FREESCAPE: correctly parse images in dos driller demo and removed extra files from freescape.dat

This commit is contained in:
neuromancer 2023-03-08 20:43:17 +01:00
parent 6dc129dc34
commit c77e280500
6 changed files with 48 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

View file

@ -462,6 +462,8 @@ private:
void drawAmigaAtariSTUI(Graphics::Surface *surface);
Graphics::ManagedSurface *load8bitTitleImage(Common::SeekableReadStream *file, int offset);
Graphics::ManagedSurface *load8bitDemoImage(Common::SeekableReadStream *file, int offset);
uint32 getPixel8bitTitleImage(int index);
void renderPixels8bitTitleImage(Graphics::ManagedSurface *surface, int &i, int &j, int pixels);
};

View file

@ -196,6 +196,50 @@ byte kEGADefaultPaletteData[16][3] = {
{0x00, 0x00, 0x00}
};
Graphics::ManagedSurface *DrillerEngine::load8bitDemoImage(Common::SeekableReadStream *file, int offset) {
Graphics::ManagedSurface *surface = new Graphics::ManagedSurface();
surface->create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
surface->fillRect(Common::Rect(0, 0, 320, 200), 0);
file->seek(offset);
int i = 0;
int j = 0;
while (true) {
byte pixels = file->readByte();
for (int b = 0; b < 4; b++) {
int color = pixels & 3;
pixels = pixels >> 2;
surface->setPixel(i + (3 - b), 2 * j, color);
}
i = i + 4;
if (i == 320) {
i = 0;
j++;
}
if (j == 100)
break;
}
file->seek(0xc0, SEEK_CUR);
i = 0;
j = 0;
while (true) {
byte pixels = file->readByte();
for (int b = 0; b < 4; b++) {
int color = pixels & 3;
pixels = pixels >> 2;
surface->setPixel(i + (3 - b), 2 * j + 1, color);
}
i = i + 4;
if (i == 320) {
i = 0;
j++;
}
if (j == 100)
break;
}
return surface;
}
void DrillerEngine::loadAssetsDOSFullGame() {
Common::File file;
if (_renderMode == Common::kRenderEGA) {
@ -256,7 +300,6 @@ void DrillerEngine::loadAssetsDOSDemo() {
_renderMode = Common::kRenderCGA; // DOS demos is CGA only
_viewArea = Common::Rect(36, 16, 284, 117); // correct view area
_gfx->_renderMode = _renderMode;
loadBundledImages();
file.open("d2");
if (!file.isOpen())
error("Failed to open 'd2' file");
@ -265,6 +308,8 @@ void DrillerEngine::loadAssetsDOSDemo() {
loadMessagesFixedSize(&file, 0x636, 14, 20);
load8bitBinary(&file, 0x55b0, 4);
loadGlobalObjects(&file, 0x8c);
_border = load8bitDemoImage(&file, 0x6220);
_border->setPalette((byte*)&kCGAPalettePinkBlueWhiteData, 0, 4);
// Fixed for a corrupted area names in the demo data
_areaMap[2]->_name = "LAPIS LAZULI";

View file

@ -105,9 +105,6 @@ void DrillerEngine::titleScreen() {
}
}
void DrillerEngine::borderScreen() {
if (isDOS() && isDemo()) // Demo will not show the border
return;
if (isAmiga() || isAtariST()) // TODO: implement these with their own animations
return;