Skip to content

Commit

Permalink
[rend2-sp] Some g2 gore code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SomaZ committed Apr 26, 2024
1 parent 7c21d86 commit 90ee6f7
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions code/rd-rend2/G2_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int goreModelIndex;
static cvar_t *cg_g2MarksAllModels=NULL;


static inline void DestroyGoreTexCoordinates(int tag)
static inline void DestroyR2GoreTexCoordinates(int tag)
{
R2GoreTextureCoordinates* gTC = FindR2GoreRecord(tag);
if (!gTC)
Expand Down Expand Up @@ -113,29 +113,14 @@ R2GoreTextureCoordinates* FindR2GoreRecord(int tag)
return 0;
}

GoreTextureCoordinates* FindGoreRecord(int tag)
{
std::map<int, R2GoreTextureCoordinates>::iterator i = GoreRecords.find(tag);
if (i != GoreRecords.end())
{
return (GoreTextureCoordinates*)(&(*i).second);
}
return 0;
}

void *G2_GetGoreRecord(int tag)
{
return FindGoreRecord(tag);
return FindR2GoreRecord(tag);
}

void DeleteR2GoreRecord(int tag)
{
DeleteGoreRecord(tag);
}

void DeleteGoreRecord(int tag)
{
DestroyGoreTexCoordinates(tag);
DestroyR2GoreTexCoordinates(tag);
GoreRecords.erase(tag);
}

Expand Down Expand Up @@ -183,7 +168,7 @@ CGoreSet::~CGoreSet()
std::multimap<int,SGoreSurface>::iterator i;
for (i=mGoreRecords.begin();i!=mGoreRecords.end();i++)
{
DeleteGoreRecord((*i).second.mGoreTag);
DeleteR2GoreRecord((*i).second.mGoreTag);
}
};
#endif // _SOF2
Expand Down

0 comments on commit 90ee6f7

Please sign in to comment.