GLK: Changing class and namespaces from Gargoyle to Glk

This commit is contained in:
Paul Gilbert 2018-11-13 20:05:59 -08:00 committed by Paul Gilbert
parent 1fb931fbd9
commit a2104deb4c
74 changed files with 1901 additions and 1901 deletions

View file

@ -22,7 +22,7 @@
#include "glk/blorb.h"
namespace Gargoyle {
namespace Glk {
#define giblorb_Inited_Magic 0xB7012BEDU
@ -540,4 +540,4 @@ bool Blorb::giblorb_is_resource_map(void) const {
return _map != nullptr;
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -26,7 +26,7 @@
#include "glk/glk_types.h"
#include "glk/streams.h"
namespace Gargoyle {
namespace Glk {
/**
@ -141,6 +141,6 @@ public:
glui32 usage, glui32 *num, glui32 *min, glui32 *max);
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -27,7 +27,7 @@
#include "common/config-manager.h"
#include "common/system.h"
namespace Gargoyle {
namespace Glk {
const byte WHITE[3] = { 0xff, 0xff, 0xff };
const byte BLUE[3] = { 0x00, 0x00, 0x60 };
@ -251,4 +251,4 @@ void Conf::parseColor(const Common::String &str, byte *color) {
}
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -27,7 +27,7 @@
#include "glk/fonts.h"
#include "glk/windows.h"
namespace Gargoyle {
namespace Glk {
class Conf {
private:
@ -131,6 +131,6 @@ public:
extern Conf *g_conf;
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -20,7 +20,7 @@
*
*/
#include "glk/gargoyle.h"
#include "glk/glk.h"
#include "base/plugins.h"
#include "common/md5.h"
@ -34,44 +34,44 @@
#define MAX_SAVES 99
namespace Gargoyle {
namespace Glk {
struct GargoyleGameDescription {
struct GlkGameDescription {
ADGameDescription _desc;
Common::String _filename;
InterpreterType _interpType;
Common::String _md5;
};
const Common::String &GargoyleEngine::getFilename() const {
const Common::String &GlkEngine::getFilename() const {
return _gameDescription->_filename;
}
uint32 GargoyleEngine::getFeatures() const {
uint32 GlkEngine::getFeatures() const {
return _gameDescription->_desc.flags;
}
bool GargoyleEngine::isDemo() const {
bool GlkEngine::isDemo() const {
return (bool)(_gameDescription->_desc.flags & ADGF_DEMO);
}
Common::Language GargoyleEngine::getLanguage() const {
Common::Language GlkEngine::getLanguage() const {
return _gameDescription->_desc.language;
}
InterpreterType GargoyleEngine::getInterpreterType() const {
InterpreterType GlkEngine::getInterpreterType() const {
return _gameDescription->_interpType;
}
const Common::String &GargoyleEngine::getGameMD5() const {
const Common::String &GlkEngine::getGameMD5() const {
return _gameDescription->_md5;
}
} // End of namespace Gargoyle
} // End of namespace Glk
#include "glk/frotz/detection_tables.h"
#define ZCODE(ID, NAME) { ID, Gargoyle::Frotz::NAME##_DESC }
#define ZCODE(ID, NAME) { ID, Glk::Frotz::NAME##_DESC }
static const PlainGameDescriptor gargoyleGames[] = {
static const PlainGameDescriptor glkGames[] = {
{"zcode", "Zcode Games" },
{"scottadams", "Scott Adams Games"},
@ -146,9 +146,9 @@ static const PlainGameDescriptor gargoyleGames[] = {
#include "glk/scott/detection.h"
#include "glk/scott/scott.h"
class GargoyleMetaEngine : public AdvancedMetaEngine {
class GlkMetaEngine : public AdvancedMetaEngine {
public:
GargoyleMetaEngine() : AdvancedMetaEngine(Gargoyle::gameDescriptions, sizeof(Gargoyle::GargoyleGameDescription), gargoyleGames) {
GlkMetaEngine() : AdvancedMetaEngine(Glk::gameDescriptions, sizeof(Glk::GlkGameDescription), glkGames) {
_maxScanDepth = 3;
}
@ -172,7 +172,7 @@ public:
virtual ADDetectedGames detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const override;
};
bool GargoyleMetaEngine::hasFeature(MetaEngineFeature f) const {
bool GlkMetaEngine::hasFeature(MetaEngineFeature f) const {
return
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
@ -183,22 +183,22 @@ bool GargoyleMetaEngine::hasFeature(MetaEngineFeature f) const {
(f == kSimpleSavesNames);
}
bool Gargoyle::GargoyleEngine::hasFeature(EngineFeature f) const {
bool Glk::GlkEngine::hasFeature(EngineFeature f) const {
return
(f == kSupportsRTL) ||
(f == kSupportsLoadingDuringRuntime) ||
(f == kSupportsSavingDuringRuntime);
}
bool GargoyleMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
const Gargoyle::GargoyleGameDescription *gd = (const Gargoyle::GargoyleGameDescription *)desc;
bool GlkMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
const Glk::GlkGameDescription *gd = (const Glk::GlkGameDescription *)desc;
switch (gd->_interpType) {
case Gargoyle::INTERPRETER_FROTZ:
*engine = new Gargoyle::Frotz::Frotz(syst, gd);
case Glk::INTERPRETER_FROTZ:
*engine = new Glk::Frotz::Frotz(syst, gd);
break;
case Gargoyle::INTERPRETER_SCOTT:
*engine = new Gargoyle::Scott::Scott(syst, gd);
case Glk::INTERPRETER_SCOTT:
*engine = new Glk::Scott::Scott(syst, gd);
break;
default:
error("Unknown interpreter");
@ -207,12 +207,12 @@ bool GargoyleMetaEngine::createInstance(OSystem *syst, Engine **engine, const AD
return gd != 0;
}
SaveStateList GargoyleMetaEngine::listSaves(const char *target) const {
SaveStateList GlkMetaEngine::listSaves(const char *target) const {
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
Common::StringArray filenames;
Common::String saveDesc;
Common::String pattern = Common::String::format("%s.0##", target);
Gargoyle::SavegameHeader header;
Glk::SavegameHeader header;
filenames = saveFileMan->listSavefiles(pattern);
@ -225,7 +225,7 @@ SaveStateList GargoyleMetaEngine::listSaves(const char *target) const {
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
if (in) {
if (Gargoyle::FileStream::readSavegameHeader(in, header))
if (Glk::FileStream::readSavegameHeader(in, header))
saveList.push_back(SaveStateDescriptor(slot, header._saveName));
delete in;
@ -238,22 +238,22 @@ SaveStateList GargoyleMetaEngine::listSaves(const char *target) const {
return saveList;
}
int GargoyleMetaEngine::getMaximumSaveSlot() const {
int GlkMetaEngine::getMaximumSaveSlot() const {
return MAX_SAVES;
}
void GargoyleMetaEngine::removeSaveState(const char *target, int slot) const {
void GlkMetaEngine::removeSaveState(const char *target, int slot) const {
Common::String filename = Common::String::format("%s.%03d", target, slot);
g_system->getSavefileManager()->removeSavefile(filename);
}
SaveStateDescriptor GargoyleMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
SaveStateDescriptor GlkMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
Common::String filename = Common::String::format("%s.%03d", target, slot);
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename);
if (in) {
Gargoyle::SavegameHeader header;
if (Gargoyle::FileStream::readSavegameHeader(in, header)) {
Glk::SavegameHeader header;
if (Glk::FileStream::readSavegameHeader(in, header)) {
// Create the return descriptor
SaveStateDescriptor desc(slot, header._saveName);
desc.setSaveDate(header._year, header._month, header._day);
@ -268,17 +268,17 @@ SaveStateDescriptor GargoyleMetaEngine::querySaveMetaInfos(const char *target, i
return SaveStateDescriptor();
}
DetectedGames GargoyleMetaEngine::detectGames(const Common::FSList &fslist) const {
DetectedGames GlkMetaEngine::detectGames(const Common::FSList &fslist) const {
DetectedGames detectedGames;
Gargoyle::Frotz::FrotzMetaEngine::detectGames(fslist, detectedGames);
Gargoyle::Scott::ScottMetaEngine::detectGames(fslist, detectedGames);
Glk::Frotz::FrotzMetaEngine::detectGames(fslist, detectedGames);
Glk::Scott::ScottMetaEngine::detectGames(fslist, detectedGames);
return detectedGames;
}
static Gargoyle::GargoyleGameDescription gameDescription;
static Glk::GlkGameDescription gameDescription;
ADDetectedGames GargoyleMetaEngine::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const {
ADDetectedGames GlkMetaEngine::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const {
static char gameId[100];
strcpy(gameId, ConfMan.get("gameid").c_str());
Common::String filename = ConfMan.get("filename");
@ -290,10 +290,10 @@ ADDetectedGames GargoyleMetaEngine::detectGame(const Common::FSNode &parent, con
Common::File f;
// Check each sub-engine for any detected games
if (Gargoyle::Frotz::FrotzMetaEngine::detectGames(fslist, detectedGames))
gameDescription._interpType = Gargoyle::INTERPRETER_FROTZ;
else if (Gargoyle::Scott::ScottMetaEngine::detectGames(fslist, detectedGames))
gameDescription._interpType = Gargoyle::INTERPRETER_SCOTT;
if (Glk::Frotz::FrotzMetaEngine::detectGames(fslist, detectedGames))
gameDescription._interpType = Glk::INTERPRETER_FROTZ;
else if (Glk::Scott::ScottMetaEngine::detectGames(fslist, detectedGames))
gameDescription._interpType = Glk::INTERPRETER_SCOTT;
else
// No match found, so return no results
return results;
@ -317,7 +317,7 @@ ADDetectedGames GargoyleMetaEngine::detectGame(const Common::FSNode &parent, con
}
#if PLUGIN_ENABLED_DYNAMIC(GLK)
REGISTER_PLUGIN_DYNAMIC(GLK, PLUGIN_TYPE_ENGINE, GargoyleMetaEngine);
REGISTER_PLUGIN_DYNAMIC(GLK, PLUGIN_TYPE_ENGINE, GlkMetaEngine);
#else
REGISTER_PLUGIN_STATIC(GLK, PLUGIN_TYPE_ENGINE, GargoyleMetaEngine);
REGISTER_PLUGIN_STATIC(GLK, PLUGIN_TYPE_ENGINE, GlkMetaEngine);
#endif

View file

@ -20,10 +20,10 @@
*
*/
namespace Gargoyle {
namespace Glk {
static const GargoyleGameDescription gameDescriptions[] = {
static const GlkGameDescription gameDescriptions[] = {
{ AD_TABLE_END_MARKER, "", (InterpreterType)0, "" }
};
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -22,13 +22,13 @@
#include "glk/events.h"
#include "glk/conf.h"
#include "glk/gargoyle.h"
#include "glk/glk.h"
#include "glk/screen.h"
#include "glk/selection.h"
#include "glk/windows.h"
#include "graphics/cursorman.h"
namespace Gargoyle {
namespace Glk {
const byte ARROW[] = {
// byte 1: number of skipped pixels
@ -399,4 +399,4 @@ bool Events::isTimerExpired() const {
return _timerMilli && g_system->getMillis() >= _timerTimeExpiry;
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -27,7 +27,7 @@
#include "graphics/surface.h"
#include "glk/utils.h"
namespace Gargoyle {
namespace Glk {
#define GAME_FRAME_RATE 100
#define GAME_FRAME_TIME (1000 / GAME_FRAME_RATE)
@ -286,6 +286,6 @@ public:
bool isTimerExpired() const;
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -23,13 +23,13 @@
#include "glk/fonts.h"
#include "glk/glk_types.h"
#include "glk/conf.h"
#include "glk/gargoyle.h"
#include "glk/glk.h"
#include "common/memstream.h"
#include "common/unzip.h"
#include "graphics/fonts/ttf.h"
#include "graphics/fontman.h"
namespace Gargoyle {
namespace Glk {
#define FONTS_VERSION 1.0
#define FONTS_FILENAME "fonts.dat"
@ -154,4 +154,4 @@ size_t Fonts::stringWidthUni(int fontIdx, const Common::U32String &text, int spw
return font->getStringWidth(text) * GLI_SUBPIX;
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -32,7 +32,7 @@
#include "common/ustr.h"
#include "graphics/font.h"
namespace Gargoyle {
namespace Glk {
#define FONTS_TOTAL 8
@ -113,6 +113,6 @@ public:
size_t stringWidthUni(int fontIdx, const Common::U32String &text, int spw = 0);
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -26,7 +26,7 @@
#include "glk/frotz/detection_tables.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &gameList) {
@ -77,4 +77,4 @@ bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
}
} // End of namespace Frotz
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -26,7 +26,7 @@
#include "common/fs.h"
#include "engines/game.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
class FrotzMetaEngine {
@ -38,6 +38,6 @@ public:
};
} // End of namespace Frotz
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -22,7 +22,7 @@
#include "glk/frotz/detection_tables.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
const char *const AMFV_DESC = "A Mind Forever Voyaging";
@ -82,4 +82,4 @@ const FrotzGameDescription FROTZ_GAMES[] = {
} // End of namespace Frotz
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -23,7 +23,7 @@
#include "engines/advancedDetector.h"
#include "common/language.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
/**
@ -82,4 +82,4 @@ extern const char *const ZORK3_DESC;
extern const char *const ZTUU_DESC;
} // End of namespace Frotz
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -24,12 +24,12 @@
#include "glk/frotz/frotz_types.h"
#include "common/config-manager.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
Frotz *g_vm;
Frotz::Frotz(OSystem *syst, const GargoyleGameDescription *gameDesc) :
Frotz::Frotz(OSystem *syst, const GlkGameDescription *gameDesc) :
Processor(syst, gameDesc) {
g_vm = this;
}
@ -95,4 +95,4 @@ Common::Error Frotz::saveGameState(int slot, const Common::String &desc) {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -25,7 +25,7 @@
#include "glk/frotz/processor.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
/**
@ -36,7 +36,7 @@ public:
/**
* Constructor
*/
Frotz(OSystem *syst, const GargoyleGameDescription *gameDesc);
Frotz(OSystem *syst, const GlkGameDescription *gameDesc);
/**
* Destructor
@ -67,6 +67,6 @@ public:
extern Frotz *g_vm;
} // End of namespace Frotz
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -26,7 +26,7 @@
#include "glk/glk_types.h"
#include "common/algorithm.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
#define MAX_UNDO_SLOTS 500
@ -292,6 +292,6 @@ struct Redirect {
};
} // End of namespace Frotz
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -22,11 +22,11 @@
#include "glk/frotz/glk_interface.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
GlkInterface::GlkInterface(OSystem *syst, const GargoyleGameDescription *gameDesc) :
Glk(syst, gameDesc),
GlkInterface::GlkInterface(OSystem *syst, const GlkGameDescription *gameDesc) :
GlkAPI(syst, gameDesc),
oldstyle(0), curstyle(0), cury(1), curx(1), fixforced(0),
curr_fg(-2), curr_bg(-2), curr_font(1), prev_font(1), temp_font(0),
curr_status_ht(0), mach_status_ht(0), gos_status(nullptr), gos_upper(nullptr),
@ -495,4 +495,4 @@ zchar GlkInterface::os_read_line(int max, zchar *buf, int timeout, int width, in
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -23,10 +23,10 @@
#ifndef GLK_FROTZ_GLK_INTERFACE
#define GLK_FROTZ_GLK_INTERFACE
#include "glk/glk.h"
#include "glk/glk_api.h"
#include "glk/frotz/mem.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
enum SoundEffect {
@ -47,7 +47,7 @@ enum RestartAction {
* Implements an intermediate interface on top of the GLK layer, providing screen
* and sound effect handling
*/
class GlkInterface : public Glk, public virtual UserOptions, public virtual Mem {
class GlkInterface : public GlkAPI, public virtual UserOptions, public virtual Mem {
public:
zchar statusline[256];
int oldstyle;
@ -181,7 +181,7 @@ public:
/**
* Constructor
*/
GlkInterface(OSystem *syst, const GargoyleGameDescription *gameDesc);
GlkInterface(OSystem *syst, const GlkGameDescription *gameDesc);
/**
* Initialization
@ -190,6 +190,6 @@ public:
};
} // End of namespace Frotz
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -25,7 +25,7 @@
#include "common/memstream.h"
#include "common/textconsole.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
const Header::StoryEntry Header::RECORDS[25] = {
@ -416,4 +416,4 @@ void Mem::mem_undiff(zbyte *diff, long diff_length, zbyte *dest) {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -25,7 +25,7 @@
#include "glk/frotz/frotz_types.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
#define SET_WORD(addr,v) zmp[addr] = hi(v); zmp[addr+1] = lo(v)
@ -275,6 +275,6 @@ public:
};
} // End of namespace Frotz
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -23,7 +23,7 @@
#include "glk/frotz/processor.h"
#include "glk/frotz/frotz.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
// TODO: Stubs to replace with actual code
@ -131,7 +131,7 @@ Opcode Processor::ext_opcodes[64] = {
&Processor::z_buffer_screen, // spec 1.1
};
Processor::Processor(OSystem *syst, const GargoyleGameDescription *gameDesc) :
Processor::Processor(OSystem *syst, const GlkGameDescription *gameDesc) :
GlkInterface(syst, gameDesc),
_finished(0), _sp(nullptr), _fp(nullptr), _frameCount(0),
zargc(0), _decoded(nullptr), _encoded(nullptr), _resolution(0),
@ -661,4 +661,4 @@ void Processor::z_restore_undo(void) {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -28,7 +28,7 @@
#include "glk/frotz/frotz_types.h"
#include "common/stack.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
#define TEXT_BUFFER_SIZE 200
@ -1522,7 +1522,7 @@ public:
/**
* Constructor
*/
Processor(OSystem *syst, const GargoyleGameDescription *gameDesc);
Processor(OSystem *syst, const GlkGameDescription *gameDesc);
/**
* Initialization
@ -1579,6 +1579,6 @@ public:
};
} // End of namespace Frotz
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -24,7 +24,7 @@
#include "common/algorithm.h"
#include "common/textconsole.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
const char *const Processor::ERR_MESSAGES[ERR_NUM_ERRORS] = {
@ -189,4 +189,4 @@ void Processor::runtimeError(ErrorCode errNum) {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -22,7 +22,7 @@
#include "glk/frotz/processor.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
#define INPUT_BUFFER_SIZE 200
@ -220,4 +220,4 @@ void Processor::z_read_mouse(){
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -22,7 +22,7 @@
#include "glk/frotz/processor.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
void Processor::z_add() {
@ -102,4 +102,4 @@ void Processor::z_test() {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -22,7 +22,7 @@
#include "glk/frotz/processor.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
void Processor::flagsChanged(zbyte value) {
@ -215,4 +215,4 @@ void Processor::memory_close(void) {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -22,7 +22,7 @@
#include "glk/frotz/processor.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
#define MAX_OBJECT 2000
@ -729,4 +729,4 @@ void Processor::z_test_attr() {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -22,7 +22,7 @@
#include "glk/frotz/processor.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
void Processor::screen_mssg_on() {
@ -525,4 +525,4 @@ void Processor::z_split_window() {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -23,7 +23,7 @@
#include "glk/frotz/processor.h"
#include "glk/frotz/quetzal.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
zchar Processor::console_read_input(int max, zchar *buf, zword timeout, bool continued) {
@ -783,4 +783,4 @@ void Processor::z_verify() {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -22,7 +22,7 @@
#include "glk/frotz/processor.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
void Processor::z_copy_table() {
@ -117,4 +117,4 @@ void Processor::z_storew() {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -22,7 +22,7 @@
#include "glk/frotz/processor.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
zchar Processor::ZSCII_TO_LATIN1[] = {
@ -883,4 +883,4 @@ void Processor::z_tokenise() {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -22,7 +22,7 @@
#include "glk/frotz/processor.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
void Processor::z_dec() {
@ -196,4 +196,4 @@ void Processor::z_store() {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -24,7 +24,7 @@
#include "glk/frotz/processor.h"
#include "common/memstream.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
/**
@ -482,4 +482,4 @@ int Quetzal::restore(Common::SeekableReadStream *svf, Processor *proc) {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -26,7 +26,7 @@
#include "glk/glk_types.h"
#include "glk/frotz/frotz_types.h"
namespace Gargoyle {
namespace Glk {
namespace Frotz {
enum QueztalTag {
@ -92,6 +92,6 @@ public:
};
} // End of namespace Frotz
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -1,120 +0,0 @@
/* 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.
*
*/
#include "common/scummsys.h"
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/events.h"
#include "common/file.h"
#include "engines/util.h"
#include "graphics/scaler.h"
#include "graphics/thumbnail.h"
#include "glk/gargoyle.h"
#include "glk/conf.h"
#include "glk/events.h"
#include "glk/picture.h"
#include "glk/screen.h"
#include "glk/selection.h"
#include "glk/streams.h"
#include "glk/windows.h"
namespace Gargoyle {
GargoyleEngine *g_vm;
GargoyleEngine::GargoyleEngine(OSystem *syst, const GargoyleGameDescription *gameDesc) :
_gameDescription(gameDesc), Engine(syst), _random("Gargoyle"), _clipboard(nullptr),
_conf(nullptr), _events(nullptr), _picList(nullptr), _screen(nullptr),
_selection(nullptr), _windows(nullptr), _copySelect(false), _terminated(false),
gli_unregister_obj(nullptr), gli_register_arr(nullptr), gli_unregister_arr(nullptr) {
g_vm = this;
}
GargoyleEngine::~GargoyleEngine() {
delete _clipboard;
delete _conf;
delete _events;
delete _picList;
delete _screen;
delete _selection;
delete _streams;
delete _windows;
}
void GargoyleEngine::initialize() {
// Set up debug channels
DebugMan.addDebugChannel(kDebugCore, "core", "Core engine debug level");
DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
initGraphicsMode();
_conf = new Conf();
_screen = new Screen();
_clipboard = new Clipboard();
_events = new Events();
_picList = new PicList();
_selection = new Selection();
_streams = new Streams();
_windows = new Windows(_screen);
}
void GargoyleEngine::initGraphicsMode() {
uint width = ConfMan.hasKey("width") ? ConfMan.getInt("width") : 640;
uint height = ConfMan.hasKey("height") ? ConfMan.getInt("height") : 480;
Common::List<Graphics::PixelFormat> formats = g_system->getSupportedFormats();
Graphics::PixelFormat format = formats.front();
for (Common::List<Graphics::PixelFormat>::iterator i = formats.begin(); i != formats.end(); ++i) {
if ((*i).bytesPerPixel > 1) {
format = *i;
break;
}
}
initGraphics(width, height, &format);
}
Common::Error GargoyleEngine::run() {
initialize();
Common::File f;
if (f.open(getFilename()))
runGame(&f);
return Common::kNoError;
}
void GargoyleEngine::GUIError(const char *msg, ...) {
char buffer[STRINGBUFLEN];
va_list va;
// Generate the full error message
va_start(va, msg);
vsnprintf(buffer, STRINGBUFLEN, msg, va);
va_end(va);
GUIErrorMessage(buffer);
}
} // End of namespace Gargoyle

View file

@ -1,193 +0,0 @@
/* 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.
*
*/
#ifndef GLK_GARGOLE_H
#define GLK_GARGOLE_H
#include "common/scummsys.h"
#include "common/random.h"
#include "common/system.h"
#include "common/serializer.h"
#include "engines/advancedDetector.h"
#include "engines/engine.h"
#include "glk/glk_types.h"
namespace Gargoyle {
class Clipboard;
class Conf;
class Events;
class PicList;
class Screen;
class Selection;
class Streams;
class Windows;
enum InterpreterType {
INTERPRETER_ADVSYS = 0,
INTERPRETER_AGILITY = 1,
INTERPRETER_ALAN2 = 2,
INTERPRETER_ALAN3 = 3,
INTERPRETER_BOCFEL = 4,
INTERPRETER_FROTZ = 5,
INTERPRETER_GEAS = 6,
INTERPRETER_HUGO = 7,
INTERPRETER_JACL = 8,
INTERPRETER_LEVEL9 = 9,
INTERPRETER_MAGNETIC = 10,
INTERPRETER_NITFOL = 11,
INTERPRETER_SCARE = 12,
INTERPRETER_SCOTT = 13,
INTERPRETER_TADS = 14
};
enum GargoyleDebugChannels {
kDebugCore = 1 << 0,
kDebugScripts = 1 << 1,
kDebugGraphics = 1 << 2,
kDebugSound = 1 << 3
};
#define GLK_SAVEGAME_VERSION 1
struct GargoyleGameDescription;
/**
* Base class for the different interpreters
*/
class GargoyleEngine : public Engine {
private:
/**
* Handles basic initialization
*/
void initialize();
/**
* Setup the video mode
*/
void initGraphicsMode();
protected:
const GargoyleGameDescription *_gameDescription;
Common::RandomSource _random;
int _loadSaveSlot;
// Engine APIs
virtual Common::Error run();
/**
* Returns true whether a given feature is supported by the engine
*/
virtual bool hasFeature(EngineFeature f) const;
/**
* Main game loop for the individual interpreters
*/
virtual void runGame(Common::SeekableReadStream *gameFile) = 0;
public:
Clipboard *_clipboard;
Conf *_conf;
Events *_events;
PicList *_picList;
Screen *_screen;
Selection *_selection;
Streams *_streams;
Windows *_windows;
bool _copySelect;
bool _terminated;
void (*gli_unregister_obj)(void *obj, glui32 objclass, gidispatch_rock_t objrock);
gidispatch_rock_t (*gli_register_arr)(void *array, glui32 len, const char *typecode);
void (*gli_unregister_arr)(void *array, glui32 len, const char *typecode, gidispatch_rock_t objrock);
public:
GargoyleEngine(OSystem *syst, const GargoyleGameDescription *gameDesc);
virtual ~GargoyleEngine();
/**
* Returns true if a savegame can be loaded
*/
virtual bool canLoadGameStateCurrently() override {
return true;
}
/**
* Returns true if the game can be saved
*/
virtual bool canSaveGameStateCurrently() override {
return true;
}
/**
* Returns the bitset of game features
*/
uint32 getFeatures() const;
/**
* Returns whether the game is a demo
*/
bool isDemo() const;
/**
* Returns the language
*/
Common::Language getLanguage() const;
/**
* Returns the running interpreter type
*/
InterpreterType getInterpreterType() const;
/**
* Returns the game's md5
*/
const Common::String &getGameMD5() const;
/**
* Returns the primary filename for the game
*/
const Common::String &getFilename() const;
/**
* Return the game engine's target name
*/
const Common::String &getTargetName() const {
return _targetName;
}
/**
* Return the filename for a given save slot
*/
Common::String getSaveName(uint slot) const {
return Common::String::format("%s.%.3u", getTargetName().c_str(), slot);
}
/**
* Display a message in a GUI dialog
*/
void GUIError(const char *msg, ...);
};
extern GargoyleEngine *g_vm;
} // End of namespace Gargoyle
#endif

File diff suppressed because it is too large Load diff

View file

@ -23,270 +23,171 @@
#ifndef GLK_GLK_H
#define GLK_GLK_H
#include "glk/gargoyle.h"
#include "common/scummsys.h"
#include "common/random.h"
#include "common/system.h"
#include "common/serializer.h"
#include "engines/advancedDetector.h"
#include "engines/engine.h"
#include "glk/glk_types.h"
#include "glk/blorb.h"
#include "glk/time.h"
#include "glk/windows.h"
namespace Gargoyle {
namespace Glk {
/**
* Implements the GLK interface
*/
class Glk : public GargoyleEngine, public Blorb {
private:
bool _gliFirstEvent;
unsigned char _charTolowerTable[256];
unsigned char _charToupperTable[256];
public:
/**
* Constructor
*/
Glk(OSystem *syst, const GargoyleGameDescription *gameDesc);
class Clipboard;
class Conf;
class Events;
class PicList;
class Screen;
class Selection;
class Streams;
class Windows;
void glk_exit(void);
void glk_set_interrupt_handler(void(*func)(void));
void glk_tick(void);
glui32 glk_gestalt(glui32 id, glui32 val);
glui32 glk_gestalt_ext(glui32 id, glui32 val, glui32 *arr, glui32 arrlen);
unsigned char glk_char_to_lower(unsigned char ch);
unsigned char glk_char_to_upper(unsigned char ch);
/**
* Get the root window of the window hierarchy
*/
winid_t glk_window_get_root(void) const;
/**
* Open a new window
*/
winid_t glk_window_open(winid_t split, glui32 method, glui32 size,
glui32 wintype, glui32 rock = 0) const;
void glk_window_close(winid_t win, stream_result_t *result = nullptr);
void glk_window_get_size(winid_t win, glui32 *width, glui32 *height);
void glk_window_set_arrangement(winid_t win, glui32 method,
glui32 size, winid_t keyWin);
void glk_window_get_arrangement(winid_t win, glui32 *method,
glui32 *size, winid_t *keyWin);
winid_t glk_window_iterate(winid_t win, glui32 *rock = 0);
glui32 glk_window_get_rock(winid_t win);
glui32 glk_window_get_type(winid_t win);
winid_t glk_window_get_parent(winid_t win);
winid_t glk_window_get_sibling(winid_t win);
void glk_window_clear(winid_t win);
void glk_window_move_cursor(winid_t win, glui32 xpos, glui32 ypos);
strid_t glk_window_get_stream(winid_t win);
void glk_window_set_echo_stream(winid_t win, strid_t str);
strid_t glk_window_get_echo_stream(winid_t win);
void glk_set_window(winid_t win);
strid_t glk_stream_open_file(frefid_t fileref, FileMode fmode, glui32 rock = 0);
strid_t glk_stream_open_memory(char *buf, glui32 buflen, FileMode fmode, glui32 rock = 0);
void glk_stream_close(strid_t str, stream_result_t *result = nullptr);
strid_t glk_stream_iterate(strid_t str, glui32 *rockptr) const;
glui32 glk_stream_get_rock(strid_t str) const;
void glk_stream_set_position(strid_t str, glsi32 pos, glui32 seekMode);
glui32 glk_stream_get_position(strid_t str) const;
void glk_stream_set_current(strid_t str);
strid_t glk_stream_get_current(void);
void glk_put_char(unsigned char ch);
void glk_put_char_stream(strid_t str, unsigned char ch);
void glk_put_string(const char *s);
void glk_put_string_stream(strid_t str, const char *s);
void glk_put_buffer(char *buf, glui32 len);
void glk_put_buffer_stream(strid_t str, const char *buf, glui32 len);
void glk_set_style(glui32 styl);
void glk_set_style_stream(strid_t str, glui32 styl);
glsi32 glk_get_char_stream(strid_t str);
glui32 glk_get_line_stream(strid_t str, char *buf, glui32 len);
glui32 glk_get_buffer_stream(strid_t str, char *buf, glui32 len);
void glk_stylehint_set(glui32 wintype, glui32 styl, glui32 hint,
glsi32 val);
void glk_stylehint_clear(glui32 wintype, glui32 style, glui32 hint);
glui32 glk_style_distinguish(winid_t win, glui32 style1, glui32 style2);
bool glk_style_measure(winid_t win, glui32 style, glui32 hint, glui32 *result);
frefid_t glk_fileref_create_temp(glui32 usage, glui32 rock = 0);
frefid_t glk_fileref_create_by_name(glui32 usage, const char *name, glui32 rock = 0);
frefid_t glk_fileref_create_by_prompt(glui32 usage, FileMode fmode, glui32 rock = 0);
frefid_t glk_fileref_create_from_fileref(glui32 usage, frefid_t fref, glui32 rock = 0);
void glk_fileref_destroy(frefid_t fref);
frefid_t glk_fileref_iterate(frefid_t fref, glui32 *rockptr);
glui32 glk_fileref_get_rock(frefid_t fref);
void glk_fileref_delete_file(frefid_t fref);
glui32 glk_fileref_does_file_exist(frefid_t fref);
void glk_select(event_t *event);
void glk_select_poll(event_t *event);
void glk_request_timer_events(glui32 millisecs);
void glk_request_line_event(winid_t win, char *buf, glui32 maxlen,
glui32 initlen);
void glk_request_char_event(winid_t win);
void glk_request_mouse_event(winid_t win);
void glk_cancel_line_event(winid_t win, event_t *event);
void glk_cancel_char_event(winid_t win);
void glk_cancel_mouse_event(winid_t win);
#ifdef GLK_MODULE_LINE_ECHO
void glk_set_echo_line_event(winid_t win, glui32 val);
#endif /* GLK_MODULE_LINE_ECHO */
#ifdef GLK_MODULE_LINE_TERMINATORS
void glk_set_terminators_line_event(winid_t win, glui32 *keycodes,
glui32 count);
#endif /* GLK_MODULE_LINE_TERMINATORS */
/** \addtogroup Unicode
* @{
*/
glui32 glk_buffer_to_lower_case_uni(glui32 *buf, glui32 len,
glui32 numchars);
glui32 glk_buffer_to_upper_case_uni(glui32 *buf, glui32 len,
glui32 numchars);
glui32 glk_buffer_to_title_case_uni(glui32 *buf, glui32 len,
glui32 numchars, glui32 lowerrest);
void glk_put_char_uni(glui32 ch);
void glk_put_string_uni(glui32 *s);
void glk_put_buffer_uni(glui32 *buf, glui32 len);
void glk_put_char_stream_uni(strid_t str, glui32 ch);
void glk_put_string_stream_uni(strid_t str, const glui32 *s);
void glk_put_buffer_stream_uni(strid_t str, const glui32 *buf, glui32 len);
glsi32 glk_get_char_stream_uni(strid_t str);
glui32 glk_get_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len);
glui32 glk_get_line_stream_uni(strid_t str, glui32 *buf, glui32 len);
strid_t glk_stream_open_file_uni(frefid_t fileref, FileMode fmode, glui32 rock = 0);
strid_t glk_stream_open_memory_uni(glui32 *buf, glui32 buflen, FileMode fmode, glui32 rock = 0);
void glk_request_char_event_uni(winid_t win);
void glk_request_line_event_uni(winid_t win, glui32 *buf,
glui32 maxlen, glui32 initlen);
/** @}*/
#ifdef GLK_MODULE_UNICODE_NORM
glui32 glk_buffer_canon_decompose_uni(glui32 *buf, glui32 len,
glui32 numchars);
glui32 glk_buffer_canon_normalize_uni(glui32 *buf, glui32 len,
glui32 numchars);
#endif /* GLK_MODULE_UNICODE_NORM */
#ifdef GLK_MODULE_IMAGE
glui32 glk_image_draw(winid_t win, glui32 image, glsi32 val1, glsi32 val2);
glui32 glk_image_draw_scaled(winid_t win, glui32 image,
glsi32 val1, glsi32 val2, glui32 width, glui32 height);
glui32 glk_image_get_info(glui32 image, glui32 *width, glui32 *height);
void glk_window_flow_break(winid_t win);
void glk_window_erase_rect(winid_t win,
glsi32 left, glsi32 top, glui32 width, glui32 height);
void glk_window_fill_rect(winid_t win, glui32 color,
glsi32 left, glsi32 top, glui32 width, glui32 height);
void glk_window_set_background_color(winid_t win, glui32 color);
#endif /* GLK_MODULE_IMAGE */
#ifdef GLK_MODULE_SOUND
schanid_t glk_schannel_create(glui32 rock = 0);
void glk_schannel_destroy(schanid_t chan);
schanid_t glk_schannel_iterate(schanid_t chan, glui32 *rockptr);
glui32 glk_schannel_get_rock(schanid_t chan);
glui32 glk_schannel_play(schanid_t chan, glui32 snd);
glui32 glk_schannel_play_ext(schanid_t chan, glui32 snd, glui32 repeats,
glui32 notify);
void glk_schannel_stop(schanid_t chan);
void glk_schannel_set_volume(schanid_t chan, glui32 vol);
void glk_sound_load_hint(glui32 snd, glui32 flag);
#ifdef GLK_MODULE_SOUND2
/* Note that this section is nested inside the #ifdef GLK_MODULE_SOUND.
GLK_MODULE_SOUND must be defined if GLK_MODULE_SOUND2 is. */
schanid_t glk_schannel_create_ext(glui32 rock, glui32 volume);
glui32 glk_schannel_play_multi(schanid_t *chanarray, glui32 chancount,
glui32 *sndarray, glui32 soundcount, glui32 notify);
void glk_schannel_pause(schanid_t chan);
void glk_schannel_unpause(schanid_t chan);
void glk_schannel_set_volume_ext(schanid_t chan, glui32 vol,
glui32 duration, glui32 notify);
#endif /* GLK_MODULE_SOUND2 */
#endif /* GLK_MODULE_SOUND */
#ifdef GLK_MODULE_HYPERLINKS
void glk_set_hyperlink(glui32 linkval);
void glk_set_hyperlink_stream(strid_t str, glui32 linkval);
void glk_request_hyperlink_event(winid_t win);
void glk_cancel_hyperlink_event(winid_t win);
#endif /* GLK_MODULE_HYPERLINKS */
#ifdef GLK_MODULE_DATETIME
void glk_current_time(glktimeval_t *time);
glsi32 glk_current_simple_time(glui32 factor);
void glk_time_to_date_utc(const glktimeval_t *time, glkdate_t *date);
void glk_time_to_date_local(const glktimeval_t *time, glkdate_t *date);
void glk_simple_time_to_date_utc(glsi32 time, glui32 factor, glkdate_t *date);
void glk_simple_time_to_date_local(glsi32 time, glui32 factor, glkdate_t *date);
void glk_date_to_time_utc(const glkdate_t *date, glktimeval_t *time);
void glk_date_to_time_local(const glkdate_t *date, glktimeval_t *time);
glsi32 glk_date_to_simple_time_utc(const glkdate_t *date, glui32 factor);
glsi32 glk_date_to_simple_time_local(const glkdate_t *date, glui32 factor);
#endif /* GLK_MODULE_DATETIME */
/* XXX non-official Glk functions that may or may not exist */
#define GARGLK 1
const char *garglk_fileref_get_name(frefid_t fref) const;
void garglk_set_program_name(const char *name);
void garglk_set_program_info(const char *info);
void garglk_set_story_name(const char *name);
void garglk_set_story_title(const char *title);
void garglk_set_config(const char *name);
/**
* Removes the specified string from the end of the output buffer, if
* indeed it is there.
*/
void garglk_unput_string(const char *str);
/**
* Removes the specified string from the end of the output buffer, if
* indeed it is there.
*/
void garglk_unput_string_uni(const glui32 *str);
void garglk_set_zcolors(glui32 fg, glui32 bg);
void garglk_set_zcolors_stream(strid_t str, glui32 fg, glui32 bg);
void garglk_set_reversevideo(glui32 reverse);
void garglk_set_reversevideo_stream(strid_t str, glui32 reverse);
enum InterpreterType {
INTERPRETER_ADVSYS = 0,
INTERPRETER_AGILITY = 1,
INTERPRETER_ALAN2 = 2,
INTERPRETER_ALAN3 = 3,
INTERPRETER_BOCFEL = 4,
INTERPRETER_FROTZ = 5,
INTERPRETER_GEAS = 6,
INTERPRETER_HUGO = 7,
INTERPRETER_JACL = 8,
INTERPRETER_LEVEL9 = 9,
INTERPRETER_MAGNETIC = 10,
INTERPRETER_NITFOL = 11,
INTERPRETER_SCARE = 12,
INTERPRETER_SCOTT = 13,
INTERPRETER_TADS = 14
};
} // End of namespace Gargoyle
enum GlkDebugChannels {
kDebugCore = 1 << 0,
kDebugScripts = 1 << 1,
kDebugGraphics = 1 << 2,
kDebugSound = 1 << 3
};
#define GLK_SAVEGAME_VERSION 1
struct GlkGameDescription;
/**
* Base class for the different interpreters
*/
class GlkEngine : public Engine {
private:
/**
* Handles basic initialization
*/
void initialize();
/**
* Setup the video mode
*/
void initGraphicsMode();
protected:
const GlkGameDescription *_gameDescription;
Common::RandomSource _random;
int _loadSaveSlot;
// Engine APIs
virtual Common::Error run();
/**
* Returns true whether a given feature is supported by the engine
*/
virtual bool hasFeature(EngineFeature f) const;
/**
* Main game loop for the individual interpreters
*/
virtual void runGame(Common::SeekableReadStream *gameFile) = 0;
public:
Clipboard *_clipboard;
Conf *_conf;
Events *_events;
PicList *_picList;
Screen *_screen;
Selection *_selection;
Streams *_streams;
Windows *_windows;
bool _copySelect;
bool _terminated;
void (*gli_unregister_obj)(void *obj, glui32 objclass, gidispatch_rock_t objrock);
gidispatch_rock_t (*gli_register_arr)(void *array, glui32 len, const char *typecode);
void (*gli_unregister_arr)(void *array, glui32 len, const char *typecode, gidispatch_rock_t objrock);
public:
GlkEngine(OSystem *syst, const GlkGameDescription *gameDesc);
virtual ~GlkEngine();
/**
* Returns true if a savegame can be loaded
*/
virtual bool canLoadGameStateCurrently() override {
return true;
}
/**
* Returns true if the game can be saved
*/
virtual bool canSaveGameStateCurrently() override {
return true;
}
/**
* Returns the bitset of game features
*/
uint32 getFeatures() const;
/**
* Returns whether the game is a demo
*/
bool isDemo() const;
/**
* Returns the language
*/
Common::Language getLanguage() const;
/**
* Returns the running interpreter type
*/
InterpreterType getInterpreterType() const;
/**
* Returns the game's md5
*/
const Common::String &getGameMD5() const;
/**
* Returns the primary filename for the game
*/
const Common::String &getFilename() const;
/**
* Return the game engine's target name
*/
const Common::String &getTargetName() const {
return _targetName;
}
/**
* Return the filename for a given save slot
*/
Common::String getSaveName(uint slot) const {
return Common::String::format("%s.%.3u", getTargetName().c_str(), slot);
}
/**
* Display a message in a GUI dialog
*/
void GUIError(const char *msg, ...);
};
extern GlkEngine *g_vm;
} // End of namespace Glk
#endif

1174
engines/glk/glk_api.cpp Normal file

File diff suppressed because it is too large Load diff

292
engines/glk/glk_api.h Normal file
View file

@ -0,0 +1,292 @@
/* 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.
*
*/
#ifndef GLK_GLK_API_H
#define GLK_GLK_API_H
#include "glk/glk.h"
#include "glk/glk_types.h"
#include "glk/blorb.h"
#include "glk/time.h"
#include "glk/windows.h"
namespace Glk {
/**
* Implements the GLK interface
*/
class GlkAPI : public GlkEngine, public Blorb {
private:
bool _gliFirstEvent;
unsigned char _charTolowerTable[256];
unsigned char _charToupperTable[256];
public:
/**
* Constructor
*/
GlkAPI(OSystem *syst, const GlkGameDescription *gameDesc);
void glk_exit(void);
void glk_set_interrupt_handler(void(*func)(void));
void glk_tick(void);
glui32 glk_gestalt(glui32 id, glui32 val);
glui32 glk_gestalt_ext(glui32 id, glui32 val, glui32 *arr, glui32 arrlen);
unsigned char glk_char_to_lower(unsigned char ch);
unsigned char glk_char_to_upper(unsigned char ch);
/**
* Get the root window of the window hierarchy
*/
winid_t glk_window_get_root(void) const;
/**
* Open a new window
*/
winid_t glk_window_open(winid_t split, glui32 method, glui32 size,
glui32 wintype, glui32 rock = 0) const;
void glk_window_close(winid_t win, stream_result_t *result = nullptr);
void glk_window_get_size(winid_t win, glui32 *width, glui32 *height);
void glk_window_set_arrangement(winid_t win, glui32 method,
glui32 size, winid_t keyWin);
void glk_window_get_arrangement(winid_t win, glui32 *method,
glui32 *size, winid_t *keyWin);
winid_t glk_window_iterate(winid_t win, glui32 *rock = 0);
glui32 glk_window_get_rock(winid_t win);
glui32 glk_window_get_type(winid_t win);
winid_t glk_window_get_parent(winid_t win);
winid_t glk_window_get_sibling(winid_t win);
void glk_window_clear(winid_t win);
void glk_window_move_cursor(winid_t win, glui32 xpos, glui32 ypos);
strid_t glk_window_get_stream(winid_t win);
void glk_window_set_echo_stream(winid_t win, strid_t str);
strid_t glk_window_get_echo_stream(winid_t win);
void glk_set_window(winid_t win);
strid_t glk_stream_open_file(frefid_t fileref, FileMode fmode, glui32 rock = 0);
strid_t glk_stream_open_memory(char *buf, glui32 buflen, FileMode fmode, glui32 rock = 0);
void glk_stream_close(strid_t str, stream_result_t *result = nullptr);
strid_t glk_stream_iterate(strid_t str, glui32 *rockptr) const;
glui32 glk_stream_get_rock(strid_t str) const;
void glk_stream_set_position(strid_t str, glsi32 pos, glui32 seekMode);
glui32 glk_stream_get_position(strid_t str) const;
void glk_stream_set_current(strid_t str);
strid_t glk_stream_get_current(void);
void glk_put_char(unsigned char ch);
void glk_put_char_stream(strid_t str, unsigned char ch);
void glk_put_string(const char *s);
void glk_put_string_stream(strid_t str, const char *s);
void glk_put_buffer(char *buf, glui32 len);
void glk_put_buffer_stream(strid_t str, const char *buf, glui32 len);
void glk_set_style(glui32 styl);
void glk_set_style_stream(strid_t str, glui32 styl);
glsi32 glk_get_char_stream(strid_t str);
glui32 glk_get_line_stream(strid_t str, char *buf, glui32 len);
glui32 glk_get_buffer_stream(strid_t str, char *buf, glui32 len);
void glk_stylehint_set(glui32 wintype, glui32 styl, glui32 hint,
glsi32 val);
void glk_stylehint_clear(glui32 wintype, glui32 style, glui32 hint);
glui32 glk_style_distinguish(winid_t win, glui32 style1, glui32 style2);
bool glk_style_measure(winid_t win, glui32 style, glui32 hint, glui32 *result);
frefid_t glk_fileref_create_temp(glui32 usage, glui32 rock = 0);
frefid_t glk_fileref_create_by_name(glui32 usage, const char *name, glui32 rock = 0);
frefid_t glk_fileref_create_by_prompt(glui32 usage, FileMode fmode, glui32 rock = 0);
frefid_t glk_fileref_create_from_fileref(glui32 usage, frefid_t fref, glui32 rock = 0);
void glk_fileref_destroy(frefid_t fref);
frefid_t glk_fileref_iterate(frefid_t fref, glui32 *rockptr);
glui32 glk_fileref_get_rock(frefid_t fref);
void glk_fileref_delete_file(frefid_t fref);
glui32 glk_fileref_does_file_exist(frefid_t fref);
void glk_select(event_t *event);
void glk_select_poll(event_t *event);
void glk_request_timer_events(glui32 millisecs);
void glk_request_line_event(winid_t win, char *buf, glui32 maxlen,
glui32 initlen);
void glk_request_char_event(winid_t win);
void glk_request_mouse_event(winid_t win);
void glk_cancel_line_event(winid_t win, event_t *event);
void glk_cancel_char_event(winid_t win);
void glk_cancel_mouse_event(winid_t win);
#ifdef GLK_MODULE_LINE_ECHO
void glk_set_echo_line_event(winid_t win, glui32 val);
#endif /* GLK_MODULE_LINE_ECHO */
#ifdef GLK_MODULE_LINE_TERMINATORS
void glk_set_terminators_line_event(winid_t win, glui32 *keycodes,
glui32 count);
#endif /* GLK_MODULE_LINE_TERMINATORS */
/** \addtogroup Unicode
* @{
*/
glui32 glk_buffer_to_lower_case_uni(glui32 *buf, glui32 len,
glui32 numchars);
glui32 glk_buffer_to_upper_case_uni(glui32 *buf, glui32 len,
glui32 numchars);
glui32 glk_buffer_to_title_case_uni(glui32 *buf, glui32 len,
glui32 numchars, glui32 lowerrest);
void glk_put_char_uni(glui32 ch);
void glk_put_string_uni(glui32 *s);
void glk_put_buffer_uni(glui32 *buf, glui32 len);
void glk_put_char_stream_uni(strid_t str, glui32 ch);
void glk_put_string_stream_uni(strid_t str, const glui32 *s);
void glk_put_buffer_stream_uni(strid_t str, const glui32 *buf, glui32 len);
glsi32 glk_get_char_stream_uni(strid_t str);
glui32 glk_get_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len);
glui32 glk_get_line_stream_uni(strid_t str, glui32 *buf, glui32 len);
strid_t glk_stream_open_file_uni(frefid_t fileref, FileMode fmode, glui32 rock = 0);
strid_t glk_stream_open_memory_uni(glui32 *buf, glui32 buflen, FileMode fmode, glui32 rock = 0);
void glk_request_char_event_uni(winid_t win);
void glk_request_line_event_uni(winid_t win, glui32 *buf,
glui32 maxlen, glui32 initlen);
/** @}*/
#ifdef GLK_MODULE_UNICODE_NORM
glui32 glk_buffer_canon_decompose_uni(glui32 *buf, glui32 len,
glui32 numchars);
glui32 glk_buffer_canon_normalize_uni(glui32 *buf, glui32 len,
glui32 numchars);
#endif /* GLK_MODULE_UNICODE_NORM */
#ifdef GLK_MODULE_IMAGE
glui32 glk_image_draw(winid_t win, glui32 image, glsi32 val1, glsi32 val2);
glui32 glk_image_draw_scaled(winid_t win, glui32 image,
glsi32 val1, glsi32 val2, glui32 width, glui32 height);
glui32 glk_image_get_info(glui32 image, glui32 *width, glui32 *height);
void glk_window_flow_break(winid_t win);
void glk_window_erase_rect(winid_t win,
glsi32 left, glsi32 top, glui32 width, glui32 height);
void glk_window_fill_rect(winid_t win, glui32 color,
glsi32 left, glsi32 top, glui32 width, glui32 height);
void glk_window_set_background_color(winid_t win, glui32 color);
#endif /* GLK_MODULE_IMAGE */
#ifdef GLK_MODULE_SOUND
schanid_t glk_schannel_create(glui32 rock = 0);
void glk_schannel_destroy(schanid_t chan);
schanid_t glk_schannel_iterate(schanid_t chan, glui32 *rockptr);
glui32 glk_schannel_get_rock(schanid_t chan);
glui32 glk_schannel_play(schanid_t chan, glui32 snd);
glui32 glk_schannel_play_ext(schanid_t chan, glui32 snd, glui32 repeats,
glui32 notify);
void glk_schannel_stop(schanid_t chan);
void glk_schannel_set_volume(schanid_t chan, glui32 vol);
void glk_sound_load_hint(glui32 snd, glui32 flag);
#ifdef GLK_MODULE_SOUND2
/* Note that this section is nested inside the #ifdef GLK_MODULE_SOUND.
GLK_MODULE_SOUND must be defined if GLK_MODULE_SOUND2 is. */
schanid_t glk_schannel_create_ext(glui32 rock, glui32 volume);
glui32 glk_schannel_play_multi(schanid_t *chanarray, glui32 chancount,
glui32 *sndarray, glui32 soundcount, glui32 notify);
void glk_schannel_pause(schanid_t chan);
void glk_schannel_unpause(schanid_t chan);
void glk_schannel_set_volume_ext(schanid_t chan, glui32 vol,
glui32 duration, glui32 notify);
#endif /* GLK_MODULE_SOUND2 */
#endif /* GLK_MODULE_SOUND */
#ifdef GLK_MODULE_HYPERLINKS
void glk_set_hyperlink(glui32 linkval);
void glk_set_hyperlink_stream(strid_t str, glui32 linkval);
void glk_request_hyperlink_event(winid_t win);
void glk_cancel_hyperlink_event(winid_t win);
#endif /* GLK_MODULE_HYPERLINKS */
#ifdef GLK_MODULE_DATETIME
void glk_current_time(glktimeval_t *time);
glsi32 glk_current_simple_time(glui32 factor);
void glk_time_to_date_utc(const glktimeval_t *time, glkdate_t *date);
void glk_time_to_date_local(const glktimeval_t *time, glkdate_t *date);
void glk_simple_time_to_date_utc(glsi32 time, glui32 factor, glkdate_t *date);
void glk_simple_time_to_date_local(glsi32 time, glui32 factor, glkdate_t *date);
void glk_date_to_time_utc(const glkdate_t *date, glktimeval_t *time);
void glk_date_to_time_local(const glkdate_t *date, glktimeval_t *time);
glsi32 glk_date_to_simple_time_utc(const glkdate_t *date, glui32 factor);
glsi32 glk_date_to_simple_time_local(const glkdate_t *date, glui32 factor);
#endif /* GLK_MODULE_DATETIME */
/* XXX non-official Glk functions that may or may not exist */
#define GARGLK 1
const char *garglk_fileref_get_name(frefid_t fref) const;
void garglk_set_program_name(const char *name);
void garglk_set_program_info(const char *info);
void garglk_set_story_name(const char *name);
void garglk_set_story_title(const char *title);
void garglk_set_config(const char *name);
/**
* Removes the specified string from the end of the output buffer, if
* indeed it is there.
*/
void garglk_unput_string(const char *str);
/**
* Removes the specified string from the end of the output buffer, if
* indeed it is there.
*/
void garglk_unput_string_uni(const glui32 *str);
void garglk_set_zcolors(glui32 fg, glui32 bg);
void garglk_set_zcolors_stream(strid_t str, glui32 fg, glui32 bg);
void garglk_set_reversevideo(glui32 reverse);
void garglk_set_reversevideo_stream(strid_t str, glui32 reverse);
};
} // End of namespace Glk
#endif

View file

@ -26,7 +26,7 @@
#include "common/scummsys.h"
#include "common/stream.h"
namespace Gargoyle {
namespace Glk {
typedef uint32 glui32;
typedef int32 glsi32;
@ -203,6 +203,6 @@ union gidispatch_rock_t {
void *ptr;
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -6,8 +6,8 @@ MODULE_OBJS := \
detection.o \
events.o \
fonts.o \
gargoyle.o \
glk.o \
glk_api.o \
picture.o \
screen.o \
selection.o \

View file

@ -22,7 +22,7 @@
#include "glk/picture.h"
namespace Gargoyle {
namespace Glk {
void PicList::increment() {
// TODO
@ -60,4 +60,4 @@ void Picture::drawPicture(int x0, int y0, int dx0, int dy0, int dx1, int dy1) {
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -25,7 +25,7 @@
#include "graphics/surface.h"
namespace Gargoyle {
namespace Glk {
class PicList {
public:
@ -68,6 +68,6 @@ public:
void drawPicture(int x0, int y0, int dx0, int dy0, int dx1, int dy1);
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -24,7 +24,7 @@
#include "common/file.h"
#include "common/md5.h"
namespace Gargoyle {
namespace Glk {
namespace Scott {
struct ScottGame {
@ -106,4 +106,4 @@ bool ScottMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -26,7 +26,7 @@
#include "common/fs.h"
#include "engines/game.h"
namespace Gargoyle {
namespace Glk {
namespace Scott {
class ScottMetaEngine {
@ -38,6 +38,6 @@ public:
};
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -23,10 +23,10 @@
#include "glk/scott/scott.h"
#include "common/config-manager.h"
namespace Gargoyle {
namespace Glk {
namespace Scott {
Scott::Scott(OSystem *syst, const GargoyleGameDescription *gameDesc) : Glk(syst, gameDesc),
Scott::Scott(OSystem *syst, const GlkGameDescription *gameDesc) : GlkAPI(syst, gameDesc),
Items(nullptr), Rooms(nullptr), Verbs(nullptr), Nouns(nullptr), Messages(nullptr),
Actions(nullptr), CurrentCounter(0), SavedRoom(0), Options(0), Width(0), TopHeight(0),
split_screen(true), Bottom(0), Top(0), BitFlags(0), _saveSlot(-1) {
@ -1260,4 +1260,4 @@ void Scott::readInts(Common::SeekableReadStream *f, size_t count, ...) {
}
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -28,9 +28,9 @@
*/
#include "common/scummsys.h"
#include "glk/glk.h"
#include "glk/glk_api.h"
namespace Gargoyle {
namespace Glk {
namespace Scott {
#define LIGHT_SOURCE 9 // Always 9 how odd
@ -109,7 +109,7 @@ struct Tail {
/**
* Scott Adams game interpreter
*/
class Scott : public Glk {
class Scott : public GlkAPI {
private:
Header GameHeader;
Item *Items;
@ -167,7 +167,7 @@ public:
/**
* Constructor
*/
Scott(OSystem *syst, const GargoyleGameDescription *gameDesc);
Scott(OSystem *syst, const GlkGameDescription *gameDesc);
/**
* Execute the game
@ -186,6 +186,6 @@ public:
};
} // End of namespace Scott
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -23,7 +23,7 @@
#include "glk/screen.h"
#include "glk/conf.h"
namespace Gargoyle {
namespace Glk {
void Screen::fill(const byte *rgb) {
uint color = format.RGBToColor(rgb[0], rgb[1], rgb[2]);
@ -69,4 +69,4 @@ void Screen::drawCaret(const Point &pos) {
}
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -26,7 +26,7 @@
#include "graphics/screen.h"
#include "glk/fonts.h"
namespace Gargoyle {
namespace Glk {
enum CaretShape {
SMALL_DOT = 0, FAT_DOT = 1, THIN_LINE = 2, FAT_LINE = 3, BLOCK = 4
@ -60,6 +60,6 @@ public:
void drawCaret(const Point &pos);
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -22,11 +22,11 @@
#include "glk/selection.h"
#include "glk/conf.h"
#include "glk/gargoyle.h"
#include "glk/glk.h"
#include "glk/windows.h"
#include "common/system.h"
namespace Gargoyle {
namespace Glk {
void Clipboard::clipboardStore(const Common::U32String &text) {
_text = text;
@ -318,4 +318,4 @@ bool Selection::getSelection(const Rect &r, int *rx0, int *rx1) const {
return (rx0 && rx1);
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -29,7 +29,7 @@
#include "common/rect.h"
#include "common/ustr.h"
namespace Gargoyle {
namespace Glk {
enum ClipSource { PRIMARY = 0, CLIPBOARD = 1 };
@ -115,6 +115,6 @@ public:
bool getSelection(const Rect &r, int *rx0, int *rx1) const;
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -26,7 +26,7 @@
#include "common/events.h"
#include "glk/glk_types.h"
namespace Gargoyle {
namespace Glk {
/**
* Currently not implemented
@ -44,6 +44,6 @@ protected:
void gli_free_tts(void) {}
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -23,14 +23,14 @@
#include "glk/streams.h"
#include "glk/conf.h"
#include "glk/events.h"
#include "glk/gargoyle.h"
#include "glk/glk.h"
#include "glk/windows.h"
#include "gui/saveload.h"
#include "common/file.h"
#include "common/savefile.h"
#include "common/translation.h"
namespace Gargoyle {
namespace Glk {
Stream::Stream(Streams *streams, bool readable, bool writable, uint32 rock, bool unicode) :
_streams(streams), _readable(readable), _writable(writable), _readCount(0),
@ -1589,4 +1589,4 @@ void FileReference::deleteFile() {
g_system->getSavefileManager()->removeSavefile(filename);
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -29,7 +29,7 @@
#include "common/str.h"
#include "glk/glk_types.h"
namespace Gargoyle {
namespace Glk {
#define SAVEGAME_VERSION 1
@ -634,6 +634,6 @@ public:
frefid_t iterate(frefid_t fref, glui32 *rock);
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -23,7 +23,7 @@
#include "glk/time.h"
#include "common/system.h"
namespace Gargoyle {
namespace Glk {
TimeAndDate::TimeAndDate() {
::TimeDate t;
@ -117,4 +117,4 @@ TimeSeconds TimeAndDate::getTime() const {
return totalMinutes * 60 + second;
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -25,7 +25,7 @@
#include "glk/glk_types.h"
namespace Gargoyle {
namespace Glk {
typedef int64 TimeSeconds;
@ -88,6 +88,6 @@ public:
};
typedef TimeAndDate glkdate_t;
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -24,7 +24,7 @@
#include "glk/unicode_gen.h"
#include "common/textconsole.h"
namespace Gargoyle {
namespace Glk {
size_t strlen_uni(const uint32 *s) {
size_t len = 0;
@ -148,4 +148,4 @@ glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCa
return outcount;
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -25,7 +25,7 @@
#include "glk/glk_types.h"
namespace Gargoyle {
namespace Glk {
typedef glui32 gli_case_block_t[2]; /* upper, lower */
enum BufferChangeCase { CASE_UPPER = 0, CASE_LOWER = 1, CASE_TITLE = 2, CASE_IDENT = 3 };
@ -46,6 +46,6 @@ size_t strlen_uni(const uint32 *s);
extern glui32 bufferChangeCase(glui32 *buf, glui32 len,
glui32 numchars, BufferChangeCase destcase, BufferChangeCond cond, int changerest);
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -27,7 +27,7 @@
#include "glk/unicode_gen.h"
namespace Gargoyle {
namespace Glk {
gli_case_block_t unigen_case_block_0x0[256] = {
{ 0x0, 0x0 },
@ -11823,4 +11823,4 @@ gli_decomp_block_t unigen_decomp_block_0x2fa[256] = {
*countptr = 0; \
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -25,7 +25,7 @@
#include "glk/glk_types.h"
namespace Gargoyle {
namespace Glk {
#define GET_CASE_BLOCK(ch, blockptr) \
switch ((glui32)(ch) >> 8) { \
@ -558,6 +558,6 @@ extern gli_case_special_t unigen_special_0xfb16;
extern gli_case_special_t unigen_special_0xfb17;
extern glui32 unigen_special_array[];
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -23,7 +23,7 @@
#include "glk/utils.h"
#include "common/textconsole.h"
namespace Gargoyle {
namespace Glk {
int strToInt(const char *s) {
if (!*s)
@ -41,4 +41,4 @@ int strToInt(const char *s) {
return (int)tmp;
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -26,7 +26,7 @@
#include "common/rect.h"
#include "glk/glk_types.h"
namespace Gargoyle {
namespace Glk {
typedef Common::Point Point;
@ -46,6 +46,6 @@ public:
*/
int strToInt(const char *s);
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -22,10 +22,10 @@
#include "glk/window_graphics.h"
#include "glk/conf.h"
#include "glk/gargoyle.h"
#include "glk/glk.h"
#include "glk/screen.h"
namespace Gargoyle {
namespace Glk {
GraphicsWindow::GraphicsWindow(Windows *windows, uint32 rock) : Window(windows, rock),
_w(0), _h(0), _dirty(false), _surface(nullptr) {
@ -269,4 +269,4 @@ void GraphicsWindow::click(const Point &newPos) {
}
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -26,7 +26,7 @@
#include "glk/windows.h"
#include "glk/picture.h"
namespace Gargoyle {
namespace Glk {
/**
* Graphics window
@ -108,6 +108,6 @@ public:
virtual void setBackgroundColor(glui32 color) override;
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -22,10 +22,10 @@
#include "glk/window_pair.h"
#include "glk/conf.h"
#include "glk/gargoyle.h"
#include "glk/glk.h"
#include "glk/screen.h"
namespace Gargoyle {
namespace Glk {
PairWindow::PairWindow(Windows *windows, glui32 method, Window *key, glui32 size) :
Window(windows, 0),
@ -233,4 +233,4 @@ void PairWindow::click(const Point &newPos) {
_child2->click(newPos);
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -25,7 +25,7 @@
#include "glk/windows.h"
namespace Gargoyle {
namespace Glk {
/**
* Pair window
@ -68,6 +68,6 @@ public:
virtual void click(const Point &newPos) override;
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -22,12 +22,12 @@
#include "glk/window_text_buffer.h"
#include "glk/conf.h"
#include "glk/gargoyle.h"
#include "glk/glk.h"
#include "glk/screen.h"
#include "glk/selection.h"
#include "glk/unicode.h"
namespace Gargoyle {
namespace Glk {
/**
*
@ -1633,4 +1633,4 @@ TextBufferWindow::TextBufferRow::TextBufferRow() : _len(0), _newLine(0), _dirty(
Common::fill(&_chars[0], &_chars[TBLINELEN], 0);
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -27,7 +27,7 @@
#include "glk/picture.h"
#include "glk/speech.h"
namespace Gargoyle {
namespace Glk {
/**
* Text Buffer window
@ -240,6 +240,6 @@ public:
}
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -22,11 +22,11 @@
#include "glk/window_text_grid.h"
#include "glk/conf.h"
#include "glk/gargoyle.h"
#include "glk/glk.h"
#include "glk/selection.h"
#include "glk/screen.h"
namespace Gargoyle {
namespace Glk {
TextGridWindow::TextGridWindow(Windows *windows, uint32 rock) : Window(windows, rock) {
_type = wintype_TextGrid;
@ -651,4 +651,4 @@ void TextGridWindow::TextGridRow::resize(size_t newSize) {
Common::fill(&_chars[0], &_chars[0] + newSize, ' ');
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -25,7 +25,7 @@
#include "glk/windows.h"
namespace Gargoyle {
namespace Glk {
/**
* Text Grid window
@ -190,6 +190,6 @@ public:
}
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif

View file

@ -26,13 +26,13 @@
#include "glk/window_text_buffer.h"
#include "glk/window_text_grid.h"
#include "glk/conf.h"
#include "glk/gargoyle.h"
#include "glk/glk.h"
#include "glk/screen.h"
#include "glk/streams.h"
#include "common/algorithm.h"
#include "common/textconsole.h"
namespace Gargoyle {
namespace Glk {
bool Windows::_overrideReverse;
bool Windows::_overrideFgSet;
@ -770,4 +770,4 @@ byte *Attributes::attrFg(WindowStyle *styles) {
}
}
} // End of namespace Gargoyle
} // End of namespace Glk

View file

@ -33,7 +33,7 @@
#include "glk/selection.h"
#include "glk/streams.h"
namespace Gargoyle {
namespace Glk {
class Window;
class PairWindow;
@ -536,6 +536,6 @@ public:
BlankWindow(Windows *windows, uint32 rock);
};
} // End of namespace Gargoyle
} // End of namespace Glk
#endif