mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-04 08:28:41 +00:00
GLK: Add stub classes for sub-engine components
This commit is contained in:
parent
c4d4d48d67
commit
9c536cb6bf
31
engines/gargoyle/events.cpp
Normal file
31
engines/gargoyle/events.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
/* 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 "gargoyle/events.h"
|
||||
|
||||
namespace Gargoyle {
|
||||
|
||||
void Events::pollEvents() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
} // End of namespace Gargoyle
|
40
engines/gargoyle/events.h
Normal file
40
engines/gargoyle/events.h
Normal file
@ -0,0 +1,40 @@
|
||||
/* 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 GARGOYLE_EVENTS_H
|
||||
#define GARGOYLE_EVENTS_H
|
||||
|
||||
#include "common/events.h"
|
||||
|
||||
namespace Gargoyle {
|
||||
|
||||
class Events {
|
||||
public:
|
||||
/**
|
||||
* Checks for new events
|
||||
*/
|
||||
void pollEvents();
|
||||
};
|
||||
|
||||
} // End of namespace Gargoyle
|
||||
|
||||
#endif
|
@ -31,8 +31,9 @@
|
||||
|
||||
namespace Gargoyle {
|
||||
|
||||
GargoyleEngine::GargoyleEngine(OSystem *syst, const GargoyleGameDescription *gameDesc)
|
||||
: _gameDescription(gameDesc), Engine(syst) {
|
||||
GargoyleEngine::GargoyleEngine(OSystem *syst, const GargoyleGameDescription *gameDesc) :
|
||||
_gameDescription(gameDesc), Engine(syst), _glk(&_screen),
|
||||
_scott(_glk) {
|
||||
}
|
||||
|
||||
GargoyleEngine::~GargoyleEngine() {
|
||||
|
@ -28,6 +28,10 @@
|
||||
#include "common/serializer.h"
|
||||
#include "engines/advancedDetector.h"
|
||||
#include "engines/engine.h"
|
||||
#include "graphics/screen.h"
|
||||
#include "gargoyle/events.h"
|
||||
#include "gargoyle/glk.h"
|
||||
#include "gargoyle/scott/scott.h"
|
||||
|
||||
namespace Gargoyle {
|
||||
|
||||
@ -57,9 +61,13 @@ private:
|
||||
* Handles basic initialization
|
||||
*/
|
||||
void initialize();
|
||||
protected:
|
||||
private:
|
||||
const GargoyleGameDescription *_gameDescription;
|
||||
int _loadSaveSlot;
|
||||
Graphics::Screen _screen;
|
||||
Events _events;
|
||||
Glk _glk;
|
||||
Scott::Scott _scott;
|
||||
|
||||
// Engine APIs
|
||||
virtual Common::Error run();
|
||||
|
28
engines/gargoyle/glk.cpp
Normal file
28
engines/gargoyle/glk.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
/* 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 "gargoyle/glk.h"
|
||||
|
||||
namespace Gargoyle {
|
||||
|
||||
|
||||
} // End of namespace Gargoyle
|
45
engines/gargoyle/glk.h
Normal file
45
engines/gargoyle/glk.h
Normal file
@ -0,0 +1,45 @@
|
||||
/* 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 GARGOYLE_GLK_H
|
||||
#define GARGOYLE_GLK_H
|
||||
|
||||
#include "graphics/managed_surface.h"
|
||||
|
||||
namespace Gargoyle {
|
||||
|
||||
/**
|
||||
* Implements the GLK interface
|
||||
*/
|
||||
class Glk {
|
||||
private:
|
||||
Graphics::ManagedSurface *_surface;
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Glk(Graphics::ManagedSurface *surface) : _surface(surface) {}
|
||||
};
|
||||
|
||||
} // End of namespace Gargoyle
|
||||
|
||||
#endif
|
28
engines/gargoyle/interpreter.cpp
Normal file
28
engines/gargoyle/interpreter.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
/* 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 "gargoyle/interpreter.h"
|
||||
|
||||
namespace Gargoyle {
|
||||
|
||||
|
||||
} // End of namespace Gargoyle
|
45
engines/gargoyle/interpreter.h
Normal file
45
engines/gargoyle/interpreter.h
Normal file
@ -0,0 +1,45 @@
|
||||
/* 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 GARGOYLE_INTERPRETER_H
|
||||
#define GARGOYLE_INTERPRETER_H
|
||||
|
||||
#include "gargoyle/glk.h"
|
||||
|
||||
namespace Gargoyle {
|
||||
|
||||
/**
|
||||
* Base class for specific interpreters
|
||||
*/
|
||||
class Interpreter {
|
||||
protected:
|
||||
Glk &_glk;
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Interpreter(Glk &glk) : _glk(glk) {}
|
||||
};
|
||||
|
||||
} // End of namespace Gargoyle
|
||||
|
||||
#endif
|
@ -2,7 +2,11 @@ MODULE := engines/gargoyle
|
||||
|
||||
MODULE_OBJS := \
|
||||
detection.o \
|
||||
gargoyle.o
|
||||
events.o \
|
||||
gargoyle.o \
|
||||
glk.o \
|
||||
interpreter.o \
|
||||
scott/scott.o
|
||||
|
||||
# This module can be built as a plugin
|
||||
ifeq ($(ENABLE_GARGOYLE), DYNAMIC_PLUGIN)
|
||||
|
30
engines/gargoyle/scott/scott.cpp
Normal file
30
engines/gargoyle/scott/scott.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
/* 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 "gargoyle/scott/scott.h"
|
||||
|
||||
namespace Gargoyle {
|
||||
namespace Scott {
|
||||
|
||||
|
||||
} // End of namespace Scott
|
||||
} // End of namespace Gargoyle
|
98
engines/gargoyle/scott/scott.h
Normal file
98
engines/gargoyle/scott/scott.h
Normal file
@ -0,0 +1,98 @@
|
||||
/* 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 GARGOYLE_SCOTT
|
||||
#define GARGOYLE_SCOTT
|
||||
|
||||
/*
|
||||
* Controlling block
|
||||
*/
|
||||
|
||||
#include "common/scummsys.h"
|
||||
#include "gargoyle/interpreter.h"
|
||||
|
||||
namespace Gargoyle {
|
||||
namespace Scott {
|
||||
|
||||
#define LIGHT_SOURCE 9 // Always 9 how odd
|
||||
#define CARRIED 255 // Carried
|
||||
#define DESTROYED 0 // Destroyed
|
||||
#define DARKBIT 15
|
||||
#define LIGHTOUTBIT 16 // Light gone out
|
||||
|
||||
#define YOUARE 1 // You are not I am
|
||||
#define SCOTTLIGHT 2 // Authentic Scott Adams light messages
|
||||
#define DEBUGGING 4 // Info from database load
|
||||
#define TRS80_STYLE 8 // Display in style used on TRS-80
|
||||
#define PREHISTORIC_LAMP 16 // Destroy the lamp (very old databases)
|
||||
|
||||
struct Header {
|
||||
int Unknown;
|
||||
int NumItems;
|
||||
int NumActions;
|
||||
int NumWords; // Smaller of verb/noun is padded to same size
|
||||
int NumRooms;
|
||||
int MaxCarry;
|
||||
int PlayerRoom;
|
||||
int Treasures;
|
||||
int WordLength;
|
||||
int LightTime;
|
||||
int NumMessages;
|
||||
int TreasureRoom;
|
||||
};
|
||||
|
||||
struct Action {
|
||||
uint Vocab;
|
||||
uint Condition[5];
|
||||
uint action[2];
|
||||
};
|
||||
|
||||
struct Room {
|
||||
char *Text;
|
||||
short Exits[6];
|
||||
};
|
||||
|
||||
struct Item {
|
||||
char *Text; // PORTABILITY WARNING: THESE TWO MUST BE 8 BIT VALUES.
|
||||
byte Location;
|
||||
byte InitialLoc;
|
||||
char *AutoGet;
|
||||
};
|
||||
|
||||
struct Tail {
|
||||
int Version;
|
||||
int AdventureNumber;
|
||||
int Unknown;
|
||||
};
|
||||
|
||||
class Scott : public Interpreter {
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Scott(Glk &glk) : Interpreter(glk) {}
|
||||
};
|
||||
|
||||
} // End of namespace Scott
|
||||
} // End of namespace Gargoyle
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user