[Scummvm-git-logs] scummvm master -> e68ca7630dfec195d2234274f126ca40034904c6
mgerhardy
martin.gerhardy at gmail.com
Sat Jul 31 19:42:55 UTC 2021
This automated email contains information about 8 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
896622286a TWINE: dirty rect handling simplified
9ac735f623 TWINE: simplified dirty rect handling
9a6dce181e TWINE: renamed method
e0f26fe06e TWINE: removed unused copyBlockPhys calls
a7f5a56847 TWINE: added todo comment
1c4694e7b6 TWINE: when blitting the back to the front buffer also mark the area as dirty
63d225854f TWINE: fixed lBUBBLE_OFF
e68ca7630d TWINE: exit the scenery view in lASK_CHOICE_OBJ
Commit: 896622286ae99ae2d5c1254dc832f175cc76a644
https://github.com/scummvm/scummvm/commit/896622286ae99ae2d5c1254dc832f175cc76a644
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-31T21:38:12+02:00
Commit Message:
TWINE: dirty rect handling simplified
also reduced visibility of some members
Changed paths:
engines/twine/debugger/debug.cpp
engines/twine/menu/menu.cpp
engines/twine/menu/menu.h
engines/twine/renderer/renderer.cpp
engines/twine/renderer/renderer.h
engines/twine/scene/gamestate.cpp
engines/twine/twine.cpp
diff --git a/engines/twine/debugger/debug.cpp b/engines/twine/debugger/debug.cpp
index d57da80dd7..63ec91d861 100644
--- a/engines/twine/debugger/debug.cpp
+++ b/engines/twine/debugger/debug.cpp
@@ -395,9 +395,6 @@ int32 Debug::debugProcessButton(int32 x, int32 y) {
void Debug::debugPlasmaWindow(const char *text, int32 color) {
_engine->_menu->processPlasmaEffect(Common::Rect(0, 0, PLASMA_WIDTH, PLASMA_HEIGHT), color);
- if (!(_engine->getRandomNumber() % 5)) {
- _engine->_menu->_plasmaEffectPtr[_engine->getRandomNumber() % PLASMA_WIDTH * 10 + 6400] = 255;
- }
const int32 textSize = _engine->_text->getTextSize(text);
_engine->_text->drawText((_engine->width() / 2) - (textSize / 2), 10, text);
const Common::Rect rect(5, 5, _engine->width() - 5, 50);
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index b899f74068..a358cffb9c 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -932,7 +932,7 @@ bool Menu::isBehaviourHovered(int32 left, int32 top, HeroBehaviourType behaviour
return _engine->_input->isMouseHovering(boxRect);
}
-void Menu::drawBehaviour(int32 left, int32 top, HeroBehaviourType behaviour, int32 angle, bool cantDrawBox, Common::Rect &dirtyRect) {
+void Menu::drawBehaviour(int32 left, int32 top, HeroBehaviourType behaviour, int32 angle, bool cantDrawBox) {
const Common::Rect &boxRect = calcBehaviourRect(left, top, behaviour);
const int animIdx = _engine->_actor->_heroAnimIdx[(byte)behaviour];
@@ -980,26 +980,19 @@ void Menu::drawBehaviour(int32 left, int32 top, HeroBehaviourType behaviour, int
_engine->_text->getMenuText(_engine->_actor->getTextIdForBehaviour(), dialText, sizeof(dialText));
_engine->_text->drawText(titleBoxCenter - _engine->_text->getTextSize(dialText) / 2, titleBoxTop + 1, dialText);
- _engine->copyBlockPhys(titleRect);
} else {
_engine->_interface->drawFilledRect(boxRect, COLOR_BLACK);
}
- _engine->_renderer->renderBehaviourModel(boxRect, -600, angle, *_behaviourEntity);
-
- if (dirtyRect.isEmpty()) {
- dirtyRect = boxRect;
- } else {
- dirtyRect.extend(boxRect);
- }
+ _engine->_renderer->renderBehaviourModel(boxRect, -600, angle, *_behaviourEntity, _moveMenu);
_engine->_interface->loadClip();
}
-void Menu::prepareAndDrawBehaviour(int32 left, int32 top, int32 angle, HeroBehaviourType behaviour, Common::Rect &dirtyRect) {
+void Menu::prepareAndDrawBehaviour(int32 left, int32 top, int32 angle, HeroBehaviourType behaviour) {
const int animIdx = _engine->_actor->_heroAnimIdx[(byte)behaviour];
_engine->_animations->setAnimAtKeyframe(_behaviourAnimState[(byte)behaviour], _engine->_resources->_animData[animIdx], *_behaviourEntity, &_behaviourAnimData[(byte)behaviour]);
- drawBehaviour(left, top, behaviour, angle, false, dirtyRect);
+ drawBehaviour(left, top, behaviour, angle, false);
}
void Menu::drawBehaviourMenu(int32 left, int32 top, int32 angle) {
@@ -1015,11 +1008,10 @@ void Menu::drawBehaviourMenu(int32 left, int32 top, int32 angle) {
boxRect.grow(-1);
_engine->_interface->drawTransparentBox(boxRect, 2);
- Common::Rect ignoreRect;
- prepareAndDrawBehaviour(left, top, angle, HeroBehaviourType::kNormal, ignoreRect);
- prepareAndDrawBehaviour(left, top, angle, HeroBehaviourType::kAthletic, ignoreRect);
- prepareAndDrawBehaviour(left, top, angle, HeroBehaviourType::kAggressive, ignoreRect);
- prepareAndDrawBehaviour(left, top, angle, HeroBehaviourType::kDiscrete, ignoreRect);
+ prepareAndDrawBehaviour(left, top, angle, HeroBehaviourType::kNormal);
+ prepareAndDrawBehaviour(left, top, angle, HeroBehaviourType::kAthletic);
+ prepareAndDrawBehaviour(left, top, angle, HeroBehaviourType::kAggressive);
+ prepareAndDrawBehaviour(left, top, angle, HeroBehaviourType::kDiscrete);
_engine->copyBlockPhys(titleRect);
@@ -1095,19 +1087,15 @@ void Menu::processBehaviourMenu() {
_engine->_actor->_heroBehaviour = (HeroBehaviourType)heroBehaviour;
- Common::Rect dirtyRect;
if (tmpHeroBehaviour != _engine->_actor->_heroBehaviour) {
- drawBehaviour(left, top, tmpHeroBehaviour, _engine->_scene->_sceneHero->_angle, true, dirtyRect);
+ drawBehaviour(left, top, tmpHeroBehaviour, _engine->_scene->_sceneHero->_angle, true);
tmpHeroBehaviour = _engine->_actor->_heroBehaviour;
_engine->_movements->setActorAngleSafe(_engine->_scene->_sceneHero->_angle, _engine->_scene->_sceneHero->_angle - ANGLE_90, ANGLE_17, &_moveMenu);
const int tmpAnimIdx = _engine->_actor->_heroAnimIdx[(byte)_engine->_actor->_heroBehaviour];
_engine->_animations->setAnimAtKeyframe(_behaviourAnimState[(byte)_engine->_actor->_heroBehaviour], _engine->_resources->_animData[tmpAnimIdx], *_behaviourEntity, &_behaviourAnimData[(byte)_engine->_actor->_heroBehaviour]);
}
- drawBehaviour(left, top, _engine->_actor->_heroBehaviour, -1, true, dirtyRect);
- if (!dirtyRect.isEmpty()) {
- _engine->copyBlockPhys(dirtyRect);
- }
+ drawBehaviour(left, top, _engine->_actor->_heroBehaviour, -1, true);
_engine->_lbaTime++;
}
@@ -1121,7 +1109,7 @@ void Menu::processBehaviourMenu() {
_engine->_text->initSceneTextBank();
}
-void Menu::drawItem(int32 left, int32 top, int32 item, Common::Rect &dirtyRect) {
+void Menu::drawItem(int32 left, int32 top, int32 item) {
const int32 itemWidth = 74;
const int32 itemHeight = 64;
const int32 itemPadding = 11;
@@ -1147,26 +1135,15 @@ void Menu::drawItem(int32 left, int32 top, int32 item, Common::Rect &dirtyRect)
}
drawBox(rect);
- if (dirtyRect.isEmpty()) {
- dirtyRect = rect;
- } else {
- dirtyRect.extend(rect);
- }
}
void Menu::drawInventoryItems(int32 left, int32 top) {
const Common::Rect rect(left, top, left + 605, top + 310);
_engine->_interface->drawTransparentBox(rect, 4);
drawBox(rect);
- drawBox(left + 93, top + 8, left + 93 + 78, top + 8 + 293, COLOR_75, COLOR_75);
- _engine->copyBlockPhys(rect);
- Common::Rect dirtyRect;
for (int32 item = 0; item < NUM_INVENTORY_ITEMS; item++) {
- drawItem(left, top, item, dirtyRect);
- }
- if (!dirtyRect.isEmpty()) {
- _engine->copyBlockPhys(dirtyRect);
+ drawItem(left, top, item);
}
}
@@ -1214,34 +1191,33 @@ void Menu::processInventoryMenu() {
const bool cursorLeft = _engine->_input->toggleActionIfActive(TwinEActionType::UILeft);
const bool cursorRight = _engine->_input->toggleActionIfActive(TwinEActionType::UIRight);
- Common::Rect dirtyRect;
if (cursorDown) {
_inventorySelectedItem++;
if (_inventorySelectedItem >= NUM_INVENTORY_ITEMS) {
_inventorySelectedItem = 0;
}
- drawItem(left, top, prevSelectedItem, dirtyRect);
+ drawItem(left, top, prevSelectedItem);
updateItemText = true;
} else if (cursorUp) {
_inventorySelectedItem--;
if (_inventorySelectedItem < 0) {
_inventorySelectedItem = NUM_INVENTORY_ITEMS - 1;
}
- drawItem(left, top, prevSelectedItem, dirtyRect);
+ drawItem(left, top, prevSelectedItem);
updateItemText = true;
} else if (cursorLeft) {
_inventorySelectedItem -= 4;
if (_inventorySelectedItem < 0) {
_inventorySelectedItem += NUM_INVENTORY_ITEMS;
}
- drawItem(left, top, prevSelectedItem, dirtyRect);
+ drawItem(left, top, prevSelectedItem);
updateItemText = true;
} else if (cursorRight) {
_inventorySelectedItem += 4;
if (_inventorySelectedItem >= NUM_INVENTORY_ITEMS) {
_inventorySelectedItem -= NUM_INVENTORY_ITEMS;
}
- drawItem(left, top, prevSelectedItem, dirtyRect);
+ drawItem(left, top, prevSelectedItem);
updateItemText = true;
}
@@ -1273,21 +1249,14 @@ void Menu::processInventoryMenu() {
}
}
- drawItem(left, top, _inventorySelectedItem, dirtyRect);
+ drawItem(left, top, _inventorySelectedItem);
if (_inventorySelectedItem < NUM_INVENTORY_ITEMS && _engine->_input->toggleActionIfActive(TwinEActionType::UIEnter) && _engine->_gameState->hasItem((InventoryItems)_inventorySelectedItem) && !_engine->_gameState->inventoryDisabled()) {
_engine->_loopInventoryItem = _inventorySelectedItem;
_inventorySelectedColor = COLOR_91;
- drawItem(left, top, _inventorySelectedItem, dirtyRect);
- if (!dirtyRect.isEmpty()) {
- _engine->copyBlockPhys(dirtyRect);
- }
+ drawItem(left, top, _inventorySelectedItem);
break;
}
-
- if (!dirtyRect.isEmpty()) {
- _engine->copyBlockPhys(dirtyRect);
- }
}
_engine->_text->_hasValidTextHandle = false;
diff --git a/engines/twine/menu/menu.h b/engines/twine/menu/menu.h
index 8a6677c943..5cb15af785 100644
--- a/engines/twine/menu/menu.h
+++ b/engines/twine/menu/menu.h
@@ -146,6 +146,22 @@ private:
int32 _inventorySelectedColor = COLOR_BLACK;
int32 _inventorySelectedItem = 0; // currentSelectedObjectInInventory
+ /** Plasma Effect pointer to file content: RESS.HQR:51 */
+ uint8 *_plasmaEffectPtr = nullptr;
+
+ MenuSettings _giveUpMenuWithSaveState;
+ MenuSettings _volumeMenuState;
+ MenuSettings _saveManageMenuState;
+ MenuSettings _giveUpMenuState;
+ MenuSettings _mainMenuState;
+ MenuSettings _advOptionsMenuState;
+ MenuSettings _optionsMenuState;
+
+ // objectRotation
+ int16 _itemAngle[NUM_INVENTORY_ITEMS];
+ /** Behaviour menu move pointer */
+ ActorMoveStruct _moveMenu;
+
/**
* Draws main menu button
* @param buttonId current button identification from menu settings
@@ -169,19 +185,11 @@ private:
void drawInfoMenu(int16 left, int16 top, int16 width);
Common::Rect calcBehaviourRect(int32 left, int32 top, HeroBehaviourType behaviour) const;
bool isBehaviourHovered(int32 left, int32 top, HeroBehaviourType behaviour) const;
- void drawBehaviour(int32 left, int32 top, HeroBehaviourType behaviour, int32 angle, bool cantDrawBox, Common::Rect &dirtyRect);
+ void drawBehaviour(int32 left, int32 top, HeroBehaviourType behaviour, int32 angle, bool cantDrawBox);
void drawInventoryItems(int32 left, int32 top);
- void prepareAndDrawBehaviour(int32 left, int32 top, int32 angle, HeroBehaviourType behaviour, Common::Rect &dirtyRect);
+ void prepareAndDrawBehaviour(int32 left, int32 top, int32 angle, HeroBehaviourType behaviour);
void drawBehaviourMenu(int32 left, int32 top, int32 angle);
- void drawItem(int32 left, int32 top, int32 item, Common::Rect &dirtyRect);
-
- MenuSettings _giveUpMenuWithSaveState;
- MenuSettings _volumeMenuState;
- MenuSettings _saveManageMenuState;
- MenuSettings _giveUpMenuState;
- MenuSettings _mainMenuState;
- MenuSettings _advOptionsMenuState;
- MenuSettings _optionsMenuState;
+ void drawItem(int32 left, int32 top, int32 item);
void drawSpriteAndString(int32 left, int32 top, const SpriteData &spriteData, const Common::String &str, int32 color = COLOR_GOLD);
@@ -189,14 +197,6 @@ public:
Menu(TwinEEngine *engine);
~Menu();
- int16 _itemAngle[NUM_INVENTORY_ITEMS]; // objectRotation
-
- /** Behaviour menu move pointer */
- ActorMoveStruct _moveMenu;
-
- /** Plasma Effect pointer to file content: RESS.HQR:51 */
- uint8 *_plasmaEffectPtr = nullptr;
-
/**
* Process the plasma effect
* @param color plasma effect start color
diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index 2c2ba1fae2..e063823039 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -1460,20 +1460,19 @@ bool Renderer::renderIsoModel(int32 x, int32 y, int32 z, int32 angleX, int32 ang
return true;
}
-void Renderer::renderBehaviourModel(const Common::Rect &rect, int32 y, int32 angle, const BodyData &bodyData) {
- renderBehaviourModel(rect.left, rect.top, rect.right, rect.bottom, y, angle, bodyData);
-}
-
-void Renderer::renderBehaviourModel(int32 boxLeft, int32 boxTop, int32 boxRight, int32 boxBottom, int32 y, int32 angle, const BodyData &bodyData) {
+void Renderer::renderBehaviourModel(const Common::Rect &rect, int32 y, int32 angle, const BodyData &bodyData, ActorMoveStruct &move) {
+ int32 boxLeft = rect.left;
+ int32 boxTop = rect.top;
+ int32 boxRight = rect.right;
+ int32 boxBottom = rect.bottom;
const int32 ypos = (boxBottom + boxTop) / 2;
const int32 xpos = (boxRight + boxLeft) / 2;
setOrthoProjection(xpos, ypos, 0);
- _engine->_interface->setClip(Common::Rect(boxLeft, boxTop, boxRight, boxBottom));
+ _engine->_interface->setClip(rect);
Common::Rect dummy;
if (angle == -1) {
- ActorMoveStruct &move = _engine->_menu->_moveMenu;
const int16 newAngle = move.getRealAngle(_engine->_lbaTime);
if (move.numOfStep == 0) {
_engine->_movements->setActorAngleSafe(newAngle, newAngle - ANGLE_90, ANGLE_17, &move);
diff --git a/engines/twine/renderer/renderer.h b/engines/twine/renderer/renderer.h
index 4845b68286..0b2ad6c302 100644
--- a/engines/twine/renderer/renderer.h
+++ b/engines/twine/renderer/renderer.h
@@ -240,11 +240,11 @@ public:
/**
* @param angle A value of @c -1 means that the model is automatically rotated
*/
- void renderBehaviourModel(int32 boxLeft, int32 boxTop, int32 boxRight, int32 boxBottom, int32 y, int32 angle, const BodyData &bodyData);
+ void renderBehaviourModel(int32 boxLeft, int32 boxTop, int32 boxRight, int32 boxBottom, int32 y, int32 angle, const BodyData &bodyData, ActorMoveStruct &move);
/**
* @param angle A value of @c -1 means that the model is automatically rotated
*/
- void renderBehaviourModel(const Common::Rect &rect, int32 y, int32 angle, const BodyData &bodyData);
+ void renderBehaviourModel(const Common::Rect &rect, int32 y, int32 angle, const BodyData &bodyData, ActorMoveStruct &move);
void renderInventoryItem(int32 x, int32 y, const BodyData &bodyData, int32 angle, int32 param);
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index e191fb2cac..e9ea1b3fff 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -365,6 +365,7 @@ void GameState::processFoundItem(InventoryItems item) {
_engine->_redraw->_numOfRedrawBox = 0;
ScopedKeyMap uiKeyMap(_engine, uiKeyMapId);
+ int16 itemAngle = ANGLE_0;
for (;;) {
FrameMarker frame(_engine, 66);
_engine->_interface->resetClip();
@@ -374,9 +375,9 @@ void GameState::processFoundItem(InventoryItems item) {
_engine->_interface->setClip(boxRect);
- _engine->_menu->_itemAngle[item] += ANGLE_2;
+ itemAngle += ANGLE_2;
- _engine->_renderer->renderInventoryItem(_engine->_renderer->_projPos.x, _engine->_renderer->_projPos.y, _engine->_resources->_inventoryTable[item], _engine->_menu->_itemAngle[item], 10000);
+ _engine->_renderer->renderInventoryItem(_engine->_renderer->_projPos.x, _engine->_renderer->_projPos.y, _engine->_resources->_inventoryTable[item], itemAngle, 10000);
_engine->_menu->drawBox(boxRect);
_engine->_redraw->addRedrawArea(boxRect);
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index a33148a591..c63c5fd113 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -526,8 +526,6 @@ void TwinEEngine::exitSceneryView() {
}
void TwinEEngine::initAll() {
- Common::fill(&_menu->_itemAngle[0], &_menu->_itemAngle[NUM_INVENTORY_ITEMS], 0);
-
_scene->_sceneHero = _scene->getActor(OWN_ACTOR_SCENE_INDEX);
// Set clip to fullscreen by default, allows main menu to render properly after load
Commit: 9ac735f623552afa089f1eec3db7d7901aec0219
https://github.com/scummvm/scummvm/commit/9ac735f623552afa089f1eec3db7d7901aec0219
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-31T21:38:12+02:00
Commit Message:
TWINE: simplified dirty rect handling
Changed paths:
engines/twine/menu/menuoptions.cpp
engines/twine/menu/menuoptions.h
diff --git a/engines/twine/menu/menuoptions.cpp b/engines/twine/menu/menuoptions.cpp
index 8ffb472ea1..0ecb727a2e 100644
--- a/engines/twine/menu/menuoptions.cpp
+++ b/engines/twine/menu/menuoptions.cpp
@@ -121,7 +121,7 @@ void MenuOptions::showEndSequence() {
_engine->setPalette(_engine->_screens->_paletteRGBA);
}
-void MenuOptions::drawSelectableCharacter(int32 x, int32 y, Common::Rect &dirtyRect) {
+void MenuOptions::drawSelectableCharacter(int32 x, int32 y) {
const int32 borderTop = 200;
const int32 borderLeft = _engine->width() / 2 - 295;
const int32 halfButtonHeight = 25;
@@ -160,12 +160,6 @@ void MenuOptions::drawSelectableCharacter(int32 x, int32 y, Common::Rect &dirtyR
const int32 textX = centerX - _engine->_text->getCharWidth(character) / 2;
const int32 textY = centerY - _engine->_text->getCharHeight(character) / 2;
_engine->_text->drawText(textX, textY, buffer);
-
- if (dirtyRect.isEmpty()) {
- dirtyRect = rect;
- } else {
- dirtyRect.extend(rect);
- }
}
void MenuOptions::setOnScreenKeyboard(int x, int y) {
@@ -195,16 +189,11 @@ void MenuOptions::setOnScreenKeyboard(int x, int y) {
}
void MenuOptions::drawSelectableCharacters() {
- Common::Rect dirtyRect;
for (int8 x = 0; x < ONSCREENKEYBOARD_WIDTH; x++) {
for (int8 y = 0; y < ONSCREENKEYBOARD_HEIGHT; y++) {
- drawSelectableCharacter(x, y, dirtyRect);
+ drawSelectableCharacter(x, y);
}
}
- if (dirtyRect.isEmpty()) {
- return;
- }
- _engine->copyBlockPhys(dirtyRect);
}
void MenuOptions::drawInputText(int32 centerx, int32 top, int32 type, const char *text) {
diff --git a/engines/twine/menu/menuoptions.h b/engines/twine/menu/menuoptions.h
index 9effa77279..ed0c421930 100644
--- a/engines/twine/menu/menuoptions.h
+++ b/engines/twine/menu/menuoptions.h
@@ -47,7 +47,7 @@ private:
bool enterText(TextId textIdx, char *textTargetBuf, size_t bufSize);
void drawSelectableCharacters();
void drawInputText(int32 centerx, int32 top, int32 type, const char *text);
- void drawSelectableCharacter(int32 x, int32 y, Common::Rect &dirtyRect);
+ void drawSelectableCharacter(int32 x, int32 y);
int chooseSave(TextId textIdx, bool showEmptySlots = false);
public:
Commit: 9a6dce181e8158f38e562ab78a73d7e9013a7653
https://github.com/scummvm/scummvm/commit/9a6dce181e8158f38e562ab78a73d7e9013a7653
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-31T21:38:12+02:00
Commit Message:
TWINE: renamed method
Changed paths:
engines/twine/debugger/debug.cpp
engines/twine/debugger/debug.h
engines/twine/debugger/debug_scene.cpp
engines/twine/holomap.cpp
engines/twine/menu/menu.cpp
engines/twine/menu/menu.h
engines/twine/menu/menuoptions.cpp
engines/twine/renderer/redraw.cpp
engines/twine/scene/gamestate.cpp
engines/twine/text.cpp
diff --git a/engines/twine/debugger/debug.cpp b/engines/twine/debugger/debug.cpp
index 63ec91d861..45f5668d96 100644
--- a/engines/twine/debugger/debug.cpp
+++ b/engines/twine/debugger/debug.cpp
@@ -42,17 +42,11 @@ void Debug::debugFillButton(int32 x, int32 y, int32 width, int32 height, int8 co
void Debug::debugDrawButton(const Common::Rect &rect, const char *text, int32 textLeft, int32 textTop, int32 isActive, int8 color) {
debugFillButton(rect.left + 1, rect.top + 1, rect.right - rect.left - 1, rect.bottom - rect.top - 1, color);
- _engine->_menu->drawBox(rect);
+ _engine->_menu->drawRectBorders(rect);
_engine->drawText(textLeft, textTop, text, 0);
_engine->copyBlockPhys(rect);
}
-void Debug::debugDrawWindowBox(const Common::Rect &rect, int32 alpha) {
- _engine->_interface->drawTransparentBox(rect, alpha);
- _engine->_menu->drawBox(rect);
- //_engine->copyBlockPhys(rect);
-}
-
void Debug::debugDrawWindowButtons(int32 w) {
DebugWindowStruct &window = _debugWindows[w];
for (int32 b = 0; b < window.numButtons; b++) {
@@ -75,7 +69,8 @@ void Debug::debugDrawWindow(int32 w) {
const Common::Rect &rect = window.rect;
const int32 alpha = window.alpha;
- debugDrawWindowBox(rect, alpha);
+ _engine->_interface->drawTransparentBox(rect, alpha);
+ _engine->_menu->drawRectBorders(rect);
if (window.numLines > 0) {
for (int32 l = 0; l < window.numLines; l++) {
@@ -398,7 +393,7 @@ void Debug::debugPlasmaWindow(const char *text, int32 color) {
const int32 textSize = _engine->_text->getTextSize(text);
_engine->_text->drawText((_engine->width() / 2) - (textSize / 2), 10, text);
const Common::Rect rect(5, 5, _engine->width() - 5, 50);
- _engine->_menu->drawBox(rect);
+ _engine->_menu->drawRectBorders(rect);
_engine->copyBlockPhys(rect);
}
diff --git a/engines/twine/debugger/debug.h b/engines/twine/debugger/debug.h
index f250fb4ffb..abe0d55279 100644
--- a/engines/twine/debugger/debug.h
+++ b/engines/twine/debugger/debug.h
@@ -82,7 +82,6 @@ private:
int32 _numDebugWindows = 0;
void debugFillButton(int32 x, int32 y, int32 width, int32 height, int8 color);
void debugDrawButton(const Common::Rect &rect, const char *text, int32 textLeft, int32 textTop, int32 isActive, int8 color);
- void debugDrawWindowBox(const Common::Rect &rect, int32 alpha);
void debugDrawWindowButtons(int32 w);
void debugDrawWindow(int32 w);
int32 debugTypeUseMenu(int32 type);
diff --git a/engines/twine/debugger/debug_scene.cpp b/engines/twine/debugger/debug_scene.cpp
index 8a04484205..9b0175d909 100644
--- a/engines/twine/debugger/debug_scene.cpp
+++ b/engines/twine/debugger/debug_scene.cpp
@@ -38,7 +38,7 @@ void DebugScene::drawClip(const Common::Rect &rect) {
if (!_showingClips) {
return;
}
- _engine->_menu->drawBox(rect);
+ _engine->_menu->drawRectBorders(rect);
}
void DebugScene::projectBoundingBoxPoints(IVec3 *pPoint3d, IVec3 *pPoint3dProjected) {
@@ -164,7 +164,7 @@ bool DebugScene::displayActors() {
const int boxheight = 2 * lineHeight;
const Common::Rect filledRect(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, positions.frontTopRightPoint2D.x + boxwidth, positions.frontTopRightPoint2D.y + boxheight);
_engine->_interface->drawFilledRect(filledRect, COLOR_WHITE);
- _engine->_menu->drawBox(filledRect);
+ _engine->_menu->drawRectBorders(filledRect);
_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, Common::String::format("Actor: %i", a), true, false, boxwidth);
_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y + lineHeight, Common::String::format("pos: %i:%i:%i", positions.frontTopRightPoint.x, positions.frontTopRightPoint.y, positions.frontTopRightPoint.z), true, false, boxwidth);
state = true;
@@ -203,7 +203,7 @@ bool DebugScene::displayZones() {
const int boxheight = 2 * lineHeight;
const Common::Rect filledRect(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, positions.frontTopRightPoint2D.x + boxwidth, positions.frontTopRightPoint2D.y + boxheight);
_engine->_interface->drawFilledRect(filledRect, COLOR_WHITE);
- _engine->_menu->drawBox(filledRect);
+ _engine->_menu->drawRectBorders(filledRect);
_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, Common::String::format("Type: %i (%i)", (int)zonePtr->type, i), true, false, boxwidth);
_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y + lineHeight, Common::String::format("pos: %i:%i:%i", positions.frontTopRightPoint.x, positions.frontTopRightPoint.y, positions.frontTopRightPoint.z), true, false, boxwidth);
state = true;
diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index db26318701..5de944705b 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -582,7 +582,7 @@ void Holomap::processHolomap() {
renderLocations(xRot, yRot, 0, true);
drawHolomapText(_engine->width() / 2, 25, "HoloMap");
if (rotate) {
- _engine->_menu->drawBox(300, 170, 340, 210);
+ _engine->_menu->drawRectBorders(300, 170, 340, 210);
}
_engine->copyBlockPhys(rect);
}
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index a358cffb9c..f0f7ac2cb7 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -238,15 +238,15 @@ void Menu::processPlasmaEffect(const Common::Rect &rect, int32 color) {
_engine->_frontVideoBuffer.blitFrom(_engine->_imageBuffer, prect, rect);
}
-void Menu::drawBox(const Common::Rect &rect, int32 colorLeftTop, int32 colorRightBottom) {
+void Menu::drawRectBorders(const Common::Rect &rect, int32 colorLeftTop, int32 colorRightBottom) {
_engine->_interface->drawLine(rect.left, rect.top, rect.right, rect.top, colorLeftTop); // top line
_engine->_interface->drawLine(rect.left, rect.top, rect.left, rect.bottom, colorLeftTop); // left line
_engine->_interface->drawLine(rect.right, rect.top + 1, rect.right, rect.bottom, colorRightBottom); // right line
_engine->_interface->drawLine(rect.left + 1, rect.bottom, rect.right, rect.bottom, colorRightBottom); // bottom line
}
-void Menu::drawBox(int32 left, int32 top, int32 right, int32 bottom, int32 colorLeftTop, int32 colorRightBottom) {
- drawBox(Common::Rect(left, top, right, bottom), colorLeftTop, colorLeftTop);
+void Menu::drawRectBorders(int32 left, int32 top, int32 right, int32 bottom, int32 colorLeftTop, int32 colorRightBottom) {
+ drawRectBorders(Common::Rect(left, top, right, bottom), colorLeftTop, colorLeftTop);
}
void Menu::drawButtonGfx(const MenuSettings *menuSettings, const Common::Rect &rect, int32 buttonId, const char *dialText, bool hover) {
@@ -292,7 +292,7 @@ void Menu::drawButtonGfx(const MenuSettings *menuSettings, const Common::Rect &r
_engine->_interface->drawTransparentBox(rect, 4);
}
- drawBox(rect);
+ drawRectBorders(rect);
_engine->_text->setFontColor(COLOR_WHITE);
_engine->_text->setFontParameters(2, 8);
@@ -837,7 +837,7 @@ void Menu::drawHealthBar(int32 left, int32 right, int32 top, int32 barLeftPaddin
const int32 healthBarRight = _engine->_screens->crossDot(barLeft, right, 50, _engine->_scene->_sceneHero->_life);
const int32 barBottom = top + barHeight;
_engine->_interface->drawFilledRect(Common::Rect(barLeft, top, healthBarRight, barBottom), COLOR_91);
- drawBox(Common::Rect(barLeft, top, right, barBottom));
+ drawRectBorders(Common::Rect(barLeft, top, right, barBottom));
}
void Menu::drawCloverLeafs(int32 newBoxLeft, int32 boxRight, int32 top) {
@@ -870,7 +870,7 @@ void Menu::drawMagicPointsBar(int32 left, int32 right, int32 top, int32 barLeftP
const int32 barRight = _engine->_screens->crossDot(barLeft, right, 80, _engine->_gameState->_inventoryMagicPoints);
const Common::Rect pointsRect(barLeft, top, barRight, barBottom);
_engine->_interface->drawFilledRect(pointsRect, COLOR_75);
- drawBox(barLeft, top, barLeft + _engine->_gameState->_magicLevelIdx * 80, barBottom);
+ drawRectBorders(barLeft, top, barLeft + _engine->_gameState->_magicLevelIdx * 80, barBottom);
}
void Menu::drawSpriteAndString(int32 left, int32 top, const SpriteData &spriteData, const Common::String &str, int32 color) {
@@ -893,7 +893,7 @@ void Menu::drawInfoMenu(int16 left, int16 top, int16 width) {
_engine->_interface->resetClip();
const int16 height = 80;
const Common::Rect rect(left, top, left + width, top + height);
- drawBox(rect);
+ drawRectBorders(rect);
Common::Rect filledRect(rect);
filledRect.grow(-1);
_engine->_interface->drawFilledRect(filledRect, COLOR_BLACK);
@@ -951,7 +951,7 @@ void Menu::drawBehaviour(int32 left, int32 top, HeroBehaviourType behaviour, int
if (!cantDrawBox) {
Common::Rect boxRectCopy(boxRect);
boxRectCopy.grow(1);
- drawBox(boxRectCopy);
+ drawRectBorders(boxRectCopy);
}
_engine->_interface->saveClip();
@@ -972,7 +972,7 @@ void Menu::drawBehaviour(int32 left, int32 top, HeroBehaviourType behaviour, int
// behaviour menu title
const Common::Rect titleRect(titleBoxLeft, titleBoxTop, titleBoxRight, titleBoxBottom);
_engine->_interface->drawFilledRect(titleRect, COLOR_BLACK);
- drawBox(titleRect);
+ drawRectBorders(titleRect);
_engine->_text->setFontColor(COLOR_WHITE);
@@ -1002,7 +1002,7 @@ void Menu::drawBehaviourMenu(int32 left, int32 top, int32 angle) {
const int32 bottom = top + height;
const Common::Rect titleRect(left, top, right, bottom);
- drawBox(titleRect);
+ drawRectBorders(titleRect);
Common::Rect boxRect(titleRect);
boxRect.grow(-1);
@@ -1134,13 +1134,13 @@ void Menu::drawItem(int32 left, int32 top, int32 item) {
}
}
- drawBox(rect);
+ drawRectBorders(rect);
}
void Menu::drawInventoryItems(int32 left, int32 top) {
const Common::Rect rect(left, top, left + 605, top + 310);
_engine->_interface->drawTransparentBox(rect, 4);
- drawBox(rect);
+ drawRectBorders(rect);
for (int32 item = 0; item < NUM_INVENTORY_ITEMS; item++) {
drawItem(left, top, item);
diff --git a/engines/twine/menu/menu.h b/engines/twine/menu/menu.h
index 5cb15af785..29736aa6f9 100644
--- a/engines/twine/menu/menu.h
+++ b/engines/twine/menu/menu.h
@@ -210,14 +210,14 @@ public:
void drawKeys(int32 left, int32 top);
/**
- * Draw the entire button box
+ * Draw the rect lines without filling the area
* @param left start width to draw the button
* @param top start height to draw the button
* @param right end width to draw the button
* @param bottom end height to draw the button
*/
- void drawBox(int32 left, int32 top, int32 right, int32 bottom, int32 colorLeftTop = COLOR_79, int32 colorRightBottom = COLOR_73);
- void drawBox(const Common::Rect &rect, int32 colorLeftTop = COLOR_79, int32 colorRightBottom = COLOR_73);
+ void drawRectBorders(int32 left, int32 top, int32 right, int32 bottom, int32 colorLeftTop = COLOR_79, int32 colorRightBottom = COLOR_73);
+ void drawRectBorders(const Common::Rect &rect, int32 colorLeftTop = COLOR_79, int32 colorRightBottom = COLOR_73);
/**
* Where the main menu options are processed
* @param menuSettings menu settings array with the information to build the menu options
diff --git a/engines/twine/menu/menuoptions.cpp b/engines/twine/menu/menuoptions.cpp
index 0ecb727a2e..3680c70f77 100644
--- a/engines/twine/menu/menuoptions.cpp
+++ b/engines/twine/menu/menuoptions.cpp
@@ -153,7 +153,7 @@ void MenuOptions::drawSelectableCharacter(int32 x, int32 y) {
_engine->_interface->drawTransparentBox(rect, 4);
}
- _engine->_menu->drawBox(rect);
+ _engine->_menu->drawRectBorders(rect);
_engine->_text->setFontColor(COLOR_WHITE);
const uint8 character = (uint8)allowedCharIndex[idx];
@@ -207,7 +207,7 @@ void MenuOptions::drawInputText(int32 centerx, int32 top, int32 type, const char
Common::Rect rectBox(rect);
rectBox.grow(-1);
- _engine->_menu->drawBox(rect);
+ _engine->_menu->drawRectBorders(rect);
_engine->_interface->drawTransparentBox(rectBox, 3);
_engine->_text->drawText(centerx - _engine->_text->getTextSize(text) / 2, top + 6, text);
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index d754e1b739..d9db0a287d 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -468,7 +468,7 @@ void Redraw::processDrawListExtras(const DrawListStruct &drawCmd) {
addRedrawArea(_engine->_interface->_clip);
// show clipping area
- //drawBox(renderRect);
+ //drawRectBorders(renderRect);
}
}
@@ -607,7 +607,7 @@ void Redraw::renderOverlays() {
const BodyData &bodyPtr = _engine->_resources->_inventoryTable[item];
_overlayRotation += 1; // overlayRotation += 8;
_engine->_renderer->renderInventoryItem(40, 40, bodyPtr, _overlayRotation, 16000);
- _engine->_menu->drawBox(rect);
+ _engine->_menu->drawRectBorders(rect);
addRedrawArea(rect);
_engine->_gameState->initEngineProjections();
break;
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index e9ea1b3fff..47bb9559eb 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -379,7 +379,7 @@ void GameState::processFoundItem(InventoryItems item) {
_engine->_renderer->renderInventoryItem(_engine->_renderer->_projPos.x, _engine->_renderer->_projPos.y, _engine->_resources->_inventoryTable[item], itemAngle, 10000);
- _engine->_menu->drawBox(boxRect);
+ _engine->_menu->drawRectBorders(boxRect);
_engine->_redraw->addRedrawArea(boxRect);
_engine->_interface->resetClip();
initEngineProjections();
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index dded4b5786..cd76698225 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -275,7 +275,7 @@ void Text::initDialogueBox() {
_engine->blitWorkToFront(_dialTextBox);
if (_drawTextBoxBackground) {
- _engine->_menu->drawBox(_dialTextBox);
+ _engine->_menu->drawRectBorders(_dialTextBox);
Common::Rect rect(_dialTextBox);
rect.grow(-1);
_engine->_interface->drawTransparentBox(rect, 3);
Commit: e0f26fe06e1d631f30aad1b4a90d308fa5e56483
https://github.com/scummvm/scummvm/commit/e0f26fe06e1d631f30aad1b4a90d308fa5e56483
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-31T21:38:12+02:00
Commit Message:
TWINE: removed unused copyBlockPhys calls
... for areas that are already marked as dirty in the managed surface class
Changed paths:
engines/twine/debugger/debug.cpp
engines/twine/holomap.cpp
engines/twine/menu/menu.cpp
engines/twine/script/script_life_v1.cpp
diff --git a/engines/twine/debugger/debug.cpp b/engines/twine/debugger/debug.cpp
index 45f5668d96..9fae6d761b 100644
--- a/engines/twine/debugger/debug.cpp
+++ b/engines/twine/debugger/debug.cpp
@@ -78,8 +78,6 @@ void Debug::debugDrawWindow(int32 w) {
}
}
- _engine->copyBlockPhys(rect);
-
debugDrawWindowButtons(w);
}
diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index 5de944705b..98e27ad56c 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -584,7 +584,6 @@ void Holomap::processHolomap() {
if (rotate) {
_engine->_menu->drawRectBorders(300, 170, 340, 210);
}
- _engine->copyBlockPhys(rect);
}
if (rotate && xRot == _locations[currentLocation].angle.x && yRot == _locations[currentLocation].angle.y) {
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index f0f7ac2cb7..fa4c40d853 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -298,8 +298,6 @@ void Menu::drawButtonGfx(const MenuSettings *menuSettings, const Common::Rect &r
_engine->_text->setFontParameters(2, 8);
const int32 textSize = _engine->_text->getTextSize(dialText);
_engine->_text->drawText((_engine->width() / 2) - (textSize / 2), rect.top + 7, dialText);
-
- _engine->copyBlockPhys(rect);
}
int16 Menu::drawButtons(MenuSettings *menuSettings, bool hover) {
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index fe5e685992..0ecb180ccc 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -1736,7 +1736,6 @@ static int32 lCLEAR_TEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
lTextYPos = 0;
const Common::Rect rect(0, 0, engine->width() - 1, engine->height() / 2);
engine->_interface->drawFilledRect(rect, COLOR_BLACK);
- engine->copyBlockPhys(rect);
return 0;
}
Commit: a7f5a568475e8866d0e43a31115b5a2597ced02a
https://github.com/scummvm/scummvm/commit/a7f5a568475e8866d0e43a31115b5a2597ced02a
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-31T21:38:12+02:00
Commit Message:
TWINE: added todo comment
Changed paths:
engines/twine/text.cpp
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index cd76698225..ae79824cf9 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -286,6 +286,7 @@ void Text::initDialogueBox() {
_engine->blitFrontToWork(_dialTextBox);
}
+// TODO: this blits a few pixels too much when switching an item in the inventory menu.
void Text::initInventoryDialogueBox() {
_engine->blitWorkToFront(_dialTextBox);
_engine->copyBlockPhys(_dialTextBox);
Commit: 1c4694e7b61bc4bfeb79a3d375d1d1b23bfba6df
https://github.com/scummvm/scummvm/commit/1c4694e7b61bc4bfeb79a3d375d1d1b23bfba6df
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-31T21:38:12+02:00
Commit Message:
TWINE: when blitting the back to the front buffer also mark the area as dirty
Changed paths:
engines/twine/scene/gamestate.cpp
engines/twine/text.cpp
engines/twine/twine.cpp
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index 47bb9559eb..33e772d9a4 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -511,7 +511,6 @@ void GameState::processGameoverAnimation() {
_engine->blitWorkToFront(rect);
_engine->_renderer->setCameraAngle(0, 0, 0, 0, -cdot, 0, avg);
_engine->_renderer->renderIsoModel(0, 0, 0, ANGLE_0, ANGLE_0, ANGLE_0, gameOverPtr, dummy);
- _engine->copyBlockPhys(rect);
_engine->_lbaTime++;
}
@@ -520,7 +519,6 @@ void GameState::processGameoverAnimation() {
_engine->blitWorkToFront(rect);
_engine->_renderer->setCameraAngle(0, 0, 0, 0, 0, 0, 3200);
_engine->_renderer->renderIsoModel(0, 0, 0, ANGLE_0, ANGLE_0, ANGLE_0, gameOverPtr, dummy);
- _engine->copyBlockPhys(rect);
_engine->delaySkip(2000);
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index ae79824cf9..26c1a79629 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -281,7 +281,6 @@ void Text::initDialogueBox() {
_engine->_interface->drawTransparentBox(rect, 3);
}
- _engine->copyBlockPhys(_dialTextBox);
_fadeInCharactersPos = 0;
_engine->blitFrontToWork(_dialTextBox);
}
@@ -289,7 +288,6 @@ void Text::initDialogueBox() {
// TODO: this blits a few pixels too much when switching an item in the inventory menu.
void Text::initInventoryDialogueBox() {
_engine->blitWorkToFront(_dialTextBox);
- _engine->copyBlockPhys(_dialTextBox);
_fadeInCharactersPos = 0;
}
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index c63c5fd113..ddee4a7c59 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -1047,7 +1047,7 @@ bool TwinEEngine::delaySkip(uint32 time) {
return true;
}
stopTicks = _system->getMillis() - startTicks;
- //lbaTime++;
+ //_lbaTime++;
} while (stopTicks <= time);
return false;
}
@@ -1062,6 +1062,7 @@ void TwinEEngine::restoreFrontBuffer() {
void TwinEEngine::blitWorkToFront(const Common::Rect &rect) {
_interface->blitBox(rect, _workVideoBuffer, _frontVideoBuffer);
+ copyBlockPhys(rect);
}
void TwinEEngine::blitFrontToWork(const Common::Rect &rect) {
Commit: 63d225854f1dc3660016d7e3eeb4985f512939fe
https://github.com/scummvm/scummvm/commit/63d225854f1dc3660016d7e3eeb4985f512939fe
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-31T21:38:12+02:00
Commit Message:
TWINE: fixed lBUBBLE_OFF
verified against disassembly
Changed paths:
engines/twine/script/script_life_v1.cpp
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 0ecb180ccc..0aa3ca8c66 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -1521,7 +1521,7 @@ static int32 lBUBBLE_ON(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x5A
*/
static int32 lBUBBLE_OFF(TwinEEngine *engine, LifeScriptContext &ctx) {
- engine->_text->_showDialogueBubble = true; // TODO: this looks wrong - why true and not false?
+ engine->_text->_showDialogueBubble = false;
return 0;
}
Commit: e68ca7630dfec195d2234274f126ca40034904c6
https://github.com/scummvm/scummvm/commit/e68ca7630dfec195d2234274f126ca40034904c6
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-31T21:42:15+02:00
Commit Message:
TWINE: exit the scenery view in lASK_CHOICE_OBJ
found in disassembly
Changed paths:
engines/twine/script/script_life_v1.cpp
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 0aa3ca8c66..97e87a7975 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -1533,14 +1533,14 @@ static int32 lASK_CHOICE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 otherActorIdx = ctx.stream.readByte();
const TextId choiceIdx = (TextId)ctx.stream.readSint16LE();
- engine->freezeTime();
+ ScopedEngineFreeze freeze(engine);
+ engine->exitSceneryView();
if (engine->_text->_showDialogueBubble) {
engine->_redraw->drawBubble(otherActorIdx);
}
engine->_text->setFontCrossColor(engine->_scene->getActor(otherActorIdx)->_talkColor);
engine->_gameState->processGameChoices(choiceIdx);
engine->_gameState->_numChoices = 0;
- engine->unfreezeTime();
engine->_redraw->redrawEngineActions(true);
return 0;
More information about the Scummvm-git-logs
mailing list