[Scummvm-cvs-logs] SF.net SVN: scummvm: [32727] scummvm/trunk/engines/drascula/graphics.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jun 17 20:27:06 CEST 2008


Revision: 32727
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32727&view=rev
Author:   thebluegr
Date:     2008-06-17 11:27:03 -0700 (Tue, 17 Jun 2008)

Log Message:
-----------
Removed duplicate code

Modified Paths:
--------------
    scummvm/trunk/engines/drascula/graphics.cpp

Modified: scummvm/trunk/engines/drascula/graphics.cpp
===================================================================
--- scummvm/trunk/engines/drascula/graphics.cpp	2008-06-16 23:38:21 UTC (rev 32726)
+++ scummvm/trunk/engines/drascula/graphics.cpp	2008-06-17 18:27:03 UTC (rev 32727)
@@ -89,32 +89,22 @@
 }
 
 void DrasculaEngine::loadPic(const char *NamePcc, byte *targetSurface, int colorCount) {
-	unsigned int con, x = 0;
-	unsigned int fExit = 0;
-	byte ch, rep;
+	uint dataSize = 0;
+	byte *pcxData;
 
 	_arj.open(NamePcc);
 	if (!_arj.isOpen())
 		error("missing game data %s %c", NamePcc, 7);
 
-	_arj.seek(128);
-	while (!fExit) {
-		ch = _arj.readByte();
-		rep = 1;
-		if ((ch & 192) == 192) {
-			rep = (ch & 63);
-			ch = _arj.readByte();
-		}
-		for (con = 0; con < rep; con++) {
-			x++;
-			if (x > 64000) {
-				fExit = 1;
-				break;
-			}
-			*targetSurface++ = ch;
-		}
-	}
+	dataSize = _arj.size() - 128 - (256 * 3);
+	pcxData = (byte *)malloc(dataSize);
 
+	_arj.seek(128, SEEK_SET);
+	_arj.read(pcxData, dataSize);
+
+	decodeRLE(pcxData, targetSurface);
+	free(pcxData);
+
 	for (int i = 0; i < 256; i++) {
 		cPal[i * 3 + 0] = _arj.readByte();
 		cPal[i * 3 + 1] = _arj.readByte();
@@ -141,7 +131,6 @@
 	memcpy(prevFrame, VGA, 64000);
 
 	decodeRLE(pcxData, VGA);
-
 	free(pcxData);
 
 	if (!firstFrame)


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