mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-19 07:51:43 +00:00
Merge branch 'rainfixes' into 'master'
Rain fixes and associated See merge request STJr/SRB2Internal!233
This commit is contained in:
commit
14a1af9396
6 changed files with 97 additions and 62 deletions
|
@ -5431,7 +5431,7 @@ static void HWR_AddSprites(sector_t *sec)
|
|||
}
|
||||
|
||||
#ifdef HWPRECIP
|
||||
// Someone seriously wants infinite draw distance for precipitation?
|
||||
// no, no infinite draw distance for precipitation. this option at zero is supposed to turn it off
|
||||
if ((limit_dist = (fixed_t)cv_drawdist_precip.value << FRACBITS))
|
||||
{
|
||||
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
|
||||
|
@ -5447,13 +5447,6 @@ static void HWR_AddSprites(sector_t *sec)
|
|||
HWR_ProjectPrecipitationSprite(precipthing);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw everything in sector, no checks
|
||||
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
|
||||
if (!(precipthing->precipflags & PCF_INVISIBLE))
|
||||
HWR_ProjectPrecipitationSprite(precipthing);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -5774,16 +5767,6 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
x1 = tr_x + x1 * rightcos;
|
||||
x2 = tr_x - x2 * rightcos;
|
||||
|
||||
// okay, we can't return now... this is a hack, but weather isn't networked, so it should be ok
|
||||
if (!(thing->precipflags & PCF_THUNK))
|
||||
{
|
||||
if (thing->precipflags & PCF_RAIN)
|
||||
P_RainThinker(thing);
|
||||
else
|
||||
P_SnowThinker(thing);
|
||||
thing->precipflags |= PCF_THUNK;
|
||||
}
|
||||
|
||||
//
|
||||
// store information in a vissprite
|
||||
//
|
||||
|
@ -5804,6 +5787,16 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
vis->ty = FIXED_TO_FLOAT(thing->z + spritecachedinfo[lumpoff].topoffset);
|
||||
|
||||
vis->precip = true;
|
||||
|
||||
// okay... this is a hack, but weather isn't networked, so it should be ok
|
||||
if (!(thing->precipflags & PCF_THUNK))
|
||||
{
|
||||
if (thing->precipflags & PCF_RAIN)
|
||||
P_RainThinker(thing);
|
||||
else
|
||||
P_SnowThinker(thing);
|
||||
thing->precipflags |= PCF_THUNK;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
59
src/m_menu.c
59
src/m_menu.c
|
@ -1193,13 +1193,12 @@ static menuitem_t OP_VideoOptionsMenu[] =
|
|||
|
||||
{IT_HEADER, NULL, "Level", NULL, 155},
|
||||
{IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 161},
|
||||
{IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist.", &cv_drawdist_nights, 166},
|
||||
{IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 171},
|
||||
{IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 176},
|
||||
{IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 166},
|
||||
{IT_STRING | IT_CVAR, NULL, "NiGHTS mode Draw Dist.", &cv_drawdist_nights, 171},
|
||||
|
||||
{IT_HEADER, NULL, "Diagnostic", NULL, 185},
|
||||
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 191},
|
||||
{IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 196},
|
||||
{IT_HEADER, NULL, "Diagnostic", NULL, 180},
|
||||
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 186},
|
||||
{IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 191},
|
||||
};
|
||||
|
||||
static menuitem_t OP_VideoModeMenu[] =
|
||||
|
@ -2674,20 +2673,35 @@ static void M_ChangeCvar(INT32 choice)
|
|||
{
|
||||
consvar_t *cv = (consvar_t *)currentMenu->menuitems[itemOn].itemaction;
|
||||
|
||||
if (choice == -1)
|
||||
{
|
||||
if (cv == &cv_playercolor)
|
||||
{
|
||||
SINT8 skinno = R_SkinAvailable(cv_chooseskin.string);
|
||||
if (skinno != -1)
|
||||
CV_SetValue(cv,skins[skinno].prefcolor);
|
||||
return;
|
||||
}
|
||||
CV_Set(cv,cv->defaultvalue);
|
||||
return;
|
||||
}
|
||||
|
||||
choice = (choice<<1) - 1;
|
||||
|
||||
if (((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_SLIDER)
|
||||
||((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_INVISSLIDER)
|
||||
||((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_NOMOD))
|
||||
{
|
||||
CV_SetValue(cv,cv->value+(choice*2-1));
|
||||
CV_SetValue(cv,cv->value+(choice));
|
||||
}
|
||||
else if (cv->flags & CV_FLOAT)
|
||||
{
|
||||
char s[20];
|
||||
sprintf(s,"%f",FIXED_TO_FLOAT(cv->value)+(choice*2-1)*(1.0f/16.0f));
|
||||
sprintf(s,"%f",FIXED_TO_FLOAT(cv->value)+(choice)*(1.0f/16.0f));
|
||||
CV_Set(cv,s);
|
||||
}
|
||||
else
|
||||
CV_AddValue(cv,choice*2-1);
|
||||
CV_AddValue(cv,choice);
|
||||
}
|
||||
|
||||
static boolean M_ChangeStringCvar(INT32 choice)
|
||||
|
@ -3123,6 +3137,23 @@ boolean M_Responder(event_t *ev)
|
|||
S_StartSound(NULL, sfx_shldls);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (routine && ((currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_ARROWS
|
||||
|| (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_CVAR))
|
||||
{
|
||||
consvar_t *cv = (consvar_t *)currentMenu->menuitems[itemOn].itemaction;
|
||||
|
||||
if (cv == &cv_chooseskin
|
||||
|| cv == &cv_nextmap
|
||||
|| cv == &cv_newgametype)
|
||||
return true;
|
||||
|
||||
if (currentMenu != &OP_SoundOptionsDef || itemOn > 3)
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
routine(-1);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Why _does_ backspace go back anyway?
|
||||
//currentMenu->lastOn = itemOn;
|
||||
//if (currentMenu->prevMenu)
|
||||
|
@ -9563,6 +9594,16 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
|
|||
S_StartSound(NULL,sfx_menu1); // Tails
|
||||
setupm_name[l-1] = 0;
|
||||
}
|
||||
else if (itemOn == 2)
|
||||
{
|
||||
UINT8 col = skins[setupm_fakeskin].prefcolor;
|
||||
if (setupm_fakecolor != col)
|
||||
{
|
||||
S_StartSound(NULL,sfx_menu1); // Tails
|
||||
setupm_fakecolor = col;
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case KEY_DEL:
|
||||
|
|
23
src/p_mobj.c
23
src/p_mobj.c
|
@ -4101,17 +4101,18 @@ void P_RainThinker(precipmobj_t *mobj)
|
|||
}
|
||||
|
||||
// adjust height
|
||||
if ((mobj->z += mobj->momz) <= mobj->floorz)
|
||||
if ((mobj->z += mobj->momz) > mobj->floorz)
|
||||
return;
|
||||
|
||||
// no splashes on sky or bottomless pits
|
||||
if (mobj->precipflags & PCF_PIT)
|
||||
{
|
||||
// no splashes on sky or bottomless pits
|
||||
if (mobj->precipflags & PCF_PIT)
|
||||
mobj->z = mobj->ceilingz;
|
||||
else
|
||||
{
|
||||
mobj->z = mobj->floorz;
|
||||
P_SetPrecipMobjState(mobj, S_SPLASH1);
|
||||
}
|
||||
mobj->z = mobj->ceilingz;
|
||||
return;
|
||||
}
|
||||
|
||||
mobj->z = mobj->floorz;
|
||||
P_SetPrecipMobjState(mobj, S_SPLASH1);
|
||||
}
|
||||
|
||||
static void P_RingThinker(mobj_t *mobj)
|
||||
|
@ -9625,7 +9626,7 @@ void P_SpawnPrecipitation(void)
|
|||
subsector_t *precipsector = NULL;
|
||||
precipmobj_t *rainmo = NULL;
|
||||
|
||||
if (dedicated || !cv_precipdensity.value || curWeather == PRECIP_NONE)
|
||||
if (dedicated || /*!cv_precipdensity*/!cv_drawdist_precip.value || curWeather == PRECIP_NONE)
|
||||
return;
|
||||
|
||||
// Use the blockmap to narrow down our placing patterns
|
||||
|
@ -9634,7 +9635,7 @@ void P_SpawnPrecipitation(void)
|
|||
basex = bmaporgx + (i % bmapwidth) * MAPBLOCKSIZE;
|
||||
basey = bmaporgy + (i / bmapwidth) * MAPBLOCKSIZE;
|
||||
|
||||
for (j = 0; j < cv_precipdensity.value; ++j)
|
||||
//for (j = 0; j < cv_precipdensity.value; ++j) -- density is 1 for us always
|
||||
{
|
||||
x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
||||
y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
||||
|
|
14
src/r_main.c
14
src/r_main.c
|
@ -98,7 +98,14 @@ static CV_PossibleValue_t drawdist_cons_t[] = {
|
|||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{3072, "3072"}, {4096, "4096"}, {6144, "6144"},
|
||||
{8192, "8192"}, {0, "Infinite"}, {0, NULL}};
|
||||
static CV_PossibleValue_t precipdensity_cons_t[] = {{0, "None"}, {1, "Light"}, {2, "Moderate"}, {4, "Heavy"}, {6, "Thick"}, {8, "V.Thick"}, {0, NULL}};
|
||||
|
||||
//static CV_PossibleValue_t precipdensity_cons_t[] = {{0, "None"}, {1, "Light"}, {2, "Moderate"}, {4, "Heavy"}, {6, "Thick"}, {8, "V.Thick"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
||||
{256, "256"}, {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{0, "None"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t translucenthud_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t maxportals_cons_t[] = {{0, "MIN"}, {12, "MAX"}, {0, NULL}}; // lmao rendering 32 portals, you're a card
|
||||
static CV_PossibleValue_t homremoval_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Flash"}, {0, NULL}};
|
||||
|
@ -126,8 +133,8 @@ consvar_t cv_translucenthud = {"translucenthud", "10", CV_SAVE, translucenthud_c
|
|||
consvar_t cv_translucency = {"translucency", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_drawdist = {"drawdist", "Infinite", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_drawdist_nights = {"drawdist_nights", "2048", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_precipdensity = {"precipdensity", "Moderate", CV_SAVE, precipdensity_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE, drawdist_precip_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
//consvar_t cv_precipdensity = {"precipdensity", "Moderate", CV_SAVE, precipdensity_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Okay, whoever said homremoval causes a performance hit should be shot.
|
||||
consvar_t cv_homremoval = {"homremoval", "No", CV_SAVE, homremoval_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -1158,7 +1165,6 @@ void R_RegisterEngineStuff(void)
|
|||
if (dedicated)
|
||||
return;
|
||||
|
||||
CV_RegisterVar(&cv_precipdensity);
|
||||
CV_RegisterVar(&cv_translucency);
|
||||
CV_RegisterVar(&cv_drawdist);
|
||||
CV_RegisterVar(&cv_drawdist_nights);
|
||||
|
|
|
@ -78,7 +78,7 @@ extern consvar_t cv_chasecam, cv_chasecam2;
|
|||
extern consvar_t cv_flipcam, cv_flipcam2;
|
||||
extern consvar_t cv_shadow, cv_shadowoffs;
|
||||
extern consvar_t cv_translucency;
|
||||
extern consvar_t cv_precipdensity, cv_drawdist, cv_drawdist_nights, cv_drawdist_precip;
|
||||
extern consvar_t cv_drawdist, cv_drawdist_nights, cv_drawdist_precip;
|
||||
extern consvar_t cv_skybox;
|
||||
extern consvar_t cv_tailspickup;
|
||||
|
||||
|
|
|
@ -1527,16 +1527,6 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
return;
|
||||
}
|
||||
|
||||
// okay, we can't return now except for vertical clipping... this is a hack, but weather isn't networked, so it should be ok
|
||||
if (!(thing->precipflags & PCF_THUNK))
|
||||
{
|
||||
if (thing->precipflags & PCF_RAIN)
|
||||
P_RainThinker(thing);
|
||||
else
|
||||
P_SnowThinker(thing);
|
||||
thing->precipflags |= PCF_THUNK;
|
||||
}
|
||||
|
||||
|
||||
//SoM: 3/17/2000: Disregard sprites that are out of view..
|
||||
gzt = thing->z + spritecachedinfo[lump].topoffset;
|
||||
|
@ -1545,7 +1535,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
if (thing->subsector->sector->cullheight)
|
||||
{
|
||||
if (R_DoCulling(thing->subsector->sector->cullheight, viewsector->cullheight, viewz, gz, gzt))
|
||||
return;
|
||||
goto weatherthink;
|
||||
}
|
||||
|
||||
// store information in a vissprite
|
||||
|
@ -1605,6 +1595,17 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
|
||||
// Fullbright
|
||||
vis->colormap = colormaps;
|
||||
|
||||
weatherthink:
|
||||
// okay... this is a hack, but weather isn't networked, so it should be ok
|
||||
if (!(thing->precipflags & PCF_THUNK))
|
||||
{
|
||||
if (thing->precipflags & PCF_RAIN)
|
||||
P_RainThinker(thing);
|
||||
else
|
||||
P_SnowThinker(thing);
|
||||
thing->precipflags |= PCF_THUNK;
|
||||
}
|
||||
}
|
||||
|
||||
// R_AddSprites
|
||||
|
@ -1669,7 +1670,7 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
|||
R_ProjectSprite(thing);
|
||||
}
|
||||
|
||||
// Someone seriously wants infinite draw distance for precipitation?
|
||||
// no, no infinite draw distance for precipitation. this option at zero is supposed to turn it off
|
||||
if ((limit_dist = (fixed_t)cv_drawdist_precip.value << FRACBITS))
|
||||
{
|
||||
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
|
||||
|
@ -1685,13 +1686,6 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
|||
R_ProjectPrecipitationSprite(precipthing);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw everything in sector, no checks
|
||||
for (precipthing = sec->preciplist; precipthing; precipthing = precipthing->snext)
|
||||
if (!(precipthing->precipflags & PCF_INVISIBLE))
|
||||
R_ProjectPrecipitationSprite(precipthing);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue