diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 1fc0dc686..ca79bfbc1 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -79,8 +79,6 @@ int32_t g_quitDeadline = 0; int32_t g_cameraDistance = 0, g_cameraClock = 0; static int32_t g_quickExit; -char boardfilename[BMAX_PATH] = {0}, currentboardfilename[BMAX_PATH] = {0}; - int32_t voting = -1; int32_t vote_map = -1, vote_episode = -1; diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index 85964c43f..4b77984cf 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -199,7 +199,7 @@ extern user_defs ud; // this is checked against http://eduke32.com/VERSION extern const char *s_buildDate; -extern char boardfilename[BMAX_PATH], currentboardfilename[BMAX_PATH]; +extern char boardfilename[BMAX_PATH]; #define USERMAPMUSICFAKEVOLUME MAXVOLUMES #define USERMAPMUSICFAKELEVEL (MAXLEVELS-1) #define USERMAPMUSICFAKESLOT ((USERMAPMUSICFAKEVOLUME * MAXLEVELS) + USERMAPMUSICFAKELEVEL) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 70f7ded60..c15ea143f 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -5613,7 +5613,6 @@ int portableBackupSave(const char * path, const char * name, int volume, int lev sjson_node * root = sjson_mkobject(ctx); sjson_put_string(ctx, root, "name", name); - // sjson_put_string(ctx, root, "map", currentboardfilename); sjson_put_int(ctx, root, "volume", volume); sjson_put_int(ctx, root, "level", level); sjson_put_int(ctx, root, "skill", ud.player_skill); diff --git a/source/duke3d/src/premap.cpp b/source/duke3d/src/premap.cpp index 4909abf05..a48db358e 100644 --- a/source/duke3d/src/premap.cpp +++ b/source/duke3d/src/premap.cpp @@ -1940,8 +1940,6 @@ int G_EnterLevel(int gameMode) G_ResetTimers(0); // Here we go - Bmemcpy(currentboardfilename, boardfilename, BMAX_PATH); - G_CheckIfStateless(); for (int TRAVERSE_CONNECT(i)) diff --git a/source/duke3d/src/savegame.cpp b/source/duke3d/src/savegame.cpp index 41368ae6e..c63759737 100644 --- a/source/duke3d/src/savegame.cpp +++ b/source/duke3d/src/savegame.cpp @@ -302,9 +302,6 @@ int32_t G_LoadPlayer(FSaveGameNode *sv) append_ext_UNSAFE(workbuffer, ".mhk"); engineLoadMHK(workbuffer); } - - currentboardfilename[0] = '\0'; - // G_NewGame_EnterLevel(); } @@ -503,8 +500,6 @@ int32_t G_LoadPlayer(FSaveGameNode *sv) engineLoadMHK(workbuffer); } - Bmemcpy(currentboardfilename, boardfilename, BMAX_PATH); - if (status == 2) G_NewGame_EnterLevel(); else if ((status = sv_loadsnapshot(*fil, 0, &h))) // read the rest... @@ -1166,8 +1161,6 @@ static const dataspec_t svgm_udnetw[] = { DS_NOCHK, &ud.noexits, sizeof(ud.noexits), 1 }, { DS_NOCHK, &ud.playerai, sizeof(ud.playerai), 1 }, { 0, &ud.pause_on, sizeof(ud.pause_on), 1 }, - { DS_NOCHK, ¤tboardfilename[0], BMAX_PATH, 1 }, -// { DS_LOADFN, (void *)&sv_postudload, 0, 1 }, { 0, connectpoint2, sizeof(connectpoint2), 1 }, { 0, &randomseed, sizeof(randomseed), 1 }, { 0, &g_globalRandom, sizeof(g_globalRandom), 1 }, @@ -1428,10 +1421,6 @@ int32_t sv_saveandmakesnapshot(FileWriter &fil, char const *name, int8_t spot, i h.levnum = ud.level_number; h.skill = ud.player_skill; - const uint32_t BSZ = sizeof(h.boardfn); - EDUKE32_STATIC_ASSERT(BSZ == sizeof(currentboardfilename)); - Bstrncpy(h.boardfn, currentboardfilename, BSZ); - if (spot >= 0) { // savegame @@ -1686,7 +1675,6 @@ int32_t sv_readdiff(FileReader &fil) // SVGM data description static void sv_postudload() { -// Bmemcpy(&boardfilename[0], ¤tboardfilename[0], BMAX_PATH); // DON'T do this in demos! #if 1 m_level_number = ud.level_number; ud.m_volume_number = ud.volume_number; diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index 140c4ff52..7fa039dbb 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -993,17 +993,8 @@ void G_DisplayRest(int32_t smoothratio) o |= 1|32; else if (g_levelTextTime < 5) o |= 1; - - auto dname = mapList[(ud.volume_number * MAXLEVELS) + ud.level_number].DisplayName(); - if (dname != NULL && *dname != 0) - { - char const * const fn = currentboardfilename[0] != 0 && - ud.volume_number == 0 && ud.level_number == 7 - ? currentboardfilename - : dname; - - menutext_(160<<16, (90+16+8)<<16, -g_levelTextTime+22/*quotepulseshade*/, fn, o, TEXT_XCENTER); - } + + menutext_(160<<16, (90+16+8)<<16, -g_levelTextTime+22/*quotepulseshade*/, currentLevel->DisplayName(), o, TEXT_XCENTER); } if (g_player[myconnectindex].ps->newowner == -1 && ud.overhead_on == 0 && cl_crosshair && ud.camerasprite == -1) diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index 32c608558..cc9faa2c5 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -79,7 +79,7 @@ int32_t g_quitDeadline = 0; int32_t g_cameraDistance = 0, g_cameraClock = 0; static int32_t g_quickExit; -char boardfilename[BMAX_PATH] = {0}, currentboardfilename[BMAX_PATH] = {0}; +char boardfilename[BMAX_PATH] = {0}; int32_t voting = -1; int32_t vote_map = -1, vote_episode = -1; diff --git a/source/rr/src/game.h b/source/rr/src/game.h index 7b451136e..cc4d938f0 100644 --- a/source/rr/src/game.h +++ b/source/rr/src/game.h @@ -198,7 +198,7 @@ extern user_defs ud; // this is checked against http://eduke32.com/VERSION extern const char *s_buildDate; -extern char boardfilename[BMAX_PATH], currentboardfilename[BMAX_PATH]; +extern char boardfilename[BMAX_PATH]; static inline int G_HaveUserMap(void) { diff --git a/source/rr/src/premap.cpp b/source/rr/src/premap.cpp index a8f85ea56..3a98f6808 100644 --- a/source/rr/src/premap.cpp +++ b/source/rr/src/premap.cpp @@ -2502,7 +2502,6 @@ int G_EnterLevel(int gameMode) //AddLog(g_szBuf); // variables are set by pointer... - Bmemcpy(currentboardfilename, boardfilename, BMAX_PATH); if (G_HaveUserMap()) { diff --git a/source/rr/src/savegame.cpp b/source/rr/src/savegame.cpp index 319673e59..ab9e93477 100644 --- a/source/rr/src/savegame.cpp +++ b/source/rr/src/savegame.cpp @@ -258,8 +258,6 @@ int32_t G_LoadPlayer(const char *path) engineLoadMHK(workbuffer); } - Bmemcpy(currentboardfilename, boardfilename, BMAX_PATH); - if (status == 2) G_NewGame_EnterLevel(); else if ((status = sv_loadsnapshot(*fil, 0, &h))) // read the rest... @@ -883,8 +881,6 @@ static const dataspec_t svgm_udnetw[] = { DS_NOCHK, &ud.noexits, sizeof(ud.noexits), 1 }, { DS_NOCHK, &ud.playerai, sizeof(ud.playerai), 1 }, { 0, &ud.pause_on, sizeof(ud.pause_on), 1 }, - { DS_NOCHK, ¤tboardfilename[0], BMAX_PATH, 1 }, -// { DS_LOADFN, (void *)&sv_postudload, 0, 1 }, { 0, connectpoint2, sizeof(connectpoint2), 1 }, { 0, &randomseed, sizeof(randomseed), 1 }, { 0, &g_globalRandom, sizeof(g_globalRandom), 1 }, @@ -1130,10 +1126,6 @@ int32_t sv_saveandmakesnapshot(FileWriter &fil, char const *name, int8_t spot, i h.levnum = ud.level_number; h.skill = ud.player_skill; - const uint32_t BSZ = sizeof(h.boardfn); - EDUKE32_STATIC_ASSERT(BSZ == sizeof(currentboardfilename)); - Bstrncpy(h.boardfn, currentboardfilename, BSZ); - if (spot >= 0) { // savegame @@ -1382,7 +1374,6 @@ int32_t sv_readdiff(FileReader &fil) // SVGM data description static void sv_postudload() { -// Bmemcpy(&boardfilename[0], ¤tboardfilename[0], BMAX_PATH); // DON'T do this in demos! #if 1 m_level_number = ud.level_number; ud.m_volume_number = ud.volume_number; diff --git a/source/rr/src/screens.cpp b/source/rr/src/screens.cpp index a9f6b0133..a00d2d27c 100644 --- a/source/rr/src/screens.cpp +++ b/source/rr/src/screens.cpp @@ -989,14 +989,9 @@ void G_DisplayRest(int32_t smoothratio) if (ud.overhead_on == 2) { const int32_t a = RR ? 0 : ((ud.screen_size > 0) ? 147 : 179); - if (RR && g_lastLevel) - minitext(5, a+6, "CLOSE ENCOUNTERS", 0, 2+8+16+256); - else - { - if (!G_HaveUserMap()) - minitext(5, a+6, GStrings.localize(gVolumeNames[ud.volume_number]), 0, 2+8+16+256); - minitext(5, a+6+6, mapList[ud.volume_number*MAXLEVELS + ud.level_number].DisplayName(), 0, 2+8+16+256); - } + if (!G_HaveUserMap()) + minitext(5, a+6, GStrings.localize(gVolumeNames[ud.volume_number]), 0, 2+8+16+256); + minitext(5, a+6+6, currentLevel->DisplayName(), 0, 2+8+16+256); } } } @@ -1025,11 +1020,7 @@ void G_DisplayRest(int32_t smoothratio) else if (g_levelTextTime < 5) o |= 1; - char const * const fn = currentboardfilename[0] != 0 && - ud.volume_number == 0 && ud.level_number == 7 - ? currentboardfilename - : mapList[(ud.volume_number*MAXLEVELS) + ud.level_number].DisplayName(); - menutext_(160<<16, (90+16+8)<<16, -g_levelTextTime+22/*quotepulseshade*/, fn, o, TEXT_XCENTER); + menutext_(160<<16, (90+16+8)<<16, -g_levelTextTime+22/*quotepulseshade*/, currentLevel->DisplayName(), o, TEXT_XCENTER); } if (g_player[myconnectindex].ps->newowner == -1 && ud.overhead_on == 0 && cl_crosshair && ud.camerasprite == -1)