TINSEL: Adjust LoadFile for Noir, stubbing out compression for now.

This commit is contained in:
Einar Johan Trøan Sømåen 2021-02-06 00:18:44 +01:00
parent 6e3daad277
commit 0f78bfeeae
No known key found for this signature in database
GPG Key ID: E78D26458077C9C5
4 changed files with 78 additions and 2 deletions

View File

@ -34,6 +34,7 @@
#include "tinsel/timers.h" // for DwGetCurrentTime()
#include "tinsel/tinsel.h"
#include "tinsel/scene.h"
#include "tinsel/noir/lzss.h"
namespace Tinsel {
@ -254,7 +255,7 @@ void Handle::LoadFile(MEMHANDLE *pH) {
memcpy(szFilename, pH->szName, sizeof(pH->szName));
szFilename[sizeof(pH->szName)] = 0;
if (pH->filesize & fCompressed) {
if (!TinselV3 && MEMFLAGS(pH) & fCompressed) {
error("Compression handling has been removed - %s", szFilename);
}
@ -269,7 +270,11 @@ void Handle::LoadFile(MEMHANDLE *pH) {
// make sure address is valid
assert(addr);
bytes = f.read(addr, pH->filesize & FSIZE_MASK);
if (TinselV3 && MEMFLAGS(pH) & fCompressed) {
bytes = decompressLZSS(f, addr);
} else {
bytes = f.read(addr, pH->filesize & FSIZE_MASK);
}
// close the file
f.close();

View File

@ -1,6 +1,7 @@
MODULE := engines/tinsel
MODULE_OBJS := \
noir/lzss.o \
actors.o \
adpcm.o \
anim.o \

View File

@ -0,0 +1,35 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Prototypes of actor functions
*/
#include "common/textconsole.h"
#include "tinsel/noir/lzss.h"
namespace Tinsel {
int decompressLZSS(Common::ReadStream &input, byte *output) {
error("TODO: Implement decompression");
return 0;
}
}

View File

@ -0,0 +1,35 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Prototypes of actor functions
*/
#ifndef TINSEL_NOIR_LZSS_H
#define TINSEL_NOIR_LZSS_H
#include "common/stream.h"
namespace Tinsel {
int decompressLZSS(Common::ReadStream &input, byte *output);
}
#endif