diff options
author | lukaslw | 2014-10-08 17:39:10 +0200 |
---|---|---|
committer | lukaslw | 2014-10-08 17:39:10 +0200 |
commit | 0e70ffaf59044402973eb88ec32f338c522491e3 (patch) | |
tree | af01c3a3cccea91ad844d2ce87193b54ab9d8535 /engines | |
parent | dcb85739fffbfcb9b1da72ecbfcb048875f93d62 (diff) | |
download | scummvm-rg350-0e70ffaf59044402973eb88ec32f338c522491e3.tar.gz scummvm-rg350-0e70ffaf59044402973eb88ec32f338c522491e3.tar.bz2 scummvm-rg350-0e70ffaf59044402973eb88ec32f338c522491e3.zip |
PRINCE: Flags::getFlagName - debugging function
Faster searching by changing switch to bsearch and array
Diffstat (limited to 'engines')
-rw-r--r-- | engines/prince/flags.cpp | 759 | ||||
-rw-r--r-- | engines/prince/flags.h | 15 |
2 files changed, 399 insertions, 375 deletions
diff --git a/engines/prince/flags.cpp b/engines/prince/flags.cpp index 3b0d1d95dc..f1a05bd4df 100644 --- a/engines/prince/flags.cpp +++ b/engines/prince/flags.cpp @@ -21,383 +21,400 @@ */ #include "prince/flags.h" +#include "prince/script.h" namespace Prince { const char *Flags::getFlagName(uint16 flagId) { - switch (flagId) { - default: return "unknown_flag"; - case FLAGA1: return "FLAGA1"; - case FLAGA2: return "FLAGA2"; - case FLAGA3: return "FLAGA3"; - case DESTX: return "DESTX"; - case DESTY: return "DESTY"; - case DESTD: return "DESTD"; - case DwarfDone: return "DwarfDone"; - case GRABARZCOUNTER: return "GRABARZCOUNTER"; - case KIERUNEK: return "KIERUNEK"; - case BACKFLAG1: return "BACKFLAG1"; - case BACKFLAG2: return "BACKFLAG2"; - case BACKFLAG3: return "BACKFLAG3"; - case BACKFLAG4: return "BACKFLAG4"; - case MACROFLAG1: return "MACROFLAG1"; - case MACROFLAG2: return "MACROFLAG2"; - case MACROFLAG3: return "MACROFLAG3"; - case HEROLDDONE: return "HEROLDDONE"; - case BRIDGESET: return "BRIDGESET"; - case U_BT_1: return "U_BT_1"; - case U_BT_2: return "U_BT_2"; - case U_BT_3: return "U_BT_3"; - case U_BT_4: return "U_BT_4"; - case U_BT_5: return "U_BT_5"; - case U_BT_6: return "U_BT_6"; - case U_BT_7: return "U_BT_7"; - case U_BT_8: return "U_BT_8"; - case U_BT_9: return "U_BT_9"; - case U_BT_COUNTER: return "U_BT_COUNTER"; - case ARIVALDALIVE: return "ARIVALDALIVE"; - case TALKCHAR1: return "TALKCHAR1"; - case TalkType1: return "TalkType1"; - case TALKROUT1: return "TALKROUT1"; - case TALKROUT2: return "TALKROUT2"; - case TALKROUT3: return "TALKROUT3"; - case TALKROUT4: return "TALKROUT4"; - case TALKANIM1: return "TALKANIM1"; - case TALKANIM2: return "TALKANIM2"; - case TALKCOLOR1: return "TALKCOLOR1"; - case TALKCOLOR2: return "TALKCOLOR2"; - case KapciuchTaken: return "KapciuchTaken"; - case CurrentBeggarA: return "CurrentBeggarA"; - case TempKapc: return "TempKapc"; - case HomTaken: return "HomTaken"; - case WizardTalk: return "WizardTalk"; - case SunlordTalk: return "SunlordTalk"; - case HermitTalk: return "HermitTalk"; - case RunyMode: return "RunyMode"; - case FatMerchantTalk: return "FatMerchantTalk"; - case HotDogTalk: return "HotDogTalk"; - case ThiefTalk: return "ThiefTalk"; - case BeggarTalk: return "BeggarTalk"; - case MonkTalk: return "MonkTalk"; - case BardTalk: return "BardTalk"; - case BarmanTalk: return "BarmanTalk"; - case LeftPlayerTalk: return "LeftPlayerTalk"; - case OczySowy: return "OczySowy"; - case CzachySpeed1: return "CzachySpeed1"; - case CzachySpeed2: return "CzachySpeed2"; - case CzachySpeed3: return "CzachySpeed3"; - case CzachySlowDown1: return "CzachySlowDown1"; - case CzachySlowDown2: return "CzachySlowDown2"; - case CzachySlowDown3: return "CzachySlowDown3"; - case FjordDane: return "FjordDane"; - case GKopany1: return "GKopany1"; - case GKopany2: return "GKopany2"; - case GKopany3: return "GKopany3"; - case GKopany4: return "GKopany4"; - case KnowGodWord: return "KnowGodWord"; - case TALKROUT21: return "TALKROUT21"; - case TALKROUT22: return "TALKROUT22"; - case TALKROUT23: return "TALKROUT23"; - case TALKROUT24: return "TALKROUT24"; - case TalkType2: return "TalkType2"; - case GrabarzTalk: return "GrabarzTalk"; - case LastTalker: return "LastTalker"; - case MapaPustelniaEnabled: return "MapaPustelniaEnabled"; - case MapaTempleEnabled: return "MapaTempleEnabled"; - case MapaFjordEnabled: return "MapaFjordEnabled"; - case MapaSilmanionaEnabled: return "MapaSilmanionaEnabled"; - case MapaKurhanEnabled: return "MapaKurhanEnabled"; - case MapaDragonEnabled: return "MapaDragonEnabled"; - case MapaMillEnabled: return "MapaMillEnabled"; - case DwarfRunning: return "DwarfRunning"; - case DwarfTalk: return "DwarfTalk"; - case CurseLift: return "CurseLift"; - case KosciSwapped: return "KosciSwapped"; - case BookStolen: return "BookStolen"; - case MapaUsable: return "MapaUsable"; - case FjordBoss: return "FjordBoss"; - case FjordHotDog: return "FjordHotDog"; - case FjordLewy: return "FjordLewy"; - case FjordPrawy: return "FjordPrawy"; - case TalkArivald: return "TalkArivald"; - case ShootDone: return "ShootDone"; - case ShootRunning: return "ShootRunning"; - case ShootKnow: return "ShootKnow"; - case MirrorKnow: return "MirrorKnow"; - case Gar1stTime: return "Gar1stTime"; - case KosciTaken: return "KosciTaken"; - case ArivGotSpell: return "ArivGotSpell"; - case BookGiven: return "BookGiven"; - case Wywieszka: return "Wywieszka"; - case TalkSheila: return "TalkSheila"; - case TalkSheila2: return "TalkSheila2"; - case BackHuman: return "BackHuman"; - case SkarbiecOpen: return "SkarbiecOpen"; - case LustroTaken: return "LustroTaken"; - case GargoyleHom: return "GargoyleHom"; - case GargoyleBroken: return "GargoyleBroken"; - case FjordDzien: return "FjordDzien"; - case GargoyleHom2: return "GargoyleHom2"; - case RunMonstersRunning: return "RunMonstersRunning"; - case FoundPaperInCoffin: return "FoundPaperInCoffin"; - case KnowSunlord: return "KnowSunlord"; - case KnowSunlordTalk: return "KnowSunlordTalk"; - case ArivaldCzyta: return "ArivaldCzyta"; - case TelepX: return "TelepX"; - case TelepY: return "TelepY"; - case TelepDir: return "TelepDir"; - case TelepRoom: return "TelepRoom"; - case ListStolen: return "ListStolen"; - case WifeInDoor: return "WifeInDoor"; - case TalkWifeFlag: return "TalkWifeFlag"; - case LetterGiven: return "LetterGiven"; - case LutniaTaken: return "LutniaTaken"; - case BardHomeOpen: return "BardHomeOpen"; - case FjordNoMonsters: return "FjordNoMonsters"; - case ShandriaWallTalking: return "ShandriaWallTalking"; - case ShandriaWallCounter: return "ShandriaWallCounter"; - case ShandriaWallDone: return "ShandriaWallDone"; - case FutureDone: return "FutureDone"; - case TalkButch: return "TalkButch"; - case GotSzalik: return "GotSzalik"; - case GotCzosnek: return "GotCzosnek"; - case BearDone: return "BearDone"; - case NekrVisited: return "NekrVisited"; - case SunRiddle: return "SunRiddle"; - case PtaszekAway: return "PtaszekAway"; - case KotGadanie: return "KotGadanie"; - case SzlafmycaTaken: return "SzlafmycaTaken"; - case BabkaTalk: return "BabkaTalk"; - case SellerTalk: return "SellerTalk"; - case CzosnekDone: return "CzosnekDone"; - case PriestCounter: return "PriestCounter"; - case PriestGest1: return "PriestGest1"; - case PriestGest2: return "PriestGest2"; - case PriestGest3: return "PriestGest3"; - case PriestGest4: return "PriestGest4"; - case PriestAnim: return "PriestAnim"; - case HolyWaterTaken: return "HolyWaterTaken"; - case AxeTaken: return "AxeTaken"; - case BadylTaken1: return "BadylTaken1"; - case BadylTaken2: return "BadylTaken2"; - case BadylSharpened: return "BadylSharpened"; - case PorwanieSmoka: return "PorwanieSmoka"; - case ShopReOpen: return "ShopReOpen"; - case LuskaShown: return "LuskaShown"; - case CudKnow: return "CudKnow"; - case VampireDead: return "VampireDead"; - case MapaVisible1: return "MapaVisible1"; - case MapaVisible2: return "MapaVisible2"; - case MapaVisible3: return "MapaVisible3"; - case MapaVisible4: return "MapaVisible4"; - case MapaVisible5: return "MapaVisible5"; - case MapaVisible6: return "MapaVisible6"; - case MapaVisible7: return "MapaVisible7"; - case MapaVisible8: return "MapaVisible8"; - case MapaVisible9: return "MapaVisible9"; - case MapaX: return "MapaX"; - case MapaY: return "MapaY"; - case MapaD: return "MapaD"; - case OldMapaX: return "OldMapaX"; - case OldMapaY: return "OldMapaY"; - case OldMapaD: return "OldMapaD"; - case MovingBack: return "MovingBack"; - case MapaCount: return "MapaCount"; - case Pustelnia1st: return "Pustelnia1st"; - case CzarnePole1st: return "CzarnePole1st"; - case TalkArivNum: return "TalkArivNum"; - case Pfui: return "Pfui"; - case MapaSunlordEnabled:return "MapaSunlordEnabled"; - case WebDone: return "WebDone"; - case DragonDone: return "DragonDone"; - case KanPlay: return "KanPlay"; - case OldKanPlay: return "OldKanPlay"; - case LapkiWait: return "LapkiWait"; - case WebNoCheck: return "WebNoCheck"; - case Perfumeria: return "Perfumeria"; - case SmokNoCheck: return "SmokNoCheck"; - case IluzjaBroken: return "IluzjaBroken"; - case IluzjaWorking: return "IluzjaWorking"; - case IluzjaCounter: return "IluzjaCounter"; - case KurhanOpen1: return "KurhanOpen1"; - case KastetTaken: return "KastetTaken"; - case KastetDown: return "KastetDown"; - case KurhanDone: return "KurhanDone"; - case SkelCounter: return "SkelCounter"; - case SkelDial1: return "SkelDial1"; - case SkelDial2: return "SkelDial2"; - case SkelDial3: return "SkelDial3"; - case SkelDial4: return "SkelDial4"; - case SameTalker: return "SameTalker"; - case RunMonstersText: return "RunMonstersText"; - case PiwnicaChecked: return "PiwnicaChecked"; - case DragonTalked: return "DragonTalked"; - case ToldAboutBook: return "ToldAboutBook"; - case SilmanionaDone: return "SilmanionaDone"; - case ToldBookCount: return "ToldBookCount"; - case SmrodNoCheck: return "SmrodNoCheck"; - case RopeTaken: return "RopeTaken"; - case RopeTime: return "RopeTime"; - case LaskaFree: return "LaskaFree"; - case ShanSmokTalked: return "ShanSmokTalked"; - case SwordTaken: return "SwordTaken"; - case Mill1st: return "Mill1st"; - case SawRat: return "SawRat"; - case KnowRat: return "KnowRat"; - case DziuraTimer: return "DziuraTimer"; - case LaskaInside: return "LaskaInside"; - case HoleBig: return "HoleBig"; - case EnableWiedzmin: return "EnableWiedzmin"; - case EnableTrucizna: return "EnableTrucizna"; - case KnowPoison: return "KnowPoison"; - case KufelTaken: return "KufelTaken"; - case BojkaEnabled: return "BojkaEnabled"; - case BitwaNot1st: return "BitwaNot1st"; - case BojkaTimer: return "BojkaTimer"; - case BojkaGirl: return "BojkaGirl"; - case Look1st: return "Look1st"; - case RatTaken: return "RatTaken"; - case LaskaTalkedGr: return "LaskaTalkedGr"; - case RatusGivus: return "RatusGivus"; - case MamObole: return "MamObole"; - case Speed1st: return "Speed1st"; - case SpeedTimer: return "SpeedTimer"; - case ProveIt: return "ProveIt"; - case Proven: return "Proven"; - case ShowWoalka: return "ShowWoalka"; - case PoisonTaken: return "PoisonTaken"; - case HellOpened: return "HellOpened"; - case HellNoCheck: return "HellNoCheck"; - case TalAn1: return "TalAn1"; - case TalAn2: return "TalAn2"; - case TalAn3: return "TalAn3"; - case TalkDevilGuard: return "TalkDevilGuard"; - case Sword1st: return "Sword1st"; - case IluzjaNoCheck: return "IluzjaNoCheck"; - case RozdzielniaNumber: return "RozdzielniaNumber"; - case JailChecked: return "JailChecked"; - case JailTalked: return "JailTalked"; - case TrickFailed: return "TrickFailed"; - case WegielVisible: return "WegielVisible"; - case WegielTimer1: return "WegielTimer1"; - case RandomSample: return "RandomSample"; - case RandomSampleTimer: return "RandomSampleTimer"; - case SampleTimer: return "SampleTimer"; - case ZonaSample: return "ZonaSample"; - case HoleTryAgain: return "HoleTryAgain"; - case TeleportTimer: return "TeleportTimer"; - case RozLezy: return "RozLezy"; - case UdkoTimer: return "UdkoTimer"; - case ZaworZatkany: return "ZaworZatkany"; - case ZaworOpened: return "ZaworOpened"; - case DoorExploded: return "DoorExploded"; - case SkoraTaken: return "SkoraTaken"; - case CiezkieByl: return "CiezkieByl"; - case MamWegiel: return "MamWegiel"; - case SwiecaAway: return "SwiecaAway"; - case ITSAVE: return "ITSAVE"; - case RozpadlSie: return "RozpadlSie"; - case WegielFullTimer: return "WegielFullTimer"; - case WegielDown: return "WegielDown"; - case WegielDownTimer: return "WegielDownTimer"; - case PaliSie: return "PaliSie"; - case DiabGuardTalked: return "DiabGuardTalked"; - case GuardsNoCheck: return "GuardsNoCheck"; - case TalkedPowloka: return "TalkedPowloka"; - case JailOpen: return "JailOpen"; - case PrzytulTimer: return "PrzytulTimer"; - case JailDone: return "JailDone"; - case MamMonety: return "MamMonety"; - case LotTimer: return "LotTimer"; - case LotObj: return "LotObj"; - case PtakTimer: return "PtakTimer"; - case BookTimer: return "BookTimer"; - case BookGiba: return "BookGiba"; - case PtakLata: return "PtakLata"; - case Podej: return "Podej"; - case GotHint: return "GotHint"; - case LawaLeci: return "LawaLeci"; - case PowerKlik: return "PowerKlik"; - case LucekBad: return "LucekBad"; - case LucekBad1st: return "LucekBad1st"; - case IntroDial1: return "IntroDial1"; - case IntroDial2: return "IntroDial2"; - case ItsOutro: return "ItsOutro"; - case KamienComment: return "KamienComment"; - case KamienSkip: return "KamienSkip"; - case TesterFlag: return "TesterFlag"; - case RememberLine: return "RememberLine"; - case OpisLapek: return "OpisLapek"; - case TalWait: return "TalWait"; - case OpisKamienia: return "OpisKamienia"; - case JumpBox: return "JumpBox"; - case JumpBox1: return "JumpBox1"; - case JumpBox2: return "JumpBox2"; - case JumpBox3: return "JumpBox3"; - case SpecPiesek: return "SpecPiesek"; - case SpecPiesekCount: return "SpecPiesekCount"; - case SpecPiesekGadanie: return "SpecPiesekGadanie"; - case ZnikaFlag: return "ZnikaFlag"; - case ZnikaTimer: return "ZnikaTimer"; - case SowaTimer: return "SowaTimer"; - case MamrotanieOff: return "MamrotanieOff"; - - case CURRMOB: return "CURRMOB"; - case KOLOR: return "KOLOR"; - case MBFLAG: return "MBFLAG"; - case MXFLAG: return "MXFLAG"; - case MYFLAG: return "MYFLAG"; - case SCROLLTYPE: return "SCROLLTYPE"; - case SCROLLVALUE: return "SCROLLVALUE"; - case SCROLLVALUE2: return "SCROLLVALUE2"; - case TALKEXITCODE: return "TALKEXITCODE"; - case SPECROUTFLAG1: return "SPECROUTFLAG1"; - case SPECROUTFLAG2: return "SPECROUTFLAG2"; - case SPECROUTFLAG3: return "SPECROUTFLAG3"; - case TALKFLAGCODE: return "TALKFLAGCODE"; - case CURRROOM: return "CURRROOM"; - case Talker1Init: return "Talker1Init"; - case Talker2Init: return "Talker2Init"; - case RESTOREROOM: return "RESTOREROOM"; - case INVALLOWED: return "INVALLOWED"; - case BOXSEL: return "BOXSEL"; - case CURSEBLINK: return "CURSEBLINK"; - case EXACTMOVE: return "EXACTMOVE"; - case MOVEDESTX: return "MOVEDESTX"; - case MOVEDESTY: return "MOVEDESTY"; - case NOANTIALIAS: return "NOANTIALIAS"; - case ESCAPED: return "ESCAPED"; - case ALLOW1OPTION: return "ALLOW1OPTION"; - case VOICE_H_LINE: return "VOICE_H_LINE"; - case VOICE_A_LINE: return "VOICE_A_LINE"; - case VOICE_B_LINE: return "VOICE_B_LINE"; - case VOICE_C_LINE: return "VOICE_C_LINE"; - case NOHEROATALL: return "NOHEROATALL"; - case MOUSEENABLED: return "MOUSEENABLED"; - case DIALINES: return "DIALINES"; + FlagDebug *flagd = nullptr; + flagd = (FlagDebug *)bsearch(&flagId, _flagNames, kFlagDebugAmount, sizeof(FlagDebug), Flags::compareFlagDebug); + if (flagd != nullptr) { + return flagd->flagName; + } else { + return "unknown_flag"; + } +} - case SHANWALK: return "SHANWALK"; - case SHANDOG: return "SHANDOG"; - case GETACTIONBACK: return "GETACTIONBACK"; - case GETACTIONDATA: return "GETACTIONDATA"; - case GETACTION: return "GETACTION"; - case HEROFAST: return "HEROFAST"; - case SELITEM: return "SELITEM"; - case LMOUSE: return "LMOUSE"; - case MINMX: return "MINMX"; - case MAXMX: return "MAXMX"; - case MINMY: return "MINMY"; - case MAXMY: return "MAXMY"; - case TORX1: return "TORX1"; - case TORY1: return "TORY1"; - case TORX2: return "TORX2"; - case TORY2: return "TORY2"; - case POWER: return "POWER"; - case POWERENABLED: return "POWERENABLED"; - case FLCRESTORE: return "FLCRESTORE"; - case NOCLSTEXT: return "NOCLSTEXT"; - case ESCAPED2: return "ESCAPED2"; +int Flags::compareFlagDebug(const void *a, const void *b) { + const uint32 *flagId = (const uint32 *)a; + const FlagDebug *entry = (const FlagDebug *)b; + if (*flagId < (uint32)entry->id) { + return -1; + } else if (*flagId > (uint32)entry->id) { + return 1; } + return 0; } +const Flags::FlagDebug Flags::_flagNames[Flags::kFlagDebugAmount] = { + { Flags::FLAGA1, "FLAGA1" }, + { Flags::FLAGA2, "FLAGA2" }, + { Flags::FLAGA3, "FLAGA3" }, + { Flags::DESTX, "DESTX" }, + { Flags::DESTY, "DESTY" }, + { Flags::DESTD, "DESTD" }, + { Flags::DwarfDone, "DwarfDone" }, + { Flags::GRABARZCOUNTER, "GRABARZCOUNTER" }, + { Flags::KIERUNEK, "KIERUNEK" }, + { Flags::BACKFLAG1, "BACKFLAG1" }, + { Flags::BACKFLAG2, "BACKFLAG2" }, + { Flags::BACKFLAG3, "BACKFLAG3" }, + { Flags::BACKFLAG4, "BACKFLAG4" }, + { Flags::MACROFLAG1, "MACROFLAG1" }, + { Flags::MACROFLAG2, "MACROFLAG2" }, + { Flags::MACROFLAG3, "MACROFLAG3" }, + { Flags::HEROLDDONE, "HEROLDDONE" }, + { Flags::BRIDGESET, "BRIDGESET" }, + { Flags::U_BT_1, "U_BT_1" }, + { Flags::U_BT_2, "U_BT_2" }, + { Flags::U_BT_3, "U_BT_3" }, + { Flags::U_BT_4, "U_BT_4" }, + { Flags::U_BT_5, "U_BT_5" }, + { Flags::U_BT_6, "U_BT_6" }, + { Flags::U_BT_7, "U_BT_7" }, + { Flags::U_BT_8, "U_BT_8" }, + { Flags::U_BT_9, "U_BT_9" }, + { Flags::U_BT_COUNTER, "U_BT_COUNTER" }, + { Flags::ARIVALDALIVE, "ARIVALDALIVE" }, + { Flags::TALKCHAR1, "TALKCHAR1" }, + { Flags::TalkType1, "TalkType1" }, + { Flags::TALKROUT1, "TALKROUT1" }, + { Flags::TALKROUT2, "TALKROUT2" }, + { Flags::TALKROUT3, "TALKROUT3" }, + { Flags::TALKROUT4, "TALKROUT4" }, + { Flags::TALKANIM1, "TALKANIM1" }, + { Flags::TALKANIM2, "TALKANIM2" }, + { Flags::TALKCOLOR1, "TALKCOLOR1" }, + { Flags::TALKCOLOR2, "TALKCOLOR2" }, + { Flags::KapciuchTaken, "KapciuchTaken" }, + { Flags::CurrentBeggarA, "CurrentBeggarA" }, + { Flags::TempKapc, "TempKapc" }, + { Flags::HomTaken, "HomTaken" }, + { Flags::WizardTalk, "WizardTalk" }, + { Flags::SunlordTalk, "SunlordTalk" }, + { Flags::HermitTalk, "HermitTalk" }, + { Flags::RunyMode, "RunyMode" }, + { Flags::FatMerchantTalk, "FatMerchantTalk" }, + { Flags::HotDogTalk, "HotDogTalk" }, + { Flags::ThiefTalk, "ThiefTalk" }, + { Flags::BeggarTalk, "BeggarTalk" }, + { Flags::MonkTalk, "MonkTalk" }, + { Flags::BardTalk, "BardTalk" }, + { Flags::BarmanTalk, "BarmanTalk" }, + { Flags::LeftPlayerTalk, "LeftPlayerTalk" }, + { Flags::OczySowy, "OczySowy" }, + { Flags::CzachySpeed1, "CzachySpeed1" }, + { Flags::CzachySpeed2, "CzachySpeed2" }, + { Flags::CzachySpeed3, "CzachySpeed3" }, + { Flags::CzachySlowDown1, "CzachySlowDown1" }, + { Flags::CzachySlowDown2, "CzachySlowDown2" }, + { Flags::CzachySlowDown3, "CzachySlowDown3" }, + { Flags::FjordDane, "FjordDane" }, + { Flags::GKopany1, "GKopany1" }, + { Flags::GKopany2, "GKopany2" }, + { Flags::GKopany3, "GKopany3" }, + { Flags::GKopany4, "GKopany4" }, + { Flags::KnowGodWord, "KnowGodWord" }, + { Flags::TALKROUT21, "TALKROUT21" }, + { Flags::TALKROUT22, "TALKROUT22" }, + { Flags::TALKROUT23, "TALKROUT23" }, + { Flags::TALKROUT24, "TALKROUT24" }, + { Flags::TalkType2, "TalkType2" }, + { Flags::GrabarzTalk, "GrabarzTalk" }, + { Flags::LastTalker, "LastTalker" }, + { Flags::MapaPustelniaEnabled, "MapaPustelniaEnabled" }, + { Flags::MapaTempleEnabled, "MapaTempleEnabled" }, + { Flags::MapaFjordEnabled, "MapaFjordEnabled" }, + { Flags::MapaSilmanionaEnabled, "MapaSilmanionaEnabled" }, + { Flags::MapaKurhanEnabled, "MapaKurhanEnabled" }, + { Flags::MapaDragonEnabled, "MapaDragonEnabled" }, + { Flags::MapaMillEnabled, "MapaMillEnabled" }, + { Flags::DwarfRunning, "DwarfRunning" }, + { Flags::DwarfTalk, "DwarfTalk" }, + { Flags::CurseLift, "CurseLift" }, + { Flags::KosciSwapped, "KosciSwapped" }, + { Flags::BookStolen, "BookStolen" }, + { Flags::MapaUsable, "MapaUsable" }, + { Flags::FjordBoss, "FjordBoss" }, + { Flags::FjordHotDog, "FjordHotDog" }, + { Flags::FjordLewy, "FjordLewy" }, + { Flags::FjordPrawy, "FjordPrawy" }, + { Flags::TalkArivald, "TalkArivald" }, + { Flags::ShootDone, "ShootDone" }, + { Flags::ShootRunning, "ShootRunning" }, + { Flags::ShootKnow, "ShootKnow" }, + { Flags::MirrorKnow, "MirrorKnow" }, + { Flags::Gar1stTime, "Gar1stTime" }, + { Flags::KosciTaken, "KosciTaken" }, + { Flags::ArivGotSpell, "ArivGotSpell" }, + { Flags::BookGiven, "BookGiven" }, + { Flags::Wywieszka, "Wywieszka" }, + { Flags::TalkSheila, "TalkSheila" }, + { Flags::TalkSheila2, "TalkSheila2" }, + { Flags::BackHuman, "BackHuman" }, + { Flags::SkarbiecOpen, "SkarbiecOpen" }, + { Flags::LustroTaken, "LustroTaken" }, + { Flags::GargoyleHom, "GargoyleHom" }, + { Flags::GargoyleBroken, "GargoyleBroken" }, + { Flags::FjordDzien, "FjordDzien" }, + { Flags::GargoyleHom2, "GargoyleHom2" }, + { Flags::RunMonstersRunning, "RunMonstersRunning" }, + { Flags::FoundPaperInCoffin, "FoundPaperInCoffin" }, + { Flags::KnowSunlord, "KnowSunlord" }, + { Flags::KnowSunlordTalk, "KnowSunlordTalk" }, + { Flags::ArivaldCzyta, "ArivaldCzyta" }, + { Flags::TelepX, "TelepX" }, + { Flags::TelepY, "TelepY" }, + { Flags::TelepDir, "TelepDir" }, + { Flags::TelepRoom, "TelepRoom" }, + { Flags::ListStolen, "ListStolen" }, + { Flags::WifeInDoor, "WifeInDoor" }, + { Flags::TalkWifeFlag, "TalkWifeFlag" }, + { Flags::LetterGiven, "LetterGiven" }, + { Flags::LutniaTaken, "LutniaTaken" }, + { Flags::BardHomeOpen, "BardHomeOpen" }, + { Flags::FjordNoMonsters, "FjordNoMonsters" }, + { Flags::ShandriaWallTalking, "ShandriaWallTalking" }, + { Flags::ShandriaWallCounter, "ShandriaWallCounter" }, + { Flags::ShandriaWallDone, "ShandriaWallDone" }, + { Flags::FutureDone, "FutureDone" }, + { Flags::TalkButch, "TalkButch" }, + { Flags::GotSzalik, "GotSzalik" }, + { Flags::GotCzosnek, "GotCzosnek" }, + { Flags::BearDone, "BearDone" }, + { Flags::NekrVisited, "NekrVisited" }, + { Flags::SunRiddle, "SunRiddle" }, + { Flags::PtaszekAway, "PtaszekAway" }, + { Flags::KotGadanie, "KotGadanie" }, + { Flags::SzlafmycaTaken, "SzlafmycaTaken" }, + { Flags::BabkaTalk, "BabkaTalk" }, + { Flags::SellerTalk, "SellerTalk" }, + { Flags::CzosnekDone, "CzosnekDone" }, + { Flags::PriestCounter, "PriestCounter" }, + { Flags::PriestGest1, "PriestGest1" }, + { Flags::PriestGest2, "PriestGest2" }, + { Flags::PriestGest3, "PriestGest3" }, + { Flags::PriestGest4, "PriestGest4" }, + { Flags::PriestAnim, "PriestAnim" }, + { Flags::HolyWaterTaken, "HolyWaterTaken" }, + { Flags::AxeTaken, "AxeTaken" }, + { Flags::BadylTaken1, "BadylTaken1" }, + { Flags::BadylTaken2, "BadylTaken2" }, + { Flags::BadylSharpened, "BadylSharpened" }, + { Flags::PorwanieSmoka, "PorwanieSmoka" }, + { Flags::ShopReOpen, "ShopReOpen" }, + { Flags::LuskaShown, "LuskaShown" }, + { Flags::CudKnow, "CudKnow" }, + { Flags::VampireDead, "VampireDead" }, + { Flags::MapaVisible1, "MapaVisible1" }, + { Flags::MapaVisible2, "MapaVisible2" }, + { Flags::MapaVisible3, "MapaVisible3" }, + { Flags::MapaVisible4, "MapaVisible4" }, + { Flags::MapaVisible5, "MapaVisible5" }, + { Flags::MapaVisible6, "MapaVisible6" }, + { Flags::MapaVisible7, "MapaVisible7" }, + { Flags::MapaVisible8, "MapaVisible8" }, + { Flags::MapaVisible9, "MapaVisible9" }, + { Flags::MapaX, "MapaX" }, + { Flags::MapaY, "MapaY" }, + { Flags::MapaD, "MapaD" }, + { Flags::OldMapaX, "OldMapaX" }, + { Flags::OldMapaY, "OldMapaY" }, + { Flags::OldMapaD, "OldMapaD" }, + { Flags::MovingBack, "MovingBack" }, + { Flags::MapaCount, "MapaCount" }, + { Flags::Pustelnia1st, "Pustelnia1st" }, + { Flags::CzarnePole1st, "CzarnePole1st" }, + { Flags::TalkArivNum, "TalkArivNum" }, + { Flags::Pfui, "Pfui" }, + { Flags::MapaSunlordEnabled, "MapaSunlordEnabled" }, + { Flags::WebDone, "WebDone" }, + { Flags::DragonDone, "DragonDone" }, + { Flags::KanPlay, "KanPlay" }, + { Flags::OldKanPlay, "OldKanPlay" }, + { Flags::LapkiWait, "LapkiWait" }, + { Flags::WebNoCheck, "WebNoCheck" }, + { Flags::Perfumeria, "Perfumeria" }, + { Flags::SmokNoCheck, "SmokNoCheck" }, + { Flags::IluzjaBroken, "IluzjaBroken" }, + { Flags::IluzjaWorking, "IluzjaWorking" }, + { Flags::IluzjaCounter, "IluzjaCounter" }, + { Flags::KurhanOpen1, "KurhanOpen1" }, + { Flags::KastetTaken, "KastetTaken" }, + { Flags::KastetDown, "KastetDown" }, + { Flags::KurhanDone, "KurhanDone" }, + { Flags::SkelCounter, "SkelCounter" }, + { Flags::SkelDial1, "SkelDial1" }, + { Flags::SkelDial2, "SkelDial2" }, + { Flags::SkelDial3, "SkelDial3" }, + { Flags::SkelDial4, "SkelDial4" }, + { Flags::SameTalker, "SameTalker" }, + { Flags::RunMonstersText, "RunMonstersText" }, + { Flags::PiwnicaChecked, "PiwnicaChecked" }, + { Flags::DragonTalked, "DragonTalked" }, + { Flags::ToldAboutBook, "ToldAboutBook" }, + { Flags::SilmanionaDone, "SilmanionaDone" }, + { Flags::ToldBookCount, "ToldBookCount" }, + { Flags::SmrodNoCheck, "SmrodNoCheck" }, + { Flags::RopeTaken, "RopeTaken" }, + { Flags::RopeTime, "RopeTime" }, + { Flags::LaskaFree, "LaskaFree" }, + { Flags::ShanSmokTalked, "ShanSmokTalked" }, + { Flags::SwordTaken, "SwordTaken" }, + { Flags::Mill1st, "Mill1st" }, + { Flags::SawRat, "SawRat" }, + { Flags::KnowRat, "KnowRat" }, + { Flags::DziuraTimer, "DziuraTimer" }, + { Flags::LaskaInside, "LaskaInside" }, + { Flags::HoleBig, "HoleBig" }, + { Flags::EnableWiedzmin, "EnableWiedzmin" }, + { Flags::EnableTrucizna, "EnableTrucizna" }, + { Flags::KnowPoison, "KnowPoison" }, + { Flags::KufelTaken, "KufelTaken" }, + { Flags::BojkaEnabled, "BojkaEnabled" }, + { Flags::BitwaNot1st, "BitwaNot1st" }, + { Flags::BojkaTimer, "BojkaTimer" }, + { Flags::BojkaGirl, "BojkaGirl" }, + { Flags::Look1st, "Look1st" }, + { Flags::RatTaken, "RatTaken" }, + { Flags::LaskaTalkedGr, "LaskaTalkedGr" }, + { Flags::RatusGivus, "RatusGivus" }, + { Flags::MamObole, "MamObole" }, + { Flags::Speed1st, "Speed1st" }, + { Flags::SpeedTimer, "SpeedTimer" }, + { Flags::ProveIt, "ProveIt" }, + { Flags::Proven, "Proven" }, + { Flags::ShowWoalka, "ShowWoalka" }, + { Flags::PoisonTaken, "PoisonTaken" }, + { Flags::HellOpened, "HellOpened" }, + { Flags::HellNoCheck, "HellNoCheck" }, + { Flags::TalAn1, "TalAn1" }, + { Flags::TalAn2, "TalAn2" }, + { Flags::TalAn3, "TalAn3" }, + { Flags::TalkDevilGuard, "TalkDevilGuard" }, + { Flags::Sword1st, "Sword1st" }, + { Flags::IluzjaNoCheck, "IluzjaNoCheck" }, + { Flags::RozdzielniaNumber, "RozdzielniaNumber" }, + { Flags::JailChecked, "JailChecked" }, + { Flags::JailTalked, "JailTalked" }, + { Flags::TrickFailed, "TrickFailed" }, + { Flags::WegielVisible, "WegielVisible" }, + { Flags::WegielTimer1, "WegielTimer1" }, + { Flags::RandomSample, "RandomSample" }, + { Flags::RandomSampleTimer, "RandomSampleTimer" }, + { Flags::SampleTimer, "SampleTimer" }, + { Flags::ZonaSample, "ZonaSample" }, + { Flags::HoleTryAgain, "HoleTryAgain" }, + { Flags::TeleportTimer, "TeleportTimer" }, + { Flags::RozLezy, "RozLezy" }, + { Flags::UdkoTimer, "UdkoTimer" }, + { Flags::ZaworZatkany, "ZaworZatkany" }, + { Flags::ZaworOpened, "ZaworOpened" }, + { Flags::DoorExploded, "DoorExploded" }, + { Flags::SkoraTaken, "SkoraTaken" }, + { Flags::CiezkieByl, "CiezkieByl" }, + { Flags::MamWegiel, "MamWegiel" }, + { Flags::SwiecaAway, "SwiecaAway" }, + { Flags::ITSAVE, "ITSAVE" }, + { Flags::RozpadlSie, "RozpadlSie" }, + { Flags::WegielFullTimer, "WegielFullTimer" }, + { Flags::WegielDown, "WegielDown" }, + { Flags::WegielDownTimer, "WegielDownTimer" }, + { Flags::PaliSie, "PaliSie" }, + { Flags::DiabGuardTalked, "DiabGuardTalked" }, + { Flags::GuardsNoCheck, "GuardsNoCheck" }, + { Flags::TalkedPowloka, "TalkedPowloka" }, + { Flags::JailOpen, "JailOpen" }, + { Flags::PrzytulTimer, "PrzytulTimer" }, + { Flags::JailDone, "JailDone" }, + { Flags::MamMonety, "MamMonety" }, + { Flags::LotTimer, "LotTimer" }, + { Flags::LotObj, "LotObj" }, + { Flags::PtakTimer, "PtakTimer" }, + { Flags::BookTimer, "BookTimer" }, + { Flags::BookGiba, "BookGiba" }, + { Flags::PtakLata, "PtakLata" }, + { Flags::Podej, "Podej" }, + { Flags::GotHint, "GotHint" }, + { Flags::LawaLeci, "LawaLeci" }, + { Flags::PowerKlik, "PowerKlik" }, + { Flags::LucekBad, "LucekBad" }, + { Flags::LucekBad1st, "LucekBad1st" }, + { Flags::IntroDial1, "IntroDial1" }, + { Flags::IntroDial2, "IntroDial2" }, + { Flags::ItsOutro, "ItsOutro" }, + { Flags::KamienComment, "KamienComment" }, + { Flags::KamienSkip, "KamienSkip" }, + { Flags::TesterFlag, "TesterFlag" }, + { Flags::RememberLine, "RememberLine" }, + { Flags::OpisLapek, "OpisLapek" }, + { Flags::TalWait, "TalWait" }, + { Flags::OpisKamienia, "OpisKamienia" }, + { Flags::JumpBox, "JumpBox" }, + { Flags::JumpBox1, "JumpBox1" }, + { Flags::JumpBox2, "JumpBox2" }, + { Flags::JumpBox3, "JumpBox3" }, + { Flags::SpecPiesek, "SpecPiesek" }, + { Flags::SpecPiesekCount, "SpecPiesekCount" }, + { Flags::SpecPiesekGadanie, "SpecPiesekGadanie" }, + { Flags::ZnikaFlag, "ZnikaFlag" }, + { Flags::ZnikaTimer, "ZnikaTimer" }, + { Flags::SowaTimer, "SowaTimer" }, + { Flags::MamrotanieOff, "MamrotanieOff" }, + { Flags::CURRMOB, "CURRMOB" }, + { Flags::KOLOR, "KOLOR" }, + { Flags::MBFLAG, "MBFLAG" }, + { Flags::MXFLAG, "MXFLAG" }, + { Flags::MYFLAG, "MYFLAG" }, + { Flags::SCROLLTYPE, "SCROLLTYPE" }, + { Flags::SCROLLVALUE, "SCROLLVALUE" }, + { Flags::SCROLLVALUE2, "SCROLLVALUE2" }, + { Flags::TALKEXITCODE, "TALKEXITCODE" }, + { Flags::SPECROUTFLAG1, "SPECROUTFLAG1" }, + { Flags::SPECROUTFLAG2, "SPECROUTFLAG2" }, + { Flags::SPECROUTFLAG3, "SPECROUTFLAG3" }, + { Flags::TALKFLAGCODE, "TALKFLAGCODE" }, + { Flags::CURRROOM, "CURRROOM" }, + { Flags::Talker1Init, "Talker1Init" }, + { Flags::Talker2Init, "Talker2Init" }, + { Flags::RESTOREROOM, "RESTOREROOM" }, + { Flags::INVALLOWED, "INVALLOWED" }, + { Flags::BOXSEL, "BOXSEL" }, + { Flags::CURSEBLINK, "CURSEBLINK" }, + { Flags::EXACTMOVE, "EXACTMOVE" }, + { Flags::MOVEDESTX, "MOVEDESTX" }, + { Flags::MOVEDESTY, "MOVEDESTY" }, + { Flags::NOANTIALIAS, "NOANTIALIAS" }, + { Flags::ESCAPED, "ESCAPED" }, + { Flags::ALLOW1OPTION, "ALLOW1OPTION" }, + { Flags::VOICE_H_LINE, "VOICE_H_LINE" }, + { Flags::VOICE_A_LINE, "VOICE_A_LINE" }, + { Flags::VOICE_B_LINE, "VOICE_B_LINE" }, + { Flags::VOICE_C_LINE, "VOICE_C_LINE" }, + { Flags::NOHEROATALL, "NOHEROATALL" }, + { Flags::MOUSEENABLED, "MOUSEENABLED" }, + { Flags::DIALINES, "DIALINES" }, + { Flags::SHANWALK, "SHANWALK" }, + { Flags::SHANDOG, "SHANDOG" }, + { Flags::GETACTIONBACK, "GETACTIONBACK" }, + { Flags::GETACTIONDATA, "GETACTIONDATA" }, + { Flags::GETACTION, "GETACTION" }, + { Flags::HEROFAST, "HEROFAST" }, + { Flags::SELITEM, "SELITEM" }, + { Flags::LMOUSE, "LMOUSE" }, + { Flags::MINMX, "MINMX" }, + { Flags::MAXMX, "MAXMX" }, + { Flags::MINMY, "MINMY" }, + { Flags::MAXMY, "MAXMY" }, + { Flags::TORX1, "TORX1" }, + { Flags::TORY1, "TORY1" }, + { Flags::TORX2, "TORX2" }, + { Flags::TORY2, "TORY2" }, + { Flags::POWER, "POWER" }, + { Flags::POWERENABLED, "POWERENABLED" }, + { Flags::FLCRESTORE, "FLCRESTORE" }, + { Flags::NOCLSTEXT, "NOCLSTEXT" }, + { Flags::ESCAPED2, "ESCAPED2" }, +}; + } // End of namespace Prince diff --git a/engines/prince/flags.h b/engines/prince/flags.h index efa97eb5ed..706f72826a 100644 --- a/engines/prince/flags.h +++ b/engines/prince/flags.h @@ -27,10 +27,9 @@ namespace Prince { -struct Flags { - - // TODO: Remove from release build - // useful just for debugging +class Flags { +public: + static int compareFlagDebug(const void *a, const void *b); static const char *getFlagName(uint16 flagId); enum Id { @@ -408,6 +407,14 @@ struct Flags { NOCLSTEXT = 0x846E, ESCAPED2 = 0x8470 }; + + struct FlagDebug { + Id id; + char flagName[30]; + }; + + static const int kFlagDebugAmount = 368; + static const FlagDebug _flagNames[kFlagDebugAmount]; }; } // End of namespace Prince |