mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
GLK: SCOTT: Hopefully fix global constructor warning
The games list is moved to be a field of Globals, by putting the list into a header file included directly inside the Globals class definition
This commit is contained in:
parent
fae01e8c84
commit
622d27f73f
@ -378,7 +378,7 @@ GameIDType detectGame(Common::SeekableReadStream *f) {
|
||||
|
||||
_G(_fileLength) = f->size();
|
||||
|
||||
_G(_game) = new GameInfo;
|
||||
_G(_game) = &_G(_fallbackGame);
|
||||
|
||||
Common::String md5 = g_vm->getGameMD5();
|
||||
const GlkDetectionEntry *p = SCOTT_GAMES;
|
||||
@ -386,7 +386,7 @@ GameIDType detectGame(Common::SeekableReadStream *f) {
|
||||
while (p->_md5) {
|
||||
if (md5.equalsC(p->_md5)) {
|
||||
if (!scumm_stricmp(p->_extra, "")) {
|
||||
CURRENT_GAME = SCOTTFREE;
|
||||
_G(_fallbackGame)._gameID = SCOTTFREE;
|
||||
}
|
||||
if (!scumm_stricmp(p->_extra, "ZXSpectrum")) {
|
||||
_G(_entireFile) = new uint8_t[_G(_fileLength)];
|
||||
@ -407,10 +407,9 @@ GameIDType detectGame(Common::SeekableReadStream *f) {
|
||||
if (dict_type == NOT_A_GAME)
|
||||
return UNKNOWN_GAME;
|
||||
for (int i = 0; i < NUMGAMES; i++) {
|
||||
if (g_games[i]._dictionary == dict_type) {
|
||||
if (tryLoading(g_games[i], offset, 0)) {
|
||||
delete _G(_game);
|
||||
_G(_game) = &g_games[i];
|
||||
if (_G(_games)[i]._dictionary == dict_type) {
|
||||
if (tryLoading(_G(_games)[i], offset, 0)) {
|
||||
_G(_game) = &_G(_games)[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -28,7 +28,6 @@
|
||||
namespace Glk {
|
||||
namespace Scott {
|
||||
|
||||
extern GameInfo g_games[];
|
||||
extern const char *g_sysDict[];
|
||||
extern const char *g_sysDictIAm[];
|
||||
extern const char *g_sysDictZX[];
|
||||
|
2363
engines/glk/scott/games.h
Normal file
2363
engines/glk/scott/games.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -62,7 +62,6 @@ public:
|
||||
Common::Array<Action> _actions;
|
||||
Common::StringArray _sys;
|
||||
Common::StringArray _systemMessages;
|
||||
GameInfo *_game = nullptr;
|
||||
winid_t _graphics = nullptr;
|
||||
uint8_t *_entireFile = nullptr;
|
||||
size_t _fileLength = 0;
|
||||
@ -147,6 +146,10 @@ public:
|
||||
SavedState *_oldestUndo = nullptr;
|
||||
int _numberOfUndos = 0;
|
||||
|
||||
const GameInfo *_game;
|
||||
GameInfo _fallbackGame;
|
||||
// Include game list
|
||||
#include "glk/scott/games.h"
|
||||
public:
|
||||
Globals();
|
||||
~Globals();
|
||||
|
Loading…
Reference in New Issue
Block a user