[Scummvm-cvs-logs] CVS: scummvm/bs2/driver driver96.h,1.43,1.44 keyboard.cpp,1.7,1.8 language.cpp,1.4,1.5 render.cpp,1.24,1.25
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Tue Sep 23 23:41:12 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/bs2 build_display.cpp,1.22,1.23 console.cpp,1.9,1.10 interpreter.cpp,1.12,1.13 maketext.cpp,1.11,1.12 resman.cpp,1.41,1.42 router.cpp,1.14,1.15 speech.cpp,1.20,1.21 sword2.cpp,1.37,1.38 walker.cpp,1.5,1.6
- Next message: [Scummvm-cvs-logs] CVS: scummvm scumm.dsp,1.49,1.50 scummvm.dsp,1.56,1.57
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv11562/driver
Modified Files:
driver96.h keyboard.cpp language.cpp render.cpp
Log Message:
Replaced abs() with ABS and BOOL with bool, plus some minor cleanups.
Index: driver96.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/driver96.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- driver96.h 23 Sep 2003 16:53:25 -0000 1.43
+++ driver96.h 24 Sep 2003 06:40:22 -0000 1.44
@@ -898,10 +898,6 @@
// Key buffer size
#define MAX_KEY_BUFFER 32
-typedef int BOOL;
-#define TRUE 1
-#define FALSE 0
-
//
// Structure definitions
// ---------------------
@@ -921,11 +917,10 @@
#pragma START_PACK_STRUCTS
#endif
-typedef struct
-{
- uint16 w;
- uint16 h;
- uint32 offset[2]; // 2 is arbitrary
+typedef struct {
+ uint16 w;
+ uint16 h;
+ uint32 offset[2]; // 2 is arbitrary
} GCC_PACK _parallax;
#if !defined(__GNUC__)
@@ -933,30 +928,29 @@
#endif
-// The _spriteInfo structure is used to tell the driver96 code what attributes
-// are linked to a sprite for drawing. These include position, scaling and
-// compression.
-typedef struct
-{
- int16 x; // coords for top-left of sprite
- int16 y;
- uint16 w; // dimensions of sprite (before scaling)
- uint16 h;
- uint16 scale; // scale at which to draw, given in 256ths ['0' or '256' MEANS DON'T SCALE]
- uint16 scaledWidth; // new dimensions (we calc these for the mouse area, so may as well pass to you to save time)
- uint16 scaledHeight; //
- uint16 type; // mask containing 'RDSPR_' bits specifying compression type, flip, transparency, etc
- uint16 blend; // holds the blending values.
- uint8 *data; // pointer to the sprite data
- uint8 *colourTable; // pointer to 16-byte colour table, only applicable to 16-col compression type
+// The _spriteInfo structure is used to tell the driver96 code what attributes
+// are linked to a sprite for drawing. These include position, scaling and
+// compression.
+
+typedef struct {
+ int16 x; // coords for top-left of sprite
+ int16 y;
+ uint16 w; // dimensions of sprite (before scaling)
+ uint16 h;
+ uint16 scale; // scale at which to draw, given in 256ths ['0' or '256' MEANS DON'T SCALE]
+ uint16 scaledWidth; // new dimensions (we calc these for the mouse area, so may as well pass to you to save time)
+ uint16 scaledHeight; //
+ uint16 type; // mask containing 'RDSPR_' bits specifying compression type, flip, transparency, etc
+ uint16 blend; // holds the blending values.
+ uint8 *data; // pointer to the sprite data
+ uint8 *colourTable; // pointer to 16-byte colour table, only applicable to 16-col compression type
} _spriteInfo;
// This is the format of a .WAV file. Somewhere after this header is the string
// 'DATA' followed by an int32 size which is the size of the data. Following
// the size of the data is the data itself.
-typedef struct
-{
+typedef struct {
uint32 riff;
uint32 fileLength;
uint32 wavID;
@@ -977,8 +971,7 @@
// It includes the smack to play, and any text lines which are
// to be displayed over the top of the sequence.
-typedef struct
-{
+typedef struct {
uint16 startFrame;
uint16 endFrame;
_spriteInfo *textSprite;
@@ -986,25 +979,6 @@
uint16 *speech;
} _movieTextObject;
-
-
-typedef struct
-{ uint8 manufacturer;
- uint8 version;
- uint8 encoding;
- uint8 bitsPerPixel;
- int16 xmin,ymin;
- int16 xmax,ymax;
- int16 hres;
- int16 vres;
- char palette[48];
- char reserved;
- uint8 colourPlanes;
- int16 bytesPerLine;
- int16 paletteType;
- char filler[58];
-} _pcxHeader;
-
//
// Function Prototypes
// -------------------
@@ -1068,7 +1042,7 @@
//-----------------------------------------------------------------------------
// Keyboard functions - from keyboard.c
//-----------------------------------------------------------------------------
-extern BOOL KeyWaiting(void);
+extern bool KeyWaiting(void);
extern int32 ReadKey(_keyboardEvent *ke);
//-----------------------------------------------------------------------------
@@ -1089,7 +1063,7 @@
extern int32 SetScrollTarget(int16 sx, int16 sy);
extern int32 InitialiseRenderCycle(void);
extern int32 StartRenderCycle(void);
-extern int32 EndRenderCycle(BOOL *end);
+extern int32 EndRenderCycle(bool *end);
extern int32 RenderParallax(_parallax *p, int16 layer);
extern int32 SetLocationMetrics(uint16 w, uint16 h);
extern int32 CopyScreenBuffer(void);
@@ -1110,7 +1084,6 @@
extern uint8 GetMenuStatus(uint8 menu);
extern int32 CloseMenuImmediately(void);
-
//-----------------------------------------------------------------------------
// Misc functions - from misc.cpp
//-----------------------------------------------------------------------------
@@ -1121,18 +1094,13 @@
extern void scumm_mkdir(const char *pathname);
extern void SVM_GetModuleFileName(void *module, char *destStr, uint32 maxLen);
-
-//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-extern int16 screenWide; // Width of the screen display
-extern int16 screenDeep; // Height of the screen display
-extern int16 mousex; // Mouse screen x coordinate
-extern int16 mousey; // Mouse screen y coordinate
-extern int32 renderCaps; // Flags which determine how to render the scene.
-extern uint8 palCopy[256][4]; // Current palette.
-//-----------------------------------------------------------------------------
-
-extern long int myTimers[10][2];
+extern int16 screenWide; // Width of the screen display
+extern int16 screenDeep; // Height of the screen display
+extern int16 mousex; // Mouse screen x coordinate
+extern int16 mousey; // Mouse screen y coordinate
+extern int32 renderCaps; // Flags which determine how to render the scene.
+extern uint8 palCopy[256][4]; // Current palette.
#ifdef __cplusplus
}
Index: keyboard.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/keyboard.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- keyboard.cpp 23 Sep 2003 16:53:25 -0000 1.7
+++ keyboard.cpp 24 Sep 2003 06:40:23 -0000 1.8
@@ -70,11 +70,8 @@
}
}
-BOOL KeyWaiting(void) {
- if (keyBacklog)
- return TRUE;
-
- return FALSE;
+bool KeyWaiting(void) {
+ return keyBacklog != 0;
}
int32 ReadKey(_keyboardEvent *ev) {
Index: language.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/language.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- language.cpp 23 Sep 2003 16:53:25 -0000 1.4
+++ language.cpp 24 Sep 2003 06:40:23 -0000 1.5
@@ -67,12 +67,11 @@
} else {
versionFromFile = 1;
languageVersion = AMERICAN;
- return(RDERR_OPENVERSIONFILE);
+ return RDERR_OPENVERSIONFILE;
}
return RD_OK;
}
-
int32 SetLanguageVersion(uint8 version) {
languageVersion = version;
return RD_OK;
@@ -86,17 +85,17 @@
switch (version) {
case ENGLISH:
- strcpy((char *)name, "Broken Sword II");
+ strcpy((char *) name, "Broken Sword II");
break;
case AMERICAN:
- strcpy((char *)name, "Circle of Blood II");
+ strcpy((char *) name, "Circle of Blood II");
break;
case GERMAN:
- strcpy((char *)name, "Baphomet's Fluch II");
+ strcpy((char *) name, "Baphomet's Fluch II");
break;
default:
strcpy((char *)name, "Some game or other, part 86");
- return(RDERR_INVALIDVERSION);
+ return RDERR_INVALIDVERSION;
}
return rv;
Index: render.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/render.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- render.cpp 23 Sep 2003 16:53:25 -0000 1.24
+++ render.cpp 24 Sep 2003 06:40:23 -0000 1.25
@@ -809,8 +809,6 @@
}
-
-
int32 RenderParallax(_parallax *p, int16 l) {
int16 x, y;
int16 i, j;
@@ -854,10 +852,6 @@
}
-
-
-
-
/*
#define LOGSIZE 10
int32 previousTimeLog[LOGSIZE];
@@ -902,8 +896,6 @@
return RD_OK;
}
-
-
int32 StartRenderCycle(void) {
scrollxOld = scrollx;
scrollyOld = scrolly;
@@ -924,7 +916,6 @@
return RD_OK;
}
-
// FIXME: Move this to some better place?
void sleepUntil(int32 time) {
@@ -939,7 +930,7 @@
}
}
-int32 EndRenderCycle(BOOL *end) {
+int32 EndRenderCycle(bool *end) {
int32 time;
time = SVM_timeGetTime();
@@ -953,23 +944,23 @@
renderCountIndex = 0;
if (renderTooSlow) {
- *end = TRUE;
+ *end = true;
InitialiseRenderCycle();
} else if (startTime + renderAverageTime >= totalTime) {
- *end = TRUE;
+ *end = true;
totalTime += MILLISECSPERCYCLE;
initialTime = time;
#ifdef LIMIT_FRAME_RATE
} else if (scrollxTarget == scrollx && scrollyTarget == scrolly) {
// If we have already reached the scroll target sleep for the
// rest of the render cycle.
- *end = TRUE;
+ *end = true;
sleepUntil(totalTime);
initialTime = SVM_timeGetTime();
totalTime += MILLISECSPERCYCLE;
#endif
} else {
- *end = FALSE;
+ *end = false;
// This is an attempt to ensure that we always reach the scroll
// target. Otherwise the game frequently tries to pump out new
@@ -987,7 +978,6 @@
return RD_OK;
}
-
int32 SetScrollTarget(int16 sx, int16 sy) {
scrollxTarget = sx;
scrollyTarget = sy;
@@ -1000,7 +990,6 @@
return RD_OK;
}
-
int32 InitialiseBackgroundLayer(_parallax *p) {
uint8 *memchunk;
uint8 zeros;
@@ -1121,7 +1110,6 @@
}
-
int32 CloseBackgroundLayer(void) {
debug(2, "CloseBackgroundLayer");
@@ -1139,11 +1127,4 @@
layer = 0;
return RD_OK;
-}
-
-
-int32 EraseSoftwareScreenBuffer(void)
-{
- // memset(myScreenBuffer, 0, RENDERWIDE * RENDERDEEP);
- return(RD_OK);
}
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/bs2 build_display.cpp,1.22,1.23 console.cpp,1.9,1.10 interpreter.cpp,1.12,1.13 maketext.cpp,1.11,1.12 resman.cpp,1.41,1.42 router.cpp,1.14,1.15 speech.cpp,1.20,1.21 sword2.cpp,1.37,1.38 walker.cpp,1.5,1.6
- Next message: [Scummvm-cvs-logs] CVS: scummvm scumm.dsp,1.49,1.50 scummvm.dsp,1.56,1.57
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list