aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hopkins')
-rw-r--r--engines/hopkins/anim.cpp234
-rw-r--r--engines/hopkins/graphics.cpp20
-rw-r--r--engines/hopkins/graphics.h4
-rw-r--r--engines/hopkins/hopkins.cpp12
-rw-r--r--engines/hopkins/talk.cpp10
5 files changed, 134 insertions, 146 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index 55e9fe17f1..302c2f7913 100644
--- a/engines/hopkins/anim.cpp
+++ b/engines/hopkins/anim.cpp
@@ -47,21 +47,16 @@ AnimationManager::AnimationManager() {
* @param rate3 Delay amount after animation finishes
*/
void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, uint32 rate2, uint32 rate3) {
- bool breakFlag;
- bool hasScreenCopy;
byte *screenCopy = NULL;
- byte *screenP = NULL;
int frameNumber;
- byte *ptr = NULL;
- size_t nbytes;
Common::File f;
if (_vm->shouldQuit())
return;
- hasScreenCopy = false;
- screenP = _vm->_graphicsManager._vesaScreen;
- ptr = _vm->_globals.allocMemory(20);
+ bool hasScreenCopy = false;
+ byte *screenP = _vm->_graphicsManager._vesaScreen;
+ byte *ptr = _vm->_globals.allocMemory(20);
_vm->_fileManager.constructFilename(_vm->_globals.HOPANM, filename);
if (!f.open(_vm->_globals._curFilename))
@@ -70,7 +65,7 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
f.skip(6);
f.read(_vm->_graphicsManager._palette, 800);
f.skip(4);
- nbytes = f.readUint32LE();
+ size_t nbytes = f.readUint32LE();
f.skip(14);
f.read(screenP, nbytes);
@@ -87,9 +82,9 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
if (NO_SEQ) {
if (hasScreenCopy)
memcpy(screenCopy, _vm->_graphicsManager._vesaBuffer, 307200);
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
} else {
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
_vm->_graphicsManager.lockScreen();
if (hasScreenCopy)
_vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
@@ -113,7 +108,6 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
}
_vm->_eventsManager._rateCounter = 0;
- breakFlag = false;
frameNumber = 0;
while (!_vm->shouldQuit()) {
++frameNumber;
@@ -121,11 +115,9 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
// Read frame header
if (f.read(ptr, 16) != 16)
- breakFlag = true;
+ break;
if (strncmp((char *)ptr, "IMAGE=", 6))
- breakFlag = true;
- if (breakFlag)
break;
f.read(screenP, READ_LE_UINT32(ptr + 8));
@@ -182,21 +174,18 @@ EXIT:
memcpy(screenCopy, screenP, 307200);
- breakFlag = false;
- do {
+ for (;;) {
memset(ptr, 0, 20);
if (f.read(ptr, 16) != 16)
- breakFlag = true;
+ break;
if (strncmp((char *)ptr, "IMAGE=", 6))
- breakFlag = true;
+ break;
- if (!breakFlag) {
- f.read(screenP, READ_LE_UINT32(ptr + 8));
- if (*screenP != kByteStop)
- _vm->_graphicsManager.Copy_WinScan_Vbe3(screenP, screenCopy);
- }
- } while (breakFlag);
+ f.read(screenP, READ_LE_UINT32(ptr + 8));
+ if (*screenP != kByteStop)
+ _vm->_graphicsManager.Copy_WinScan_Vbe3(screenP, screenCopy);
+ }
_vm->_graphicsManager.fadeOutDefaultLength(screenCopy);
screenCopy = _vm->_globals.freeMemory(screenCopy);
}
@@ -217,12 +206,11 @@ EXIT:
*/
void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint32 a3, uint32 a4) {
int v5;
- int v8;
- byte *ptr = NULL;
+ byte *screenCopy = NULL;
int oldScrollVal = 0;
- byte *v12 = NULL;
- byte *v13 = NULL;
- int v15;
+ byte *screenP = NULL;
+ byte *ptr = NULL;
+ int frameNumber;
size_t nbytes;
byte buf[6];
Common::File f;
@@ -230,7 +218,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
if (_vm->shouldQuit())
return;
- v8 = 0;
+ bool hasScreenCopy = false;
while (!_vm->shouldQuit()) {
memcpy(_vm->_graphicsManager._oldPalette, _vm->_graphicsManager._palette, 769);
@@ -243,8 +231,8 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
if (!_vm->_graphicsManager._lineNbr)
_vm->_graphicsManager._scrollOffset = 0;
- v12 = _vm->_graphicsManager._vesaScreen;
- v13 = _vm->_globals.allocMemory(20);
+ screenP = _vm->_graphicsManager._vesaScreen;
+ ptr = _vm->_globals.allocMemory(20);
_vm->_fileManager.constructFilename(_vm->_globals.HOPANM, filename);
if (!f.open(_vm->_globals._curFilename))
@@ -261,7 +249,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
f.readUint16LE();
f.readUint16LE();
- f.read(v12, nbytes);
+ f.read(screenP, nbytes);
_vm->_graphicsManager.clearPalette();
oldScrollVal = _vm->_graphicsManager.SCROLL;
@@ -272,21 +260,21 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
_vm->_graphicsManager.unlockScreen();
_vm->_graphicsManager.max_x = SCREEN_WIDTH;
if (_vm->_graphicsManager.WinScan / 2 > SCREEN_WIDTH) {
- v8 = 1;
- ptr = _vm->_globals.allocMemory(307200);
- memcpy(ptr, v12, 307200);
+ hasScreenCopy = true;
+ screenCopy = _vm->_globals.allocMemory(307200);
+ memcpy(screenCopy, screenP, 307200);
}
if (NO_SEQ) {
- if (v8 == 1)
- memcpy(ptr, _vm->_graphicsManager._vesaBuffer, 307200);
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ if (hasScreenCopy)
+ memcpy(screenCopy, _vm->_graphicsManager._vesaBuffer, 307200);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
} else {
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
_vm->_graphicsManager.lockScreen();
- if (v8)
- _vm->_graphicsManager.m_scroll16A(ptr, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ if (hasScreenCopy)
+ _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
- _vm->_graphicsManager.m_scroll16(v12, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ _vm->_graphicsManager.m_scroll16(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
_vm->_graphicsManager.unlockScreen();
_vm->_graphicsManager.DD_VBL();
}
@@ -304,9 +292,9 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
}
if (_vm->_graphicsManager._skipVideoLockFl)
goto LABEL_114;
- if (v8 == 1)
- ptr = _vm->_globals.freeMemory(ptr);
- _vm->_globals.freeMemory(v13);
+ if (hasScreenCopy)
+ screenCopy = _vm->_globals.freeMemory(screenCopy);
+ _vm->_globals.freeMemory(ptr);
f.close();
_vm->_saveLoadManager.load("TEMP.SCR", _vm->_graphicsManager._vesaScreen);
@@ -338,34 +326,34 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
LABEL_48:
_vm->_eventsManager._rateCounter = 0;
v5 = 0;
- v15 = 0;
+ frameNumber = 0;
for (;;) {
- ++v15;
- _vm->_soundManager.playAnim_SOUND(v15);
+ ++frameNumber;
+ _vm->_soundManager.playAnim_SOUND(frameNumber);
memset(&buf, 0, 6);
- memset(v13, 0, 19);
+ memset(ptr, 0, 19);
- if (f.read(v13, 16) != 16)
+ if (f.read(ptr, 16) != 16)
v5 = -1;
- if (strncmp((const char *)v13, "IMAGE=", 6))
+ if (strncmp((const char *)ptr, "IMAGE=", 6))
v5 = -1;
if (v5)
goto LABEL_88;
- f.read(v12, READ_LE_UINT32(v13 + 8));
+ f.read(screenP, READ_LE_UINT32(ptr + 8));
if (_vm->_globals.iRegul == 1)
break;
LABEL_77:
_vm->_eventsManager._rateCounter = 0;
_vm->_graphicsManager.lockScreen();
- if (v8) {
- if (*v12 != kByteStop) {
- _vm->_graphicsManager.Copy_WinScan_Vbe3(v12, ptr);
- _vm->_graphicsManager.m_scroll16A(ptr, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ if (hasScreenCopy) {
+ if (*screenP != kByteStop) {
+ _vm->_graphicsManager.Copy_WinScan_Vbe3(screenP, screenCopy);
+ _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
- } else if (*v12 != kByteStop) {
- _vm->_graphicsManager.Copy_Video_Vbe16(v12);
+ } else if (*screenP != kByteStop) {
+ _vm->_graphicsManager.Copy_Video_Vbe16(screenP);
}
_vm->_graphicsManager.unlockScreen();
_vm->_graphicsManager.DD_VBL();
@@ -393,7 +381,7 @@ LABEL_114:
_vm->_graphicsManager._skipVideoLockFl = false;
f.close();
- if (_vm->_graphicsManager.FADE_LINUX == 2 && !v8) {
+ if (_vm->_graphicsManager.FADE_LINUX == 2 && !hasScreenCopy) {
byte *ptra;
ptra = _vm->_globals.allocMemory(307200);
@@ -410,34 +398,34 @@ LABEL_114:
f.readUint16LE();
f.readUint16LE();
- f.read(v12, nbytes);
- memcpy(ptra, v12, 307200);
+ f.read(screenP, nbytes);
+ memcpy(ptra, screenP, 307200);
int v6 = 0;
do {
memset(&buf, 0, 6);
- memset(v13, 0, 19);
- if (f.read(v13, 16) != 16)
+ memset(ptr, 0, 19);
+ if (f.read(ptr, 16) != 16)
v6 = -1;
- if (strncmp((const char *)v13, "IMAGE=", 6))
+ if (strncmp((const char *)ptr, "IMAGE=", 6))
v6 = -1;
if (!v6) {
- f.read(v12, READ_LE_UINT32(v13 + 8));
- if (*v12 != kByteStop)
- _vm->_graphicsManager.Copy_WinScan_Vbe3(v12, ptra);
+ f.read(screenP, READ_LE_UINT32(ptr + 8));
+ if (*screenP != kByteStop)
+ _vm->_graphicsManager.Copy_WinScan_Vbe3(screenP, ptra);
}
} while (v6 != -1);
_vm->_graphicsManager.fadeOutDefaultLength(ptra);
ptra = _vm->_globals.freeMemory(ptra);
}
- if (v8 == 1) {
+ if (hasScreenCopy) {
if (_vm->_graphicsManager.FADE_LINUX == 2)
- _vm->_graphicsManager.fadeOutDefaultLength(ptr);
- _vm->_globals.freeMemory(ptr);
+ _vm->_graphicsManager.fadeOutDefaultLength(screenCopy);
+ _vm->_globals.freeMemory(screenCopy);
}
_vm->_graphicsManager.FADE_LINUX = 0;
- _vm->_globals.freeMemory(v13);
+ _vm->_globals.freeMemory(ptr);
_vm->_saveLoadManager.load("TEMP.SCR", _vm->_graphicsManager._vesaScreen);
g_system->getSavefileManager()->removeSavefile("TEMP.SCR");
@@ -714,8 +702,8 @@ void AnimationManager::searchAnim(const byte *data, int animIndex, int count) {
*/
void AnimationManager::playSequence(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3) {
bool readError;
- byte *ptr = NULL;
- byte *v9;
+ byte *screenCopy = NULL;
+ byte *screenP;
byte *v10;
int soundNumber;
size_t nbytes;
@@ -724,7 +712,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
if (_vm->shouldQuit())
return;
- bool v7 = false;
+ bool hasScreenCopy = false;
_vm->_eventsManager._mouseFl = false;
if (!NO_COUL) {
_vm->_eventsManager.VBL();
@@ -737,7 +725,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
if (!_vm->_graphicsManager._lineNbr)
_vm->_graphicsManager._scrollOffset = 0;
}
- v9 = _vm->_graphicsManager._vesaScreen;
+ screenP = _vm->_graphicsManager._vesaScreen;
v10 = _vm->_globals.allocMemory(22);
_vm->_fileManager.constructFilename(_vm->_globals.HOPSEQ, file);
if (!f.open(_vm->_globals._curFilename))
@@ -748,29 +736,29 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
f.skip(4);
nbytes = f.readUint32LE();
f.skip(14);
- f.read(v9, nbytes);
+ f.read(screenP, nbytes);
if (_vm->_graphicsManager.WinScan / 2 > SCREEN_WIDTH) {
- v7 = true;
- ptr = _vm->_globals.allocMemory(307200);
- memcpy(ptr, v9, 307200);
+ hasScreenCopy = true;
+ screenCopy = _vm->_globals.allocMemory(307200);
+ memcpy(screenCopy, screenP, 307200);
}
if (NO_SEQ) {
- if (v7)
- memcpy(ptr, _vm->_graphicsManager._vesaBuffer, 307200);
+ if (hasScreenCopy)
+ memcpy(screenCopy, _vm->_graphicsManager._vesaBuffer, 307200);
if (!_vm->getIsDemo()) {
_vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0);
}
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
} else {
_vm->_graphicsManager.lockScreen();
- if (v7)
- _vm->_graphicsManager.m_scroll16A(ptr, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ if (hasScreenCopy)
+ _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
- _vm->_graphicsManager.m_scroll16(v9, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ _vm->_graphicsManager.m_scroll16(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
_vm->_graphicsManager.unlockScreen();
_vm->_graphicsManager.DD_VBL();
}
@@ -791,7 +779,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
}
} else {
if (NO_COUL)
- _vm->_graphicsManager.fadeInDefaultLength(v9);
+ _vm->_graphicsManager.fadeInDefaultLength(screenP);
_vm->_eventsManager._rateCounter = 0;
_vm->_eventsManager._escKeyFl = false;
_vm->_soundManager.LOAD_ANM_SOUND();
@@ -820,7 +808,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
if (strncmp((const char *)v10, "IMAGE=", 6))
readError = true;
if (!readError) {
- f.read(v9, READ_LE_UINT32(v10 + 8));
+ f.read(screenP, READ_LE_UINT32(v10 + 8));
if (_vm->_globals.iRegul == 1) {
do {
if (_vm->_eventsManager._escKeyFl) {
@@ -834,13 +822,13 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
}
_vm->_eventsManager._rateCounter = 0;
_vm->_graphicsManager.lockScreen();
- if (v7) {
- if (*v9 != kByteStop) {
- _vm->_graphicsManager.Copy_WinScan_Vbe(v9, ptr);
- _vm->_graphicsManager.m_scroll16A(ptr, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ if (hasScreenCopy) {
+ if (*screenP != kByteStop) {
+ _vm->_graphicsManager.Copy_WinScan_Vbe(screenP, screenCopy);
+ _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
- } else if (*v9 != kByteStop) {
- _vm->_graphicsManager.Copy_Video_Vbe16a(v9);
+ } else if (*screenP != kByteStop) {
+ _vm->_graphicsManager.Copy_Video_Vbe16a(screenP);
}
_vm->_graphicsManager.unlockScreen();
_vm->_graphicsManager.DD_VBL();
@@ -870,8 +858,8 @@ LABEL_59:
_vm->_eventsManager._mouseFl = true;
}
- if (v7)
- _vm->_globals.freeMemory(ptr);
+ if (hasScreenCopy)
+ _vm->_globals.freeMemory(screenCopy);
_vm->_globals.freeMemory(v10);
}
@@ -880,8 +868,8 @@ LABEL_59:
*/
void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3) {
bool v4;
- byte *ptr = NULL;
- byte *v10;
+ byte *screenCopy = NULL;
+ byte *screenP;
byte *v11 = NULL;
int v13;
size_t nbytes;
@@ -893,7 +881,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
return;
_vm->_eventsManager._mouseFl = false;
- v10 = _vm->_graphicsManager._vesaScreen;
+ screenP = _vm->_graphicsManager._vesaScreen;
v11 = _vm->_globals.allocMemory(22);
_vm->_fileManager.constructFilename(_vm->_globals.HOPSEQ, file);
@@ -910,26 +898,26 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
f.readUint16LE();
f.readUint16LE();
f.readUint16LE();
- f.read(v10, nbytes);
+ f.read(screenP, nbytes);
if (_vm->_graphicsManager.WinScan / 2 > SCREEN_WIDTH) {
multiScreenFl = true;
- ptr = _vm->_globals.allocMemory(307200);
- memcpy((void *)ptr, v10, 307200);
+ screenCopy = _vm->_globals.allocMemory(307200);
+ memcpy((void *)screenCopy, screenP, 307200);
}
if (NO_SEQ) {
if (multiScreenFl) {
- assert(ptr != NULL);
- memcpy((void *)ptr, _vm->_graphicsManager._vesaBuffer, 307200);
+ assert(screenCopy != NULL);
+ memcpy((void *)screenCopy, _vm->_graphicsManager._vesaBuffer, 307200);
}
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
} else {
_vm->_graphicsManager.lockScreen();
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
if (multiScreenFl)
- _vm->_graphicsManager.m_scroll16A(ptr, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
- _vm->_graphicsManager.m_scroll16(v10, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ _vm->_graphicsManager.m_scroll16(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
_vm->_graphicsManager.unlockScreen();
_vm->_graphicsManager.DD_VBL();
}
@@ -949,7 +937,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
if (_vm->_graphicsManager._skipVideoLockFl)
goto LABEL_54;
if (multiScreenFl)
- ptr = _vm->_globals.freeMemory(ptr);
+ screenCopy = _vm->_globals.freeMemory(screenCopy);
_vm->_globals.freeMemory(v11);
f.close();
}
@@ -968,19 +956,19 @@ LABEL_23:
v4 = true;
if (v4)
goto LABEL_44;
- f.read(v10, READ_LE_UINT32(v11 + 8));
+ f.read(screenP, READ_LE_UINT32(v11 + 8));
if (_vm->_globals.iRegul == 1)
break;
LABEL_33:
_vm->_eventsManager._rateCounter = 0;
_vm->_graphicsManager.lockScreen();
if (multiScreenFl) {
- if (*v10 != kByteStop) {
- _vm->_graphicsManager.Copy_WinScan_Vbe(v10, ptr);
- _vm->_graphicsManager.m_scroll16A(ptr, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ if (*screenP != kByteStop) {
+ _vm->_graphicsManager.Copy_WinScan_Vbe(screenP, screenCopy);
+ _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
- } else if (*v10 != kByteStop) {
- _vm->_graphicsManager.Copy_Video_Vbe16a(v10);
+ } else if (*screenP != kByteStop) {
+ _vm->_graphicsManager.Copy_Video_Vbe16a(screenP);
}
_vm->_graphicsManager.unlockScreen();
_vm->_graphicsManager.DD_VBL();
@@ -1024,9 +1012,9 @@ LABEL_54:
f.readUint16LE();
f.readUint16LE();
- f.read(v10, nbytes);
+ f.read(screenP, nbytes);
- memcpy(ptra, v10, 307200);
+ memcpy(ptra, screenP, 307200);
for (;;) {
memset(v11, 0, 19);
if (f.read(v11, 16) != 16)
@@ -1035,17 +1023,17 @@ LABEL_54:
if (strncmp((const char *)v11, "IMAGE=", 6))
break;
- f.read(v10, READ_LE_UINT32(v11 + 8));
- if (*v10 != kByteStop)
- _vm->_graphicsManager.Copy_WinScan_Vbe(v10, ptra);
+ f.read(screenP, READ_LE_UINT32(v11 + 8));
+ if (*screenP != kByteStop)
+ _vm->_graphicsManager.Copy_WinScan_Vbe(screenP, ptra);
}
_vm->_graphicsManager.fadeOutDefaultLength(ptra);
ptra = _vm->_globals.freeMemory(ptra);
}
if (multiScreenFl) {
if (_vm->_graphicsManager.FADE_LINUX == 2)
- _vm->_graphicsManager.fadeOutDefaultLength(ptr);
- _vm->_globals.freeMemory(ptr);
+ _vm->_graphicsManager.fadeOutDefaultLength(screenCopy);
+ _vm->_globals.freeMemory(screenCopy);
}
_vm->_graphicsManager.FADE_LINUX = 0;
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index 88b576ac00..d8d44a4641 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -557,7 +557,7 @@ void GraphicsManager::fadeIn(const byte *palette, int step, const byte *surface)
Common::fill(&palData2[0], &palData2[PALETTE_BLOCK_SIZE], 0);
// Set current palette to black
- setpal_vga256(palData2);
+ setPaletteVGA256(palData2);
// Loop through fading in the palette
for (int fadeIndex = 0; fadeIndex < fadeStep; ++fadeIndex) {
@@ -568,7 +568,7 @@ void GraphicsManager::fadeIn(const byte *palette, int step, const byte *surface)
}
// Set the transition palette and refresh the screen
- setpal_vga256(palData2);
+ setPaletteVGA256(palData2);
m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
DD_VBL();
@@ -577,7 +577,7 @@ void GraphicsManager::fadeIn(const byte *palette, int step, const byte *surface)
}
// Set the final palette
- setpal_vga256(palette);
+ setPaletteVGA256(palette);
// Refresh the screen
m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
@@ -603,7 +603,7 @@ void GraphicsManager::fadeOut(const byte *palette, int step, const byte *surface
palData[palOffset + 2] = (fadeStep - fadeIndex - 1) * palette[palOffset + 2] / (fadeStep - 1);
}
- setpal_vga256(palData);
+ setPaletteVGA256(palData);
m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
DD_VBL();
@@ -615,7 +615,7 @@ void GraphicsManager::fadeOut(const byte *palette, int step, const byte *surface
for (int i = 0; i < PALETTE_BLOCK_SIZE; i++)
palData[i] = 0;
- setpal_vga256(palData);
+ setPaletteVGA256(palData);
m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
return DD_VBL();
}
@@ -672,7 +672,7 @@ void GraphicsManager::fadeOutDefaultLength(const byte *surface) {
* Fade in used by for the breakout mini-game
*/
void GraphicsManager::fadeInBreakout() {
- setpal_vga256(_palette);
+ setPaletteVGA256(_palette);
lockScreen();
copy16bFromSurfaceScaleX2(_vesaBuffer);
unlockScreen();
@@ -686,7 +686,7 @@ void GraphicsManager::fateOutBreakout() {
byte palette[PALETTE_EXT_BLOCK_SIZE];
memset(palette, 0, PALETTE_EXT_BLOCK_SIZE);
- setpal_vga256(palette);
+ setPaletteVGA256(palette);
lockScreen();
copy16bFromSurfaceScaleX2(_vesaBuffer);
@@ -694,11 +694,11 @@ void GraphicsManager::fateOutBreakout() {
DD_VBL();
}
-void GraphicsManager::setpal_vga256(const byte *palette) {
+void GraphicsManager::setPaletteVGA256(const byte *palette) {
changePalette(palette);
}
-void GraphicsManager::setpal_vga256_linux(const byte *palette, const byte *surface) {
+void GraphicsManager::setPaletteVGA256WithRefresh(const byte *palette, const byte *surface) {
changePalette(palette);
m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
DD_VBL();
@@ -1841,7 +1841,7 @@ void GraphicsManager::NB_SCREEN() {
}
void GraphicsManager::SHOW_PALETTE() {
- setpal_vga256(_palette);
+ setPaletteVGA256(_palette);
}
void GraphicsManager::Copy_WinScan_Vbe(const byte *src, byte *dest) {
diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h
index c0faa466f8..e77c105a12 100644
--- a/engines/hopkins/graphics.h
+++ b/engines/hopkins/graphics.h
@@ -125,8 +125,8 @@ public:
void fadeInDefaultLength(const byte *surface);
void fadeInBreakout();
void fateOutBreakout();
- void setpal_vga256(const byte *palette);
- void setpal_vga256_linux(const byte *palette, const byte *surface);
+ void setPaletteVGA256(const byte *palette);
+ void setPaletteVGA256WithRefresh(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 changePalette(const byte *palette);
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index 8f50044b96..77f755971a 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -4588,7 +4588,7 @@ void HopkinsEngine::playIntro() {
_eventsManager.VBL();
memcpy(&paletteData2, _graphicsManager._palette, 796);
- _graphicsManager.setpal_vga256_linux(paletteData, _graphicsManager._vesaBuffer);
+ _graphicsManager.setPaletteVGA256WithRefresh(paletteData, _graphicsManager._vesaBuffer);
_graphicsManager.FIN_VISU();
if (shouldQuit())
@@ -4621,7 +4621,7 @@ void HopkinsEngine::playIntro() {
_eventsManager.VBL();
_globals.iRegul = 1;
- _graphicsManager.setpal_vga256_linux(paletteData2, _graphicsManager._vesaBuffer);
+ _graphicsManager.setPaletteVGA256WithRefresh(paletteData2, _graphicsManager._vesaBuffer);
int v9 = 0;
while (!shouldQuit() && !_eventsManager._escKeyFl) {
@@ -4642,7 +4642,7 @@ void HopkinsEngine::playIntro() {
_graphicsManager._palette[i] -= v12;
}
- _graphicsManager.setpal_vga256_linux(_graphicsManager._palette, _graphicsManager._vesaBuffer);
+ _graphicsManager.setPaletteVGA256WithRefresh(_graphicsManager._palette, _graphicsManager._vesaBuffer);
if (2 * v9 > 1) {
@@ -4650,7 +4650,7 @@ void HopkinsEngine::playIntro() {
_eventsManager.VBL();
}
- _graphicsManager.setpal_vga256_linux(paletteData2, _graphicsManager._vesaBuffer);
+ _graphicsManager.setPaletteVGA256WithRefresh(paletteData2, _graphicsManager._vesaBuffer);
if (20 - v9 > 1) {
for (int i = 1; i < 20 - v9; i++)
_eventsManager.VBL();
@@ -4658,7 +4658,7 @@ void HopkinsEngine::playIntro() {
v9 += 2;
if (v9 > 15) {
- _graphicsManager.setpal_vga256_linux(paletteData, _graphicsManager._vesaBuffer);
+ _graphicsManager.setPaletteVGA256WithRefresh(paletteData, _graphicsManager._vesaBuffer);
for (uint j = 1; j < 100 / _globals._speed; ++j)
_eventsManager.VBL();
@@ -4673,7 +4673,7 @@ void HopkinsEngine::playIntro() {
_eventsManager.VBL();
Common::copy(&paletteData2[0], &paletteData2[PALETTE_BLOCK_SIZE], &_graphicsManager._palette[0]);
- _graphicsManager.setpal_vga256_linux(_graphicsManager._palette, _graphicsManager._vesaBuffer);
+ _graphicsManager.setPaletteVGA256WithRefresh(_graphicsManager._palette, _graphicsManager._vesaBuffer);
for (uint m = 0; m < 50 / _globals._speed; ++m) {
if (m == 30 / _globals._speed) {
diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp
index 8b20fa7e09..c87fcd7601 100644
--- a/engines/hopkins/talk.cpp
+++ b/engines/hopkins/talk.cpp
@@ -145,7 +145,7 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) {
_vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0);
_vm->_graphicsManager.initColorTable(145, 150, _vm->_graphicsManager._palette);
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
_vm->_graphicsManager.lockScreen();
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
_vm->_graphicsManager.unlockScreen();
@@ -223,7 +223,7 @@ void TalkManager::PARLER_PERSO2(const Common::String &filename) {
_vm->_eventsManager.changeMouseCursor(v8);
_vm->_graphicsManager.initColorTable(145, 150, _vm->_graphicsManager._palette);
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
_vm->_objectsManager._disableCursorFl = false;
_vm->_globals._disableInventFl = v7;
STATI = 0;
@@ -520,7 +520,7 @@ void TalkManager::searchCharacterPalette(int startIdx, bool dark) {
else
_characterPalette[761] = 255;
- _vm->_graphicsManager.setpal_vga256(_characterPalette);
+ _vm->_graphicsManager.setPaletteVGA256(_characterPalette);
_vm->_graphicsManager.initColorTable(145, 150, _characterPalette);
}
@@ -1186,11 +1186,11 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) {
_vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0);
_vm->_graphicsManager.initColorTable(145, 150, _vm->_graphicsManager._palette);
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
_vm->_graphicsManager.lockScreen();
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
_vm->_graphicsManager.unlockScreen();
- _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager._palette);
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
memcpy(_vm->_graphicsManager._vesaBuffer, _vm->_graphicsManager._vesaScreen, 614399);
_vm->_globals._disableInventFl = false;
_vm->_graphicsManager.DD_VBL();