aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he
diff options
context:
space:
mode:
authorMax Horn2007-03-09 00:34:28 +0000
committerMax Horn2007-03-09 00:34:28 +0000
commit37af88c8c4ec64cacd195f0568de859fea40d898 (patch)
tree7c998da1c88dc2e79c984f9d331cc79435cf9d1e /engines/scumm/he
parent6b348c03d567879dbd00d35d36c1bbaef2ad90f0 (diff)
downloadscummvm-rg350-37af88c8c4ec64cacd195f0568de859fea40d898.tar.gz
scummvm-rg350-37af88c8c4ec64cacd195f0568de859fea40d898.tar.bz2
scummvm-rg350-37af88c8c4ec64cacd195f0568de859fea40d898.zip
Some cleanup, and added some of my observation (man this code is really strange)
svn-id: r26036
Diffstat (limited to 'engines/scumm/he')
-rw-r--r--engines/scumm/he/logic_he.cpp15
-rw-r--r--engines/scumm/he/logic_he.h8
2 files changed, 19 insertions, 4 deletions
diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp
index 371ea6b979..d5da543cc5 100644
--- a/engines/scumm/he/logic_he.cpp
+++ b/engines/scumm/he/logic_he.cpp
@@ -28,12 +28,22 @@
namespace Scumm {
LogicHE::LogicHE(ScummEngine_v90he *vm) : _vm(vm) {
+}
+
+LogicHE::~LogicHE() {
+}
+
+LogicHErace::LogicHErace(ScummEngine_v90he *vm) : LogicHE(vm) {
// Originally it used 0x930 and stored both floats and doubles inside
_userData = (float *)calloc(550, sizeof(float));
_userDataD = (double *)calloc(30, sizeof(double));
+
+ // FIXME: of the 550 entries in _userData, only 516 till 532 are used
+ // FIXME: similarly, in _userDataD only 9 till 17 are used for computations
+ // (some of the other entries are also set, but never read, hence useless).
}
-LogicHE::~LogicHE() {
+LogicHErace::~LogicHErace() {
free(_userData);
free(_userDataD);
}
@@ -353,6 +363,7 @@ int32 LogicHErace::op_1140(int32 *args) {
}
void LogicHErace::op_sub1(float arg) {
+ // Setup a rotation matrix
_userDataD[10] = _userDataD[12] = _userDataD[14] = _userDataD[16] = 0;
_userDataD[13] = 1;
@@ -363,6 +374,7 @@ void LogicHErace::op_sub1(float arg) {
}
void LogicHErace::op_sub2(float arg) {
+ // Setup a rotation matrix -- but it is NEVER USED!
_userDataD[20] = _userDataD[21] = _userDataD[24] = _userDataD[25] = 0;
_userDataD[26] = 1;
@@ -373,6 +385,7 @@ void LogicHErace::op_sub2(float arg) {
}
void LogicHErace::op_sub3(float arg) {
+ // Setup a rotation matrix -- but it is NEVER USED!
_userDataD[1] = _userDataD[2] = _userDataD[3] = _userDataD[6] = 0;
_userDataD[0] = 1;
diff --git a/engines/scumm/he/logic_he.h b/engines/scumm/he/logic_he.h
index 42dc9b0e08..e0f70ff52a 100644
--- a/engines/scumm/he/logic_he.h
+++ b/engines/scumm/he/logic_he.h
@@ -31,8 +31,6 @@ class ScummEngine_v90he;
class LogicHE {
public:
- float *_userData;
- double *_userDataD;
ScummEngine_v90he *_vm;
LogicHE(ScummEngine_v90he *vm);
@@ -53,8 +51,12 @@ public:
};
class LogicHErace : public LogicHE {
+private:
+ float *_userData;
+ double *_userDataD;
public:
- LogicHErace(ScummEngine_v90he *vm) : LogicHE(vm) {}
+ LogicHErace(ScummEngine_v90he *vm);
+ ~LogicHErace();
int versionID();
int32 dispatch(int op, int numArgs, int32 *args);