port over most fixes from srb2classics clang-tidy pr
Based on 939354f483
This commit is contained in:
parent
166648f008
commit
ff467c676c
21 changed files with 86 additions and 100 deletions
|
|
@ -265,6 +265,11 @@ static void AM_findMinMaxBoundaries(void)
|
|||
max_w = minimapinfo.map_w << MAPBITS;
|
||||
max_h = minimapinfo.map_h << MAPBITS;
|
||||
|
||||
if (max_w == 0)
|
||||
max_w = 1;
|
||||
if (max_h == 0)
|
||||
max_h = 1;
|
||||
|
||||
a = FixedDiv(f_w<<FRACBITS, max_w);
|
||||
b = FixedDiv(f_h<<FRACBITS, max_h);
|
||||
|
||||
|
|
@ -352,7 +357,9 @@ static void AM_LevelInit(void)
|
|||
AM_findMinMaxBoundaries();
|
||||
scale_mtof = FixedDiv(min_scale_mtof*10, 7*FRACUNIT);
|
||||
if (scale_mtof > max_scale_mtof)
|
||||
scale_mtof = min_scale_mtof;
|
||||
scale_mtof = max_scale_mtof;
|
||||
if (scale_mtof == 0)
|
||||
scale_mtof = 1;
|
||||
scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -797,12 +797,10 @@ static void COM_CEcho_f(void)
|
|||
|
||||
for (i = 1; i < COM_Argc(); i++)
|
||||
{
|
||||
strncat(cechotext, COM_Argv(i), sizeof(cechotext)-1);
|
||||
strncat(cechotext, " ", sizeof(cechotext)-1);
|
||||
strlcpy(cechotext, COM_Argv(i), sizeof(cechotext)-1);
|
||||
strlcpy(cechotext, " ", sizeof(cechotext)-1);
|
||||
}
|
||||
|
||||
cechotext[sizeof(cechotext) - 1] = '\0';
|
||||
|
||||
HU_DoCEcho(cechotext);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5627,7 +5627,7 @@ retryscramble:
|
|||
memset(&scrambleplayers, 0, sizeof(scrambleplayers));
|
||||
memset(&scrambleteams, 0, sizeof(scrambleplayers));
|
||||
scrambletotal = scramblecount = 0;
|
||||
blue = red = maxcomposition = newteam = playercount = 0;
|
||||
blue = red = newteam = playercount = 0;
|
||||
repick = true;
|
||||
|
||||
// Put each player's node in the array.
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ void readskincolor(MYFILE *f, INT32 num, boolean mainfile)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
|
||||
if (fastcmp(word, "NAME"))
|
||||
{
|
||||
|
|
@ -867,7 +867,7 @@ void readlevelheader(MYFILE *f, char * name)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
i = atoi(word2); // used for numerical settings
|
||||
|
||||
|
||||
|
|
@ -1947,7 +1947,7 @@ static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
//strupr(word2);
|
||||
|
||||
if (fastcmp(word, "X"))
|
||||
|
|
@ -2525,7 +2525,7 @@ void readsound(MYFILE *f, INT32 num)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
value = atoi(word2); // used for numerical settings
|
||||
|
||||
if (fastcmp(word, "SINGULAR"))
|
||||
|
|
@ -2631,7 +2631,7 @@ void reademblemdata(MYFILE *f, INT32 num)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
value = atoi(word2); // used for numerical settings
|
||||
|
||||
// Up here to allow lowercase in hints
|
||||
|
|
@ -2738,7 +2738,7 @@ void readextraemblemdata(MYFILE *f, INT32 num)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
|
||||
value = atoi(word2); // used for numerical settings
|
||||
|
||||
|
|
@ -2821,7 +2821,7 @@ void readunlockable(MYFILE *f, INT32 num)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
|
||||
i = atoi(word2); // used for numerical settings
|
||||
|
||||
|
|
@ -3082,7 +3082,7 @@ void readconditionset(MYFILE *f, UINT8 setnum)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
strupr(word2);
|
||||
|
||||
if (fastncmp(word, "CONDITION", 9))
|
||||
|
|
@ -3146,7 +3146,7 @@ void readmaincfg(MYFILE *f)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
strupr(word2);
|
||||
|
||||
value = atoi(word2); // used for numerical settings
|
||||
|
|
@ -3437,7 +3437,7 @@ void readwipes(MYFILE *f)
|
|||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
char *word = s;
|
||||
char *pword = word;
|
||||
char *pword;
|
||||
char *word2;
|
||||
char *tmp;
|
||||
INT32 value;
|
||||
|
|
@ -3470,7 +3470,7 @@ void readwipes(MYFILE *f)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
value = atoi(word2); // used for numerical settings
|
||||
|
||||
if (value < -1 || value > 99)
|
||||
|
|
@ -3615,7 +3615,7 @@ void readcupheader(MYFILE *f, cupheader_t *cup)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
i = atoi(word2); // used for numerical settings
|
||||
strupr(word2);
|
||||
|
||||
|
|
@ -4009,7 +4009,7 @@ void readweather(MYFILE *f, INT32 num)
|
|||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
word2 = tmp + 2;
|
||||
|
||||
if (fastcmp(word, "TYPE"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -373,10 +373,13 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
|||
Z_Free(dirmenu);
|
||||
dirmenu = NULL;
|
||||
|
||||
for (; sizecoredirmenu > 0; sizecoredirmenu--) // clear out existing items
|
||||
if (coredirmenu != NULL)
|
||||
{
|
||||
Z_Free(coredirmenu[sizecoredirmenu-1]);
|
||||
coredirmenu[sizecoredirmenu-1] = NULL;
|
||||
for (; sizecoredirmenu > 0; sizecoredirmenu--) // clear out existing items
|
||||
{
|
||||
Z_Free(coredirmenu[sizecoredirmenu-1]);
|
||||
coredirmenu[sizecoredirmenu-1] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
while (true)
|
||||
|
|
|
|||
|
|
@ -5403,8 +5403,6 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
|
|||
if (!( realmapname = G_BuildMapTitle(mapnum) ))
|
||||
continue;
|
||||
|
||||
aprop = realmapname;
|
||||
|
||||
/* Now that we found a perfect match no need to fucking guess. */
|
||||
if (strnicmp(realmapname, mapname, mapnamelen) == 0)
|
||||
{
|
||||
|
|
@ -5433,6 +5431,7 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
|
|||
writesimplefreq(freq, &freqc,
|
||||
mapnum, aprop - realmapname, mapnamelen);
|
||||
}
|
||||
|
||||
if (apromapnum == 0)
|
||||
{
|
||||
apromapnum = mapnum;
|
||||
|
|
|
|||
|
|
@ -1572,7 +1572,9 @@ static void HWR_CacheFadeMask(GLMipmap_t *grMipmap, lumpnum_t fademasklumpnum)
|
|||
break;
|
||||
default: // Bad lump
|
||||
CONS_Alert(CONS_WARNING, "Fade mask lump of incorrect size, ignored\n"); // I should avoid this by checking the lumpnum in HWR_RunWipe
|
||||
break;
|
||||
fmwidth = 0;
|
||||
fmheight = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// Thankfully, this will still work for this scenario
|
||||
|
|
|
|||
|
|
@ -3386,7 +3386,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
tmult = (tbot - ttop) / (top - bot);
|
||||
|
||||
endrealtop = endtop = baseWallVerts[2].y;
|
||||
endrealbot = endbot = baseWallVerts[1].y;
|
||||
endrealbot = baseWallVerts[1].y;
|
||||
|
||||
// copy the contents of baseWallVerts into the drawn wallVerts array
|
||||
// baseWallVerts is used to know the final shape to easily get the vertex
|
||||
|
|
@ -5484,8 +5484,6 @@ void HWR_BuildSkyDome(void)
|
|||
sky->loops[sky->loopcount].use_texture = false;
|
||||
sky->loopcount++;
|
||||
|
||||
delta = 0.0f;
|
||||
|
||||
for (c = 0; c < col_count; c++)
|
||||
{
|
||||
HWR_SkyDomeVertex(sky, vertex_p, 1, c, yflip, 0.0f, true);
|
||||
|
|
|
|||
|
|
@ -1007,25 +1007,7 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
|
|||
continue;
|
||||
}
|
||||
|
||||
firsti = 0;
|
||||
mul = 0;
|
||||
mulmax = 1;
|
||||
|
||||
/*for (i = 0; i < translen; i++)
|
||||
{
|
||||
if (brightness > colorbrightnesses[i]) // don't allow greater matches (because calculating a makeshift gradient for this is already a huge mess as is)
|
||||
continue;
|
||||
|
||||
compare = abs((INT16)(colorbrightnesses[i]) - (INT16)(brightness));
|
||||
|
||||
if (compare < brightdif)
|
||||
{
|
||||
brightdif = (UINT16)compare;
|
||||
firsti = i; // best matching color that's equal brightness or darker
|
||||
}
|
||||
}*/
|
||||
firsti = color_match_lookup[brightness];
|
||||
|
||||
secondi = firsti+1; // next color in line
|
||||
|
||||
m = (INT16)brightness - (INT16)colorbrightnesses[secondi];
|
||||
|
|
@ -1360,10 +1342,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
FTransform p;
|
||||
FSurfaceInfo Surf;
|
||||
|
||||
if (!cv_glmodels.value)
|
||||
return false;
|
||||
|
||||
if (spr->precip)
|
||||
if (!cv_glmodels.value || spr->precip)
|
||||
return false;
|
||||
|
||||
// Lactozilla: Disallow certain models from rendering
|
||||
|
|
|
|||
|
|
@ -784,7 +784,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
|| target == 0 // To everyone
|
||||
|| consoleplayer == target-1) // To you
|
||||
{
|
||||
const char *prefix = "", *cstart = "", *cend = "", *adminchar = "\x82~\x83", *remotechar = "\x82@\x83", *fmt2, *textcolor = "\x80";
|
||||
const char *prefix, *cstart, *adminchar = "\x82~\x83", *remotechar = "\x82@\x83", *fmt2, *textcolor = "\x80";
|
||||
char *tempchar = NULL;
|
||||
char color_prefix[2];
|
||||
|
||||
|
|
@ -877,13 +877,13 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
// name, color end, and the message itself.
|
||||
// '\4' makes the message yellow and beeps; '\3' just beeps.
|
||||
if (action)
|
||||
fmt2 = "* %s%s%s%s \x82%s%s";
|
||||
fmt2 = "* %s%s%s %s%s";
|
||||
else if (target-1 == consoleplayer) // To you
|
||||
{
|
||||
prefix = "\x82[PM]";
|
||||
cstart = "\x82";
|
||||
textcolor = "\x82";
|
||||
fmt2 = "%s<%s%s>%s\x80 %s%s";
|
||||
fmt2 = "%s<%s%s> %s%s";
|
||||
}
|
||||
else if (target > 0) // By you, to another player
|
||||
{
|
||||
|
|
@ -891,11 +891,11 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
dispname = player_names[target-1];
|
||||
prefix = "\x82[TO]";
|
||||
cstart = "\x82";
|
||||
fmt2 = "%s<%s%s>%s\x80 %s%s";
|
||||
fmt2 = "%s<%s%s> %s%s";
|
||||
|
||||
}
|
||||
else // To everyone or sayteam, it doesn't change anything.
|
||||
fmt2 = "%s<%s%s%s>\x80 %s%s";
|
||||
fmt2 = "%s<%s%s> %s%s";
|
||||
/*else // To your team
|
||||
{
|
||||
if (players[playernum].ctfteam == 1) // red
|
||||
|
|
@ -908,7 +908,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
fmt2 = "%s<%s%s>\x80%s %s%s";
|
||||
}*/
|
||||
|
||||
HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg), (cv_chatnotifications.value) && !(flags & HU_SHOUT)); // add to chat
|
||||
HU_AddChatText(va(fmt2, prefix, cstart, dispname, textcolor, msg), (cv_chatnotifications.value) && !(flags & HU_SHOUT)); // add to chat
|
||||
|
||||
if ((cv_chatnotifications.value) && (flags & HU_SHOUT))
|
||||
S_StartSound(NULL, sfx_sysmsg);
|
||||
|
|
|
|||
|
|
@ -755,12 +755,12 @@ fixed_t FV3_Normal(const vector3_t *a_triangle, vector3_t *a_normal)
|
|||
fixed_t FV3_Strength(const vector3_t *a_1, const vector3_t *dir)
|
||||
{
|
||||
vector3_t normal;
|
||||
fixed_t dist = FV3_NormalizeEx(a_1, &normal);
|
||||
FV3_NormalizeEx(a_1, &normal);
|
||||
fixed_t dot = FV3_Dot(&normal, dir);
|
||||
|
||||
FV3_ClosestPointOnVector(dir, a_1, &normal);
|
||||
|
||||
dist = FV3_Magnitude(&normal);
|
||||
fixed_t dist = FV3_Magnitude(&normal);
|
||||
|
||||
if (dot < 0) // Not facing same direction, so negate result.
|
||||
dist = -dist;
|
||||
|
|
|
|||
|
|
@ -1625,6 +1625,10 @@ void M_DoScreenShot(void)
|
|||
palette = nullptr;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
I_Error("rendermode %d is not valid", rendermode);
|
||||
}
|
||||
|
||||
#ifdef USE_PNG
|
||||
ret = M_SavePNG(va(pandf,pathname,freename), linear, vid.width, vid.height, palette);
|
||||
|
|
|
|||
|
|
@ -6120,10 +6120,11 @@ void A_Boss3Path(mobj_t *actor)
|
|||
actor->momx = 0;
|
||||
actor->momy = 0;
|
||||
actor->momz = 0;
|
||||
P_SetTarget(&actor->target, actor->tracer->target);
|
||||
if (actor->tracer)
|
||||
P_SetTarget(&actor->target, actor->tracer->target);
|
||||
var1 = 0, var2 = 0;
|
||||
A_FaceTarget(actor);
|
||||
if (actor->tracer->state == &states[actor->tracer->info->missilestate])
|
||||
if (actor && actor->tracer && actor->tracer->state == &states[actor->tracer->info->missilestate])
|
||||
P_SetMobjState(actor, actor->info->missilestate);
|
||||
return;
|
||||
}
|
||||
|
|
@ -8331,7 +8332,7 @@ void A_SetCustomValue(mobj_t *actor)
|
|||
if (cht_debug)
|
||||
CONS_Printf("Init custom value is %d\n", actor->cusval);
|
||||
|
||||
if (locvar1 == 0 && locvar2 == 4)
|
||||
if (locvar1 == 0 && (locvar2 == 3 || locvar2 == 4))
|
||||
return; // DON'T DIVIDE BY ZERO
|
||||
|
||||
// no need for a "temp" value here, just modify the cusval directly
|
||||
|
|
@ -8389,7 +8390,7 @@ void A_UseCusValMemo(mobj_t *actor)
|
|||
tempM = actor->cvmem;
|
||||
}
|
||||
|
||||
if (tempM == 0 && locvar2 == 4)
|
||||
if (locvar1 == 0 && (locvar2 == 3 || locvar2 == 4))
|
||||
return; // DON'T DIVIDE BY ZERO
|
||||
|
||||
// now get new value for cusval/cvmem using the other
|
||||
|
|
@ -8455,7 +8456,7 @@ void A_RelayCustomValue(mobj_t *actor)
|
|||
else // tracer's custom value
|
||||
tempT = actor->tracer->cusval;
|
||||
|
||||
if (temp == 0 && locvar2 == 4)
|
||||
if (locvar1 == 0 && (locvar2 == 3 || locvar2 == 4))
|
||||
return; // DON'T DIVIDE BY ZERO
|
||||
|
||||
// now get new cusval using target's and the reference
|
||||
|
|
|
|||
|
|
@ -5565,7 +5565,7 @@ static void P_Boss9Thinker(mobj_t *mobj)
|
|||
{
|
||||
mobj_t *spawner;
|
||||
fixed_t dist = 0;
|
||||
angle = 0x06000000*leveltime;
|
||||
angle = ANGLE_135*leveltime;
|
||||
|
||||
// Alter your energy bubble's size/position
|
||||
if (mobj->health > 3)
|
||||
|
|
@ -5744,7 +5744,7 @@ static void P_Boss9Thinker(mobj_t *mobj)
|
|||
return;
|
||||
}
|
||||
|
||||
angle = 0x06000000*leveltime;
|
||||
angle = ANGLE_135*leveltime;
|
||||
mobj->momz += FixedMul(FINECOSINE(angle>>ANGLETOFINESHIFT),2*FRACUNIT); // Use that "angle" to bob gently in the air
|
||||
// This is below threshold because we don't want to bob while zipping around
|
||||
|
||||
|
|
@ -14731,7 +14731,7 @@ mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 allowai
|
|||
// angle at which you fire, is player angle
|
||||
an = angle;
|
||||
|
||||
if (allowaim) // aiming allowed?
|
||||
if (source->player && allowaim) // aiming allowed?
|
||||
slope = AIMINGTOSLOPE(source->player->aiming);
|
||||
|
||||
x = source->x;
|
||||
|
|
@ -14764,7 +14764,7 @@ mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 allowai
|
|||
th->momx = FixedMul(speed, FINECOSINE(an>>ANGLETOFINESHIFT));
|
||||
th->momy = FixedMul(speed, FINESINE(an>>ANGLETOFINESHIFT));
|
||||
|
||||
if (allowaim)
|
||||
if (source->player && allowaim)
|
||||
{
|
||||
th->momx = FixedMul(th->momx,FINECOSINE(source->player->aiming>>ANGLETOFINESHIFT));
|
||||
th->momy = FixedMul(th->momy,FINECOSINE(source->player->aiming>>ANGLETOFINESHIFT));
|
||||
|
|
|
|||
|
|
@ -110,7 +110,8 @@ extern "C" {
|
|||
*/
|
||||
typedef enum
|
||||
{
|
||||
tr_trans10 = 1,
|
||||
tr_trans0 = 0,
|
||||
tr_trans10,
|
||||
tr_trans20,
|
||||
tr_trans30,
|
||||
tr_trans40,
|
||||
|
|
|
|||
|
|
@ -8183,7 +8183,6 @@ void T_Scroll(scroll_t *s)
|
|||
|
||||
case sc_carry:
|
||||
sec = sectors + s->affectee;
|
||||
height = sec->floorheight;
|
||||
|
||||
// sec is the control sector, find the real sector(s) to use
|
||||
for (i = 0; i < sec->linecount; i++)
|
||||
|
|
@ -8260,7 +8259,6 @@ void T_Scroll(scroll_t *s)
|
|||
|
||||
case sc_carry_ceiling: // carry on ceiling (FOF scrolling)
|
||||
sec = sectors + s->affectee;
|
||||
height = sec->ceilingheight;
|
||||
|
||||
// sec is the control sector, find the real sector(s) to use
|
||||
for (i = 0; i < sec->linecount; i++)
|
||||
|
|
|
|||
|
|
@ -1001,8 +1001,9 @@ void R_AddSkins(UINT16 wadnum)
|
|||
if ((stoken[0] == '/' && stoken[1] == '/')
|
||||
|| (stoken[0] == '#'))// skip comments
|
||||
{
|
||||
stoken = strtok(NULL, "\r\n"); // skip end of line
|
||||
goto next_token; // find the real next token
|
||||
strtok(NULL, "\r\n"); // skip end of line
|
||||
stoken = strtok(NULL, "\r\n= ");
|
||||
continue; // find the real next token
|
||||
}
|
||||
|
||||
value = strtok(NULL, "\r\n= ");
|
||||
|
|
@ -1052,7 +1053,6 @@ void R_AddSkins(UINT16 wadnum)
|
|||
else if (!R_ProcessPatchableFields(skin, stoken, value))
|
||||
CONS_Debug(DBG_SETUP, "R_AddSkins: Unknown keyword '%s' in S_SKIN lump #%d (WAD %s)\n", stoken, lump, wadfiles[wadnum]->filename);
|
||||
|
||||
next_token:
|
||||
stoken = strtok(NULL, "\r\n= ");
|
||||
}
|
||||
free(buf2);
|
||||
|
|
@ -1136,8 +1136,9 @@ void R_PatchSkins(UINT16 wadnum)
|
|||
if ((stoken[0] == '/' && stoken[1] == '/')
|
||||
|| (stoken[0] == '#'))// skip comments
|
||||
{
|
||||
stoken = strtok(NULL, "\r\n"); // skip end of line
|
||||
goto next_token; // find the real next token
|
||||
strtok(NULL, "\r\n"); // skip end of line
|
||||
stoken = strtok(NULL, "\r\n= ");
|
||||
continue; // find the real next token
|
||||
}
|
||||
|
||||
value = strtok(NULL, "\r\n= ");
|
||||
|
|
@ -1215,7 +1216,6 @@ void R_PatchSkins(UINT16 wadnum)
|
|||
if (!skin)
|
||||
break;
|
||||
|
||||
next_token:
|
||||
stoken = strtok(NULL, "\r\n= ");
|
||||
}
|
||||
free(buf2);
|
||||
|
|
|
|||
|
|
@ -2993,6 +2993,10 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
visplane_t *plane;
|
||||
INT32 sintersect;
|
||||
fixed_t scale = 0;
|
||||
const INT32 vidheight = vid.height;
|
||||
|
||||
if (mask->drawsegs[0] == mask->drawsegs[1])
|
||||
return;
|
||||
|
||||
// Add the 3D floors, thicksides, and masked textures...
|
||||
for (ds = drawsegs + mask->drawsegs[1]; ds-- > drawsegs + mask->drawsegs[0];)
|
||||
|
|
@ -3011,7 +3015,7 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
plane = ds->curline->polyseg->visplane;
|
||||
R_PlaneBounds(plane);
|
||||
|
||||
if (plane->low < 0 || plane->high > vid.height || plane->high > plane->low)
|
||||
if (plane->low < 0 || plane->high > vidheight || plane->high > plane->low)
|
||||
;
|
||||
else {
|
||||
// Put it in!
|
||||
|
|
@ -3039,7 +3043,7 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
plane = ds->ffloorplanes[p];
|
||||
R_PlaneBounds(plane);
|
||||
|
||||
if (plane->low < 0 || plane->high > vid.height || plane->high > plane->low || plane->polyobj)
|
||||
if (plane->low < 0 || plane->high > vidheight || plane->high > plane->low || plane->polyobj)
|
||||
{
|
||||
ds->ffloorplanes[p] = NULL;
|
||||
continue;
|
||||
|
|
@ -3078,7 +3082,7 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
plane = PolyObjects[i].visplane;
|
||||
R_PlaneBounds(plane);
|
||||
|
||||
if (plane->low < 0 || plane->high > vid.height || plane->high > plane->low)
|
||||
if (plane->low < 0 || plane->high > vidheight || plane->high > plane->low)
|
||||
{
|
||||
PolyObjects[i].visplane = NULL;
|
||||
continue;
|
||||
|
|
@ -3100,7 +3104,7 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
const boolean alwaysontop = cv_debugrender_spriteclip.value || (rover->renderflags & RF_ALWAYSONTOP);
|
||||
const INT32 ontopflag = cv_debugrender_spriteclip.value ? 0 : (rover->renderflags & RF_ALWAYSONTOP);
|
||||
|
||||
if (rover->szt > vid.height || rover->sz < 0)
|
||||
if (rover->szt > vidheight || rover->sz < 0)
|
||||
continue;
|
||||
|
||||
sintersect = (rover->x1 + rover->x2) / 2;
|
||||
|
|
@ -3171,9 +3175,7 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
continue;
|
||||
}
|
||||
|
||||
entry = R_CreateDrawNode(NULL);
|
||||
(entry->prev = r2->prev)->next = entry;
|
||||
(entry->next = r2)->prev = entry;
|
||||
entry = R_CreateDrawNode(r2);
|
||||
entry->sprite = rover;
|
||||
break;
|
||||
}
|
||||
|
|
@ -3205,9 +3207,7 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
(botplanecameraz > viewz && rover->gz > botplaneobjectz))
|
||||
#endif
|
||||
{
|
||||
entry = R_CreateDrawNode(NULL);
|
||||
(entry->prev = r2->prev)->next = entry;
|
||||
(entry->next = r2)->prev = entry;
|
||||
entry = R_CreateDrawNode(r2);
|
||||
entry->sprite = rover;
|
||||
break;
|
||||
}
|
||||
|
|
@ -3224,9 +3224,7 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
|
||||
if (rover->sortscale < scale)
|
||||
{
|
||||
entry = R_CreateDrawNode(NULL);
|
||||
(entry->prev = r2->prev)->next = entry;
|
||||
(entry->next = r2)->prev = entry;
|
||||
entry = R_CreateDrawNode(r2);
|
||||
entry->sprite = rover;
|
||||
break;
|
||||
}
|
||||
|
|
@ -3273,9 +3271,7 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
|
||||
if (infront)
|
||||
{
|
||||
entry = R_CreateDrawNode(NULL);
|
||||
(entry->prev = r2->prev)->next = entry;
|
||||
(entry->next = r2)->prev = entry;
|
||||
entry = R_CreateDrawNode(r2);
|
||||
entry->sprite = rover;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2549,7 +2549,7 @@ const char *I_LocateWad(void)
|
|||
SetCurrentDirectoryA(waddir);
|
||||
#else
|
||||
waddir = realpath(waddir, NULL);
|
||||
if (chdir(waddir) == -1)
|
||||
if (waddir == NULL || chdir(waddir) == -1)
|
||||
I_OutputMsg("Couldn't change working directory\n");
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
// fixed_t tantoangle[2049] - ArcTan LUT,
|
||||
// Maps tan(angle) to angle fast. Gotta search.
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "tables.h"
|
||||
|
||||
unsigned SlopeDiv(unsigned num, unsigned den)
|
||||
|
|
@ -66,9 +67,9 @@ fixed_t AngleFixed(angle_t af)
|
|||
return rf;
|
||||
}
|
||||
|
||||
static FUNCMATH angle_t AngleAdj(const fixed_t fa, const fixed_t wf,
|
||||
angle_t ra)
|
||||
static FUNCMATH angle_t AngleAdj(const fixed_t fa, const fixed_t wf, angle_t ra)
|
||||
{
|
||||
I_Assert(wf > 0);
|
||||
const angle_t adj = 0x77;
|
||||
const boolean fan = fa < 0;
|
||||
const fixed_t sl = FixedDiv(fa, wf*2);
|
||||
|
|
@ -566,4 +567,4 @@ matrix_t *FM_RotateZ(matrix_t *dest, angle_t rad)
|
|||
return dest;
|
||||
}
|
||||
|
||||
#undef M
|
||||
#undef M
|
||||
|
|
|
|||
|
|
@ -522,17 +522,16 @@ static void CV_constextsize_OnChange(void)
|
|||
// --------------------------------------------------------------------------
|
||||
// Copy a rectangular area from one bitmap to another (8bpp)
|
||||
// --------------------------------------------------------------------------
|
||||
void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT32 height, size_t srcrowbytes,
|
||||
size_t destrowbytes)
|
||||
void VID_BlitLinearScreen(const UINT8 *restrict srcptr, UINT8 *restrict destptr, INT32 width, INT32 height, size_t srcrowbytes, size_t destrowbytes)
|
||||
{
|
||||
if (srcrowbytes == destrowbytes && srcrowbytes == width)
|
||||
if (srcrowbytes == destrowbytes && srcrowbytes == (size_t)width)
|
||||
{
|
||||
size_t i = srcrowbytes * height;
|
||||
#if defined(__SSE__)
|
||||
while (i >= 16)
|
||||
{
|
||||
// TODO: find where the buffer is misaligned at times and align it
|
||||
_mm_storeu_ps((float *)destptr, _mm_loadu_ps((const float *)srcptr));
|
||||
_mm_storeu_ps((void *)destptr, _mm_loadu_ps((const void *)srcptr));
|
||||
srcptr += 16;
|
||||
destptr += 16;
|
||||
i -= 16;
|
||||
|
|
|
|||
Loading…
Reference in a new issue