aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2016-01-29 15:43:45 +0100
committerMartin Kiewitz2016-01-29 15:43:45 +0100
commit0f15ec2ce827d157f4459b966088ec0792ff5be8 (patch)
treef18cbb1fc699ee074b0b3fddcc6e89eb3f947732
parent41620c95ccd771b78ead14bebaab0045079f95c4 (diff)
downloadscummvm-rg350-0f15ec2ce827d157f4459b966088ec0792ff5be8.tar.gz
scummvm-rg350-0f15ec2ce827d157f4459b966088ec0792ff5be8.tar.bz2
scummvm-rg350-0f15ec2ce827d157f4459b966088ec0792ff5be8.zip
AGI: use Common::RenderMode instead of its own
AppleIIgs + Atari ST weren't available back then in the enum. They now are, so I can use the Common one.
-rw-r--r--engines/agi/agi.cpp32
-rw-r--r--engines/agi/agi.h12
-rw-r--r--engines/agi/cycle.cpp15
-rw-r--r--engines/agi/graphics.cpp32
-rw-r--r--engines/agi/picture.cpp10
-rw-r--r--engines/agi/preagi_mickey.cpp2
-rw-r--r--engines/agi/text.cpp2
-rw-r--r--engines/agi/view.cpp2
8 files changed, 49 insertions, 58 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 23a6474ee8..9902d99d04 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -283,31 +283,31 @@ void AgiBase::initRenderMode() {
Common::RenderMode configRenderMode = Common::parseRenderMode(ConfMan.get("render_mode").c_str());
// Default to EGA PC rendering
- _renderMode = RENDERMODE_EGA;
+ _renderMode = Common::kRenderEGA;
switch (platform) {
case Common::kPlatformDOS:
switch (configRenderMode) {
case Common::kRenderCGA:
- _renderMode = RENDERMODE_CGA;
+ _renderMode = Common::kRenderCGA;
break;
// Hercules is not supported atm
//case Common::kRenderHercA:
//case Common::kRenderHercG:
- // _renderMode = RENDERMODE_HERCULES;
+ // _renderMode = Common::kRenderHercG;
// break;
default:
break;
}
break;
case Common::kPlatformAmiga:
- _renderMode = RENDERMODE_AMIGA;
+ _renderMode = Common::kRenderAmiga;
break;
case Common::kPlatformApple2GS:
- _renderMode = RENDERMODE_APPLE_II_GS;
+ _renderMode = Common::kRenderApple2GS;
break;
case Common::kPlatformAtariST:
- _renderMode = RENDERMODE_ATARI_ST;
+ _renderMode = Common::kRenderAtariST;
break;
default:
break;
@@ -316,13 +316,13 @@ void AgiBase::initRenderMode() {
// If render mode is explicitly set, force rendermode
switch (configRenderMode) {
case Common::kRenderAmiga:
- _renderMode = RENDERMODE_AMIGA;
+ _renderMode = Common::kRenderAmiga;
break;
case Common::kRenderApple2GS:
- _renderMode = RENDERMODE_APPLE_II_GS;
+ _renderMode = Common::kRenderApple2GS;
break;
case Common::kRenderAtariST:
- _renderMode = RENDERMODE_ATARI_ST;
+ _renderMode = Common::kRenderAtariST;
break;
default:
break;
@@ -330,7 +330,7 @@ void AgiBase::initRenderMode() {
if (getFeatures() & (GF_AGI256 | GF_AGI256_2)) {
// If current game is AGI256, switch (force) to VGA render mode
- _renderMode = RENDERMODE_VGA;
+ _renderMode = Common::kRenderVGA;
}
}
@@ -343,21 +343,21 @@ void AgiBase::initFont() {
}
switch (_renderMode) {
- case RENDERMODE_AMIGA:
+ case Common::kRenderAmiga:
loadFontAmigaPseudoTopaz();
//_fontData = fontData_Amiga; // use Amiga Topaz font
break;
- case RENDERMODE_APPLE_II_GS:
+ case Common::kRenderApple2GS:
// Special font, stored in file AGIFONT
loadFontAppleIIgs();
break;
- case RENDERMODE_ATARI_ST:
+ case Common::kRenderAtariST:
// TODO: Atari ST uses another font
// Seems to be the standard Atari ST 8x8 system font
- case RENDERMODE_CGA:
- case RENDERMODE_EGA:
- case RENDERMODE_VGA:
+ case Common::kRenderCGA:
+ case Common::kRenderEGA:
+ case Common::kRenderVGA:
switch (getGameID()) {
case GID_MICKEY:
// load mickey mouse font from interpreter file
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index fd44afd910..a070d5eafd 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -140,16 +140,6 @@ enum AgiGameType {
BooterDisk2 = 1
};
-enum AgiRenderMode {
- RENDERMODE_EGA = 0,
- RENDERMODE_CGA = 1,
- RENDERMODE_VGA = 2,
- RENDERMODE_HERCULES = 3,
- RENDERMODE_AMIGA = 4,
- RENDERMODE_APPLE_II_GS = 5,
- RENDERMODE_ATARI_ST = 6
-};
-
//
// GF_OLDAMIGAV20 means that the interpreter is an old Amiga AGI interpreter that
// uses value 20 for the computer type (v20 i.e. vComputer) rather than the usual value 5.
@@ -666,7 +656,7 @@ public:
GfxMgr *_gfx;
- AgiRenderMode _renderMode;
+ Common::RenderMode _renderMode;
volatile uint32 _clockCount;
AgiDebug _debug;
AgiGame _game;
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index 98f29ec0e1..3d9803e6e3 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -494,19 +494,20 @@ int AgiEngine::runGame() {
// Set monitor type (v26 i.e. vMonitor)
switch (_renderMode) {
- case RENDERMODE_CGA:
+ case Common::kRenderCGA:
setVar(VM_VAR_MONITOR, kAgiMonitorCga);
break;
- case RENDERMODE_HERCULES:
+ case Common::kRenderHercA:
+ case Common::kRenderHercG:
setVar(VM_VAR_MONITOR, kAgiMonitorHercules);
break;
// Don't know if Amiga AGI games use a different value than kAgiMonitorEga
// for vMonitor so I just use kAgiMonitorEga for them (As was done before too).
- case RENDERMODE_AMIGA:
- case RENDERMODE_APPLE_II_GS:
- case RENDERMODE_ATARI_ST:
- case RENDERMODE_EGA:
- case RENDERMODE_VGA:
+ case Common::kRenderAmiga:
+ case Common::kRenderApple2GS:
+ case Common::kRenderAtariST:
+ case Common::kRenderEGA:
+ case Common::kRenderVGA:
default:
setVar(VM_VAR_MONITOR, kAgiMonitorEga);
break;
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 467d63be84..b19e729409 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -63,16 +63,16 @@ int GfxMgr::initVideo() {
initPalette(_paletteTextMode, PALETTE_EGA);
switch (_vm->_renderMode) {
- case RENDERMODE_EGA:
+ case Common::kRenderEGA:
initPalette(_paletteGfxMode, PALETTE_EGA);
break;
- case RENDERMODE_CGA:
+ case Common::kRenderCGA:
initPalette(_paletteGfxMode, PALETTE_CGA, 4, 8);
break;
- case RENDERMODE_VGA:
+ case Common::kRenderVGA:
initPalette(_paletteGfxMode, PALETTE_VGA, 256, 8);
break;
- case RENDERMODE_AMIGA:
+ case Common::kRenderAmiga:
if (!ConfMan.getBool("altamigapalette")) {
// Set the correct Amiga palette depending on AGI interpreter version
if (_vm->getVersion() < 0x2936)
@@ -86,10 +86,10 @@ int GfxMgr::initVideo() {
initPalette(_paletteGfxMode, PALETTE_AMIGA_ALT);
}
break;
- case RENDERMODE_APPLE_II_GS:
+ case Common::kRenderApple2GS:
initPalette(_paletteGfxMode, PALETTE_APPLE_II_GS, 16, 4);
break;
- case RENDERMODE_ATARI_ST:
+ case Common::kRenderAtariST:
initPalette(_paletteGfxMode, PALETTE_ATARI_ST, 16, 3);
break;
default:
@@ -99,22 +99,22 @@ int GfxMgr::initVideo() {
// set up mouse cursors
switch (_vm->_renderMode) {
- case RENDERMODE_EGA:
- case RENDERMODE_CGA:
- case RENDERMODE_VGA:
+ case Common::kRenderEGA:
+ case Common::kRenderCGA:
+ case Common::kRenderVGA:
initMouseCursor(&_mouseCursor, MOUSECURSOR_SCI, 11, 16, 1, 1);
initMouseCursor(&_mouseCursorBusy, MOUSECURSOR_SCI_BUSY, 15, 16, 7, 8);
break;
- case RENDERMODE_AMIGA:
+ case Common::kRenderAmiga:
initMouseCursor(&_mouseCursor, MOUSECURSOR_AMIGA, 8, 11, 1, 1);
initMouseCursor(&_mouseCursorBusy, MOUSECURSOR_AMIGA_BUSY, 13, 16, 7, 8);
break;
- case RENDERMODE_APPLE_II_GS:
+ case Common::kRenderApple2GS:
// had no special busy mouse cursor
initMouseCursor(&_mouseCursor, MOUSECURSOR_APPLE_II_GS, 9, 11, 1, 1);
initMouseCursor(&_mouseCursorBusy, MOUSECURSOR_SCI_BUSY, 15, 16, 7, 8);
break;
- case RENDERMODE_ATARI_ST:
+ case Common::kRenderAtariST:
initMouseCursor(&_mouseCursor, MOUSECURSOR_ATARI_ST, 11, 16, 1, 1);
initMouseCursor(&_mouseCursorBusy, MOUSECURSOR_SCI_BUSY, 15, 16, 7, 8);
break;
@@ -270,10 +270,10 @@ void GfxMgr::render_Block(int16 x, int16 y, int16 width, int16 height, bool copy
return;
switch (_vm->_renderMode) {
- case RENDERMODE_CGA:
+ case Common::kRenderCGA:
render_BlockCGA(x, y, width, height, copyToScreen);
break;
- case RENDERMODE_EGA:
+ case Common::kRenderEGA:
default:
render_BlockEGA(x, y, width, height, copyToScreen);
break;
@@ -546,10 +546,10 @@ void GfxMgr::drawRect(int16 x, int16 y, int16 width, int16 height, byte color) {
// coordinates are directly for display screen
void GfxMgr::drawDisplayRect(int16 x, int16 y, int16 width, int16 height, byte color) {
switch (_vm->_renderMode) {
- case RENDERMODE_CGA:
+ case Common::kRenderCGA:
drawDisplayRectCGA(x, y, width, height, color);
break;
- case RENDERMODE_EGA:
+ case Common::kRenderEGA:
default:
drawDisplayRectEGA(x, y, width, height, color);
break;
diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp
index 951d67a0c0..965145cb1c 100644
--- a/engines/agi/picture.cpp
+++ b/engines/agi/picture.cpp
@@ -632,7 +632,7 @@ void PictureMgr::draw_SetColor() {
// For CGA, replace the color with its mixture color
switch (_vm->_renderMode) {
- case RENDERMODE_CGA:
+ case Common::kRenderCGA:
_scrColor = _gfx->getCGAMixtureColor(_scrColor);
break;
default:
@@ -651,7 +651,7 @@ void PictureMgr::draw_SetNibbleColor() {
// For CGA, replace the color with its mixture color
switch (_vm->_renderMode) {
- case RENDERMODE_CGA:
+ case Common::kRenderCGA:
_scrColor = _gfx->getCGAMixtureColor(_scrColor);
break;
default:
@@ -1030,14 +1030,14 @@ void PictureMgr::showPicWithTransition() {
}
switch (_vm->_renderMode) {
- case RENDERMODE_AMIGA:
- case RENDERMODE_APPLE_II_GS:
+ case Common::kRenderAmiga:
+ case Common::kRenderApple2GS:
// Platform Amiga/Apple II GS -> render and do Amiga transition
_gfx->render_Block(0, 167, SCRIPT_WIDTH, SCRIPT_HEIGHT, false);
_gfx->transition_Amiga();
return;
break;
- case RENDERMODE_ATARI_ST:
+ case Common::kRenderAtariST:
// Platform Atari ST used a different transition, looks "high-res" (full 320x168)
_gfx->render_Block(0, 167, SCRIPT_WIDTH, SCRIPT_HEIGHT, false);
_gfx->transition_AtariSt();
diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp
index 02c48b090b..ad1bddff02 100644
--- a/engines/agi/preagi_mickey.cpp
+++ b/engines/agi/preagi_mickey.cpp
@@ -921,7 +921,7 @@ void MickeyEngine::drawLogo() {
const byte *BCGColorMapping = BCGColorMappingCGAToEGA;
// disable color mapping in case we are in CGA mode
- if (_renderMode == RENDERMODE_CGA)
+ if (_renderMode == Common::kRenderCGA)
BCGColorMapping = BCGColorMappingCGAToCGA;
// read logos.bcg
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp
index 8367929932..f7b4ef68df 100644
--- a/engines/agi/text.cpp
+++ b/engines/agi/text.cpp
@@ -155,7 +155,7 @@ void TextMgr::charAttrib_Set(byte foreground, byte background) {
} else {
// Graphics-mode:
switch (_vm->_renderMode) {
- case RENDERMODE_CGA:
+ case Common::kRenderCGA:
// CGA
if (background) {
_textAttrib.combinedForeground = 3;
diff --git a/engines/agi/view.cpp b/engines/agi/view.cpp
index 66508a6c27..e9ed169eb7 100644
--- a/engines/agi/view.cpp
+++ b/engines/agi/view.cpp
@@ -321,7 +321,7 @@ void AgiEngine::unpackViewCelData(AgiViewCel *celData, byte *compressedData, uin
// for CGA rendering, apply dithering
switch (_renderMode) {
- case RENDERMODE_CGA: {
+ case Common::kRenderCGA: {
uint16 totalPixels = celData->width * celData->height;
// dither clear key