[Scummvm-cvs-logs] scummvm master -> ccf328d725c4b4b0747c7af9b5d57c50dd4ba8d2

m-kiewitz m_kiewitz at users.sourceforge.net
Wed Feb 10 19:54:01 CET 2016


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:
ccf328d725 AGI: Cleanup


Commit: ccf328d725c4b4b0747c7af9b5d57c50dd4ba8d2
    https://github.com/scummvm/scummvm/commit/ccf328d725c4b4b0747c7af9b5d57c50dd4ba8d2
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-02-10T19:54:03+01:00

Commit Message:
AGI: Cleanup

Changed paths:
    engines/agi/graphics.cpp
    engines/agi/graphics.h
    engines/agi/preagi.cpp
    engines/agi/preagi_mickey.cpp
    engines/agi/saveload.cpp



diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 06f9285..af2e8ba 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 fb59662..f5a933b 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 104b442..cbd15f2 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 8b1ae81..620d5e0 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 1bf0dbc..a57465a 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();






More information about the Scummvm-git-logs mailing list