aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-04-06 08:43:20 +0000
committerTravis Howell2006-04-06 08:43:20 +0000
commitdd9f4d9f99097f0ae96abaa958e426fb396c7d66 (patch)
tree68967cb56cc3dfc1b977c97e56e3940d8d53c7b4 /engines
parent3023f6f76ee0bcbbd8dd82849f4ed2b7afb7e4c9 (diff)
downloadscummvm-rg350-dd9f4d9f99097f0ae96abaa958e426fb396c7d66.tar.gz
scummvm-rg350-dd9f4d9f99097f0ae96abaa958e426fb396c7d66.tar.bz2
scummvm-rg350-dd9f4d9f99097f0ae96abaa958e426fb396c7d66.zip
Remove duplicate code in last commit and minor fixes for FF
svn-id: r21639
Diffstat (limited to 'engines')
-rw-r--r--engines/simon/simon.cpp10
-rw-r--r--engines/simon/simon.h4
-rw-r--r--engines/simon/verb.cpp34
3 files changed, 26 insertions, 22 deletions
diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp
index dde392d131..d41de44243 100644
--- a/engines/simon/simon.cpp
+++ b/engines/simon/simon.cpp
@@ -286,7 +286,7 @@ SimonEngine::SimonEngine(OSystem *syst)
_iOverflow = 0;
_hitAreaObjectItem = 0;
_lastHitArea = 0;
- _lastHitArea2Ptr = 0;
+ _lastNameOn = 0;
_lastHitArea3 = 0;
_leftButtonDown = 0;
_hitAreaSubjectItem = 0;
@@ -1603,9 +1603,9 @@ void SimonEngine::setup_cond_c_helper() {
_lastHitArea = 0;
_hitAreaObjectItem = NULL;
- last = _lastHitArea2Ptr;
- defocusHitarea();
- _lastHitArea2Ptr = last;
+ last = _lastNameOn;
+ clearName();
+ _lastNameOn = last;
for (;;) {
_lastHitArea = NULL;
@@ -1646,7 +1646,7 @@ void SimonEngine::setup_cond_c_helper() {
out_of_here:
_lastHitArea3 = 0;
_lastHitArea = 0;
- _lastHitArea2Ptr = NULL;
+ _lastNameOn = NULL;
_mouseCursor = 0;
_noRightClick = 0;
}
diff --git a/engines/simon/simon.h b/engines/simon/simon.h
index d1addbd497..00555f87ae 100644
--- a/engines/simon/simon.h
+++ b/engines/simon/simon.h
@@ -280,7 +280,7 @@ protected:
Item *_hitAreaObjectItem;
HitArea *_lastHitArea;
- HitArea *_lastHitArea2Ptr;
+ HitArea *_lastNameOn;
HitArea *_lastHitArea3;
byte _leftButtonDown;
byte _rightButtonDown;
@@ -632,7 +632,7 @@ protected:
void invokeTimeEvent(TimeEvent *te);
bool kickoffTimeEvents();
- void defocusHitarea();
+ void clearName();
void endCutscene();
void runSubroutine101();
void checkUp(WindowBlock *window);
diff --git a/engines/simon/verb.cpp b/engines/simon/verb.cpp
index 3cf0b4fd94..42dbd11f75 100644
--- a/engines/simon/verb.cpp
+++ b/engines/simon/verb.cpp
@@ -188,22 +188,22 @@ static const char *const english_verb_prep_names[] = {
"", "", "", "to whom ?"
};
-void SimonEngine::defocusHitarea() {
+void SimonEngine::clearName() {
HitArea *last;
HitArea *ha;
if (getGameType() == GType_FF) {
- if (getBitFlag(79)) {
- o_sync(202);
- _lastHitArea2Ptr = NULL;
- return;
- }
+ o_kill_sprite_simon2(2, 6);
+ _lastNameOn = NULL;
+ //_animatePointer = 0;
+ _mouseAnim = 1;
+ return;
}
if (getGameType() == GType_SIMON2) {
if (getBitFlag(79)) {
o_sync(202);
- _lastHitArea2Ptr = NULL;
+ _lastNameOn = NULL;
return;
}
}
@@ -311,7 +311,7 @@ void SimonEngine::hitareaChangedHelper() {
if (window != NULL && window->text_color != 0)
clearWindow(window);
- _lastHitArea2Ptr = NULL;
+ _lastNameOn = NULL;
_hitAreaPtr7 = NULL;
}
@@ -365,8 +365,8 @@ void SimonEngine::delete_hitarea(uint hitarea) {
HitArea *ha = findHitAreaByID(hitarea);
if (ha != NULL) {
ha->flags = 0;
- if (ha == _lastHitArea2Ptr)
- defocusHitarea();
+ if (ha == _lastNameOn)
+ clearName();
_needHitAreaRecalc++;
}
}
@@ -625,8 +625,12 @@ void SimonEngine::setup_hitarea_from_pos(uint x, uint y, uint mode) {
uint count = ARRAYSIZE(_hitAreas);
uint16 priority = 0;
uint16 x_ = x;
- const uint16 y_ = y;
+ uint16 y_ = y;
+ if (getGameType() == GType_FF) {
+ x_ += _scrollX;
+ y_ += _scrollY;
+ }
if (getGameType() == GType_SIMON2) {
if (getBitFlag(79) || y < 134) {
x_ += _scrollX * 8;
@@ -657,7 +661,7 @@ void SimonEngine::setup_hitarea_from_pos(uint x, uint y, uint mode) {
_currentBoxNumber = 0;
if (best_ha == NULL) {
- defocusHitarea();
+ clearName();
return;
}
@@ -670,8 +674,8 @@ void SimonEngine::setup_hitarea_from_pos(uint x, uint y, uint mode) {
}
if (best_ha->flags & 4) {
- defocusHitarea();
- } else if (best_ha != _lastHitArea2Ptr) {
+ clearName();
+ } else if (best_ha != _lastNameOn) {
displayName(best_ha);
}
@@ -694,7 +698,7 @@ void SimonEngine::displayName(HitArea *ha) {
}
if (result)
- _lastHitArea2Ptr = ha;
+ _lastNameOn = ha;
}
bool SimonEngine::printTextOf(uint a) {