cleanup; got rid of o2_printEgo

svn-id: r7300
This commit is contained in:
Max Horn 2003-05-04 01:10:45 +00:00
parent 781564d401
commit 3b77249ab0
4 changed files with 24 additions and 30 deletions

View file

@ -39,7 +39,7 @@
// Note: This is purely experimental, NOT WORKING COMPLETLY and very buggy.
// Please do not make reports about problems with it - this is only in CVS
// to get it fixed and so that really interested parties can experiment it.
// It is NOT FIT FOR GENERAL USAGE!. You have been warned.
// It is NOT FIT FOR GENERAL USAGE! You have been warned.
//
// Doing this correctly will be quite some more complicated. Basically, with smooth
// scrolling, the virtual screen strips don't match the display screen strips.

View file

@ -44,7 +44,7 @@ protected:
virtual void executeOpcode(int i);
virtual const char *getOpcodeDesc(int i);
void decodeParseString();
virtual void decodeParseString();
int getWordVararg(int *ptr);
/* Version 5 script opcodes */
@ -172,9 +172,6 @@ protected:
};
class Scumm_v2 : public Scumm_v3 {
public:
Scumm_v2(GameDetector *detector, OSystem *syst) : Scumm_v3(detector, syst) {}
protected:
void readIndexFile();
void loadCharset(int no);
@ -188,11 +185,18 @@ protected:
const OpcodeEntryV2 *_opcodesV2;
virtual void setupScummVars();
public:
Scumm_v2(GameDetector *detector, OSystem *syst) : Scumm_v3(detector, syst) {}
protected:
virtual void setupOpcodes();
virtual void executeOpcode(int i);
virtual const char *getOpcodeDesc(int i);
virtual void setupScummVars();
virtual void decodeParseString();
virtual void ifStateCommon(byte type);
virtual void ifNotStateCommon(byte type);
virtual void setStateCommon(byte type);
@ -225,7 +229,6 @@ protected:
void o2_ifNotState02();
void o2_ifState01();
void o2_ifNotState01();
void o2_printEgo();
void o2_actorSet();
void o2_waitForActor();
void o2_waitForSentence();
@ -296,18 +299,16 @@ public:
protected:
virtual void setupOpcodes();
virtual void executeOpcode(int i);
virtual const char *getOpcodeDesc(int i);
virtual void setupScummVars();
int popRoomAndObj(int *room);
void shuffleArray(int num, int minIdx, int maxIdx);
virtual void decodeParseString(int a, int b);
int getStackList(int *args, uint maxnum);
int popRoomAndObj(int *room);
void shuffleArray(int num, int minIdx, int maxIdx);
/* Version 6 script opcodes */
void o6_setBlastObjectWindow();
@ -509,20 +510,19 @@ public:
protected:
virtual void setupOpcodes();
virtual void executeOpcode(int i);
virtual const char *getOpcodeDesc(int i);
virtual void setupScummVars();
virtual void decodeParseString(int m, int n);
virtual uint fetchScriptWord();
virtual int fetchScriptWordSigned();
virtual int readVar(uint var);
virtual void writeVar(uint var, int value);
virtual void decodeParseString(int m, int n);
/* Version 8 script opcodes */
void o8_mod();
void o8_wait();

View file

@ -303,7 +303,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o5_getActorMoving),
OPCODE(o2_setState02),
/* D8 */
OPCODE(o2_printEgo),
OPCODE(o5_printEgo),
OPCODE(o2_doSentence),
OPCODE(o5_add),
OPCODE(o2_setBitVar),
@ -832,14 +832,11 @@ void Scumm_v2::o2_doSentence() {
}
}
void Scumm_v2::o2_printEgo() {
//_actorToPrintStrFor = (unsigned char)_vars[VAR_EGO];
//_messagePtr = _scriptPointer;
char buffer[256]; // FIXME
char *ptr = buffer;
char c;
while ((c = *_scriptPointer++)) {
void Scumm_v2::decodeParseString() {
byte buffer[256]; // FIXME
byte *ptr = buffer;
byte c;
while ((c = fetchScriptByte())) {
if (c & 0x80) {
*ptr++ = c & 0x7f;
*ptr++ = ' ';
@ -852,17 +849,14 @@ void Scumm_v2::o2_printEgo() {
*ptr++ = c;
if (c > 3) {
*ptr++ = 0;
*ptr++ = *_scriptPointer++;
*ptr++ = fetchScriptByte();
}
} else
*ptr++ = c;
}
*ptr = 0;
printf("o2_printEgo(%s)\n", buffer);
//_messagePtr = addMessageToStack(_messagePtr);
//_scriptPointer = _messagePtr;
printf("TODO: Scumm_v2::decodeParseString(\"%s\")\n", buffer);
}
void Scumm_v2::o2_ifClassOfIs() {

View file

@ -1440,7 +1440,7 @@ void Scumm_v5::o5_print() {
}
void Scumm_v5::o5_printEgo() {
_actorToPrintStrFor = (unsigned char)_vars[VAR_EGO];
_actorToPrintStrFor = (byte)_vars[VAR_EGO];
decodeParseString();
}