Skip to content

Commit

Permalink
ZVISION: Now setBackgroundPosition must care about statekey value
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisa-Chan committed Nov 7, 2014
1 parent 3131e3a commit 7151240
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions engines/zvision/graphics/render_manager.cpp
Expand Up @@ -24,6 +24,7 @@

#include "zvision/zvision.h"
#include "zvision/graphics/render_manager.h"
#include "zvision/scripting/script_manager.h"
#include "zvision/text/text.h"

#include "zvision/utility/lzss_read_stream.h"
Expand Down Expand Up @@ -384,6 +385,8 @@ void RenderManager::setBackgroundPosition(int offset) {
if (_bkgOff != offset)
_bkgDirtyRect = Common::Rect(_bkgWidth, _bkgHeight);
_bkgOff = offset;

_engine->getScriptManager()->setStateValue(StateKey_ViewPos, offset);
}

uint32 RenderManager::getCurrentBackgroundOffset() {
Expand Down
2 changes: 0 additions & 2 deletions engines/zvision/zvision.cpp
Expand Up @@ -383,7 +383,6 @@ void ZVision::updateRotation() {
if (new_pos < 0)
new_pos += scr_width;

_scriptManager->setStateValue(StateKey_ViewPos, new_pos);
_renderManager->setBackgroundPosition(new_pos);
} else if (renderState == RenderTable::TILT) {
int16 st_pos = _scriptManager->getStateValue(StateKey_ViewPos);
Expand All @@ -398,7 +397,6 @@ void ZVision::updateRotation() {
if (new_pos <= tilt_gap)
new_pos = tilt_gap;

_scriptManager->setStateValue(StateKey_ViewPos, new_pos);
_renderManager->setBackgroundPosition(new_pos);
}
}
Expand Down

0 comments on commit 7151240

Please sign in to comment.