CRYOMNI3D: Support the Versailles 1685 demo

This commit is contained in:
Cameron Cawley 2021-10-02 14:48:07 +01:00 committed by Le Philousophe
parent 4c079726d7
commit f5ea77bed3
5 changed files with 44 additions and 9 deletions

View File

@ -29,6 +29,8 @@
#include "common/events.h"
#include "common/file.h"
#include "engines/util.h"
#include "audio/mixer.h"
#include "graphics/palette.h"
@ -488,4 +490,19 @@ void CryOmni3DEngine::fillSurface(byte color) {
g_system->fillScreen(color);
g_system->updateScreen();
}
Common::Error CryOmni3DEngine_HNMPlayer::run() {
CryOmni3DEngine::run();
initGraphics(640, 480);
syncSoundSettings();
for (int i = 0; _gameDescription->desc.filesDescriptions[i].fileName; i++) {
playHNM(_gameDescription->desc.filesDescriptions[i].fileName, Audio::Mixer::kMusicSoundType);
}
return Common::kNoError;
}
} // End of namespace CryOmni3D

View File

@ -183,6 +183,22 @@ private:
bool _hnmHasClip;
};
class CryOmni3DEngine_HNMPlayer : public CryOmni3DEngine {
protected:
Common::Error run() override;
public:
CryOmni3DEngine_HNMPlayer(OSystem *syst, const CryOmni3DGameDescription *gamedesc) : CryOmni3DEngine(syst, gamedesc) {}
~CryOmni3DEngine_HNMPlayer() override {}
virtual bool displayToolbar(const Graphics::Surface *original) override { return false; }
virtual bool hasPlaceDocumentation() override { return false; }
virtual bool displayPlaceDocumentation() override { return false; }
virtual uint displayOptions() override { return 0; }
virtual void makeTranslucent(Graphics::Surface &dst, const Graphics::Surface &src) const override {}
virtual void setupPalette(const byte *colors, uint start, uint num) override {}
};
} // End of namespace CryOmni3D
#endif

View File

@ -28,7 +28,8 @@
namespace CryOmni3D {
enum CryOmni3DGameType {
GType_VERSAILLES
GType_VERSAILLES,
GType_HNM_PLAYER
};
enum CryOmni3DGameFeatures {

View File

@ -23,6 +23,7 @@
namespace CryOmni3D {
#define GUI_OPTIONS_VERSAILLES GUIO3(GUIO_NOMIDI, GUIO_NOSFX, GUIO_NOASPECT)
#define GUI_OPTIONS_HNM_PLAYER GUIO4(GUIO_NOMIDI, GUIO_NOSFX, GUIO_NOSPEECH, GUIO_NOASPECT)
// To correctly detect root we need files from various places: CD1, CD2, HDD, on-CD install files
// We use files common to all installations except the documentation links and the binary
@ -541,17 +542,14 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
{
"versailles",
"Demo",
{
{ "DEMO_US.HNS", 0, "3a65a984353fec354dd26a62ca2cd3fb", 68462303 },
{ "PLAYHNS.EXE", 0, "1c992f034f43418a5da2e8ebd0b92620", 472371 }
},
AD_ENTRY1s("DEMO_US.HNS", "3a65a984353fec354dd26a62ca2cd3fb", 68462303),
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_DEMO | ADGF_UNSUPPORTED,
GUI_OPTIONS_VERSAILLES
ADGF_DEMO,
GUI_OPTIONS_HNM_PLAYER
},
GType_VERSAILLES,
/* GF_VERSAILLES_FONTS_ | */ GF_VERSAILLES_AUDIOPADDING_NO,
GType_HNM_PLAYER,
0,
},
{ AD_TABLE_END_MARKER, 0, 0 }

View File

@ -141,6 +141,9 @@ Common::Error CryOmni3DMetaEngine::createInstance(OSystem *syst, Engine **engine
#else
return Common::Error(Common::kUnsupportedGameidError, _s("Versailles 1685 support is not compiled in"));
#endif
case GType_HNM_PLAYER:
*engine = new CryOmni3DEngine_HNMPlayer(syst, gd);
return Common::kNoError;
default:
return Common::kUnsupportedGameidError;
}