WINTERMUTE: Privatize variables in BaseRegion and BaseSubFrame

This commit is contained in:
Einar Johan Trøan Sømåen 2012-09-28 23:55:41 +02:00
parent b31d6212ff
commit 03e7bffc77
4 changed files with 11 additions and 6 deletions

View File

@ -36,9 +36,6 @@ namespace Wintermute {
class BaseRegion : public BaseObject {
public:
float _lastMimicScale;
int _lastMimicX;
int _lastMimicY;
void cleanup();
bool mimic(BaseRegion *region, float scale = 100.0f, int x = 0, int y = 0);
bool getBoundingRect(Rect32 *rect);
@ -62,6 +59,10 @@ public:
virtual bool scSetProperty(const char *name, ScValue *value);
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
private:
float _lastMimicScale;
int _lastMimicX;
int _lastMimicY;
};
} // end of namespace Wintermute

View File

@ -226,6 +226,9 @@ void BaseSubFrame::setRect(Rect32 rect) {
_rect = rect;
}
const char* BaseSubFrame::getSurfaceFilename() {
return _surfaceFilename;
}
//////////////////////////////////////////////////////////////////////
bool BaseSubFrame::draw(int x, int y, BaseObject *registerOwner, float zoomX, float zoomY, bool precise, uint32 alpha, float rotate, TSpriteBlendMode blendMode) {

View File

@ -54,6 +54,7 @@ public:
bool loadBuffer(byte *buffer, int lifeTime, bool keepLoaded);
bool draw(int x, int y, BaseObject *registerOwner = NULL, float zoomX = 100, float zoomY = 100, bool precise = true, uint32 alpha = 0xFFFFFFFF, float rotate = 0.0f, TSpriteBlendMode blendMode = BLEND_NORMAL);
bool getBoundingRect(Rect32 *rect, int x, int y, float scaleX = 100, float scaleY = 100);
const char* getSurfaceFilename();
int _hotspotX;
int _hotspotY;
@ -65,6 +66,7 @@ public:
private:
bool _wantsDefaultRect;
Rect32 _rect;
char *_surfaceFilename;
public:
bool _cKDefault;
byte _cKRed;
@ -72,7 +74,6 @@ public:
byte _cKBlue;
int _lifeTime;
bool _keepLoaded;
char *_surfaceFilename;
bool _2DOnly;
bool _3DOnly;

View File

@ -334,8 +334,8 @@ bool UITiledImage::saveAsText(BaseDynamicBuffer *buffer, int indent) {
buffer->putTextIndent(indent, "TILED_IMAGE\n");
buffer->putTextIndent(indent, "{\n");
if (_image && _image->_surfaceFilename) {
buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_surfaceFilename);
if (_image && _image->getSurfaceFilename()) {
buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->getSurfaceFilename());
}
int h1, h2, h3;