From ccf328d725c4b4b0747c7af9b5d57c50dd4ba8d2 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Wed, 10 Feb 2016 19:54:03 +0100 Subject: AGI: Cleanup --- engines/agi/graphics.cpp | 5 ++++- engines/agi/graphics.h | 6 +----- engines/agi/preagi.cpp | 2 +- engines/agi/preagi_mickey.cpp | 2 +- engines/agi/saveload.cpp | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) (limited to 'engines') diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index 06f9285bb3..af2e8ba499 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -539,6 +539,9 @@ void GfxMgr::block_restore(int16 x, int16 y, int16 width, int16 height, byte *bu void GfxMgr::copyDisplayRectToScreen(int16 x, int16 y, int16 width, int16 height) { g_system->copyRectToScreen(_displayScreen + y * DISPLAY_WIDTH + x, DISPLAY_WIDTH, x, y, width, height); } +void GfxMgr::copyDisplayToScreen() { + g_system->copyRectToScreen(_displayScreen, DISPLAY_WIDTH, 0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT); +} // coordinates are for visual screen, but are supposed to point somewhere inside the playscreen // attention: Clipping is done here against 160x200 instead of 160x168 @@ -741,7 +744,7 @@ void GfxMgr::shakeScreen(int16 repeatCount) { for (shakeNr = 0; shakeNr < shakeCount; shakeNr++) { if (shakeNr & 1) { // move back - copyDisplayRectToScreen(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT); + copyDisplayToScreen(); } else { g_system->copyRectToScreen(_displayScreen, DISPLAY_WIDTH, SHAKE_HORIZONTAL_PIXELS, SHAKE_VERTICAL_PIXELS, DISPLAY_WIDTH - SHAKE_HORIZONTAL_PIXELS, DISPLAY_HEIGHT - SHAKE_VERTICAL_PIXELS); // additionally fill the remaining space with black diff --git a/engines/agi/graphics.h b/engines/agi/graphics.h index fb596626c6..f5a933bf2b 100644 --- a/engines/agi/graphics.h +++ b/engines/agi/graphics.h @@ -32,11 +32,6 @@ namespace Agi { #define DISPLAY_WIDTH 320 #define DISPLAY_HEIGHT 200 -#define GFX_WIDTH 320 -#define GFX_HEIGHT 200 -#define CHAR_COLS 8 -#define CHAR_LINES 8 - class AgiEngine; enum GfxScreenMasks { @@ -128,6 +123,7 @@ public: void block_restore(int16 x, int16 y, int16 width, int16 height, byte *bufferPtr); void copyDisplayRectToScreen(int16 x, int16 y, int16 width, int16 height); + void copyDisplayToScreen(); void drawBox(int16 x, int16 y, int16 width, int16 height, byte backgroundColor, byte lineColor); void drawRect(int16 x, int16 y, int16 width, int16 height, byte color); diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp index 104b442f5d..cbd15f2666 100644 --- a/engines/agi/preagi.cpp +++ b/engines/agi/preagi.cpp @@ -112,7 +112,7 @@ void PreAgiEngine::clearScreen(int attr, bool overrideDefault) { } void PreAgiEngine::clearGfxScreen(int attr) { - _gfx->drawDisplayRect(0, 0, GFX_WIDTH - 1, IDI_MAX_ROW_PIC * 8 - 1, (attr & 0xF0) / 0x10); + _gfx->drawDisplayRect(0, 0, DISPLAY_WIDTH - 1, IDI_MAX_ROW_PIC * 8 - 1, (attr & 0xF0) / 0x10); } // String functions diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp index 8b1ae81b8e..620d5e0baf 100644 --- a/engines/agi/preagi_mickey.cpp +++ b/engines/agi/preagi_mickey.cpp @@ -957,7 +957,7 @@ void MickeyEngine::drawLogo() { } } - _gfx->copyDisplayRectToScreen(0, 0, DISPLAY_WIDTH, height); + _gfx->copyDisplayToScreen(); delete[] fileBuffer; } diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 1bf0dbcc02..a57465a61e 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -704,7 +704,7 @@ int AgiEngine::loadGame(const Common::String &fileName, bool checkId) { _text->promptRedraw(); // copy everything over (we should probably only copy over the remaining parts of the screen w/o play screen - _gfx->copyDisplayRectToScreen(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT); + _gfx->copyDisplayToScreen(); // Sync volume settings from ScummVM system settings, so that VM volume variable is overwritten setVolumeViaSystemSetting(); -- cgit v1.2.3