aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/glk/frotz/frotz.cpp14
-rw-r--r--engines/glk/frotz/frotz.h5
-rw-r--r--engines/glk/frotz/glk_interface.cpp8
-rw-r--r--engines/glk/frotz/screen.cpp6
-rw-r--r--engines/glk/glk.h10
5 files changed, 30 insertions, 13 deletions
diff --git a/engines/glk/frotz/frotz.cpp b/engines/glk/frotz/frotz.cpp
index 8ec3db7133..0c33f417ec 100644
--- a/engines/glk/frotz/frotz.cpp
+++ b/engines/glk/frotz/frotz.cpp
@@ -24,6 +24,7 @@
#include "glk/frotz/frotz_types.h"
#include "glk/frotz/screen.h"
#include "glk/frotz/quetzal.h"
+#include "engines/util.h"
#include "common/config-manager.h"
namespace Glk {
@@ -40,6 +41,19 @@ Frotz::~Frotz() {
reset_memory();
}
+void Frotz::initGraphicsMode() {
+ _gameFile.seek(0);
+ byte version = _gameFile.readByte();
+
+ if (version == 6) {
+ // The V6 games have graphics that expect 320x200 mode
+ Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
+ initGraphics(320, 200, &pixelFormat);
+ } else {
+ GlkEngine::initGraphicsMode();
+ }
+}
+
Screen *Frotz::createScreen() {
return new FrotzScreen();
}
diff --git a/engines/glk/frotz/frotz.h b/engines/glk/frotz/frotz.h
index b5de82d7f8..8312e16b49 100644
--- a/engines/glk/frotz/frotz.h
+++ b/engines/glk/frotz/frotz.h
@@ -37,6 +37,11 @@ class Frotz : public Processor {
friend class FrotzScreen;
protected:
/**
+ * Setup the video mode
+ */
+ virtual void initGraphicsMode();
+
+ /**
* Create the screen class
*/
virtual Screen *createScreen() override;
diff --git a/engines/glk/frotz/glk_interface.cpp b/engines/glk/frotz/glk_interface.cpp
index 959ab31064..46a6caa707 100644
--- a/engines/glk/frotz/glk_interface.cpp
+++ b/engines/glk/frotz/glk_interface.cpp
@@ -350,13 +350,11 @@ void GlkInterface::gos_update_height() {
void GlkInterface::reset_status_ht() {
uint height;
- if (_wp._upper) {
+ if (_wp._upper && h_version != 6) {
glk_window_get_size(_wp._upper, nullptr, &height);
if ((uint)mach_status_ht != height) {
- glk_window_set_arrangement(
- glk_window_get_parent(_wp._upper),
- winmethod_Above | winmethod_Fixed,
- mach_status_ht, nullptr);
+ glk_window_set_arrangement(glk_window_get_parent(_wp._upper),
+ winmethod_Above | winmethod_Fixed, mach_status_ht, nullptr);
}
}
}
diff --git a/engines/glk/frotz/screen.cpp b/engines/glk/frotz/screen.cpp
index 06b36167e8..f364a23142 100644
--- a/engines/glk/frotz/screen.cpp
+++ b/engines/glk/frotz/screen.cpp
@@ -42,9 +42,9 @@ void FrotzScreen::loadFonts(Common::Archive *archive) {
byte version = g_vm->_gameFile.readByte();
if (version == 6) {
- // For graphical games, force both mono and proportinate fonts to be the same size.
- // This simplifies calculation of pixels when setting window position and sizes
- g_conf->_monoInfo._size = g_conf->_propInfo._size = MAX(g_conf->_monoInfo._size, g_conf->_propInfo._size);
+ // For graphical games, ignore any font configurations and force their size
+ g_conf->_monoInfo._size = g_conf->_propInfo._size = 7;
+ g_conf->_monoInfo._aspect = g_conf->_propInfo._aspect = 1.0;
}
// Load the basic fonts
diff --git a/engines/glk/glk.h b/engines/glk/glk.h
index 2782353547..17ee3568aa 100644
--- a/engines/glk/glk.h
+++ b/engines/glk/glk.h
@@ -72,11 +72,6 @@ private:
* Handles basic initialization
*/
void initialize();
-
- /**
- * Setup the video mode
- */
- void initGraphicsMode();
protected:
const GlkGameDescription _gameDescription;
Common::RandomSource _random;
@@ -92,6 +87,11 @@ protected:
virtual bool hasFeature(EngineFeature f) const;
/**
+ * Setup the video mode
+ */
+ virtual void initGraphicsMode();
+
+ /**
* Create the screen
*/
virtual Screen *createScreen();