cleanup r_things a little

This commit is contained in:
Alug committed 2024-07-21 22:24:21 +02:00
1 parent 6b4d02ae99
commit a771ebf0e8
1 file changed
+19 -36
+19 -36
View File
@@ -38,12 +38,6 @@
#include "qs22j.h"
#ifdef PC_DOS
#include <stdio.h> // for snprintf
int snprintf(char *str, size_t n, const char *fmt, ...);
//int vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
#endif
CV_PossibleValue_t Forceskin_cons_t[MAXSKINS+2];
static void R_InitSkins(void);
@@ -532,15 +526,6 @@ void R_InitSprites(void)
R_AddSkins((UINT16)i, false);
R_LoadSpriteInfoLumps(i, wadfiles[i]->numlumps);
}
//
// check if all sprites have frames
//
/*
for (i = 0; i < numsprites; i++)
if (sprites[i].numframes < 1)
CONS_Debug(DBG_SETUP, "R_InitSprites: sprite %s has no frames at all\n", sprnames[i]);
*/
}
//
@@ -1034,13 +1019,6 @@ static void R_SplitSprite(vissprite_t *sprite, mobj_t *thing)
newsprite->extra_colormap = sector->lightlist[i].extra_colormap;
/*
if (thing->frame & FF_TRANSMASK)
;
else if (thing->flags2 & MF2_SHADOW)
;
else
*/
if (!((thing->frame & (FF_FULLBRIGHT|FF_TRANSMASK) || thing->flags2 & MF2_SHADOW)
&& (!newsprite->extra_colormap || !(newsprite->extra_colormap->fog & 1))))
{
@@ -1068,6 +1046,7 @@ fixed_t R_GetShadowZ(mobj_t *thing, pslope_t **shadowslope)
msecnode_t *node;
sector_t *sector;
ffloor_t *rover;
#define CHECKZ (isflipped ? z > thing->z+thing->height/2 && z < groundz : z < thing->z+thing->height/2 && z > groundz)
for (node = thing->touching_sectorlist; node; node = node->m_sectorlist_next)
@@ -1347,7 +1326,7 @@ static void R_ProjectSprite(mobj_t *thing)
rollangle = thing->rollangle;
}
if ((rollangle) || (pitchnroll) || (thing->player && thing->player->sliproll))
if (rollangle || pitchnroll || (thing->player && thing->player->sliproll))
{
rollsum = pitchnroll;
@@ -1585,7 +1564,8 @@ static void R_ProjectSprite(mobj_t *thing)
for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) {
fixed_t h = thing->subsector->sector->lightlist[lightnum].slope ? P_GetZAt(thing->subsector->sector->lightlist[lightnum].slope, interp.x, interp.y)
: thing->subsector->sector->lightlist[lightnum].height;
if (h <= gzt) {
if (h <= gzt)
{
light = lightnum - 1;
break;
}
@@ -3171,12 +3151,15 @@ void SetLocalPlayerSkin(INT32 playernum, const char *skinname, consvar_t *cvar)
}
}
if (cvar != NULL) {
if (player->localskin > 0) {
if (cvar != NULL)
{
if (player->localskin > 0)
{
CV_StealthSet(&cv_fakelocalskin, ( (player->skinlocal) ? localskins : skins )[player->localskin - 1].name);
CV_StealthSet(cvar, ( (player->skinlocal) ? localskins : skins )[player->localskin - 1].name);
}
else {
else
{
CV_StealthSet(&cv_fakelocalskin, "none");
CV_StealthSet(cvar, "none");
}
@@ -3634,8 +3617,8 @@ next_token:
CONS_Printf(M_GetText("Added skin '%s'\n"), skin->name);
#ifdef SKINVALUES
( (local) ? localskin_cons_t : skin_cons_t )[( (local) ? numlocalskins : numskins )].value = ( (local) ? numlocalskins : numskins );
( (local) ? localskin_cons_t : skin_cons_t )[( (local) ? numlocalskins : numskins )].strvalue = skin->name;
(local ? localskin_cons_t : skin_cons_t)[(local ? numlocalskins : numskins)].value = (local ? numlocalskins : numskins);
(local ? localskin_cons_t : skin_cons_t)[(local ? numlocalskins : numskins)].strvalue = skin->name;
#endif
// Update the forceskin possiblevalues
@@ -3646,6 +3629,7 @@ next_token:
}
skin->localskin = local;
// so we dont have to guess
if (local)
skin->localnum = numlocalskins;
@@ -3653,28 +3637,27 @@ next_token:
skin->localnum = numskins;
// add face graphics
if (local) {
if (local)
ST_LoadLocalFaceGraphics(skin->facerank, skin->facewant, skin->facemmap, numlocalskins);
} else {
else
ST_LoadFaceGraphics(skin->facerank, skin->facewant, skin->facemmap, numskins);
}
#ifdef HWRENDER
if (rendermode == render_opengl)
HWR_AddPlayerMD2(( (local) ? numlocalskins : numskins ), local);
HWR_AddPlayerMD2(((local) ? numlocalskins : numskins), local);
#endif
if (!local) {
if (!local)
{
skinstats[skin->kartspeed-1][skin->kartweight-1][skinstatscount[skin->kartspeed-1][skin->kartweight-1]] = numskins;
CONS_Debug(DBG_SETUP, M_GetText("Added %d to %d, %d\n"), numskins, skin->kartweight, skin->kartweight);
skinstatscount[skin->kartspeed-1][skin->kartweight-1]++;
CONS_Debug(DBG_SETUP, M_GetText("Incremented %d, %d to %d\n"), skin->kartspeed, skin->kartweight, skinstatscount[skin->kartspeed - 1][skin->kartweight - 1]);
skinsorted[numskins] = numskins;
}
allskins[numallskins] = ( (local) ? localskins : skins )[( (local) ? numlocalskins : numskins )];
( (local) ? numlocalskins++ : numskins++ );
local ? numlocalskins++ : numskins++;
numallskins++;
}