SAGA2: Rename class variables in mapfeatr.h

This commit is contained in:
Eugene Sandulenko 2022-09-26 15:42:46 +02:00
parent 7b69970c82
commit f3a751e947
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 27 additions and 27 deletions

View File

@ -298,10 +298,10 @@ void termMapFeatures() {
CMapFeature::CMapFeature(TilePoint where, int16 inWorld, const char *desc) { CMapFeature::CMapFeature(TilePoint where, int16 inWorld, const char *desc) {
visible = false; _visible = false;
featureCoords = where; _featureCoords = where;
world = inWorld; _world = inWorld;
Common::strlcpy(name, desc, MAX_MAP_FEATURE_NAME_LENGTH); Common::strlcpy(_name, desc, MAX_MAP_FEATURE_NAME_LENGTH);
} }
@ -311,12 +311,12 @@ void CMapFeature::draw(TileRegion viewRegion,
gPort &tPort) { gPort &tPort) {
int32 x, y; int32 x, y;
if (world != inWorld) return; if (_world != inWorld) return;
update(); update();
//TilePoint centerCoords = featureCoords >> (kTileUVShift + kPlatShift); //TilePoint centerCoords = _featureCoords >> (kTileUVShift + kPlatShift);
TilePoint fCoords = featureCoords >> (kTileUVShift + kPlatShift); TilePoint fCoords = _featureCoords >> (kTileUVShift + kPlatShift);
if (visible && if (_visible &&
fCoords.u >= viewRegion.min.u && fCoords.u >= viewRegion.min.u &&
fCoords.u <= viewRegion.max.u && fCoords.u <= viewRegion.max.u &&
fCoords.v >= viewRegion.min.v && fCoords.v >= viewRegion.min.v &&
@ -325,7 +325,7 @@ void CMapFeature::draw(TileRegion viewRegion,
// Calculate the position of the cross-hairs showing the position of // Calculate the position of the cross-hairs showing the position of
// the center actor. // the center actor.
centerPt = featureCoords - (baseCoords << (kTileUVShift + kPlatShift)); centerPt = _featureCoords - (baseCoords << (kTileUVShift + kPlatShift));
x = ((centerPt.u - centerPt.v) >> (kTileUVShift + kPlatShift - 2)) + 261 + 4; x = ((centerPt.u - centerPt.v) >> (kTileUVShift + kPlatShift - 2)) + 261 + 4;
y = 255 + 4 - ((centerPt.u + centerPt.v) >> (kTileUVShift + kPlatShift - 1)); y = 255 + 4 - ((centerPt.u + centerPt.v) >> (kTileUVShift + kPlatShift - 1));
@ -354,9 +354,9 @@ bool CMapFeature::hitCheck(TileRegion viewRegion,
TilePoint comparePoint) { TilePoint comparePoint) {
int32 x, y; int32 x, y;
if (world != inWorld) return false; if (_world != inWorld) return false;
TilePoint fCoords = featureCoords >> (kTileUVShift + kPlatShift); TilePoint fCoords = _featureCoords >> (kTileUVShift + kPlatShift);
if (visible && if (_visible &&
fCoords.u >= viewRegion.min.u && fCoords.u >= viewRegion.min.u &&
fCoords.u <= viewRegion.max.u && fCoords.u <= viewRegion.max.u &&
fCoords.v >= viewRegion.min.v && fCoords.v >= viewRegion.min.v &&
@ -365,7 +365,7 @@ bool CMapFeature::hitCheck(TileRegion viewRegion,
// Calculate the position of the cross-hairs showing the position of // Calculate the position of the cross-hairs showing the position of
// the center actor. // the center actor.
centerPt = featureCoords - (baseCoords << (kTileUVShift + kPlatShift)); centerPt = _featureCoords - (baseCoords << (kTileUVShift + kPlatShift));
x = ((centerPt.u - centerPt.v) >> (kTileUVShift + kPlatShift - 2)) + 261 + 4; x = ((centerPt.u - centerPt.v) >> (kTileUVShift + kPlatShift - 2)) + 261 + 4;
y = 255 + 4 - ((centerPt.u + centerPt.v) >> (kTileUVShift + kPlatShift - 1)); y = 255 + 4 - ((centerPt.u + centerPt.v) >> (kTileUVShift + kPlatShift - 1));
@ -382,13 +382,13 @@ bool CMapFeature::hitCheck(TileRegion viewRegion,
CStaticMapFeature::CStaticMapFeature(TilePoint where, int16 inWorld, const char *desc, int16 bColor) CStaticMapFeature::CStaticMapFeature(TilePoint where, int16 inWorld, const char *desc, int16 bColor)
: CMapFeature(where, inWorld, desc) { : CMapFeature(where, inWorld, desc) {
color = bColor; _color = bColor;
} }
void CStaticMapFeature::blit(gPort &tPort, int32 x, int32 y) { void CStaticMapFeature::blit(gPort &tPort, int32 x, int32 y) {
tPort.setColor(9 + 15); // black tPort.setColor(9 + 15); // black
tPort.fillRect(x - 2, y - 2, 5, 5); tPort.fillRect(x - 2, y - 2, 5, 5);
tPort.setColor(color); // whatever color its supposed to be tPort.setColor(_color); // whatever color its supposed to be
tPort.fillRect(x - 1, y - 1, 3, 3); tPort.fillRect(x - 1, y - 1, 3, 3);
} }
@ -404,7 +404,7 @@ bool CStaticMapFeature::isHit(TilePoint disp, TilePoint mouse) {
CPictureMapFeature::CPictureMapFeature(TilePoint where, int16 inWorld, char *desc, gPixelMap *pm) CPictureMapFeature::CPictureMapFeature(TilePoint where, int16 inWorld, char *desc, gPixelMap *pm)
: CMapFeature(where, inWorld, desc) { : CMapFeature(where, inWorld, desc) {
pic = pm; _pic = pm;
} }
void CPictureMapFeature::blit(gPort &tPort, int32 x, int32 y) { void CPictureMapFeature::blit(gPort &tPort, int32 x, int32 y) {

View File

@ -44,10 +44,10 @@ class gPixelMap;
// Pure virtual base class for map features // Pure virtual base class for map features
class CMapFeature { class CMapFeature {
bool visible; bool _visible;
int16 world; int16 _world;
TilePoint featureCoords; TilePoint _featureCoords;
char name[MAX_MAP_FEATURE_NAME_LENGTH]; char _name[MAX_MAP_FEATURE_NAME_LENGTH];
public: public:
@ -55,21 +55,21 @@ public:
virtual ~CMapFeature() {} virtual ~CMapFeature() {}
void expose(bool canSee = true) { void expose(bool canSee = true) {
visible = canSee; _visible = canSee;
} }
void draw(TileRegion tr, int16 inWorld, TilePoint bc, gPort &tport); void draw(TileRegion tr, int16 inWorld, TilePoint bc, gPort &tport);
bool hitCheck(TileRegion vr, int16 inWorld, TilePoint bc, TilePoint cp); bool hitCheck(TileRegion vr, int16 inWorld, TilePoint bc, TilePoint cp);
int16 getWorld() { int16 getWorld() {
return world; return _world;
} }
int16 getU() { int16 getU() {
return featureCoords.u; return _featureCoords.u;
} }
int16 getV() { int16 getV() {
return featureCoords.v; return _featureCoords.v;
} }
char *getText() { char *getText() {
return name; return _name;
} }
// The only aspect of different map features is what they look like // The only aspect of different map features is what they look like
@ -85,7 +85,7 @@ typedef CMapFeature *pCMapFeature;
// class for map features with static icons // class for map features with static icons
class CStaticMapFeature : public CMapFeature { class CStaticMapFeature : public CMapFeature {
int16 color; int16 _color;
public: public:
CStaticMapFeature(TilePoint where, int16 inWorld, const char *desc, int16 bColor); CStaticMapFeature(TilePoint where, int16 inWorld, const char *desc, int16 bColor);
@ -99,7 +99,7 @@ public:
// class for map features with static icons // class for map features with static icons
class CPictureMapFeature : public CMapFeature { class CPictureMapFeature : public CMapFeature {
gPixelMap *pic; gPixelMap *_pic;
public: public:
CPictureMapFeature(TilePoint where, int16 inWorld, char *desc, gPixelMap *pm); CPictureMapFeature(TilePoint where, int16 inWorld, char *desc, gPixelMap *pm);