aboutsummaryrefslogtreecommitdiff
path: root/gob
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-08-08 20:20:00 +0000
committerTorbjörn Andersson2005-08-08 20:20:00 +0000
commite64afc23b4199952ce77de16f94bf30f54fd6c57 (patch)
treebbb3023fb04b57a649d3def7c995836036eb0ae1 /gob
parentaebd226028631bed2387f907fe5683d4b2963d83 (diff)
downloadscummvm-rg350-e64afc23b4199952ce77de16f94bf30f54fd6c57.tar.gz
scummvm-rg350-e64afc23b4199952ce77de16f94bf30f54fd6c57.tar.bz2
scummvm-rg350-e64afc23b4199952ce77de16f94bf30f54fd6c57.zip
Cleanups. Mostly removal of seemingly unused variables and stuff.
svn-id: r18639
Diffstat (limited to 'gob')
-rw-r--r--gob/game.cpp13
-rw-r--r--gob/global.cpp30
-rw-r--r--gob/global.h41
-rw-r--r--gob/gob.cpp3
-rw-r--r--gob/init.cpp23
-rw-r--r--gob/video.cpp10
-rw-r--r--gob/video.h19
7 files changed, 8 insertions, 131 deletions
diff --git a/gob/game.cpp b/gob/game.cpp
index 84ac83312d..15cf15e65a 100644
--- a/gob/game.cpp
+++ b/gob/game.cpp
@@ -71,7 +71,7 @@ int16 game_collStackElemSizes[3];
int16 game_mouseButtons = 0;
// Capture
-static Rectangle game_captureStack[20];
+static Common::Rect game_captureStack[20];
static int16 game_captureCount = 0;
Snd_SoundDesc *game_soundSamples[20];
@@ -323,8 +323,8 @@ void game_capturePush(int16 left, int16 top, int16 width, int16 height) {
game_captureStack[game_captureCount].left = left;
game_captureStack[game_captureCount].top = top;
- game_captureStack[game_captureCount].width = width;
- game_captureStack[game_captureCount].height = height;
+ game_captureStack[game_captureCount].right = left + width;
+ game_captureStack[game_captureCount].bottom = top + height;
draw_spriteTop = top;
draw_spriteBottom = height;
@@ -356,9 +356,10 @@ void game_capturePop(char doDraw) {
if (doDraw) {
draw_destSpriteX = game_captureStack[game_captureCount].left;
draw_destSpriteY = game_captureStack[game_captureCount].top;
- draw_spriteRight = game_captureStack[game_captureCount].width;
+ draw_spriteRight =
+ game_captureStack[game_captureCount].width();
draw_spriteBottom =
- game_captureStack[game_captureCount].height;
+ game_captureStack[game_captureCount].height();
draw_transparency = 0;
draw_sourceSurface = 30 + game_captureCount;
@@ -1646,10 +1647,8 @@ void game_prepareStart(void) {
}
draw_cursorAnimLow[1] = 0;
- trySmallForBig = 1;
draw_cursorSprites = vid_initSurfDesc(videoMode, 32, 16, 2);
draw_cursorBack = vid_initSurfDesc(videoMode, 16, 16, 0);
- trySmallForBig = 0;
draw_renderFlags = 0;
draw_backDeltaX = 0;
draw_backDeltaY = 0;
diff --git a/gob/global.cpp b/gob/global.cpp
index 9ec7410d57..9dd612a72c 100644
--- a/gob/global.cpp
+++ b/gob/global.cpp
@@ -59,12 +59,6 @@ int16 mouseMaxRow = 200;
uint16 disableLangCfg = 0x8000;
uint16 language = 0x8000;
-/* Configuration */
-char batFileName[8];
-
-/* */
-int16 requiredSpace = 0;
-
/* Timer variables */
int32 startTime = 0;
char timer_enabled = 1;
@@ -73,25 +67,13 @@ int16 timer_delta = 1000;
int16 frameWaitTime = 0;
int32 startFrameTime = 0;
-/* Memory */
-int16 allocatedBlocks[2] = { 0, 0 };
-char *heapHeads[2] = { 0, 0 };
-char *heapFence = 0;
-int32 heapSize = 10000000;
-char inAllocSub = 0;
-
-/* Runtime */
-//CleanupFuncPtr soundCleanup = 0;
-
/* Timer and delays */
int16 delayTime = 0;
-int16 fastComputer = 1;
/* Joystick */
char useJoystick = 1;
/* Files */
-int16 filesCount = 0;
Common::File filesHandles[MAX_FILES];
/* Data files */
@@ -104,7 +86,6 @@ int32 chunkSize[MAX_SLOT_COUNT * MAX_DATA_FILES];
char isCurrentSlot[MAX_SLOT_COUNT * MAX_DATA_FILES];
int32 packedSize = 0;
-
int16 sprAllocated = 0;
SurfaceDesc primarySurfDesc;
@@ -115,8 +96,6 @@ int16 primaryHeight;
int16 doRangeClamp = 0;
-DrawPackedSpriteFunc pDrawPacked;
-
char redPalette[256];
char greenPalette[256];
char bluePalette[256];
@@ -124,15 +103,12 @@ char bluePalette[256];
int16 setAllPalette = 0;
int16 oldMode = 3;
-int16 needDriverInit = 1;
char dontSetPalette = 0;
SurfaceDesc *curPrimaryDesc = 0;
SurfaceDesc *allocatedPrimary = 0;
PalDesc *pPaletteDesc = 0;
-FileHandler pFileHandler = 0;
-
int16 unusedPalette1[18] = {
0, 0x0b, 0, (int16)0x5555, (int16)0xAAAA, (int16)0xFFFF, 0, (int16)0x5555,
(int16)0xAAAA, (int16)0xFFFF, 0, (int16)0x5555,
@@ -165,15 +141,9 @@ Color vgaPalette[16] = {
PalDesc paletteStruct;
int16 debugFlag = 0;
-int16 breakSet = 0;
int16 inVM = 0;
int16 colorCount = 16;
-int16 slowCD = 0;
-int16 checkMemFlag = 0;
-
-int16 trySmallForBig = 0;
-
char inter_resStr[200];
int32 inter_resVal = 0;
diff --git a/gob/global.h b/gob/global.h
index 35611392f7..169ea13552 100644
--- a/gob/global.h
+++ b/gob/global.h
@@ -45,13 +45,12 @@ extern int16 disableVideoCfg;
#define VIDMODE_CGA 0x05
#define VIDMODE_EGA 0x0d
-#define VIDMODE_VGA 0x13
+#define VIDMODE_VGA 0x13
#define VIDMODE_HER 7
extern uint16 presentSound;
extern uint16 soundFlags;
extern int16 disableSoundCfg;
-//extern int16 blasterPort;
#define PROAUDIO_FLAG 0x10
#define ADLIB_FLAG 0x08
@@ -76,12 +75,6 @@ extern uint16 language;
#define ESCAPE 0x001b
#define ENTER 0x000d
-/* Configuration */
-extern char batFileName[8];
-
-/* Init */
-extern int16 requiredSpace;
-
/* Timer variables */
extern int32 startTime;
extern char timer_enabled;
@@ -98,16 +91,8 @@ extern int16 mouseYShift;
extern int16 mouseMaxCol;
extern int16 mouseMaxRow;
-/* Memory */
-extern int16 allocatedBlocks[2];
-extern char *heapHeads[2];
-extern int32 heapSize;
-extern char *heapFence;
-extern char inAllocSub;
-
/* Timer and delays */
extern int16 delayTime;
-extern int16 fastComputer;
/* Joystick */
extern char useJoystick;
@@ -115,7 +100,6 @@ extern char useJoystick;
/* Files */
#define MAX_FILES 30
-extern int16 filesCount;
extern Common::File filesHandles[MAX_FILES];
/* Data files */
@@ -144,8 +128,6 @@ extern int16 primaryHeight;
extern int16 doRangeClamp;
-extern DrawPackedSpriteFunc pDrawPacked;
-
extern char redPalette[256];
extern char greenPalette[256];
extern char bluePalette[256];
@@ -156,31 +138,19 @@ extern SurfaceDesc *curPrimaryDesc;
extern SurfaceDesc *allocatedPrimary;
extern int16 oldMode;
-extern int16 needDriverInit;
extern char dontSetPalette;
extern PalDesc *pPaletteDesc;
-typedef void (*FileHandler) (char *path);
-extern FileHandler pFileHandler;
-
- //extern void interrupt(*oldInt5Handler) (void);
- //extern void interrupt(*oldInt0Handler) (void);
- //extern void interrupt(*oldInt1bHandler) (void);
-
extern int16 unusedPalette1[18];
extern int16 unusedPalette2[16];
extern Color vgaPalette[16];
extern PalDesc paletteStruct;
extern int16 debugFlag;
-extern int16 breakSet;
extern int16 inVM;
extern int16 colorCount;
-extern int16 trySmallForBig;
-extern int16 checkMemFlag;
-
extern char inter_resStr[200];
extern int32 inter_resVal;
@@ -193,13 +163,6 @@ extern int16 inter_mouseY;
extern char *tmpPalBuffer;
-typedef struct Rectangle {
- int16 left;
- int16 top;
- int16 width;
- int16 height;
-} Rectangle;
-
-} // End of namespace Gob
+} // End of namespace Gob
#endif
diff --git a/gob/gob.cpp b/gob/gob.cpp
index b20042de78..275e9d8397 100644
--- a/gob/gob.cpp
+++ b/gob/gob.cpp
@@ -248,11 +248,8 @@ int GobEngine::init(GameDetector &detector) {
_system->openCD(cd_num);
debugFlag = 1;
- breakSet = 0;
doRangeClamp = 1;
- trySmallForBig = 0;
- checkMemFlag = 0;
videoMode = 0x13;
snd_soundPort = 1;
useMouse = 1;
diff --git a/gob/init.cpp b/gob/init.cpp
index 17868060af..7a108cff93 100644
--- a/gob/init.cpp
+++ b/gob/init.cpp
@@ -67,8 +67,6 @@ void init_soundVideo(int32 smallHeap, int16 flag) {
error("init_soundVideo: Video mode 0x%x is not supported!",
videoMode);
- pFileHandler = 0;
-
//if ((flag & 4) == 0)
// vid_findVideo();
@@ -79,14 +77,12 @@ void init_soundVideo(int32 smallHeap, int16 flag) {
presentSound = 0; // FIXME: sound is not supported yet
sprAllocated = 0;
- filesCount = 0;
timer_enableTimer();
// snd_setResetTimerFlag(debugFlag); // TODO
if (videoMode == 0x13)
colorCount = 256;
- fastComputer = 1;
pPaletteDesc = &paletteStruct;
pPaletteDesc->vgaPal = vgaPalette;
@@ -125,31 +121,16 @@ void init_cleanup(void) {
snd_speakerOff();
data_closeDataFile();
- if (filesCount != 0)
- error("init_cleanup: Error! Opened files lef: %d", filesCount);
if (sprAllocated != 0)
error("init_cleanup: Error! Allocated sprites left: %d",
sprAllocated);
- if (allocatedBlocks[0] != 0)
- error("init_cleanup: Error! Allocated blocks in heap 0 left: %d",
- allocatedBlocks[0]);
-
- if (allocatedBlocks[1] != 0)
- error("init_cleanup: Error! Allocated blocks in heap 1 left: %d",
- allocatedBlocks[1]);
-
snd_stopSound(0);
keyboard_release();
- //free(heapHeads);
g_system->quit();
}
-/*static void init_hardErrHandler(void) {
- hardretn(-1);
-}*/
-
void init_initGame(char *totName) {
int16 handle2;
int16 i;
@@ -175,9 +156,6 @@ memBlocks = word ptr -2*/
disableVideoCfg = 0x11;
disableMouseCfg = 0x15;
- //reqRAMParag = 570;
- //requiredSpace = 10;
- strcpy(batFileName, "go");
init_soundVideo(1000, 1);
handle2 = data_openData("intro.stk");
@@ -190,7 +168,6 @@ memBlocks = word ptr -2*/
vid_setHandlers();
vid_initPrimary(videoMode);
-// harderr(&init_hardErrHandler);
mouseXShift = 1;
mouseYShift = 1;
diff --git a/gob/video.cpp b/gob/video.cpp
index 8296127b09..6df6c68d00 100644
--- a/gob/video.cpp
+++ b/gob/video.cpp
@@ -233,7 +233,6 @@ void vid_drawSprite(SurfaceDesc *source, SurfaceDesc *dest,
bottom -= destBottom - dest->height + 1;
}
-// pDrawSprite(source, dest, left, top, right, bottom, x, y, transp);
_videoDriver->drawSprite(source, dest, left, top, right, bottom, x, y, transp);
}
@@ -267,7 +266,6 @@ void vid_fillRect(SurfaceDesc *dest, int16 left, int16 top, int16 right, int16 b
bottom = vid_clampValue(bottom, dest->height);
}
-// pFillRect(dest, left, top, right, bottom, color);
_videoDriver->fillRect(dest, left, top, right, bottom, color);
}
@@ -277,7 +275,6 @@ void vid_drawLine(SurfaceDesc *dest, int16 x0, int16 y0, int16 x1, int16 y1, int
return;
}
-// pDrawLine(dest, x0, y0, x1, y1, color);
_videoDriver->drawLine(dest, x0, y0, x1, y1, color);
}
@@ -285,14 +282,12 @@ void vid_putPixel(int16 x, int16 y, int16 color, SurfaceDesc *dest) {
if (x < 0 || y < 0 || x >= dest->width || y >= dest->height)
return;
-// pPutPixel(x, y, color, dest);
_videoDriver->putPixel(x, y, color, dest);
}
void vid_drawLetter(unsigned char item, int16 x, int16 y, FontDesc *fontDesc, int16 color1,
int16 color2, int16 transp, SurfaceDesc * dest) {
-// pDrawLetter(item, x, y, fontDesc, color1, color2, transp, dest);
_videoDriver->drawLetter(item, x, y, fontDesc, color1, color2, transp, dest);
}
@@ -310,7 +305,6 @@ void vid_drawPackedSprite(byte *sprBuf, int16 width, int16 height, int16 x, int1
error("vid_drawPackedSprite: Vide mode 0x%x is not fully supported!",
dest->vidMode & 0x7f);
-// pDrawPackedSprite(sprBuf, width, height, x, y, transp, dest);
_videoDriver->drawPackedSprite(sprBuf, width, height, x, y, transp, dest);
}
@@ -407,8 +401,6 @@ void vid_initPrimary(int16 mode) {
if (mode != 3)
vid_initDriver(mode);
- needDriverInit = 1;
-
if (mode != 3) {
vid_initSurfDesc(mode, 320, 200, PRIMARY_SURFACE);
@@ -549,8 +541,6 @@ char vid_spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
}
void vid_setHandlers() {
- //pDrawPacked = &vid_spriteUncompressor;
- pFileHandler = 0;
setAllPalette = 1;
}
diff --git a/gob/video.h b/gob/video.h
index ea2e7bd2d9..8d8e0a43ae 100644
--- a/gob/video.h
+++ b/gob/video.h
@@ -70,27 +70,8 @@ public:
virtual void drawPackedSprite(byte *sprBuf, int16 width, int16 height, int16 x, int16 y, byte transp, SurfaceDesc *dest) = 0;
};
-
-typedef void (*FillRectFunc) (SurfaceDesc * desc, int16 left, int16 top, int16 right,
- int16 bottom, int16 color);
-typedef void (*DrawSpriteFunc) (SurfaceDesc * source, SurfaceDesc * dest,
- int16 left, int16 top, int16 right, int16 bottom, int16 x, int16 y, int16 transp);
-typedef void (*PutPixelFunc) (int16 x, int16 y, int16 color, SurfaceDesc * desc);
-typedef void (*XorRectFunc) (SurfaceDesc * desc, int16 left, int16 top, int16 right,
- int16 bottom);
-typedef void (*SetXorValFunc) (int16 val);
-typedef void (*DrawLineFunc) (SurfaceDesc * desc, int16 x0, int16 y0, int16 x1,
- int16 y1, int16 color);
-typedef void (*DrawLetterFunc) (char item, int16 x, int16 y, FontDesc * fontDesc,
- int16 color1, int16 color2, int16 transp, SurfaceDesc * dest);
-typedef char (*DrawPackedSpriteFunc) (byte *sprBuf, int16 width, int16 height,
- int16 x, int16 y, int16 transp, SurfaceDesc * dest);
-
#define GDR_VERSION 4
-#define SET_SEG(ptr,seg) (((unsigned*)(ptr))[1] = (seg))
-
-
#define PRIMARY_SURFACE 0x80
#define RETURN_PRIMARY 0x01
#define DISABLE_SPR_ALLOC 0x20