From 0f2c9e6ea489ecac11a5715cdfe977e862af8dd9 Mon Sep 17 00:00:00 2001 From: yoshizf Date: Sun, 21 Sep 2003 18:33:04 +0000 Subject: [PATCH] support for palettes in AHDR (SMUSH) --- image.cpp | 5 ++++- resource.cpp | 4 ++-- resource.h | 4 ++-- scummex.cpp | 4 +++- wxwindows.cpp | 3 ++- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/image.cpp b/image.cpp index 6c3ffdd..d28ae91 100644 --- a/image.cpp +++ b/image.cpp @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/image.cpp,v 1.4 2003/09/19 15:47:41 fingolfin Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/image.cpp,v 1.5 2003/09/21 18:33:04 yoshizf Exp $ * */ @@ -46,6 +46,9 @@ int Image::drawPalette(BlockTable *_blockTable, int id, File& _input) _input.seek(_blockTable[id].offset + 8, SEEK_SET); + if (_blockTable[id].blockTypeID == AHDR) + _input.seek(6, SEEK_CUR); + for (int j = 0; j < 256; j++) { _rgbTable[j].red = _input.readByte(); // red _rgbTable[j].green = _input.readByte(); // green diff --git a/resource.cpp b/resource.cpp index a19374e..51564dc 100644 --- a/resource.cpp +++ b/resource.cpp @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/resource.cpp,v 1.10 2003/09/21 15:04:14 yoshizf Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/resource.cpp,v 1.11 2003/09/21 18:33:04 yoshizf Exp $ * */ @@ -747,7 +747,7 @@ int Resource::parseBlocks(char *blockName, BlockTable *_blockTable, File& _input case FOBJ: _blockTable[index].blockSize = _input.readUint32BE() + 8; - _input.readUint16LE(); // Codec + _blockTable[index].variables = _input.readUint16LE(); // Codec _input.readUint16BE(); // Left _input.readUint16BE(); // Top _blockTable[index].width = _input.readUint16LE(); // Width diff --git a/resource.h b/resource.h index de3e9d3..32a7e8d 100644 --- a/resource.h +++ b/resource.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/resource.h,v 1.4 2003/09/21 15:04:14 yoshizf Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/resource.h,v 1.5 2003/09/21 18:33:04 yoshizf Exp $ * */ @@ -166,7 +166,7 @@ const struct blockInfo blocksInfo[] = { {101, "FOBJ", "SMUSH Frame Object", 0, "", 32}, {102, "IACT", "iMUSE Action", 0, "", 24}, {103, "NPAL", "New Palette", 0, "", 34}, - {104, "TRES", "Text Resource"}, + {104, "TRES", "Text Resource", 0, "", 47}, {105, "PSAD", "", 0, "", 24}, {106, "SAUD", "", 0, "", 24}, {107, "STRK", "", 0, "", 24}, diff --git a/scummex.cpp b/scummex.cpp index 57928dd..1996eb8 100644 --- a/scummex.cpp +++ b/scummex.cpp @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/scummex.cpp,v 1.10 2003/09/21 15:04:14 yoshizf Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/scummex.cpp,v 1.11 2003/09/21 18:33:04 yoshizf Exp $ * */ @@ -340,6 +340,7 @@ void ScummEX::UpdateInfosFromTree(int blockid) { case APAL: case 208: // PA case NPAL: + case AHDR: _gui->SetButton(_blockTable[blockid].blockTypeID); break; @@ -381,6 +382,7 @@ void ScummEX::UpdateInfosFromTree(int blockid) { case FOBJ: _gui->updateLabel("SpecLabel1", "Frame Width", _blockTable[blockid].width); _gui->updateLabel("SpecLabel2", "Frame Height", _blockTable[blockid].height); + _gui->updateLabel("SpecLabel3", "Codec", _blockTable[blockid].variables); break; } } diff --git a/wxwindows.cpp b/wxwindows.cpp index 0aa1d4b..eabbe3a 100644 --- a/wxwindows.cpp +++ b/wxwindows.cpp @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/wxwindows.cpp,v 1.8 2003/09/21 15:22:51 yoshizf Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/wxwindows.cpp,v 1.9 2003/09/21 18:33:04 yoshizf Exp $ * */ @@ -354,6 +354,7 @@ void GUI_wxWindows::SetButton(int blocktype) { case APAL: case 208: // Palettes case NPAL: + case AHDR: SpecButton1->SetLabel("View Palette"); SpecButton1->Show(TRUE); SpecButton1->Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,