Skip to content

Commit

Permalink
WAGE: Mark scene as dirty of some object was moved to/from it
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Jan 4, 2016
1 parent e7eb7ff commit 3b48d90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions engines/wage/gui.h
Expand Up @@ -72,6 +72,7 @@ class Gui {
void mouseMove(int x, int y);
Designed *getClickTarget(int x, int y);
void drawInput();
void setSceneDirty() { _sceneDirty = true; }

private:
void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType);
Expand Down
12 changes: 12 additions & 0 deletions engines/wage/wage.cpp
Expand Up @@ -308,6 +308,18 @@ void WageEngine::onMove(Designed *what, Designed *from, Designed *to) {
return;
}

if (!_temporarilyHidden) {
assert(what);
assert(from);
assert(to);
debug(6, "move: %s, %s -> %s", what->_name.c_str(), from->_name.c_str(), to->_name.c_str());
}

if (from == currentScene || to == currentScene ||
(what->_classType == CHR && ((Chr *)what)->_currentScene == currentScene) ||
(what->_classType == OBJ && ((Obj *)what)->_currentScene == currentScene))
_gui->setSceneDirty();

if (what != player && what->_classType == CHR) {
Chr *chr = (Chr *)what;
if (to == _world->_storageScene) {
Expand Down

0 comments on commit 3b48d90

Please sign in to comment.