Skip to content

Commit

Permalink
WINTERMUTE: Privatize AdScaleLevel and AdWaypointGroup's members.
Browse files Browse the repository at this point in the history
  • Loading branch information
somaen committed Dec 9, 2012
1 parent 0e93e89 commit 32e6309
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions engines/wintermute/ad/ad_scale_level.cpp
Expand Up @@ -48,6 +48,9 @@ AdScaleLevel::~AdScaleLevel() {

}

float AdScaleLevel::getScale() {
return _scale;
}

//////////////////////////////////////////////////////////////////////////
bool AdScaleLevel::loadFile(const char *filename) {
Expand Down
4 changes: 3 additions & 1 deletion engines/wintermute/ad/ad_scale_level.h
Expand Up @@ -37,12 +37,14 @@ namespace Wintermute {
class AdScaleLevel : public BaseObject {
public:
DECLARE_PERSISTENT(AdScaleLevel, BaseObject)
float _scale;
AdScaleLevel(BaseGame *inGame);
virtual ~AdScaleLevel();
virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent);
bool loadFile(const char *filename);
bool loadBuffer(byte *buffer, bool complete = true);
float getScale();
private:
float _scale;
};

} // end of namespace Wintermute
Expand Down
4 changes: 2 additions & 2 deletions engines/wintermute/ad/ad_scene.cpp
Expand Up @@ -2277,11 +2277,11 @@ float AdScene::getScaleAt(int Y) {
}

int delta_y = next->_posY - prev->_posY;
float delta_scale = next->_scale - prev->_scale;
float delta_scale = next->getScale() - prev->getScale();
Y -= prev->_posY;

float percent = (float)Y / ((float)delta_y / 100.0f);
return prev->_scale + delta_scale / 100 * percent;
return prev->getScale() + delta_scale / 100 * percent;
}


Expand Down
13 changes: 8 additions & 5 deletions engines/wintermute/ad/ad_waypoint_group.h
Expand Up @@ -35,22 +35,25 @@ namespace Wintermute {
class BasePoint;
class AdWaypointGroup : public BaseObject {
public:
float _lastMimicScale;
int _lastMimicX;
int _lastMimicY;
void cleanup();
bool mimic(AdWaypointGroup *wpt, float scale = 100.0f, int x = 0, int y = 0);
DECLARE_PERSISTENT(AdWaypointGroup, BaseObject)
virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent);
bool _active;
AdWaypointGroup(BaseGame *inGame);
bool loadFile(const char *filename);
bool loadBuffer(byte *buffer, bool complete = true);
virtual ~AdWaypointGroup();

bool _active;
BaseArray<BasePoint *> _points;
int _editorSelectedPoint;

virtual ScValue *scGetProperty(const Common::String &name);
virtual bool scSetProperty(const char *name, ScValue *value);
private:
int _editorSelectedPoint;
float _lastMimicScale;
int _lastMimicX;
int _lastMimicY;
};

} // end of namespace Wintermute
Expand Down

0 comments on commit 32e6309

Please sign in to comment.