FULLPIPE: Split out motion-related classes

This commit is contained in:
Eugene Sandulenko 2013-06-16 15:11:18 +03:00
parent 0f9c1281d4
commit a8d733b2b2
6 changed files with 195 additions and 105 deletions

View file

@ -3,6 +3,7 @@ MODULE := engines/fullpipe
MODULE_OBJS = \ MODULE_OBJS = \
detection.o \ detection.o \
fullpipe.o \ fullpipe.o \
motion.o \
ngiarchive.o \ ngiarchive.o \
stateloader.o \ stateloader.o \
utils.o utils.o

View file

@ -0,0 +1,79 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "fullpipe/fullpipe.h"
#include "common/file.h"
#include "common/array.h"
#include "common/list.h"
#include "fullpipe/utils.h"
#include "fullpipe/objects.h"
#include "fullpipe/motion.h"
namespace Fullpipe {
bool CMotionController::load(MfcArchive &file) {
// Is originally empty file.readClass();
return true;
}
bool CMctlCompound::load(MfcArchive &file) {
int count = file.readUint32LE();
debug(0, "CMctlCompund::count = %d", count);
for (int i = 0; i < count; i++) {
CMctlCompoundArrayItem *obj = (CMctlCompoundArrayItem *)file.readClass();
_motionControllers.push_back(*obj);
}
return true;
}
bool CMctlCompoundArray::load(MfcArchive &file) {
int count = file.readUint32LE();
debug(0, "CMctlCompundArray::count = %d", count);
return true;
}
CMovGraph::CMovGraph() {
_itemsCount = 0;
_items = 0;
//_callback1 = CMovGraphCallback1; // TODO
_field_44 = 0;
// insertMessageHandler(CMovGraph_messageHandler, getMessageHandlersCount() - 1, 129);
}
bool CMovGraph::load(MfcArchive &file) {
_links.load(file);
_nodes.load(file);
return true;
}
} // End of namespace Fullpipe

112
engines/fullpipe/motion.h Normal file
View file

@ -0,0 +1,112 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef FULLPIPE_MOTION_H
#define FULLPIPE_MOTION_H
namespace Fullpipe {
class CMotionController : public CObject {
int _field_4;
int _isEnabled;
public:
CMotionController() : _isEnabled(1) {}
virtual bool load(MfcArchive &file);
};
class CMctlCompoundArray : public Common::Array<CObject>, public CObject {
public:
virtual bool load(MfcArchive &file);
};
class CMctlConnectionPointsArray : public Common::Array<CObject>, public CObject {
public:
virtual bool load(MfcArchive &file);
};
class CMctlCompoundArrayItem : public CObject {
int _motionControllerObj;
int _movGraphReactObj;
CMctlConnectionPointsArray _connectionPoints;
int _field_20;
int _field_24;
int _field_28;
public:
CMctlCompoundArrayItem() : _movGraphReactObj(0), _motionControllerObj(0) {}
};
class CMctlCompound : public CMotionController {
CMctlCompoundArray _motionControllers;
public:
virtual bool load(MfcArchive &file);
};
class Unk2 : public CObject {
int _items;
int _count;
public:
Unk2() : _items(0), _count(0) {}
};
class CMovGraphLink : public CObject {
int movGraphNode1;
int movGraphNode2;
int dwordArray1;
int field_10;
int field_14;
int field_18;
int field_1C;
int dwordArray2;
int field_24;
int field_28;
int field_2C;
int field_30;
int flags;
int field_38;
int field_3C;
double distance;
double angle;
int movGraphReact;
int name;
};
class CMovGraph : public CMotionController {
CObList _nodes;
CObList _links;
int _field_44;
int _items;
int _itemsCount;
int (*_callback1)(int, int, int);
Unk2 _unk2;
public:
CMovGraph();
virtual bool load(MfcArchive &file);
};
} // End of namespace Fullpipe
#endif /* FULLPIPE_MOTION_H */

View file

@ -176,66 +176,6 @@ class CInputController {
CInputController(); CInputController();
}; };
class CMotionController : public CObject {
int _field_4;
int _isEnabled;
public:
CMotionController() : _isEnabled(1) {}
virtual bool load(MfcArchive &file);
};
class CMctlCompoundArray : public Common::Array<CObject>, public CObject {
public:
virtual bool load(MfcArchive &file);
};
class CMctlConnectionPointsArray : public Common::Array<CObject>, public CObject {
public:
virtual bool load(MfcArchive &file);
};
class CMctlCompoundArrayItem : public CObject {
int _motionControllerObj;
int _movGraphReactObj;
CMctlConnectionPointsArray _connectionPoints;
int _field_20;
int _field_24;
int _field_28;
public:
CMctlCompoundArrayItem() : _movGraphReactObj(0), _motionControllerObj(0) {}
};
class CMctlCompound : public CMotionController {
CMctlCompoundArray _motionControllers;
public:
virtual bool load(MfcArchive &file);
};
class Unk2 : public CObject {
int _items;
int _count;
public:
Unk2() : _items(0), _count(0) {}
};
class CMovGraph : public CMotionController {
CObList _nodes;
CObList _links;
int _field_44;
int _items;
int _itemsCount;
int (*_callback1)(int, int, int);
Unk2 _unk2;
public:
CMovGraph();
virtual bool load(MfcArchive &file);
};
class ShadowsItemArray : public Common::Array<CObject>, public CObject { class ShadowsItemArray : public Common::Array<CObject>, public CObject {
public: public:
virtual bool load(MfcArchive &file); virtual bool load(MfcArchive &file);
@ -275,6 +215,8 @@ class Scene {
int libHandle; int libHandle;
}; };
class CMotionController;
class Sc2 : public CObject { class Sc2 : public CObject {
int16 _sceneId; int16 _sceneId;
int16 _field_2; int16 _field_2;

View file

@ -504,49 +504,4 @@ bool Sc2::load(MfcArchive &file) {
return true; return true;
} }
bool CMotionController::load(MfcArchive &file) {
// Is originally empty file.readClass();
return true;
}
bool CMctlCompound::load(MfcArchive &file) {
int count = file.readUint32LE();
debug(0, "CMctlCompund::count = %d", count);
for (int i = 0; i < count; i++) {
CMctlCompoundArrayItem *obj = (CMctlCompoundArrayItem *)file.readClass();
_motionControllers.push_back(*obj);
}
return true;
}
bool CMctlCompoundArray::load(MfcArchive &file) {
int count = file.readUint32LE();
debug(0, "CMctlCompundArray::count = %d", count);
return true;
}
CMovGraph::CMovGraph() {
_itemsCount = 0;
_items = 0;
//_callback1 = CMovGraphCallback1; // TODO
_field_44 = 0;
// insertMessageHandler(CMovGraph_messageHandler, getMessageHandlersCount() - 1, 129);
}
bool CMovGraph::load(MfcArchive &file) {
_links.load(file);
_nodes.load(file);
return true;
}
} // End of namespace Fullpipe } // End of namespace Fullpipe

View file

@ -26,6 +26,7 @@
#include "fullpipe/utils.h" #include "fullpipe/utils.h"
#include "fullpipe/objects.h" #include "fullpipe/objects.h"
#include "fullpipe/motion.h"
namespace Fullpipe { namespace Fullpipe {