Permalink
Browse files

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
  • Loading branch information...
dreammaster committed Jan 6, 2019
1 parent 8515590 commit 302d26bf42a56eb0d9c82b4eabface8736249f64
@@ -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();
}
@@ -36,6 +36,11 @@ class FrotzScreen;
class Frotz : public Processor {
friend class FrotzScreen;
protected:
/**
* Setup the video mode
*/
virtual void initGraphicsMode();

/**
* Create the screen class
*/
@@ -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);
}
}
}
@@ -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
@@ -72,11 +72,6 @@ class GlkEngine : public Engine {
* Handles basic initialization
*/
void initialize();

/**
* Setup the video mode
*/
void initGraphicsMode();
protected:
const GlkGameDescription _gameDescription;
Common::RandomSource _random;
@@ -91,6 +86,11 @@ class GlkEngine : public Engine {
*/
virtual bool hasFeature(EngineFeature f) const;

/**
* Setup the video mode
*/
virtual void initGraphicsMode();

/**
* Create the screen
*/

0 comments on commit 302d26b

Please sign in to comment.