[Scummvm-cvs-logs] scummvm master -> 67a7f5b3063c8d9634f43ee36ba26b18c2e6cd11
somaen
einarjohan at somadalen.com
Fri Sep 28 23:58:41 CEST 2012
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ee4a92cce5 WINTERMUTE: Privatise member-variables in BaseDynamicBuffer
f6d7d05343 WINTERMUTE: Privatize variables in BaseFader
b31d6212ff WINTERMUTE: Privatize variables in BaseFrame and BaseSprite
03e7bffc77 WINTERMUTE: Privatize variables in BaseRegion and BaseSubFrame
67a7f5b306 WINTERMUTE: Privatize variables in BaseQuickMsg
Commit: ee4a92cce511586898c8334e0ade2e82db57b1f7
https://github.com/scummvm/scummvm/commit/ee4a92cce511586898c8334e0ade2e82db57b1f7
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2012-09-28T06:42:08-07:00
Commit Message:
WINTERMUTE: Privatise member-variables in BaseDynamicBuffer
Changed paths:
engines/wintermute/base/base_dynamic_buffer.h
diff --git a/engines/wintermute/base/base_dynamic_buffer.h b/engines/wintermute/base/base_dynamic_buffer.h
index b6f3e12..2d1a7fb 100644
--- a/engines/wintermute/base/base_dynamic_buffer.h
+++ b/engines/wintermute/base/base_dynamic_buffer.h
@@ -29,14 +29,12 @@
#ifndef WINTERMUTE_BASE_DYNAMIC_BUFFER_H
#define WINTERMUTE_BASE_DYNAMIC_BUFFER_H
-
#include "engines/wintermute/base/base.h"
namespace Wintermute {
class BaseDynamicBuffer {
public:
- bool _initialized;
void putText(const char *fmt, ...);
void putTextIndent(int indent, const char *fmt, ...);
uint32 getDWORD();
@@ -48,12 +46,13 @@ public:
uint32 getSize();
bool init(uint32 initSize = 0);
void cleanup();
- uint32 _size;
- byte *_buffer;
BaseDynamicBuffer(BaseGame *inGame, uint32 initSize = 1000, uint32 growBy = 1000);
virtual ~BaseDynamicBuffer();
private:
+ uint32 _size;
+ byte *_buffer;
+ bool _initialized;
uint32 _realSize;
uint32 _growBy;
uint32 _initSize;
Commit: f6d7d05343375b05f5f487c0c9006fe2cdd7a387
https://github.com/scummvm/scummvm/commit/f6d7d05343375b05f5f487c0c9006fe2cdd7a387
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2012-09-28T14:43:35-07:00
Commit Message:
WINTERMUTE: Privatize variables in BaseFader
Changed paths:
engines/wintermute/base/base_fader.h
diff --git a/engines/wintermute/base/base_fader.h b/engines/wintermute/base/base_fader.h
index d3ced4a..116c8c9 100644
--- a/engines/wintermute/base/base_fader.h
+++ b/engines/wintermute/base/base_fader.h
@@ -36,7 +36,6 @@ namespace Wintermute {
class BaseFader : public BaseObject {
public:
- bool _system;
uint32 getCurrentColor();
bool fadeOut(uint32 targetColor, uint32 duration, bool system = false);
bool fadeIn(uint32 sourceColor, uint32 duration, bool system = false);
@@ -47,6 +46,7 @@ public:
BaseFader(BaseGame *inGame);
virtual ~BaseFader();
private:
+ bool _system;
bool _active;
byte _red;
byte _green;
Commit: b31d6212ffc35b987cfb7ee35a5ae3f75bf34a60
https://github.com/scummvm/scummvm/commit/b31d6212ffc35b987cfb7ee35a5ae3f75bf34a60
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2012-09-28T14:43:43-07:00
Commit Message:
WINTERMUTE: Privatize variables in BaseFrame and BaseSprite
Changed paths:
engines/wintermute/ad/ad_actor.cpp
engines/wintermute/ad/ad_entity.cpp
engines/wintermute/ad/ad_item.cpp
engines/wintermute/ad/ad_talk_node.cpp
engines/wintermute/base/base_frame.cpp
engines/wintermute/base/base_frame.h
engines/wintermute/base/base_sprite.cpp
engines/wintermute/base/base_sprite.h
diff --git a/engines/wintermute/ad/ad_actor.cpp b/engines/wintermute/ad/ad_actor.cpp
index 074d5af..fa06bb1 100644
--- a/engines/wintermute/ad/ad_actor.cpp
+++ b/engines/wintermute/ad/ad_actor.cpp
@@ -602,13 +602,13 @@ bool AdActor::update() {
}
// finished playing animation?
- if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->_finished) {
+ if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->isFinished()) {
_state = _nextState;
_nextState = STATE_READY;
_currentSprite = _animSprite;
}
- if (_state == STATE_PLAYING_ANIM_SET && _animSprite2 != NULL && _animSprite2->_finished) {
+ if (_state == STATE_PLAYING_ANIM_SET && _animSprite2 != NULL && _animSprite2->isFinished()) {
_state = _nextState;
_nextState = STATE_READY;
_currentSprite = _animSprite2;
@@ -649,7 +649,7 @@ bool AdActor::update() {
//////////////////////////////////////////////////////////////////////////
case STATE_TURNING_LEFT:
- if (_tempSprite2 == NULL || _tempSprite2->_finished) {
+ if (_tempSprite2 == NULL || _tempSprite2->isFinished()) {
if (_dir > 0) {
_dir = (TDirection)(_dir - 1);
} else {
@@ -686,7 +686,7 @@ bool AdActor::update() {
//////////////////////////////////////////////////////////////////////////
case STATE_TURNING_RIGHT:
- if (_tempSprite2 == NULL || _tempSprite2->_finished) {
+ if (_tempSprite2 == NULL || _tempSprite2->isFinished()) {
_dir = (TDirection)(_dir + 1);
if ((int)_dir >= (int)NUM_DIRECTIONS) {
@@ -753,7 +753,7 @@ bool AdActor::update() {
}
bool timeIsUp = (_sentence->_sound && _sentence->_soundStarted && (!_sentence->_sound->isPlaying() && !_sentence->_sound->isPaused())) || (!_sentence->_sound && _sentence->_duration <= _gameRef->_timer - _sentence->_startTime);
- if (_tempSprite2 == NULL || _tempSprite2->_finished || (/*_tempSprite2->_looping &&*/ timeIsUp)) {
+ if (_tempSprite2 == NULL || _tempSprite2->isFinished() || (/*_tempSprite2->_looping &&*/ timeIsUp)) {
if (timeIsUp) {
_sentence->finish();
_tempSprite2 = NULL;
@@ -798,7 +798,7 @@ bool AdActor::update() {
if (_currentSprite && !already_moved) {
_currentSprite->getCurrentFrame(_zoomable ? ((AdGame *)_gameRef)->_scene->getZoomAt(_posX, _posY) : 100, _zoomable ? ((AdGame *)_gameRef)->_scene->getZoomAt(_posX, _posY) : 100);
- if (_currentSprite->_changed) {
+ if (_currentSprite->isChanged()) {
_posX += _currentSprite->_moveX;
_posY += _currentSprite->_moveY;
afterMove();
@@ -858,7 +858,7 @@ void AdActor::getNextStep() {
}
_currentSprite->getCurrentFrame(_zoomable ? ((AdGame *)_gameRef)->_scene->getZoomAt(_posX, _posY) : 100, _zoomable ? ((AdGame *)_gameRef)->_scene->getZoomAt(_posX, _posY) : 100);
- if (!_currentSprite->_changed) {
+ if (!_currentSprite->isChanged()) {
return;
}
diff --git a/engines/wintermute/ad/ad_entity.cpp b/engines/wintermute/ad/ad_entity.cpp
index 00dbc0f..f97284a 100644
--- a/engines/wintermute/ad/ad_entity.cpp
+++ b/engines/wintermute/ad/ad_entity.cpp
@@ -578,7 +578,7 @@ bool AdEntity::update() {
}
// finished playing animation?
- if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->_finished) {
+ if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->isFinished()) {
_state = STATE_READY;
_currentSprite = _animSprite;
}
@@ -613,7 +613,7 @@ bool AdEntity::update() {
}
bool timeIsUp = (_sentence->_sound && _sentence->_soundStarted && (!_sentence->_sound->isPlaying() && !_sentence->_sound->isPaused())) || (!_sentence->_sound && _sentence->_duration <= _gameRef->_timer - _sentence->_startTime);
- if (_tempSprite2 == NULL || _tempSprite2->_finished || (/*_tempSprite2->_looping &&*/ timeIsUp)) {
+ if (_tempSprite2 == NULL || _tempSprite2->isFinished() || (/*_tempSprite2->_looping &&*/ timeIsUp)) {
if (timeIsUp) {
_sentence->finish();
_tempSprite2 = NULL;
@@ -639,7 +639,7 @@ bool AdEntity::update() {
if (_currentSprite) {
_currentSprite->getCurrentFrame(_zoomable ? ((AdGame *)_gameRef)->_scene->getZoomAt(_posX, _posY) : 100);
- if (_currentSprite->_changed) {
+ if (_currentSprite->isChanged()) {
_posX += _currentSprite->_moveX;
_posY += _currentSprite->_moveY;
}
diff --git a/engines/wintermute/ad/ad_item.cpp b/engines/wintermute/ad/ad_item.cpp
index bad7223..55ccca8 100644
--- a/engines/wintermute/ad/ad_item.cpp
+++ b/engines/wintermute/ad/ad_item.cpp
@@ -340,7 +340,7 @@ bool AdItem::update() {
}
// finished playing animation?
- if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->_finished) {
+ if (_state == STATE_PLAYING_ANIM && _animSprite != NULL && _animSprite->isFinished()) {
_state = STATE_READY;
_currentSprite = _animSprite;
}
@@ -379,7 +379,7 @@ bool AdItem::update() {
}
bool timeIsUp = (_sentence->_sound && _sentence->_soundStarted && (!_sentence->_sound->isPlaying() && !_sentence->_sound->isPaused())) || (!_sentence->_sound && _sentence->_duration <= _gameRef->_timer - _sentence->_startTime);
- if (_tempSprite2 == NULL || _tempSprite2->_finished || (/*_tempSprite2->_looping &&*/ timeIsUp)) {
+ if (_tempSprite2 == NULL || _tempSprite2->isFinished() || (/*_tempSprite2->_looping &&*/ timeIsUp)) {
if (timeIsUp) {
_sentence->finish();
_tempSprite2 = NULL;
diff --git a/engines/wintermute/ad/ad_talk_node.cpp b/engines/wintermute/ad/ad_talk_node.cpp
index b1bcf68..c909ee2 100644
--- a/engines/wintermute/ad/ad_talk_node.cpp
+++ b/engines/wintermute/ad/ad_talk_node.cpp
@@ -264,9 +264,9 @@ bool AdTalkNode::loadSprite() {
bool AdTalkNode::isInTimeInterval(uint32 time, TDirection dir) {
if (time >= _startTime) {
if (_playToEnd) {
- if ((_spriteFilename && _sprite == NULL) || (_sprite && _sprite->_finished == false)) {
+ if ((_spriteFilename && _sprite == NULL) || (_sprite && _sprite->isFinished() == false)) {
return true;
- } else if ((_spriteSetFilename && _spriteSet == NULL) || (_spriteSet && _spriteSet->getSprite(dir) && _spriteSet->getSprite(dir)->_finished == false)) {
+ } else if ((_spriteSetFilename && _spriteSet == NULL) || (_spriteSet && _spriteSet->getSprite(dir) && _spriteSet->getSprite(dir)->isFinished() == false)) {
return true;
} else {
return false;
diff --git a/engines/wintermute/base/base_frame.cpp b/engines/wintermute/base/base_frame.cpp
index e1b29a3..3e67c29 100644
--- a/engines/wintermute/base/base_frame.cpp
+++ b/engines/wintermute/base/base_frame.cpp
@@ -87,6 +87,12 @@ bool BaseFrame::draw(int x, int y, BaseObject *registerOwner, float zoomX, float
return STATUS_OK;
}
+void BaseFrame::stopSound() {
+ if (_sound) {
+ _sound->stop();
+ }
+}
+
//////////////////////////////////////////////////////////////////////////
bool BaseFrame::oneTimeDisplay(BaseObject *owner, bool muted) {
diff --git a/engines/wintermute/base/base_frame.h b/engines/wintermute/base/base_frame.h
index ea5467b..6088721 100644
--- a/engines/wintermute/base/base_frame.h
+++ b/engines/wintermute/base/base_frame.h
@@ -41,11 +41,10 @@ class ScStack;
class BaseFrame: public BaseScriptable {
public:
bool _killSound;
- bool _keyframe;
+ void stopSound();
bool oneTimeDisplay(BaseObject *owner, bool muted = false);
DECLARE_PERSISTENT(BaseFrame, BaseScriptable)
- BaseSound *_sound;
- bool _editorExpanded;
+
bool getBoundingRect(Rect32 *rect, int x, int y, float scaleX = 100, float scaleY = 100);
bool saveAsText(BaseDynamicBuffer *buffer, int indent);
int _moveY;
@@ -65,7 +64,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:
+ bool _keyframe;
+ bool _editorExpanded;
+ BaseSound *_sound;
};
} // end of namespace Wintermute
diff --git a/engines/wintermute/base/base_sprite.cpp b/engines/wintermute/base/base_sprite.cpp
index e2dd8bb..0baa25a 100644
--- a/engines/wintermute/base/base_sprite.cpp
+++ b/engines/wintermute/base/base_sprite.cpp
@@ -121,6 +121,13 @@ bool BaseSprite::draw(int x, int y, BaseObject *registerOwner, float zoomX, floa
return display(x, y, registerOwner, zoomX, zoomY, alpha);
}
+bool BaseSprite::isChanged() {
+ return _changed;
+}
+
+bool BaseSprite::isFinished() {
+ return _finished;
+}
//////////////////////////////////////////////////////////////////////
bool BaseSprite::loadFile(const Common::String &filename, int lifeTime, TSpriteCacheType cacheType) {
@@ -804,9 +811,7 @@ const char *BaseSprite::scToString() {
//////////////////////////////////////////////////////////////////////////
bool BaseSprite::killAllSounds() {
for (uint32 i = 0; i < _frames.size(); i++) {
- if (_frames[i]->_sound) {
- _frames[i]->_sound->stop();
- }
+ _frames[i]->stopSound();
}
return STATUS_OK;
}
diff --git a/engines/wintermute/base/base_sprite.h b/engines/wintermute/base/base_sprite.h
index c861ca9..cef874b 100644
--- a/engines/wintermute/base/base_sprite.h
+++ b/engines/wintermute/base/base_sprite.h
@@ -39,36 +39,21 @@ class BaseSurface;
class BaseObject;
class BaseSprite: public BaseScriptHolder {
public:
- bool killAllSounds();
BaseSurface *getSurface();
- char *_editorBgFile;
- int _editorBgOffsetX;
- int _editorBgOffsetY;
- int _editorBgAlpha;
- bool _streamed;
- bool _streamedKeepLoaded;
void cleanup();
void setDefaults();
- bool _precise;
DECLARE_PERSISTENT(BaseSprite, BaseScriptHolder)
- bool _editorAllFrames;
bool getBoundingRect(Rect32 *rect, int x, int y, float scaleX = 100, float scaleY = 100);
int _moveY;
int _moveX;
bool display(int x, int y, BaseObject *registerOwner = NULL, float zoomX = 100, float zoomY = 100, uint32 alpha = 0xFFFFFFFF, float rotate = 0.0f, TSpriteBlendMode blendMode = BLEND_NORMAL);
bool getCurrentFrame(float zoomX = 100, float zoomY = 100);
- bool _canBreak;
- bool _editorMuted;
- bool _continuous;
void reset();
- BaseObject *_owner;
- bool _changed;
- bool _paused;
- bool _finished;
+ bool isChanged();
+ bool isFinished();
bool loadBuffer(byte *buffer, bool compete = true, int lifeTime = -1, TSpriteCacheType cacheType = CACHE_ALL);
bool loadFile(const Common::String &filename, int lifeTime = -1, TSpriteCacheType cacheType = CACHE_ALL);
- uint32 _lastFrameTime;
bool draw(int x, int y, BaseObject *Register = NULL, float zoomX = 100, float zoomY = 100, uint32 alpha = 0xFFFFFFFF);
bool _looping;
int _currentFrame;
@@ -83,6 +68,24 @@ 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:
+ BaseObject *_owner;
+ bool _canBreak;
+ bool _changed;
+ bool _editorAllFrames;
+ char *_editorBgFile;
+ int _editorBgOffsetX;
+ int _editorBgOffsetY;
+ int _editorBgAlpha;
+ bool _editorMuted;
+ bool _finished;
+ bool _continuous;
+ uint32 _lastFrameTime;
+ bool _precise;
+ bool _paused;
+ bool _streamed;
+ bool _streamedKeepLoaded;
+ bool killAllSounds();
};
} // end of namespace Wintermute
Commit: 03e7bffc77c8b4e74bee34573da35fe88459703e
https://github.com/scummvm/scummvm/commit/03e7bffc77c8b4e74bee34573da35fe88459703e
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2012-09-28T14:55:41-07:00
Commit Message:
WINTERMUTE: Privatize variables in BaseRegion and BaseSubFrame
Changed paths:
engines/wintermute/base/base_region.h
engines/wintermute/base/base_sub_frame.cpp
engines/wintermute/base/base_sub_frame.h
engines/wintermute/ui/ui_tiled_image.cpp
diff --git a/engines/wintermute/base/base_region.h b/engines/wintermute/base/base_region.h
index 8dd02fe..51989de 100644
--- a/engines/wintermute/base/base_region.h
+++ b/engines/wintermute/base/base_region.h
@@ -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
diff --git a/engines/wintermute/base/base_sub_frame.cpp b/engines/wintermute/base/base_sub_frame.cpp
index 2ff12e8..fd7ee50 100644
--- a/engines/wintermute/base/base_sub_frame.cpp
+++ b/engines/wintermute/base/base_sub_frame.cpp
@@ -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) {
diff --git a/engines/wintermute/base/base_sub_frame.h b/engines/wintermute/base/base_sub_frame.h
index b174c6e..0be77c5 100644
--- a/engines/wintermute/base/base_sub_frame.h
+++ b/engines/wintermute/base/base_sub_frame.h
@@ -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;
diff --git a/engines/wintermute/ui/ui_tiled_image.cpp b/engines/wintermute/ui/ui_tiled_image.cpp
index 472f4a8..2b33733 100644
--- a/engines/wintermute/ui/ui_tiled_image.cpp
+++ b/engines/wintermute/ui/ui_tiled_image.cpp
@@ -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;
Commit: 67a7f5b3063c8d9634f43ee36ba26b18c2e6cd11
https://github.com/scummvm/scummvm/commit/67a7f5b3063c8d9634f43ee36ba26b18c2e6cd11
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2012-09-28T14:57:42-07:00
Commit Message:
WINTERMUTE: Privatize variables in BaseQuickMsg
Changed paths:
engines/wintermute/base/base_quick_msg.h
diff --git a/engines/wintermute/base/base_quick_msg.h b/engines/wintermute/base/base_quick_msg.h
index 4fed5ff..67f9613 100644
--- a/engines/wintermute/base/base_quick_msg.h
+++ b/engines/wintermute/base/base_quick_msg.h
@@ -37,10 +37,10 @@ class BaseQuickMsg : public BaseClass {
public:
char *getText();
uint32 _startTime;
- char *_text;
- BaseQuickMsg(BaseGame *inGame, const char *Text);
+ BaseQuickMsg(BaseGame *inGame, const char *text);
virtual ~BaseQuickMsg();
-
+private:
+ char *_text;
};
} // end of namespace Wintermute
More information about the Scummvm-git-logs
mailing list