diff options
author | Nicola Mettifogo | 2007-07-29 17:02:08 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-07-29 17:02:08 +0000 |
commit | 4774696a9620cb0c325b7ceb82d85c77ea5363f1 (patch) | |
tree | 4d5cf08cd9197b53dcec715ffe2219a3208f17b3 | |
parent | 608fd62cb5063d64c8f718a2604b99023817a816 (diff) | |
download | scummvm-rg350-4774696a9620cb0c325b7ceb82d85c77ea5363f1.tar.gz scummvm-rg350-4774696a9620cb0c325b7ceb82d85c77ea5363f1.tar.bz2 scummvm-rg350-4774696a9620cb0c325b7ceb82d85c77ea5363f1.zip |
Made current callable routines members of Parallaction_ns, and moved them to callables_ns.cpp.
svn-id: r28302
-rw-r--r-- | engines/parallaction/callables_ns.cpp (renamed from engines/parallaction/callables.cpp) | 54 | ||||
-rw-r--r-- | engines/parallaction/module.mk | 2 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 36 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 3 | ||||
-rw-r--r-- | engines/parallaction/staticres.cpp | 135 |
5 files changed, 117 insertions, 113 deletions
diff --git a/engines/parallaction/callables.cpp b/engines/parallaction/callables_ns.cpp index 97c6b85453..b0312bb714 100644 --- a/engines/parallaction/callables.cpp +++ b/engines/parallaction/callables_ns.cpp @@ -173,12 +173,12 @@ struct Credit { game callables */ -void _c_null(void *parm) { +void Parallaction_ns::_c_null(void *parm) { return; } -void _c_play_boogie(void *parm) { +void Parallaction_ns::_c_play_boogie(void *parm) { static uint16 flag = 1; @@ -193,12 +193,12 @@ void _c_play_boogie(void *parm) { } -void _c_score(void *parm) { +void Parallaction_ns::_c_score(void *parm) { _score += 5; return; } -void _c_fade(void *parm) { +void Parallaction_ns::_c_fade(void *parm) { _vm->_gfx->setBlackPalette(); @@ -218,7 +218,7 @@ void _c_fade(void *parm) { -void _c_moveSarc(void *parm) { +void Parallaction_ns::_c_moveSarc(void *parm) { Animation *a; @@ -295,7 +295,7 @@ void _c_moveSarc(void *parm) { -void _c_contaFoglie(void *parm) { +void Parallaction_ns::_c_contaFoglie(void *parm) { num_foglie++; if (num_foglie != 6) @@ -306,23 +306,23 @@ void _c_contaFoglie(void *parm) { return; } -void _c_zeroFoglie(void *parm) { +void Parallaction_ns::_c_zeroFoglie(void *parm) { num_foglie = 0; return; } -void _c_trasformata(void *parm) { +void Parallaction_ns::_c_trasformata(void *parm) { _engineFlags ^= kEngineTransformedDonna; return; } -void _c_offMouse(void *parm) { +void Parallaction_ns::_c_offMouse(void *parm) { _vm->showCursor(false); _engineFlags |= kEngineBlockInput; return; } -void _c_onMouse(void *parm) { +void Parallaction_ns::_c_onMouse(void *parm) { _engineFlags &= ~kEngineBlockInput; _vm->showCursor(true); return; @@ -330,14 +330,14 @@ void _c_onMouse(void *parm) { -void _c_setMask(void *parm) { +void Parallaction_ns::_c_setMask(void *parm) { _vm->_gfx->intGrottaHackMask(); return; } -void _c_endComment(void *param) { +void Parallaction_ns::_c_endComment(void *param) { byte* _enginePal = _vm->_gfx->_palette; Gfx::Palette pal; @@ -432,7 +432,7 @@ void _c_endComment(void *param) { return; } -void _c_frankenstein(void *parm) { +void Parallaction_ns::_c_frankenstein(void *parm) { Gfx::Palette pal0; Gfx::Palette pal1; @@ -462,7 +462,7 @@ void _c_frankenstein(void *parm) { } -void _c_finito(void *parm) { +void Parallaction_ns::_c_finito(void *parm) { const char **v8C = endMsg0; const char **v7C = endMsg1; @@ -546,12 +546,12 @@ void _c_finito(void *parm) { return; } -void _c_ridux(void *parm) { +void Parallaction_ns::_c_ridux(void *parm) { _vm->changeCharacter(_minidinoName); return; } -void _c_testResult(void *parm) { +void Parallaction_ns::_c_testResult(void *parm) { _vm->_gfx->swapBuffers(); _vm->_disk->selectArchive("disk1"); @@ -568,18 +568,18 @@ void _c_testResult(void *parm) { return; } -void _c_offSound(void*) { +void Parallaction_ns::_c_offSound(void*) { _vm->_soundMan->stopSfx(0); _vm->_soundMan->stopSfx(1); _vm->_soundMan->stopSfx(2); _vm->_soundMan->stopSfx(3); } -void _c_startMusic(void*) { +void Parallaction_ns::_c_startMusic(void*) { _vm->_soundMan->playMusic(); } -void _c_closeMusic(void*) { +void Parallaction_ns::_c_closeMusic(void*) { _vm->_soundMan->stopMusic(); } @@ -587,7 +587,7 @@ void _c_closeMusic(void*) { intro callables */ -void _c_startIntro(void *parm) { +void Parallaction_ns::_c_startIntro(void *parm) { _rightHandAnim = _vm->findAnimation("righthand"); if (_vm->getPlatform() == Common::kPlatformPC) { @@ -600,7 +600,7 @@ void _c_startIntro(void *parm) { return; } -void _c_endIntro(void *parm) { +void Parallaction_ns::_c_endIntro(void *parm) { _vm->_gfx->setFont(kFontMenu); @@ -640,7 +640,7 @@ void _c_endIntro(void *parm) { return; } -void _c_moveSheet(void *parm) { +void Parallaction_ns::_c_moveSheet(void *parm) { static uint16 x = 319; @@ -672,7 +672,7 @@ void plotPixel(int x, int y, int color, void *data) { _vm->_gfx->plotMaskPixel(x, y, color); } -void _c_sketch(void *parm) { +void Parallaction_ns::_c_sketch(void *parm) { static uint16 index = 1; @@ -695,7 +695,7 @@ void _c_sketch(void *parm) { -void _c_shade(void *parm) { +void Parallaction_ns::_c_shade(void *parm) { Common::Rect r( _rightHandAnim->_left - 36, @@ -710,7 +710,7 @@ void _c_shade(void *parm) { } -void _c_projector(void*) { +void Parallaction_ns::_c_projector(void*) { #ifdef HALFBRITE static int dword_16032 = 0; @@ -766,13 +766,13 @@ void _c_projector(void*) { #endif } -void _c_HBOff(void*) { +void Parallaction_ns::_c_HBOff(void*) { #ifdef HALFBRITE _vm->_gfx->setHalfbriteMode(false); #endif } -void _c_HBOn(void*) { +void Parallaction_ns::_c_HBOn(void*) { #ifdef HALFBRITE _vm->_gfx->setHalfbriteMode(true); #endif diff --git a/engines/parallaction/module.mk b/engines/parallaction/module.mk index 052ab64aff..5a7a3b9694 100644 --- a/engines/parallaction/module.mk +++ b/engines/parallaction/module.mk @@ -2,7 +2,7 @@ MODULE := engines/parallaction MODULE_OBJS := \ animation.o \ - callables.o \ + callables_ns.o \ commands.o \ debug.o \ detection.o \ diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 1bc1cc63bd..7a4e076675 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -497,6 +497,42 @@ public: private: void initResources(); + typedef void (Parallaction_ns::*Callable)(void*); + + // common callables + void _c_play_boogie(void*); + void _c_startIntro(void*); + void _c_endIntro(void*); + void _c_moveSheet(void*); + void _c_sketch(void*); + void _c_shade(void*); + void _c_score(void*); + void _c_fade(void*); + void _c_moveSarc(void*); + void _c_contaFoglie(void*); + void _c_zeroFoglie(void*); + void _c_trasformata(void*); + void _c_offMouse(void*); + void _c_onMouse(void*); + void _c_setMask(void*); + void _c_endComment(void*); + void _c_frankenstein(void*); + void _c_finito(void*); + void _c_ridux(void*); + void _c_testResult(void*); + + // dos specific callables + void _c_null(void*); + + // amiga specific callables + void _c_projector(void*); + void _c_HBOff(void*); + void _c_offSound(void*); + void _c_startMusic(void*); + void _c_closeMusic(void*); + void _c_HBOn(void*); + + Callable _callables[25]; }; class Parallaction_br : public Parallaction { diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index e971701d6f..742f2c860a 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -69,9 +69,10 @@ int Parallaction_ns::init() { } void Parallaction_ns::callFunction(uint index, void* parm) { + printf("index = %i\n", index); assert(index >= 0 && index < 25); // magic value 25 is maximum # of callables for Nippon Safes - _callables[index](parm); + (this->*_callables[index])(parm); } diff --git a/engines/parallaction/staticres.cpp b/engines/parallaction/staticres.cpp index 567b43785a..ec94f56916 100644 --- a/engines/parallaction/staticres.cpp +++ b/engines/parallaction/staticres.cpp @@ -472,40 +472,6 @@ const char *_audioCommandsNamesRes_br[] = { "loop" }; -typedef void (*callable)(void*); - - -void _c_play_boogie(void*); -void _c_startIntro(void*); -void _c_endIntro(void*); -void _c_moveSheet(void*); -void _c_sketch(void*); -void _c_shade(void*); -void _c_score(void*); -void _c_fade(void*); -void _c_moveSarc(void*); -void _c_contaFoglie(void*); -void _c_zeroFoglie(void*); -void _c_trasformata(void*); -void _c_offMouse(void*); -void _c_onMouse(void*); -void _c_setMask(void*); -void _c_endComment(void*); -void _c_frankenstein(void*); -void _c_finito(void*); -void _c_ridux(void*); -void _c_testResult(void*); -void _c_null(void*); - -void _c_projector(void*); -void _c_HBOff(void*); -void _c_offSound(void*); -void _c_startMusic(void*); -void _c_closeMusic(void*); -void _c_HBOn(void*); - -callable _callables[25]; - const char *_dinoName = "dino"; const char *_donnaName = "donna"; const char *_doughName = "dough"; @@ -516,6 +482,7 @@ const char *_minidonnaName = "minidonna"; const char *_minidoughName = "minidough"; const char *_minidrkiName = "minidrki"; +#define CALLABLE_NS(x) &Parallaction_ns::x void Parallaction_ns::initResources() { @@ -535,57 +502,57 @@ void Parallaction_ns::initResources() { _localFlagNames->addData("visited"); if (getPlatform() == Common::kPlatformPC) { - _callables[0] = _c_play_boogie; - _callables[1] = _c_play_boogie; - _callables[2] = _c_startIntro; - _callables[3] = _c_endIntro; - _callables[4] = _c_moveSheet; - _callables[5] = _c_sketch; - _callables[6] = _c_shade; - _callables[7] = _c_score; - _callables[8] = _c_null; - _callables[9] = _c_null; - _callables[10] = _c_null; - _callables[11] = _c_fade; - _callables[12] = _c_play_boogie; - _callables[13] = _c_moveSarc; - _callables[14] = _c_contaFoglie; - _callables[15] = _c_zeroFoglie; - _callables[16] = _c_trasformata; - _callables[17] = _c_offMouse; - _callables[18] = _c_onMouse; - _callables[19] = _c_setMask; - _callables[20] = _c_endComment; - _callables[21] = _c_frankenstein; - _callables[22] = _c_finito; - _callables[23] = _c_ridux; - _callables[24] = _c_testResult; + _callables[0] = CALLABLE_NS(_c_play_boogie); + _callables[1] = CALLABLE_NS(_c_play_boogie); + _callables[2] = CALLABLE_NS(_c_startIntro); + _callables[3] = CALLABLE_NS(_c_endIntro); + _callables[4] = CALLABLE_NS(_c_moveSheet); + _callables[5] = CALLABLE_NS(_c_sketch); + _callables[6] = CALLABLE_NS(_c_shade); + _callables[7] = CALLABLE_NS(_c_score); + _callables[8] = CALLABLE_NS(_c_null); + _callables[9] = CALLABLE_NS(_c_null); + _callables[10] = CALLABLE_NS(_c_null); + _callables[11] = CALLABLE_NS(_c_fade); + _callables[12] = CALLABLE_NS(_c_play_boogie); + _callables[13] = CALLABLE_NS(_c_moveSarc); + _callables[14] = CALLABLE_NS(_c_contaFoglie); + _callables[15] = CALLABLE_NS(_c_zeroFoglie); + _callables[16] = CALLABLE_NS(_c_trasformata); + _callables[17] = CALLABLE_NS(_c_offMouse); + _callables[18] = CALLABLE_NS(_c_onMouse); + _callables[19] = CALLABLE_NS(_c_setMask); + _callables[20] = CALLABLE_NS(_c_endComment); + _callables[21] = CALLABLE_NS(_c_frankenstein); + _callables[22] = CALLABLE_NS(_c_finito); + _callables[23] = CALLABLE_NS(_c_ridux); + _callables[24] = CALLABLE_NS(_c_testResult); } else { - _callables[0] = _c_projector; - _callables[1] = _c_HBOff; - _callables[2] = _c_startIntro; - _callables[3] = _c_endIntro; - _callables[4] = _c_moveSheet; - _callables[5] = _c_sketch; - _callables[6] = _c_shade; - _callables[7] = _c_score; - _callables[8] = _c_offSound; - _callables[9] = _c_startMusic; - _callables[10] = _c_closeMusic; - _callables[11] = _c_fade; - _callables[12] = _c_HBOn; - _callables[13] = _c_moveSarc; - _callables[14] = _c_contaFoglie; - _callables[15] = _c_zeroFoglie; - _callables[16] = _c_trasformata; - _callables[17] = _c_offMouse; - _callables[18] = _c_onMouse; - _callables[19] = _c_setMask; - _callables[20] = _c_endComment; - _callables[21] = _c_frankenstein; - _callables[22] = _c_finito; - _callables[23] = _c_ridux; - _callables[24] = _c_testResult; + _callables[0] = CALLABLE_NS(_c_projector); + _callables[1] = CALLABLE_NS(_c_HBOff); + _callables[2] = CALLABLE_NS(_c_startIntro); + _callables[3] = CALLABLE_NS(_c_endIntro); + _callables[4] = CALLABLE_NS(_c_moveSheet); + _callables[5] = CALLABLE_NS(_c_sketch); + _callables[6] = CALLABLE_NS(_c_shade); + _callables[7] = CALLABLE_NS(_c_score); + _callables[8] = CALLABLE_NS(_c_offSound); + _callables[9] = CALLABLE_NS(_c_startMusic); + _callables[10] = CALLABLE_NS(_c_closeMusic); + _callables[11] = CALLABLE_NS(_c_fade); + _callables[12] = CALLABLE_NS(_c_HBOn); + _callables[13] = CALLABLE_NS(_c_moveSarc); + _callables[14] = CALLABLE_NS(_c_contaFoglie); + _callables[15] = CALLABLE_NS(_c_zeroFoglie); + _callables[16] = CALLABLE_NS(_c_trasformata); + _callables[17] = CALLABLE_NS(_c_offMouse); + _callables[18] = CALLABLE_NS(_c_onMouse); + _callables[19] = CALLABLE_NS(_c_setMask); + _callables[20] = CALLABLE_NS(_c_endComment); + _callables[21] = CALLABLE_NS(_c_frankenstein); + _callables[22] = CALLABLE_NS(_c_finito); + _callables[23] = CALLABLE_NS(_c_ridux); + _callables[24] = CALLABLE_NS(_c_testResult); } } |