[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
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Sun Oct 5 08:29:03 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm TODO,1.19,1.20 README,1.186,1.187
- Next message: [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
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv24626
Modified Files:
anims.cpp build_display.cpp events.cpp events.h maketext.cpp
protocol.cpp router.cpp router.h sound.cpp sword2.cpp sword2.h
walker.cpp
Log Message:
Made a separate class for the cutscene functions, removed some unused code
and made some other minor cleanups.
Index: anims.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/anims.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- anims.cpp 4 Oct 2003 08:07:00 -0000 1.25
+++ anims.cpp 5 Oct 2003 15:28:13 -0000 1.26
@@ -26,6 +26,7 @@
#include "stdafx.h"
#include "common/scummsys.h"
#include "bs2/driver/driver96.h"
+#include "bs2/driver/d_draw.h"
#include "bs2/anims.h"
#include "bs2/console.h"
#include "bs2/controls.h" // for 'speechSelected' & 'subtitles'
@@ -748,10 +749,12 @@
// pause sfx during sequence, except the one used for lead-in music
g_sound->pauseFxForSequence();
+ MoviePlayer player;
+
if (sequenceTextLines && g_sword2->_gameId == GID_SWORD2)
- rv = PlaySmacker(filename, sequenceSpeechArray, leadOut);
+ rv = player.play(filename, sequenceSpeechArray, leadOut);
else
- rv = PlaySmacker(filename, NULL, leadOut);
+ rv = player.play(filename, NULL, leadOut);
// unpause sound fx again, in case we're staying in same location
g_sound->unpauseFx();
Index: build_display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/build_display.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- build_display.cpp 4 Oct 2003 08:07:00 -0000 1.30
+++ build_display.cpp 5 Oct 2003 15:28:13 -0000 1.31
@@ -22,6 +22,7 @@
// ---------------------------------------------------------------------------
#include "stdafx.h"
+#include "bs2/sword2.h"
#include "bs2/build_display.h"
#include "bs2/console.h"
#include "bs2/defs.h"
@@ -106,7 +107,7 @@
//
// ---------------------------------------------------------------------------
-void Build_display(void) { //Tony21Sept96
+void Build_display(void) {
bool end;
#ifdef _SWORD2_DEBUG
uint8 pal[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0 };
@@ -324,8 +325,6 @@
_spriteInfo spriteInfo;
_palEntry pal[256];
_palEntry oldPal[256];
- int16 oldY;
- int16 oldX;
uint32 rv; // drivers error return value
warning("DisplayMsg: %s", (char *) text);
@@ -336,16 +335,16 @@
}
Set_mouse(0);
- Set_luggage(0); //tw28Aug
+ Set_luggage(0);
CloseMenuImmediately();
EraseBackBuffer();
text_spr = MakeTextSprite(text, 640, 187, speech_font_id);
- frame = (_frameHeader*) text_spr->ad;
+ frame = (_frameHeader *) text_spr->ad;
- spriteInfo.x = screenWide/2 - frame->width/2;
+ spriteInfo.x = screenWide / 2 - frame->width / 2;
if (!time)
spriteInfo.y = screenDeep / 2 - frame->height / 2 - RDMENU_MENUDEEP;
else
@@ -359,19 +358,14 @@
spriteInfo.blend = 0;
spriteInfo.data = text_spr->ad + sizeof(_frameHeader);
spriteInfo.colourTable = 0;
- oldX = spriteInfo.x;
- oldY = spriteInfo.y;
rv = DrawSprite(&spriteInfo);
if (rv)
error("Driver Error %.8x (in DisplayMsg)", rv);
- spriteInfo.x = oldX;
- spriteInfo.y = oldY;
-
memcpy((char *) oldPal, (char *) palCopy, 256 * sizeof(_palEntry));
- memset(pal, 0, 256*sizeof(_palEntry));
+ memset(pal, 0, 256 * sizeof(_palEntry));
pal[187].red = 255;
pal[187].green = 255;
pal[187].blue = 255;
@@ -385,19 +379,11 @@
uint32 targetTime = SVM_timeGetTime() + (time * 1000);
- while (SVM_timeGetTime() < targetTime) {
- ServiceWindows();
-
- EraseBackBuffer();
-
- rv = DrawSprite(&spriteInfo); // Keep the message there even when the user task swaps.
- if (rv)
- error("Driver Error %.8x (in DisplayMsg)", rv);
+ rv = DrawSprite(&spriteInfo); // Keep the message there even when the user task swaps.
+ if (rv)
+ error("Driver Error %.8x (in DisplayMsg)", rv);
- // Drivers change the y co-ordinate, don't know why...
- spriteInfo.y = oldY;
- spriteInfo.x = oldX;
- }
+ sleepUntil(targetTime);
BS2_SetPalette(0, 256, (uint8 *) oldPal, RDPAL_FADE);
}
@@ -688,13 +674,11 @@
res_man.close(build_unit->anim_resource);
}
-void Reset_render_lists(void) { //Tony18Sept96
+void Reset_render_lists(void) {
// reset the sort lists - do this before a logic loop
// takes into account the fact that the start of the list is pre-built
// with the special sortable layers
- uint32 j;
-
cur_bgp0 = 0;
cur_bgp1 = 0;
cur_back = 0;
@@ -707,7 +691,7 @@
if (cur_sort) {
// there are some layers - so rebuild the sort order
// positioning
- for (j = 0; j < cur_sort; j++)
+ for (uint j = 0; j < cur_sort; j++)
sort_order[j] = j; //rebuild the order list
}
}
@@ -719,15 +703,11 @@
if (cur_sort <= 1)
return;
- uint16 i, j, swap;
-
- for (i = 0; i < cur_sort - 1; i++) {
- for (j = 0; j < cur_sort - 1; j++) {
+ for (uint i = 0; i < cur_sort - 1; i++) {
+ for (uint j = 0; j < cur_sort - 1; j++) {
//this > next then swap
- if (sort_list[sort_order[j]].sort_y > sort_list[sort_order[j+1]].sort_y) {
- swap = sort_order[j];
- sort_order[j] = sort_order[j + 1];
- sort_order[j + 1] = swap;
+ if (sort_list[sort_order[j]].sort_y > sort_list[sort_order[j + 1]].sort_y) {
+ SWAP(sort_order[j], sort_order[j + 1]);
}
}
}
@@ -854,7 +834,6 @@
mouse_list[cur_mouse].priority = ob_mouse->priority;
mouse_list[cur_mouse].pointer = ob_mouse->pointer;
- // (James17jun97)
// check if pointer text field is set due to previous
// object using this slot (ie. not correct for this
// one)
@@ -862,6 +841,7 @@
// if 'pointer_text' field is set, but the 'id' field
// isn't same is current id
// then we don't want this "left over" pointer text
+
if (mouse_list[cur_mouse].pointer_text && mouse_list[cur_mouse].id != (int32) ID)
mouse_list[cur_mouse].pointer_text=0;
@@ -1075,7 +1055,6 @@
palRes = lastPaletteRes;
}
} else {
- // (James 03sep97)
// check if we're just restoring the current screen palette
// because we might actually need to use a separate palette
// file anyway eg. for pausing & unpausing during the eclipse
@@ -1091,11 +1070,10 @@
}
//----------------------------------
-
// non-zero: set palette to this separate palette file
if (palRes) {
// open the palette file
- head = (_standardHeader*) res_man.open(palRes);
+ head = (_standardHeader *) res_man.open(palRes);
#ifdef _SWORD2_DEBUG
if (head->fileType != PALETTE_FILE)
@@ -1151,7 +1129,7 @@
int32 FN_change_shadows(int32 *params) {
uint32 rv;
- // if last screen was using a shading mask (see below) (James 08apr97)
+ // if last screen was using a shading mask (see below)
if (this_screen.mask_flag) {
rv = CloseLightMask();
Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/events.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- events.cpp 4 Oct 2003 08:07:01 -0000 1.9
+++ events.cpp 5 Oct 2003 15:28:13 -0000 1.10
@@ -39,6 +39,7 @@
}
}
+#ifdef _SWORD2_DEBUG
uint32 CountEvents(void) {
uint32 count = 0;
@@ -49,6 +50,7 @@
return count;
}
+#endif
int32 FN_request_speech(int32 *params) {
// change current script - must be followed by a TERMINATE script
@@ -86,12 +88,6 @@
void Set_player_action_event(uint32 id, uint32 interact_id) {
uint32 j = 0;
-// if (event_list[j].id != id && event_list[j].id)
-// // zip along until we find a free slot
-// while (event_list[j].id!=id || event_list[j].id) {
-// j++;
-// }
-
while (1) {
if (event_list[j].id == id)
break;
@@ -107,10 +103,10 @@
// found that slot
- //id of person to stop
+ // id of person to stop
event_list[j].id = id;
- //full script id of action script number 2
+ // full script id of action script number 2
event_list[j].interact_id = (interact_id * 65536) + 2;
}
Index: events.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/events.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- events.h 4 Oct 2003 08:07:01 -0000 1.4
+++ events.h 5 Oct 2003 15:28:13 -0000 1.5
@@ -41,7 +41,10 @@
int32 FN_start_event(void);
uint32 Check_event_waiting(void);
void Kill_all_ids_events(uint32 id);
+
+#ifdef _SWORD2_DEBUG
uint32 CountEvents(void);
+#endif
} // End of namespace Sword2
Index: maketext.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/maketext.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- maketext.cpp 4 Oct 2003 08:07:02 -0000 1.19
+++ maketext.cpp 5 Oct 2003 15:28:13 -0000 1.20
@@ -95,7 +95,6 @@
uint32 speech_font_id;
uint32 controls_font_id;
uint32 red_font_id;
-uint32 death_font_id;
mem* MakeTextSprite(uint8 *sentence, uint16 maxWidth, uint8 pen, uint32 fontRes) {
mem *line; // handle for the memory block which will
@@ -450,11 +449,11 @@
// correct size!
uint16 type;
mem *text_mem;
-} text_bloc;
+} text_bloc;
text_bloc text_sprite_list[MAX_text_blocs];
-void Init_text_bloc_system(void) { //Tony16Oct96
+void Init_text_bloc_system(void) {
for (int j = 0; j < MAX_text_blocs; j++)
text_sprite_list[j].text_mem = 0;
}
@@ -492,7 +491,7 @@
// debug text just to be printed normally from point (x,y)
- // JUSTIFICATION & POSITIONING (James updated 20jun97)
+ // JUSTIFICATION & POSITIONING
// 'NO_JUSTIFICATION' means print sprite with top-left at (x,y)
// without margin checking - used for debug text
@@ -637,9 +636,9 @@
// "talenna" Finnish for "save"
// "zapisz" Polish for "save"
- if (strcmp((char*) textLine, "tallenna") == 0)
+ if (strcmp((char *) textLine, "tallenna") == 0)
language = FINNISH_TEXT;
- else if (strcmp((char*) textLine, "zapisz") == 0)
+ else if (strcmp((char *) textLine, "zapisz") == 0)
language = POLISH_TEXT;
else
language = DEFAULT_TEXT;
@@ -659,7 +658,7 @@
else
textLine = FetchTextLine(textFile, 54) + 2;
- SetWindowName((char*) textLine);
+ SetWindowName((char *) textLine);
// now ok to close the text file
res_man.close(TEXT_RES);
Index: protocol.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/protocol.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- protocol.cpp 4 Oct 2003 08:07:02 -0000 1.14
+++ protocol.cpp 5 Oct 2003 15:28:13 -0000 1.15
@@ -172,7 +172,7 @@
if (text_line >= text_header->noOfLines) {
fileHeader = (_standardHeader*)file;
- sprintf((char*) errorLine, "xxMissing line %d of %s (only 0..%d)", text_line, fileHeader->name, text_header->noOfLines - 1);
+ sprintf((char *) errorLine, "xxMissing line %d of %s (only 0..%d)", text_line, fileHeader->name, text_header->noOfLines - 1);
// first 2 chars are NULL so that actor-number comes out as '0'
@@ -182,9 +182,9 @@
}
//point to the lookup table
- point = (uint32*) text_header + 1;
+ point = (uint32 *) text_header + 1;
- return (uint8*) (file + READ_LE_UINT32(point + text_line));
+ return (uint8 *) (file + READ_LE_UINT32(point + text_line));
}
@@ -204,7 +204,7 @@
uint8 *FetchObjectName(int32 resourceId) {
_standardHeader *header;
- header = (_standardHeader*) res_man.open(resourceId);
+ header = (_standardHeader *) res_man.open(resourceId);
res_man.close(resourceId);
// note this pointer is no longer valid, but it should be ok until
Index: router.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/router.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- router.cpp 4 Oct 2003 08:07:02 -0000 1.21
+++ router.cpp 5 Oct 2003 15:28:13 -0000 1.22
@@ -133,7 +133,10 @@
static void LoadWalkGrid(void);
static void SetUpWalkGrid(Object_mega *ob_mega, int32 x, int32 y, int32 dir);
static void LoadWalkData(Object_walkdata *ob_walkdata);
+
+#ifdef _SWORD2_DEBUG
static void PlotCross(int16 x, int16 y, uint8 colour);
+#endif
static int32 Scan(int32 level);
static int32 NewCheck(int32 status, int32 x1, int32 y1, int32 x2, int32 y2);
@@ -483,7 +486,7 @@
do {
changed = Scan(level);
level++;
- } while(changed == 1);
+ } while (changed == 1);
// Check to see if the route reached the target
@@ -680,7 +683,7 @@
// route.X route.Y route.dir and bestTurns start at far end
p++;
- } while (p < (routeLength));
+ } while (p < routeLength);
// best turns will end heading as near as possible to target dir rest
// is down to anim for now
@@ -987,7 +990,7 @@
walkAnim[walk_pc].step = 0;
debug(5, "SLOW-OUT FRAME: walkAnim[%d].frame = %d",walk_pc, walkAnim[walk_pc].frame);
walk_pc++;
- } while(walkAnim[walk_pc].step > 0);
+ } while (walkAnim[walk_pc].step > 0);
// add stationary frame(s) (OPTIONAL)
@@ -1050,7 +1053,7 @@
debug(5, "walkAnim[%d].frame = %d",slowOutFrameNo,walkAnim[slowOutFrameNo].frame);
slowOutFrameNo++;
- } while(slowOutFrameNo < lastCount);
+ } while (slowOutFrameNo < lastCount);
// add stationary frame(s) (OPTIONAL)
@@ -1264,7 +1267,7 @@
stepCount++;
step++;
module++;
- } while(module < moduleEnd);
+ } while (module < moduleEnd);
stepX = modX[modularPath[p].dir];
stepY = modY[modularPath[p].dir];
@@ -1323,7 +1326,7 @@
do {
frameCount++;
walkAnim[lastCount + frameCount - 1].x += errorX * frameCount / frames;
- } while(frameCount < frames);
+ } while (frameCount < frames);
}
if (errorY != 0) {
@@ -1332,7 +1335,7 @@
do {
frameCount++;
walkAnim[lastCount + frameCount - 1].y += errorY * frameCount / frames;
- } while(frameCount < frames);
+ } while (frameCount < frames);
}
// Now is the time to put in the turn frames
@@ -1375,7 +1378,7 @@
// turning right
walkAnim[frame].frame += firstWalkingTurnRightFrame;
frame++;
- } while(frame < lastCount);
+ } while (frame < lastCount);
}
lastDir = currentDir;
}
@@ -1735,7 +1738,7 @@
currentDir = 99;
do {
- while(modularPath[p].num > 0) {
+ while (modularPath[p].num > 0) {
currentDir = modularPath[p].dir;
if (currentDir< NO_DIRECTIONS) {
module = currentDir * framesPerStep * 2 + left;
@@ -1762,7 +1765,7 @@
stepCount++;
module++;
step++;
- } while( module < moduleEnd);
+ } while (module < moduleEnd);
errorX = modularPath[p].x - moduleX;
errorX = errorX * modX[modularPath[p].dir];
@@ -1797,8 +1800,8 @@
// walk
if (slowStart == 1) {
- stepCount -= numberOfSlowInFrames[currentDir]; // (James08sep97)
- lastCount -= numberOfSlowInFrames[currentDir]; // (James08sep97)
+ stepCount -= numberOfSlowInFrames[currentDir];
+ lastCount -= numberOfSlowInFrames[currentDir];
slowStart = 0;
}
@@ -2254,7 +2257,7 @@
}
}
i++;
- } while(i < nbars && linesCrossed);
+ } while (i < nbars && linesCrossed);
return linesCrossed;
}
@@ -2301,7 +2304,7 @@
}
}
i++;
- } while(i < nbars && linesCrossed);
+ } while (i < nbars && linesCrossed);
return linesCrossed;
}
@@ -2351,7 +2354,7 @@
}
}
i++;
- } while(i < nbars && linesCrossed);
+ } while (i < nbars && linesCrossed);
return linesCrossed;
}
@@ -2418,7 +2421,7 @@
}
}
i++;
- } while(i < nbars && onLine == 0);
+ } while (i < nbars && onLine == 0);
return onLine;
}
@@ -2694,6 +2697,7 @@
node[nnodes].dist = 9999;
}
+#ifdef _SWORD2_DEBUG
void PlotWalkGrid(void) {
int32 j;
@@ -2716,6 +2720,7 @@
DrawLine(x - 1, y - 1, x + 1, y + 1, colour);
DrawLine(x + 1, y - 1, x - 1, y + 1, colour);
}
+#endif
void LoadWalkGrid(void) {
_walkGridHeader floorHeader;
Index: router.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/router.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- router.h 4 Oct 2003 08:07:02 -0000 1.6
+++ router.h 5 Oct 2003 15:28:13 -0000 1.7
@@ -72,10 +72,13 @@
void FloatRouteMem(void);
void FreeRouteMem(void);
void FreeAllRouteMem(void);
-void PlotWalkGrid(void);
void AddWalkGrid(int32 gridResource);
void RemoveWalkGrid(int32 gridResource);
void ClearWalkGridList(void);
+
+#ifdef _SWORD2_DEBUG
+void PlotWalkGrid(void);
+#endif
} // End of namespace Sword2
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sound.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- sound.cpp 4 Oct 2003 08:07:02 -0000 1.23
+++ sound.cpp 5 Oct 2003 15:28:13 -0000 1.24
@@ -398,7 +398,7 @@
return IR_CONT;
}
-void Kill_music(void) { // James22aug97
+void Kill_music(void) {
looping_music_id = 0; // clear the 'looping' flag
g_sound->stopMusic();
}
Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- sword2.cpp 5 Oct 2003 14:37:16 -0000 1.50
+++ sword2.cpp 5 Oct 2003 15:28:13 -0000 1.51
@@ -462,6 +462,20 @@
debug(5, "Start_game() DONE.");
}
+// 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);
+ }
+}
+
void PauseGame(void) {
// uint8 *text;
Index: sword2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- sword2.h 4 Oct 2003 08:07:02 -0000 1.16
+++ sword2.h 5 Oct 2003 15:28:14 -0000 1.17
@@ -50,6 +50,8 @@
void PauseGame(void);
void UnpauseGame(void);
+void sleepUntil(int32 time);
+
#define HEAD_LEN 8
extern uint8 version_string[]; // for displaying from the console
Index: walker.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/walker.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- walker.cpp 4 Oct 2003 08:07:02 -0000 1.11
+++ walker.cpp 5 Oct 2003 15:28:14 -0000 1.12
@@ -162,7 +162,7 @@
// it in script to check if a 2nd-click came along
// EXIT_FADING = 0;
- // finished walk (James23jun97)
+ // finished walk
ob_mega->currently_walking = 0;
// (see FN_get_player_savedata() in save_rest.cpp
@@ -207,7 +207,7 @@
ob_logic->looping = 0; // so script loop stops
FreeRouteMem(); // free up the walkdata mem block
- // finished walk(James23jun97)
+ // finished walk
ob_mega->currently_walking = 0;
// (see FN_get_player_savedata() in save_rest.cpp
- Previous message: [Scummvm-cvs-logs] CVS: scummvm TODO,1.19,1.20 README,1.186,1.187
- Next message: [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
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list