Permalink
Browse files
TITANIC: Implemented CStarControlSub2 class
- Loading branch information
|
|
@@ -201,14 +201,17 @@ void CBaseStar::draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar |
|
|
// TODO |
|
|
} |
|
|
|
|
|
void CBaseStar::baseFn1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, |
|
|
int CBaseStar::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) { |
|
|
// TODO |
|
|
return 0; |
|
|
CStarRef3 ref(this); |
|
|
ref.process(surfaceArea, sub12); |
|
|
return ref._index; |
|
|
} |
|
|
|
|
|
} // End of namespace Titanic |
|
|
@@ -104,7 +104,7 @@ class CBaseStar { |
|
|
* Selects a star |
|
|
*/ |
|
|
virtual bool selectStar(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, |
|
|
const Common::Point &pt, int flags = 0) { return false; } |
|
|
const Common::Point &pt, void *handler = nullptr) { return false; } |
|
|
|
|
|
/** |
|
|
* Adds a new star, or removes one if already present at the given co-ordinates |
|
|
@@ -137,7 +137,7 @@ class CBaseStar { |
|
|
*/ |
|
|
const CBaseStarEntry *getDataPtr(int index) const; |
|
|
|
|
|
void baseFn1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, |
|
|
int baseFn1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, |
|
|
const Common::Point &pt); |
|
|
|
|
|
int baseFn2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12); |
|
|
|
|
|
@@ -21,29 +21,36 @@ |
|
|
*/ |
|
|
|
|
|
#include "titanic/star_control/star_control_sub2.h" |
|
|
#include "titanic/star_control/star_control_sub12.h" |
|
|
|
|
|
namespace Titanic { |
|
|
|
|
|
bool CStarControlSub2::setup() { |
|
|
loadData("STARFIELD/132"); |
|
|
return true; |
|
|
} |
|
|
|
|
|
bool CStarControlSub2::loadYale(int v1) { |
|
|
clear(); |
|
|
error("Original loadYale not supported"); |
|
|
return true; |
|
|
} |
|
|
|
|
|
bool CStarControlSub2::selectStar(CSurfaceArea *surfaceArea, |
|
|
CStarControlSub12 *sub12, const Common::Point &pt, int flags) { |
|
|
// TODO |
|
|
return true; |
|
|
CStarControlSub12 *sub12, const Common::Point &pt, void *handler) { |
|
|
int index = baseFn1(surfaceArea, sub12, pt); |
|
|
if (index == -1) { |
|
|
return false; |
|
|
} else if (!handler) { |
|
|
sub12->proc14(_data[index]._position); |
|
|
return true; |
|
|
} else { |
|
|
error("no handler ever passed in original"); |
|
|
} |
|
|
} |
|
|
|
|
|
bool CStarControlSub2::loadStar() { |
|
|
// TODO |
|
|
return true; |
|
|
} |
|
|
|
|
|
bool CStarControlSub2::setup() { |
|
|
// TODO |
|
|
return true; |
|
|
error("loadStar not supported"); |
|
|
} |
|
|
|
|
|
} // End of namespace Titanic |
|
|
@@ -37,7 +37,7 @@ class CStarControlSub2: public CBaseStar { |
|
|
* Selects a star |
|
|
*/ |
|
|
virtual bool selectStar(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, |
|
|
const Common::Point &pt, int flags = 0); |
|
|
const Common::Point &pt, void *handler = nullptr); |
|
|
|
|
|
virtual bool loadStar(); |
|
|
|
|
|
|
|
|
@@ -55,7 +55,7 @@ bool CStarRef2::check(const Common::Point &pt, int index) { |
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
|
|
bool CStarRef3::check(const Common::Point &pt, int index) { |
|
|
++_counter; |
|
|
++_index; |
|
|
return true; |
|
|
} |
|
|
|
|
|
|
|
|
@@ -46,6 +46,7 @@ class CBaseStarRef { |
|
|
class CStarRef1 : public CBaseStarRef { |
|
|
private: |
|
|
Common::Point _position; |
|
|
public: |
|
|
int _index; |
|
|
public: |
|
|
CStarRef1(CBaseStar *star, const Common::Point &pt) : |
|
|
@@ -58,6 +59,7 @@ class CStarRef1 : public CBaseStarRef { |
|
|
class CStarRef2 : public CBaseStarRef { |
|
|
private: |
|
|
Common::Array<CStarPosition> *_positions; |
|
|
public: |
|
|
int _index; |
|
|
public: |
|
|
CStarRef2(CBaseStar *star, Common::Array<CStarPosition> *positions) : |
|
|
@@ -68,10 +70,10 @@ class CStarRef2 : public CBaseStarRef { |
|
|
}; |
|
|
|
|
|
class CStarRef3 : public CBaseStarRef { |
|
|
private: |
|
|
int _counter; |
|
|
public: |
|
|
CStarRef3(CBaseStar *star) :CBaseStarRef(star), _counter(0) {} |
|
|
int _index; |
|
|
public: |
|
|
CStarRef3(CBaseStar *star) :CBaseStarRef(star), _index(0) {} |
|
|
virtual ~CStarRef3() {} |
|
|
|
|
|
virtual bool check(const Common::Point &pt, int index); |
|
|
|