Permalink
Browse files
TITANIC: Rename CStarControlSub4 class to FRange
- Loading branch information
|
|
@@ -436,10 +436,10 @@ MODULE_OBJS := \ |
|
|
star_control/dvector.o \ |
|
|
star_control/fmatrix.o \ |
|
|
star_control/fpoint.o \ |
|
|
star_control/frange.o \ |
|
|
star_control/frect.o \ |
|
|
star_control/fvector.o \ |
|
|
star_control/star_control_sub2.o \ |
|
|
star_control/star_control_sub4.o \ |
|
|
star_control/star_control_sub5.o \ |
|
|
star_control/star_control_sub6.o \ |
|
|
star_control/star_control_sub7.o \ |
|
|
|
|
|
@@ -67,11 +67,11 @@ void CBaseStar::clear() { |
|
|
void CBaseStar::initialize() { |
|
|
_minVal = 9.9999998e10; |
|
|
_maxVal = -9.9999998e10; |
|
|
_sub4.initialize(); |
|
|
_minMax.reset(); |
|
|
|
|
|
for (uint idx = 0; idx < _data.size(); ++idx) { |
|
|
const CBaseStarEntry *entry = getDataPtr(idx); |
|
|
_sub4.checkEntry(entry->_position); |
|
|
_minMax.expand(entry->_position); |
|
|
|
|
|
if (entry->_value < _minVal) |
|
|
_minVal = entry->_value; |
|
|
|
|
|
@@ -24,7 +24,7 @@ |
|
|
#define TITANIC_STAR_CONTROL_SUB3_H |
|
|
|
|
|
#include "titanic/support/simple_file.h" |
|
|
#include "titanic/star_control/star_control_sub4.h" |
|
|
#include "titanic/star_control/frange.h" |
|
|
#include "titanic/star_control/star_control_sub5.h" |
|
|
#include "titanic/star_control/surface_area.h" |
|
|
|
|
|
@@ -68,7 +68,7 @@ class CBaseStar { |
|
|
void draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarControlSub5 *sub5); |
|
|
protected: |
|
|
Common::Array<CBaseStarEntry> _data; |
|
|
CStarControlSub4 _sub4; |
|
|
FRange _minMax; |
|
|
double _minVal; |
|
|
double _maxVal; |
|
|
double _range; |
|
|
|
|
|
@@ -21,19 +21,19 @@ |
|
|
*/ |
|
|
|
|
|
#include "common/algorithm.h" |
|
|
#include "titanic/star_control/star_control_sub4.h" |
|
|
#include "titanic/star_control/frange.h" |
|
|
|
|
|
namespace Titanic { |
|
|
|
|
|
CStarControlSub4::CStarControlSub4() { |
|
|
FRange::FRange() { |
|
|
} |
|
|
|
|
|
void CStarControlSub4::initialize() { |
|
|
void FRange::reset() { |
|
|
_min._x = _min._y = _min._z = 9.9999994e27; |
|
|
_max._x = _max._y = _max._z = -9.9999994e27; |
|
|
} |
|
|
|
|
|
void CStarControlSub4::checkEntry(const FVector &v) { |
|
|
void FRange::expand(const FVector &v) { |
|
|
_min._x = MIN(_min._x, v._x); |
|
|
_min._y = MIN(_min._y, v._y); |
|
|
_min._z = MIN(_min._z, v._z); |
|
|
|
|
|
@@ -20,25 +20,31 @@ |
|
|
* |
|
|
*/ |
|
|
|
|
|
#ifndef TITANIC_STAR_CONTROL_SUB4_H |
|
|
#define TITANIC_STAR_CONTROL_SUB4_H |
|
|
#ifndef TITANIC_FRANGE_H |
|
|
#define TITANIC_FRANGE_H |
|
|
|
|
|
#include "titanic/star_control/fvector.h" |
|
|
|
|
|
namespace Titanic { |
|
|
|
|
|
class CStarControlSub4 { |
|
|
class FRange { |
|
|
private: |
|
|
FVector _min; |
|
|
FVector _max; |
|
|
public: |
|
|
CStarControlSub4(); |
|
|
FRange(); |
|
|
|
|
|
void initialize(); |
|
|
/** |
|
|
* Resets the minimum & maximum vector values |
|
|
*/ |
|
|
void reset(); |
|
|
|
|
|
void checkEntry(const FVector &v); |
|
|
/** |
|
|
* Expands the minimum & maximum as necessary to encompass the passed vector/ |
|
|
*/ |
|
|
void expand(const FVector &v); |
|
|
}; |
|
|
|
|
|
} // End of namespace Titanic |
|
|
|
|
|
#endif /* TITANIC_STAR_CONTROL_SUB4_H */ |
|
|
#endif /* TITANIC_FRANGE_H */ |