Quake 4 integrated with DoomRTX

This commit is contained in:
Justin Marshall
2026-05-09 22:10:40 -07:00
parent 8c4a087aa9
commit d37f87e493
436 changed files with 277587 additions and 10254 deletions
+51 -33
View File
@@ -2,9 +2,9 @@
===========================================================================
IceTech GPL Source Code
Copyright (C) 2026 Justin Marshall
Copyright (C) 2026 Justin Marshall
This file is part of the IceTech GPL Source Code (?IceTech Source Code?).
This file is part of the IceTech GPL Source Code (?IceTech Source Code?).
IceTech Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -49,68 +49,86 @@ const int NUM_DECAL_BOUNDING_PLANES = 6;
typedef struct decalProjectionInfo_s {
idVec3 projectionOrigin;
idBounds projectionBounds;
idPlane boundingPlanes[6];
idPlane boundingPlanes[NUM_DECAL_BOUNDING_PLANES];
idPlane fadePlanes[2];
idPlane textureAxis[2];
const idMaterial * material;
const idMaterial* material;
bool parallel;
float fadeDepth;
int startTime;
#ifdef QUAKE4
float maxAngle;
#endif
bool force;
} decalProjectionInfo_t;
class idRenderModelDecal {
public:
idRenderModelDecal( void );
~idRenderModelDecal( void );
idRenderModelDecal(void);
~idRenderModelDecal(void);
static idRenderModelDecal * Alloc( void );
static void Free( idRenderModelDecal *decal );
static idRenderModelDecal* Alloc(void);
static void Free(idRenderModelDecal* decal);
// Creates decal projection info.
static bool CreateProjectionInfo( decalProjectionInfo_t &info, const idFixedWinding &winding, const idVec3 &projectionOrigin, const bool parallel, const float fadeDepth, const idMaterial *material, const int startTime );
// Creates decal projection info.
static bool CreateProjectionInfo(decalProjectionInfo_t& info, const idFixedWinding& winding, const idVec3& projectionOrigin, const bool parallel, const float fadeDepth, const idMaterial* material, const int startTime);
// Transform the projection info from global space to local.
static void GlobalProjectionInfoToLocal( decalProjectionInfo_t &localInfo, const decalProjectionInfo_t &info, const idVec3 &origin, const idMat3 &axis );
// Transform the projection info from global space to local.
static void GlobalProjectionInfoToLocal(decalProjectionInfo_t& localInfo, const decalProjectionInfo_t& info, const idVec3& origin, const idMat3& axis);
// Creates a deal on the given model.
void CreateDecal( const idRenderModel *model, const decalProjectionInfo_t &localInfo );
// Creates a decal on the given model.
void CreateDecal(const idRenderModel* model, const decalProjectionInfo_t& localInfo);
// Remove decals that are completely faded away.
static idRenderModelDecal * RemoveFadedDecals( idRenderModelDecal *decals, int time );
// Remove decals that are completely faded away.
static idRenderModelDecal* RemoveFadedDecals(idRenderModelDecal* decals, int time);
// Updates the vertex colors, removing any faded indexes,
// then copy the verts to temporary vertex cache and adds a drawSurf.
void AddDecalDrawSurf( struct viewEntity_s *space );
// Updates the vertex colors, removing any faded indexes,
// then copy the verts to temporary vertex cache and adds a drawSurf.
void AddDecalDrawSurf(struct viewEntity_s* space);
// Returns the next decal in the chain.
idRenderModelDecal * Next( void ) const { return nextDecal; }
// Returns the next decal in the chain.
idRenderModelDecal* Next(void) const { return nextDecal; }
void ReadFromDemoFile( class idDemoFile *f );
void WriteToDemoFile( class idDemoFile *f ) const;
void ReadFromDemoFile(class idDemoFile* f);
void WriteToDemoFile(class idDemoFile* f) const;
#ifdef QUAKE4
static int GetAllocatedDecalCount(void) { return allocatedDecalCount; }
#endif
private:
static const int MAX_DECAL_VERTS = 40;
static const int MAX_DECAL_INDEXES = 60;
const idMaterial * material;
#ifdef QUAKE4
static int allocatedDecalCount;
#endif
const idMaterial* material;
srfTriangles_t tri;
idDrawVert verts[MAX_DECAL_VERTS];
float vertDepthFade[MAX_DECAL_VERTS];
#ifdef QUAKE4
float vertLifeSpan[MAX_DECAL_VERTS];
#endif
glIndex_t indexes[MAX_DECAL_INDEXES];
#ifdef QUAKE4
float indexStartTime[MAX_DECAL_INDEXES];
#else
int indexStartTime[MAX_DECAL_INDEXES];
idRenderModelDecal * nextDecal;
#endif
idRenderModelDecal* nextDecal;
// Adds the winding triangles to the appropriate decal in the
// chain, creating a new one if necessary.
void AddWinding( const idWinding &w, const idMaterial *decalMaterial, const idPlane fadePlanes[2], float fadeDepth, int startTime );
// Adds the winding triangles to the appropriate decal in the
// chain, creating a new one if necessary.
void AddWinding(const idWinding& w, const idMaterial* decalMaterial, const idPlane fadePlanes[2], float fadeDepth, int startTime);
// Adds depth faded triangles for the winding to the appropriate
// decal in the chain, creating a new one if necessary.
// The part of the winding at the front side of both fade planes is not faded.
// The parts at the back sides of the fade planes are faded with the given depth.
void AddDepthFadedWinding( const idWinding &w, const idMaterial *decalMaterial, const idPlane fadePlanes[2], float fadeDepth, int startTime );
// Adds depth faded triangles for the winding to the appropriate
// decal in the chain, creating a new one if necessary.
// The part of the winding at the front side of both fade planes is not faded.
// The parts at the back sides of the fade planes are faded with the given depth.
void AddDepthFadedWinding(const idWinding& w, const idMaterial* decalMaterial, const idPlane fadePlanes[2], float fadeDepth, int startTime);
};
#endif /* !__MODELDECAL_H__ */