[Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_draw.cpp,1.15,1.16
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Tue Sep 9 08:56:23 CEST 2003
Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv12385/driver
Modified Files:
d_draw.cpp
Log Message:
HACK: Display instructions during the cutscenes, so that the user won't
think ScummVM has hung or something.
Index: d_draw.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_draw.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- d_draw.cpp 9 Sep 2003 15:17:12 -0000 1.15
+++ d_draw.cpp 9 Sep 2003 15:54:13 -0000 1.16
@@ -20,6 +20,9 @@
#include <stdio.h>
#include "stdafx.h"
#include "driver96.h"
+#include "bs2/header.h" // HACK: For cutscenes instruction message
+#include "bs2/memory.h" // HACK: For cutscenes instruction message
+#include "bs2/maketext.h" // HACK: For cutscenes instruction message
#include "rdwin.h"
#include "_mouse.h"
#include "d_draw.h"
@@ -551,6 +554,31 @@
EraseBackBuffer();
+ // HACK: Draw instructions
+ //
+ // I'm using the the menu area, because that's unlikely to be
+ // touched by anything else during the cutscene.
+
+ memset(lpBackBuffer, 0, screenWide * MENUDEEP);
+
+ uint8 msg[] = "Cutscene - Press ESC to exit";
+ mem *data = MakeTextSprite(msg, 640, 255, speech_font_id);
+ _frameHeader *frame = (_frameHeader *) data->ad;
+ _spriteInfo msgSprite;
+ uint8 *msgSurface;
+
+ msgSprite.x = screenWide / 2 - frame->width / 2;
+ msgSprite.y = RDMENU_MENUDEEP / 2 - frame->height / 2;
+ msgSprite.w = frame->width;
+ msgSprite.h = frame->height;
+ msgSprite.h = RDSPR_DISPLAYALIGN | RDSPR_NOCOMPRESSION | RDSPR_TRANS;
+ msgSprite.data = data->ad + sizeof(_frameHeader);
+
+ CreateSurface(&msgSprite, &msgSurface);
+ DrawSurface(&msgSprite, msgSurface);
+ DeleteSurface(msgSurface);
+ Free_mem(data);
+
// In case the cutscene has a long lead-in, start just before
// the first line of text.
@@ -609,6 +637,15 @@
BS2_SetPalette(0, 256, oldPal, RDPAL_INSTANT);
CloseTextObject(text[textCounter]);
+
+ // HACK: Remove the instructions created above
+ ScummVM::Rect r;
+
+ memset(lpBackBuffer, 0, screenWide * MENUDEEP);
+ r.left = r.top = 0;
+ r.right = screenWide;
+ r.bottom = MENUDEEP;
+ UploadRect(&r);
}
return(RD_OK);
More information about the Scummvm-git-logs
mailing list