[Scummvm-cvs-logs] CVS: scummvm/scumm player_v2a.cpp,2.17,2.18

Chris Apers chrilith at users.sourceforge.net
Thu Jan 8 04:15:01 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv13829

Modified Files:
	player_v2a.cpp 
Log Message:
Save more memory on PalmOS

Index: player_v2a.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2a.cpp,v
retrieving revision 2.17
retrieving revision 2.18
diff -u -d -r2.17 -r2.18
--- player_v2a.cpp	6 Jan 2004 12:45:30 -0000	2.17
+++ player_v2a.cpp	8 Jan 2004 12:14:48 -0000	2.18
@@ -29,12 +29,18 @@
 
 #define BASE_FREQUENCY 3579545
 
-static uint32	CRCtable[256];
+#ifdef __PALM_OS__
+static uint32 *CRCtable = NULL;
+#else
+static uint32 CRCtable[256];
+#endif
+
 static void	InitCRC (void)
 {
 	const uint32 poly = 0xEDB88320;
 	int i, j;
 	uint32 n;
+
 	for (i = 0; i < 256; i++)
 	{
 		n = i;
@@ -1151,6 +1157,9 @@
 	_scumm = scumm;
 	_system = scumm->_system;
 
+#ifdef __PALM_OS__
+	if (!CRCtable) CRCtable = (uint32 *)calloc(256, sizeof(uint32));
+#endif
 	InitCRC();
 
 	for (i = 0; i < V2A_MAXSLOTS; i++) {
@@ -1164,6 +1173,9 @@
 
 Player_V2A::~Player_V2A() {
 	delete _mod;
+#ifdef __PALM_OS__
+	free(CRCtable);
+#endif
 }
 
 void Player_V2A::setMasterVolume (int vol) {
@@ -1255,4 +1267,4 @@
 	return 0;
 }
 
-} // End of namespace Scumm
+} // End of namespace Scumm
\ No newline at end of file





More information about the Scummvm-git-logs mailing list