FREESCAPE: implemented title display for some driller releases

This commit is contained in:
neuromancer 2022-10-02 20:18:23 +02:00 committed by Eugene Sandulenko
parent 6400b4d5b3
commit 550a82e62f
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
4 changed files with 49 additions and 9 deletions

View File

@ -76,6 +76,7 @@ FreescapeEngine::FreescapeEngine(OSystem *syst, const ADGameDescription *gd)
_border = nullptr;
_title = nullptr;
_titleTexture = nullptr;
_borderTexture = nullptr;
_uiTexture = nullptr;
_fontLoaded = false;
@ -105,6 +106,17 @@ void FreescapeEngine::drawBorder() {
_gfx->setViewport(_viewArea);
}
void FreescapeEngine::drawTitle() {
if (!_title)
return;
_gfx->setViewport(_fullscreenViewArea);
if (!_titleTexture)
_titleTexture = _gfx->createTexture(_title);
_gfx->drawTexturedRect2D(_fullscreenViewArea, _fullscreenViewArea, _titleTexture);
_gfx->setViewport(_viewArea);
}
void FreescapeEngine::loadAssets() {
Common::SeekableReadStream *file = nullptr;
Common::String path = ConfMan.get("path");
@ -286,14 +298,16 @@ Common::Error FreescapeEngine::run() {
}
int saveSlot = ConfMan.getInt("save_slot");
if (_border) {
if (_title) {
if (saveSlot == -1) {
drawBorder();
drawTitle();
_gfx->flipBuffer();
g_system->updateScreen();
if (isDriller())
g_system->delayMillis(1000);
g_system->delayMillis(3000);
}
}
if (_border) {
_borderTexture = nullptr;
_border->fillRect(_viewArea, 0xA0A0A0FF);

View File

@ -98,10 +98,12 @@ public:
void convertBorder();
void drawBorder();
void drawTitle();
virtual void drawUI();
Graphics::Surface *_border;
Graphics::Surface *_title;
Texture *_borderTexture;
Texture *_titleTexture;
Texture *_uiTexture;
// Parsing assets

View File

@ -196,21 +196,44 @@ void DrillerEngine::loadAssetsFullGame() {
Common::File exe;
if (isAmiga()) {
file = gameDir.createReadStreamForMember("driller");
if (file == nullptr)
error("Failed to open 'driller' executable for Amiga");
if (_variant == "Retail") {
file = gameDir.createReadStreamForMember("driller");
if (file == nullptr)
error("Failed to open 'driller' executable for Amiga");
_border = loadAndConvertNeoImage(file, 0x137f4);
_title = loadAndConvertNeoImage(file, 0x1b572);
loadMessagesFixedSize(file, 0xc66e, 14, 20);
loadGlobalObjects(file, 0xbd62);
load8bitBinary(file, 0x29c16, 16);
loadAmigaPalette(file, 0x297d4);
loadAmigaSounds(file, 0x30e80, 25);
} else if (_variant == "Kixx") {
file = gameDir.createReadStreamForMember("lift.neo");
if (file == nullptr)
error("Failed to open 'lift.neo' file");
_title = loadAndConvertNeoImage(file, 0);
file = gameDir.createReadStreamForMember("console.neo");
if (file == nullptr)
error("Failed to open 'console.neo' file");
_border = loadAndConvertNeoImage(file, 0);
file = gameDir.createReadStreamForMember("driller");
if (file == nullptr)
error("Failed to open 'driller' executable for Amiga");
load8bitBinary(file, 0x21a3e, 16);
loadAmigaPalette(file, 0x215fc);
file = gameDir.createReadStreamForMember("soundfx");
if (file == nullptr)
error("Failed to open 'soundfx' executable for Amiga");
loadAmigaSounds(file, 0, 25);
}
} else if (_renderMode == "ega") {

View File

@ -52,6 +52,7 @@ void NeoDecoder::destroy() {
bool NeoDecoder::loadStream(Common::SeekableReadStream &stream) {
destroy();
int start = stream.pos();
if (stream.readUint16LE() != 0x00)
return false;
@ -69,7 +70,7 @@ bool NeoDecoder::loadStream(Common::SeekableReadStream &stream) {
_palette[i * 3 + 2] = floor((v2 & 0x07) * 255.0 / 7.0);
}
stream.seek(128);
stream.seek(start + 128);
int width = 320;
int height = 200;