[Scummvm-cvs-logs] CVS: scummvm/gob game.cpp,1.24,1.25 global.cpp,1.6,1.7 global.h,1.5,1.6 gob.cpp,1.22,1.23 init.cpp,1.10,1.11 video.cpp,1.13,1.14 video.h,1.8,1.9

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Tue Aug 9 20:53:19 CEST 2005


Update of /cvsroot/scummvm/scummvm/gob
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2832

Modified Files:
	game.cpp global.cpp global.h gob.cpp init.cpp video.cpp 
	video.h 
Log Message:
Cleanups. Mostly removal of seemingly unused variables and stuff.


Index: game.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/game.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- game.cpp	30 Jul 2005 21:10:59 -0000	1.24
+++ game.cpp	8 Aug 2005 20:19:57 -0000	1.25
@@ -71,7 +71,7 @@
 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 @@
 
 	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 @@
 	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 @@
 	}
 
 	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;

Index: global.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/global.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- global.cpp	10 May 2005 22:55:47 -0000	1.6
+++ global.cpp	8 Aug 2005 20:19:58 -0000	1.7
@@ -59,12 +59,6 @@
 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 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 @@
 char isCurrentSlot[MAX_SLOT_COUNT * MAX_DATA_FILES];
 int32 packedSize = 0;
 
-
 int16 sprAllocated = 0;
 
 SurfaceDesc primarySurfDesc;
@@ -115,8 +96,6 @@
 
 int16 doRangeClamp = 0;
 
-DrawPackedSpriteFunc pDrawPacked;
-
 char redPalette[256];
 char greenPalette[256];
 char bluePalette[256];
@@ -124,15 +103,12 @@
 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 @@
 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;
 

Index: global.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/global.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- global.h	10 May 2005 22:55:47 -0000	1.5
+++ global.h	8 Aug 2005 20:19:59 -0000	1.6
@@ -45,13 +45,12 @@
 
 #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 @@
 #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 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 @@
 /* Files */
 #define MAX_FILES	30
 
-extern int16 filesCount;
 extern Common::File filesHandles[MAX_FILES];
 
 /* Data files */
@@ -144,8 +128,6 @@
 
 extern int16 doRangeClamp;
 
-extern DrawPackedSpriteFunc pDrawPacked;
-
 extern char redPalette[256];
 extern char greenPalette[256];
 extern char bluePalette[256];
@@ -156,31 +138,19 @@
 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 char *tmpPalBuffer;
 
-typedef struct Rectangle {
-	int16 left;
-	int16 top;
-	int16 width;
-	int16 height;
-} Rectangle;
-
-}				// End of namespace Gob
+} // End of namespace Gob
 
 #endif

Index: gob.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/gob.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- gob.cpp	24 Jun 2005 15:22:39 -0000	1.22
+++ gob.cpp	8 Aug 2005 20:19:59 -0000	1.23
@@ -248,11 +248,8 @@
 		_system->openCD(cd_num);
 
 	debugFlag = 1;
-	breakSet = 0;
 	doRangeClamp = 1;
-	trySmallForBig = 0;
 
-	checkMemFlag = 0;
 	videoMode = 0x13;
 	snd_soundPort = 1;
 	useMouse = 1;

Index: init.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/init.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- init.cpp	5 May 2005 11:11:49 -0000	1.10
+++ init.cpp	8 Aug 2005 20:20:00 -0000	1.11
@@ -67,8 +67,6 @@
 		error("init_soundVideo: Video mode 0x%x is not supported!",
 		    videoMode);
 
-	pFileHandler = 0;
-
 	//if ((flag & 4) == 0)
 	//	vid_findVideo();
 
@@ -79,14 +77,12 @@
 	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 @@
 	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 @@
 
 	disableVideoCfg = 0x11;
 	disableMouseCfg = 0x15;
-	//reqRAMParag = 570;
-	//requiredSpace = 10;
-	strcpy(batFileName, "go");
 	init_soundVideo(1000, 1);
 
 	handle2 = data_openData("intro.stk");
@@ -190,7 +168,6 @@
 
 	vid_setHandlers();
 	vid_initPrimary(videoMode);
-//      harderr(&init_hardErrHandler);
 	mouseXShift = 1;
 	mouseYShift = 1;
 

Index: video.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/video.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- video.cpp	30 Jul 2005 21:11:00 -0000	1.13
+++ video.cpp	8 Aug 2005 20:20:00 -0000	1.14
@@ -233,7 +233,6 @@
 			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 @@
 		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 @@
 		return;
 	}
 
-//	pDrawLine(dest, x0, y0, x1, y1, color);
 	_videoDriver->drawLine(dest, x0, y0, x1, y1, color);
 }
 
@@ -285,14 +282,12 @@
 	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 @@
 		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 @@
 	if (mode != 3)
 		vid_initDriver(mode);
 
-	needDriverInit = 1;
-
 	if (mode != 3) {
 		vid_initSurfDesc(mode, 320, 200, PRIMARY_SURFACE);
 
@@ -549,8 +541,6 @@
 }
 
 void vid_setHandlers() {
-	//pDrawPacked = &vid_spriteUncompressor;
-	pFileHandler = 0;
 	setAllPalette = 1;
 }
 

Index: video.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/video.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- video.h	30 Jul 2005 21:11:00 -0000	1.8
+++ video.h	8 Aug 2005 20:20:00 -0000	1.9
@@ -70,27 +70,8 @@
 	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





More information about the Scummvm-git-logs mailing list