diff --git a/source/games/duke/src/2d_d.cpp b/source/games/duke/src/2d_d.cpp index 2a8b5ca64..062ee7312 100644 --- a/source/games/duke/src/2d_d.cpp +++ b/source/games/duke/src/2d_d.cpp @@ -785,6 +785,39 @@ void ShowMPBonusScreen_d(int pws, CompletionFunc completion) RunScreenJob(&job, 1, completion); } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + +void showtwoscreens(CompletionFunc completion) +{ + JobDesc jobs[2]; + int job = 0; + + jobs[job++] = { Create(3291), nullptr }; + jobs[job++] = { Create(3290), nullptr }; + RunScreenJob(jobs, job, completion); +} + +void doorders(CompletionFunc completion) +{ + JobDesc jobs[2]; + int job = 0; + + for(int i=0;i<4;i++) + jobs[job++] = { Create(ORDERING+i), nullptr }; + RunScreenJob(jobs, job, completion); +} + +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + + #if 1 CCMD(testbonus) diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 404cc2cde..9e7974f7a 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -38,8 +38,6 @@ source as it is released. BEGIN_DUKE_NS -int16_t max_ammo_amount[MAX_WEAPONS]; - //--------------------------------------------------------------------------- // // setpal diff --git a/source/games/duke/src/screens.h b/source/games/duke/src/screens.h index 632265bf3..e500f1b34 100644 --- a/source/games/duke/src/screens.h +++ b/source/games/duke/src/screens.h @@ -20,10 +20,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- +#include "screenjob.h" + BEGIN_DUKE_NS -extern void G_DisplayExtraScreens(void); -extern void G_DoOrderScreen(void); +extern void showtwoscreens(CompletionFunc func); +extern void doorders(CompletionFunc func); #ifdef DEBUGGINGAIDS typedef struct { diff --git a/source/games/duke/src/zz_game.cpp b/source/games/duke/src/zz_game.cpp index 5f5a26e8d..d5bb39817 100644 --- a/source/games/duke/src/zz_game.cpp +++ b/source/games/duke/src/zz_game.cpp @@ -47,6 +47,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "mapinfo.h" #include "v_video.h" #include "glbackend/glbackend.h" +#include "st_start.h" +#include "i_interface.h" // Uncomment to prevent anything except mirrors from drawing. It is sensible to // also uncomment ENGINE_CLEAR_SCREEN in build/src/engine_priv.h. @@ -60,6 +62,8 @@ BEGIN_DUKE_NS void SetDispatcher(); void checkcommandline(); +int16_t max_ammo_amount[MAX_WEAPONS]; + uint8_t shadedsector[MAXSECTORS]; int32_t g_fakeMultiMode = 0; @@ -191,8 +195,8 @@ void G_GameExit(const char *msg) } // shareware and TEN screens - if (*msg != 0 && *(msg+1) != 'V' && *(msg+1) != 'Y') - G_DisplayExtraScreens(); + if (*msg != 0 && *(msg+1) != 'V' && *(msg+1) != 'Y' && !VOLUMEALL && !RR) + showtwoscreens([](bool) {}); } if (*msg != 0) @@ -202,7 +206,12 @@ void G_GameExit(const char *msg) I_Error("%s", msg); } } - throw CExitEvent(0); + if (!RR) + { + endoomName = VOLUMEALL ? "duke3d.bin" : "dukesw.bin"; + ST_Endoom(); + } + else throw CExitEvent(0); } @@ -1801,7 +1810,7 @@ static int G_EndOfLevel(void) if ((!g_netServer && ud.multimode < 2)) { if (!VOLUMEALL) - G_DoOrderScreen(); + doorders([](bool) {}); g_player[myconnectindex].ps->gm = 0; return 2; } diff --git a/source/games/duke/src/zz_screens.cpp b/source/games/duke/src/zz_screens.cpp index a1e6725b7..a403f21d9 100644 --- a/source/games/duke/src/zz_screens.cpp +++ b/source/games/duke/src/zz_screens.cpp @@ -1009,72 +1009,6 @@ static void fadepaltile(int32_t r, int32_t g, int32_t b, int32_t start, int32_t } while (start != end+step); } -void G_DisplayExtraScreens(void) -{ - Mus_Stop(); - FX_StopAllSounds(); - if (RR) - return; - - if (!VOLUMEALL) - { - videoSetViewableArea(0, 0, xdim-1, ydim-1); - renderFlushPerms(); - //g_player[myconnectindex].ps->palette = palette; - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 - fadepal(0, 0, 0, 0, 252, 28); - inputState.ClearAllInput(); - rotatesprite_fs(160<<16, 100<<16, 65536L, 0, 3291, 0, 0, 2+8+64+BGSTRETCH); - fadepaltile(0, 0, 0, 252, 0, -28, 3291, BASEPAL); - while (!inputState.CheckAllInput()) - G_HandleAsync(); - - fadepaltile(0, 0, 0, 0, 252, 28, 3291, BASEPAL); - rotatesprite_fs(160<<16, 100<<16, 65536L, 0, 3290, 0, 0, 2+8+64+BGSTRETCH); - fadepaltile(0, 0, 0, 252, 0, -28, 3290, BASEPAL); - while (!inputState.CheckAllInput()) - G_HandleAsync(); - - } - - if (0) - { - videoSetViewableArea(0, 0, xdim-1, ydim-1); - renderFlushPerms(); - //g_player[myconnectindex].ps->palette = palette; - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 - fadepal(0, 0, 0, 0, 252, 28); - inputState.ClearAllInput(); - totalclock = 0; - rotatesprite_fs(160<<16, 100<<16, 65536L, 0, TILE_TENSCREEN, 0, 0, 2+8+64+BGSTRETCH); - fadepaltile(0, 0, 0, 252, 0, -28, TILE_TENSCREEN, BASEPAL); - while (!inputState.CheckAllInput() && totalclock < 2400) - G_HandleAsync(); - - fadepaltile(0, 0, 0, 0, 252, 28, TILE_TENSCREEN, BASEPAL); - inputState.ClearAllInput(); - } -} - -void G_DoOrderScreen(void) -{ - int32_t i; - - videoSetViewableArea(0, 0, xdim-1, ydim-1); - - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 - - for (i=0; i<4; i++) - { - fadepal(0, 0, 0, 0, 252, 28); - inputState.ClearAllInput(); - rotatesprite_fs(160<<16, 100<<16, 65536L, 0, TILE_ORDERING+i, 0, 0, 2+8+64+BGSTRETCH); - fadepal(0, 0, 0, 252, 0, -28); - while (!inputState.CheckAllInput()) - G_HandleAsync(); - } -} - void bonussequence_d(int num, CompletionFunc completion); void bonussequence_r(int num, CompletionFunc completion);