From 5ed6a965e39051b5b28a33f0fc14045565afc627 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 24 Sep 2005 23:41:07 +0000 Subject: Fix "loading" icon for all video modes Subversion-branch: /trunk/chocolate-doom Subversion-revision: 129 --- NEWS | 1 + src/i_video.c | 211 +++++++++++++++++++++++++++++++++------------------------- 2 files changed, 120 insertions(+), 92 deletions(-) diff --git a/NEWS b/NEWS index 2b4d6268..f7061661 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ Fixes for non-x86 architectures Fix uac_dead.wad (platform drop on e1m8 should occur when all bosses die, not just barons) + Fix "loading" icon to work for all graphics modes 0.0.3 (2005-09-17): Mouse acceleration code to emulate the behaviour of old diff --git a/src/i_video.c b/src/i_video.c index 8e337db6..80d023da 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: i_video.c 126 2005-09-24 22:04:03Z fraggle $ +// $Id: i_video.c 129 2005-09-24 23:41:07Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -22,6 +22,9 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.29 2005/09/24 23:41:07 fraggle +// Fix "loading" icon for all video modes +// // Revision 1.28 2005/09/24 22:04:03 fraggle // Add application icon to running program // @@ -124,7 +127,7 @@ //----------------------------------------------------------------------------- static const char -rcsid[] = "$Id: i_video.c 126 2005-09-24 22:04:03Z fraggle $"; +rcsid[] = "$Id: i_video.c 129 2005-09-24 23:41:07Z fraggle $"; #include #include @@ -242,57 +245,6 @@ static void UpdateFocus(void) screenvisible = (state & SDL_APPACTIVE) != 0; } -void I_BeginRead(void) -{ - int y; - - if (disk_image == NULL) - return; - - // save background and copy the disk image in - - for (y=0; yw - disk_image_w, screen->h - disk_image_h, - disk_image_w, disk_image_h); -} - -void I_EndRead(void) -{ - int y; - - if (disk_image == NULL) - return; - - // save background and copy the disk image in - - for (y=0; yw - disk_image_w, screen->h - disk_image_h, - disk_image_w, disk_image_h); -} - static void LoadDiskImage(void) { patch_t *disk; @@ -548,39 +500,21 @@ void UpdateGrab(void) } -// -// I_FinishUpdate -// -void I_FinishUpdate (void) -{ - static int lasttic; - int tics; - int i; - // UNUSED static unsigned char *bigscreen=0; - - UpdateGrab(); - - // Don't update the screen if the window isn't visible. - // Not doing this breaks under Windows when we alt-tab away - // while fullscreen. +// Update a small portion of the screen - if (!(SDL_GetAppState() & SDL_APPACTIVE)) - return; +static void UpdateArea(int x1, int y1, int x2, int y2, boolean always_update) +{ + int w = x2 - x1; + int h = y2 - y1; - // draws little dots on the bottom of the screen - if (devparm) + if (palette_to_set && !always_update) { + // If we have a palette to set, the only way to update is to + // update the entire screen + // If we are only updating part of the screen (disk icon), we + // cannot update the screen - i = I_GetTime(); - tics = i - lasttic; - lasttic = i; - if (tics > 20) tics = 20; - - for (i=0 ; ipixels; pitch = screen->pitch; + bufp = screens[0] + y1 * SCREENWIDTH + x1; + screenp = (byte *) screen->pixels + y1 * pitch + x1; - for (y=0; ypixels; - screenp2 = ((byte *) screen->pixels) + screen->pitch; pitch = screen->pitch * 2; + bufp = screens[0] + y1 * SCREENWIDTH + x1; + screenp = (byte *) screen->pixels + (y1 * pitch) + (x1 * 2); + screenp2 = screenp + screen->pitch; - for (y=0; y 20) tics = 20; + + for (i=0 ; i