diff --git a/source/build/include/build.h b/source/build/include/build.h index 152d09d07bbae082a82633b0aa35cd28b9720f26..688e64788fbe19b6c2e506025255837f93d08507 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -92,7 +92,7 @@ enum rendmode_t { #define MAXWALLSB ((MAXWALLS>>2)+(MAXWALLS>>3)) #define MAXTILES 30720 -#define MAXUSERTILES (MAXTILES-16) // reserve 16 tiles at the end +#define MAXUSERTILES (MAXTILES-256) // reserve 256 tiles at the end #define MAXVOXELS 1024 #define MAXSTATUS 1024 diff --git a/source/duke3d/src/duke3d.h b/source/duke3d/src/duke3d.h index e8b4e0bf0ef56cecb60680c7e4cf0401fcb8f9d6..9f189ad0c1fcc1e64be5c1daad3544dc191f8101 100644 --- a/source/duke3d/src/duke3d.h +++ b/source/duke3d/src/duke3d.h @@ -108,7 +108,7 @@ enum { // Reserved: TILE_VIEWSCR_1 (MAXTILES-6) // Reserved: TILE_VIEWSCR_2 (MAXTILES-7) // Reserved: (MAXTILES-8) to (MAXTILES-196) for additional Viewscreen tilespace -//EDUKE32_STATIC_ASSERT(4 + (3 * MAX_ACTIVE_VIEWSCREENS) <= MAXTILES-MAXUSERTILES); +EDUKE32_STATIC_ASSERT(4 + (3 * MAX_ACTIVE_VIEWSCREENS) <= MAXTILES-MAXUSERTILES); // sprites with these statnums should be considered for fixing #define ROTFIXSPR_STATNUMP(k) ((k)==STAT_DEFAULT || (k)==STAT_STANDABLE || (k)==STAT_FX || \ diff --git a/source/duke3d/src/premap.cpp b/source/duke3d/src/premap.cpp index d020dfa7b05d4eeb113d8ce2d5cff86efc7ae1f2..63c1f55f6ecbd6e0b31cf92efdde740eb580ea5a 100644 --- a/source/duke3d/src/premap.cpp +++ b/source/duke3d/src/premap.cpp @@ -929,7 +929,10 @@ static void P_PrepForNewLevel(int playerNum, int gameMode) g_interpolationCnt = 0; for (int vscrIndex = 0; vscrIndex < MAX_ACTIVE_VIEWSCREENS; vscrIndex++) + { g_activeVscrSprite[vscrIndex] = -1; + g_activeVscrTile[vscrIndex] = -1; + } randomseed = 1996; screenpeek = myconnectindex; @@ -1710,7 +1713,10 @@ void G_ResetTimers(bool saveMoveCnt) for (int vscrIndex = 0; vscrIndex < MAX_ACTIVE_VIEWSCREENS; vscrIndex++) { if (g_activeVscrSprite[vscrIndex] >= 0) + { actor[g_activeVscrSprite[vscrIndex]].t_data[0] = 0; + actor[g_activeVscrSprite[vscrIndex]].t_data[1] = -1; + } } } diff --git a/source/duke3d/src/savegame.cpp b/source/duke3d/src/savegame.cpp index 39ea31f0368b58cab1064f08746a4b0fa76ab0c5..7155f93551545acced28823f0123866a3869cf3a 100644 --- a/source/duke3d/src/savegame.cpp +++ b/source/duke3d/src/savegame.cpp @@ -636,6 +636,11 @@ int32_t G_LoadPlayer(savebrief_t & sv) sjson_destroy_context(ctx); + for (int vscrIndex = 0; vscrIndex < MAX_ACTIVE_VIEWSCREENS; vscrIndex++) + { + g_activeVscrSprite[vscrIndex] = -1; + g_activeVscrTile[vscrIndex] = -1; + } if (G_EnterLevel(MODE_GAME|MODE_EOL)) G_BackToMenu(); @@ -645,7 +650,6 @@ int32_t G_LoadPlayer(savebrief_t & sv) // sv_postudload(); - VM_OnEvent(EVENT_LOADGAME, g_player[screenpeek].ps->i, screenpeek); return 0; @@ -725,6 +729,12 @@ int32_t G_LoadPlayer(savebrief_t & sv) Bmemcpy(currentboardfilename, boardfilename, BMAX_PATH); + for (int vscrIndex = 0; vscrIndex < MAX_ACTIVE_VIEWSCREENS; vscrIndex++) + { + g_activeVscrSprite[vscrIndex] = -1; + g_activeVscrTile[vscrIndex] = -1; + } + if (status == 2) G_NewGame_EnterLevel(); else if ((status = sv_loadsnapshot(fil, 0, &h))) // read the rest...