From 9c9e1bac25a53ba9486a74300c669492f9641d76 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 31 Aug 2005 21:35:42 +0000 Subject: Display the game name in the title bar. Move game start code to later in initialisation because of the IWAD detection changes. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 61 --- src/d_main.c | 132 +++++++++++++++++++++------------------------------------- src/i_video.c | 28 ++++++++++++- 2 files changed, 74 insertions(+), 86 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 998b11e8..f21467e1 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: d_main.c 60 2005-08-31 21:24:24Z fraggle $ +// $Id: d_main.c 61 2005-08-31 21:35:42Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -22,6 +22,10 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.9 2005/08/31 21:35:42 fraggle +// Display the game name in the title bar. Move game start code to later +// in initialisation because of the IWAD detection changes. +// // Revision 1.8 2005/08/31 21:24:24 fraggle // Remove the last traces of NORMALUNIX // @@ -60,7 +64,7 @@ //----------------------------------------------------------------------------- -static const char rcsid[] = "$Id: d_main.c 60 2005-08-31 21:24:24Z fraggle $"; +static const char rcsid[] = "$Id: d_main.c 61 2005-08-31 21:35:42Z fraggle $"; #define BGCOLOR 7 #define FGCOLOR 8 @@ -785,6 +789,8 @@ static void IdentifyVersion(void) gamedescription = "DOOM 2: Plutonia Experiment"; else if (gamemission == pack_tnt) gamedescription = "DOOM 2: TNT - Evilution"; + else + gamedescription = "DOOM 2: ?????????????"; } printf("%s\n", gamedescription); @@ -1053,6 +1059,46 @@ void D_DoomMain (void) printf("Playing demo %s.lmp.\n",myargv[p+1]); } + // init subsystems + printf ("V_Init: allocate screens.\n"); + V_Init (); + + printf ("M_LoadDefaults: Load system defaults.\n"); + M_LoadDefaults (); // load before initing other systems + + printf ("Z_Init: Init zone memory allocation daemon. \n"); + Z_Init (); + + printf ("W_Init: Init WADfiles.\n"); + W_InitMultipleFiles (wadfiles); + + IdentifyVersion(); + + // Check for -file in shareware + if (modifiedgame) + { + // These are the lumps that will be checked in IWAD, + // if any one is not present, execution will be aborted. + char name[23][8]= + { + "e2m1","e2m2","e2m3","e2m4","e2m5","e2m6","e2m7","e2m8","e2m9", + "e3m1","e3m3","e3m3","e3m4","e3m5","e3m6","e3m7","e3m8","e3m9", + "dphoof","bfgga0","heada1","cybra1","spida1d1" + }; + int i; + + if ( gamemode == shareware) + I_Error("\nYou cannot -file with the shareware " + "version. Register!"); + + // Check for fake IWAD with right name, + // but w/o all the lumps of the registered version. + if (gamemode == registered) + for (i = 0;i < 23; i++) + if (W_CheckNumForName(name[i])<0) + I_Error("\nThis is not the registered version."); + } + // get skill / episode / map from parms startskill = sk_medium; startepisode = 1; @@ -1103,88 +1149,6 @@ void D_DoomMain (void) autostart = true; } - // init subsystems - printf ("V_Init: allocate screens.\n"); - V_Init (); - - printf ("M_LoadDefaults: Load system defaults.\n"); - M_LoadDefaults (); // load before initing other systems - - printf ("Z_Init: Init zone memory allocation daemon. \n"); - Z_Init (); - - printf ("W_Init: Init WADfiles.\n"); - W_InitMultipleFiles (wadfiles); - - IdentifyVersion(); - - // Check for -file in shareware - if (modifiedgame) - { - // These are the lumps that will be checked in IWAD, - // if any one is not present, execution will be aborted. - char name[23][8]= - { - "e2m1","e2m2","e2m3","e2m4","e2m5","e2m6","e2m7","e2m8","e2m9", - "e3m1","e3m3","e3m3","e3m4","e3m5","e3m6","e3m7","e3m8","e3m9", - "dphoof","bfgga0","heada1","cybra1","spida1d1" - }; - int i; - - if ( gamemode == shareware) - I_Error("\nYou cannot -file with the shareware " - "version. Register!"); - - // Check for fake IWAD with right name, - // but w/o all the lumps of the registered version. - if (gamemode == registered) - for (i = 0;i < 23; i++) - if (W_CheckNumForName(name[i])<0) - I_Error("\nThis is not the registered version."); - } - -#if 0 - // Iff additonal PWAD files are used, print modified banner - if (modifiedgame) - { - /*m*/printf ( - "===========================================================================\n" - "ATTENTION: This version of DOOM has been modified. If you would like to\n" - "get a copy of the original game, call 1-800-IDGAMES or see the readme file.\n" - " You will not receive technical support for modified games.\n" - " press enter to continue\n" - "===========================================================================\n" - ); - getchar (); - } - - // Check and print which version is executed. - switch ( gamemode ) - { - case shareware: - case indetermined: - printf ( - "===========================================================================\n" - " Shareware!\n" - "===========================================================================\n" - ); - break; - case registered: - case retail: - case commercial: - printf ( - "===========================================================================\n" - " Commercial product - do not distribute!\n" - " Please report software piracy to the SPA: 1-800-388-PIR8\n" - "===========================================================================\n" - ); - break; - - default: - // Ouch. - break; - } -#endif printf ( "===========================================================================\n" " " PACKAGE_NAME " is free software, covered by the GNU General Public\n" diff --git a/src/i_video.c b/src/i_video.c index 8197e674..64f2c449 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: i_video.c 51 2005-08-10 08:45:35Z fraggle $ +// $Id: i_video.c 61 2005-08-31 21:35:42Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -22,6 +22,10 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.19 2005/08/31 21:35:42 fraggle +// Display the game name in the title bar. Move game start code to later +// in initialisation because of the IWAD detection changes. +// // Revision 1.18 2005/08/10 08:45:35 fraggle // Remove "if (french)" stuff, FRENCH define, detect french wad automatically // @@ -87,11 +91,12 @@ //----------------------------------------------------------------------------- static const char -rcsid[] = "$Id: i_video.c 51 2005-08-10 08:45:35Z fraggle $"; +rcsid[] = "$Id: i_video.c 61 2005-08-31 21:35:42Z fraggle $"; #include #include +#include "config.h" #include "w_wad.h" #include "z_zone.h" #include "doomstat.h" @@ -653,6 +658,23 @@ void I_SetPalette (byte *doompalette) palette_to_set = 1; } +// +// Set the window caption +// + +static void SetCaption(void) +{ + char *buf; + + buf = Z_Malloc(strlen(gamedescription) + strlen(PACKAGE_STRING) + 10, + PU_STATIC, NULL); + sprintf(buf, "%s - %s", gamedescription, PACKAGE_STRING); + + SDL_WM_SetCaption(buf, NULL); + + Z_Free(buf); +} + void I_InitGraphics(void) { @@ -685,6 +707,8 @@ void I_InitGraphics(void) I_Error("Error setting video mode: %s\n", SDL_GetError()); } + SetCaption(); + SDL_ShowCursor(0); SDL_WM_GrabInput(SDL_GRAB_ON); -- cgit v1.2.3