PETKA: renamed unk field in QSystem

This commit is contained in:
Andrei Prykhodko 2020-10-02 22:34:37 +03:00
parent e75ee3f5f2
commit 7e41be4877
4 changed files with 8 additions and 9 deletions

View File

@ -137,7 +137,7 @@ void QObjectBG::setEntrance(const Common::String &name) {
sys->getChapay()->setPos(Common::Point(entrance->_walkX, entrance->_walkY - 2), false);
sys->_xOffset = CLIP<int32>(entrance->_walkX - 320, 0, sys->_sceneWidth - 640);
sys->_field6C = sys->_xOffset;
sys->_reqOffset = sys->_xOffset;
}
g_vm->videoSystem()->makeAllDirty();
}

View File

@ -43,7 +43,7 @@ namespace Petka {
QSystem::QSystem(PetkaEngine &vm)
: _vm(vm), _mainInterface(nullptr), _currInterface(nullptr), _prevInterface(nullptr),
_totalInit(false), _sceneWidth(640), _room(nullptr) {}
_totalInit(false), _sceneWidth(640), _room(nullptr), _xOffset(0), _reqOffset(0) {}
QSystem::~QSystem() {
for (uint i = 0; i < _allObjects.size(); ++i) {

View File

@ -104,8 +104,7 @@ public:
int _sceneWidth;
int _xOffset;
int _field6C;
int _reqOffset;
QObjectBG *_room;
};

View File

@ -52,14 +52,14 @@ void VideoSystem::update() {
if (interface) {
if (sys->_currInterface == sys->_mainInterface.get()) {
int xOff = sys->_xOffset;
int field6C = sys->_field6C;
if (xOff != field6C && ((xOff != sys->_sceneWidth - 640 && xOff < field6C ) || (xOff > 0 && xOff > field6C))) {
if (xOff <= field6C) {
int reqOffset = sys->_reqOffset;
if (xOff != reqOffset && ((xOff != sys->_sceneWidth - 640 && xOff < reqOffset) || (xOff > 0 && xOff > reqOffset))) {
if (xOff <= reqOffset) {
xOff += 8;
xOff = MIN<int>(xOff, field6C);
xOff = MIN<int>(xOff, reqOffset);
} else {
xOff -= 8;
xOff = MAX<int>(xOff, field6C);
xOff = MAX<int>(xOff, reqOffset);
}
sys->_xOffset = CLIP(xOff, 0, sys->_sceneWidth - 640);
}