removed unneeded opcodes

svn-id: r24618
This commit is contained in:
Gregory Montoir 2006-11-05 00:40:35 +00:00
parent 102969f820
commit 4f4be11631
3 changed files with 5 additions and 77 deletions

View File

@ -79,8 +79,8 @@ void ToucheEngine::setupOpcodes() {
0,
0,
/* 0x28 */
&ToucheEngine::op_getScriptValue,
&ToucheEngine::op_setScriptValue,
0,
0,
0,
0,
/* 0x2C */
@ -114,7 +114,7 @@ void ToucheEngine::setupOpcodes() {
&ToucheEngine::op_startEpisode,
&ToucheEngine::op_setConversationNum,
/* 0x44 */
&ToucheEngine::op_enableInventoryItem,
0,
&ToucheEngine::op_enableInput,
&ToucheEngine::op_disableInput,
&ToucheEngine::op_faceKeyChar,
@ -139,7 +139,7 @@ void ToucheEngine::setupOpcodes() {
&ToucheEngine::op_fadePalette,
0,
/* 0x58 */
&ToucheEngine::op_disableInventoryItem,
0,
0,
0,
0,
@ -172,7 +172,7 @@ void ToucheEngine::setupOpcodes() {
&ToucheEngine::op_startMusic,
0,
0,
&ToucheEngine::op_copyPaletteColor,
0,
/* 0x74 */
&ToucheEngine::op_delay,
&ToucheEngine::op_lockHitBox,
@ -422,20 +422,6 @@ void ToucheEngine::op_fetchScriptByte() {
*_script.stackDataPtr = val;
}
void ToucheEngine::op_getScriptValue() {
debugC(9, kDebugOpcodes, "ToucheEngine::op_getScriptValue()");
uint8 index = _script.readNextByte();
assert(index < _script.stackDataBasePtr[2]);
*_script.stackDataPtr = _script.stackDataBasePtr[3 + index];
}
void ToucheEngine::op_setScriptValue() {
debugC(9, kDebugOpcodes, "ToucheEngine::op_setScriptValue()");
uint8 index = _script.readNextByte();
assert(index < _script.stackDataBasePtr[2]);
_script.stackDataBasePtr[3 + index] = *_script.stackDataPtr;
}
void ToucheEngine::op_getKeyCharWalkBox() {
debugC(9, kDebugOpcodes, "ToucheEngine::op_getKeyCharWalkBox()");
int16 keyChar = _script.readNextWord();
@ -620,14 +606,6 @@ void ToucheEngine::op_setConversationNum() {
_conversationNum = _script.readNextWord();
}
void ToucheEngine::op_enableInventoryItem() {
debugC(9, kDebugOpcodes, "ToucheEngine::op_enableInventoryItem()");
int16 flag = _script.readNextWord();
int16 item = _script.readNextWord();
int16 rnd = _script.readNextWord();
changeInventoryItemState(flag, item, rnd, 1);
}
void ToucheEngine::op_enableInput() {
debugC(9, kDebugOpcodes, "ToucheEngine::op_enableInput()");
++_disabledInputCounter;
@ -792,14 +770,6 @@ void ToucheEngine::op_fadePalette() {
}
}
void ToucheEngine::op_disableInventoryItem() {
debugC(9, kDebugOpcodes, "ToucheEngine::op_disableInventoryItem()");
int16 flag = _script.readNextWord();
int16 item = _script.readNextWord();
int16 rnd = _script.readNextWord();
changeInventoryItemState(flag, item, rnd, 0);
}
void ToucheEngine::op_getInventoryItemFlags() {
debugC(9, kDebugOpcodes, "ToucheEngine::op_getInventoryItemFlags()");
int16 item = _script.readNextWord();
@ -891,13 +861,6 @@ void ToucheEngine::op_startMusic() {
_newMusicNum = _script.readNextWord();
}
void ToucheEngine::op_copyPaletteColor() {
debugC(9, kDebugOpcodes, "ToucheEngine::op_copyPaletteColor()");
int16 src = _script.readNextWord();
int16 dst = _script.readNextWord();
copyPaletteColor(src, dst);
}
void ToucheEngine::op_delay() {
debugC(9, kDebugOpcodes, "ToucheEngine::op_delay()");
int16 delay = _script.readNextWord();

View File

@ -2142,30 +2142,6 @@ void ToucheEngine::removeItemFromInventory(int inventory, int16 item) {
}
}
void ToucheEngine::changeInventoryItemState(int flag, int itemNum, int itemRnd, int inventoryItem) {
const int rnd = getRandomNumber(100) + 1;
if (inventoryItem) {
itemNum = _keyCharsTable[_currentKeyCharNum].inventoryItems[itemNum];
}
if (_flagsTable[174]) {
itemNum /= 2;
_flagsTable[174] = 0;
}
int16 value;
if (itemNum > itemRnd) {
value = 1;
} else if (rnd < itemNum / 6) {
value = 0;
} else if (rnd <= itemNum) {
value = 1;
} else if (rnd >= itemNum * 2) {
value = 2;
} else {
value = 3;
}
_flagsTable[flag] = value;
}
void ToucheEngine::resetTalkingVars() {
_talkListCurrent = 0;
_talkListEnd = 0;
@ -3245,10 +3221,6 @@ void ToucheEngine::setPalette(int firstColor, int colorCount, int rScale, int gS
_system->setPalette(&pal[firstColor * 4], firstColor, colorCount);
}
void ToucheEngine::copyPaletteColor(int srcColorIndex, int dstColorIndex) {
memcpy(&_paletteBuffer[dstColorIndex * 4], &_paletteBuffer[srcColorIndex * 4], 4);
}
void ToucheEngine::updateScreenArea(const uint8 *src, int srcPitch, int srcX, int srcY, int dstX, int dstY, int w, int h) {
_system->copyRectToScreen(src + srcY * srcPitch + srcX, srcPitch, dstX, dstY, w, h);
_system->updateScreen();

View File

@ -406,7 +406,6 @@ protected:
void appendItemToInventoryList(int index);
void addItemToInventory(int inventory, int16 item);
void removeItemFromInventory(int inventory, int16 item);
void changeInventoryItemState(int flag, int itemNum, int itemRnd, int inventoryItem);
void resetTalkingVars();
int updateKeyCharTalk(int pauseFlag);
@ -447,7 +446,6 @@ protected:
void addToDirtyRect(const Common::Rect &r);
void clearDirtyRects();
void setPalette(int firstColor, int colorCount, int redScale, int greenScale, int blueScale);
void copyPaletteColor(int srcColorIndex, int dstColorIndex);
void updateScreenArea(const uint8 *src, int srcPitch, int srcX, int srcY, int dstX, int dstY, int w, int h);
void updateEntireScreen();
void updateDirtyScreenAreas();
@ -489,8 +487,6 @@ protected:
void op_getFlag();
void op_setFlag();
void op_fetchScriptByte();
void op_getScriptValue();
void op_setScriptValue();
void op_getKeyCharWalkBox();
void op_startSound();
void op_initKeyCharTalk();
@ -510,7 +506,6 @@ protected:
void op_setInventoryItem();
void op_startEpisode();
void op_setConversationNum();
void op_enableInventoryItem();
void op_enableInput();
void op_disableInput();
void op_faceKeyChar();
@ -528,7 +523,6 @@ protected:
void op_giveItemTo();
void op_resetHitBoxes();
void op_fadePalette();
void op_disableInventoryItem();
void op_getInventoryItemFlags();
void op_drawInventory();
void op_stopKeyCharScript();
@ -539,7 +533,6 @@ protected:
void op_startAnimation();
void op_setKeyCharTextColor();
void op_startMusic();
void op_copyPaletteColor();
void op_delay();
void op_lockHitBox();
void op_removeItemFromInventory();