diff options
author | Vincent Hamm | 2007-11-11 01:04:40 +0000 |
---|---|---|
committer | Vincent Hamm | 2007-11-11 01:04:40 +0000 |
commit | 1bae92f2e1ba13a57239024942676cf33fec82b0 (patch) | |
tree | b146e65d3bb0593fb0f866adc80e9e898e6d8134 /engines/cruise/function.cpp | |
parent | 31d04d98dcfe9113b39520568bde07737a718f09 (diff) | |
download | scummvm-rg350-1bae92f2e1ba13a57239024942676cf33fec82b0.tar.gz scummvm-rg350-1bae92f2e1ba13a57239024942676cf33fec82b0.tar.bz2 scummvm-rg350-1bae92f2e1ba13a57239024942676cf33fec82b0.zip |
Implement dialogues
Detect french 256 colors version
svn-id: r29473
Diffstat (limited to 'engines/cruise/function.cpp')
-rw-r--r-- | engines/cruise/function.cpp | 80 |
1 files changed, 70 insertions, 10 deletions
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index b05d80874d..46d938b849 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -1360,26 +1360,47 @@ int16 Op_60(void) { } int16 Op_6F(void) { - int numArgs = popVar(); + int nbp = popVar(); + int param[160]; + char txt[40]; + char format[30]; + char nbf[20]; - assert(numArgs == 0); + for(int i=nbp-1; i>= 0; i--) + param[i] = popVar(); - { - popVar(); - char *string = (char *)popPtr(); + int val = popVar(); + char* pDest = (char*)popPtr(); - printf("partial opcode 6F sprintf (%s)\n", string); + if(!nbp) + sprintf(txt, "%d", val); + else + { + strcpy(format, "%"); + sprintf(nbf, "%d", param[0]); + strcat(format, nbf ); + strcat(format, "d"); + sprintf(txt, format, val); } + for(int i=0; txt[i]; i++) + *(pDest++) = txt[i]; + *(pDest++) = '\0'; + return 0; } int16 Op_6E(void) { - char *ptr0 = (char *)popPtr(); - char *ptr1 = (char *)popPtr(); + char *pSource = (char *)popPtr(); + char *pDest = (char *)popPtr(); - printf("partial opcode 6E (%s)(%s)\n", ptr0, ptr1); + while(*pDest) + pDest++; + while(*pSource) + *(pDest++) = *(pSource++); + *(pDest++) = '\0'; + return 0; } @@ -1419,7 +1440,7 @@ int16 Op_SetObjectAtNode(void) { int16 ovl = popVar(); if (!ovl) - ovl = currentScriptPtr->overlayNumber;; + ovl = currentScriptPtr->overlayNumber; int nodeInfo[2]; @@ -1476,6 +1497,42 @@ int16 Op_SetNodeColor(void) { return 0; } +int16 Op_SetXDial(void) { + int16 old; + + old = xdial; + xdial = popVar(); + + return old; +} + +int16 Op_DialogOn(void) { + dialogueObj = popVar(); + dialogueOvl = popVar(); + + if(dialogueOvl == 0) + dialogueOvl = currentScriptPtr->overlayNumber; + + dialogueEnabled = true; + + return 0; +} + +int16 Op_DialogOff(void) { + dialogueEnabled = false; + + objectReset(); + + if(menuTable[0]) { + freeMenu(menuTable[0]); + menuTable[0] = NULL; + changeCursor(CURSOR_NORMAL); + currentActiveMenu = -1; + } + + return 0; +} + void setupOpcodeTable(void) { int i; @@ -1528,6 +1585,8 @@ void setupOpcodeTable(void) { opcodeTablePtr[0x30] = Op_RemoveBackgroundIncrust; opcodeTablePtr[0x31] = Op_UnmergeBackgroundIncrust; opcodeTablePtr[0x32] = Op_freeBackgroundInscrustList; + opcodeTablePtr[0x33] = Op_DialogOn; + opcodeTablePtr[0x34] = Op_DialogOff; opcodeTablePtr[0x37] = Op_37; opcodeTablePtr[0x38] = Op_removeBackground; opcodeTablePtr[0x39] = Op_SetActiveBackgroundPlane; @@ -1568,6 +1627,7 @@ void setupOpcodeTable(void) { opcodeTablePtr[0x70] = Op_comment; opcodeTablePtr[0x71] = Op_SetColorrawLine; opcodeTablePtr[0x72] = Op_InitializeState2; + opcodeTablePtr[0x73] = Op_SetXDial; opcodeTablePtr[0x74] = Op_GetInitVar1; opcodeTablePtr[0x76] = Op_InitializeState6; opcodeTablePtr[0x79] = Op_PlayFXnterPlayerMenu; |