AGI: Cleanup

This commit is contained in:
Martin Kiewitz 2016-02-10 19:54:03 +01:00
parent b443ac7b95
commit ccf328d725
5 changed files with 8 additions and 9 deletions

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -957,7 +957,7 @@ void MickeyEngine::drawLogo() {
}
}
_gfx->copyDisplayRectToScreen(0, 0, DISPLAY_WIDTH, height);
_gfx->copyDisplayToScreen();
delete[] fileBuffer;
}

View File

@ -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();