[Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_draw.cpp,1.35,1.36 d_draw.h,1.9,1.10 driver96.h,1.53,1.54 render.cpp,1.33,1.34
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Sun Oct 5 08:29:11 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/bs2 anims.cpp,1.25,1.26 build_display.cpp,1.30,1.31 events.cpp,1.9,1.10 events.h,1.4,1.5 maketext.cpp,1.19,1.20 protocol.cpp,1.14,1.15 router.cpp,1.21,1.22 router.h,1.6,1.7 sound.cpp,1.23,1.24 sword2.cpp,1.50,1.51 sword2.h,1.16,1.17 walker.cpp,1.11,1.12
- Next message: [Scummvm-cvs-logs] CVS: scummvm/backends/midi ym2612.cpp,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv24626/driver
Modified Files:
d_draw.cpp d_draw.h driver96.h render.cpp
Log Message:
Made a separate class for the cutscene functions, removed some unused code
and made some other minor cleanups.
Index: d_draw.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_draw.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- d_draw.cpp 4 Oct 2003 08:07:03 -0000 1.35
+++ d_draw.cpp 5 Oct 2003 15:28:14 -0000 1.36
@@ -43,47 +43,6 @@
int32 renderCaps = 0;
-int32 PlotDots(int16 x, int16 y, int16 count) {
-
- warning("stub PlotDots( %d, %d, %d )", x, y, count);
-/*
- int16 i;
- uint8 *dst;
-
- DDSURFACEDESC ddDescription;
- HRESULT hr;
-
- ddDescription.dwSize = sizeof(ddDescription);
-
- hr = IDirectDrawSurface2_Lock(lpBackBuffer, NULL, &ddDescription, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL);
- if (hr != DD_OK)
- {
- hr = IDirectDrawSurface2_Lock(lpBackBuffer, NULL, &ddDescription, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL);
- }
-
- if (hr == DD_OK)
- {
-
- dst = (uint8 *) ddDescription.lpSurface + y * ddDescription.lPitch + x;
-
- for (i=0; i<=count; i++)
- {
- *dst = 184;
- dst += 2;
- }
- dst = (uint8 *) ddDescription.lpSurface + (y+1) * ddDescription.lPitch + x;
- for (i=0; i<=count/10; i++)
- {
- *dst = 184;
- dst += 20;
- }
- IDirectDrawSurface2_Unlock(lpBackBuffer, ddDescription.lpSurface);
- }
-*/
-
- return RD_OK;
-}
-
/**
* Initialise the display with the sizes passed in.
* @return RD_OK, or an error code if the display cannot be set up.
@@ -168,30 +127,21 @@
return RD_OK;
}
-
-int32 NextSmackerFrame(void) {
- warning("stub NextSmackerFrame");
- return RD_OK;
-}
-
-
-static uint8 *textSurface = NULL;
-
-void OpenTextObject(_movieTextObject *obj) {
+void MoviePlayer::openTextObject(_movieTextObject *obj) {
if (obj->textSprite)
- CreateSurface(obj->textSprite, &textSurface);
+ CreateSurface(obj->textSprite, &_textSurface);
}
-void CloseTextObject(_movieTextObject *obj) {
- if (textSurface) {
- DeleteSurface(textSurface);
- textSurface = 0;
+void MoviePlayer::closeTextObject(_movieTextObject *obj) {
+ if (_textSurface) {
+ DeleteSurface(_textSurface);
+ _textSurface = NULL;
}
}
-void DrawTextObject(_movieTextObject *obj) {
- if (obj->textSprite && textSurface)
- DrawSurface(obj->textSprite, textSurface);
+void MoviePlayer::drawTextObject(_movieTextObject *obj) {
+ if (obj->textSprite && _textSurface)
+ DrawSurface(obj->textSprite, _textSurface);
}
/**
@@ -201,7 +151,7 @@
* @param musicOut lead-out music
*/
-int32 PlaySmacker(char *filename, _movieTextObject *text[], uint8 *musicOut) {
+int32 MoviePlayer::play(char *filename, _movieTextObject *text[], uint8 *musicOut) {
warning("semi-stub PlaySmacker %s", filename);
// WORKAROUND: For now, we just do the voice-over parts of the
@@ -268,15 +218,15 @@
if (frameCounter == text[textCounter]->startFrame) {
EraseBackBuffer();
- OpenTextObject(text[textCounter]);
- DrawTextObject(text[textCounter]);
+ openTextObject(text[textCounter]);
+ drawTextObject(text[textCounter]);
if (text[textCounter]->speech) {
g_sword2->_mixer->playRaw(&handle, text[textCounter]->speech, text[textCounter]->speechBufferSize, 22050, SoundMixer::FLAG_16BITS);
}
}
if (frameCounter == text[textCounter]->endFrame) {
- CloseTextObject(text[textCounter]);
+ closeTextObject(text[textCounter]);
EraseBackBuffer();
textCounter++;
}
@@ -300,7 +250,7 @@
g_system->delay_msecs(90);
}
- CloseTextObject(text[textCounter]);
+ closeTextObject(text[textCounter]);
EraseBackBuffer();
SetNeedRedraw();
Index: d_draw.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_draw.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- d_draw.h 4 Oct 2003 00:52:26 -0000 1.9
+++ d_draw.h 5 Oct 2003 15:28:15 -0000 1.10
@@ -26,6 +26,18 @@
extern byte *lpBackBuffer;
+class MoviePlayer {
+private:
+ uint8 *_textSurface;
+ void openTextObject(_movieTextObject *obj);
+ void closeTextObject(_movieTextObject *obj);
+ void drawTextObject(_movieTextObject *obj);
+
+public:
+ MoviePlayer() : _textSurface(NULL) {}
+ int32 play(char *filename, _movieTextObject *text[], uint8 *musicOut);
+};
+
} // End of namespace Sword2
#endif
Index: driver96.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/driver96.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- driver96.h 4 Oct 2003 08:31:20 -0000 1.53
+++ driver96.h 5 Oct 2003 15:28:15 -0000 1.54
@@ -361,7 +361,6 @@
extern int32 DrawLine(int16 x1, int16 y1, int16 x2, int16 y2, uint8 colour);
extern int32 InitialiseBackgroundLayer(_parallax *p);
extern int32 CloseBackgroundLayer(void);
-extern int32 PlotDots(int16 x, int16 y, int16 count);
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
Index: render.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/render.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- render.cpp 4 Oct 2003 00:52:27 -0000 1.33
+++ render.cpp 5 Oct 2003 15:28:15 -0000 1.34
@@ -782,20 +782,6 @@
return RD_OK;
}
-// FIXME: Move this to some better place?
-
-void sleepUntil(int32 time) {
- while ((int32) SVM_timeGetTime() < time) {
- g_sword2->parseEvents();
-
- // Make sure menu animations and fades don't suffer
- ProcessMenu();
- ServiceWindows();
-
- g_system->delay_msecs(10);
- }
-}
-
/**
* This function should be called at the end of the render cycle.
* @param end the function sets this to true if the render cycle is to be
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/bs2 anims.cpp,1.25,1.26 build_display.cpp,1.30,1.31 events.cpp,1.9,1.10 events.h,1.4,1.5 maketext.cpp,1.19,1.20 protocol.cpp,1.14,1.15 router.cpp,1.21,1.22 router.h,1.6,1.7 sound.cpp,1.23,1.24 sword2.cpp,1.50,1.51 sword2.h,1.16,1.17 walker.cpp,1.11,1.12
- Next message: [Scummvm-cvs-logs] CVS: scummvm/backends/midi ym2612.cpp,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list