aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_stacks
diff options
context:
space:
mode:
authorEugene Sandulenko2018-06-15 00:48:00 +0200
committerBastien Bouclet2018-06-29 13:31:54 +0200
commit0ca52f62a4b475081f77eb933934c8f3448f33e2 (patch)
tree575770bfee6b8d5204f4085c8d6a6d52291373e0 /engines/mohawk/riven_stacks
parent1e9b58ab4bf864456de315c03c3cf3d0d2a81b2e (diff)
downloadscummvm-rg350-0ca52f62a4b475081f77eb933934c8f3448f33e2.tar.gz
scummvm-rg350-0ca52f62a4b475081f77eb933934c8f3448f33e2.tar.bz2
scummvm-rg350-0ca52f62a4b475081f77eb933934c8f3448f33e2.zip
MOHAWK: RIVEN: Draw menu with TTF fonts
Diffstat (limited to 'engines/mohawk/riven_stacks')
-rw-r--r--engines/mohawk/riven_stacks/aspit.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/engines/mohawk/riven_stacks/aspit.cpp b/engines/mohawk/riven_stacks/aspit.cpp
index 67b416c9ca..1c6f330b64 100644
--- a/engines/mohawk/riven_stacks/aspit.cpp
+++ b/engines/mohawk/riven_stacks/aspit.cpp
@@ -31,6 +31,10 @@
#include "common/translation.h"
+#include "graphics/fonts/ttf.h"
+#include "graphics/font.h"
+#include "graphics/fontman.h"
+
#include "gui/message.h"
namespace Mohawk {
@@ -62,9 +66,52 @@ ASpit::ASpit(MohawkEngine_Riven *vm) :
REGISTER_COMMAND(ASpit, xaexittomain);
}
+static const char *menuItems[] = {
+ "SETUP",
+ "START NEW GAME",
+ "START SAVED GAME",
+ 0
+};
+
void ASpit::xastartupbtnhide(const ArgumentArray &args) {
// The original game hides the start/setup buttons depending on an ini entry.
// It's safe to ignore this command.
+
+ warning("xastartupbtnhide");
+
+ Graphics::Surface surface;
+ surface.create(115, 200, _vm->_gfx->getBackScreen()->format);
+ surface.fillRect(Common::Rect(0, 0, 115, 200), 0);
+
+ Common::File file;
+
+ const char *fontname = "FreeSans.ttf";
+ int fontHeight = 11;
+ const Graphics::Font *font = nullptr;
+
+ if (file.open(fontname)) {
+ font = Graphics::loadTTFFont(file, fontHeight);
+ }
+
+ if (!font) {
+ warning("Cannot load font %s directly", fontname);
+ font = FontMan.getFontByName(fontname);
+ }
+
+ if (!font) {
+ warning("Cannot load font %s", fontname);
+
+ font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
+ }
+
+ int y = 70;
+
+ for (const char **item = menuItems; *item; item++) {
+ font->drawString(&surface, *item, 0, y, surface.w, 0xffffff);
+ y += fontHeight * 2.5;
+ }
+
+ _vm->_gfx->copySurfaceToScreen(&surface, 485, 160);
}
void ASpit::xasetupcomplete(const ArgumentArray &args) {