diff options
author | dreammaster | 2018-11-10 05:42:22 +0000 |
---|---|---|
committer | Paul Gilbert | 2018-12-08 19:05:59 -0800 |
commit | a8e656a5de01e18697fa4f0086215d11d9143197 (patch) | |
tree | 95387943edd3e57d8db031534dc4105de05e525c /engines | |
parent | 5ddf55da6cb9ba283229d2a06014ab5b88f6bfb4 (diff) | |
download | scummvm-rg350-a8e656a5de01e18697fa4f0086215d11d9143197.tar.gz scummvm-rg350-a8e656a5de01e18697fa4f0086215d11d9143197.tar.bz2 scummvm-rg350-a8e656a5de01e18697fa4f0086215d11d9143197.zip |
GLK: astyle formatting
Diffstat (limited to 'engines')
31 files changed, 5058 insertions, 4897 deletions
diff --git a/engines/gargoyle/conf.cpp b/engines/gargoyle/conf.cpp index 7add133cba..9a0d6482aa 100644 --- a/engines/gargoyle/conf.cpp +++ b/engines/gargoyle/conf.cpp @@ -35,31 +35,31 @@ const byte SCROLL_BG[3] = { 0xb0, 0xb0, 0xb0 }; const byte SCROLL_FG[3] = { 0x80, 0x80, 0x80 }; WindowStyle T_STYLES[style_NUMSTYLES] = { - { PROPR,{ 0xff,0xff,0xff },{ 0x00,0x00,0x00 }, 0 }, ///< Normal - { PROPI,{ 0xff,0xff,0xff },{ 0x00,0x00,0x00 }, 0 }, ///< Emphasized - { MONOR,{ 0xff,0xff,0xff },{ 0x00,0x00,0x00 }, 0 }, ///< Preformatted - { PROPB,{ 0xff,0xff,0xff },{ 0x00,0x00,0x00 }, 0 }, ///< Header - { PROPB,{ 0xff,0xff,0xff },{ 0x00,0x00,0x00 }, 0 }, ///< Subheader - { PROPZ,{ 0xff,0xff,0xff },{ 0x00,0x00,0x00 }, 0 }, ///< Alert - { PROPR,{ 0xff,0xff,0xff },{ 0x00,0x00,0x00 }, 0 }, ///< Note - { PROPR,{ 0xff,0xff,0xff },{ 0x00,0x00,0x00 }, 0 }, ///< BlockQuote - { PROPB,{ 0xff,0xff,0xff },{ 0x00,0x60,0x00 }, 0 }, ///< Input - { MONOR,{ 0xff,0xff,0xff },{ 0x00,0x00,0x00 }, 0 }, ///< User1 - { MONOR,{ 0xff,0xff,0xff },{ 0x00,0x00,0x00 }, 0 }, ///< User2 + { PROPR, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< Normal + { PROPI, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< Emphasized + { MONOR, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< Preformatted + { PROPB, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< Header + { PROPB, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< Subheader + { PROPZ, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< Alert + { PROPR, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< Note + { PROPR, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< BlockQuote + { PROPB, { 0xff, 0xff, 0xff }, { 0x00, 0x60, 0x00 }, 0 }, ///< Input + { MONOR, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< User1 + { MONOR, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< User2 }; WindowStyle G_STYLES[style_NUMSTYLES] = { - { MONOR,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< Normal - { MONOI,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< Emphasized - { MONOR,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< Preformatted - { MONOB,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< Header - { MONOB,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< Subheader - { MONOR,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< Alert - { MONOR,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< Note - { MONOR,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< BlockQuote - { MONOR,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< Input - { MONOR,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< User1 - { MONOR,{ 0xff,0xff,0xff },{ 0x60,0x60,0x60 }, 0 }, ///< User2 + { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< Normal + { MONOI, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< Emphasized + { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< Preformatted + { MONOB, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< Header + { MONOB, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< Subheader + { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< Alert + { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< Note + { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< BlockQuote + { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< Input + { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< User1 + { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< User2 }; Conf *g_conf; @@ -122,7 +122,7 @@ Conf::Conf() { get("tmarginx", _tMarginX, 7); get("tmarginy", _tMarginY, 7); get("gamma", _gamma, 1.0); - + get("caretcolor", _caretColor); get("caretcolor", _caretSave); get("linkcolor", _linkColor, BLUE); @@ -235,9 +235,15 @@ void Conf::parseColor(const Common::String &str, byte *color) { char r[3], g[3], b[3]; if (str.size() == 6) { - r[0] = str[0]; r[1] = str[1]; r[2] = 0; - g[0] = str[2]; g[1] = str[3]; g[2] = 0; - b[0] = str[4]; b[1] = str[5]; b[2] = 0; + r[0] = str[0]; + r[1] = str[1]; + r[2] = 0; + g[0] = str[2]; + g[1] = str[3]; + g[2] = 0; + b[0] = str[4]; + b[1] = str[5]; + b[2] = 0; color[0] = strtol(r, nullptr, 16); color[1] = strtol(g, nullptr, 16); diff --git a/engines/gargoyle/detection.cpp b/engines/gargoyle/detection.cpp index af7cfc6b34..4363c4607c 100644 --- a/engines/gargoyle/detection.cpp +++ b/engines/gargoyle/detection.cpp @@ -125,20 +125,20 @@ public: bool GargoyleMetaEngine::hasFeature(MetaEngineFeature f) const { return - (f == kSupportsListSaves) || - (f == kSupportsLoadingDuringStartup) || - (f == kSupportsDeleteSave) || - (f == kSavesSupportMetaInfo) || - (f == kSavesSupportCreationDate) || - (f == kSavesSupportPlayTime) || - (f == kSimpleSavesNames); + (f == kSupportsListSaves) || + (f == kSupportsLoadingDuringStartup) || + (f == kSupportsDeleteSave) || + (f == kSavesSupportMetaInfo) || + (f == kSavesSupportCreationDate) || + (f == kSavesSupportPlayTime) || + (f == kSimpleSavesNames); } bool Gargoyle::GargoyleEngine::hasFeature(EngineFeature f) const { return - (f == kSupportsRTL) || - (f == kSupportsLoadingDuringRuntime) || - (f == kSupportsSavingDuringRuntime); + (f == kSupportsRTL) || + (f == kSupportsLoadingDuringRuntime) || + (f == kSupportsSavingDuringRuntime); } bool GargoyleMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { @@ -255,7 +255,7 @@ ADDetectedGames GargoyleMetaEngine::detectGame(const Common::FSNode &parent, con } #if PLUGIN_ENABLED_DYNAMIC(GARGOYLE) - REGISTER_PLUGIN_DYNAMIC(Gargoyle, PLUGIN_TYPE_ENGINE, GargoyleMetaEngine); +REGISTER_PLUGIN_DYNAMIC(Gargoyle, PLUGIN_TYPE_ENGINE, GargoyleMetaEngine); #else - REGISTER_PLUGIN_STATIC(GARGOYLE, PLUGIN_TYPE_ENGINE, GargoyleMetaEngine); +REGISTER_PLUGIN_STATIC(GARGOYLE, PLUGIN_TYPE_ENGINE, GargoyleMetaEngine); #endif diff --git a/engines/gargoyle/detection_tables.h b/engines/gargoyle/detection_tables.h index 780cfe284d..777d4db96b 100644 --- a/engines/gargoyle/detection_tables.h +++ b/engines/gargoyle/detection_tables.h @@ -21,7 +21,7 @@ */ namespace Gargoyle { - + static const GargoyleGameDescription gameDescriptions[] = { { { diff --git a/engines/gargoyle/events.cpp b/engines/gargoyle/events.cpp index 520b6f22e5..6c0cd71985 100644 --- a/engines/gargoyle/events.cpp +++ b/engines/gargoyle/events.cpp @@ -54,7 +54,7 @@ const byte ARROW[] = { }; Events::Events() : _forceClick(false), _currentEvent(nullptr), _cursorId(CURSOR_NONE), - _timerMilli(0), _timerTimeExpiry(0), _priorFrameTime(0), _frameCounter(0) { + _timerMilli(0), _timerTimeExpiry(0), _priorFrameTime(0), _frameCounter(0) { initializeCursors(); } @@ -239,34 +239,85 @@ void Events::handleKeyDown(const Common::KeyState &ks) { return; switch (ks.keycode) { - case Common::KEYCODE_RETURN: windows.inputHandleKey(keycode_Return); break; - case Common::KEYCODE_BACKSPACE: windows.inputHandleKey(keycode_Delete); break; - case Common::KEYCODE_DELETE: windows.inputHandleKey(keycode_Erase); break; - case Common::KEYCODE_TAB: windows.inputHandleKey(keycode_Tab); break; - case Common::KEYCODE_PAGEUP: windows.inputHandleKey(keycode_PageUp); break; - case Common::KEYCODE_PAGEDOWN: windows.inputHandleKey(keycode_PageDown); break; - case Common::KEYCODE_HOME: windows.inputHandleKey(keycode_Home); break; - case Common::KEYCODE_END: windows.inputHandleKey(keycode_End); break; - case Common::KEYCODE_LEFT: windows.inputHandleKey(keycode_Left); break; - case Common::KEYCODE_RIGHT: windows.inputHandleKey(keycode_Right); break; - case Common::KEYCODE_UP: windows.inputHandleKey(keycode_Up); break; - case Common::KEYCODE_DOWN: windows.inputHandleKey(keycode_Down); break; - case Common::KEYCODE_ESCAPE: windows.inputHandleKey(keycode_Escape); break; - case Common::KEYCODE_F1: windows.inputHandleKey(keycode_Func1); break; - case Common::KEYCODE_F2: windows.inputHandleKey(keycode_Func2); break; - case Common::KEYCODE_F3: windows.inputHandleKey(keycode_Func3); break; - case Common::KEYCODE_F4: windows.inputHandleKey(keycode_Func4); break; - case Common::KEYCODE_F5: windows.inputHandleKey(keycode_Func5); break; - case Common::KEYCODE_F6: windows.inputHandleKey(keycode_Func6); break; - case Common::KEYCODE_F7: windows.inputHandleKey(keycode_Func7); break; - case Common::KEYCODE_F8: windows.inputHandleKey(keycode_Func8); break; - case Common::KEYCODE_F9: windows.inputHandleKey(keycode_Func9); break; - case Common::KEYCODE_F10: windows.inputHandleKey(keycode_Func10); break; - case Common::KEYCODE_F11: windows.inputHandleKey(keycode_Func11); break; - case Common::KEYCODE_F12: windows.inputHandleKey(keycode_Func12); break; + case Common::KEYCODE_RETURN: + windows.inputHandleKey(keycode_Return); + break; + case Common::KEYCODE_BACKSPACE: + windows.inputHandleKey(keycode_Delete); + break; + case Common::KEYCODE_DELETE: + windows.inputHandleKey(keycode_Erase); + break; + case Common::KEYCODE_TAB: + windows.inputHandleKey(keycode_Tab); + break; + case Common::KEYCODE_PAGEUP: + windows.inputHandleKey(keycode_PageUp); + break; + case Common::KEYCODE_PAGEDOWN: + windows.inputHandleKey(keycode_PageDown); + break; + case Common::KEYCODE_HOME: + windows.inputHandleKey(keycode_Home); + break; + case Common::KEYCODE_END: + windows.inputHandleKey(keycode_End); + break; + case Common::KEYCODE_LEFT: + windows.inputHandleKey(keycode_Left); + break; + case Common::KEYCODE_RIGHT: + windows.inputHandleKey(keycode_Right); + break; + case Common::KEYCODE_UP: + windows.inputHandleKey(keycode_Up); + break; + case Common::KEYCODE_DOWN: + windows.inputHandleKey(keycode_Down); + break; + case Common::KEYCODE_ESCAPE: + windows.inputHandleKey(keycode_Escape); + break; + case Common::KEYCODE_F1: + windows.inputHandleKey(keycode_Func1); + break; + case Common::KEYCODE_F2: + windows.inputHandleKey(keycode_Func2); + break; + case Common::KEYCODE_F3: + windows.inputHandleKey(keycode_Func3); + break; + case Common::KEYCODE_F4: + windows.inputHandleKey(keycode_Func4); + break; + case Common::KEYCODE_F5: + windows.inputHandleKey(keycode_Func5); + break; + case Common::KEYCODE_F6: + windows.inputHandleKey(keycode_Func6); + break; + case Common::KEYCODE_F7: + windows.inputHandleKey(keycode_Func7); + break; + case Common::KEYCODE_F8: + windows.inputHandleKey(keycode_Func8); + break; + case Common::KEYCODE_F9: + windows.inputHandleKey(keycode_Func9); + break; + case Common::KEYCODE_F10: + windows.inputHandleKey(keycode_Func10); + break; + case Common::KEYCODE_F11: + windows.inputHandleKey(keycode_Func11); + break; + case Common::KEYCODE_F12: + windows.inputHandleKey(keycode_Func12); + break; default: - windows.inputHandleKey(ks.ascii); break; - break; + windows.inputHandleKey(ks.ascii); + break; + break; } } @@ -317,8 +368,8 @@ void Events::waitForPress() { g_system->delayMillis(10); checkForNextFrameCounter(); } while (!g_vm->shouldQuit() && e.type != Common::EVENT_KEYDOWN && - e.type != Common::EVENT_LBUTTONDOWN && e.type != Common::EVENT_RBUTTONDOWN && - e.type != Common::EVENT_MBUTTONDOWN); + e.type != Common::EVENT_LBUTTONDOWN && e.type != Common::EVENT_RBUTTONDOWN && + e.type != Common::EVENT_MBUTTONDOWN); } void Events::setCursor(CursorId cursorId) { diff --git a/engines/gargoyle/events.h b/engines/gargoyle/events.h index f91c91b242..b69cd04c34 100644 --- a/engines/gargoyle/events.h +++ b/engines/gargoyle/events.h @@ -50,7 +50,7 @@ enum EvType { evtype_VolumeNotify = 9, // ScummVM custom events - evtype_Quit = 99 + evtype_Quit = 99 }; /** @@ -115,7 +115,9 @@ struct Event { /** * Constructor */ - Event() { clear(); } + Event() { + clear(); + } /** * Constructor @@ -139,7 +141,9 @@ struct Event { /** * Boolean cast to allow checking whether event is filled out */ - operator bool() const { return type != evtype_None; } + operator bool() const { + return type != evtype_None; + } }; typedef Event event_t; @@ -161,16 +165,16 @@ class Events { Common::Point _hotspot; }; private: - EventQueue _eventsPolled; ///< User generated events - EventQueue _eventsLogged; ///< Custom events generated by game code - Event *_currentEvent; ///< Event pointer passed during event retrieval - uint32 _priorFrameTime; ///< Time of prior game frame - uint32 _frameCounter; ///< Frame counter - bool _redraw; ///< Screen needed redrawing - CursorId _cursorId; ///< Current cursor Id - Surface _cursors[4]; ///< Cursor pixel data - uint _timerMilli; ///< Time in milliseconds between timer events - uint _timerTimeExpiry; ///< When to trigger next timer event + EventQueue _eventsPolled; ///< User generated events + EventQueue _eventsLogged; ///< Custom events generated by game code + Event *_currentEvent; ///< Event pointer passed during event retrieval + uint32 _priorFrameTime; ///< Time of prior game frame + uint32 _frameCounter; ///< Frame counter + bool _redraw; ///< Screen needed redrawing + CursorId _cursorId; ///< Current cursor Id + Surface _cursors[4]; ///< Cursor pixel data + uint _timerMilli; ///< Time in milliseconds between timer events + uint _timerTimeExpiry; ///< When to trigger next timer event private: /** * Initialize the cursor graphics @@ -247,17 +251,23 @@ public: /** * Get the total number of frames played */ - uint32 getTotalPlayTicks() const { return _frameCounter; } + uint32 getTotalPlayTicks() const { + return _frameCounter; + } /** * Set the total number of frames played */ - void Events::setTotalPlayTicks(uint frames) { _frameCounter = frames; } + void Events::setTotalPlayTicks(uint frames) { + _frameCounter = frames; + } /** * Flags the screen for redrawing */ - void redraw() { _redraw = true; } + void redraw() { + _redraw = true; + } /** * Sets the current cursor @@ -266,7 +276,7 @@ public: /** * Set a timer interval - * @param milli Time in millieseconds for intervals, or 0 for off + * @param milli Time in millieseconds for intervals, or 0 for off */ void setTimerInterval(uint milli); diff --git a/engines/gargoyle/fonts.h b/engines/gargoyle/fonts.h index 1437bd8152..737618e41d 100644 --- a/engines/gargoyle/fonts.h +++ b/engines/gargoyle/fonts.h @@ -76,39 +76,39 @@ public: /** * Draws a string using the specified font at the given co-ordinates - * @param pos Position for the bottom-left corner the text will be drawn with - * @param fontIdx Which font to use - * @param rgb RGB tuplet specifying the text color - * @param text The text to draw - * @param spw ?? + * @param pos Position for the bottom-left corner the text will be drawn with + * @param fontIdx Which font to use + * @param rgb RGB tuplet specifying the text color + * @param text The text to draw + * @param spw ?? */ int drawString(const Point &pos, int fontIdx, const byte *rgb, const Common::String &text, int spw = 0); /** * Draws a unicode string using the specified font at the given co-ordinates - * @param pos Position for the bottom-left corner the text will be drawn with - * @param fontIdx Which font to use - * @param rgb RGB tuplet specifying the text color - * @param text The text to draw - * @param spw ?? + * @param pos Position for the bottom-left corner the text will be drawn with + * @param fontIdx Which font to use + * @param rgb RGB tuplet specifying the text color + * @param text The text to draw + * @param spw ?? */ int drawStringUni(const Point &pos, int fontIdx, const byte *rgb, const Common::U32String &text, int spw = 0); /** * Get the width in pixels of a string * @param fontIdx Which font to use - * @param text Text to get the width of - * @param spw Delta X - * @returns Width of string multiplied by GLI_SUBPIX + * @param text Text to get the width of + * @param spw Delta X + * @returns Width of string multiplied by GLI_SUBPIX */ size_t stringWidth(int fontIdx, const Common::String &text, int spw = 0); /** * Get the width in pixels of a unicode string * @param fontIdx Which font to use - * @param text Text to get the width of - * @param spw Delta X - * @returns Width of string multiplied by GLI_SUBPIX + * @param text Text to get the width of + * @param spw Delta X + * @returns Width of string multiplied by GLI_SUBPIX */ size_t stringWidthUni(int fontIdx, const Common::U32String &text, int spw = 0); }; diff --git a/engines/gargoyle/gargoyle.cpp b/engines/gargoyle/gargoyle.cpp index 9c00937185..021323cd6a 100644 --- a/engines/gargoyle/gargoyle.cpp +++ b/engines/gargoyle/gargoyle.cpp @@ -42,10 +42,10 @@ namespace Gargoyle { GargoyleEngine *g_vm; GargoyleEngine::GargoyleEngine(OSystem *syst, const GargoyleGameDescription *gameDesc) : - _gameDescription(gameDesc), Engine(syst), _random("Gargoyle"), _clipboard(nullptr), - _conf(nullptr), _events(nullptr), _picList(nullptr), _screen(nullptr), - _selection(nullptr), _windows(nullptr), _copySelect(false), _terminated(false), - gli_unregister_obj(nullptr), gli_register_arr(nullptr), gli_unregister_arr(nullptr) { + _gameDescription(gameDesc), Engine(syst), _random("Gargoyle"), _clipboard(nullptr), + _conf(nullptr), _events(nullptr), _picList(nullptr), _screen(nullptr), + _selection(nullptr), _windows(nullptr), _copySelect(false), _terminated(false), + gli_unregister_obj(nullptr), gli_register_arr(nullptr), gli_unregister_arr(nullptr) { g_vm = this; } diff --git a/engines/gargoyle/gargoyle.h b/engines/gargoyle/gargoyle.h index 793a353d08..e131be17d2 100644 --- a/engines/gargoyle/gargoyle.h +++ b/engines/gargoyle/gargoyle.h @@ -62,8 +62,8 @@ enum InterpreterType { enum GargoyleDebugChannels { kDebugCore = 1 << 0, - kDebugScripts = 1 << 1, - kDebugGraphics = 1 << 2, + kDebugScripts = 1 << 1, + kDebugGraphics = 1 << 2, kDebugSound = 1 << 3 }; @@ -125,12 +125,16 @@ public: /** * Returns true if a savegame can be loaded */ - virtual bool canLoadGameStateCurrently() override { return true; } + virtual bool canLoadGameStateCurrently() override { + return true; + } /** * Returns true if the game can be saved */ - virtual bool canSaveGameStateCurrently() override { return true; } + virtual bool canSaveGameStateCurrently() override { + return true; + } /** * Returns the bitset of game features @@ -165,7 +169,9 @@ public: /** * Return the game engine's target name */ - const Common::String &getTargetName() const { return _targetName; } + const Common::String &getTargetName() const { + return _targetName; + } /** * Display a message in a GUI dialog diff --git a/engines/gargoyle/glk.cpp b/engines/gargoyle/glk.cpp index 25ce3cc45e..58293f7902 100644 --- a/engines/gargoyle/glk.cpp +++ b/engines/gargoyle/glk.cpp @@ -34,8 +34,8 @@ namespace Gargoyle { -Glk::Glk(OSystem *syst, const GargoyleGameDescription *gameDesc) : - GargoyleEngine(syst, gameDesc), _gliFirstEvent(false) { +Glk::Glk(OSystem *syst, const GargoyleGameDescription *gameDesc) : + GargoyleEngine(syst, gameDesc), _gliFirstEvent(false) { // Set uppercase/lowercase tables int ix, res; for (ix = 0; ix < 256; ix++) { @@ -59,7 +59,7 @@ Glk::Glk(OSystem *syst, const GargoyleGameDescription *gameDesc) : } void Glk::glk_exit(void) { - glk_put_string("[ press any key to exit ]"); + glk_put_string("[ press any key to exit ]"); _events->waitForPress(); quitGame(); @@ -194,7 +194,7 @@ void Glk::glk_window_set_arrangement(winid_t win, glui32 method, glui32 size, wi } void Glk::glk_window_get_arrangement(winid_t win, glui32 *method, - glui32 *size, winid_t *keyWin) { + glui32 *size, winid_t *keyWin) { if (win) { win->getArrangement(method, size, keyWin); } else { @@ -586,30 +586,30 @@ bool Glk::glk_style_measure(winid_t win, glui32 style, glui32 hint, glui32 *resu case stylehint_Weight: *result = - (styles[style].font == PROPB || styles[style].font == PROPZ || - styles[style].font == MONOB || styles[style].font == MONOZ); + (styles[style].font == PROPB || styles[style].font == PROPZ || + styles[style].font == MONOB || styles[style].font == MONOZ); break; case stylehint_Oblique: *result = - (styles[style].font == PROPI || styles[style].font == PROPZ || - styles[style].font == MONOI || styles[style].font == MONOZ); + (styles[style].font == PROPI || styles[style].font == PROPZ || + styles[style].font == MONOI || styles[style].font == MONOZ); break; case stylehint_Proportional: *result = - (styles[style].font == PROPR || styles[style].font == PROPI || - styles[style].font == PROPB || styles[style].font == PROPZ); + (styles[style].font == PROPR || styles[style].font == PROPI || + styles[style].font == PROPB || styles[style].font == PROPZ); break; case stylehint_TextColor: *result = - (styles[style].fg[0] << 16) | (styles[style].fg[1] << 8) | (styles[style].fg[2]); + (styles[style].fg[0] << 16) | (styles[style].fg[1] << 8) | (styles[style].fg[2]); break; case stylehint_BackColor: *result = - (styles[style].bg[0] << 16) | (styles[style].bg[1] << 8) | (styles[style].bg[2]); + (styles[style].bg[0] << 16) | (styles[style].bg[1] << 8) | (styles[style].bg[2]); break; case stylehint_ReverseColor: @@ -681,7 +681,7 @@ void Glk::glk_select(event_t *event) { _windows->inputGuessFocus(); _gliFirstEvent = true; } - + _events->getEvent(event, false); } @@ -702,7 +702,7 @@ void Glk::glk_request_line_event(winid_t win, char *buf, glui32 maxlen, glui32 i if (!win) { warning("request_line_event: invalid ref"); } else if (win->_charRequest || win->_lineRequest || win->_charRequestUni - || win->_lineRequestUni) { + || win->_lineRequestUni) { warning("request_line_event: window already has keyboard request"); } else { win->requestLineEvent(buf, maxlen, initlen); @@ -713,7 +713,7 @@ void Glk::glk_request_char_event(winid_t win) { if (!win) { warning("request_char_event: invalid ref"); } else if (win->_charRequest || win->_lineRequest || win->_charRequestUni - || win->_lineRequestUni) { + || win->_lineRequestUni) { warning("request_char_event: window already has keyboard request"); } else { win->requestCharEvent(); @@ -777,7 +777,7 @@ glui32 Glk::glk_buffer_to_upper_case_uni(glui32 *buf, glui32 len, glui32 numchar } glui32 Glk::glk_buffer_to_title_case_uni(glui32 *buf, glui32 len, - glui32 numchars, glui32 lowerrest) { + glui32 numchars, glui32 lowerrest) { return bufferChangeCase(buf, len, numchars, CASE_TITLE, COND_LINESTART, lowerrest); } @@ -840,7 +840,7 @@ glui32 Glk::glk_get_line_stream_uni(strid_t str, glui32 *buf, glui32 len) { return str->getLineUni(buf, len); } else { warning("get_line_stream_uni: invalid ref"); - return (glui32 )-1; + return (glui32) - 1; } } @@ -856,7 +856,7 @@ void Glk::glk_request_char_event_uni(winid_t win) { if (!win) { warning("request_char_event_uni: invalid ref"); } else if (win->_charRequest || win->_lineRequest || win->_charRequestUni - || win->_lineRequestUni) { + || win->_lineRequestUni) { warning("request_char_event_uni: window already has keyboard request"); } else { win->requestCharEvent(); @@ -867,7 +867,7 @@ void Glk::glk_request_line_event_uni(winid_t win, glui32 *buf, glui32 maxlen, gl if (!win) { warning("request_line_event_uni: invalid ref"); } else if (win->_charRequest || win->_lineRequest || win->_charRequestUni - || win->_lineRequestUni) { + || win->_lineRequestUni) { warning("request_line_event_uni: window already has keyboard request"); } else { win->requestLineEventUni(buf, maxlen, initlen); @@ -875,7 +875,7 @@ void Glk::glk_request_line_event_uni(winid_t win, glui32 *buf, glui32 maxlen, gl } glui32 Glk::glk_buffer_canon_decompose_uni(glui32 *buf, glui32 len, - glui32 numchars) { + glui32 numchars) { // TODO return 0; } @@ -901,7 +901,7 @@ glui32 Glk::glk_image_draw(winid_t win, glui32 image, glsi32 val1, glsi32 val2) } glui32 Glk::glk_image_draw_scaled(winid_t win, glui32 image, glsi32 val1, glsi32 val2, - glui32 width, glui32 height) { + glui32 width, glui32 height) { if (!win) { warning("image_draw_scaled: invalid ref"); } else if (g_conf->_graphics) { @@ -950,7 +950,7 @@ void Glk::glk_window_erase_rect(winid_t win, glsi32 left, glsi32 top, glui32 wid } void Glk::glk_window_fill_rect(winid_t win, glui32 color, glsi32 left, glsi32 top, - glui32 width, glui32 height) { + glui32 width, glui32 height) { if (!win) { warning("window_fill_rect: invalid ref"); } else { @@ -1013,7 +1013,7 @@ schanid_t Glk::glk_schannel_create_ext(glui32 rock, glui32 volume) { } glui32 Glk::glk_schannel_play_multi(schanid_t *chanarray, glui32 chancount, - glui32 *sndarray, glui32 soundcount, glui32 notify) { + glui32 *sndarray, glui32 soundcount, glui32 notify) { // TODO return 0; } @@ -1027,7 +1027,7 @@ void Glk::glk_schannel_unpause(schanid_t chan) { } void Glk::glk_schannel_set_volume_ext(schanid_t chan, glui32 vol, - glui32 duration, glui32 notify) { + glui32 duration, glui32 notify) { // TODO } diff --git a/engines/gargoyle/glk.h b/engines/gargoyle/glk.h index eb3e68d9a6..b14546c684 100644 --- a/engines/gargoyle/glk.h +++ b/engines/gargoyle/glk.h @@ -63,14 +63,14 @@ public: * Open a new window */ winid_t glk_window_open(winid_t split, glui32 method, glui32 size, - glui32 wintype, glui32 rock = 0) const; + glui32 wintype, glui32 rock = 0) const; void glk_window_close(winid_t win, stream_result_t *result); void glk_window_get_size(winid_t win, glui32 *width, glui32 *height); void glk_window_set_arrangement(winid_t win, glui32 method, - glui32 size, winid_t keyWin); + glui32 size, winid_t keyWin); void glk_window_get_arrangement(winid_t win, glui32 *method, - glui32 *size, winid_t *keyWin); + glui32 *size, winid_t *keyWin); winid_t glk_window_iterate(winid_t win, glui32 *rock); glui32 glk_window_get_rock(winid_t win); glui32 glk_window_get_type(winid_t win); @@ -108,7 +108,7 @@ public: glui32 glk_get_buffer_stream(strid_t str, char *buf, glui32 len); void glk_stylehint_set(glui32 wintype, glui32 styl, glui32 hint, - glsi32 val); + glsi32 val); void glk_stylehint_clear(glui32 wintype, glui32 style, glui32 hint); glui32 glk_style_distinguish(winid_t win, glui32 style1, glui32 style2); bool glk_style_measure(winid_t win, glui32 style, glui32 hint, glui32 *result); @@ -129,7 +129,7 @@ public: void glk_request_timer_events(glui32 millisecs); void glk_request_line_event(winid_t win, char *buf, glui32 maxlen, - glui32 initlen); + glui32 initlen); void glk_request_char_event(winid_t win); void glk_request_mouse_event(winid_t win); @@ -143,19 +143,19 @@ public: #ifdef GLK_MODULE_LINE_TERMINATORS void glk_set_terminators_line_event(winid_t win, glui32 *keycodes, - glui32 count); + glui32 count); #endif /* GLK_MODULE_LINE_TERMINATORS */ - /** \addtogroup Unicode + /** \addtogroup Unicode * @{ */ glui32 glk_buffer_to_lower_case_uni(glui32 *buf, glui32 len, - glui32 numchars); + glui32 numchars); glui32 glk_buffer_to_upper_case_uni(glui32 *buf, glui32 len, - glui32 numchars); + glui32 numchars); glui32 glk_buffer_to_title_case_uni(glui32 *buf, glui32 len, - glui32 numchars, glui32 lowerrest); + glui32 numchars, glui32 lowerrest); void glk_put_char_uni(glui32 ch); void glk_put_string_uni(glui32 *s); @@ -173,16 +173,16 @@ public: void glk_request_char_event_uni(winid_t win); void glk_request_line_event_uni(winid_t win, glui32 *buf, - glui32 maxlen, glui32 initlen); + glui32 maxlen, glui32 initlen); /** @}*/ #ifdef GLK_MODULE_UNICODE_NORM glui32 glk_buffer_canon_decompose_uni(glui32 *buf, glui32 len, - glui32 numchars); + glui32 numchars); glui32 glk_buffer_canon_normalize_uni(glui32 *buf, glui32 len, - glui32 numchars); + glui32 numchars); #endif /* GLK_MODULE_UNICODE_NORM */ @@ -190,15 +190,15 @@ public: glui32 glk_image_draw(winid_t win, glui32 image, glsi32 val1, glsi32 val2); glui32 glk_image_draw_scaled(winid_t win, glui32 image, - glsi32 val1, glsi32 val2, glui32 width, glui32 height); + glsi32 val1, glsi32 val2, glui32 width, glui32 height); glui32 glk_image_get_info(glui32 image, glui32 *width, glui32 *height); void glk_window_flow_break(winid_t win); void glk_window_erase_rect(winid_t win, - glsi32 left, glsi32 top, glui32 width, glui32 height); + glsi32 left, glsi32 top, glui32 width, glui32 height); void glk_window_fill_rect(winid_t win, glui32 color, - glsi32 left, glsi32 top, glui32 width, glui32 height); + glsi32 left, glsi32 top, glui32 width, glui32 height); void glk_window_set_background_color(winid_t win, glui32 color); #endif /* GLK_MODULE_IMAGE */ @@ -212,7 +212,7 @@ public: glui32 glk_schannel_play(schanid_t chan, glui32 snd); glui32 glk_schannel_play_ext(schanid_t chan, glui32 snd, glui32 repeats, - glui32 notify); + glui32 notify); void glk_schannel_stop(schanid_t chan); void glk_schannel_set_volume(schanid_t chan, glui32 vol); @@ -224,11 +224,11 @@ public: schanid_t glk_schannel_create_ext(glui32 rock, glui32 volume); glui32 glk_schannel_play_multi(schanid_t *chanarray, glui32 chancount, - glui32 *sndarray, glui32 soundcount, glui32 notify); + glui32 *sndarray, glui32 soundcount, glui32 notify); void glk_schannel_pause(schanid_t chan); void glk_schannel_unpause(schanid_t chan); void glk_schannel_set_volume_ext(schanid_t chan, glui32 vol, - glui32 duration, glui32 notify); + glui32 duration, glui32 notify); #endif /* GLK_MODULE_SOUND2 */ #endif /* GLK_MODULE_SOUND */ @@ -258,7 +258,7 @@ public: #endif /* GLK_MODULE_DATETIME */ /* XXX non-official Glk functions that may or may not exist */ - #define GARGLK 1 +#define GARGLK 1 const char *garglk_fileref_get_name(frefid_t fref) const; diff --git a/engines/gargoyle/glk_types.h b/engines/gargoyle/glk_types.h index 6dd8504326..7258e693c4 100644 --- a/engines/gargoyle/glk_types.h +++ b/engines/gargoyle/glk_types.h @@ -169,7 +169,7 @@ enum StyleHint { * These constants define the classes of opaque objects. It's a bit ugly to put * them in this header file, since more classes may be added in the future. * But if you find yourself stuck with an obsolete version of this file, - * adding new class definitions will be easy enough -- they will be numbered + * adding new class definitions will be easy enough -- they will be numbered * sequentially, and the numeric constants can be found in the Glk specification. */ enum giDisp { @@ -180,10 +180,10 @@ enum giDisp { }; enum zcolor { - zcolor_Transparent = (uint32)-4, - zcolor_Cursor = (uint32)-3, - zcolor_Current = (uint32)-2, - zcolor_Default = (uint32)-1 + zcolor_Transparent = (uint32) - 4, + zcolor_Cursor = (uint32) - 3, + zcolor_Current = (uint32) - 2, + zcolor_Default = (uint32) - 1 }; #ifdef GLK_MODULE_IMAGE diff --git a/engines/gargoyle/scott/scott.cpp b/engines/gargoyle/scott/scott.cpp index 8728cdb46d..329cfb334e 100644 --- a/engines/gargoyle/scott/scott.cpp +++ b/engines/gargoyle/scott/scott.cpp @@ -27,9 +27,9 @@ namespace Gargoyle { namespace Scott { Scott::Scott(OSystem *syst, const GargoyleGameDescription *gameDesc) : Glk(syst, gameDesc), - Items(nullptr), Rooms(nullptr), Verbs(nullptr), Nouns(nullptr), Messages(nullptr), - Actions(nullptr), CurrentCounter(0), SavedRoom(0), Options(0), Width(0), TopHeight(0), - split_screen(true), Bottom(0), Top(0), BitFlags(0) { + Items(nullptr), Rooms(nullptr), Verbs(nullptr), Nouns(nullptr), Messages(nullptr), + Actions(nullptr), CurrentCounter(0), SavedRoom(0), Options(0), Width(0), TopHeight(0), + split_screen(true), Bottom(0), Top(0), BitFlags(0) { Common::fill(&NounText[0], &NounText[16], '\0'); Common::fill(&Counters[0], &Counters[16], 0); Common::fill(&RoomSaved[0], &RoomSaved[16], 0); @@ -107,19 +107,19 @@ Distributed under the GNU software license\n\n"); if (GameHeader.LightTime < 1) { BitFlags |= (1 << LIGHTOUTBIT); if (Items[LIGHT_SOURCE].Location == CARRIED || - Items[LIGHT_SOURCE].Location == MyLoc) { - if (Options&SCOTTLIGHT) + Items[LIGHT_SOURCE].Location == MyLoc) { + if (Options & SCOTTLIGHT) output("Light has run out! "); else output("Your light has run out. "); } - if (Options&PREHISTORIC_LAMP) + if (Options & PREHISTORIC_LAMP) Items[LIGHT_SOURCE].Location = DESTROYED; } else if (GameHeader.LightTime < 25) { if (Items[LIGHT_SOURCE].Location == CARRIED || - Items[LIGHT_SOURCE].Location == MyLoc) { + Items[LIGHT_SOURCE].Location == MyLoc) { - if (Options&SCOTTLIGHT) { + if (Options & SCOTTLIGHT) { output("Light runs out in "); outputNumber(GameHeader.LightTime); output(" turns. "); @@ -208,7 +208,7 @@ int Scott::countCarried(void) { const char *Scott::mapSynonym(const char *word) { int n = 1; const char *tp; - static char lastword[16]; // Last non synonym + static char lastword[16]; // Last non synonym while (n <= GameHeader.NumWords) { tp = Nouns[n]; if (*tp == '*') @@ -231,7 +231,7 @@ int Scott::matchUpItem(const char *text, int loc) { while (ct <= GameHeader.NumItems) { if (Items[ct].AutoGet && Items[ct].Location == loc && - xstrncasecmp(Items[ct].AutoGet, word, GameHeader.WordLength) == 0) + xstrncasecmp(Items[ct].AutoGet, word, GameHeader.WordLength) == 0) return ct; ct++; } @@ -293,27 +293,27 @@ void Scott::loadDatabase(Common::SeekableReadStream *f, bool loud) { Action *ap; Room *rp; Item *ip; - + // Load the header readInts(f, 12, &unused, &ni, &na, &nw, &nr, &mc, &pr, &tr, &wl, <, &mn, &trm); GameHeader.NumItems = ni; - Items = (Item *)memAlloc(sizeof(Item)*(ni + 1)); + Items = (Item *)memAlloc(sizeof(Item) * (ni + 1)); GameHeader.NumActions = na; - Actions = (Action *)memAlloc(sizeof(Action)*(na + 1)); + Actions = (Action *)memAlloc(sizeof(Action) * (na + 1)); GameHeader.NumWords = nw; GameHeader.WordLength = wl; - Verbs = (const char **)memAlloc(sizeof(char *)*(nw + 1)); - Nouns = (const char **)memAlloc(sizeof(char *)*(nw + 1)); + Verbs = (const char **)memAlloc(sizeof(char *) * (nw + 1)); + Nouns = (const char **)memAlloc(sizeof(char *) * (nw + 1)); GameHeader.NumRooms = nr; - Rooms = (Room *)memAlloc(sizeof(Room)*(nr + 1)); + Rooms = (Room *)memAlloc(sizeof(Room) * (nr + 1)); GameHeader.MaxCarry = mc; GameHeader.PlayerRoom = pr; GameHeader.Treasures = tr; GameHeader.LightTime = lt; LightRefill = lt; GameHeader.NumMessages = mn; - Messages = (const char **)memAlloc(sizeof(char *)*(mn + 1)); + Messages = (const char **)memAlloc(sizeof(char *) * (mn + 1)); GameHeader.TreasureRoom = trm; // Load the actions @@ -323,14 +323,14 @@ void Scott::loadDatabase(Common::SeekableReadStream *f, bool loud) { debug("Reading %d actions.", na); while (ct < na + 1) { readInts(f, 8, - &ap->Vocab, - &ap->Condition[0], - &ap->Condition[1], - &ap->Condition[2], - &ap->Condition[3], - &ap->Condition[4], - &ap->action[0], - &ap->action[1]); + &ap->Vocab, + &ap->Condition[0], + &ap->Condition[1], + &ap->Condition[2], + &ap->Condition[3], + &ap->Condition[4], + &ap->action[0], + &ap->action[1]); ap++; ct++; } @@ -338,7 +338,7 @@ void Scott::loadDatabase(Common::SeekableReadStream *f, bool loud) { ct = 0; if (loud) debug("Reading %d word pairs.", nw); - while (ct<nw + 1) { + while (ct < nw + 1) { Verbs[ct] = readString(f); Nouns[ct] = readString(f); ct++; @@ -347,11 +347,11 @@ void Scott::loadDatabase(Common::SeekableReadStream *f, bool loud) { rp = Rooms; if (loud) debug("Reading %d rooms.", nr); - while (ct<nr + 1) { + while (ct < nr + 1) { readInts(f, 6, - &rp->Exits[0], &rp->Exits[1], &rp->Exits[2], - &rp->Exits[3], &rp->Exits[4], &rp->Exits[5]); - + &rp->Exits[0], &rp->Exits[1], &rp->Exits[2], + &rp->Exits[3], &rp->Exits[4], &rp->Exits[5]); + rp->Text = readString(f); ct++; rp++; @@ -360,7 +360,7 @@ void Scott::loadDatabase(Common::SeekableReadStream *f, bool loud) { ct = 0; if (loud) debug("Reading %d messages.", mn); - while (ct<mn + 1) { + while (ct < mn + 1) { Messages[ct] = readString(f); ct++; } @@ -389,7 +389,7 @@ void Scott::loadDatabase(Common::SeekableReadStream *f, bool loud) { } ct = 0; // Discard Comment Strings - while (ct<na + 1) { + while (ct < na + 1) { free(readString(f)); ct++; } @@ -420,9 +420,9 @@ void Scott::look(void) { if (split_screen) glk_window_clear(Top); - if ((BitFlags&(1 << DARKBIT)) && Items[LIGHT_SOURCE].Location != CARRIED - && Items[LIGHT_SOURCE].Location != MyLoc) { - if (Options&YOUARE) + if ((BitFlags & (1 << DARKBIT)) && Items[LIGHT_SOURCE].Location != CARRIED + && Items[LIGHT_SOURCE].Location != MyLoc) { + if (Options & YOUARE) display(Top, "You can't see. It is too dark!\n"); else display(Top, "I can't see. It is too dark!\n"); @@ -434,7 +434,7 @@ void Scott::look(void) { if (*r->Text == '*') display(Top, "%s\n", r->Text + 1); else { - if (Options&YOUARE) + if (Options & YOUARE) display(Top, "You are in a %s\n", r->Text); else display(Top, "I'm in a %s\n", r->Text); @@ -443,9 +443,8 @@ void Scott::look(void) { ct = 0; f = 0; display(Top, "\nObvious exits: "); - while (ct<6) { - if (r->Exits[ct] != 0) - { + while (ct < 6) { + if (r->Exits[ct] != 0) { if (f == 0) f = 1; else @@ -532,7 +531,7 @@ void Scott::lineInput(char *buf, size_t n) { void Scott::saveGame(void) { frefid_t ref = glk_fileref_create_by_prompt(fileusage_TextMode | fileusage_SavedGame, - filemode_Write, 0); + filemode_Write, 0); if (ref == nullptr) return; @@ -557,8 +556,8 @@ Common::Error Scott::saveGameState(int slot, const Common::String &desc) { } msg = Common::String::format("%lu %d %hd %d %d %hd\n", - BitFlags, (BitFlags&(1 << DARKBIT)) ? 1 : 0, - MyLoc, CurrentCounter, SavedRoom, GameHeader.LightTime); + BitFlags, (BitFlags & (1 << DARKBIT)) ? 1 : 0, + MyLoc, CurrentCounter, SavedRoom, GameHeader.LightTime); glk_put_string_stream(file, msg.c_str()); for (int ct = 0; ct <= GameHeader.NumItems; ct++) { @@ -574,7 +573,7 @@ Common::Error Scott::saveGameState(int slot, const Common::String &desc) { void Scott::loadGame(void) { frefid_t ref = glk_fileref_create_by_prompt(fileusage_TextMode | fileusage_SavedGame, - filemode_Read, 0); + filemode_Read, 0); if (ref == nullptr) return; @@ -597,15 +596,15 @@ Common::Error Scott::loadGameState(int slot) { if (file == nullptr) return Common::kReadingFailed; - for (ct = 0; ct<16; ct++) { + for (ct = 0; ct < 16; ct++) { glk_get_line_stream(file, buf, sizeof buf); sscanf(buf, "%d %d", &Counters[ct], &RoomSaved[ct]); } glk_get_line_stream(file, buf, sizeof buf); sscanf(buf, "%ld %hd %d %d %d %d\n", - &BitFlags, &darkFlag, &MyLoc, &CurrentCounter, &SavedRoom, - &GameHeader.LightTime); + &BitFlags, &darkFlag, &MyLoc, &CurrentCounter, &SavedRoom, + &GameHeader.LightTime); // Backward compatibility if (darkFlag) @@ -634,7 +633,7 @@ int Scott::getInput(int *vb, int *no) { num = sscanf(buf, "%9s %9s", verb, noun); } while (num == 0 || *buf == '\n'); - + if (xstrcasecmp(verb, "restore") == 0) { loadGame(); return -1; @@ -643,14 +642,28 @@ int Scott::getInput(int *vb, int *no) { *noun = 0; if (*noun == 0 && strlen(verb) == 1) { switch (Common::isUpper((unsigned char)*verb) ? tolower((unsigned char)*verb) : *verb) { - case 'n':strcpy(verb, "NORTH"); break; - case 'e':strcpy(verb, "EAST"); break; - case 's':strcpy(verb, "SOUTH"); break; - case 'w':strcpy(verb, "WEST"); break; - case 'u':strcpy(verb, "UP"); break; - case 'd':strcpy(verb, "DOWN"); break; + case 'n': + strcpy(verb, "NORTH"); + break; + case 'e': + strcpy(verb, "EAST"); + break; + case 's': + strcpy(verb, "SOUTH"); + break; + case 'w': + strcpy(verb, "WEST"); + break; + case 'u': + strcpy(verb, "UP"); + break; + case 'd': + strcpy(verb, "DOWN"); + break; // Brian Howarth interpreter also supports this - case 'i':strcpy(verb, "INVENTORY"); break; + case 'i': + strcpy(verb, "INVENTORY"); + break; } } nc = whichWord(verb, Nouns); @@ -668,7 +681,7 @@ int Scott::getInput(int *vb, int *no) { } } while (vc == -1); - strcpy(NounText, noun); // Needed by GET/DROP hack + strcpy(NounText, noun); // Needed by GET/DROP hack return 0; } @@ -678,7 +691,7 @@ int Scott::performLine(int ct) { int act[4]; int cc = 0; - while (cc<5) { + while (cc < 5) { int cv, dv; cv = Actions[ct].Condition[cc]; dv = cv / 20; @@ -696,8 +709,8 @@ int Scott::performLine(int ct) { return 0; break; case 3: - if (Items[dv].Location != CARRIED&& - Items[dv].Location != MyLoc) + if (Items[dv].Location != CARRIED && + Items[dv].Location != MyLoc) return 0; break; case 4: @@ -717,11 +730,11 @@ int Scott::performLine(int ct) { return 0; break; case 8: - if ((BitFlags&(1 << dv)) == 0) + if ((BitFlags & (1 << dv)) == 0) return 0; break; case 9: - if (BitFlags&(1 << dv)) + if (BitFlags & (1 << dv)) return 0; break; case 10: @@ -745,7 +758,7 @@ int Scott::performLine(int ct) { return 0; break; case 15: - if (CurrentCounter>dv) + if (CurrentCounter > dv) return 0; break; case 16: @@ -778,8 +791,7 @@ int Scott::performLine(int ct) { act[2] /= 150; cc = 0; pptr = 0; - while (cc<4) - { + while (cc < 4) { if (act[cc] >= 1 && act[cc] < 52) { output(Messages[act[cc]]); output("\n"); @@ -825,7 +837,7 @@ int Scott::performLine(int ct) { BitFlags &= ~(1 << param[pptr++]); break; case 61: - if (Options&YOUARE) + if (Options & YOUARE) output("You are dead.\n"); else output("I am dead.\n"); @@ -850,11 +862,11 @@ doneit: int n = 0; while (i <= GameHeader.NumItems) { if (Items[i].Location == GameHeader.TreasureRoom && - *Items[i].Text == '*') + *Items[i].Text == '*') n++; i++; } - if (Options&YOUARE) + if (Options & YOUARE) output("You have stored "); else output("I've stored "); @@ -871,7 +883,7 @@ doneit: case 66: { int i = 0; int f = 0; - if (Options&YOUARE) + if (Options & YOUARE) output("You are carrying:\n"); else output("I'm carrying:\n"); @@ -999,7 +1011,7 @@ doneit: break; default: error("Unknown action %d [Param begins %d %d]\n", - act[cc], param[pptr], param[pptr + 1]); + act[cc], param[pptr], param[pptr + 1]); break; } } @@ -1011,8 +1023,8 @@ doneit: } int Scott::performActions(int vb, int no) { - static int disable_sysfunc = 0; // Recursion lock - int d = BitFlags&(1 << DARKBIT); + static int disable_sysfunc = 0; // Recursion lock + int d = BitFlags & (1 << DARKBIT); int ct = 0; int fl; @@ -1024,7 +1036,7 @@ int Scott::performActions(int vb, int no) { if (vb == 1 && no >= 1 && no <= 6) { int nl; if (Items[LIGHT_SOURCE].Location == MyLoc || - Items[LIGHT_SOURCE].Location == CARRIED) + Items[LIGHT_SOURCE].Location == CARRIED) d = 0; if (d) output("Dangerous to move in the dark! "); @@ -1034,13 +1046,13 @@ int Scott::performActions(int vb, int no) { return 0; } if (d) { - if (Options&YOUARE) + if (Options & YOUARE) output("You fell down and broke your neck. "); else output("I fell down and broke my neck. "); glk_exit(); } - if (Options&YOUARE) + if (Options & YOUARE) output("You can't go in that direction. "); else output("I can't go in that direction. "); @@ -1053,16 +1065,16 @@ int Scott::performActions(int vb, int no) { vv = Actions[ct].Vocab; // Think this is now right. If a line we run has an action73 // run all following lines with vocab of 0,0 - if (vb != 0 && (doagain&&vv != 0)) + if (vb != 0 && (doagain && vv != 0)) break; // Oops.. added this minor cockup fix 1.11 if (vb != 0 && !doagain && fl == 0) break; nv = vv % 150; vv /= 150; - if ((vv == vb) || (doagain&&Actions[ct].Vocab == 0)) { + if ((vv == vb) || (doagain && Actions[ct].Vocab == 0)) { if ((vv == 0 && randomPercent(nv)) || doagain || - (vv != 0 && (nv == no || nv == 0))) { + (vv != 0 && (nv == no || nv == 0))) { int f2; if (fl == -1) fl = -2; @@ -1088,7 +1100,7 @@ int Scott::performActions(int vb, int no) { if (fl != 0 && disable_sysfunc == 0) { int item; if (Items[LIGHT_SOURCE].Location == MyLoc || - Items[LIGHT_SOURCE].Location == CARRIED) + Items[LIGHT_SOURCE].Location == CARRIED) d = 0; if (vb == 10 || vb == 18) { // Yes they really _are_ hardcoded values @@ -1104,11 +1116,11 @@ int Scott::performActions(int vb, int no) { while (i <= GameHeader.NumItems) { if (Items[i].Location == MyLoc && Items[i].AutoGet != nullptr && Items[i].AutoGet[0] != '*') { no = whichWord(Items[i].AutoGet, Nouns); - disable_sysfunc = 1; // Don't recurse into auto get ! - performActions(vb, no); // Recursively check each items table code + disable_sysfunc = 1; // Don't recurse into auto get ! + performActions(vb, no); // Recursively check each items table code disable_sysfunc = 0; if (countCarried() == GameHeader.MaxCarry) { - if (Options&YOUARE) + if (Options & YOUARE) output("You are carrying too much. "); else output("I've too much to carry. "); @@ -1130,7 +1142,7 @@ int Scott::performActions(int vb, int no) { return 0; } if (countCarried() == GameHeader.MaxCarry) { - if (Options&YOUARE) + if (Options & YOUARE) output("You are carrying too much. "); else output("I've too much to carry. "); @@ -1138,7 +1150,7 @@ int Scott::performActions(int vb, int no) { } item = matchUpItem(NounText, MyLoc); if (item == -1) { - if (Options&YOUARE) + if (Options & YOUARE) output("It is beyond your power to do that. "); else output("It's beyond my power to do that. "); @@ -1175,7 +1187,7 @@ int Scott::performActions(int vb, int no) { } item = matchUpItem(NounText, CARRIED); if (item == -1) { - if (Options&YOUARE) + if (Options & YOUARE) output("It's beyond your power to do that.\n"); else output("It's beyond my power to do that.\n"); @@ -1193,8 +1205,8 @@ int Scott::performActions(int vb, int no) { int Scott::xstrcasecmp(const char *s1, const char *s2) { const unsigned char - *us1 = (const unsigned char *)s1, - *us2 = (const unsigned char *)s2; + *us1 = (const unsigned char *)s1, + *us2 = (const unsigned char *)s2; while (tolower(*us1) == tolower(*us2++)) if (*us1++ == '\0') @@ -1205,8 +1217,8 @@ int Scott::xstrcasecmp(const char *s1, const char *s2) { int Scott::xstrncasecmp(const char *s1, const char *s2, size_t n) { if (n != 0) { const unsigned char - *us1 = (const unsigned char *)s1, - *us2 = (const unsigned char *)s2; + *us1 = (const unsigned char *)s1, + *us2 = (const unsigned char *)s2; do { if (tolower(*us1) != tolower(*us2++)) diff --git a/engines/gargoyle/scott/scott.h b/engines/gargoyle/scott/scott.h index 81847cce3f..0ff8d3318b 100644 --- a/engines/gargoyle/scott/scott.h +++ b/engines/gargoyle/scott/scott.h @@ -24,7 +24,7 @@ #define GARGOYLE_SCOTT /* - * Controlling block + * Controlling block */ #include "common/scummsys.h" @@ -33,28 +33,28 @@ namespace Gargoyle { namespace Scott { -#define LIGHT_SOURCE 9 // Always 9 how odd -#define CARRIED 255 // Carried -#define DESTROYED 0 // Destroyed -#define DARKBIT 15 -#define LIGHTOUTBIT 16 // Light gone out +#define LIGHT_SOURCE 9 // Always 9 how odd +#define CARRIED 255 // Carried +#define DESTROYED 0 // Destroyed +#define DARKBIT 15 +#define LIGHTOUTBIT 16 // Light gone out enum GameOption { - YOUARE = 1, ///< You are not I am - SCOTTLIGHT = 2, ///< Authentic Scott Adams light messages - DEBUGGING = 4, ///< Info from database load - TRS80_STYLE = 8, ///< Display in style used on TRS-80 - PREHISTORIC_LAMP = 16 ///< Destroy the lamp (very old databases) + YOUARE = 1, ///< You are not I am + SCOTTLIGHT = 2, ///< Authentic Scott Adams light messages + DEBUGGING = 4, ///< Info from database load + TRS80_STYLE = 8, ///< Display in style used on TRS-80 + PREHISTORIC_LAMP = 16 ///< Destroy the lamp (very old databases) }; -#define TRS80_LINE "\n<------------------------------------------------------------>\n" -#define MyLoc (GameHeader.PlayerRoom) +#define TRS80_LINE "\n<------------------------------------------------------------>\n" +#define MyLoc (GameHeader.PlayerRoom) struct Header { - int Unknown; + int Unknown; int NumItems; int NumActions; - int NumWords; ///< Smaller of verb/noun is padded to same size + int NumWords; ///< Smaller of verb/noun is padded to same size int NumRooms; int MaxCarry; int PlayerRoom; @@ -90,7 +90,7 @@ struct Room { }; struct Item { - char *Text; // PORTABILITY WARNING: THESE TWO MUST BE 8 BIT VALUES. + char *Text; // PORTABILITY WARNING: THESE TWO MUST BE 8 BIT VALUES. byte Location; byte InitialLoc; char *AutoGet; @@ -125,7 +125,7 @@ private: int SavedRoom; int RoomSaved[16]; ///< Range unknown int Options; ///< Option flags set - int Width; ///< Terminal width + int Width; ///< Terminal width int TopHeight; ///< Height of top window bool split_screen; diff --git a/engines/gargoyle/screen.h b/engines/gargoyle/screen.h index d7631efccf..aa43b1bfdb 100644 --- a/engines/gargoyle/screen.h +++ b/engines/gargoyle/screen.h @@ -54,8 +54,8 @@ public: /** * Draws the text input caret at the given position - * @remarks The position specifies the caret's bottom-left corner, - * and the X position is in multiples of GLI_SUBPIX + * @remarks The position specifies the caret's bottom-left corner, + * and the X position is in multiples of GLI_SUBPIX */ void drawCaret(const Point &pos); }; diff --git a/engines/gargoyle/selection.cpp b/engines/gargoyle/selection.cpp index 8ad3b76716..27cfbe7083 100644 --- a/engines/gargoyle/selection.cpp +++ b/engines/gargoyle/selection.cpp @@ -112,9 +112,9 @@ void WindowMask::putHyperlink(glui32 linkval, uint x0, uint y0, uint x1, uint y1 } if (tx0 >= _hor - || tx1 >= _hor - || ty0 >= _ver || ty1 >= _ver - || !_links[tx0] || !_links[tx1]) { + || tx1 >= _hor + || ty0 >= _ver || ty1 >= _ver + || !_links[tx0] || !_links[tx1]) { warning("putHyperlink: invalid range given"); return; } @@ -190,7 +190,7 @@ void Selection::clearSelection() { bool Selection::checkSelection(const Rect &r) const { Rect select(MIN(_select.left, _select.right), MAX(_select.left, _select.right), - MIN(_select.top, _select.bottom), MAX(_select.top, _select.bottom)); + MIN(_select.top, _select.bottom), MAX(_select.top, _select.bottom)); if (select.isEmpty()) return false; @@ -218,7 +218,7 @@ bool Selection::getSelection(const Rect &r, int *rx0, int *rx1) const { row_selected = false; if ((cy0 >= upper && cy0 <= lower) - || (cy1 >= upper && cy1 <= lower)) + || (cy1 >= upper && cy1 <= lower)) row_selected = true; if (row >= cy0 && row <= cy1) diff --git a/engines/gargoyle/selection.h b/engines/gargoyle/selection.h index 2d3a208ee4..a82af6d2a0 100644 --- a/engines/gargoyle/selection.h +++ b/engines/gargoyle/selection.h @@ -92,13 +92,13 @@ class Selection : public Clipboard, public WindowMask { public: /** * Start selecting an area of the screen - * @param pos Position to start selection area at + * @param pos Position to start selection area at */ void startSelection(const Point &pos); /** * Move the end point of the selection area - * @param pos Position to end selection area at + * @param pos Position to end selection area at */ void moveSelection(const Point &pos); diff --git a/engines/gargoyle/streams.cpp b/engines/gargoyle/streams.cpp index b3012720d5..75fb205591 100644 --- a/engines/gargoyle/streams.cpp +++ b/engines/gargoyle/streams.cpp @@ -33,8 +33,8 @@ namespace Gargoyle { Stream::Stream(Streams *streams, bool readable, bool writable, uint32 rock, bool unicode) : - _streams(streams), _readable(readable), _writable(writable), _readCount(0), - _writeCount(0), _prev(nullptr), _next(nullptr), _rock(0) { + _streams(streams), _readable(readable), _writable(writable), _readCount(0), + _writeCount(0), _prev(nullptr), _next(nullptr), _rock(0) { } Stream::~Stream() { @@ -174,7 +174,7 @@ void WindowStream::unputBuffer(const char *buf, size_t len) { } } - for (lx = 0, cx = buf + len - 1; lx<len; lx++, cx--) { + for (lx = 0, cx = buf + len - 1; lx < len; lx++, cx--) { if (!_window->unputCharUni(*cx)) break; _writeCount--; @@ -200,7 +200,7 @@ void WindowStream::unputBufferUni(const glui32 *buf, size_t len) { } } - for (lx = 0, cx = buf + len - 1; lx<len; lx++, cx--) { + for (lx = 0, cx = buf + len - 1; lx < len; lx++, cx--) { if (!_window->unputCharUni(*cx)) break; _writeCount--; @@ -245,7 +245,7 @@ void WindowStream::setZColors(glui32 fg, glui32 bg) { _window->_attr.fgcolor = 0; Windows::_overrideFgSet = false; Windows::_overrideFgVal = 0; - + Common::copy(g_conf->_moreSave, g_conf->_moreSave + 3, g_conf->_moreColor); Common::copy(g_conf->_caretSave, g_conf->_caretSave + 3, g_conf->_caretColor); Common::copy(g_conf->_linkSave, g_conf->_linkSave + 3, g_conf->_linkColor); @@ -254,7 +254,7 @@ void WindowStream::setZColors(glui32 fg, glui32 bg) { _window->_attr.fgcolor = fg; Windows::_overrideFgSet = true; Windows::_overrideFgVal = fg; - + Common::copy(fore, fore + 3, g_conf->_moreColor); Common::copy(fore, fore + 3, g_conf->_caretColor); Common::copy(fore, fore + 3, g_conf->_linkColor); @@ -302,8 +302,8 @@ void WindowStream::setReverseVideo(bool reverse) { /*--------------------------------------------------------------------------*/ MemoryStream::MemoryStream(Streams *streams, void *buf, size_t buflen, FileMode mode, uint32 rock, bool unicode) : - Stream(streams, mode != filemode_Write, mode != filemode_Read, rock, unicode), - _buf(buf), _bufLen(buflen), _bufPtr(buf) { + Stream(streams, mode != filemode_Write, mode != filemode_Read, rock, unicode), + _buf(buf), _bufLen(buflen), _bufPtr(buf) { assert(_buf && _bufLen); assert(mode == filemode_Read || mode == filemode_Write || mode == filemode_ReadWrite); @@ -363,8 +363,7 @@ void MemoryStream::putBuffer(const char *buf, size_t len) { } else { if (!_unicode) { unsigned char *bp = (unsigned char *)_bufPtr; - if (bp + len > (unsigned char *)_bufEnd) - { + if (bp + len > (unsigned char *)_bufEnd) { lx = (bp + len) - (unsigned char *)_bufEnd; if (lx < len) len -= lx; @@ -374,7 +373,7 @@ void MemoryStream::putBuffer(const char *buf, size_t len) { if (len) { memmove(bp, buf, len); bp += len; - if (bp >(unsigned char *)_bufEof) + if (bp > (unsigned char *)_bufEof) _bufEof = bp; } _bufPtr = bp; @@ -392,7 +391,7 @@ void MemoryStream::putBuffer(const char *buf, size_t len) { for (i = 0; i < len; i++) bp[i] = buf[i]; bp += len; - if (bp >(glui32 *)_bufEof) + if (bp > (glui32 *)_bufEof) _bufEof = bp; } _bufPtr = bp; @@ -444,7 +443,7 @@ void MemoryStream::putBufferUni(const uint32 *buf, size_t len) { if (len) { memmove(bp, buf, len * 4); bp += len; - if (bp >(glui32 *)_bufEof) + if (bp > (glui32 *)_bufEof) _bufEof = bp; } _bufPtr = bp; @@ -460,8 +459,7 @@ glui32 MemoryStream::getPosition() const { } void MemoryStream::setPosition(glui32 pos, glui32 seekMode) { - if (!_unicode) - { + if (!_unicode) { if (seekMode == seekmode_Current) pos = ((unsigned char *)_bufPtr - (unsigned char *)_buf) + pos; else if (seekMode == seekmode_End) @@ -556,7 +554,7 @@ glui32 MemoryStream::getBuffer(char *buf, glui32 len) { if (len) { memcpy(buf, bp, len); bp += len; - if (bp >(unsigned char *)_bufEof) + if (bp > (unsigned char *)_bufEof) _bufEof = bp; } @@ -601,8 +599,7 @@ glui32 MemoryStream::getBufferUni(glui32 *buf, glui32 len) { } else { if (!_unicode) { unsigned char *bp = (unsigned char *)_bufPtr; - if (bp + len > (unsigned char *)_bufEnd) - { + if (bp + len > (unsigned char *)_bufEnd) { glui32 lx; lx = (bp + len) - (unsigned char *)_bufEnd; if (lx < len) @@ -615,7 +612,7 @@ glui32 MemoryStream::getBufferUni(glui32 *buf, glui32 len) { for (i = 0; i < len; i++) buf[i] = bp[i]; bp += len; - if (bp >(unsigned char *)_bufEof) + if (bp > (unsigned char *)_bufEof) _bufEof = bp; } _readCount += len; @@ -633,7 +630,7 @@ glui32 MemoryStream::getBufferUni(glui32 *buf, glui32 len) { if (len) { memcpy(buf, bp, len * 4); bp += len; - if (bp >(glui32 *)_bufEof) + if (bp > (glui32 *)_bufEof) _bufEof = bp; } _readCount += len; @@ -761,8 +758,8 @@ glui32 MemoryStream::getLineUni(glui32 *ubuf, glui32 len) { /*--------------------------------------------------------------------------*/ FileStream::FileStream(Streams *streams, frefid_t fref, glui32 fmode, glui32 rock, bool unicode) : - Stream(streams, fmode == filemode_Read, fmode != filemode_Read, rock, unicode), _lastOp(0), - _textFile(fref->_textMode), _inFile(nullptr), _outFile(nullptr), _inStream(nullptr) { + Stream(streams, fmode == filemode_Read, fmode != filemode_Read, rock, unicode), _lastOp(0), + _textFile(fref->_textMode), _inFile(nullptr), _outFile(nullptr), _inStream(nullptr) { Common::String fname = fref->_slotNumber == -1 ? fref->_filename : fref->getSaveName(); if (fmode == filemode_Write || fmode == filemode_ReadWrite || fmode == filemode_WriteAppend) { @@ -789,7 +786,7 @@ FileStream::FileStream(Streams *streams, frefid_t fref, glui32 fmode, glui32 roc if (!readSavegameHeader(_inStream, header)) error("Invalid savegame"); if (header._interpType != g_vm->getInterpreterType() || header._language != g_vm->getLanguage() - || header._md5 != g_vm->getGameMD5()) + || header._md5 != g_vm->getGameMD5()) error("Savegame is for a different game"); g_vm->_events->setTotalPlayTicks(header._totalFrames); @@ -873,7 +870,7 @@ void FileStream::putBufferUni(const uint32 *buf, size_t len) { ensureOp(filemode_Write); - for (size_t lx = 0; lx<len; lx++) { + for (size_t lx = 0; lx < len; lx++) { glui32 ch = buf[lx]; if (!_unicode) { if (ch >= 0x100) @@ -1005,7 +1002,7 @@ void FileStream::setPosition(glui32 pos, glui32 seekMode) { _lastOp = 0; if (_unicode) pos *= 4; - + if (_inStream) { _inStream->seek(pos, SEEK_SET); } else { @@ -1100,7 +1097,7 @@ glui32 FileStream::getBuffer(char *buf, glui32 len) { return res; } else if (_textFile) { glui32 lx; - for (lx = 0; lx<len; lx++) { + for (lx = 0; lx < len; lx++) { glui32 ch; ch = getCharUtf8(); if (ch == -1) @@ -1148,7 +1145,7 @@ glui32 FileStream::getBufferUni(glui32 *buf, glui32 len) { ensureOp(filemode_Read); if (!_unicode) { glui32 lx; - for (lx = 0; lx<len; lx++) { + for (lx = 0; lx < len; lx++) { int res; glui32 ch; res = _inStream->readByte(); @@ -1161,7 +1158,7 @@ glui32 FileStream::getBufferUni(glui32 *buf, glui32 len) { return lx; } else if (_textFile) { glui32 lx; - for (lx = 0; lx<len; lx++) { + for (lx = 0; lx < len; lx++) { glui32 ch; ch = getCharUtf8(); if (ch == -1) @@ -1172,8 +1169,7 @@ glui32 FileStream::getBufferUni(glui32 *buf, glui32 len) { return lx; } else { glui32 lx; - for (lx = 0; lx<len; lx++) - { + for (lx = 0; lx < len; lx++) { int res; glui32 ch; res = _inStream->readByte(); @@ -1477,8 +1473,7 @@ frefid_t Streams::createByPrompt(glui32 usage, FileMode fmode, glui32 rock) { Common::String desc = dialog->getResultString(); return createRef(slot, desc, usage, rock); } - } - else if (fmode == filemode_Read) { + } else if (fmode == filemode_Read) { // Load a savegame slot GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false); @@ -1486,8 +1481,7 @@ frefid_t Streams::createByPrompt(glui32 usage, FileMode fmode, glui32 rock) { if (slot >= 0) { return createRef(slot, "", usage, rock); } - } - else { + } else { error("Unsupport file mode"); } break; @@ -1527,7 +1521,7 @@ frefid_t Streams::createRef(const Common::String &filename, glui32 usage, glui32 frefid_t Streams::createTemp(glui32 usage, glui32 rock) { return createRef(Common::String::format("%s.tmp", g_vm->getTargetName().c_str()), - usage, rock); + usage, rock); } frefid_t Streams::createFromRef(frefid_t fref, glui32 usage, glui32 rock) { @@ -1579,8 +1573,7 @@ bool FileReference::exists() const { if (Common::File::exists(_filename)) return true; filename = _filename; - } - else { + } else { filename = getSaveName(); } diff --git a/engines/gargoyle/streams.h b/engines/gargoyle/streams.h index c8b69631a0..8a497e08cb 100644 --- a/engines/gargoyle/streams.h +++ b/engines/gargoyle/streams.h @@ -159,7 +159,9 @@ public: /** * Get the rock value for the stream */ - uint32 getRock() const { return _rock; } + uint32 getRock() const { + return _rock; + } /** * Fill out the total amount read and/or written @@ -217,7 +219,9 @@ public: putCharUni('\n'); } - virtual glui32 getPosition() const { return 0; } + virtual glui32 getPosition() const { + return 0; + } virtual void setPosition(glui32 pos, glui32 seekMode) {} @@ -226,32 +230,44 @@ public: /** * Get a character from the stream */ - virtual glsi32 getChar() { return -1; } + virtual glsi32 getChar() { + return -1; + } /** * Get a unicode character from the stream */ - virtual glsi32 getCharUni() { return -1; } + virtual glsi32 getCharUni() { + return -1; + } /** * Get a buffer */ - virtual glui32 getBuffer(char *buf, glui32 len) { return 0; } + virtual glui32 getBuffer(char *buf, glui32 len) { + return 0; + } /** * Get a unicode buffer */ - virtual glui32 getBufferUni(glui32 *buf, glui32 len) { return 0; } + virtual glui32 getBufferUni(glui32 *buf, glui32 len) { + return 0; + } /** * Get a line */ - virtual glui32 getLine(char *buf, glui32 len) { return 0; } + virtual glui32 getLine(char *buf, glui32 len) { + return 0; + } /** * Get a unicode line */ - virtual glui32 getLineUni(glui32 *ubuf, glui32 len) { return 0; } + virtual glui32 getLineUni(glui32 *ubuf, glui32 len) { + return 0; + } /** * Set a hyperlink @@ -341,11 +357,11 @@ public: */ class MemoryStream : public Stream { private: - void *_buf; ///< unsigned char* for latin1, glui32* for unicode + void *_buf; ///< unsigned char* for latin1, glui32* for unicode void *_bufPtr; void *_bufEnd; void *_bufEof; - size_t _bufLen; ///< # of bytes for latin1, # of 4-byte words for unicode + size_t _bufLen; ///< # of bytes for latin1, # of 4-byte words for unicode public: /** * Constructor @@ -416,7 +432,7 @@ private: Common::OutSaveFile *_outFile; Common::InSaveFile *_inFile; Common::SeekableReadStream *_inStream; - uint32 _lastOp; ///< 0, filemode_Write, or filemode_Read + uint32 _lastOp; ///< 0, filemode_Write, or filemode_Read bool _textFile; private: /** @@ -577,7 +593,9 @@ public: /** * Gets the current output stream */ - Stream *getCurrent() const { return _currentStream; } + Stream *getCurrent() const { + return _currentStream; + } /** * Prompt for a savegame to load or save, and populate a file reference from the result diff --git a/engines/gargoyle/unicode.cpp b/engines/gargoyle/unicode.cpp index c783915cde..f32093b2f5 100644 --- a/engines/gargoyle/unicode.cpp +++ b/engines/gargoyle/unicode.cpp @@ -34,7 +34,7 @@ size_t strlen_uni(const uint32 *s) { } glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCase destcase, - BufferChangeCond cond, int changerest) { + BufferChangeCond cond, int changerest) { glui32 ix, jx; glui32 *outbuf; glui32 *newoutbuf; @@ -92,8 +92,7 @@ glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCa res = block[ch & 0xFF][target]; } - if (res != 0xFFFFFFFF || res == ch) - { + if (res != 0xFFFFFFFF || res == ch) { /* simple case */ if (outcount < len) outbuf[outcount] = res; @@ -130,7 +129,7 @@ glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCa outbuf = newoutbuf; } - for (jx = 0; jx<speccount; jx++) { + for (jx = 0; jx < speccount; jx++) { if (outcount < len) outbuf[outcount] = ptr[jx]; outcount++; diff --git a/engines/gargoyle/unicode.h b/engines/gargoyle/unicode.h index 2392c1afa1..e9fa9280d9 100644 --- a/engines/gargoyle/unicode.h +++ b/engines/gargoyle/unicode.h @@ -44,7 +44,7 @@ size_t strlen_uni(const uint32 *s); *converted string should have contained. */ extern glui32 bufferChangeCase(glui32 *buf, glui32 len, - glui32 numchars, BufferChangeCase destcase, BufferChangeCond cond, int changerest); + glui32 numchars, BufferChangeCase destcase, BufferChangeCond cond, int changerest); } // End of namespace Gargoyle diff --git a/engines/gargoyle/unicode_gen.cpp b/engines/gargoyle/unicode_gen.cpp index c9ad57097f..56e44c350f 100644 --- a/engines/gargoyle/unicode_gen.cpp +++ b/engines/gargoyle/unicode_gen.cpp @@ -3861,3325 +3861,3325 @@ gli_case_special_t unigen_special_0xfb16 = { 857, 860, 862 }; gli_case_special_t unigen_special_0xfb17 = { 865, 868, 870 }; #define RETURN_COMBINING_CLASS(ch) \ -switch ((glui32)(ch) >> 8) { \ -case 3: \ -switch (ch) { \ - case 820: \ - case 821: \ - case 822: \ - case 823: \ - case 824: \ - return 1; \ - case 801: \ - case 802: \ - case 807: \ - case 808: \ - return 202; \ - case 795: \ - return 216; \ - case 790: \ - case 791: \ - case 792: \ - case 793: \ - case 796: \ - case 797: \ - case 798: \ - case 799: \ - case 800: \ - case 803: \ - case 804: \ - case 805: \ - case 806: \ - case 809: \ - case 810: \ - case 811: \ - case 812: \ - case 813: \ - case 814: \ - case 815: \ - case 816: \ - case 817: \ - case 818: \ - case 819: \ - case 825: \ - case 826: \ - case 827: \ - case 828: \ - case 839: \ - case 840: \ - case 841: \ - case 845: \ - case 846: \ - case 851: \ - case 852: \ - case 853: \ - case 854: \ - return 220; \ - case 768: \ - case 769: \ - case 770: \ - case 771: \ - case 772: \ - case 773: \ - case 774: \ - case 775: \ - case 776: \ - case 777: \ - case 778: \ - case 779: \ - case 780: \ - case 781: \ - case 782: \ - case 783: \ - case 784: \ - case 785: \ - case 786: \ - case 787: \ - case 788: \ - case 829: \ - case 830: \ - case 831: \ - case 832: \ - case 833: \ - case 834: \ - case 835: \ - case 836: \ - case 838: \ - case 842: \ - case 843: \ - case 844: \ - case 848: \ - case 849: \ - case 850: \ - case 855: \ - case 867: \ - case 868: \ - case 869: \ - case 870: \ - case 871: \ - case 872: \ - case 873: \ - case 874: \ - case 875: \ - case 876: \ - case 877: \ - case 878: \ - case 879: \ - return 230; \ - case 789: \ - case 794: \ - return 232; \ - case 863: \ - case 866: \ - return 233; \ - case 861: \ - case 862: \ - case 864: \ - case 865: \ - return 234; \ - case 837: \ - return 240; \ -} \ -return 0; \ -case 4: \ -switch (ch) { \ - case 1155: \ - case 1156: \ - case 1157: \ - case 1158: \ - return 230; \ -} \ -return 0; \ -case 5: \ -switch (ch) { \ - case 1456: \ - return 10; \ - case 1457: \ - return 11; \ - case 1458: \ - return 12; \ - case 1459: \ - return 13; \ - case 1460: \ - return 14; \ - case 1461: \ - return 15; \ - case 1462: \ - return 16; \ - case 1463: \ - return 17; \ - case 1464: \ - return 18; \ - case 1465: \ - return 19; \ - case 1467: \ - return 20; \ - case 1468: \ - return 21; \ - case 1469: \ - return 22; \ - case 1471: \ - return 23; \ - case 1473: \ - return 24; \ - case 1474: \ - return 25; \ - case 1425: \ - case 1430: \ - case 1435: \ - case 1443: \ - case 1444: \ - case 1445: \ - case 1446: \ - case 1447: \ - case 1450: \ - return 220; \ - case 1434: \ - case 1453: \ - return 222; \ - case 1454: \ - return 228; \ - case 1426: \ - case 1427: \ - case 1428: \ - case 1429: \ - case 1431: \ - case 1432: \ - case 1433: \ - case 1436: \ - case 1437: \ - case 1438: \ - case 1439: \ - case 1440: \ - case 1441: \ - case 1448: \ - case 1449: \ - case 1451: \ - case 1452: \ - case 1455: \ - case 1476: \ - return 230; \ -} \ -return 0; \ -case 6: \ -switch (ch) { \ - case 1611: \ - return 27; \ - case 1612: \ - return 28; \ - case 1613: \ - return 29; \ - case 1614: \ - return 30; \ - case 1615: \ - return 31; \ - case 1616: \ - return 32; \ - case 1617: \ - return 33; \ - case 1618: \ - return 34; \ - case 1648: \ - return 35; \ - case 1621: \ - case 1622: \ - case 1763: \ - case 1770: \ - case 1773: \ - return 220; \ - case 1552: \ - case 1553: \ - case 1554: \ - case 1555: \ - case 1556: \ - case 1557: \ - case 1619: \ - case 1620: \ - case 1623: \ - case 1624: \ - case 1750: \ - case 1751: \ - case 1752: \ - case 1753: \ - case 1754: \ - case 1755: \ - case 1756: \ - case 1759: \ - case 1760: \ - case 1761: \ - case 1762: \ - case 1764: \ - case 1767: \ - case 1768: \ - case 1771: \ - case 1772: \ - return 230; \ -} \ -return 0; \ -case 7: \ -switch (ch) { \ - case 1809: \ - return 36; \ - case 1841: \ - case 1844: \ - case 1847: \ - case 1848: \ - case 1849: \ - case 1851: \ - case 1852: \ - case 1854: \ - case 1858: \ - case 1860: \ - case 1862: \ - case 1864: \ - return 220; \ - case 1840: \ - case 1842: \ - case 1843: \ - case 1845: \ - case 1846: \ - case 1850: \ - case 1853: \ - case 1855: \ - case 1856: \ - case 1857: \ - case 1859: \ - case 1861: \ - case 1863: \ - case 1865: \ - case 1866: \ - return 230; \ -} \ -return 0; \ -case 9: \ -switch (ch) { \ - case 2364: \ - case 2492: \ - return 7; \ - case 2381: \ - case 2509: \ - return 9; \ - case 2386: \ - return 220; \ - case 2385: \ - case 2387: \ - case 2388: \ - return 230; \ -} \ -return 0; \ -case 10: \ -switch (ch) { \ - case 2620: \ - case 2748: \ - return 7; \ - case 2637: \ - case 2765: \ - return 9; \ -} \ -return 0; \ -case 11: \ -switch (ch) { \ - case 2876: \ - return 7; \ - case 2893: \ - case 3021: \ - return 9; \ -} \ -return 0; \ -case 12: \ -switch (ch) { \ - case 3260: \ - return 7; \ - case 3149: \ - case 3277: \ - return 9; \ - case 3157: \ - return 84; \ - case 3158: \ - return 91; \ -} \ -return 0; \ -case 13: \ -switch (ch) { \ - case 3405: \ - case 3530: \ - return 9; \ -} \ -return 0; \ -case 14: \ -switch (ch) { \ - case 3642: \ - return 9; \ - case 3640: \ - case 3641: \ - return 103; \ - case 3656: \ - case 3657: \ - case 3658: \ - case 3659: \ - return 107; \ - case 3768: \ - case 3769: \ - return 118; \ - case 3784: \ - case 3785: \ - case 3786: \ - case 3787: \ - return 122; \ -} \ -return 0; \ -case 15: \ -switch (ch) { \ - case 3972: \ - return 9; \ - case 3953: \ - return 129; \ - case 3954: \ - case 3962: \ - case 3963: \ - case 3964: \ - case 3965: \ - case 3968: \ - return 130; \ - case 3956: \ - return 132; \ - case 3897: \ - return 216; \ - case 3864: \ - case 3865: \ - case 3893: \ - case 3895: \ - case 4038: \ - return 220; \ - case 3970: \ - case 3971: \ - case 3974: \ - case 3975: \ - return 230; \ -} \ -return 0; \ -case 16: \ -switch (ch) { \ - case 4151: \ - return 7; \ - case 4153: \ - return 9; \ -} \ -return 0; \ -case 23: \ -switch (ch) { \ - case 5908: \ - case 5940: \ - case 6098: \ - return 9; \ - case 6109: \ - return 230; \ -} \ -return 0; \ -case 24: \ -switch (ch) { \ - case 6313: \ - return 228; \ -} \ -return 0; \ -case 25: \ -switch (ch) { \ - case 6459: \ - return 220; \ - case 6457: \ - return 222; \ - case 6458: \ - return 230; \ -} \ -return 0; \ -case 32: \ -switch (ch) { \ - case 8402: \ - case 8403: \ - case 8408: \ - case 8409: \ - case 8410: \ - case 8421: \ - case 8422: \ - case 8426: \ - return 1; \ - case 8424: \ - return 220; \ - case 8400: \ - case 8401: \ - case 8404: \ - case 8405: \ - case 8406: \ - case 8407: \ - case 8411: \ - case 8412: \ - case 8417: \ - case 8423: \ - case 8425: \ - return 230; \ -} \ -return 0; \ -case 48: \ -switch (ch) { \ - case 12441: \ - case 12442: \ - return 8; \ - case 12330: \ - return 218; \ - case 12333: \ - return 222; \ - case 12334: \ - case 12335: \ - return 224; \ - case 12331: \ - return 228; \ - case 12332: \ - return 232; \ -} \ -return 0; \ -case 251: \ -switch (ch) { \ - case 64286: \ - return 26; \ -} \ -return 0; \ -case 254: \ -switch (ch) { \ - case 65056: \ - case 65057: \ - case 65058: \ - case 65059: \ - return 230; \ -} \ -return 0; \ -case 465: \ -switch (ch) { \ - case 119143: \ - case 119144: \ - case 119145: \ - return 1; \ - case 119141: \ - case 119142: \ - case 119150: \ - case 119151: \ - case 119152: \ - case 119153: \ - case 119154: \ - return 216; \ - case 119163: \ - case 119164: \ - case 119165: \ - case 119166: \ - case 119167: \ - case 119168: \ - case 119169: \ - case 119170: \ - case 119178: \ - case 119179: \ - return 220; \ - case 119149: \ - return 226; \ - case 119173: \ - case 119174: \ - case 119175: \ - case 119176: \ - case 119177: \ - case 119210: \ - case 119211: \ - case 119212: \ - case 119213: \ - return 230; \ -} \ -return 0; \ -} \ -return 0; + switch ((glui32)(ch) >> 8) { \ + case 3: \ + switch (ch) { \ + case 820: \ + case 821: \ + case 822: \ + case 823: \ + case 824: \ + return 1; \ + case 801: \ + case 802: \ + case 807: \ + case 808: \ + return 202; \ + case 795: \ + return 216; \ + case 790: \ + case 791: \ + case 792: \ + case 793: \ + case 796: \ + case 797: \ + case 798: \ + case 799: \ + case 800: \ + case 803: \ + case 804: \ + case 805: \ + case 806: \ + case 809: \ + case 810: \ + case 811: \ + case 812: \ + case 813: \ + case 814: \ + case 815: \ + case 816: \ + case 817: \ + case 818: \ + case 819: \ + case 825: \ + case 826: \ + case 827: \ + case 828: \ + case 839: \ + case 840: \ + case 841: \ + case 845: \ + case 846: \ + case 851: \ + case 852: \ + case 853: \ + case 854: \ + return 220; \ + case 768: \ + case 769: \ + case 770: \ + case 771: \ + case 772: \ + case 773: \ + case 774: \ + case 775: \ + case 776: \ + case 777: \ + case 778: \ + case 779: \ + case 780: \ + case 781: \ + case 782: \ + case 783: \ + case 784: \ + case 785: \ + case 786: \ + case 787: \ + case 788: \ + case 829: \ + case 830: \ + case 831: \ + case 832: \ + case 833: \ + case 834: \ + case 835: \ + case 836: \ + case 838: \ + case 842: \ + case 843: \ + case 844: \ + case 848: \ + case 849: \ + case 850: \ + case 855: \ + case 867: \ + case 868: \ + case 869: \ + case 870: \ + case 871: \ + case 872: \ + case 873: \ + case 874: \ + case 875: \ + case 876: \ + case 877: \ + case 878: \ + case 879: \ + return 230; \ + case 789: \ + case 794: \ + return 232; \ + case 863: \ + case 866: \ + return 233; \ + case 861: \ + case 862: \ + case 864: \ + case 865: \ + return 234; \ + case 837: \ + return 240; \ + } \ + return 0; \ + case 4: \ + switch (ch) { \ + case 1155: \ + case 1156: \ + case 1157: \ + case 1158: \ + return 230; \ + } \ + return 0; \ + case 5: \ + switch (ch) { \ + case 1456: \ + return 10; \ + case 1457: \ + return 11; \ + case 1458: \ + return 12; \ + case 1459: \ + return 13; \ + case 1460: \ + return 14; \ + case 1461: \ + return 15; \ + case 1462: \ + return 16; \ + case 1463: \ + return 17; \ + case 1464: \ + return 18; \ + case 1465: \ + return 19; \ + case 1467: \ + return 20; \ + case 1468: \ + return 21; \ + case 1469: \ + return 22; \ + case 1471: \ + return 23; \ + case 1473: \ + return 24; \ + case 1474: \ + return 25; \ + case 1425: \ + case 1430: \ + case 1435: \ + case 1443: \ + case 1444: \ + case 1445: \ + case 1446: \ + case 1447: \ + case 1450: \ + return 220; \ + case 1434: \ + case 1453: \ + return 222; \ + case 1454: \ + return 228; \ + case 1426: \ + case 1427: \ + case 1428: \ + case 1429: \ + case 1431: \ + case 1432: \ + case 1433: \ + case 1436: \ + case 1437: \ + case 1438: \ + case 1439: \ + case 1440: \ + case 1441: \ + case 1448: \ + case 1449: \ + case 1451: \ + case 1452: \ + case 1455: \ + case 1476: \ + return 230; \ + } \ + return 0; \ + case 6: \ + switch (ch) { \ + case 1611: \ + return 27; \ + case 1612: \ + return 28; \ + case 1613: \ + return 29; \ + case 1614: \ + return 30; \ + case 1615: \ + return 31; \ + case 1616: \ + return 32; \ + case 1617: \ + return 33; \ + case 1618: \ + return 34; \ + case 1648: \ + return 35; \ + case 1621: \ + case 1622: \ + case 1763: \ + case 1770: \ + case 1773: \ + return 220; \ + case 1552: \ + case 1553: \ + case 1554: \ + case 1555: \ + case 1556: \ + case 1557: \ + case 1619: \ + case 1620: \ + case 1623: \ + case 1624: \ + case 1750: \ + case 1751: \ + case 1752: \ + case 1753: \ + case 1754: \ + case 1755: \ + case 1756: \ + case 1759: \ + case 1760: \ + case 1761: \ + case 1762: \ + case 1764: \ + case 1767: \ + case 1768: \ + case 1771: \ + case 1772: \ + return 230; \ + } \ + return 0; \ + case 7: \ + switch (ch) { \ + case 1809: \ + return 36; \ + case 1841: \ + case 1844: \ + case 1847: \ + case 1848: \ + case 1849: \ + case 1851: \ + case 1852: \ + case 1854: \ + case 1858: \ + case 1860: \ + case 1862: \ + case 1864: \ + return 220; \ + case 1840: \ + case 1842: \ + case 1843: \ + case 1845: \ + case 1846: \ + case 1850: \ + case 1853: \ + case 1855: \ + case 1856: \ + case 1857: \ + case 1859: \ + case 1861: \ + case 1863: \ + case 1865: \ + case 1866: \ + return 230; \ + } \ + return 0; \ + case 9: \ + switch (ch) { \ + case 2364: \ + case 2492: \ + return 7; \ + case 2381: \ + case 2509: \ + return 9; \ + case 2386: \ + return 220; \ + case 2385: \ + case 2387: \ + case 2388: \ + return 230; \ + } \ + return 0; \ + case 10: \ + switch (ch) { \ + case 2620: \ + case 2748: \ + return 7; \ + case 2637: \ + case 2765: \ + return 9; \ + } \ + return 0; \ + case 11: \ + switch (ch) { \ + case 2876: \ + return 7; \ + case 2893: \ + case 3021: \ + return 9; \ + } \ + return 0; \ + case 12: \ + switch (ch) { \ + case 3260: \ + return 7; \ + case 3149: \ + case 3277: \ + return 9; \ + case 3157: \ + return 84; \ + case 3158: \ + return 91; \ + } \ + return 0; \ + case 13: \ + switch (ch) { \ + case 3405: \ + case 3530: \ + return 9; \ + } \ + return 0; \ + case 14: \ + switch (ch) { \ + case 3642: \ + return 9; \ + case 3640: \ + case 3641: \ + return 103; \ + case 3656: \ + case 3657: \ + case 3658: \ + case 3659: \ + return 107; \ + case 3768: \ + case 3769: \ + return 118; \ + case 3784: \ + case 3785: \ + case 3786: \ + case 3787: \ + return 122; \ + } \ + return 0; \ + case 15: \ + switch (ch) { \ + case 3972: \ + return 9; \ + case 3953: \ + return 129; \ + case 3954: \ + case 3962: \ + case 3963: \ + case 3964: \ + case 3965: \ + case 3968: \ + return 130; \ + case 3956: \ + return 132; \ + case 3897: \ + return 216; \ + case 3864: \ + case 3865: \ + case 3893: \ + case 3895: \ + case 4038: \ + return 220; \ + case 3970: \ + case 3971: \ + case 3974: \ + case 3975: \ + return 230; \ + } \ + return 0; \ + case 16: \ + switch (ch) { \ + case 4151: \ + return 7; \ + case 4153: \ + return 9; \ + } \ + return 0; \ + case 23: \ + switch (ch) { \ + case 5908: \ + case 5940: \ + case 6098: \ + return 9; \ + case 6109: \ + return 230; \ + } \ + return 0; \ + case 24: \ + switch (ch) { \ + case 6313: \ + return 228; \ + } \ + return 0; \ + case 25: \ + switch (ch) { \ + case 6459: \ + return 220; \ + case 6457: \ + return 222; \ + case 6458: \ + return 230; \ + } \ + return 0; \ + case 32: \ + switch (ch) { \ + case 8402: \ + case 8403: \ + case 8408: \ + case 8409: \ + case 8410: \ + case 8421: \ + case 8422: \ + case 8426: \ + return 1; \ + case 8424: \ + return 220; \ + case 8400: \ + case 8401: \ + case 8404: \ + case 8405: \ + case 8406: \ + case 8407: \ + case 8411: \ + case 8412: \ + case 8417: \ + case 8423: \ + case 8425: \ + return 230; \ + } \ + return 0; \ + case 48: \ + switch (ch) { \ + case 12441: \ + case 12442: \ + return 8; \ + case 12330: \ + return 218; \ + case 12333: \ + return 222; \ + case 12334: \ + case 12335: \ + return 224; \ + case 12331: \ + return 228; \ + case 12332: \ + return 232; \ + } \ + return 0; \ + case 251: \ + switch (ch) { \ + case 64286: \ + return 26; \ + } \ + return 0; \ + case 254: \ + switch (ch) { \ + case 65056: \ + case 65057: \ + case 65058: \ + case 65059: \ + return 230; \ + } \ + return 0; \ + case 465: \ + switch (ch) { \ + case 119143: \ + case 119144: \ + case 119145: \ + return 1; \ + case 119141: \ + case 119142: \ + case 119150: \ + case 119151: \ + case 119152: \ + case 119153: \ + case 119154: \ + return 216; \ + case 119163: \ + case 119164: \ + case 119165: \ + case 119166: \ + case 119167: \ + case 119168: \ + case 119169: \ + case 119170: \ + case 119178: \ + case 119179: \ + return 220; \ + case 119149: \ + return 226; \ + case 119173: \ + case 119174: \ + case 119175: \ + case 119176: \ + case 119177: \ + case 119210: \ + case 119211: \ + case 119212: \ + case 119213: \ + return 230; \ + } \ + return 0; \ + } \ + return 0; #define RETURN_COMPOSITION(ch1, ch2) \ -switch ((glui32)(ch1) >> 8) { \ -case 0: \ -switch (ch1) { \ - case 60: \ - switch (ch2) { \ - case 824: return 8814; \ - } \ - return 0; \ - case 61: \ - switch (ch2) { \ - case 824: return 8800; \ - } \ - return 0; \ - case 62: \ - switch (ch2) { \ - case 824: return 8815; \ - } \ - return 0; \ - case 65: \ - switch (ch2) { \ - case 768: return 192; \ - case 769: return 193; \ - case 770: return 194; \ - case 771: return 195; \ - case 772: return 256; \ - case 774: return 258; \ - case 775: return 550; \ - case 776: return 196; \ - case 777: return 7842; \ - case 778: return 197; \ - case 780: return 461; \ - case 783: return 512; \ - case 785: return 514; \ - case 803: return 7840; \ - case 805: return 7680; \ - case 808: return 260; \ - } \ - return 0; \ - case 66: \ - switch (ch2) { \ - case 775: return 7682; \ - case 803: return 7684; \ - case 817: return 7686; \ - } \ - return 0; \ - case 67: \ - switch (ch2) { \ - case 769: return 262; \ - case 770: return 264; \ - case 775: return 266; \ - case 780: return 268; \ - case 807: return 199; \ - } \ - return 0; \ - case 68: \ - switch (ch2) { \ - case 775: return 7690; \ - case 780: return 270; \ - case 803: return 7692; \ - case 807: return 7696; \ - case 813: return 7698; \ - case 817: return 7694; \ - } \ - return 0; \ - case 69: \ - switch (ch2) { \ - case 768: return 200; \ - case 769: return 201; \ - case 770: return 202; \ - case 771: return 7868; \ - case 772: return 274; \ - case 774: return 276; \ - case 775: return 278; \ - case 776: return 203; \ - case 777: return 7866; \ - case 780: return 282; \ - case 783: return 516; \ - case 785: return 518; \ - case 803: return 7864; \ - case 807: return 552; \ - case 808: return 280; \ - case 813: return 7704; \ - case 816: return 7706; \ - } \ - return 0; \ - case 70: \ - switch (ch2) { \ - case 775: return 7710; \ - } \ - return 0; \ - case 71: \ - switch (ch2) { \ - case 769: return 500; \ - case 770: return 284; \ - case 772: return 7712; \ - case 774: return 286; \ - case 775: return 288; \ - case 780: return 486; \ - case 807: return 290; \ - } \ - return 0; \ - case 72: \ - switch (ch2) { \ - case 770: return 292; \ - case 775: return 7714; \ - case 776: return 7718; \ - case 780: return 542; \ - case 803: return 7716; \ - case 807: return 7720; \ - case 814: return 7722; \ - } \ - return 0; \ - case 73: \ - switch (ch2) { \ - case 768: return 204; \ - case 769: return 205; \ - case 770: return 206; \ - case 771: return 296; \ - case 772: return 298; \ - case 774: return 300; \ - case 775: return 304; \ - case 776: return 207; \ - case 777: return 7880; \ - case 780: return 463; \ - case 783: return 520; \ - case 785: return 522; \ - case 803: return 7882; \ - case 808: return 302; \ - case 816: return 7724; \ - } \ - return 0; \ - case 74: \ - switch (ch2) { \ - case 770: return 308; \ - } \ - return 0; \ - case 75: \ - switch (ch2) { \ - case 769: return 7728; \ - case 780: return 488; \ - case 803: return 7730; \ - case 807: return 310; \ - case 817: return 7732; \ - } \ - return 0; \ - case 76: \ - switch (ch2) { \ - case 769: return 313; \ - case 780: return 317; \ - case 803: return 7734; \ - case 807: return 315; \ - case 813: return 7740; \ - case 817: return 7738; \ - } \ - return 0; \ - case 77: \ - switch (ch2) { \ - case 769: return 7742; \ - case 775: return 7744; \ - case 803: return 7746; \ - } \ - return 0; \ - case 78: \ - switch (ch2) { \ - case 768: return 504; \ - case 769: return 323; \ - case 771: return 209; \ - case 775: return 7748; \ - case 780: return 327; \ - case 803: return 7750; \ - case 807: return 325; \ - case 813: return 7754; \ - case 817: return 7752; \ - } \ - return 0; \ - case 79: \ - switch (ch2) { \ - case 768: return 210; \ - case 769: return 211; \ - case 770: return 212; \ - case 771: return 213; \ - case 772: return 332; \ - case 774: return 334; \ - case 775: return 558; \ - case 776: return 214; \ - case 777: return 7886; \ - case 779: return 336; \ - case 780: return 465; \ - case 783: return 524; \ - case 785: return 526; \ - case 795: return 416; \ - case 803: return 7884; \ - case 808: return 490; \ - } \ - return 0; \ - case 80: \ - switch (ch2) { \ - case 769: return 7764; \ - case 775: return 7766; \ - } \ - return 0; \ - case 82: \ - switch (ch2) { \ - case 769: return 340; \ - case 775: return 7768; \ - case 780: return 344; \ - case 783: return 528; \ - case 785: return 530; \ - case 803: return 7770; \ - case 807: return 342; \ - case 817: return 7774; \ - } \ - return 0; \ - case 83: \ - switch (ch2) { \ - case 769: return 346; \ - case 770: return 348; \ - case 775: return 7776; \ - case 780: return 352; \ - case 803: return 7778; \ - case 806: return 536; \ - case 807: return 350; \ - } \ - return 0; \ - case 84: \ - switch (ch2) { \ - case 775: return 7786; \ - case 780: return 356; \ - case 803: return 7788; \ - case 806: return 538; \ - case 807: return 354; \ - case 813: return 7792; \ - case 817: return 7790; \ - } \ - return 0; \ - case 85: \ - switch (ch2) { \ - case 768: return 217; \ - case 769: return 218; \ - case 770: return 219; \ - case 771: return 360; \ - case 772: return 362; \ - case 774: return 364; \ - case 776: return 220; \ - case 777: return 7910; \ - case 778: return 366; \ - case 779: return 368; \ - case 780: return 467; \ - case 783: return 532; \ - case 785: return 534; \ - case 795: return 431; \ - case 803: return 7908; \ - case 804: return 7794; \ - case 808: return 370; \ - case 813: return 7798; \ - case 816: return 7796; \ - } \ - return 0; \ - case 86: \ - switch (ch2) { \ - case 771: return 7804; \ - case 803: return 7806; \ - } \ - return 0; \ - case 87: \ - switch (ch2) { \ - case 768: return 7808; \ - case 769: return 7810; \ - case 770: return 372; \ - case 775: return 7814; \ - case 776: return 7812; \ - case 803: return 7816; \ - } \ - return 0; \ - case 88: \ - switch (ch2) { \ - case 775: return 7818; \ - case 776: return 7820; \ - } \ - return 0; \ - case 89: \ - switch (ch2) { \ - case 768: return 7922; \ - case 769: return 221; \ - case 770: return 374; \ - case 771: return 7928; \ - case 772: return 562; \ - case 775: return 7822; \ - case 776: return 376; \ - case 777: return 7926; \ - case 803: return 7924; \ - } \ - return 0; \ - case 90: \ - switch (ch2) { \ - case 769: return 377; \ - case 770: return 7824; \ - case 775: return 379; \ - case 780: return 381; \ - case 803: return 7826; \ - case 817: return 7828; \ - } \ - return 0; \ - case 97: \ - switch (ch2) { \ - case 768: return 224; \ - case 769: return 225; \ - case 770: return 226; \ - case 771: return 227; \ - case 772: return 257; \ - case 774: return 259; \ - case 775: return 551; \ - case 776: return 228; \ - case 777: return 7843; \ - case 778: return 229; \ - case 780: return 462; \ - case 783: return 513; \ - case 785: return 515; \ - case 803: return 7841; \ - case 805: return 7681; \ - case 808: return 261; \ - } \ - return 0; \ - case 98: \ - switch (ch2) { \ - case 775: return 7683; \ - case 803: return 7685; \ - case 817: return 7687; \ - } \ - return 0; \ - case 99: \ - switch (ch2) { \ - case 769: return 263; \ - case 770: return 265; \ - case 775: return 267; \ - case 780: return 269; \ - case 807: return 231; \ - } \ - return 0; \ - case 100: \ - switch (ch2) { \ - case 775: return 7691; \ - case 780: return 271; \ - case 803: return 7693; \ - case 807: return 7697; \ - case 813: return 7699; \ - case 817: return 7695; \ - } \ - return 0; \ - case 101: \ - switch (ch2) { \ - case 768: return 232; \ - case 769: return 233; \ - case 770: return 234; \ - case 771: return 7869; \ - case 772: return 275; \ - case 774: return 277; \ - case 775: return 279; \ - case 776: return 235; \ - case 777: return 7867; \ - case 780: return 283; \ - case 783: return 517; \ - case 785: return 519; \ - case 803: return 7865; \ - case 807: return 553; \ - case 808: return 281; \ - case 813: return 7705; \ - case 816: return 7707; \ - } \ - return 0; \ - case 102: \ - switch (ch2) { \ - case 775: return 7711; \ - } \ - return 0; \ - case 103: \ - switch (ch2) { \ - case 769: return 501; \ - case 770: return 285; \ - case 772: return 7713; \ - case 774: return 287; \ - case 775: return 289; \ - case 780: return 487; \ - case 807: return 291; \ - } \ - return 0; \ - case 104: \ - switch (ch2) { \ - case 770: return 293; \ - case 775: return 7715; \ - case 776: return 7719; \ - case 780: return 543; \ - case 803: return 7717; \ - case 807: return 7721; \ - case 814: return 7723; \ - case 817: return 7830; \ - } \ - return 0; \ - case 105: \ - switch (ch2) { \ - case 768: return 236; \ - case 769: return 237; \ - case 770: return 238; \ - case 771: return 297; \ - case 772: return 299; \ - case 774: return 301; \ - case 776: return 239; \ - case 777: return 7881; \ - case 780: return 464; \ - case 783: return 521; \ - case 785: return 523; \ - case 803: return 7883; \ - case 808: return 303; \ - case 816: return 7725; \ - } \ - return 0; \ - case 106: \ - switch (ch2) { \ - case 770: return 309; \ - case 780: return 496; \ - } \ - return 0; \ - case 107: \ - switch (ch2) { \ - case 769: return 7729; \ - case 780: return 489; \ - case 803: return 7731; \ - case 807: return 311; \ - case 817: return 7733; \ - } \ - return 0; \ - case 108: \ - switch (ch2) { \ - case 769: return 314; \ - case 780: return 318; \ - case 803: return 7735; \ - case 807: return 316; \ - case 813: return 7741; \ - case 817: return 7739; \ - } \ - return 0; \ - case 109: \ - switch (ch2) { \ - case 769: return 7743; \ - case 775: return 7745; \ - case 803: return 7747; \ - } \ - return 0; \ - case 110: \ - switch (ch2) { \ - case 768: return 505; \ - case 769: return 324; \ - case 771: return 241; \ - case 775: return 7749; \ - case 780: return 328; \ - case 803: return 7751; \ - case 807: return 326; \ - case 813: return 7755; \ - case 817: return 7753; \ - } \ - return 0; \ - case 111: \ - switch (ch2) { \ - case 768: return 242; \ - case 769: return 243; \ - case 770: return 244; \ - case 771: return 245; \ - case 772: return 333; \ - case 774: return 335; \ - case 775: return 559; \ - case 776: return 246; \ - case 777: return 7887; \ - case 779: return 337; \ - case 780: return 466; \ - case 783: return 525; \ - case 785: return 527; \ - case 795: return 417; \ - case 803: return 7885; \ - case 808: return 491; \ - } \ - return 0; \ - case 112: \ - switch (ch2) { \ - case 769: return 7765; \ - case 775: return 7767; \ - } \ - return 0; \ - case 114: \ - switch (ch2) { \ - case 769: return 341; \ - case 775: return 7769; \ - case 780: return 345; \ - case 783: return 529; \ - case 785: return 531; \ - case 803: return 7771; \ - case 807: return 343; \ - case 817: return 7775; \ - } \ - return 0; \ - case 115: \ - switch (ch2) { \ - case 769: return 347; \ - case 770: return 349; \ - case 775: return 7777; \ - case 780: return 353; \ - case 803: return 7779; \ - case 806: return 537; \ - case 807: return 351; \ - } \ - return 0; \ - case 116: \ - switch (ch2) { \ - case 775: return 7787; \ - case 776: return 7831; \ - case 780: return 357; \ - case 803: return 7789; \ - case 806: return 539; \ - case 807: return 355; \ - case 813: return 7793; \ - case 817: return 7791; \ - } \ - return 0; \ - case 117: \ - switch (ch2) { \ - case 768: return 249; \ - case 769: return 250; \ - case 770: return 251; \ - case 771: return 361; \ - case 772: return 363; \ - case 774: return 365; \ - case 776: return 252; \ - case 777: return 7911; \ - case 778: return 367; \ - case 779: return 369; \ - case 780: return 468; \ - case 783: return 533; \ - case 785: return 535; \ - case 795: return 432; \ - case 803: return 7909; \ - case 804: return 7795; \ - case 808: return 371; \ - case 813: return 7799; \ - case 816: return 7797; \ - } \ - return 0; \ - case 118: \ - switch (ch2) { \ - case 771: return 7805; \ - case 803: return 7807; \ - } \ - return 0; \ - case 119: \ - switch (ch2) { \ - case 768: return 7809; \ - case 769: return 7811; \ - case 770: return 373; \ - case 775: return 7815; \ - case 776: return 7813; \ - case 778: return 7832; \ - case 803: return 7817; \ - } \ - return 0; \ - case 120: \ - switch (ch2) { \ - case 775: return 7819; \ - case 776: return 7821; \ - } \ - return 0; \ - case 121: \ - switch (ch2) { \ - case 768: return 7923; \ - case 769: return 253; \ - case 770: return 375; \ - case 771: return 7929; \ - case 772: return 563; \ - case 775: return 7823; \ - case 776: return 255; \ - case 777: return 7927; \ - case 778: return 7833; \ - case 803: return 7925; \ - } \ - return 0; \ - case 122: \ - switch (ch2) { \ - case 769: return 378; \ - case 770: return 7825; \ - case 775: return 380; \ - case 780: return 382; \ - case 803: return 7827; \ - case 817: return 7829; \ - } \ - return 0; \ - case 168: \ - switch (ch2) { \ - case 768: return 8173; \ - case 769: return 901; \ - case 834: return 8129; \ - } \ - return 0; \ - case 194: \ - switch (ch2) { \ - case 768: return 7846; \ - case 769: return 7844; \ - case 771: return 7850; \ - case 777: return 7848; \ - } \ - return 0; \ - case 196: \ - switch (ch2) { \ - case 772: return 478; \ - } \ - return 0; \ - case 197: \ - switch (ch2) { \ - case 769: return 506; \ - } \ - return 0; \ - case 198: \ - switch (ch2) { \ - case 769: return 508; \ - case 772: return 482; \ - } \ - return 0; \ - case 199: \ - switch (ch2) { \ - case 769: return 7688; \ - } \ - return 0; \ - case 202: \ - switch (ch2) { \ - case 768: return 7872; \ - case 769: return 7870; \ - case 771: return 7876; \ - case 777: return 7874; \ - } \ - return 0; \ - case 207: \ - switch (ch2) { \ - case 769: return 7726; \ - } \ - return 0; \ - case 212: \ - switch (ch2) { \ - case 768: return 7890; \ - case 769: return 7888; \ - case 771: return 7894; \ - case 777: return 7892; \ - } \ - return 0; \ - case 213: \ - switch (ch2) { \ - case 769: return 7756; \ - case 772: return 556; \ - case 776: return 7758; \ - } \ - return 0; \ - case 214: \ - switch (ch2) { \ - case 772: return 554; \ - } \ - return 0; \ - case 216: \ - switch (ch2) { \ - case 769: return 510; \ - } \ - return 0; \ - case 220: \ - switch (ch2) { \ - case 768: return 475; \ - case 769: return 471; \ - case 772: return 469; \ - case 780: return 473; \ - } \ - return 0; \ - case 226: \ - switch (ch2) { \ - case 768: return 7847; \ - case 769: return 7845; \ - case 771: return 7851; \ - case 777: return 7849; \ - } \ - return 0; \ - case 228: \ - switch (ch2) { \ - case 772: return 479; \ - } \ - return 0; \ - case 229: \ - switch (ch2) { \ - case 769: return 507; \ - } \ - return 0; \ - case 230: \ - switch (ch2) { \ - case 769: return 509; \ - case 772: return 483; \ - } \ - return 0; \ - case 231: \ - switch (ch2) { \ - case 769: return 7689; \ - } \ - return 0; \ - case 234: \ - switch (ch2) { \ - case 768: return 7873; \ - case 769: return 7871; \ - case 771: return 7877; \ - case 777: return 7875; \ - } \ - return 0; \ - case 239: \ - switch (ch2) { \ - case 769: return 7727; \ - } \ - return 0; \ - case 244: \ - switch (ch2) { \ - case 768: return 7891; \ - case 769: return 7889; \ - case 771: return 7895; \ - case 777: return 7893; \ - } \ - return 0; \ - case 245: \ - switch (ch2) { \ - case 769: return 7757; \ - case 772: return 557; \ - case 776: return 7759; \ - } \ - return 0; \ - case 246: \ - switch (ch2) { \ - case 772: return 555; \ - } \ - return 0; \ - case 248: \ - switch (ch2) { \ - case 769: return 511; \ - } \ - return 0; \ - case 252: \ - switch (ch2) { \ - case 768: return 476; \ - case 769: return 472; \ - case 772: return 470; \ - case 780: return 474; \ - } \ - return 0; \ -} \ -return 0; \ -case 1: \ -switch (ch1) { \ - case 258: \ - switch (ch2) { \ - case 768: return 7856; \ - case 769: return 7854; \ - case 771: return 7860; \ - case 777: return 7858; \ - } \ - return 0; \ - case 259: \ - switch (ch2) { \ - case 768: return 7857; \ - case 769: return 7855; \ - case 771: return 7861; \ - case 777: return 7859; \ - } \ - return 0; \ - case 274: \ - switch (ch2) { \ - case 768: return 7700; \ - case 769: return 7702; \ - } \ - return 0; \ - case 275: \ - switch (ch2) { \ - case 768: return 7701; \ - case 769: return 7703; \ - } \ - return 0; \ - case 332: \ - switch (ch2) { \ - case 768: return 7760; \ - case 769: return 7762; \ - } \ - return 0; \ - case 333: \ - switch (ch2) { \ - case 768: return 7761; \ - case 769: return 7763; \ - } \ - return 0; \ - case 346: \ - switch (ch2) { \ - case 775: return 7780; \ - } \ - return 0; \ - case 347: \ - switch (ch2) { \ - case 775: return 7781; \ - } \ - return 0; \ - case 352: \ - switch (ch2) { \ - case 775: return 7782; \ - } \ - return 0; \ - case 353: \ - switch (ch2) { \ - case 775: return 7783; \ - } \ - return 0; \ - case 360: \ - switch (ch2) { \ - case 769: return 7800; \ - } \ - return 0; \ - case 361: \ - switch (ch2) { \ - case 769: return 7801; \ - } \ - return 0; \ - case 362: \ - switch (ch2) { \ - case 776: return 7802; \ - } \ - return 0; \ - case 363: \ - switch (ch2) { \ - case 776: return 7803; \ - } \ - return 0; \ - case 383: \ - switch (ch2) { \ - case 775: return 7835; \ - } \ - return 0; \ - case 416: \ - switch (ch2) { \ - case 768: return 7900; \ - case 769: return 7898; \ - case 771: return 7904; \ - case 777: return 7902; \ - case 803: return 7906; \ - } \ - return 0; \ - case 417: \ - switch (ch2) { \ - case 768: return 7901; \ - case 769: return 7899; \ - case 771: return 7905; \ - case 777: return 7903; \ - case 803: return 7907; \ - } \ - return 0; \ - case 431: \ - switch (ch2) { \ - case 768: return 7914; \ - case 769: return 7912; \ - case 771: return 7918; \ - case 777: return 7916; \ - case 803: return 7920; \ - } \ - return 0; \ - case 432: \ - switch (ch2) { \ - case 768: return 7915; \ - case 769: return 7913; \ - case 771: return 7919; \ - case 777: return 7917; \ - case 803: return 7921; \ - } \ - return 0; \ - case 439: \ - switch (ch2) { \ - case 780: return 494; \ - } \ - return 0; \ - case 490: \ - switch (ch2) { \ - case 772: return 492; \ - } \ - return 0; \ - case 491: \ - switch (ch2) { \ - case 772: return 493; \ - } \ - return 0; \ -} \ -return 0; \ -case 2: \ -switch (ch1) { \ - case 550: \ - switch (ch2) { \ - case 772: return 480; \ - } \ - return 0; \ - case 551: \ - switch (ch2) { \ - case 772: return 481; \ - } \ - return 0; \ - case 552: \ - switch (ch2) { \ - case 774: return 7708; \ - } \ - return 0; \ - case 553: \ - switch (ch2) { \ - case 774: return 7709; \ - } \ - return 0; \ - case 558: \ - switch (ch2) { \ - case 772: return 560; \ - } \ - return 0; \ - case 559: \ - switch (ch2) { \ - case 772: return 561; \ - } \ - return 0; \ - case 658: \ - switch (ch2) { \ - case 780: return 495; \ - } \ - return 0; \ -} \ -return 0; \ -case 3: \ -switch (ch1) { \ - case 776: \ - switch (ch2) { \ - case 769: return 836; \ - } \ - return 0; \ - case 913: \ - switch (ch2) { \ - case 768: return 8122; \ - case 769: return 902; \ - case 772: return 8121; \ - case 774: return 8120; \ - case 787: return 7944; \ - case 788: return 7945; \ - case 837: return 8124; \ - } \ - return 0; \ - case 917: \ - switch (ch2) { \ - case 768: return 8136; \ - case 769: return 904; \ - case 787: return 7960; \ - case 788: return 7961; \ - } \ - return 0; \ - case 919: \ - switch (ch2) { \ - case 768: return 8138; \ - case 769: return 905; \ - case 787: return 7976; \ - case 788: return 7977; \ - case 837: return 8140; \ - } \ - return 0; \ - case 921: \ - switch (ch2) { \ - case 768: return 8154; \ - case 769: return 906; \ - case 772: return 8153; \ - case 774: return 8152; \ - case 776: return 938; \ - case 787: return 7992; \ - case 788: return 7993; \ - } \ - return 0; \ - case 927: \ - switch (ch2) { \ - case 768: return 8184; \ - case 769: return 908; \ - case 787: return 8008; \ - case 788: return 8009; \ - } \ - return 0; \ - case 929: \ - switch (ch2) { \ - case 788: return 8172; \ - } \ - return 0; \ - case 933: \ - switch (ch2) { \ - case 768: return 8170; \ - case 769: return 910; \ - case 772: return 8169; \ - case 774: return 8168; \ - case 776: return 939; \ - case 788: return 8025; \ - } \ - return 0; \ - case 937: \ - switch (ch2) { \ - case 768: return 8186; \ - case 769: return 911; \ - case 787: return 8040; \ - case 788: return 8041; \ - case 837: return 8188; \ - } \ - return 0; \ - case 940: \ - switch (ch2) { \ - case 837: return 8116; \ - } \ - return 0; \ - case 942: \ - switch (ch2) { \ - case 837: return 8132; \ - } \ - return 0; \ - case 945: \ - switch (ch2) { \ - case 768: return 8048; \ - case 769: return 940; \ - case 772: return 8113; \ - case 774: return 8112; \ - case 787: return 7936; \ - case 788: return 7937; \ - case 834: return 8118; \ - case 837: return 8115; \ - } \ - return 0; \ - case 949: \ - switch (ch2) { \ - case 768: return 8050; \ - case 769: return 941; \ - case 787: return 7952; \ - case 788: return 7953; \ - } \ - return 0; \ - case 951: \ - switch (ch2) { \ - case 768: return 8052; \ - case 769: return 942; \ - case 787: return 7968; \ - case 788: return 7969; \ - case 834: return 8134; \ - case 837: return 8131; \ - } \ - return 0; \ - case 953: \ - switch (ch2) { \ - case 768: return 8054; \ - case 769: return 943; \ - case 772: return 8145; \ - case 774: return 8144; \ - case 776: return 970; \ - case 787: return 7984; \ - case 788: return 7985; \ - case 834: return 8150; \ - } \ - return 0; \ - case 959: \ - switch (ch2) { \ - case 768: return 8056; \ - case 769: return 972; \ - case 787: return 8000; \ - case 788: return 8001; \ - } \ - return 0; \ - case 961: \ - switch (ch2) { \ - case 787: return 8164; \ - case 788: return 8165; \ - } \ - return 0; \ - case 965: \ - switch (ch2) { \ - case 768: return 8058; \ - case 769: return 973; \ - case 772: return 8161; \ - case 774: return 8160; \ - case 776: return 971; \ - case 787: return 8016; \ - case 788: return 8017; \ - case 834: return 8166; \ - } \ - return 0; \ - case 969: \ - switch (ch2) { \ - case 768: return 8060; \ - case 769: return 974; \ - case 787: return 8032; \ - case 788: return 8033; \ - case 834: return 8182; \ - case 837: return 8179; \ - } \ - return 0; \ - case 970: \ - switch (ch2) { \ - case 768: return 8146; \ - case 769: return 912; \ - case 834: return 8151; \ - } \ - return 0; \ - case 971: \ - switch (ch2) { \ - case 768: return 8162; \ - case 769: return 944; \ - case 834: return 8167; \ - } \ - return 0; \ - case 974: \ - switch (ch2) { \ - case 837: return 8180; \ - } \ - return 0; \ - case 978: \ - switch (ch2) { \ - case 769: return 979; \ - case 776: return 980; \ - } \ - return 0; \ -} \ -return 0; \ -case 4: \ -switch (ch1) { \ - case 1030: \ - switch (ch2) { \ - case 776: return 1031; \ - } \ - return 0; \ - case 1040: \ - switch (ch2) { \ - case 774: return 1232; \ - case 776: return 1234; \ - } \ - return 0; \ - case 1043: \ - switch (ch2) { \ - case 769: return 1027; \ - } \ - return 0; \ - case 1045: \ - switch (ch2) { \ - case 768: return 1024; \ - case 774: return 1238; \ - case 776: return 1025; \ - } \ - return 0; \ - case 1046: \ - switch (ch2) { \ - case 774: return 1217; \ - case 776: return 1244; \ - } \ - return 0; \ - case 1047: \ - switch (ch2) { \ - case 776: return 1246; \ - } \ - return 0; \ - case 1048: \ - switch (ch2) { \ - case 768: return 1037; \ - case 772: return 1250; \ - case 774: return 1049; \ - case 776: return 1252; \ - } \ - return 0; \ - case 1050: \ - switch (ch2) { \ - case 769: return 1036; \ - } \ - return 0; \ - case 1054: \ - switch (ch2) { \ - case 776: return 1254; \ - } \ - return 0; \ - case 1059: \ - switch (ch2) { \ - case 772: return 1262; \ - case 774: return 1038; \ - case 776: return 1264; \ - case 779: return 1266; \ - } \ - return 0; \ - case 1063: \ - switch (ch2) { \ - case 776: return 1268; \ - } \ - return 0; \ - case 1067: \ - switch (ch2) { \ - case 776: return 1272; \ - } \ - return 0; \ - case 1069: \ - switch (ch2) { \ - case 776: return 1260; \ - } \ - return 0; \ - case 1072: \ - switch (ch2) { \ - case 774: return 1233; \ - case 776: return 1235; \ - } \ - return 0; \ - case 1075: \ - switch (ch2) { \ - case 769: return 1107; \ - } \ - return 0; \ - case 1077: \ - switch (ch2) { \ - case 768: return 1104; \ - case 774: return 1239; \ - case 776: return 1105; \ - } \ - return 0; \ - case 1078: \ - switch (ch2) { \ - case 774: return 1218; \ - case 776: return 1245; \ - } \ - return 0; \ - case 1079: \ - switch (ch2) { \ - case 776: return 1247; \ - } \ - return 0; \ - case 1080: \ - switch (ch2) { \ - case 768: return 1117; \ - case 772: return 1251; \ - case 774: return 1081; \ - case 776: return 1253; \ - } \ - return 0; \ - case 1082: \ - switch (ch2) { \ - case 769: return 1116; \ - } \ - return 0; \ - case 1086: \ - switch (ch2) { \ - case 776: return 1255; \ - } \ - return 0; \ - case 1091: \ - switch (ch2) { \ - case 772: return 1263; \ - case 774: return 1118; \ - case 776: return 1265; \ - case 779: return 1267; \ - } \ - return 0; \ - case 1095: \ - switch (ch2) { \ - case 776: return 1269; \ - } \ - return 0; \ - case 1099: \ - switch (ch2) { \ - case 776: return 1273; \ - } \ - return 0; \ - case 1101: \ - switch (ch2) { \ - case 776: return 1261; \ - } \ - return 0; \ - case 1110: \ - switch (ch2) { \ - case 776: return 1111; \ - } \ - return 0; \ - case 1140: \ - switch (ch2) { \ - case 783: return 1142; \ - } \ - return 0; \ - case 1141: \ - switch (ch2) { \ - case 783: return 1143; \ - } \ - return 0; \ - case 1240: \ - switch (ch2) { \ - case 776: return 1242; \ - } \ - return 0; \ - case 1241: \ - switch (ch2) { \ - case 776: return 1243; \ - } \ - return 0; \ - case 1256: \ - switch (ch2) { \ - case 776: return 1258; \ - } \ - return 0; \ - case 1257: \ - switch (ch2) { \ - case 776: return 1259; \ - } \ - return 0; \ -} \ -return 0; \ -case 5: \ -switch (ch1) { \ - case 1488: \ - switch (ch2) { \ - case 1463: return 64302; \ - case 1464: return 64303; \ - case 1468: return 64304; \ - } \ - return 0; \ - case 1489: \ - switch (ch2) { \ - case 1468: return 64305; \ - case 1471: return 64332; \ - } \ - return 0; \ - case 1490: \ - switch (ch2) { \ - case 1468: return 64306; \ - } \ - return 0; \ - case 1491: \ - switch (ch2) { \ - case 1468: return 64307; \ - } \ - return 0; \ - case 1492: \ - switch (ch2) { \ - case 1468: return 64308; \ - } \ - return 0; \ - case 1493: \ - switch (ch2) { \ - case 1465: return 64331; \ - case 1468: return 64309; \ - } \ - return 0; \ - case 1494: \ - switch (ch2) { \ - case 1468: return 64310; \ - } \ - return 0; \ - case 1496: \ - switch (ch2) { \ - case 1468: return 64312; \ - } \ - return 0; \ - case 1497: \ - switch (ch2) { \ - case 1460: return 64285; \ - case 1468: return 64313; \ - } \ - return 0; \ - case 1498: \ - switch (ch2) { \ - case 1468: return 64314; \ - } \ - return 0; \ - case 1499: \ - switch (ch2) { \ - case 1468: return 64315; \ - case 1471: return 64333; \ - } \ - return 0; \ - case 1500: \ - switch (ch2) { \ - case 1468: return 64316; \ - } \ - return 0; \ - case 1502: \ - switch (ch2) { \ - case 1468: return 64318; \ - } \ - return 0; \ - case 1504: \ - switch (ch2) { \ - case 1468: return 64320; \ - } \ - return 0; \ - case 1505: \ - switch (ch2) { \ - case 1468: return 64321; \ - } \ - return 0; \ - case 1507: \ - switch (ch2) { \ - case 1468: return 64323; \ - } \ - return 0; \ - case 1508: \ - switch (ch2) { \ - case 1468: return 64324; \ - case 1471: return 64334; \ - } \ - return 0; \ - case 1510: \ - switch (ch2) { \ - case 1468: return 64326; \ - } \ - return 0; \ - case 1511: \ - switch (ch2) { \ - case 1468: return 64327; \ - } \ - return 0; \ - case 1512: \ - switch (ch2) { \ - case 1468: return 64328; \ - } \ - return 0; \ - case 1513: \ - switch (ch2) { \ - case 1468: return 64329; \ - case 1473: return 64298; \ - case 1474: return 64299; \ - } \ - return 0; \ - case 1514: \ - switch (ch2) { \ - case 1468: return 64330; \ - } \ - return 0; \ - case 1522: \ - switch (ch2) { \ - case 1463: return 64287; \ - } \ - return 0; \ -} \ -return 0; \ -case 6: \ -switch (ch1) { \ - case 1575: \ - switch (ch2) { \ - case 1619: return 1570; \ - case 1620: return 1571; \ - case 1621: return 1573; \ - } \ - return 0; \ - case 1608: \ - switch (ch2) { \ - case 1620: return 1572; \ - } \ - return 0; \ - case 1610: \ - switch (ch2) { \ - case 1620: return 1574; \ - } \ - return 0; \ - case 1729: \ - switch (ch2) { \ - case 1620: return 1730; \ - } \ - return 0; \ - case 1746: \ - switch (ch2) { \ - case 1620: return 1747; \ - } \ - return 0; \ - case 1749: \ - switch (ch2) { \ - case 1620: return 1728; \ - } \ - return 0; \ -} \ -return 0; \ -case 9: \ -switch (ch1) { \ - case 2325: \ - switch (ch2) { \ - case 2364: return 2392; \ - } \ - return 0; \ - case 2326: \ - switch (ch2) { \ - case 2364: return 2393; \ - } \ - return 0; \ - case 2327: \ - switch (ch2) { \ - case 2364: return 2394; \ - } \ - return 0; \ - case 2332: \ - switch (ch2) { \ - case 2364: return 2395; \ - } \ - return 0; \ - case 2337: \ - switch (ch2) { \ - case 2364: return 2396; \ - } \ - return 0; \ - case 2338: \ - switch (ch2) { \ - case 2364: return 2397; \ - } \ - return 0; \ - case 2344: \ - switch (ch2) { \ - case 2364: return 2345; \ - } \ - return 0; \ - case 2347: \ - switch (ch2) { \ - case 2364: return 2398; \ - } \ - return 0; \ - case 2351: \ - switch (ch2) { \ - case 2364: return 2399; \ - } \ - return 0; \ - case 2352: \ - switch (ch2) { \ - case 2364: return 2353; \ - } \ - return 0; \ - case 2355: \ - switch (ch2) { \ - case 2364: return 2356; \ - } \ - return 0; \ - case 2465: \ - switch (ch2) { \ - case 2492: return 2524; \ - } \ - return 0; \ - case 2466: \ - switch (ch2) { \ - case 2492: return 2525; \ - } \ - return 0; \ - case 2479: \ - switch (ch2) { \ - case 2492: return 2527; \ - } \ - return 0; \ - case 2503: \ - switch (ch2) { \ - case 2494: return 2507; \ - case 2519: return 2508; \ - } \ - return 0; \ -} \ -return 0; \ -case 10: \ -switch (ch1) { \ - case 2582: \ - switch (ch2) { \ - case 2620: return 2649; \ - } \ - return 0; \ - case 2583: \ - switch (ch2) { \ - case 2620: return 2650; \ - } \ - return 0; \ - case 2588: \ - switch (ch2) { \ - case 2620: return 2651; \ - } \ - return 0; \ - case 2603: \ - switch (ch2) { \ - case 2620: return 2654; \ - } \ - return 0; \ - case 2610: \ - switch (ch2) { \ - case 2620: return 2611; \ - } \ - return 0; \ - case 2616: \ - switch (ch2) { \ - case 2620: return 2614; \ - } \ - return 0; \ -} \ -return 0; \ -case 11: \ -switch (ch1) { \ - case 2849: \ - switch (ch2) { \ - case 2876: return 2908; \ - } \ - return 0; \ - case 2850: \ - switch (ch2) { \ - case 2876: return 2909; \ - } \ - return 0; \ - case 2887: \ - switch (ch2) { \ - case 2878: return 2891; \ - case 2902: return 2888; \ - case 2903: return 2892; \ - } \ - return 0; \ - case 2962: \ - switch (ch2) { \ - case 3031: return 2964; \ - } \ - return 0; \ - case 3014: \ - switch (ch2) { \ - case 3006: return 3018; \ - case 3031: return 3020; \ - } \ - return 0; \ - case 3015: \ - switch (ch2) { \ - case 3006: return 3019; \ - } \ - return 0; \ -} \ -return 0; \ -case 12: \ -switch (ch1) { \ - case 3142: \ - switch (ch2) { \ - case 3158: return 3144; \ - } \ - return 0; \ - case 3263: \ - switch (ch2) { \ - case 3285: return 3264; \ - } \ - return 0; \ - case 3270: \ - switch (ch2) { \ - case 3266: return 3274; \ - case 3285: return 3271; \ - case 3286: return 3272; \ - } \ - return 0; \ - case 3274: \ - switch (ch2) { \ - case 3285: return 3275; \ - } \ - return 0; \ -} \ -return 0; \ -case 13: \ -switch (ch1) { \ - case 3398: \ - switch (ch2) { \ - case 3390: return 3402; \ - case 3415: return 3404; \ - } \ - return 0; \ - case 3399: \ - switch (ch2) { \ - case 3390: return 3403; \ - } \ - return 0; \ - case 3545: \ - switch (ch2) { \ - case 3530: return 3546; \ - case 3535: return 3548; \ - case 3551: return 3550; \ - } \ - return 0; \ - case 3548: \ - switch (ch2) { \ - case 3530: return 3549; \ - } \ - return 0; \ -} \ -return 0; \ -case 15: \ -switch (ch1) { \ - case 3904: \ - switch (ch2) { \ - case 4021: return 3945; \ - } \ - return 0; \ - case 3906: \ - switch (ch2) { \ - case 4023: return 3907; \ - } \ - return 0; \ - case 3916: \ - switch (ch2) { \ - case 4023: return 3917; \ - } \ - return 0; \ - case 3921: \ - switch (ch2) { \ - case 4023: return 3922; \ - } \ - return 0; \ - case 3926: \ - switch (ch2) { \ - case 4023: return 3927; \ - } \ - return 0; \ - case 3931: \ - switch (ch2) { \ - case 4023: return 3932; \ - } \ - return 0; \ - case 3953: \ - switch (ch2) { \ - case 3954: return 3955; \ - case 3956: return 3957; \ - case 3968: return 3969; \ - } \ - return 0; \ - case 3984: \ - switch (ch2) { \ - case 4021: return 4025; \ - } \ - return 0; \ - case 3986: \ - switch (ch2) { \ - case 4023: return 3987; \ - } \ - return 0; \ - case 3996: \ - switch (ch2) { \ - case 4023: return 3997; \ - } \ - return 0; \ - case 4001: \ - switch (ch2) { \ - case 4023: return 4002; \ - } \ - return 0; \ - case 4006: \ - switch (ch2) { \ - case 4023: return 4007; \ - } \ - return 0; \ - case 4011: \ - switch (ch2) { \ - case 4023: return 4012; \ - } \ - return 0; \ - case 4018: \ - switch (ch2) { \ - case 3968: return 3958; \ - } \ - return 0; \ - case 4019: \ - switch (ch2) { \ - case 3968: return 3960; \ - } \ - return 0; \ -} \ -return 0; \ -case 16: \ -switch (ch1) { \ - case 4133: \ - switch (ch2) { \ - case 4142: return 4134; \ - } \ - return 0; \ -} \ -return 0; \ -case 30: \ -switch (ch1) { \ - case 7734: \ - switch (ch2) { \ - case 772: return 7736; \ - } \ - return 0; \ - case 7735: \ - switch (ch2) { \ - case 772: return 7737; \ - } \ - return 0; \ - case 7770: \ - switch (ch2) { \ - case 772: return 7772; \ - } \ - return 0; \ - case 7771: \ - switch (ch2) { \ - case 772: return 7773; \ - } \ - return 0; \ - case 7778: \ - switch (ch2) { \ - case 775: return 7784; \ - } \ - return 0; \ - case 7779: \ - switch (ch2) { \ - case 775: return 7785; \ - } \ - return 0; \ - case 7840: \ - switch (ch2) { \ - case 770: return 7852; \ - case 774: return 7862; \ - } \ - return 0; \ - case 7841: \ - switch (ch2) { \ - case 770: return 7853; \ - case 774: return 7863; \ - } \ - return 0; \ - case 7864: \ - switch (ch2) { \ - case 770: return 7878; \ - } \ - return 0; \ - case 7865: \ - switch (ch2) { \ - case 770: return 7879; \ - } \ - return 0; \ - case 7884: \ - switch (ch2) { \ - case 770: return 7896; \ - } \ - return 0; \ - case 7885: \ - switch (ch2) { \ - case 770: return 7897; \ - } \ - return 0; \ -} \ -return 0; \ -case 31: \ -switch (ch1) { \ - case 7936: \ - switch (ch2) { \ - case 768: return 7938; \ - case 769: return 7940; \ - case 834: return 7942; \ - case 837: return 8064; \ - } \ - return 0; \ - case 7937: \ - switch (ch2) { \ - case 768: return 7939; \ - case 769: return 7941; \ - case 834: return 7943; \ - case 837: return 8065; \ - } \ - return 0; \ - case 7938: \ - switch (ch2) { \ - case 837: return 8066; \ - } \ - return 0; \ - case 7939: \ - switch (ch2) { \ - case 837: return 8067; \ - } \ - return 0; \ - case 7940: \ - switch (ch2) { \ - case 837: return 8068; \ - } \ - return 0; \ - case 7941: \ - switch (ch2) { \ - case 837: return 8069; \ - } \ - return 0; \ - case 7942: \ - switch (ch2) { \ - case 837: return 8070; \ - } \ - return 0; \ - case 7943: \ - switch (ch2) { \ - case 837: return 8071; \ - } \ - return 0; \ - case 7944: \ - switch (ch2) { \ - case 768: return 7946; \ - case 769: return 7948; \ - case 834: return 7950; \ - case 837: return 8072; \ - } \ - return 0; \ - case 7945: \ - switch (ch2) { \ - case 768: return 7947; \ - case 769: return 7949; \ - case 834: return 7951; \ - case 837: return 8073; \ - } \ - return 0; \ - case 7946: \ - switch (ch2) { \ - case 837: return 8074; \ - } \ - return 0; \ - case 7947: \ - switch (ch2) { \ - case 837: return 8075; \ - } \ - return 0; \ - case 7948: \ - switch (ch2) { \ - case 837: return 8076; \ - } \ - return 0; \ - case 7949: \ - switch (ch2) { \ - case 837: return 8077; \ - } \ - return 0; \ - case 7950: \ - switch (ch2) { \ - case 837: return 8078; \ - } \ - return 0; \ - case 7951: \ - switch (ch2) { \ - case 837: return 8079; \ - } \ - return 0; \ - case 7952: \ - switch (ch2) { \ - case 768: return 7954; \ - case 769: return 7956; \ - } \ - return 0; \ - case 7953: \ - switch (ch2) { \ - case 768: return 7955; \ - case 769: return 7957; \ - } \ - return 0; \ - case 7960: \ - switch (ch2) { \ - case 768: return 7962; \ - case 769: return 7964; \ - } \ - return 0; \ - case 7961: \ - switch (ch2) { \ - case 768: return 7963; \ - case 769: return 7965; \ - } \ - return 0; \ - case 7968: \ - switch (ch2) { \ - case 768: return 7970; \ - case 769: return 7972; \ - case 834: return 7974; \ - case 837: return 8080; \ - } \ - return 0; \ - case 7969: \ - switch (ch2) { \ - case 768: return 7971; \ - case 769: return 7973; \ - case 834: return 7975; \ - case 837: return 8081; \ - } \ - return 0; \ - case 7970: \ - switch (ch2) { \ - case 837: return 8082; \ - } \ - return 0; \ - case 7971: \ - switch (ch2) { \ - case 837: return 8083; \ - } \ - return 0; \ - case 7972: \ - switch (ch2) { \ - case 837: return 8084; \ - } \ - return 0; \ - case 7973: \ - switch (ch2) { \ - case 837: return 8085; \ - } \ - return 0; \ - case 7974: \ - switch (ch2) { \ - case 837: return 8086; \ - } \ - return 0; \ - case 7975: \ - switch (ch2) { \ - case 837: return 8087; \ - } \ - return 0; \ - case 7976: \ - switch (ch2) { \ - case 768: return 7978; \ - case 769: return 7980; \ - case 834: return 7982; \ - case 837: return 8088; \ - } \ - return 0; \ - case 7977: \ - switch (ch2) { \ - case 768: return 7979; \ - case 769: return 7981; \ - case 834: return 7983; \ - case 837: return 8089; \ - } \ - return 0; \ - case 7978: \ - switch (ch2) { \ - case 837: return 8090; \ - } \ - return 0; \ - case 7979: \ - switch (ch2) { \ - case 837: return 8091; \ - } \ - return 0; \ - case 7980: \ - switch (ch2) { \ - case 837: return 8092; \ - } \ - return 0; \ - case 7981: \ - switch (ch2) { \ - case 837: return 8093; \ - } \ - return 0; \ - case 7982: \ - switch (ch2) { \ - case 837: return 8094; \ - } \ - return 0; \ - case 7983: \ - switch (ch2) { \ - case 837: return 8095; \ - } \ - return 0; \ - case 7984: \ - switch (ch2) { \ - case 768: return 7986; \ - case 769: return 7988; \ - case 834: return 7990; \ - } \ - return 0; \ - case 7985: \ - switch (ch2) { \ - case 768: return 7987; \ - case 769: return 7989; \ - case 834: return 7991; \ - } \ - return 0; \ - case 7992: \ - switch (ch2) { \ - case 768: return 7994; \ - case 769: return 7996; \ - case 834: return 7998; \ - } \ - return 0; \ - case 7993: \ - switch (ch2) { \ - case 768: return 7995; \ - case 769: return 7997; \ - case 834: return 7999; \ - } \ - return 0; \ - case 8000: \ - switch (ch2) { \ - case 768: return 8002; \ - case 769: return 8004; \ - } \ - return 0; \ - case 8001: \ - switch (ch2) { \ - case 768: return 8003; \ - case 769: return 8005; \ - } \ - return 0; \ - case 8008: \ - switch (ch2) { \ - case 768: return 8010; \ - case 769: return 8012; \ - } \ - return 0; \ - case 8009: \ - switch (ch2) { \ - case 768: return 8011; \ - case 769: return 8013; \ - } \ - return 0; \ - case 8016: \ - switch (ch2) { \ - case 768: return 8018; \ - case 769: return 8020; \ - case 834: return 8022; \ - } \ - return 0; \ - case 8017: \ - switch (ch2) { \ - case 768: return 8019; \ - case 769: return 8021; \ - case 834: return 8023; \ - } \ - return 0; \ - case 8025: \ - switch (ch2) { \ - case 768: return 8027; \ - case 769: return 8029; \ - case 834: return 8031; \ - } \ - return 0; \ - case 8032: \ - switch (ch2) { \ - case 768: return 8034; \ - case 769: return 8036; \ - case 834: return 8038; \ - case 837: return 8096; \ - } \ - return 0; \ - case 8033: \ - switch (ch2) { \ - case 768: return 8035; \ - case 769: return 8037; \ - case 834: return 8039; \ - case 837: return 8097; \ - } \ - return 0; \ - case 8034: \ - switch (ch2) { \ - case 837: return 8098; \ - } \ - return 0; \ - case 8035: \ - switch (ch2) { \ - case 837: return 8099; \ - } \ - return 0; \ - case 8036: \ - switch (ch2) { \ - case 837: return 8100; \ - } \ - return 0; \ - case 8037: \ - switch (ch2) { \ - case 837: return 8101; \ - } \ - return 0; \ - case 8038: \ - switch (ch2) { \ - case 837: return 8102; \ - } \ - return 0; \ - case 8039: \ - switch (ch2) { \ - case 837: return 8103; \ - } \ - return 0; \ - case 8040: \ - switch (ch2) { \ - case 768: return 8042; \ - case 769: return 8044; \ - case 834: return 8046; \ - case 837: return 8104; \ - } \ - return 0; \ - case 8041: \ - switch (ch2) { \ - case 768: return 8043; \ - case 769: return 8045; \ - case 834: return 8047; \ - case 837: return 8105; \ - } \ - return 0; \ - case 8042: \ - switch (ch2) { \ - case 837: return 8106; \ - } \ - return 0; \ - case 8043: \ - switch (ch2) { \ - case 837: return 8107; \ - } \ - return 0; \ - case 8044: \ - switch (ch2) { \ - case 837: return 8108; \ - } \ - return 0; \ - case 8045: \ - switch (ch2) { \ - case 837: return 8109; \ - } \ - return 0; \ - case 8046: \ - switch (ch2) { \ - case 837: return 8110; \ - } \ - return 0; \ - case 8047: \ - switch (ch2) { \ - case 837: return 8111; \ - } \ - return 0; \ - case 8048: \ - switch (ch2) { \ - case 837: return 8114; \ - } \ - return 0; \ - case 8052: \ - switch (ch2) { \ - case 837: return 8130; \ - } \ - return 0; \ - case 8060: \ - switch (ch2) { \ - case 837: return 8178; \ - } \ - return 0; \ - case 8118: \ - switch (ch2) { \ - case 837: return 8119; \ - } \ - return 0; \ - case 8127: \ - switch (ch2) { \ - case 768: return 8141; \ - case 769: return 8142; \ - case 834: return 8143; \ - } \ - return 0; \ - case 8134: \ - switch (ch2) { \ - case 837: return 8135; \ - } \ - return 0; \ - case 8182: \ - switch (ch2) { \ - case 837: return 8183; \ - } \ - return 0; \ - case 8190: \ - switch (ch2) { \ - case 768: return 8157; \ - case 769: return 8158; \ - case 834: return 8159; \ - } \ - return 0; \ -} \ -return 0; \ -case 33: \ -switch (ch1) { \ - case 8592: \ - switch (ch2) { \ - case 824: return 8602; \ - } \ - return 0; \ - case 8594: \ - switch (ch2) { \ - case 824: return 8603; \ - } \ - return 0; \ - case 8596: \ - switch (ch2) { \ - case 824: return 8622; \ - } \ - return 0; \ - case 8656: \ - switch (ch2) { \ - case 824: return 8653; \ - } \ - return 0; \ - case 8658: \ - switch (ch2) { \ - case 824: return 8655; \ - } \ - return 0; \ - case 8660: \ - switch (ch2) { \ - case 824: return 8654; \ - } \ - return 0; \ -} \ -return 0; \ -case 34: \ -switch (ch1) { \ - case 8707: \ - switch (ch2) { \ - case 824: return 8708; \ - } \ - return 0; \ - case 8712: \ - switch (ch2) { \ - case 824: return 8713; \ - } \ - return 0; \ - case 8715: \ - switch (ch2) { \ - case 824: return 8716; \ - } \ - return 0; \ - case 8739: \ - switch (ch2) { \ - case 824: return 8740; \ - } \ - return 0; \ - case 8741: \ - switch (ch2) { \ - case 824: return 8742; \ - } \ - return 0; \ - case 8764: \ - switch (ch2) { \ - case 824: return 8769; \ - } \ - return 0; \ - case 8771: \ - switch (ch2) { \ - case 824: return 8772; \ - } \ - return 0; \ - case 8773: \ - switch (ch2) { \ - case 824: return 8775; \ - } \ - return 0; \ - case 8776: \ - switch (ch2) { \ - case 824: return 8777; \ - } \ - return 0; \ - case 8781: \ - switch (ch2) { \ - case 824: return 8813; \ - } \ - return 0; \ - case 8801: \ - switch (ch2) { \ - case 824: return 8802; \ - } \ - return 0; \ - case 8804: \ - switch (ch2) { \ - case 824: return 8816; \ - } \ - return 0; \ - case 8805: \ - switch (ch2) { \ - case 824: return 8817; \ - } \ - return 0; \ - case 8818: \ - switch (ch2) { \ - case 824: return 8820; \ - } \ - return 0; \ - case 8819: \ - switch (ch2) { \ - case 824: return 8821; \ - } \ - return 0; \ - case 8822: \ - switch (ch2) { \ - case 824: return 8824; \ - } \ - return 0; \ - case 8823: \ - switch (ch2) { \ - case 824: return 8825; \ - } \ - return 0; \ - case 8826: \ - switch (ch2) { \ - case 824: return 8832; \ - } \ - return 0; \ - case 8827: \ - switch (ch2) { \ - case 824: return 8833; \ - } \ - return 0; \ - case 8828: \ - switch (ch2) { \ - case 824: return 8928; \ - } \ - return 0; \ - case 8829: \ - switch (ch2) { \ - case 824: return 8929; \ - } \ - return 0; \ - case 8834: \ - switch (ch2) { \ - case 824: return 8836; \ - } \ - return 0; \ - case 8835: \ - switch (ch2) { \ - case 824: return 8837; \ - } \ - return 0; \ - case 8838: \ - switch (ch2) { \ - case 824: return 8840; \ - } \ - return 0; \ - case 8839: \ - switch (ch2) { \ - case 824: return 8841; \ - } \ - return 0; \ - case 8849: \ - switch (ch2) { \ - case 824: return 8930; \ - } \ - return 0; \ - case 8850: \ - switch (ch2) { \ - case 824: return 8931; \ - } \ - return 0; \ - case 8866: \ - switch (ch2) { \ - case 824: return 8876; \ - } \ - return 0; \ - case 8872: \ - switch (ch2) { \ - case 824: return 8877; \ - } \ - return 0; \ - case 8873: \ - switch (ch2) { \ - case 824: return 8878; \ - } \ - return 0; \ - case 8875: \ - switch (ch2) { \ - case 824: return 8879; \ - } \ - return 0; \ - case 8882: \ - switch (ch2) { \ - case 824: return 8938; \ - } \ - return 0; \ - case 8883: \ - switch (ch2) { \ - case 824: return 8939; \ - } \ - return 0; \ - case 8884: \ - switch (ch2) { \ - case 824: return 8940; \ - } \ - return 0; \ - case 8885: \ - switch (ch2) { \ - case 824: return 8941; \ - } \ - return 0; \ -} \ -return 0; \ -case 42: \ -switch (ch1) { \ - case 10973: \ - switch (ch2) { \ - case 824: return 10972; \ - } \ - return 0; \ -} \ -return 0; \ -case 48: \ -switch (ch1) { \ - case 12358: \ - switch (ch2) { \ - case 12441: return 12436; \ - } \ - return 0; \ - case 12363: \ - switch (ch2) { \ - case 12441: return 12364; \ - } \ - return 0; \ - case 12365: \ - switch (ch2) { \ - case 12441: return 12366; \ - } \ - return 0; \ - case 12367: \ - switch (ch2) { \ - case 12441: return 12368; \ - } \ - return 0; \ - case 12369: \ - switch (ch2) { \ - case 12441: return 12370; \ - } \ - return 0; \ - case 12371: \ - switch (ch2) { \ - case 12441: return 12372; \ - } \ - return 0; \ - case 12373: \ - switch (ch2) { \ - case 12441: return 12374; \ - } \ - return 0; \ - case 12375: \ - switch (ch2) { \ - case 12441: return 12376; \ - } \ - return 0; \ - case 12377: \ - switch (ch2) { \ - case 12441: return 12378; \ - } \ - return 0; \ - case 12379: \ - switch (ch2) { \ - case 12441: return 12380; \ - } \ - return 0; \ - case 12381: \ - switch (ch2) { \ - case 12441: return 12382; \ - } \ - return 0; \ - case 12383: \ - switch (ch2) { \ - case 12441: return 12384; \ - } \ - return 0; \ - case 12385: \ - switch (ch2) { \ - case 12441: return 12386; \ - } \ - return 0; \ - case 12388: \ - switch (ch2) { \ - case 12441: return 12389; \ - } \ - return 0; \ - case 12390: \ - switch (ch2) { \ - case 12441: return 12391; \ - } \ - return 0; \ - case 12392: \ - switch (ch2) { \ - case 12441: return 12393; \ - } \ - return 0; \ - case 12399: \ - switch (ch2) { \ - case 12441: return 12400; \ - case 12442: return 12401; \ - } \ - return 0; \ - case 12402: \ - switch (ch2) { \ - case 12441: return 12403; \ - case 12442: return 12404; \ - } \ - return 0; \ - case 12405: \ - switch (ch2) { \ - case 12441: return 12406; \ - case 12442: return 12407; \ - } \ - return 0; \ - case 12408: \ - switch (ch2) { \ - case 12441: return 12409; \ - case 12442: return 12410; \ - } \ - return 0; \ - case 12411: \ - switch (ch2) { \ - case 12441: return 12412; \ - case 12442: return 12413; \ - } \ - return 0; \ - case 12445: \ - switch (ch2) { \ - case 12441: return 12446; \ - } \ - return 0; \ - case 12454: \ - switch (ch2) { \ - case 12441: return 12532; \ - } \ - return 0; \ - case 12459: \ - switch (ch2) { \ - case 12441: return 12460; \ - } \ - return 0; \ - case 12461: \ - switch (ch2) { \ - case 12441: return 12462; \ - } \ - return 0; \ - case 12463: \ - switch (ch2) { \ - case 12441: return 12464; \ - } \ - return 0; \ - case 12465: \ - switch (ch2) { \ - case 12441: return 12466; \ - } \ - return 0; \ - case 12467: \ - switch (ch2) { \ - case 12441: return 12468; \ - } \ - return 0; \ - case 12469: \ - switch (ch2) { \ - case 12441: return 12470; \ - } \ - return 0; \ - case 12471: \ - switch (ch2) { \ - case 12441: return 12472; \ - } \ - return 0; \ - case 12473: \ - switch (ch2) { \ - case 12441: return 12474; \ - } \ - return 0; \ - case 12475: \ - switch (ch2) { \ - case 12441: return 12476; \ - } \ - return 0; \ - case 12477: \ - switch (ch2) { \ - case 12441: return 12478; \ - } \ - return 0; \ - case 12479: \ - switch (ch2) { \ - case 12441: return 12480; \ - } \ - return 0; \ - case 12481: \ - switch (ch2) { \ - case 12441: return 12482; \ - } \ - return 0; \ - case 12484: \ - switch (ch2) { \ - case 12441: return 12485; \ - } \ - return 0; \ - case 12486: \ - switch (ch2) { \ - case 12441: return 12487; \ - } \ - return 0; \ - case 12488: \ - switch (ch2) { \ - case 12441: return 12489; \ - } \ - return 0; \ - case 12495: \ - switch (ch2) { \ - case 12441: return 12496; \ - case 12442: return 12497; \ - } \ - return 0; \ - case 12498: \ - switch (ch2) { \ - case 12441: return 12499; \ - case 12442: return 12500; \ - } \ - return 0; \ - case 12501: \ - switch (ch2) { \ - case 12441: return 12502; \ - case 12442: return 12503; \ - } \ - return 0; \ - case 12504: \ - switch (ch2) { \ - case 12441: return 12505; \ - case 12442: return 12506; \ - } \ - return 0; \ - case 12507: \ - switch (ch2) { \ - case 12441: return 12508; \ - case 12442: return 12509; \ - } \ - return 0; \ - case 12527: \ - switch (ch2) { \ - case 12441: return 12535; \ - } \ - return 0; \ - case 12528: \ - switch (ch2) { \ - case 12441: return 12536; \ - } \ - return 0; \ - case 12529: \ - switch (ch2) { \ - case 12441: return 12537; \ - } \ - return 0; \ - case 12530: \ - switch (ch2) { \ - case 12441: return 12538; \ - } \ - return 0; \ - case 12541: \ - switch (ch2) { \ - case 12441: return 12542; \ - } \ - return 0; \ -} \ -return 0; \ -case 251: \ -switch (ch1) { \ - case 64329: \ - switch (ch2) { \ - case 1473: return 64300; \ - case 1474: return 64301; \ - } \ - return 0; \ -} \ -return 0; \ -case 465: \ -switch (ch1) { \ - case 119127: \ - switch (ch2) { \ - case 119141: return 119134; \ - } \ - return 0; \ - case 119128: \ - switch (ch2) { \ - case 119141: return 119135; \ - } \ - return 0; \ - case 119135: \ - switch (ch2) { \ - case 119150: return 119136; \ - case 119151: return 119137; \ - case 119152: return 119138; \ - case 119153: return 119139; \ - case 119154: return 119140; \ - } \ - return 0; \ - case 119225: \ - switch (ch2) { \ - case 119141: return 119227; \ - } \ - return 0; \ - case 119226: \ - switch (ch2) { \ - case 119141: return 119228; \ - } \ - return 0; \ - case 119227: \ - switch (ch2) { \ - case 119150: return 119229; \ - case 119151: return 119231; \ - } \ - return 0; \ - case 119228: \ - switch (ch2) { \ - case 119150: return 119230; \ - case 119151: return 119232; \ - } \ - return 0; \ -} \ -return 0; \ -} \ -return 0; + switch ((glui32)(ch1) >> 8) { \ + case 0: \ + switch (ch1) { \ + case 60: \ + switch (ch2) { \ + case 824: return 8814; \ + } \ + return 0; \ + case 61: \ + switch (ch2) { \ + case 824: return 8800; \ + } \ + return 0; \ + case 62: \ + switch (ch2) { \ + case 824: return 8815; \ + } \ + return 0; \ + case 65: \ + switch (ch2) { \ + case 768: return 192; \ + case 769: return 193; \ + case 770: return 194; \ + case 771: return 195; \ + case 772: return 256; \ + case 774: return 258; \ + case 775: return 550; \ + case 776: return 196; \ + case 777: return 7842; \ + case 778: return 197; \ + case 780: return 461; \ + case 783: return 512; \ + case 785: return 514; \ + case 803: return 7840; \ + case 805: return 7680; \ + case 808: return 260; \ + } \ + return 0; \ + case 66: \ + switch (ch2) { \ + case 775: return 7682; \ + case 803: return 7684; \ + case 817: return 7686; \ + } \ + return 0; \ + case 67: \ + switch (ch2) { \ + case 769: return 262; \ + case 770: return 264; \ + case 775: return 266; \ + case 780: return 268; \ + case 807: return 199; \ + } \ + return 0; \ + case 68: \ + switch (ch2) { \ + case 775: return 7690; \ + case 780: return 270; \ + case 803: return 7692; \ + case 807: return 7696; \ + case 813: return 7698; \ + case 817: return 7694; \ + } \ + return 0; \ + case 69: \ + switch (ch2) { \ + case 768: return 200; \ + case 769: return 201; \ + case 770: return 202; \ + case 771: return 7868; \ + case 772: return 274; \ + case 774: return 276; \ + case 775: return 278; \ + case 776: return 203; \ + case 777: return 7866; \ + case 780: return 282; \ + case 783: return 516; \ + case 785: return 518; \ + case 803: return 7864; \ + case 807: return 552; \ + case 808: return 280; \ + case 813: return 7704; \ + case 816: return 7706; \ + } \ + return 0; \ + case 70: \ + switch (ch2) { \ + case 775: return 7710; \ + } \ + return 0; \ + case 71: \ + switch (ch2) { \ + case 769: return 500; \ + case 770: return 284; \ + case 772: return 7712; \ + case 774: return 286; \ + case 775: return 288; \ + case 780: return 486; \ + case 807: return 290; \ + } \ + return 0; \ + case 72: \ + switch (ch2) { \ + case 770: return 292; \ + case 775: return 7714; \ + case 776: return 7718; \ + case 780: return 542; \ + case 803: return 7716; \ + case 807: return 7720; \ + case 814: return 7722; \ + } \ + return 0; \ + case 73: \ + switch (ch2) { \ + case 768: return 204; \ + case 769: return 205; \ + case 770: return 206; \ + case 771: return 296; \ + case 772: return 298; \ + case 774: return 300; \ + case 775: return 304; \ + case 776: return 207; \ + case 777: return 7880; \ + case 780: return 463; \ + case 783: return 520; \ + case 785: return 522; \ + case 803: return 7882; \ + case 808: return 302; \ + case 816: return 7724; \ + } \ + return 0; \ + case 74: \ + switch (ch2) { \ + case 770: return 308; \ + } \ + return 0; \ + case 75: \ + switch (ch2) { \ + case 769: return 7728; \ + case 780: return 488; \ + case 803: return 7730; \ + case 807: return 310; \ + case 817: return 7732; \ + } \ + return 0; \ + case 76: \ + switch (ch2) { \ + case 769: return 313; \ + case 780: return 317; \ + case 803: return 7734; \ + case 807: return 315; \ + case 813: return 7740; \ + case 817: return 7738; \ + } \ + return 0; \ + case 77: \ + switch (ch2) { \ + case 769: return 7742; \ + case 775: return 7744; \ + case 803: return 7746; \ + } \ + return 0; \ + case 78: \ + switch (ch2) { \ + case 768: return 504; \ + case 769: return 323; \ + case 771: return 209; \ + case 775: return 7748; \ + case 780: return 327; \ + case 803: return 7750; \ + case 807: return 325; \ + case 813: return 7754; \ + case 817: return 7752; \ + } \ + return 0; \ + case 79: \ + switch (ch2) { \ + case 768: return 210; \ + case 769: return 211; \ + case 770: return 212; \ + case 771: return 213; \ + case 772: return 332; \ + case 774: return 334; \ + case 775: return 558; \ + case 776: return 214; \ + case 777: return 7886; \ + case 779: return 336; \ + case 780: return 465; \ + case 783: return 524; \ + case 785: return 526; \ + case 795: return 416; \ + case 803: return 7884; \ + case 808: return 490; \ + } \ + return 0; \ + case 80: \ + switch (ch2) { \ + case 769: return 7764; \ + case 775: return 7766; \ + } \ + return 0; \ + case 82: \ + switch (ch2) { \ + case 769: return 340; \ + case 775: return 7768; \ + case 780: return 344; \ + case 783: return 528; \ + case 785: return 530; \ + case 803: return 7770; \ + case 807: return 342; \ + case 817: return 7774; \ + } \ + return 0; \ + case 83: \ + switch (ch2) { \ + case 769: return 346; \ + case 770: return 348; \ + case 775: return 7776; \ + case 780: return 352; \ + case 803: return 7778; \ + case 806: return 536; \ + case 807: return 350; \ + } \ + return 0; \ + case 84: \ + switch (ch2) { \ + case 775: return 7786; \ + case 780: return 356; \ + case 803: return 7788; \ + case 806: return 538; \ + case 807: return 354; \ + case 813: return 7792; \ + case 817: return 7790; \ + } \ + return 0; \ + case 85: \ + switch (ch2) { \ + case 768: return 217; \ + case 769: return 218; \ + case 770: return 219; \ + case 771: return 360; \ + case 772: return 362; \ + case 774: return 364; \ + case 776: return 220; \ + case 777: return 7910; \ + case 778: return 366; \ + case 779: return 368; \ + case 780: return 467; \ + case 783: return 532; \ + case 785: return 534; \ + case 795: return 431; \ + case 803: return 7908; \ + case 804: return 7794; \ + case 808: return 370; \ + case 813: return 7798; \ + case 816: return 7796; \ + } \ + return 0; \ + case 86: \ + switch (ch2) { \ + case 771: return 7804; \ + case 803: return 7806; \ + } \ + return 0; \ + case 87: \ + switch (ch2) { \ + case 768: return 7808; \ + case 769: return 7810; \ + case 770: return 372; \ + case 775: return 7814; \ + case 776: return 7812; \ + case 803: return 7816; \ + } \ + return 0; \ + case 88: \ + switch (ch2) { \ + case 775: return 7818; \ + case 776: return 7820; \ + } \ + return 0; \ + case 89: \ + switch (ch2) { \ + case 768: return 7922; \ + case 769: return 221; \ + case 770: return 374; \ + case 771: return 7928; \ + case 772: return 562; \ + case 775: return 7822; \ + case 776: return 376; \ + case 777: return 7926; \ + case 803: return 7924; \ + } \ + return 0; \ + case 90: \ + switch (ch2) { \ + case 769: return 377; \ + case 770: return 7824; \ + case 775: return 379; \ + case 780: return 381; \ + case 803: return 7826; \ + case 817: return 7828; \ + } \ + return 0; \ + case 97: \ + switch (ch2) { \ + case 768: return 224; \ + case 769: return 225; \ + case 770: return 226; \ + case 771: return 227; \ + case 772: return 257; \ + case 774: return 259; \ + case 775: return 551; \ + case 776: return 228; \ + case 777: return 7843; \ + case 778: return 229; \ + case 780: return 462; \ + case 783: return 513; \ + case 785: return 515; \ + case 803: return 7841; \ + case 805: return 7681; \ + case 808: return 261; \ + } \ + return 0; \ + case 98: \ + switch (ch2) { \ + case 775: return 7683; \ + case 803: return 7685; \ + case 817: return 7687; \ + } \ + return 0; \ + case 99: \ + switch (ch2) { \ + case 769: return 263; \ + case 770: return 265; \ + case 775: return 267; \ + case 780: return 269; \ + case 807: return 231; \ + } \ + return 0; \ + case 100: \ + switch (ch2) { \ + case 775: return 7691; \ + case 780: return 271; \ + case 803: return 7693; \ + case 807: return 7697; \ + case 813: return 7699; \ + case 817: return 7695; \ + } \ + return 0; \ + case 101: \ + switch (ch2) { \ + case 768: return 232; \ + case 769: return 233; \ + case 770: return 234; \ + case 771: return 7869; \ + case 772: return 275; \ + case 774: return 277; \ + case 775: return 279; \ + case 776: return 235; \ + case 777: return 7867; \ + case 780: return 283; \ + case 783: return 517; \ + case 785: return 519; \ + case 803: return 7865; \ + case 807: return 553; \ + case 808: return 281; \ + case 813: return 7705; \ + case 816: return 7707; \ + } \ + return 0; \ + case 102: \ + switch (ch2) { \ + case 775: return 7711; \ + } \ + return 0; \ + case 103: \ + switch (ch2) { \ + case 769: return 501; \ + case 770: return 285; \ + case 772: return 7713; \ + case 774: return 287; \ + case 775: return 289; \ + case 780: return 487; \ + case 807: return 291; \ + } \ + return 0; \ + case 104: \ + switch (ch2) { \ + case 770: return 293; \ + case 775: return 7715; \ + case 776: return 7719; \ + case 780: return 543; \ + case 803: return 7717; \ + case 807: return 7721; \ + case 814: return 7723; \ + case 817: return 7830; \ + } \ + return 0; \ + case 105: \ + switch (ch2) { \ + case 768: return 236; \ + case 769: return 237; \ + case 770: return 238; \ + case 771: return 297; \ + case 772: return 299; \ + case 774: return 301; \ + case 776: return 239; \ + case 777: return 7881; \ + case 780: return 464; \ + case 783: return 521; \ + case 785: return 523; \ + case 803: return 7883; \ + case 808: return 303; \ + case 816: return 7725; \ + } \ + return 0; \ + case 106: \ + switch (ch2) { \ + case 770: return 309; \ + case 780: return 496; \ + } \ + return 0; \ + case 107: \ + switch (ch2) { \ + case 769: return 7729; \ + case 780: return 489; \ + case 803: return 7731; \ + case 807: return 311; \ + case 817: return 7733; \ + } \ + return 0; \ + case 108: \ + switch (ch2) { \ + case 769: return 314; \ + case 780: return 318; \ + case 803: return 7735; \ + case 807: return 316; \ + case 813: return 7741; \ + case 817: return 7739; \ + } \ + return 0; \ + case 109: \ + switch (ch2) { \ + case 769: return 7743; \ + case 775: return 7745; \ + case 803: return 7747; \ + } \ + return 0; \ + case 110: \ + switch (ch2) { \ + case 768: return 505; \ + case 769: return 324; \ + case 771: return 241; \ + case 775: return 7749; \ + case 780: return 328; \ + case 803: return 7751; \ + case 807: return 326; \ + case 813: return 7755; \ + case 817: return 7753; \ + } \ + return 0; \ + case 111: \ + switch (ch2) { \ + case 768: return 242; \ + case 769: return 243; \ + case 770: return 244; \ + case 771: return 245; \ + case 772: return 333; \ + case 774: return 335; \ + case 775: return 559; \ + case 776: return 246; \ + case 777: return 7887; \ + case 779: return 337; \ + case 780: return 466; \ + case 783: return 525; \ + case 785: return 527; \ + case 795: return 417; \ + case 803: return 7885; \ + case 808: return 491; \ + } \ + return 0; \ + case 112: \ + switch (ch2) { \ + case 769: return 7765; \ + case 775: return 7767; \ + } \ + return 0; \ + case 114: \ + switch (ch2) { \ + case 769: return 341; \ + case 775: return 7769; \ + case 780: return 345; \ + case 783: return 529; \ + case 785: return 531; \ + case 803: return 7771; \ + case 807: return 343; \ + case 817: return 7775; \ + } \ + return 0; \ + case 115: \ + switch (ch2) { \ + case 769: return 347; \ + case 770: return 349; \ + case 775: return 7777; \ + case 780: return 353; \ + case 803: return 7779; \ + case 806: return 537; \ + case 807: return 351; \ + } \ + return 0; \ + case 116: \ + switch (ch2) { \ + case 775: return 7787; \ + case 776: return 7831; \ + case 780: return 357; \ + case 803: return 7789; \ + case 806: return 539; \ + case 807: return 355; \ + case 813: return 7793; \ + case 817: return 7791; \ + } \ + return 0; \ + case 117: \ + switch (ch2) { \ + case 768: return 249; \ + case 769: return 250; \ + case 770: return 251; \ + case 771: return 361; \ + case 772: return 363; \ + case 774: return 365; \ + case 776: return 252; \ + case 777: return 7911; \ + case 778: return 367; \ + case 779: return 369; \ + case 780: return 468; \ + case 783: return 533; \ + case 785: return 535; \ + case 795: return 432; \ + case 803: return 7909; \ + case 804: return 7795; \ + case 808: return 371; \ + case 813: return 7799; \ + case 816: return 7797; \ + } \ + return 0; \ + case 118: \ + switch (ch2) { \ + case 771: return 7805; \ + case 803: return 7807; \ + } \ + return 0; \ + case 119: \ + switch (ch2) { \ + case 768: return 7809; \ + case 769: return 7811; \ + case 770: return 373; \ + case 775: return 7815; \ + case 776: return 7813; \ + case 778: return 7832; \ + case 803: return 7817; \ + } \ + return 0; \ + case 120: \ + switch (ch2) { \ + case 775: return 7819; \ + case 776: return 7821; \ + } \ + return 0; \ + case 121: \ + switch (ch2) { \ + case 768: return 7923; \ + case 769: return 253; \ + case 770: return 375; \ + case 771: return 7929; \ + case 772: return 563; \ + case 775: return 7823; \ + case 776: return 255; \ + case 777: return 7927; \ + case 778: return 7833; \ + case 803: return 7925; \ + } \ + return 0; \ + case 122: \ + switch (ch2) { \ + case 769: return 378; \ + case 770: return 7825; \ + case 775: return 380; \ + case 780: return 382; \ + case 803: return 7827; \ + case 817: return 7829; \ + } \ + return 0; \ + case 168: \ + switch (ch2) { \ + case 768: return 8173; \ + case 769: return 901; \ + case 834: return 8129; \ + } \ + return 0; \ + case 194: \ + switch (ch2) { \ + case 768: return 7846; \ + case 769: return 7844; \ + case 771: return 7850; \ + case 777: return 7848; \ + } \ + return 0; \ + case 196: \ + switch (ch2) { \ + case 772: return 478; \ + } \ + return 0; \ + case 197: \ + switch (ch2) { \ + case 769: return 506; \ + } \ + return 0; \ + case 198: \ + switch (ch2) { \ + case 769: return 508; \ + case 772: return 482; \ + } \ + return 0; \ + case 199: \ + switch (ch2) { \ + case 769: return 7688; \ + } \ + return 0; \ + case 202: \ + switch (ch2) { \ + case 768: return 7872; \ + case 769: return 7870; \ + case 771: return 7876; \ + case 777: return 7874; \ + } \ + return 0; \ + case 207: \ + switch (ch2) { \ + case 769: return 7726; \ + } \ + return 0; \ + case 212: \ + switch (ch2) { \ + case 768: return 7890; \ + case 769: return 7888; \ + case 771: return 7894; \ + case 777: return 7892; \ + } \ + return 0; \ + case 213: \ + switch (ch2) { \ + case 769: return 7756; \ + case 772: return 556; \ + case 776: return 7758; \ + } \ + return 0; \ + case 214: \ + switch (ch2) { \ + case 772: return 554; \ + } \ + return 0; \ + case 216: \ + switch (ch2) { \ + case 769: return 510; \ + } \ + return 0; \ + case 220: \ + switch (ch2) { \ + case 768: return 475; \ + case 769: return 471; \ + case 772: return 469; \ + case 780: return 473; \ + } \ + return 0; \ + case 226: \ + switch (ch2) { \ + case 768: return 7847; \ + case 769: return 7845; \ + case 771: return 7851; \ + case 777: return 7849; \ + } \ + return 0; \ + case 228: \ + switch (ch2) { \ + case 772: return 479; \ + } \ + return 0; \ + case 229: \ + switch (ch2) { \ + case 769: return 507; \ + } \ + return 0; \ + case 230: \ + switch (ch2) { \ + case 769: return 509; \ + case 772: return 483; \ + } \ + return 0; \ + case 231: \ + switch (ch2) { \ + case 769: return 7689; \ + } \ + return 0; \ + case 234: \ + switch (ch2) { \ + case 768: return 7873; \ + case 769: return 7871; \ + case 771: return 7877; \ + case 777: return 7875; \ + } \ + return 0; \ + case 239: \ + switch (ch2) { \ + case 769: return 7727; \ + } \ + return 0; \ + case 244: \ + switch (ch2) { \ + case 768: return 7891; \ + case 769: return 7889; \ + case 771: return 7895; \ + case 777: return 7893; \ + } \ + return 0; \ + case 245: \ + switch (ch2) { \ + case 769: return 7757; \ + case 772: return 557; \ + case 776: return 7759; \ + } \ + return 0; \ + case 246: \ + switch (ch2) { \ + case 772: return 555; \ + } \ + return 0; \ + case 248: \ + switch (ch2) { \ + case 769: return 511; \ + } \ + return 0; \ + case 252: \ + switch (ch2) { \ + case 768: return 476; \ + case 769: return 472; \ + case 772: return 470; \ + case 780: return 474; \ + } \ + return 0; \ + } \ + return 0; \ + case 1: \ + switch (ch1) { \ + case 258: \ + switch (ch2) { \ + case 768: return 7856; \ + case 769: return 7854; \ + case 771: return 7860; \ + case 777: return 7858; \ + } \ + return 0; \ + case 259: \ + switch (ch2) { \ + case 768: return 7857; \ + case 769: return 7855; \ + case 771: return 7861; \ + case 777: return 7859; \ + } \ + return 0; \ + case 274: \ + switch (ch2) { \ + case 768: return 7700; \ + case 769: return 7702; \ + } \ + return 0; \ + case 275: \ + switch (ch2) { \ + case 768: return 7701; \ + case 769: return 7703; \ + } \ + return 0; \ + case 332: \ + switch (ch2) { \ + case 768: return 7760; \ + case 769: return 7762; \ + } \ + return 0; \ + case 333: \ + switch (ch2) { \ + case 768: return 7761; \ + case 769: return 7763; \ + } \ + return 0; \ + case 346: \ + switch (ch2) { \ + case 775: return 7780; \ + } \ + return 0; \ + case 347: \ + switch (ch2) { \ + case 775: return 7781; \ + } \ + return 0; \ + case 352: \ + switch (ch2) { \ + case 775: return 7782; \ + } \ + return 0; \ + case 353: \ + switch (ch2) { \ + case 775: return 7783; \ + } \ + return 0; \ + case 360: \ + switch (ch2) { \ + case 769: return 7800; \ + } \ + return 0; \ + case 361: \ + switch (ch2) { \ + case 769: return 7801; \ + } \ + return 0; \ + case 362: \ + switch (ch2) { \ + case 776: return 7802; \ + } \ + return 0; \ + case 363: \ + switch (ch2) { \ + case 776: return 7803; \ + } \ + return 0; \ + case 383: \ + switch (ch2) { \ + case 775: return 7835; \ + } \ + return 0; \ + case 416: \ + switch (ch2) { \ + case 768: return 7900; \ + case 769: return 7898; \ + case 771: return 7904; \ + case 777: return 7902; \ + case 803: return 7906; \ + } \ + return 0; \ + case 417: \ + switch (ch2) { \ + case 768: return 7901; \ + case 769: return 7899; \ + case 771: return 7905; \ + case 777: return 7903; \ + case 803: return 7907; \ + } \ + return 0; \ + case 431: \ + switch (ch2) { \ + case 768: return 7914; \ + case 769: return 7912; \ + case 771: return 7918; \ + case 777: return 7916; \ + case 803: return 7920; \ + } \ + return 0; \ + case 432: \ + switch (ch2) { \ + case 768: return 7915; \ + case 769: return 7913; \ + case 771: return 7919; \ + case 777: return 7917; \ + case 803: return 7921; \ + } \ + return 0; \ + case 439: \ + switch (ch2) { \ + case 780: return 494; \ + } \ + return 0; \ + case 490: \ + switch (ch2) { \ + case 772: return 492; \ + } \ + return 0; \ + case 491: \ + switch (ch2) { \ + case 772: return 493; \ + } \ + return 0; \ + } \ + return 0; \ + case 2: \ + switch (ch1) { \ + case 550: \ + switch (ch2) { \ + case 772: return 480; \ + } \ + return 0; \ + case 551: \ + switch (ch2) { \ + case 772: return 481; \ + } \ + return 0; \ + case 552: \ + switch (ch2) { \ + case 774: return 7708; \ + } \ + return 0; \ + case 553: \ + switch (ch2) { \ + case 774: return 7709; \ + } \ + return 0; \ + case 558: \ + switch (ch2) { \ + case 772: return 560; \ + } \ + return 0; \ + case 559: \ + switch (ch2) { \ + case 772: return 561; \ + } \ + return 0; \ + case 658: \ + switch (ch2) { \ + case 780: return 495; \ + } \ + return 0; \ + } \ + return 0; \ + case 3: \ + switch (ch1) { \ + case 776: \ + switch (ch2) { \ + case 769: return 836; \ + } \ + return 0; \ + case 913: \ + switch (ch2) { \ + case 768: return 8122; \ + case 769: return 902; \ + case 772: return 8121; \ + case 774: return 8120; \ + case 787: return 7944; \ + case 788: return 7945; \ + case 837: return 8124; \ + } \ + return 0; \ + case 917: \ + switch (ch2) { \ + case 768: return 8136; \ + case 769: return 904; \ + case 787: return 7960; \ + case 788: return 7961; \ + } \ + return 0; \ + case 919: \ + switch (ch2) { \ + case 768: return 8138; \ + case 769: return 905; \ + case 787: return 7976; \ + case 788: return 7977; \ + case 837: return 8140; \ + } \ + return 0; \ + case 921: \ + switch (ch2) { \ + case 768: return 8154; \ + case 769: return 906; \ + case 772: return 8153; \ + case 774: return 8152; \ + case 776: return 938; \ + case 787: return 7992; \ + case 788: return 7993; \ + } \ + return 0; \ + case 927: \ + switch (ch2) { \ + case 768: return 8184; \ + case 769: return 908; \ + case 787: return 8008; \ + case 788: return 8009; \ + } \ + return 0; \ + case 929: \ + switch (ch2) { \ + case 788: return 8172; \ + } \ + return 0; \ + case 933: \ + switch (ch2) { \ + case 768: return 8170; \ + case 769: return 910; \ + case 772: return 8169; \ + case 774: return 8168; \ + case 776: return 939; \ + case 788: return 8025; \ + } \ + return 0; \ + case 937: \ + switch (ch2) { \ + case 768: return 8186; \ + case 769: return 911; \ + case 787: return 8040; \ + case 788: return 8041; \ + case 837: return 8188; \ + } \ + return 0; \ + case 940: \ + switch (ch2) { \ + case 837: return 8116; \ + } \ + return 0; \ + case 942: \ + switch (ch2) { \ + case 837: return 8132; \ + } \ + return 0; \ + case 945: \ + switch (ch2) { \ + case 768: return 8048; \ + case 769: return 940; \ + case 772: return 8113; \ + case 774: return 8112; \ + case 787: return 7936; \ + case 788: return 7937; \ + case 834: return 8118; \ + case 837: return 8115; \ + } \ + return 0; \ + case 949: \ + switch (ch2) { \ + case 768: return 8050; \ + case 769: return 941; \ + case 787: return 7952; \ + case 788: return 7953; \ + } \ + return 0; \ + case 951: \ + switch (ch2) { \ + case 768: return 8052; \ + case 769: return 942; \ + case 787: return 7968; \ + case 788: return 7969; \ + case 834: return 8134; \ + case 837: return 8131; \ + } \ + return 0; \ + case 953: \ + switch (ch2) { \ + case 768: return 8054; \ + case 769: return 943; \ + case 772: return 8145; \ + case 774: return 8144; \ + case 776: return 970; \ + case 787: return 7984; \ + case 788: return 7985; \ + case 834: return 8150; \ + } \ + return 0; \ + case 959: \ + switch (ch2) { \ + case 768: return 8056; \ + case 769: return 972; \ + case 787: return 8000; \ + case 788: return 8001; \ + } \ + return 0; \ + case 961: \ + switch (ch2) { \ + case 787: return 8164; \ + case 788: return 8165; \ + } \ + return 0; \ + case 965: \ + switch (ch2) { \ + case 768: return 8058; \ + case 769: return 973; \ + case 772: return 8161; \ + case 774: return 8160; \ + case 776: return 971; \ + case 787: return 8016; \ + case 788: return 8017; \ + case 834: return 8166; \ + } \ + return 0; \ + case 969: \ + switch (ch2) { \ + case 768: return 8060; \ + case 769: return 974; \ + case 787: return 8032; \ + case 788: return 8033; \ + case 834: return 8182; \ + case 837: return 8179; \ + } \ + return 0; \ + case 970: \ + switch (ch2) { \ + case 768: return 8146; \ + case 769: return 912; \ + case 834: return 8151; \ + } \ + return 0; \ + case 971: \ + switch (ch2) { \ + case 768: return 8162; \ + case 769: return 944; \ + case 834: return 8167; \ + } \ + return 0; \ + case 974: \ + switch (ch2) { \ + case 837: return 8180; \ + } \ + return 0; \ + case 978: \ + switch (ch2) { \ + case 769: return 979; \ + case 776: return 980; \ + } \ + return 0; \ + } \ + return 0; \ + case 4: \ + switch (ch1) { \ + case 1030: \ + switch (ch2) { \ + case 776: return 1031; \ + } \ + return 0; \ + case 1040: \ + switch (ch2) { \ + case 774: return 1232; \ + case 776: return 1234; \ + } \ + return 0; \ + case 1043: \ + switch (ch2) { \ + case 769: return 1027; \ + } \ + return 0; \ + case 1045: \ + switch (ch2) { \ + case 768: return 1024; \ + case 774: return 1238; \ + case 776: return 1025; \ + } \ + return 0; \ + case 1046: \ + switch (ch2) { \ + case 774: return 1217; \ + case 776: return 1244; \ + } \ + return 0; \ + case 1047: \ + switch (ch2) { \ + case 776: return 1246; \ + } \ + return 0; \ + case 1048: \ + switch (ch2) { \ + case 768: return 1037; \ + case 772: return 1250; \ + case 774: return 1049; \ + case 776: return 1252; \ + } \ + return 0; \ + case 1050: \ + switch (ch2) { \ + case 769: return 1036; \ + } \ + return 0; \ + case 1054: \ + switch (ch2) { \ + case 776: return 1254; \ + } \ + return 0; \ + case 1059: \ + switch (ch2) { \ + case 772: return 1262; \ + case 774: return 1038; \ + case 776: return 1264; \ + case 779: return 1266; \ + } \ + return 0; \ + case 1063: \ + switch (ch2) { \ + case 776: return 1268; \ + } \ + return 0; \ + case 1067: \ + switch (ch2) { \ + case 776: return 1272; \ + } \ + return 0; \ + case 1069: \ + switch (ch2) { \ + case 776: return 1260; \ + } \ + return 0; \ + case 1072: \ + switch (ch2) { \ + case 774: return 1233; \ + case 776: return 1235; \ + } \ + return 0; \ + case 1075: \ + switch (ch2) { \ + case 769: return 1107; \ + } \ + return 0; \ + case 1077: \ + switch (ch2) { \ + case 768: return 1104; \ + case 774: return 1239; \ + case 776: return 1105; \ + } \ + return 0; \ + case 1078: \ + switch (ch2) { \ + case 774: return 1218; \ + case 776: return 1245; \ + } \ + return 0; \ + case 1079: \ + switch (ch2) { \ + case 776: return 1247; \ + } \ + return 0; \ + case 1080: \ + switch (ch2) { \ + case 768: return 1117; \ + case 772: return 1251; \ + case 774: return 1081; \ + case 776: return 1253; \ + } \ + return 0; \ + case 1082: \ + switch (ch2) { \ + case 769: return 1116; \ + } \ + return 0; \ + case 1086: \ + switch (ch2) { \ + case 776: return 1255; \ + } \ + return 0; \ + case 1091: \ + switch (ch2) { \ + case 772: return 1263; \ + case 774: return 1118; \ + case 776: return 1265; \ + case 779: return 1267; \ + } \ + return 0; \ + case 1095: \ + switch (ch2) { \ + case 776: return 1269; \ + } \ + return 0; \ + case 1099: \ + switch (ch2) { \ + case 776: return 1273; \ + } \ + return 0; \ + case 1101: \ + switch (ch2) { \ + case 776: return 1261; \ + } \ + return 0; \ + case 1110: \ + switch (ch2) { \ + case 776: return 1111; \ + } \ + return 0; \ + case 1140: \ + switch (ch2) { \ + case 783: return 1142; \ + } \ + return 0; \ + case 1141: \ + switch (ch2) { \ + case 783: return 1143; \ + } \ + return 0; \ + case 1240: \ + switch (ch2) { \ + case 776: return 1242; \ + } \ + return 0; \ + case 1241: \ + switch (ch2) { \ + case 776: return 1243; \ + } \ + return 0; \ + case 1256: \ + switch (ch2) { \ + case 776: return 1258; \ + } \ + return 0; \ + case 1257: \ + switch (ch2) { \ + case 776: return 1259; \ + } \ + return 0; \ + } \ + return 0; \ + case 5: \ + switch (ch1) { \ + case 1488: \ + switch (ch2) { \ + case 1463: return 64302; \ + case 1464: return 64303; \ + case 1468: return 64304; \ + } \ + return 0; \ + case 1489: \ + switch (ch2) { \ + case 1468: return 64305; \ + case 1471: return 64332; \ + } \ + return 0; \ + case 1490: \ + switch (ch2) { \ + case 1468: return 64306; \ + } \ + return 0; \ + case 1491: \ + switch (ch2) { \ + case 1468: return 64307; \ + } \ + return 0; \ + case 1492: \ + switch (ch2) { \ + case 1468: return 64308; \ + } \ + return 0; \ + case 1493: \ + switch (ch2) { \ + case 1465: return 64331; \ + case 1468: return 64309; \ + } \ + return 0; \ + case 1494: \ + switch (ch2) { \ + case 1468: return 64310; \ + } \ + return 0; \ + case 1496: \ + switch (ch2) { \ + case 1468: return 64312; \ + } \ + return 0; \ + case 1497: \ + switch (ch2) { \ + case 1460: return 64285; \ + case 1468: return 64313; \ + } \ + return 0; \ + case 1498: \ + switch (ch2) { \ + case 1468: return 64314; \ + } \ + return 0; \ + case 1499: \ + switch (ch2) { \ + case 1468: return 64315; \ + case 1471: return 64333; \ + } \ + return 0; \ + case 1500: \ + switch (ch2) { \ + case 1468: return 64316; \ + } \ + return 0; \ + case 1502: \ + switch (ch2) { \ + case 1468: return 64318; \ + } \ + return 0; \ + case 1504: \ + switch (ch2) { \ + case 1468: return 64320; \ + } \ + return 0; \ + case 1505: \ + switch (ch2) { \ + case 1468: return 64321; \ + } \ + return 0; \ + case 1507: \ + switch (ch2) { \ + case 1468: return 64323; \ + } \ + return 0; \ + case 1508: \ + switch (ch2) { \ + case 1468: return 64324; \ + case 1471: return 64334; \ + } \ + return 0; \ + case 1510: \ + switch (ch2) { \ + case 1468: return 64326; \ + } \ + return 0; \ + case 1511: \ + switch (ch2) { \ + case 1468: return 64327; \ + } \ + return 0; \ + case 1512: \ + switch (ch2) { \ + case 1468: return 64328; \ + } \ + return 0; \ + case 1513: \ + switch (ch2) { \ + case 1468: return 64329; \ + case 1473: return 64298; \ + case 1474: return 64299; \ + } \ + return 0; \ + case 1514: \ + switch (ch2) { \ + case 1468: return 64330; \ + } \ + return 0; \ + case 1522: \ + switch (ch2) { \ + case 1463: return 64287; \ + } \ + return 0; \ + } \ + return 0; \ + case 6: \ + switch (ch1) { \ + case 1575: \ + switch (ch2) { \ + case 1619: return 1570; \ + case 1620: return 1571; \ + case 1621: return 1573; \ + } \ + return 0; \ + case 1608: \ + switch (ch2) { \ + case 1620: return 1572; \ + } \ + return 0; \ + case 1610: \ + switch (ch2) { \ + case 1620: return 1574; \ + } \ + return 0; \ + case 1729: \ + switch (ch2) { \ + case 1620: return 1730; \ + } \ + return 0; \ + case 1746: \ + switch (ch2) { \ + case 1620: return 1747; \ + } \ + return 0; \ + case 1749: \ + switch (ch2) { \ + case 1620: return 1728; \ + } \ + return 0; \ + } \ + return 0; \ + case 9: \ + switch (ch1) { \ + case 2325: \ + switch (ch2) { \ + case 2364: return 2392; \ + } \ + return 0; \ + case 2326: \ + switch (ch2) { \ + case 2364: return 2393; \ + } \ + return 0; \ + case 2327: \ + switch (ch2) { \ + case 2364: return 2394; \ + } \ + return 0; \ + case 2332: \ + switch (ch2) { \ + case 2364: return 2395; \ + } \ + return 0; \ + case 2337: \ + switch (ch2) { \ + case 2364: return 2396; \ + } \ + return 0; \ + case 2338: \ + switch (ch2) { \ + case 2364: return 2397; \ + } \ + return 0; \ + case 2344: \ + switch (ch2) { \ + case 2364: return 2345; \ + } \ + return 0; \ + case 2347: \ + switch (ch2) { \ + case 2364: return 2398; \ + } \ + return 0; \ + case 2351: \ + switch (ch2) { \ + case 2364: return 2399; \ + } \ + return 0; \ + case 2352: \ + switch (ch2) { \ + case 2364: return 2353; \ + } \ + return 0; \ + case 2355: \ + switch (ch2) { \ + case 2364: return 2356; \ + } \ + return 0; \ + case 2465: \ + switch (ch2) { \ + case 2492: return 2524; \ + } \ + return 0; \ + case 2466: \ + switch (ch2) { \ + case 2492: return 2525; \ + } \ + return 0; \ + case 2479: \ + switch (ch2) { \ + case 2492: return 2527; \ + } \ + return 0; \ + case 2503: \ + switch (ch2) { \ + case 2494: return 2507; \ + case 2519: return 2508; \ + } \ + return 0; \ + } \ + return 0; \ + case 10: \ + switch (ch1) { \ + case 2582: \ + switch (ch2) { \ + case 2620: return 2649; \ + } \ + return 0; \ + case 2583: \ + switch (ch2) { \ + case 2620: return 2650; \ + } \ + return 0; \ + case 2588: \ + switch (ch2) { \ + case 2620: return 2651; \ + } \ + return 0; \ + case 2603: \ + switch (ch2) { \ + case 2620: return 2654; \ + } \ + return 0; \ + case 2610: \ + switch (ch2) { \ + case 2620: return 2611; \ + } \ + return 0; \ + case 2616: \ + switch (ch2) { \ + case 2620: return 2614; \ + } \ + return 0; \ + } \ + return 0; \ + case 11: \ + switch (ch1) { \ + case 2849: \ + switch (ch2) { \ + case 2876: return 2908; \ + } \ + return 0; \ + case 2850: \ + switch (ch2) { \ + case 2876: return 2909; \ + } \ + return 0; \ + case 2887: \ + switch (ch2) { \ + case 2878: return 2891; \ + case 2902: return 2888; \ + case 2903: return 2892; \ + } \ + return 0; \ + case 2962: \ + switch (ch2) { \ + case 3031: return 2964; \ + } \ + return 0; \ + case 3014: \ + switch (ch2) { \ + case 3006: return 3018; \ + case 3031: return 3020; \ + } \ + return 0; \ + case 3015: \ + switch (ch2) { \ + case 3006: return 3019; \ + } \ + return 0; \ + } \ + return 0; \ + case 12: \ + switch (ch1) { \ + case 3142: \ + switch (ch2) { \ + case 3158: return 3144; \ + } \ + return 0; \ + case 3263: \ + switch (ch2) { \ + case 3285: return 3264; \ + } \ + return 0; \ + case 3270: \ + switch (ch2) { \ + case 3266: return 3274; \ + case 3285: return 3271; \ + case 3286: return 3272; \ + } \ + return 0; \ + case 3274: \ + switch (ch2) { \ + case 3285: return 3275; \ + } \ + return 0; \ + } \ + return 0; \ + case 13: \ + switch (ch1) { \ + case 3398: \ + switch (ch2) { \ + case 3390: return 3402; \ + case 3415: return 3404; \ + } \ + return 0; \ + case 3399: \ + switch (ch2) { \ + case 3390: return 3403; \ + } \ + return 0; \ + case 3545: \ + switch (ch2) { \ + case 3530: return 3546; \ + case 3535: return 3548; \ + case 3551: return 3550; \ + } \ + return 0; \ + case 3548: \ + switch (ch2) { \ + case 3530: return 3549; \ + } \ + return 0; \ + } \ + return 0; \ + case 15: \ + switch (ch1) { \ + case 3904: \ + switch (ch2) { \ + case 4021: return 3945; \ + } \ + return 0; \ + case 3906: \ + switch (ch2) { \ + case 4023: return 3907; \ + } \ + return 0; \ + case 3916: \ + switch (ch2) { \ + case 4023: return 3917; \ + } \ + return 0; \ + case 3921: \ + switch (ch2) { \ + case 4023: return 3922; \ + } \ + return 0; \ + case 3926: \ + switch (ch2) { \ + case 4023: return 3927; \ + } \ + return 0; \ + case 3931: \ + switch (ch2) { \ + case 4023: return 3932; \ + } \ + return 0; \ + case 3953: \ + switch (ch2) { \ + case 3954: return 3955; \ + case 3956: return 3957; \ + case 3968: return 3969; \ + } \ + return 0; \ + case 3984: \ + switch (ch2) { \ + case 4021: return 4025; \ + } \ + return 0; \ + case 3986: \ + switch (ch2) { \ + case 4023: return 3987; \ + } \ + return 0; \ + case 3996: \ + switch (ch2) { \ + case 4023: return 3997; \ + } \ + return 0; \ + case 4001: \ + switch (ch2) { \ + case 4023: return 4002; \ + } \ + return 0; \ + case 4006: \ + switch (ch2) { \ + case 4023: return 4007; \ + } \ + return 0; \ + case 4011: \ + switch (ch2) { \ + case 4023: return 4012; \ + } \ + return 0; \ + case 4018: \ + switch (ch2) { \ + case 3968: return 3958; \ + } \ + return 0; \ + case 4019: \ + switch (ch2) { \ + case 3968: return 3960; \ + } \ + return 0; \ + } \ + return 0; \ + case 16: \ + switch (ch1) { \ + case 4133: \ + switch (ch2) { \ + case 4142: return 4134; \ + } \ + return 0; \ + } \ + return 0; \ + case 30: \ + switch (ch1) { \ + case 7734: \ + switch (ch2) { \ + case 772: return 7736; \ + } \ + return 0; \ + case 7735: \ + switch (ch2) { \ + case 772: return 7737; \ + } \ + return 0; \ + case 7770: \ + switch (ch2) { \ + case 772: return 7772; \ + } \ + return 0; \ + case 7771: \ + switch (ch2) { \ + case 772: return 7773; \ + } \ + return 0; \ + case 7778: \ + switch (ch2) { \ + case 775: return 7784; \ + } \ + return 0; \ + case 7779: \ + switch (ch2) { \ + case 775: return 7785; \ + } \ + return 0; \ + case 7840: \ + switch (ch2) { \ + case 770: return 7852; \ + case 774: return 7862; \ + } \ + return 0; \ + case 7841: \ + switch (ch2) { \ + case 770: return 7853; \ + case 774: return 7863; \ + } \ + return 0; \ + case 7864: \ + switch (ch2) { \ + case 770: return 7878; \ + } \ + return 0; \ + case 7865: \ + switch (ch2) { \ + case 770: return 7879; \ + } \ + return 0; \ + case 7884: \ + switch (ch2) { \ + case 770: return 7896; \ + } \ + return 0; \ + case 7885: \ + switch (ch2) { \ + case 770: return 7897; \ + } \ + return 0; \ + } \ + return 0; \ + case 31: \ + switch (ch1) { \ + case 7936: \ + switch (ch2) { \ + case 768: return 7938; \ + case 769: return 7940; \ + case 834: return 7942; \ + case 837: return 8064; \ + } \ + return 0; \ + case 7937: \ + switch (ch2) { \ + case 768: return 7939; \ + case 769: return 7941; \ + case 834: return 7943; \ + case 837: return 8065; \ + } \ + return 0; \ + case 7938: \ + switch (ch2) { \ + case 837: return 8066; \ + } \ + return 0; \ + case 7939: \ + switch (ch2) { \ + case 837: return 8067; \ + } \ + return 0; \ + case 7940: \ + switch (ch2) { \ + case 837: return 8068; \ + } \ + return 0; \ + case 7941: \ + switch (ch2) { \ + case 837: return 8069; \ + } \ + return 0; \ + case 7942: \ + switch (ch2) { \ + case 837: return 8070; \ + } \ + return 0; \ + case 7943: \ + switch (ch2) { \ + case 837: return 8071; \ + } \ + return 0; \ + case 7944: \ + switch (ch2) { \ + case 768: return 7946; \ + case 769: return 7948; \ + case 834: return 7950; \ + case 837: return 8072; \ + } \ + return 0; \ + case 7945: \ + switch (ch2) { \ + case 768: return 7947; \ + case 769: return 7949; \ + case 834: return 7951; \ + case 837: return 8073; \ + } \ + return 0; \ + case 7946: \ + switch (ch2) { \ + case 837: return 8074; \ + } \ + return 0; \ + case 7947: \ + switch (ch2) { \ + case 837: return 8075; \ + } \ + return 0; \ + case 7948: \ + switch (ch2) { \ + case 837: return 8076; \ + } \ + return 0; \ + case 7949: \ + switch (ch2) { \ + case 837: return 8077; \ + } \ + return 0; \ + case 7950: \ + switch (ch2) { \ + case 837: return 8078; \ + } \ + return 0; \ + case 7951: \ + switch (ch2) { \ + case 837: return 8079; \ + } \ + return 0; \ + case 7952: \ + switch (ch2) { \ + case 768: return 7954; \ + case 769: return 7956; \ + } \ + return 0; \ + case 7953: \ + switch (ch2) { \ + case 768: return 7955; \ + case 769: return 7957; \ + } \ + return 0; \ + case 7960: \ + switch (ch2) { \ + case 768: return 7962; \ + case 769: return 7964; \ + } \ + return 0; \ + case 7961: \ + switch (ch2) { \ + case 768: return 7963; \ + case 769: return 7965; \ + } \ + return 0; \ + case 7968: \ + switch (ch2) { \ + case 768: return 7970; \ + case 769: return 7972; \ + case 834: return 7974; \ + case 837: return 8080; \ + } \ + return 0; \ + case 7969: \ + switch (ch2) { \ + case 768: return 7971; \ + case 769: return 7973; \ + case 834: return 7975; \ + case 837: return 8081; \ + } \ + return 0; \ + case 7970: \ + switch (ch2) { \ + case 837: return 8082; \ + } \ + return 0; \ + case 7971: \ + switch (ch2) { \ + case 837: return 8083; \ + } \ + return 0; \ + case 7972: \ + switch (ch2) { \ + case 837: return 8084; \ + } \ + return 0; \ + case 7973: \ + switch (ch2) { \ + case 837: return 8085; \ + } \ + return 0; \ + case 7974: \ + switch (ch2) { \ + case 837: return 8086; \ + } \ + return 0; \ + case 7975: \ + switch (ch2) { \ + case 837: return 8087; \ + } \ + return 0; \ + case 7976: \ + switch (ch2) { \ + case 768: return 7978; \ + case 769: return 7980; \ + case 834: return 7982; \ + case 837: return 8088; \ + } \ + return 0; \ + case 7977: \ + switch (ch2) { \ + case 768: return 7979; \ + case 769: return 7981; \ + case 834: return 7983; \ + case 837: return 8089; \ + } \ + return 0; \ + case 7978: \ + switch (ch2) { \ + case 837: return 8090; \ + } \ + return 0; \ + case 7979: \ + switch (ch2) { \ + case 837: return 8091; \ + } \ + return 0; \ + case 7980: \ + switch (ch2) { \ + case 837: return 8092; \ + } \ + return 0; \ + case 7981: \ + switch (ch2) { \ + case 837: return 8093; \ + } \ + return 0; \ + case 7982: \ + switch (ch2) { \ + case 837: return 8094; \ + } \ + return 0; \ + case 7983: \ + switch (ch2) { \ + case 837: return 8095; \ + } \ + return 0; \ + case 7984: \ + switch (ch2) { \ + case 768: return 7986; \ + case 769: return 7988; \ + case 834: return 7990; \ + } \ + return 0; \ + case 7985: \ + switch (ch2) { \ + case 768: return 7987; \ + case 769: return 7989; \ + case 834: return 7991; \ + } \ + return 0; \ + case 7992: \ + switch (ch2) { \ + case 768: return 7994; \ + case 769: return 7996; \ + case 834: return 7998; \ + } \ + return 0; \ + case 7993: \ + switch (ch2) { \ + case 768: return 7995; \ + case 769: return 7997; \ + case 834: return 7999; \ + } \ + return 0; \ + case 8000: \ + switch (ch2) { \ + case 768: return 8002; \ + case 769: return 8004; \ + } \ + return 0; \ + case 8001: \ + switch (ch2) { \ + case 768: return 8003; \ + case 769: return 8005; \ + } \ + return 0; \ + case 8008: \ + switch (ch2) { \ + case 768: return 8010; \ + case 769: return 8012; \ + } \ + return 0; \ + case 8009: \ + switch (ch2) { \ + case 768: return 8011; \ + case 769: return 8013; \ + } \ + return 0; \ + case 8016: \ + switch (ch2) { \ + case 768: return 8018; \ + case 769: return 8020; \ + case 834: return 8022; \ + } \ + return 0; \ + case 8017: \ + switch (ch2) { \ + case 768: return 8019; \ + case 769: return 8021; \ + case 834: return 8023; \ + } \ + return 0; \ + case 8025: \ + switch (ch2) { \ + case 768: return 8027; \ + case 769: return 8029; \ + case 834: return 8031; \ + } \ + return 0; \ + case 8032: \ + switch (ch2) { \ + case 768: return 8034; \ + case 769: return 8036; \ + case 834: return 8038; \ + case 837: return 8096; \ + } \ + return 0; \ + case 8033: \ + switch (ch2) { \ + case 768: return 8035; \ + case 769: return 8037; \ + case 834: return 8039; \ + case 837: return 8097; \ + } \ + return 0; \ + case 8034: \ + switch (ch2) { \ + case 837: return 8098; \ + } \ + return 0; \ + case 8035: \ + switch (ch2) { \ + case 837: return 8099; \ + } \ + return 0; \ + case 8036: \ + switch (ch2) { \ + case 837: return 8100; \ + } \ + return 0; \ + case 8037: \ + switch (ch2) { \ + case 837: return 8101; \ + } \ + return 0; \ + case 8038: \ + switch (ch2) { \ + case 837: return 8102; \ + } \ + return 0; \ + case 8039: \ + switch (ch2) { \ + case 837: return 8103; \ + } \ + return 0; \ + case 8040: \ + switch (ch2) { \ + case 768: return 8042; \ + case 769: return 8044; \ + case 834: return 8046; \ + case 837: return 8104; \ + } \ + return 0; \ + case 8041: \ + switch (ch2) { \ + case 768: return 8043; \ + case 769: return 8045; \ + case 834: return 8047; \ + case 837: return 8105; \ + } \ + return 0; \ + case 8042: \ + switch (ch2) { \ + case 837: return 8106; \ + } \ + return 0; \ + case 8043: \ + switch (ch2) { \ + case 837: return 8107; \ + } \ + return 0; \ + case 8044: \ + switch (ch2) { \ + case 837: return 8108; \ + } \ + return 0; \ + case 8045: \ + switch (ch2) { \ + case 837: return 8109; \ + } \ + return 0; \ + case 8046: \ + switch (ch2) { \ + case 837: return 8110; \ + } \ + return 0; \ + case 8047: \ + switch (ch2) { \ + case 837: return 8111; \ + } \ + return 0; \ + case 8048: \ + switch (ch2) { \ + case 837: return 8114; \ + } \ + return 0; \ + case 8052: \ + switch (ch2) { \ + case 837: return 8130; \ + } \ + return 0; \ + case 8060: \ + switch (ch2) { \ + case 837: return 8178; \ + } \ + return 0; \ + case 8118: \ + switch (ch2) { \ + case 837: return 8119; \ + } \ + return 0; \ + case 8127: \ + switch (ch2) { \ + case 768: return 8141; \ + case 769: return 8142; \ + case 834: return 8143; \ + } \ + return 0; \ + case 8134: \ + switch (ch2) { \ + case 837: return 8135; \ + } \ + return 0; \ + case 8182: \ + switch (ch2) { \ + case 837: return 8183; \ + } \ + return 0; \ + case 8190: \ + switch (ch2) { \ + case 768: return 8157; \ + case 769: return 8158; \ + case 834: return 8159; \ + } \ + return 0; \ + } \ + return 0; \ + case 33: \ + switch (ch1) { \ + case 8592: \ + switch (ch2) { \ + case 824: return 8602; \ + } \ + return 0; \ + case 8594: \ + switch (ch2) { \ + case 824: return 8603; \ + } \ + return 0; \ + case 8596: \ + switch (ch2) { \ + case 824: return 8622; \ + } \ + return 0; \ + case 8656: \ + switch (ch2) { \ + case 824: return 8653; \ + } \ + return 0; \ + case 8658: \ + switch (ch2) { \ + case 824: return 8655; \ + } \ + return 0; \ + case 8660: \ + switch (ch2) { \ + case 824: return 8654; \ + } \ + return 0; \ + } \ + return 0; \ + case 34: \ + switch (ch1) { \ + case 8707: \ + switch (ch2) { \ + case 824: return 8708; \ + } \ + return 0; \ + case 8712: \ + switch (ch2) { \ + case 824: return 8713; \ + } \ + return 0; \ + case 8715: \ + switch (ch2) { \ + case 824: return 8716; \ + } \ + return 0; \ + case 8739: \ + switch (ch2) { \ + case 824: return 8740; \ + } \ + return 0; \ + case 8741: \ + switch (ch2) { \ + case 824: return 8742; \ + } \ + return 0; \ + case 8764: \ + switch (ch2) { \ + case 824: return 8769; \ + } \ + return 0; \ + case 8771: \ + switch (ch2) { \ + case 824: return 8772; \ + } \ + return 0; \ + case 8773: \ + switch (ch2) { \ + case 824: return 8775; \ + } \ + return 0; \ + case 8776: \ + switch (ch2) { \ + case 824: return 8777; \ + } \ + return 0; \ + case 8781: \ + switch (ch2) { \ + case 824: return 8813; \ + } \ + return 0; \ + case 8801: \ + switch (ch2) { \ + case 824: return 8802; \ + } \ + return 0; \ + case 8804: \ + switch (ch2) { \ + case 824: return 8816; \ + } \ + return 0; \ + case 8805: \ + switch (ch2) { \ + case 824: return 8817; \ + } \ + return 0; \ + case 8818: \ + switch (ch2) { \ + case 824: return 8820; \ + } \ + return 0; \ + case 8819: \ + switch (ch2) { \ + case 824: return 8821; \ + } \ + return 0; \ + case 8822: \ + switch (ch2) { \ + case 824: return 8824; \ + } \ + return 0; \ + case 8823: \ + switch (ch2) { \ + case 824: return 8825; \ + } \ + return 0; \ + case 8826: \ + switch (ch2) { \ + case 824: return 8832; \ + } \ + return 0; \ + case 8827: \ + switch (ch2) { \ + case 824: return 8833; \ + } \ + return 0; \ + case 8828: \ + switch (ch2) { \ + case 824: return 8928; \ + } \ + return 0; \ + case 8829: \ + switch (ch2) { \ + case 824: return 8929; \ + } \ + return 0; \ + case 8834: \ + switch (ch2) { \ + case 824: return 8836; \ + } \ + return 0; \ + case 8835: \ + switch (ch2) { \ + case 824: return 8837; \ + } \ + return 0; \ + case 8838: \ + switch (ch2) { \ + case 824: return 8840; \ + } \ + return 0; \ + case 8839: \ + switch (ch2) { \ + case 824: return 8841; \ + } \ + return 0; \ + case 8849: \ + switch (ch2) { \ + case 824: return 8930; \ + } \ + return 0; \ + case 8850: \ + switch (ch2) { \ + case 824: return 8931; \ + } \ + return 0; \ + case 8866: \ + switch (ch2) { \ + case 824: return 8876; \ + } \ + return 0; \ + case 8872: \ + switch (ch2) { \ + case 824: return 8877; \ + } \ + return 0; \ + case 8873: \ + switch (ch2) { \ + case 824: return 8878; \ + } \ + return 0; \ + case 8875: \ + switch (ch2) { \ + case 824: return 8879; \ + } \ + return 0; \ + case 8882: \ + switch (ch2) { \ + case 824: return 8938; \ + } \ + return 0; \ + case 8883: \ + switch (ch2) { \ + case 824: return 8939; \ + } \ + return 0; \ + case 8884: \ + switch (ch2) { \ + case 824: return 8940; \ + } \ + return 0; \ + case 8885: \ + switch (ch2) { \ + case 824: return 8941; \ + } \ + return 0; \ + } \ + return 0; \ + case 42: \ + switch (ch1) { \ + case 10973: \ + switch (ch2) { \ + case 824: return 10972; \ + } \ + return 0; \ + } \ + return 0; \ + case 48: \ + switch (ch1) { \ + case 12358: \ + switch (ch2) { \ + case 12441: return 12436; \ + } \ + return 0; \ + case 12363: \ + switch (ch2) { \ + case 12441: return 12364; \ + } \ + return 0; \ + case 12365: \ + switch (ch2) { \ + case 12441: return 12366; \ + } \ + return 0; \ + case 12367: \ + switch (ch2) { \ + case 12441: return 12368; \ + } \ + return 0; \ + case 12369: \ + switch (ch2) { \ + case 12441: return 12370; \ + } \ + return 0; \ + case 12371: \ + switch (ch2) { \ + case 12441: return 12372; \ + } \ + return 0; \ + case 12373: \ + switch (ch2) { \ + case 12441: return 12374; \ + } \ + return 0; \ + case 12375: \ + switch (ch2) { \ + case 12441: return 12376; \ + } \ + return 0; \ + case 12377: \ + switch (ch2) { \ + case 12441: return 12378; \ + } \ + return 0; \ + case 12379: \ + switch (ch2) { \ + case 12441: return 12380; \ + } \ + return 0; \ + case 12381: \ + switch (ch2) { \ + case 12441: return 12382; \ + } \ + return 0; \ + case 12383: \ + switch (ch2) { \ + case 12441: return 12384; \ + } \ + return 0; \ + case 12385: \ + switch (ch2) { \ + case 12441: return 12386; \ + } \ + return 0; \ + case 12388: \ + switch (ch2) { \ + case 12441: return 12389; \ + } \ + return 0; \ + case 12390: \ + switch (ch2) { \ + case 12441: return 12391; \ + } \ + return 0; \ + case 12392: \ + switch (ch2) { \ + case 12441: return 12393; \ + } \ + return 0; \ + case 12399: \ + switch (ch2) { \ + case 12441: return 12400; \ + case 12442: return 12401; \ + } \ + return 0; \ + case 12402: \ + switch (ch2) { \ + case 12441: return 12403; \ + case 12442: return 12404; \ + } \ + return 0; \ + case 12405: \ + switch (ch2) { \ + case 12441: return 12406; \ + case 12442: return 12407; \ + } \ + return 0; \ + case 12408: \ + switch (ch2) { \ + case 12441: return 12409; \ + case 12442: return 12410; \ + } \ + return 0; \ + case 12411: \ + switch (ch2) { \ + case 12441: return 12412; \ + case 12442: return 12413; \ + } \ + return 0; \ + case 12445: \ + switch (ch2) { \ + case 12441: return 12446; \ + } \ + return 0; \ + case 12454: \ + switch (ch2) { \ + case 12441: return 12532; \ + } \ + return 0; \ + case 12459: \ + switch (ch2) { \ + case 12441: return 12460; \ + } \ + return 0; \ + case 12461: \ + switch (ch2) { \ + case 12441: return 12462; \ + } \ + return 0; \ + case 12463: \ + switch (ch2) { \ + case 12441: return 12464; \ + } \ + return 0; \ + case 12465: \ + switch (ch2) { \ + case 12441: return 12466; \ + } \ + return 0; \ + case 12467: \ + switch (ch2) { \ + case 12441: return 12468; \ + } \ + return 0; \ + case 12469: \ + switch (ch2) { \ + case 12441: return 12470; \ + } \ + return 0; \ + case 12471: \ + switch (ch2) { \ + case 12441: return 12472; \ + } \ + return 0; \ + case 12473: \ + switch (ch2) { \ + case 12441: return 12474; \ + } \ + return 0; \ + case 12475: \ + switch (ch2) { \ + case 12441: return 12476; \ + } \ + return 0; \ + case 12477: \ + switch (ch2) { \ + case 12441: return 12478; \ + } \ + return 0; \ + case 12479: \ + switch (ch2) { \ + case 12441: return 12480; \ + } \ + return 0; \ + case 12481: \ + switch (ch2) { \ + case 12441: return 12482; \ + } \ + return 0; \ + case 12484: \ + switch (ch2) { \ + case 12441: return 12485; \ + } \ + return 0; \ + case 12486: \ + switch (ch2) { \ + case 12441: return 12487; \ + } \ + return 0; \ + case 12488: \ + switch (ch2) { \ + case 12441: return 12489; \ + } \ + return 0; \ + case 12495: \ + switch (ch2) { \ + case 12441: return 12496; \ + case 12442: return 12497; \ + } \ + return 0; \ + case 12498: \ + switch (ch2) { \ + case 12441: return 12499; \ + case 12442: return 12500; \ + } \ + return 0; \ + case 12501: \ + switch (ch2) { \ + case 12441: return 12502; \ + case 12442: return 12503; \ + } \ + return 0; \ + case 12504: \ + switch (ch2) { \ + case 12441: return 12505; \ + case 12442: return 12506; \ + } \ + return 0; \ + case 12507: \ + switch (ch2) { \ + case 12441: return 12508; \ + case 12442: return 12509; \ + } \ + return 0; \ + case 12527: \ + switch (ch2) { \ + case 12441: return 12535; \ + } \ + return 0; \ + case 12528: \ + switch (ch2) { \ + case 12441: return 12536; \ + } \ + return 0; \ + case 12529: \ + switch (ch2) { \ + case 12441: return 12537; \ + } \ + return 0; \ + case 12530: \ + switch (ch2) { \ + case 12441: return 12538; \ + } \ + return 0; \ + case 12541: \ + switch (ch2) { \ + case 12441: return 12542; \ + } \ + return 0; \ + } \ + return 0; \ + case 251: \ + switch (ch1) { \ + case 64329: \ + switch (ch2) { \ + case 1473: return 64300; \ + case 1474: return 64301; \ + } \ + return 0; \ + } \ + return 0; \ + case 465: \ + switch (ch1) { \ + case 119127: \ + switch (ch2) { \ + case 119141: return 119134; \ + } \ + return 0; \ + case 119128: \ + switch (ch2) { \ + case 119141: return 119135; \ + } \ + return 0; \ + case 119135: \ + switch (ch2) { \ + case 119150: return 119136; \ + case 119151: return 119137; \ + case 119152: return 119138; \ + case 119153: return 119139; \ + case 119154: return 119140; \ + } \ + return 0; \ + case 119225: \ + switch (ch2) { \ + case 119141: return 119227; \ + } \ + return 0; \ + case 119226: \ + switch (ch2) { \ + case 119141: return 119228; \ + } \ + return 0; \ + case 119227: \ + switch (ch2) { \ + case 119150: return 119229; \ + case 119151: return 119231; \ + } \ + return 0; \ + case 119228: \ + switch (ch2) { \ + case 119150: return 119230; \ + case 119151: return 119232; \ + } \ + return 0; \ + } \ + return 0; \ + } \ + return 0; glui32 unigen_decomp_data[3247] = { 0x41, 0x300, 0x41, 0x301, 0x41, 0x302, 0x41, 0x303, @@ -7587,7 +7587,8 @@ glui32 unigen_decomp_data[3247] = { 0x980b, 0x9829, 0x295b6, 0x98e2, 0x4b33, 0x9929, 0x99a7, 0x99c2, 0x99fe, 0x4bce, 0x29b30, 0x9b12, 0x9c40, 0x9cfd, 0x4cce, 0x4ced, 0x9d67, 0x2a0ce, 0x4cf8, 0x2a105, 0x2a20e, 0x2a291, 0x9ebb, 0x4d56, - 0x9ef9, 0x9efe, 0x9f05, 0x9f0f, 0x9f16, 0x9f3b, 0x2a600, }; + 0x9ef9, 0x9efe, 0x9f05, 0x9f0f, 0x9f16, 0x9f3b, 0x2a600, +}; gli_decomp_block_t unigen_decomp_block_0x0[256] = { { 0, 0 }, @@ -11475,351 +11476,351 @@ gli_decomp_block_t unigen_decomp_block_0x2fa[256] = { }; #define GET_DECOMP_BLOCK(ch, blockptr) \ -switch ((glui32)(ch) >> 8) { \ - case 0x0: \ - *blockptr = unigen_decomp_block_0x0; \ - break; \ - case 0x1: \ - *blockptr = unigen_decomp_block_0x1; \ - break; \ - case 0x2: \ - *blockptr = unigen_decomp_block_0x2; \ - break; \ - case 0x3: \ - *blockptr = unigen_decomp_block_0x3; \ - break; \ - case 0x4: \ - *blockptr = unigen_decomp_block_0x4; \ - break; \ - case 0x1e: \ - *blockptr = unigen_decomp_block_0x1e; \ - break; \ - case 0x1f: \ - *blockptr = unigen_decomp_block_0x1f; \ - break; \ - case 0x22: \ - *blockptr = unigen_decomp_block_0x22; \ - break; \ - case 0x30: \ - *blockptr = unigen_decomp_block_0x30; \ - break; \ - case 0xf9: \ - *blockptr = unigen_decomp_block_0xf9; \ - break; \ - case 0xfa: \ - *blockptr = unigen_decomp_block_0xfa; \ - break; \ - case 0xfb: \ - *blockptr = unigen_decomp_block_0xfb; \ - break; \ - case 0x2f8: \ - *blockptr = unigen_decomp_block_0x2f8; \ - break; \ - case 0x2f9: \ - *blockptr = unigen_decomp_block_0x2f9; \ - break; \ - case 0x2fa: \ - *blockptr = unigen_decomp_block_0x2fa; \ - break; \ - default: \ - *blockptr = nullptr; \ -} + switch ((glui32)(ch) >> 8) { \ + case 0x0: \ + *blockptr = unigen_decomp_block_0x0; \ + break; \ + case 0x1: \ + *blockptr = unigen_decomp_block_0x1; \ + break; \ + case 0x2: \ + *blockptr = unigen_decomp_block_0x2; \ + break; \ + case 0x3: \ + *blockptr = unigen_decomp_block_0x3; \ + break; \ + case 0x4: \ + *blockptr = unigen_decomp_block_0x4; \ + break; \ + case 0x1e: \ + *blockptr = unigen_decomp_block_0x1e; \ + break; \ + case 0x1f: \ + *blockptr = unigen_decomp_block_0x1f; \ + break; \ + case 0x22: \ + *blockptr = unigen_decomp_block_0x22; \ + break; \ + case 0x30: \ + *blockptr = unigen_decomp_block_0x30; \ + break; \ + case 0xf9: \ + *blockptr = unigen_decomp_block_0xf9; \ + break; \ + case 0xfa: \ + *blockptr = unigen_decomp_block_0xfa; \ + break; \ + case 0xfb: \ + *blockptr = unigen_decomp_block_0xfb; \ + break; \ + case 0x2f8: \ + *blockptr = unigen_decomp_block_0x2f8; \ + break; \ + case 0x2f9: \ + *blockptr = unigen_decomp_block_0x2f9; \ + break; \ + case 0x2fa: \ + *blockptr = unigen_decomp_block_0x2fa; \ + break; \ + default: \ + *blockptr = nullptr; \ + } #define GET_DECOMP_SPECIAL(ch, countptr, posptr) \ -switch (ch) { \ - case 0x622: \ - *countptr = 2; *posptr = 686; \ - break; \ - case 0x623: \ - *countptr = 2; *posptr = 688; \ - break; \ - case 0x624: \ - *countptr = 2; *posptr = 690; \ - break; \ - case 0x625: \ - *countptr = 2; *posptr = 692; \ - break; \ - case 0x626: \ - *countptr = 2; *posptr = 694; \ - break; \ - case 0x6c0: \ - *countptr = 2; *posptr = 696; \ - break; \ - case 0x6c2: \ - *countptr = 2; *posptr = 698; \ - break; \ - case 0x6d3: \ - *countptr = 2; *posptr = 700; \ - break; \ - case 0x929: \ - *countptr = 2; *posptr = 702; \ - break; \ - case 0x931: \ - *countptr = 2; *posptr = 704; \ - break; \ - case 0x934: \ - *countptr = 2; *posptr = 706; \ - break; \ - case 0x958: \ - *countptr = 2; *posptr = 708; \ - break; \ - case 0x959: \ - *countptr = 2; *posptr = 710; \ - break; \ - case 0x95a: \ - *countptr = 2; *posptr = 712; \ - break; \ - case 0x95b: \ - *countptr = 2; *posptr = 714; \ - break; \ - case 0x95c: \ - *countptr = 2; *posptr = 716; \ - break; \ - case 0x95d: \ - *countptr = 2; *posptr = 718; \ - break; \ - case 0x95e: \ - *countptr = 2; *posptr = 720; \ - break; \ - case 0x95f: \ - *countptr = 2; *posptr = 722; \ - break; \ - case 0x9cb: \ - *countptr = 2; *posptr = 724; \ - break; \ - case 0x9cc: \ - *countptr = 2; *posptr = 726; \ - break; \ - case 0x9dc: \ - *countptr = 2; *posptr = 728; \ - break; \ - case 0x9dd: \ - *countptr = 2; *posptr = 730; \ - break; \ - case 0x9df: \ - *countptr = 2; *posptr = 732; \ - break; \ - case 0xa33: \ - *countptr = 2; *posptr = 734; \ - break; \ - case 0xa36: \ - *countptr = 2; *posptr = 736; \ - break; \ - case 0xa59: \ - *countptr = 2; *posptr = 738; \ - break; \ - case 0xa5a: \ - *countptr = 2; *posptr = 740; \ - break; \ - case 0xa5b: \ - *countptr = 2; *posptr = 742; \ - break; \ - case 0xa5e: \ - *countptr = 2; *posptr = 744; \ - break; \ - case 0xb48: \ - *countptr = 2; *posptr = 746; \ - break; \ - case 0xb4b: \ - *countptr = 2; *posptr = 748; \ - break; \ - case 0xb4c: \ - *countptr = 2; *posptr = 750; \ - break; \ - case 0xb5c: \ - *countptr = 2; *posptr = 752; \ - break; \ - case 0xb5d: \ - *countptr = 2; *posptr = 754; \ - break; \ - case 0xb94: \ - *countptr = 2; *posptr = 756; \ - break; \ - case 0xbca: \ - *countptr = 2; *posptr = 758; \ - break; \ - case 0xbcb: \ - *countptr = 2; *posptr = 760; \ - break; \ - case 0xbcc: \ - *countptr = 2; *posptr = 762; \ - break; \ - case 0xc48: \ - *countptr = 2; *posptr = 764; \ - break; \ - case 0xcc0: \ - *countptr = 2; *posptr = 766; \ - break; \ - case 0xcc7: \ - *countptr = 2; *posptr = 768; \ - break; \ - case 0xcc8: \ - *countptr = 2; *posptr = 770; \ - break; \ - case 0xcca: \ - *countptr = 2; *posptr = 772; \ - break; \ - case 0xccb: \ - *countptr = 3; *posptr = 774; \ - break; \ - case 0xd4a: \ - *countptr = 2; *posptr = 777; \ - break; \ - case 0xd4b: \ - *countptr = 2; *posptr = 779; \ - break; \ - case 0xd4c: \ - *countptr = 2; *posptr = 781; \ - break; \ - case 0xdda: \ - *countptr = 2; *posptr = 783; \ - break; \ - case 0xddc: \ - *countptr = 2; *posptr = 785; \ - break; \ - case 0xddd: \ - *countptr = 3; *posptr = 787; \ - break; \ - case 0xdde: \ - *countptr = 2; *posptr = 790; \ - break; \ - case 0xf43: \ - *countptr = 2; *posptr = 792; \ - break; \ - case 0xf4d: \ - *countptr = 2; *posptr = 794; \ - break; \ - case 0xf52: \ - *countptr = 2; *posptr = 796; \ - break; \ - case 0xf57: \ - *countptr = 2; *posptr = 798; \ - break; \ - case 0xf5c: \ - *countptr = 2; *posptr = 800; \ - break; \ - case 0xf69: \ - *countptr = 2; *posptr = 802; \ - break; \ - case 0xf73: \ - *countptr = 2; *posptr = 804; \ - break; \ - case 0xf75: \ - *countptr = 2; *posptr = 806; \ - break; \ - case 0xf76: \ - *countptr = 2; *posptr = 808; \ - break; \ - case 0xf78: \ - *countptr = 2; *posptr = 810; \ - break; \ - case 0xf81: \ - *countptr = 2; *posptr = 812; \ - break; \ - case 0xf93: \ - *countptr = 2; *posptr = 814; \ - break; \ - case 0xf9d: \ - *countptr = 2; *posptr = 816; \ - break; \ - case 0xfa2: \ - *countptr = 2; *posptr = 818; \ - break; \ - case 0xfa7: \ - *countptr = 2; *posptr = 820; \ - break; \ - case 0xfac: \ - *countptr = 2; *posptr = 822; \ - break; \ - case 0xfb9: \ - *countptr = 2; *posptr = 824; \ - break; \ - case 0x1026: \ - *countptr = 2; *posptr = 826; \ - break; \ - case 0x2000: \ - *countptr = 1; *posptr = 2037; \ - break; \ - case 0x2001: \ - *countptr = 1; *posptr = 2038; \ - break; \ - case 0x2126: \ - *countptr = 1; *posptr = 2039; \ - break; \ - case 0x212a: \ - *countptr = 1; *posptr = 2040; \ - break; \ - case 0x212b: \ - *countptr = 2; *posptr = 2041; \ - break; \ - case 0x219a: \ - *countptr = 2; *posptr = 2043; \ - break; \ - case 0x219b: \ - *countptr = 2; *posptr = 2045; \ - break; \ - case 0x21ae: \ - *countptr = 2; *posptr = 2047; \ - break; \ - case 0x21cd: \ - *countptr = 2; *posptr = 2049; \ - break; \ - case 0x21ce: \ - *countptr = 2; *posptr = 2051; \ - break; \ - case 0x21cf: \ - *countptr = 2; *posptr = 2053; \ - break; \ - case 0x2329: \ - *countptr = 1; *posptr = 2131; \ - break; \ - case 0x232a: \ - *countptr = 1; *posptr = 2132; \ - break; \ - case 0x2adc: \ - *countptr = 2; *posptr = 2133; \ - break; \ - case 0x1d15e: \ - *countptr = 2; *posptr = 2670; \ - break; \ - case 0x1d15f: \ - *countptr = 2; *posptr = 2672; \ - break; \ - case 0x1d160: \ - *countptr = 3; *posptr = 2674; \ - break; \ - case 0x1d161: \ - *countptr = 3; *posptr = 2677; \ - break; \ - case 0x1d162: \ - *countptr = 3; *posptr = 2680; \ - break; \ - case 0x1d163: \ - *countptr = 3; *posptr = 2683; \ - break; \ - case 0x1d164: \ - *countptr = 3; *posptr = 2686; \ - break; \ - case 0x1d1bb: \ - *countptr = 2; *posptr = 2689; \ - break; \ - case 0x1d1bc: \ - *countptr = 2; *posptr = 2691; \ - break; \ - case 0x1d1bd: \ - *countptr = 3; *posptr = 2693; \ - break; \ - case 0x1d1be: \ - *countptr = 3; *posptr = 2696; \ - break; \ - case 0x1d1bf: \ - *countptr = 3; *posptr = 2699; \ - break; \ - case 0x1d1c0: \ - *countptr = 3; *posptr = 2702; \ - break; \ - default: \ - *countptr = 0; \ -} + switch (ch) { \ + case 0x622: \ + *countptr = 2; *posptr = 686; \ + break; \ + case 0x623: \ + *countptr = 2; *posptr = 688; \ + break; \ + case 0x624: \ + *countptr = 2; *posptr = 690; \ + break; \ + case 0x625: \ + *countptr = 2; *posptr = 692; \ + break; \ + case 0x626: \ + *countptr = 2; *posptr = 694; \ + break; \ + case 0x6c0: \ + *countptr = 2; *posptr = 696; \ + break; \ + case 0x6c2: \ + *countptr = 2; *posptr = 698; \ + break; \ + case 0x6d3: \ + *countptr = 2; *posptr = 700; \ + break; \ + case 0x929: \ + *countptr = 2; *posptr = 702; \ + break; \ + case 0x931: \ + *countptr = 2; *posptr = 704; \ + break; \ + case 0x934: \ + *countptr = 2; *posptr = 706; \ + break; \ + case 0x958: \ + *countptr = 2; *posptr = 708; \ + break; \ + case 0x959: \ + *countptr = 2; *posptr = 710; \ + break; \ + case 0x95a: \ + *countptr = 2; *posptr = 712; \ + break; \ + case 0x95b: \ + *countptr = 2; *posptr = 714; \ + break; \ + case 0x95c: \ + *countptr = 2; *posptr = 716; \ + break; \ + case 0x95d: \ + *countptr = 2; *posptr = 718; \ + break; \ + case 0x95e: \ + *countptr = 2; *posptr = 720; \ + break; \ + case 0x95f: \ + *countptr = 2; *posptr = 722; \ + break; \ + case 0x9cb: \ + *countptr = 2; *posptr = 724; \ + break; \ + case 0x9cc: \ + *countptr = 2; *posptr = 726; \ + break; \ + case 0x9dc: \ + *countptr = 2; *posptr = 728; \ + break; \ + case 0x9dd: \ + *countptr = 2; *posptr = 730; \ + break; \ + case 0x9df: \ + *countptr = 2; *posptr = 732; \ + break; \ + case 0xa33: \ + *countptr = 2; *posptr = 734; \ + break; \ + case 0xa36: \ + *countptr = 2; *posptr = 736; \ + break; \ + case 0xa59: \ + *countptr = 2; *posptr = 738; \ + break; \ + case 0xa5a: \ + *countptr = 2; *posptr = 740; \ + break; \ + case 0xa5b: \ + *countptr = 2; *posptr = 742; \ + break; \ + case 0xa5e: \ + *countptr = 2; *posptr = 744; \ + break; \ + case 0xb48: \ + *countptr = 2; *posptr = 746; \ + break; \ + case 0xb4b: \ + *countptr = 2; *posptr = 748; \ + break; \ + case 0xb4c: \ + *countptr = 2; *posptr = 750; \ + break; \ + case 0xb5c: \ + *countptr = 2; *posptr = 752; \ + break; \ + case 0xb5d: \ + *countptr = 2; *posptr = 754; \ + break; \ + case 0xb94: \ + *countptr = 2; *posptr = 756; \ + break; \ + case 0xbca: \ + *countptr = 2; *posptr = 758; \ + break; \ + case 0xbcb: \ + *countptr = 2; *posptr = 760; \ + break; \ + case 0xbcc: \ + *countptr = 2; *posptr = 762; \ + break; \ + case 0xc48: \ + *countptr = 2; *posptr = 764; \ + break; \ + case 0xcc0: \ + *countptr = 2; *posptr = 766; \ + break; \ + case 0xcc7: \ + *countptr = 2; *posptr = 768; \ + break; \ + case 0xcc8: \ + *countptr = 2; *posptr = 770; \ + break; \ + case 0xcca: \ + *countptr = 2; *posptr = 772; \ + break; \ + case 0xccb: \ + *countptr = 3; *posptr = 774; \ + break; \ + case 0xd4a: \ + *countptr = 2; *posptr = 777; \ + break; \ + case 0xd4b: \ + *countptr = 2; *posptr = 779; \ + break; \ + case 0xd4c: \ + *countptr = 2; *posptr = 781; \ + break; \ + case 0xdda: \ + *countptr = 2; *posptr = 783; \ + break; \ + case 0xddc: \ + *countptr = 2; *posptr = 785; \ + break; \ + case 0xddd: \ + *countptr = 3; *posptr = 787; \ + break; \ + case 0xdde: \ + *countptr = 2; *posptr = 790; \ + break; \ + case 0xf43: \ + *countptr = 2; *posptr = 792; \ + break; \ + case 0xf4d: \ + *countptr = 2; *posptr = 794; \ + break; \ + case 0xf52: \ + *countptr = 2; *posptr = 796; \ + break; \ + case 0xf57: \ + *countptr = 2; *posptr = 798; \ + break; \ + case 0xf5c: \ + *countptr = 2; *posptr = 800; \ + break; \ + case 0xf69: \ + *countptr = 2; *posptr = 802; \ + break; \ + case 0xf73: \ + *countptr = 2; *posptr = 804; \ + break; \ + case 0xf75: \ + *countptr = 2; *posptr = 806; \ + break; \ + case 0xf76: \ + *countptr = 2; *posptr = 808; \ + break; \ + case 0xf78: \ + *countptr = 2; *posptr = 810; \ + break; \ + case 0xf81: \ + *countptr = 2; *posptr = 812; \ + break; \ + case 0xf93: \ + *countptr = 2; *posptr = 814; \ + break; \ + case 0xf9d: \ + *countptr = 2; *posptr = 816; \ + break; \ + case 0xfa2: \ + *countptr = 2; *posptr = 818; \ + break; \ + case 0xfa7: \ + *countptr = 2; *posptr = 820; \ + break; \ + case 0xfac: \ + *countptr = 2; *posptr = 822; \ + break; \ + case 0xfb9: \ + *countptr = 2; *posptr = 824; \ + break; \ + case 0x1026: \ + *countptr = 2; *posptr = 826; \ + break; \ + case 0x2000: \ + *countptr = 1; *posptr = 2037; \ + break; \ + case 0x2001: \ + *countptr = 1; *posptr = 2038; \ + break; \ + case 0x2126: \ + *countptr = 1; *posptr = 2039; \ + break; \ + case 0x212a: \ + *countptr = 1; *posptr = 2040; \ + break; \ + case 0x212b: \ + *countptr = 2; *posptr = 2041; \ + break; \ + case 0x219a: \ + *countptr = 2; *posptr = 2043; \ + break; \ + case 0x219b: \ + *countptr = 2; *posptr = 2045; \ + break; \ + case 0x21ae: \ + *countptr = 2; *posptr = 2047; \ + break; \ + case 0x21cd: \ + *countptr = 2; *posptr = 2049; \ + break; \ + case 0x21ce: \ + *countptr = 2; *posptr = 2051; \ + break; \ + case 0x21cf: \ + *countptr = 2; *posptr = 2053; \ + break; \ + case 0x2329: \ + *countptr = 1; *posptr = 2131; \ + break; \ + case 0x232a: \ + *countptr = 1; *posptr = 2132; \ + break; \ + case 0x2adc: \ + *countptr = 2; *posptr = 2133; \ + break; \ + case 0x1d15e: \ + *countptr = 2; *posptr = 2670; \ + break; \ + case 0x1d15f: \ + *countptr = 2; *posptr = 2672; \ + break; \ + case 0x1d160: \ + *countptr = 3; *posptr = 2674; \ + break; \ + case 0x1d161: \ + *countptr = 3; *posptr = 2677; \ + break; \ + case 0x1d162: \ + *countptr = 3; *posptr = 2680; \ + break; \ + case 0x1d163: \ + *countptr = 3; *posptr = 2683; \ + break; \ + case 0x1d164: \ + *countptr = 3; *posptr = 2686; \ + break; \ + case 0x1d1bb: \ + *countptr = 2; *posptr = 2689; \ + break; \ + case 0x1d1bc: \ + *countptr = 2; *posptr = 2691; \ + break; \ + case 0x1d1bd: \ + *countptr = 3; *posptr = 2693; \ + break; \ + case 0x1d1be: \ + *countptr = 3; *posptr = 2696; \ + break; \ + case 0x1d1bf: \ + *countptr = 3; *posptr = 2699; \ + break; \ + case 0x1d1c0: \ + *countptr = 3; *posptr = 2702; \ + break; \ + default: \ + *countptr = 0; \ + } } // End of namespace Gargoyle diff --git a/engines/gargoyle/unicode_gen.h b/engines/gargoyle/unicode_gen.h index 1539ec49cd..7c86e9b39f 100644 --- a/engines/gargoyle/unicode_gen.h +++ b/engines/gargoyle/unicode_gen.h @@ -28,400 +28,400 @@ namespace Gargoyle { #define GET_CASE_BLOCK(ch, blockptr) \ -switch ((glui32)(ch) >> 8) { \ -case 0x0: \ - *blockptr = unigen_case_block_0x0; \ - break; \ -case 0x1: \ - *blockptr = unigen_case_block_0x1; \ - break; \ -case 0x2: \ - *blockptr = unigen_case_block_0x2; \ - break; \ -case 0x3: \ - *blockptr = unigen_case_block_0x3; \ - break; \ -case 0x4: \ - *blockptr = unigen_case_block_0x4; \ - break; \ -case 0x5: \ - *blockptr = unigen_case_block_0x5; \ - break; \ -case 0x1e: \ - *blockptr = unigen_case_block_0x1e; \ - break; \ -case 0x1f: \ - *blockptr = unigen_case_block_0x1f; \ - break; \ -case 0x21: \ - *blockptr = unigen_case_block_0x21; \ - break; \ -case 0x24: \ - *blockptr = unigen_case_block_0x24; \ - break; \ -case 0xfb: \ - *blockptr = unigen_case_block_0xfb; \ - break; \ -case 0xff: \ - *blockptr = unigen_case_block_0xff; \ - break; \ -case 0x104: \ - *blockptr = unigen_case_block_0x104; \ - break; \ -default: \ - *blockptr = nullptr; \ -} + switch ((glui32)(ch) >> 8) { \ + case 0x0: \ + *blockptr = unigen_case_block_0x0; \ + break; \ + case 0x1: \ + *blockptr = unigen_case_block_0x1; \ + break; \ + case 0x2: \ + *blockptr = unigen_case_block_0x2; \ + break; \ + case 0x3: \ + *blockptr = unigen_case_block_0x3; \ + break; \ + case 0x4: \ + *blockptr = unigen_case_block_0x4; \ + break; \ + case 0x5: \ + *blockptr = unigen_case_block_0x5; \ + break; \ + case 0x1e: \ + *blockptr = unigen_case_block_0x1e; \ + break; \ + case 0x1f: \ + *blockptr = unigen_case_block_0x1f; \ + break; \ + case 0x21: \ + *blockptr = unigen_case_block_0x21; \ + break; \ + case 0x24: \ + *blockptr = unigen_case_block_0x24; \ + break; \ + case 0xfb: \ + *blockptr = unigen_case_block_0xfb; \ + break; \ + case 0xff: \ + *blockptr = unigen_case_block_0xff; \ + break; \ + case 0x104: \ + *blockptr = unigen_case_block_0x104; \ + break; \ + default: \ + *blockptr = nullptr; \ + } #define GET_CASE_SPECIAL(ch, specptr) \ -switch (ch) { \ -case 0xdf: \ - *specptr = unigen_special_0xdf; \ - break; \ -case 0x130: \ - *specptr = unigen_special_0x130; \ - break; \ -case 0x149: \ - *specptr = unigen_special_0x149; \ - break; \ -case 0x1c4: \ - *specptr = unigen_special_0x1c4; \ - break; \ -case 0x1c5: \ - *specptr = unigen_special_0x1c5; \ - break; \ -case 0x1c6: \ - *specptr = unigen_special_0x1c6; \ - break; \ -case 0x1c7: \ - *specptr = unigen_special_0x1c7; \ - break; \ -case 0x1c8: \ - *specptr = unigen_special_0x1c8; \ - break; \ -case 0x1c9: \ - *specptr = unigen_special_0x1c9; \ - break; \ -case 0x1ca: \ - *specptr = unigen_special_0x1ca; \ - break; \ -case 0x1cb: \ - *specptr = unigen_special_0x1cb; \ - break; \ -case 0x1cc: \ - *specptr = unigen_special_0x1cc; \ - break; \ -case 0x1f0: \ - *specptr = unigen_special_0x1f0; \ - break; \ -case 0x1f1: \ - *specptr = unigen_special_0x1f1; \ - break; \ -case 0x1f2: \ - *specptr = unigen_special_0x1f2; \ - break; \ -case 0x1f3: \ - *specptr = unigen_special_0x1f3; \ - break; \ -case 0x390: \ - *specptr = unigen_special_0x390; \ - break; \ -case 0x3b0: \ - *specptr = unigen_special_0x3b0; \ - break; \ -case 0x587: \ - *specptr = unigen_special_0x587; \ - break; \ -case 0x1e96: \ - *specptr = unigen_special_0x1e96; \ - break; \ -case 0x1e97: \ - *specptr = unigen_special_0x1e97; \ - break; \ -case 0x1e98: \ - *specptr = unigen_special_0x1e98; \ - break; \ -case 0x1e99: \ - *specptr = unigen_special_0x1e99; \ - break; \ -case 0x1e9a: \ - *specptr = unigen_special_0x1e9a; \ - break; \ -case 0x1f50: \ - *specptr = unigen_special_0x1f50; \ - break; \ -case 0x1f52: \ - *specptr = unigen_special_0x1f52; \ - break; \ -case 0x1f54: \ - *specptr = unigen_special_0x1f54; \ - break; \ -case 0x1f56: \ - *specptr = unigen_special_0x1f56; \ - break; \ -case 0x1f80: \ - *specptr = unigen_special_0x1f80; \ - break; \ -case 0x1f81: \ - *specptr = unigen_special_0x1f81; \ - break; \ -case 0x1f82: \ - *specptr = unigen_special_0x1f82; \ - break; \ -case 0x1f83: \ - *specptr = unigen_special_0x1f83; \ - break; \ -case 0x1f84: \ - *specptr = unigen_special_0x1f84; \ - break; \ -case 0x1f85: \ - *specptr = unigen_special_0x1f85; \ - break; \ -case 0x1f86: \ - *specptr = unigen_special_0x1f86; \ - break; \ -case 0x1f87: \ - *specptr = unigen_special_0x1f87; \ - break; \ -case 0x1f88: \ - *specptr = unigen_special_0x1f88; \ - break; \ -case 0x1f89: \ - *specptr = unigen_special_0x1f89; \ - break; \ -case 0x1f8a: \ - *specptr = unigen_special_0x1f8a; \ - break; \ -case 0x1f8b: \ - *specptr = unigen_special_0x1f8b; \ - break; \ -case 0x1f8c: \ - *specptr = unigen_special_0x1f8c; \ - break; \ -case 0x1f8d: \ - *specptr = unigen_special_0x1f8d; \ - break; \ -case 0x1f8e: \ - *specptr = unigen_special_0x1f8e; \ - break; \ -case 0x1f8f: \ - *specptr = unigen_special_0x1f8f; \ - break; \ -case 0x1f90: \ - *specptr = unigen_special_0x1f90; \ - break; \ -case 0x1f91: \ - *specptr = unigen_special_0x1f91; \ - break; \ -case 0x1f92: \ - *specptr = unigen_special_0x1f92; \ - break; \ -case 0x1f93: \ - *specptr = unigen_special_0x1f93; \ - break; \ -case 0x1f94: \ - *specptr = unigen_special_0x1f94; \ - break; \ -case 0x1f95: \ - *specptr = unigen_special_0x1f95; \ - break; \ -case 0x1f96: \ - *specptr = unigen_special_0x1f96; \ - break; \ -case 0x1f97: \ - *specptr = unigen_special_0x1f97; \ - break; \ -case 0x1f98: \ - *specptr = unigen_special_0x1f98; \ - break; \ -case 0x1f99: \ - *specptr = unigen_special_0x1f99; \ - break; \ -case 0x1f9a: \ - *specptr = unigen_special_0x1f9a; \ - break; \ -case 0x1f9b: \ - *specptr = unigen_special_0x1f9b; \ - break; \ -case 0x1f9c: \ - *specptr = unigen_special_0x1f9c; \ - break; \ -case 0x1f9d: \ - *specptr = unigen_special_0x1f9d; \ - break; \ -case 0x1f9e: \ - *specptr = unigen_special_0x1f9e; \ - break; \ -case 0x1f9f: \ - *specptr = unigen_special_0x1f9f; \ - break; \ -case 0x1fa0: \ - *specptr = unigen_special_0x1fa0; \ - break; \ -case 0x1fa1: \ - *specptr = unigen_special_0x1fa1; \ - break; \ -case 0x1fa2: \ - *specptr = unigen_special_0x1fa2; \ - break; \ -case 0x1fa3: \ - *specptr = unigen_special_0x1fa3; \ - break; \ -case 0x1fa4: \ - *specptr = unigen_special_0x1fa4; \ - break; \ -case 0x1fa5: \ - *specptr = unigen_special_0x1fa5; \ - break; \ -case 0x1fa6: \ - *specptr = unigen_special_0x1fa6; \ - break; \ -case 0x1fa7: \ - *specptr = unigen_special_0x1fa7; \ - break; \ -case 0x1fa8: \ - *specptr = unigen_special_0x1fa8; \ - break; \ -case 0x1fa9: \ - *specptr = unigen_special_0x1fa9; \ - break; \ -case 0x1faa: \ - *specptr = unigen_special_0x1faa; \ - break; \ -case 0x1fab: \ - *specptr = unigen_special_0x1fab; \ - break; \ -case 0x1fac: \ - *specptr = unigen_special_0x1fac; \ - break; \ -case 0x1fad: \ - *specptr = unigen_special_0x1fad; \ - break; \ -case 0x1fae: \ - *specptr = unigen_special_0x1fae; \ - break; \ -case 0x1faf: \ - *specptr = unigen_special_0x1faf; \ - break; \ -case 0x1fb2: \ - *specptr = unigen_special_0x1fb2; \ - break; \ -case 0x1fb3: \ - *specptr = unigen_special_0x1fb3; \ - break; \ -case 0x1fb4: \ - *specptr = unigen_special_0x1fb4; \ - break; \ -case 0x1fb6: \ - *specptr = unigen_special_0x1fb6; \ - break; \ -case 0x1fb7: \ - *specptr = unigen_special_0x1fb7; \ - break; \ -case 0x1fbc: \ - *specptr = unigen_special_0x1fbc; \ - break; \ -case 0x1fc2: \ - *specptr = unigen_special_0x1fc2; \ - break; \ -case 0x1fc3: \ - *specptr = unigen_special_0x1fc3; \ - break; \ -case 0x1fc4: \ - *specptr = unigen_special_0x1fc4; \ - break; \ -case 0x1fc6: \ - *specptr = unigen_special_0x1fc6; \ - break; \ -case 0x1fc7: \ - *specptr = unigen_special_0x1fc7; \ - break; \ -case 0x1fcc: \ - *specptr = unigen_special_0x1fcc; \ - break; \ -case 0x1fd2: \ - *specptr = unigen_special_0x1fd2; \ - break; \ -case 0x1fd3: \ - *specptr = unigen_special_0x1fd3; \ - break; \ -case 0x1fd6: \ - *specptr = unigen_special_0x1fd6; \ - break; \ -case 0x1fd7: \ - *specptr = unigen_special_0x1fd7; \ - break; \ -case 0x1fe2: \ - *specptr = unigen_special_0x1fe2; \ - break; \ -case 0x1fe3: \ - *specptr = unigen_special_0x1fe3; \ - break; \ -case 0x1fe4: \ - *specptr = unigen_special_0x1fe4; \ - break; \ -case 0x1fe6: \ - *specptr = unigen_special_0x1fe6; \ - break; \ -case 0x1fe7: \ - *specptr = unigen_special_0x1fe7; \ - break; \ -case 0x1ff2: \ - *specptr = unigen_special_0x1ff2; \ - break; \ -case 0x1ff3: \ - *specptr = unigen_special_0x1ff3; \ - break; \ -case 0x1ff4: \ - *specptr = unigen_special_0x1ff4; \ - break; \ -case 0x1ff6: \ - *specptr = unigen_special_0x1ff6; \ - break; \ -case 0x1ff7: \ - *specptr = unigen_special_0x1ff7; \ - break; \ -case 0x1ffc: \ - *specptr = unigen_special_0x1ffc; \ - break; \ -case 0xfb00: \ - *specptr = unigen_special_0xfb00; \ - break; \ -case 0xfb01: \ - *specptr = unigen_special_0xfb01; \ - break; \ -case 0xfb02: \ - *specptr = unigen_special_0xfb02; \ - break; \ -case 0xfb03: \ - *specptr = unigen_special_0xfb03; \ - break; \ -case 0xfb04: \ - *specptr = unigen_special_0xfb04; \ - break; \ -case 0xfb05: \ - *specptr = unigen_special_0xfb05; \ - break; \ -case 0xfb06: \ - *specptr = unigen_special_0xfb06; \ - break; \ -case 0xfb13: \ - *specptr = unigen_special_0xfb13; \ - break; \ -case 0xfb14: \ - *specptr = unigen_special_0xfb14; \ - break; \ -case 0xfb15: \ - *specptr = unigen_special_0xfb15; \ - break; \ -case 0xfb16: \ - *specptr = unigen_special_0xfb16; \ - break; \ -case 0xfb17: \ - *specptr = unigen_special_0xfb17; \ - break; \ -default: \ - *specptr = nullptr; \ -} + switch (ch) { \ + case 0xdf: \ + *specptr = unigen_special_0xdf; \ + break; \ + case 0x130: \ + *specptr = unigen_special_0x130; \ + break; \ + case 0x149: \ + *specptr = unigen_special_0x149; \ + break; \ + case 0x1c4: \ + *specptr = unigen_special_0x1c4; \ + break; \ + case 0x1c5: \ + *specptr = unigen_special_0x1c5; \ + break; \ + case 0x1c6: \ + *specptr = unigen_special_0x1c6; \ + break; \ + case 0x1c7: \ + *specptr = unigen_special_0x1c7; \ + break; \ + case 0x1c8: \ + *specptr = unigen_special_0x1c8; \ + break; \ + case 0x1c9: \ + *specptr = unigen_special_0x1c9; \ + break; \ + case 0x1ca: \ + *specptr = unigen_special_0x1ca; \ + break; \ + case 0x1cb: \ + *specptr = unigen_special_0x1cb; \ + break; \ + case 0x1cc: \ + *specptr = unigen_special_0x1cc; \ + break; \ + case 0x1f0: \ + *specptr = unigen_special_0x1f0; \ + break; \ + case 0x1f1: \ + *specptr = unigen_special_0x1f1; \ + break; \ + case 0x1f2: \ + *specptr = unigen_special_0x1f2; \ + break; \ + case 0x1f3: \ + *specptr = unigen_special_0x1f3; \ + break; \ + case 0x390: \ + *specptr = unigen_special_0x390; \ + break; \ + case 0x3b0: \ + *specptr = unigen_special_0x3b0; \ + break; \ + case 0x587: \ + *specptr = unigen_special_0x587; \ + break; \ + case 0x1e96: \ + *specptr = unigen_special_0x1e96; \ + break; \ + case 0x1e97: \ + *specptr = unigen_special_0x1e97; \ + break; \ + case 0x1e98: \ + *specptr = unigen_special_0x1e98; \ + break; \ + case 0x1e99: \ + *specptr = unigen_special_0x1e99; \ + break; \ + case 0x1e9a: \ + *specptr = unigen_special_0x1e9a; \ + break; \ + case 0x1f50: \ + *specptr = unigen_special_0x1f50; \ + break; \ + case 0x1f52: \ + *specptr = unigen_special_0x1f52; \ + break; \ + case 0x1f54: \ + *specptr = unigen_special_0x1f54; \ + break; \ + case 0x1f56: \ + *specptr = unigen_special_0x1f56; \ + break; \ + case 0x1f80: \ + *specptr = unigen_special_0x1f80; \ + break; \ + case 0x1f81: \ + *specptr = unigen_special_0x1f81; \ + break; \ + case 0x1f82: \ + *specptr = unigen_special_0x1f82; \ + break; \ + case 0x1f83: \ + *specptr = unigen_special_0x1f83; \ + break; \ + case 0x1f84: \ + *specptr = unigen_special_0x1f84; \ + break; \ + case 0x1f85: \ + *specptr = unigen_special_0x1f85; \ + break; \ + case 0x1f86: \ + *specptr = unigen_special_0x1f86; \ + break; \ + case 0x1f87: \ + *specptr = unigen_special_0x1f87; \ + break; \ + case 0x1f88: \ + *specptr = unigen_special_0x1f88; \ + break; \ + case 0x1f89: \ + *specptr = unigen_special_0x1f89; \ + break; \ + case 0x1f8a: \ + *specptr = unigen_special_0x1f8a; \ + break; \ + case 0x1f8b: \ + *specptr = unigen_special_0x1f8b; \ + break; \ + case 0x1f8c: \ + *specptr = unigen_special_0x1f8c; \ + break; \ + case 0x1f8d: \ + *specptr = unigen_special_0x1f8d; \ + break; \ + case 0x1f8e: \ + *specptr = unigen_special_0x1f8e; \ + break; \ + case 0x1f8f: \ + *specptr = unigen_special_0x1f8f; \ + break; \ + case 0x1f90: \ + *specptr = unigen_special_0x1f90; \ + break; \ + case 0x1f91: \ + *specptr = unigen_special_0x1f91; \ + break; \ + case 0x1f92: \ + *specptr = unigen_special_0x1f92; \ + break; \ + case 0x1f93: \ + *specptr = unigen_special_0x1f93; \ + break; \ + case 0x1f94: \ + *specptr = unigen_special_0x1f94; \ + break; \ + case 0x1f95: \ + *specptr = unigen_special_0x1f95; \ + break; \ + case 0x1f96: \ + *specptr = unigen_special_0x1f96; \ + break; \ + case 0x1f97: \ + *specptr = unigen_special_0x1f97; \ + break; \ + case 0x1f98: \ + *specptr = unigen_special_0x1f98; \ + break; \ + case 0x1f99: \ + *specptr = unigen_special_0x1f99; \ + break; \ + case 0x1f9a: \ + *specptr = unigen_special_0x1f9a; \ + break; \ + case 0x1f9b: \ + *specptr = unigen_special_0x1f9b; \ + break; \ + case 0x1f9c: \ + *specptr = unigen_special_0x1f9c; \ + break; \ + case 0x1f9d: \ + *specptr = unigen_special_0x1f9d; \ + break; \ + case 0x1f9e: \ + *specptr = unigen_special_0x1f9e; \ + break; \ + case 0x1f9f: \ + *specptr = unigen_special_0x1f9f; \ + break; \ + case 0x1fa0: \ + *specptr = unigen_special_0x1fa0; \ + break; \ + case 0x1fa1: \ + *specptr = unigen_special_0x1fa1; \ + break; \ + case 0x1fa2: \ + *specptr = unigen_special_0x1fa2; \ + break; \ + case 0x1fa3: \ + *specptr = unigen_special_0x1fa3; \ + break; \ + case 0x1fa4: \ + *specptr = unigen_special_0x1fa4; \ + break; \ + case 0x1fa5: \ + *specptr = unigen_special_0x1fa5; \ + break; \ + case 0x1fa6: \ + *specptr = unigen_special_0x1fa6; \ + break; \ + case 0x1fa7: \ + *specptr = unigen_special_0x1fa7; \ + break; \ + case 0x1fa8: \ + *specptr = unigen_special_0x1fa8; \ + break; \ + case 0x1fa9: \ + *specptr = unigen_special_0x1fa9; \ + break; \ + case 0x1faa: \ + *specptr = unigen_special_0x1faa; \ + break; \ + case 0x1fab: \ + *specptr = unigen_special_0x1fab; \ + break; \ + case 0x1fac: \ + *specptr = unigen_special_0x1fac; \ + break; \ + case 0x1fad: \ + *specptr = unigen_special_0x1fad; \ + break; \ + case 0x1fae: \ + *specptr = unigen_special_0x1fae; \ + break; \ + case 0x1faf: \ + *specptr = unigen_special_0x1faf; \ + break; \ + case 0x1fb2: \ + *specptr = unigen_special_0x1fb2; \ + break; \ + case 0x1fb3: \ + *specptr = unigen_special_0x1fb3; \ + break; \ + case 0x1fb4: \ + *specptr = unigen_special_0x1fb4; \ + break; \ + case 0x1fb6: \ + *specptr = unigen_special_0x1fb6; \ + break; \ + case 0x1fb7: \ + *specptr = unigen_special_0x1fb7; \ + break; \ + case 0x1fbc: \ + *specptr = unigen_special_0x1fbc; \ + break; \ + case 0x1fc2: \ + *specptr = unigen_special_0x1fc2; \ + break; \ + case 0x1fc3: \ + *specptr = unigen_special_0x1fc3; \ + break; \ + case 0x1fc4: \ + *specptr = unigen_special_0x1fc4; \ + break; \ + case 0x1fc6: \ + *specptr = unigen_special_0x1fc6; \ + break; \ + case 0x1fc7: \ + *specptr = unigen_special_0x1fc7; \ + break; \ + case 0x1fcc: \ + *specptr = unigen_special_0x1fcc; \ + break; \ + case 0x1fd2: \ + *specptr = unigen_special_0x1fd2; \ + break; \ + case 0x1fd3: \ + *specptr = unigen_special_0x1fd3; \ + break; \ + case 0x1fd6: \ + *specptr = unigen_special_0x1fd6; \ + break; \ + case 0x1fd7: \ + *specptr = unigen_special_0x1fd7; \ + break; \ + case 0x1fe2: \ + *specptr = unigen_special_0x1fe2; \ + break; \ + case 0x1fe3: \ + *specptr = unigen_special_0x1fe3; \ + break; \ + case 0x1fe4: \ + *specptr = unigen_special_0x1fe4; \ + break; \ + case 0x1fe6: \ + *specptr = unigen_special_0x1fe6; \ + break; \ + case 0x1fe7: \ + *specptr = unigen_special_0x1fe7; \ + break; \ + case 0x1ff2: \ + *specptr = unigen_special_0x1ff2; \ + break; \ + case 0x1ff3: \ + *specptr = unigen_special_0x1ff3; \ + break; \ + case 0x1ff4: \ + *specptr = unigen_special_0x1ff4; \ + break; \ + case 0x1ff6: \ + *specptr = unigen_special_0x1ff6; \ + break; \ + case 0x1ff7: \ + *specptr = unigen_special_0x1ff7; \ + break; \ + case 0x1ffc: \ + *specptr = unigen_special_0x1ffc; \ + break; \ + case 0xfb00: \ + *specptr = unigen_special_0xfb00; \ + break; \ + case 0xfb01: \ + *specptr = unigen_special_0xfb01; \ + break; \ + case 0xfb02: \ + *specptr = unigen_special_0xfb02; \ + break; \ + case 0xfb03: \ + *specptr = unigen_special_0xfb03; \ + break; \ + case 0xfb04: \ + *specptr = unigen_special_0xfb04; \ + break; \ + case 0xfb05: \ + *specptr = unigen_special_0xfb05; \ + break; \ + case 0xfb06: \ + *specptr = unigen_special_0xfb06; \ + break; \ + case 0xfb13: \ + *specptr = unigen_special_0xfb13; \ + break; \ + case 0xfb14: \ + *specptr = unigen_special_0xfb14; \ + break; \ + case 0xfb15: \ + *specptr = unigen_special_0xfb15; \ + break; \ + case 0xfb16: \ + *specptr = unigen_special_0xfb16; \ + break; \ + case 0xfb17: \ + *specptr = unigen_special_0xfb17; \ + break; \ + default: \ + *specptr = nullptr; \ + } typedef glui32 gli_case_block_t[2]; ///< upper, lower typedef glui32 gli_case_special_t[3]; ///< upper, lower, title diff --git a/engines/gargoyle/window_graphics.cpp b/engines/gargoyle/window_graphics.cpp index a0d8b6ddba..322d642a1b 100644 --- a/engines/gargoyle/window_graphics.cpp +++ b/engines/gargoyle/window_graphics.cpp @@ -28,7 +28,7 @@ namespace Gargoyle { GraphicsWindow::GraphicsWindow(Windows *windows, uint32 rock) : Window(windows, rock), -_w(0), _h(0), _dirty(false), _surface(nullptr) { + _w(0), _h(0), _dirty(false), _surface(nullptr) { _type = wintype_Graphics; Common::copy(&_bgColor[0], &_bgColor[3], _bgnd); } @@ -66,7 +66,7 @@ void GraphicsWindow::rearrange(const Rect &box) { bothhgt = newhgt; newSurface = new Graphics::ManagedSurface(newwid, newhgt, - Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0)); + Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0)); // If the new surface is equal or bigger than the old one, copy it over if (_surface && bothwid && bothhgt) @@ -98,7 +98,7 @@ void GraphicsWindow::redraw() { } glui32 GraphicsWindow::drawPicture(glui32 image, glsi32 xpos, glsi32 ypos, int scale, - glui32 imagewidth, glui32 imageheight) { + glui32 imagewidth, glui32 imageheight) { Picture *pic = Picture::load(image); glui32 hyperlink = _attr.hyper; diff --git a/engines/gargoyle/window_graphics.h b/engines/gargoyle/window_graphics.h index ebcf45b195..67963bc9a1 100644 --- a/engines/gargoyle/window_graphics.h +++ b/engines/gargoyle/window_graphics.h @@ -53,7 +53,7 @@ public: virtual ~GraphicsWindow(); glui32 drawPicture(glui32 image, glsi32 xpos, glsi32 ypos, int scale, - glui32 imagewidth, glui32 imageheight); + glui32 imagewidth, glui32 imageheight); /** * Rearranges the window @@ -75,16 +75,24 @@ public: /** * Cancel a mouse event */ - virtual void cancelMouseEvent() override { _mouseRequest = false; } + virtual void cancelMouseEvent() override { + _mouseRequest = false; + } /** * Cancel a hyperlink event */ - virtual void cancelHyperlinkEvent() override { _hyperRequest = false; } + virtual void cancelHyperlinkEvent() override { + _hyperRequest = false; + } - virtual void requestMouseEvent() override { _mouseRequest = true; } + virtual void requestMouseEvent() override { + _mouseRequest = true; + } - virtual void requestHyperlinkEvent() override { _hyperRequest = true; } + virtual void requestHyperlinkEvent() override { + _hyperRequest = true; + } /** * Redraw the window diff --git a/engines/gargoyle/window_pair.cpp b/engines/gargoyle/window_pair.cpp index 33914c5fe7..9bd562ddb9 100644 --- a/engines/gargoyle/window_pair.cpp +++ b/engines/gargoyle/window_pair.cpp @@ -28,13 +28,13 @@ namespace Gargoyle { PairWindow::PairWindow(Windows *windows, glui32 method, Window *key, glui32 size) : - Window(windows, 0), - _dir(method & winmethod_DirMask), - _division(method & winmethod_DivisionMask), - _wBorder((method & winmethod_BorderMask) == winmethod_Border), - _vertical(_dir == winmethod_Left || _dir == winmethod_Right), - _backward(_dir == winmethod_Left || _dir == winmethod_Above), - _key(key), _size(size), _keyDamage(0), _child1(nullptr), _child2(nullptr) { + Window(windows, 0), + _dir(method & winmethod_DirMask), + _division(method & winmethod_DivisionMask), + _wBorder((method & winmethod_BorderMask) == winmethod_Border), + _vertical(_dir == winmethod_Left || _dir == winmethod_Right), + _backward(_dir == winmethod_Left || _dir == winmethod_Above), + _key(key), _size(size), _keyDamage(0), _child1(nullptr), _child2(nullptr) { _type = wintype_Pair; } @@ -128,19 +128,19 @@ void PairWindow::redraw() { Window *child = !_backward ? _child1 : _child2; Rect box(child->_bbox.left, child->_yAdj ? child->_bbox.top - child->_yAdj : child->_bbox.top, - child->_bbox.right, child->_bbox.bottom); + child->_bbox.right, child->_bbox.bottom); if (_vertical) { int xBord = _wBorder ? g_conf->_wBorderX : 0; int xPad = (g_conf->_wPaddingX - xBord) / 2; - + g_vm->_screen->fillRect(Rect(box.right + xPad, box.top, box.right + xPad + xBord, box.bottom), - g_conf->_borderColor); + g_conf->_borderColor); } else { int yBord = _wBorder ? g_conf->_wBorderY : 0; int yPad = (g_conf->_wPaddingY - yBord) / 2; g_vm->_screen->fillRect(Rect(box.left, box.bottom + yPad, box.right, box.bottom + yPad + yBord), - g_conf->_borderColor); + g_conf->_borderColor); } } @@ -200,7 +200,7 @@ void PairWindow::setArrangement(glui32 method, glui32 size, Window *keyWin) { } if (keyWin && dynamic_cast<BlankWindow *>(keyWin) - && (method & winmethod_DivisionMask) == winmethod_Fixed) { + && (method & winmethod_DivisionMask) == winmethod_Fixed) { warning("setArrangement: a Blank window cannot have a fixed size"); return; } diff --git a/engines/gargoyle/window_text_buffer.cpp b/engines/gargoyle/window_text_buffer.cpp index 7e65059169..ca891672ab 100644 --- a/engines/gargoyle/window_text_buffer.cpp +++ b/engines/gargoyle/window_text_buffer.cpp @@ -37,11 +37,11 @@ namespace Gargoyle { TextBufferWindow::TextBufferWindow(Windows *windows, uint32 rock) : Window(windows, rock), - _historyPos(0), _historyFirst(0), _historyPresent(0), _lastSeen(0), _scrollPos(0), - _scrollMax(0), _scrollBack(SCROLLBACK), _width(-1), _height(-1), _inBuf(nullptr), - _lineTerminators(nullptr), _echoLineInput(true), _ladjw(0), _radjw(0), _ladjn(0), - _radjn(0), _numChars(0), _chars(nullptr), _attrs(nullptr), - _spaced(0), _dashed(0), _copyBuf(0), _copyPos(0) { + _historyPos(0), _historyFirst(0), _historyPresent(0), _lastSeen(0), _scrollPos(0), + _scrollMax(0), _scrollBack(SCROLLBACK), _width(-1), _height(-1), _inBuf(nullptr), + _lineTerminators(nullptr), _echoLineInput(true), _ladjw(0), _radjw(0), _ladjn(0), + _radjn(0), _numChars(0), _chars(nullptr), _attrs(nullptr), + _spaced(0), _dashed(0), _copyBuf(0), _copyPos(0) { _type = wintype_TextBuffer; Common::fill(&_history[0], &_history[HISTORYLEN], nullptr); @@ -306,11 +306,11 @@ void TextBufferWindow::putText(const char *buf, int len, int pos, int oldlen) { if (diff != 0 && pos + oldlen < _numChars) { memmove(_chars + pos + len, - _chars + pos + oldlen, - (_numChars - (pos + oldlen)) * 4); + _chars + pos + oldlen, + (_numChars - (pos + oldlen)) * 4); memmove(_attrs + pos + len, - _attrs + pos + oldlen, - (_numChars - (pos + oldlen)) * sizeof(Attributes)); + _attrs + pos + oldlen, + (_numChars - (pos + oldlen)) * sizeof(Attributes)); } if (len > 0) { for (int i = 0; i < len; i++) { @@ -338,11 +338,11 @@ void TextBufferWindow::putTextUni(const glui32 *buf, int len, int pos, int oldle if (diff != 0 && pos + oldlen < _numChars) { memmove(_chars + pos + len, - _chars + pos + oldlen, - (_numChars - (pos + oldlen)) * 4); + _chars + pos + oldlen, + (_numChars - (pos + oldlen)) * 4); memmove(_attrs + pos + len, - _attrs + pos + oldlen, - (_numChars - (pos + oldlen)) * sizeof(Attributes)); + _attrs + pos + oldlen, + (_numChars - (pos + oldlen)) * sizeof(Attributes)); } if (len > 0) { int i; @@ -442,8 +442,8 @@ void TextBufferWindow::putCharUni(glui32 ch) { } if (g_conf->_spaces && _attr.style != style_Preformatted - && _styles[_attr.style].bg == color - && !_styles[_attr.style].reverse) { + && _styles[_attr.style].bg == color + && !_styles[_attr.style].reverse) { // turn (period space space) into (period space) if (g_conf->_spaces == 1) { if (ch == '.') @@ -480,8 +480,8 @@ void TextBufferWindow::putCharUni(glui32 ch) { // kill spaces at the end for line width calculation linelen = _numChars; while (linelen > 1 && _chars[linelen - 1] == ' ' - && _styles[_attrs[linelen - 1].style].bg == color - && !_styles[_attrs[linelen - 1].style].reverse) + && _styles[_attrs[linelen - 1].style].bg == color + && !_styles[_attrs[linelen - 1].style].reverse) linelen--; if (calcWidth(_chars, _attrs, 0, linelen, -1) >= pw) { @@ -567,8 +567,8 @@ void TextBufferWindow::click(const Point &newPos) { int gs = false; if (_lineRequest || _charRequest - || _lineRequestUni || _charRequestUni - || _moreRequest || _scrollRequest) + || _lineRequestUni || _charRequestUni + || _moreRequest || _scrollRequest) _windows->setFocus(this); if (_hyperRequest) { @@ -743,14 +743,14 @@ void TextBufferWindow::cancelLineEvent(Event *ev) { len = inmax; if (!unicode) { - for (ix = 0; ix<len; ix++) { + for (ix = 0; ix < len; ix++) { glui32 ch = _chars[_inFence + ix]; if (ch > 0xff) ch = '?'; ((char *)inbuf)[ix] = (char)ch; } } else { - for (ix = 0; ix<len; ix++) + for (ix = 0; ix < len; ix++) ((glui32 *)inbuf)[ix] = _chars[_inFence + ix]; } @@ -782,379 +782,379 @@ void TextBufferWindow::cancelLineEvent(Event *ev) { } void TextBufferWindow::redraw() { - TextBufferRow *ln; - int linelen; - int nsp, spw, pw; - int x0, y0, x1, y1; - int x, y, w; - int a, b; - glui32 link; - int font; - unsigned char *color; - int i; - int hx0, hx1, hy0, hy1; - int selrow, selchar, sx0, sx1, selleft, selright; + TextBufferRow *ln; + int linelen; + int nsp, spw, pw; + int x0, y0, x1, y1; + int x, y, w; + int a, b; + glui32 link; + int font; + unsigned char *color; + int i; + int hx0, hx1, hy0, hy1; + int selrow, selchar, sx0, sx1, selleft, selright; bool selBuf; - int tx, tsc, tsw, lsc, rsc; + int tx, tsc, tsw, lsc, rsc; Screen &screen = *g_vm->_screen; Window::redraw(); - _lines[0]._len = _numChars; + _lines[0]._len = _numChars; sx0 = sx1 = selleft = selright = 0; ln = new TextBufferRow(); - if (!ln) - return; - - x0 = (_bbox.left + g_conf->_tMarginX) * GLI_SUBPIX; - x1 = (_bbox.right - g_conf->_tMarginX - g_conf->_scrollWidth) * GLI_SUBPIX; - y0 = _bbox.top + g_conf->_tMarginY; - y1 = _bbox.bottom - g_conf->_tMarginY; - - pw = x1 - x0 - 2 * GLI_SUBPIX; - - // check if any part of buffer is selected - selBuf = g_vm->_selection->checkSelection(Rect(x0 / GLI_SUBPIX, y0, x1 / GLI_SUBPIX, y1)); - - for (i = _scrollPos + _height - 1; i >= _scrollPos; i--) { - // top of line - y = y0 + (_height - (i - _scrollPos) - 1) * g_conf->_leading; - - // check if part of line is selected - if (selBuf) { - selrow = g_vm->_selection->getSelection(Rect(x0 / GLI_SUBPIX, y, - x1 / GLI_SUBPIX, y + g_conf->_leading), &sx0, &sx1); - selleft = (sx0 == x0/GLI_SUBPIX); - selright = (sx1 == x1/GLI_SUBPIX); - } else { - selrow = false; - } - - // mark selected line dirty - if (selrow) - _lines[i]._dirty = true; - - memcpy(ln, &_lines[i], sizeof(TextBufferRow)); - - // skip if we can - if (!ln->_dirty && !ln->_repaint && !Windows::_forceRedraw && _scrollPos == 0) - continue; - - // repaint previously selected lines if needed - if (ln->_repaint && !Windows::_forceRedraw) - _windows->redrawRect(Rect(x0 / GLI_SUBPIX, y, - x1/GLI_SUBPIX, y + g_conf->_leading)); - - // keep selected line dirty and flag for repaint - if (!selrow) { - _lines[i]._dirty = false; - _lines[i]._repaint = false; - } else { - _lines[i]._repaint = true; - } - - // leave bottom line blank for [more] prompt - if (i == _scrollPos && i > 0) - continue; - - linelen = ln->_len; - - // kill spaces at the end unless they're a different color - color = Windows::_overrideBgSet ? g_conf->_windowColor : _bgColor; - while (i > 0 && linelen > 1 && ln->_chars[linelen-1] == ' ' - && _styles[ln->_attrs[linelen-1].style].bg == color - && !_styles[ln->_attrs[linelen-1].style].reverse) - linelen --; - - // kill characters that would overwrite the scroll bar - while (linelen > 1 && calcWidth(ln->_chars, ln->_attrs, 0, linelen, -1) >= pw) - linelen --; - - /* - * count spaces and width for justification - */ - if (g_conf->_justify && !ln->_newLine && i > 0) { - for (a = 0, nsp = 0; a < linelen; a++) - if (ln->_chars[a] == ' ') - nsp ++; - w = calcWidth(ln->_chars, ln->_attrs, 0, linelen, 0); - if (nsp) - spw = (x1 - x0 - ln->_lm - ln->_rm - 2 * SLOP - w) / nsp; - else - spw = 0; - } else { - spw = -1; - } - - // find and highlight selected characters - if (selrow && !Windows::_claimSelect) { - lsc = 0; - rsc = 0; - selchar = false; - // optimized case for all chars selected - if (selleft && selright) { - rsc = linelen > 0 ? linelen - 1 : 0; - selchar = calcWidth(ln->_chars, ln->_attrs, lsc, rsc, spw)/GLI_SUBPIX; - } else { - // optimized case for leftmost char selected - if (selleft) { - tsc = linelen > 0 ? linelen - 1 : 0; - selchar = calcWidth(ln->_chars, ln->_attrs, lsc, tsc, spw)/GLI_SUBPIX; - } else { - // find the substring contained by the selection - tx = (x0 + SLOP + ln->_lm)/GLI_SUBPIX; - // measure string widths until we find left char - for (tsc = 0; tsc < linelen; tsc++) { - tsw = calcWidth(ln->_chars, ln->_attrs, 0, tsc, spw)/GLI_SUBPIX; - if (tsw + tx >= sx0 || - tsw + tx + GLI_SUBPIX >= sx0 && ln->_chars[tsc] != ' ') { - lsc = tsc; - selchar = true; - break; - } - } - } - if (selchar) { - // optimized case for rightmost char selected - if (selright) { - rsc = linelen > 0 ? linelen - 1 : 0; - } else { - // measure string widths until we find right char - for (tsc = lsc; tsc < linelen; tsc++) { - tsw = calcWidth(ln->_chars, ln->_attrs, lsc, tsc, spw)/GLI_SUBPIX; - if (tsw + sx0 < sx1) - rsc = tsc; - } - if (lsc && !rsc) - rsc = lsc; - } - } - } - // reverse colors for selected chars - if (selchar) { - for (tsc = lsc; tsc <= rsc; tsc++) { - ln->_attrs[tsc].reverse = !ln->_attrs[tsc].reverse; - _copyBuf[_copyPos] = ln->_chars[tsc]; - _copyPos++; - } - } - // add newline if we reach the end of the line - if (ln->_len == 0 || ln->_len == (rsc+1)) { - _copyBuf[_copyPos] = '\n'; - _copyPos++; - } - } - - // clear any stored hyperlink coordinates - g_vm->_selection->putHyperlink(0, x0/GLI_SUBPIX, y, - x1/GLI_SUBPIX, y + g_conf->_leading); - - /* - * fill in background colors - */ - color = Windows::_overrideBgSet ? g_conf->_windowColor : _bgColor; - screen.fillRect(Rect::fromXYWH(x0 / GLI_SUBPIX, y, (x1-x0) / GLI_SUBPIX, g_conf->_leading), - color); - - x = x0 + SLOP + ln->_lm; - a = 0; - for (b = 0; b < linelen; b++) { - if (ln->_attrs[a] != ln->_attrs[b]) { - link = ln->_attrs[a].hyper; - font = ln->_attrs[a].attrFont(_styles); - color = ln->_attrs[a].attrBg(_styles); - w = screen.stringWidthUni(font, Common::U32String(ln->_chars + a, b - a), spw); - screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX, y, w / GLI_SUBPIX, g_conf->_leading), - color); - if (link) { - screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX + 1, y + g_conf->_baseLine + 1, - w / GLI_SUBPIX + 1, g_conf->_linkStyle), g_conf->_linkColor); - g_vm->_selection->putHyperlink(link, x/GLI_SUBPIX, y, - x/GLI_SUBPIX + w/GLI_SUBPIX, - y + g_conf->_leading); - } - x += w; - a = b; - } - } - link = ln->_attrs[a].hyper; - font = ln->_attrs[a].attrFont(_styles); - color = ln->_attrs[a].attrBg(_styles); - w = screen.stringWidthUni(font, Common::U32String(ln->_chars + a, b - a), spw); - screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX, y, w / GLI_SUBPIX, g_conf->_leading), color); - if (link) { - screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX + 1, y + g_conf->_baseLine + 1, - w/GLI_SUBPIX + 1, g_conf->_linkStyle), g_conf->_linkColor); - g_vm->_selection->putHyperlink(link, x / GLI_SUBPIX, y, - x / GLI_SUBPIX + w / GLI_SUBPIX, - y + g_conf->_leading); - } - x += w; - - color = Windows::_overrideBgSet ? g_conf->_windowColor : _bgColor; - screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX, y, x1/GLI_SUBPIX - x/GLI_SUBPIX, g_conf->_leading), color); - - /* - * draw caret - */ - - if (_windows->getFocusWindow() == this && i == 0 && (_lineRequest || _lineRequestUni)) { - w = calcWidth(_chars, _attrs, 0, _inCurs, spw); - if (w < pw - g_conf->_caretShape * 2 * GLI_SUBPIX) - screen.drawCaret(Point(x0 + SLOP + ln->_lm + w, y + g_conf->_baseLine)); - } - - /* - * draw text - */ - - x = x0 + SLOP + ln->_lm; - a = 0; - for (b = 0; b < linelen; b++) { - if (ln->_attrs[a] != ln->_attrs[b]) { - link = ln->_attrs[a].hyper; - font = ln->_attrs[a].attrFont(_styles); - color = link ? g_conf->_linkColor : ln->_attrs[a].attrFg(_styles); - x = screen.drawStringUni(Point(x, y + g_conf->_baseLine), - font, color, Common::U32String(ln->_chars + a, b - a), spw); - a = b; - } - } - link = ln->_attrs[a].hyper; - font = ln->_attrs[a].attrFont(_styles); - color = link ? g_conf->_linkColor : ln->_attrs[a].attrFg(_styles); - screen.drawStringUni(Point(x, y + g_conf->_baseLine), font, color, Common::U32String(ln->_chars + a, linelen - a), spw); - } - - /* - * draw more prompt - */ - if (_scrollPos && _height > 1) { - x = x0 + SLOP; - y = y0 + (_height - 1) * g_conf->_leading; - - g_vm->_selection->putHyperlink(0, x0/GLI_SUBPIX, y, - x1/GLI_SUBPIX, y + g_conf->_leading); - - color = Windows::_overrideBgSet ? g_conf->_windowColor : _bgColor; - screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX, y, x1 / GLI_SUBPIX - x / GLI_SUBPIX, g_conf->_leading), color); - - w = screen.stringWidth(g_conf->_moreFont, g_conf->_morePrompt); - - if (g_conf->_moreAlign == 1) + if (!ln) + return; + + x0 = (_bbox.left + g_conf->_tMarginX) * GLI_SUBPIX; + x1 = (_bbox.right - g_conf->_tMarginX - g_conf->_scrollWidth) * GLI_SUBPIX; + y0 = _bbox.top + g_conf->_tMarginY; + y1 = _bbox.bottom - g_conf->_tMarginY; + + pw = x1 - x0 - 2 * GLI_SUBPIX; + + // check if any part of buffer is selected + selBuf = g_vm->_selection->checkSelection(Rect(x0 / GLI_SUBPIX, y0, x1 / GLI_SUBPIX, y1)); + + for (i = _scrollPos + _height - 1; i >= _scrollPos; i--) { + // top of line + y = y0 + (_height - (i - _scrollPos) - 1) * g_conf->_leading; + + // check if part of line is selected + if (selBuf) { + selrow = g_vm->_selection->getSelection(Rect(x0 / GLI_SUBPIX, y, + x1 / GLI_SUBPIX, y + g_conf->_leading), &sx0, &sx1); + selleft = (sx0 == x0 / GLI_SUBPIX); + selright = (sx1 == x1 / GLI_SUBPIX); + } else { + selrow = false; + } + + // mark selected line dirty + if (selrow) + _lines[i]._dirty = true; + + memcpy(ln, &_lines[i], sizeof(TextBufferRow)); + + // skip if we can + if (!ln->_dirty && !ln->_repaint && !Windows::_forceRedraw && _scrollPos == 0) + continue; + + // repaint previously selected lines if needed + if (ln->_repaint && !Windows::_forceRedraw) + _windows->redrawRect(Rect(x0 / GLI_SUBPIX, y, + x1 / GLI_SUBPIX, y + g_conf->_leading)); + + // keep selected line dirty and flag for repaint + if (!selrow) { + _lines[i]._dirty = false; + _lines[i]._repaint = false; + } else { + _lines[i]._repaint = true; + } + + // leave bottom line blank for [more] prompt + if (i == _scrollPos && i > 0) + continue; + + linelen = ln->_len; + + // kill spaces at the end unless they're a different color + color = Windows::_overrideBgSet ? g_conf->_windowColor : _bgColor; + while (i > 0 && linelen > 1 && ln->_chars[linelen - 1] == ' ' + && _styles[ln->_attrs[linelen - 1].style].bg == color + && !_styles[ln->_attrs[linelen - 1].style].reverse) + linelen --; + + // kill characters that would overwrite the scroll bar + while (linelen > 1 && calcWidth(ln->_chars, ln->_attrs, 0, linelen, -1) >= pw) + linelen --; + + /* + * count spaces and width for justification + */ + if (g_conf->_justify && !ln->_newLine && i > 0) { + for (a = 0, nsp = 0; a < linelen; a++) + if (ln->_chars[a] == ' ') + nsp ++; + w = calcWidth(ln->_chars, ln->_attrs, 0, linelen, 0); + if (nsp) + spw = (x1 - x0 - ln->_lm - ln->_rm - 2 * SLOP - w) / nsp; + else + spw = 0; + } else { + spw = -1; + } + + // find and highlight selected characters + if (selrow && !Windows::_claimSelect) { + lsc = 0; + rsc = 0; + selchar = false; + // optimized case for all chars selected + if (selleft && selright) { + rsc = linelen > 0 ? linelen - 1 : 0; + selchar = calcWidth(ln->_chars, ln->_attrs, lsc, rsc, spw) / GLI_SUBPIX; + } else { + // optimized case for leftmost char selected + if (selleft) { + tsc = linelen > 0 ? linelen - 1 : 0; + selchar = calcWidth(ln->_chars, ln->_attrs, lsc, tsc, spw) / GLI_SUBPIX; + } else { + // find the substring contained by the selection + tx = (x0 + SLOP + ln->_lm) / GLI_SUBPIX; + // measure string widths until we find left char + for (tsc = 0; tsc < linelen; tsc++) { + tsw = calcWidth(ln->_chars, ln->_attrs, 0, tsc, spw) / GLI_SUBPIX; + if (tsw + tx >= sx0 || + tsw + tx + GLI_SUBPIX >= sx0 && ln->_chars[tsc] != ' ') { + lsc = tsc; + selchar = true; + break; + } + } + } + if (selchar) { + // optimized case for rightmost char selected + if (selright) { + rsc = linelen > 0 ? linelen - 1 : 0; + } else { + // measure string widths until we find right char + for (tsc = lsc; tsc < linelen; tsc++) { + tsw = calcWidth(ln->_chars, ln->_attrs, lsc, tsc, spw) / GLI_SUBPIX; + if (tsw + sx0 < sx1) + rsc = tsc; + } + if (lsc && !rsc) + rsc = lsc; + } + } + } + // reverse colors for selected chars + if (selchar) { + for (tsc = lsc; tsc <= rsc; tsc++) { + ln->_attrs[tsc].reverse = !ln->_attrs[tsc].reverse; + _copyBuf[_copyPos] = ln->_chars[tsc]; + _copyPos++; + } + } + // add newline if we reach the end of the line + if (ln->_len == 0 || ln->_len == (rsc + 1)) { + _copyBuf[_copyPos] = '\n'; + _copyPos++; + } + } + + // clear any stored hyperlink coordinates + g_vm->_selection->putHyperlink(0, x0 / GLI_SUBPIX, y, + x1 / GLI_SUBPIX, y + g_conf->_leading); + + /* + * fill in background colors + */ + color = Windows::_overrideBgSet ? g_conf->_windowColor : _bgColor; + screen.fillRect(Rect::fromXYWH(x0 / GLI_SUBPIX, y, (x1 - x0) / GLI_SUBPIX, g_conf->_leading), + color); + + x = x0 + SLOP + ln->_lm; + a = 0; + for (b = 0; b < linelen; b++) { + if (ln->_attrs[a] != ln->_attrs[b]) { + link = ln->_attrs[a].hyper; + font = ln->_attrs[a].attrFont(_styles); + color = ln->_attrs[a].attrBg(_styles); + w = screen.stringWidthUni(font, Common::U32String(ln->_chars + a, b - a), spw); + screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX, y, w / GLI_SUBPIX, g_conf->_leading), + color); + if (link) { + screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX + 1, y + g_conf->_baseLine + 1, + w / GLI_SUBPIX + 1, g_conf->_linkStyle), g_conf->_linkColor); + g_vm->_selection->putHyperlink(link, x / GLI_SUBPIX, y, + x / GLI_SUBPIX + w / GLI_SUBPIX, + y + g_conf->_leading); + } + x += w; + a = b; + } + } + link = ln->_attrs[a].hyper; + font = ln->_attrs[a].attrFont(_styles); + color = ln->_attrs[a].attrBg(_styles); + w = screen.stringWidthUni(font, Common::U32String(ln->_chars + a, b - a), spw); + screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX, y, w / GLI_SUBPIX, g_conf->_leading), color); + if (link) { + screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX + 1, y + g_conf->_baseLine + 1, + w / GLI_SUBPIX + 1, g_conf->_linkStyle), g_conf->_linkColor); + g_vm->_selection->putHyperlink(link, x / GLI_SUBPIX, y, + x / GLI_SUBPIX + w / GLI_SUBPIX, + y + g_conf->_leading); + } + x += w; + + color = Windows::_overrideBgSet ? g_conf->_windowColor : _bgColor; + screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX, y, x1 / GLI_SUBPIX - x / GLI_SUBPIX, g_conf->_leading), color); + + /* + * draw caret + */ + + if (_windows->getFocusWindow() == this && i == 0 && (_lineRequest || _lineRequestUni)) { + w = calcWidth(_chars, _attrs, 0, _inCurs, spw); + if (w < pw - g_conf->_caretShape * 2 * GLI_SUBPIX) + screen.drawCaret(Point(x0 + SLOP + ln->_lm + w, y + g_conf->_baseLine)); + } + + /* + * draw text + */ + + x = x0 + SLOP + ln->_lm; + a = 0; + for (b = 0; b < linelen; b++) { + if (ln->_attrs[a] != ln->_attrs[b]) { + link = ln->_attrs[a].hyper; + font = ln->_attrs[a].attrFont(_styles); + color = link ? g_conf->_linkColor : ln->_attrs[a].attrFg(_styles); + x = screen.drawStringUni(Point(x, y + g_conf->_baseLine), + font, color, Common::U32String(ln->_chars + a, b - a), spw); + a = b; + } + } + link = ln->_attrs[a].hyper; + font = ln->_attrs[a].attrFont(_styles); + color = link ? g_conf->_linkColor : ln->_attrs[a].attrFg(_styles); + screen.drawStringUni(Point(x, y + g_conf->_baseLine), font, color, Common::U32String(ln->_chars + a, linelen - a), spw); + } + + /* + * draw more prompt + */ + if (_scrollPos && _height > 1) { + x = x0 + SLOP; + y = y0 + (_height - 1) * g_conf->_leading; + + g_vm->_selection->putHyperlink(0, x0 / GLI_SUBPIX, y, + x1 / GLI_SUBPIX, y + g_conf->_leading); + + color = Windows::_overrideBgSet ? g_conf->_windowColor : _bgColor; + screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX, y, x1 / GLI_SUBPIX - x / GLI_SUBPIX, g_conf->_leading), color); + + w = screen.stringWidth(g_conf->_moreFont, g_conf->_morePrompt); + + if (g_conf->_moreAlign == 1) // center - x = x0 + SLOP + (x1 - x0 - w - SLOP * 2) / 2; - if (g_conf->_moreAlign == 2) + x = x0 + SLOP + (x1 - x0 - w - SLOP * 2) / 2; + if (g_conf->_moreAlign == 2) // right - x = x1 - SLOP - w; + x = x1 - SLOP - w; - color = Windows::_overrideFgSet ? g_conf->_moreColor : _fgColor; + color = Windows::_overrideFgSet ? g_conf->_moreColor : _fgColor; screen.drawString(Point(x, y + g_conf->_baseLine), - g_conf->_moreFont, color, g_conf->_morePrompt); - y1 = y; // don't want pictures overdrawing "[more]" - - // try to claim the focus - _moreRequest = true; - Windows::_moreFocus = true; - } else { - _moreRequest = false; - y1 = y0 + _height * g_conf->_leading; - } - - /* - * draw the images - */ - for (i = 0; i < _scrollBack; i++) { - memcpy(ln, &_lines[i], sizeof(TextBufferRow)); - - y = y0 + (_height - (i - _scrollPos) - 1) * g_conf->_leading; - - if (ln->_lPic) { - if (y < y1 && y + ln->_lPic->h > y0) { - ln->_lPic->drawPicture(x0/GLI_SUBPIX, y, x0/GLI_SUBPIX, y0, x1/GLI_SUBPIX, y1); - link = ln->_lHyper; - hy0 = y > y0 ? y : y0; - hy1 = y + ln->_lPic->h < y1 ? y + ln->_lPic->h : y1; - hx0 = x0/GLI_SUBPIX; - hx1 = x0/GLI_SUBPIX + ln->_lPic->w < x1/GLI_SUBPIX - ? x0/GLI_SUBPIX + ln->_lPic->w - : x1/GLI_SUBPIX; - g_vm->_selection->putHyperlink(link, hx0, hy0, hx1, hy1); - } - } - - if (ln->_rPic) { - if (y < y1 && y + ln->_rPic->h > y0) { - ln->_rPic->drawPicture(x1/GLI_SUBPIX - ln->_rPic->w, y, - x0/GLI_SUBPIX, y0, x1/GLI_SUBPIX, y1); - link = ln->_rHyper; - hy0 = y > y0 ? y : y0; - hy1 = y + ln->_rPic->h < y1 ? y + ln->_rPic->h : y1; - hx0 = x1/GLI_SUBPIX - ln->_rPic->w > x0/GLI_SUBPIX - ? x1/GLI_SUBPIX - ln->_rPic->w - : x0/GLI_SUBPIX; - hx1 = x1/GLI_SUBPIX; - g_vm->_selection->putHyperlink(link, hx0, hy0, hx1, hy1); - } - } - } - - /* - * Draw the scrollbar - */ - - // try to claim scroll keys - _scrollRequest = _scrollMax > _height; - - if (_scrollRequest && g_conf->_scrollWidth) { - int t0, t1; - x0 = _bbox.right - g_conf->_scrollWidth; - x1 = _bbox.right; - y0 = _bbox.top + g_conf->_tMarginY; - y1 = _bbox.bottom - g_conf->_tMarginY; - - g_vm->_selection->putHyperlink(0, x0, y0, x1, y1); - - y0 += g_conf->_scrollWidth / 2; - y1 -= g_conf->_scrollWidth / 2; - - // pos = thbot, pos - ht = thtop, max = wtop, 0 = wbot - t0 = (_scrollMax - _scrollPos) - (_height - 1); - t1 = (_scrollMax - _scrollPos); - if (_scrollMax > _height) { - t0 = t0 * (y1 - y0) / _scrollMax + y0; - t1 = t1 * (y1 - y0) / _scrollMax + y0; - } else { - t0 = t1 = y0; - } - - screen.fillRect(Rect::fromXYWH(x0 + 1, y0, x1-x0 - 2, y1 - y0), g_conf->_scrollBg); - screen.fillRect(Rect::fromXYWH(x0 + 1, t0, x1-x0 - 2, t1 - t0), g_conf->_scrollFg); - - for (i = 0; i < g_conf->_scrollWidth / 2 + 1; i++) { - screen.fillRect(Rect::fromXYWH(x0 + g_conf->_scrollWidth / 2 - i, - y0 - g_conf->_scrollWidth/2 + i, i * 2, 1), g_conf->_scrollFg); - screen.fillRect(Rect::fromXYWH(x0 + g_conf->_scrollWidth / 2 - i, - y1 + g_conf->_scrollWidth / 2 - i, i * 2, 1), g_conf->_scrollFg); - } - } - - // Keep track of selected text to be ready when user copies it to the clipboard - if (selBuf && _copyPos) { - Windows::_claimSelect = true; + g_conf->_moreFont, color, g_conf->_morePrompt); + y1 = y; // don't want pictures overdrawing "[more]" + + // try to claim the focus + _moreRequest = true; + Windows::_moreFocus = true; + } else { + _moreRequest = false; + y1 = y0 + _height * g_conf->_leading; + } + + /* + * draw the images + */ + for (i = 0; i < _scrollBack; i++) { + memcpy(ln, &_lines[i], sizeof(TextBufferRow)); + + y = y0 + (_height - (i - _scrollPos) - 1) * g_conf->_leading; + + if (ln->_lPic) { + if (y < y1 && y + ln->_lPic->h > y0) { + ln->_lPic->drawPicture(x0 / GLI_SUBPIX, y, x0 / GLI_SUBPIX, y0, x1 / GLI_SUBPIX, y1); + link = ln->_lHyper; + hy0 = y > y0 ? y : y0; + hy1 = y + ln->_lPic->h < y1 ? y + ln->_lPic->h : y1; + hx0 = x0 / GLI_SUBPIX; + hx1 = x0 / GLI_SUBPIX + ln->_lPic->w < x1 / GLI_SUBPIX + ? x0 / GLI_SUBPIX + ln->_lPic->w + : x1 / GLI_SUBPIX; + g_vm->_selection->putHyperlink(link, hx0, hy0, hx1, hy1); + } + } + + if (ln->_rPic) { + if (y < y1 && y + ln->_rPic->h > y0) { + ln->_rPic->drawPicture(x1 / GLI_SUBPIX - ln->_rPic->w, y, + x0 / GLI_SUBPIX, y0, x1 / GLI_SUBPIX, y1); + link = ln->_rHyper; + hy0 = y > y0 ? y : y0; + hy1 = y + ln->_rPic->h < y1 ? y + ln->_rPic->h : y1; + hx0 = x1 / GLI_SUBPIX - ln->_rPic->w > x0 / GLI_SUBPIX + ? x1 / GLI_SUBPIX - ln->_rPic->w + : x0 / GLI_SUBPIX; + hx1 = x1 / GLI_SUBPIX; + g_vm->_selection->putHyperlink(link, hx0, hy0, hx1, hy1); + } + } + } + + /* + * Draw the scrollbar + */ + + // try to claim scroll keys + _scrollRequest = _scrollMax > _height; + + if (_scrollRequest && g_conf->_scrollWidth) { + int t0, t1; + x0 = _bbox.right - g_conf->_scrollWidth; + x1 = _bbox.right; + y0 = _bbox.top + g_conf->_tMarginY; + y1 = _bbox.bottom - g_conf->_tMarginY; + + g_vm->_selection->putHyperlink(0, x0, y0, x1, y1); + + y0 += g_conf->_scrollWidth / 2; + y1 -= g_conf->_scrollWidth / 2; + + // pos = thbot, pos - ht = thtop, max = wtop, 0 = wbot + t0 = (_scrollMax - _scrollPos) - (_height - 1); + t1 = (_scrollMax - _scrollPos); + if (_scrollMax > _height) { + t0 = t0 * (y1 - y0) / _scrollMax + y0; + t1 = t1 * (y1 - y0) / _scrollMax + y0; + } else { + t0 = t1 = y0; + } + + screen.fillRect(Rect::fromXYWH(x0 + 1, y0, x1 - x0 - 2, y1 - y0), g_conf->_scrollBg); + screen.fillRect(Rect::fromXYWH(x0 + 1, t0, x1 - x0 - 2, t1 - t0), g_conf->_scrollFg); + + for (i = 0; i < g_conf->_scrollWidth / 2 + 1; i++) { + screen.fillRect(Rect::fromXYWH(x0 + g_conf->_scrollWidth / 2 - i, + y0 - g_conf->_scrollWidth / 2 + i, i * 2, 1), g_conf->_scrollFg); + screen.fillRect(Rect::fromXYWH(x0 + g_conf->_scrollWidth / 2 - i, + y1 + g_conf->_scrollWidth / 2 - i, i * 2, 1), g_conf->_scrollFg); + } + } + + // Keep track of selected text to be ready when user copies it to the clipboard + if (selBuf && _copyPos) { + Windows::_claimSelect = true; g_vm->_clipboard->clipboardStore(Common::U32String(_copyBuf, _copyPos)); - for (i = 0; i < _copyPos; i++) - _copyBuf[i] = 0; - _copyPos = 0; - } + for (i = 0; i < _copyPos; i++) + _copyBuf[i] = 0; + _copyPos = 0; + } - // no more prompt means all text has been seen - if (!_moreRequest) - _lastSeen = 0; + // no more prompt means all text has been seen + if (!_moreRequest) + _lastSeen = 0; - delete ln; + delete ln; } int TextBufferWindow::acceptScroll(glui32 arg) { @@ -1209,8 +1209,8 @@ void TextBufferWindow::acceptReadChar(glui32 arg) { _scrollPos = 0; if (_scrollPos - || arg == keycode_PageUp - || arg == keycode_MouseWheelUp) { + || arg == keycode_PageUp + || arg == keycode_MouseWheelUp) { acceptScroll(arg); return; } @@ -1286,7 +1286,7 @@ void TextBufferWindow::acceptReadLine(glui32 arg) { _historyPos += HISTORYLEN; cx = _history[_historyPos]; putTextUni(cx, cx ? strlen_uni(cx) : 0, _inFence, - _numChars - _inFence); + _numChars - _inFence); break; case keycode_Down: @@ -1297,7 +1297,7 @@ void TextBufferWindow::acceptReadLine(glui32 arg) { _historyPos -= HISTORYLEN; cx = _history[_historyPos]; putTextUni(cx, cx ? strlen_uni(cx) : 0, _inFence, - _numChars - _inFence); + _numChars - _inFence); break; // Cursor movement keys, during line input. @@ -1441,14 +1441,14 @@ void TextBufferWindow::acceptLine(glui32 keycode) { len = inmax; if (!unicode) { - for (ix = 0; ix<len; ix++) { + for (ix = 0; ix < len; ix++) { glui32 ch = _chars[_inFence + ix]; if (ch > 0xff) ch = '?'; ((char *)inbuf)[ix] = (char)ch; } } else { - for (ix = 0; ix<len; ix++) + for (ix = 0; ix < len; ix++) ((glui32 *)inbuf)[ix] = _chars[_inFence + ix]; } @@ -1483,13 +1483,26 @@ void TextBufferWindow::acceptLine(glui32 keycode) { bool TextBufferWindow::leftquote(glui32 c) { switch (c) { - case '(': case '[': + case '(': + case '[': // The following are Unicode characters in the "Separator, Space" category. - case 0x0020: case 0x00a0: case 0x1680: case 0x2000: - case 0x2001: case 0x2002: case 0x2003: case 0x2004: - case 0x2005: case 0x2006: case 0x2007: case 0x2008: - case 0x2009: case 0x200a: case 0x202f: case 0x205f: + case 0x0020: + case 0x00a0: + case 0x1680: + case 0x2000: + case 0x2001: + case 0x2002: + case 0x2003: + case 0x2004: + case 0x2005: + case 0x2006: + case 0x2007: + case 0x2008: + case 0x2009: + case 0x200a: + case 0x202f: + case 0x205f: case 0x3000: return true; default: @@ -1502,7 +1515,7 @@ void TextBufferWindow::scrollOneLine(bool forced) { _scrollMax++; if (_scrollMax > _scrollBack - 1 - || _lastSeen > _scrollBack - 1) + || _lastSeen > _scrollBack - 1) scrollResize(); if (_lastSeen >= _height) @@ -1581,7 +1594,7 @@ void TextBufferWindow::scrollResize() { } int TextBufferWindow::calcWidth(glui32 *chars, Attributes *attrs, int startchar, - int numChars, int spw) { + int numChars, int spw) { Screen &screen = *g_vm->_screen; int w = 0; int a, b; @@ -1590,7 +1603,7 @@ int TextBufferWindow::calcWidth(glui32 *chars, Attributes *attrs, int startchar, for (b = startchar; b < numChars; b++) { if (attrs[a] != attrs[b]) { w += screen.stringWidthUni(attrs[a].attrFont(_styles), - Common::U32String(chars + a, b - a), spw); + Common::U32String(chars + a, b - a), spw); a = b; } } @@ -1615,8 +1628,8 @@ void TextBufferWindow::flowBreak() { /*--------------------------------------------------------------------------*/ TextBufferWindow::TextBufferRow::TextBufferRow() : _len(0), _newLine(0), _dirty(false), - _repaint(false), _lPic(nullptr), _rPic(nullptr), _lHyper(0), _rHyper(0), - _lm(0), _rm(0) { + _repaint(false), _lPic(nullptr), _rPic(nullptr), _lHyper(0), _rHyper(0), + _lm(0), _rm(0) { Common::fill(&_chars[0], &_chars[TBLINELEN], 0); } diff --git a/engines/gargoyle/window_text_buffer.h b/engines/gargoyle/window_text_buffer.h index 9f0e20c0c1..199aeb42f6 100644 --- a/engines/gargoyle/window_text_buffer.h +++ b/engines/gargoyle/window_text_buffer.h @@ -99,7 +99,7 @@ public: glui32 *_chars; ///< alias to lines[0].chars Attributes *_attrs; ///< alias to lines[0].attrs - ///< adjust margins temporarily for images + ///< adjust margins temporarily for images int _ladjw; int _ladjn; int _radjw; @@ -195,7 +195,9 @@ public: /** * Cancel a hyperlink event */ - virtual void cancelHyperlinkEvent() override { _hyperRequest = false; } + virtual void cancelHyperlinkEvent() override { + _hyperRequest = false; + } /** * Redraw the window @@ -208,22 +210,34 @@ public: virtual void getSize(glui32 *width, glui32 *height) const override; - virtual void requestCharEvent() override { _charRequest = true; } + virtual void requestCharEvent() override { + _charRequest = true; + } - virtual void requestCharEventUni() override { _charRequestUni = true; } + virtual void requestCharEventUni() override { + _charRequestUni = true; + } - virtual void setEchoLineEvent(glui32 val) override { _echoLineInput = val != 0; } + virtual void setEchoLineEvent(glui32 val) override { + _echoLineInput = val != 0; + } - virtual void requestHyperlinkEvent() override { _hyperRequest = true; } + virtual void requestHyperlinkEvent() override { + _hyperRequest = true; + } - virtual void cancelCharEvent() override { _charRequest = _charRequestUni = false; } + virtual void cancelCharEvent() override { + _charRequest = _charRequestUni = false; + } virtual void flowBreak() override; /** * Returns a pointer to the styles for the window */ - virtual const WindowStyle *getStyles() const override { return _styles; } + virtual const WindowStyle *getStyles() const override { + return _styles; + } }; } // End of namespace Gargoyle diff --git a/engines/gargoyle/window_text_grid.cpp b/engines/gargoyle/window_text_grid.cpp index 1e5e41dd53..c232fb11da 100644 --- a/engines/gargoyle/window_text_grid.cpp +++ b/engines/gargoyle/window_text_grid.cpp @@ -193,7 +193,7 @@ void TextGridWindow::click(const Point &newPos) { int y = newPos.y - _bbox.top; if (_lineRequest || _charRequest || _lineRequestUni || _charRequestUni - || _moreRequest || _scrollRequest) + || _moreRequest || _scrollRequest) _windows->setFocus(this); if (_mouseRequest) { @@ -205,8 +205,7 @@ void TextGridWindow::click(const Point &newPos) { if (_hyperRequest) { glui32 linkval = g_vm->_selection->getHyperlink(newPos); - if (linkval) - { + if (linkval) { g_vm->_events->store(evtype_Hyperlink, this, linkval, 0); _hyperRequest = false; if (g_conf->_safeClicks) @@ -216,8 +215,7 @@ void TextGridWindow::click(const Point &newPos) { } void TextGridWindow::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen) { - if (_charRequest || _lineRequest || _charRequestUni || _lineRequestUni) - { + if (_charRequest || _lineRequest || _charRequestUni || _lineRequestUni) { warning("request_line_event: window already has keyboard request"); return; } @@ -292,7 +290,7 @@ void TextGridWindow::requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 init if (initlen) { TextGridRow *ln = &(_lines[_inOrgY]); - for (glui32 ix = 0; ix<initlen; ix++) { + for (glui32 ix = 0; ix < initlen; ix++) { ln->_attrs[_inOrgX + ix].set(style_Input); ln->_chars[_inOrgX + ix] = buf[ix]; } @@ -304,7 +302,7 @@ void TextGridWindow::requestLineEventUni(glui32 *buf, glui32 maxlen, glui32 init touch(_inOrgY); } - + if (_lineTerminatorsBase && _termCt) { _lineTerminators = new glui32[_termCt + 1]; @@ -341,8 +339,7 @@ void TextGridWindow::cancelLineEvent(Event *ev) { inarrayrock = _inArrayRock; if (!unicode) { - for (ix = 0; ix<_inLen; ix++) - { + for (ix = 0; ix < _inLen; ix++) { glui32 ch = ln->_chars[_inOrgX + ix]; if (ch > 0xff) ch = '?'; @@ -351,7 +348,7 @@ void TextGridWindow::cancelLineEvent(Event *ev) { if (_echoStream) _echoStream->echoLine((char *)_inBuf, _inLen); } else { - for (ix = 0; ix<_inLen; ix++) + for (ix = 0; ix < _inLen; ix++) ((glui32 *)inbuf)[ix] = ln->_chars[_inOrgX + ix]; if (_echoStream) _echoStream->echoLineUni((glui32 *)inbuf, _inLen); @@ -386,8 +383,7 @@ void TextGridWindow::cancelLineEvent(Event *ev) { void TextGridWindow::acceptReadChar(glui32 arg) { glui32 key; - switch (arg) - { + switch (arg) { case keycode_Erase: key = keycode_Delete; break; @@ -398,8 +394,7 @@ void TextGridWindow::acceptReadChar(glui32 arg) { key = arg; } - if (key > 0xff && key < (0xffffffff - keycode_MAXVAL + 1)) - { + if (key > 0xff && key < (0xffffffff - keycode_MAXVAL + 1)) { if (!(_charRequestUni) || key > 0x10ffff) key = keycode_Unknown; } @@ -425,12 +420,12 @@ void TextGridWindow::acceptLine(glui32 keycode) { inarrayrock = _inArrayRock; if (!unicode) { - for (ix = 0; ix<_inLen; ix++) + for (ix = 0; ix < _inLen; ix++) ((char *)inbuf)[ix] = (char)ln->_chars[_inOrgX + ix]; if (_echoStream) _echoStream->echoLine((char *)inbuf, _inLen); } else { - for (ix = 0; ix<_inLen; ix++) + for (ix = 0; ix < _inLen; ix++) ((glui32 *)inbuf)[ix] = ln->_chars[_inOrgX + ix]; if (_echoStream) _echoStream->echoLineUni((glui32 *)inbuf, _inLen); @@ -440,8 +435,7 @@ void TextGridWindow::acceptLine(glui32 keycode) { _curX = 0; _attr = _origAttr; - if (_lineTerminators) - { + if (_lineTerminators) { glui32 val2 = keycode; if (val2 == keycode_Return) val2 = 0; @@ -487,7 +481,7 @@ void TextGridWindow::acceptReadLine(glui32 arg) { return; if (_inCurs <= 0) return; - for (ix = _inCurs; ix<_inLen; ix++) + for (ix = _inCurs; ix < _inLen; ix++) ln->_chars[_inOrgX + ix - 1] = ln->_chars[_inOrgX + ix]; ln->_chars[_inOrgX + _inLen - 1] = ' '; _inCurs--; @@ -499,7 +493,7 @@ void TextGridWindow::acceptReadLine(glui32 arg) { return; if (_inCurs >= _inLen) return; - for (ix = _inCurs; ix<_inLen - 1; ix++) + for (ix = _inCurs; ix < _inLen - 1; ix++) ln->_chars[_inOrgX + ix] = ln->_chars[_inOrgX + ix + 1]; ln->_chars[_inOrgX + _inLen - 1] = ' '; _inLen--; @@ -508,7 +502,7 @@ void TextGridWindow::acceptReadLine(glui32 arg) { case keycode_Escape: if (_inLen <= 0) return; - for (ix = 0; ix<_inLen; ix++) + for (ix = 0; ix < _inLen; ix++) ln->_chars[_inOrgX + ix] = ' '; _inLen = 0; _inCurs = 0; @@ -553,7 +547,7 @@ void TextGridWindow::acceptReadLine(glui32 arg) { if (g_conf->_caps && (arg > 0x60 && arg < 0x7b)) arg -= 0x20; - for (ix = _inLen; ix>_inCurs; ix--) + for (ix = _inLen; ix > _inCurs; ix--) ln->_chars[_inOrgX + ix] = ln->_chars[_inOrgX + ix - 1]; ln->_attrs[_inOrgX + _inLen].set(style_Input); ln->_chars[_inOrgX + _inCurs] = arg; @@ -607,11 +601,11 @@ void TextGridWindow::redraw() { for (k = a, o = x; k < b; k++, o += g_conf->_cellW) { screen.drawStringUni(Point(o * GLI_SUBPIX, y + g_conf->_baseLine), font, - fgcolor, Common::U32String(&ln->_chars[k], 1), -1); + fgcolor, Common::U32String(&ln->_chars[k], 1), -1); } if (link) { screen.fillRect(Rect::fromXYWH(x, y + g_conf->_baseLine + 1, w, - g_conf->_linkStyle), g_conf->_linkColor); + g_conf->_linkStyle), g_conf->_linkColor); g_vm->_selection->putHyperlink(link, x, y, x + w, y + g_conf->_leading); } @@ -629,11 +623,11 @@ void TextGridWindow::redraw() { for (k = a, o = x; k < b; k++, o += g_conf->_cellW) { screen.drawStringUni(Point(o * GLI_SUBPIX, y + g_conf->_baseLine), font, - fgcolor, Common::U32String(&ln->_chars[k], 1)); + fgcolor, Common::U32String(&ln->_chars[k], 1)); } if (link) { screen.fillRect(Rect::fromXYWH(x, y + g_conf->_baseLine + 1, w, g_conf->_linkStyle), - g_conf->_linkColor); + g_conf->_linkColor); g_vm->_selection->putHyperlink(link, x, y, x + w, y + g_conf->_leading); } } diff --git a/engines/gargoyle/window_text_grid.h b/engines/gargoyle/window_text_grid.h index 8470c36fd2..fa9fe8b18b 100644 --- a/engines/gargoyle/window_text_grid.h +++ b/engines/gargoyle/window_text_grid.h @@ -57,7 +57,7 @@ private: void touch(int line); /** - * Return or enter, during line input. Ends line input. + * Return or enter, during line input. Ends line input. */ void acceptLine(glui32 keycode); public: @@ -66,7 +66,7 @@ public: int _curX, _curY; ///< the window cursor position - ///< for line input + ///< for line input void *_inBuf; ///< unsigned char* for latin1, glui32* for unicode int _inOrgX, _inOrgY; int _inMax; @@ -125,7 +125,9 @@ public: /** * Cancel a hyperlink event */ - virtual void cancelHyperlinkEvent() override { _hyperRequest = false; } + virtual void cancelHyperlinkEvent() override { + _hyperRequest = false; + } /** * Redraw the window @@ -138,7 +140,9 @@ public: virtual void getSize(glui32 *width, glui32 *height) const override; - virtual void requestCharEvent() override { _charRequest = true; } + virtual void requestCharEvent() override { + _charRequest = true; + } /** * Prepare for inputing a line @@ -158,20 +162,32 @@ public: /** * Cancel a mouse event */ - virtual void cancelMouseEvent() override { _mouseRequest = false; } + virtual void cancelMouseEvent() override { + _mouseRequest = false; + } - virtual void requestCharEventUni() override { _charRequestUni = true; } + virtual void requestCharEventUni() override { + _charRequestUni = true; + } - virtual void requestMouseEvent() override { _mouseRequest = true; } + virtual void requestMouseEvent() override { + _mouseRequest = true; + } - virtual void requestHyperlinkEvent() override { _hyperRequest = true; } + virtual void requestHyperlinkEvent() override { + _hyperRequest = true; + } - virtual void cancelCharEvent() override { _charRequest = _charRequestUni = false; } + virtual void cancelCharEvent() override { + _charRequest = _charRequestUni = false; + } /** * Returns a pointer to the styles for the window */ - virtual const WindowStyle *getStyles() const override { return _styles; } + virtual const WindowStyle *getStyles() const override { + return _styles; + } }; } // End of namespace Gargoyle diff --git a/engines/gargoyle/windows.cpp b/engines/gargoyle/windows.cpp index 5bf2b3eac9..883e3d6da4 100644 --- a/engines/gargoyle/windows.cpp +++ b/engines/gargoyle/windows.cpp @@ -52,7 +52,7 @@ byte Windows::_zcolor_Bright[3]; /*--------------------------------------------------------------------------*/ Windows::Windows(Graphics::Screen *screen) : _screen(screen), _windowList(nullptr), - _rootWin(nullptr), _focusWin(nullptr) { + _rootWin(nullptr), _focusWin(nullptr) { _overrideReverse = false; _overrideFgSet = false; _overrideBgSet = false; @@ -71,7 +71,7 @@ Windows::Windows(Graphics::Screen *screen) : _screen(screen), _windowList(nullpt } Window *Windows::windowOpen(Window *splitwin, glui32 method, glui32 size, - glui32 wintype, glui32 rock) { + glui32 wintype, glui32 rock) { Window *newwin, *oldparent; PairWindow *pairWin; glui32 val; @@ -93,23 +93,20 @@ Window *Windows::windowOpen(Window *splitwin, glui32 method, glui32 size, } val = (method & winmethod_DivisionMask); - if (val != winmethod_Fixed && val != winmethod_Proportional) - { + if (val != winmethod_Fixed && val != winmethod_Proportional) { warning("window_open: invalid method (not fixed or proportional)"); return nullptr; } val = (method & winmethod_DirMask); if (val != winmethod_Above && val != winmethod_Below - && val != winmethod_Left && val != winmethod_Right) - { + && val != winmethod_Left && val != winmethod_Right) { warning("window_open: invalid method (bad direction)"); return nullptr; } oldparent = splitwin->_parent; - if (oldparent && oldparent->_type != wintype_Pair) - { + if (oldparent && oldparent->_type != wintype_Pair) { warning("window_open: parent window is not Pair"); return nullptr; } @@ -283,8 +280,8 @@ void Windows::inputGuessFocus() { do { if (altWin - && (altWin->_lineRequest || altWin->_charRequest || - altWin->_lineRequestUni || altWin->_charRequestUni)) + && (altWin->_lineRequest || altWin->_charRequest || + altWin->_lineRequestUni || altWin->_charRequestUni)) break; altWin = iterateTreeOrder(altWin); } while (altWin != _focusWin); @@ -311,12 +308,11 @@ void Windows::inputMoreFocus() { void Windows::inputNextFocus() { Window *altWin = _focusWin; - do - { + do { altWin = iterateTreeOrder(altWin); if (altWin - && (altWin->_lineRequest || altWin->_charRequest || - altWin->_lineRequestUni || altWin->_charRequestUni)) + && (altWin->_lineRequest || altWin->_charRequest || + altWin->_lineRequestUni || altWin->_charRequestUni)) break; } while (altWin != _focusWin); @@ -485,10 +481,10 @@ Window *Windows::iterateTreeOrder(Window *win) { /*--------------------------------------------------------------------------*/ Window::Window(Windows *windows, glui32 rock) : _windows(windows), _rock(rock), - _type(0), _parent(nullptr), _next(nullptr), _prev(nullptr), _yAdj(0), - _lineRequest(0), _lineRequestUni(0), _charRequest(0), _charRequestUni(0), - _mouseRequest(0), _hyperRequest(0), _moreRequest(0), _scrollRequest(0), _imageLoaded(0), - _echoLineInputBase(true), _lineTerminatorsBase(nullptr), _termCt(0), _echoStream(nullptr) { + _type(0), _parent(nullptr), _next(nullptr), _prev(nullptr), _yAdj(0), + _lineRequest(0), _lineRequestUni(0), _charRequest(0), _charRequestUni(0), + _mouseRequest(0), _hyperRequest(0), _moreRequest(0), _scrollRequest(0), _imageLoaded(0), + _echoLineInputBase(true), _lineTerminatorsBase(nullptr), _termCt(0), _echoStream(nullptr) { _attr.fgset = 0; _attr.bgset = 0; _attr.reverse = 0; @@ -509,7 +505,7 @@ Window::~Window() { if (g_vm->gli_unregister_obj) (*g_vm->gli_unregister_obj)(this, gidisp_Class_Window, _dispRock); - + _echoStream = nullptr; delete _stream; @@ -704,14 +700,14 @@ byte *Attributes::attrBg(WindowStyle *styles) { if (zfset && zfore != Windows::_zcolor_fg) { Windows::_zcolor_Foreground[0] = (zfore >> 16) & 0xff; Windows::_zcolor_Foreground[1] = (zfore >> 8) & 0xff; - Windows::_zcolor_Foreground[2] = (zfore)& 0xff; + Windows::_zcolor_Foreground[2] = (zfore) & 0xff; Windows::_zcolor_fg = zfore; } if (zbset && zback != Windows::_zcolor_bg) { Windows::_zcolor_Background[0] = (zback >> 16) & 0xff; Windows::_zcolor_Background[1] = (zback >> 8) & 0xff; - Windows::_zcolor_Background[2] = (zback)& 0xff; + Windows::_zcolor_Background[2] = (zback) & 0xff; Windows::_zcolor_bg = zback; } @@ -726,11 +722,10 @@ byte *Attributes::attrBg(WindowStyle *styles) { return Windows::rgbShift(Windows::_zcolor_Foreground); else return Windows::_zcolor_Foreground; + else if (zbset && !memcmp(styles[style].fg, Windows::_zcolor_Background, 3)) + return Windows::_zcolor_LightGrey; else - if (zbset && !memcmp(styles[style].fg, Windows::_zcolor_Background, 3)) - return Windows::_zcolor_LightGrey; - else - return styles[style].fg; + return styles[style].fg; } } @@ -746,14 +741,14 @@ byte *Attributes::attrFg(WindowStyle *styles) { if (zfset && zfore != Windows::_zcolor_fg) { Windows::_zcolor_Foreground[0] = (zfore >> 16) & 0xff; Windows::_zcolor_Foreground[1] = (zfore >> 8) & 0xff; - Windows::_zcolor_Foreground[2] = (zfore)& 0xff; + Windows::_zcolor_Foreground[2] = (zfore) & 0xff; Windows::_zcolor_fg = zfore; } if (zbset && zback != Windows::_zcolor_bg) { Windows::_zcolor_Background[0] = (zback >> 16) & 0xff; Windows::_zcolor_Background[1] = (zback >> 8) & 0xff; - Windows::_zcolor_Background[2] = (zback)& 0xff; + Windows::_zcolor_Background[2] = (zback) & 0xff; Windows::_zcolor_bg = zback; } @@ -763,11 +758,10 @@ byte *Attributes::attrFg(WindowStyle *styles) { return Windows::rgbShift(Windows::_zcolor_Foreground); else return Windows::_zcolor_Foreground; + else if (zbset && !memcmp(styles[style].fg, Windows::_zcolor_Background, 3)) + return Windows::_zcolor_LightGrey; else - if (zbset && !memcmp(styles[style].fg, Windows::_zcolor_Background, 3)) - return Windows::_zcolor_LightGrey; - else - return styles[style].fg; + return styles[style].fg; } else { if (zbset) return Windows::_zcolor_Background; diff --git a/engines/gargoyle/windows.h b/engines/gargoyle/windows.h index 0e4020bb76..4838d7b245 100644 --- a/engines/gargoyle/windows.h +++ b/engines/gargoyle/windows.h @@ -63,7 +63,9 @@ public: /** * Dereference */ - Window *operator*() const { return _current; } + Window *operator*() const { + return _current; + } /** * Move to next @@ -73,17 +75,21 @@ public: /** * Equality test */ - bool operator==(const iterator &i) { return _current == i._current; } + bool operator==(const iterator &i) { + return _current == i._current; + } /** * Inequality test */ - bool operator!=(const iterator &i) { return _current != i._current; } + bool operator!=(const iterator &i) { + return _current != i._current; + } }; friend class iterator; private: Graphics::Screen *_screen; - Window * _windowList; ///< List of all windows + Window *_windowList; ///< List of all windows Window *_rootWin; ///< The topmost window Window *_focusWin; ///< The window selected by the player bool _drawSelect; @@ -149,7 +155,7 @@ public: * Open a new window */ Window *windowOpen(Window *splitwin, glui32 method, glui32 size, - glui32 wintype, glui32 rock); + glui32 wintype, glui32 rock); /** * Close an existing window @@ -159,17 +165,23 @@ public: /** * Return the root window */ - Window *getRoot() const { return _rootWin; } + Window *getRoot() const { + return _rootWin; + } /** * Gets the focused window */ - Window *getFocusWindow() const { return _focusWin; } + Window *getFocusWindow() const { + return _focusWin; + } /** * Setst the focused window */ - void setFocus(Window *win) { _focusWin = win; } + void setFocus(Window *win) { + _focusWin = win; + } /** * Pick first window which might want input. This is called after every keystroke. @@ -188,7 +200,9 @@ public: void selectionChanged(); - void clearClaimSelect() { _claimSelect = false; } + void clearClaimSelect() { + _claimSelect = false; + } /** * Rearrange windows @@ -207,12 +221,16 @@ public: /** * Get an iterator that will move over the tree */ - iterator begin() { return iterator(this, _windowList); } + iterator begin() { + return iterator(this, _windowList); + } /** * Returns the end point of window iteration */ - iterator end() { return iterator(this, nullptr); } + iterator end() { + return iterator(this, nullptr); + } }; /** @@ -272,14 +290,14 @@ struct WindowStyle { * Window attributes */ struct Attributes { - unsigned fgset : 1; - unsigned bgset : 1; - unsigned reverse : 1; - unsigned : 1; - unsigned style : 4; - unsigned fgcolor : 24; - unsigned bgcolor : 24; - unsigned hyper : 32; + unsigned fgset : 1; + unsigned bgset : 1; + unsigned reverse : 1; + unsigned : 1; + unsigned style : 4; + unsigned fgcolor : 24; + unsigned bgcolor : 24; + unsigned hyper : 32; /** * Constructor @@ -306,16 +324,16 @@ struct Attributes { */ bool operator==(const Attributes &src) { return fgset == src.fgset && bgset == src.bgset && reverse == src.reverse - && style == src.style && fgcolor == src.fgcolor && bgcolor == src.bgcolor - && hyper == src.hyper; + && style == src.style && fgcolor == src.fgcolor && bgcolor == src.bgcolor + && hyper == src.hyper; } /** * Inequality comparison */ bool operator!=(const Attributes &src) { return fgset != src.fgset || bgset != src.bgset || reverse != src.reverse - || style != src.style || fgcolor != src.fgcolor || bgcolor != src.bgcolor - || hyper != src.hyper; + || style != src.style || fgcolor != src.fgcolor || bgcolor != src.bgcolor + || hyper != src.hyper; } /** @@ -331,7 +349,9 @@ struct Attributes { /** * Get the font for the current font style */ - FACES attrFont(WindowStyle *styles) const { return styles[style].font; } + FACES attrFont(WindowStyle *styles) const { + return styles[style].font; + } }; /** @@ -391,12 +411,16 @@ public: /** * Rearranges the window */ - virtual void rearrange(const Rect &box) { _bbox = box; } + virtual void rearrange(const Rect &box) { + _bbox = box; + } /** * Get window split size within parent pair window */ - virtual glui32 getSplit(glui32 size, bool vertical) const { return 0; } + virtual glui32 getSplit(glui32 size, bool vertical) const { + return 0; + } /** * Write a character @@ -406,7 +430,9 @@ public: /** * Unput a unicode character */ - virtual bool unputCharUni(uint32 ch) { return false; } + virtual bool unputCharUni(uint32 ch) { + return false; + } /** * Move the cursor |