[Scummvm-git-logs] scummvm master -> 2d8a615ea8ed500a882c39e8128916e6ea4841c6
whiterandrek
noreply at scummvm.org
Sun Feb 6 12:25:36 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
2d8a615ea8 PETKA: fix setting scene offset in some cases
Commit: 2d8a615ea8ed500a882c39e8128916e6ea4841c6
https://github.com/scummvm/scummvm/commit/2d8a615ea8ed500a882c39e8128916e6ea4841c6
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2022-02-06T14:25:31+02:00
Commit Message:
PETKA: fix setting scene offset in some cases
bug #12068
Changed paths:
engines/petka/interfaces/main.cpp
engines/petka/q_manager.cpp
diff --git a/engines/petka/interfaces/main.cpp b/engines/petka/interfaces/main.cpp
index d0ba9d1eb2d..3ae8fd7f72c 100644
--- a/engines/petka/interfaces/main.cpp
+++ b/engines/petka/interfaces/main.cpp
@@ -96,12 +96,7 @@ void InterfaceMain::loadRoom(int id, bool fromSave) {
sys->_room = room;
_objs.push_back(room);
- auto surface = resMgr->getSurface(room->_resourceId);
- if (surface) {
- assert(surface->w >= 640);
- sys->_sceneWidth = MAX<int>(surface->w, 640);
- sys->_xOffset = 0;
- }
+ resMgr->getSurface(room->_resourceId);
for (uint i = 0; i < info->attachedObjIds.size(); ++i) {
QMessageObject *obj = sys->findObject(info->attachedObjIds[i]);
diff --git a/engines/petka/q_manager.cpp b/engines/petka/q_manager.cpp
index eb7567c39de..59f64663c58 100644
--- a/engines/petka/q_manager.cpp
+++ b/engines/petka/q_manager.cpp
@@ -30,6 +30,7 @@
#include "petka/flc.h"
#include "petka/q_manager.h"
+#include "petka/q_system.h"
#include "petka/petka.h"
namespace Petka {
@@ -120,6 +121,10 @@ Graphics::Surface *QManager::getSurface(uint32 id) {
Common::ScopedPtr<Common::SeekableReadStream> preloaded_stream (stream->readStream(stream->size()));
Graphics::Surface *s = loadBitmapSurface(*preloaded_stream);
if (s) {
+ assert(s->w >= 640);
+ g_vm->getQSystem()->_sceneWidth = MAX<int>(s->w, 640);
+ g_vm->getQSystem()->_xOffset = 0;
+
QResource &res = _resourceMap.getOrCreateVal(id);
res.type = QResource::kSurface;
res.surface = s;
More information about the Scummvm-git-logs
mailing list