mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 11:36:22 +00:00
TITANIC: Renamed CStarControlSub7 to CStarMarkers
This commit is contained in:
parent
a4fca68217
commit
77703ed316
@ -447,13 +447,13 @@ MODULE_OBJS := \
|
||||
star_control/star_camera.o \
|
||||
star_control/star_closeup.o \
|
||||
star_control/star_control_sub2.o \
|
||||
star_control/star_control_sub7.o \
|
||||
star_control/star_control_sub21.o \
|
||||
star_control/star_control_sub22.o \
|
||||
star_control/star_control_sub23.o \
|
||||
star_control/star_control_sub24.o \
|
||||
star_control/star_control_sub27.o \
|
||||
star_control/star_field.o \
|
||||
star_control/star_markers.o \
|
||||
star_control/star_points1.o \
|
||||
star_control/star_points2.o \
|
||||
star_control/star_ref.o \
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "titanic/star_control/photo_crosshairs.h"
|
||||
#include "titanic/star_control/star_control_sub7.h"
|
||||
#include "titanic/star_control/star_markers.h"
|
||||
#include "titanic/star_control/star_camera.h"
|
||||
#include "titanic/star_control/star_field.h"
|
||||
#include "titanic/star_control/star_ref.h"
|
||||
@ -32,7 +32,7 @@ CPhotoCrosshairs::CPhotoCrosshairs() : _field8(-1), _entryIndex(-1) {
|
||||
}
|
||||
|
||||
void CPhotoCrosshairs::selectStar(int index, CVideoSurface *surface,
|
||||
CStarField *starField, CStarControlSub7 *sub7) {
|
||||
CStarField *starField, CStarMarkers *markers) {
|
||||
if (_entryIndex >= 0) {
|
||||
if (_entryIndex == _field8) {
|
||||
if (_field8 != 2) {
|
||||
@ -48,7 +48,7 @@ void CPhotoCrosshairs::selectStar(int index, CVideoSurface *surface,
|
||||
newP = _positions[index];
|
||||
|
||||
const CBaseStarEntry *starP = starField->getDataPtr(_positions[index]._index1);
|
||||
sub7->addStar(starP);
|
||||
markers->addStar(starP);
|
||||
}
|
||||
}
|
||||
} else if (_entryIndex == _field8 + 1) {
|
||||
@ -60,7 +60,7 @@ void CPhotoCrosshairs::selectStar(int index, CVideoSurface *surface,
|
||||
|
||||
--_entryIndex;
|
||||
const CBaseStarEntry *starP = starField->getDataPtr(_positions[index]._index1);
|
||||
sub7->addStar(starP);
|
||||
markers->addStar(starP);
|
||||
} else {
|
||||
surface->lock();
|
||||
CSurfaceArea surfaceArea(surface);
|
||||
@ -70,9 +70,9 @@ void CPhotoCrosshairs::selectStar(int index, CVideoSurface *surface,
|
||||
|
||||
const CBaseStarEntry *starP;
|
||||
starP = starField->getDataPtr(_positions[_entryIndex]._index1);
|
||||
sub7->addStar(starP);
|
||||
markers->addStar(starP);
|
||||
starP = starField->getDataPtr(_positions[index]._index1);
|
||||
sub7->addStar(starP);
|
||||
markers->addStar(starP);
|
||||
|
||||
CStarPosition &newP = _positions[_entryIndex + 1];
|
||||
newP = _positions[index];
|
||||
@ -89,7 +89,7 @@ void CPhotoCrosshairs::selectStar(int index, CVideoSurface *surface,
|
||||
newP = _positions[index];
|
||||
|
||||
const CBaseStarEntry *starP = starField->getDataPtr(_positions[index]._index1);
|
||||
sub7->addStar(starP);
|
||||
markers->addStar(starP);
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,16 +107,16 @@ bool CPhotoCrosshairs::fn1(CStarField *starField, CSurfaceArea *surfaceArea, CSt
|
||||
}
|
||||
}
|
||||
|
||||
void CPhotoCrosshairs::fn2(CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7) {
|
||||
void CPhotoCrosshairs::fn2(CVideoSurface *surface, CStarField *starField, CStarMarkers *markers) {
|
||||
if (_field8 <= -1) {
|
||||
if (_entryIndex > -1) {
|
||||
fn5(_entryIndex, surface, starField, sub7);
|
||||
fn5(_entryIndex, surface, starField, markers);
|
||||
--_entryIndex;
|
||||
}
|
||||
} else {
|
||||
--_field8;
|
||||
if (_entryIndex - _field8 > 1) {
|
||||
fn5(_entryIndex, surface, starField, sub7);
|
||||
fn5(_entryIndex, surface, starField, markers);
|
||||
--_entryIndex;
|
||||
}
|
||||
}
|
||||
@ -189,14 +189,14 @@ void CPhotoCrosshairs::fn4(int index, CSurfaceArea *surfaceArea) {
|
||||
}
|
||||
}
|
||||
|
||||
void CPhotoCrosshairs::fn5(int index, CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7) {
|
||||
void CPhotoCrosshairs::fn5(int index, CVideoSurface *surface, CStarField *starField, CStarMarkers *markers) {
|
||||
surface->lock();
|
||||
CSurfaceArea surfaceArea(surface);
|
||||
fn7(_positions[index + 1], &surfaceArea);
|
||||
surface->unlock();
|
||||
|
||||
const CBaseStarEntry *starP = starField->getDataPtr(_positions[index + 1]._index1);
|
||||
sub7->addStar(starP);
|
||||
markers->addStar(starP);
|
||||
}
|
||||
|
||||
void CPhotoCrosshairs::fn6(CSurfaceArea *surfaceArea) {
|
||||
|
@ -34,7 +34,7 @@
|
||||
namespace Titanic {
|
||||
|
||||
class CStarField;
|
||||
class CStarControlSub7;
|
||||
class CStarMarkers;
|
||||
class CStarCamera;
|
||||
|
||||
class CPhotoCrosshairs {
|
||||
@ -70,15 +70,15 @@ public:
|
||||
void save(SimpleFile *file, int indent) {}
|
||||
|
||||
void selectStar(int starNum, CVideoSurface *surface, CStarField *starField,
|
||||
CStarControlSub7 *sub7);
|
||||
CStarMarkers *markers);
|
||||
|
||||
void draw(CSurfaceArea *surfaceArea);
|
||||
|
||||
bool fn1(CStarField *starField, CSurfaceArea *surfaceArea, CStarCamera *camera);
|
||||
void fn2(CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7);
|
||||
void fn2(CVideoSurface *surface, CStarField *starField, CStarMarkers *markers);
|
||||
void fn3();
|
||||
void fn4(int index, CSurfaceArea *surfaceArea);
|
||||
void fn5(int index, CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7);
|
||||
void fn5(int index, CVideoSurface *surface, CStarField *starField, CStarMarkers *markers);
|
||||
void fn6(CSurfaceArea *surfaceArea);
|
||||
void fn7(const FPoint &pt, CSurfaceArea *surfaceArea);
|
||||
FPoint getPosition() const;
|
||||
|
@ -141,7 +141,7 @@ void CStarControl::newFrame() {
|
||||
|
||||
if (_starField.getMode() == MODE_STARFIELD) {
|
||||
val2 = _starField.get5();
|
||||
if ((val1 + 2) == _starField.get7Count())
|
||||
if ((val1 + 2) == _starField.getMarkerCount())
|
||||
val2 = 0;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ CStarField::CStarField() : _points1On(false), _points2On(false), _mode(MODE_STAR
|
||||
}
|
||||
|
||||
void CStarField::load(SimpleFile *file) {
|
||||
_sub7.load(file);
|
||||
_markers.load(file);
|
||||
_crosshairs.load(file);
|
||||
_points1On = file->readNumber();
|
||||
_points2On = file->readNumber();
|
||||
@ -42,7 +42,7 @@ void CStarField::load(SimpleFile *file) {
|
||||
}
|
||||
|
||||
void CStarField::save(SimpleFile *file, int indent) {
|
||||
_sub7.save(file, indent);
|
||||
_markers.save(file, indent);
|
||||
_crosshairs.save(file, indent);
|
||||
file->writeNumberLine(_points1On, indent);
|
||||
file->writeNumberLine(_points2On, indent);
|
||||
@ -69,7 +69,7 @@ void CStarField::render(CVideoSurface *surface, CStarCamera *camera) {
|
||||
if (_showCrosshairs)
|
||||
drawCrosshairs(&surfaceArea);
|
||||
|
||||
_sub7.draw(&surfaceArea, camera, nullptr);
|
||||
_markers.draw(&surfaceArea, camera, nullptr);
|
||||
_crosshairs.draw(&surfaceArea);
|
||||
|
||||
if (_points2On)
|
||||
@ -186,7 +186,7 @@ double CStarField::fn5(CSurfaceArea *surfaceArea, CStarCamera *camera,
|
||||
if (_crosshairs._fieldC < 0)
|
||||
return -1.0;
|
||||
|
||||
const CBaseStarEntry *dataP = _sub7.getDataPtr(_crosshairs._fieldC);
|
||||
const CBaseStarEntry *dataP = _markers.getDataPtr(_crosshairs._fieldC);
|
||||
v2 = dataP->_position;
|
||||
FVector tv = camera->proc29(2, v2);
|
||||
|
||||
@ -221,7 +221,7 @@ void CStarField::fn7() {
|
||||
}
|
||||
|
||||
void CStarField::fn8(CVideoSurface *surface) {
|
||||
_crosshairs.fn2(surface, this, &_sub7);
|
||||
_crosshairs.fn2(surface, this, &_markers);
|
||||
setSolved();
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ bool CStarField::mouseButtonDown(CVideoSurface *surface, CStarCamera *camera,
|
||||
} else {
|
||||
int starNum = _crosshairs.indexOf(pt);
|
||||
if (starNum >= 0) {
|
||||
_crosshairs.selectStar(starNum, surface, this, &_sub7);
|
||||
_crosshairs.selectStar(starNum, surface, this, &_markers);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include "titanic/star_control/star_control_sub2.h"
|
||||
#include "titanic/star_control/star_closeup.h"
|
||||
#include "titanic/star_control/star_control_sub7.h"
|
||||
#include "titanic/star_control/star_markers.h"
|
||||
#include "titanic/star_control/photo_crosshairs.h"
|
||||
#include "titanic/star_control/star_points1.h"
|
||||
#include "titanic/star_control/star_points2.h"
|
||||
@ -34,7 +34,7 @@ namespace Titanic {
|
||||
|
||||
class CStarField : public CStarControlSub2 {
|
||||
private:
|
||||
CStarControlSub7 _sub7;
|
||||
CStarMarkers _markers;
|
||||
CPhotoCrosshairs _crosshairs;
|
||||
CStarPoints1 _points1;
|
||||
CStarPoints2 _points2;
|
||||
@ -112,8 +112,11 @@ public:
|
||||
*/
|
||||
bool isSolved() const;
|
||||
|
||||
int get7Count() const {
|
||||
return _sub7.size();
|
||||
/**
|
||||
* Returns the number of markers placed in the starfield
|
||||
*/
|
||||
int getMarkerCount() const {
|
||||
return _markers.size();
|
||||
}
|
||||
|
||||
void fn1(CErrorCode *errorCode);
|
||||
|
@ -20,12 +20,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "titanic/star_control/star_control_sub7.h"
|
||||
#include "titanic/star_control/star_markers.h"
|
||||
#include "titanic/star_control/star_camera.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
void CStarControlSub7::draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup) {
|
||||
void CStarMarkers::draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup) {
|
||||
if (_data.empty())
|
||||
return;
|
||||
|
||||
@ -71,7 +71,7 @@ void CStarControlSub7::draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CSta
|
||||
surfaceArea->setColorFromPixel();
|
||||
}
|
||||
|
||||
bool CStarControlSub7::addStar(const CBaseStarEntry *entry) {
|
||||
bool CStarMarkers::addStar(const CBaseStarEntry *entry) {
|
||||
// iterate through the existing stars
|
||||
for (uint idx = 0; idx < _data.size(); ++idx) {
|
||||
CBaseStarEntry &star = _data[idx];
|
@ -20,15 +20,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TITANIC_STAR_CONTROL_SUB7_H
|
||||
#define TITANIC_STAR_CONTROL_SUB7_H
|
||||
#ifndef TITANIC_STAR_MARKERS_H
|
||||
#define TITANIC_STAR_MARKERS_H
|
||||
|
||||
#include "titanic/star_control/base_stars.h"
|
||||
namespace Titanic {
|
||||
|
||||
class CStarControlSub7 : public CBaseStars {
|
||||
class CStarMarkers : public CBaseStars {
|
||||
public:
|
||||
virtual ~CStarControlSub7() { clear(); }
|
||||
virtual ~CStarMarkers() { clear(); }
|
||||
|
||||
/**
|
||||
* Draw the item
|
||||
@ -43,4 +43,4 @@ public:
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
||||
#endif /* TITANIC_STAR_CONTROL_SUB7_H */
|
||||
#endif /* TITANIC_STAR_MARKERS_H */
|
Loading…
x
Reference in New Issue
Block a user