mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Merge branch 'next' into platform-fixes
This commit is contained in:
commit
d67388ece0
13 changed files with 151 additions and 130 deletions
|
@ -2695,8 +2695,18 @@ static void F_FigureActiveTtScale(void)
|
|||
SINT8 newttscale = max(1, min(6, vid.dupx));
|
||||
SINT8 oldttscale = activettscale;
|
||||
|
||||
if (newttscale == testttscale)
|
||||
return;
|
||||
if (needpatchrecache)
|
||||
ttloaded[0] = ttloaded[1] = ttloaded[2] = ttloaded[3] = ttloaded[4] = ttloaded[5] = 0;
|
||||
else
|
||||
{
|
||||
if (newttscale == testttscale)
|
||||
return;
|
||||
|
||||
// We have a new ttscale, so load gfx
|
||||
if(oldttscale > 0)
|
||||
F_UnloadAlacroixGraphics(oldttscale);
|
||||
}
|
||||
|
||||
testttscale = newttscale;
|
||||
|
||||
// If ttscale is unavailable: look for lower scales, then higher scales.
|
||||
|
@ -2714,10 +2724,6 @@ static void F_FigureActiveTtScale(void)
|
|||
|
||||
activettscale = (newttscale >= 1 && newttscale <= 6) ? newttscale : 0;
|
||||
|
||||
// We have a new ttscale, so load gfx
|
||||
if(oldttscale > 0)
|
||||
F_UnloadAlacroixGraphics(oldttscale);
|
||||
|
||||
if(activettscale > 0)
|
||||
F_LoadAlacroixGraphics(activettscale);
|
||||
}
|
||||
|
@ -2759,12 +2765,6 @@ void F_TitleScreenDrawer(void)
|
|||
return;
|
||||
#endif
|
||||
|
||||
if (needpatchrecache && (curttmode == TTMODE_ALACROIX))
|
||||
{
|
||||
ttloaded[0] = ttloaded[1] = ttloaded[2] = ttloaded[3] = ttloaded[4] = ttloaded[5] = 0;
|
||||
F_LoadAlacroixGraphics(activettscale);
|
||||
}
|
||||
|
||||
switch(curttmode)
|
||||
{
|
||||
case TTMODE_OLD:
|
||||
|
@ -3630,7 +3630,6 @@ void F_StartContinue(void)
|
|||
}
|
||||
|
||||
wipestyleflags = WSF_FADEOUT;
|
||||
F_TryColormapFade(31);
|
||||
G_SetGamestate(GS_CONTINUING);
|
||||
gameaction = ga_nothing;
|
||||
|
||||
|
|
|
@ -1941,6 +1941,10 @@ boolean G_IsTitleCardAvailable(void)
|
|||
if (gametyperules & GTR_NOTITLECARD)
|
||||
return false;
|
||||
|
||||
// The current level has no name.
|
||||
if (!mapheaderinfo[gamemap-1]->lvlttl[0])
|
||||
return false;
|
||||
|
||||
// The title card is available.
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -5325,7 +5325,7 @@ static void HWR_AddSprites(sector_t *sec)
|
|||
#ifdef HWPRECIP
|
||||
precipmobj_t *precipthing;
|
||||
#endif
|
||||
fixed_t approx_dist, limit_dist, hoop_limit_dist;
|
||||
fixed_t limit_dist, hoop_limit_dist;
|
||||
|
||||
// BSP is traversed by subsector.
|
||||
// A sector might have been split into several
|
||||
|
@ -5344,35 +5344,10 @@ static void HWR_AddSprites(sector_t *sec)
|
|||
// If a limit exists, handle things a tiny bit different.
|
||||
limit_dist = (fixed_t)(cv_drawdist.value) << FRACBITS;
|
||||
hoop_limit_dist = (fixed_t)(cv_drawdist_nights.value) << FRACBITS;
|
||||
if (limit_dist || hoop_limit_dist)
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
{
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
{
|
||||
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
||||
continue;
|
||||
|
||||
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
|
||||
|
||||
if (thing->sprite == SPR_HOOP)
|
||||
{
|
||||
if (hoop_limit_dist && approx_dist > hoop_limit_dist)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (limit_dist && approx_dist > limit_dist)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (R_ThingVisibleWithinDist(thing, limit_dist, hoop_limit_dist))
|
||||
HWR_ProjectSprite(thing);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw everything in sector, no checks
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
if (!(thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW))
|
||||
HWR_ProjectSprite(thing);
|
||||
}
|
||||
|
||||
#ifdef HWPRECIP
|
||||
|
@ -5381,15 +5356,8 @@ static void HWR_AddSprites(sector_t *sec)
|
|||
{
|
||||
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
|
||||
{
|
||||
if (precipthing->precipflags & PCF_INVISIBLE)
|
||||
continue;
|
||||
|
||||
approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y);
|
||||
|
||||
if (approx_dist > limit_dist)
|
||||
continue;
|
||||
|
||||
HWR_ProjectPrecipitationSprite(precipthing);
|
||||
if (R_PrecipThingVisible(precipthing, limit_dist))
|
||||
HWR_ProjectPrecipitationSprite(precipthing);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -5643,7 +5611,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer)
|
||||
{
|
||||
// bodge support - not nearly as comprehensive as r_things.c, but better than nothing
|
||||
if (thing->tracer->sprite == SPR_NULL || thing->tracer->flags2 & MF2_DONTDRAW)
|
||||
if (! R_ThingVisible(thing->tracer))
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1437,7 +1437,7 @@ static void HU_drawMiniChat(void)
|
|||
|
||||
for (; i>0; i--)
|
||||
{
|
||||
const char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i-1]);
|
||||
char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i-1]);
|
||||
size_t j = 0;
|
||||
INT32 linescount = 0;
|
||||
|
||||
|
@ -1479,6 +1479,9 @@ static void HU_drawMiniChat(void)
|
|||
dy = 0;
|
||||
dx = 0;
|
||||
msglines += linescount+1;
|
||||
|
||||
if (msg)
|
||||
Z_Free(msg);
|
||||
}
|
||||
|
||||
y = chaty - charheight*(msglines+1);
|
||||
|
@ -1501,7 +1504,7 @@ static void HU_drawMiniChat(void)
|
|||
INT32 timer = ((cv_chattime.value*TICRATE)-chat_timers[i]) - cv_chattime.value*TICRATE+9; // see below...
|
||||
INT32 transflag = (timer >= 0 && timer <= 9) ? (timer*V_10TRANS) : 0; // you can make bad jokes out of this one.
|
||||
size_t j = 0;
|
||||
const char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i]); // get the current message, and word wrap it.
|
||||
char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i]); // get the current message, and word wrap it.
|
||||
UINT8 *colormap = NULL;
|
||||
|
||||
while(msg[j]) // iterate through msg
|
||||
|
@ -1547,6 +1550,9 @@ static void HU_drawMiniChat(void)
|
|||
}
|
||||
dy += charheight;
|
||||
dx = 0;
|
||||
|
||||
if (msg)
|
||||
Z_Free(msg);
|
||||
}
|
||||
|
||||
// decrement addy and make that shit smooth:
|
||||
|
@ -1598,7 +1604,7 @@ static void HU_drawChatLog(INT32 offset)
|
|||
{
|
||||
INT32 clrflag = 0;
|
||||
INT32 j = 0;
|
||||
const char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_log[i]); // get the current message, and word wrap it.
|
||||
char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_log[i]); // get the current message, and word wrap it.
|
||||
UINT8 *colormap = NULL;
|
||||
while(msg[j]) // iterate through msg
|
||||
{
|
||||
|
@ -1638,6 +1644,9 @@ static void HU_drawChatLog(INT32 offset)
|
|||
}
|
||||
dy += charheight;
|
||||
dx = 0;
|
||||
|
||||
if (msg)
|
||||
Z_Free(msg);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6487,10 +6487,10 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
24*FRACUNIT, // radius
|
||||
24*FRACUNIT, // height
|
||||
0, // display offset
|
||||
0, // mass
|
||||
DMG_FIRE, // mass
|
||||
1, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY, // flags
|
||||
MF_NOBLOCKMAP|MF_MISSILE|MF_PAIN|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
|
@ -5602,7 +5602,8 @@ static void M_DrawNightsAttackMountains(void)
|
|||
static INT32 bgscrollx;
|
||||
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||
patch_t *background = W_CachePatchName(curbgname, PU_PATCH);
|
||||
INT32 x = FixedInt(bgscrollx) % SHORT(background->width);
|
||||
INT16 w = SHORT(background->width);
|
||||
INT32 x = FixedInt(-bgscrollx) % w;
|
||||
INT32 y = BASEVIDHEIGHT - SHORT(background->height)*2;
|
||||
|
||||
if (vid.height != BASEVIDHEIGHT * dupz)
|
||||
|
@ -5610,11 +5611,13 @@ static void M_DrawNightsAttackMountains(void)
|
|||
V_DrawFill(0, y+50, vid.width, BASEVIDHEIGHT, V_SNAPTOLEFT|31);
|
||||
|
||||
V_DrawScaledPatch(x, y, V_SNAPTOLEFT, background);
|
||||
x += SHORT(background->width);
|
||||
x += w;
|
||||
if (x < BASEVIDWIDTH)
|
||||
V_DrawScaledPatch(x, y, V_SNAPTOLEFT, background);
|
||||
|
||||
bgscrollx -= (FRACUNIT/2);
|
||||
bgscrollx += (FRACUNIT/2);
|
||||
if (bgscrollx > w<<FRACBITS)
|
||||
bgscrollx &= 0xFFFF;
|
||||
}
|
||||
|
||||
// NiGHTS Attack foreground.
|
||||
|
|
|
@ -3684,8 +3684,7 @@ boolean P_LoadLevel(boolean fromnetsave)
|
|||
return true;
|
||||
|
||||
// If so...
|
||||
if ((!(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD)) && (*mapheaderinfo[gamemap-1]->lvlttl != '\0'))
|
||||
G_PreLevelTitleCard();
|
||||
G_PreLevelTitleCard();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
15
src/p_user.c
15
src/p_user.c
|
@ -11043,10 +11043,21 @@ static void P_MinecartThink(player_t *player)
|
|||
|
||||
if (angdiff + minecart->angle != player->mo->angle && (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG))
|
||||
{
|
||||
angle_t *ang = NULL;
|
||||
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
ang = &localangle;
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
ang = &localangle2;
|
||||
|
||||
if (ang)
|
||||
{
|
||||
angdiff = *ang - minecart->angle;
|
||||
if (angdiff < ANGLE_180 && angdiff > MINECARTCONEMAX)
|
||||
*ang = minecart->angle + MINECARTCONEMAX;
|
||||
else if (angdiff > ANGLE_180 && angdiff < InvAngle(MINECARTCONEMAX))
|
||||
*ang = minecart->angle - MINECARTCONEMAX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
55
src/r_main.c
55
src/r_main.c
|
@ -71,6 +71,7 @@ angle_t viewangle, aimingangle;
|
|||
fixed_t viewcos, viewsin;
|
||||
sector_t *viewsector;
|
||||
player_t *viewplayer;
|
||||
mobj_t *r_viewmobj;
|
||||
|
||||
//
|
||||
// precalculated math tables
|
||||
|
@ -742,8 +743,6 @@ subsector_t *R_PointInSubsectorOrNull(fixed_t x, fixed_t y)
|
|||
// R_SetupFrame
|
||||
//
|
||||
|
||||
static mobj_t *viewmobj;
|
||||
|
||||
// WARNING: a should be unsigned but to add with 2048, it isn't!
|
||||
#define AIMINGTODY(a) FixedDiv((FINETANGENT((2048+(((INT32)a)>>ANGLETOFINESHIFT)) & FINEMASK)*160)>>FRACBITS, fovtan)
|
||||
|
||||
|
@ -800,16 +799,16 @@ void R_SetupFrame(player_t *player)
|
|||
if (player->awayviewtics)
|
||||
{
|
||||
// cut-away view stuff
|
||||
viewmobj = player->awayviewmobj; // should be a MT_ALTVIEWMAN
|
||||
I_Assert(viewmobj != NULL);
|
||||
viewz = viewmobj->z + 20*FRACUNIT;
|
||||
r_viewmobj = player->awayviewmobj; // should be a MT_ALTVIEWMAN
|
||||
I_Assert(r_viewmobj != NULL);
|
||||
viewz = r_viewmobj->z + 20*FRACUNIT;
|
||||
aimingangle = player->awayviewaiming;
|
||||
viewangle = viewmobj->angle;
|
||||
viewangle = r_viewmobj->angle;
|
||||
}
|
||||
else if (!player->spectator && chasecam)
|
||||
// use outside cam view
|
||||
{
|
||||
viewmobj = NULL;
|
||||
r_viewmobj = NULL;
|
||||
viewz = thiscam->z + (thiscam->height>>1);
|
||||
aimingangle = thiscam->aiming;
|
||||
viewangle = thiscam->angle;
|
||||
|
@ -819,11 +818,11 @@ void R_SetupFrame(player_t *player)
|
|||
{
|
||||
viewz = player->viewz;
|
||||
|
||||
viewmobj = player->mo;
|
||||
I_Assert(viewmobj != NULL);
|
||||
r_viewmobj = player->mo;
|
||||
I_Assert(r_viewmobj != NULL);
|
||||
|
||||
aimingangle = player->aiming;
|
||||
viewangle = viewmobj->angle;
|
||||
viewangle = r_viewmobj->angle;
|
||||
|
||||
if (!demoplayback && player->playerstate != PST_DEAD)
|
||||
{
|
||||
|
@ -857,13 +856,13 @@ void R_SetupFrame(player_t *player)
|
|||
}
|
||||
else
|
||||
{
|
||||
viewx = viewmobj->x;
|
||||
viewy = viewmobj->y;
|
||||
viewx = r_viewmobj->x;
|
||||
viewy = r_viewmobj->y;
|
||||
viewx += quake.x;
|
||||
viewy += quake.y;
|
||||
|
||||
if (viewmobj->subsector)
|
||||
viewsector = viewmobj->subsector->sector;
|
||||
if (r_viewmobj->subsector)
|
||||
viewsector = r_viewmobj->subsector->sector;
|
||||
else
|
||||
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
||||
}
|
||||
|
@ -885,12 +884,12 @@ void R_SkyboxFrame(player_t *player)
|
|||
thiscam = &camera;
|
||||
|
||||
// cut-away view stuff
|
||||
viewmobj = skyboxmo[0];
|
||||
r_viewmobj = skyboxmo[0];
|
||||
#ifdef PARANOIA
|
||||
if (!viewmobj)
|
||||
if (!r_viewmobj)
|
||||
{
|
||||
const size_t playeri = (size_t)(player - players);
|
||||
I_Error("R_SkyboxFrame: viewmobj null (player %s)", sizeu1(playeri));
|
||||
I_Error("R_SkyboxFrame: r_viewmobj null (player %s)", sizeu1(playeri));
|
||||
}
|
||||
#endif
|
||||
if (player->awayviewtics)
|
||||
|
@ -921,13 +920,13 @@ void R_SkyboxFrame(player_t *player)
|
|||
}
|
||||
}
|
||||
}
|
||||
viewangle += viewmobj->angle;
|
||||
viewangle += r_viewmobj->angle;
|
||||
|
||||
viewplayer = player;
|
||||
|
||||
viewx = viewmobj->x;
|
||||
viewy = viewmobj->y;
|
||||
viewz = viewmobj->z; // 26/04/17: use actual Z position instead of spawnpoint angle!
|
||||
viewx = r_viewmobj->x;
|
||||
viewy = r_viewmobj->y;
|
||||
viewz = r_viewmobj->z; // 26/04/17: use actual Z position instead of spawnpoint angle!
|
||||
|
||||
if (mapheaderinfo[gamemap-1])
|
||||
{
|
||||
|
@ -967,29 +966,29 @@ void R_SkyboxFrame(player_t *player)
|
|||
else if (mh->skybox_scaley < 0)
|
||||
y = (campos.y - skyboxmo[1]->y) * -mh->skybox_scaley;
|
||||
|
||||
if (viewmobj->angle == 0)
|
||||
if (r_viewmobj->angle == 0)
|
||||
{
|
||||
viewx += x;
|
||||
viewy += y;
|
||||
}
|
||||
else if (viewmobj->angle == ANGLE_90)
|
||||
else if (r_viewmobj->angle == ANGLE_90)
|
||||
{
|
||||
viewx -= y;
|
||||
viewy += x;
|
||||
}
|
||||
else if (viewmobj->angle == ANGLE_180)
|
||||
else if (r_viewmobj->angle == ANGLE_180)
|
||||
{
|
||||
viewx -= x;
|
||||
viewy -= y;
|
||||
}
|
||||
else if (viewmobj->angle == ANGLE_270)
|
||||
else if (r_viewmobj->angle == ANGLE_270)
|
||||
{
|
||||
viewx += y;
|
||||
viewy -= x;
|
||||
}
|
||||
else
|
||||
{
|
||||
angle_t ang = viewmobj->angle>>ANGLETOFINESHIFT;
|
||||
angle_t ang = r_viewmobj->angle>>ANGLETOFINESHIFT;
|
||||
viewx += FixedMul(x,FINECOSINE(ang)) - FixedMul(y, FINESINE(ang));
|
||||
viewy += FixedMul(x, FINESINE(ang)) + FixedMul(y,FINECOSINE(ang));
|
||||
}
|
||||
|
@ -1000,8 +999,8 @@ void R_SkyboxFrame(player_t *player)
|
|||
viewz += campos.z * -mh->skybox_scalez;
|
||||
}
|
||||
|
||||
if (viewmobj->subsector)
|
||||
viewsector = viewmobj->subsector->sector;
|
||||
if (r_viewmobj->subsector)
|
||||
viewsector = r_viewmobj->subsector->sector;
|
||||
else
|
||||
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ extern fixed_t viewx, viewy, viewz;
|
|||
extern angle_t viewangle, aimingangle;
|
||||
extern sector_t *viewsector;
|
||||
extern player_t *viewplayer;
|
||||
extern mobj_t *r_viewmobj;
|
||||
|
||||
extern consvar_t cv_allowmlook;
|
||||
extern consvar_t cv_maxportals;
|
||||
|
|
|
@ -1695,7 +1695,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
|
||||
thing = thing->tracer;
|
||||
|
||||
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
||||
if (! R_ThingVisible(thing))
|
||||
return;
|
||||
|
||||
tr_x = thing->x - viewx;
|
||||
|
@ -2098,7 +2098,7 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
|||
mobj_t *thing;
|
||||
precipmobj_t *precipthing; // Tails 08-25-2002
|
||||
INT32 lightnum;
|
||||
fixed_t approx_dist, limit_dist, hoop_limit_dist;
|
||||
fixed_t limit_dist, hoop_limit_dist;
|
||||
|
||||
if (rendermode != render_soft)
|
||||
return;
|
||||
|
@ -2131,35 +2131,10 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
|||
// If a limit exists, handle things a tiny bit different.
|
||||
limit_dist = (fixed_t)(cv_drawdist.value) << FRACBITS;
|
||||
hoop_limit_dist = (fixed_t)(cv_drawdist_nights.value) << FRACBITS;
|
||||
if (limit_dist || hoop_limit_dist)
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
{
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
{
|
||||
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
||||
continue;
|
||||
|
||||
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
|
||||
|
||||
if (thing->sprite == SPR_HOOP)
|
||||
{
|
||||
if (hoop_limit_dist && approx_dist > hoop_limit_dist)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (limit_dist && approx_dist > limit_dist)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (R_ThingVisibleWithinDist(thing, limit_dist, hoop_limit_dist))
|
||||
R_ProjectSprite(thing);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw everything in sector, no checks
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
if (!(thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW))
|
||||
R_ProjectSprite(thing);
|
||||
}
|
||||
|
||||
// no, no infinite draw distance for precipitation. this option at zero is supposed to turn it off
|
||||
|
@ -2167,15 +2142,8 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
|||
{
|
||||
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
|
||||
{
|
||||
if (precipthing->precipflags & PCF_INVISIBLE)
|
||||
continue;
|
||||
|
||||
approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y);
|
||||
|
||||
if (approx_dist > limit_dist)
|
||||
continue;
|
||||
|
||||
R_ProjectPrecipitationSprite(precipthing);
|
||||
if (R_PrecipThingVisible(precipthing, limit_dist))
|
||||
R_ProjectPrecipitationSprite(precipthing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2877,6 +2845,55 @@ void R_ClipSprites(drawseg_t* dsstart, portal_t* portal)
|
|||
}
|
||||
}
|
||||
|
||||
/* Check if thing may be drawn from our current view. */
|
||||
boolean R_ThingVisible (mobj_t *thing)
|
||||
{
|
||||
return (!(
|
||||
thing->sprite == SPR_NULL ||
|
||||
( thing->flags2 & (MF2_DONTDRAW) ) ||
|
||||
thing == r_viewmobj
|
||||
));
|
||||
}
|
||||
|
||||
boolean R_ThingVisibleWithinDist (mobj_t *thing,
|
||||
fixed_t limit_dist,
|
||||
fixed_t hoop_limit_dist)
|
||||
{
|
||||
fixed_t approx_dist;
|
||||
|
||||
if (! R_ThingVisible(thing))
|
||||
return false;
|
||||
|
||||
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
|
||||
|
||||
if (thing->sprite == SPR_HOOP)
|
||||
{
|
||||
if (hoop_limit_dist && approx_dist > hoop_limit_dist)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (limit_dist && approx_dist > limit_dist)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Check if precipitation may be drawn from our current view. */
|
||||
boolean R_PrecipThingVisible (precipmobj_t *precipthing,
|
||||
fixed_t limit_dist)
|
||||
{
|
||||
fixed_t approx_dist;
|
||||
|
||||
if (( precipthing->precipflags & PCF_INVISIBLE ))
|
||||
return false;
|
||||
|
||||
approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y);
|
||||
|
||||
return ( approx_dist <= limit_dist );
|
||||
}
|
||||
|
||||
//
|
||||
// R_DrawMasked
|
||||
//
|
||||
|
|
|
@ -59,6 +59,15 @@ void R_InitSprites(void);
|
|||
void R_ClearSprites(void);
|
||||
void R_ClipSprites(drawseg_t* dsstart, portal_t* portal);
|
||||
|
||||
boolean R_ThingVisible (mobj_t *thing);
|
||||
|
||||
boolean R_ThingVisibleWithinDist (mobj_t *thing,
|
||||
fixed_t draw_dist,
|
||||
fixed_t nights_draw_dist);
|
||||
|
||||
boolean R_PrecipThingVisible (precipmobj_t *precipthing,
|
||||
fixed_t precip_draw_dist);
|
||||
|
||||
/** Used to count the amount of masked elements
|
||||
* per portal to later group them in separate
|
||||
* drawnode lists.
|
||||
|
|
|
@ -1278,13 +1278,15 @@ void ST_preDrawTitleCard(void)
|
|||
//
|
||||
void ST_runTitleCard(void)
|
||||
{
|
||||
boolean run = !(paused || P_AutoPause());
|
||||
|
||||
if (!G_IsTitleCardAvailable())
|
||||
return;
|
||||
|
||||
if (lt_ticker >= (lt_endtime + TICRATE))
|
||||
return;
|
||||
|
||||
if (!(paused || P_AutoPause()))
|
||||
if (run || (lt_ticker < PRELEVELTIME))
|
||||
{
|
||||
// tick
|
||||
lt_ticker++;
|
||||
|
|
Loading…
Reference in a new issue