aboutsummaryrefslogtreecommitdiff
path: root/engines/m4/animation.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2010-06-03 09:34:32 +0000
committerPaul Gilbert2010-06-03 09:34:32 +0000
commit86dcc28342021933f04ff3542932fc8823ff2360 (patch)
tree88b43c3e0a4938078ad782609b5141cd96bd47c2 /engines/m4/animation.cpp
parent90649938d2d70115967c45cdd1cbb8dab1635794 (diff)
downloadscummvm-rg350-86dcc28342021933f04ff3542932fc8823ff2360.tar.gz
scummvm-rg350-86dcc28342021933f04ff3542932fc8823ff2360.tar.bz2
scummvm-rg350-86dcc28342021933f04ff3542932fc8823ff2360.zip
Moved the MADS interface view into mads_scene.cpp and did a major cleanup of scene loading code
svn-id: r49405
Diffstat (limited to 'engines/m4/animation.cpp')
-rw-r--r--engines/m4/animation.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp
index 9c31cd35d7..412f514e5b 100644
--- a/engines/m4/animation.cpp
+++ b/engines/m4/animation.cpp
@@ -26,6 +26,7 @@
#include "m4/assets.h"
#include "m4/animation.h"
#include "m4/compression.h"
+#include "m4/mads_scene.h"
namespace M4 {
@@ -44,7 +45,7 @@ MadsAnimation::~MadsAnimation() {
delete _font;
}
-void MadsAnimation::load(const Common::String &filename) {
+void MadsAnimation::load(const Common::String &filename, uint16 flags, M4Surface *walkSurface, M4Surface *sceneSurface) {
MadsPack anim(filename.c_str(), _vm);
bool madsRes = filename[0] == '*';
char buffer[20];
@@ -64,7 +65,6 @@ void MadsAnimation::load(const Common::String &filename) {
animStream->skip(2);
_animMode = animStream->readUint16LE();
- assert(_animMode != 4);
_roomNumber = animStream->readUint16LE();
_field12 = animStream->readUint16LE() != 0;
animStream->skip(4);
@@ -74,7 +74,7 @@ void MadsAnimation::load(const Common::String &filename) {
animStream->skip(10);
animStream->read(buffer, 13);
- _field24 = Common::String(buffer, 13);
+ _infoFilename = Common::String(buffer, 13);
for (int i = 0; i < 10; ++i) {
animStream->read(buffer, 13);
@@ -93,8 +93,10 @@ void MadsAnimation::load(const Common::String &filename) {
animStream->read(buffer, 13);
Common::String fontResource(buffer, 13);
- // TODO: Based on a weird usage of a flags word, a secondary method gets called here.
- // Figure out secondary method, and when/if it's called
+ if (_animMode == 4)
+ flags |= 0x4000;
+ if (flags & 0x100)
+ loadInterface(walkSurface, sceneSurface);
// Initialise the reference list
for (int i = 0; i < spriteListCount; ++i)
@@ -416,12 +418,24 @@ void MadsAnimation::load1(int frameNumber) {
if (proc1(spriteSet, pt, frameNumber))
error("proc1 failure");
-
-
}
bool MadsAnimation::proc1(SpriteAsset &spriteSet, const Common::Point &pt, int frameNumber) {
return 0;
}
+void MadsAnimation::loadInterface(M4Surface *walkSurface, M4Surface *sceneSurface) {
+ walkSurface->madsloadInterface(0);
+
+
+ /* TODO - implement properly
+ if (_animMode > 2) {
+ warning("Mode1");
+ } else {
+ MadsSceneResources sceneResources;
+ sceneResources.load(_roomNumber, _infoFilename.c_str(), 0, walkSurface, sceneSurface);
+ }
+ */
+}
+
} // End of namespace M4