diff options
-rw-r--r-- | engines/cge/cge.cpp | 4 | ||||
-rw-r--r-- | engines/cge/cge_main.cpp | 34 | ||||
-rw-r--r-- | engines/cge/cge_main.h | 41 | ||||
-rw-r--r-- | engines/cge/config.cpp | 4 | ||||
-rw-r--r-- | engines/cge/config.h | 1 | ||||
-rw-r--r-- | engines/cge/ems.cpp | 4 | ||||
-rw-r--r-- | engines/cge/game.cpp | 19 | ||||
-rw-r--r-- | engines/cge/game.h | 8 | ||||
-rw-r--r-- | engines/cge/snail.cpp | 8 | ||||
-rw-r--r-- | engines/cge/walk.cpp | 4 |
10 files changed, 47 insertions, 80 deletions
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp index 58c32dd575..6068dee46e 100644 --- a/engines/cge/cge.cpp +++ b/engines/cge/cge.cpp @@ -50,7 +50,7 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription) _isDemo = _gameDescription->flags & ADGF_DEMO; _startupMode = 1; - _demoText = DEMO_TEXT; + _demoText = kDemo; _oldLev = 0; _jbw = false; _pocPtr = 0; @@ -100,7 +100,7 @@ void CGEEngine::setup() { _mouse = new Mouse(this); _keyboard = new Keyboard(); _eventManager = new EventManager(); - _offUseCount = atoi(_text->getText(OFF_USE_COUNT)); + _offUseCount = atoi(_text->getText(kOffUseCount)); _music = true; _mini = new byte[MINI_EMM_SIZE]; diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index 22e38618cb..ee561726a1 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -139,7 +139,7 @@ void CGEEngine::syncHeader(Common::Serializer &s) { uint16 checksum; s.syncAsUint16LE(checksum); if (checksum != SVGCHKSUM) - error("%s", _text->getText(BADSVG_TEXT)); + error("%s", _text->getText(kBadSVG)); } } @@ -418,13 +418,13 @@ void CGEEngine::trouble(int seq, int txt) { void CGEEngine::offUse() { debugC(1, kCGEDebugEngine, "CGEEngine::offUse()"); - trouble(OFF_USE, OFF_USE_TEXT + new_random(_offUseCount)); + trouble(kSeqOffUse, kOffUse + new_random(_offUseCount)); } void CGEEngine::tooFar() { debugC(1, kCGEDebugEngine, "CGEEngine::tooFar()"); - trouble(TOO_FAR, TOO_FAR_TEXT); + trouble(kSeqTooFar, kTooFar); } void CGEEngine::loadHeroXY() { @@ -513,9 +513,9 @@ void CGEEngine::quit() { SNPOST_(SNKILL, -1, 0, Vmenu::_addr); resetQSwitch(); } else { - QuitMenu[0]._text = _text->getText(QUIT_TEXT); - QuitMenu[1]._text = _text->getText(NOQUIT_TEXT); - (new Vmenu(this, QuitMenu, -1, -1))->setName(_text->getText(QUIT_TITLE)); + QuitMenu[0]._text = _text->getText(kQuit); + QuitMenu[1]._text = _text->getText(kNoQuit); + (new Vmenu(this, QuitMenu, -1, -1))->setName(_text->getText(kQuitTitle)); SNPOST_(SNSEQ, 123, 1, NULL); keyClick(); } @@ -526,7 +526,7 @@ void CGEEngine::quit() { void CGEEngine::AltCtrlDel() { debugC(1, kCGEDebugEngine, "CGEEngine::AltCtrlDel()"); - SNPOST_(SNSAY, -1, A_C_D_TEXT, _hero); + SNPOST_(SNSAY, -1, kAltCtrlDel, _hero); } void CGEEngine::miniStep(int stp) { @@ -771,22 +771,22 @@ void System::touch(uint16 mask, int x, int y) { _vm->switchDebug(); break; case F3: - _hero->step(TSEQ + 4); + _hero->step(kTSeq + 4); break; case F4: - _hero->step(TSEQ + 5); + _hero->step(kTSeq + 5); break; case F5: - _hero->step(TSEQ + 0); + _hero->step(kTSeq + 0); break; case F6: - _hero->step(TSEQ + 1); + _hero->step(kTSeq + 1); break; case F7: - _hero->step(TSEQ + 2); + _hero->step(kTSeq + 2); break; case F8: - _hero->step(TSEQ + 3); + _hero->step(kTSeq + 3); break; case F9: _sys->_funDel = 1; @@ -927,7 +927,7 @@ void CGEEngine::switchMusic() { } } else { if (Startup::_core < CORE_HIG) - SNPOST(SNINF, -1, NOMUSIC_TEXT, NULL); + SNPOST(SNINF, -1, kNoMusic, NULL); else { SNPOST_(SNSEQ, 122, (_music = !_music), NULL); keyClick(); @@ -953,9 +953,9 @@ void CGEEngine::takeName() { SNPOST_(SNKILL, -1, 0, GetText::_ptr); else { memset(_usrFnam, 0, 15); - GetText *tn = new GetText(this, _text->getText(GETNAME_PROMPT), _usrFnam, 8); + GetText *tn = new GetText(this, _text->getText(kGetNamePrompt), _usrFnam, 8); if (tn) { - tn->setName(_text->getText(GETNAME_TITLE)); + tn->setName(_text->getText(kGetNameTitle)); tn->center(); tn->gotoxy(tn->_x, tn->_y - 10); tn->_z = 126; @@ -1417,7 +1417,7 @@ void CGEEngine::mainLoop() { SNPOST(SNINF, -1, _demoText, NULL); SNPOST(SNLABEL, -1, -1, NULL); if (_text->getText(++_demoText) == NULL) - _demoText = DEMO_TEXT + 1; + _demoText = kDemo + 1; } //FIXME: tc = TimerCount; } diff --git a/engines/cge/cge_main.h b/engines/cge/cge_main.h index 68c6f1f1dc..2a467761b3 100644 --- a/engines/cge/cge_main.h +++ b/engines/cge/cge_main.h @@ -69,27 +69,26 @@ namespace CGE { #define kSystemRate 6 // 12 Hz #define kHeroFun0 (40 * 12) #define kHeroFun1 ( 2 * 12) -#define GETNAME_PROMPT 50 -#define GETNAME_TITLE 51 -#define TSEQ 96 -#define NOMUSIC_TEXT 98 -#define BADSVG_TEXT 99 -#define HTALK (TSEQ + 4) -#define TOO_FAR (TSEQ + 5) -#define NO_WAY (TSEQ + 5) -#define POC_FUL (TSEQ + 5) -#define OFF_USE (TSEQ + 6) -#define QUIT_TITLE 200 -#define QUIT_TEXT 201 -#define NOQUIT_TEXT 202 -#define DEMO_TEXT 300 -#define NOSOUND_TEXT 310 -#define OFF_USE_COUNT 600 -#define OFF_USE_TEXT 601 -#define NO_WAY_TEXT 671 -#define TOO_FAR_TEXT 681 -#define POC_FUL_TEXT 691 -#define A_C_D_TEXT 777 +#define kGetNamePrompt 50 +#define kGetNameTitle 51 +#define kTSeq 96 +#define kNoMusic 98 +#define kBadSVG 99 +#define kSeqHTalk (kTSeq + 4) +#define kSeqTooFar (kTSeq + 5) +#define kSeqNoWay (kTSeq + 5) +#define kSeqPocketFull (kTSeq + 5) +#define kSeqOffUse (kTSeq + 6) +#define kQuitTitle 200 +#define kQuit 201 +#define kNoQuit 202 +#define kDemo 300 +#define kOffUseCount 600 +#define kOffUse 601 +#define kNoWay 671 +#define kTooFar 681 +#define kPocketFull 691 +#define kAltCtrlDel 777 #define kPanHeight 40 #define kScrWidth 320 #define kScrHeight 200 diff --git a/engines/cge/config.cpp b/engines/cge/config.cpp index 964b029b59..b1cc5769d8 100644 --- a/engines/cge/config.cpp +++ b/engines/cge/config.cpp @@ -33,8 +33,6 @@ namespace CGE { -#define MENU_TEXT 56 - static Choice *_cho; static int _hlp; @@ -43,7 +41,7 @@ void CGEEngine::snSelect() { inf(_text->getText(_hlp)); _talk->gotoxy(_talk->_x, kFontHigh / 2); - (new Vmenu(this, _cho, kScrWidth / 2, _talk->_y + _talk->_h + kTextVMargin + kFontHigh))->setName(_text->getText(MENU_TEXT)); + (new Vmenu(this, _cho, kScrWidth / 2, _talk->_y + _talk->_h + kTextVMargin + kFontHigh))->setName(_text->getText(kMenu)); } } // End of namespace CGE diff --git a/engines/cge/config.h b/engines/cge/config.h index d7191a281d..5ea677b97d 100644 --- a/engines/cge/config.h +++ b/engines/cge/config.h @@ -29,6 +29,7 @@ #define __CGE_CONFIG__ namespace CGE { + #define kMenu 56 } // End of namespace CGE #endif diff --git a/engines/cge/ems.cpp b/engines/cge/ems.cpp index 93342f77da..0364758a12 100644 --- a/engines/cge/ems.cpp +++ b/engines/cge/ems.cpp @@ -29,10 +29,6 @@ namespace CGE { -#define EMS_INT 0x67 -#define PAGE_MASK 0x3FFF -#define SIZ(n) ((n) ? ((long)n) : (0x10000L)) - enum EMM_FUN { GET_STATUS = 0x40, GET_FRAME, GET_SIZE, OPEN_HANDLE, MAP_PAGE, diff --git a/engines/cge/game.cpp b/engines/cge/game.cpp index 18c4efbe00..4107580691 100644 --- a/engines/cge/game.cpp +++ b/engines/cge/game.cpp @@ -43,36 +43,17 @@ uint8 *glass(Dac *pal, uint8 r, uint8 g, uint8 b) { return x; } -/* Useless? -uint8 *Mark(DAC *pal) { -#define f(c) (c ^ 63) - uint8 *x = new uint8[256]; - if (x) { - uint16 i; - for (i = 0; i < 256; i++) { - x[i] = closest(pal, mkDax(f(pal[i]._R), - f(pal[i]._G), - f(pal[i]._B))); - } - } - return x; -#undef f -} -*/ - int Fly::_l = 20, Fly::_t = 40, Fly::_r = 110, Fly::_b = 100; - Fly::Fly(CGEEngine *vm, Bitmap **shpl) : Sprite(vm, shpl), _tx(0), _ty(0), _vm(vm) { step(new_random(2)); gotoxy(_l + new_random(_r - _l - _w), _t + new_random(_b - _t - _h)); } - void Fly::tick() { step(); if (!_flags._kept) { diff --git a/engines/cge/game.h b/engines/cge/game.h index c442d81577..078f3880ea 100644 --- a/engines/cge/game.h +++ b/engines/cge/game.h @@ -33,15 +33,7 @@ namespace CGE { -//#define PAN_HIG 40 -//#define LBound(s) (s->X <= 0) -//#define RBound(s) (s->X+s->W >= SCR_WID) -//#define TBound(s) (s->Y <= 0) -//#define BBound(s) (s->Y+s->H >= SCR_HIG - PAN_HIG) - -//int sinus(long x); uint8 *glass(Dac *pal, uint8 r, uint8 g, uint8 b); -//uint8 *mark(DAC *pal); class Fly : public Sprite { static int _l; diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp index e9ae494811..e694cab0b9 100644 --- a/engines/cge/snail.cpp +++ b/engines/cge/snail.cpp @@ -303,10 +303,10 @@ void CGEEngine::pocFul() { _hero->park(); SNPOST(SNWAIT, -1, -1, _hero); - SNPOST(SNSEQ, -1, POC_FUL, _hero); + SNPOST(SNSEQ, -1, kSeqPocketFull, _hero); SNPOST(SNSOUND, -1, 2, _hero); SNPOST(SNWAIT, -1, -1, _hero); - SNPOST(SNSAY, 1, POC_FUL_TEXT, _hero); + SNPOST(SNSAY, 1, kPocketFull, _hero); } void CGEEngine::hide1(Sprite *spr) { @@ -1006,7 +1006,7 @@ void Snail::runCom() { case SNSAY : if (spr && _talkEnable) { if (spr == _hero && spr->seqTest(-1)) - spr->step(HTALK); + spr->step(kSeqHTalk); _text->say(_text->getText(snc->_val), spr); _sys->_funDel = kHeroFun0; } @@ -1020,7 +1020,7 @@ void Snail::runCom() { case SNTIME : if (spr && _talkEnable) { if (spr == _hero && spr->seqTest(-1)) - spr->step(HTALK); + spr->step(kSeqHTalk); sayTime(spr); } break; diff --git a/engines/cge/walk.cpp b/engines/cge/walk.cpp index f07ed4ece2..2568a51df0 100644 --- a/engines/cge/walk.cpp +++ b/engines/cge/walk.cpp @@ -234,7 +234,7 @@ void WALK::reach(Sprite *spr, int mode) { } // note: insert SNAIL commands in reverse order SNINSERT(SNPAUSE, -1, 64, NULL); - SNINSERT(SNSEQ, -1, TSEQ + mode, this); + SNINSERT(SNSEQ, -1, kTSeq + mode, this); if (spr) { SNINSERT(SNWAIT, -1, -1, _hero); /////--------$$$$$$$ //SNINSERT(SNWALK, -1, -1, spr); @@ -244,7 +244,7 @@ void WALK::reach(Sprite *spr, int mode) { } void WALK::noWay() { - _vm->trouble(NO_WAY, NO_WAY_TEXT); + _vm->trouble(kSeqNoWay, kNoWay); } bool WALK::find1Way(Cluster c) { |