aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins
diff options
context:
space:
mode:
authorStrangerke2012-12-23 20:36:08 +0100
committerStrangerke2012-12-23 20:36:08 +0100
commit3f8085f6542a1ef5a8fd0b1b3588b31114ac28c5 (patch)
tree58ee275833b94f7fde185576daa62606c47fdc0e /engines/hopkins
parent1f987a91ae9e7044fd1f6764d1232109028a8bd8 (diff)
downloadscummvm-rg350-3f8085f6542a1ef5a8fd0b1b3588b31114ac28c5.tar.gz
scummvm-rg350-3f8085f6542a1ef5a8fd0b1b3588b31114ac28c5.tar.bz2
scummvm-rg350-3f8085f6542a1ef5a8fd0b1b3588b31114ac28c5.zip
HOPKINS: Some more renaming, remove useless variable
Diffstat (limited to 'engines/hopkins')
-rw-r--r--engines/hopkins/anim.cpp10
-rw-r--r--engines/hopkins/font.cpp2
-rw-r--r--engines/hopkins/graphics.cpp52
-rw-r--r--engines/hopkins/graphics.h13
-rw-r--r--engines/hopkins/script.cpp4
-rw-r--r--engines/hopkins/talk.cpp8
6 files changed, 43 insertions, 46 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index 5b8495c84c..83f039341c 100644
--- a/engines/hopkins/anim.cpp
+++ b/engines/hopkins/anim.cpp
@@ -232,7 +232,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
v8 = 0;
while (!_vm->shouldQuit()) {
- memcpy(_vm->_graphicsManager.OLD_PAL, _vm->_graphicsManager._palette, 769);
+ memcpy(_vm->_graphicsManager._oldPalette, _vm->_graphicsManager._palette, 769);
_vm->_fileManager.constructLinuxFilename("TEMP.SCR");
@@ -314,7 +314,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
_vm->_saveLoadManager.load("TEMP.SCR", _vm->_graphicsManager._vesaScreen);
g_system->getSavefileManager()->removeSavefile("TEMP.SCR");
- memcpy(_vm->_graphicsManager._palette, _vm->_graphicsManager.OLD_PAL, 769);
+ memcpy(_vm->_graphicsManager._palette, _vm->_graphicsManager._oldPalette, 769);
_vm->_graphicsManager.clearPalette();
_vm->_graphicsManager.lockScreen();
_vm->_graphicsManager.clearScreen();
@@ -388,7 +388,7 @@ LABEL_88:
_vm->_saveLoadManager.load("TEMP.SCR", _vm->_graphicsManager._vesaScreen);
g_system->getSavefileManager()->removeSavefile("TEMP.SCR");
- memcpy(_vm->_graphicsManager._palette, _vm->_graphicsManager.OLD_PAL, 769);
+ memcpy(_vm->_graphicsManager._palette, _vm->_graphicsManager._oldPalette, 769);
_vm->_graphicsManager.clearPalette();
_vm->_graphicsManager.lockScreen();
_vm->_graphicsManager.clearScreen();
@@ -430,7 +430,7 @@ LABEL_88:
_vm->_saveLoadManager.load("TEMP.SCR", _vm->_graphicsManager._vesaScreen);
g_system->getSavefileManager()->removeSavefile("TEMP.SCR");
- memcpy(_vm->_graphicsManager._palette, _vm->_graphicsManager.OLD_PAL, 769);
+ memcpy(_vm->_graphicsManager._palette, _vm->_graphicsManager._oldPalette, 769);
_vm->_graphicsManager.clearPalette();
_vm->_graphicsManager.lockScreen();
_vm->_graphicsManager.clearScreen();
@@ -509,7 +509,7 @@ LABEL_114:
_vm->_saveLoadManager.load("TEMP.SCR", _vm->_graphicsManager._vesaScreen);
g_system->getSavefileManager()->removeSavefile("TEMP.SCR");
- memcpy(_vm->_graphicsManager._palette, _vm->_graphicsManager.OLD_PAL, 769);
+ memcpy(_vm->_graphicsManager._palette, _vm->_graphicsManager._oldPalette, 769);
_vm->_graphicsManager.clearPalette();
_vm->_graphicsManager.lockScreen();
_vm->_graphicsManager.clearScreen();
diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp
index 28b13490f7..8c0239db13 100644
--- a/engines/hopkins/font.cpp
+++ b/engines/hopkins/font.cpp
@@ -384,7 +384,7 @@ LABEL_57:
error("Cutting a block for text box (%d)", v49);
}
_vm->_graphicsManager.Capture_Mem(_vm->_graphicsManager._vesaBuffer, ptrd, v56, v55, v53, v51);
- _vm->_graphicsManager.Trans_bloc2(ptrd, _vm->_graphicsManager.TABLE_COUL, v49);
+ _vm->_graphicsManager.Trans_bloc2(ptrd, _vm->_graphicsManager._colorTable, v49);
_vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager._vesaBuffer, ptrd, v56, v55, v53, v51);
_vm->_globals.freeMemory(ptrd);
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index 18f0ec8bef..638a1a2719 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -40,7 +40,6 @@ GraphicsManager::GraphicsManager() {
WinScan = 0;
PAL_PIXELS = NULL;
_lineNbr = 0;
- Linear = false;
_videoPtr = NULL;
ofscroll = 0;
SCROLL = 0;
@@ -71,9 +70,9 @@ GraphicsManager::GraphicsManager() {
spec_largeur = 0;
Common::fill(&SD_PIXELS[0], &SD_PIXELS[PALETTE_SIZE * 2], 0);
- Common::fill(&TABLE_COUL[0], &TABLE_COUL[PALETTE_EXT_BLOCK_SIZE], 0);
+ Common::fill(&_colorTable[0], &_colorTable[PALETTE_EXT_BLOCK_SIZE], 0);
Common::fill(&_palette[0], &_palette[PALETTE_EXT_BLOCK_SIZE], 0);
- Common::fill(&OLD_PAL[0], &OLD_PAL[PALETTE_EXT_BLOCK_SIZE], 0);
+ Common::fill(&_oldPalette[0], &_oldPalette[PALETTE_EXT_BLOCK_SIZE], 0);
}
GraphicsManager::~GraphicsManager() {
@@ -110,7 +109,6 @@ void GraphicsManager::setGraphicalMode(int width, int height) {
XSCREEN = width;
YSCREEN = height;
- Linear = true;
WinScan = width * 2; // Refactor me
PAL_PIXELS = SD_PIXELS;
@@ -157,7 +155,7 @@ void GraphicsManager::clearScreen() {
void GraphicsManager::loadImage(const Common::String &file) {
Common::String filename = Common::String::format("%s.PCX", file.c_str());
loadScreen(filename);
- INIT_TABLE(165, 170, _palette);
+ initColorTable(165, 170, _palette);
}
/**
@@ -229,21 +227,21 @@ void GraphicsManager::loadScreen(const Common::String &file) {
memcpy(_vesaBuffer, _vesaScreen, SCREEN_WIDTH * 2 * SCREEN_HEIGHT);
}
-void GraphicsManager::INIT_TABLE(int minIndex, int maxIndex, byte *palette) {
+void GraphicsManager::initColorTable(int minIndex, int maxIndex, byte *palette) {
for (int idx = 0; idx < 256; ++idx)
- TABLE_COUL[idx] = idx;
+ _colorTable[idx] = idx;
- Trans_bloc(TABLE_COUL, palette, 256, minIndex, maxIndex);
+ Trans_bloc(_colorTable, palette, 256, minIndex, maxIndex);
for (int idx = 0; idx < 256; ++idx) {
- byte v = TABLE_COUL[idx];
+ byte v = _colorTable[idx];
if (v > 27)
- TABLE_COUL[idx] = 0;
+ _colorTable[idx] = 0;
if (!v)
- TABLE_COUL[idx] = 0;
+ _colorTable[idx] = 0;
}
- TABLE_COUL[0] = 1;
+ _colorTable[0] = 1;
}
/**
@@ -588,7 +586,7 @@ void GraphicsManager::Copy_Vga16(const byte *surface, int xp, int yp, int width,
} while (yCtr != 1);
}
-void GraphicsManager::fade_in(const byte *palette, int step, const byte *surface) {
+void GraphicsManager::fadeIn(const byte *palette, int step, const byte *surface) {
uint16 palData1[PALETTE_BLOCK_SIZE * 2];
byte palData2[PALETTE_BLOCK_SIZE];
@@ -639,7 +637,7 @@ void GraphicsManager::fade_in(const byte *palette, int step, const byte *surface
DD_VBL();
}
-void GraphicsManager::fade_out(const byte *palette, int step, const byte *surface) {
+void GraphicsManager::fadeOut(const byte *palette, int step, const byte *surface) {
int palByte;
uint16 palMax;
byte palData[PALETTE_BLOCK_SIZE];
@@ -691,30 +689,30 @@ void GraphicsManager::fade_out(const byte *palette, int step, const byte *surfac
void GraphicsManager::FADE_INS() {
FADESPD = 1;
- fade_in(_palette, 1, (const byte *)_vesaBuffer);
+ fadeIn(_palette, 1, (const byte *)_vesaBuffer);
}
void GraphicsManager::FADE_OUTS() {
- FADESPD = 1;
- fade_out(_palette, 1, (const byte *)_vesaBuffer);
+ FADESPD = 1;
+ fadeOut(_palette, 1, (const byte *)_vesaBuffer);
}
void GraphicsManager::FADE_INW() {
FADESPD = 15;
- fade_in(_palette, 20, (const byte *)_vesaBuffer);
+ fadeIn(_palette, 20, (const byte *)_vesaBuffer);
}
void GraphicsManager::FADE_OUTW() {
FADESPD = 15;
- fade_out(_palette, 20, (const byte *)_vesaBuffer);
+ fadeOut(_palette, 20, (const byte *)_vesaBuffer);
}
void GraphicsManager::setpal_vga256(const byte *palette) {
- CHANGE_PALETTE(palette);
+ changePalette(palette);
}
void GraphicsManager::setpal_vga256_linux(const byte *palette, const byte *surface) {
- CHANGE_PALETTE(palette);
+ changePalette(palette);
m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
DD_VBL();
}
@@ -739,7 +737,7 @@ void GraphicsManager::SETCOLOR4(int palIndex, int r, int g, int b) {
WRITE_LE_UINT16(&SD_PIXELS[2 * palIndex], MapRGB(rv, gv, bv));
}
-void GraphicsManager::CHANGE_PALETTE(const byte *palette) {
+void GraphicsManager::changePalette(const byte *palette) {
const byte *srcP = &palette[0];
for (int idx = 0; idx < PALETTE_SIZE; ++idx, srcP += 3) {
*(uint16 *)&SD_PIXELS[2 * idx] = MapRGB(*srcP, *(srcP + 1), *(srcP + 2));
@@ -761,12 +759,12 @@ void GraphicsManager::DD_VBL() {
void GraphicsManager::FADE_OUTW_LINUX(const byte *surface) {
assert(surface);
- fade_out(_palette, FADESPD, surface);
+ fadeOut(_palette, FADESPD, surface);
}
void GraphicsManager::FADE_INW_LINUX(const byte *surface) {
assert(surface);
- fade_in(_palette, FADESPD, surface);
+ fadeIn(_palette, FADESPD, surface);
}
void GraphicsManager::FADE_IN_CASSE() {
@@ -2006,12 +2004,12 @@ void GraphicsManager::NB_SCREEN() {
const byte *srcP;
if (!_vm->_globals.NECESSAIRE)
- INIT_TABLE(50, 65, _palette);
+ initColorTable(50, 65, _palette);
if (_lineNbr == SCREEN_WIDTH)
- Trans_bloc2(_vesaBuffer, TABLE_COUL, SCREEN_WIDTH * SCREEN_HEIGHT);
+ Trans_bloc2(_vesaBuffer, _colorTable, SCREEN_WIDTH * SCREEN_HEIGHT);
else if (_lineNbr == (SCREEN_WIDTH * 2))
- Trans_bloc2(_vesaBuffer, TABLE_COUL, SCREEN_WIDTH * SCREEN_HEIGHT * 2);
+ Trans_bloc2(_vesaBuffer, _colorTable, SCREEN_WIDTH * SCREEN_HEIGHT * 2);
lockScreen();
m_scroll16(_vesaBuffer, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h
index 0e0963a08c..cadcd1dce8 100644
--- a/engines/hopkins/graphics.h
+++ b/engines/hopkins/graphics.h
@@ -61,10 +61,9 @@ public:
byte SD_PIXELS[PALETTE_SIZE * 2];
byte *PAL_PIXELS;
int _lineNbr;
- byte TABLE_COUL[PALETTE_EXT_BLOCK_SIZE];
+ byte _colorTable[PALETTE_EXT_BLOCK_SIZE];
byte _palette[PALETTE_EXT_BLOCK_SIZE];
- byte OLD_PAL[PALETTE_EXT_BLOCK_SIZE];
- bool Linear;
+ byte _oldPalette[PALETTE_EXT_BLOCK_SIZE];
Graphics::Surface *_videoPtr;
byte *_vesaScreen;
byte *_vesaBuffer;
@@ -109,7 +108,7 @@ public:
void clearScreen();
void loadImage(const Common::String &file);
void loadVgaImage(const Common::String &file);
- void INIT_TABLE(int minIndex, int maxIndex, byte *palette);
+ void initColorTable(int minIndex, int maxIndex, byte *palette);
void scrollScreen(int amount);
void Trans_bloc(byte *destP, const byte *srcP, int count, int minThreshold, int maxThreshold);
void Trans_bloc2(byte *surface, byte *col, int size);
@@ -121,8 +120,8 @@ public:
void m_scroll16(const byte *surface, int xs, int ys, int width, int height, int destX, int destY);
void m_scroll16A(const byte *surface, int xs, int ys, int width, int height, int destX, int destY);
void Copy_Vga16(const byte *surface, int xp, int yp, int width, int height, int destX, int destY);
- void fade_in(const byte *palette, int step, const byte *surface);
- void fade_out(const byte *palette, int step, const byte *surface);
+ void fadeIn(const byte *palette, int step, const byte *surface);
+ void fadeOut(const byte *palette, int step, const byte *surface);
void FADE_INS();
void FADE_OUTS();
void FADE_INW();
@@ -135,7 +134,7 @@ public:
void setpal_vga256_linux(const byte *palette, const byte *surface);
void SETCOLOR3(int palIndex, int r, int g, int b);
void SETCOLOR4(int palIndex, int r, int g, int b);
- void CHANGE_PALETTE(const byte *palette);
+ void changePalette(const byte *palette);
uint16 MapRGB(byte r, byte g, byte b);
void DD_VBL();
void Copy_WinScan_Vbe3(const byte *srcData, byte *destSurface);
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index 3c865755ec..f6cf8567db 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -637,8 +637,8 @@ LABEL_1141:
}
if (v76 == 607) {
if (!_vm->_globals._internetFl) {
- memcpy(_vm->_graphicsManager.OLD_PAL, _vm->_graphicsManager._palette, 769);
- v1 = _vm->_graphicsManager.OLD_PAL[769];
+ memcpy(_vm->_graphicsManager._oldPalette, _vm->_graphicsManager._palette, 769);
+ v1 = _vm->_graphicsManager._oldPalette[769];
_vm->_animationManager.playAnim2("PLAN.ANM", 50, 10, 800);
}
_vm->_globals.NBBLOC = 0;
diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp
index 1e4c228577..b55e0814f2 100644
--- a/engines/hopkins/talk.cpp
+++ b/engines/hopkins/talk.cpp
@@ -155,7 +155,7 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) {
if (_vm->getIsDemo() == false)
_vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0);
- _vm->_graphicsManager.INIT_TABLE(145, 150, _vm->_graphicsManager._palette);
+ _vm->_graphicsManager.initColorTable(145, 150, _vm->_graphicsManager._palette);
_vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
_vm->_graphicsManager.lockScreen();
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
@@ -243,7 +243,7 @@ void TalkManager::PARLER_PERSO2(const Common::String &filename) {
_vm->_eventsManager._mouseCursorId = v8;
_vm->_eventsManager.changeMouseCursor(v8);
- _vm->_graphicsManager.INIT_TABLE(145, 150, _vm->_graphicsManager._palette);
+ _vm->_graphicsManager.initColorTable(145, 150, _vm->_graphicsManager._palette);
_vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
_vm->_objectsManager._disableCursorFl = false;
_vm->_globals._disableInventFl = v7;
@@ -569,7 +569,7 @@ void TalkManager::CHERCHE_PAL(int a1, int a2) {
}
_vm->_graphicsManager.setpal_vga256(palette);
- _vm->_graphicsManager.INIT_TABLE(145, 150, palette);
+ _vm->_graphicsManager.initColorTable(145, 150, palette);
}
void TalkManager::VISU_WAIT() {
@@ -1266,7 +1266,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) {
if (!_vm->getIsDemo())
_vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0);
- _vm->_graphicsManager.INIT_TABLE(145, 150, _vm->_graphicsManager._palette);
+ _vm->_graphicsManager.initColorTable(145, 150, _vm->_graphicsManager._palette);
_vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
_vm->_graphicsManager.lockScreen();
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);