[Scummvm-cvs-logs] SF.net SVN: scummvm: [26879] scummvm/trunk/engines/cine

cyx at users.sourceforge.net cyx at users.sourceforge.net
Sat May 19 23:12:11 CEST 2007


Revision: 26879
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26879&view=rev
Author:   cyx
Date:     2007-05-19 14:12:10 -0700 (Sat, 19 May 2007)

Log Message:
-----------
removed 4 unused offscreen buffers ; also changed several 64k buffers to be dynamically allocated.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/bg.cpp
    scummvm/trunk/engines/cine/cine.cpp
    scummvm/trunk/engines/cine/gfx.cpp
    scummvm/trunk/engines/cine/gfx.h
    scummvm/trunk/engines/cine/main_loop.cpp

Modified: scummvm/trunk/engines/cine/bg.cpp
===================================================================
--- scummvm/trunk/engines/cine/bg.cpp	2007-05-19 20:49:36 UTC (rev 26878)
+++ scummvm/trunk/engines/cine/bg.cpp	2007-05-19 21:12:10 UTC (rev 26879)
@@ -105,7 +105,7 @@
 	return 0;
 }
 
-byte *additionalBgTable[9] = { page2Raw, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page3Raw };
+byte *additionalBgTable[9];
 byte currentAdditionalBgIdx = 0;
 byte currentAdditionalBgIdx2 = 0;
 

Modified: scummvm/trunk/engines/cine/cine.cpp
===================================================================
--- scummvm/trunk/engines/cine/cine.cpp	2007-05-19 20:49:36 UTC (rev 26878)
+++ scummvm/trunk/engines/cine/cine.cpp	2007-05-19 21:12:10 UTC (rev 26879)
@@ -122,7 +122,7 @@
 	setupOpcodes();
 
 	initLanguage(g_cine->getLanguage());
-	init_video();
+	gfxInit();
 
 	textDataPtr = (byte *)malloc(8000);
 

Modified: scummvm/trunk/engines/cine/gfx.cpp
===================================================================
--- scummvm/trunk/engines/cine/gfx.cpp	2007-05-19 20:49:36 UTC (rev 26878)
+++ scummvm/trunk/engines/cine/gfx.cpp	2007-05-19 21:12:10 UTC (rev 26879)
@@ -23,6 +23,7 @@
  */
 
 #include "cine/cine.h"
+#include "cine/bg.h"
 #include "cine/various.h"
 
 #include "common/system.h"
@@ -31,20 +32,13 @@
 
 namespace Cine {
 
-byte *screenBuffer;
-
 uint16 c_palette[256];
 
-byte *page0;
-byte *page0c;
-byte *page1;
-byte *page2;
-byte *page3;
+byte *screenBuffer;
+byte *page1Raw;
+byte *page2Raw;
+byte *page3Raw;
 
-byte page1Raw[320 * 200];
-byte page2Raw[320 * 200];
-byte page3Raw[320 * 200];
-
 static const byte mouseCursorNormal[] = {
 	0x00, 0x00, 0x40, 0x00, 0x60, 0x00, 0x70, 0x00,
 	0x78, 0x00, 0x7C, 0x00, 0x7E, 0x00, 0x7F, 0x00,
@@ -93,14 +87,21 @@
 	0xff, 0xff, 0xff, 0xff
 };
 
-void init_video() {
-	screenBuffer = (byte *)malloc(320 * 200 * 3);
-	assert(screenBuffer);
-
-	page0 = (byte *)malloc(0x8000);
-	page1 = (byte *)malloc(0x8000);
-	page2 = (byte *)malloc(0x8000);
-	page3 = (byte *)malloc(0x8000);
+void gfxInit() {
+	screenBuffer = (byte *)malloc(320 * 200);
+	page1Raw = (byte *)malloc(320 * 200);
+	page2Raw = (byte *)malloc(320 * 200);
+	page3Raw = (byte *)malloc(320 * 200);
+	if (!screenBuffer || !page1Raw || !page2Raw || !page3Raw) {
+		error("Unable to allocate offscreen buffers");
+	}
+	memset(page1Raw, 0, 320 * 200);
+	memset(page2Raw, 0, 320 * 200);
+	memset(page3Raw, 0, 320 * 200);
+	
+	memset(additionalBgTable, 0, sizeof(additionalBgTable));
+	additionalBgTable[0] = page2Raw;
+	additionalBgTable[8] = page3Raw;
 }
 
 void setMouseCursor(int cursor) {

Modified: scummvm/trunk/engines/cine/gfx.h
===================================================================
--- scummvm/trunk/engines/cine/gfx.h	2007-05-19 20:49:36 UTC (rev 26878)
+++ scummvm/trunk/engines/cine/gfx.h	2007-05-19 21:12:10 UTC (rev 26879)
@@ -29,15 +29,13 @@
 
 void gfxDrawSprite(byte *src4, uint16 sw, uint16 sh, byte *dst4, int16 sx, int16 sy);
 
-extern byte *page0;
-extern byte *page0c;
-extern byte *page1;
-extern byte *page2;
-extern byte *page3;
+extern byte *page1Raw;
+extern byte *page2Raw;
+extern byte *page3Raw;
 
 extern uint16 c_palette[256];
 
-void init_video();
+void gfxInit();
 void setMouseCursor(int cursor);
 void convertGfx(byte *source, byte *dest, const uint16 width, const uint16 height);
 void convertGfx2(byte *source, byte *dest, const uint16 width, const uint16 height);
@@ -59,10 +57,6 @@
 
 int16 gfxGetBit(int16 x, int16 y, byte *ptr, int16 width);
 
-extern byte page1Raw[320 * 200];
-extern byte page2Raw[320 * 200];
-extern byte page3Raw[320 * 200];
-
 void gfxResetRawPage(byte *pageRaw);
 void gfxConvertSpriteToRaw(byte *dest, byte *source, uint16 width, uint16 height);
 void gfxCopyRawPage(byte *source, byte * dest);

Modified: scummvm/trunk/engines/cine/main_loop.cpp
===================================================================
--- scummvm/trunk/engines/cine/main_loop.cpp	2007-05-19 20:49:36 UTC (rev 26878)
+++ scummvm/trunk/engines/cine/main_loop.cpp	2007-05-19 21:12:10 UTC (rev 26879)
@@ -210,7 +210,7 @@
 
 		menuVar = 0;
 
-		gfxFuncGen1(page0c, page0, page0c, page0, -1);
+//		gfxFuncGen1(page0c, page0, page0c, page0, -1);
 
 		ptrGfxFunc13();
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list