aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2007-12-14 19:21:19 +0000
committerGregory Montoir2007-12-14 19:21:19 +0000
commitbb30d560b2edaade39ce5fea556ed0106d1cea0d (patch)
tree24e00e209a44c8e3a87c9bb2678efb1ca4d79883
parent57460c21b3991944edacf75dbe5b8cfbe197b6f9 (diff)
downloadscummvm-rg350-bb30d560b2edaade39ce5fea556ed0106d1cea0d.tar.gz
scummvm-rg350-bb30d560b2edaade39ce5fea556ed0106d1cea0d.tar.bz2
scummvm-rg350-bb30d560b2edaade39ce5fea556ed0106d1cea0d.zip
renamed several structures, variables and functions
svn-id: r29860
-rw-r--r--engines/cine/anim.cpp10
-rw-r--r--engines/cine/anim.h6
-rw-r--r--engines/cine/cine.cpp41
-rw-r--r--engines/cine/gfx.cpp18
-rw-r--r--engines/cine/gfx.h7
-rw-r--r--engines/cine/main_loop.cpp47
-rw-r--r--engines/cine/pal.cpp9
-rw-r--r--engines/cine/pal.h2
-rw-r--r--engines/cine/script.cpp20
-rw-r--r--engines/cine/script.h12
-rw-r--r--engines/cine/texte.cpp36
-rw-r--r--engines/cine/texte.h8
-rw-r--r--engines/cine/various.cpp61
-rw-r--r--engines/cine/various.h22
14 files changed, 122 insertions, 177 deletions
diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index 522e0717d8..1b39340301 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -36,7 +36,7 @@
namespace Cine {
-struct animHeader2Struct {
+struct AnimHeader2Struct {
uint32 field_0;
uint16 width;
uint16 height;
@@ -48,9 +48,9 @@ struct animHeader2Struct {
static uint16 animDataCount = 0;
-animHeaderStruct animHeader;
+AnimHeaderStruct animHeader;
-animDataEntry animData[] = {
+static const AnimDataEntry animData[] = {
{"ALPHA", 0xF},
{"TITRE2", 0xF},
{"ET", 0xC},
@@ -519,7 +519,7 @@ void convert8BBP2(byte * dest, byte * source, int16 width, int16 height) {
}
void loadSet(const char *resourceName, int16 idx) {
- animHeader2Struct header2;
+ AnimHeader2Struct header2;
uint32 fullSize;
uint16 numSpriteInAnim;
int16 foundFileIdx = findFileInBundle(resourceName);
@@ -678,7 +678,7 @@ void loadResourcesFromSave() {
foundFileIdx = currentPtr->fileIdx;
- strcpy(animName, partBuffer[foundFileIdx].partName);
+ strcpy(animName, partBuffer[foundFileIdx].partName);
ptr = dataPtr = readBundleFile(foundFileIdx);
isSpl = (strstr(animName, ".SPL")) ? 1 : 0;
diff --git a/engines/cine/anim.h b/engines/cine/anim.h
index 92b5a646a9..92dbb2aaea 100644
--- a/engines/cine/anim.h
+++ b/engines/cine/anim.h
@@ -28,7 +28,7 @@
namespace Cine {
-struct animHeaderStruct {
+struct AnimHeaderStruct {
byte field_0;
byte field_1;
byte field_2;
@@ -49,13 +49,11 @@ struct animHeaderStruct {
uint16 field_14;
};
-struct animDataEntry {
+struct AnimDataEntry {
char name[9];
byte color;
};
-extern animDataEntry animData[];
-
void freeAnimDataTable(void);
void freeAnimDataRange(byte startIdx, byte numIdx);
void loadResource(const char *animName);
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index 0503dcd616..b5b83211c8 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -97,22 +97,19 @@ int CineEngine::init() {
}
int CineEngine::go() {
+ gfxInit();
CursorMan.showMouse(true);
-
mainLoop(1);
-
+ gfxDestroy();
delete g_sound;
return 0;
}
void CineEngine::initialize() {
- uint16 i;
-
setupOpcodes();
initLanguage(g_cine->getLanguage());
- gfxInit();
textDataPtr = (byte *)malloc(8000);
@@ -131,35 +128,13 @@ void CineEngine::initialize() {
loadErrmessDat("errmess.dat");
}
- for (i = 0; i < NUM_MAX_OBJECT; i++) {
- objectTable[i].part = 0;
- objectTable[i].name[0] = 0;
- }
-
- for (i = 0; i < NUM_MAX_VAR; i++) {
- globalVars[i] = 0;
- }
-
- for (i = 0; i < NUM_MAX_SCRIPT; i++) {
- scriptTable[i].ptr = NULL;
- scriptTable[i].size = 0;
- }
-
- for (i = 0; i < NUM_MAX_MESSAGE; i++) {
- messageTable[i].ptr = NULL;
- messageTable[i].len = 0;
- }
-
- for (i = 0; i < NUM_MAX_REL; i++) {
- relTable[i].data = NULL;
- relTable[i].size = 0;
- relTable[i].obj1Param1 = 0;
- relTable[i].obj1Param2 = 0;
- relTable[i].obj2Param = 0;
- relTable[i].runCount = 0;
- }
+ memset(objectTable, 0, sizeof(objectTable));
+ memset(globalVars, 0, sizeof(globalVars));
+ memset(scriptTable, 0, sizeof(scriptTable));
+ memset(messageTable, 0, sizeof(scriptTable));
+ memset(relTable, 0, sizeof(scriptTable));
- for (i = 0; i < NUM_MAX_ANIMDATA; i++) {
+ for (int i = 0; i < NUM_MAX_ANIMDATA; i++) {
animDataTable[i].ptr1 = animDataTable[i].ptr2 = NULL;
}
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 40cbc1857d..c76f62cdd7 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -35,6 +35,8 @@
namespace Cine {
uint16 c_palette[256];
+byte colorMode256 = 0;
+byte palette256[256 * 3];
byte *screenBuffer;
byte *page1Raw;
@@ -106,6 +108,13 @@ void gfxInit() {
additionalBgTable[8] = page3Raw;
}
+void gfxDestroy() {
+ free(screenBuffer);
+ free(page1Raw);
+ free(page2Raw);
+ free(page3Raw);
+}
+
void setMouseCursor(int cursor) {
static int currentMouseCursor = -1;
assert(cursor >= 0 && cursor < 3);
@@ -433,15 +442,6 @@ void fadeToBlack() {
}
}
-void gfxFuncGen1(byte *param1, byte *param2, byte *param3, byte *param4, int16 param5) {
-}
-
-void ptrGfxFunc13(void) {
-}
-
-void gfxFuncGen2(void) {
-}
-
void blitRawScreen(byte *frontBuffer) {
gfxFlipRawPage(frontBuffer);
}
diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h
index 72f01124fc..b2dc70f360 100644
--- a/engines/cine/gfx.h
+++ b/engines/cine/gfx.h
@@ -35,8 +35,11 @@ extern byte *page2Raw;
extern byte *page3Raw;
extern uint16 c_palette[256];
+extern byte colorMode256;
+extern byte palette256[256 * 3];
void gfxInit();
+void gfxDestroy();
void setMouseCursor(int cursor);
void gfxCopyPage(byte *source, byte *dest);
@@ -67,8 +70,8 @@ void drawSpriteRaw2(byte *spritePtr, byte transColor, int16 width, int16 height,
void fadeToBlack(void);
void gfxDrawMaskedSprite(byte *param1, byte *param2, byte *param3, byte *param4, int16 param5);
-void ptrGfxFunc13(void);
-void gfxFuncGen2(void);
+void gfxWaitVBL(void);
+void gfxRedrawMouseCursor(void);
void blitScreen(byte *frontBuffer, byte *backbuffer);
void blitRawScreen(byte *frontBuffer);
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index ad65cb4072..1af8cfb3cf 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -36,12 +36,12 @@
namespace Cine {
-struct mouseStatusStruct {
+struct MouseStatusStruct {
int left;
int right;
};
-mouseStatusStruct mouseData;
+MouseStatusStruct mouseData;
uint16 mouseRight = 0;
uint16 mouseLeft = 0;
@@ -62,7 +62,7 @@ static void processEvent(Common::Event &event) {
case Common::EVENT_MOUSEMOVE:
break;
case Common::EVENT_QUIT:
- g_system->quit();
+ exitEngine = 1;
break;
case Common::EVENT_KEYDOWN:
switch (event.kbd.keycode) {
@@ -180,7 +180,7 @@ int getKeyData() {
}
void CineEngine::mainLoop(int bootScriptIdx) {
- uint16 var_6;
+ bool playerAction;
uint16 quitFlag;
uint16 i;
byte di;
@@ -204,11 +204,9 @@ void CineEngine::mainLoop(int bootScriptIdx) {
menuVar = 0;
-// gfxFuncGen1(page0c, page0, page0c, page0, -1);
-
- ptrGfxFunc13();
-
- gfxFuncGen2();
+// gfxRedrawPage(page0c, page0, page0c, page0, -1);
+// gfxWaitVBL();
+// gfxRedrawMouseCursor();
inMenu = false;
allowPlayerInput = 0;
@@ -233,7 +231,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {
c_palette[i] = 0;
}
- var17 = 1;
+ _paletteNeedUpdate = true;
strcpy(newPrcName, "");
strcpy(newRelName, "");
@@ -247,13 +245,9 @@ void CineEngine::mainLoop(int bootScriptIdx) {
}
do {
- mainLoopSub3();
+ stopMusicAfterFadeOut();
di = executePlayerInput();
-// if (g_sfxPlayer->_fadeOutCounter != 0 && g_sfxPlayer->_fadeOutCounter < 100) {
-// g_sfxPlayer->stop();
-// }
-
processSeqList();
executeList1();
executeList0();
@@ -271,12 +265,11 @@ void CineEngine::mainLoop(int bootScriptIdx) {
flip();
if (waitForPlayerClick) {
- var_6 = 0;
-
- var20 <<= 3;
+ playerAction = false;
- if (var20 < 0x800)
- var20 = 0x800;
+ _messageLen <<= 3;
+ if (_messageLen < 0x800)
+ _messageLen = 0x800;
do {
manageEvents();
@@ -288,17 +281,9 @@ void CineEngine::mainLoop(int bootScriptIdx) {
do {
manageEvents();
getMouseData(mouseUpdateStatus, &mouseButton, &dummyU16, &dummyU16);
-
- if (mouseButton == 0) {
- if (processKeyboard(menuVar)) {
- var_6 = 1;
- }
- } else {
- var_6 = 1;
- }
-
+ playerAction = (mouseButton != 0) || processKeyboard(menuVar);
mainLoopSub6();
- } while (!var_6);
+ } while (!playerAction);
menuVar = 0;
@@ -329,7 +314,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {
manageEvents();
- } while (!exitEngine && !quitFlag && var21 != 7);
+ } while (!exitEngine && !quitFlag && _danKeysPressed != 7);
hideMouse();
g_sound->stopMusic();
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp
index f6754f9195..9341563898 100644
--- a/engines/cine/pal.cpp
+++ b/engines/cine/pal.cpp
@@ -30,15 +30,12 @@ namespace Cine {
uint16 tempPalette[256];
-byte colorMode256 = 0;
-byte palette256[256 * 3];
-
uint16 palEntriesCount;
PalEntry *palPtr = NULL;
-byte paletteBuffer1[16];
-byte paletteBuffer2[16];
+static byte paletteBuffer1[16];
+static byte paletteBuffer2[16];
void loadPal(const char *fileName) {
char buffer[20];
@@ -60,7 +57,7 @@ void loadPal(const char *fileName) {
palEntriesCount = palFileHandle.readUint16LE();
palFileHandle.readUint16LE(); // entry size
-
+
palPtr = (PalEntry *)malloc(palEntriesCount * sizeof(PalEntry));
assert(palPtr);
for (int i = 0; i < palEntriesCount; ++i) {
diff --git a/engines/cine/pal.h b/engines/cine/pal.h
index 89392e6ae6..da822fa1a1 100644
--- a/engines/cine/pal.h
+++ b/engines/cine/pal.h
@@ -37,8 +37,6 @@ struct PalEntry {
void loadPal(const char *fileName);
extern uint16 tempPalette[256];
-extern byte colorMode256;
-extern byte palette256[256 * 3];
void loadRelatedPalette(const char *fileName);
diff --git a/engines/cine/script.cpp b/engines/cine/script.cpp
index e4bb8c7d03..f4579a1365 100644
--- a/engines/cine/script.cpp
+++ b/engines/cine/script.cpp
@@ -175,9 +175,9 @@ void setupOpcodes() {
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
- { o1_op63, "wwww" },
+ { o1_setScreenDimensions, "wwww" },
/* 64 */
- { o1_op64, "" },
+ { o1_displayBackground, "" },
{ o1_initializeZoneData, "" },
{ o1_setZoneDataEntry, "bw" },
{ o1_getZoneDataEntry, "bb" },
@@ -335,9 +335,9 @@ void setupOpcodes() {
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
- { o1_op63, "wwww" },
+ { o1_setScreenDimensions, "wwww" },
/* 64 */
- { o1_op64, "" },
+ { o1_displayBackground, "" },
{ o1_initializeZoneData, "" },
{ o1_setZoneDataEntry, "bw" },
{ o1_getZoneDataEntry, "bb" },
@@ -525,7 +525,7 @@ uint16 isSeqRunning(uint16 param1, uint16 param2, uint16 param3) {
return 0;
}
-scriptStruct scriptTable[NUM_MAX_SCRIPT];
+ScriptStruct scriptTable[NUM_MAX_SCRIPT];
void stopGlobalScript(uint16 scriptIdx) {
prcLinkedListStruct *currentHead = &globalScriptsHead;
@@ -1429,8 +1429,8 @@ void o1_unloadAllMasks() {
unloadAllMasks();
}
-void o1_op63() {
- warning("STUB: o1_op63()");
+void o1_setScreenDimensions() {
+ warning("STUB: o1_setScreenDimensions()");
getNextWord();
getNextWord();
getNextWord();
@@ -1438,8 +1438,8 @@ void o1_op63() {
// setupScreenParam
}
-void o1_op64() {
- warning("STUB: o1_op64()");
+void o1_displayBackground() {
+ warning("STUB: o1_displayBackground()");
}
void o1_initializeZoneData() {
@@ -2761,7 +2761,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
sprintf(lineBuffer, "stopSample()\n");
break;
}
- case OP_79:
+ case 0x79:
{
byte param;
diff --git a/engines/cine/script.h b/engines/cine/script.h
index c3b3794cd2..2f39169a20 100644
--- a/engines/cine/script.h
+++ b/engines/cine/script.h
@@ -30,7 +30,7 @@ namespace Cine {
#define SCRIPT_STACK_SIZE 50
-struct scriptStruct {
+struct ScriptStruct {
byte *ptr;
uint16 size;
int16 stack[SCRIPT_STACK_SIZE];
@@ -38,9 +38,9 @@ struct scriptStruct {
#define NUM_MAX_SCRIPT 50
-extern scriptStruct scriptTable[NUM_MAX_SCRIPT];
+extern ScriptStruct scriptTable[NUM_MAX_SCRIPT];
- void setupOpcodes();
+void setupOpcodes();
void computeScriptStack(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize);
void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16 scriptIdx);
@@ -50,8 +50,6 @@ void dumpScript(char *dumpName);
#define OP_loadNewPrcName 0x41
#define OP_requestCheckPendingDataLoad 0x42
#define OP_endScript 0x50
-#define OP_changeDataDisk 0x6B
-#define OP_79 0x79
void addScriptToList0(uint16 idx);
int16 checkCollision(int16 objIdx, int16 x, int16 y, int16 numZones, int16 zoneIdx);
@@ -122,8 +120,8 @@ void o1_compareGlobalVar();
void o1_declareFunctionName();
void o1_freePartRange();
void o1_unloadAllMasks();
-void o1_op63();
-void o1_op64();
+void o1_setScreenDimensions();
+void o1_displayBackground();
void o1_initializeZoneData();
void o1_setZoneDataEntry();
void o1_getZoneDataEntry();
diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp
index 3090392301..066eab48e3 100644
--- a/engines/cine/texte.cpp
+++ b/engines/cine/texte.cpp
@@ -34,9 +34,9 @@ byte *textDataPtr;
byte textTable[256][2][16 * 8];
const char **failureMessages;
-const commandeType *defaultActionCommand;
-const commandeType *systemMenu;
-const commandeType *confirmMenu;
+const CommandeType *defaultActionCommand;
+const CommandeType *systemMenu;
+const CommandeType *confirmMenu;
const char **otherMessages;
const char *commandPrepositionOn;
@@ -200,7 +200,7 @@ void initLanguage(Common::Language lang) {
"A wall of silence ..."
};
- static const commandeType defaultActionCommand_EN[] = {
+ static const CommandeType defaultActionCommand_EN[] = {
"EXAMINE",
"TAKE",
"INVENTORY",
@@ -210,7 +210,7 @@ void initLanguage(Common::Language lang) {
"NOACTION"
};
- static const commandeType systemMenu_EN[] = {
+ static const CommandeType systemMenu_EN[] = {
"Pause",
"Restart Game",
"Quit",
@@ -230,7 +230,7 @@ void initLanguage(Common::Language lang) {
"on"
};
- static const commandeType confirmMenu_EN[] = {
+ static const CommandeType confirmMenu_EN[] = {
"Ok, go ahead ...",
"Absolutely Not!"
};
@@ -268,7 +268,7 @@ void initLanguage(Common::Language lang) {
"Un mur de silence ..."
};
- static const commandeType defaultActionCommand_FR[] = {
+ static const CommandeType defaultActionCommand_FR[] = {
"EXAMINER",
"PRENDRE",
"INVENTAIRE",
@@ -278,7 +278,7 @@ void initLanguage(Common::Language lang) {
"NOACTION"
};
- static const commandeType systemMenu_FR[] = {
+ static const CommandeType systemMenu_FR[] = {
"Pause",
"Nouvelle partie",
"Quitter",
@@ -287,7 +287,7 @@ void initLanguage(Common::Language lang) {
"Sauver la partie"
};
- static const commandeType confirmMenu_FR[] = {
+ static const CommandeType confirmMenu_FR[] = {
"Ok , Vas-y ...",
"Surtout Pas !"
};
@@ -336,7 +336,7 @@ void initLanguage(Common::Language lang) {
"Un muro de silencio ..."
};
- static const commandeType defaultActionCommand_ES[] = {
+ static const CommandeType defaultActionCommand_ES[] = {
"EXAMINAR",
"COGER",
"INVENTARIO",
@@ -346,7 +346,7 @@ void initLanguage(Common::Language lang) {
"NOACTION"
};
- static const commandeType systemMenu_ES[] = {
+ static const CommandeType systemMenu_ES[] = {
"Pause",
"Nueva partida",
"Abandonar",
@@ -355,7 +355,7 @@ void initLanguage(Common::Language lang) {
"Salvar la partida"
};
- static const commandeType confirmMenu_ES[] = {
+ static const CommandeType confirmMenu_ES[] = {
"Ok , Vas a ...",
"Nade de nada !"
};
@@ -404,7 +404,7 @@ void initLanguage(Common::Language lang) {
"Eine Wand des Schweigens..."
};
- static const commandeType defaultActionCommand_DE[] = {
+ static const CommandeType defaultActionCommand_DE[] = {
"Pr\x81""fe",
"Nimm",
"Bestand",
@@ -414,7 +414,7 @@ void initLanguage(Common::Language lang) {
"NOACTION"
};
- static const commandeType systemMenu_DE[] = {
+ static const CommandeType systemMenu_DE[] = {
"Pause",
"Spiel Neu Starten",
"Lassen",
@@ -423,7 +423,7 @@ void initLanguage(Common::Language lang) {
"Spiel Speichern"
};
- static const commandeType confirmMenu_DE[] = {
+ static const CommandeType confirmMenu_DE[] = {
"Gut, Weitermachen",
"Absolut Nicht!"
};
@@ -472,7 +472,7 @@ void initLanguage(Common::Language lang) {
"Un muro di silenzio ..."
};
- static const commandeType defaultActionCommand_IT[] = {
+ static const CommandeType defaultActionCommand_IT[] = {
"ESAMINARE",
"PRENDERE",
"INVENTARIO",
@@ -482,7 +482,7 @@ void initLanguage(Common::Language lang) {
"NOACTION"
};
- static const commandeType systemMenu_IT[] = {
+ static const CommandeType systemMenu_IT[] = {
"Pausa",
"Parte nuova",
"Quit",
@@ -491,7 +491,7 @@ void initLanguage(Common::Language lang) {
"Salvare una parte"
};
- static const commandeType confirmMenu_IT[] = {
+ static const CommandeType confirmMenu_IT[] = {
"Ok, vacci ...",
"Supratutto non!"
};
diff --git a/engines/cine/texte.h b/engines/cine/texte.h
index e2afec41dc..b5eaef9211 100644
--- a/engines/cine/texte.h
+++ b/engines/cine/texte.h
@@ -31,15 +31,15 @@
namespace Cine {
-typedef char commandeType[20];
+typedef char CommandeType[20];
extern byte *textDataPtr;
extern byte textTable[256][2][16 * 8];
extern const char **failureMessages;
-extern const commandeType *defaultActionCommand;
-extern const commandeType *systemMenu;
-extern const commandeType *confirmMenu;
+extern const CommandeType *defaultActionCommand;
+extern const CommandeType *systemMenu;
+extern const CommandeType *confirmMenu;
extern const char **otherMessages;
extern const char *commandPrepositionOn;
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index e4462d63c9..a15fa0b16a 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -44,9 +44,7 @@ int16 commandVar3[4];
int16 commandVar1;
int16 commandVar2;
-unk1Struct messageTable[NUM_MAX_MESSAGE];
-
-uint32 var6;
+Message messageTable[NUM_MAX_MESSAGE];
uint16 var2;
uint16 var3;
@@ -74,11 +72,9 @@ uint16 checkForPendingDataLoadSwitch;
uint16 isDrawCommandEnabled;
uint16 waitForPlayerClick;
uint16 menuCommandLen;
-uint16 var17;
-uint16 var18;
-uint16 var19;
-uint16 var20;
-byte var21;
+bool _paletteNeedUpdate;
+uint16 _messageLen;
+byte _danKeysPressed;
int16 playerCommand;
@@ -105,16 +101,16 @@ uint16 defaultMenuBoxColor;
byte inputVar1 = 0;
uint16 inputVar2 = 0, inputVar3 = 0;
-selectedObjStruct currentSelectedObject;
+SelectedObjStruct currentSelectedObject;
-static commandeType currentSaveName[10];
+static CommandeType currentSaveName[10];
int16 currentDisk;
static const int16 choiceResultTable[] = { 1, 1, 1, 2, 1, 1, 1 };
static const int16 subObjectUseTable[] = { 3, 3, 3, 3, 3, 0, 0 };
static const int16 canUseOnItemTable[] = { 1, 0, 0, 1, 1, 0, 0 };
-commandeType objectListCommand[20];
+CommandeType objectListCommand[20];
int16 objListTab[20];
uint16 exitEngine;
@@ -122,7 +118,10 @@ uint16 defaultMenuBoxColor2;
uint16 zoneData[NUM_MAX_ZONE];
-void mainLoopSub3(void) {
+void stopMusicAfterFadeOut(void) {
+// if (g_sfxPlayer->_fadeOutCounter != 0 && g_sfxPlayer->_fadeOutCounter < 100) {
+// g_sfxPlayer->stop();
+// }
}
int16 stopObjectScript(int16 entryIdx) {
@@ -217,7 +216,7 @@ void addPlayerCommandMessage(int16 cmd) {
currentHeadPtr->previous = pNewElement;
}
-int16 getRelEntryForObject(uint16 param1, uint16 param2, selectedObjStruct *pSelectedObject) {
+int16 getRelEntryForObject(uint16 param1, uint16 param2, SelectedObjStruct *pSelectedObject) {
int16 i;
int16 di = -1;
@@ -1016,7 +1015,7 @@ void drawMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 offset,
gfxDrawLine(x + width - offset, y + offset, x + width - offset, currentY + 4 - offset, color, page); // right
}
-void makeTextEntry(const commandeType commandList[], uint16 height, uint16 X, uint16 Y, uint16 width) {
+void makeTextEntry(const CommandeType commandList[], uint16 height, uint16 X, uint16 Y, uint16 width) {
byte color = 2;
byte color2 = defaultMenuBoxColor2;
int16 paramY = (height * 9) + 10;
@@ -1193,7 +1192,7 @@ void makeCommandLine(void) {
isDrawCommandEnabled = 1;
if (playerCommand != -1 && choiceResultTable[playerCommand] == commandVar1) {
- selectedObjStruct obj;
+ SelectedObjStruct obj;
obj.idx = commandVar3[0];
obj.param = commandVar3[1];
int16 di = getRelEntryForObject(playerCommand, commandVar1, &obj);
@@ -1215,7 +1214,7 @@ uint16 needMouseSave = 0;
uint16 menuVar4 = 0;
uint16 menuVar5 = 0;
-int16 makeMenuChoice(const commandeType commandList[], uint16 height, uint16 X, uint16 Y,
+int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X, uint16 Y,
uint16 width, bool recheckValue) {
byte color = 2;
byte color2 = defaultMenuBoxColor2;
@@ -1365,9 +1364,9 @@ int16 makeMenuChoice(const commandeType commandList[], uint16 height, uint16 X,
blitRawScreen(page1Raw);
- if (needMouseSave) {
- gfxFuncGen2();
- }
+// if (needMouseSave) {
+// gfxRedrawMouseCursor();
+// }
}
} while (!var_A);
@@ -1401,7 +1400,7 @@ void drawMenuBox(char *command, int16 x, int16 y) {
gfxDrawPlainBoxRaw(x, y, x + 300, y + 10, 0, page2Raw);
- drawMessageBox(x, y, 300, y + 6, -1, lColor, page2Raw);
+ drawMessageBox(x, y, 300, y + 6, -1, lColor, page2Raw);
x += 2;
y += 2;
@@ -1422,7 +1421,7 @@ void drawMenuBox(char *command, int16 x, int16 y) {
}
}
- gfxFuncGen2();
+// gfxRedrawMouseCursor();
}
void makeActionMenu(void) {
@@ -1516,7 +1515,7 @@ uint16 executePlayerInput(void) {
int16 relEntry;
drawMenuBox(commandBuffer, 10, defaultMenuBoxColor);
- selectedObjStruct obj;
+ SelectedObjStruct obj;
obj.idx = commandVar3[0];
obj.param = commandVar3[1];
@@ -1895,7 +1894,7 @@ void drawDialogueMessage(byte msgIdx, int16 x, int16 y, int16 width, int16 color
return;
}
- var20 += strlen(messagePtr);
+ _messageLen += strlen(messagePtr);
drawMessage(messagePtr, x, y, width, color);
@@ -1908,7 +1907,7 @@ void drawFailureMessage(byte cmd) {
const char *messagePtr = failureMessages[msgIdx];
int len = strlen(messagePtr);
- var20 += len;
+ _messageLen += len;
int16 width = 6 * len + 20;
@@ -1935,7 +1934,7 @@ void drawOverlays(void) {
backupOverlayPage();
- var20 = 0;
+ _messageLen = 0;
currentOverlay = (&overlayHead)->next;
@@ -1995,9 +1994,8 @@ void drawOverlays(void) {
drawDialogueMessage(messageIdx, x, y, partVar1, partVar2);
- //blitScreen(page0, NULL);
-
- gfxFuncGen2();
+ // blitScreen(page0, NULL);
+ // gfxRedrawMouseCursor();
waitForPlayerClick = 1;
@@ -2012,9 +2010,8 @@ void drawOverlays(void) {
drawFailureMessage(currentOverlay->objIdx);
- //blitScreen(page0, NULL);
-
- gfxFuncGen2();
+ // blitScreen(page0, NULL);
+ // gfxRedrawMouseCursor();
waitForPlayerClick = 1;
@@ -2577,7 +2574,7 @@ bool makeTextEntryMenu(const char *messagePtr, char *inputString, int stringMaxL
int quit = 0;
bool redraw = true;
- commandeType tempString;
+ CommandeType tempString;
int inputLength = strlen(inputString);
int inputPos = inputLength + 1;
diff --git a/engines/cine/various.h b/engines/cine/various.h
index ef20ea5714..314a0bd24b 100644
--- a/engines/cine/various.h
+++ b/engines/cine/various.h
@@ -35,21 +35,21 @@ namespace Cine {
void initLanguage(Common::Language lang);
-int16 makeMenuChoice(const commandeType commandList[], uint16 height, uint16 X, uint16 Y, uint16 width, bool recheckValue = false);
+int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X, uint16 Y, uint16 width, bool recheckValue = false);
void makeCommandLine(void);
void makeActionMenu(void);
extern bool disableSystemMenu;
extern bool inMenu;
-struct unk1Struct {
+struct Message {
byte *ptr;
uint16 len;
};
#define NUM_MAX_MESSAGE 255
-extern unk1Struct messageTable[NUM_MAX_MESSAGE];
+extern Message messageTable[NUM_MAX_MESSAGE];
struct SeqListElement {
struct SeqListElement *next;
@@ -71,15 +71,11 @@ struct SeqListElement {
extern SeqListElement seqList;
-extern uint32 var6;
-extern uint32 var8;
-
extern uint16 var2;
extern uint16 var3;
extern uint16 var4;
extern uint16 var5;
-void mainLoopSub1(void);
void setTextWindow(uint16 param1, uint16 param2, uint16 param3, uint16 param4);
extern uint16 errorVar;
@@ -93,11 +89,9 @@ extern bool fadeRequired;
extern uint16 isDrawCommandEnabled;
extern uint16 waitForPlayerClick;
extern uint16 menuCommandLen;
-extern uint16 var17;
-extern uint16 var18;
-extern uint16 var19;
-extern uint16 var20;
-extern byte var21;
+extern bool _paletteNeedUpdate;
+extern uint16 _messageLen;
+extern byte _danKeysPressed;
extern int16 playerCommand;
@@ -117,7 +111,7 @@ extern char currentCtName[15];
extern char currentPartName[15];
void stopSample(void);
-void mainLoopSub3(void);
+void stopMusicAfterFadeOut(void);
uint16 executePlayerInput(void);
void drawOverlays(void);
@@ -140,7 +134,7 @@ void hideMouse(void);
void removeExtention(char *dest, const char *source);
-struct selectedObjStruct {
+struct SelectedObjStruct {
int16 idx;
int16 param;
};