mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 13:13:58 +00:00
LOL: implement some opcodes for dialogue sequences
svn-id: r39051
This commit is contained in:
parent
bf894deb06
commit
b42b7a8b40
@ -1342,7 +1342,7 @@ int LoLEngine::clickedWall(Button *button) {
|
||||
return res;
|
||||
}
|
||||
|
||||
int LoLEngine::clickedScene(Button *button) {
|
||||
int LoLEngine::clickedSequenceWindow(Button *button) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1428,7 +1428,7 @@ bool LoLEngine::characterSays(int track, int charId, bool redraw) {
|
||||
return r ? textEnabled() : 1;
|
||||
}
|
||||
|
||||
int LoLEngine::playCharacterScriptChat(int charId, int mode, int unk1, char *str, EMCState *script, int16 *paramList, int16 paramIndex) {
|
||||
int LoLEngine::playCharacterScriptChat(int charId, int mode, int unk1, char *str, EMCState *script, const uint16 *paramList, int16 paramIndex) {
|
||||
int ch = 0;
|
||||
bool skipAnim = false;
|
||||
|
||||
|
@ -434,7 +434,7 @@ private:
|
||||
int clickedInventorySlot(Button *button);
|
||||
int clickedInventoryScroll(Button *button);
|
||||
int clickedWall(Button *button);
|
||||
int clickedScene(Button *button);
|
||||
int clickedSequenceWindow(Button *button);
|
||||
int clickedScroll(Button *button);
|
||||
int clickedUnk23(Button *button);
|
||||
int clickedUnk24(Button *button);
|
||||
@ -468,7 +468,7 @@ private:
|
||||
|
||||
// text
|
||||
bool characterSays(int track, int charId, bool redraw);
|
||||
int playCharacterScriptChat(int charId, int y, int unk1, char *str, EMCState *script, int16 *paramList, int16 paramIndex);
|
||||
int playCharacterScriptChat(int charId, int y, int unk1, char *str, EMCState *script, const uint16 *paramList, int16 paramIndex);
|
||||
|
||||
TextDisplayer_LoL *_txt;
|
||||
|
||||
@ -490,6 +490,7 @@ private:
|
||||
uint16 _unkEMC46[16];
|
||||
|
||||
// emc opcode
|
||||
int olol_drawScene(EMCState *script);
|
||||
int olol_setGameFlag(EMCState *script);
|
||||
int olol_testGameFlag(EMCState *script);
|
||||
int olol_loadLevelGraphics(EMCState *script);
|
||||
@ -552,6 +553,11 @@ private:
|
||||
int tlol_processWsaFrame(const TIM *tim, const uint16 *param);
|
||||
int tlol_displayText(const TIM *tim, const uint16 *param);
|
||||
|
||||
int tlol_initDialogueSequence(const TIM *tim, const uint16 *param);
|
||||
int tlol_restoreSceneAfterDialogueSequence(const TIM *tim, const uint16 *param);
|
||||
int tlol_fadeClearWindow(const TIM *tim, const uint16 *param);
|
||||
int tlol_playDialogueTalkText(const TIM *tim, const uint16 *param);
|
||||
|
||||
Common::Array<const TIMOpcode*> _timIngameOpcodes;
|
||||
|
||||
// translation
|
||||
|
@ -110,6 +110,12 @@ bool LoLEngine::checkSceneUpdateNeed(int func) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int LoLEngine::olol_drawScene(EMCState *script) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_drawScene(%p) (%d)", (const void *)script, stackPos(0));
|
||||
drawScene(stackPos(0));
|
||||
return 1;
|
||||
}
|
||||
|
||||
int LoLEngine::olol_setGameFlag(EMCState *script) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_setGameFlag(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
|
||||
if (stackPos(1))
|
||||
@ -883,6 +889,75 @@ int LoLEngine::tlol_displayText(const TIM *tim, const uint16 *param) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int LoLEngine::tlol_initDialogueSequence(const TIM *tim, const uint16 *param) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::tlol_initDialogueSequence(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]);
|
||||
this->initDialogueSequence(param[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int LoLEngine::tlol_restoreSceneAfterDialogueSequence(const TIM *tim, const uint16 *param) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::tlol_restoreSceneAfterDialogueSequence(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]);
|
||||
restoreSceneAfterDialogueSequence(param[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int LoLEngine::tlol_fadeClearWindow(const TIM *tim, const uint16 *param) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::tlol_fadeClearWindow(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]);
|
||||
uint8 *tmp = 0;
|
||||
|
||||
switch (param[0]) {
|
||||
case 0:
|
||||
_screen->fadeClearSceneWindow(10);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
tmp = _screen->getPalette(3);
|
||||
memcpy(tmp + 0x180, _screen->_currentPalette + 0x180, 0x180);
|
||||
_screen->loadSpecialColours(tmp);
|
||||
_screen->fadePalette(tmp, 10);
|
||||
_screen->_fadeFlag = 0;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_screen->fadeToBlack(10);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
tmp = _screen->getPalette(3);
|
||||
_screen->loadSpecialColours(tmp);
|
||||
_screen->fadePalette(tmp, 10);
|
||||
_screen->_fadeFlag = 0;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (_screen->_fadeFlag != 2)
|
||||
_screen->fadeClearSceneWindow(10);
|
||||
gui_drawPlayField();
|
||||
_screen->setPaletteBrightness(_screen->_currentPalette, _brightness, _lampOilStatus);
|
||||
_screen->_fadeFlag = 0;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
tmp = _screen->getPalette(3);
|
||||
_screen->loadSpecialColours(tmp);
|
||||
_screen->fadePalette(_screen->getPalette(1), 10);
|
||||
_screen->_fadeFlag = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int LoLEngine::tlol_playDialogueTalkText(const TIM *tim, const uint16 *param) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::tlol_playDialogueTalkText(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]);
|
||||
if (!snd_playCharacterSpeech(param[0], 0, 0) || textEnabled())
|
||||
_txt->printDialogueText(4, getLangString(param[0]), 0, param, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
typedef Common::Functor1Mem<EMCState*, int, LoLEngine> OpcodeV2;
|
||||
@ -902,7 +977,7 @@ void LoLEngine::setupOpcodeTable() {
|
||||
// 0x00
|
||||
OpcodeUnImpl();
|
||||
OpcodeUnImpl();
|
||||
OpcodeUnImpl();
|
||||
Opcode(olol_drawScene);
|
||||
Opcode(o1_getRand);
|
||||
|
||||
// 0x04
|
||||
@ -1205,14 +1280,14 @@ void LoLEngine::setupOpcodeTable() {
|
||||
SetTimOpcodeTable(_timIngameOpcodes);
|
||||
|
||||
// 0x00
|
||||
OpcodeTimUnImpl();
|
||||
OpcodeTimUnImpl();
|
||||
OpcodeTim(tlol_initDialogueSequence);
|
||||
OpcodeTim(tlol_restoreSceneAfterDialogueSequence);
|
||||
OpcodeTimUnImpl();
|
||||
OpcodeTimUnImpl();
|
||||
|
||||
// 0x04
|
||||
OpcodeTimUnImpl();
|
||||
OpcodeTimUnImpl();
|
||||
OpcodeTim(tlol_fadeClearWindow);
|
||||
OpcodeTimUnImpl();
|
||||
OpcodeTimUnImpl();
|
||||
|
||||
@ -1224,7 +1299,7 @@ void LoLEngine::setupOpcodeTable() {
|
||||
|
||||
// 0x0C
|
||||
OpcodeTimUnImpl();
|
||||
OpcodeTimUnImpl();
|
||||
OpcodeTim(tlol_playDialogueTalkText);
|
||||
OpcodeTimUnImpl();
|
||||
OpcodeTimUnImpl();
|
||||
|
||||
|
@ -499,6 +499,7 @@ void LoLEngine::drawMonster(uint16 id) {
|
||||
if (curFrm == -1) {
|
||||
////////////
|
||||
// TODO
|
||||
curFrm=curFrm;
|
||||
|
||||
} else {
|
||||
int d = m->flags & 7;
|
||||
@ -934,8 +935,6 @@ void LoLEngine::shiftMonster(MonsterInPlay *monster) {
|
||||
if (monster->properties->flags & 0x400)
|
||||
return;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
} // end of namespace Kyra
|
||||
|
@ -1861,7 +1861,7 @@ void LoLEngine::assignButtonCallback(Button *button, int index) {
|
||||
cb(clickedInventoryScroll),
|
||||
cb(clickedWall),
|
||||
cb(clickedWall),
|
||||
cb(clickedScene),
|
||||
cb(clickedSequenceWindow),
|
||||
cb(clickedUpArrow),
|
||||
cb(clickedDownArrow),
|
||||
cb(clickedLeftArrow),
|
||||
|
@ -131,7 +131,7 @@ void TextDisplayer_LoL::setAnimParameters(const char *str, int x, uint8 col1, ui
|
||||
}
|
||||
}
|
||||
|
||||
void TextDisplayer_LoL::printDialogueText(int dim, char *str, EMCState *script, int16 *paramList, int16 paramIndex) {
|
||||
void TextDisplayer_LoL::printDialogueText(int dim, char *str, EMCState *script, const uint16 *paramList, int16 paramIndex) {
|
||||
_colour1prot = false;
|
||||
int oldDim = _screen->curDimIndex();
|
||||
|
||||
@ -213,7 +213,7 @@ void TextDisplayer_LoL::printMessage(uint16 type, char *str, ...) {
|
||||
_vm->_fadeText = false;
|
||||
}
|
||||
|
||||
void TextDisplayer_LoL::preprocessString(char *str, EMCState *script, int16 *paramList, int16 paramIndex) {
|
||||
void TextDisplayer_LoL::preprocessString(char *str, EMCState *script, const uint16 *paramList, int16 paramIndex) {
|
||||
char *dst = _dialogueBuffer;
|
||||
|
||||
for (char *s = str; *s;) {
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
void setupField(bool mode);
|
||||
void expandField();
|
||||
|
||||
void printDialogueText(int dim, char *str, EMCState *script, int16 *paramList, int16 paramIndex);
|
||||
void printDialogueText(int dim, char *str, EMCState *script, const uint16 *paramList, int16 paramIndex);
|
||||
void printMessage(uint16 type, char *str, ...);
|
||||
|
||||
int16 _scriptParameter;
|
||||
@ -54,7 +54,7 @@ private:
|
||||
char parseCommand();
|
||||
void readNextPara();
|
||||
void printLine(char *str);
|
||||
void preprocessString(char *str, EMCState *script, int16 *paramList, int16 paramIndex);
|
||||
void preprocessString(char *str, EMCState *script, const uint16 *paramList, int16 paramIndex);
|
||||
|
||||
//typedef void (LoLEngine::*DialogueAnimCallback)(const char *str, uint16 lineWidth, uint8 col1, uint8 col2);
|
||||
//DialogueAnimCallback _dlgAnimCallback;
|
||||
|
Loading…
x
Reference in New Issue
Block a user