SCI: Added FIXME comment to not_register()

svn-id: r41172
This commit is contained in:
Max Horn 2009-06-04 20:50:51 +00:00
parent 3da455420a
commit 3091de6735
2 changed files with 11 additions and 2 deletions

View file

@ -126,5 +126,8 @@ EngineState::EngineState() : _dirseeker(this) {
EngineState::~EngineState() { EngineState::~EngineState() {
} }
uint16 EngineState::currentRoomNumber() const {
return KP_UINT(script_000->locals_block->_locals[13]);
}
} // End of namespace Sci } // End of namespace Sci

View file

@ -48,7 +48,6 @@ namespace Common {
namespace Sci { namespace Sci {
class Menubar; class Menubar;
struct kfunct_sig_pair_t; // from kernel.h
struct GfxState; struct GfxState;
struct GfxPort; struct GfxPort;
@ -208,7 +207,7 @@ public:
reg_t parser_event; /**< The event passed to Parse() and later used by Said() */ reg_t parser_event; /**< The event passed to Parse() and later used by Said() */
Script *script_000; /**< script 000, e.g. for globals */ Script *script_000; /**< script 000, e.g. for globals */
uint16 currentRoomNumber() const { return KP_UINT(script_000->locals_block->_locals[13]); } uint16 currentRoomNumber() const;
/* Debugger data: */ /* Debugger data: */
Breakpoint *bp_list; /**< List of breakpoints */ Breakpoint *bp_list; /**< List of breakpoints */
@ -250,6 +249,13 @@ public:
*/ */
PaletteEntry get_pic_color(EngineState *s, int color); PaletteEntry get_pic_color(EngineState *s, int color);
// FIXME: Document this strange function.
// It seems to negate the given register but only if the "cantBeHere" exists.
// My guess: Since some SCI versions have cantBeHere and some have canBeHere,
// this function allows unifying the code, making it look identical for both
// kinds of SCI games. That's fine, but the name not_register is rather
// misleading. A different name (and a different place for declaring this)
// would be highly welcome.
static inline reg_t not_register(EngineState *s, reg_t r) { static inline reg_t not_register(EngineState *s, reg_t r) {
if (s->_kernel->_selectorMap.cantBeHere != -1) if (s->_kernel->_selectorMap.cantBeHere != -1)
return make_reg(0, !r.offset); return make_reg(0, !r.offset);