- Added ENDOOM screen. It will only be shown when the game is exited via the

main menu and there is an option to switch it off for those who don't want
  to wait.


SVN r441 (trunk)
This commit is contained in:
Christoph Oelckers 2007-01-06 12:30:34 +00:00
parent 05c77ebcb6
commit 34c6f64d82
6 changed files with 91 additions and 1 deletions

View file

@ -1,3 +1,8 @@
January 6, 2007 (Changes by Graf Zahl)
- Added ENDOOM screen. It will only be shown when the game is exited via the
main menu and there is an option to switch it off for those who don't want
to wait.
January 5, 2007 January 5, 2007
- Added simulation of Heretic's startup screen. - Added simulation of Heretic's startup screen.
- Changed copyright notice for i_main.cpp, since none of it is really id's - Changed copyright notice for i_main.cpp, since none of it is really id's

View file

@ -64,6 +64,7 @@
#include "lists.h" #include "lists.h"
#include "gi.h" #include "gi.h"
#include "p_tick.h" #include "p_tick.h"
#include "st_start.h"
// MACROS ------------------------------------------------------------------ // MACROS ------------------------------------------------------------------
@ -1956,7 +1957,7 @@ void M_QuitResponse(int ch)
I_WaitVBL (105); I_WaitVBL (105);
} }
} }
exit (0); ST_Endoom();
} }
void M_QuitDOOM (int choice) void M_QuitDOOM (int choice)

View file

@ -81,6 +81,7 @@
#include "m_menu.h" #include "m_menu.h"
EXTERN_CVAR(Bool, nomonsterinterpolation) EXTERN_CVAR(Bool, nomonsterinterpolation)
EXTERN_CVAR(Bool, showendoom)
// //
// defaulted values // defaulted values
// //
@ -510,6 +511,7 @@ static menuitem_t VideoItems[] = {
{ discrete, "Stretch status bar", {&st_scale}, {2.0}, {0.0}, {0.0}, {OnOff} }, { discrete, "Stretch status bar", {&st_scale}, {2.0}, {0.0}, {0.0}, {OnOff} },
{ discrete, "Screen wipe style", {&wipetype}, {4.0}, {0.0}, {0.0}, {Wipes} }, { discrete, "Screen wipe style", {&wipetype}, {4.0}, {0.0}, {0.0}, {Wipes} },
#ifdef _WIN32 #ifdef _WIN32
{ discrete, "Show ENDOOM screen", {&showendoom}, {2.0}, {0.0}, {0.0}, {OnOff} },
{ discrete, "DirectDraw palette hack", {&vid_palettehack}, {2.0}, {0.0}, {0.0}, {OnOff} }, { discrete, "DirectDraw palette hack", {&vid_palettehack}, {2.0}, {0.0}, {0.0}, {OnOff} },
{ discrete, "Use attached surfaces", {&vid_attachedsurfaces},{2.0}, {0.0}, {0.0}, {OnOff} }, { discrete, "Use attached surfaces", {&vid_attachedsurfaces},{2.0}, {0.0}, {0.0}, {OnOff} },
#endif #endif

View file

@ -303,3 +303,8 @@ static bool ST_TTY_NetLoop(bool (*timer_callback)(void *), void *userdata)
} }
} }
} }
void ST_Endoom()
{
exit(0);
}

View file

@ -42,3 +42,4 @@ extern void (*ST_NetProgress)(int count);
extern void (*ST_NetMessage)(const char *format, ...); // cover for printf() extern void (*ST_NetMessage)(const char *format, ...); // cover for printf()
extern void (*ST_NetDone)(); extern void (*ST_NetDone)();
extern bool (*ST_NetLoop)(bool (*timer_callback)(void *), void *userdata); extern bool (*ST_NetLoop)(bool (*timer_callback)(void *), void *userdata);
extern void ST_Endoom();

View file

@ -47,6 +47,7 @@
#include "templates.h" #include "templates.h"
#include "i_system.h" #include "i_system.h"
#include "i_input.h" #include "i_input.h"
#include "hardware.h"
#include "gi.h" #include "gi.h"
#include "w_wad.h" #include "w_wad.h"
#include "s_sound.h" #include "s_sound.h"
@ -83,6 +84,7 @@
// TYPES ------------------------------------------------------------------- // TYPES -------------------------------------------------------------------
// EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- // EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
void RestoreConView();
bool ST_Util_CreateStartupWindow (); bool ST_Util_CreateStartupWindow ();
void ST_Util_SizeWindowForBitmap (); void ST_Util_SizeWindowForBitmap ();
@ -743,6 +745,80 @@ static void ST_Heretic_Progress()
I_GetEvent (); I_GetEvent ();
} }
//==========================================================================
//
// ST_Endoom
//
// Shows an ENDOOM text screen
//
//==========================================================================
CVAR(Bool, showendoom, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
void ST_Endoom()
{
if (!showendoom) return;
int endoom_lump = Wads.CheckNumForName (
gameinfo.gametype == GAME_Doom? "ENDOOM" :
gameinfo.gametype == GAME_Heretic? "ENDTEXT" :
gameinfo.gametype == GAME_Strife? "ENDSTRF" : NULL);
BYTE endoom_screen[4000];
BYTE *font;
MSG mess;
if (endoom_lump < 0 || Wads.LumpLength (endoom_lump) != 4000)
{
exit(0);
}
font = ST_Util_LoadFont (TEXT_FONT_NAME, TEXT_FONT_HEIGHT);
if (font == NULL)
{
exit(0);
}
if (!ST_Util_CreateStartupWindow())
{
ST_Util_FreeFont (font);
exit(0);
}
ST_Done = ST_Basic_Done;
I_ShutdownGraphics ();
RestoreConView ();
S_StopMusic(true);
Wads.ReadLump (endoom_lump, endoom_screen);
// Draw the loading screen to a bitmap.
StartupBitmap = ST_Util_AllocTextBitmap (font);
ST_Util_DrawTextScreen (StartupBitmap, endoom_screen, font);
ST_Util_FreeFont (font);
ST_Util_SizeWindowForBitmap ();
LayoutMainWindow (Window, NULL);
InvalidateRect (StartupScreen, NULL, TRUE);
// Wait until any key has been pressed or a quit message has been received
while (1)
{
if (PeekMessage (&mess, NULL, 0, 0, PM_REMOVE))
{
if (mess.message == WM_QUIT)
exit (int(mess.wParam));
if (mess.message == WM_KEYDOWN || mess.message == WM_SYSKEYDOWN || mess.message == WM_LBUTTONDOWN)
exit(0);
TranslateMessage (&mess);
DispatchMessage (&mess);
}
else WaitMessage();
}
}
//========================================================================== //==========================================================================
// //
// ST_Util_CreateStartupWindow // ST_Util_CreateStartupWindow