From 91d5b8b17e7a600ab4e2d8def5a2d24b14cb1d57 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 26 Dec 2015 13:12:30 +0100 Subject: WAGE: Started border drawing implementation --- engines/wage/gui.h | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 engines/wage/gui.h (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h new file mode 100644 index 0000000000..0e5be4fb8f --- /dev/null +++ b/engines/wage/gui.h @@ -0,0 +1,70 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * MIT License: + * + * Copyright (c) 2009 Alexei Svitkine, Eugene Sandulenko + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef WAGE_GUI_H +#define WAGE_GUI_H + +#include "graphics/surface.h" +#include "common/rect.h" + +namespace Wage { + +class Gui { +public: + Gui(); + ~Gui(); + + void paintBorder(Graphics::Surface *g, int x, int y, int width, int height); + +private: + void drawBox(Graphics::Surface *g, int x, int y, int w, int h); + +}; + +} // End of namespace Wage + +#endif -- cgit v1.2.3 From cd063ec0e8e3870f1d2386bd138010b370c79a85 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 26 Dec 2015 13:54:20 +0100 Subject: WAGE: Further work on border drawing --- engines/wage/gui.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 0e5be4fb8f..0410686d3f 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -58,10 +58,12 @@ public: Gui(); ~Gui(); - void paintBorder(Graphics::Surface *g, int x, int y, int width, int height); + void paintBorder(Graphics::Surface *g, int x, int y, int width, int height, + bool active, bool scrollable, bool closeable, bool closeBoxPressed); private: void drawBox(Graphics::Surface *g, int x, int y, int w, int h); + void fillRect(Graphics::Surface *g, int x, int y, int w, int h); }; -- cgit v1.2.3 From 3fe3ad7ee35c8bdb4aef298e2cfa52b43b94d88e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 28 Dec 2015 12:38:26 +0100 Subject: WAGE: Moved scene drawing calls to Gui class --- engines/wage/gui.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 0410686d3f..46899027d3 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -58,13 +58,20 @@ public: Gui(); ~Gui(); + void draw(); + void setScene(Scene *scene); + +private: void paintBorder(Graphics::Surface *g, int x, int y, int width, int height, bool active, bool scrollable, bool closeable, bool closeBoxPressed); -private: void drawBox(Graphics::Surface *g, int x, int y, int w, int h); void fillRect(Graphics::Surface *g, int x, int y, int w, int h); +private: + Graphics::Surface _screen; + Scene *_scene; + bool _sceneDirty; }; } // End of namespace Wage -- cgit v1.2.3 From a712a1d80b2bf7e35d729475e9522456b6a90e27 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 30 Dec 2015 18:22:46 +0100 Subject: WAGE: Implement appendText() --- engines/wage/gui.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 46899027d3..2e6cd65ad6 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -60,6 +60,7 @@ public: void draw(); void setScene(Scene *scene); + void appendText(Common::String &str); private: void paintBorder(Graphics::Surface *g, int x, int y, int width, int height, @@ -72,6 +73,8 @@ private: Graphics::Surface _screen; Scene *_scene; bool _sceneDirty; + + Common::String _out; }; } // End of namespace Wage -- cgit v1.2.3 From 141bddbf57393a5cf24c35b63f5d802d10f36149 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 30 Dec 2015 18:41:18 +0100 Subject: WAGE: Stub for console rendering --- engines/wage/gui.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 2e6cd65ad6..0ac81e20a0 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -66,11 +66,13 @@ private: void paintBorder(Graphics::Surface *g, int x, int y, int width, int height, bool active, bool scrollable, bool closeable, bool closeBoxPressed); + void renderConsole(Graphics::Surface *g, int x, int y, int width, int height); void drawBox(Graphics::Surface *g, int x, int y, int w, int h); void fillRect(Graphics::Surface *g, int x, int y, int w, int h); private: Graphics::Surface _screen; + Graphics::Surface _console; Scene *_scene; bool _sceneDirty; -- cgit v1.2.3 From f25663605bcb63c615bb4be9d6161b847ea5ce22 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 31 Dec 2015 17:45:36 +0100 Subject: WAGE: Implement console drawing --- engines/wage/gui.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 0ac81e20a0..ea6af1ecf3 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -48,6 +48,7 @@ #ifndef WAGE_GUI_H #define WAGE_GUI_H +#include "common/str-array.h" #include "graphics/surface.h" #include "common/rect.h" @@ -76,7 +77,9 @@ private: Scene *_scene; bool _sceneDirty; - Common::String _out; + Common::StringArray _out; + Common::StringArray _lines; + uint _scrollPos; }; } // End of namespace Wage -- cgit v1.2.3 From 849220b6b6c8544f145ba9c480c499b4638b3c2b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 31 Dec 2015 17:55:33 +0100 Subject: WAGE: Simplified border drawing API --- engines/wage/gui.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index ea6af1ecf3..7be81baa54 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -54,6 +54,11 @@ namespace Wage { +enum WindowType { + kWindowScene, + kWindowConsole +}; + class Gui { public: Gui(); @@ -64,9 +69,7 @@ public: void appendText(Common::String &str); private: - void paintBorder(Graphics::Surface *g, int x, int y, int width, int height, - bool active, bool scrollable, bool closeable, bool closeBoxPressed); - + void paintBorder(Graphics::Surface *g, int x, int y, int width, int height, WindowType windowType); void renderConsole(Graphics::Surface *g, int x, int y, int width, int height); void drawBox(Graphics::Surface *g, int x, int y, int w, int h); void fillRect(Graphics::Surface *g, int x, int y, int w, int h); -- cgit v1.2.3 From dad200e50eb1096db39a282d5110225da92dbade Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 31 Dec 2015 18:50:34 +0100 Subject: WAGE: Load fonts from wage.dat --- engines/wage/gui.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 7be81baa54..91acfb3635 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -73,6 +73,7 @@ private: void renderConsole(Graphics::Surface *g, int x, int y, int width, int height); void drawBox(Graphics::Surface *g, int x, int y, int w, int h); void fillRect(Graphics::Surface *g, int x, int y, int w, int h); + void loadFonts(); private: Graphics::Surface _screen; @@ -83,6 +84,8 @@ private: Common::StringArray _out; Common::StringArray _lines; uint _scrollPos; + + bool _builtInFonts; }; } // End of namespace Wage -- cgit v1.2.3 From ac87bc9671822ce26e9dd4a5f77b23de83a71b63 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 1 Jan 2016 01:43:59 +0100 Subject: WAGE: Implement cursor drawing and handling --- engines/wage/gui.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 91acfb3635..216a63c6ae 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -67,6 +67,7 @@ public: void draw(); void setScene(Scene *scene); void appendText(Common::String &str); + void mouseMove(int x, int y); private: void paintBorder(Graphics::Surface *g, int x, int y, int width, int height, WindowType windowType); @@ -86,6 +87,9 @@ private: uint _scrollPos; bool _builtInFonts; + + Common::Rect _consoleTextArea; + bool _cursorIsArrow; }; } // End of namespace Wage -- cgit v1.2.3 From 1332958c9a951e74f1d3d93b4827c63ba052ad8f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 1 Jan 2016 02:23:43 +0100 Subject: WAGE: Stub for menu drawing --- engines/wage/gui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 216a63c6ae..9573f57e25 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -75,6 +75,7 @@ private: void drawBox(Graphics::Surface *g, int x, int y, int w, int h); void fillRect(Graphics::Surface *g, int x, int y, int w, int h); void loadFonts(); + void renderMenu(); private: Graphics::Surface _screen; -- cgit v1.2.3 From 1ef7beb8e80797d79ef7aa33275f391b8642d51c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 1 Jan 2016 18:48:16 +0100 Subject: WAGE: Stub for object clicking --- engines/wage/gui.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 9573f57e25..f5e1ef5c9b 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -68,6 +68,7 @@ public: void setScene(Scene *scene); void appendText(Common::String &str); void mouseMove(int x, int y); + Designed *getClickTarget(int x, int y); private: void paintBorder(Graphics::Surface *g, int x, int y, int width, int height, WindowType windowType); @@ -82,6 +83,7 @@ private: Graphics::Surface _console; Scene *_scene; bool _sceneDirty; + bool _bordersDirty; Common::StringArray _out; Common::StringArray _lines; @@ -90,6 +92,8 @@ private: bool _builtInFonts; Common::Rect _consoleTextArea; + Common::Rect _sceneArea; + bool _sceneIsActive; bool _cursorIsArrow; }; -- cgit v1.2.3 From 2e6732171d6dcec60eaaead55de28d18d5427941 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 2 Jan 2016 00:55:45 +0100 Subject: WAGE: More work on object interaction --- engines/wage/gui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index f5e1ef5c9b..25629f64b9 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -67,6 +67,7 @@ public: void draw(); void setScene(Scene *scene); void appendText(Common::String &str); + void clearOutput(); void mouseMove(int x, int y); Designed *getClickTarget(int x, int y); -- cgit v1.2.3 From e825eadb80794ea9bdf767b5f9c0e897502a7666 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 2 Jan 2016 02:39:47 +0100 Subject: WAGE: Made Gui autosense scene change --- engines/wage/gui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 25629f64b9..dc04e90c17 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -61,11 +61,10 @@ enum WindowType { class Gui { public: - Gui(); + Gui(WageEngine *engine); ~Gui(); void draw(); - void setScene(Scene *scene); void appendText(Common::String &str); void clearOutput(); void mouseMove(int x, int y); @@ -80,6 +79,7 @@ private: void renderMenu(); private: + WageEngine *_engine; Graphics::Surface _screen; Graphics::Surface _console; Scene *_scene; -- cgit v1.2.3 From 8d6e8118423088ba5c126e2cedf79bb3f41492f6 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 2 Jan 2016 02:53:30 +0100 Subject: WAGE: Redraw Gui parts on demand --- engines/wage/gui.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index dc04e90c17..2fa9e7ab27 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -84,7 +84,9 @@ private: Graphics::Surface _console; Scene *_scene; bool _sceneDirty; + bool _consoleDirty; bool _bordersDirty; + bool _menuDirty; Common::StringArray _out; Common::StringArray _lines; -- cgit v1.2.3 From 077048032b493c5ee81c0ccefaea9acac1a964ba Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 3 Jan 2016 12:23:17 +0100 Subject: WAGE: Refactored coordinate manipulation --- engines/wage/gui.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 2fa9e7ab27..28e1934fd4 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -71,12 +71,13 @@ public: Designed *getClickTarget(int x, int y); private: - void paintBorder(Graphics::Surface *g, int x, int y, int width, int height, WindowType windowType); - void renderConsole(Graphics::Surface *g, int x, int y, int width, int height); + void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); + void renderConsole(Graphics::Surface *g, Common::Rect &r); void drawBox(Graphics::Surface *g, int x, int y, int w, int h); void fillRect(Graphics::Surface *g, int x, int y, int w, int h); void loadFonts(); void renderMenu(); + void flowText(Common::String &str); private: WageEngine *_engine; -- cgit v1.2.3 From 2aef67c0acdffea281daf5cea3aac055bee17d05 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 3 Jan 2016 12:39:29 +0100 Subject: WAGE: Refactored font querying --- engines/wage/gui.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 28e1934fd4..aafc9b3fec 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -49,6 +49,8 @@ #define WAGE_GUI_H #include "common/str-array.h" +#include "graphics/font.h" +#include "graphics/fontman.h" #include "graphics/surface.h" #include "common/rect.h" @@ -78,6 +80,10 @@ private: void loadFonts(); void renderMenu(); void flowText(Common::String &str); + const Graphics::Font *getConsoleFont(); + const Graphics::Font *getMenuFont(); + const Graphics::Font *getTitleFont(); + const Graphics::Font *getFont(const char *name, Graphics::FontManager::FontUsage fallback); private: WageEngine *_engine; -- cgit v1.2.3 From 74cbf5477da7418e94b5ba8a5222a2cae0c16a99 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 3 Jan 2016 15:31:24 +0100 Subject: WAGE: Implement console scrolling --- engines/wage/gui.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index aafc9b3fec..4f2815b18e 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -98,6 +98,9 @@ private: Common::StringArray _out; Common::StringArray _lines; uint _scrollPos; + int _consoleLineHeight; + uint _consoleNumLines; + bool _consoleFullRedraw; bool _builtInFonts; -- cgit v1.2.3 From 0b361b94dc303f95a636e8d183aca7f3854f00e4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 3 Jan 2016 21:59:57 +0100 Subject: WAGE: Initial cursor drawing code --- engines/wage/gui.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 4f2815b18e..1a82c8f713 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -85,9 +85,14 @@ private: const Graphics::Font *getTitleFont(); const Graphics::Font *getFont(const char *name, Graphics::FontManager::FontUsage fallback); +public: + Graphics::Surface _screen; + int _cursorX, _cursorY; + bool _cursorState; + Common::Rect _consoleTextArea; + private: WageEngine *_engine; - Graphics::Surface _screen; Graphics::Surface _console; Scene *_scene; bool _sceneDirty; @@ -104,7 +109,6 @@ private: bool _builtInFonts; - Common::Rect _consoleTextArea; Common::Rect _sceneArea; bool _sceneIsActive; bool _cursorIsArrow; -- cgit v1.2.3 From f97c915c7b0f3ef3c34dfea78619d8c17446638b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 4 Jan 2016 00:09:10 +0100 Subject: WAGE: Display text input --- engines/wage/gui.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 1a82c8f713..cd918f7bd3 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -71,6 +71,7 @@ public: void clearOutput(); void mouseMove(int x, int y); Designed *getClickTarget(int x, int y); + void drawInput(); private: void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); @@ -90,6 +91,7 @@ public: int _cursorX, _cursorY; bool _cursorState; Common::Rect _consoleTextArea; + bool _cursorOff; private: WageEngine *_engine; -- cgit v1.2.3 From 3b48d90f13159afc3b877929b63bea6a8467694c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 4 Jan 2016 12:06:47 +0100 Subject: WAGE: Mark scene as dirty of some object was moved to/from it --- engines/wage/gui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index cd918f7bd3..3c5660b4f2 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -72,6 +72,7 @@ public: void mouseMove(int x, int y); Designed *getClickTarget(int x, int y); void drawInput(); + void setSceneDirty() { _sceneDirty = true; } private: void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); -- cgit v1.2.3 From 5b374c6f55885f61215bada85a57feb293ea0c8d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 11 Jan 2016 11:16:00 +0100 Subject: WAGE: Moved menu rendering into separate file --- engines/wage/gui.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 3c5660b4f2..7e91479b07 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -56,11 +56,23 @@ namespace Wage { +class Menu; + enum WindowType { kWindowScene, kWindowConsole }; +enum { + kMenuHeight = 20, + kMenuPadding = 6, + kMenuItemHeight = 20, + kBorderWidth = 17, + kDesktopArc = 7, + kComponentsPadding = 10, + kCursorHeight = 12 +}; + class Gui { public: Gui(WageEngine *engine); @@ -73,6 +85,7 @@ public: Designed *getClickTarget(int x, int y); void drawInput(); void setSceneDirty() { _sceneDirty = true; } + const Graphics::Font *getFont(const char *name, Graphics::FontManager::FontUsage fallback); private: void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); @@ -80,12 +93,9 @@ private: void drawBox(Graphics::Surface *g, int x, int y, int w, int h); void fillRect(Graphics::Surface *g, int x, int y, int w, int h); void loadFonts(); - void renderMenu(); void flowText(Common::String &str); const Graphics::Font *getConsoleFont(); - const Graphics::Font *getMenuFont(); const Graphics::Font *getTitleFont(); - const Graphics::Font *getFont(const char *name, Graphics::FontManager::FontUsage fallback); public: Graphics::Surface _screen; @@ -94,9 +104,12 @@ public: Common::Rect _consoleTextArea; bool _cursorOff; + bool _builtInFonts; + private: WageEngine *_engine; Graphics::Surface _console; + Menu *_menu; Scene *_scene; bool _sceneDirty; bool _consoleDirty; @@ -110,8 +123,6 @@ private: uint _consoleNumLines; bool _consoleFullRedraw; - bool _builtInFonts; - Common::Rect _sceneArea; bool _sceneIsActive; bool _cursorIsArrow; -- cgit v1.2.3 From faa2588ba4d2074ef7b62ff362c2fce176bfd91e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 11 Jan 2016 11:34:12 +0100 Subject: WAGE: Made rendering of 1st menu level generic --- engines/wage/gui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 7e91479b07..8ba9ce904d 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -105,9 +105,9 @@ public: bool _cursorOff; bool _builtInFonts; + WageEngine *_engine; private: - WageEngine *_engine; Graphics::Surface _console; Menu *_menu; Scene *_scene; -- cgit v1.2.3 From 2d2c8ab340e873b1d4abdbd7573cca40ee3c49b5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 11 Jan 2016 20:17:38 +0100 Subject: WAGE: Highlight first level menus --- engines/wage/gui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 8ba9ce904d..8dea4f85e5 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -82,6 +82,7 @@ public: void appendText(Common::String &str); void clearOutput(); void mouseMove(int x, int y); + void mouseClick(int x, int y); Designed *getClickTarget(int x, int y); void drawInput(); void setSceneDirty() { _sceneDirty = true; } -- cgit v1.2.3 From db9a9665a47a16852613fd0a15799cdaeaa4bb97 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 11 Jan 2016 20:58:37 +0100 Subject: WAGE: Precalculate menu dimensions --- engines/wage/gui.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 8dea4f85e5..c5c1aada0b 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -65,6 +65,8 @@ enum WindowType { enum { kMenuHeight = 20, + kMenuLeftMargin = 7, + kMenuSpacing = 13, kMenuPadding = 6, kMenuItemHeight = 20, kBorderWidth = 17, -- cgit v1.2.3 From a2053eb40522fd1bdbbd1993261fbb53fb407697 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 12 Jan 2016 11:01:11 +0100 Subject: WAGE: Calculate submenu bounds --- engines/wage/gui.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index c5c1aada0b..335af862ab 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -68,6 +68,8 @@ enum { kMenuLeftMargin = 7, kMenuSpacing = 13, kMenuPadding = 6, + kMenuDropdownPadding = 6, + kMenuDropdownItemHeight = 19, kMenuItemHeight = 20, kBorderWidth = 17, kDesktopArc = 7, -- cgit v1.2.3 From a1e9c825794a47b3c5b1c85be544f819d824d6e0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 13 Jan 2016 09:51:15 +0100 Subject: WAGE: Fix menu dropdown dimensions --- engines/wage/gui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 335af862ab..0b35ac4fb0 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -67,8 +67,8 @@ enum { kMenuHeight = 20, kMenuLeftMargin = 7, kMenuSpacing = 13, - kMenuPadding = 6, - kMenuDropdownPadding = 6, + kMenuPadding = 16, + kMenuDropdownPadding = 12, kMenuDropdownItemHeight = 19, kMenuItemHeight = 20, kBorderWidth = 17, -- cgit v1.2.3 From b34308a03c6771f46fb6a0b119024e65949a65d4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 13 Jan 2016 22:11:31 +0100 Subject: WAGE: Fix vertical submenu size --- engines/wage/gui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 0b35ac4fb0..4017702eed 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -69,7 +69,7 @@ enum { kMenuSpacing = 13, kMenuPadding = 16, kMenuDropdownPadding = 12, - kMenuDropdownItemHeight = 19, + kMenuDropdownItemHeight = 15, kMenuItemHeight = 20, kBorderWidth = 17, kDesktopArc = 7, -- cgit v1.2.3 From 4c8b9bb52cfba6b1a723f12ec19463c4cf6282be Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 13 Jan 2016 23:00:30 +0100 Subject: WAGE: Moved global patterns to Gui class --- engines/wage/gui.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 4017702eed..c1af13d8fe 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -77,6 +77,12 @@ enum { kCursorHeight = 12 }; +enum { + kPatternSolid = 1, + kPatternStripes = 2, + kPatternCheckers = 3 +}; + class Gui { public: Gui(WageEngine *engine); @@ -112,6 +118,8 @@ public: bool _builtInFonts; WageEngine *_engine; + Patterns _patterns; + private: Graphics::Surface _console; Menu *_menu; -- cgit v1.2.3 From 5a887808aba3d3a496828549201f563f9ad70c6e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 15 Jan 2016 11:25:50 +0100 Subject: WAGE: Regenerate weapons menu on demand --- engines/wage/gui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index c1af13d8fe..53722d5cf8 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -97,6 +97,7 @@ public: void drawInput(); void setSceneDirty() { _sceneDirty = true; } const Graphics::Font *getFont(const char *name, Graphics::FontManager::FontUsage fallback); + void regenWeaponsMenu(); private: void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); -- cgit v1.2.3 From 40eb91da3ce5d3bd96f749ebc749238d364cc15d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 18 Jan 2016 21:58:31 +0100 Subject: WAGE: More menu finetuning --- engines/wage/gui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 53722d5cf8..4494771466 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -68,8 +68,8 @@ enum { kMenuLeftMargin = 7, kMenuSpacing = 13, kMenuPadding = 16, - kMenuDropdownPadding = 12, - kMenuDropdownItemHeight = 15, + kMenuDropdownPadding = 14, + kMenuDropdownItemHeight = 16, kMenuItemHeight = 20, kBorderWidth = 17, kDesktopArc = 7, -- cgit v1.2.3 From ee8999241e115b4f38c8481ed8257176ced0dbc2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 18 Jan 2016 22:05:46 +0100 Subject: WAGE: Fix submenu rendering --- engines/wage/gui.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 4494771466..3f5a824a32 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -80,7 +80,8 @@ enum { enum { kPatternSolid = 1, kPatternStripes = 2, - kPatternCheckers = 3 + kPatternCheckers = 3, + kPatternCheckers2 = 4 }; class Gui { -- cgit v1.2.3 From 47b3f404b89e23918a3afd688c7865dc12e8f521 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 22 Jan 2016 17:18:49 +0100 Subject: WAGE: Moved all interaction-related methods from script.cpp to combat.cpp --- engines/wage/gui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 3f5a824a32..45ef50c12a 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -90,7 +90,7 @@ public: ~Gui(); void draw(); - void appendText(Common::String &str); + void appendText(const char *str); void clearOutput(); void mouseMove(int x, int y); void mouseClick(int x, int y); -- cgit v1.2.3 From 345effab985f93fdd4f5728fc9f46e58cf64019f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 29 Jan 2016 18:31:19 +0100 Subject: WAGE: Implement WageEngine::setMenu() --- engines/wage/gui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 45ef50c12a..5f15067063 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -98,6 +98,7 @@ public: void drawInput(); void setSceneDirty() { _sceneDirty = true; } const Graphics::Font *getFont(const char *name, Graphics::FontManager::FontUsage fallback); + void regenCommandsMenu(); void regenWeaponsMenu(); private: -- cgit v1.2.3 From 95a3a31ee110df758317944b477d202d77384f42 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 2 Feb 2016 20:21:19 +0100 Subject: WAGE: Initial code for shortcuts --- engines/wage/gui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 5f15067063..b5f84e0c80 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -100,6 +100,7 @@ public: const Graphics::Font *getFont(const char *name, Graphics::FontManager::FontUsage fallback); void regenCommandsMenu(); void regenWeaponsMenu(); + void processMenuShortCut(byte flags, uint16 ascii); private: void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); -- cgit v1.2.3 From 63ef49ec8afa761b89b809811699321c6fe5826e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 3 Feb 2016 10:48:26 +0100 Subject: WAGE: Rename mouse event processor to add clarity --- engines/wage/gui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index b5f84e0c80..488543e485 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -93,8 +93,8 @@ public: void appendText(const char *str); void clearOutput(); void mouseMove(int x, int y); - void mouseClick(int x, int y); - Designed *getClickTarget(int x, int y); + void mouseDown(int x, int y); + Designed *mouseUp(int x, int y); void drawInput(); void setSceneDirty() { _sceneDirty = true; } const Graphics::Font *getFont(const char *name, Graphics::FontManager::FontUsage fallback); -- cgit v1.2.3 From d812706328ddd31bd23b425d7d4eb7777d29ae55 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 3 Feb 2016 11:01:41 +0100 Subject: WAGE: Started text selection implementation --- engines/wage/gui.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 488543e485..09c4693ba8 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -111,6 +111,7 @@ private: void flowText(Common::String &str); const Graphics::Font *getConsoleFont(); const Graphics::Font *getTitleFont(); + void startMarking(int x, int y); public: Graphics::Surface _screen; @@ -143,6 +144,8 @@ private: Common::Rect _sceneArea; bool _sceneIsActive; bool _cursorIsArrow; + + bool _inTextSelection; }; } // End of namespace Wage -- cgit v1.2.3 From 0ab0daa1dc2717a39455b85048d26570544751a6 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 3 Feb 2016 19:02:08 +0100 Subject: WAGE: Further work on console selection --- engines/wage/gui.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 09c4693ba8..6adba2721c 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -112,6 +112,9 @@ private: const Graphics::Font *getConsoleFont(); const Graphics::Font *getTitleFont(); void startMarking(int x, int y); + int calcTextX(int x, int textLine); + int calcTextY(int y); + void updateTextSelection(int x, int y); public: Graphics::Surface _screen; @@ -146,6 +149,10 @@ private: bool _cursorIsArrow; bool _inTextSelection; + int _selectionStartX; + int _selectionStartY; + int _selectionEndX; + int _selectionEndY; }; } // End of namespace Wage -- cgit v1.2.3 From 06ba17395d0bbd3a099d692a6e1356b4c67f1d8b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 4 Feb 2016 18:59:36 +0100 Subject: WAGE: Fix cursors during dialogs --- engines/wage/gui.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 6adba2721c..4f3b0f9aa0 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -101,6 +101,8 @@ public: void regenCommandsMenu(); void regenWeaponsMenu(); void processMenuShortCut(byte flags, uint16 ascii); + void pushArrowCursor(); + void popCursor(); private: void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); -- cgit v1.2.3 From fe40bb284c7cefbfc82c59fc1fd3a0c081416902 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 5 Feb 2016 11:14:10 +0100 Subject: WAGE: Started copy command implementation --- engines/wage/gui.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 4f3b0f9aa0..16421276be 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -104,6 +104,8 @@ public: void pushArrowCursor(); void popCursor(); + void actionCopy(); + private: void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); void renderConsole(Graphics::Surface *g, Common::Rect &r); @@ -155,6 +157,8 @@ private: int _selectionStartY; int _selectionEndX; int _selectionEndY; + + Common::String _clipboard; }; } // End of namespace Wage -- cgit v1.2.3 From 3570e417c9ab4ab47be65b76d0481f6323e6e74e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 5 Feb 2016 19:33:30 +0100 Subject: WAGE: Implement Paste action --- engines/wage/gui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 16421276be..7270a782ce 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -105,6 +105,7 @@ public: void popCursor(); void actionCopy(); + void actionPaste(); private: void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); -- cgit v1.2.3 From 1d5220ef3fb5ed1a869d88ee67b28cb0433f8578 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 5 Feb 2016 19:37:13 +0100 Subject: WAGE: Implement Undo action --- engines/wage/gui.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 7270a782ce..6d33abb948 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -106,6 +106,7 @@ public: void actionCopy(); void actionPaste(); + void actionUndo(); private: void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); @@ -160,6 +161,7 @@ private: int _selectionEndY; Common::String _clipboard; + Common::String _undobuffer; }; } // End of namespace Wage -- cgit v1.2.3 From ab20b96f604f6819dfe6f03286a01bb899fde291 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 8 Feb 2016 18:26:16 +0100 Subject: WAGE: Improve text entry --- engines/wage/gui.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 6d33abb948..2353a59795 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -162,6 +162,8 @@ private: Common::String _clipboard; Common::String _undobuffer; + + int _inputTextLineNum; }; } // End of namespace Wage -- cgit v1.2.3 From c80bc8cbe0b02c8cd4ced475e395aadc5a06158f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 12 Feb 2016 11:28:42 +0100 Subject: WAGE: Move all console-related stuff to gui-console.cpp --- engines/wage/gui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 2353a59795..ae53f4b6c2 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -109,6 +109,7 @@ public: void actionUndo(); private: + void undrawCursor(); void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType); void renderConsole(Graphics::Surface *g, Common::Rect &r); void drawBox(Graphics::Surface *g, int x, int y, int w, int h); -- cgit v1.2.3 From 1158987a1e4f078ed1ae699409fd26558486722e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 12 Feb 2016 19:16:55 +0100 Subject: WAGE: Disable Undo action after command exectution --- engines/wage/gui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index ae53f4b6c2..652e0ff1e4 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -107,6 +107,7 @@ public: void actionCopy(); void actionPaste(); void actionUndo(); + void disableUndo(); private: void undrawCursor(); -- cgit v1.2.3 From 5cea5a4d3aa712c21fbdfd9283c8ce9981086a67 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 12 Feb 2016 19:36:08 +0100 Subject: WAGE: Implement Cut and Clear actions --- engines/wage/gui.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 652e0ff1e4..f679faa5cd 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -107,6 +107,8 @@ public: void actionCopy(); void actionPaste(); void actionUndo(); + void actionClear(); + void actionCut(); void disableUndo(); private: -- cgit v1.2.3 From 9c8d0352ad5078606c1b854a599e964c1d4d1ad2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 14 Feb 2016 13:37:24 +0100 Subject: WAGE: Avoid potential race condition in cursor drawing code --- engines/wage/gui.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/wage/gui.h') diff --git a/engines/wage/gui.h b/engines/wage/gui.h index f679faa5cd..8cdc827bf0 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -138,6 +138,9 @@ public: Patterns _patterns; + bool _cursorDirty; + Common::Rect _cursorRect; + private: Graphics::Surface _console; Menu *_menu; -- cgit v1.2.3