aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukaslw2014-06-24 05:21:12 +0200
committerlukaslw2014-06-25 16:05:01 +0200
commite453f23f04889c7b33276240c45e9f2e5eb70206 (patch)
tree5dbd2031d538af0c2dd90562ca471289d18dc9ed
parent9a13423829ec001cf588e2607b5a90785f501f89 (diff)
downloadscummvm-rg350-e453f23f04889c7b33276240c45e9f2e5eb70206.tar.gz
scummvm-rg350-e453f23f04889c7b33276240c45e9f2e5eb70206.tar.bz2
scummvm-rg350-e453f23f04889c7b33276240c45e9f2e5eb70206.zip
PRINCE: leftMouseButton() - code clean up
-rw-r--r--engines/prince/prince.cpp28
1 files changed, 7 insertions, 21 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 44e2ec9639..358baad762 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -1686,32 +1686,27 @@ void PrinceEngine::drawInvItems() {
void PrinceEngine::leftMouseButton() {
int option = 0;
+ int optionEvent = -1;
if (_optionsFlag) {
if (_optionEnabled < _optionsNumber) {
option = _optionEnabled;
_optionsFlag = 0;
- // edi = optionsMob
- // ebp = optionsMobNumber
} else {
return;
}
} else {
- // edi = currentMob
- // ebp = currentMobNumber
_optionsMob = _selectedMob;
- if (_selectedMob == 0) {
+ if (_optionsMob == 0) {
// @@walkto - TODO
return;
}
option = 0;
}
//do_option
- // selectedMob = optionsMobNumber
if (_currentPointerNumber != 2) {
//skip_use_code
int optionScriptOffset = _script->getOptionScript(_room->_walkTo, option);
- int optionEvent;
if (optionScriptOffset != 0) {
optionEvent = _script->scanMobEvents(_optionsMob, optionScriptOffset);
} else {
@@ -1725,13 +1720,8 @@ void PrinceEngine::leftMouseButton() {
optionEvent = _script->getOptionScript(_script->_scriptInfo.stdExamine, option - 1);
}
}
- // eax <- return (int)READ_UINT16(&_data[optionEvent]);
- // store_new_pc:
- // storeNewPC();
- return;
} else if (_selectedMode != 0) {
//give_item
- int optionEvent = -1;
if (_room->_itemGive != 0) {
optionEvent = _script->scanMobEventsWithItem(_optionsMob, _room->_itemGive, _selectedItem);
}
@@ -1739,12 +1729,7 @@ void PrinceEngine::leftMouseButton() {
//standard_giveitem
optionEvent = _script->_scriptInfo.stdGiveItem;
}
- // eax <- return (int)READ_UINT16(&_data[optionEvent]);
- // store_new_pc:
- // storeNewPC();
- return;
} else {
- int optionEvent = -1;
if (_room->_itemUse != 0) {
optionEvent = _script->scanMobEventsWithItem(_optionsMob, _room->_itemUse, _selectedItem);
_flags->setFlagValue(Flags::SELITEM, _selectedItem);
@@ -1753,11 +1738,12 @@ void PrinceEngine::leftMouseButton() {
//standard_useitem
optionEvent = _script->_scriptInfo.stdUseItem;
}
- // eax <- return (int)READ_UINT16(&_data[optionEvent]);
- // store_new_pc:
- // storeNewPC();
- return;
}
+ // eax <- return (int)READ_UINT16(&_data[optionEvent]);
+ // storeNewPC();
+ _flags->setFlagValue(Flags::CURRMOB, _selectedMob);
+ _selectedMob = 0;
+ _optionsMob = 0;
}
void PrinceEngine::rightMouseButton() {