Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f78699b
Showing
6 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#include "engines/metaengine.h" | ||
#include "common/fs.h" | ||
#include "common/unzip.h" | ||
|
||
#include "unity.h" | ||
|
||
static const PlainGameDescriptor unityGames[] = { | ||
{ "unity", "Star Trek: The Next Generation \"A Final Unity\"" }, | ||
{ 0, 0 } | ||
}; | ||
|
||
class UnityMetaEngine : public MetaEngine { | ||
virtual const char *getName() const { return "A Final Unity engine"; } | ||
virtual const char *getOriginalCopyright() const { return "Copyright (C) Spectrum Holobyte Inc."; } | ||
|
||
virtual GameList getSupportedGames() const { | ||
GameList games; | ||
const PlainGameDescriptor *g = unityGames; | ||
while (g->gameid) { | ||
games.push_back(*g); | ||
g++; | ||
} | ||
return games; | ||
} | ||
|
||
virtual GameDescriptor findGame(const char *gameid) const { | ||
const PlainGameDescriptor *g = unityGames; | ||
while (g->gameid) { | ||
if (0 == scumm_stricmp(gameid, g->gameid)) | ||
break; | ||
g++; | ||
} | ||
return GameDescriptor(g->gameid, g->description); | ||
} | ||
|
||
virtual GameList detectGames(const Common::FSList &fslist) const { | ||
GameList detectedGames; | ||
|
||
for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { | ||
if (!file->isDirectory()) { | ||
const char *gameName = file->getName().c_str(); | ||
|
||
// game data is stored on the CD in this file; | ||
// TODO: might want to support unzipped installs too | ||
if (0 == scumm_stricmp("STTNG.ZIP", gameName)) { | ||
Common::Archive *archive = Common::makeZipArchive(*file); | ||
// just some random file as a sanity check | ||
if (archive && archive->hasFile("PENTARA.BIN")) { | ||
detectedGames.push_back(unityGames[0]); | ||
delete archive; | ||
break; | ||
} | ||
delete archive; | ||
} | ||
} | ||
} | ||
return detectedGames; | ||
} | ||
|
||
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const { | ||
*engine = new Unity::UnityEngine(syst); | ||
return Common::kNoError; | ||
} | ||
}; | ||
|
||
#if PLUGIN_ENABLED_DYNAMIC(UNITY) | ||
REGISTER_PLUGIN_DYNAMIC(UNITY, PLUGIN_TYPE_ENGINE, UnityMetaEngine); | ||
#else | ||
REGISTER_PLUGIN_STATIC(UNITY, PLUGIN_TYPE_ENGINE, UnityMetaEngine); | ||
#endif |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
MODULE := engines/unity | ||
|
||
MODULE_OBJS := \ | ||
debug.o \ | ||
detection.o \ | ||
graphics.o \ | ||
unity.o | ||
|
||
# This module can be built as a plugin | ||
ifeq ($(ENABLE_UNITY), DYNAMIC_PLUGIN) | ||
PLUGIN := 1 | ||
endif | ||
|
||
# Include common rules | ||
include $(srcdir)/rules.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "unity.h" | ||
|
||
#include "common/fs.h" | ||
#include "common/config-manager.h" | ||
#include "engines/util.h" | ||
|
||
namespace Unity { | ||
|
||
UnityEngine::UnityEngine(OSystem *syst) : Engine(syst) { | ||
const Common::FSNode gameDataDir(ConfMan.get("path")); | ||
} | ||
|
||
UnityEngine::~UnityEngine() { | ||
} | ||
|
||
Common::Error UnityEngine::init() { | ||
return Common::kNoError; | ||
} | ||
|
||
Common::Error UnityEngine::run() { | ||
initGraphics(640, 480, true); | ||
|
||
// TODO | ||
|
||
return Common::kNoError; | ||
} | ||
|
||
} // Unity | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef _UNITY_H | ||
#define _UNITY_H | ||
|
||
#include "engines/engine.h" | ||
|
||
namespace Unity { | ||
|
||
class UnityEngine : public Engine { | ||
public: | ||
UnityEngine(class OSystem *syst); | ||
~UnityEngine(); | ||
|
||
Common::Error init(); | ||
Common::Error run(); | ||
}; | ||
|
||
} // Unity | ||
|
||
#endif | ||
|