Skip to content

Commit

Permalink
[Meta] trim EOL whitespace (JACoders#1202)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4547d40)
  • Loading branch information
Razish authored and taysta committed Feb 26, 2024
1 parent 6096114 commit 734e62a
Show file tree
Hide file tree
Showing 61 changed files with 1,088 additions and 1,091 deletions.
4 changes: 2 additions & 2 deletions codemp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ if(BuildMPEngine OR BuildMPDed)
"${MPDir}/qcommon/qcommon.h"
"${MPDir}/qcommon/qfiles.h"
"${MPDir}/qcommon/tags.h"

${SharedCommonFiles}
)
source_group("common" FILES ${MPBotlibCommonFiles})
Expand Down Expand Up @@ -298,7 +298,7 @@ if(BuildMPEngine OR BuildMPDed)
endif(WIN32)
source_group("common" FILES ${MPEngineAndDedCommonFiles})
set(MPEngineAndDedFiles ${MPEngineAndDedFiles} ${MPEngineAndDedCommonFiles})

set(MPEngineAndDedCommonSafeFiles
"${SharedDir}/qcommon/safe/files.cpp"
"${SharedDir}/qcommon/safe/files.h"
Expand Down
2 changes: 1 addition & 1 deletion codemp/client/cl_uiapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static qboolean CL_G2API_HaveWeGhoul2Models( void *ghoul2) {
static qboolean CL_G2API_GetBoltMatrix( void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix, const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale ) {
if ( !ghoul2 ) {
return qfalse;

}
return re->G2API_GetBoltMatrix( *((CGhoul2Info_v *)ghoul2), modelIndex, boltIndex, matrix, angles, position, frameNum, modelList, scale );
}
Expand Down
2 changes: 1 addition & 1 deletion codemp/game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ set(MPGameCommonFiles
"${MPDir}/qcommon/disablewarnings.h"
"${MPDir}/qcommon/q_shared.h"
"${MPDir}/qcommon/tags.h"

${SharedCommonFiles}
)
source_group("common" FILES ${MPGameCommonFiles})
Expand Down
14 changes: 7 additions & 7 deletions codemp/qcommon/cvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,11 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, uint32_t flags, c
return var;
}

static void Cvar_QSortByName( cvar_t **a, int n )
static void Cvar_QSortByName( cvar_t **a, int n )
{
cvar_t *temp;
cvar_t *m;
int i, j;
int i, j;

i = 0;
j = n;
Expand All @@ -534,10 +534,10 @@ static void Cvar_QSortByName( cvar_t **a, int n )
while ( strcmp( a[j]->name, m->name ) < 0 ) j--;

if ( i <= j ) {
temp = a[i];
a[i] = a[j];
temp = a[i];
a[i] = a[j];
a[j] = temp;
i++;
i++;
j--;
}
} while ( i <= j );
Expand All @@ -547,7 +547,7 @@ static void Cvar_QSortByName( cvar_t **a, int n )
}


static void Cvar_Sort( void )
static void Cvar_Sort( void )
{
cvar_t *list[ MAX_CVARS ], *var;
int count;
Expand All @@ -566,7 +566,7 @@ static void Cvar_Sort( void )
}

Cvar_QSortByName( &list[0], count-1 );

cvar_vars = NULL;

// relink cvars
Expand Down
32 changes: 16 additions & 16 deletions codemp/rd-rend2/G2_API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ qboolean G2API_OverrideServerWithClientData(CGhoul2Info_v& ghoul2, int modelInde
static size_t GetSizeOfGhoul2Info ( const CGhoul2Info& g2Info )
{
size_t size = 0;

// This is pretty ugly, but we don't want to save everything in the CGhoul2Info object.
size += offsetof (CGhoul2Info, mTransformedVertsArray) - offsetof (CGhoul2Info, mModelindex);

Expand All @@ -312,7 +312,7 @@ static size_t SerializeGhoul2Info ( char *buffer, const CGhoul2Info& g2Info )
{
char *base = buffer;
size_t blockSize;

// Oh the ugliness...
blockSize = offsetof (CGhoul2Info, mTransformedVertsArray) - offsetof (CGhoul2Info, mModelindex);
memcpy (buffer, &g2Info.mModelindex, blockSize);
Expand All @@ -329,15 +329,15 @@ static size_t SerializeGhoul2Info ( char *buffer, const CGhoul2Info& g2Info )
// Bones vector + size
*(int *)buffer = g2Info.mBlist.size();
buffer += sizeof (int);

blockSize = g2Info.mBlist.size() * sizeof (boneInfo_t);
memcpy (buffer, g2Info.mBlist.data(), g2Info.mBlist.size() * sizeof (boneInfo_t));
buffer += blockSize;

// Bolts vector + size
*(int *)buffer = g2Info.mBltlist.size();
buffer += sizeof (int);

blockSize = g2Info.mBltlist.size() * sizeof (boltInfo_t);
memcpy (buffer, g2Info.mBltlist.data(), g2Info.mBltlist.size() * sizeof (boltInfo_t));
buffer += blockSize;
Expand Down Expand Up @@ -420,7 +420,7 @@ class Ghoul2InfoArray : public IGhoul2InfoArray

size_t GetSerializedSize() const
{
size_t size = 0;
size_t size = 0;

size += sizeof (int); // size of mFreeIndecies linked list
size += mFreeIndecies.size() * sizeof (int);
Expand Down Expand Up @@ -495,7 +495,7 @@ class Ghoul2InfoArray : public IGhoul2InfoArray
buffer += sizeof (int);

mInfos[i].resize (count);

for ( size_t j = 0; j < count; j++ )
{
buffer += DeserializeGhoul2Info (buffer, mInfos[i][j]);
Expand Down Expand Up @@ -548,7 +548,7 @@ class Ghoul2InfoArray : public IGhoul2InfoArray
Com_Error(ERR_FATAL, "Out of ghoul2 info slots");

}
// gonna pull from the front, doing a
// gonna pull from the front, doing a
int idx=*mFreeIndecies.begin();
mFreeIndecies.erase(mFreeIndecies.begin());
return mIds[idx];
Expand Down Expand Up @@ -585,7 +585,7 @@ class Ghoul2InfoArray : public IGhoul2InfoArray
assert((handle&G2_INDEX_MASK)>=0&&(handle&G2_INDEX_MASK)<MAX_G2_MODELS); //junk handle
assert(mIds[handle&G2_INDEX_MASK]==handle); // not a valid handle, could be old or garbage
assert(!(handle<=0||(handle&G2_INDEX_MASK)<0||(handle&G2_INDEX_MASK)>=MAX_G2_MODELS||mIds[handle&G2_INDEX_MASK]!=handle));

return mInfos[handle&G2_INDEX_MASK];
}
const std::vector<CGhoul2Info> &Get(int handle) const
Expand Down Expand Up @@ -747,7 +747,7 @@ void G2API_CleanGhoul2Models(CGhoul2Info_v **ghoul2Ptr)

delete *ghoul2Ptr;
*ghoul2Ptr = NULL;
}
}
}

qboolean G2_ShouldRegisterServer(void)
Expand Down Expand Up @@ -822,7 +822,7 @@ int G2API_InitGhoul2Model(CGhoul2Info_v **ghoul2Ptr, const char *fileName, int m
if (model==ghoul2.size())
{ //init should not be used to create additional models, only the first one
assert(ghoul2.size() < 4); //use G2API_CopySpecificG2Model to add models
ghoul2.push_back(CGhoul2Info());
ghoul2.push_back(CGhoul2Info());
}

strcpy(ghoul2[model].mFileName, fileName);
Expand Down Expand Up @@ -1291,7 +1291,7 @@ qboolean G2API_SetBoneAnim(CGhoul2Info_v &ghoul2, const int modelIndex, const ch
CGhoul2Info *ghlInfo = &ghoul2[modelIndex];
qboolean setPtrs = qfalse;
qboolean res = qfalse;

//rww - RAGDOLL_BEGIN
if (ghlInfo)
{
Expand Down Expand Up @@ -2274,7 +2274,7 @@ void G2API_SetGhoul2ModelIndexes(
// broken into 3 lines for debugging, STL is a pain to view...
//
int iModelIndex = ghoul2[i].mModelindex;
qhandle_t mModel = modelList[iModelIndex];
qhandle_t mModel = modelList[iModelIndex];
ghoul2[i].mModel = mModel;

ghoul2[i].mSkin = skinList[ghoul2[i].mCustomSkin];
Expand Down Expand Up @@ -2600,7 +2600,7 @@ int G2API_CopyGhoul2Instance(CGhoul2Info_v &g2From, CGhoul2Info_v &g2To, int mod
{
assert(modelIndex==-1); // copy individual bolted parts is not used in jk2 and I didn't want to deal with it
// if ya want it, we will add it back correctly

//G2ERROR(ghoul2From.IsValid(),"Invalid ghlInfo");
if (g2From.IsValid())
{
Expand Down Expand Up @@ -2709,7 +2709,7 @@ void G2API_DuplicateGhoul2Instance(CGhoul2Info_v &g2From, CGhoul2Info_v **g2To)
CGhoul2Info_v &ghoul2 = *(*g2To);

/*ignore = */G2API_CopyGhoul2Instance(g2From, ghoul2, -1);

return;
}

Expand Down Expand Up @@ -2874,7 +2874,7 @@ qboolean G2API_SkinlessModel(CGhoul2Info_v& ghoul2, int modelIndex)

surf = (mdxmSurfHierarchy_t *) ( (byte *)mdxm + mdxm->ofsSurfHierarchy );

for (i = 0; i < mdxm->numSurfaces; i++)
for (i = 0; i < mdxm->numSurfaces; i++)
{
if (surf->shader[0])
{ //found a surface with a shader name, ok.
Expand Down Expand Up @@ -3070,7 +3070,7 @@ qboolean G2_SetupModelPointers(CGhoul2Info *ghlInfo) // returns true if the mode

// RJ - experimental optimization!
if (!ghlInfo->mModel || 1)
{
{
if (ri.Cvar_VariableIntegerValue( "dedicated" ) ||
(G2_ShouldRegisterServer())) //supreme hackery!
{
Expand Down
12 changes: 6 additions & 6 deletions codemp/rd-rend2/G2_bolts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int G2_Find_Bolt_Surface_Num(boltInfo_v &bltlist, const int surfaceNum, const in
// didn't find it
return -1;
}

//=========================================================================================
//// Public Bolt Routines
int G2_Add_Bolt_Surf_Num(CGhoul2Info *ghlInfo, boltInfo_v &bltlist, surfaceInfo_v &slist, const int surfNum)
Expand All @@ -74,7 +74,7 @@ int G2_Add_Bolt_Surf_Num(CGhoul2Info *ghlInfo, boltInfo_v &bltlist, surfaceInfo_
}
}

// we have a surface
// we have a surface
// look through entire list - see if it's already there first
for(size_t i=0; i<bltlist.size(); i++)
{
Expand All @@ -88,7 +88,7 @@ int G2_Add_Bolt_Surf_Num(CGhoul2Info *ghlInfo, boltInfo_v &bltlist, surfaceInfo_
return i;
}
}

// ok, we didn't find an existing surface of that name, or an empty slot. Lets add an entry
tempBolt.surfaceNumber = surfNum;
tempBolt.surfaceType = G2SURFACEFLAG_GENERATED;
Expand Down Expand Up @@ -141,7 +141,7 @@ int G2_Add_Bolt(CGhoul2Info *ghlInfo, boltInfo_v &bltlist, surfaceInfo_v &slist,
return i;
}
}

// ok, we didn't find an existing surface of that name, or an empty slot. Lets add an entry
tempBolt.surfaceNumber = surfNum;
tempBolt.boneNumber = -1;
Expand Down Expand Up @@ -203,7 +203,7 @@ int G2_Add_Bolt(CGhoul2Info *ghlInfo, boltInfo_v &bltlist, surfaceInfo_v &slist,
return i;
}
}

// ok, we didn't find an existing bone of that name, or an empty slot. Lets add an entry
tempBolt.boneNumber = x;
tempBolt.surfaceNumber = -1;
Expand Down Expand Up @@ -264,7 +264,7 @@ void G2_Init_Bolt_List(boltInfo_v &bltlist)
bltlist.clear();
}

// remove any bolts that reference original surfaces, generated surfaces, or bones that aren't active anymore
// remove any bolts that reference original surfaces, generated surfaces, or bones that aren't active anymore
void G2_RemoveRedundantBolts(boltInfo_v &bltlist, surfaceInfo_v &slist, int *activeSurfaces, int *activeBones)
{
// walk the bolt list
Expand Down
Loading

0 comments on commit 734e62a

Please sign in to comment.