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) {
visible = false;
featureCoords = where;
world = inWorld;
Common::strlcpy(name, desc, MAX_MAP_FEATURE_NAME_LENGTH);
_visible = false;
_featureCoords = where;
_world = inWorld;
Common::strlcpy(_name, desc, MAX_MAP_FEATURE_NAME_LENGTH);
}
@ -311,12 +311,12 @@ void CMapFeature::draw(TileRegion viewRegion,
gPort &tPort) {
int32 x, y;
if (world != inWorld) return;
if (_world != inWorld) return;
update();
//TilePoint centerCoords = featureCoords >> (kTileUVShift + kPlatShift);
TilePoint fCoords = featureCoords >> (kTileUVShift + kPlatShift);
if (visible &&
//TilePoint centerCoords = _featureCoords >> (kTileUVShift + kPlatShift);
TilePoint fCoords = _featureCoords >> (kTileUVShift + kPlatShift);
if (_visible &&
fCoords.u >= viewRegion.min.u &&
fCoords.u <= viewRegion.max.u &&
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
// the center actor.
centerPt = featureCoords - (baseCoords << (kTileUVShift + kPlatShift));
centerPt = _featureCoords - (baseCoords << (kTileUVShift + kPlatShift));
x = ((centerPt.u - centerPt.v) >> (kTileUVShift + kPlatShift - 2)) + 261 + 4;
y = 255 + 4 - ((centerPt.u + centerPt.v) >> (kTileUVShift + kPlatShift - 1));
@ -354,9 +354,9 @@ bool CMapFeature::hitCheck(TileRegion viewRegion,
TilePoint comparePoint) {
int32 x, y;
if (world != inWorld) return false;
TilePoint fCoords = featureCoords >> (kTileUVShift + kPlatShift);
if (visible &&
if (_world != inWorld) return false;
TilePoint fCoords = _featureCoords >> (kTileUVShift + kPlatShift);
if (_visible &&
fCoords.u >= viewRegion.min.u &&
fCoords.u <= viewRegion.max.u &&
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
// the center actor.
centerPt = featureCoords - (baseCoords << (kTileUVShift + kPlatShift));
centerPt = _featureCoords - (baseCoords << (kTileUVShift + kPlatShift));
x = ((centerPt.u - centerPt.v) >> (kTileUVShift + kPlatShift - 2)) + 261 + 4;
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)
: CMapFeature(where, inWorld, desc) {
color = bColor;
_color = bColor;
}
void CStaticMapFeature::blit(gPort &tPort, int32 x, int32 y) {
tPort.setColor(9 + 15); // black
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);
}
@ -404,7 +404,7 @@ bool CStaticMapFeature::isHit(TilePoint disp, TilePoint mouse) {
CPictureMapFeature::CPictureMapFeature(TilePoint where, int16 inWorld, char *desc, gPixelMap *pm)
: CMapFeature(where, inWorld, desc) {
pic = pm;
_pic = pm;
}
void CPictureMapFeature::blit(gPort &tPort, int32 x, int32 y) {

View File

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