aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-07-05 22:06:26 +1000
committerPaul Gilbert2011-07-05 22:06:26 +1000
commit2997db0040d4c4e7ead02f37d8e7bd2c0ce6b206 (patch)
tree0c9b953c7feb9be3dd6f7db9930ef20e0234dd8b
parentc676f88da02f56a8b7caecb83bcf9e1a9f7e663c (diff)
downloadscummvm-rg350-2997db0040d4c4e7ead02f37d8e7bd2c0ce6b206.tar.gz
scummvm-rg350-2997db0040d4c4e7ead02f37d8e7bd2c0ce6b206.tar.bz2
scummvm-rg350-2997db0040d4c4e7ead02f37d8e7bd2c0ce6b206.zip
CGE: Minor bugfixes for game loading
-rw-r--r--engines/cge/cge_main.cpp2
-rw-r--r--engines/cge/vga13h.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 08e373d322..14109ddd6f 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -229,7 +229,7 @@ void CGEEngine::loadGame(XFile &file, bool tiny = false) {
}
if (! tiny) { // load sprites & pocket
- while (!readStream.eos()) {
+ while (readStream.pos() < readStream.size()) {
Sprite S(this, NULL);
S.sync(s);
diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index c349950bee..6c20a78cae 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -349,6 +349,14 @@ Sprite::Sprite(CGEEngine *vm, BMP_PTR *shpP)
_ext(NULL), _ref(-1), _cave(0), _vm(vm) {
memset(_file, 0, sizeof(_file));
*((uint16 *)&_flags) = 0;
+ _ref = 0;
+ _x = _y = 0;
+ _w = _h = 0;
+ _time = 0;
+ _seqPtr = 0;
+ _shpCnt = 0;
+ _prev = _next = NULL;
+
setShapeList(shpP);
}