mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Cleaned up some more stuff in P_LoadLevel()
This commit is contained in:
parent
9b81821d44
commit
d00a9a42a1
6 changed files with 20 additions and 36 deletions
|
|
@ -2152,7 +2152,7 @@ lumpnum_t lastloadedmaplumpnum; // for comparative savegame
|
||||||
//
|
//
|
||||||
// Some player initialization for map start.
|
// Some player initialization for map start.
|
||||||
//
|
//
|
||||||
static void P_LevelInitStuff(void)
|
static void P_InitLevelSettings(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
boolean canresetlives = true;
|
boolean canresetlives = true;
|
||||||
|
|
@ -2277,7 +2277,7 @@ void P_LoadThingsOnly(void)
|
||||||
P_RemoveMobj((mobj_t *)think);
|
P_RemoveMobj((mobj_t *)think);
|
||||||
}
|
}
|
||||||
|
|
||||||
P_LevelInitStuff();
|
P_InitLevelSettings();
|
||||||
|
|
||||||
P_SpawnMapThings(true);
|
P_SpawnMapThings(true);
|
||||||
|
|
||||||
|
|
@ -2777,19 +2777,16 @@ static void P_InitGametype(void)
|
||||||
|
|
||||||
/** Loads a level from a lump or external wad.
|
/** Loads a level from a lump or external wad.
|
||||||
*
|
*
|
||||||
* \param skipprecip If true, don't spawn precipitation.
|
* \param fromnetsave If true, skip some stuff because we're loading a netgame snapshot.
|
||||||
* \todo Clean up, refactor, split up; get rid of the bloat.
|
* \todo Clean up, refactor, split up; get rid of the bloat.
|
||||||
*/
|
*/
|
||||||
boolean P_LoadLevel(boolean skipprecip)
|
boolean P_LoadLevel(boolean fromnetsave)
|
||||||
{
|
{
|
||||||
// use gamemap to get map number.
|
// use gamemap to get map number.
|
||||||
// 99% of the things already did, so.
|
// 99% of the things already did, so.
|
||||||
// Map header should always be in place at this point
|
// Map header should always be in place at this point
|
||||||
INT32 i, loadprecip = 1, ranspecialwipe = 0;
|
INT32 i, ranspecialwipe = 0;
|
||||||
boolean spawnemblems = true;
|
|
||||||
INT32 fromnetsave = 0;
|
|
||||||
sector_t *ss;
|
sector_t *ss;
|
||||||
boolean chase;
|
|
||||||
levelloading = true;
|
levelloading = true;
|
||||||
|
|
||||||
// This is needed. Don't touch.
|
// This is needed. Don't touch.
|
||||||
|
|
@ -2820,19 +2817,18 @@ boolean P_LoadLevel(boolean skipprecip)
|
||||||
if (cv_runscripts.value && mapheaderinfo[gamemap-1]->scriptname[0] != '#')
|
if (cv_runscripts.value && mapheaderinfo[gamemap-1]->scriptname[0] != '#')
|
||||||
P_RunLevelScript(mapheaderinfo[gamemap-1]->scriptname);
|
P_RunLevelScript(mapheaderinfo[gamemap-1]->scriptname);
|
||||||
|
|
||||||
P_LevelInitStuff();
|
P_InitLevelSettings();
|
||||||
|
|
||||||
postimgtype = postimgtype2 = postimg_none;
|
postimgtype = postimgtype2 = postimg_none;
|
||||||
|
|
||||||
if (mapheaderinfo[gamemap-1]->forcecharacter[0] != '\0')
|
if (mapheaderinfo[gamemap-1]->forcecharacter[0] != '\0')
|
||||||
P_ForceCharacter(mapheaderinfo[gamemap-1]->forcecharacter);
|
P_ForceCharacter(mapheaderinfo[gamemap-1]->forcecharacter);
|
||||||
|
|
||||||
// chasecam on in chaos, race, coop
|
|
||||||
// chasecam off in match, tag, capture the flag
|
|
||||||
chase = (!(gametyperules & GTR_FIRSTPERSON)) || (maptol & TOL_2D);
|
|
||||||
|
|
||||||
if (!dedicated)
|
if (!dedicated)
|
||||||
{
|
{
|
||||||
|
// chasecam on in first-person gametypes and 2D
|
||||||
|
boolean chase = (!(gametyperules & GTR_FIRSTPERSON)) || (maptol & TOL_2D);
|
||||||
|
|
||||||
// Salt: CV_ClearChangedFlags() messes with your settings :(
|
// Salt: CV_ClearChangedFlags() messes with your settings :(
|
||||||
/*if (!cv_cam_speed.changed)
|
/*if (!cv_cam_speed.changed)
|
||||||
CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue);*/
|
CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue);*/
|
||||||
|
|
@ -2943,14 +2939,7 @@ boolean P_LoadLevel(boolean skipprecip)
|
||||||
P_InitThinkers();
|
P_InitThinkers();
|
||||||
P_InitCachedActions();
|
P_InitCachedActions();
|
||||||
|
|
||||||
/// \note for not spawning precipitation, etc. when loading netgame snapshots
|
if (!fromnetsave && savedata.lives > 0)
|
||||||
if (skipprecip)
|
|
||||||
{
|
|
||||||
fromnetsave = 1;
|
|
||||||
loadprecip = 0;
|
|
||||||
spawnemblems = false;
|
|
||||||
}
|
|
||||||
else if (savedata.lives > 0)
|
|
||||||
{
|
{
|
||||||
numgameovers = savedata.numgameovers;
|
numgameovers = savedata.numgameovers;
|
||||||
players[consoleplayer].continues = savedata.continues;
|
players[consoleplayer].continues = savedata.continues;
|
||||||
|
|
@ -2964,9 +2953,7 @@ boolean P_LoadLevel(boolean skipprecip)
|
||||||
|
|
||||||
// internal game map
|
// internal game map
|
||||||
maplumpname = G_BuildMapName(gamemap);
|
maplumpname = G_BuildMapName(gamemap);
|
||||||
//lastloadedmaplumpnum = LUMPERROR;
|
|
||||||
lastloadedmaplumpnum = W_CheckNumForName(maplumpname);
|
lastloadedmaplumpnum = W_CheckNumForName(maplumpname);
|
||||||
|
|
||||||
if (lastloadedmaplumpnum == INT16_MAX)
|
if (lastloadedmaplumpnum == INT16_MAX)
|
||||||
I_Error("Map %s not found.\n", maplumpname);
|
I_Error("Map %s not found.\n", maplumpname);
|
||||||
|
|
||||||
|
|
@ -2991,7 +2978,7 @@ boolean P_LoadLevel(boolean skipprecip)
|
||||||
P_ResetDynamicSlopes(fromnetsave);
|
P_ResetDynamicSlopes(fromnetsave);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
P_SpawnMapThings(spawnemblems);
|
P_SpawnMapThings(!fromnetsave);
|
||||||
skyboxmo[0] = skyboxviewpnts[0];
|
skyboxmo[0] = skyboxviewpnts[0];
|
||||||
skyboxmo[1] = skyboxcenterpnts[0];
|
skyboxmo[1] = skyboxcenterpnts[0];
|
||||||
|
|
||||||
|
|
@ -3002,7 +2989,7 @@ boolean P_LoadLevel(boolean skipprecip)
|
||||||
// set up world state
|
// set up world state
|
||||||
P_SpawnSpecials(fromnetsave);
|
P_SpawnSpecials(fromnetsave);
|
||||||
|
|
||||||
if (loadprecip) // ugly hack for P_NetUnArchiveMisc (and P_LoadNetGame)
|
if (!fromnetsave) // ugly hack for P_NetUnArchiveMisc (and P_LoadNetGame)
|
||||||
P_SpawnPrecipitation();
|
P_SpawnPrecipitation();
|
||||||
|
|
||||||
#ifdef HWRENDER // not win32 only 19990829 by Kin
|
#ifdef HWRENDER // not win32 only 19990829 by Kin
|
||||||
|
|
@ -3068,7 +3055,7 @@ boolean P_LoadLevel(boolean skipprecip)
|
||||||
|
|
||||||
lastmaploaded = gamemap; // HAS to be set after saving!!
|
lastmaploaded = gamemap; // HAS to be set after saving!!
|
||||||
|
|
||||||
if (loadprecip) // uglier hack
|
if (!fromnetsave) // uglier hack
|
||||||
{ // to make a newly loaded level start on the second frame.
|
{ // to make a newly loaded level start on the second frame.
|
||||||
INT32 buf = gametic % BACKUPTICS;
|
INT32 buf = gametic % BACKUPTICS;
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ void P_SetupLevelSky(INT32 skynum, boolean global);
|
||||||
void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum);
|
void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum);
|
||||||
#endif
|
#endif
|
||||||
void P_LoadThingsOnly(void);
|
void P_LoadThingsOnly(void);
|
||||||
boolean P_LoadLevel(boolean skipprecip);
|
boolean P_LoadLevel(boolean fromnetsave);
|
||||||
boolean P_AddWadFile(const char *wadfilename);
|
boolean P_AddWadFile(const char *wadfilename);
|
||||||
boolean P_RunSOC(const char *socfilename);
|
boolean P_RunSOC(const char *socfilename);
|
||||||
void P_LoadSoundsRange(UINT16 wadnum, UINT16 first, UINT16 num);
|
void P_LoadSoundsRange(UINT16 wadnum, UINT16 first, UINT16 num);
|
||||||
|
|
|
||||||
|
|
@ -553,11 +553,8 @@ pslope_t *P_SlopeById(UINT16 id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reset slopes and read them from special lines.
|
/// Reset slopes and read them from special lines.
|
||||||
void P_ResetDynamicSlopes(const UINT32 fromsave) {
|
void P_ResetDynamicSlopes(const boolean fromsave) {
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
boolean spawnthinkers = !(boolean)fromsave;
|
|
||||||
|
|
||||||
slopelist = NULL;
|
slopelist = NULL;
|
||||||
slopecount = 0;
|
slopecount = 0;
|
||||||
|
|
||||||
|
|
@ -574,14 +571,14 @@ void P_ResetDynamicSlopes(const UINT32 fromsave) {
|
||||||
case 711:
|
case 711:
|
||||||
case 712:
|
case 712:
|
||||||
case 713:
|
case 713:
|
||||||
line_SpawnViaLine(i, spawnthinkers);
|
line_SpawnViaLine(i, !fromsave);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 704:
|
case 704:
|
||||||
case 705:
|
case 705:
|
||||||
case 714:
|
case 714:
|
||||||
case 715:
|
case 715:
|
||||||
line_SpawnViaVertexes(i, spawnthinkers);
|
line_SpawnViaVertexes(i, !fromsave);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ extern UINT16 slopecount;
|
||||||
void P_LinkSlopeThinkers (void);
|
void P_LinkSlopeThinkers (void);
|
||||||
|
|
||||||
void P_CalculateSlopeNormal(pslope_t *slope);
|
void P_CalculateSlopeNormal(pslope_t *slope);
|
||||||
void P_ResetDynamicSlopes(const UINT32 fromsave);
|
void P_ResetDynamicSlopes(const boolean fromsave);
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_CopySectorSlope
|
// P_CopySectorSlope
|
||||||
|
|
|
||||||
|
|
@ -6426,7 +6426,7 @@ static void P_ApplyFlatAlignment(line_t *master, sector_t *sector, angle_t flata
|
||||||
* as they'll just be erased by UnArchiveThinkers.
|
* as they'll just be erased by UnArchiveThinkers.
|
||||||
* \sa P_SpawnPrecipitation, P_SpawnFriction, P_SpawnPushers, P_SpawnScrollers
|
* \sa P_SpawnPrecipitation, P_SpawnFriction, P_SpawnPushers, P_SpawnScrollers
|
||||||
*/
|
*/
|
||||||
void P_SpawnSpecials(INT32 fromnetsave)
|
void P_SpawnSpecials(boolean fromnetsave)
|
||||||
{
|
{
|
||||||
sector_t *sector;
|
sector_t *sector;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ void P_SetupLevelFlatAnims(void);
|
||||||
|
|
||||||
// at map load
|
// at map load
|
||||||
void P_InitSpecials(void);
|
void P_InitSpecials(void);
|
||||||
void P_SpawnSpecials(INT32 fromnetsave);
|
void P_SpawnSpecials(boolean fromnetsave);
|
||||||
|
|
||||||
// every tic
|
// every tic
|
||||||
void P_UpdateSpecials(void);
|
void P_UpdateSpecials(void);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue