aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2008-06-08 11:10:00 +0000
committerFilippos Karapetis2008-06-08 11:10:00 +0000
commit5880defea4cdc3ea8e621769c34f46be724c6e66 (patch)
treed56bbdd61adf1063e3e05be9d8b421a911c7d33c /engines
parentaf7472642089e52e16c7e39428b44c39e997841f (diff)
downloadscummvm-rg350-5880defea4cdc3ea8e621769c34f46be724c6e66.tar.gz
scummvm-rg350-5880defea4cdc3ea8e621769c34f46be724c6e66.tar.bz2
scummvm-rg350-5880defea4cdc3ea8e621769c34f46be724c6e66.zip
Removed the useless pcxBuffer buffer and auxPun pointer and fixed an off-by-one error in the PCX decoding routine
svn-id: r32613
Diffstat (limited to 'engines')
-rw-r--r--engines/drascula/drascula.h1
-rw-r--r--engines/drascula/graphics.cpp11
2 files changed, 4 insertions, 8 deletions
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index 4501d73134..08aa44ce58 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -287,7 +287,6 @@ public:
byte *frontSurface;
byte *textSurface;
byte *pendulumSurface;
- byte *pcxBuffer;
byte *AuxBuffOrg;
byte *AuxBuffDes;
byte *pointer;
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
index a2b4527015..22d32b42ca 100644
--- a/engines/drascula/graphics.cpp
+++ b/engines/drascula/graphics.cpp
@@ -89,14 +89,11 @@ void DrasculaEngine::loadPic(const char *NamePcc, byte *targetSurface, int color
unsigned int con, x = 0;
unsigned int fExit = 0;
byte ch, rep;
- byte *auxPun;
_arj.open(NamePcc);
if (!_arj.isOpen())
error("missing game data %s %c", NamePcc, 7);
- pcxBuffer = (byte *)malloc(65000);
- auxPun = pcxBuffer;
_arj.seek(128);
while (!fExit) {
ch = _arj.readByte();
@@ -106,18 +103,18 @@ void DrasculaEngine::loadPic(const char *NamePcc, byte *targetSurface, int color
ch = _arj.readByte();
}
for (con = 0; con < rep; con++) {
- *auxPun++ = ch;
x++;
- if (x > 64000)
+ if (x > 64000) {
fExit = 1;
+ break;
+ }
+ *targetSurface++ = ch;
}
}
_arj.read(cPal, 768);
_arj.close();
- memcpy(targetSurface, pcxBuffer, 64000);
- free(pcxBuffer);
setRGB((byte *)cPal, colorCount);
}