diff options
author | Simon Howard | 2008-12-20 20:25:22 +0000 |
---|---|---|
committer | Simon Howard | 2008-12-20 20:25:22 +0000 |
commit | b9b0c2abfbe194baf6d497f1c4a2165769f64ab3 (patch) | |
tree | a82b96f274bd7427b963964f37242607a27c593d /src/i_video.c | |
parent | 0ec9859ec8cf39ce1223516161fb39ea44ed5c33 (diff) | |
parent | acd1a13a4f70973d7616df3f6de43f8f79b8e392 (diff) | |
download | chocolate-doom-b9b0c2abfbe194baf6d497f1c4a2165769f64ab3.tar.gz chocolate-doom-b9b0c2abfbe194baf6d497f1c4a2165769f64ab3.tar.bz2 chocolate-doom-b9b0c2abfbe194baf6d497f1c4a2165769f64ab3.zip |
Merge from trunk.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1423
Diffstat (limited to 'src/i_video.c')
-rw-r--r-- | src/i_video.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/src/i_video.c b/src/i_video.c index 39aedc0c..8360ab9e 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -20,7 +20,7 @@ // 02111-1307, USA. // // DESCRIPTION: -// Low level graphics code using SDL. +// DOOM graphics stuff for SDL. // //----------------------------------------------------------------------------- @@ -128,8 +128,14 @@ static screen_mode_t *screen_modes_corrected[] = { char *video_driver = ""; +// SDL surface for the screen. + static SDL_Surface *screen; +// Window title + +static char *window_title = ""; + // palette static SDL_Color palette[256]; @@ -752,6 +758,11 @@ static void I_ReadMouse(void) // void I_StartTic (void) { + if (!initialised) + { + return; + } + I_GetEvent(); if (usemouse && !nomouse) @@ -999,11 +1010,21 @@ void I_SetPalette (byte *doompalette) void I_SetWindowTitle(char *title) { + window_title = title; +} + +// +// Call the SDL function to set the window title, based on +// the title set with I_SetWindowTitle. +// + +static void I_InitWindowTitle(void) +{ char *buf; - buf = Z_Malloc(strlen(title) + strlen(PACKAGE_STRING) + 5, + buf = Z_Malloc(strlen(window_title) + strlen(PACKAGE_STRING) + 5, PU_STATIC, NULL); - sprintf(buf, "%s - %s", title, PACKAGE_STRING); + sprintf(buf, "%s - %s", window_title, PACKAGE_STRING); SDL_WM_SetCaption(buf, NULL); @@ -1012,7 +1033,7 @@ void I_SetWindowTitle(char *title) // Set the application icon -void I_SetWindowIcon(void) +static void I_InitWindowIcon(void) { SDL_Surface *surface; Uint8 *mask; @@ -1669,6 +1690,12 @@ void I_InitGraphics(void) } } + // Set up title and icon. Windows cares about the ordering; this + // has to be done before the call to SDL_SetVideoMode. + + I_InitWindowTitle(); + I_InitWindowIcon(); + // Set the video mode. flags |= SDL_SWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF; @@ -1706,8 +1733,6 @@ void I_InitGraphics(void) I_SetPalette(doompal); SDL_SetColors(screen, palette, 0, 256); - I_SetWindowIcon(); - CreateCursors(); UpdateFocus(); |