aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2
diff options
context:
space:
mode:
authoruruk2014-05-15 10:58:59 +0200
committeruruk2014-05-15 10:58:59 +0200
commit945f12f2ad04ce60d2d072548799a440ebb32da6 (patch)
treed929a76c135502701525d934140f10893cda05f3 /engines/cge2
parentc202328ecf9fc244e0e3974c303056b811726af7 (diff)
downloadscummvm-rg350-945f12f2ad04ce60d2d072548799a440ebb32da6.tar.gz
scummvm-rg350-945f12f2ad04ce60d2d072548799a440ebb32da6.tar.bz2
scummvm-rg350-945f12f2ad04ce60d2d072548799a440ebb32da6.zip
CGE2: Move setEye()s to CGE2Engine.
Diffstat (limited to 'engines/cge2')
-rw-r--r--engines/cge2/cge2.cpp6
-rw-r--r--engines/cge2/cge2.h6
-rw-r--r--engines/cge2/cge2_main.cpp18
-rw-r--r--engines/cge2/general.h11
4 files changed, 30 insertions, 11 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp
index 4afafdc807..85e8e889aa 100644
--- a/engines/cge2/cge2.cpp
+++ b/engines/cge2/cge2.cpp
@@ -50,6 +50,8 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription)
for (int i = 0; i < 2; i++)
_heroTab[i] = nullptr;
_eye = nullptr;
+ for (int i = 0; i < kCaveMax; i++)
+ _eyeTab[i] = nullptr;
_spare = nullptr;
_commandHandler = nullptr;
@@ -72,6 +74,8 @@ void CGE2Engine::init() {
for (int i = 0; i < 2; i++)
_heroTab[i] = new HeroTab(this);
_eye = new V3D();
+ for (int i = 0; i < kCaveMax; i++)
+ _eyeTab[i] = new V3D();
_spare = new Spare(this);
_commandHandler = new CommandHandler(this, false);
}
@@ -87,6 +91,8 @@ void CGE2Engine::deinit() {
for (int i = 0; i < 2; i++)
delete _heroTab[i];
delete _eye;
+ for (int i = 0; i < kCaveMax; i++)
+ delete _eyeTab[i];
delete _spare;
delete _commandHandler;
}
diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h
index be2c129fb5..fa161f360a 100644
--- a/engines/cge2/cge2.h
+++ b/engines/cge2/cge2.h
@@ -84,6 +84,11 @@ public:
void badLab(const char *fn);
void caveUp(int cav);
void showBak(int ref);
+ void loadTab();
+
+ void setEye(V3D &e);
+ void setEye(const V2D& e2, int z = -kScrWidth);
+ void setEye(const char *s);
int number(char *s);
char *token(char *s);
@@ -110,6 +115,7 @@ public:
Text *_text;
HeroTab *_heroTab[2];
V3D *_eye;
+ V3D *_eyeTab[kCaveMax];
Spare *_spare;
CommandHandler *_commandHandler;
private:
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp
index 352c62c6c1..a0717a374a 100644
--- a/engines/cge2/cge2_main.cpp
+++ b/engines/cge2/cge2_main.cpp
@@ -384,4 +384,22 @@ char *CGE2Engine::mergeExt(char *buf, const char *name, const char *ext) {
return buf;
}
+void CGE2Engine::setEye(V3D &e) {
+ _eye = &e;
+}
+
+void CGE2Engine::setEye(const V2D& e2, int z) {
+ _eye->_x = e2.x;
+ _eye->_y = e2.y;
+ _eye->_z = z;
+}
+
+void CGE2Engine::setEye(const char *s) {
+ char tempStr[kLineMax];
+ strcpy(tempStr, s);
+ _eye->_x = atoi(token(tempStr));
+ _eye->_y = atoi(token(NULL));
+ _eye->_z = atoi(token(NULL));
+}
+
} // End of namespace CGE2
diff --git a/engines/cge2/general.h b/engines/cge2/general.h
index 62b41a9ebb..747fb84e45 100644
--- a/engines/cge2/general.h
+++ b/engines/cge2/general.h
@@ -72,17 +72,6 @@ public:
V2D(CGE2Engine *vm) : _vm(vm) { }
V2D(CGE2Engine *vm, const V3D& p3) : _vm(vm) { *this = p3; }
V2D(CGE2Engine *vm, int x, int y) : _vm(vm), Common::Point(x, y) { }
- void setEye(V3D &e) { _vm->_eye = &e; }
- void setEye(const V2D& e2, int z = -SCR_WID_) {
- _vm->_eye->_x = e2.x; _vm->_eye->_y = e2.y; _vm->_eye->_z = z;
- }
- void setEye(const char *s) {
- char *tempStr;
- strcpy(tempStr, s);
- _vm->_eye->_x = atoi(_vm->token(tempStr));
- _vm->_eye->_y = atoi(_vm->token(tempStr));
- _vm->_eye->_z = atoi(_vm->token(tempStr));
- }
bool operator < (const V2D& p) const { return (x < p.x) && (y < p.y); }
bool operator <= (const V2D& p) const { return (x <= p.x) && (y <= p.y); }
bool operator >(const V2D& p) const { return (x > p.x) && (y > p.y); }