Compare commits
40
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80024497b1 | ||
|
|
403b60240f | ||
|
|
e1cb858d9a | ||
|
|
1659c2e753 | ||
|
|
e2222f66a9 | ||
|
|
8a15b5e640 | ||
|
|
684de4c8d0 | ||
|
|
c989aa3fcf | ||
|
|
bab83386d4 | ||
|
|
8b21048387 | ||
|
|
b22b4d7f84 | ||
|
|
014d61b373 | ||
|
|
ac2ba6e4bf | ||
|
|
94e0e7fb70 | ||
|
|
7b26ecb5f5 | ||
|
|
0c2ccc56cd | ||
|
|
525681b5a5 | ||
|
|
c9a3dfcac9 | ||
|
|
a05aab1c7b | ||
|
|
7dfc638305 | ||
|
|
3585969285 | ||
|
|
3361ebe3c5 | ||
|
|
ebfd7f3e4e | ||
|
|
e2c8a773be | ||
|
|
6816c6dd19 | ||
|
|
b9e26a7e2f | ||
|
|
52f1d727c0 | ||
|
|
ef763487a5 | ||
|
|
03f5ac87fa | ||
|
|
b2cac97106 | ||
|
|
c3ce75055a | ||
|
|
90d64c4e15 | ||
|
|
595648a2b3 | ||
|
|
8e799ddd74 | ||
|
|
a754e9c08a | ||
|
|
112c9398e7 | ||
|
|
ccd691548e | ||
|
|
afd7b85005 | ||
|
|
f9e1cdb940 | ||
|
|
63fe657c7d |
No files matched your search
+40
-29
@@ -1228,7 +1228,7 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
|
||||
//Draw bottom box
|
||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press ESC to abort");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP|MENUCAPS, "Press ESC to abort");
|
||||
|
||||
for (i = 0; i < 16; ++i)
|
||||
V_DrawFill((BASEVIDWIDTH/2-128) + (i * 16), BASEVIDHEIGHT-24, 16, 8, palstart + ((animtime - i) & 15));
|
||||
@@ -1275,7 +1275,7 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
cltext = M_GetText("Connecting to server...");
|
||||
break;
|
||||
}
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP, cltext);
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP|MENUCAPS, cltext);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1285,7 +1285,7 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
INT32 checkednum = 0;
|
||||
INT32 i;
|
||||
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press ESC to abort");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP|MENUCAPS, "Press ESC to abort");
|
||||
|
||||
//ima just count files here
|
||||
for (i = 0; i < fileneedednum; i++)
|
||||
@@ -1293,12 +1293,12 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
checkednum++;
|
||||
|
||||
// Loading progress
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP, "Checking server addons...");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP|MENUCAPS, "Checking server addons...");
|
||||
totalfileslength = (INT32)((checkednum/(double)(fileneedednum)) * 256);
|
||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, 256, 8, 175);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, totalfileslength, 8, 160);
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE,
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va(" %2u/%2u Files",checkednum,fileneedednum));
|
||||
}
|
||||
else if (cl_mode == CL_LOADFILES)
|
||||
@@ -1307,7 +1307,7 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
INT32 loadcompletednum = 0;
|
||||
INT32 i;
|
||||
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press ESC to abort");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP|MENUCAPS, "Press ESC to abort");
|
||||
|
||||
//ima just count files here
|
||||
for (i = 0; i < fileneedednum; i++)
|
||||
@@ -1315,12 +1315,12 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
loadcompletednum++;
|
||||
|
||||
// Loading progress
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP, "Loading server addons...");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP|MENUCAPS, "Loading server addons...");
|
||||
totalfileslength = (INT32)((loadcompletednum/(double)(fileneedednum)) * 256);
|
||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, 256, 8, 175);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, totalfileslength, 8, 160);
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE,
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va(" %2u/%2u Files",loadcompletednum,fileneedednum));
|
||||
}
|
||||
else if (lastfilenum != -1)
|
||||
@@ -1334,7 +1334,7 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
|
||||
// Draw the bottom box.
|
||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-58-8, 32, 1);
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-14, V_YELLOWMAP, "Press ESC to abort");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-14, V_YELLOWMAP|MENUCAPS, "Press ESC to abort");
|
||||
|
||||
Net_GetNetStat();
|
||||
dldlength = (INT32)((file->currentsize/(double)file->totalsize) * 256);
|
||||
@@ -1359,17 +1359,17 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
strncpy(tempname, filename, sizeof(tempname)-1);
|
||||
}
|
||||
#ifdef HAVE_CURL
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-30, 0,
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-30, MENUCAPS,
|
||||
va(M_GetText("%s downloading"), ((cl_mode == CL_DOWNLOADHTTPFILES) ? "\x82""HTTP" : "\x85""Direct")));
|
||||
#else
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-30, 0,
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-30, MENUCAPS,
|
||||
va(M_GetText("%s downloading"),("\x85""Direct")));
|
||||
#endif
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-22, V_YELLOWMAP,
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-22, V_YELLOWMAP|MENUCAPS,
|
||||
va(M_GetText("\"%s\""), tempname));
|
||||
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-58, V_20TRANS|V_MONOSPACE,
|
||||
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-58, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va(" %4uK/%4uK",fileneeded[lastfilenum].currentsize>>10,file->totalsize>>10));
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-58, V_20TRANS|V_MONOSPACE,
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-58, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va("%3.1fK/s ", ((double)getbps)/1024));
|
||||
|
||||
// Download progress
|
||||
@@ -1379,20 +1379,20 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
else
|
||||
totaldldsize = downloadcompletedsize;
|
||||
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-14, V_YELLOWMAP, "Overall Download Progress");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-14, V_YELLOWMAP|MENUCAPS, "Overall Download Progress");
|
||||
totalfileslength = (INT32)((totaldldsize/(double)totalfilesrequestedsize) * 256);
|
||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, 256, 8, 175);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, totalfileslength, 8, 160);
|
||||
|
||||
if (totalfilesrequestedsize>>20 >= 10) //display in MB if over 10MB
|
||||
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE,
|
||||
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va(" %4uM/%4uM",totaldldsize>>20,totalfilesrequestedsize>>20));
|
||||
else
|
||||
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE,
|
||||
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va(" %4uK/%4uK",totaldldsize>>10,totalfilesrequestedsize>>10));
|
||||
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE,
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE|MENUCAPS,
|
||||
va("%2u/%2u Files ",downloadcompletednum,totalfilesrequestednum));
|
||||
}
|
||||
else
|
||||
@@ -1403,12 +1403,12 @@ static inline void CL_DrawConnectionStatus(void)
|
||||
|
||||
//Draw bottom box
|
||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press ESC to abort");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP|MENUCAPS, "Press ESC to abort");
|
||||
|
||||
for (i = 0; i < 16; ++i)
|
||||
V_DrawFill((BASEVIDWIDTH/2-128) + (i * 16), BASEVIDHEIGHT-24, 16, 8, palstart + ((animtime - i) & 15));
|
||||
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP,
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP|MENUCAPS,
|
||||
M_GetText("Waiting to download files..."));
|
||||
}
|
||||
}
|
||||
@@ -4275,14 +4275,20 @@ void SV_ResetServer(void)
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
LUA_InvalidatePlayer(&players[i]);
|
||||
playeringame[i] = false;
|
||||
playernode[i] = UINT8_MAX;
|
||||
sprintf(player_names[i], "Player %d", i + 1);
|
||||
adminplayers[i] = -1; // Populate the entire adminplayers array with -1.
|
||||
}
|
||||
|
||||
memset(playeringame, false, sizeof playeringame);
|
||||
memset(playernode, UINT8_MAX, sizeof playernode);
|
||||
|
||||
ClearAdminPlayers(); // Populate the entire adminplayers array with -1.
|
||||
|
||||
memset(player_name_changes, 0, sizeof player_name_changes);
|
||||
|
||||
pingmeasurecount = 1;
|
||||
memset(realpingtable, 0, sizeof realpingtable);
|
||||
memset(playerpingtable, 0, sizeof playerpingtable);
|
||||
|
||||
mynode = 0;
|
||||
cl_packetmissed = false;
|
||||
#ifdef SATURNSYNCH
|
||||
@@ -4551,7 +4557,9 @@ static boolean SV_AddWaitingPlayers(void)
|
||||
buf[0] = (UINT8)node;
|
||||
buf[1] = newplayernum;
|
||||
if (playerpernode[node] < 1)
|
||||
{
|
||||
nodetoplayer[node] = newplayernum;
|
||||
}
|
||||
else if (playerpernode[node] < 2)
|
||||
{
|
||||
nodetoplayer2[node] = newplayernum;
|
||||
@@ -6401,19 +6409,21 @@ boolean TryRunTics(tic_t realtics)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (neededtic > gametic)
|
||||
ticking = neededtic > gametic;
|
||||
|
||||
if (ticking)
|
||||
{
|
||||
hu_stopped = false;
|
||||
if (realtics)
|
||||
hu_stopped = false;
|
||||
}
|
||||
|
||||
if (player_joining)
|
||||
{
|
||||
hu_stopped = true;
|
||||
if (realtics)
|
||||
hu_stopped = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
ticking = neededtic > gametic;
|
||||
|
||||
if (ticking)
|
||||
{
|
||||
// run the count * tics
|
||||
@@ -6444,7 +6454,8 @@ boolean TryRunTics(tic_t realtics)
|
||||
}
|
||||
else
|
||||
{
|
||||
hu_stopped = true;
|
||||
if (realtics)
|
||||
hu_stopped = true;
|
||||
}
|
||||
|
||||
return ticking;
|
||||
|
||||
+1
-1
@@ -813,7 +813,7 @@ void D_SRB2Loop(void)
|
||||
{
|
||||
renderdeltatics = FLOAT_TO_FIXED(deltatics);
|
||||
|
||||
if (!(paused || P_AutoPause()) && deltatics < 1.0 && !hu_stopped)
|
||||
if (!(paused || P_AutoPause()) && !hu_stopped)
|
||||
{
|
||||
rendertimefrac = g_time.timefrac;
|
||||
}
|
||||
|
||||
@@ -2016,9 +2016,6 @@ static void G_FixCamera(UINT8 view)
|
||||
|
||||
// Make sure the viewport doesn't interpolate at all into
|
||||
// its new position -- just snap instantly into place.
|
||||
|
||||
// Why does it need to be done twice?
|
||||
R_ResetViewInterpolation(view);
|
||||
R_ResetViewInterpolation(view);
|
||||
}
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ angle_t gld_FrustumAngle(angle_t tiltangle)
|
||||
floatangle = 2.0f + (45.0f + (tilt / 1.9f)) * clipfov / 90.0f;
|
||||
if (floatangle >= 180.0)
|
||||
return 0xffffffff;
|
||||
a1 = (angle_t)(ANG1 * (int)floatangle);
|
||||
a1 = (angle_t)xs_CRoundToInt(ANG1 * floatangle);
|
||||
return a1;
|
||||
}
|
||||
|
||||
@@ -458,4 +458,4 @@ boolean gld_SphereInFrustum(float x, float y, float z, float radius)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -171,9 +171,9 @@ enum
|
||||
{
|
||||
SHADER_NONE = -1,
|
||||
SHADER_FLOOR = 0,
|
||||
SHADER_SHADOW,
|
||||
SHADER_WALL,
|
||||
SHADER_SPRITE,
|
||||
SHADER_SPRITECLIPHACK,
|
||||
SHADER_MODEL,
|
||||
SHADER_WATER,
|
||||
SHADER_FOG,
|
||||
|
||||
+101
-88
@@ -329,7 +329,7 @@ static void HWR_SetShaderState(void)
|
||||
|
||||
boolean HWR_ShouldUsePaletteRendering(void)
|
||||
{
|
||||
return (cv_glpaletterendering.value && HWR_UseShader());
|
||||
return (cv_glpaletterendering.value && (pLocalPalette != NULL) && HWR_UseShader());
|
||||
}
|
||||
|
||||
boolean HWR_PalRenderFlashpal(void)
|
||||
@@ -3218,8 +3218,6 @@ static void HWR_DrawSpriteShadow(gl_vissprite_t *spr, GLPatch_t *gpatch)
|
||||
pslope_t *floorslope;
|
||||
fixed_t slopez;
|
||||
float offset = 0;
|
||||
|
||||
INT32 shader = SHADER_NONE;
|
||||
|
||||
// technically this_scale gets multiplied and added to sprite y/x scale, but this thing needs it for some crap so ill just throw it in here again
|
||||
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->flags & SF_HIRES);
|
||||
@@ -3376,86 +3374,114 @@ static void HWR_DrawSpriteShadow(gl_vissprite_t *spr, GLPatch_t *gpatch)
|
||||
if (sSurf.PolyColor.s.alpha > floorheight/4)
|
||||
{
|
||||
sSurf.PolyColor.s.alpha = (UINT8)(sSurf.PolyColor.s.alpha - floorheight/4);
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
shader = SHADER_SHADOW;
|
||||
blendmode |= PF_ColorMapped;
|
||||
}
|
||||
|
||||
HWR_ProcessPolygon(&sSurf, swallVerts, 4, blendmode|PF_Translucent|PF_Modulated, shader, false);
|
||||
HWR_ProcessPolygon(&sSurf, swallVerts, 4, blendmode|PF_Translucent|PF_Modulated, SHADER_NONE, false);
|
||||
}
|
||||
}
|
||||
|
||||
// This is expecting a pointer to an array containing 4 wallVerts for a sprite
|
||||
static void HWR_RotateSpritePolyToAim(gl_vissprite_t *spr, FOutVector *wallVerts, const boolean precip)
|
||||
static void HWR_RotateSpritePolyToAim(gl_vissprite_t *spr, FOutVector *wallVerts, const boolean precip, const boolean papersprite)
|
||||
{
|
||||
if (cv_glspritebillboarding.value && spr && spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE) && wallVerts)
|
||||
if (!cv_glspritebillboarding.value || !spr || !spr->mobj || papersprite || !wallVerts)
|
||||
{
|
||||
// uncapped/interpolation
|
||||
interpmobjstate_t interp = {0};
|
||||
float basey, lowy;
|
||||
INT32 dist = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (cv_maxinterpdist.value)
|
||||
dist = R_QuickCamDist(spr->mobj->x, spr->mobj->y);
|
||||
// uncapped/interpolation
|
||||
interpmobjstate_t interp = {0};
|
||||
float basey, lowy;
|
||||
INT32 dist = -1;
|
||||
|
||||
// do interpolation
|
||||
if (R_UsingFrameInterpolation() && !paused && (!cv_maxinterpdist.value || dist < cv_maxinterpdist.value))
|
||||
if (cv_maxinterpdist.value)
|
||||
dist = R_QuickCamDist(spr->mobj->x, spr->mobj->y);
|
||||
|
||||
// do interpolation
|
||||
if (R_UsingFrameInterpolation() && !paused && (!cv_maxinterpdist.value || dist < cv_maxinterpdist.value))
|
||||
{
|
||||
if (precip)
|
||||
{
|
||||
if (precip)
|
||||
{
|
||||
R_InterpolatePrecipMobjState((precipmobj_t *)spr->mobj, rendertimefrac, &interp);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_InterpolateMobjState(spr->mobj, rendertimefrac, &interp);
|
||||
}
|
||||
R_InterpolatePrecipMobjState((precipmobj_t *)spr->mobj, rendertimefrac, &interp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (precip)
|
||||
{
|
||||
R_InterpolatePrecipMobjState((precipmobj_t *)spr->mobj, FRACUNIT, &interp);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_InterpolateMobjState(spr->mobj, FRACUNIT, &interp);
|
||||
}
|
||||
R_InterpolateMobjState(spr->mobj, rendertimefrac, &interp);
|
||||
}
|
||||
|
||||
if (!precip && P_MobjFlip(spr->mobj) == -1) // precip doesn't have eflags so they can't flip
|
||||
}
|
||||
else
|
||||
{
|
||||
if (precip)
|
||||
{
|
||||
basey = FIXED_TO_FLOAT(interp.z + spr->mobj->height);
|
||||
R_InterpolatePrecipMobjState((precipmobj_t *)spr->mobj, FRACUNIT, &interp);
|
||||
}
|
||||
else
|
||||
{
|
||||
basey = FIXED_TO_FLOAT(interp.z);
|
||||
R_InterpolateMobjState(spr->mobj, FRACUNIT, &interp);
|
||||
}
|
||||
lowy = wallVerts[0].y;
|
||||
}
|
||||
|
||||
// Rotate sprites to fully billboard with the camera
|
||||
// X, Y, AND Z need to be manipulated for the polys to rotate around the
|
||||
// origin, because of how the origin setting works I believe that should
|
||||
// be mobj->z or mobj->z + mobj->height
|
||||
wallVerts[2].y = wallVerts[3].y = (spr->gzt - basey) * gl_viewludsin + basey;
|
||||
wallVerts[0].y = wallVerts[1].y = (lowy - basey) * gl_viewludsin + basey;
|
||||
// translate back to be around 0 before translating back
|
||||
wallVerts[3].x += ((spr->gzt - basey) * gl_viewludcos) * gl_viewcos;
|
||||
wallVerts[2].x += ((spr->gzt - basey) * gl_viewludcos) * gl_viewcos;
|
||||
if (!precip && P_MobjFlip(spr->mobj) == -1) // precip doesn't have eflags so they can't flip
|
||||
{
|
||||
basey = FIXED_TO_FLOAT(interp.z + spr->mobj->height);
|
||||
}
|
||||
else
|
||||
{
|
||||
basey = FIXED_TO_FLOAT(interp.z);
|
||||
}
|
||||
lowy = wallVerts[0].y;
|
||||
|
||||
wallVerts[0].x += ((lowy - basey) * gl_viewludcos) * gl_viewcos;
|
||||
wallVerts[1].x += ((lowy - basey) * gl_viewludcos) * gl_viewcos;
|
||||
// Rotate sprites to fully billboard with the camera
|
||||
// X, Y, AND Z need to be manipulated for the polys to rotate around the
|
||||
// origin, because of how the origin setting works I believe that should
|
||||
// be mobj->z or mobj->z + mobj->height
|
||||
wallVerts[2].y = wallVerts[3].y = (spr->gzt - basey) * gl_viewludsin + basey;
|
||||
wallVerts[0].y = wallVerts[1].y = (lowy - basey) * gl_viewludsin + basey;
|
||||
// translate back to be around 0 before translating back
|
||||
wallVerts[3].x += ((spr->gzt - basey) * gl_viewludcos) * gl_viewcos;
|
||||
wallVerts[2].x += ((spr->gzt - basey) * gl_viewludcos) * gl_viewcos;
|
||||
|
||||
wallVerts[3].z += ((spr->gzt - basey) * gl_viewludcos) * gl_viewsin;
|
||||
wallVerts[2].z += ((spr->gzt - basey) * gl_viewludcos) * gl_viewsin;
|
||||
wallVerts[0].x += ((lowy - basey) * gl_viewludcos) * gl_viewcos;
|
||||
wallVerts[1].x += ((lowy - basey) * gl_viewludcos) * gl_viewcos;
|
||||
|
||||
wallVerts[0].z += ((lowy - basey) * gl_viewludcos) * gl_viewsin;
|
||||
wallVerts[1].z += ((lowy - basey) * gl_viewludcos) * gl_viewsin;
|
||||
wallVerts[3].z += ((spr->gzt - basey) * gl_viewludcos) * gl_viewsin;
|
||||
wallVerts[2].z += ((spr->gzt - basey) * gl_viewludcos) * gl_viewsin;
|
||||
|
||||
wallVerts[0].z += ((lowy - basey) * gl_viewludcos) * gl_viewsin;
|
||||
wallVerts[1].z += ((lowy - basey) * gl_viewludcos) * gl_viewsin;
|
||||
}
|
||||
|
||||
static inline void HWR_ApplyDispoffset(gl_vissprite_t *spr, FOutVector *wallVerts, const boolean papersprite)
|
||||
{
|
||||
// dont push papersprites near the cam unless they have a dispoffset
|
||||
if (papersprite || HWR_UseShader())
|
||||
{
|
||||
// if it has a dispoffset, push it a little towards the camera
|
||||
if (spr->dispoffset)
|
||||
{
|
||||
float co = -gl_viewcos*(0.05f*spr->dispoffset);
|
||||
float si = -gl_viewsin*(0.05f*spr->dispoffset);
|
||||
wallVerts[0].z = wallVerts[3].z = wallVerts[0].z+si;
|
||||
wallVerts[1].z = wallVerts[2].z = wallVerts[1].z+si;
|
||||
wallVerts[0].x = wallVerts[3].x = wallVerts[0].x+co;
|
||||
wallVerts[1].x = wallVerts[2].x = wallVerts[1].x+co;
|
||||
}
|
||||
|
||||
HWR_RotateSpritePolyToAim(spr, wallVerts, false, papersprite);
|
||||
return;
|
||||
}
|
||||
|
||||
HWR_RotateSpritePolyToAim(spr, wallVerts, false, papersprite);
|
||||
|
||||
float sprdist = sqrtf((spr->x1 - gl_viewx)*(spr->x1 - gl_viewx) + (spr->z1 - gl_viewy)*(spr->z1 - gl_viewy) + (spr->gzt - gl_viewz)*(spr->gzt - gl_viewz));
|
||||
float distfact = ((2.0f*spr->dispoffset) + 20.0f) / sprdist;
|
||||
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
{
|
||||
wallVerts[i].x += (gl_viewx - wallVerts[i].x)*distfact;
|
||||
wallVerts[i].z += (gl_viewy - wallVerts[i].z)*distfact;
|
||||
wallVerts[i].y += (gl_viewz - wallVerts[i].y)*distfact;
|
||||
}
|
||||
}
|
||||
|
||||
static void HWR_SplitSprite(gl_vissprite_t *spr)
|
||||
static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
||||
{
|
||||
FOutVector wallVerts[4];
|
||||
FOutVector baseWallVerts[4]; // This is what the verts should end up as
|
||||
@@ -3535,18 +3561,8 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
||||
baseWallVerts[0].t = baseWallVerts[1].t = gpatch->max_t;
|
||||
}
|
||||
|
||||
// Let dispoffset work first since this adjust each vertex
|
||||
HWR_RotateSpritePolyToAim(spr, baseWallVerts, false);
|
||||
|
||||
// push it toward the camera to mitigate floor-clipping sprites
|
||||
float sprdist = sqrtf((spr->x1 - gl_viewx)*(spr->x1 - gl_viewx) + (spr->z1 - gl_viewy)*(spr->z1 - gl_viewy) + (spr->gzt - gl_viewz)*(spr->gzt - gl_viewz));
|
||||
float distfact = ((2.0f*spr->dispoffset) + 20.0f) / sprdist;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
baseWallVerts[i].x += (gl_viewx - baseWallVerts[i].x)*distfact;
|
||||
baseWallVerts[i].z += (gl_viewy - baseWallVerts[i].z)*distfact;
|
||||
baseWallVerts[i].y += (gl_viewz - baseWallVerts[i].y)*distfact;
|
||||
}
|
||||
HWR_ApplyDispoffset(spr, baseWallVerts, papersprite);
|
||||
|
||||
realtop = top = baseWallVerts[3].y;
|
||||
realbot = bot = baseWallVerts[0].y;
|
||||
@@ -3586,7 +3602,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
shader = SHADER_SPRITE;
|
||||
shader = (papersprite ? SHADER_SPRITE : SHADER_SPRITECLIPHACK);
|
||||
blend |= PF_ColorMapped;
|
||||
}
|
||||
|
||||
@@ -3664,7 +3680,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
||||
wallVerts[1].y = endbot;
|
||||
|
||||
// The x and y only need to be adjusted in the case that it's not a papersprite
|
||||
if (cv_glspritebillboarding.value && spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE))
|
||||
if (cv_glspritebillboarding.value && spr->mobj && !papersprite)
|
||||
{
|
||||
// Get the x and z of the vertices so billboarding draws correctly
|
||||
realheight = realbot - realtop;
|
||||
@@ -3740,9 +3756,11 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||
if (!spr->mobj->subsector)
|
||||
return;
|
||||
|
||||
const boolean papersprite = (spr->mobj->frame & FF_PAPERSPRITE);
|
||||
|
||||
if (spr->mobj->subsector->sector->numlights)
|
||||
{
|
||||
HWR_SplitSprite(spr);
|
||||
HWR_SplitSprite(spr, papersprite);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3808,20 +3826,8 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||
HWR_DrawSpriteShadow(spr, gpatch);
|
||||
}
|
||||
|
||||
// Let dispoffset work first since this adjust each vertex
|
||||
// ...nah
|
||||
HWR_RotateSpritePolyToAim(spr, wallVerts, false);
|
||||
|
||||
// push it toward the camera to mitigate floor-clipping sprites
|
||||
float sprdist = sqrtf((spr->x1 - gl_viewx)*(spr->x1 - gl_viewx) + (spr->z1 - gl_viewy)*(spr->z1 - gl_viewy) + (spr->gzt - gl_viewz)*(spr->gzt - gl_viewz));
|
||||
float distfact = ((2.0f*spr->dispoffset) + 20.0f) / sprdist;
|
||||
size_t i;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
wallVerts[i].x += (gl_viewx - wallVerts[i].x)*distfact;
|
||||
wallVerts[i].z += (gl_viewy - wallVerts[i].z)*distfact;
|
||||
wallVerts[i].y += (gl_viewz - wallVerts[i].y)*distfact;
|
||||
}
|
||||
HWR_ApplyDispoffset(spr, wallVerts, papersprite);
|
||||
|
||||
// This needs to be AFTER the shadows so that the regular sprites aren't drawn completely black.
|
||||
// sprite lighting by modulating the RGB components
|
||||
@@ -3861,7 +3867,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
shader = SHADER_SPRITE;
|
||||
shader = (papersprite ? SHADER_SPRITE : SHADER_SPRITECLIPHACK);
|
||||
blend |= PF_ColorMapped;
|
||||
}
|
||||
|
||||
@@ -3903,8 +3909,7 @@ static inline void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
|
||||
wallVerts[0].z = wallVerts[3].z = spr->z1;
|
||||
wallVerts[1].z = wallVerts[2].z = spr->z2;
|
||||
|
||||
// Let dispoffset work first since this adjust each vertex
|
||||
HWR_RotateSpritePolyToAim(spr, wallVerts, true);
|
||||
HWR_RotateSpritePolyToAim(spr, wallVerts, true, false);
|
||||
|
||||
wallVerts[0].s = wallVerts[3].s = 0;
|
||||
wallVerts[2].s = wallVerts[1].s = gpatch->max_s;
|
||||
@@ -4599,6 +4604,14 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||
else
|
||||
rollsum = rollangle;
|
||||
|
||||
// this is kinda dumb lkmao, but try to mitigate shadows being weirdly offset on slopes
|
||||
if (thing->type == MT_SHADOW)
|
||||
{
|
||||
sprinfo->available = true; // < lmao
|
||||
sprinfo->pivot[(thing->frame & FF_FRAMEMASK)].x = spr_offset>>FRACBITS;
|
||||
sprinfo->pivot[(thing->frame & FF_FRAMEMASK)].y = -8; // noones gonna replace shadow sprite anyways, right? that random value ftw, otherwise this clips into the ground Zzz...
|
||||
}
|
||||
|
||||
rollangle = R_GetRollAngle(rollsum);
|
||||
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle);
|
||||
|
||||
|
||||
@@ -29,15 +29,15 @@ static struct {
|
||||
// Floor shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_FLOOR_FRAGMENT_SHADER},
|
||||
|
||||
// Shadow shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_SHADOW_FRAGMENT_SHADER},
|
||||
|
||||
// Wall shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER},
|
||||
|
||||
// Sprite shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER},
|
||||
|
||||
// Sprite clipping hack shader (for pulling things out of the floor)
|
||||
{GLSL_SPRITECLIP_HACK_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER},
|
||||
|
||||
// Model shader
|
||||
{GLSL_DEFAULT_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER},
|
||||
|
||||
@@ -432,7 +432,6 @@ static inline UINT16 HWR_FindShaderDefs(UINT16 wadnum)
|
||||
customshaderxlat_t shaderxlat[] =
|
||||
{
|
||||
{"Flat", SHADER_FLOOR},
|
||||
{"Shadow", SHADER_SHADOW},
|
||||
{"WallTexture", SHADER_WALL},
|
||||
{"Sprite", SHADER_SPRITE},
|
||||
{"Model", SHADER_MODEL},
|
||||
|
||||
@@ -31,6 +31,16 @@
|
||||
"gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;\n" \
|
||||
"}\0"
|
||||
|
||||
// Sprite clipping makes me want to McFucking Die
|
||||
#define GLSL_SPRITECLIP_HACK_VERTEX_SHADER \
|
||||
"void main(void) {\n" \
|
||||
"gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;\n" \
|
||||
"gl_FrontColor = gl_Color;\n" \
|
||||
"gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;\n" \
|
||||
"gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;\n" \
|
||||
"gl_Position.z -= 160.0 / gl_Position.z;\n" \
|
||||
"}\0"
|
||||
|
||||
// ==================
|
||||
// Fragment shaders
|
||||
// ==================
|
||||
@@ -211,10 +221,6 @@
|
||||
GLSL_WALL_FUDGES \
|
||||
GLSL_SOFTWARE_FRAGMENT_SHADER
|
||||
|
||||
#define GLSL_SHADOW_FRAGMENT_SHADER \
|
||||
GLSL_FLOOR_FUDGES \
|
||||
GLSL_SOFTWARE_FRAGMENT_SHADER_NOPAL
|
||||
|
||||
//
|
||||
// Water surface shader
|
||||
//
|
||||
|
||||
@@ -247,6 +247,35 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedRound(fixed_t x)
|
||||
return INT32_MAX;
|
||||
}
|
||||
|
||||
/** \brief The xs_CRoundToInt function
|
||||
|
||||
\param val double number
|
||||
|
||||
\return Round toward nearest, but ties round toward even
|
||||
*/
|
||||
#if defined(SRB2_BIG_ENDIAN)
|
||||
#define _xs_iexp_ 0
|
||||
#define _xs_iman_ 1
|
||||
#else
|
||||
#define _xs_iexp_ 1 //intel is little endian
|
||||
#define _xs_iman_ 0
|
||||
#endif //BigEndian_
|
||||
|
||||
typedef double real64;
|
||||
|
||||
typedef union _xs_doubleints
|
||||
{
|
||||
real64 val;
|
||||
unsigned ival[2];
|
||||
} _xs_doubleints;
|
||||
|
||||
FUNCMATH FUNCINLINE static ATTRINLINE int xs_CRoundToInt(real64 val)
|
||||
{
|
||||
_xs_doubleints uval;
|
||||
uval.val = val + 6755399441055744.0;
|
||||
return uval.ival[_xs_iman_];
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
fixed_t x;
|
||||
|
||||
+40
-52
@@ -5153,8 +5153,6 @@ static void M_DrawGenericMenu(void)
|
||||
{
|
||||
INT32 x, y, w, i, cursory = 0;
|
||||
|
||||
INT32 lowercase = !cv_menucaps.value ? V_ALLOWLOWERCASE : 0;
|
||||
|
||||
// DRAW MENU
|
||||
x = currentMenu->x;
|
||||
y = currentMenu->y;
|
||||
@@ -5200,9 +5198,9 @@ static void M_DrawGenericMenu(void)
|
||||
cursory = y;
|
||||
|
||||
if ((currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING)
|
||||
V_DrawString(x, y, lowercase, currentMenu->menuitems[i].text);
|
||||
V_DrawString(x, y, MENUCAPS, currentMenu->menuitems[i].text);
|
||||
else
|
||||
V_DrawString(x, y, lowercase|highlightflags, currentMenu->menuitems[i].text);
|
||||
V_DrawString(x, y, MENUCAPS|highlightflags, currentMenu->menuitems[i].text);
|
||||
|
||||
// Cvar specific handling
|
||||
switch (currentMenu->menuitems[i].status & IT_TYPE)
|
||||
@@ -5229,7 +5227,7 @@ static void M_DrawGenericMenu(void)
|
||||
default:
|
||||
w = V_StringWidth(cv->string, 0);
|
||||
V_DrawString(BASEVIDWIDTH - x - w, y,
|
||||
((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags)|lowercase, cv->string);
|
||||
((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags)|MENUCAPS, cv->string);
|
||||
if (i == itemOn)
|
||||
{
|
||||
V_DrawCharacter(BASEVIDWIDTH - x - 10 - w - (skullAnimCounter/5), y,
|
||||
@@ -5244,7 +5242,7 @@ static void M_DrawGenericMenu(void)
|
||||
y += STRINGHEIGHT;
|
||||
break;
|
||||
case IT_STRING2:
|
||||
V_DrawString(((BASEVIDWIDTH - V_StringWidth(currentMenu->menuitems[i].text, 0))>>1), y, lowercase, currentMenu->menuitems[i].text);
|
||||
V_DrawString(((BASEVIDWIDTH - V_StringWidth(currentMenu->menuitems[i].text, 0))>>1), y, MENUCAPS, currentMenu->menuitems[i].text);
|
||||
/* FALLTHRU */
|
||||
case IT_DYLITLSPACE:
|
||||
y += SMALLLINEHEIGHT;
|
||||
@@ -5260,21 +5258,21 @@ static void M_DrawGenericMenu(void)
|
||||
y = currentMenu->y+currentMenu->menuitems[i].alphaKey;
|
||||
/* FALLTHRU */
|
||||
case IT_TRANSTEXT2:
|
||||
V_DrawString(x, y, V_TRANSLUCENT|lowercase, currentMenu->menuitems[i].text);
|
||||
V_DrawString(x, y, V_TRANSLUCENT|MENUCAPS, currentMenu->menuitems[i].text);
|
||||
y += SMALLLINEHEIGHT;
|
||||
break;
|
||||
case IT_QUESTIONMARKS:
|
||||
if (currentMenu->menuitems[i].alphaKey)
|
||||
y = currentMenu->y+currentMenu->menuitems[i].alphaKey;
|
||||
|
||||
V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING|lowercase, M_CreateSecretMenuOption(currentMenu->menuitems[i].text));
|
||||
V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING|MENUCAPS, M_CreateSecretMenuOption(currentMenu->menuitems[i].text));
|
||||
y += SMALLLINEHEIGHT;
|
||||
break;
|
||||
case IT_HEADERTEXT: // draws 16 pixels to the left, in yellow text
|
||||
if (currentMenu->menuitems[i].alphaKey)
|
||||
y = currentMenu->y+currentMenu->menuitems[i].alphaKey;
|
||||
|
||||
V_DrawString(x-16, y, highlightflags|lowercase, currentMenu->menuitems[i].text);
|
||||
V_DrawString(x-16, y, highlightflags|MENUCAPS, currentMenu->menuitems[i].text);
|
||||
y += SMALLLINEHEIGHT;
|
||||
break;
|
||||
}
|
||||
@@ -5291,7 +5289,7 @@ static void M_DrawGenericMenu(void)
|
||||
{
|
||||
V_DrawScaledPatch(currentMenu->x - 24, cursory, 0,
|
||||
W_CachePatchName("M_CURSOR", PU_CACHE));
|
||||
V_DrawString(currentMenu->x, cursory, lowercase|highlightflags, currentMenu->menuitems[itemOn].text);
|
||||
V_DrawString(currentMenu->x, cursory, MENUCAPS|highlightflags, currentMenu->menuitems[itemOn].text);
|
||||
}
|
||||
|
||||
// dumb hack
|
||||
@@ -5369,8 +5367,6 @@ static void M_DrawGenericScrollMenu(void)
|
||||
// draw title (or big pic)
|
||||
M_DrawMenuTitle();
|
||||
|
||||
INT32 lowercase = !cv_menucaps.value ? V_ALLOWLOWERCASE : 0;
|
||||
|
||||
for (; i < max; i++)
|
||||
{
|
||||
y = currentMenu->menuitems[i].alphaKey*2 + tempcentery;
|
||||
@@ -5387,9 +5383,9 @@ static void M_DrawGenericScrollMenu(void)
|
||||
case IT_STRING:
|
||||
case IT_WHITESTRING:
|
||||
if (i != itemOn && (currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING)
|
||||
V_DrawString(x, y, lowercase, currentMenu->menuitems[i].text);
|
||||
V_DrawString(x, y, MENUCAPS, currentMenu->menuitems[i].text);
|
||||
else
|
||||
V_DrawString(x, y, lowercase|highlightflags, currentMenu->menuitems[i].text);
|
||||
V_DrawString(x, y, MENUCAPS|highlightflags, currentMenu->menuitems[i].text);
|
||||
|
||||
// Cvar specific handling
|
||||
switch (currentMenu->menuitems[i].status & IT_TYPE)
|
||||
@@ -5411,12 +5407,12 @@ static void M_DrawGenericScrollMenu(void)
|
||||
if (itemOn == i)
|
||||
M_DrawTextInput(x + 8, y + 12, &menuinput, 0);
|
||||
else
|
||||
V_DrawString(x + 8, y + 12, lowercase, cv->string);
|
||||
V_DrawString(x + 8, y + 12, MENUCAPS, cv->string);
|
||||
|
||||
break;
|
||||
default:
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH - x, y,
|
||||
((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? V_REDMAP : highlightflags)|lowercase, cv->string);
|
||||
((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? V_REDMAP : highlightflags)|MENUCAPS, cv->string);
|
||||
if (i == itemOn)
|
||||
{
|
||||
V_DrawCharacter(BASEVIDWIDTH - x - 10 - V_StringWidth(cv->string, 0) - (skullAnimCounter/5), y,
|
||||
@@ -5430,13 +5426,13 @@ static void M_DrawGenericScrollMenu(void)
|
||||
}
|
||||
break;
|
||||
case IT_TRANSTEXT:
|
||||
V_DrawString(x, y, V_TRANSLUCENT|lowercase, currentMenu->menuitems[i].text);
|
||||
V_DrawString(x, y, V_TRANSLUCENT|MENUCAPS, currentMenu->menuitems[i].text);
|
||||
break;
|
||||
case IT_QUESTIONMARKS:
|
||||
V_DrawString(x, y, lowercase|V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text));
|
||||
V_DrawString(x, y, MENUCAPS|V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text));
|
||||
break;
|
||||
case IT_HEADERTEXT:
|
||||
V_DrawString(x-16, y, highlightflags|lowercase, currentMenu->menuitems[i].text);
|
||||
V_DrawString(x-16, y, highlightflags|MENUCAPS, currentMenu->menuitems[i].text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -5491,8 +5487,6 @@ static void M_DrawCenteredMenu(void)
|
||||
// draw title (or big pic)
|
||||
M_DrawMenuTitle();
|
||||
|
||||
INT32 lowercase = !cv_menucaps.value ? V_ALLOWLOWERCASE : 0;
|
||||
|
||||
for (i = 0; i < currentMenu->numitems; i++)
|
||||
{
|
||||
if (i == itemOn)
|
||||
@@ -5531,9 +5525,9 @@ static void M_DrawCenteredMenu(void)
|
||||
cursory = y;
|
||||
|
||||
if ((currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING)
|
||||
V_DrawCenteredString(x, y, lowercase, currentMenu->menuitems[i].text);
|
||||
V_DrawCenteredString(x, y, MENUCAPS, currentMenu->menuitems[i].text);
|
||||
else
|
||||
V_DrawCenteredString(x, y, highlightflags|lowercase, currentMenu->menuitems[i].text);
|
||||
V_DrawCenteredString(x, y, highlightflags|MENUCAPS, currentMenu->menuitems[i].text);
|
||||
|
||||
// Cvar specific handling
|
||||
switch(currentMenu->menuitems[i].status & IT_TYPE)
|
||||
@@ -5558,7 +5552,7 @@ static void M_DrawCenteredMenu(void)
|
||||
break;
|
||||
default:
|
||||
V_DrawString(BASEVIDWIDTH - x - V_StringWidth(cv->string, 0), y,
|
||||
((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags)|lowercase, cv->string);
|
||||
((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags)|MENUCAPS, cv->string);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -5566,7 +5560,7 @@ static void M_DrawCenteredMenu(void)
|
||||
y += STRINGHEIGHT;
|
||||
break;
|
||||
case IT_STRING2:
|
||||
V_DrawCenteredString(x, y, lowercase, currentMenu->menuitems[i].text);
|
||||
V_DrawCenteredString(x, y, MENUCAPS, currentMenu->menuitems[i].text);
|
||||
/* FALLTHRU */
|
||||
case IT_DYLITLSPACE:
|
||||
y += SMALLLINEHEIGHT;
|
||||
@@ -5575,7 +5569,7 @@ static void M_DrawCenteredMenu(void)
|
||||
if (currentMenu->menuitems[i].alphaKey)
|
||||
y = currentMenu->y+currentMenu->menuitems[i].alphaKey;
|
||||
|
||||
V_DrawCenteredString(x, y, V_TRANSLUCENT|V_OLDSPACING|lowercase, M_CreateSecretMenuOption(currentMenu->menuitems[i].text));
|
||||
V_DrawCenteredString(x, y, V_TRANSLUCENT|V_OLDSPACING|MENUCAPS, M_CreateSecretMenuOption(currentMenu->menuitems[i].text));
|
||||
y += SMALLLINEHEIGHT;
|
||||
break;
|
||||
case IT_GRAYPATCH:
|
||||
@@ -5598,7 +5592,7 @@ static void M_DrawCenteredMenu(void)
|
||||
{
|
||||
V_DrawScaledPatch(x - V_StringWidth(currentMenu->menuitems[itemOn].text, 0)/2 - 24, cursory, 0,
|
||||
W_CachePatchName("M_CURSOR", PU_CACHE));
|
||||
V_DrawCenteredString(x, cursory, highlightflags|lowercase, currentMenu->menuitems[itemOn].text);
|
||||
V_DrawCenteredString(x, cursory, highlightflags|MENUCAPS, currentMenu->menuitems[itemOn].text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7104,11 +7098,11 @@ static void DrawReplayHutReplayInfo(void)
|
||||
switch (demolist[dir_on[menudepthleft]].type)
|
||||
{
|
||||
case MD_NOTLOADED:
|
||||
V_DrawCenteredString(160, 40, V_SNAPTOTOP, "Loading replay information...");
|
||||
V_DrawCenteredString(160, 40, V_SNAPTOTOP|MENUCAPS, "Loading replay information...");
|
||||
break;
|
||||
|
||||
case MD_INVALID:
|
||||
V_DrawCenteredString(160, 40, V_SNAPTOTOP|warningflags, "This replay cannot be played.");
|
||||
V_DrawCenteredString(160, 40, V_SNAPTOTOP|warningflags|MENUCAPS, "This replay cannot be played.");
|
||||
break;
|
||||
|
||||
case MD_SUBDIR:
|
||||
@@ -7150,7 +7144,7 @@ static void DrawReplayHutReplayInfo(void)
|
||||
if (mapheaderinfo[demolist[dir_on[menudepthleft]].map-1])
|
||||
{
|
||||
char *title = G_BuildMapTitle(demolist[dir_on[menudepthleft]].map);
|
||||
V_DrawString(x, y, V_SNAPTOTOP, title);
|
||||
V_DrawString(x, y, V_SNAPTOTOP|MENUCAPS, title);
|
||||
Z_Free(title);
|
||||
}
|
||||
else
|
||||
@@ -7167,26 +7161,24 @@ static void DrawReplayHutReplayInfo(void)
|
||||
{
|
||||
// No standings were loaded!
|
||||
V_DrawString(x, y+39, V_SNAPTOTOP|V_ALLOWLOWERCASE|V_TRANSLUCENT, "No standings available.");
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
V_DrawThinString(x, y+29, V_SNAPTOTOP|highlightflags, "WINNER");
|
||||
V_DrawThinString(x, y+29, V_SNAPTOTOP|highlightflags|MENUCAPS, "Winner");
|
||||
V_DrawString(x+38, y+30, V_SNAPTOTOP|V_ALLOWLOWERCASE, demolist[dir_on[menudepthleft]].standings[0].name);
|
||||
|
||||
if (demolist[dir_on[menudepthleft]].gametype == GT_RACE)
|
||||
{
|
||||
V_DrawThinString(x, y+39, V_SNAPTOTOP|highlightflags, "TIME");
|
||||
V_DrawThinString(x, y+39, V_SNAPTOTOP|highlightflags|MENUCAPS, "Time");
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawThinString(x, y+39, V_SNAPTOTOP|highlightflags, "SCORE");
|
||||
V_DrawThinString(x, y+39, V_SNAPTOTOP|highlightflags|MENUCAPS, "Score");
|
||||
}
|
||||
|
||||
if (demolist[dir_on[menudepthleft]].standings[0].timeorscore == (UINT32_MAX-1))
|
||||
{
|
||||
V_DrawThinString(x+32, y+40-1, V_SNAPTOTOP, "NO CONTEST");
|
||||
V_DrawThinString(x+32, y+40-1, V_SNAPTOTOP|MENUCAPS, "No Contest");
|
||||
}
|
||||
else if (demolist[dir_on[menudepthleft]].gametype == GT_RACE)
|
||||
{
|
||||
@@ -8956,7 +8948,7 @@ void M_DrawTimeAttackMenu(void)
|
||||
if (i == itemOn)
|
||||
cursory = y;
|
||||
|
||||
V_DrawString(x, y, (dispstatus == IT_WHITESTRING) ? highlightflags : 0 , currentMenu->menuitems[i].text);
|
||||
V_DrawString(x, y, ((dispstatus == IT_WHITESTRING) ? highlightflags : 0)|MENUCAPS, currentMenu->menuitems[i].text);
|
||||
|
||||
// Cvar specific handling
|
||||
if ((currentMenu->menuitems[i].status & IT_TYPE) == IT_CVAR)
|
||||
@@ -8981,7 +8973,7 @@ void M_DrawTimeAttackMenu(void)
|
||||
soffset = 0;
|
||||
|
||||
// Should see nothing but strings
|
||||
V_DrawString(BASEVIDWIDTH - x - soffset - strw, y, highlightflags, str);
|
||||
V_DrawString(BASEVIDWIDTH - x - soffset - strw, y, highlightflags|MENUCAPS, str);
|
||||
|
||||
if (i == itemOn)
|
||||
{
|
||||
@@ -9011,7 +9003,7 @@ void M_DrawTimeAttackMenu(void)
|
||||
|
||||
// DRAW THE SKULL CURSOR
|
||||
V_DrawScaledPatch(x - 24, cursory, 0, W_CachePatchName("M_CURSOR", PU_CACHE));
|
||||
V_DrawString(x, cursory, highlightflags, currentMenu->menuitems[itemOn].text);
|
||||
V_DrawString(x, cursory, highlightflags|MENUCAPS, currentMenu->menuitems[itemOn].text);
|
||||
|
||||
// Level record list
|
||||
if (cv_nextmap.value)
|
||||
@@ -9026,10 +9018,10 @@ void M_DrawTimeAttackMenu(void)
|
||||
|
||||
V_DrawFill((BASEVIDWIDTH - dupadjust)>>1, 78, dupadjust, 36, 239);
|
||||
|
||||
V_DrawRightAlignedString(149, 80, highlightflags, "BEST LAP:");
|
||||
V_DrawRightAlignedString(149, 80, highlightflags|MENUCAPS, "Best Lap:");
|
||||
K_drawKartTimestamp(lap, 19, 86, 0, 2);
|
||||
|
||||
V_DrawRightAlignedString(292, 80, highlightflags, "BEST TIME:");
|
||||
V_DrawRightAlignedString(292, 80, highlightflags|MENUCAPS, "Best Time:");
|
||||
K_drawKartTimestamp(time, 162, 86, cv_nextmap.value, 1);
|
||||
}
|
||||
|
||||
@@ -9041,7 +9033,7 @@ void M_DrawTimeAttackMenu(void)
|
||||
for (i = 0; i < 4; ++i)
|
||||
{
|
||||
y = currentMenu->y+SP_TimeAttackMenu[i].alphaKey;
|
||||
V_DrawString(x, y, V_TRANSLUCENT, SP_TimeAttackMenu[i].text);
|
||||
V_DrawString(x, y, V_TRANSLUCENT|MENUCAPS, SP_TimeAttackMenu[i].text);
|
||||
ncv = (consvar_t *)SP_TimeAttackMenu[i].itemaction;
|
||||
if (SP_TimeAttackMenu[i].status & IT_CV_STRING)
|
||||
{
|
||||
@@ -9058,7 +9050,7 @@ void M_DrawTimeAttackMenu(void)
|
||||
soffset = 0;
|
||||
|
||||
// Should see nothing but strings
|
||||
V_DrawString(BASEVIDWIDTH - x - soffset - strw, y, highlightflags|V_TRANSLUCENT, str);
|
||||
V_DrawString(BASEVIDWIDTH - x - soffset - strw, y, highlightflags|V_TRANSLUCENT|MENUCAPS, str);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10088,10 +10080,10 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade)
|
||||
len = strlen(addonname);
|
||||
#define charsonside 14
|
||||
if (len > charlimit)
|
||||
V_DrawThinString(x+w+5, y+i-8, V_TRANSLUCENT, va("%.*s...%s", charsonside, addonname, addonname+((len-charlimit) + charsonside))); // variable reuse...
|
||||
V_DrawThinString(x+w+5, y+i-8, V_TRANSLUCENT|MENUCAPS, va("%.*s...%s", charsonside, addonname, addonname+((len-charlimit) + charsonside))); // variable reuse...
|
||||
#undef charsonside
|
||||
else
|
||||
V_DrawThinString(x+w+5, y+i-8, V_TRANSLUCENT, addonname); // variable reuse...
|
||||
V_DrawThinString(x+w+5, y+i-8, V_TRANSLUCENT|MENUCAPS, addonname); // variable reuse...
|
||||
}
|
||||
|
||||
if (!cv_kartencore.value || gamestate == GS_TIMEATTACK || cv_newgametype.value != GT_RACE)
|
||||
@@ -10274,18 +10266,16 @@ static void M_DrawMPMainMenu(void)
|
||||
// use generic drawer for cursor, items and title
|
||||
M_DrawGenericMenu();
|
||||
|
||||
INT32 lowercase = !cv_menucaps.value ? V_ALLOWLOWERCASE : 0;
|
||||
|
||||
#ifndef NONET
|
||||
#if MAXPLAYERS != 16
|
||||
Update the maxplayers label...
|
||||
#endif
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH-x, y+MP_MainMenu[4].alphaKey,
|
||||
((itemOn == 4) ? highlightflags : 0)|lowercase, "(2-16 Players)");
|
||||
((itemOn == 4) ? highlightflags : 0)|MENUCAPS, "(2-16 Players)");
|
||||
#endif
|
||||
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH-x, y+MP_MainMenu[5].alphaKey,
|
||||
((itemOn == 5) ? highlightflags : 0)|lowercase,
|
||||
((itemOn == 5) ? highlightflags : 0)|MENUCAPS,
|
||||
"(2-4 players)"
|
||||
);
|
||||
|
||||
@@ -12632,10 +12622,8 @@ static void M_DrawVideoMenu(void)
|
||||
{
|
||||
M_DrawGenericMenu();
|
||||
|
||||
INT32 lowercase = !cv_menucaps.value ? V_ALLOWLOWERCASE : 0;
|
||||
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + OP_VideoOptionsMenu[0].alphaKey,
|
||||
(SCR_IsAspectCorrect(vid.width, vid.height) ? recommendedflags : highlightflags)|lowercase,
|
||||
(SCR_IsAspectCorrect(vid.width, vid.height) ? recommendedflags : highlightflags)|MENUCAPS,
|
||||
va("%dx%d", vid.width, vid.height));
|
||||
}
|
||||
|
||||
|
||||
+4
-10
@@ -10568,7 +10568,8 @@ void P_SpawnPlayer(INT32 playernum)
|
||||
}
|
||||
|
||||
// spawn as spectator determination
|
||||
if (multiplayer && demo.playback); // Don't mess with spectator values since the demo setup handles them already.
|
||||
if (multiplayer && demo.playback)
|
||||
; // Don't mess with spectator values since the demo setup handles them already.
|
||||
else if (!G_GametypeHasSpectators())
|
||||
p->spectator = false;
|
||||
else if (netgame && p->jointime <= 1 && pcount)
|
||||
@@ -10635,15 +10636,8 @@ void P_SpawnPlayer(INT32 playernum)
|
||||
// (usefulness: when body mobj is detached from player (who respawns),
|
||||
// the dead body mobj retains the skin through the 'spritedef' override).
|
||||
mobj->skin = &skins[p->skin];
|
||||
if (p->localskin > 0)
|
||||
{
|
||||
if (p->skinlocal)
|
||||
mobj->localskin = &localskins[p->localskin - 1];
|
||||
else
|
||||
mobj->localskin = & skins[p->localskin - 1];
|
||||
}
|
||||
else
|
||||
mobj->localskin = 0;
|
||||
|
||||
mobj->localskin = ((p->localskin > 0) ? (p->skinlocal ? &localskins[p->localskin - 1] : &skins[p->localskin - 1]) : 0);
|
||||
mobj->skinlocal = p->skinlocal;
|
||||
|
||||
mobj->health = p->health;
|
||||
|
||||
+4
-1
@@ -460,7 +460,11 @@ FUNCINLINE static ATTRINLINE void P_LoadRawVertexes(UINT8 *data)
|
||||
* \param seg Seg to compute length for.
|
||||
* \return Length in fracunits.
|
||||
*/
|
||||
#if defined (WALLSPLATS) || defined (FLOORSPLATS)
|
||||
fixed_t P_SegLength(seg_t *seg)
|
||||
#else
|
||||
static inline fixed_t P_SegLength(seg_t *seg)
|
||||
#endif
|
||||
{
|
||||
INT64 dx = (seg->v2->x - seg->v1->x)>>1;
|
||||
INT64 dy = (seg->v2->y - seg->v1->y)>>1;
|
||||
@@ -3018,7 +3022,6 @@ boolean P_SetupLevel(boolean skipprecip, boolean reloadinggamestate)
|
||||
|
||||
if (rendermode != render_none && !reloadinggamestate)
|
||||
{
|
||||
R_ResetViewInterpolation(0);
|
||||
R_ResetViewInterpolation(0);
|
||||
R_UpdateMobjInterpolators();
|
||||
}
|
||||
|
||||
@@ -88,6 +88,11 @@ SINT8 P_PartialAddGetStage(void);
|
||||
|
||||
boolean P_RunSOC(const char *socfilename);
|
||||
void P_WriteThings(lumpnum_t lump);
|
||||
|
||||
#if defined (WALLSPLATS) || defined (FLOORSPLATS)
|
||||
fixed_t P_SegLength(seg_t *seg);
|
||||
#endif
|
||||
|
||||
void P_UpdateSegLightOffset(seg_t *li);
|
||||
size_t P_PrecacheLevelFlats(void);
|
||||
void P_AllocMapHeader(INT16 i);
|
||||
|
||||
+34
-74
@@ -364,11 +364,11 @@ void P_SpawnSlope_Line(int linenum)
|
||||
// In P_SpawnSlopeLine the origin is the centerpoint of the sourcelinedef
|
||||
|
||||
fslope = line->frontsector->f_slope =
|
||||
P_MakeSlope(&point, &direction, dz, flags);
|
||||
P_MakeSlope(&point, &direction, dz, flags);
|
||||
|
||||
// Set up some shit
|
||||
fslope->extent = extent;
|
||||
fslope->refpos = 1;
|
||||
// Set up some shit
|
||||
fslope->extent = extent;
|
||||
fslope->refpos = 1;
|
||||
|
||||
// Now remember that f_slope IS a vector
|
||||
// fslope->o = origin 3D point 1 of the vector
|
||||
@@ -425,11 +425,11 @@ void P_SpawnSlope_Line(int linenum)
|
||||
dz = FixedDiv(origin.z - point.z, extent);
|
||||
|
||||
cslope = line->frontsector->c_slope =
|
||||
P_MakeSlope(&point, &direction, dz, flags);
|
||||
P_MakeSlope(&point, &direction, dz, flags);
|
||||
|
||||
// Set up some shit
|
||||
cslope->extent = extent;
|
||||
cslope->refpos = 2;
|
||||
// Set up some shit
|
||||
cslope->extent = extent;
|
||||
cslope->refpos = 2;
|
||||
|
||||
// Sync the linedata of the line that started this slope
|
||||
// TODO: Anything special for control sector based slopes later?
|
||||
@@ -494,11 +494,11 @@ void P_SpawnSlope_Line(int linenum)
|
||||
dz = FixedDiv(origin.z - point.z, extent);
|
||||
|
||||
fslope = line->backsector->f_slope =
|
||||
P_MakeSlope(&point, &direction, dz, flags);
|
||||
P_MakeSlope(&point, &direction, dz, flags);
|
||||
|
||||
// Set up some shit
|
||||
fslope->extent = extent;
|
||||
fslope->refpos = 3;
|
||||
// Set up some shit
|
||||
fslope->extent = extent;
|
||||
fslope->refpos = 3;
|
||||
|
||||
// Sync the linedata of the line that started this slope
|
||||
// TODO: Anything special for control sector based slopes later?
|
||||
@@ -531,6 +531,7 @@ void P_SpawnSlope_Line(int linenum)
|
||||
|
||||
P_CalculateSlopeNormal(fslope);
|
||||
}
|
||||
|
||||
if (backceil)
|
||||
{
|
||||
fixed_t highest, lowest;
|
||||
@@ -540,11 +541,11 @@ void P_SpawnSlope_Line(int linenum)
|
||||
dz = FixedDiv(origin.z - point.z, extent);
|
||||
|
||||
cslope = line->backsector->c_slope =
|
||||
P_MakeSlope(&point, &direction, dz, flags);
|
||||
P_MakeSlope(&point, &direction, dz, flags);
|
||||
|
||||
// Set up some shit
|
||||
cslope->extent = extent;
|
||||
cslope->refpos = 4;
|
||||
// Set up some shit
|
||||
cslope->extent = extent;
|
||||
cslope->refpos = 4;
|
||||
|
||||
// Sync the linedata of the line that started this slope
|
||||
// TODO: Anything special for control sector based slopes later?
|
||||
@@ -604,7 +605,8 @@ static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag
|
||||
memset(ret->vertices, 0, 3*sizeof(mapthing_t));
|
||||
|
||||
// And... look for the vertices in question.
|
||||
for (i = 0; i < nummapthings; i++, mt++) {
|
||||
for (i = 0; i < nummapthings; i++, mt++)
|
||||
{
|
||||
if (mt->type != 750) // Haha, I'm hijacking the old Chaos Spawn thingtype for something!
|
||||
continue;
|
||||
|
||||
@@ -617,7 +619,8 @@ static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag
|
||||
}
|
||||
|
||||
// Now set heights for each vertex, because they haven't been set yet
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
mt = ret->vertices[i];
|
||||
if (!mt) // If a vertex wasn't found, it's game over. There's nothing you can do to recover (except maybe try and kill the slope instead - TODO?)
|
||||
I_Error("P_NewVertexSlope: Slope vertex %s (for linedef tag %d) not found!", sizeu1(i), tag1);
|
||||
@@ -649,23 +652,23 @@ static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag
|
||||
//
|
||||
void P_CopySectorSlope(line_t *line)
|
||||
{
|
||||
sector_t *fsec = line->frontsector;
|
||||
int i, special = line->special;
|
||||
sector_t *fsec = line->frontsector;
|
||||
int i, special = line->special;
|
||||
|
||||
// Check for copy linedefs
|
||||
for(i = -1; (i = P_FindSectorFromLineTag(line, i)) >= 0;)
|
||||
{
|
||||
sector_t *srcsec = sectors + i;
|
||||
// Check for copy linedefs
|
||||
for(i = -1; (i = P_FindSectorFromLineTag(line, i)) >= 0;)
|
||||
{
|
||||
sector_t *srcsec = sectors + i;
|
||||
|
||||
if((special - 719) & 1 && !fsec->f_slope && srcsec->f_slope)
|
||||
fsec->f_slope = srcsec->f_slope; //P_CopySlope(srcsec->f_slope);
|
||||
if((special - 719) & 2 && !fsec->c_slope && srcsec->c_slope)
|
||||
fsec->c_slope = srcsec->c_slope; //P_CopySlope(srcsec->c_slope);
|
||||
}
|
||||
if((special - 719) & 1 && !fsec->f_slope && srcsec->f_slope)
|
||||
fsec->f_slope = srcsec->f_slope; //P_CopySlope(srcsec->f_slope);
|
||||
if((special - 719) & 2 && !fsec->c_slope && srcsec->c_slope)
|
||||
fsec->c_slope = srcsec->c_slope; //P_CopySlope(srcsec->c_slope);
|
||||
}
|
||||
|
||||
fsec->hasslope = true;
|
||||
fsec->hasslope = true;
|
||||
|
||||
line->special = 0; // Linedef was use to set slopes, it finished its job, so now make it a normal linedef
|
||||
line->special = 0; // Linedef was use to set slopes, it finished its job, so now make it a normal linedef
|
||||
}
|
||||
|
||||
//
|
||||
@@ -790,49 +793,6 @@ void P_ResetDynamicSlopes(void)
|
||||
// Various utilities related to slopes
|
||||
//
|
||||
|
||||
//
|
||||
// P_GetZAt
|
||||
//
|
||||
// Returns the height of the sloped plane at (x, y) as a fixed_t
|
||||
//
|
||||
fixed_t P_GetZAt(pslope_t *slope, fixed_t x, fixed_t y)
|
||||
{
|
||||
fixed_t dist = FixedMul(x - slope->o.x, slope->d.x) +
|
||||
FixedMul(y - slope->o.y, slope->d.y);
|
||||
|
||||
return slope->o.z + FixedMul(dist, slope->zdelta);
|
||||
}
|
||||
|
||||
// Returns the height of the sector floor at (x, y)
|
||||
fixed_t P_GetSectorFloorZAt(const sector_t *sector, fixed_t x, fixed_t y)
|
||||
{
|
||||
return sector->f_slope ? P_GetZAt(sector->f_slope, x, y) : sector->floorheight;
|
||||
}
|
||||
|
||||
// Returns the height of the sector ceiling at (x, y)
|
||||
fixed_t P_GetSectorCeilingZAt(const sector_t *sector, fixed_t x, fixed_t y)
|
||||
{
|
||||
return sector->c_slope ? P_GetZAt(sector->c_slope, x, y) : sector->ceilingheight;
|
||||
}
|
||||
|
||||
// Returns the height of the FOF top at (x, y)
|
||||
fixed_t P_GetFFloorTopZAt(const ffloor_t *ffloor, fixed_t x, fixed_t y)
|
||||
{
|
||||
return *ffloor->t_slope ? P_GetZAt(*ffloor->t_slope, x, y) : *ffloor->topheight;
|
||||
}
|
||||
|
||||
// Returns the height of the FOF bottom at (x, y)
|
||||
fixed_t P_GetFFloorBottomZAt(const ffloor_t *ffloor, fixed_t x, fixed_t y)
|
||||
{
|
||||
return *ffloor->b_slope ? P_GetZAt(*ffloor->b_slope, x, y) : *ffloor->bottomheight;
|
||||
}
|
||||
|
||||
// Returns the height of the light list at (x, y)
|
||||
fixed_t P_GetLightZAt(const lightlist_t *light, fixed_t x, fixed_t y)
|
||||
{
|
||||
return light->slope ? P_GetZAt(light->slope, x, y) : light->height;
|
||||
}
|
||||
|
||||
//
|
||||
// P_QuantizeMomentumToSlope
|
||||
//
|
||||
|
||||
+37
-8
@@ -13,9 +13,12 @@
|
||||
#ifndef P_SLOPES_H__
|
||||
#define P_SLOPES_H__
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
void P_CalculateSlopeNormal(pslope_t *slope);
|
||||
void P_ResetDynamicSlopes(void);
|
||||
void P_RunDynamicSlopes(void);
|
||||
|
||||
// P_SpawnSlope_Line
|
||||
// Creates one or more slopes based on the given line type and front/back
|
||||
// sectors.
|
||||
@@ -30,19 +33,45 @@ void P_CopySectorSlope(line_t *line);
|
||||
|
||||
pslope_t *P_SlopeById(UINT16 id);
|
||||
|
||||
//
|
||||
// P_GetZAt
|
||||
//
|
||||
|
||||
// Returns the height of the sloped plane at (x, y) as a fixed_t
|
||||
fixed_t P_GetZAt(pslope_t *slope, fixed_t x, fixed_t y);
|
||||
FUNCINLINE static ATTRINLINE fixed_t P_GetZAt(pslope_t *z_slope, fixed_t x, fixed_t y)
|
||||
{
|
||||
return z_slope->o.z + FixedMul((FixedMul(x - z_slope->o.x, z_slope->d.x) + FixedMul(y - z_slope->o.y, z_slope->d.y)), z_slope->zdelta);
|
||||
}
|
||||
|
||||
// Returns the height of the sector at (x, y)
|
||||
fixed_t P_GetSectorFloorZAt (const sector_t *sector, fixed_t x, fixed_t y);
|
||||
fixed_t P_GetSectorCeilingZAt(const sector_t *sector, fixed_t x, fixed_t y);
|
||||
// Returns the height of the sector floor at (x, y)
|
||||
FUNCINLINE static ATTRINLINE fixed_t P_GetSectorFloorZAt(const sector_t *z_sector, fixed_t x, fixed_t y)
|
||||
{
|
||||
return z_sector->f_slope ? P_GetZAt(z_sector->f_slope, x, y) : z_sector->floorheight;
|
||||
}
|
||||
|
||||
// Returns the height of the FOF at (x, y)
|
||||
fixed_t P_GetFFloorTopZAt (const ffloor_t *ffloor, fixed_t x, fixed_t y);
|
||||
fixed_t P_GetFFloorBottomZAt(const ffloor_t *ffloor, fixed_t x, fixed_t y);
|
||||
// Returns the height of the sector ceiling at (x, y)
|
||||
FUNCINLINE static ATTRINLINE fixed_t P_GetSectorCeilingZAt(const sector_t *z_sector, fixed_t x, fixed_t y)
|
||||
{
|
||||
return z_sector->c_slope ? P_GetZAt(z_sector->c_slope, x, y) : z_sector->ceilingheight;
|
||||
}
|
||||
|
||||
// Returns the height of the FOF top at (x, y)
|
||||
FUNCINLINE static ATTRINLINE fixed_t P_GetFFloorTopZAt(const ffloor_t *z_ffloor, fixed_t x, fixed_t y)
|
||||
{
|
||||
return *z_ffloor->t_slope ? P_GetZAt(*z_ffloor->t_slope, x, y) : *z_ffloor->topheight;
|
||||
}
|
||||
|
||||
// Returns the height of the FOF bottom at (x, y)
|
||||
FUNCINLINE static ATTRINLINE fixed_t P_GetFFloorBottomZAt(const ffloor_t *z_ffloor, fixed_t x, fixed_t y)
|
||||
{
|
||||
return *z_ffloor->b_slope ? P_GetZAt(*z_ffloor->b_slope, x, y) : *z_ffloor->bottomheight;
|
||||
}
|
||||
|
||||
// Returns the height of the light list at (x, y)
|
||||
fixed_t P_GetLightZAt(const lightlist_t *light, fixed_t x, fixed_t y);
|
||||
FUNCINLINE static ATTRINLINE fixed_t P_GetLightZAt(const lightlist_t *z_light, fixed_t x, fixed_t y)
|
||||
{
|
||||
return z_light->slope ? P_GetZAt(z_light->slope, x, y) : z_light->height;
|
||||
}
|
||||
|
||||
// Lots of physics-based bullshit
|
||||
void P_QuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope);
|
||||
|
||||
+3
-2
@@ -2084,6 +2084,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||
mo->y += y;
|
||||
mo->z += z;
|
||||
P_SetThingPosition(mo);
|
||||
mo->old_x = mo->x;
|
||||
mo->old_y = mo->y;
|
||||
mo->old_z = mo->z;
|
||||
|
||||
if (mo->player)
|
||||
{
|
||||
@@ -2102,7 +2105,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||
camera[i].reset = true;
|
||||
camera[i].subsector = R_PointInSubsector(camera[i].x, camera[i].y);
|
||||
R_RelativeTeleportViewInterpolation(i, x, y, z, 0);
|
||||
R_ResetViewInterpolation(i + 1); // reset view interp as well
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2520,7 +2522,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||
if (displayplayers[i] == (mo->player - players))
|
||||
{
|
||||
R_ResetViewInterpolation(i + 1);
|
||||
R_ResetViewInterpolation(i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
-3
@@ -434,10 +434,21 @@ void P_Ticker(boolean run)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
//Increment jointime even if paused.
|
||||
// Increment jointime and quittime even if paused
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i])
|
||||
++players[i].jointime;
|
||||
{
|
||||
players[i].jointime++;
|
||||
}
|
||||
}
|
||||
|
||||
if (run)
|
||||
{
|
||||
// Update old view state BEFORE ticking so resetting
|
||||
// the old interpolation state from game logic works.
|
||||
R_UpdateViewInterpolation();
|
||||
}
|
||||
|
||||
if (objectplacing)
|
||||
{
|
||||
@@ -669,7 +680,6 @@ void P_Ticker(boolean run)
|
||||
if (run)
|
||||
{
|
||||
R_UpdateLevelInterpolators();
|
||||
R_UpdateViewInterpolation();
|
||||
|
||||
// Hack: ensure newview is assigned every tic.
|
||||
// Ensures view interpolation is T-1 to T in poor network conditions
|
||||
|
||||
+2
-1
@@ -3995,7 +3995,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||
{
|
||||
P_MoveChaseCamera(player, thiscam, false);
|
||||
R_ResetViewInterpolation(num + 1);
|
||||
R_ResetViewInterpolation(num + 1);
|
||||
}
|
||||
|
||||
return (x == thiscam->x && y == thiscam->y && z == thiscam->z && angle == thiscam->aiming);
|
||||
@@ -4214,6 +4213,8 @@ void P_DoTimeOver(player_t *player)
|
||||
|
||||
player->pflags |= PF_TIMEOVER;
|
||||
|
||||
demo.savebutton = leveltime;
|
||||
|
||||
if (P_IsLocalPlayer(player) && !demo.playback)
|
||||
legitimateexit = true; // SRB2kart: losing a race is still seeing it through to the end :p
|
||||
|
||||
|
||||
+10
-2
@@ -23,6 +23,7 @@
|
||||
#include "r_state.h"
|
||||
#include "z_zone.h"
|
||||
#include "console.h" // con_startup_loadprogress
|
||||
#include "i_time.h"
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_main.h" // for cv_grshearing
|
||||
@@ -79,6 +80,7 @@ static viewvars_t skyview_old[MAXSPLITSCREENPLAYERS];
|
||||
static viewvars_t skyview_new[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
static viewvars_t *oldview = &pview_old[0];
|
||||
static tic_t last_view_update;
|
||||
static int oldview_invalid[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
|
||||
viewvars_t *newview = &pview_new[0];
|
||||
|
||||
@@ -207,21 +209,27 @@ void R_UpdateViewInterpolation(void)
|
||||
|
||||
if (oldview_invalid[i]) oldview_invalid[i]--;
|
||||
}
|
||||
|
||||
last_view_update = I_GetTime();
|
||||
}
|
||||
|
||||
void R_ResetViewInterpolation(UINT8 p)
|
||||
{
|
||||
// Wait an extra tic if the interpolation state hasn't
|
||||
// updated yet.
|
||||
int t = ((last_view_update == I_GetTime()) ? 1 : 2);
|
||||
|
||||
if (p == 0)
|
||||
{
|
||||
UINT8 i;
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
oldview_invalid[i]++;
|
||||
oldview_invalid[i] = t;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oldview_invalid[p - 1]++;
|
||||
oldview_invalid[p - 1] = t;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -842,8 +842,8 @@ patch_t *Patch_GetRotatedSprite(spriteframe_t *sprite, size_t frame, size_t spri
|
||||
}
|
||||
else
|
||||
{
|
||||
xpivot = patch->leftoffset;
|
||||
ypivot = patch->height / 2;
|
||||
xpivot = SHORT(patch->leftoffset);
|
||||
ypivot = SHORT(patch->height) / 2;
|
||||
}
|
||||
|
||||
RotatedPatch_DoRotation(rotsprite, patch, rotationangle, xpivot, ypivot, flip);
|
||||
@@ -902,9 +902,9 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
|
||||
size_t size;
|
||||
INT32 bflip = (flip != 0x00);
|
||||
|
||||
INT32 width = patch->width;
|
||||
INT32 height = patch->height;
|
||||
INT32 leftoffset = patch->leftoffset;
|
||||
INT32 width = SHORT(patch->width);
|
||||
INT32 height = SHORT(patch->height);
|
||||
INT32 leftoffset = SHORT(patch->leftoffset);
|
||||
INT32 newwidth, newheight;
|
||||
|
||||
fixed_t ca = rollcosang[angle];
|
||||
@@ -975,7 +975,7 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
|
||||
}
|
||||
|
||||
ox = (newwidth / 2) + (leftoffset - xpivot);
|
||||
oy = (newheight / 2) + (patch->topoffset - ypivot);
|
||||
oy = (newheight / 2) + (SHORT(patch->topoffset) - ypivot);
|
||||
width = (maxx - minx);
|
||||
height = (maxy - miny);
|
||||
|
||||
|
||||
@@ -59,9 +59,6 @@ typedef struct floorsplat_s
|
||||
struct floorsplat_s *nextvis;
|
||||
} floorsplat_t;
|
||||
|
||||
// p_setup.c
|
||||
fixed_t P_SegLength(seg_t *seg);
|
||||
|
||||
// call at P_SetupLevel()
|
||||
void R_ClearLevelSplats(void);
|
||||
|
||||
|
||||
+14
-13
@@ -2191,11 +2191,11 @@ static boolean oldencore = false;
|
||||
static boolean skipmusic = false;
|
||||
boolean skipintromus = false;
|
||||
|
||||
static const char *musicexception_list[16] = {
|
||||
static const char *musicexception_list[17] = {
|
||||
"vote", "voteea", "voteeb", "racent", "krwin",
|
||||
"krok", "krlose", "krfail", "kbwin", "kbok",
|
||||
"kblose", "kstart", "estart", "wait2j", "CHRSHP",
|
||||
"CHRSHF"
|
||||
"kblose", "kstart", "estart", "wait2j", "titles",
|
||||
"CHRSHF", "CHRSHP" // no clue what those are tbh
|
||||
};
|
||||
|
||||
//checks for any kind of event music like intermission, vote etc.
|
||||
@@ -2207,7 +2207,7 @@ static void S_CheckEventMus(const char *newmus)
|
||||
if (!cv_keepmusic.value)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
for (int i = 0; i < 17; i++)
|
||||
if (stricmp(music_name, musicexception_list[i]) == 0 || stricmp(newmus, musicexception_list[i]) == 0) // weird? sure! but were lucky enough newmus reflects whats being replaced
|
||||
{
|
||||
skipmusic = true;
|
||||
@@ -2242,15 +2242,7 @@ void S_CheckMap(void)
|
||||
//
|
||||
void S_InitMapMusic(void)
|
||||
{
|
||||
if (!cv_skipintromusic.value)
|
||||
skipintromus = false;
|
||||
else
|
||||
{
|
||||
char *maptitle = G_BuildMapTitle(gamemap);
|
||||
skipintromus = cv_skipintromusic.value && stricmp(maptitle, "Wandering Falls") != 0; // thanks diggle!
|
||||
if (maptitle)
|
||||
Z_Free(maptitle);
|
||||
}
|
||||
skipintromus = false;
|
||||
|
||||
if (mapmusflags & MUSIC_RELOADRESET)
|
||||
{
|
||||
@@ -2268,6 +2260,15 @@ void S_InitMapMusic(void)
|
||||
// lug: but not when we keep the map music lol
|
||||
S_StopMusic();
|
||||
|
||||
if (cv_skipintromusic.value)
|
||||
{
|
||||
char *maptitle = G_BuildMapTitle(gamemap);
|
||||
// for some reason, occasionally the title screen music doesent seem to be reset in time, so skipping the intro may make it just continue playing it instead, weird..
|
||||
skipintromus = (stricmp(music_name, "titles") != 0) && (stricmp(maptitle, "Wandering Falls") != 0); // thanks diggle!
|
||||
if (maptitle)
|
||||
Z_Free(maptitle);
|
||||
}
|
||||
|
||||
if (skipintromus)
|
||||
return;
|
||||
|
||||
|
||||
@@ -182,6 +182,9 @@ void V_DrawFadeScreen(UINT16 color, UINT8 strength);
|
||||
|
||||
void V_DrawFadeConsBack(INT32 plines);
|
||||
|
||||
// allow menu text to be displayed in lowercase
|
||||
#define MENUCAPS (!cv_menucaps.value ? V_ALLOWLOWERCASE : 0)
|
||||
|
||||
// draw a single character
|
||||
void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed);
|
||||
// draw a single character, but for the chat
|
||||
|
||||
+12
-6
@@ -463,14 +463,12 @@ void Y_IntermissionDrawer(void)
|
||||
|
||||
for (i = 0; i < data.match.numplayers; i++)
|
||||
{
|
||||
boolean dojitter = data.match.jitter[data.match.num[i]];
|
||||
data.match.jitter[data.match.num[i]] = 0;
|
||||
|
||||
if (data.match.num[i] != MAXPLAYERS && playeringame[data.match.num[i]] && !players[data.match.num[i]].spectator)
|
||||
{
|
||||
char strtime[MAXPLAYERNAME+1];
|
||||
|
||||
if (dojitter)
|
||||
// Apply the jitter offset (later reversed)
|
||||
if (data.match.jitter[data.match.num[i]] > 0)
|
||||
y--;
|
||||
|
||||
V_DrawCenteredString(x+6, y, 0, va("%d", data.match.pos[i]));
|
||||
@@ -559,7 +557,7 @@ void Y_IntermissionDrawer(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (dojitter)
|
||||
if (data.match.jitter[data.match.num[i]] > 0)
|
||||
y++;
|
||||
}
|
||||
else
|
||||
@@ -666,8 +664,16 @@ void Y_Ticker(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (intertic < TICRATE || intertic & 1 || endtic != -1)
|
||||
if (intertic < TICRATE || endtic != -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.match.rankingsmode && intertic & 1)
|
||||
{
|
||||
memset(data.match.jitter, 0, sizeof (data.match.jitter));
|
||||
return;
|
||||
}
|
||||
|
||||
if (intertype == int_race || intertype == int_match)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user