- removed redundant fields from Blood's startup info struct.

This commit is contained in:
Christoph Oelckers 2020-08-16 11:58:42 +02:00
parent 90a4d0dcb8
commit 0ac8568be0
4 changed files with 7 additions and 20 deletions

View file

@ -415,14 +415,14 @@ void StartLevel(GAMEOPTIONS *gameOptions)
memset(xsprite,0,sizeof(xsprite));
memset(sprite,0,kMaxSprites*sizeof(spritetype));
//drawLoadingScreen();
if (dbLoadMap(currentLevel->fileName,(int*)&startpos.x,(int*)&startpos.y,(int*)&startpos.z,&startang,&startsectnum,(unsigned int*)&gameOptions->uMapCRC))
if (dbLoadMap(currentLevel->fileName,(int*)&startpos.x,(int*)&startpos.y,(int*)&startpos.z,&startang,&startsectnum,nullptr))
{
I_Error("Unable to load map");
}
SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
STAT_NewLevel(currentLevel->fileName);
G_LoadMapHack(currentLevel->fileName);
wsrand(gameOptions->uMapCRC);
wsrand(dbReadMapCRC(currentLevel->LabelName()));
gKillMgr.Clear();
gSecretMgr.Clear();
gLevelTime = 0;

View file

@ -46,7 +46,7 @@ BEGIN_BLD_NS
GAMEOPTIONS gGameOptions;
GAMEOPTIONS gSingleGameOptions = {
0, 2, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 3600, 1800, 1800, 7200
0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 3600, 1800, 1800, 7200
};
EPISODEINFO gEpisodeInfo[kMaxEpisodes+1];
@ -114,10 +114,6 @@ void levelSetupOptions(int nEpisode, int nLevel)
{
gGameOptions.nEpisode = nEpisode;
gGameOptions.nLevel = nLevel;
auto level = FindMapByLevelNum(levelnum(nEpisode, nLevel));
if (!level) return;
gGameOptions.uMapCRC = dbReadMapCRC(level->LabelName());
gGameOptions.nTrackNumber = level->cdSongId;
}
void levelLoadMapInfo(IniFile *pIni, MapRecord *pLevelInfo, const char *pzSection, int epinum, int mapnum)
@ -224,7 +220,6 @@ void levelAddUserMap(const char *pzMap)
levelLoadMapInfo(&UserINI, pLevelInfo, NULL, nEpisode, nLevel);
gGameOptions.nEpisode = nEpisode;
gGameOptions.nLevel = nLevel;
gGameOptions.uMapCRC = dbReadMapCRC(pLevelInfo->name);
#else
auto map = SetupUserMap(pzMap);
#endif

View file

@ -40,10 +40,8 @@ struct GAMEOPTIONS {
unsigned char nDifficulty;
int nEpisode;
int nLevel;
int nTrackNumber; //at12a;
short nSaveGameSlot;
int picEntry;
unsigned int uMapCRC;
char nMonsterSettings;
int uGameFlags;
int uNetGameFlags;

View file

@ -60,25 +60,19 @@ static int osdcmd_map(CCmdFuncPtr parm)
auto maprec = FindMapByName(mapname);
if (maprec)
{
int e = volfromlevelnum(mapList[i].levelNumber);
int m = mapfromlevelnum(mapList[i].levelNumber);
int e = volfromlevelnum(maprec->levelNumber);
int m = mapfromlevelnum(maprec->levelNumber);
LevelWarp(e, m);
return CCMD_OK;
}
// Map has not been defined. Treat as user map.
#if 0 // this doesn't work yet because map progression is hardwired to the level number.
levelAddUserMap(mapname);
if (numplayers > 1)
{
gPacketStartGame.episodeId = gGameOptions.nEpisode;
gPacketStartGame.levelId = gGameOptions.nLevel;
netBroadcastNewGame();
gStartNewGame = 1;
return CCMD_OK;
}
levelSetupOptions(gGameOptions.nEpisode, gGameOptions.nLevel);
StartLevel(&gGameOptions);
#endif
return CCMD_OK;
}