mirror of
https://github.com/scummvm/scummex.git
synced 2026-05-21 05:40:51 +00:00
Added support for COMI room/objects images
This commit is contained in:
@@ -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.8 2003/09/22 18:25:16 yoshizf Exp $
|
||||
* $Header: /Users/sev/projects/sc/s/scummvm/scummex/image.cpp,v 1.9 2003/09/22 19:47:58 yoshizf Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -109,12 +109,12 @@ void Image::drawLine(int xStart, int yStart, int xEnd, int yEnd, int red, int gr
|
||||
int Image::drawBoxes(BlockTable *_blockTable, int id, File& _input, int newWindow) {
|
||||
int nBox, RMHDindex, width, height;
|
||||
|
||||
RMHDindex = _resource->findBlock(0, _blockTable, _input, id, "RMHD", "-1");
|
||||
RMHDindex = _resource->findBlock(0, _blockTable, id, "RMHD", "-1");
|
||||
width = _blockTable[RMHDindex].width;
|
||||
height = _blockTable[RMHDindex].height;
|
||||
|
||||
if (newWindow == 0)
|
||||
id = _resource->findBlock(0, _blockTable, _input, id, "BOXD", "-1");
|
||||
id = _resource->findBlock(0, _blockTable, id, "BOXD", "-1");
|
||||
|
||||
_input.seek(_blockTable[id].offset + 10, SEEK_SET);
|
||||
|
||||
@@ -157,7 +157,7 @@ int Image::drawSmushFrame(BlockTable *_blockTable, int id, File& _input) {
|
||||
int x = 0, y = 0;
|
||||
byte *dst, *dstorg, *chunk_buffer;
|
||||
|
||||
index = _resource->findBlock(0, _blockTable, _input, id, "NPAL", "AHDR", "-1");
|
||||
index = _resource->findBlock(0, _blockTable, id, "NPAL", "AHDR", "-1");
|
||||
if (_blockTable[index].blockTypeID == AHDR) {
|
||||
_input.seek(_blockTable[index].offset + 14, SEEK_SET);
|
||||
} else {
|
||||
@@ -210,24 +210,26 @@ int Image::drawBG(File& _input, BlockTable *_blockTable, int id)
|
||||
{
|
||||
int RMHDindex, CLUTindex, SMAPindex, TRNSindex;
|
||||
|
||||
if (_blockTable[id].blockTypeID == 209) {
|
||||
RMHDindex = _resource->findBlock(0, _blockTable, _input, id, "HD", "-1");
|
||||
if (_blockTable[id].blockTypeID == BM) {
|
||||
RMHDindex = _resource->findBlock(0, _blockTable, id, "HD", "-1");
|
||||
} else if (_blockTable[id-1].blockTypeID == IMHD) {
|
||||
RMHDindex = id-1;
|
||||
} else {
|
||||
RMHDindex = _resource->findBlock(0, _blockTable, _input, id, "RMHD", "-1");
|
||||
RMHDindex = _resource->findBlock(0, _blockTable, id, "RMHD", "-1");
|
||||
}
|
||||
_width = _blockTable[RMHDindex].width;
|
||||
_height = _blockTable[RMHDindex].height;
|
||||
|
||||
_gui->DisplayImage("Room Image", _width, _height, IMAGE_BOXES);
|
||||
|
||||
if (_blockTable[id].blockTypeID != 209) {
|
||||
TRNSindex = _resource->findBlock(0, _blockTable, _input, id, "TRNS", "-1");
|
||||
if (_blockTable[id].blockTypeID != BM) {
|
||||
TRNSindex = _resource->findBlock(0, _blockTable, id, "TRNS", "-1");
|
||||
_transp = _blockTable[TRNSindex].trans;
|
||||
CLUTindex = _resource->findBlock(0, _blockTable, _input, id, "CLUT", "APAL", "NPAL", "-1");
|
||||
CLUTindex = _resource->findBlock(0, _blockTable, id, "CLUT", "APAL", "NPAL", "-1");
|
||||
_input.seek(_blockTable[CLUTindex].offset + 8, SEEK_SET);
|
||||
} else {
|
||||
_transp = 260;
|
||||
CLUTindex = _resource->findBlock(0, _blockTable, _input, id, "PA", "-1");
|
||||
CLUTindex = _resource->findBlock(0, _blockTable, id, "PA", "-1");
|
||||
_input.seek(_blockTable[CLUTindex].offset + 8, SEEK_SET);
|
||||
}
|
||||
|
||||
@@ -237,15 +239,19 @@ int Image::drawBG(File& _input, BlockTable *_blockTable, int id)
|
||||
_rgbTable[j].blue = _input.readByte(); // blue
|
||||
}
|
||||
|
||||
if (_blockTable[id].blockTypeID != 209) {
|
||||
SMAPindex = _resource->findBlock(1, _blockTable, _input, id, "SMAP", "-1");
|
||||
if (_blockTable[id].blockTypeID != BM) {
|
||||
SMAPindex = _resource->findBlock(1, _blockTable, id, "SMAP", "-1");
|
||||
} else {
|
||||
SMAPindex = id;
|
||||
}
|
||||
|
||||
if (_blockTable[id].blockTypeID == IMAG) {
|
||||
SMAPindex = _resource->findBlock(1, _blockTable, SMAPindex, "OFFS", "-1");
|
||||
}
|
||||
|
||||
_offsets = new uint32[_width/8];
|
||||
|
||||
if (_blockTable[id].blockTypeID != 209) {
|
||||
if (_blockTable[id].blockTypeID != BM) {
|
||||
_input.seek(_blockTable[SMAPindex].offset + 8, SEEK_SET);
|
||||
} else {
|
||||
_input.seek(_blockTable[SMAPindex].offset + 10, SEEK_SET);
|
||||
@@ -270,18 +276,18 @@ int Image::drawObject(File& _input, BlockTable *_blockTable, int id)
|
||||
{
|
||||
int RMHDindex, CLUTindex, SMAPindex, TRNSindex;
|
||||
|
||||
RMHDindex = _resource->findBlock(1, _blockTable, _input, id, "IMHD", "-1");
|
||||
RMHDindex = _resource->findBlock(1, _blockTable, id, "IMHD", "-1");
|
||||
|
||||
_width = _blockTable[RMHDindex].width;
|
||||
_height = _blockTable[RMHDindex].height;
|
||||
|
||||
_gui->DisplayImage("Object", _width, _height);
|
||||
|
||||
TRNSindex = _resource->findBlock(0, _blockTable, _input, id, "TRNS", "-1");
|
||||
TRNSindex = _resource->findBlock(0, _blockTable, id, "TRNS", "-1");
|
||||
|
||||
_transp = _blockTable[TRNSindex].trans;
|
||||
|
||||
CLUTindex = _resource->findBlock(0, _blockTable, _input, id, "CLUT", "APAL", "NPAL", "-1");
|
||||
CLUTindex = _resource->findBlock(0, _blockTable, id, "CLUT", "APAL", "NPAL", "-1");
|
||||
|
||||
_input.seek(_blockTable[CLUTindex].offset + 8, SEEK_SET);
|
||||
|
||||
@@ -291,7 +297,7 @@ int Image::drawObject(File& _input, BlockTable *_blockTable, int id)
|
||||
_rgbTable[j].blue = _input.readByte(); // blue
|
||||
}
|
||||
|
||||
SMAPindex = _resource->findBlock(1, _blockTable, _input, id, "SMAP", "-1");
|
||||
SMAPindex = _resource->findBlock(1, _blockTable, id, "SMAP", "-1");
|
||||
|
||||
_offsets = new uint32[_width/8];
|
||||
|
||||
|
||||
+3
-86
@@ -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.13 2003/09/22 15:23:56 yoshizf Exp $
|
||||
* $Header: /Users/sev/projects/sc/s/scummvm/scummex/resource.cpp,v 1.14 2003/09/22 19:47:58 yoshizf Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -27,90 +27,6 @@
|
||||
|
||||
int v8 = 0;
|
||||
|
||||
/*void parseV5Index(BlockTable *_blockTable, RoomTable *_roomTable, File& _input, int fileType) {
|
||||
int i = 0, index = 0, rooms = 0;
|
||||
|
||||
// MAXS block
|
||||
if (rooms < 1)
|
||||
fileType = 2;
|
||||
|
||||
if (fileType == 1) {
|
||||
_input.read(_blockTable[index].blockName, 4);
|
||||
_blockTable[index].blockName[4] = '\0';
|
||||
strcpy(_blockTable[index].blockType, _blockTable[index].blockName);
|
||||
_blockTable[index].blockTypeID = getBlockType(_blockTable[index].blockName);
|
||||
strcpy(_blockTable[index].blockDescription, blocksInfo[_blockTable[index].blockTypeID].description);
|
||||
|
||||
_blockTable[index].blockSize = _input.readUint32BE();
|
||||
_blockTable[index].offset = _input.pos() - 8;
|
||||
_blockTable[index].variables = _input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_blockTable[index].bitVariables = _input.readUint16LE();
|
||||
_blockTable[index].localObjects = _input.readUint16LE();
|
||||
_blockTable[index].arrays = _input.readUint16LE();
|
||||
_blockTable[index].characters = _input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_blockTable[index].invObjects = _input.readUint16LE();
|
||||
index++;
|
||||
}
|
||||
|
||||
if (fileType == 2) {
|
||||
_input.read(_blockTable[index].blockName, 4);
|
||||
_blockTable[index].blockName[4] = '\0';
|
||||
strcpy(_blockTable[index].blockType, _blockTable[index].blockName);
|
||||
_blockTable[index].blockTypeID = getBlockType(_blockTable[index].blockName);
|
||||
strcpy(_blockTable[index].blockDescription, blocksInfo[_blockTable[index].blockTypeID].description);
|
||||
_blockTable[index].blockSize = _input.readUint32BE();
|
||||
_blockTable[index].offset = _input.pos() - 8;
|
||||
_blockTable[index].variables = _input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_blockTable[index].bitVariables = _input.readUint16LE();
|
||||
_blockTable[index].localObjects = _input.readUint16LE();
|
||||
_blockTable[index].arrays = _input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_blockTable[index].invObjects = _input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_blockTable[index].characters = _input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
index++;
|
||||
}
|
||||
|
||||
if (fileType == 3) {
|
||||
_input.read(_blockTable[index].blockName, 4);
|
||||
_blockTable[index].blockName[4] = '\0';
|
||||
strcpy(_blockTable[index].blockType, _blockTable[index].blockName);
|
||||
_blockTable[index].blockTypeID = getBlockType(_blockTable[index].blockName);
|
||||
strcpy(_blockTable[index].blockDescription, blocksInfo[_blockTable[index].blockTypeID].description);
|
||||
_blockTable[index].blockSize = _input.readUint32BE();
|
||||
_blockTable[index].offset = _input.pos() - 8;
|
||||
_input.seek(50 + 50, SEEK_CUR);
|
||||
_blockTable[index].variables = _input.readUint16LE();
|
||||
_blockTable[index].bitVariables = _input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_blockTable[index].localObjects = _input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_blockTable[index].invObjects = _input.readUint16LE();
|
||||
_blockTable[index].arrays = _input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
_blockTable[index].characters = _input.readUint16LE();
|
||||
_input.readUint16LE();
|
||||
index++;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
Resource::Resource() {
|
||||
stopflag = 0;
|
||||
}
|
||||
@@ -654,6 +570,7 @@ int Resource::parseBlocks(char *blockName, BlockTable *_blockTable, File& _input
|
||||
case WRAP:
|
||||
case OBIM:
|
||||
case SOUN:
|
||||
case ZPLN:
|
||||
_blockTable[index].blockSize = _input.readUint32BE();
|
||||
_gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
|
||||
bufindex = index;
|
||||
@@ -951,7 +868,7 @@ int Resource::getOldBlockType(char *tag) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Resource::findBlock(int direction, BlockTable * _blockTable, File& _input, int id, ...)
|
||||
int Resource::findBlock(int direction, BlockTable * _blockTable, int id, ...)
|
||||
{
|
||||
va_list arg_ptr;
|
||||
char *test;
|
||||
|
||||
+4
-4
@@ -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.6 2003/09/21 23:50:28 yoshizf Exp $
|
||||
* $Header: /Users/sev/projects/sc/s/scummvm/scummex/resource.h,v 1.7 2003/09/22 19:47:58 yoshizf Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -148,10 +148,10 @@ const struct blockInfo blocksInfo[] = {
|
||||
{83, "BOMP", ""},
|
||||
{84, "IMAG", "", 0, "", 25},
|
||||
{85, "AKOS", ""},
|
||||
{86, "ZP04", ""},
|
||||
{86, "ZP04", "", 0, "", 52},
|
||||
{87, "RMSC", "", 1, "help/specRMSC.html", 57},
|
||||
{88, "BSTR", "", 0, "", 42},
|
||||
{89, "ZPLN", ""},
|
||||
{89, "ZPLN", "", 0, "", 52},
|
||||
{90, "AKHD", ""},
|
||||
{91, "AKPL", ""},
|
||||
{92, "RGBS", ""},
|
||||
@@ -220,7 +220,7 @@ public:
|
||||
int searchOldBlocks(BlockTable *_blockTable, File& _input, int index = 0, int level = 1, int size = 0);
|
||||
int parseBlocks(char *blockName, BlockTable *_blockTable, File& _input, int index, int level);
|
||||
int parseOldBlocks(char *blockName, BlockTable *_blockTable, File& _input, int index, int level);
|
||||
int findBlock(int direction, BlockTable * _blockTable, File& _input, int id, ...);
|
||||
int findBlock(int direction, BlockTable * _blockTable, int id, ...);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -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.16 2003/09/22 18:25:16 yoshizf Exp $
|
||||
* $Header: /Users/sev/projects/sc/s/scummvm/scummex/scummex.cpp,v 1.17 2003/09/22 19:47:58 yoshizf Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -368,6 +368,7 @@ void ScummEX::UpdateInfosFromTree(int blockid) {
|
||||
|
||||
case RMIM:
|
||||
case BM:
|
||||
case IMAG:
|
||||
_gui->SetButton(_blockTable[blockid].blockTypeID);
|
||||
break;
|
||||
|
||||
|
||||
+4
-1
@@ -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.13 2003/09/22 18:25:16 yoshizf Exp $
|
||||
* $Header: /Users/sev/projects/sc/s/scummvm/scummex/wxwindows.cpp,v 1.14 2003/09/22 19:47:59 yoshizf Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -379,6 +379,7 @@ void GUI_wxWindows::SetButton(int blocktype) {
|
||||
|
||||
case BM:
|
||||
case RMIM:
|
||||
case IMAG:
|
||||
SpecButton1->SetLabel("View Image");
|
||||
SpecButton1->Show(TRUE);
|
||||
SpecButton1->Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
|
||||
@@ -1112,6 +1113,8 @@ void MainWindow::OnSelChanged(wxTreeEvent& event) {
|
||||
case ZP01:
|
||||
case ZP02:
|
||||
case ZP03:
|
||||
case ZP04:
|
||||
case ZPLN:
|
||||
bigIconBitmap = wxBitmap(xpm_52_big);
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user