Fix data compression, byte order handling, and tag parsing in COD Wii zonefile
This commit is contained in:
parent
95349eaa5b
commit
3e311e5aec
@ -159,7 +159,7 @@ QStringList ZoneFile_COD10_360::pParseZoneTags(QDataStream *aZoneFileStream, qui
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD11_360::pParseZoneTags(QDataStream *aZoneFileStream, qui
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -161,7 +161,7 @@ QStringList ZoneFile_COD12_360::pParseZoneTags(QDataStream *aZoneFileStream, qui
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -21,6 +21,10 @@ bool ZoneFile_COD2_360::Load(const QByteArray aFileData) {
|
|||||||
|
|
||||||
// Parse data from zone file header
|
// Parse data from zone file header
|
||||||
pParseZoneHeader(&zoneFileStream);
|
pParseZoneHeader(&zoneFileStream);
|
||||||
|
|
||||||
|
zoneFileStream.skipRawData(4 * GetMiscCount());
|
||||||
|
pParseMiscTags(&zoneFileStream);
|
||||||
|
|
||||||
SetRecords(pParseZoneIndex(&zoneFileStream, GetRecordCount()));
|
SetRecords(pParseZoneIndex(&zoneFileStream, GetRecordCount()));
|
||||||
SetAssetMap(pParseAssets(&zoneFileStream, GetRecords()));
|
SetAssetMap(pParseAssets(&zoneFileStream, GetRecords()));
|
||||||
|
|
||||||
@ -29,8 +33,13 @@ bool ZoneFile_COD2_360::Load(const QByteArray aFileData) {
|
|||||||
|
|
||||||
void ZoneFile_COD2_360::pParseZoneHeader(QDataStream *aZoneFileStream) {
|
void ZoneFile_COD2_360::pParseZoneHeader(QDataStream *aZoneFileStream) {
|
||||||
SetTagCount(pParseZoneTagCount(aZoneFileStream));
|
SetTagCount(pParseZoneTagCount(aZoneFileStream));
|
||||||
pParseZoneUnknownsB(aZoneFileStream);
|
|
||||||
pParseZoneUnknownsC(aZoneFileStream);
|
aZoneFileStream->skipRawData(4);
|
||||||
|
|
||||||
|
SetMiscCount(pParseZoneTagCount(aZoneFileStream));
|
||||||
|
|
||||||
|
aZoneFileStream->skipRawData(4);
|
||||||
|
|
||||||
SetRecordCount(pParseZoneRecordCount(aZoneFileStream));
|
SetRecordCount(pParseZoneRecordCount(aZoneFileStream));
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(4);
|
aZoneFileStream->skipRawData(4);
|
||||||
@ -157,7 +166,25 @@ QStringList ZoneFile_COD2_360::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
|
zoneTag.clear();
|
||||||
|
}
|
||||||
|
return tags;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList ZoneFile_COD2_360::pParseMiscTags(QDataStream *aZoneFileStream) {
|
||||||
|
QStringList tags;
|
||||||
|
|
||||||
|
// Parse tags/strings before index
|
||||||
|
QString zoneTag;
|
||||||
|
char zoneTagChar;
|
||||||
|
while (aZoneFileStream->device()->peek(8).right(4).toHex() != "ffffffff") {
|
||||||
|
*aZoneFileStream >> zoneTagChar;
|
||||||
|
while (zoneTagChar != 0) {
|
||||||
|
zoneTag += zoneTagChar;
|
||||||
|
*aZoneFileStream >> zoneTagChar;
|
||||||
|
}
|
||||||
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
@ -285,8 +312,8 @@ LocalString ZoneFile_COD2_360::pParseAsset_LocalString(QDataStream *aZoneFileStr
|
|||||||
RawFile ZoneFile_COD2_360::pParseAsset_RawFile(QDataStream *aZoneFileStream) {
|
RawFile ZoneFile_COD2_360::pParseAsset_RawFile(QDataStream *aZoneFileStream) {
|
||||||
RawFile result;
|
RawFile result;
|
||||||
|
|
||||||
// Skip start separator FF FF FF FF (pointer?)
|
qint32 rawFilePtr;
|
||||||
aZoneFileStream->skipRawData(4);
|
*aZoneFileStream >> rawFilePtr;
|
||||||
|
|
||||||
*aZoneFileStream >> result.length;
|
*aZoneFileStream >> result.length;
|
||||||
|
|
||||||
@ -294,13 +321,19 @@ RawFile ZoneFile_COD2_360::pParseAsset_RawFile(QDataStream *aZoneFileStream) {
|
|||||||
aZoneFileStream->skipRawData(4);
|
aZoneFileStream->skipRawData(4);
|
||||||
|
|
||||||
// Parse rawfile path
|
// Parse rawfile path
|
||||||
char scriptPathChar;
|
const QStringList tags = GetTags();
|
||||||
*aZoneFileStream >> scriptPathChar;
|
if (rawFilePtr == -1) {
|
||||||
while (scriptPathChar != 0) {
|
char scriptPathChar;
|
||||||
result.path += scriptPathChar;
|
|
||||||
*aZoneFileStream >> scriptPathChar;
|
*aZoneFileStream >> scriptPathChar;
|
||||||
|
while (scriptPathChar != 0) {
|
||||||
|
result.path += scriptPathChar;
|
||||||
|
*aZoneFileStream >> scriptPathChar;
|
||||||
|
}
|
||||||
|
result.path.replace(",", "");
|
||||||
|
} else if (rawFilePtr > 0 && rawFilePtr < tags.size() + 2) {
|
||||||
|
result.path = tags[rawFilePtr - 1];
|
||||||
}
|
}
|
||||||
result.path.replace(",", "");
|
|
||||||
const QStringList pathParts = result.path.split('/');
|
const QStringList pathParts = result.path.split('/');
|
||||||
if (pathParts.size() == 0) {
|
if (pathParts.size() == 0) {
|
||||||
qDebug() << "Failed to parse ff path! " << result.path;
|
qDebug() << "Failed to parse ff path! " << result.path;
|
||||||
@ -308,11 +341,15 @@ RawFile ZoneFile_COD2_360::pParseAsset_RawFile(QDataStream *aZoneFileStream) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Parse gsc contents
|
// Parse gsc contents
|
||||||
char rawFileContentsChar;
|
if (result.length) {
|
||||||
*aZoneFileStream >> rawFileContentsChar;
|
char rawFileContentsChar;
|
||||||
while (rawFileContentsChar != 0 && rawFileContentsChar != -1) {
|
|
||||||
result.contents += rawFileContentsChar;
|
|
||||||
*aZoneFileStream >> rawFileContentsChar;
|
*aZoneFileStream >> rawFileContentsChar;
|
||||||
|
while (rawFileContentsChar != 0 && rawFileContentsChar != -1) {
|
||||||
|
result.contents += rawFileContentsChar;
|
||||||
|
*aZoneFileStream >> rawFileContentsChar;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
aZoneFileStream->skipRawData(1);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -325,10 +362,10 @@ Model ZoneFile_COD2_360::pParseAsset_Model(QDataStream *aZoneFileStream) {
|
|||||||
Model result;
|
Model result;
|
||||||
|
|
||||||
*aZoneFileStream >> result.namePtr >> result.tagCount >> result.rootTagCount
|
*aZoneFileStream >> result.namePtr >> result.tagCount >> result.rootTagCount
|
||||||
>> result.surfCount >> result.unknownCount >> result.boneNamePtr
|
>> result.surfCount >> result.unknownCount >> result.boneNamePtr
|
||||||
>> result.parentListPtr >> result.quatsPtr >> result.transPtr
|
>> result.parentListPtr >> result.quatsPtr >> result.transPtr
|
||||||
>> result.partClassPtr >> result.baseMatPtr
|
>> result.partClassPtr >> result.baseMatPtr
|
||||||
>> result.surfsPtr >> result.materialHandlesPtr;
|
>> result.surfsPtr >> result.materialHandlesPtr;
|
||||||
|
|
||||||
// Parse XModelLodInfo
|
// Parse XModelLodInfo
|
||||||
for (int i = 1; i <= 4; i++) {
|
for (int i = 1; i <= 4; i++) {
|
||||||
@ -341,16 +378,16 @@ Model ZoneFile_COD2_360::pParseAsset_Model(QDataStream *aZoneFileStream) {
|
|||||||
aZoneFileStream->skipRawData(4);
|
aZoneFileStream->skipRawData(4);
|
||||||
|
|
||||||
*aZoneFileStream >> result.lodInfo[i].partBits[0]
|
*aZoneFileStream >> result.lodInfo[i].partBits[0]
|
||||||
>> result.lodInfo[i].partBits[1]
|
>> result.lodInfo[i].partBits[1]
|
||||||
>> result.lodInfo[i].partBits[2]
|
>> result.lodInfo[i].partBits[2]
|
||||||
>> result.lodInfo[i].partBits[3];
|
>> result.lodInfo[i].partBits[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
*aZoneFileStream >> result.collSurfsPtr >> result.numCollSurfs >> result.contents >> result.boneInfoPtr;
|
*aZoneFileStream >> result.collSurfsPtr >> result.numCollSurfs >> result.contents >> result.boneInfoPtr;
|
||||||
|
|
||||||
quint32 intRadius, intMins[3], intMaxs[3];
|
quint32 intRadius, intMins[3], intMaxs[3];
|
||||||
*aZoneFileStream >> intRadius >> intMins[0] >> intMins[1]
|
*aZoneFileStream >> intRadius >> intMins[0] >> intMins[1]
|
||||||
>> intMins[2] >> intMaxs[0] >> intMaxs[1] >> intMaxs[2];
|
>> intMins[2] >> intMaxs[0] >> intMaxs[1] >> intMaxs[2];
|
||||||
|
|
||||||
std::memcpy(&result.radius, &intRadius, sizeof(result.radius));
|
std::memcpy(&result.radius, &intRadius, sizeof(result.radius));
|
||||||
|
|
||||||
@ -363,7 +400,7 @@ Model ZoneFile_COD2_360::pParseAsset_Model(QDataStream *aZoneFileStream) {
|
|||||||
std::memcpy(&result.maxs[2], &intMaxs[2], sizeof(result.maxs[3]));
|
std::memcpy(&result.maxs[2], &intMaxs[2], sizeof(result.maxs[3]));
|
||||||
|
|
||||||
*aZoneFileStream >> result.numLods >> result.collLod >> result.streamInfoPtr
|
*aZoneFileStream >> result.numLods >> result.collLod >> result.streamInfoPtr
|
||||||
>> result.memUsage >> result.flags >> result.physPresetPtr >> result.physGeomsPtr;
|
>> result.memUsage >> result.flags >> result.physPresetPtr >> result.physGeomsPtr;
|
||||||
|
|
||||||
// Parse model name
|
// Parse model name
|
||||||
char modelNameChar;
|
char modelNameChar;
|
||||||
@ -448,10 +485,13 @@ Image ZoneFile_COD2_360::pParseAsset_Image(QDataStream *aZoneFileStream) {
|
|||||||
Image result;
|
Image result;
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(4);
|
aZoneFileStream->skipRawData(4);
|
||||||
*aZoneFileStream >> result.unknowna >> result.unknownb
|
*aZoneFileStream >> result.unknowna
|
||||||
>> result.unknownc >> result.unknownd
|
>> result.unknownb
|
||||||
>> result.unknowne >> result.unknownf
|
>> result.unknownc
|
||||||
>> result.unknowng;
|
>> result.unknownd
|
||||||
|
>> result.unknowne
|
||||||
|
>> result.unknownf
|
||||||
|
>> result.unknowng;
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(15 * 4);
|
aZoneFileStream->skipRawData(15 * 4);
|
||||||
*aZoneFileStream >> result.unknownh >> result.unknowni;
|
*aZoneFileStream >> result.unknownh >> result.unknowni;
|
||||||
@ -481,8 +521,8 @@ Image ZoneFile_COD2_360::pParseAsset_Image(QDataStream *aZoneFileStream) {
|
|||||||
aZoneFileStream->skipRawData(4);
|
aZoneFileStream->skipRawData(4);
|
||||||
|
|
||||||
*aZoneFileStream >> result.unknown2 >> result.unknown3
|
*aZoneFileStream >> result.unknown2 >> result.unknown3
|
||||||
>> result.size1 >> result.size2
|
>> result.size1 >> result.size2
|
||||||
>> result.unknown4 >> result.unknown5;
|
>> result.unknown4 >> result.unknown5;
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(4);
|
aZoneFileStream->skipRawData(4);
|
||||||
|
|
||||||
@ -688,43 +728,43 @@ Animation ZoneFile_COD2_360::pParseAsset_Animation(QDataStream *aZoneFileStream)
|
|||||||
aZoneFileStream->skipRawData(4);
|
aZoneFileStream->skipRawData(4);
|
||||||
|
|
||||||
*aZoneFileStream
|
*aZoneFileStream
|
||||||
>> result.dataByteCount
|
>> result.dataByteCount
|
||||||
>> result.dataShortCount
|
>> result.dataShortCount
|
||||||
>> result.dataIntCount
|
>> result.dataIntCount
|
||||||
>> result.randomDataByteCount
|
>> result.randomDataByteCount
|
||||||
>> result.randomDataIntCount
|
>> result.randomDataIntCount
|
||||||
>> result.numframes
|
>> result.numframes
|
||||||
>> result.isLooped
|
>> result.isLooped
|
||||||
>> result.isDelta
|
>> result.isDelta
|
||||||
>> result.noneRotatedBoneCount
|
>> result.noneRotatedBoneCount
|
||||||
>> result.twoDRotatedBoneCount
|
>> result.twoDRotatedBoneCount
|
||||||
>> result.normalRotatedBoneCount
|
>> result.normalRotatedBoneCount
|
||||||
>> result.twoDRotatedBoneCount
|
>> result.twoDRotatedBoneCount
|
||||||
>> result.normalRotatedBoneCount
|
>> result.normalRotatedBoneCount
|
||||||
>> result.normalTranslatedBoneCount
|
>> result.normalTranslatedBoneCount
|
||||||
>> result.preciseTranslatedBoneCount
|
>> result.preciseTranslatedBoneCount
|
||||||
>> result.staticTranslatedBoneCount
|
>> result.staticTranslatedBoneCount
|
||||||
>> result.noneTranslatedBoneCount
|
>> result.noneTranslatedBoneCount
|
||||||
>> result.totalBoneCount
|
>> result.totalBoneCount
|
||||||
>> result.otherBoneCount1
|
>> result.otherBoneCount1
|
||||||
>> result.otherBoneCount2
|
>> result.otherBoneCount2
|
||||||
>> result.notifyCount
|
>> result.notifyCount
|
||||||
>> result.assetType
|
>> result.assetType
|
||||||
>> result.pad
|
>> result.pad
|
||||||
>> result.randomDataShortCount
|
>> result.randomDataShortCount
|
||||||
>> result.indexCount
|
>> result.indexCount
|
||||||
>> result.frameRate
|
>> result.frameRate
|
||||||
>> result.frequency
|
>> result.frequency
|
||||||
>> result.boneIDsPtr
|
>> result.boneIDsPtr
|
||||||
>> result.dataBytePtr
|
>> result.dataBytePtr
|
||||||
>> result.dataShortPtr
|
>> result.dataShortPtr
|
||||||
>> result.dataIntPtr
|
>> result.dataIntPtr
|
||||||
>> result.randomDataShortPtr
|
>> result.randomDataShortPtr
|
||||||
>> result.randomDataBytePtr
|
>> result.randomDataBytePtr
|
||||||
>> result.randomDataIntPtr
|
>> result.randomDataIntPtr
|
||||||
>> result.longIndiciesPtr
|
>> result.longIndiciesPtr
|
||||||
>> result.notificationsPtr
|
>> result.notificationsPtr
|
||||||
>> result.deltaPartsPtr;
|
>> result.deltaPartsPtr;
|
||||||
|
|
||||||
// Read in x_anim file name
|
// Read in x_anim file name
|
||||||
QString xAnimName;
|
QString xAnimName;
|
||||||
@ -795,21 +835,21 @@ MenuFile ZoneFile_COD2_360::pParseAsset_MenuFile(QDataStream *aZoneFileStream) {
|
|||||||
|
|
||||||
quint32 hClientAlignInt, vClientAlignInt, styleInt, borderInt;
|
quint32 hClientAlignInt, vClientAlignInt, styleInt, borderInt;
|
||||||
*aZoneFileStream >> hClientAlignInt >> vClientAlignInt >> menu.groupPtr
|
*aZoneFileStream >> hClientAlignInt >> vClientAlignInt >> menu.groupPtr
|
||||||
>> styleInt >> borderInt >> menu.ownerDraw >> menu.ownerDrawFlags
|
>> styleInt >> borderInt >> menu.ownerDraw >> menu.ownerDrawFlags
|
||||||
>> menu.borderSize >> menu.staticFlags >> menu.dynamicFlags >> menu.nextTime;
|
>> menu.borderSize >> menu.staticFlags >> menu.dynamicFlags >> menu.nextTime;
|
||||||
menu.hClientAlign = (MENU_H_ALIGNMENT)hClientAlignInt;
|
menu.hClientAlign = (MENU_H_ALIGNMENT)hClientAlignInt;
|
||||||
menu.vClientAlign = (MENU_V_ALIGNMENT)vClientAlignInt;
|
menu.vClientAlign = (MENU_V_ALIGNMENT)vClientAlignInt;
|
||||||
menu.style = (MENU_WINDOW_STYLE)styleInt;
|
menu.style = (MENU_WINDOW_STYLE)styleInt;
|
||||||
menu.border = (MENU_WINDOW_BORDER)borderInt;
|
menu.border = (MENU_WINDOW_BORDER)borderInt;
|
||||||
|
|
||||||
float foregroundColorR, foregroundColorG, foregroundColorB, foregroundColorA,
|
float foregroundColorR, foregroundColorG, foregroundColorB, foregroundColorA,
|
||||||
backgroundColorR, backgroundColorG, backgroundColorB, backgroundColorA,
|
backgroundColorR, backgroundColorG, backgroundColorB, backgroundColorA,
|
||||||
borderColorR, borderColorG, borderColorB, borderColorA,
|
borderColorR, borderColorG, borderColorB, borderColorA,
|
||||||
outlineColorR, outlineColorG, outlineColorB, outlineColorA;
|
outlineColorR, outlineColorG, outlineColorB, outlineColorA;
|
||||||
*aZoneFileStream >> foregroundColorR >> foregroundColorG >> foregroundColorB >> foregroundColorA
|
*aZoneFileStream >> foregroundColorR >> foregroundColorG >> foregroundColorB >> foregroundColorA
|
||||||
>> backgroundColorR >> backgroundColorG >> backgroundColorB >> backgroundColorA
|
>> backgroundColorR >> backgroundColorG >> backgroundColorB >> backgroundColorA
|
||||||
>> borderColorR >> borderColorG >> borderColorB >> borderColorA
|
>> borderColorR >> borderColorG >> borderColorB >> borderColorA
|
||||||
>> outlineColorR >> outlineColorG >> outlineColorB >> outlineColorA;
|
>> outlineColorR >> outlineColorG >> outlineColorB >> outlineColorA;
|
||||||
|
|
||||||
menu.foregroundColor = QColor(foregroundColorR, foregroundColorG, foregroundColorB, foregroundColorA);
|
menu.foregroundColor = QColor(foregroundColorR, foregroundColorG, foregroundColorB, foregroundColorA);
|
||||||
menu.backgroundColor = QColor(backgroundColorR, backgroundColorG, backgroundColorB, backgroundColorA);
|
menu.backgroundColor = QColor(backgroundColorR, backgroundColorG, backgroundColorB, backgroundColorA);
|
||||||
@ -817,16 +857,16 @@ MenuFile ZoneFile_COD2_360::pParseAsset_MenuFile(QDataStream *aZoneFileStream) {
|
|||||||
menu.outlineColor = QColor(outlineColorR, outlineColorG, outlineColorB, outlineColorA);
|
menu.outlineColor = QColor(outlineColorR, outlineColorG, outlineColorB, outlineColorA);
|
||||||
|
|
||||||
*aZoneFileStream >> menu.materialPtr >> menu.fontPtr >> menu.fullScreen >> menu.itemCount
|
*aZoneFileStream >> menu.materialPtr >> menu.fontPtr >> menu.fullScreen >> menu.itemCount
|
||||||
>> menu.fontIndex >> menu.cursorItem >> menu.fadeCycle >> menu.fadeClamp
|
>> menu.fontIndex >> menu.cursorItem >> menu.fadeCycle >> menu.fadeClamp
|
||||||
>> menu.fadeAmount >> menu.fadeInAmount >> menu.blurRadius >> menu.onOpenPtr
|
>> menu.fadeAmount >> menu.fadeInAmount >> menu.blurRadius >> menu.onOpenPtr
|
||||||
>> menu.onFocusPtr >> menu.onClosePtr >> menu.onESCPtr >> menu.onKeyPtr
|
>> menu.onFocusPtr >> menu.onClosePtr >> menu.onESCPtr >> menu.onKeyPtr
|
||||||
>> menu.visibleExpCount >> menu.expEntryPtr >> menu.allowedBindingPtr
|
>> menu.visibleExpCount >> menu.expEntryPtr >> menu.allowedBindingPtr
|
||||||
>> menu.soundNamePtr >> menu.imageTrack;
|
>> menu.soundNamePtr >> menu.imageTrack;
|
||||||
|
|
||||||
float focusColorR, focusColorG, focusColorB, focusColorA,
|
float focusColorR, focusColorG, focusColorB, focusColorA,
|
||||||
disabledColorR, disabledColorG, disabledColorB, disabledColorA;
|
disabledColorR, disabledColorG, disabledColorB, disabledColorA;
|
||||||
*aZoneFileStream >> focusColorR >> focusColorG >> focusColorB >> focusColorA
|
*aZoneFileStream >> focusColorR >> focusColorG >> focusColorB >> focusColorA
|
||||||
>> disabledColorR >> disabledColorG >> disabledColorB >> disabledColorA;
|
>> disabledColorR >> disabledColorG >> disabledColorB >> disabledColorA;
|
||||||
menu.focusColor = QColor(focusColorR, focusColorG, focusColorB, focusColorA);
|
menu.focusColor = QColor(focusColorR, focusColorG, focusColorB, focusColorA);
|
||||||
menu.disabledColor = QColor(disabledColorR, disabledColorG, disabledColorB, disabledColorA);
|
menu.disabledColor = QColor(disabledColorR, disabledColorG, disabledColorB, disabledColorA);
|
||||||
|
|
||||||
@ -860,18 +900,18 @@ MenuFile ZoneFile_COD2_360::pParseAsset_MenuFile(QDataStream *aZoneFileStream) {
|
|||||||
menu.itemRect = QRectF(itemRectX, itemRectY, itemRectWidth, itemRectHeight);
|
menu.itemRect = QRectF(itemRectX, itemRectY, itemRectWidth, itemRectHeight);
|
||||||
|
|
||||||
*aZoneFileStream >> menu.itemHAlignment >> menu.itemVAlignment >> menu.itemGroupPtr
|
*aZoneFileStream >> menu.itemHAlignment >> menu.itemVAlignment >> menu.itemGroupPtr
|
||||||
>> menu.itemWindowStyle >> menu.itemWindowBorder >> menu.itemOwnerDraw
|
>> menu.itemWindowStyle >> menu.itemWindowBorder >> menu.itemOwnerDraw
|
||||||
>> menu.itemOwnerDrawFlags >> menu.itemBorderSize >> menu.itemStaticFlags
|
>> menu.itemOwnerDrawFlags >> menu.itemBorderSize >> menu.itemStaticFlags
|
||||||
>> menu.itemDynamicFlags >> menu.itemNextTime;
|
>> menu.itemDynamicFlags >> menu.itemNextTime;
|
||||||
|
|
||||||
float itemForegroundColorR, itemForegroundColorG, itemForegroundColorB, itemForegroundColorA,
|
float itemForegroundColorR, itemForegroundColorG, itemForegroundColorB, itemForegroundColorA,
|
||||||
itemBackgroundColorR, itemBackgroundColorG, itemBackgroundColorB, itemBackgroundColorA,
|
itemBackgroundColorR, itemBackgroundColorG, itemBackgroundColorB, itemBackgroundColorA,
|
||||||
itemBorderColorR, itemBorderColorG, itemBorderColorB, itemBorderColorA,
|
itemBorderColorR, itemBorderColorG, itemBorderColorB, itemBorderColorA,
|
||||||
itemOutlineColorR, itemOutlineColorG, itemOutlineColorB, itemOutlineColorA;
|
itemOutlineColorR, itemOutlineColorG, itemOutlineColorB, itemOutlineColorA;
|
||||||
*aZoneFileStream >> itemForegroundColorR >> itemForegroundColorG >> itemForegroundColorB >> itemForegroundColorA
|
*aZoneFileStream >> itemForegroundColorR >> itemForegroundColorG >> itemForegroundColorB >> itemForegroundColorA
|
||||||
>> itemBackgroundColorR >> itemBackgroundColorG >> itemBackgroundColorB >> itemBackgroundColorA
|
>> itemBackgroundColorR >> itemBackgroundColorG >> itemBackgroundColorB >> itemBackgroundColorA
|
||||||
>> itemBorderColorR >> itemBorderColorG >> itemBorderColorB >> itemBorderColorA
|
>> itemBorderColorR >> itemBorderColorG >> itemBorderColorB >> itemBorderColorA
|
||||||
>> itemOutlineColorR >> itemOutlineColorG >> itemOutlineColorB >> itemOutlineColorA;
|
>> itemOutlineColorR >> itemOutlineColorG >> itemOutlineColorB >> itemOutlineColorA;
|
||||||
|
|
||||||
menu.itemForegroundColor = QColor(itemForegroundColorR, itemForegroundColorG, itemForegroundColorB, itemForegroundColorA);
|
menu.itemForegroundColor = QColor(itemForegroundColorR, itemForegroundColorG, itemForegroundColorB, itemForegroundColorA);
|
||||||
menu.itemBackgroundColor = QColor(itemBackgroundColorR, itemBackgroundColorG, itemBackgroundColorB, itemBackgroundColorA);
|
menu.itemBackgroundColor = QColor(itemBackgroundColorR, itemBackgroundColorG, itemBackgroundColorB, itemBackgroundColorA);
|
||||||
@ -886,9 +926,9 @@ MenuFile ZoneFile_COD2_360::pParseAsset_MenuFile(QDataStream *aZoneFileStream) {
|
|||||||
|
|
||||||
quint32 hItemTextAlignInt, vItemTextAlignInt, itemType, fontTypeInt, textStyleInt;
|
quint32 hItemTextAlignInt, vItemTextAlignInt, itemType, fontTypeInt, textStyleInt;
|
||||||
*aZoneFileStream >> hItemTextAlignInt >> vItemTextAlignInt >> itemType >> menu.dataType
|
*aZoneFileStream >> hItemTextAlignInt >> vItemTextAlignInt >> itemType >> menu.dataType
|
||||||
>> menu.alignment >> fontTypeInt >> menu.textAlignMode >> menu.textalignx >> menu.textaligny
|
>> menu.alignment >> fontTypeInt >> menu.textAlignMode >> menu.textalignx >> menu.textaligny
|
||||||
>> menu.textscale >> textStyleInt >> menu.gameMsgWindowIndex >> menu.gameMsgWindowMode
|
>> menu.textscale >> textStyleInt >> menu.gameMsgWindowIndex >> menu.gameMsgWindowMode
|
||||||
>> menu.testPtr >> menu.textSavegameInfo >> menu.parentPtr;
|
>> menu.testPtr >> menu.textSavegameInfo >> menu.parentPtr;
|
||||||
menu.itemText_hAlign = (MENU_H_ALIGNMENT)hItemTextAlignInt;
|
menu.itemText_hAlign = (MENU_H_ALIGNMENT)hItemTextAlignInt;
|
||||||
menu.itemText_vAlign = (MENU_V_ALIGNMENT)vItemTextAlignInt;
|
menu.itemText_vAlign = (MENU_V_ALIGNMENT)vItemTextAlignInt;
|
||||||
menu.itemType = (MENU_ITEM_TYPE)itemType;
|
menu.itemType = (MENU_ITEM_TYPE)itemType;
|
||||||
@ -896,9 +936,9 @@ MenuFile ZoneFile_COD2_360::pParseAsset_MenuFile(QDataStream *aZoneFileStream) {
|
|||||||
menu.textStyle = (MENU_ITEM_TEXTSTYLE)textStyleInt;
|
menu.textStyle = (MENU_ITEM_TEXTSTYLE)textStyleInt;
|
||||||
|
|
||||||
*aZoneFileStream >> menu.mouseEnterText >> menu.mouseExitText >> menu.mouseEnter >> menu.mouseExit
|
*aZoneFileStream >> menu.mouseEnterText >> menu.mouseExitText >> menu.mouseEnter >> menu.mouseExit
|
||||||
>> menu.action >> menu.onAccept >> menu.onFocus >> menu.leaveFocus >> menu.dvar >> menu.dvarTest
|
>> menu.action >> menu.onAccept >> menu.onFocus >> menu.leaveFocus >> menu.dvar >> menu.dvarTest
|
||||||
>> menu.keyHandlerPtr >> menu.enableDvarPtr >> menu.dvarFlags >> menu.focusSoundPtr
|
>> menu.keyHandlerPtr >> menu.enableDvarPtr >> menu.dvarFlags >> menu.focusSoundPtr
|
||||||
>> menu.special >> menu.cursorPos;
|
>> menu.special >> menu.cursorPos;
|
||||||
|
|
||||||
// itemDefData_t typeData;
|
// itemDefData_t typeData;
|
||||||
|
|
||||||
@ -918,11 +958,11 @@ MenuFile ZoneFile_COD2_360::pParseAsset_MenuFile(QDataStream *aZoneFileStream) {
|
|||||||
*aZoneFileStream >> menu.notselectable >> menu.noScrollBars >> menu.usePaging;
|
*aZoneFileStream >> menu.notselectable >> menu.noScrollBars >> menu.usePaging;
|
||||||
|
|
||||||
float itemSelectBorderColorR, itemSelectBorderColorG, itemSelectBorderColorB, itemSelectBorderColorA,
|
float itemSelectBorderColorR, itemSelectBorderColorG, itemSelectBorderColorB, itemSelectBorderColorA,
|
||||||
itemDisableColorR, itemDisableColorG, itemDisableColorB, itemDisableColorA,
|
itemDisableColorR, itemDisableColorG, itemDisableColorB, itemDisableColorA,
|
||||||
itemFocusColorR, itemFocusColorG, itemFocusColorB, itemFocusColorA;
|
itemFocusColorR, itemFocusColorG, itemFocusColorB, itemFocusColorA;
|
||||||
*aZoneFileStream >> itemSelectBorderColorR >> itemSelectBorderColorG >> itemSelectBorderColorB >> itemSelectBorderColorA
|
*aZoneFileStream >> itemSelectBorderColorR >> itemSelectBorderColorG >> itemSelectBorderColorB >> itemSelectBorderColorA
|
||||||
>> itemDisableColorR >> itemDisableColorG >> itemDisableColorB >> itemDisableColorA
|
>> itemDisableColorR >> itemDisableColorG >> itemDisableColorB >> itemDisableColorA
|
||||||
>> itemFocusColorR >> itemFocusColorG >> itemFocusColorB >> itemFocusColorA;
|
>> itemFocusColorR >> itemFocusColorG >> itemFocusColorB >> itemFocusColorA;
|
||||||
menu.itemSelectBorderColor = QColor(itemSelectBorderColorR, itemSelectBorderColorG, itemSelectBorderColorB, itemSelectBorderColorA);
|
menu.itemSelectBorderColor = QColor(itemSelectBorderColorR, itemSelectBorderColorG, itemSelectBorderColorB, itemSelectBorderColorA);
|
||||||
menu.itemDisableColor = QColor(itemDisableColorR, itemDisableColorG, itemDisableColorB, itemDisableColorA);
|
menu.itemDisableColor = QColor(itemDisableColorR, itemDisableColorG, itemDisableColorB, itemDisableColorA);
|
||||||
menu.itemFocusColor = QColor(itemFocusColorR, itemFocusColorG, itemFocusColorB, itemFocusColorA);
|
menu.itemFocusColor = QColor(itemFocusColorR, itemFocusColorG, itemFocusColorB, itemFocusColorA);
|
||||||
@ -932,7 +972,7 @@ MenuFile ZoneFile_COD2_360::pParseAsset_MenuFile(QDataStream *aZoneFileStream) {
|
|||||||
// editFieldDef_s *editField;
|
// editFieldDef_s *editField;
|
||||||
|
|
||||||
*aZoneFileStream >> menu.minVal >> menu.maxVal >> menu.defVal >> menu.range >> menu.maxChars
|
*aZoneFileStream >> menu.minVal >> menu.maxVal >> menu.defVal >> menu.range >> menu.maxChars
|
||||||
>> menu.maxCharsGotoNext >> menu.maxPaintChars >> menu.paintOffset;
|
>> menu.maxCharsGotoNext >> menu.maxPaintChars >> menu.paintOffset;
|
||||||
|
|
||||||
// multiDef_s *multi;
|
// multiDef_s *multi;
|
||||||
|
|
||||||
@ -990,8 +1030,8 @@ StringTable ZoneFile_COD2_360::pParseAsset_StringTable(QDataStream *aZoneFileStr
|
|||||||
aZoneFileStream->skipRawData(4);
|
aZoneFileStream->skipRawData(4);
|
||||||
|
|
||||||
*aZoneFileStream
|
*aZoneFileStream
|
||||||
>> result.columnCount
|
>> result.columnCount
|
||||||
>> result.rowCount;
|
>> result.rowCount;
|
||||||
|
|
||||||
// Todo fix this
|
// Todo fix this
|
||||||
result.columnCount = 0;
|
result.columnCount = 0;
|
||||||
@ -1039,29 +1079,10 @@ StringTable ZoneFile_COD2_360::pParseAsset_StringTable(QDataStream *aZoneFileStr
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// "parts",
|
|
||||||
// ASSET_MODEL,
|
|
||||||
// ASSET_MATERIAL,
|
|
||||||
// ASSET_IMAGE,
|
|
||||||
// ASSET_SOUND,
|
|
||||||
// "sndCurve",
|
|
||||||
// "clipMap",
|
|
||||||
// "world",
|
|
||||||
// "lightDef",
|
|
||||||
// ASSET_FONT,
|
|
||||||
// "menuList",
|
|
||||||
// ASSET_MENU,
|
|
||||||
// "localize",
|
|
||||||
// ASSET_WEAPON,
|
|
||||||
// "sndDriverGlobals",
|
|
||||||
// "fx",
|
|
||||||
// "impactFx",
|
|
||||||
// "rawfile",
|
|
||||||
// "data"
|
|
||||||
|
|
||||||
AssetType ZoneFile_COD2_360::AssetStrToEnum(const QString aAssetType) {
|
AssetType ZoneFile_COD2_360::AssetStrToEnum(const QString aAssetType) {
|
||||||
const QString cleanedType = aAssetType.toUpper();
|
const QString cleanedType = aAssetType.toUpper();
|
||||||
if (cleanedType == "") {
|
if (cleanedType == "00000017") {
|
||||||
return ASSET_RAW_FILE;
|
return ASSET_RAW_FILE;
|
||||||
} else if (cleanedType == "") {
|
} else if (cleanedType == "") {
|
||||||
return ASSET_EFFECT;
|
return ASSET_EFFECT;
|
||||||
@ -1087,7 +1108,7 @@ AssetType ZoneFile_COD2_360::AssetStrToEnum(const QString aAssetType) {
|
|||||||
return ASSET_FONT;
|
return ASSET_FONT;
|
||||||
} else if (cleanedType == "") {
|
} else if (cleanedType == "") {
|
||||||
return ASSET_MODEL;
|
return ASSET_MODEL;
|
||||||
} else if (cleanedType == "") {
|
} else if (cleanedType == "00000006") {
|
||||||
return ASSET_D3DBSP;
|
return ASSET_D3DBSP;
|
||||||
} else if (cleanedType == "00000002") {
|
} else if (cleanedType == "00000002") {
|
||||||
return ASSET_MATERIAL;
|
return ASSET_MATERIAL;
|
||||||
@ -1099,8 +1120,8 @@ AssetType ZoneFile_COD2_360::AssetStrToEnum(const QString aAssetType) {
|
|||||||
return ASSET_PHYS_PRESET;
|
return ASSET_PHYS_PRESET;
|
||||||
} else if (cleanedType == "") {
|
} else if (cleanedType == "") {
|
||||||
return ASSET_DESTRUCTIBLE;
|
return ASSET_DESTRUCTIBLE;
|
||||||
} else if (cleanedType == "") {
|
} else if (cleanedType == "00000004") {
|
||||||
return ASSET_MENU;
|
return ASSET_SHOCK_FILE;
|
||||||
}
|
}
|
||||||
return ASSET_NONE;
|
return ASSET_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,14 @@ public:
|
|||||||
|
|
||||||
QByteArray GetBinaryData() override;
|
QByteArray GetBinaryData() override;
|
||||||
|
|
||||||
|
void SetMiscCount(quint32 aMiscCount) {
|
||||||
|
mMiscCount = aMiscCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 GetMiscCount() {
|
||||||
|
return mMiscCount;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void pParseZoneHeader(QDataStream *aZoneFileStream) override;
|
void pParseZoneHeader(QDataStream *aZoneFileStream) override;
|
||||||
quint32 pParseZoneSize(QDataStream *aZoneFileStream) override;
|
quint32 pParseZoneSize(QDataStream *aZoneFileStream) override;
|
||||||
@ -23,6 +31,7 @@ protected:
|
|||||||
void pParseZoneUnknownsB(QDataStream *aZoneFileStream) override;
|
void pParseZoneUnknownsB(QDataStream *aZoneFileStream) override;
|
||||||
void pParseZoneUnknownsC(QDataStream *aZoneFileStream) override;
|
void pParseZoneUnknownsC(QDataStream *aZoneFileStream) override;
|
||||||
QStringList pParseZoneTags(QDataStream *aZoneFileStream, quint32 tagCount) override;
|
QStringList pParseZoneTags(QDataStream *aZoneFileStream, quint32 tagCount) override;
|
||||||
|
QStringList pParseMiscTags(QDataStream *aZoneFileStream);
|
||||||
QStringList pParseZoneIndex(QDataStream *aZoneFileStream, quint32 recordCount) override;
|
QStringList pParseZoneIndex(QDataStream *aZoneFileStream, quint32 recordCount) override;
|
||||||
AssetMap pParseAssets(QDataStream *aZoneFileStream, QStringList assetOrder) override;
|
AssetMap pParseAssets(QDataStream *aZoneFileStream, QStringList assetOrder) override;
|
||||||
LocalString pParseAsset_LocalString(QDataStream *aZoneFileStream) override;
|
LocalString pParseAsset_LocalString(QDataStream *aZoneFileStream) override;
|
||||||
@ -47,6 +56,9 @@ protected:
|
|||||||
void pParseAsset_Weapon(QDataStream *aZoneFileStream) override;
|
void pParseAsset_Weapon(QDataStream *aZoneFileStream) override;
|
||||||
void pParseAsset_D3DBSP(QDataStream *aZoneFileStream) override;
|
void pParseAsset_D3DBSP(QDataStream *aZoneFileStream) override;
|
||||||
StringTable pParseAsset_StringTable(QDataStream *aZoneFileStream) override;
|
StringTable pParseAsset_StringTable(QDataStream *aZoneFileStream) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint32 mMiscCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ZONEFILE_COD2_360_H
|
#endif // ZONEFILE_COD2_360_H
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#include "zonefile_cod4_360.h"
|
#include "zonefile_cod4_360.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
@ -152,7 +153,7 @@ QStringList ZoneFile_COD4_360::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
// Parse tags/strings before index
|
// Parse tags/strings before index
|
||||||
QString zoneTag;
|
QString zoneTag;
|
||||||
char zoneTagChar;
|
char zoneTagChar;
|
||||||
for (quint32 i = 0; i < tagCount - 1; i++) {
|
for (quint32 i = 0; i < tagCount; i++) {
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
while (zoneTagChar != 0) {
|
while (zoneTagChar != 0) {
|
||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
@ -177,6 +178,10 @@ QStringList ZoneFile_COD4_360::pParseZoneIndex(QDataStream *aZoneFileStream, qui
|
|||||||
// Don't parse if no records
|
// Don't parse if no records
|
||||||
if (!recordCount) { return result; }
|
if (!recordCount) { return result; }
|
||||||
|
|
||||||
|
if (aZoneFileStream->device()->peek(4).toHex().contains("ff")) {
|
||||||
|
aZoneFileStream->device()->seek(aZoneFileStream->device()->pos() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
// Parse index & map found asset types
|
// Parse index & map found asset types
|
||||||
for (quint32 i = 0; i < recordCount; i++) {
|
for (quint32 i = 0; i < recordCount; i++) {
|
||||||
// Skip record start
|
// Skip record start
|
||||||
@ -253,9 +258,9 @@ AssetMap ZoneFile_COD4_360::pParseAssets(QDataStream *aZoneFileStream, QStringLi
|
|||||||
LocalString ZoneFile_COD4_360::pParseAsset_LocalString(QDataStream *aZoneFileStream) {
|
LocalString ZoneFile_COD4_360::pParseAsset_LocalString(QDataStream *aZoneFileStream) {
|
||||||
LocalString result;
|
LocalString result;
|
||||||
|
|
||||||
quint32 stringPtr, aliasPtr;
|
qint32 stringPtr, aliasPtr;
|
||||||
*aZoneFileStream >> stringPtr >> aliasPtr;
|
*aZoneFileStream >> stringPtr >> aliasPtr;
|
||||||
if (stringPtr == 4294967295) {
|
if (stringPtr == -1) {
|
||||||
// Parse local string asset contents
|
// Parse local string asset contents
|
||||||
QString localStr;
|
QString localStr;
|
||||||
char localStrChar;
|
char localStrChar;
|
||||||
@ -268,7 +273,7 @@ LocalString ZoneFile_COD4_360::pParseAsset_LocalString(QDataStream *aZoneFileStr
|
|||||||
result.string = "String Ptr: " + QString::number(stringPtr);
|
result.string = "String Ptr: " + QString::number(stringPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aliasPtr == 4294967295) {
|
if (aliasPtr == -1) {
|
||||||
// Parse rawfile name
|
// Parse rawfile name
|
||||||
QString aliasName;
|
QString aliasName;
|
||||||
char aliasNameChar;
|
char aliasNameChar;
|
||||||
@ -287,6 +292,8 @@ LocalString ZoneFile_COD4_360::pParseAsset_LocalString(QDataStream *aZoneFileStr
|
|||||||
RawFile ZoneFile_COD4_360::pParseAsset_RawFile(QDataStream *aZoneFileStream) {
|
RawFile ZoneFile_COD4_360::pParseAsset_RawFile(QDataStream *aZoneFileStream) {
|
||||||
RawFile result;
|
RawFile result;
|
||||||
|
|
||||||
|
result.startPos = aZoneFileStream->device()->pos();
|
||||||
|
|
||||||
// Skip start separator FF FF FF FF (pointer?)
|
// Skip start separator FF FF FF FF (pointer?)
|
||||||
aZoneFileStream->skipRawData(4);
|
aZoneFileStream->skipRawData(4);
|
||||||
|
|
||||||
@ -330,6 +337,8 @@ RawFile ZoneFile_COD4_360::pParseAsset_RawFile(QDataStream *aZoneFileStream) {
|
|||||||
*aZoneFileStream >> rawFileContentsChar;
|
*aZoneFileStream >> rawFileContentsChar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result.endPos = aZoneFileStream->device()->pos();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,57 +349,93 @@ void ZoneFile_COD4_360::pParseAsset_PhysPreset(QDataStream *aZoneFileStream) {
|
|||||||
Model ZoneFile_COD4_360::pParseAsset_Model(QDataStream *aZoneFileStream) {
|
Model ZoneFile_COD4_360::pParseAsset_Model(QDataStream *aZoneFileStream) {
|
||||||
Model result;
|
Model result;
|
||||||
|
|
||||||
*aZoneFileStream >> result.namePtr >> result.tagCount >> result.rootTagCount
|
aZoneFileStream->skipRawData(4);
|
||||||
>> result.surfCount >> result.unknownCount >> result.boneNamePtr
|
|
||||||
>> result.parentListPtr >> result.quatsPtr >> result.transPtr
|
|
||||||
>> result.partClassPtr >> result.baseMatPtr
|
|
||||||
>> result.surfsPtr >> result.materialHandlesPtr;
|
|
||||||
|
|
||||||
// Parse XModelLodInfo
|
QByteArray modelMagic(4, Qt::Uninitialized);
|
||||||
for (int i = 1; i <= 4; i++) {
|
aZoneFileStream->readRawData(modelMagic.data(), 4);
|
||||||
quint32 intDist;
|
if (modelMagic.toHex() != "01010200") {
|
||||||
*aZoneFileStream >> intDist;
|
qDebug() << "Invalid model magic: " << modelMagic.toHex();
|
||||||
|
return result;
|
||||||
std::memcpy(&result.lodInfo[i].dist, &intDist, sizeof(result.lodInfo[i].dist));
|
|
||||||
*aZoneFileStream >> result.lodInfo[i].numsurfs >> result.lodInfo[i].surfIndex;
|
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(4);
|
|
||||||
|
|
||||||
*aZoneFileStream >> result.lodInfo[i].partBits[0]
|
|
||||||
>> result.lodInfo[i].partBits[1]
|
|
||||||
>> result.lodInfo[i].partBits[2]
|
|
||||||
>> result.lodInfo[i].partBits[3];
|
|
||||||
}
|
}
|
||||||
|
qDebug() << "Model Magic: " << modelMagic.toHex();
|
||||||
|
|
||||||
*aZoneFileStream >> result.collSurfsPtr >> result.numCollSurfs >> result.contents >> result.boneInfoPtr;
|
aZoneFileStream->skipRawData(8 * 4);
|
||||||
|
|
||||||
quint32 intRadius, intMins[3], intMaxs[3];
|
for (int i = 0; i < 4; i++) {
|
||||||
*aZoneFileStream >> intRadius >> intMins[0] >> intMins[1]
|
|
||||||
>> intMins[2] >> intMaxs[0] >> intMaxs[1] >> intMaxs[2];
|
|
||||||
|
|
||||||
std::memcpy(&result.radius, &intRadius, sizeof(result.radius));
|
QByteArray lodData(4, Qt::Uninitialized);
|
||||||
|
aZoneFileStream->readRawData(lodData.data(), 4);
|
||||||
|
|
||||||
std::memcpy(&result.mins[0], &intMins[0], sizeof(result.mins[0]));
|
float levelOfDetail = qFromBigEndian<float>(reinterpret_cast<const uchar*>(lodData.constData()));
|
||||||
std::memcpy(&result.mins[1], &intMins[1], sizeof(result.mins[1]));
|
|
||||||
std::memcpy(&result.mins[2], &intMins[2], sizeof(result.mins[2]));
|
|
||||||
|
|
||||||
std::memcpy(&result.maxs[0], &intMaxs[0], sizeof(result.maxs[0]));
|
quint16 surfacePresent;
|
||||||
std::memcpy(&result.maxs[1], &intMaxs[1], sizeof(result.maxs[2]));
|
*aZoneFileStream >> surfacePresent;
|
||||||
std::memcpy(&result.maxs[2], &intMaxs[2], sizeof(result.maxs[3]));
|
|
||||||
|
|
||||||
*aZoneFileStream >> result.numLods >> result.collLod >> result.streamInfoPtr
|
quint16 surfaceIndex;
|
||||||
>> result.memUsage >> result.flags >> result.physPresetPtr >> result.physGeomsPtr;
|
*aZoneFileStream >> surfaceIndex;
|
||||||
|
|
||||||
// Parse model name
|
if (surfacePresent) {
|
||||||
|
qDebug() << "Surface " << surfaceIndex << " detected";
|
||||||
|
qDebug() << "- Level of Detail: " << levelOfDetail;
|
||||||
|
}
|
||||||
|
aZoneFileStream->skipRawData(4 * 4);
|
||||||
|
}
|
||||||
|
aZoneFileStream->skipRawData(17 * 4);
|
||||||
|
|
||||||
|
qDebug() << "Name Char: " << aZoneFileStream->device()->pos();
|
||||||
|
QString modelName;
|
||||||
char modelNameChar;
|
char modelNameChar;
|
||||||
*aZoneFileStream >> modelNameChar;
|
*aZoneFileStream >> modelNameChar;
|
||||||
while (modelNameChar == 0) {
|
|
||||||
*aZoneFileStream >> modelNameChar;
|
|
||||||
}
|
|
||||||
while (modelNameChar != 0) {
|
while (modelNameChar != 0) {
|
||||||
result.modelName += modelNameChar;
|
modelName += modelNameChar;
|
||||||
*aZoneFileStream >> modelNameChar;
|
*aZoneFileStream >> modelNameChar;
|
||||||
}
|
}
|
||||||
|
qDebug() << "Model Name: " << modelName;
|
||||||
|
|
||||||
|
aZoneFileStream->skipRawData(4 * 9 + 1);
|
||||||
|
|
||||||
|
quint16 vertCount, faceCount;
|
||||||
|
*aZoneFileStream >> vertCount >> faceCount;
|
||||||
|
qDebug() << "Vertex count 1: " << vertCount;
|
||||||
|
qDebug() << "Face count 1: " << faceCount;
|
||||||
|
|
||||||
|
aZoneFileStream->skipRawData(57 * 4 - 2);
|
||||||
|
|
||||||
|
qDebug() << "Vertex Listing: " << aZoneFileStream->device()->pos();
|
||||||
|
for (int i = 0; i < vertCount; i++) {
|
||||||
|
qDebug() << "- Vertex " << i;
|
||||||
|
|
||||||
|
QByteArray xOffData(4, Qt::Uninitialized);
|
||||||
|
aZoneFileStream->readRawData(xOffData.data(), 4);
|
||||||
|
float xOff = qFromBigEndian<float>(reinterpret_cast<const uchar*>(xOffData.constData()));
|
||||||
|
|
||||||
|
QByteArray yOffData(4, Qt::Uninitialized);
|
||||||
|
aZoneFileStream->readRawData(yOffData.data(), 4);
|
||||||
|
float yOff = qFromBigEndian<float>(reinterpret_cast<const uchar*>(yOffData.constData()));
|
||||||
|
|
||||||
|
QByteArray zOffData(4, Qt::Uninitialized);
|
||||||
|
aZoneFileStream->readRawData(zOffData.data(), 4);
|
||||||
|
float zOff = qFromBigEndian<float>(reinterpret_cast<const uchar*>(zOffData.constData()));
|
||||||
|
|
||||||
|
qDebug() << " - Offset: " << xOff << ", " << yOff << ", " << zOff;
|
||||||
|
aZoneFileStream->skipRawData(20);
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug() << "Count 2: " << aZoneFileStream->device()->pos();
|
||||||
|
quint32 vertCount1, faceCount1;
|
||||||
|
*aZoneFileStream >> vertCount1 >> faceCount1;
|
||||||
|
qDebug() << "Vertex count 2: " << vertCount1;
|
||||||
|
qDebug() << "Face count 2: " << faceCount1;
|
||||||
|
|
||||||
|
aZoneFileStream->skipRawData(1968);
|
||||||
|
|
||||||
|
for (int i = 0; i < faceCount - 6; i++) {
|
||||||
|
aZoneFileStream->skipRawData(64);
|
||||||
|
}
|
||||||
|
aZoneFileStream->skipRawData(224);
|
||||||
|
|
||||||
|
aZoneFileStream->device()->seek(aZoneFileStream->device()->pos() + aZoneFileStream->device()->peek(1024).toHex().indexOf("ffffffff"));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,15 +553,13 @@ TechSet ZoneFile_COD4_360::pParseAsset_TechSet(QDataStream *aZoneFileStream) {
|
|||||||
*aZoneFileStream >> namePtr;
|
*aZoneFileStream >> namePtr;
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < 53; i++) {
|
for (int i = 0; i < 28; i++) {
|
||||||
quint32 ptr;
|
quint32 ptr;
|
||||||
*aZoneFileStream >> ptr;
|
*aZoneFileStream >> ptr;
|
||||||
|
|
||||||
result.pointers << ptr;
|
result.pointers << ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//aZoneFileStream->skipRawData(53 * 4);
|
|
||||||
|
|
||||||
if (namePtr == -1) {
|
if (namePtr == -1) {
|
||||||
aZoneFileStream->skipRawData(1);
|
aZoneFileStream->skipRawData(1);
|
||||||
|
|
||||||
@ -536,68 +579,62 @@ TechSet ZoneFile_COD4_360::pParseAsset_TechSet(QDataStream *aZoneFileStream) {
|
|||||||
Image ZoneFile_COD4_360::pParseAsset_Image(QDataStream *aZoneFileStream) {
|
Image ZoneFile_COD4_360::pParseAsset_Image(QDataStream *aZoneFileStream) {
|
||||||
Image result;
|
Image result;
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(4);
|
qDebug() << "Header" << aZoneFileStream->device()->pos();
|
||||||
*aZoneFileStream >> result.unknowna >> result.unknownb
|
qDebug() << "- Start Pos: " << aZoneFileStream->device()->pos();
|
||||||
>> result.unknownc >> result.unknownd
|
aZoneFileStream->skipRawData(14);
|
||||||
>> result.unknowne >> result.unknownf
|
|
||||||
>> result.unknowng;
|
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(15 * 4);
|
QByteArray sectionCountData(1, Qt::Uninitialized);
|
||||||
*aZoneFileStream >> result.unknownh >> result.unknowni;
|
aZoneFileStream->readRawData(sectionCountData.data(), 1);
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(4);
|
QString sectionCountStr = sectionCountData.toHex();
|
||||||
*aZoneFileStream >> result.unknownj;
|
std::reverse(sectionCountStr.begin(), sectionCountStr.end());
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(4);
|
quint32 sectionCount = sectionCountStr.toInt();
|
||||||
|
qDebug() << "- Section Count: " << sectionCountStr << " : " << sectionCount;
|
||||||
|
|
||||||
char materialNameChar;
|
aZoneFileStream->skipRawData(25);
|
||||||
*aZoneFileStream >> materialNameChar;
|
|
||||||
while (materialNameChar != 0) {
|
|
||||||
result.materialName += materialNameChar;
|
|
||||||
*aZoneFileStream >> materialNameChar;
|
|
||||||
}
|
|
||||||
result.materialName.replace(",", "");
|
|
||||||
|
|
||||||
if (result.unknowna) {
|
// Parse image name
|
||||||
*aZoneFileStream >> result.unknownk;
|
char imageNameChar;
|
||||||
*aZoneFileStream >> result.unknownl;
|
*aZoneFileStream >> imageNameChar;
|
||||||
*aZoneFileStream >> result.unknownm;
|
while (imageNameChar != 0) {
|
||||||
|
result.name += imageNameChar;
|
||||||
aZoneFileStream->skipRawData(4);
|
result.materialName += imageNameChar;
|
||||||
|
|
||||||
*aZoneFileStream >> result.unknown1;
|
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(4);
|
|
||||||
|
|
||||||
*aZoneFileStream >> result.unknown2 >> result.unknown3
|
|
||||||
>> result.size1 >> result.size2
|
|
||||||
>> result.unknown4 >> result.unknown5;
|
|
||||||
|
|
||||||
aZoneFileStream->skipRawData(4);
|
|
||||||
|
|
||||||
char imageNameChar;
|
|
||||||
*aZoneFileStream >> imageNameChar;
|
*aZoneFileStream >> imageNameChar;
|
||||||
while (imageNameChar != 0) {
|
|
||||||
result.name += imageNameChar;
|
|
||||||
*aZoneFileStream >> imageNameChar;
|
|
||||||
}
|
|
||||||
|
|
||||||
*aZoneFileStream >> result.unknown6 >> result.unknown7;
|
|
||||||
|
|
||||||
QByteArray compressionData(8, Qt::Uninitialized);
|
|
||||||
aZoneFileStream->readRawData(compressionData.data(), 8);
|
|
||||||
if (compressionData.contains("DXT1")) {
|
|
||||||
result.compression = COMPRESSION_DXT1;
|
|
||||||
} else if (compressionData.contains("DXT3")) {
|
|
||||||
result.compression = COMPRESSION_DXT3;
|
|
||||||
} else if (compressionData.contains("DXT5")) {
|
|
||||||
result.compression = COMPRESSION_DXT5;
|
|
||||||
} else {
|
|
||||||
result.compression = COMPRESSION_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
*aZoneFileStream >> result.unknown8 >> result.unknown9;
|
|
||||||
}
|
}
|
||||||
|
qDebug() << "- Name: " << result.name;
|
||||||
|
qDebug() << "- End Pos: " << aZoneFileStream->device()->pos();
|
||||||
|
|
||||||
|
qDebug() << "Chunks [" << sectionCount << "]";
|
||||||
|
for (int i = 0; i < sectionCount; i++) {
|
||||||
|
qDebug() << "- Chunk " << sectionCount;
|
||||||
|
qDebug() << " - Header" << sectionCount;
|
||||||
|
qDebug() << " - Start Pos: " << aZoneFileStream->device()->pos();
|
||||||
|
|
||||||
|
// TODO: Parse header/index/pointers?
|
||||||
|
for (int j = 0; j < 60; j++) {
|
||||||
|
quint32 unknownPtr;
|
||||||
|
*aZoneFileStream >> unknownPtr;
|
||||||
|
|
||||||
|
result.unknowns.append(unknownPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug() << " - End Pos: " << aZoneFileStream->device()->pos();
|
||||||
|
qDebug() << " - Data" << sectionCount;
|
||||||
|
qDebug() << " - Start Pos: " << aZoneFileStream->device()->pos();
|
||||||
|
|
||||||
|
// TODO: Parse data chunks
|
||||||
|
aZoneFileStream->skipRawData(3856);
|
||||||
|
qDebug() << " - End Pos: " << aZoneFileStream->device()->pos();
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug() << "Footer";
|
||||||
|
qDebug() << "- Start Pos: " << aZoneFileStream->device()->pos();
|
||||||
|
// TODO: Parse pointers/footer?
|
||||||
|
for (int k = 0; k < 17; k++) {
|
||||||
|
aZoneFileStream->skipRawData(4);
|
||||||
|
}
|
||||||
|
qDebug() << "- End Pos: " << aZoneFileStream->device()->pos();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -605,6 +642,9 @@ Image ZoneFile_COD4_360::pParseAsset_Image(QDataStream *aZoneFileStream) {
|
|||||||
SoundAsset ZoneFile_COD4_360::pParseAsset_Sound(QDataStream *aZoneFileStream) {
|
SoundAsset ZoneFile_COD4_360::pParseAsset_Sound(QDataStream *aZoneFileStream) {
|
||||||
SoundAsset result;
|
SoundAsset result;
|
||||||
|
|
||||||
|
// TODO Reimplement proper sound parsing
|
||||||
|
return result;
|
||||||
|
|
||||||
QByteArray rootNamePtr(4, Qt::Uninitialized);
|
QByteArray rootNamePtr(4, Qt::Uninitialized);
|
||||||
aZoneFileStream->readRawData(rootNamePtr.data(), 4);
|
aZoneFileStream->readRawData(rootNamePtr.data(), 4);
|
||||||
|
|
||||||
@ -1100,13 +1140,13 @@ StringTable ZoneFile_COD4_360::pParseAsset_StringTable(QDataStream *aZoneFileStr
|
|||||||
|
|
||||||
AssetType ZoneFile_COD4_360::AssetStrToEnum(const QString aAssetType) {
|
AssetType ZoneFile_COD4_360::AssetStrToEnum(const QString aAssetType) {
|
||||||
const QString cleanedType = aAssetType.toUpper();
|
const QString cleanedType = aAssetType.toUpper();
|
||||||
if (cleanedType == "00000021") {
|
if (cleanedType == "00000020") {
|
||||||
return ASSET_RAW_FILE;
|
return ASSET_RAW_FILE;
|
||||||
} else if (cleanedType == "0000001A") {
|
} else if (cleanedType == "0000001A") {
|
||||||
return ASSET_EFFECT;
|
return ASSET_EFFECT;
|
||||||
} else if (cleanedType == "00000009") {
|
} else if (cleanedType == "00000017") {
|
||||||
return ASSET_SOUND;
|
return ASSET_LOCAL_STRING;
|
||||||
} else if (cleanedType == "00000004") {
|
} else if (cleanedType == "00000002") {
|
||||||
return ASSET_ANIMATION;
|
return ASSET_ANIMATION;
|
||||||
} else if (cleanedType == "0000000C") {
|
} else if (cleanedType == "0000000C") {
|
||||||
return ASSET_COLLISION_MAP;
|
return ASSET_COLLISION_MAP;
|
||||||
@ -1114,21 +1154,19 @@ AssetType ZoneFile_COD4_360::AssetStrToEnum(const QString aAssetType) {
|
|||||||
return ASSET_STRING_TABLE;
|
return ASSET_STRING_TABLE;
|
||||||
} else if (cleanedType == "00000015") {
|
} else if (cleanedType == "00000015") {
|
||||||
return ASSET_MENU;
|
return ASSET_MENU;
|
||||||
} else if (cleanedType == "00000008") {
|
} else if (cleanedType == "00000006") {
|
||||||
return ASSET_TECH_SET;
|
return ASSET_TECH_SET;
|
||||||
} else if (cleanedType == "00000018") {
|
} else if (cleanedType == "00000018") {
|
||||||
return ASSET_LOCAL_STRING;
|
return ASSET_WEAPON;
|
||||||
} else if (cleanedType == "00000011") {
|
} else if (cleanedType == "00000011") {
|
||||||
return ASSET_GFX_MAP;
|
return ASSET_GFX_MAP;
|
||||||
} else if (cleanedType == "00000012") {
|
} else if (cleanedType == "00000012") {
|
||||||
return ASSET_LIGHT_DEF;
|
return ASSET_LIGHT_DEF;
|
||||||
} else if (cleanedType == "00000014") {
|
} else if (cleanedType == "00000014") {
|
||||||
return ASSET_FONT;
|
return ASSET_FONT;
|
||||||
} else if (cleanedType == "00000005") {
|
|
||||||
return ASSET_MODEL;
|
|
||||||
} else if (cleanedType == "0000000D") {
|
} else if (cleanedType == "0000000D") {
|
||||||
return ASSET_D3DBSP;
|
return ASSET_D3DBSP;
|
||||||
} else if (cleanedType == "00000006") {
|
} else if (cleanedType == "00000008") {
|
||||||
return ASSET_MATERIAL;
|
return ASSET_MATERIAL;
|
||||||
} else if (cleanedType == "0000000E") {
|
} else if (cleanedType == "0000000E") {
|
||||||
return ASSET_GAME_MAP_SP;
|
return ASSET_GAME_MAP_SP;
|
||||||
@ -1137,9 +1175,17 @@ AssetType ZoneFile_COD4_360::AssetStrToEnum(const QString aAssetType) {
|
|||||||
} else if (cleanedType == "00000001") {
|
} else if (cleanedType == "00000001") {
|
||||||
return ASSET_PHYS_PRESET;
|
return ASSET_PHYS_PRESET;
|
||||||
} else if (cleanedType == "00000003") {
|
} else if (cleanedType == "00000003") {
|
||||||
return ASSET_DESTRUCTIBLE;
|
return ASSET_MODEL;
|
||||||
} else if (cleanedType == "00000016") {
|
} else if (cleanedType == "00000016") {
|
||||||
return ASSET_MENU;
|
return ASSET_MENU;
|
||||||
|
} else if (cleanedType == "0000001B") {
|
||||||
|
return ASSET_UI_MAP;
|
||||||
|
} else if (cleanedType == "00000007") {
|
||||||
|
return ASSET_IMAGE;
|
||||||
|
} else if (cleanedType == "00000009") {
|
||||||
|
return ASSET_SOUND_DRIVER_GLOBALS;
|
||||||
|
} else if (cleanedType == "00000019") {
|
||||||
|
return ASSET_SOUND;
|
||||||
}
|
}
|
||||||
return ASSET_NONE;
|
return ASSET_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD5_360::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
if (!zoneTag.isEmpty()) {
|
if (!zoneTag.isEmpty()) {
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
}
|
}
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,8 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) {
|
|||||||
|
|
||||||
void ZoneFile_COD6_360::pParseZoneHeader(QDataStream *aZoneFileStream) {
|
void ZoneFile_COD6_360::pParseZoneHeader(QDataStream *aZoneFileStream) {
|
||||||
SetSize(pParseZoneSize(aZoneFileStream));
|
SetSize(pParseZoneSize(aZoneFileStream));
|
||||||
pParseZoneUnknownsA(aZoneFileStream);
|
|
||||||
|
aZoneFileStream->skipRawData(28);
|
||||||
|
|
||||||
SetTagCount(pParseZoneTagCount(aZoneFileStream));
|
SetTagCount(pParseZoneTagCount(aZoneFileStream));
|
||||||
pParseZoneUnknownsB(aZoneFileStream);
|
pParseZoneUnknownsB(aZoneFileStream);
|
||||||
@ -51,7 +52,7 @@ quint32 ZoneFile_COD6_360::pParseZoneSize(QDataStream *aZoneFileStream) {
|
|||||||
qDebug() << "Tried to open empty zone file!";
|
qDebug() << "Tried to open empty zone file!";
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
zoneFileSize += 36;
|
zoneFileSize += 32;
|
||||||
return zoneFileSize;
|
return zoneFileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,19 +148,19 @@ QStringList ZoneFile_COD6_360::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
QStringList tags;
|
QStringList tags;
|
||||||
|
|
||||||
// Byte 48-51: Repeated separators? ÿÿÿÿ x i
|
// Byte 48-51: Repeated separators? ÿÿÿÿ x i
|
||||||
aZoneFileStream->skipRawData(4 * (tagCount - 1));
|
aZoneFileStream->skipRawData(4 * (tagCount + 1));
|
||||||
|
|
||||||
// Parse tags/strings before index
|
// Parse tags/strings before index
|
||||||
QString zoneTag;
|
QString zoneTag;
|
||||||
char zoneTagChar;
|
char zoneTagChar;
|
||||||
for (quint32 i = 0; i < tagCount - 1; i++) {
|
for (quint32 i = 0; i < tagCount; i++) {
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
while (zoneTagChar != 0) {
|
while (zoneTagChar != 0) {
|
||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
if (!zoneTag.isEmpty()) {
|
if (!zoneTag.isEmpty()) {
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
}
|
}
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
@ -604,6 +605,7 @@ Image ZoneFile_COD6_360::pParseAsset_Image(QDataStream *aZoneFileStream) {
|
|||||||
|
|
||||||
SoundAsset ZoneFile_COD6_360::pParseAsset_Sound(QDataStream *aZoneFileStream) {
|
SoundAsset ZoneFile_COD6_360::pParseAsset_Sound(QDataStream *aZoneFileStream) {
|
||||||
SoundAsset result;
|
SoundAsset result;
|
||||||
|
return result;
|
||||||
|
|
||||||
QByteArray rootNamePtr(4, Qt::Uninitialized);
|
QByteArray rootNamePtr(4, Qt::Uninitialized);
|
||||||
aZoneFileStream->readRawData(rootNamePtr.data(), 4);
|
aZoneFileStream->readRawData(rootNamePtr.data(), 4);
|
||||||
|
|||||||
@ -164,7 +164,7 @@ QStringList ZoneFile_COD7_360::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -164,7 +164,7 @@ QStringList ZoneFile_COD8_360::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD9_360::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD10_PC::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD11_PC::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -161,7 +161,7 @@ QStringList ZoneFile_COD12_PC::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -29,12 +29,13 @@ bool ZoneFile_COD4_PC::Load(const QByteArray aFileData) {
|
|||||||
|
|
||||||
void ZoneFile_COD4_PC::pParseZoneHeader(QDataStream *aZoneFileStream) {
|
void ZoneFile_COD4_PC::pParseZoneHeader(QDataStream *aZoneFileStream) {
|
||||||
SetSize(pParseZoneSize(aZoneFileStream));
|
SetSize(pParseZoneSize(aZoneFileStream));
|
||||||
pParseZoneUnknownsA(aZoneFileStream);
|
|
||||||
|
aZoneFileStream->skipRawData(40);
|
||||||
|
|
||||||
SetTagCount(pParseZoneTagCount(aZoneFileStream));
|
SetTagCount(pParseZoneTagCount(aZoneFileStream));
|
||||||
pParseZoneUnknownsB(aZoneFileStream);
|
pParseZoneUnknownsB(aZoneFileStream);
|
||||||
|
|
||||||
SetRecordCount(pParseZoneRecordCount(aZoneFileStream));
|
SetRecordCount(pParseZoneRecordCount(aZoneFileStream) - 1);
|
||||||
|
|
||||||
quint32 tagCount = GetTagCount();
|
quint32 tagCount = GetTagCount();
|
||||||
if (tagCount) {
|
if (tagCount) {
|
||||||
@ -159,7 +160,7 @@ QStringList ZoneFile_COD4_PC::pParseZoneTags(QDataStream *aZoneFileStream, quint
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
@ -592,6 +593,9 @@ Image ZoneFile_COD4_PC::pParseAsset_Image(QDataStream *aZoneFileStream) {
|
|||||||
SoundAsset ZoneFile_COD4_PC::pParseAsset_Sound(QDataStream *aZoneFileStream) {
|
SoundAsset ZoneFile_COD4_PC::pParseAsset_Sound(QDataStream *aZoneFileStream) {
|
||||||
SoundAsset result;
|
SoundAsset result;
|
||||||
|
|
||||||
|
// TODO Reimplement proper sound parsing
|
||||||
|
return result;
|
||||||
|
|
||||||
qDebug() << aZoneFileStream->device()->pos();
|
qDebug() << aZoneFileStream->device()->pos();
|
||||||
|
|
||||||
QByteArray rootNamePtr(4, Qt::Uninitialized);
|
QByteArray rootNamePtr(4, Qt::Uninitialized);
|
||||||
@ -1089,46 +1093,50 @@ StringTable ZoneFile_COD4_PC::pParseAsset_StringTable(QDataStream *aZoneFileStre
|
|||||||
|
|
||||||
AssetType ZoneFile_COD4_PC::AssetStrToEnum(const QString aAssetType) {
|
AssetType ZoneFile_COD4_PC::AssetStrToEnum(const QString aAssetType) {
|
||||||
const QString cleanedType = aAssetType.toUpper();
|
const QString cleanedType = aAssetType.toUpper();
|
||||||
if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED
|
if (cleanedType == "1F000000") {
|
||||||
return ASSET_RAW_FILE;
|
return ASSET_RAW_FILE;
|
||||||
} else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED
|
} else if (cleanedType == "20000000") {
|
||||||
return ASSET_SCRIPT_PARSE_TREE;
|
return ASSET_SCRIPT_PARSE_TREE;
|
||||||
} else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED
|
} else if (cleanedType == "19000000") {
|
||||||
return ASSET_EFFECT;
|
return ASSET_EFFECT;
|
||||||
} else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED
|
} else if (cleanedType == "16000000") {
|
||||||
return ASSET_SOUND;
|
return ASSET_SOUND;
|
||||||
} else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED
|
} else if (cleanedType == "02000000") {
|
||||||
return ASSET_ANIMATION;
|
return ASSET_ANIMATION;
|
||||||
} else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED
|
} else if (cleanedType == "0B000000") {
|
||||||
return ASSET_COLLISION_MAP;
|
return ASSET_COLLISION_MAP;
|
||||||
} else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED
|
} else if (cleanedType == "21000000") {
|
||||||
return ASSET_STRING_TABLE;
|
return ASSET_STRING_TABLE;
|
||||||
} else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED
|
} else if (cleanedType == "14000000") {
|
||||||
return ASSET_MENU;
|
return ASSET_MENU;
|
||||||
} else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED
|
} else if (cleanedType == "07000000") {
|
||||||
return ASSET_TECH_SET;
|
return ASSET_TECH_SET;
|
||||||
} else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED
|
} else if (cleanedType == "17000000") {
|
||||||
return ASSET_WEAPON;
|
return ASSET_WEAPON;
|
||||||
} else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED
|
} else if (cleanedType == "10000000") {
|
||||||
return ASSET_GFX_MAP;
|
return ASSET_GFX_MAP;
|
||||||
} else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED
|
} else if (cleanedType == "12000000") {
|
||||||
return ASSET_LIGHT_DEF;
|
return ASSET_LIGHT_DEF;
|
||||||
} else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED
|
} else if (cleanedType == "15000000") {
|
||||||
return ASSET_FONT;
|
return ASSET_FONT;
|
||||||
} else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED
|
} else if (cleanedType == "03000000") {
|
||||||
return ASSET_MODEL;
|
return ASSET_MODEL;
|
||||||
} else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED
|
} else if (cleanedType == "0C000000") {
|
||||||
return ASSET_D3DBSP;
|
return ASSET_D3DBSP;
|
||||||
} else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED
|
} else if (cleanedType == "06000000") {
|
||||||
return ASSET_IMAGE;
|
return ASSET_IMAGE;
|
||||||
} else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED
|
} else if (cleanedType == "0D000000") {
|
||||||
return ASSET_GAME_MAP_SP;
|
return ASSET_GAME_MAP_SP;
|
||||||
} else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED
|
} else if (cleanedType == "0A000000") {
|
||||||
return ASSET_COL_MAP_SP;
|
return ASSET_COL_MAP_SP;
|
||||||
} else if (cleanedType == "01000000") { // physics preset PARTIALLY VERIFIED
|
} else if (cleanedType == "01000000") {
|
||||||
return ASSET_PHYS_PRESET;
|
return ASSET_PHYS_PRESET;
|
||||||
} else if (cleanedType == "03000000") { // destructible def PARTIALLY VERIFIED
|
} else if (cleanedType == "05000000") {
|
||||||
return ASSET_DESTRUCTIBLE;
|
return ASSET_DESTRUCTIBLE;
|
||||||
|
} else if (cleanedType == "18000000") {
|
||||||
|
return ASSET_LOCAL_STRING;
|
||||||
|
} else if (cleanedType == "1A000000") {
|
||||||
|
return ASSET_UI_MAP;
|
||||||
}
|
}
|
||||||
return ASSET_NONE;
|
return ASSET_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD5_PC::pParseZoneTags(QDataStream *aZoneFileStream, quint
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD6_PC::pParseZoneTags(QDataStream *aZoneFileStream, quint
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -164,7 +164,7 @@ QStringList ZoneFile_COD7_PC::pParseZoneTags(QDataStream *aZoneFileStream, quint
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -164,7 +164,7 @@ QStringList ZoneFile_COD8_PC::pParseZoneTags(QDataStream *aZoneFileStream, quint
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD9_PC::pParseZoneTags(QDataStream *aZoneFileStream, quint
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD10_PS3::pParseZoneTags(QDataStream *aZoneFileStream, qui
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD11_PS3::pParseZoneTags(QDataStream *aZoneFileStream, qui
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD12_PS3::pParseZoneTags(QDataStream *aZoneFileStream, qui
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -28,12 +28,13 @@ bool ZoneFile_COD4_PS3::Load(const QByteArray aFileData) {
|
|||||||
|
|
||||||
void ZoneFile_COD4_PS3::pParseZoneHeader(QDataStream *aZoneFileStream) {
|
void ZoneFile_COD4_PS3::pParseZoneHeader(QDataStream *aZoneFileStream) {
|
||||||
SetSize(pParseZoneSize(aZoneFileStream));
|
SetSize(pParseZoneSize(aZoneFileStream));
|
||||||
pParseZoneUnknownsA(aZoneFileStream);
|
|
||||||
|
aZoneFileStream->skipRawData(32);
|
||||||
|
|
||||||
SetTagCount(pParseZoneTagCount(aZoneFileStream));
|
SetTagCount(pParseZoneTagCount(aZoneFileStream));
|
||||||
pParseZoneUnknownsB(aZoneFileStream);
|
pParseZoneUnknownsB(aZoneFileStream);
|
||||||
|
|
||||||
SetRecordCount(pParseZoneRecordCount(aZoneFileStream));
|
SetRecordCount(pParseZoneRecordCount(aZoneFileStream) - 1);
|
||||||
|
|
||||||
quint32 tagCount = GetTagCount();
|
quint32 tagCount = GetTagCount();
|
||||||
if (tagCount) {
|
if (tagCount) {
|
||||||
@ -152,13 +153,13 @@ QStringList ZoneFile_COD4_PS3::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
// Parse tags/strings before index
|
// Parse tags/strings before index
|
||||||
QString zoneTag;
|
QString zoneTag;
|
||||||
char zoneTagChar;
|
char zoneTagChar;
|
||||||
for (quint32 i = 0; i < tagCount; i++) {
|
for (quint32 i = 0; i <= tagCount; i++) {
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
while (zoneTagChar != 0) {
|
while (zoneTagChar != 0) {
|
||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
@ -591,6 +592,9 @@ Image ZoneFile_COD4_PS3::pParseAsset_Image(QDataStream *aZoneFileStream) {
|
|||||||
SoundAsset ZoneFile_COD4_PS3::pParseAsset_Sound(QDataStream *aZoneFileStream) {
|
SoundAsset ZoneFile_COD4_PS3::pParseAsset_Sound(QDataStream *aZoneFileStream) {
|
||||||
SoundAsset result;
|
SoundAsset result;
|
||||||
|
|
||||||
|
// TODO Reimplement proper sound parsing
|
||||||
|
return result;
|
||||||
|
|
||||||
qDebug() << aZoneFileStream->device()->pos();
|
qDebug() << aZoneFileStream->device()->pos();
|
||||||
|
|
||||||
QByteArray rootNamePtr(4, Qt::Uninitialized);
|
QByteArray rootNamePtr(4, Qt::Uninitialized);
|
||||||
@ -1088,46 +1092,28 @@ StringTable ZoneFile_COD4_PS3::pParseAsset_StringTable(QDataStream *aZoneFileStr
|
|||||||
|
|
||||||
AssetType ZoneFile_COD4_PS3::AssetStrToEnum(const QString aAssetType) {
|
AssetType ZoneFile_COD4_PS3::AssetStrToEnum(const QString aAssetType) {
|
||||||
const QString cleanedType = aAssetType.toUpper();
|
const QString cleanedType = aAssetType.toUpper();
|
||||||
if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED
|
if (cleanedType == "00000003") {
|
||||||
return ASSET_RAW_FILE;
|
|
||||||
} else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED
|
|
||||||
return ASSET_SCRIPT_PARSE_TREE;
|
|
||||||
} else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED
|
|
||||||
return ASSET_EFFECT;
|
|
||||||
} else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED
|
|
||||||
return ASSET_SOUND;
|
|
||||||
} else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED
|
|
||||||
return ASSET_ANIMATION;
|
|
||||||
} else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED
|
|
||||||
return ASSET_COLLISION_MAP;
|
|
||||||
} else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED
|
|
||||||
return ASSET_STRING_TABLE;
|
|
||||||
} else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED
|
|
||||||
return ASSET_MENU;
|
|
||||||
} else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED
|
|
||||||
return ASSET_TECH_SET;
|
|
||||||
} else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED
|
|
||||||
return ASSET_WEAPON;
|
|
||||||
} else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED
|
|
||||||
return ASSET_GFX_MAP;
|
|
||||||
} else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED
|
|
||||||
return ASSET_LIGHT_DEF;
|
|
||||||
} else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED
|
|
||||||
return ASSET_FONT;
|
|
||||||
} else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED
|
|
||||||
return ASSET_MODEL;
|
return ASSET_MODEL;
|
||||||
} else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED
|
} else if (cleanedType == "00000002") {
|
||||||
return ASSET_D3DBSP;
|
return ASSET_ANIMATION;
|
||||||
} else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED
|
} else if (cleanedType == "00000007") {
|
||||||
return ASSET_IMAGE;
|
return ASSET_MATERIAL;
|
||||||
} else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED
|
} else if (cleanedType == "00000009") {
|
||||||
return ASSET_GAME_MAP_SP;
|
return ASSET_TECH_SET;
|
||||||
} else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED
|
} else if (cleanedType == "0000000C") {
|
||||||
return ASSET_COL_MAP_SP;
|
return ASSET_COL_MAP_SP;
|
||||||
} else if (cleanedType == "01000000") { // physics preset PARTIALLY VERIFIED
|
} else if (cleanedType == "0000000E") {
|
||||||
return ASSET_PHYS_PRESET;
|
return ASSET_D3DBSP;
|
||||||
} else if (cleanedType == "03000000") { // destructible def PARTIALLY VERIFIED
|
} else if (cleanedType == "0000000F") {
|
||||||
return ASSET_DESTRUCTIBLE;
|
return ASSET_GAME_MAP_SP;
|
||||||
|
} else if (cleanedType == "00000012") {
|
||||||
|
return ASSET_GFX_MAP;
|
||||||
|
} else if (cleanedType == "00000019") {
|
||||||
|
return ASSET_WEAPON;
|
||||||
|
} else if (cleanedType == "0000001B") {
|
||||||
|
return ASSET_EFFECT;
|
||||||
|
} else if (cleanedType == "00000018") {
|
||||||
|
return ASSET_SOUND;
|
||||||
}
|
}
|
||||||
return ASSET_NONE;
|
return ASSET_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -158,7 +158,7 @@ QStringList ZoneFile_COD5_PS3::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -158,7 +158,7 @@ QStringList ZoneFile_COD6_PS3::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -164,7 +164,7 @@ QStringList ZoneFile_COD7_PS3::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -164,7 +164,7 @@ QStringList ZoneFile_COD8_PS3::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD9_PS3::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -21,7 +21,6 @@ bool ZoneFile_COD4_Wii::Load(const QByteArray aFileData) {
|
|||||||
|
|
||||||
// Parse data from zone file header
|
// Parse data from zone file header
|
||||||
pParseZoneHeader(&zoneFileStream);
|
pParseZoneHeader(&zoneFileStream);
|
||||||
zoneFileStream.device()->seek(zoneFileStream.device()->pos() - 1);
|
|
||||||
SetRecords(pParseZoneIndex(&zoneFileStream, GetRecordCount()));
|
SetRecords(pParseZoneIndex(&zoneFileStream, GetRecordCount()));
|
||||||
SetAssetMap(pParseAssets(&zoneFileStream, GetRecords()));
|
SetAssetMap(pParseAssets(&zoneFileStream, GetRecords()));
|
||||||
|
|
||||||
@ -57,7 +56,7 @@ quint32 ZoneFile_COD4_Wii::pParseZoneSize(QDataStream *aZoneFileStream) {
|
|||||||
qDebug() << "Tried to open empty zone file!";
|
qDebug() << "Tried to open empty zone file!";
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
zoneFileSize += 36;
|
zoneFileSize += 40;
|
||||||
return zoneFileSize;
|
return zoneFileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,9 +163,10 @@ QStringList ZoneFile_COD4_Wii::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
|
*aZoneFileStream >> zoneTagChar;
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ QStringList ZoneFile_COD4_Wii::pParseZoneIndex(QDataStream *aZoneFileStream, qui
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Parse index & map found asset types
|
// Parse index & map found asset types
|
||||||
for (quint32 i = 0; i <= recordCount; i++) {
|
for (quint32 i = 0; i < recordCount; i++) {
|
||||||
// Skip record start
|
// Skip record start
|
||||||
QByteArray rawAssetType(4, Qt::Uninitialized);
|
QByteArray rawAssetType(4, Qt::Uninitialized);
|
||||||
aZoneFileStream->readRawData(rawAssetType.data(), 4);
|
aZoneFileStream->readRawData(rawAssetType.data(), 4);
|
||||||
|
|||||||
@ -164,7 +164,7 @@ QStringList ZoneFile_COD7_Wii::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -164,7 +164,7 @@ QStringList ZoneFile_COD8_Wii::pParseZoneTags(QDataStream *aZoneFileStream, quin
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD10_WiiU::pParseZoneTags(QDataStream *aZoneFileStream, qu
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -159,7 +159,7 @@ QStringList ZoneFile_COD9_WiiU::pParseZoneTags(QDataStream *aZoneFileStream, qui
|
|||||||
zoneTag += zoneTagChar;
|
zoneTag += zoneTagChar;
|
||||||
*aZoneFileStream >> zoneTagChar;
|
*aZoneFileStream >> zoneTagChar;
|
||||||
}
|
}
|
||||||
tags << zoneTag;
|
if (!zoneTag.isEmpty()) { tags << zoneTag; }
|
||||||
zoneTag.clear();
|
zoneTag.clear();
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@ -86,15 +86,24 @@ enum AssetType {
|
|||||||
ASSET_MODEL_MESH = 0x74,
|
ASSET_MODEL_MESH = 0x74,
|
||||||
ASSET_S_ANIM = 0x75,
|
ASSET_S_ANIM = 0x75,
|
||||||
ASSET_FONT_ICON = 0x76,
|
ASSET_FONT_ICON = 0x76,
|
||||||
ASSET_CG_MEDIA_TABLE = 0x77
|
ASSET_CG_MEDIA_TABLE = 0x77,
|
||||||
|
ASSET_SHOCK_FILE = 0x78,
|
||||||
|
ASSET_ZONE_FILE = 0x79,
|
||||||
|
ASSET_FAST_FILE = 0x80,
|
||||||
|
ASSET_SOUND_DRIVER_GLOBALS = 0x81
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LocalString {
|
struct Asset {
|
||||||
|
quint32 startPos;
|
||||||
|
quint32 endPos;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct LocalString : Asset {
|
||||||
QString string;
|
QString string;
|
||||||
QString alias;
|
QString alias;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RawFile {
|
struct RawFile : Asset {
|
||||||
quint32 length;
|
quint32 length;
|
||||||
QString path;
|
QString path;
|
||||||
QString contents;
|
QString contents;
|
||||||
@ -183,6 +192,8 @@ struct Model {
|
|||||||
quint32 physGeomsPtr;
|
quint32 physGeomsPtr;
|
||||||
|
|
||||||
QString modelName;
|
QString modelName;
|
||||||
|
|
||||||
|
QVector<quint32> unknowns;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Animation {
|
struct Animation {
|
||||||
@ -237,9 +248,21 @@ struct StringTable {
|
|||||||
struct Image {
|
struct Image {
|
||||||
QString name;
|
QString name;
|
||||||
QString materialName;
|
QString materialName;
|
||||||
|
IMAGE_COMPRESSION compression;
|
||||||
|
|
||||||
quint32 size1;
|
quint32 size1;
|
||||||
quint32 size2;
|
quint32 size2;
|
||||||
IMAGE_COMPRESSION compression;
|
|
||||||
|
quint32 unknown1;
|
||||||
|
quint32 unknown2;
|
||||||
|
quint32 unknown3;
|
||||||
|
quint32 unknown4;
|
||||||
|
quint32 unknown5;
|
||||||
|
quint32 unknown6;
|
||||||
|
quint32 unknown7;
|
||||||
|
quint32 unknown8;
|
||||||
|
quint32 unknown9;
|
||||||
|
|
||||||
quint32 unknowna;
|
quint32 unknowna;
|
||||||
quint32 unknownb;
|
quint32 unknownb;
|
||||||
quint32 unknownc;
|
quint32 unknownc;
|
||||||
@ -253,15 +276,9 @@ struct Image {
|
|||||||
quint32 unknownk;
|
quint32 unknownk;
|
||||||
quint32 unknownl;
|
quint32 unknownl;
|
||||||
quint32 unknownm;
|
quint32 unknownm;
|
||||||
quint32 unknown1;
|
|
||||||
quint32 unknown2;
|
int chunkCount;
|
||||||
quint32 unknown3;
|
QVector<quint32> unknowns;
|
||||||
quint32 unknown4;
|
|
||||||
quint32 unknown5;
|
|
||||||
quint32 unknown6;
|
|
||||||
quint32 unknown7;
|
|
||||||
quint32 unknown8;
|
|
||||||
quint32 unknown9;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Material {
|
struct Material {
|
||||||
|
|||||||
@ -47,199 +47,339 @@ ZoneFile &ZoneFile::operator=(const ZoneFile &other) {
|
|||||||
QString ZoneFile::AssetEnumToStr(const AssetType aAssetType)
|
QString ZoneFile::AssetEnumToStr(const AssetType aAssetType)
|
||||||
{
|
{
|
||||||
if (aAssetType == ASSET_LOCAL_STRING) {
|
if (aAssetType == ASSET_LOCAL_STRING) {
|
||||||
return "ASSET_LOCAL_STRING";
|
return "LOCAL_STRING";
|
||||||
} else if (aAssetType == ASSET_RAW_FILE) {
|
} else if (aAssetType == ASSET_RAW_FILE) {
|
||||||
return "ASSET_RAW_FILE";
|
return "RAW_FILE";
|
||||||
} else if (aAssetType == ASSET_SCRIPT_PARSE_TREE) {
|
} else if (aAssetType == ASSET_SCRIPT_PARSE_TREE) {
|
||||||
return "ASSET_GSC_FILE";
|
return "GSC_FILE";
|
||||||
} else if (aAssetType == ASSET_EFFECT) {
|
} else if (aAssetType == ASSET_EFFECT) {
|
||||||
return "ASSET_EFFECT";
|
return "EFFECT";
|
||||||
} else if (aAssetType == ASSET_SOUND) {
|
} else if (aAssetType == ASSET_SOUND) {
|
||||||
return "ASSET_SOUND";
|
return "SOUND";
|
||||||
} else if (aAssetType == ASSET_ANIMATION) {
|
} else if (aAssetType == ASSET_ANIMATION) {
|
||||||
return "ASSET_ANIMATION";
|
return "ANIMATION";
|
||||||
} else if (aAssetType == ASSET_COLLISION_MAP) {
|
} else if (aAssetType == ASSET_COLLISION_MAP) {
|
||||||
return "ASSET_COLLISION_MAP";
|
return "COLLISION_MAP";
|
||||||
} else if (aAssetType == ASSET_STRING_TABLE) {
|
} else if (aAssetType == ASSET_STRING_TABLE) {
|
||||||
return "ASSET_STRING_TABLE";
|
return "STRING_TABLE";
|
||||||
} else if (aAssetType == ASSET_MENU) {
|
} else if (aAssetType == ASSET_MENU) {
|
||||||
return "ASSET_MENU";
|
return "MENU";
|
||||||
} else if (aAssetType == ASSET_TECH_SET) {
|
} else if (aAssetType == ASSET_TECH_SET) {
|
||||||
return "ASSET_TECH_SET";
|
return "TECH_SET";
|
||||||
} else if (aAssetType == ASSET_WEAPON) {
|
} else if (aAssetType == ASSET_WEAPON) {
|
||||||
return "ASSET_WEAPON";
|
return "WEAPON";
|
||||||
} else if (aAssetType == ASSET_GFX_MAP) {
|
} else if (aAssetType == ASSET_GFX_MAP) {
|
||||||
return "ASSET_GFX_MAP";
|
return "GFX_MAP";
|
||||||
} else if (aAssetType == ASSET_LIGHT_DEF) {
|
} else if (aAssetType == ASSET_LIGHT_DEF) {
|
||||||
return "ASSET_LIGHT_DEF";
|
return "LIGHT_DEF";
|
||||||
} else if (aAssetType == ASSET_FONT) {
|
} else if (aAssetType == ASSET_FONT) {
|
||||||
return "ASSET_FONT";
|
return "FONT";
|
||||||
} else if (aAssetType == ASSET_MODEL) {
|
} else if (aAssetType == ASSET_MODEL) {
|
||||||
return "ASSET_MODEL";
|
return "MODEL";
|
||||||
} else if (aAssetType == ASSET_D3DBSP) {
|
} else if (aAssetType == ASSET_D3DBSP) {
|
||||||
return "ASSET_D3DBSP";
|
return "D3DBSP";
|
||||||
} else if (aAssetType == ASSET_IMAGE) {
|
} else if (aAssetType == ASSET_IMAGE) {
|
||||||
return "ASSET_IMAGE";
|
return "IMAGE";
|
||||||
} else if (aAssetType == ASSET_GAME_MAP_SP) {
|
} else if (aAssetType == ASSET_GAME_MAP_SP) {
|
||||||
return "ASSET_GAME_MAP_SP";
|
return "GAME_MAP_SP";
|
||||||
} else if (aAssetType == ASSET_COL_MAP_SP) {
|
} else if (aAssetType == ASSET_COL_MAP_SP) {
|
||||||
return "ASSET_COL_MAP_SP";
|
return "COL_MAP_SP";
|
||||||
} else if (aAssetType == ASSET_COL_MAP_SP) {
|
} else if (aAssetType == ASSET_COL_MAP_SP) {
|
||||||
return "ASSET_COL_MAP_SP";
|
return "COL_MAP_SP";
|
||||||
|
} else if (aAssetType == ASSET_UI_MAP) {
|
||||||
|
return "UI_MAP";
|
||||||
} else if (aAssetType == ASSET_DESTRUCTIBLE) {
|
} else if (aAssetType == ASSET_DESTRUCTIBLE) {
|
||||||
return "ASSET_DESTRUCTIBLE";
|
return "DESTRUCTIBLE";
|
||||||
} else if (aAssetType == ASSET_MATERIAL) {
|
} else if (aAssetType == ASSET_MATERIAL) {
|
||||||
return "ASSET_MATERIAL";
|
return "MATERIAL";
|
||||||
} else if (aAssetType == ASSET_PHYS_PRESET) {
|
} else if (aAssetType == ASSET_PHYS_PRESET) {
|
||||||
return "ASSET_PHYS_PRESET";
|
return "PHYS_PRESET";
|
||||||
} else if (aAssetType == ASSET_COMPUTE_SHADER_SET) {
|
} else if (aAssetType == ASSET_COMPUTE_SHADER_SET) {
|
||||||
return "ASSET_COMPUTE_SHADER_SET";
|
return "COMPUTE_SHADER_SET";
|
||||||
} else if (aAssetType == ASSET_STRUCTURED_TABLE) {
|
} else if (aAssetType == ASSET_STRUCTURED_TABLE) {
|
||||||
return "ASSET_STRUCTURED_TABLE";
|
return "STRUCTURED_TABLE";
|
||||||
} else if (aAssetType == ASSET_LEADERBOARD_DEF) {
|
} else if (aAssetType == ASSET_LEADERBOARD_DEF) {
|
||||||
return "ASSET_LEADERBOARD_DEF";
|
return "LEADERBOARD_DEF";
|
||||||
} else if (aAssetType == ASSET_DDL) {
|
} else if (aAssetType == ASSET_DDL) {
|
||||||
return "ASSET_DDL";
|
return "DDL";
|
||||||
} else if (aAssetType == ASSET_SCRIPT_PARSE_TREE) {
|
} else if (aAssetType == ASSET_SCRIPT_PARSE_TREE) {
|
||||||
return "ASSET_SCRIPT_PARSE_TREE";
|
return "SCRIPT_PARSE_TREE";
|
||||||
} else if (aAssetType == ASSET_KEY_VALUE_PAIRS) {
|
} else if (aAssetType == ASSET_KEY_VALUE_PAIRS) {
|
||||||
return "ASSET_KEY_VALUE_PAIRS";
|
return "KEY_VALUE_PAIRS";
|
||||||
} else if (aAssetType == ASSET_SCRIPT_BUNDLE) {
|
} else if (aAssetType == ASSET_SCRIPT_BUNDLE) {
|
||||||
return "ASSET_SCRIPT_BUNDLE";
|
return "SCRIPT_BUNDLE";
|
||||||
} else if (aAssetType == ASSET_SCRIPT_BUNDLE_LIST) {
|
} else if (aAssetType == ASSET_SCRIPT_BUNDLE_LIST) {
|
||||||
return "ASSET_SCRIPT_BUNDLE_LIST";
|
return "SCRIPT_BUNDLE_LIST";
|
||||||
} else if (aAssetType == ASSET_LIGHT_DEF) {
|
} else if (aAssetType == ASSET_LIGHT_DEF) {
|
||||||
return "ASSET_LIGHT_DEF";
|
return "LIGHT_DEF";
|
||||||
} else if (aAssetType == ASSET_BIT_FIELD) {
|
} else if (aAssetType == ASSET_BIT_FIELD) {
|
||||||
return "ASSET_BIT_FIELD";
|
return "BIT_FIELD";
|
||||||
} else if (aAssetType == ASSET_MAP_TABLE) {
|
} else if (aAssetType == ASSET_MAP_TABLE) {
|
||||||
return "ASSET_MAP_TABLE";
|
return "MAP_TABLE";
|
||||||
} else if (aAssetType == ASSET_MAP_TABLE_LOADING_IMAGES) {
|
} else if (aAssetType == ASSET_MAP_TABLE_LOADING_IMAGES) {
|
||||||
return "ASSET_MAP_TABLE_LOADING_IMAGES";
|
return "MAP_TABLE_LOADING_IMAGES";
|
||||||
} else if (aAssetType == ASSET_SURFACE_SOUND_DEF) {
|
} else if (aAssetType == ASSET_SURFACE_SOUND_DEF) {
|
||||||
return "ASSET_SURFACE_SOUND_DEF";
|
return "SURFACE_SOUND_DEF";
|
||||||
} else if (aAssetType == ASSET_SURFACE_FX_TABLE) {
|
} else if (aAssetType == ASSET_SURFACE_FX_TABLE) {
|
||||||
return "ASSET_SURFACE_FX_TABLE";
|
return "SURFACE_FX_TABLE";
|
||||||
} else if (aAssetType == ASSET_RUMBLE) {
|
} else if (aAssetType == ASSET_RUMBLE) {
|
||||||
return "ASSET_RUMBLE";
|
return "RUMBLE";
|
||||||
} else if (aAssetType == ASSET_AIM_TABLE) {
|
} else if (aAssetType == ASSET_AIM_TABLE) {
|
||||||
return "ASSET_AIM_TABLE";
|
return "AIM_TABLE";
|
||||||
} else if (aAssetType == ASSET_MEDAL) {
|
} else if (aAssetType == ASSET_MEDAL) {
|
||||||
return "ASSET_MEDAL";
|
return "MEDAL";
|
||||||
} else if (aAssetType == ASSET_MEDAL_TABLE) {
|
} else if (aAssetType == ASSET_MEDAL_TABLE) {
|
||||||
return "ASSET_MEDAL_TABLE";
|
return "MEDAL_TABLE";
|
||||||
} else if (aAssetType == ASSET_OBJECTIVE) {
|
} else if (aAssetType == ASSET_OBJECTIVE) {
|
||||||
return "ASSET_OBJECTIVE";
|
return "OBJECTIVE";
|
||||||
} else if (aAssetType == ASSET_OBJECTIVE_LIST) {
|
} else if (aAssetType == ASSET_OBJECTIVE_LIST) {
|
||||||
return "ASSET_OBJECTIVE_LIST";
|
return "OBJECTIVE_LIST";
|
||||||
} else if (aAssetType == ASSET_LASER) {
|
} else if (aAssetType == ASSET_LASER) {
|
||||||
return "ASSET_LASER";
|
return "LASER";
|
||||||
} else if (aAssetType == ASSET_BEAM) {
|
} else if (aAssetType == ASSET_BEAM) {
|
||||||
return "ASSET_BEAM";
|
return "BEAM";
|
||||||
} else if (aAssetType == ASSET_STREAMER_HINT) {
|
} else if (aAssetType == ASSET_STREAMER_HINT) {
|
||||||
return "ASSET_STREAMER_HINT";
|
return "STREAMER_HINT";
|
||||||
} else if (aAssetType == ASSET_ANIM_SELECTOR_TABLE) {
|
} else if (aAssetType == ASSET_ANIM_SELECTOR_TABLE) {
|
||||||
return "ASSET_ANIM_SELECTOR_TABLE";
|
return "ANIM_SELECTOR_TABLE";
|
||||||
} else if (aAssetType == ASSET_ANIM_MAPPING_TABLE) {
|
} else if (aAssetType == ASSET_ANIM_MAPPING_TABLE) {
|
||||||
return "ASSET_ANIM_MAPPING_TABLE";
|
return "ANIM_MAPPING_TABLE";
|
||||||
} else if (aAssetType == ASSET_ANIM_STATE_MACHINE) {
|
} else if (aAssetType == ASSET_ANIM_STATE_MACHINE) {
|
||||||
return "ASSET_ANIM_STATE_MACHINE";
|
return "ANIM_STATE_MACHINE";
|
||||||
} else if (aAssetType == ASSET_BEHAVIOR_TREE) {
|
} else if (aAssetType == ASSET_BEHAVIOR_TREE) {
|
||||||
return "ASSET_BEHAVIOR_TREE";
|
return "BEHAVIOR_TREE";
|
||||||
} else if (aAssetType == ASSET_BEHAVIOR_STATE_MACHINE) {
|
} else if (aAssetType == ASSET_BEHAVIOR_STATE_MACHINE) {
|
||||||
return "ASSET_BEHAVIOR_STATE_MACHINE";
|
return "BEHAVIOR_STATE_MACHINE";
|
||||||
} else if (aAssetType == ASSET_FOOTSTEP_TABLE) {
|
} else if (aAssetType == ASSET_FOOTSTEP_TABLE) {
|
||||||
return "ASSET_FOOTSTEP_TABLE";
|
return "FOOTSTEP_TABLE";
|
||||||
} else if (aAssetType == ASSET_ENTITY_FX_IMPACTS) {
|
} else if (aAssetType == ASSET_ENTITY_FX_IMPACTS) {
|
||||||
return "ASSET_ENTITY_FX_IMPACTS";
|
return "ENTITY_FX_IMPACTS";
|
||||||
} else if (aAssetType == ASSET_ENTITY_SOUND_IMPACTS) {
|
} else if (aAssetType == ASSET_ENTITY_SOUND_IMPACTS) {
|
||||||
return "ASSET_ENTITY_SOUND_IMPACTS";
|
return "ENTITY_SOUND_IMPACTS";
|
||||||
} else if (aAssetType == ASSET_VEHICLE_FX_DEF) {
|
} else if (aAssetType == ASSET_VEHICLE_FX_DEF) {
|
||||||
return "ASSET_VEHICLE_FX_DEF";
|
return "VEHICLE_FX_DEF";
|
||||||
} else if (aAssetType == ASSET_VEHICLE_SOUND_DEF) {
|
} else if (aAssetType == ASSET_VEHICLE_SOUND_DEF) {
|
||||||
return "ASSET_VEHICLE_SOUND_DEF";
|
return "VEHICLE_SOUND_DEF";
|
||||||
} else if (aAssetType == ASSET_VEHICLE) {
|
} else if (aAssetType == ASSET_VEHICLE) {
|
||||||
return "ASSET_VEHICLE";
|
return "VEHICLE";
|
||||||
} else if (aAssetType == ASSET_VEHICLE_TRACER) {
|
} else if (aAssetType == ASSET_VEHICLE_TRACER) {
|
||||||
return "ASSET_VEHICLE_TRACER";
|
return "VEHICLE_TRACER";
|
||||||
} else if (aAssetType == ASSET_PLAYER_SOUNDS_TABLE) {
|
} else if (aAssetType == ASSET_PLAYER_SOUNDS_TABLE) {
|
||||||
return "ASSET_PLAYER_SOUNDS_TABLE";
|
return "PLAYER_SOUNDS_TABLE";
|
||||||
} else if (aAssetType == ASSET_PLAYER_FX_TABLE) {
|
} else if (aAssetType == ASSET_PLAYER_FX_TABLE) {
|
||||||
return "ASSET_PLAYER_FX_TABLE";
|
return "PLAYER_FX_TABLE";
|
||||||
} else if (aAssetType == ASSET_SHARED_WEAPON_SOUNDS) {
|
} else if (aAssetType == ASSET_SHARED_WEAPON_SOUNDS) {
|
||||||
return "ASSET_SHARED_WEAPON_SOUNDS";
|
return "SHARED_WEAPON_SOUNDS";
|
||||||
} else if (aAssetType == ASSET_ATTACHMENT) {
|
} else if (aAssetType == ASSET_ATTACHMENT) {
|
||||||
return "ASSET_ATTACHMENT";
|
return "ATTACHMENT";
|
||||||
} else if (aAssetType == ASSET_ATTACHMENT_UNIQUE) {
|
} else if (aAssetType == ASSET_ATTACHMENT_UNIQUE) {
|
||||||
return "ASSET_ATTACHMENT_UNIQUE";
|
return "ATTACHMENT_UNIQUE";
|
||||||
} else if (aAssetType == ASSET_WEAPON_CAMO) {
|
} else if (aAssetType == ASSET_WEAPON_CAMO) {
|
||||||
return "ASSET_WEAPON_CAMO";
|
return "WEAPON_CAMO";
|
||||||
} else if (aAssetType == ASSET_CUSTOMIZATION_TABLE) {
|
} else if (aAssetType == ASSET_CUSTOMIZATION_TABLE) {
|
||||||
return "ASSET_CUSTOMIZATION_TABLE";
|
return "CUSTOMIZATION_TABLE";
|
||||||
} else if (aAssetType == ASSET_CUSTOMIZATION_TABLE_FEIMAGES) {
|
} else if (aAssetType == ASSET_CUSTOMIZATION_TABLE_FEIMAGES) {
|
||||||
return "ASSET_CUSTOMIZATION_TABLE_FEIMAGES";
|
return "CUSTOMIZATION_TABLE_FEIMAGES";
|
||||||
} else if (aAssetType == ASSET_CUSTOMIZATION_TABLE_COLOR) {
|
} else if (aAssetType == ASSET_CUSTOMIZATION_TABLE_COLOR) {
|
||||||
return "ASSET_CUSTOMIZATION_TABLE_COLOR";
|
return "CUSTOMIZATION_TABLE_COLOR";
|
||||||
} else if (aAssetType == ASSET_PHYS_CONSTRAINTS) {
|
} else if (aAssetType == ASSET_PHYS_CONSTRAINTS) {
|
||||||
return "ASSET_PHYS_CONSTRAINTS";
|
return "PHYS_CONSTRAINTS";
|
||||||
} else if (aAssetType == ASSET_DESTRUCTIBLE_DEF) {
|
} else if (aAssetType == ASSET_DESTRUCTIBLE_DEF) {
|
||||||
return "ASSET_DESTRUCTIBLE_DEF";
|
return "DESTRUCTIBLE_DEF";
|
||||||
} else if (aAssetType == ASSET_MODEL_MESH) {
|
} else if (aAssetType == ASSET_MODEL_MESH) {
|
||||||
return "ASSET_MODEL_MESH";
|
return "MODEL_MESH";
|
||||||
} else if (aAssetType == ASSET_S_ANIM) {
|
} else if (aAssetType == ASSET_S_ANIM) {
|
||||||
return "ASSET_S_ANIM";
|
return "S_ANIM";
|
||||||
} else if (aAssetType == ASSET_SOUND) {
|
} else if (aAssetType == ASSET_SOUND) {
|
||||||
return "ASSET_SOUND";
|
return "SOUND";
|
||||||
} else if (aAssetType == ASSET_FONT_ICON) {
|
} else if (aAssetType == ASSET_FONT_ICON) {
|
||||||
return "ASSET_FONT_ICON";
|
return "FONT_ICON";
|
||||||
|
} else if (aAssetType == ASSET_SHOCK_FILE) {
|
||||||
|
return "SHOCK_FILE";
|
||||||
|
} else if (aAssetType == ASSET_FAST_FILE) {
|
||||||
|
return "FAST_FILE";
|
||||||
|
} else if (aAssetType == ASSET_ZONE_FILE) {
|
||||||
|
return "ZONE_FILE";
|
||||||
|
} else if (aAssetType == ASSET_SOUND_DRIVER_GLOBALS) {
|
||||||
|
return "SOUND_DRIVER_GLOBALS";
|
||||||
}
|
}
|
||||||
return "ASSET_UNKNOWN";
|
return "UNKNOWN";
|
||||||
}
|
}
|
||||||
QIcon ZoneFile::AssetTypeToIcon(const AssetType aAssetType) {
|
QIcon ZoneFile::AssetTypeToIcon(const AssetType aAssetType) {
|
||||||
if (aAssetType == ASSET_LOCAL_STRING) { // localized string PARTIALLY VERIFIED
|
QString assetCode;
|
||||||
return QIcon(":/icons/icons/Icon_StringFile.png");
|
const QStringList parts = AssetEnumToStr(aAssetType).split('_');
|
||||||
} else if (aAssetType == ASSET_RAW_FILE) { // raw_file PARTIALLY VERIFIED
|
foreach (const QString part, parts) {
|
||||||
return QIcon(":/icons/icons/Icon_RawFile.png");
|
assetCode.append(part[0]);
|
||||||
} else if (aAssetType == ASSET_SCRIPT_PARSE_TREE) { // raw_file PARTIALLY VERIFIED
|
}
|
||||||
return QIcon(":/icons/icons/Icon_GSCFile.png");
|
if (parts.size() == 1) {
|
||||||
} else if (aAssetType == ASSET_EFFECT) { // fx PARTIALLY VERIFIED
|
assetCode.append(parts[0][1]);
|
||||||
return QIcon(":/icons/icons/Icon_Effect.png");
|
}
|
||||||
} else if (aAssetType == ASSET_SOUND) { // loaded_sound PARTIALLY VERIFIED
|
return Utils::CreateAssetIcon(assetCode);
|
||||||
return QIcon(":/icons/icons/Icon_Sound.png");
|
|
||||||
} else if (aAssetType == ASSET_ANIMATION) { // x_anim PARTIALLY VERIFIED
|
if (aAssetType == ASSET_NONE) {
|
||||||
return QIcon(":/icons/icons/Icon_Animation.png");
|
return Utils::CreateAssetIcon("NO");
|
||||||
} else if (aAssetType == ASSET_COLLISION_MAP) { // collision_map PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_RAW_FILE) {
|
||||||
//return ASSET_COLLISION_MAP;
|
return Utils::CreateAssetIcon("RAW");
|
||||||
} else if (aAssetType == ASSET_STRING_TABLE) { // string_table PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_SCRIPT_PARSE_TREE) {
|
||||||
return QIcon(":/icons/icons/Icon_StringTable.png");
|
return Utils::CreateAssetIcon("PT");
|
||||||
} else if (aAssetType == ASSET_MENU) { // menu_file PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_EFFECT) {
|
||||||
return QIcon(":/icons/icons/Icon_MenuFile.png");
|
return Utils::CreateAssetIcon("EF");
|
||||||
} else if (aAssetType == ASSET_TECH_SET) { // tech set PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_SOUND) {
|
||||||
return QIcon(":/icons/icons/Icon_TechSetFile.png");
|
return Utils::CreateAssetIcon("SN");
|
||||||
} else if (aAssetType == ASSET_WEAPON) { // weapon PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_ANIMATION) {
|
||||||
return QIcon(":/icons/icons/Icon_Weapon.png");
|
return Utils::CreateAssetIcon("AN");
|
||||||
} else if (aAssetType == ASSET_GFX_MAP) { // gfx map PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_COLLISION_MAP) {
|
||||||
return QIcon(":/icons/icons/Icon_FXMap.png");
|
return Utils::CreateAssetIcon("CM");
|
||||||
} else if (aAssetType == ASSET_LIGHT_DEF) { // light_def PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_STRING_TABLE) {
|
||||||
return QIcon(":/icons/icons/Icon_LightDef.png");
|
return Utils::CreateAssetIcon("ST");
|
||||||
} else if (aAssetType == ASSET_FONT) { // font PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_MENU) {
|
||||||
return QIcon(":/icons/icons/Icon_Font.png");
|
return Utils::CreateAssetIcon("MN");
|
||||||
} else if (aAssetType == ASSET_MODEL) { // xmodel PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_TECH_SET) {
|
||||||
return QIcon(":/icons/icons/Icon_Model.png");
|
return Utils::CreateAssetIcon("TS");
|
||||||
} else if (aAssetType == ASSET_MATERIAL) { // xmodel PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_WEAPON) {
|
||||||
return QIcon(":/icons/icons/Icon_Material.png");
|
return Utils::CreateAssetIcon("WP");
|
||||||
} else if (aAssetType == ASSET_D3DBSP) { // d3dbsp PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_GFX_MAP) {
|
||||||
return QIcon(":/icons/icons/Icon_BSP.png");
|
return Utils::CreateAssetIcon("GFM");
|
||||||
} else if (aAssetType == ASSET_IMAGE) { // image PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_LIGHT_DEF) {
|
||||||
return QIcon(":/icons/icons/Icon_Image.png");
|
return Utils::CreateAssetIcon("LDF");
|
||||||
} else if (aAssetType == ASSET_GAME_MAP_SP) { // game map sp PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_FONT) {
|
||||||
return QIcon(":/icons/icons/Icon_GameMapSp.png");
|
return Utils::CreateAssetIcon("FN");
|
||||||
} else if (aAssetType == ASSET_COL_MAP_SP) { // col map sp PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_MODEL) {
|
||||||
return QIcon(":/icons/icons/Icon_ColMapSp.png");
|
return Utils::CreateAssetIcon("MD");
|
||||||
} else if (aAssetType == ASSET_PHYS_PRESET) { // col map sp PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_D3DBSP) {
|
||||||
return QIcon(":/icons/icons/Icon_PhysPreset.png");
|
return Utils::CreateAssetIcon("BSP");
|
||||||
} else if (aAssetType == ASSET_DESTRUCTIBLE) { // col map sp PARTIALLY VERIFIED
|
} else if (aAssetType == ASSET_IMAGE) {
|
||||||
return QIcon(":/icons/icons/Icon_Destructible.png");
|
return Utils::CreateAssetIcon("IM");
|
||||||
|
} else if (aAssetType == ASSET_GAME_MAP_SP) {
|
||||||
|
return Utils::CreateAssetIcon("GMS");
|
||||||
|
} else if (aAssetType == ASSET_COL_MAP_SP) {
|
||||||
|
return Utils::CreateAssetIcon("CMS");
|
||||||
|
} else if (aAssetType == ASSET_PHYS_PRESET) {
|
||||||
|
return Utils::CreateAssetIcon("PP");
|
||||||
|
} else if (aAssetType == ASSET_DESTRUCTIBLE) {
|
||||||
|
return Utils::CreateAssetIcon("DE");
|
||||||
|
} else if (aAssetType == ASSET_LOCAL_STRING) {
|
||||||
|
return Utils::CreateAssetIcon("LS");
|
||||||
|
} else if (aAssetType == ASSET_SHADER) {
|
||||||
|
return Utils::CreateAssetIcon("SH");
|
||||||
|
} else if (aAssetType == ASSET_MP_MAP) {
|
||||||
|
return Utils::CreateAssetIcon("MM");
|
||||||
|
} else if (aAssetType == ASSET_SP_MAP) {
|
||||||
|
return Utils::CreateAssetIcon("SM");
|
||||||
|
} else if (aAssetType == ASSET_UI_MAP) {
|
||||||
|
return Utils::CreateAssetIcon("UM");
|
||||||
|
} else if (aAssetType == ASSET_SND_DRIVER_GLOBALS) {
|
||||||
|
return Utils::CreateAssetIcon("DG");
|
||||||
|
} else if (aAssetType == ASSET_AI_TYPE) {
|
||||||
|
return Utils::CreateAssetIcon("AT");
|
||||||
|
} else if (aAssetType == ASSET_MATERIAL) {
|
||||||
|
return Utils::CreateAssetIcon("MT");
|
||||||
|
} else if (aAssetType == ASSET_COMPUTE_SHADER_SET) {
|
||||||
|
return Utils::CreateAssetIcon("CSH");
|
||||||
|
} else if (aAssetType == ASSET_LIGHT_DESCRIPTION) {
|
||||||
|
return Utils::CreateAssetIcon("LDS");
|
||||||
|
} else if (aAssetType == ASSET_BIT_FIELD) {
|
||||||
|
return Utils::CreateAssetIcon("BF");
|
||||||
|
} else if (aAssetType == ASSET_STRUCTURED_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("SDT");
|
||||||
|
} else if (aAssetType == ASSET_LEADERBOARD_DEF) {
|
||||||
|
return Utils::CreateAssetIcon("LBD");
|
||||||
|
} else if (aAssetType == ASSET_DDL) {
|
||||||
|
return Utils::CreateAssetIcon("DDL");
|
||||||
|
} else if (aAssetType == ASSET_KEY_VALUE_PAIRS) {
|
||||||
|
return Utils::CreateAssetIcon("KV");
|
||||||
|
} else if (aAssetType == ASSET_SCRIPT_BUNDLE) {
|
||||||
|
return Utils::CreateAssetIcon("SB");
|
||||||
|
} else if (aAssetType == ASSET_SCRIPT_BUNDLE_LIST) {
|
||||||
|
return Utils::CreateAssetIcon("SBL");
|
||||||
|
} else if (aAssetType == ASSET_MAP_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("MT");
|
||||||
|
} else if (aAssetType == ASSET_MAP_TABLE_LOADING_IMAGES) {
|
||||||
|
return Utils::CreateAssetIcon("LI");
|
||||||
|
} else if (aAssetType == ASSET_SURFACE_SOUND_DEF) {
|
||||||
|
return Utils::CreateAssetIcon("SSD");
|
||||||
|
} else if (aAssetType == ASSET_SURFACE_FX_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("FT");
|
||||||
|
} else if (aAssetType == ASSET_RUMBLE) {
|
||||||
|
return Utils::CreateAssetIcon("RM");
|
||||||
|
} else if (aAssetType == ASSET_AIM_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("AMT");
|
||||||
|
} else if (aAssetType == ASSET_MEDAL) {
|
||||||
|
return Utils::CreateAssetIcon("ME");
|
||||||
|
} else if (aAssetType == ASSET_MEDAL_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("MET");
|
||||||
|
} else if (aAssetType == ASSET_OBJECTIVE) {
|
||||||
|
return Utils::CreateAssetIcon("OB");
|
||||||
|
} else if (aAssetType == ASSET_OBJECTIVE_LIST) {
|
||||||
|
return Utils::CreateAssetIcon("OBL");
|
||||||
|
} else if (aAssetType == ASSET_LASER) {
|
||||||
|
return Utils::CreateAssetIcon("LS");
|
||||||
|
} else if (aAssetType == ASSET_BEAM) {
|
||||||
|
return Utils::CreateAssetIcon("BM");
|
||||||
|
} else if (aAssetType == ASSET_STREAMER_HINT) {
|
||||||
|
return Utils::CreateAssetIcon("SH");
|
||||||
|
} else if (aAssetType == ASSET_ANIM_SELECTOR_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("AST");
|
||||||
|
} else if (aAssetType == ASSET_ANIM_MAPPING_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("AMP");
|
||||||
|
} else if (aAssetType == ASSET_ANIM_STATE_MACHINE) {
|
||||||
|
return Utils::CreateAssetIcon("ASM");
|
||||||
|
} else if (aAssetType == ASSET_BEHAVIOR_TREE) {
|
||||||
|
return Utils::CreateAssetIcon("BT");
|
||||||
|
} else if (aAssetType == ASSET_BEHAVIOR_STATE_MACHINE) {
|
||||||
|
return Utils::CreateAssetIcon("BSM");
|
||||||
|
} else if (aAssetType == ASSET_FOOTSTEP_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("FT");
|
||||||
|
} else if (aAssetType == ASSET_ENTITY_FX_IMPACTS) {
|
||||||
|
return Utils::CreateAssetIcon("FI");
|
||||||
|
} else if (aAssetType == ASSET_ENTITY_SOUND_IMPACTS) {
|
||||||
|
return Utils::CreateAssetIcon("SI");
|
||||||
|
} else if (aAssetType == ASSET_VEHICLE_FX_DEF) {
|
||||||
|
return Utils::CreateAssetIcon("FD");
|
||||||
|
} else if (aAssetType == ASSET_VEHICLE_SOUND_DEF) {
|
||||||
|
return Utils::CreateAssetIcon("SDD");
|
||||||
|
} else if (aAssetType == ASSET_VEHICLE) {
|
||||||
|
return Utils::CreateAssetIcon("VE");
|
||||||
|
} else if (aAssetType == ASSET_VEHICLE_TRACER) {
|
||||||
|
return Utils::CreateAssetIcon("VT");
|
||||||
|
} else if (aAssetType == ASSET_PLAYER_SOUNDS_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("SDT");
|
||||||
|
} else if (aAssetType == ASSET_PLAYER_FX_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("FXT");
|
||||||
|
} else if (aAssetType == ASSET_SHARED_WEAPON_SOUNDS) {
|
||||||
|
return Utils::CreateAssetIcon("SWS");
|
||||||
|
} else if (aAssetType == ASSET_ATTACHMENT) {
|
||||||
|
return Utils::CreateAssetIcon("AT");
|
||||||
|
} else if (aAssetType == ASSET_ATTACHMENT_UNIQUE) {
|
||||||
|
return Utils::CreateAssetIcon("AU");
|
||||||
|
} else if (aAssetType == ASSET_WEAPON_CAMO) {
|
||||||
|
return Utils::CreateAssetIcon("WPC");
|
||||||
|
} else if (aAssetType == ASSET_CUSTOMIZATION_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("CT");
|
||||||
|
} else if (aAssetType == ASSET_CUSTOMIZATION_TABLE_FEIMAGES) {
|
||||||
|
return Utils::CreateAssetIcon("CI");
|
||||||
|
} else if (aAssetType == ASSET_CUSTOMIZATION_TABLE_COLOR) {
|
||||||
|
return Utils::CreateAssetIcon("CC");
|
||||||
|
} else if (aAssetType == ASSET_PHYS_CONSTRAINTS) {
|
||||||
|
return Utils::CreateAssetIcon("PC");
|
||||||
|
} else if (aAssetType == ASSET_DESTRUCTIBLE_DEF) {
|
||||||
|
return Utils::CreateAssetIcon("DD");
|
||||||
|
} else if (aAssetType == ASSET_MODEL_MESH) {
|
||||||
|
return Utils::CreateAssetIcon("MM");
|
||||||
|
} else if (aAssetType == ASSET_S_ANIM) {
|
||||||
|
return Utils::CreateAssetIcon("SA");
|
||||||
|
} else if (aAssetType == ASSET_FONT_ICON) {
|
||||||
|
return Utils::CreateAssetIcon("FI");
|
||||||
|
} else if (aAssetType == ASSET_CG_MEDIA_TABLE) {
|
||||||
|
return Utils::CreateAssetIcon("MT");
|
||||||
|
} else if (aAssetType == ASSET_SHOCK_FILE) {
|
||||||
|
return Utils::CreateAssetIcon("SF");
|
||||||
|
} else if (aAssetType == ASSET_FAST_FILE) {
|
||||||
|
return Utils::CreateAssetIcon("FF");
|
||||||
|
} else if (aAssetType == ASSET_ZONE_FILE) {
|
||||||
|
return Utils::CreateAssetIcon("ZF");
|
||||||
|
} else if (aAssetType == ASSET_SOUND_DRIVER_GLOBALS) {
|
||||||
|
return Utils::CreateAssetIcon("SDG");
|
||||||
}
|
}
|
||||||
return QIcon();
|
return QIcon();
|
||||||
}
|
}
|
||||||
@ -259,6 +399,10 @@ QString ZoneFile::GetStem() {
|
|||||||
return mStem;
|
return mStem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ZoneFile::GetBaseStem() {
|
||||||
|
return mStem.split('.').first();
|
||||||
|
}
|
||||||
|
|
||||||
quint32 ZoneFile::GetSize() {
|
quint32 ZoneFile::GetSize() {
|
||||||
return mSize;
|
return mSize;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,13 +16,14 @@ public:
|
|||||||
|
|
||||||
virtual bool Load(const QByteArray aFileData) = 0;
|
virtual bool Load(const QByteArray aFileData) = 0;
|
||||||
virtual AssetType AssetStrToEnum(const QString aAssetType) = 0;
|
virtual AssetType AssetStrToEnum(const QString aAssetType) = 0;
|
||||||
virtual QString AssetEnumToStr(const AssetType aAssetType);
|
static QString AssetEnumToStr(const AssetType aAssetType);
|
||||||
virtual QIcon AssetTypeToIcon(const AssetType aAssetType);
|
static QIcon AssetTypeToIcon(const AssetType aAssetType);
|
||||||
|
|
||||||
virtual QByteArray GetBinaryData() = 0;
|
virtual QByteArray GetBinaryData() = 0;
|
||||||
virtual bool SaveZoneFile(const QString aZoneFilePath);
|
virtual bool SaveZoneFile(const QString aZoneFilePath);
|
||||||
|
|
||||||
QString GetStem();
|
QString GetStem();
|
||||||
|
QString GetBaseStem();
|
||||||
quint32 GetSize();
|
quint32 GetSize();
|
||||||
quint32 GetTagCount();
|
quint32 GetTagCount();
|
||||||
QStringList GetTags();
|
QStringList GetTags();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user