aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/menu.h
diff options
context:
space:
mode:
authorMartin Kiewitz2016-01-29 13:13:40 +0100
committerMartin Kiewitz2016-01-29 13:22:22 +0100
commit8a595e7771aa89d06876e13d7ab6751e26da8982 (patch)
treedfc61e112c9f7e5b1d9e295fbb60edf4ae1b65f3 /engines/agi/menu.h
parent1e73796bd0b17740ca4c35b9a7bd1882f9de6a37 (diff)
downloadscummvm-rg350-8a595e7771aa89d06876e13d7ab6751e26da8982.tar.gz
scummvm-rg350-8a595e7771aa89d06876e13d7ab6751e26da8982.tar.bz2
scummvm-rg350-8a595e7771aa89d06876e13d7ab6751e26da8982.zip
AGI: graphics rewrite + cleanup
- graphics code fully rewritten - Apple IIgs font support - Amiga Topaz support - Word parser rewritten - menu code rewritten - removed forced 2 second delay on all room changes replaced with heuristic to detect situations, where it's required - lots of naming cleanup - new console commands show_map, screenobj, vmvars and vmflags - all sorts of hacks/workarounds removed - added SCI wait mouse cursor - added Apple IIgs mouse cursor - added Atari ST mouse cursor - added Amiga/Apple IIgs transition - added Atari ST transition - user can select another render mode and use Apple IIgs palette + transition for PC versions - inventory screen rewritten - SetSimple command now properly implemented - PreAGI Mickey: Sierra logo now shown - saved games: now saving controller key mapping also saving automatic save data (SetSimple command) - fixed invalid memory access when saving games (31 bytes were saved using Common::String c_ptr() Special Thanks to: - fuzzie for helping out with the Apple IIgs font + valgrind - eriktorbjorn for helping out with valgrind - LordHoto for figuring out the code, that caused invalid memory access in the original code, when saving a game - sev for help out with reversing the Amiga transition currently missing: - mouse support for menu - mouse support for system dialogs - predictive dialog support
Diffstat (limited to 'engines/agi/menu.h')
-rw-r--r--engines/agi/menu.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/engines/agi/menu.h b/engines/agi/menu.h
index 000973db23..1781704996 100644
--- a/engines/agi/menu.h
+++ b/engines/agi/menu.h
@@ -25,6 +25,88 @@
namespace Agi {
+struct GuiMenuEntry {
+ Common::String text;
+ int16 textLen;
+
+ int16 row;
+ int16 column;
+
+ int16 itemCount;
+ int16 firstItemNr;
+ int16 selectedItemNr;
+
+ int16 maxItemTextLen;
+};
+typedef Common::Array<GuiMenuEntry *> GuiMenuArray;
+
+struct GuiMenuItemEntry {
+ Common::String text;
+ int16 textLen;
+
+ int16 row;
+ int16 column;
+
+ bool enabled;
+ uint16 controllerSlot;
+};
+typedef Common::Array<GuiMenuItemEntry *> GuiMenuItemArray;
+
+class GfxMenu {
+public:
+ GfxMenu(AgiEngine *vm, GfxMgr *gfx, PictureMgr *picture, TextMgr *text);
+ ~GfxMenu();
+
+ void addMenu(const char *menuText);
+ void addMenuItem(const char *menuText, uint16 controlCode);
+ void submit();
+ void itemEnable(uint16 controllerSlot);
+ void itemDisable(uint16 controllerSlot);
+ void itemEnableAll();
+ void charPress(int16 newChar);
+
+ bool isAvailable();
+
+ void accessAllow();
+ void accessDeny();
+
+ void delayedExecute();
+ bool delayedExecuteActive();
+ void execute();
+
+private:
+ void itemEnableDisable(uint16 controllerSlot, bool enabled);
+
+ void drawMenuName(int16 menuNr, bool inverted);
+ void drawItemName(int16 itemNr, bool inverted);
+ void drawActiveMenu();
+ void removeActiveMenu();
+
+ AgiEngine *_vm;
+ GfxMgr *_gfx;
+ PictureMgr *_picture;
+ TextMgr *_text;
+
+ bool _allowed;
+ bool _submitted;
+ bool _delayedExecute;
+
+ // for initial setup of the menu
+ int16 _setupMenuColumn;
+ int16 _setupMenuItemColumn;
+
+ GuiMenuArray _array;
+ GuiMenuItemArray _itemArray;
+
+ int16 _selectedMenuNr;
+
+ uint16 _selectedMenuHeight;
+ uint16 _selectedMenuWidth;
+ int16 _selectedMenuRow;
+ int16 _selectedMenuColumn;
+};
+
+#if 0
#define MENU_BG 0x0f // White
#define MENU_DISABLED 0x07 // Grey
@@ -44,6 +126,7 @@ private:
AgiEngine *_vm;
GfxMgr *_gfx;
PictureMgr *_picture;
+ TextMgr *_text;
public:
Menu(AgiEngine *vm, GfxMgr *gfx, PictureMgr *picture);
@@ -78,6 +161,7 @@ private:
bool mouseOverText(int line, int col, char *s);
};
+#endif
} // End of namespace Agi