aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-21 19:19:03 +0000
committerFilippos Karapetis2009-10-21 19:19:03 +0000
commitb105d690e398b47063b332245a783190f2cc84de (patch)
tree304b3c0fc5c2538430f949f77ec8075d3f7894ee /engines
parent95cefe311c29a5ea81ac17db25ecf142bd8352de (diff)
downloadscummvm-rg350-b105d690e398b47063b332245a783190f2cc84de.tar.gz
scummvm-rg350-b105d690e398b47063b332245a783190f2cc84de.tar.bz2
scummvm-rg350-b105d690e398b47063b332245a783190f2cc84de.zip
- Removed kShow() and the related code it uses - it's a debugging function, and we have the same functionality in the debug console
- Merged the view signal flags from kernel.h and gui_animate.h, and named them appropriately. Also, updated the notes next to them, cause some were incorrectly marked as not used in our engine - Added a note about a hack used in the old GUI in the view signal flags - Moved the control state flags inside gui_helpers.h svn-id: r45310
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kernel.cpp5
-rw-r--r--engines/sci/engine/kernel.h24
-rw-r--r--engines/sci/engine/kgraphics.cpp52
-rw-r--r--engines/sci/engine/kmovement.cpp5
-rw-r--r--engines/sci/engine/vm.cpp22
-rw-r--r--engines/sci/gfx/gfx_gui.cpp17
-rw-r--r--engines/sci/gfx/gfx_gui.h8
-rw-r--r--engines/sci/gfx/operations.cpp40
-rw-r--r--engines/sci/gfx/operations.h17
-rw-r--r--engines/sci/gui/gui.cpp2
-rw-r--r--engines/sci/gui/gui_animate.cpp72
-rw-r--r--engines/sci/gui/gui_animate.h37
-rw-r--r--engines/sci/gui/gui_gfx.cpp2
-rw-r--r--engines/sci/gui/gui_helpers.h8
-rw-r--r--engines/sci/gui32/gui32.cpp115
15 files changed, 172 insertions, 254 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index ee795454b0..a7c6527bc4 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -44,7 +44,7 @@ static const char *sci_default_knames[SCI_KNAMES_DEFAULT_ENTRIES_NR] = {
/*0x06*/ "IsObject",
/*0x07*/ "RespondsTo",
/*0x08*/ "DrawPic",
- /*0x09*/ "Show",
+ /*0x09*/ "Dummy", // Show
/*0x0a*/ "PicNotValid",
/*0x0b*/ "Animate",
/*0x0c*/ "SetNowSeen",
@@ -192,7 +192,7 @@ SciKernelFunction kfunct_mappers[] = {
/*06*/ DEFUN("IsObject", kIsObject, "."),
/*07*/ DEFUN("RespondsTo", kRespondsTo, ".i"),
/*08*/ DEFUN("DrawPic", kDrawPic, "i*"),
- /*09*/ DEFUN("Show", kShow, "i"),
+
/*0a*/ DEFUN("PicNotValid", kPicNotValid, "i*"),
/*0b*/ DEFUN("Animate", kAnimate, "LI*"), // More like (li?)?
/*0c*/ DEFUN("SetNowSeen", kSetNowSeen, "oi*"), // The second parameter is ignored
@@ -341,6 +341,7 @@ SciKernelFunction kfunct_mappers[] = {
#if 0
// Stub functions
+ /*09*/ DEFUN("Show", kShow, "i"),
DEFUN("ShiftScreen", kShiftScreen, ".*"),
DEFUN("MemorySegment", kMemorySegment, ".*"),
DEFUN("ListOps", kListOps, ".*"),
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 7cf3bcd4e3..d43581e117 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -268,29 +268,6 @@ void process_sound_events(EngineState *s);
/* Maximum length of a savegame name (including terminator character) */
#define SCI_MAX_SAVENAME_LENGTH 0x24
-/* Flags for the signal selector */
-enum {
- _K_VIEW_SIG_FLAG_STOP_UPDATE = 0x0001,
- _K_VIEW_SIG_FLAG_UPDATED = 0x0002,
- _K_VIEW_SIG_FLAG_NO_UPDATE = 0x0004,
- _K_VIEW_SIG_FLAG_HIDDEN = 0x0008,
- _K_VIEW_SIG_FLAG_FIX_PRI_ON = 0x0010,
- _K_VIEW_SIG_FLAG_ALWAYS_UPDATE = 0x0020,
- _K_VIEW_SIG_FLAG_FORCE_UPDATE = 0x0040,
- _K_VIEW_SIG_FLAG_REMOVE = 0x0080,
- _K_VIEW_SIG_FLAG_FROZEN = 0x0100,
- _K_VIEW_SIG_FLAG_IS_EXTRA = 0x0200,
- _K_VIEW_SIG_FLAG_HIT_OBSTACLE = 0x0400,
- _K_VIEW_SIG_FLAG_DOESNT_TURN = 0x0800,
- _K_VIEW_SIG_FLAG_NO_CYCLER = 0x1000,
- _K_VIEW_SIG_FLAG_IGNORE_HORIZON = 0x2000,
- _K_VIEW_SIG_FLAG_IGNORE_ACTOR = 0x4000,
- _K_VIEW_SIG_FLAG_DISPOSE_ME = 0x8000,
-
- _K_VIEW_SIG_FLAG_STOPUPD = 0x20000000 /* View has been stop-updated */
-};
-
-
/******************** Kernel functions ********************/
// New kernel functions
@@ -312,7 +289,6 @@ reg_t kPriCoord(EngineState *s, int argc, reg_t *argv);
reg_t kShakeScreen(EngineState *s, int argc, reg_t *argv);
reg_t kSetCursor(EngineState *s, int argc, reg_t *argv);
reg_t kMoveCursor(EngineState *s, int argc, reg_t *argv);
-reg_t kShow(EngineState *s, int argc, reg_t *argv);
reg_t kPicNotValid(EngineState *s, int argc, reg_t *argv);
reg_t kOnControl(EngineState *s, int argc, reg_t *argv);
reg_t kDrawPic(EngineState *s, int argc, reg_t *argv);
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 002a7ce841..29f3e632d3 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -33,10 +33,10 @@
#include "sci/seq_decoder.h"
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
-#include "sci/gfx/gfx_gui.h"
#include "sci/gfx/gfx_widgets.h"
-#include "sci/gfx/gfx_state_internal.h" // required for GfxContainer, GfxPort, GfxVisual
+//#include "sci/gfx/gfx_state_internal.h" // required for GfxContainer, GfxPort, GfxVisual
#include "sci/gui/gui.h"
+#include "sci/gui/gui_animate.h"
#include "sci/gui/gui_cursor.h"
#include "sci/gui/gui_screen.h"
@@ -67,7 +67,7 @@ void _k_dirloop(reg_t obj, uint16 angle, EngineState *s, int argc, reg_t *argv)
int maxloops;
bool oldScriptHeader = (getSciVersion() == SCI_VERSION_0_EARLY);
- if (signal & _K_VIEW_SIG_FLAG_DOESNT_TURN)
+ if (signal & kSignalDoesntTurn)
return;
angle %= 360;
@@ -188,36 +188,6 @@ reg_t kMoveCursor(EngineState *s, int argc, reg_t *argv) {
return s->r_acc;
}
-reg_t kShow(EngineState *s, int argc, reg_t *argv) {
- int old_map = s->pic_visible_map;
-
- s->pic_visible_map = (argc > 0) ? (gfx_map_mask_t) argv[0].toUint16() : GFX_MASK_VISUAL;
-
- switch (s->pic_visible_map) {
-
- case GFX_MASK_VISUAL:
- case GFX_MASK_PRIORITY:
- case GFX_MASK_CONTROL:
- gfxop_set_visible_map(s->gfx_state, s->pic_visible_map);
- if (old_map != s->pic_visible_map) {
-
- if (s->pic_visible_map == GFX_MASK_VISUAL) // Full widget redraw
- s->visual->draw(Common::Point(0, 0));
-
- gfxop_update(s->gfx_state);
- debugC(2, kDebugLevelGraphics, "Switching visible map to %x\n", s->pic_visible_map);
- }
- break;
-
- default:
- warning("Show(%x) selects unknown map", s->pic_visible_map);
-
- }
-
- s->pic_not_valid = 2;
- return s->r_acc;
-}
-
reg_t kPicNotValid(EngineState *s, int argc, reg_t *argv) {
int16 newPicNotValid = (argc > 0) ? argv[0].toUint16() : -1;
@@ -862,22 +832,6 @@ reg_t kEditControl(EngineState *s, int argc, reg_t *argv) {
return s->r_acc;
}
-void _k_view_list_mark_free(EngineState *s, reg_t off) {
- if (s->dyn_views) {
-
- GfxDynView *w = (GfxDynView *)s->dyn_views->_contents;
-
- while (w) {
- if (w->_ID == off.segment
- && w->_subID == off.offset) {
- w->under_bitsp.obj = NULL_REG;
- }
-
- w = (GfxDynView *)w->_next;
- }
- }
-}
-
reg_t kAddToPic(EngineState *s, int argc, reg_t *argv) {
GuiResourceId viewId;
GuiViewLoopNo loopNo;
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index 62a8bc88b0..7c8d070d10 100644
--- a/engines/sci/engine/kmovement.cpp
+++ b/engines/sci/engine/kmovement.cpp
@@ -27,6 +27,7 @@
#include "sci/resource.h"
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
+#include "sci/gui/gui_animate.h"
namespace Sci {
@@ -247,7 +248,7 @@ reg_t kDoBresen(EngineState *s, int argc, reg_t *argv) {
int max_movcnt = GET_SEL32V(segMan, client, moveSpeed);
if (getSciVersion() > SCI_VERSION_01)
- signal &= ~_K_VIEW_SIG_FLAG_HIT_OBSTACLE;
+ signal &= ~kSignalHitObstacle;
PUT_SEL32(segMan, client, signal, make_reg(0, signal)); // This is a NOP for SCI0
oldx = x;
@@ -324,7 +325,7 @@ reg_t kDoBresen(EngineState *s, int argc, reg_t *argv) {
PUT_SEL32V(segMan, client, x, oldx);
PUT_SEL32V(segMan, client, y, oldy);
- PUT_SEL32V(segMan, client, signal, (signal | _K_VIEW_SIG_FLAG_HIT_OBSTACLE));
+ PUT_SEL32V(segMan, client, signal, (signal | kSignalHitObstacle));
debugC(2, kDebugLevelBresen, "Finished mover %04x:%04x by collision\n", PRINT_REG(mover));
completed = 1;
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index eb154b1ad7..bf526e284f 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -1608,6 +1608,7 @@ int script_instantiate_sci0(ResourceManager *resMan, SegManager *segMan, int scr
objlength = 0;
reg.offset = magic_pos_adder; // Reset counter
+ reg_t egoClass = segMan->findObjectByName("Ego");
do {
reg_t addr;
@@ -1634,10 +1635,29 @@ int script_instantiate_sci0(ResourceManager *resMan, SegManager *segMan, int scr
Object *baseObj = segMan->getObject(obj->getSpeciesSelector());
obj->setVarCount(baseObj->getVarCount());
- obj->_baseObj = baseObj->_baseObj;
// Copy base from species class, as we need its selector IDs
+ obj->_baseObj = baseObj->_baseObj;
obj->setSuperClassSelector(INST_LOOKUP_CLASS(obj->getSuperClassSelector().offset));
+
+ // Check if the game is trying to change an object that has Ego as its superclass
+ if (!egoClass.isNull() && obj->getSuperClassSelector() == egoClass) {
+ reg_t stopGroopPos = segMan->findObjectByName("stopGroop");
+ debugC(2, "ego changed, updating stopGroop");
+
+ // Notify the stopGroop object that Ego changed
+ if (!stopGroopPos.isNull()) {
+ Object *stopGroopObj = segMan->getObject(stopGroopPos);
+
+ // Find the client member variable, and update it
+ ObjVarRef varp;
+ if (lookup_selector(segMan, stopGroopPos, ((SciEngine*)g_engine)->getKernel()->_selectorCache.client, &varp, NULL) == kSelectorVariable) {
+ reg_t *clientVar = varp.getPointer(segMan);
+ *clientVar = addr;
+ }
+ }
+
+ }
} // if object or class
break;
case SCI_OBJ_POINTERS: // A relocation table
diff --git a/engines/sci/gfx/gfx_gui.cpp b/engines/sci/gfx/gfx_gui.cpp
index 4e2e90bbc4..49ba3f24c3 100644
--- a/engines/sci/gfx/gfx_gui.cpp
+++ b/engines/sci/gfx/gfx_gui.cpp
@@ -31,6 +31,7 @@
#include "sci/gfx/gfx_gui.h"
#include "sci/gfx/gfx_state_internal.h"
#include "sci/gui32/font.h"
+#include "sci/gui/gui_animate.h"
#include "common/system.h"
@@ -642,4 +643,20 @@ GfxPort *sciw_toggle_item(GfxPort *menu_port, Menu *menu, int selection, bool se
return menu_port;
}
+void _k_view_list_mark_free(EngineState *s, reg_t off) {
+ if (s->dyn_views) {
+
+ GfxDynView *w = (GfxDynView *)s->dyn_views->_contents;
+
+ while (w) {
+ if (w->_ID == off.segment
+ && w->_subID == off.offset) {
+ w->under_bitsp.obj = NULL_REG;
+ }
+
+ w = (GfxDynView *)w->_next;
+ }
+ }
+}
+
} // End of namespace Sci
diff --git a/engines/sci/gfx/gfx_gui.h b/engines/sci/gfx/gfx_gui.h
index fe7eb1bb50..c8cb8650b0 100644
--- a/engines/sci/gfx/gfx_gui.h
+++ b/engines/sci/gfx/gfx_gui.h
@@ -52,14 +52,6 @@ enum windowFlags {
kWindowAutoRestore = 0x2000000
};
-/** Button and frame control flags. */
-enum controlStateFlags {
- kControlStateEnabled = 0x0001, ///< 0001 - enabled buttons (used by the interpreter)
- kControlStateDisabled = 0x0004, ///< 0010 - grayed out buttons (used by the interpreter)
- kControlStateFramed = 0x0008, ///< 1000 - widgets surrounded by a frame (used by the interpreter)
- kControlStateDitherFramed = 0x1000 ///< 0001 0000 0000 0000 - widgets surrounded by a dithered frame (used in kgraphics)
-};
-
/**
* Sets the contents of a port used as status bar.
*
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index 9d212a93c3..1c5f6a32bc 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -340,8 +340,7 @@ static void _gfxop_clear_dirty_rec(GfxState *state, DirtyRectList &dirtyRects) {
#ifdef GFXOP_DEBUG_DIRTY
fprintf(stderr, "\tClearing dirty (%d %d %d %d)\n", GFX_PRINT_RECT(*dirty));
#endif
- if (!state->fullscreen_override)
- _gfxop_update_box(state, *dirty);
+ _gfxop_update_box(state, *dirty);
++dirty;
}
dirtyRects.clear();
@@ -360,7 +359,6 @@ void gfxop_init(GfxState *state,
SciGuiScreen *screen, SciGuiPalette *palette, int scaleFactor) {
state->options = options;
state->visible_map = GFX_MASK_VISUAL;
- state->fullscreen_override = NULL; // No magical override
state->options = options;
state->disable_dirty = 0;
state->_events.clear();
@@ -881,45 +879,9 @@ void gfxop_clear_box(GfxState *state, rect_t box) {
_gfxop_buffer_propagate_box(state, box, GFX_BUFFER_BACK);
}
-void gfxop_set_visible_map(GfxState *state, gfx_map_mask_t visible_map) {
- switch (visible_map) {
-
- case GFX_MASK_VISUAL:
- state->fullscreen_override = NULL;
- if (visible_map != state->visible_map) {
- rect_t rect = gfx_rect(0, 0, 320, 200);
- gfxop_clear_box(state, rect);
- gfxop_update_box(state, rect);
- }
- break;
-
- case GFX_MASK_PRIORITY:
- state->fullscreen_override = state->priority_map;
- break;
-
- case GFX_MASK_CONTROL:
- state->fullscreen_override = state->control_map;
- break;
-
- default:
- warning("Invalid display map %d selected", visible_map);
- return;
- }
-
- state->visible_map = visible_map;
-}
-
void gfxop_update(GfxState *state) {
_gfxop_clear_dirty_rec(state, state->_dirtyRects);
- if (state->fullscreen_override) {
- // We've been asked to re-draw the active full-screen image, essentially.
- rect_t rect = gfx_rect(0, 0, 320, 200);
- gfx_xlate_pixmap(state->fullscreen_override, state->driver->getMode());
- gfxop_draw_pixmap(state, state->fullscreen_override, rect, Common::Point(0, 0));
- _gfxop_update_box(state, rect);
- }
-
if (state->tag_mode) {
// This usually happens after a pic and all resources have been drawn
state->gfxResMan->freeTaggedResources();
diff --git a/engines/sci/gfx/operations.h b/engines/sci/gfx/operations.h
index e620fc9833..2ae5bf80d6 100644
--- a/engines/sci/gfx/operations.h
+++ b/engines/sci/gfx/operations.h
@@ -114,8 +114,6 @@ struct GfxState {
Common::List<sci_event_t> _events;
- gfx_pixmap_t *fullscreen_override; /**< An optional override picture which must have unscaled full-screen size, which overrides all other visibility, and which is generally slow */
-
gfxr_pic_t *pic, *pic_unscaled; /**< The background picture and its unscaled equivalent */
rect_t pic_port_bounds; /**< Picture port bounds */
@@ -164,21 +162,6 @@ void gfxop_exit(GfxState *state);
int gfxop_scan_bitmask(GfxState *state, rect_t area, gfx_map_mask_t map);
/**
- * Sets the currently visible map.
- *
- * 'visible_map' can be any of GFX_MASK_VISUAL, GFX_MASK_PRIORITY and
- * GFX_MASK_CONTROL; the appropriate map (as far as its contents are known to
- * the graphics subsystem) is then subsequently drawn to the screen at each
- * update. If this is set to anything other than GFX_MASK_VISUAL, slow
- * full-screen updates are performed. Mostly useful for debugging. The screen
- * needs to be updated for the changes to take effect.
- *
- * @param[in] state The state to modify
- * @param[in] map The GFX_MASK to set
- */
-void gfxop_set_visible_map(GfxState *state, gfx_map_mask_t map);
-
-/**
* Sets a new clipping zone.
*
* @param[in] state The affected state
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index f93901b5fe..1ad267f05d 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -598,7 +598,7 @@ bool SciGui::canBeHere(reg_t curObject, reg_t listReference) {
signal = GET_SEL32V(segMan, curObject, signal);
controlMask = GET_SEL32V(segMan, curObject, illegalBits);
result = (_gfx->onControl(SCI_SCREEN_MASK_CONTROL, checkRect) & controlMask) ? false : true;
- if ((result) && (signal & (SCI_ANIMATE_SIGNAL_IGNOREACTOR | SCI_ANIMATE_SIGNAL_REMOVEVIEW)) == 0) {
+ if ((result) && (signal & (kSignalIgnoreActor | kSignalRemoveView)) == 0) {
List *list = _s->_segMan->lookupList(listReference);
if (!list)
error("kCanBeHere called with non-list as parameter");
diff --git a/engines/sci/gui/gui_animate.cpp b/engines/sci/gui/gui_animate.cpp
index cab34a2a21..23af6f5796 100644
--- a/engines/sci/gui/gui_animate.cpp
+++ b/engines/sci/gui/gui_animate.cpp
@@ -75,7 +75,7 @@ bool SciGuiAnimate::invoke(List *list, int argc, reg_t *argv) {
return false;
signal = GET_SEL32V(segMan, curObject, signal);
- if (!(signal & SCI_ANIMATE_SIGNAL_FROZEN)) {
+ if (!(signal & kSignalFrozen)) {
// Call .doit method of that object
invoke_selector(_s, curObject, _s->_kernel->_selectorCache.doit, kContinueOnInvalidSelector, argv, argc, __FILE__, __LINE__, 0);
// Lookup node again, since the nodetable it was in may have been reallocated
@@ -194,22 +194,22 @@ void SciGuiAnimate::fill(byte &old_picNotValid) {
signal = listEntry->signal;
// Calculate current priority according to y-coordinate
- if (!(signal & SCI_ANIMATE_SIGNAL_FIXEDPRIORITY)) {
+ if (!(signal & kSignalFixedPriority)) {
listEntry->priority = _gfx->CoordinateToPriority(listEntry->y);
PUT_SEL32V(segMan, curObject, priority, listEntry->priority);
}
- if (signal & SCI_ANIMATE_SIGNAL_NOUPDATE) {
- if (signal & (SCI_ANIMATE_SIGNAL_FORCEUPDATE | SCI_ANIMATE_SIGNAL_VIEWUPDATED)
- || (signal & SCI_ANIMATE_SIGNAL_HIDDEN && !(signal & SCI_ANIMATE_SIGNAL_REMOVEVIEW))
- || (!(signal & SCI_ANIMATE_SIGNAL_HIDDEN) && signal & SCI_ANIMATE_SIGNAL_REMOVEVIEW)
- || (signal & SCI_ANIMATE_SIGNAL_ALWAYSUPDATE))
+ if (signal & kSignalNoUpdate) {
+ if (signal & (kSignalForceUpdate | kSignalViewUpdated)
+ || (signal & kSignalHidden && !(signal & kSignalRemoveView))
+ || (!(signal & kSignalHidden) && signal & kSignalRemoveView)
+ || (signal & kSignalAlwaysUpdate))
old_picNotValid++;
- signal &= 0xFFFF ^ SCI_ANIMATE_SIGNAL_STOPUPDATE;
+ signal &= 0xFFFF ^ kSignalStopUpdate;
} else {
- if (signal & SCI_ANIMATE_SIGNAL_STOPUPDATE || signal & SCI_ANIMATE_SIGNAL_ALWAYSUPDATE)
+ if (signal & kSignalStopUpdate || signal & kSignalAlwaysUpdate)
old_picNotValid++;
- signal &= 0xFFFF ^ SCI_ANIMATE_SIGNAL_FORCEUPDATE;
+ signal &= 0xFFFF ^ kSignalForceUpdate;
}
listEntry->signal = signal;
@@ -237,8 +237,8 @@ void SciGuiAnimate::update() {
curObject = listEntry->object;
signal = listEntry->signal;
- if (signal & SCI_ANIMATE_SIGNAL_NOUPDATE) {
- if (!(signal & SCI_ANIMATE_SIGNAL_REMOVEVIEW)) {
+ if (signal & kSignalNoUpdate) {
+ if (!(signal & kSignalRemoveView)) {
bitsHandle = GET_SEL32(segMan, curObject, underBits);
if (_screen->_picNotValid != 1) {
_gfx->BitsRestore(bitsHandle);
@@ -248,10 +248,10 @@ void SciGuiAnimate::update() {
}
PUT_SEL32V(segMan, curObject, underBits, 0);
}
- signal &= 0xFFFF ^ SCI_ANIMATE_SIGNAL_FORCEUPDATE;
- signal &= signal & SCI_ANIMATE_SIGNAL_VIEWUPDATED ? 0xFFFF ^ (SCI_ANIMATE_SIGNAL_VIEWUPDATED | SCI_ANIMATE_SIGNAL_NOUPDATE) : 0xFFFF;
- } else if (signal & SCI_ANIMATE_SIGNAL_STOPUPDATE) {
- signal = (signal & (0xFFFF ^ SCI_ANIMATE_SIGNAL_STOPUPDATE)) | SCI_ANIMATE_SIGNAL_NOUPDATE;
+ signal &= 0xFFFF ^ kSignalForceUpdate;
+ signal &= signal & kSignalViewUpdated ? 0xFFFF ^ (kSignalViewUpdated | kSignalNoUpdate) : 0xFFFF;
+ } else if (signal & kSignalStopUpdate) {
+ signal = (signal & (0xFFFF ^ kSignalStopUpdate)) | kSignalNoUpdate;
}
listEntry->signal = signal;
listIterator--;
@@ -264,13 +264,13 @@ void SciGuiAnimate::update() {
curObject = listEntry->object;
signal = listEntry->signal;
- if (signal & SCI_ANIMATE_SIGNAL_ALWAYSUPDATE) {
+ if (signal & kSignalAlwaysUpdate) {
// draw corresponding cel
_gfx->drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect, listEntry->priority, listEntry->paletteNo);
listEntry->showBitsFlag = true;
- signal &= 0xFFFF ^ (SCI_ANIMATE_SIGNAL_STOPUPDATE | SCI_ANIMATE_SIGNAL_VIEWUPDATED | SCI_ANIMATE_SIGNAL_NOUPDATE | SCI_ANIMATE_SIGNAL_FORCEUPDATE);
- if ((signal & SCI_ANIMATE_SIGNAL_IGNOREACTOR) == 0) {
+ signal &= 0xFFFF ^ (kSignalStopUpdate | kSignalViewUpdated | kSignalNoUpdate | kSignalForceUpdate);
+ if ((signal & kSignalIgnoreActor) == 0) {
rect = listEntry->celRect;
rect.top = CLIP<int16>(_gfx->PriorityToCoordinate(listEntry->priority) - 1, rect.top, rect.bottom - 1);
_gfx->FillRect(rect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15);
@@ -287,12 +287,12 @@ void SciGuiAnimate::update() {
curObject = listEntry->object;
signal = listEntry->signal;
- if (signal & SCI_ANIMATE_SIGNAL_NOUPDATE) {
- if (signal & SCI_ANIMATE_SIGNAL_HIDDEN) {
- signal |= SCI_ANIMATE_SIGNAL_REMOVEVIEW;
+ if (signal & kSignalNoUpdate) {
+ if (signal & kSignalHidden) {
+ signal |= kSignalRemoveView;
} else {
- signal &= 0xFFFF ^ SCI_ANIMATE_SIGNAL_REMOVEVIEW;
- if (signal & SCI_ANIMATE_SIGNAL_IGNOREACTOR)
+ signal &= 0xFFFF ^ kSignalRemoveView;
+ if (signal & kSignalIgnoreActor)
bitsHandle = _gfx->BitsSave(listEntry->celRect, SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY);
else
bitsHandle = _gfx->BitsSave(listEntry->celRect, SCI_SCREEN_MASK_ALL);
@@ -310,12 +310,12 @@ void SciGuiAnimate::update() {
curObject = listEntry->object;
signal = listEntry->signal;
- if (signal & SCI_ANIMATE_SIGNAL_NOUPDATE && !(signal & SCI_ANIMATE_SIGNAL_HIDDEN)) {
+ if (signal & kSignalNoUpdate && !(signal & kSignalHidden)) {
// draw corresponding cel
_gfx->drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect, listEntry->priority, listEntry->paletteNo);
listEntry->showBitsFlag = true;
- if ((signal & SCI_ANIMATE_SIGNAL_IGNOREACTOR) == 0) {
+ if ((signal & kSignalIgnoreActor) == 0) {
rect = listEntry->celRect;
rect.top = CLIP<int16>(_gfx->PriorityToCoordinate(listEntry->priority) - 1, rect.top, rect.bottom - 1);
_gfx->FillRect(rect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15);
@@ -340,7 +340,7 @@ void SciGuiAnimate::drawCels() {
curObject = listEntry->object;
signal = listEntry->signal;
- if (!(signal & (SCI_ANIMATE_SIGNAL_NOUPDATE | SCI_ANIMATE_SIGNAL_HIDDEN | SCI_ANIMATE_SIGNAL_ALWAYSUPDATE))) {
+ if (!(signal & (kSignalNoUpdate | kSignalHidden | kSignalAlwaysUpdate))) {
// Save background
bitsHandle = _gfx->BitsSave(listEntry->celRect, SCI_SCREEN_MASK_ALL);
PUT_SEL32(segMan, curObject, underBits, bitsHandle);
@@ -349,8 +349,8 @@ void SciGuiAnimate::drawCels() {
_gfx->drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect, listEntry->priority, listEntry->paletteNo);
listEntry->showBitsFlag = true;
- if (signal & SCI_ANIMATE_SIGNAL_REMOVEVIEW) {
- signal &= 0xFFFF ^ SCI_ANIMATE_SIGNAL_REMOVEVIEW;
+ if (signal & kSignalRemoveView) {
+ signal &= 0xFFFF ^ kSignalRemoveView;
}
listEntry->signal = signal;
@@ -385,8 +385,8 @@ void SciGuiAnimate::updateScreen(byte oldPicNotValid) {
curObject = listEntry->object;
signal = listEntry->signal;
- if (listEntry->showBitsFlag || !(signal & (SCI_ANIMATE_SIGNAL_REMOVEVIEW | SCI_ANIMATE_SIGNAL_NOUPDATE) ||
- (!(signal & SCI_ANIMATE_SIGNAL_REMOVEVIEW) && (signal & SCI_ANIMATE_SIGNAL_NOUPDATE) && oldPicNotValid))) {
+ if (listEntry->showBitsFlag || !(signal & (kSignalRemoveView | kSignalNoUpdate) ||
+ (!(signal & kSignalRemoveView) && (signal & kSignalNoUpdate) && oldPicNotValid))) {
lsRect.left = GET_SEL32V(segMan, curObject, lsLeft);
lsRect.top = GET_SEL32V(segMan, curObject, lsTop);
lsRect.right = GET_SEL32V(segMan, curObject, lsRight);
@@ -408,8 +408,8 @@ void SciGuiAnimate::updateScreen(byte oldPicNotValid) {
PUT_SEL32V(segMan, curObject, lsBottom, workerRect.bottom);
_gfx->BitsShow(workerRect);
- if (signal & SCI_ANIMATE_SIGNAL_HIDDEN) {
- listEntry->signal |= SCI_ANIMATE_SIGNAL_REMOVEVIEW;
+ if (signal & kSignalHidden) {
+ listEntry->signal |= kSignalRemoveView;
}
}
@@ -448,12 +448,12 @@ void SciGuiAnimate::restoreAndDelete(int argc, reg_t *argv) {
// We read out signal here again, this is not by accident but to ensure that we got an up-to-date signal
signal = GET_SEL32V(segMan, curObject, signal);
- if ((signal & (SCI_ANIMATE_SIGNAL_NOUPDATE | SCI_ANIMATE_SIGNAL_REMOVEVIEW)) == 0) {
+ if ((signal & (kSignalNoUpdate | kSignalRemoveView)) == 0) {
_gfx->BitsRestore(GET_SEL32(segMan, curObject, underBits));
PUT_SEL32V(segMan, curObject, underBits, 0);
}
- if (signal & SCI_ANIMATE_SIGNAL_DISPOSEME) {
+ if (signal & kSignalDisposeMe) {
// Call .delete_ method of that object
invoke_selector(_s, curObject, _s->_kernel->_selectorCache.delete_, kContinueOnInvalidSelector, argv, argc, __FILE__, __LINE__, 0);
}
@@ -489,7 +489,7 @@ void SciGuiAnimate::addToPicDrawCels(List *list) {
// draw corresponding cel
_gfx->drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect, listEntry->priority, listEntry->paletteNo);
- if ((listEntry->signal & SCI_ANIMATE_SIGNAL_IGNOREACTOR) == 0) {
+ if ((listEntry->signal & kSignalIgnoreActor) == 0) {
listEntry->celRect.top = CLIP<int16>(_gfx->PriorityToCoordinate(listEntry->priority) - 1, listEntry->celRect.top, listEntry->celRect.bottom - 1);
_gfx->FillRect(listEntry->celRect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15);
}
diff --git a/engines/sci/gui/gui_animate.h b/engines/sci/gui/gui_animate.h
index 19bee34597..92230b7ebc 100644
--- a/engines/sci/gui/gui_animate.h
+++ b/engines/sci/gui/gui_animate.h
@@ -30,23 +30,26 @@
namespace Sci {
-enum {
- SCI_ANIMATE_SIGNAL_STOPUPDATE = 0x0001,
- SCI_ANIMATE_SIGNAL_VIEWUPDATED = 0x0002,
- SCI_ANIMATE_SIGNAL_NOUPDATE = 0x0004,
- SCI_ANIMATE_SIGNAL_HIDDEN = 0x0008,
- SCI_ANIMATE_SIGNAL_FIXEDPRIORITY = 0x0010,
- SCI_ANIMATE_SIGNAL_ALWAYSUPDATE = 0x0020,
- SCI_ANIMATE_SIGNAL_FORCEUPDATE = 0x0040,
- SCI_ANIMATE_SIGNAL_REMOVEVIEW = 0x0080,
- SCI_ANIMATE_SIGNAL_FROZEN = 0x0100,
- SCI_ANIMATE_SIGNAL_EXTRAACTOR = 0x0200, // unused by us, defines all actors that may be included into the background if speed to slow
- SCI_ANIMATE_SIGNAL_BLOCKED = 0x0400, // unused by us, defines an actor that tried to move but was blocked
- SCI_ANIMATE_SIGNAL_FIXEDLOOP = 0x0800, // unused by us
- SCI_ANIMATE_SIGNAL_FIXEDCEL = 0x1000, // unused by us
- SCI_ANIMATE_SIGNAL_IGNOREHORIZON = 0x2000, // unused by us, defines actor that can ignore horizon
- SCI_ANIMATE_SIGNAL_IGNOREACTOR = 0x4000,
- SCI_ANIMATE_SIGNAL_DISPOSEME = 0x8000
+// Flags for the signal selector
+enum ViewSignals {
+ kSignalStopUpdate = 0x0001,
+ kSignalViewUpdated = 0x0002,
+ kSignalNoUpdate = 0x0004,
+ kSignalHidden = 0x0008,
+ kSignalFixedPriority = 0x0010,
+ kSignalAlwaysUpdate = 0x0020,
+ kSignalForceUpdate = 0x0040,
+ kSignalRemoveView = 0x0080,
+ kSignalFrozen = 0x0100,
+ kSignalExtraActor = 0x0200, // unused by us, defines all actors that may be included into the background if speed to slow
+ kSignalHitObstacle = 0x0400, // used in the actor movement code by kDoBresen()
+ kSignalDoesntTurn = 0x0800, // used by _k_dirloop() to determine if an actor can turn or not
+ kSignalNoCycler = 0x1000, // unused by us
+ kSignalIgnoreHorizon = 0x2000, // unused by us, defines actor that can ignore horizon
+ kSignalIgnoreActor = 0x4000,
+ kSignalDisposeMe = 0x8000,
+
+ kSignalStopUpdHack = 0x20000000 // View has been stop-updated (again???) - a hack used by the old GUI code only, for dynamic views
};
class SciGuiGfx;
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index 7e5e6147e7..f2de19f9b1 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -1012,7 +1012,7 @@ bool SciGuiGfx::CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect
curObject = curNode->value;
if (curObject != checkObject) {
signal = GET_SEL32V(segMan, curObject, signal);
- if ((signal & (SCI_ANIMATE_SIGNAL_IGNOREACTOR | SCI_ANIMATE_SIGNAL_REMOVEVIEW | SCI_ANIMATE_SIGNAL_NOUPDATE)) == 0) {
+ if ((signal & (kSignalIgnoreActor | kSignalRemoveView | kSignalNoUpdate)) == 0) {
curRect.left = GET_SEL32V(segMan, curObject, brLeft);
curRect.top = GET_SEL32V(segMan, curObject, brTop);
curRect.right = GET_SEL32V(segMan, curObject, brRight);
diff --git a/engines/sci/gui/gui_helpers.h b/engines/sci/gui/gui_helpers.h
index 65ba397f23..efc9548dcb 100644
--- a/engines/sci/gui/gui_helpers.h
+++ b/engines/sci/gui/gui_helpers.h
@@ -116,6 +116,14 @@ struct GuiPalSchedule {
uint32 schedule;
};
+/** Button and frame control flags. */
+enum controlStateFlags {
+ kControlStateEnabled = 0x0001, ///< 0001 - enabled buttons (used by the interpreter)
+ kControlStateDisabled = 0x0004, ///< 0010 - grayed out buttons (used by the interpreter)
+ kControlStateFramed = 0x0008, ///< 1000 - widgets surrounded by a frame (used by the interpreter)
+ kControlStateDitherFramed = 0x1000 ///< 0001 0000 0000 0000 - widgets surrounded by a dithered frame (used in kgraphics)
+};
+
} // End of namespace Sci
#endif
diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp
index cc590dc4b9..790a43c9f9 100644
--- a/engines/sci/gui32/gui32.cpp
+++ b/engines/sci/gui32/gui32.cpp
@@ -36,6 +36,7 @@
#include "sci/gfx/gfx_widgets.h"
#include "sci/gfx/gfx_state_internal.h" // required for GfxContainer, GfxPort, GfxVisual
#include "sci/gui32/gui32.h"
+#include "sci/gui/gui_animate.h"
#include "sci/gui/gui_cursor.h"
// This is the real width of a text with a specified width of 0
@@ -1562,7 +1563,7 @@ void SciGui32::_k_make_view_list(GfxList **widget_list, List *list, int options,
if (options & _K_MAKE_VIEW_LIST_CYCLE) {
unsigned int signal = GET_SEL32V(segMan, obj, signal);
- if (!(signal & _K_VIEW_SIG_FLAG_FROZEN)) {
+ if (!(signal & kSignalFrozen)) {
debugC(2, kDebugLevelGraphics, " invoking %04x:%04x::doit()\n", PRINT_REG(obj));
invoke_selector(INV_SEL(obj, doit, kContinueOnInvalidSelector), 0); // Call obj::doit() if neccessary
@@ -1620,7 +1621,7 @@ void SciGui32::draw_obj_to_control_map(GfxDynView *view) {
warning("View %d does not contain valid object reference %04x:%04x", view->_ID, PRINT_REG(obj));
reg_t* sp = view->signalp.getPointer(_s->_segMan);
- if (!(sp && (sp->offset & _K_VIEW_SIG_FLAG_IGNORE_ACTOR))) {
+ if (!(sp && (sp->offset & kSignalIgnoreActor))) {
Common::Rect abs_zone = get_nsrect32(_s, make_reg(view->_ID, view->_subID), 1);
draw_rect_to_control_map(abs_zone);
}
@@ -1646,7 +1647,7 @@ int SciGui32::_k_view_list_dispose_loop(List *list, GfxDynView *widget, int argc
if (GFXW_IS_DYN_VIEW(widget) && (widget->_ID != GFXW_NO_ID)) {
signal = widget->signalp.getPointer(segMan)->offset;
- if (signal & _K_VIEW_SIG_FLAG_DISPOSE_ME) {
+ if (signal & kSignalDisposeMe) {
reg_t obj = make_reg(widget->_ID, widget->_subID);
reg_t under_bits = NULL_REG;
@@ -1687,7 +1688,7 @@ int SciGui32::_k_view_list_dispose_loop(List *list, GfxDynView *widget, int argc
debugC(2, kDebugLevelGraphics, "Freeing %04x:%04x with signal=%04x\n", PRINT_REG(obj), signal);
- if (!(signal & _K_VIEW_SIG_FLAG_HIDDEN)) {
+ if (!(signal & kSignalHidden)) {
debugC(2, kDebugLevelGraphics, "Adding view at %04x:%04x to background\n", PRINT_REG(obj));
if (!(gfxw_remove_id(widget->_parent, widget->_ID, widget->_subID) == widget)) {
error("Attempt to remove view with ID %x:%x from list failed", widget->_ID, widget->_subID);
@@ -1746,7 +1747,7 @@ void SciGui32::_k_prepare_view_list(GfxList *list, int options) {
if (priority < 0)
priority = _priority; // Always for picviews
} else { // Dynview
- if (has_nsrect && !(view->signal & _K_VIEW_SIG_FLAG_FIX_PRI_ON)) { // Calculate priority
+ if (has_nsrect && !(view->signal & kSignalFixedPriority)) { // Calculate priority
if (options & _K_MAKE_VIEW_LIST_CALC_PRIORITY)
PUT_SEL32V(segMan, obj, priority, _priority);
@@ -1765,8 +1766,8 @@ void SciGui32::_k_prepare_view_list(GfxList *list, int options) {
// CR (from :Bob Heitman:) stopupdated views (like pic views) have
// their clipped nsRect drawn to the control map
- if (view->signal & _K_VIEW_SIG_FLAG_STOP_UPDATE) {
- view->signal |= _K_VIEW_SIG_FLAG_STOPUPD;
+ if (view->signal & kSignalStopUpdate) {
+ view->signal |= kSignalStopUpdHack;
debugC(2, kDebugLevelGraphics, "Setting magic STOP_UPD for %04x:%04x\n", PRINT_REG(obj));
}
@@ -1774,30 +1775,30 @@ void SciGui32::_k_prepare_view_list(GfxList *list, int options) {
draw_obj_to_control_map(view);
// Extreme Pattern Matching ugliness ahead...
- if (view->signal & _K_VIEW_SIG_FLAG_NO_UPDATE) {
- if (((view->signal & (_K_VIEW_SIG_FLAG_UPDATED | _K_VIEW_SIG_FLAG_FORCE_UPDATE))) // 9.1.1.1
- || ((view->signal & (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_REMOVE)) == _K_VIEW_SIG_FLAG_HIDDEN)
- || ((view->signal & (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_REMOVE)) == _K_VIEW_SIG_FLAG_REMOVE) // 9.1.1.2
- || ((view->signal & (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_ALWAYS_UPDATE)) == _K_VIEW_SIG_FLAG_ALWAYS_UPDATE) // 9.1.1.3
- || ((view->signal & (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_ALWAYS_UPDATE)) == (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_ALWAYS_UPDATE))) { // 9.1.1.4
+ if (view->signal & kSignalNoUpdate) {
+ if (((view->signal & (kSignalViewUpdated | kSignalForceUpdate))) // 9.1.1.1
+ || ((view->signal & (kSignalHidden | kSignalRemoveView)) == kSignalHidden)
+ || ((view->signal & (kSignalHidden | kSignalRemoveView)) == kSignalRemoveView) // 9.1.1.2
+ || ((view->signal & (kSignalHidden | kSignalRemoveView | kSignalAlwaysUpdate)) == kSignalAlwaysUpdate) // 9.1.1.3
+ || ((view->signal & (kSignalHidden | kSignalAlwaysUpdate)) == (kSignalHidden | kSignalAlwaysUpdate))) { // 9.1.1.4
_s->pic_not_valid++;
- view->signal &= ~_K_VIEW_SIG_FLAG_STOP_UPDATE;
+ view->signal &= ~kSignalStopUpdate;
}
- else if (((view->signal & (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_ALWAYS_UPDATE)) == 0)
- || ((view->signal & (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_ALWAYS_UPDATE)) == (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_REMOVE))
- || ((view->signal & (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_ALWAYS_UPDATE)) == (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_ALWAYS_UPDATE))
- || ((view->signal & (_K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_ALWAYS_UPDATE)) == _K_VIEW_SIG_FLAG_HIDDEN)) {
- view->signal &= ~_K_VIEW_SIG_FLAG_STOP_UPDATE;
+ else if (((view->signal & (kSignalHidden | kSignalRemoveView | kSignalAlwaysUpdate)) == 0)
+ || ((view->signal & (kSignalHidden | kSignalRemoveView | kSignalAlwaysUpdate)) == (kSignalHidden | kSignalRemoveView))
+ || ((view->signal & (kSignalHidden | kSignalAlwaysUpdate)) == (kSignalHidden | kSignalAlwaysUpdate))
+ || ((view->signal & (kSignalHidden | kSignalAlwaysUpdate)) == kSignalHidden)) {
+ view->signal &= ~kSignalStopUpdate;
}
} else {
- if (view->signal & _K_VIEW_SIG_FLAG_STOP_UPDATE) {
+ if (view->signal & kSignalStopUpdate) {
_s->pic_not_valid++;
- view->signal &= ~_K_VIEW_SIG_FLAG_FORCE_UPDATE;
+ view->signal &= ~kSignalForceUpdate;
} else { // if not STOP_UPDATE
- if (view->signal & _K_VIEW_SIG_FLAG_ALWAYS_UPDATE)
+ if (view->signal & kSignalAlwaysUpdate)
_s->pic_not_valid++;
- view->signal &= ~_K_VIEW_SIG_FLAG_FORCE_UPDATE;
+ view->signal &= ~kSignalForceUpdate;
}
}
@@ -1805,7 +1806,7 @@ void SciGui32::_k_prepare_view_list(GfxList *list, int options) {
// Never happens
/* if (view->signal & 0) {
- view->signal &= ~_K_VIEW_SIG_FLAG_STOPUPD;
+ view->signal &= ~kSignalStopUpdHack;
fprintf(_stderr, "Unsetting magic StopUpd for view %04x:%04x\n", PRINT_REG(obj));
} */
@@ -1832,7 +1833,7 @@ void SciGui32::_k_update_signals_in_view_list(GfxList *old_list, GfxList *new_li
new_widget = (GfxDynView *)new_widget->_next;
if (new_widget) {
- int carry = old_widget->signal & _K_VIEW_SIG_FLAG_STOPUPD;
+ int carry = old_widget->signal & kSignalStopUpdHack;
// Transfer 'stopupd' flag
if ((new_widget->_pos.x != old_widget->_pos.x)
@@ -1864,18 +1865,18 @@ void SciGui32::_k_raise_topmost_in_view_list(GfxList *list, GfxDynView *view) {
GfxDynView *next = (GfxDynView *)view->_next;
// step 11
- if ((view->signal & (_K_VIEW_SIG_FLAG_NO_UPDATE | _K_VIEW_SIG_FLAG_HIDDEN | _K_VIEW_SIG_FLAG_ALWAYS_UPDATE)) == 0) {
+ if ((view->signal & (kSignalNoUpdate | kSignalHidden | kSignalAlwaysUpdate)) == 0) {
debugC(2, kDebugLevelGraphics, "Forcing precedence 2 at [%04x:%04x] with %04x\n", PRINT_REG(make_reg(view->_ID, view->_subID)), view->signal);
view->force_precedence = 2;
- if ((view->signal & (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_HIDDEN)) == _K_VIEW_SIG_FLAG_REMOVE) {
- view->signal &= ~_K_VIEW_SIG_FLAG_REMOVE;
+ if ((view->signal & (kSignalRemoveView | kSignalHidden)) == kSignalRemoveView) {
+ view->signal &= ~kSignalRemoveView;
}
}
gfxw_remove_widget_from_container(view->_parent, view);
- if (view->signal & _K_VIEW_SIG_FLAG_HIDDEN)
+ if (view->signal & kSignalHidden)
gfxw_hide_widget(view);
else
gfxw_show_widget(view);
@@ -1893,32 +1894,32 @@ void SciGui32::_k_redraw_view_list(GfxList *list) {
debugC(2, kDebugLevelGraphics, " dv[%04x:%04x]: signal %04x\n", PRINT_REG(make_reg(view->_ID, view->_subID)), view->signal);
// step 1 of subalgorithm
- if (view->signal & _K_VIEW_SIG_FLAG_NO_UPDATE) {
- if (view->signal & _K_VIEW_SIG_FLAG_FORCE_UPDATE)
- view->signal &= ~_K_VIEW_SIG_FLAG_FORCE_UPDATE;
+ if (view->signal & kSignalNoUpdate) {
+ if (view->signal & kSignalForceUpdate)
+ view->signal &= ~kSignalForceUpdate;
- if (view->signal & _K_VIEW_SIG_FLAG_UPDATED)
- view->signal &= ~(_K_VIEW_SIG_FLAG_UPDATED | _K_VIEW_SIG_FLAG_NO_UPDATE);
+ if (view->signal & kSignalViewUpdated)
+ view->signal &= ~(kSignalViewUpdated | kSignalNoUpdate);
} else { // NO_UPD is not set
- if (view->signal & _K_VIEW_SIG_FLAG_STOP_UPDATE) {
- view->signal &= ~_K_VIEW_SIG_FLAG_STOP_UPDATE;
- view->signal |= _K_VIEW_SIG_FLAG_NO_UPDATE;
+ if (view->signal & kSignalStopUpdate) {
+ view->signal &= ~kSignalStopUpdate;
+ view->signal |= kSignalNoUpdate;
}
}
debugC(2, kDebugLevelGraphics, " at substep 6: signal %04x\n", view->signal);
- if (view->signal & _K_VIEW_SIG_FLAG_ALWAYS_UPDATE)
- view->signal &= ~(_K_VIEW_SIG_FLAG_STOP_UPDATE | _K_VIEW_SIG_FLAG_UPDATED | _K_VIEW_SIG_FLAG_NO_UPDATE | _K_VIEW_SIG_FLAG_FORCE_UPDATE);
+ if (view->signal & kSignalAlwaysUpdate)
+ view->signal &= ~(kSignalStopUpdate | kSignalViewUpdated | kSignalNoUpdate | kSignalForceUpdate);
debugC(2, kDebugLevelGraphics, " at substep 11/14: signal %04x\n", view->signal);
- if (view->signal & _K_VIEW_SIG_FLAG_NO_UPDATE) {
- if (view->signal & _K_VIEW_SIG_FLAG_HIDDEN)
- view->signal |= _K_VIEW_SIG_FLAG_REMOVE;
+ if (view->signal & kSignalNoUpdate) {
+ if (view->signal & kSignalHidden)
+ view->signal |= kSignalRemoveView;
else
- view->signal &= ~_K_VIEW_SIG_FLAG_REMOVE;
- } else if (!(view->signal & _K_VIEW_SIG_FLAG_HIDDEN))
+ view->signal &= ~kSignalRemoveView;
+ } else if (!(view->signal & kSignalHidden))
view->force_precedence = 1;
debugC(2, kDebugLevelGraphics, " -> signal %04x\n", view->signal);
@@ -1951,20 +1952,20 @@ void SciGui32::_k_draw_view_list(GfxList *list, int flags) {
if (GFXW_IS_DYN_VIEW(widget) && widget->_ID) {
uint16 signal = (flags & _K_DRAW_VIEW_LIST_USE_SIGNAL) ? widget->signalp.getPointer(_s->_segMan)->offset : 0;
- if (signal & _K_VIEW_SIG_FLAG_HIDDEN)
+ if (signal & kSignalHidden)
gfxw_hide_widget(widget);
else
gfxw_show_widget(widget);
if (!(flags & _K_DRAW_VIEW_LIST_USE_SIGNAL)
- || ((flags & _K_DRAW_VIEW_LIST_DISPOSEABLE) && (signal & _K_VIEW_SIG_FLAG_DISPOSE_ME))
- || ((flags & _K_DRAW_VIEW_LIST_NONDISPOSEABLE) && !(signal & _K_VIEW_SIG_FLAG_DISPOSE_ME))) {
+ || ((flags & _K_DRAW_VIEW_LIST_DISPOSEABLE) && (signal & kSignalDisposeMe))
+ || ((flags & _K_DRAW_VIEW_LIST_NONDISPOSEABLE) && !(signal & kSignalDisposeMe))) {
if (flags & _K_DRAW_VIEW_LIST_USE_SIGNAL) {
- signal &= ~(_K_VIEW_SIG_FLAG_STOP_UPDATE | _K_VIEW_SIG_FLAG_UPDATED | _K_VIEW_SIG_FLAG_NO_UPDATE | _K_VIEW_SIG_FLAG_FORCE_UPDATE);
+ signal &= ~(kSignalStopUpdate | kSignalViewUpdated | kSignalNoUpdate | kSignalForceUpdate);
// Clear all of those flags
- if (signal & _K_VIEW_SIG_FLAG_HIDDEN)
+ if (signal & kSignalHidden)
gfxw_hide_widget(widget);
else
gfxw_show_widget(widget);
@@ -1991,9 +1992,9 @@ void SciGui32::_k_view_list_do_postdraw(GfxList *list) {
* this fixes a few problems, but doesn't match SSCI's logic.
* The semantics of the private flag need to be verified before this can be uncommented.
* Fixes bug #326 (CB1, ego falls down stairs)
- * if ((widget->signal & (_K_VIEW_SIG_FLAG_PRIVATE | _K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)) == _K_VIEW_SIG_FLAG_PRIVATE) {
+ * if ((widget->signal & (_K_VIEW_SIG_FLAG_PRIVATE | kSignalRemoveView | kSignalNoUpdate)) == _K_VIEW_SIG_FLAG_PRIVATE) {
*/
- if ((widget->signal & (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)) == 0) {
+ if ((widget->signal & (kSignalRemoveView | kSignalNoUpdate)) == 0) {
int has_nsrect = lookup_selector(_s->_segMan, obj, _s->_kernel->_selectorCache.nsBottom, NULL, NULL) == kSelectorVariable;
if (has_nsrect) {
@@ -2019,11 +2020,11 @@ void SciGui32::_k_view_list_do_postdraw(GfxList *list) {
fprintf(_stderr, "Not lsRecting %04x:%04x because %d\n", PRINT_REG(obj), lookup_selector(_s->_segMan, obj, _s->_kernel->_selectorCache.nsBottom, NULL, NULL));
#endif
- if (widget->signal & _K_VIEW_SIG_FLAG_HIDDEN)
- widget->signal |= _K_VIEW_SIG_FLAG_REMOVE;
+ if (widget->signal & kSignalHidden)
+ widget->signal |= kSignalRemoveView;
}
#ifdef DEBUG_LSRECT
- fprintf(_stderr, "obj %04x:%04x has pflags %x\n", PRINT_REG(obj), (widget->signal & (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)));
+ fprintf(_stderr, "obj %04x:%04x has pflags %x\n", PRINT_REG(obj), (widget->signal & (kSignalRemoveView | kSignalNoUpdate)));
#endif
reg_t* sp = widget->signalp.getPointer(_s->_segMan);
@@ -2651,8 +2652,8 @@ static int collides_with(EngineState *s, Common::Rect area, reg_t other_obj, int
return 0;
}
-#define GASEOUS_VIEW_MASK_ACTIVE (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_IGNORE_ACTOR)
-#define GASEOUS_VIEW_MASK_PASSIVE (_K_VIEW_SIG_FLAG_NO_UPDATE | _K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_IGNORE_ACTOR)
+#define GASEOUS_VIEW_MASK_ACTIVE (kSignalRemoveView | kSignalIgnoreActor)
+#define GASEOUS_VIEW_MASK_PASSIVE (kSignalNoUpdate | kSignalRemoveView | kSignalIgnoreActor)
bool SciGui32::canBeHere(reg_t curObject, reg_t listReference) {
SegManager *segMan = _s->_segMan;
@@ -2697,7 +2698,7 @@ bool SciGui32::canBeHere(reg_t curObject, reg_t listReference) {
debugC(2, kDebugLevelBresen, "Checking vs dynviews:\n");
while (widget) {
- if (widget->_ID && (widget->signal & _K_VIEW_SIG_FLAG_STOPUPD)
+ if (widget->_ID && (widget->signal & kSignalStopUpdHack)
&& ((widget->_ID != curObject.segment) || (widget->_subID != curObject.offset))
&& _s->_segMan->isObject(make_reg(widget->_ID, widget->_subID)))
if (collides_with(_s, abs_zone, make_reg(widget->_ID, widget->_subID), 1, GASEOUS_VIEW_MASK_ACTIVE))