diff options
author | Simon Howard | 2008-10-04 14:45:57 +0000 |
---|---|---|
committer | Simon Howard | 2008-10-04 14:45:57 +0000 |
commit | 62aa3c856664ec4ad329cfaf28ee5fc7f65aa20e (patch) | |
tree | 17682b6552538f125b83c146b365cd22858282d2 | |
parent | 43552743d387a04b71c75165b624bb4ac415a05b (diff) | |
download | chocolate-doom-62aa3c856664ec4ad329cfaf28ee5fc7f65aa20e.tar.gz chocolate-doom-62aa3c856664ec4ad329cfaf28ee5fc7f65aa20e.tar.bz2 chocolate-doom-62aa3c856664ec4ad329cfaf28ee5fc7f65aa20e.zip |
Draw loading disk into a temporary buffer rather than the screen, to fix
bug with leftover junk at startup melt.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1333
-rw-r--r-- | src/i_video.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/i_video.c b/src/i_video.c index 7fab7731..f72e70ae 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -282,6 +282,7 @@ static void UpdateFocus(void) void I_EnableLoadingDisk(void) { patch_t *disk; + byte *tmpbuf; char *disk_name; int y; char buf[20]; @@ -304,9 +305,16 @@ void I_EnableLoadingDisk(void) disk = W_CacheLumpName(disk_name, PU_STATIC); - V_DrawPatch(0, 0, disk); + // Draw the patch into a temporary buffer + + tmpbuf = Z_Malloc(SCREENWIDTH * (disk->height + 1), PU_STATIC, NULL); + V_UseBuffer(tmpbuf); + disk_image_w = SHORT(disk->width); disk_image_h = SHORT(disk->height); + V_DrawPatch(0, 0, disk); + + // Copy the disk into the disk_image buffer. disk_image = Z_Malloc(disk_image_w * disk_image_h, PU_STATIC, NULL); saved_background = Z_Malloc(disk_image_w * disk_image_h, PU_STATIC, NULL); @@ -314,12 +322,16 @@ void I_EnableLoadingDisk(void) for (y=0; y<disk_image_h; ++y) { memcpy(disk_image + disk_image_w * y, - I_VideoBuffer + SCREENWIDTH * y, + tmpbuf + SCREENWIDTH * y, disk_image_w); - memset(I_VideoBuffer + SCREENWIDTH * y, 0, disk_image_w); } + // All done - free the screen buffer and restore the normal + // video buffer. + W_ReleaseLumpName(disk_name); + V_RestoreBuffer(); + Z_Free(tmpbuf); } // |