diff options
author | Max Horn | 2010-02-05 22:55:18 +0000 |
---|---|---|
committer | Max Horn | 2010-02-05 22:55:18 +0000 |
commit | f86618f92be1350bf6e56573c2419e604c811548 (patch) | |
tree | 780ad7877423be3aa5d19dee510e187ba77f3477 /engines/sci/engine/selector.h | |
parent | 25a9df8a817de652a40d2cc48411310b081b5653 (diff) | |
download | scummvm-rg350-f86618f92be1350bf6e56573c2419e604c811548.tar.gz scummvm-rg350-f86618f92be1350bf6e56573c2419e604c811548.tar.bz2 scummvm-rg350-f86618f92be1350bf6e56573c2419e604c811548.zip |
SCI: Add a 'SELECTOR' macro
svn-id: r47918
Diffstat (limited to 'engines/sci/engine/selector.h')
-rw-r--r-- | engines/sci/engine/selector.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h index 0cc0935377..f74ec45213 100644 --- a/engines/sci/engine/selector.h +++ b/engines/sci/engine/selector.h @@ -42,16 +42,23 @@ enum SelectorInvocation { kContinueOnInvalidSelector = 1 }; + +/** + * Map a selector name to a selector id. Shortcut for accessing the selector cache. + */ +#define SELECTOR(_slc_) (((SciEngine *)g_engine)->getKernel()->_selectorCache._slc_) +//#define SELECTOR(_slc_) _slc_ + /** * Retrieves a selector from an object. * @param segMan the segment mananger * @param _obj_ the address of the object which the selector should be read from - * @param _slc_ the selector to read + * @param _slc_ the selector to refad * @return the selector value as a reg_t * This macro halts on error. 'selector' must be a selector name registered in vm.h's * SelectorCache and mapped in script.cpp. */ -#define GET_SEL32(segMan, _obj_, _slc_) read_selector(segMan, _obj_, ((SciEngine *)g_engine)->getKernel()->_selectorCache._slc_) +#define GET_SEL32(segMan, _obj_, _slc_) read_selector(segMan, _obj_, _slc_) #define GET_SEL32V(segMan, _obj_, _slc_) (GET_SEL32(segMan, _obj_, _slc_).offset) /** @@ -63,7 +70,7 @@ enum SelectorInvocation { * This macro halts on error. 'selector' must be a selector name registered in vm.h's * SelectorCache and mapped in script.cpp. */ -#define PUT_SEL32(segMan, _obj_, _slc_, _val_) write_selector(segMan, _obj_, ((SciEngine *)g_engine)->getKernel()->_selectorCache._slc_, _val_) +#define PUT_SEL32(segMan, _obj_, _slc_, _val_) write_selector(segMan, _obj_, _slc_, _val_) #define PUT_SEL32V(segMan, _obj_, _slc_, _val_) PUT_SEL32(segMan, _obj_, _slc_, make_reg(0, _val_)) |