[Scummvm-cvs-logs] CVS: scummex blocks.h,1.4,1.5 resource.cpp,1.9,1.10 resource.h,1.3,1.4 scummex.cpp,1.9,1.10 wxwindows.cpp,1.6,1.7
Adrien Mercier
yoshizf at users.sourceforge.net
Sun Sep 21 08:05:19 CEST 2003
Update of /cvsroot/scummvm/scummex
In directory sc8-pr-cvs1:/tmp/cvs-serv14385
Modified Files:
blocks.h resource.cpp resource.h scummex.cpp wxwindows.cpp
Log Message:
Improved v3 support
Index: blocks.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/blocks.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- blocks.h 21 Sep 2003 06:47:15 -0000 1.4
+++ blocks.h 21 Sep 2003 15:04:14 -0000 1.5
@@ -135,3 +135,35 @@
SPK,
ROL
};
+
+enum {
+ b0R = 200,
+ b0S,
+ b0N,
+ b0C,
+ b0O,
+ RO,
+ HD,
+ BX,
+ PA,
+ BM,
+ OI,
+ OC,
+ NL,
+ SL,
+ EX,
+ EN,
+ LC,
+ LS,
+ SC,
+ CO,
+ LE,
+ FO,
+ LF,
+ CC,
+ SP,
+ SA,
+ SO,
+ RN
+};
+
Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/resource.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- resource.cpp 21 Sep 2003 06:47:15 -0000 1.9
+++ resource.cpp 21 Sep 2003 15:04:14 -0000 1.10
@@ -142,9 +142,8 @@
_input.seek(size, SEEK_SET);
return index;
}
-
-
}
+
curpos = _input.pos();
}
@@ -830,16 +829,16 @@
int Resource::parseOldBlocks(char *blockName, BlockTable *_blockTable, File& _input, int index, int level) {
- int numFiles, offset, number;
+ int numFiles, offset, number, bufindex;
- strcpy(_blockTable[index].blockDescription, oldBlocksInfo[_blockTable[index].blockTypeID].description);
+ strcpy(_blockTable[index].blockDescription, oldBlocksInfo[_blockTable[index].blockTypeID - 200].description);
switch(_blockTable[index].blockTypeID) {
- case 200: // 0R
- case 201: // OS
- case 202: // ON
- case 203: // OC
+ case b0R:
+ case b0S:
+ case b0N:
+ case b0C:
numFiles = _input.readUint16LE();
_blockTable[index].numFiles = numFiles;
@@ -852,19 +851,19 @@
index++;
break;
- case 204: // 00
+ case b0O:
numFiles = _input.readUint16LE();
_blockTable[index].numFiles = numFiles;
for (int i=0; i<numFiles; i++) {
_input.readByte(); // Owner of object
}
-
+ _input.seek(_blockTable[index].blockSize + _blockTable[index].offset, SEEK_SET);
_gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
index++;
break;
- case 205: // RO
+ case RO:
_gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
index++;
level++;
@@ -873,7 +872,7 @@
break;
- case 206: // HD
+ case HD:
_blockTable[index].width = _input.readUint16LE();
_blockTable[index].height = _input.readUint16LE();
_blockTable[index].localObjects = _input.readUint16LE();
@@ -881,11 +880,26 @@
index++;
break;
- case 207: // BX
- case 208:
- case 209:
- case 210:
- case 212:
+ case LE:
+ _gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
+ bufindex = index;
+ index++;
+ level++;
+ index = searchOldBlocks(_blockTable, _input, index, level, _blockTable[index-1].blockSize + _blockTable[index-1].offset);
+ _input.seek(_blockTable[bufindex].offset + _blockTable[bufindex].blockSize, SEEK_SET);
+ break;
+
+ case LF:
+ _gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
+ _input.seek(2, SEEK_CUR);
+ bufindex = index;
+ index++;
+ level++;
+ index = searchOldBlocks(_blockTable, _input, index, level, _blockTable[index-1].blockSize + _blockTable[index-1].offset);
+ _input.seek(_blockTable[bufindex].offset + _blockTable[bufindex].blockSize, SEEK_SET);
+ break;
+
+ default:
_gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
_input.seek(_blockTable[index].blockSize + _blockTable[index].offset, SEEK_SET);
index++;
@@ -912,12 +926,11 @@
int Resource::getOldBlockType(char *tag) {
- for (int i=0; i<12; i++) {
+ for (int i=0; i<28; i++) {
if(strstr(tag, oldBlocksInfo[i].name)) {
return oldBlocksInfo[i].id;
}
}
-
return -1;
}
Index: resource.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/resource.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- resource.h 18 Sep 2003 20:50:56 -0000 1.3
+++ resource.h 21 Sep 2003 15:04:14 -0000 1.4
@@ -178,18 +178,34 @@
};
const struct blockInfo oldBlocksInfo[] = {
- {200, "0R", "Directory of Rooms"},
- {201, "0S", ""},
- {202, "0N", ""},
- {203, "0C", ""},
- {204, "0O", "Directory of Objects"},
- {205, "RO", ""},
- {206, "HD", ""},
- {207, "BX", ""},
- {208, "PA", ""},
- {209, "BM", ""},
- {210, "OI", ""},
- {211, "OC", ""}
+ {200, "0R", "Directory of Rooms", 0, "", 18},
+ {201, "0S", "", 0, "", 19},
+ {202, "0N", "", 0, "", 47},
+ {203, "0C", "", 0, "", 14},
+ {204, "0O", "Directory of Objects", 0, "", 17},
+ {205, "RO", "", 0, "", 38},
+ {206, "HD", "", 0, "", 35},
+ {207, "BX", "", 0, "", 4},
+ {208, "PA", "", 0, "", 34},
+ {209, "BM", "", 0, "", 37},
+ {210, "OI", "", 0, "", 33},
+ {211, "OC", "", 0, "", 41},
+ {212, "NL", "", 0, "", 41},
+ {213, "SL", "", 0, "", 47},
+ {214, "EX", "", 0, "", 22},
+ {215, "EN", "", 0, "", 21},
+ {216, "LC", "", 0, "", 47},
+ {217, "LS", "", 0, "", 41},
+ {218, "SC", "", 0, "", 41},
+ {219, "CO", "", 0, "", 11},
+ {220, "LE", "LucasArts Entertainment Company Files", 0, "", 6},
+ {221, "FO", "", 0, "", 44},
+ {222, "LF", "", 0, "", 58},
+ {223, "CC", "", 0, "", 12},
+ {224, "SP", "", 0, "", 47},
+ {225, "SA", "", 0, "", 40},
+ {226, "SO", "", 0, "", 59},
+ {227, "RN", "", 0, "", 47}
};
class Resource {
Index: scummex.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/scummex.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- scummex.cpp 21 Sep 2003 00:45:16 -0000 1.9
+++ scummex.cpp 21 Sep 2003 15:04:14 -0000 1.10
@@ -68,12 +68,14 @@
return;
}
-
- tag = _input.readUint16LE();
+
+ tag = 0;
+ _input.read(&tag, 2);
switch(tag) {
case 21040: // OR
case 20306: // RO
+ case 20050: // RN
_input.seek(0, SEEK_SET);
_resource->searchOldBlocks(_blockTable, _input);
return;
@@ -81,11 +83,8 @@
}
_input.close();
-
_encbyte = 0x69;
-
_input.open(filename, 1, _encbyte);
-
_input.read(&tag, 4);
switch (tag) {
@@ -98,13 +97,22 @@
_input.seek(0, SEEK_SET);
_resource->searchBlocks(_blockTable, _input);
return;
+ }
- default:
- _gui->SetTitle("ScummEX");
- _gui->DisableToolbarTool(ID_Close);
- _gui->DisableToolbarTool(ID_FileInfo);
- _gui->DisplayDialog("Unknown file type!", "Error");
+ tag = 0;
+ _input.read(&tag, 2);
+
+ switch(tag) {
+ case 17740: // LE
+ _input.seek(0, SEEK_SET);
+ _resource->searchOldBlocks(_blockTable, _input);
+ return;
}
+
+ _gui->SetTitle("ScummEX");
+ _gui->DisableToolbarTool(ID_Close);
+ _gui->DisableToolbarTool(ID_FileInfo);
+ _gui->DisplayDialog("Unknown file type!", "Error");
}
void ScummEX::Descumm() {
@@ -362,6 +370,11 @@
case ENCD:
case EXCD:
case VERB:
+ case LS:
+ case SC:
+ case EN:
+ case EX:
+ case OC:
_gui->SetButton(_blockTable[blockid].blockTypeID);
break;
Index: wxwindows.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/wxwindows.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- wxwindows.cpp 21 Sep 2003 06:47:15 -0000 1.6
+++ wxwindows.cpp 21 Sep 2003 15:04:14 -0000 1.7
@@ -373,6 +373,11 @@
case ENCD:
case EXCD:
case VERB:
+ case LS:
+ case SC:
+ case EN:
+ case EX:
+ case OC:
SpecButton1->SetLabel("Decompile Script");
SpecButton1->Show(TRUE);
SpecButton1->Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
@@ -388,12 +393,12 @@
assert(level <= 10);
itemid = iter[level] = tree->AppendItem(iter[level-1], itemName, -1, -1, new TreeItemData(blockid, type));
- if (blocksInfo[type].iconid != 0) {
- tree->SetItemImage(itemid, blocksInfo[type].iconid);
- tree->SetItemImage(itemid, blocksInfo[type].iconid, wxTreeItemIcon_Selected);
+ if (type < 200) {
+ tree->SetItemImage(itemid, blocksInfo[type].iconid);
+ tree->SetItemImage(itemid, blocksInfo[type].iconid, wxTreeItemIcon_Selected);
} else {
- tree->SetItemImage(itemid, 47);
- tree->SetItemImage(itemid, 47, wxTreeItemIcon_Selected);
+ tree->SetItemImage(itemid, oldBlocksInfo[type-200].iconid);
+ tree->SetItemImage(itemid, oldBlocksInfo[type-200].iconid, wxTreeItemIcon_Selected);
}
if (blockid == 1) {
@@ -865,27 +870,33 @@
case LECF:
case LABN:
case LB83:
+ case LE:
bigIconBitmap = wxBitmap(xpm_6_big);
break;
case LOFF:
case OFFS:
+ case FO:
bigIconBitmap = wxBitmap(xpm_44_big);
break;
case LFLF:
+ case LF:
bigIconBitmap = wxBitmap(xpm_58_big);
break;
case ROOM:
+ case RO:
bigIconBitmap = wxBitmap(xpm_38_big);
break;
case RMHD:
+ case HD:
bigIconBitmap = wxBitmap(xpm_35_big);
break;
case CYCL:
+ case CC:
bigIconBitmap = wxBitmap(xpm_12_big);
break;
@@ -898,10 +909,12 @@
case APAL:
case NPAL:
case XPAL:
+ case PA:
bigIconBitmap = wxBitmap(xpm_34_big);
break;
case BOXD:
+ case BX:
bigIconBitmap = wxBitmap(xpm_4_big);
break;
@@ -910,24 +923,32 @@
break;
case SCAL:
+ case SA:
bigIconBitmap = wxBitmap(xpm_40_big);
break;
case RMIM:
+ case BM:
bigIconBitmap = wxBitmap(xpm_37_big);
break;
case EXCD:
+ case EX:
bigIconBitmap = wxBitmap(xpm_22_big);
break;
case ENCD:
+ case EN:
bigIconBitmap = wxBitmap(xpm_21_big);
break;
case NLSC:
case SCRP:
case LSCR:
+ case OC:
+ case NL:
+ case LS:
+ case SC:
bigIconBitmap = wxBitmap(xpm_41_big);
break;
@@ -936,6 +957,7 @@
case iMUS:
case cus2:
case IMC:
+ case SO:
bigIconBitmap = wxBitmap(xpm_59_big);
break;
@@ -963,6 +985,7 @@
break;
case OBIM:
+ case OI:
bigIconBitmap = wxBitmap(xpm_33_big);
break;
@@ -1063,6 +1086,7 @@
break;
case COST:
+ case CO:
bigIconBitmap = wxBitmap(xpm_11_big);
break;
More information about the Scummvm-git-logs
mailing list