aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2013-06-18 10:23:49 -0400
committerEugene Sandulenko2013-09-06 14:48:12 +0300
commit195d52e625b1d24ea0cbda3bb8d65043d1b5eea5 (patch)
treee1fff970783c49862b7c724b2308a1c33c285d26 /engines
parent630d5526ee9618ac1f84021b2306477e81e343d2 (diff)
downloadscummvm-rg350-195d52e625b1d24ea0cbda3bb8d65043d1b5eea5.tar.gz
scummvm-rg350-195d52e625b1d24ea0cbda3bb8d65043d1b5eea5.tar.bz2
scummvm-rg350-195d52e625b1d24ea0cbda3bb8d65043d1b5eea5.zip
FULLPIPE: Implement loading CReactPolygonal. That completes .sc2 loading
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/motion.cpp35
-rw-r--r--engines/fullpipe/motion.h13
-rw-r--r--engines/fullpipe/utils.cpp6
3 files changed, 53 insertions, 1 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index a25d47505b..64fbd083de 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -164,5 +164,40 @@ void CReactParallel::createRegion() {
// GdiObject::Attach(_rgn, CreatePolygonRgn(_points, 4, 2);
}
+CReactPolygonal::CReactPolygonal() {
+ _field_C = 0;
+ _points = 0;
+ _pointCount = 0;
+ _field_10 = 0;
+}
+
+bool CReactPolygonal::load(MfcArchive &file) {
+ _field_C = file.readUint32LE();
+ _field_10 = file.readUint32LE();
+ _pointCount = file.readUint32LE();
+
+ if (_pointCount > 0) {
+ _points = (Common::Point **)malloc(sizeof(Common::Point *) * _pointCount);
+
+ for (int i = 0; i < _pointCount; i++) {
+ _points[i] = new Common::Point;
+
+ _points[i]->x = file.readUint32LE();
+ _points[i]->y = file.readUint32LE();
+ }
+
+ }
+
+ createRegion();
+
+ return true;
+}
+
+void CReactPolygonal::createRegion() {
+ if (_points) {
+
+ // GdiObject::Attach(_rgn, CreatePolygonRgn(_points, _pointCount, 2);
+ }
+}
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index f5e8632b26..bbb37f4296 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -104,6 +104,19 @@ class CReactParallel : public CMovGraphReact {
void createRegion();
};
+class CReactPolygonal : public CMovGraphReact {
+ //CRgn _rgn;
+ int _field_C;
+ int _field_10;
+ int _pointCount;
+ Common::Point **_points;
+
+ public:
+ CReactPolygonal();
+ virtual bool load(MfcArchive &file);
+ void createRegion();
+};
+
class CMovGraphLink : public CObject {
CMovGraphNode *_movGraphNode1;
CMovGraphNode *_movGraphNode2;
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index df6c869a82..6a09174bc6 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -84,7 +84,8 @@ enum {
kCMovGraph,
kCMovGraphLink,
kCMovGraphNode,
- kCReactParallel
+ kCReactParallel,
+ kCReactPolygonal
};
const struct {
@@ -101,6 +102,7 @@ const struct {
{ "CMovGraphLink", kCMovGraphLink },
{ "CMovGraphNode", kCMovGraphNode },
{ "CReactParallel", kCReactParallel },
+ { "CReactPolygonal", kCReactPolygonal },
{ 0, 0 }
};
@@ -137,6 +139,8 @@ static CObject *createObject(int objectId) {
return new CMovGraphNode();
case kCReactParallel:
return new CReactParallel();
+ case kCReactPolygonal:
+ return new CReactPolygonal();
default:
error("Unknown objectId: %d", objectId);
}