[Scummvm-git-logs] scummvm master -> b2878dea3b017434e25b108dd6ce4e7ef5c4a7b4
mgerhardy
martin.gerhardy at gmail.com
Sun Jul 11 11:58:05 UTC 2021
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f9c4511308 TWINE: hide access to front buffer screen
6d0acfee99 TWINE: use drawFilledRect in debug interface
0af2f1907a TWINE: fixed gif 'animation' in high res mode
b2878dea3b GRAPHICS: removed invalid char from comment
Commit: f9c45113088e5e78f6d68f308e9061d886f0aa24
https://github.com/scummvm/scummvm/commit/f9c45113088e5e78f6d68f308e9061d886f0aa24
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-11T13:44:12+02:00
Commit Message:
TWINE: hide access to front buffer screen
Changed paths:
engines/twine/debugger/debug.cpp
engines/twine/flamovies.cpp
engines/twine/holomap.cpp
engines/twine/menu/interface.cpp
engines/twine/menu/menu.cpp
engines/twine/menu/menuoptions.cpp
engines/twine/renderer/redraw.cpp
engines/twine/renderer/screens.cpp
engines/twine/scene/extra.cpp
engines/twine/scene/gamestate.cpp
engines/twine/scene/grid.cpp
engines/twine/text.cpp
engines/twine/twine.cpp
engines/twine/twine.h
diff --git a/engines/twine/debugger/debug.cpp b/engines/twine/debugger/debug.cpp
index 542abcd92d..d3a8af7b2e 100644
--- a/engines/twine/debugger/debug.cpp
+++ b/engines/twine/debugger/debug.cpp
@@ -194,7 +194,7 @@ void Debug::debugResetButton(int32 type) {
void Debug::debugRedrawScreen() {
_engine->_redraw->redrawEngineActions(true);
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
debugDrawWindows();
}
@@ -421,7 +421,7 @@ void Debug::debugProcessWindow() {
int32 count = 0;
ScopedCursor cursor(_engine);
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
debugResetButtonsState();
if (numDebugWindows == 0) {
@@ -441,7 +441,7 @@ void Debug::debugProcessWindow() {
int type = 0;
if ((type = debugProcessButton(point.x, point.y)) != NO_ACTION) { // process menu item
if (debugTypeUseMenu(type)) {
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
_engine->copyBlockPhys(205, 55, 634, 474);
}
diff --git a/engines/twine/flamovies.cpp b/engines/twine/flamovies.cpp
index d82c92eecf..9ab16b6961 100644
--- a/engines/twine/flamovies.cpp
+++ b/engines/twine/flamovies.cpp
@@ -27,6 +27,7 @@
#include "twine/audio/music.h"
#include "twine/audio/sound.h"
#include "twine/input.h"
+#include "twine/menu/interface.h"
#include "twine/renderer/screens.h"
#include "twine/resources/hqr.h"
#include "twine/resources/resources.h"
@@ -238,24 +239,21 @@ void FlaMovies::processFrame() {
break;
}
case kFlaUnknown7: {
- byte *ptr = (byte *)_engine->frontVideoBuffer.getPixels();
- for (int y = 0; y < 200; ++y) {
- for (int x = 0; x < 80; ++x) {
- *ptr++ = 0;
- }
- ptr = ptr + 80;
- }
+ const Common::Rect rect(0, 0, 79, 199);
+ _engine->_interface->drawFilledRect(rect, 0);
break;
}
case kFlaUnknown9:
case kFlaUnknown16SameAs9: {
+ const Common::Rect rect(0, 0, 80, 200);
byte *ptr = (byte *)_engine->frontVideoBuffer.getPixels();
- for (int y = 0; y < 200; ++y) {
- for (int x = 0; x < 80; ++x) {
+ for (int y = rect.top; y < rect.bottom; ++y) {
+ for (int x = rect.left; x < rect.right; ++x) {
*ptr++ = stream.readByte();
}
- ptr = ptr + 80;
+ ptr = ptr + rect.width();
}
+ _engine->frontVideoBuffer.addDirtyRect(rect);
break;
}
case kFlaUnknown4:
@@ -425,7 +423,7 @@ void FlaMovies::playFlaMovie(const char *flaName) {
}
if (_engine->cfgfile.CrossFade) {
- _engine->crossFade(_engine->frontVideoBuffer, _engine->_screens->paletteRGBACustom);
+ _engine->crossFade(_engine->_screens->paletteRGBACustom);
} else {
_engine->_screens->fadeToBlack(_engine->_screens->paletteRGBACustom);
}
diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index 9d78585ef4..9d1f31920c 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -585,7 +585,7 @@ void Holomap::processHolomap() {
// TODO: text afterwards on top (not before as it is currently implemented)?
// pos 0x140,0x19?
- //_engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ //_engine->restoreFrontBuffer();
if (fadeInPalette) {
fadeInPalette = false;
// TODO: this does a flip - which puts stuff onto the screen that shouldn't be there
diff --git a/engines/twine/menu/interface.cpp b/engines/twine/menu/interface.cpp
index 89124a4a0b..c613d3076f 100644
--- a/engines/twine/menu/interface.cpp
+++ b/engines/twine/menu/interface.cpp
@@ -174,6 +174,9 @@ void Interface::drawTransparentBox(const Common::Rect &rect, int32 colorAdj) {
}
void Interface::drawFilledRect(const Common::Rect &rect, uint8 colorIndex) {
+ if (rect.isValidRect()) {
+ return;
+ }
_engine->frontVideoBuffer.fillRect(Common::Rect(rect.left, rect.top, rect.right + 1, rect.bottom + 1), colorIndex);
}
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 6761c1d37f..791c894781 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -288,7 +288,7 @@ void Menu::drawButtonGfx(const MenuSettings *menuSettings, const Common::Rect &r
}
}
} else {
- _engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->blitWorkToFront(rect);
_engine->_interface->drawTransparentBox(rect, 4);
}
@@ -412,7 +412,7 @@ int32 Menu::processMenu(MenuSettings *menuSettings, bool showCredits) {
// if we are running the game already, the buttons are just rendered on top of the scene
if (_engine->_scene->isGameRunning()) {
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
} else {
_engine->_screens->loadMenuImage(false);
}
@@ -611,7 +611,7 @@ int32 Menu::processMenu(MenuSettings *menuSettings, bool showCredits) {
}
int32 Menu::advoptionsMenu() {
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
ScopedCursor scoped(_engine);
for (;;) {
@@ -635,7 +635,7 @@ int32 Menu::advoptionsMenu() {
}
int32 Menu::savemanageMenu() {
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
ScopedCursor scoped(_engine);
for (;;) {
@@ -660,7 +660,7 @@ int32 Menu::savemanageMenu() {
}
int32 Menu::volumeMenu() {
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
ScopedCursor scoped(_engine);
for (;;) {
@@ -685,14 +685,14 @@ int32 Menu::volumeMenu() {
void Menu::inGameOptionsMenu() {
_engine->_text->initTextBank(TextBankId::Options_and_menus);
optionsMenuState.setButtonTextId(0, TextId::kReturnGame);
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
optionsMenu();
_engine->_text->initSceneTextBank();
optionsMenuState.setButtonTextId(0, TextId::kReturnMenu);
}
int32 Menu::optionsMenu() {
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
_engine->_sound->stopSamples();
_engine->_music->playTrackMusic(9); // LBA's Theme
@@ -793,7 +793,7 @@ EngineState Menu::run() {
}
int32 Menu::giveupMenu() {
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
_engine->_sound->pauseSamples();
MenuSettings *localMenu;
@@ -1042,7 +1042,7 @@ void Menu::processBehaviourMenu() {
_engine->_movements->setActorAngleSafe(_engine->_scene->sceneHero->angle, _engine->_scene->sceneHero->angle - ANGLE_90, ANGLE_17, &moveMenu);
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
TextBankId tmpTextBank = _engine->_scene->sceneTextBank;
_engine->_scene->sceneTextBank = TextBankId::None;
@@ -1174,7 +1174,7 @@ void Menu::processInventoryMenu() {
int32 tmpAlphaLight = _engine->_scene->alphaLight;
int32 tmpBetaLight = _engine->_scene->betaLight;
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
_engine->_renderer->setLightVector(ANGLE_315, ANGLE_334, ANGLE_0);
diff --git a/engines/twine/menu/menuoptions.cpp b/engines/twine/menu/menuoptions.cpp
index 4eddfb7f40..04f2b31978 100644
--- a/engines/twine/menu/menuoptions.cpp
+++ b/engines/twine/menu/menuoptions.cpp
@@ -149,7 +149,7 @@ void MenuOptions::drawSelectableCharacter(int32 x, int32 y, Common::Rect &dirtyR
if (selected) {
_engine->_interface->drawFilledRect(rect, COLOR_91);
} else {
- _engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->blitWorkToFront(rect);
_engine->_interface->drawTransparentBox(rect, 4);
}
@@ -348,7 +348,7 @@ bool MenuOptions::enterText(TextId textIdx, char *textTargetBuf, size_t bufSize)
}
bool MenuOptions::newGameMenu() {
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
if (!enterText(TextId::kEnterYourName, saveGameName, sizeof(saveGameName))) {
return false;
}
@@ -400,7 +400,7 @@ int MenuOptions::chooseSave(TextId textIdx, bool showEmptySlots) {
}
bool MenuOptions::continueGameMenu() {
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
const int slot = chooseSave(TextId::kContinueGame);
if (slot >= 0) {
debug("Load slot %i", slot);
@@ -416,7 +416,7 @@ bool MenuOptions::continueGameMenu() {
}
bool MenuOptions::deleteSaveMenu() {
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
const int slot = chooseSave(TextId::kDeleteSaveGame);
if (slot >= 0) {
_engine->wipeSaveSlot(slot);
@@ -426,7 +426,7 @@ bool MenuOptions::deleteSaveMenu() {
}
bool MenuOptions::saveGameMenu() {
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
const int slot = chooseSave(TextId::kCreateSaveGame, true);
if (slot >= 0) {
// TODO: enter description
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index 46a308545f..bbf55e2ce0 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -140,7 +140,7 @@ void Redraw::flipRedrawAreas() {
void Redraw::blitBackgroundAreas() {
for (int32 i = 0; i < numOfRedrawBox; i++) {
- _engine->_interface->blitBox(_currentRedrawList[i], _engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->blitWorkToFront(_currentRedrawList[i]);
}
}
@@ -389,7 +389,7 @@ void Redraw::processDrawListActors(const DrawListStruct &drawCmd, bool bgRedraw)
addRedrawArea(_engine->_interface->textWindow);
if (actor->staticFlags.bIsBackgrounded && bgRedraw) {
- _engine->_interface->blitBox(_engine->_interface->textWindow, _engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->blitFrontToWork(_engine->_interface->textWindow);
}
_engine->_debugScene->drawClip(renderRect);
@@ -447,7 +447,7 @@ void Redraw::processDrawListActorSprites(const DrawListStruct &drawCmd, bool bgR
addRedrawArea(_engine->_interface->textWindow);
if (actor->staticFlags.bIsBackgrounded && bgRedraw) {
- _engine->_interface->blitBox(_engine->_interface->textWindow, _engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->blitFrontToWork(_engine->_interface->textWindow);
}
_engine->_debugScene->drawClip(renderRect);
@@ -685,7 +685,7 @@ void Redraw::redrawEngineActions(bool bgRedraw) {
_engine->_screens->clearScreen();
_engine->_grid->redrawGrid();
updateOverlayTypePosition(tmp_projPosX, tmp_projPosY, _engine->_renderer->projPosScreen.x, _engine->_renderer->projPosScreen.y);
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
if (_engine->_scene->needChangeScene != -1 && _engine->_scene->needChangeScene != -2) {
_engine->_screens->fadeIn(_engine->_screens->paletteRGBA);
@@ -712,7 +712,7 @@ void Redraw::redrawEngineActions(bool bgRedraw) {
// make celling grid fade
// need to be here to fade after drawing all actors in scene
if (_engine->_scene->needChangeScene == -2) {
- _engine->crossFade(_engine->frontVideoBuffer, _engine->_screens->paletteRGBA);
+ _engine->crossFade(_engine->_screens->paletteRGBA);
_engine->_scene->needChangeScene = -1;
}
diff --git a/engines/twine/renderer/screens.cpp b/engines/twine/renderer/screens.cpp
index 34cf400ce9..af0f1dfe27 100644
--- a/engines/twine/renderer/screens.cpp
+++ b/engines/twine/renderer/screens.cpp
@@ -95,7 +95,7 @@ bool Screens::loadImageDelay(int32 index, int32 paletteIndex, int32 seconds) {
void Screens::fadeIn(const uint32 *pal) {
if (_engine->cfgfile.CrossFade) {
- _engine->crossFade(_engine->frontVideoBuffer, pal);
+ _engine->crossFade(pal);
} else {
fadeToPal(pal);
}
diff --git a/engines/twine/scene/extra.cpp b/engines/twine/scene/extra.cpp
index 9d6219c3a3..91e379d24b 100644
--- a/engines/twine/scene/extra.cpp
+++ b/engines/twine/scene/extra.cpp
@@ -304,7 +304,6 @@ int32 Extra::addExtraAiming(int32 actorIdx, int32 x, int32 y, int32 z, int32 spr
return -1;
}
-// cseg01:00018168
int32 Extra::findExtraKey() const {
for (int32 i = 0; i < EXTRA_MAX_ENTRIES; i++) {
const ExtraListStruct *extra = &extraList[i];
@@ -316,8 +315,7 @@ int32 Extra::findExtraKey() const {
return -1;
}
-// cseg01:00018250
-int32 Extra::addExtraAimingAtKey(int32 actorIdx, int32 x, int32 y, int32 z, int32 spriteIdx, int32 extraIdx) { // addMagicBallAimingAtKey
+int32 Extra::addExtraAimingAtKey(int32 actorIdx, int32 x, int32 y, int32 z, int32 spriteIdx, int32 extraIdx) {
for (int32 i = 0; i < EXTRA_MAX_ENTRIES; i++) {
ExtraListStruct *extra = &extraList[i];
if (extra->info0 != -1) {
@@ -341,7 +339,7 @@ int32 Extra::addExtraAimingAtKey(int32 actorIdx, int32 x, int32 y, int32 z, int3
return -1;
}
-void Extra::addExtraThrowMagicball(int32 x, int32 y, int32 z, int32 xAngle, int32 yAngle, int32 xRotPoint, int32 extraAngle) { // ThrowMagicBall
+void Extra::addExtraThrowMagicball(int32 x, int32 y, int32 z, int32 xAngle, int32 yAngle, int32 xRotPoint, int32 extraAngle) {
int32 ballSprite = -1;
int32 ballStrength = 0;
int32 extraIdx = -1;
@@ -549,7 +547,7 @@ void Extra::processExtras() {
continue;
}
const int32 deltaT = _engine->lbaTime - extra->spawnTime;
- //
+
if (extra->type & ExtraType::EXPLOSION) {
extra->info0 = _engine->_collision->getAverageValue(SPRITEHQR_EXPLOSION_FIRST_FRAME, 100, 30, deltaT);
continue;
@@ -594,7 +592,7 @@ void Extra::processExtras() {
continue;
}
}
- //
+
if (extra->type & ExtraType::BONUS) {
if (_engine->lbaTime - extra->spawnTime > 40) {
extra->type &= ~ExtraType::BONUS;
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index f016929ae3..08ef0051c5 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -312,7 +312,7 @@ void GameState::processFoundItem(InventoryItems item) {
_engine->_redraw->redrawEngineActions(true);
_engine->_scene->sceneHero->staticFlags.bIsHidden = 0;
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
const int32 itemCameraX = _engine->_grid->newCamera.x * BRICK_SIZE;
const int32 itemCameraY = _engine->_grid->newCamera.y * BRICK_HEIGHT;
@@ -444,7 +444,7 @@ void GameState::processFoundItem(InventoryItems item) {
}
void GameState::processGameChoices(TextId choiceIdx) {
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
_gameChoicesSettings.reset();
_gameChoicesSettings.setTextBankId((TextBankId)((int)_engine->_scene->sceneTextBank + (int)TextBankId::Citadel_Island));
@@ -486,7 +486,7 @@ void GameState::processGameoverAnimation() {
// TODO: inSceneryView
_engine->setPalette(_engine->_screens->paletteRGBA);
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
BodyData gameOverPtr;
if (!gameOverPtr.loadFromHQR(Resources::HQR_RESS_FILE, RESSHQR_GAMEOVERMDL)) {
return;
@@ -509,7 +509,7 @@ void GameState::processGameoverAnimation() {
const int32 avg = _engine->_collision->getAverageValue(40000, 3200, 500, _engine->lbaTime - startLbaTime);
const int32 cdot = _engine->_screens->crossDot(1, 1024, 100, (_engine->lbaTime - startLbaTime) % 100);
- _engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _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);
_engine->copyBlockPhys(rect);
@@ -518,7 +518,7 @@ void GameState::processGameoverAnimation() {
}
_engine->_sound->playSample(Samples::Explode);
- _engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _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);
_engine->copyBlockPhys(rect);
@@ -526,7 +526,7 @@ void GameState::processGameoverAnimation() {
_engine->delaySkip(2000);
_engine->_interface->resetClip();
- _engine->_screens->copyScreen(_engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->restoreFrontBuffer();
initEngineProjections();
_engine->lbaTime = tmpLbaTime;
diff --git a/engines/twine/scene/grid.cpp b/engines/twine/scene/grid.cpp
index fba05918c5..bdbae97d64 100644
--- a/engines/twine/scene/grid.cpp
+++ b/engines/twine/scene/grid.cpp
@@ -123,23 +123,23 @@ void Grid::copyGridMask(int32 index, int32 x, int32 y, const Graphics::ManagedSu
const uint8 *inPtr = (const uint8 *)buffer.getBasePtr(left, absY);
do {
- int32 vc3 = *(ptr++);
+ int32 height = *(ptr++);
do {
- int32 temp = *(ptr++); // skip size
- outPtr += temp;
- inPtr += temp;
+ int32 width = *(ptr++); // skip size
+ outPtr += width;
+ inPtr += width;
- absX += temp;
+ absX += width;
- vc3--;
- if (!vc3) {
+ height--;
+ if (!height) {
break;
}
- temp = *(ptr++); // copy size
+ width = *(ptr++); // copy size
- for (int32 j = 0; j < temp; j++) {
+ for (int32 j = 0; j < width; j++) {
if (absX >= _engine->_interface->textWindow.left && absX <= _engine->_interface->textWindow.right) {
*outPtr = *inPtr;
}
@@ -148,7 +148,7 @@ void Grid::copyGridMask(int32 index, int32 x, int32 y, const Graphics::ManagedSu
outPtr++;
inPtr++;
}
- } while (--vc3);
+ } while (--height);
absX = left;
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 2e06d7a517..3fd8a6c3aa 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -272,7 +272,7 @@ int32 Text::getTextSize(const char *dialogue) {
}
void Text::initDialogueBox() {
- _engine->_interface->blitBox(_dialTextBox, _engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->blitWorkToFront(_dialTextBox);
if (drawTextBoxBackground) {
_engine->_menu->drawBox(_dialTextBox);
@@ -283,11 +283,11 @@ void Text::initDialogueBox() {
_engine->copyBlockPhys(_dialTextBox);
_fadeInCharactersPos = 0;
- _engine->_interface->blitBox(_dialTextBox, _engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->blitFrontToWork(_dialTextBox);
}
void Text::initInventoryDialogueBox() {
- _engine->_interface->blitBox(_dialTextBox, _engine->workVideoBuffer, _engine->frontVideoBuffer);
+ _engine->blitWorkToFront(_dialTextBox);
_engine->copyBlockPhys(_dialTextBox);
_fadeInCharactersPos = 0;
}
@@ -656,7 +656,7 @@ bool Text::drawTextProgressive(TextId index, bool playVox, bool loop) {
_engine->exitSceneryView();
_engine->_interface->saveClip();
_engine->_interface->resetClip();
- _engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
+ _engine->saveFrontBuffer();
const bool aborted = displayText(index, _engine->cfgfile.FlagDisplayText, playVox, loop);
_engine->_interface->loadClip();
return aborted;
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index abb88199ac..211193c47d 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -258,7 +258,7 @@ Common::Error TwinEEngine::run() {
initAll();
initEngine();
_sound->stopSamples();
- _screens->copyScreen(frontVideoBuffer, workVideoBuffer);
+ saveFrontBuffer();
_menu->init();
_holomap->loadLocations();
@@ -1057,6 +1057,22 @@ bool TwinEEngine::delaySkip(uint32 time) {
return false;
}
+void TwinEEngine::saveFrontBuffer() {
+ _screens->copyScreen(frontVideoBuffer, workVideoBuffer);
+}
+
+void TwinEEngine::restoreFrontBuffer() {
+ _screens->copyScreen(workVideoBuffer, frontVideoBuffer);
+}
+
+void TwinEEngine::blitWorkToFront(const Common::Rect &rect) {
+ _interface->blitBox(rect, workVideoBuffer, frontVideoBuffer);
+}
+
+void TwinEEngine::blitFrontToWork(const Common::Rect &rect) {
+ _interface->blitBox(rect, frontVideoBuffer, workVideoBuffer);
+}
+
void TwinEEngine::setPalette(const uint32 *palette) {
uint8 pal[NUMOFCOLORS * 3];
uint8 *out = pal;
@@ -1096,7 +1112,7 @@ void TwinEEngine::copyBlockPhys(int32 left, int32 top, int32 right, int32 bottom
frontVideoBuffer.addDirtyRect(Common::Rect(left, top, right, bottom));
}
-void TwinEEngine::crossFade(const Graphics::ManagedSurface &buffer, const uint32 *palette) {
+void TwinEEngine::crossFade(const uint32 *palette) {
Graphics::ManagedSurface backupSurface;
Graphics::ManagedSurface newSurface;
Graphics::ManagedSurface tempSurface;
diff --git a/engines/twine/twine.h b/engines/twine/twine.h
index fa16aaeffb..f763942bf7 100644
--- a/engines/twine/twine.h
+++ b/engines/twine/twine.h
@@ -304,6 +304,11 @@ public:
/** Main game video buffer */
TwineScreen frontVideoBuffer;
+ void blitWorkToFront(const Common::Rect &rect);
+ void blitFrontToWork(const Common::Rect &rect);
+ void restoreFrontBuffer();
+ void saveFrontBuffer();
+
int32 loopInventoryItem = 0;
int32 loopActorStep = 0;
@@ -352,10 +357,9 @@ public:
void copyBlockPhys(const Common::Rect &rect);
/** Cross fade feature
- * @param buffer screen buffer
* @param palette new palette to cross fade
*/
- void crossFade(const Graphics::ManagedSurface &buffer, const uint32 *palette);
+ void crossFade(const uint32 *palette);
/** Handle keyboard pressed keys */
void readKeys();
Commit: 6d0acfee990104ec0f7e33ea7ebc9055d07aeb88
https://github.com/scummvm/scummvm/commit/6d0acfee990104ec0f7e33ea7ebc9055d07aeb88
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-11T13:53:43+02:00
Commit Message:
TWINE: use drawFilledRect in debug interface
Changed paths:
engines/twine/debugger/debug.cpp
diff --git a/engines/twine/debugger/debug.cpp b/engines/twine/debugger/debug.cpp
index d3a8af7b2e..7f2c36daf8 100644
--- a/engines/twine/debugger/debug.cpp
+++ b/engines/twine/debugger/debug.cpp
@@ -36,15 +36,8 @@
namespace TwinE {
void Debug::debugFillButton(int32 x, int32 y, int32 width, int32 height, int8 color) {
- uint8 *ptr = (uint8 *)_engine->frontVideoBuffer.getBasePtr(x, y);
- const int32 offset = _engine->width() - width;
-
- for (int32 i = 0; i < height; i++) {
- for (int32 j = 0; j < width; j++) {
- *ptr++ = color;
- }
- ptr += offset;
- }
+ const Common::Rect rect(x, y, x + width, y + height);
+ _engine->_interface->drawFilledRect(rect, color);
}
void Debug::debugDrawButton(const Common::Rect &rect, const char *text, int32 textLeft, int32 textTop, int32 isActive, int8 color) {
Commit: 0af2f1907a851168db342a4be46b8e76785135cd
https://github.com/scummvm/scummvm/commit/0af2f1907a851168db342a4be46b8e76785135cd
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-11T13:54:17+02:00
Commit Message:
TWINE: fixed gif 'animation' in high res mode
the git surface wasn't scaled to the full screen
Changed paths:
engines/twine/flamovies.cpp
diff --git a/engines/twine/flamovies.cpp b/engines/twine/flamovies.cpp
index 9ab16b6961..ba3d18988c 100644
--- a/engines/twine/flamovies.cpp
+++ b/engines/twine/flamovies.cpp
@@ -23,6 +23,7 @@
#include "twine/flamovies.h"
#include "common/file.h"
#include "common/system.h"
+#include "graphics/managed_surface.h"
#include "image/gif.h"
#include "twine/audio/music.h"
#include "twine/audio/sound.h"
@@ -282,8 +283,9 @@ void FlaMovies::prepareGIF(int index) {
}
const Graphics::Surface *surface = decoder.getSurface();
_engine->setPalette(0, decoder.getPaletteColorCount(), decoder.getPalette());
- g_system->copyRectToScreen(surface->getPixels(), surface->pitch, 0, 0, surface->w, surface->h);
- g_system->updateScreen();
+ Graphics::ManagedSurface& target = _engine->frontVideoBuffer;
+ const Common::Rect surfaceBounds(0, 0, surface->w, surface->h);
+ target.transBlitFrom(surface, surfaceBounds, target.getBounds(), 0, false, 0, 0xff, nullptr, true);
debug(2, "Show gif with id %i from %s", index, Resources::HQR_FLAGIF_FILE);
delete stream;
_engine->delaySkip(5000);
Commit: b2878dea3b017434e25b108dd6ce4e7ef5c4a7b4
https://github.com/scummvm/scummvm/commit/b2878dea3b017434e25b108dd6ce4e7ef5c4a7b4
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-07-11T13:56:19+02:00
Commit Message:
GRAPHICS: removed invalid char from comment
Changed paths:
graphics/surface.h
diff --git a/graphics/surface.h b/graphics/surface.h
index 66dfa4eee5..514955cf8a 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -428,7 +428,7 @@ public:
* @param scale number of pixels per single character. Default is -1, fit whole surface to maxwidth
* @param maxwidth horizontal size of the print out in characters. Default is 160. Note that 2 characters
* are taken by the frame
- * @param palette Ëpalette to use for 1bpp pixels. If omitted, we assume grayscale palette
+ * @param palette palette to use for 1bpp pixels. If omitted, we assume grayscale palette
*
*/
void debugPrint(int debuglevel = 0, int width = 0, int height = 0, int x = 0, int y = 0, int scale = -1, int maxwidth = 160, const byte *palette = NULL) const;
More information about the Scummvm-git-logs
mailing list