diff options
author | Paul Gilbert | 2019-01-06 14:07:14 -0800 |
---|---|---|
committer | Paul Gilbert | 2019-01-06 14:07:14 -0800 |
commit | 302d26bf42a56eb0d9c82b4eabface8736249f64 (patch) | |
tree | 7e7cf36352dcd20afdca77d0f45d1e14af3ad24c /engines/glk | |
parent | 8515590b47ca297880df59f81f305b00b7c5384a (diff) | |
download | scummvm-rg350-302d26bf42a56eb0d9c82b4eabface8736249f64.tar.gz scummvm-rg350-302d26bf42a56eb0d9c82b4eabface8736249f64.tar.bz2 scummvm-rg350-302d26bf42a56eb0d9c82b4eabface8736249f64.zip |
GLK: FROTZ: Force v6 games to 320x200
As much as I'd like to allow for variable resolution sizes,
the graphics in Zork Zero are geared specifically for a 320x200
screen. Maybe in the future I can allow for automatic stretching
to fit any screen size, but for now it's more important to get
the v6 games working at all
Diffstat (limited to 'engines/glk')
-rw-r--r-- | engines/glk/frotz/frotz.cpp | 14 | ||||
-rw-r--r-- | engines/glk/frotz/frotz.h | 5 | ||||
-rw-r--r-- | engines/glk/frotz/glk_interface.cpp | 8 | ||||
-rw-r--r-- | engines/glk/frotz/screen.cpp | 6 | ||||
-rw-r--r-- | engines/glk/glk.h | 10 |
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(); |