aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/module.mk2
-rw-r--r--engines/titanic/star_control/base_stars.cpp (renamed from engines/titanic/star_control/base_star.cpp)30
-rw-r--r--engines/titanic/star_control/base_stars.h (renamed from engines/titanic/star_control/base_star.h)9
-rw-r--r--engines/titanic/star_control/star_control_sub12.h2
-rw-r--r--engines/titanic/star_control/star_control_sub13.h2
-rw-r--r--engines/titanic/star_control/star_control_sub2.h4
-rw-r--r--engines/titanic/star_control/star_control_sub20.h2
-rw-r--r--engines/titanic/star_control/star_control_sub7.h4
-rw-r--r--engines/titanic/star_control/star_control_sub8.h2
-rw-r--r--engines/titanic/star_control/star_ref.cpp6
-rw-r--r--engines/titanic/star_control/star_ref.h18
11 files changed, 42 insertions, 39 deletions
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 0b32265933..aa165d301e 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -431,7 +431,7 @@ MODULE_OBJS := \
sound/water_lapping_sounds.o \
sound/wave_file.o \
star_control/star_control.o \
- star_control/base_star.o \
+ star_control/base_stars.o \
star_control/dmatrix.o \
star_control/dvector.o \
star_control/fmatrix.o \
diff --git a/engines/titanic/star_control/base_star.cpp b/engines/titanic/star_control/base_stars.cpp
index e6a7b48e03..a5c6143d45 100644
--- a/engines/titanic/star_control/base_star.cpp
+++ b/engines/titanic/star_control/base_stars.cpp
@@ -20,7 +20,7 @@
*
*/
-#include "titanic/star_control/base_star.h"
+#include "titanic/star_control/base_stars.h"
#include "titanic/star_control/star_control_sub12.h"
#include "titanic/star_control/star_ref.h"
#include "titanic/titanic.h"
@@ -56,15 +56,15 @@ bool CBaseStarEntry::operator==(const CBaseStarEntry &s) const {
/*------------------------------------------------------------------------*/
-CBaseStar::CBaseStar() : _minVal(0.0), _maxVal(1.0), _range(0.0),
+CBaseStars::CBaseStars() : _minVal(0.0), _maxVal(1.0), _range(0.0),
_value1(0.0), _value2(0.0), _value3(0.0), _value4(0.0) {
}
-void CBaseStar::clear() {
+void CBaseStars::clear() {
_data.clear();
}
-void CBaseStar::initialize() {
+void CBaseStars::initialize() {
_minVal = 9.9999998e10;
_maxVal = -9.9999998e10;
_minMax.reset();
@@ -82,11 +82,11 @@ void CBaseStar::initialize() {
_range = (_maxVal - _minVal) / 1.0;
}
-const CBaseStarEntry *CBaseStar::getDataPtr(int index) const {
+const CBaseStarEntry *CBaseStars::getDataPtr(int index) const {
return (index >= 0 && index < (int)_data.size()) ? &_data[index] : nullptr;
}
-void CBaseStar::loadData(Common::SeekableReadStream &s) {
+void CBaseStars::loadData(Common::SeekableReadStream &s) {
uint headerId = s.readUint32LE();
uint count = s.readUint32LE();
if (headerId != 100 || count == 0)
@@ -101,7 +101,7 @@ void CBaseStar::loadData(Common::SeekableReadStream &s) {
_data[idx].load(s);
}
-void CBaseStar::loadData(const CString &resName) {
+void CBaseStars::loadData(const CString &resName) {
// Get a stream to read the data from the DAT file
Common::SeekableReadStream *stream = g_vm->_filesManager->getResource(resName);
assert(stream);
@@ -111,7 +111,7 @@ void CBaseStar::loadData(const CString &resName) {
delete stream;
}
-void CBaseStar::resetEntry(CBaseStarEntry &entry) {
+void CBaseStars::resetEntry(CBaseStarEntry &entry) {
entry._red = 0xFF;
entry._green = 0xFF;
entry._blue = 0xFF;
@@ -123,7 +123,7 @@ void CBaseStar::resetEntry(CBaseStarEntry &entry) {
entry._data[idx] = 0;
}
-void CBaseStar::draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) {
+void CBaseStars::draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) {
if (!_data.empty()) {
switch (sub12->proc27()) {
case 0:
@@ -158,7 +158,7 @@ void CBaseStar::draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarC
}
}
-void CBaseStar::draw1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) {
+void CBaseStars::draw1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) {
FPose pose = sub12->proc23();
sub12->proc36(&_value1, &_value2, &_value3, &_value4);
@@ -243,7 +243,7 @@ void CBaseStar::draw1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar
}
}
-void CBaseStar::draw2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) {
+void CBaseStars::draw2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) {
FPose pose = sub12->proc23();
sub12->proc36(&_value1, &_value2, &_value3, &_value4);
@@ -329,7 +329,7 @@ void CBaseStar::draw2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar
}
}
-void CBaseStar::draw3(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) {
+void CBaseStars::draw3(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) {
FPose pose = sub12->proc23();
sub12->proc36(&_value1, &_value2, &_value3, &_value4);
@@ -436,7 +436,7 @@ void CBaseStar::draw3(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar
}
}
-void CBaseStar::draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) {
+void CBaseStars::draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) {
FPose pose = sub12->proc23();
sub12->proc36(&_value1, &_value2, &_value3, &_value4);
@@ -543,14 +543,14 @@ void CBaseStar::draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar
}
}
-int CBaseStar::baseFn1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12,
+int CBaseStars::baseFn1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12,
const Common::Point &pt) {
CStarRef1 ref(this, pt);
ref.process(surfaceArea, sub12);
return ref._index;
}
-int CBaseStar::baseFn2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12) {
+int CBaseStars::baseFn2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12) {
CStarRef3 ref(this);
ref.process(surfaceArea, sub12);
return ref._index;
diff --git a/engines/titanic/star_control/base_star.h b/engines/titanic/star_control/base_stars.h
index 81bdb4d71d..0394bfe124 100644
--- a/engines/titanic/star_control/base_star.h
+++ b/engines/titanic/star_control/base_stars.h
@@ -63,7 +63,10 @@ struct CStarPosition : public Common::Point {
}
};
-class CBaseStar {
+/**
+ * Base class for views that draw a set of stars in simulated 3D space
+ */
+class CBaseStars {
private:
void draw1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup);
void draw2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup);
@@ -94,8 +97,8 @@ protected:
public:
Common::Array<CBaseStarEntry> _data;
public:
- CBaseStar();
- virtual ~CBaseStar() {}
+ CBaseStars();
+ virtual ~CBaseStars() {}
/**
* Draw the item
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index f54ba11b08..06edd962f4 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -26,7 +26,7 @@
#include "titanic/support/simple_file.h"
#include "titanic/star_control/fmatrix.h"
#include "titanic/star_control/fpoint.h"
-#include "titanic/star_control/base_star.h"
+#include "titanic/star_control/base_stars.h"
#include "titanic/star_control/star_control_sub13.h"
#include "titanic/star_control/star_control_sub20.h"
#include "titanic/star_control/error_code.h"
diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h
index 123ca0914c..ccf2cb8ce9 100644
--- a/engines/titanic/star_control/star_control_sub13.h
+++ b/engines/titanic/star_control/star_control_sub13.h
@@ -24,7 +24,7 @@
#define TITANIC_STAR_CONTROL_SUB13_H
#include "titanic/support/simple_file.h"
-#include "titanic/star_control/base_star.h"
+#include "titanic/star_control/base_stars.h"
#include "titanic/star_control/fpose.h"
#include "titanic/star_control/fmatrix.h"
diff --git a/engines/titanic/star_control/star_control_sub2.h b/engines/titanic/star_control/star_control_sub2.h
index bcf7397fe1..39f1de6fa5 100644
--- a/engines/titanic/star_control/star_control_sub2.h
+++ b/engines/titanic/star_control/star_control_sub2.h
@@ -23,11 +23,11 @@
#ifndef TITANIC_STAR_CONTROL_SUB2_H
#define TITANIC_STAR_CONTROL_SUB2_H
-#include "titanic/star_control/base_star.h"
+#include "titanic/star_control/base_stars.h"
namespace Titanic {
-class CStarControlSub2: public CBaseStar {
+class CStarControlSub2: public CBaseStars {
public:
virtual ~CStarControlSub2() {}
diff --git a/engines/titanic/star_control/star_control_sub20.h b/engines/titanic/star_control/star_control_sub20.h
index eed5e94ad1..ce3149939b 100644
--- a/engines/titanic/star_control/star_control_sub20.h
+++ b/engines/titanic/star_control/star_control_sub20.h
@@ -24,7 +24,7 @@
#define TITANIC_STAR_CONTROL_SUB20_H
#include "titanic/support/simple_file.h"
-#include "titanic/star_control/base_star.h"
+#include "titanic/star_control/base_stars.h"
#include "titanic/star_control/error_code.h"
#include "titanic/star_control/fmatrix.h"
diff --git a/engines/titanic/star_control/star_control_sub7.h b/engines/titanic/star_control/star_control_sub7.h
index b884400a9a..be5a51f31b 100644
--- a/engines/titanic/star_control/star_control_sub7.h
+++ b/engines/titanic/star_control/star_control_sub7.h
@@ -23,10 +23,10 @@
#ifndef TITANIC_STAR_CONTROL_SUB7_H
#define TITANIC_STAR_CONTROL_SUB7_H
-#include "titanic/star_control/base_star.h"
+#include "titanic/star_control/base_stars.h"
namespace Titanic {
-class CStarControlSub7 : public CBaseStar {
+class CStarControlSub7 : public CBaseStars {
public:
virtual ~CStarControlSub7() { clear(); }
diff --git a/engines/titanic/star_control/star_control_sub8.h b/engines/titanic/star_control/star_control_sub8.h
index 4939179481..992420fbf5 100644
--- a/engines/titanic/star_control/star_control_sub8.h
+++ b/engines/titanic/star_control/star_control_sub8.h
@@ -25,7 +25,7 @@
#include "common/array.h"
#include "common/rect.h"
-#include "titanic/star_control/base_star.h"
+#include "titanic/star_control/base_stars.h"
#include "titanic/star_control/surface_area.h"
#include "titanic/star_control/fpoint.h"
#include "titanic/support/simple_file.h"
diff --git a/engines/titanic/star_control/star_ref.cpp b/engines/titanic/star_control/star_ref.cpp
index dfea8aa980..fe3f2339f0 100644
--- a/engines/titanic/star_control/star_ref.cpp
+++ b/engines/titanic/star_control/star_ref.cpp
@@ -25,7 +25,7 @@
namespace Titanic {
void CBaseStarRef::process(CSurfaceArea *surface, CStarControlSub12 *sub12) {
- if (_star->_data.empty())
+ if (_stars->_data.empty())
return;
const double MAX_VAL = 1.0e9 * 1.0e9;
@@ -36,8 +36,8 @@ void CBaseStarRef::process(CSurfaceArea *surface, CStarControlSub12 *sub12) {
FVector vTemp, vector1, vector2;
double val1, green, blue, red;
- for (int idx = 0; idx < _star->size(); ++idx) {
- const CBaseStarEntry &se = _star->_data[idx];
+ for (int idx = 0; idx < _stars->size(); ++idx) {
+ const CBaseStarEntry &se = _stars->_data[idx];
vTemp = se._position;
vector1._x = vTemp._x * pose._row1._x + vTemp._y * pose._row2._x + vTemp._z * pose._row3._x + pose._vector._x;
vector1._y = vTemp._x * pose._row1._y + vTemp._y * pose._row2._y + vTemp._z * pose._row3._y + pose._vector._y;
diff --git a/engines/titanic/star_control/star_ref.h b/engines/titanic/star_control/star_ref.h
index 3cd016e804..1ed22139c4 100644
--- a/engines/titanic/star_control/star_ref.h
+++ b/engines/titanic/star_control/star_ref.h
@@ -21,7 +21,7 @@
*/
#include "common/rect.h"
-#include "titanic/star_control/base_star.h"
+#include "titanic/star_control/base_stars.h"
#include "titanic/star_control/star_control_sub12.h"
#include "titanic/star_control/surface_area.h"
@@ -32,10 +32,10 @@ namespace Titanic {
class CBaseStarRef {
protected:
- CBaseStar *_star;
+ CBaseStars *_stars;
public:
- CBaseStarRef(CBaseStar *star) : _star(star) {}
- CBaseStarRef() : _star(nullptr) {}
+ CBaseStarRef(CBaseStars *stars) : _stars(stars) {}
+ CBaseStarRef() : _stars(nullptr) {}
virtual ~CBaseStarRef() {}
void process(CSurfaceArea *surface, CStarControlSub12 *sub12);
@@ -49,8 +49,8 @@ private:
public:
int _index;
public:
- CStarRef1(CBaseStar *star, const Common::Point &pt) :
- CBaseStarRef(star), _position(pt), _index(-1) {}
+ CStarRef1(CBaseStars *stars, const Common::Point &pt) :
+ CBaseStarRef(stars), _position(pt), _index(-1) {}
virtual ~CStarRef1() {}
virtual bool check(const Common::Point &pt, int index);
@@ -62,8 +62,8 @@ private:
public:
int _index;
public:
- CStarRef2(CBaseStar *star, Common::Array<CStarPosition> *positions) :
- CBaseStarRef(star), _positions(positions), _index(0) {}
+ CStarRef2(CBaseStars *stars, Common::Array<CStarPosition> *positions) :
+ CBaseStarRef(stars), _positions(positions), _index(0) {}
virtual ~CStarRef2() {}
virtual bool check(const Common::Point &pt, int index);
@@ -73,7 +73,7 @@ class CStarRef3 : public CBaseStarRef {
public:
int _index;
public:
- CStarRef3(CBaseStar *star) :CBaseStarRef(star), _index(0) {}
+ CStarRef3(CBaseStars *stars) :CBaseStarRef(stars), _index(0) {}
virtual ~CStarRef3() {}
virtual bool check(const Common::Point &pt, int index);