feature/test #9
@ -1,5 +1,5 @@
|
||||
#include "compression.h"
|
||||
#include "minilzo.h"
|
||||
//#include "minilzo.h"
|
||||
|
||||
#define XBOXAPI __declspec(dllimport)
|
||||
#include "xcompress.h"
|
||||
@ -295,22 +295,23 @@ QByteArray Compression::CompressDeflateWithSettings(const QByteArray &aData, int
|
||||
}
|
||||
|
||||
QByteArray Compression::DecompressLZO(const QByteArray &aCompressedData, quint32 aDestSize) {
|
||||
static bool ok = (lzo_init() == LZO_E_OK);
|
||||
if (!ok)
|
||||
throw std::runtime_error("lzo_init failed");
|
||||
QByteArray dst;
|
||||
// static bool ok = (lzo_init() == LZO_E_OK);
|
||||
// if (!ok)
|
||||
// throw std::runtime_error("lzo_init failed");
|
||||
|
||||
QByteArray dst(aDestSize, Qt::Uninitialized);
|
||||
lzo_uint out = aDestSize;
|
||||
// dst = QByteArray(aDestSize, Qt::Uninitialized);
|
||||
// lzo_uint out = aDestSize;
|
||||
|
||||
int rc = lzo1x_decompress_safe(
|
||||
reinterpret_cast<const lzo_bytep>(aCompressedData.constData()),
|
||||
static_cast<lzo_uint>(aCompressedData.size()),
|
||||
reinterpret_cast<lzo_bytep>(dst.data()),
|
||||
&out,
|
||||
nullptr);
|
||||
// int rc = lzo1x_decompress_safe(
|
||||
// reinterpret_cast<const lzo_bytep>(aCompressedData.constData()),
|
||||
// static_cast<lzo_uint>(aCompressedData.size()),
|
||||
// reinterpret_cast<lzo_bytep>(dst.data()),
|
||||
// &out,
|
||||
// nullptr);
|
||||
|
||||
if (rc != LZO_E_OK || out != aDestSize)
|
||||
throw std::runtime_error("LZO decompression error");
|
||||
// if (rc != LZO_E_OK || out != aDestSize)
|
||||
// throw std::runtime_error("LZO decompression error");
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
@ -5,4 +5,10 @@ CONFIG += staticlib c++17
|
||||
SOURCES += $$files($$PWD/*.cpp, true)
|
||||
HEADERS += $$files($$PWD/*.h, true)
|
||||
|
||||
LIBS += -L$$OUT_PWD/../libs/xassets -lxassets
|
||||
|
||||
INCLUDEPATH += $$PWD/../xassets
|
||||
|
||||
DEPENDPATH += $$PWD/../xassets
|
||||
|
||||
DESTDIR = $$OUT_PWD/../
|
||||
|
||||
@ -3,28 +3,6 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
enum FF_PLATFORM {
|
||||
FF_PLATFORM_NONE = 0x00, // No platform
|
||||
FF_PLATFORM_XBOX = 0x01, // Xbox 360
|
||||
FF_PLATFORM_PS3 = 0x02, // Playstation 3
|
||||
FF_PLATFORM_PC = 0x03, // PC
|
||||
FF_PLATFORM_WII = 0x04, // WII
|
||||
FF_PLATFORM_WIIU = 0x05 // WII U
|
||||
};
|
||||
|
||||
enum FF_GAME {
|
||||
FF_GAME_NONE = 0x00, // No game
|
||||
FF_GAME_COD1 = 0x01, // Call of Duty
|
||||
FF_GAME_COD2 = 0x02, // Call of Duty 2
|
||||
FF_GAME_COD3 = 0x03, // Call of Duty 3
|
||||
FF_GAME_COD4 = 0x04, // Modern Warware 1
|
||||
FF_GAME_COD5 = 0x05, // World at War
|
||||
FF_GAME_COD6 = 0x06, // Modern Warfare 2
|
||||
FF_GAME_COD7 = 0x07, // Black Ops 1
|
||||
FF_GAME_COD8 = 0x08, // Modern Warfare 3
|
||||
FF_GAME_COD9 = 0x09, // Black Ops 2
|
||||
};
|
||||
|
||||
enum IWI_VERSION {
|
||||
IWI_VERSION_COD2 = 0x05, // 05 CoD2
|
||||
IWI_VERSION_COD4 = 0x06, // 06 CoD4
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
#include "QtZlib/zlib.h"
|
||||
#include "qdir.h"
|
||||
#include "qicon.h"
|
||||
#include "xasset.h"
|
||||
#include "xassettype.h"
|
||||
|
||||
#include <QMetaEnum>
|
||||
#include <QPainter>
|
||||
@ -12,158 +14,8 @@
|
||||
|
||||
class Utils : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum AssetType {
|
||||
ASSET_NONE = 0x00,
|
||||
ASSET_RAWFILE = 0x01,
|
||||
ASSET_SCRIPT_PARSE_TREE = 0x02,
|
||||
ASSET_FX = 0x03,
|
||||
ASSET_SOUND_CURVE = 0x04,
|
||||
ASSET_Animation = 0x05,
|
||||
ASSET_COLLISION_MAP = 0x06,
|
||||
ASSET_STRINGTABLE = 0x07,
|
||||
ASSET_XMODEL_SURFS = 0x08,
|
||||
ASSET_TECHNIQUE_SET = 0x09,
|
||||
ASSET_GFX_MAP = 0x11,
|
||||
ASSET_D3DBSP = 0x15,
|
||||
ASSET_GAME_MAP_SP = 0x17,
|
||||
ASSET_COL_MAP_SP = 0x18,
|
||||
ASSET_PHYSPRESET = 0x19,
|
||||
ASSET_DESTRUCTIBLE = 0x20,
|
||||
ASSET_LOCALIZE_ENTRY = 0x21,
|
||||
ASSET_SHADER = 0x22,
|
||||
ASSET_MP_MAP = 0x23,
|
||||
ASSET_SP_MAP = 0x24,
|
||||
ASSET_SNDDRIVER_GLOBALS = 0x26,
|
||||
ASSET_AI_TYPE = 0x27,
|
||||
ASSET_COMPUTE_SHADER_SET = 0x29,
|
||||
ASSET_LIGHT_DESCRIPTION = 0x30,
|
||||
ASSET_BIT_FIELD = 0x31,
|
||||
ASSET_STRUCTURED_TABLE = 0x32,
|
||||
ASSET_LEADERBOARD_DEF = 0x33,
|
||||
ASSET_DDL = 0x34,
|
||||
ASSET_KEY_VALUE_PAIRS = 0x35,
|
||||
ASSET_SCRIPT_BUNDLE = 0x36,
|
||||
ASSET_SCRIPT_BUNDLE_LIST = 0x37,
|
||||
ASSET_MAP_TABLE = 0x38,
|
||||
ASSET_MAP_TABLE_LOADING_IMAGES = 0x39,
|
||||
ASSET_SURFACE_SOUND_DEF = 0x40,
|
||||
ASSET_SURFACE_FX_TABLE = 0x41,
|
||||
ASSET_RUMBLE = 0x42,
|
||||
ASSET_AIM_TABLE = 0x43,
|
||||
ASSET_MEDAL = 0x44,
|
||||
ASSET_MEDAL_TABLE = 0x45,
|
||||
ASSET_OBJECTIVE = 0x46,
|
||||
ASSET_OBJECTIVE_LIST = 0x47,
|
||||
ASSET_LASER = 0x48,
|
||||
ASSET_BEAM = 0x49,
|
||||
ASSET_STREAMER_HINT = 0x50,
|
||||
ASSET_ANIM_SELECTOR_TABLE = 0x51,
|
||||
ASSET_ANIM_MAPPING_TABLE = 0x52,
|
||||
ASSET_ANIM_STATE_MACHINE = 0x53,
|
||||
ASSET_BEHAVIOR_TREE = 0x54,
|
||||
ASSET_BEHAVIOR_STATE_MACHINE = 0x55,
|
||||
ASSET_FOOTSTEP_TABLE = 0x56,
|
||||
ASSET_ENTITY_FX_IMPACTS = 0x57,
|
||||
ASSET_ENTITY_SOUND_IMPACTS = 0x58,
|
||||
ASSET_VEHICLE_FX_DEF = 0x59,
|
||||
ASSET_VEHICLE_SOUND_DEF = 0x60,
|
||||
ASSET_VEHICLE = 0x61,
|
||||
ASSET_VEHICLE_TRACER = 0x62,
|
||||
ASSET_PLAYER_SOUNDS_TABLE = 0x63,
|
||||
ASSET_PLAYER_FX_TABLE = 0x64,
|
||||
ASSET_SHARED_WEAPON_SOUNDS = 0x65,
|
||||
ASSET_ATTACHMENT = 0x66,
|
||||
ASSET_ATTACHMENT_UNIQUE = 0x67,
|
||||
ASSET_WEAPON_CAMO = 0x68,
|
||||
ASSET_CUSTOMIZATION_TABLE = 0x69,
|
||||
ASSET_CUSTOMIZATION_TABLE_FEIMAGES = 0x70,
|
||||
ASSET_CUSTOMIZATION_TABLE_COLOR = 0x71,
|
||||
ASSET_PHYS_CONSTRAINTS = 0x72,
|
||||
ASSET_DESTRUCTIBLE_DEF = 0x73,
|
||||
ASSET_XMODEL_MESH = 0x74,
|
||||
ASSET_S_ANIM = 0x75,
|
||||
ASSET_FONT_ICON = 0x76,
|
||||
ASSET_CG_MEDIA_TABLE = 0x77,
|
||||
ASSET_SHOCK_FILE = 0x78,
|
||||
ASSET_ZONE_FILE = 0x79,
|
||||
ASSET_FAST_FILE = 0x80,
|
||||
ASSET_SOUND_DRIVER_GLOBALS = 0x81,
|
||||
ASSET_XMODELPIECES = 0x82,
|
||||
ASSET_XMODEL = 0x85,
|
||||
ASSET_MATERIAL = 0x86,
|
||||
ASSET_PIXELSHADER = 0x87,
|
||||
ASSET_IMAGE = 0x89,
|
||||
ASSET_SOUND = 0x90,
|
||||
ASSET_LOADED_SOUND = 0x92,
|
||||
ASSET_CLIPMAP = 0x93,
|
||||
ASSET_CLIPMAP_PVS = 0x94,
|
||||
ASSET_COMWORLD = 0x95,
|
||||
ASSET_GAMEWORLD_SP = 0x96,
|
||||
ASSET_GAMEWORLD_MP = 0x97,
|
||||
ASSET_MAP_ENTS = 0x98,
|
||||
ASSET_GFXWORLD = 0x99,
|
||||
ASSET_LIGHT_DEF = 0x100,
|
||||
ASSET_UI_MAP = 0x101,
|
||||
ASSET_FONT = 0x102,
|
||||
ASSET_MENULIST = 0x103,
|
||||
ASSET_MENU = 0x104,
|
||||
ASSET_WEAPON = 0x106,
|
||||
ASSET_IMPACT_FX = 0x109,
|
||||
ASSET_AITYPE = 0x110,
|
||||
ASSET_MPTYPE = 0x111,
|
||||
ASSET_CHARACTER = 0x112,
|
||||
ASSET_XMODELALIAS = 0x113,
|
||||
ASSET_COUNT = 0x116,
|
||||
ASSET_STRING = 0x117,
|
||||
ASSET_ASSETLIST = 0x118,
|
||||
ASSET_PHYSCOLLMAP = 0x119,
|
||||
ASSET_CLIPMAP_SP = 0x120,
|
||||
ASSET_CLIPMAP_MP = 0x121,
|
||||
ASSET_FXWORLD = 0x122,
|
||||
ASSET_LEADERBOARD = 0x123,
|
||||
ASSET_STRUCTURED_DATA_DEF = 0x124,
|
||||
ASSET_TRACER = 0x125,
|
||||
ASSET_ADDON_MAP_ENTS = 0x126,
|
||||
ASSET_GLASSWORLD = 0x127,
|
||||
ASSET_PATHDATA = 0x128,
|
||||
ASSET_VEHICLE_TRACK = 0x129,
|
||||
ASSET_SURFACE_FX = 0x130,
|
||||
ASSET_SCRIPTFILE = 0x131,
|
||||
ASSET_SOUND_SUBMIX = 0x132,
|
||||
ASSET_SOUND_EVENT = 0x133,
|
||||
ASSET_LPF_CURVE = 0x134,
|
||||
ASSET_REVERB_CURVE = 0x135,
|
||||
ASSET_GFXWORLD_TRANSIENT_ZONE = 0x136,
|
||||
ASSET_ANIMCLASS = 0x137,
|
||||
ASSET_NET_CONST_STRINGS = 0x138,
|
||||
ASSET_REVERB_PRESET = 0x139,
|
||||
ASSET_LUA_FILE = 0x140,
|
||||
ASSET_SCRIPTABLE = 0x141,
|
||||
ASSET_EQUIPMENT_SND_TABLE = 0x142,
|
||||
ASSET_DOPPLER_PRESET = 0x143,
|
||||
ASSET_SKELETON_SCRIPT = 0x144,
|
||||
ASSET_PHYSCONSTRAINTS = 0x145,
|
||||
ASSET_DESTRUCTIBLEDEF = 0x146,
|
||||
ASSET_SOUND_PATCH = 0x147,
|
||||
ASSET_WEAPONDEF = 0x148,
|
||||
ASSET_WEAPON_VARIANT = 0x149,
|
||||
ASSET_MPBODY = 0x150,
|
||||
ASSET_MPHEAD = 0x151,
|
||||
ASSET_PACK_INDEX = 0x152,
|
||||
ASSET_XGLOBALS = 0x153,
|
||||
ASSET_GLASSES = 0x154,
|
||||
ASSET_EMBLEMSET = 0x155
|
||||
};
|
||||
Q_ENUM(AssetType)
|
||||
|
||||
static QString AssetTypeToStr(Utils::AssetType aAssetType) {
|
||||
const QMetaObject &mo = Utils::staticMetaObject;
|
||||
int index = mo.indexOfEnumerator("AssetType");
|
||||
QMetaEnum metaEnum = mo.enumerator(index);
|
||||
return QString::fromLatin1(metaEnum.valueToKey(aAssetType));
|
||||
}
|
||||
|
||||
static bool ExportData(const QString aFileName, const QByteArray aData) {
|
||||
QDir workingDir = QDir::currentPath();
|
||||
workingDir.mkdir("exports");
|
||||
@ -182,18 +34,28 @@ public:
|
||||
b = (b & 0xAA) >> 1 | (b & 0x55) << 1;
|
||||
return b;
|
||||
}
|
||||
static QIcon CreateAssetIcon(Utils::AssetType aAssetType, QColor color = QColor()) {
|
||||
const QString assetTypeStr = AssetTypeToStr(aAssetType);
|
||||
static QIcon CreateAssetIcon(XAssetType aAssetType, QColor color = QColor()) {
|
||||
const QString assetTypeStr = XAsset::XAssetTypeToString(aAssetType);
|
||||
|
||||
QString name;
|
||||
const QStringList parts = assetTypeStr.split('_').mid(1);
|
||||
foreach (const QString part, parts) {
|
||||
name += part[0];
|
||||
QString assetAbbr;
|
||||
for (int i = 0; i < assetTypeStr.length(); i++)
|
||||
{
|
||||
if (assetTypeStr[i].isUpper())
|
||||
{
|
||||
assetAbbr += assetTypeStr[i];
|
||||
}
|
||||
}
|
||||
if (parts.size() == 1) {
|
||||
name += parts.first()[1];
|
||||
}
|
||||
return CreateAssetIcon(name, color);
|
||||
return CreateAssetIcon(assetAbbr, color);
|
||||
|
||||
// QString name;
|
||||
// const QStringList parts = assetTypeStr.split('_').mid(1);
|
||||
// foreach (const QString part, parts) {
|
||||
// name += part[0];
|
||||
// }
|
||||
// if (parts.size() == 1) {
|
||||
// name += parts.first()[1];
|
||||
// }
|
||||
// return CreateAssetIcon(name, color);
|
||||
}
|
||||
static QIcon CreateAssetIcon(const QString& name, QColor color = QColor()) {
|
||||
constexpr int iconSize = 32;
|
||||
|
||||
@ -35,7 +35,7 @@ DDSPixelFormat DDSFile::CalculatePixelFormat(quint8 aIWIFormat) {
|
||||
return ddsPixelFormat;
|
||||
}
|
||||
|
||||
void DDSFile::SetupExportDirs() {
|
||||
void DDSFile::SetupExportDirs() const {
|
||||
QDir dir = QDir::currentPath();
|
||||
if (!dir.exists("exports/")) {
|
||||
dir.mkdir("exports/");
|
||||
@ -248,7 +248,7 @@ DDSFile &DDSFile::operator=(const DDSFile &other) {
|
||||
}
|
||||
|
||||
// Write a DDS file from a DDSFile object
|
||||
bool DDSFile::SaveDDS() {
|
||||
bool DDSFile::SaveDDS() const {
|
||||
SetupExportDirs();
|
||||
|
||||
QFile file("exports/dds/" + fileStem + ".dds");
|
||||
@ -268,7 +268,7 @@ bool DDSFile::SaveDDS() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DDSFile::SaveIWI() {
|
||||
bool DDSFile::SaveIWI() const {
|
||||
SetupExportDirs();
|
||||
|
||||
IWIFile iwiFile(*this);
|
||||
@ -279,7 +279,7 @@ bool DDSFile::SaveIWI() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DDSFile::SavePNG() {
|
||||
bool DDSFile::SavePNG() const {
|
||||
SetupExportDirs();
|
||||
|
||||
int mipmapIndex = 1;
|
||||
@ -311,7 +311,7 @@ bool DDSFile::SavePNG() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DDSFile::SaveJPG() {
|
||||
bool DDSFile::SaveJPG() const {
|
||||
SetupExportDirs();
|
||||
|
||||
int mipmapIndex = 1;
|
||||
|
||||
@ -68,12 +68,12 @@ public:
|
||||
DDSFile(const DDSFile &ddsFile);
|
||||
DDSFile& operator=(const DDSFile& other);
|
||||
|
||||
bool SaveDDS();
|
||||
bool SaveIWI();
|
||||
bool SavePNG();
|
||||
bool SaveJPG();
|
||||
bool SaveDDS() const;
|
||||
bool SaveIWI() const;
|
||||
bool SavePNG() const;
|
||||
bool SaveJPG() const;
|
||||
|
||||
void SetupExportDirs();
|
||||
void SetupExportDirs() const;
|
||||
static DDSPixelFormat CalculatePixelFormat(quint8 aIWIFormat);
|
||||
|
||||
private:
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD10_360::~FastFile_COD10_360() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD10_360::GetBinaryData() {
|
||||
QByteArray FastFile_COD10_360::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -106,10 +106,13 @@ bool FastFile_COD10_360::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD10_360 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD10_360>(zoneFile));
|
||||
ZoneFile_COD10_360* zoneFile = new ZoneFile_COD10_360();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD10_360(const QString aFilePath);
|
||||
~FastFile_COD10_360();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -38,7 +38,7 @@ FastFile_COD11_360::~FastFile_COD11_360() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD11_360::GetBinaryData() {
|
||||
QByteArray FastFile_COD11_360::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -94,14 +94,13 @@ bool FastFile_COD11_360::Load(const QByteArray aData) {
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
// Load the zone file with decompressed data
|
||||
ZoneFile_COD11_360 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile.Load(decompressedData)) {
|
||||
ZoneFile_COD11_360* zoneFile = new ZoneFile_COD11_360();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD11_360>(zoneFile));
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD11_360(const QString aFilePath);
|
||||
~FastFile_COD11_360();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -38,7 +38,7 @@ FastFile_COD12_360::~FastFile_COD12_360() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD12_360::GetBinaryData() {
|
||||
QByteArray FastFile_COD12_360::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -94,14 +94,13 @@ bool FastFile_COD12_360::Load(const QByteArray aData) {
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
// Load the zone file with decompressed data
|
||||
ZoneFile_COD12_360 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile.Load(decompressedData)) {
|
||||
ZoneFile_COD12_360* zoneFile = new ZoneFile_COD12_360();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD12_360>(zoneFile));
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD12_360(const QString aFilePath);
|
||||
~FastFile_COD12_360();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -38,7 +38,7 @@ FastFile_COD2_360::~FastFile_COD2_360() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD2_360::GetBinaryData() {
|
||||
QByteArray FastFile_COD2_360::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -79,10 +79,13 @@ bool FastFile_COD2_360::Load(const QByteArray aData) {
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD2_360 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD2_360>(zoneFile));
|
||||
ZoneFile_COD2_360* zoneFile = new ZoneFile_COD2_360();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD2_360(const QString aFilePath);
|
||||
~FastFile_COD2_360();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD4_360::~FastFile_COD4_360() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD4_360::GetBinaryData() {
|
||||
QByteArray FastFile_COD4_360::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -128,10 +128,13 @@ bool FastFile_COD4_360::Load(const QByteArray aData) {
|
||||
}
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
ZoneFile_COD4_360 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD4_360>(zoneFile));
|
||||
ZoneFile_COD4_360* zoneFile = new ZoneFile_COD4_360();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD4_360(const QString aFilePath);
|
||||
~FastFile_COD4_360();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD5_360::~FastFile_COD5_360() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD5_360::GetBinaryData() {
|
||||
QByteArray FastFile_COD5_360::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -80,10 +80,13 @@ bool FastFile_COD5_360::Load(const QByteArray aData) {
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
ZoneFile_COD5_360 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD5_360>(zoneFile));
|
||||
ZoneFile_COD5_360* zoneFile = new ZoneFile_COD5_360();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD5_360(const QString aFilePath);
|
||||
~FastFile_COD5_360();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD6_360::~FastFile_COD6_360() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD6_360::GetBinaryData() {
|
||||
QByteArray FastFile_COD6_360::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -78,31 +78,30 @@ bool FastFile_COD6_360::Load(const QByteArray aData) {
|
||||
}
|
||||
QByteArray compressed = aData.mid(zlibOffset);
|
||||
|
||||
// 2. Try plain decompression first ------------------------------
|
||||
QByteArray decompressed = Compression::DecompressZLIB(compressed);
|
||||
QByteArray decompressedData = Compression::DecompressZLIB(compressed);
|
||||
|
||||
// 3. If that failed or looks too small, try stripping hash blocks
|
||||
if (decompressed.isEmpty() || decompressed.size() < 1024)
|
||||
if (decompressedData.isEmpty() || decompressedData.size() < 1024)
|
||||
{
|
||||
QByteArray stripped = Compression::StripHashBlocks(compressed);
|
||||
QByteArray retry = Compression::DecompressZLIB(stripped);
|
||||
if (!retry.isEmpty())
|
||||
decompressed.swap(retry);
|
||||
decompressedData.swap(retry);
|
||||
}
|
||||
|
||||
if (decompressed.isEmpty())
|
||||
if (decompressedData.isEmpty())
|
||||
{
|
||||
qWarning() << "Unable to decompress fast-file";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Optional – keep a copy on disk for quick inspection
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressed);
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
// 4. Forward to zone-file loader --------------------------------
|
||||
auto zoneFile = std::make_shared<ZoneFile_COD6_360>();
|
||||
zoneFile->SetStem(GetStem());
|
||||
zoneFile->Load(decompressed);
|
||||
ZoneFile_COD6_360* zoneFile = new ZoneFile_COD6_360();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD6_360(const QString aFilePath);
|
||||
~FastFile_COD6_360();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -38,7 +38,7 @@ FastFile_COD7_360::~FastFile_COD7_360() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD7_360::GetBinaryData() {
|
||||
QByteArray FastFile_COD7_360::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -75,10 +75,6 @@ bool FastFile_COD7_360::Load(const QByteArray aData) {
|
||||
QDataStream fastFileStream(aData);
|
||||
fastFileStream.skipRawData(12);
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD7_360 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
|
||||
// For COD7/COD9, use BigEndian.
|
||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
||||
|
||||
@ -145,9 +141,13 @@ bool FastFile_COD7_360::Load(const QByteArray aData) {
|
||||
}
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
zoneFile.Load(decompressedData);
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD7_360>(zoneFile));
|
||||
ZoneFile_COD7_360* zoneFile = new ZoneFile_COD7_360();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD7_360(const QString aFilePath);
|
||||
~FastFile_COD7_360();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD8_360::~FastFile_COD8_360() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD8_360::GetBinaryData() {
|
||||
QByteArray FastFile_COD8_360::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -106,10 +106,13 @@ bool FastFile_COD8_360::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD8_360 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD8_360>(zoneFile));
|
||||
ZoneFile_COD8_360* zoneFile = new ZoneFile_COD8_360();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD8_360(const QString aFilePath);
|
||||
~FastFile_COD8_360();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD9_360::~FastFile_COD9_360() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD9_360::GetBinaryData() {
|
||||
QByteArray FastFile_COD9_360::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -106,10 +106,13 @@ bool FastFile_COD9_360::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD9_360 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD9_360>(zoneFile));
|
||||
ZoneFile_COD9_360* zoneFile = new ZoneFile_COD9_360();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD9_360(const QString aFilePath);
|
||||
~FastFile_COD9_360();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD10_PC::~FastFile_COD10_PC() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD10_PC::GetBinaryData() {
|
||||
QByteArray FastFile_COD10_PC::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -128,10 +128,13 @@ bool FastFile_COD10_PC::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD10_PC zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD10_PC>(zoneFile));
|
||||
ZoneFile_COD10_PC* zoneFile = new ZoneFile_COD10_PC();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD10_PC(const QString aFilePath);
|
||||
~FastFile_COD10_PC();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD11_PC::~FastFile_COD11_PC() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD11_PC::GetBinaryData() {
|
||||
QByteArray FastFile_COD11_PC::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -128,10 +128,13 @@ bool FastFile_COD11_PC::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD11_PC zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD11_PC>(zoneFile));
|
||||
ZoneFile_COD11_PC* zoneFile = new ZoneFile_COD11_PC();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD11_PC(const QString aFilePath);
|
||||
~FastFile_COD11_PC();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD12_PC::~FastFile_COD12_PC() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD12_PC::GetBinaryData() {
|
||||
QByteArray FastFile_COD12_PC::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -76,10 +76,6 @@ bool FastFile_COD12_PC::Load(const QByteArray aData) {
|
||||
QDataStream fastFileStream(aData);
|
||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD12_PC zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
|
||||
// Skip header magic
|
||||
fastFileStream.skipRawData(8);
|
||||
|
||||
@ -143,9 +139,14 @@ bool FastFile_COD12_PC::Load(const QByteArray aData) {
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
zoneFile.Load(decompressedData);
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD12_PC>(zoneFile));
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD12_PC* zoneFile = new ZoneFile_COD12_PC();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD12_PC(const QString aFilePath);
|
||||
~FastFile_COD12_PC();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD4_PC::~FastFile_COD4_PC() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD4_PC::GetBinaryData() {
|
||||
QByteArray FastFile_COD4_PC::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -84,10 +84,13 @@ bool FastFile_COD4_PC::Load(const QByteArray aData) {
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
ZoneFile_COD4_PC zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD4_PC>(zoneFile));
|
||||
ZoneFile_COD4_PC* zoneFile = new ZoneFile_COD4_PC();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD4_PC(const QString aFilePath);
|
||||
~FastFile_COD4_PC();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD5_PC::~FastFile_COD5_PC() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD5_PC::GetBinaryData() {
|
||||
QByteArray FastFile_COD5_PC::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -84,10 +84,13 @@ bool FastFile_COD5_PC::Load(const QByteArray aData) {
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
ZoneFile_COD5_PC zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD5_PC>(zoneFile));
|
||||
ZoneFile_COD5_PC* zoneFile = new ZoneFile_COD5_PC();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD5_PC(const QString aFilePath);
|
||||
~FastFile_COD5_PC();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD6_PC::~FastFile_COD6_PC() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD6_PC::GetBinaryData() {
|
||||
QByteArray FastFile_COD6_PC::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -81,10 +81,13 @@ bool FastFile_COD6_PC::Load(const QByteArray aData) {
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
ZoneFile_COD6_PC zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD6_PC>(zoneFile));
|
||||
ZoneFile_COD6_PC* zoneFile = new ZoneFile_COD6_PC();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD6_PC(const QString aFilePath);
|
||||
~FastFile_COD6_PC();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD7_PC::~FastFile_COD7_PC() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD7_PC::GetBinaryData() {
|
||||
QByteArray FastFile_COD7_PC::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -86,19 +86,19 @@ bool FastFile_COD7_PC::Load(const QByteArray aData) {
|
||||
SetPlatform("360");
|
||||
SetGame("COD7");
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD7_PC zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
|
||||
// Assume the first 12 bytes are a header; the rest is zlib-compressed zone data.
|
||||
const QByteArray compressedData = aData.mid(12);
|
||||
decompressedData = Compression::DecompressZLIB(compressedData);
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
zoneFile.Load(decompressedData);
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD7_PC>(zoneFile));
|
||||
ZoneFile_COD7_PC* zoneFile = new ZoneFile_COD7_PC();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD7_PC(const QString aFilePath);
|
||||
~FastFile_COD7_PC();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD8_PC::~FastFile_COD8_PC() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD8_PC::GetBinaryData() {
|
||||
QByteArray FastFile_COD8_PC::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -86,10 +86,6 @@ bool FastFile_COD8_PC::Load(const QByteArray aData) {
|
||||
SetPlatform(pCalculateFFPlatform(version));
|
||||
SetGame("COD7");
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD8_PC zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
|
||||
// For COD7/COD9, use BigEndian.
|
||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
||||
|
||||
@ -162,9 +158,13 @@ bool FastFile_COD8_PC::Load(const QByteArray aData) {
|
||||
sectionIndex++;
|
||||
}
|
||||
|
||||
zoneFile.Load(decompressedData);
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD8_PC>(zoneFile));
|
||||
ZoneFile_COD8_PC* zoneFile = new ZoneFile_COD8_PC();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD8_PC(const QString aFilePath);
|
||||
~FastFile_COD8_PC();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD9_PC::~FastFile_COD9_PC() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD9_PC::GetBinaryData() {
|
||||
QByteArray FastFile_COD9_PC::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -128,10 +128,13 @@ bool FastFile_COD9_PC::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD9_PC zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD9_PC>(zoneFile));
|
||||
ZoneFile_COD9_PC* zoneFile = new ZoneFile_COD9_PC();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD9_PC(const QString aFilePath);
|
||||
~FastFile_COD9_PC();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD10_PS3::~FastFile_COD10_PS3() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD10_PS3::GetBinaryData() {
|
||||
QByteArray FastFile_COD10_PS3::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -128,10 +128,13 @@ bool FastFile_COD10_PS3::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD10_PS3 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD10_PS3>(zoneFile));
|
||||
ZoneFile_COD10_PS3* zoneFile = new ZoneFile_COD10_PS3();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD10_PS3(const QString aFilePath);
|
||||
~FastFile_COD10_PS3();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD11_PS3::~FastFile_COD11_PS3() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD11_PS3::GetBinaryData() {
|
||||
QByteArray FastFile_COD11_PS3::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -128,10 +128,13 @@ bool FastFile_COD11_PS3::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD11_PS3 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD11_PS3>(zoneFile));
|
||||
ZoneFile_COD11_PS3* zoneFile = new ZoneFile_COD11_PS3();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD11_PS3(const QString aFilePath);
|
||||
~FastFile_COD11_PS3();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD12_PS3::~FastFile_COD12_PS3() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD12_PS3::GetBinaryData() {
|
||||
QByteArray FastFile_COD12_PS3::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -128,10 +128,13 @@ bool FastFile_COD12_PS3::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD12_PS3 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD12_PS3>(zoneFile));
|
||||
ZoneFile_COD12_PS3* zoneFile = new ZoneFile_COD12_PS3();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD12_PS3(const QString aFilePath);
|
||||
~FastFile_COD12_PS3();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD4_PS3::~FastFile_COD4_PS3() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD4_PS3::GetBinaryData() {
|
||||
QByteArray FastFile_COD4_PS3::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -111,10 +111,13 @@ bool FastFile_COD4_PS3::Load(const QByteArray aData) {
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
ZoneFile_COD4_PS3 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD4_PS3>(zoneFile));
|
||||
ZoneFile_COD4_PS3* zoneFile = new ZoneFile_COD4_PS3();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD4_PS3(const QString aFilePath);
|
||||
~FastFile_COD4_PS3();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD5_PS3::~FastFile_COD5_PS3() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD5_PS3::GetBinaryData() {
|
||||
QByteArray FastFile_COD5_PS3::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -111,10 +111,13 @@ bool FastFile_COD5_PS3::Load(const QByteArray aData) {
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
ZoneFile_COD5_PS3 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD5_PS3>(zoneFile));
|
||||
ZoneFile_COD5_PS3* zoneFile = new ZoneFile_COD5_PS3();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD5_PS3(const QString aFilePath);
|
||||
~FastFile_COD5_PS3();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD6_PS3::~FastFile_COD6_PS3() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD6_PS3::GetBinaryData() {
|
||||
QByteArray FastFile_COD6_PS3::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -95,10 +95,13 @@ bool FastFile_COD6_PS3::Load(const QByteArray aData) {
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
ZoneFile_COD6_PS3 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD6_PS3>(zoneFile));
|
||||
ZoneFile_COD6_PS3* zoneFile = new ZoneFile_COD6_PS3();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD6_PS3(const QString aFilePath);
|
||||
~FastFile_COD6_PS3();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD7_PS3::~FastFile_COD7_PS3() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD7_PS3::GetBinaryData() {
|
||||
QByteArray FastFile_COD7_PS3::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -87,8 +87,8 @@ bool FastFile_COD7_PS3::Load(const QByteArray aData) {
|
||||
SetGame("COD7");
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD7_PS3 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
ZoneFile_COD7_PS3* zoneFile = new ZoneFile_COD7_PS3();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
|
||||
// For COD7/COD9, use BigEndian.
|
||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
||||
@ -164,10 +164,12 @@ bool FastFile_COD7_PS3::Load(const QByteArray aData) {
|
||||
sectionIndex++;
|
||||
}
|
||||
|
||||
zoneFile.Load(decompressedData);
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD7_PS3>(zoneFile));
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD7_PS3(const QString aFilePath);
|
||||
~FastFile_COD7_PS3();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -39,7 +39,7 @@ FastFile_COD8_PS3::~FastFile_COD8_PS3() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD8_PS3::GetBinaryData() {
|
||||
QByteArray FastFile_COD8_PS3::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -86,9 +86,8 @@ bool FastFile_COD8_PS3::Load(const QByteArray aData) {
|
||||
SetPlatform(pCalculateFFPlatform(version));
|
||||
SetGame("COD7");
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD8_PS3 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
ZoneFile_COD8_PS3* zoneFile = new ZoneFile_COD8_PS3();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
|
||||
// For COD7/COD9, use BigEndian.
|
||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
||||
@ -164,10 +163,13 @@ bool FastFile_COD8_PS3::Load(const QByteArray aData) {
|
||||
sectionIndex++;
|
||||
}
|
||||
|
||||
zoneFile.Load(decompressedData);
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD8_PS3>(zoneFile));
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD8_PS3(const QString aFilePath);
|
||||
~FastFile_COD8_PS3();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD9_PS3::~FastFile_COD9_PS3() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD9_PS3::GetBinaryData() {
|
||||
QByteArray FastFile_COD9_PS3::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -128,10 +128,13 @@ bool FastFile_COD9_PS3::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD9_PS3 zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD9_PS3>(zoneFile));
|
||||
ZoneFile_COD9_PS3* zoneFile = new ZoneFile_COD9_PS3();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD9_PS3(const QString aFilePath);
|
||||
~FastFile_COD9_PS3();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD4_Wii::~FastFile_COD4_Wii() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD4_Wii::GetBinaryData() {
|
||||
QByteArray FastFile_COD4_Wii::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -67,20 +67,19 @@ bool FastFile_COD4_Wii::Load(const QString aFilePath) {
|
||||
}
|
||||
|
||||
bool FastFile_COD4_Wii::Load(const QByteArray aData) {
|
||||
QByteArray decompressedData;
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD4_Wii zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
|
||||
// For COD7, simply decompress from offset 12.
|
||||
decompressedData = Compression::DecompressZLIB(aData.mid(12));
|
||||
QByteArray decompressedData = Compression::DecompressZLIB(aData.mid(12));
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
zoneFile.Load(decompressedData);
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD4_Wii>(zoneFile));
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD4_Wii* zoneFile = new ZoneFile_COD4_Wii();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD4_Wii(const QString aFilePath);
|
||||
~FastFile_COD4_Wii();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD7_Wii::~FastFile_COD7_Wii() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD7_Wii::GetBinaryData() {
|
||||
QByteArray FastFile_COD7_Wii::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -83,10 +83,6 @@ bool FastFile_COD7_Wii::Load(const QByteArray aData) {
|
||||
SetPlatform(pCalculateFFPlatform(version));
|
||||
SetGame("COD7");
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD7_Wii zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
|
||||
// For COD7/COD9, use BigEndian.
|
||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
||||
|
||||
@ -105,9 +101,13 @@ bool FastFile_COD7_Wii::Load(const QByteArray aData) {
|
||||
outputFile.write(decompressedData);
|
||||
outputFile.close();
|
||||
|
||||
zoneFile.Load(decompressedData);
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD7_Wii>(zoneFile));
|
||||
ZoneFile_COD7_Wii* zoneFile = new ZoneFile_COD7_Wii();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD7_Wii(const QString aFilePath);
|
||||
~FastFile_COD7_Wii();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -36,7 +36,7 @@ FastFile_COD8_Wii::~FastFile_COD8_Wii() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD8_Wii::GetBinaryData() {
|
||||
QByteArray FastFile_COD8_Wii::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -80,10 +80,6 @@ bool FastFile_COD8_Wii::Load(const QByteArray aData) {
|
||||
SetMagic(pParseFFMagic(&fastFileStream));
|
||||
SetVersion(pParseFFVersion(&fastFileStream));
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD8_Wii zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
|
||||
// For COD7/COD9, use BigEndian.
|
||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
||||
|
||||
@ -92,9 +88,13 @@ bool FastFile_COD8_Wii::Load(const QByteArray aData) {
|
||||
|
||||
Utils::ExportData(GetBaseStem() + ".zone", decompressedData);
|
||||
|
||||
zoneFile.Load(decompressedData);
|
||||
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD8_Wii>(zoneFile));
|
||||
ZoneFile_COD8_Wii* zoneFile = new ZoneFile_COD8_Wii();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD8_Wii(const QString aFilePath);
|
||||
~FastFile_COD8_Wii();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -34,7 +34,7 @@ FastFile_COD10_WiiU::~FastFile_COD10_WiiU() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD10_WiiU::GetBinaryData() {
|
||||
QByteArray FastFile_COD10_WiiU::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -126,10 +126,13 @@ bool FastFile_COD10_WiiU::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD10_WiiU zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD10_WiiU>(zoneFile));
|
||||
ZoneFile_COD10_WiiU *zoneFile = new ZoneFile_COD10_WiiU();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD10_WiiU(const QString aFilePath);
|
||||
~FastFile_COD10_WiiU();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -34,7 +34,7 @@ FastFile_COD9_WiiU::~FastFile_COD9_WiiU() {
|
||||
|
||||
}
|
||||
|
||||
QByteArray FastFile_COD9_WiiU::GetBinaryData() {
|
||||
QByteArray FastFile_COD9_WiiU::GetBinaryData() const {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -126,10 +126,13 @@ bool FastFile_COD9_WiiU::Load(const QByteArray aData) {
|
||||
}
|
||||
|
||||
// Load the zone file with the decompressed data (using an Xbox platform flag).
|
||||
ZoneFile_COD9_WiiU zoneFile;
|
||||
zoneFile.SetStem(GetBaseStem() + ".zone");
|
||||
zoneFile.Load(decompressedData);
|
||||
SetZoneFile(std::make_shared<ZoneFile_COD9_WiiU>(zoneFile));
|
||||
ZoneFile_COD9_WiiU* zoneFile = new ZoneFile_COD9_WiiU();
|
||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||
if (!zoneFile->Load(decompressedData)) {
|
||||
qWarning() << "Failed to load ZoneFile!";
|
||||
return false;
|
||||
}
|
||||
SetZoneFile(zoneFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
FastFile_COD9_WiiU(const QString aFilePath);
|
||||
~FastFile_COD9_WiiU();
|
||||
|
||||
QByteArray GetBinaryData() override;
|
||||
QByteArray GetBinaryData() const override;
|
||||
|
||||
bool Load(const QString aFilePath) override;
|
||||
bool Load(const QByteArray aData) override;
|
||||
|
||||
@ -68,7 +68,7 @@ quint32 FastFile::GetVersion() const {
|
||||
return mVersion;
|
||||
}
|
||||
|
||||
std::shared_ptr<ZoneFile> FastFile::GetZoneFile() const {
|
||||
const ZoneFile* FastFile::GetZoneFile() const {
|
||||
return mZoneFile;
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ void FastFile::SetVersion(const quint32 aVersion) {
|
||||
mVersion = aVersion;
|
||||
}
|
||||
|
||||
void FastFile::SetZoneFile(const std::shared_ptr<ZoneFile> aZoneFile) {
|
||||
void FastFile::SetZoneFile(const ZoneFile* aZoneFile) {
|
||||
mZoneFile = aZoneFile;
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ QString FastFile::pCalculateFFGame(quint32 aVersion) {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::shared_ptr<FastFile> FastFile::Open(const QString &aFilePath) {
|
||||
FastFile* FastFile::Open(const QString &aFilePath) {
|
||||
LogManager::instance().addEntry("Processing Fastfile...");
|
||||
|
||||
if (aFilePath.isEmpty()) {
|
||||
@ -267,12 +267,12 @@ std::shared_ptr<FastFile> FastFile::Open(const QString &aFilePath) {
|
||||
const QString fastFileStem = aFilePath.section("/", -1, -1);
|
||||
LogManager::instance().addEntry(QString("Stem: %1").arg(fastFileStem));
|
||||
|
||||
std::shared_ptr<FastFile> fastFile = FastFileFactory::Create(data);
|
||||
FastFile* fastFile = FastFileFactory::Create(data);
|
||||
fastFile->SetStem(fastFileStem);
|
||||
|
||||
return fastFile;
|
||||
}
|
||||
bool FastFile::ExportFastFile(const QString aFastFilePath) {
|
||||
bool FastFile::ExportFastFile(const QString aFastFilePath) const {
|
||||
QFile fastFile(aFastFilePath);
|
||||
if (!fastFile.open(QIODevice::WriteOnly)) {
|
||||
LogManager::instance().addEntry("Failed to write fast file! " +
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
#define FASTFILE_H
|
||||
|
||||
#include "enums.h"
|
||||
#include "utils.h"
|
||||
#include "zonefile.h"
|
||||
|
||||
#include <QString>
|
||||
@ -20,9 +21,9 @@ public:
|
||||
virtual bool Load(const QString aFilePath) = 0;
|
||||
virtual bool Load(const QByteArray aData) = 0;
|
||||
|
||||
virtual bool ExportFastFile(const QString aFastFilePath);
|
||||
virtual bool ExportFastFile(const QString aFastFilePath) const;
|
||||
|
||||
virtual QByteArray GetBinaryData() = 0;
|
||||
virtual QByteArray GetBinaryData() const = 0;
|
||||
|
||||
virtual QString GetStem() const;
|
||||
virtual QString GetBaseStem() const;
|
||||
@ -31,7 +32,7 @@ public:
|
||||
virtual FF_SIGNAGE GetSignage() const;
|
||||
virtual QString GetMagic() const;
|
||||
virtual quint32 GetVersion() const;
|
||||
virtual std::shared_ptr<ZoneFile> GetZoneFile() const;
|
||||
virtual const ZoneFile *GetZoneFile() const;
|
||||
virtual QString GetGame() const;
|
||||
virtual QString GetPlatform() const;
|
||||
|
||||
@ -41,7 +42,7 @@ public:
|
||||
virtual void SetSignage(const FF_SIGNAGE aSignage);
|
||||
virtual void SetMagic(const QString aMagic);
|
||||
virtual void SetVersion(const quint32 aVersion);
|
||||
virtual void SetZoneFile(const std::shared_ptr<ZoneFile> aZoneFile);
|
||||
virtual void SetZoneFile(const ZoneFile* aZoneFile);
|
||||
virtual void SetGame(const QString aGame);
|
||||
virtual void SetPlatform(const QString aPlatform);
|
||||
|
||||
@ -54,7 +55,7 @@ public:
|
||||
static QString pCalculateFFPlatform(quint32 aVersion);
|
||||
static QString pCalculateFFGame(quint32 aVersion);
|
||||
|
||||
static std::shared_ptr<FastFile> Open(const QString& aFilePath);
|
||||
static FastFile* Open(const QString& aFilePath);
|
||||
|
||||
private:
|
||||
QString mStem;
|
||||
@ -63,7 +64,7 @@ private:
|
||||
FF_SIGNAGE mSignage;
|
||||
QString mMagic;
|
||||
quint32 mVersion;
|
||||
std::shared_ptr<ZoneFile> mZoneFile;
|
||||
const ZoneFile* mZoneFile;
|
||||
QString mGame;
|
||||
QString mPlatform;
|
||||
};
|
||||
|
||||
@ -7,7 +7,7 @@ HEADERS += $$files($$PWD/*.h, true)
|
||||
|
||||
LIBS += \
|
||||
-L$$OUT_PWD/../libs/core -lcore \
|
||||
-L$$OUT_PWD/../libs/core -lassets \
|
||||
-L$$OUT_PWD/../libs/core -lxassets \
|
||||
-L$$OUT_PWD/../libs/compression -lcompression \
|
||||
-L$$OUT_PWD/../libs/encryption -lencryption \
|
||||
-L$$OUT_PWD/../libs/zonefile -lzonefile
|
||||
@ -16,7 +16,7 @@ INCLUDEPATH += \
|
||||
$$PWD/../core \
|
||||
$$PWD/../compression \
|
||||
$$PWD/../encryption \
|
||||
$$PWD/../assets \
|
||||
$$PWD/../xassets \
|
||||
$$PWD/../zonefile \
|
||||
$$PWD/../zonefile/360 \
|
||||
$$PWD/../zonefile/PC \
|
||||
@ -29,7 +29,7 @@ DEPENDPATH += \
|
||||
$$PWD/../core \
|
||||
$$PWD/../compression \
|
||||
$$PWD/../encryption \
|
||||
$$PWD/../assets \
|
||||
$$PWD/../xassets \
|
||||
$$PWD/../zonefile \
|
||||
$$PWD/../zonefile/360 \
|
||||
$$PWD/../zonefile/PC \
|
||||
|
||||
@ -75,7 +75,7 @@ enum FastFile_Game {
|
||||
|
||||
class FastFileFactory {
|
||||
public:
|
||||
static std::shared_ptr<FastFile> Create(const QString& aFilePath, FastFile_Platform aPlatform = PLATFORM_NONE, FastFile_Game aGame = GAME_NONE) {
|
||||
static FastFile* Create(const QString& aFilePath, FastFile_Platform aPlatform = PLATFORM_NONE, FastFile_Game aGame = GAME_NONE) {
|
||||
QFile fastFile(aFilePath);
|
||||
if (!fastFile.open(QIODevice::ReadOnly)) {
|
||||
qDebug() << "Factory failed to open fast file: " << aFilePath;
|
||||
@ -85,7 +85,7 @@ public:
|
||||
const QString stem = aFilePath.split('/').last().split('.').first();
|
||||
|
||||
const QByteArray data = fastFile.readAll();
|
||||
std::shared_ptr<FastFile> resultFF = nullptr;
|
||||
FastFile* resultFF = nullptr;
|
||||
|
||||
if (aPlatform == PLATFORM_NONE) {
|
||||
aPlatform = pGetPlatform(data);
|
||||
@ -96,85 +96,85 @@ public:
|
||||
|
||||
if (aPlatform == PLATFORM_360) {
|
||||
if (aGame == GAME_COD2) {
|
||||
resultFF = std::make_shared<FastFile_COD2_360>(aFilePath);
|
||||
resultFF = new FastFile_COD2_360(aFilePath);
|
||||
} else if (aGame == GAME_COD4) {
|
||||
resultFF = std::make_shared<FastFile_COD4_360>(aFilePath);
|
||||
resultFF = new FastFile_COD4_360(aFilePath);
|
||||
} else if (aGame == GAME_COD5) {
|
||||
resultFF = std::make_shared<FastFile_COD5_360>(aFilePath);
|
||||
resultFF = new FastFile_COD5_360(aFilePath);
|
||||
} else if (aGame == GAME_COD6) {
|
||||
resultFF = std::make_shared<FastFile_COD6_360>(aFilePath);
|
||||
resultFF = new FastFile_COD6_360(aFilePath);
|
||||
} else if (aGame == GAME_COD7) {
|
||||
resultFF = std::make_shared<FastFile_COD7_360>(aFilePath);
|
||||
resultFF = new FastFile_COD7_360(aFilePath);
|
||||
} else if (aGame == GAME_COD8) {
|
||||
resultFF = std::make_shared<FastFile_COD8_360>(aFilePath);
|
||||
resultFF = new FastFile_COD8_360(aFilePath);
|
||||
} else if (aGame == GAME_COD9) {
|
||||
resultFF = std::make_shared<FastFile_COD9_360>(aFilePath);
|
||||
resultFF = new FastFile_COD9_360(aFilePath);
|
||||
} else if (aGame == GAME_COD10) {
|
||||
resultFF = std::make_shared<FastFile_COD10_360>(aFilePath);
|
||||
resultFF = new FastFile_COD10_360(aFilePath);
|
||||
} else if (aGame == GAME_COD11) {
|
||||
resultFF = std::make_shared<FastFile_COD11_360>(aFilePath);
|
||||
resultFF = new FastFile_COD11_360(aFilePath);
|
||||
} else if (aGame == GAME_COD12) {
|
||||
resultFF = std::make_shared<FastFile_COD12_360>(aFilePath);
|
||||
resultFF = new FastFile_COD12_360(aFilePath);
|
||||
}
|
||||
} else if (aPlatform == PLATFORM_PC) {
|
||||
if (aGame == GAME_COD4) {
|
||||
resultFF = std::make_shared<FastFile_COD4_PC>(aFilePath);
|
||||
resultFF = new FastFile_COD4_PC(aFilePath);
|
||||
} else if (aGame == GAME_COD5) {
|
||||
resultFF = std::make_shared<FastFile_COD5_PC>(aFilePath);
|
||||
resultFF = new FastFile_COD5_PC(aFilePath);
|
||||
} else if (aGame == GAME_COD6) {
|
||||
resultFF = std::make_shared<FastFile_COD6_PC>(aFilePath);
|
||||
resultFF = new FastFile_COD6_PC(aFilePath);
|
||||
} else if (aGame == GAME_COD7) {
|
||||
resultFF = std::make_shared<FastFile_COD7_PC>(aFilePath);
|
||||
resultFF = new FastFile_COD7_PC(aFilePath);
|
||||
} else if (aGame == GAME_COD8) {
|
||||
resultFF = std::make_shared<FastFile_COD8_PC>(aFilePath);
|
||||
resultFF = new FastFile_COD8_PC(aFilePath);
|
||||
} else if (aGame == GAME_COD9) {
|
||||
resultFF = std::make_shared<FastFile_COD9_PC>(aFilePath);
|
||||
resultFF = new FastFile_COD9_PC(aFilePath);
|
||||
} else if (aGame == GAME_COD10) {
|
||||
resultFF = std::make_shared<FastFile_COD10_PC>(aFilePath);
|
||||
resultFF = new FastFile_COD10_PC(aFilePath);
|
||||
} else if (aGame == GAME_COD11) {
|
||||
resultFF = std::make_shared<FastFile_COD11_PC>(aFilePath);
|
||||
resultFF = new FastFile_COD11_PC(aFilePath);
|
||||
} else if (aGame == GAME_COD12) {
|
||||
resultFF = std::make_shared<FastFile_COD12_PC>(aFilePath);
|
||||
resultFF = new FastFile_COD12_PC(aFilePath);
|
||||
}
|
||||
} else if (aPlatform == PLATFORM_PS3) {
|
||||
if (aGame == GAME_COD4) {
|
||||
resultFF = std::make_shared<FastFile_COD4_PS3>(aFilePath);
|
||||
resultFF = new FastFile_COD4_PS3(aFilePath);
|
||||
} else if (aGame == GAME_COD5) {
|
||||
resultFF = std::make_shared<FastFile_COD5_PS3>(aFilePath);
|
||||
resultFF = new FastFile_COD5_PS3(aFilePath);
|
||||
} else if (aGame == GAME_COD6) {
|
||||
resultFF = std::make_shared<FastFile_COD6_PS3>(aFilePath);
|
||||
resultFF = new FastFile_COD6_PS3(aFilePath);
|
||||
} else if (aGame == GAME_COD7) {
|
||||
resultFF = std::make_shared<FastFile_COD7_PS3>(aFilePath);
|
||||
resultFF = new FastFile_COD7_PS3(aFilePath);
|
||||
} else if (aGame == GAME_COD8) {
|
||||
resultFF = std::make_shared<FastFile_COD8_PS3>(aFilePath);
|
||||
resultFF = new FastFile_COD8_PS3(aFilePath);
|
||||
} else if (aGame == GAME_COD9) {
|
||||
resultFF = std::make_shared<FastFile_COD9_PS3>(aFilePath);
|
||||
resultFF = new FastFile_COD9_PS3(aFilePath);
|
||||
} else if (aGame == GAME_COD10) {
|
||||
resultFF = std::make_shared<FastFile_COD10_PS3>(aFilePath);
|
||||
resultFF = new FastFile_COD10_PS3(aFilePath);
|
||||
} else if (aGame == GAME_COD11) {
|
||||
resultFF = std::make_shared<FastFile_COD11_PS3>(aFilePath);
|
||||
resultFF = new FastFile_COD11_PS3(aFilePath);
|
||||
} else if (aGame == GAME_COD12) {
|
||||
resultFF = std::make_shared<FastFile_COD12_PS3>(aFilePath);
|
||||
resultFF = new FastFile_COD12_PS3(aFilePath);
|
||||
}
|
||||
} else if (aPlatform == PLATFORM_WII) {
|
||||
if (aGame == GAME_COD4) {
|
||||
resultFF = std::make_shared<FastFile_COD4_Wii>(aFilePath);
|
||||
resultFF = new FastFile_COD4_Wii(aFilePath);
|
||||
} else if (aGame == GAME_COD7) {
|
||||
resultFF = std::make_shared<FastFile_COD7_Wii>(aFilePath);
|
||||
resultFF = new FastFile_COD7_Wii(aFilePath);
|
||||
} else if (aGame == GAME_COD8) {
|
||||
resultFF = std::make_shared<FastFile_COD8_Wii>(aFilePath);
|
||||
resultFF = new FastFile_COD8_Wii(aFilePath);
|
||||
}
|
||||
} else if (aPlatform == PLATFORM_WIIU) {
|
||||
if (aGame == GAME_COD9) {
|
||||
resultFF = std::make_shared<FastFile_COD9_WiiU>(aFilePath);
|
||||
resultFF = new FastFile_COD9_WiiU(aFilePath);
|
||||
} else if (aGame == GAME_COD10) {
|
||||
resultFF = std::make_shared<FastFile_COD10_WiiU>(aFilePath);
|
||||
resultFF = new FastFile_COD10_WiiU(aFilePath);
|
||||
}
|
||||
}
|
||||
return resultFF;
|
||||
}
|
||||
static std::shared_ptr<FastFile> Create(const QByteArray& aData, const QString aStem = "no_name", FastFile_Platform aPlatform = PLATFORM_NONE, FastFile_Game aGame = GAME_NONE) {
|
||||
std::shared_ptr<FastFile> resultFF = nullptr;
|
||||
static FastFile* Create(const QByteArray& aData, const QString aStem = "no_name", FastFile_Platform aPlatform = PLATFORM_NONE, FastFile_Game aGame = GAME_NONE) {
|
||||
FastFile* resultFF = nullptr;
|
||||
|
||||
if (aPlatform == PLATFORM_NONE) {
|
||||
aPlatform = pGetPlatform(aData);
|
||||
@ -185,79 +185,79 @@ public:
|
||||
|
||||
if (aPlatform == PLATFORM_360) {
|
||||
if (aGame == GAME_COD2) {
|
||||
resultFF = std::make_shared<FastFile_COD2_360>(aData);
|
||||
resultFF = new FastFile_COD2_360(aData);
|
||||
} else if (aGame == GAME_COD4) {
|
||||
resultFF = std::make_shared<FastFile_COD4_360>(aData);
|
||||
resultFF = new FastFile_COD4_360(aData);
|
||||
} else if (aGame == GAME_COD5) {
|
||||
resultFF = std::make_shared<FastFile_COD5_360>(aData);
|
||||
resultFF = new FastFile_COD5_360(aData);
|
||||
} else if (aGame == GAME_COD6) {
|
||||
resultFF = std::make_shared<FastFile_COD6_360>(aData);
|
||||
resultFF = new FastFile_COD6_360(aData);
|
||||
} else if (aGame == GAME_COD7) {
|
||||
resultFF = std::make_shared<FastFile_COD7_360>(aData);
|
||||
resultFF = new FastFile_COD7_360(aData);
|
||||
} else if (aGame == GAME_COD8) {
|
||||
resultFF = std::make_shared<FastFile_COD8_360>(aData);
|
||||
resultFF = new FastFile_COD8_360(aData);
|
||||
} else if (aGame == GAME_COD9) {
|
||||
resultFF = std::make_shared<FastFile_COD9_360>(aData);
|
||||
resultFF = new FastFile_COD9_360(aData);
|
||||
} else if (aGame == GAME_COD10) {
|
||||
resultFF = std::make_shared<FastFile_COD10_360>(aData);
|
||||
resultFF = new FastFile_COD10_360(aData);
|
||||
} else if (aGame == GAME_COD11) {
|
||||
resultFF = std::make_shared<FastFile_COD11_360>(aData);
|
||||
resultFF = new FastFile_COD11_360(aData);
|
||||
} else if (aGame == GAME_COD12) {
|
||||
resultFF = std::make_shared<FastFile_COD12_360>(aData);
|
||||
resultFF = new FastFile_COD12_360(aData);
|
||||
}
|
||||
} else if (aPlatform == PLATFORM_PC) {
|
||||
if (aGame == GAME_COD4) {
|
||||
resultFF = std::make_shared<FastFile_COD4_PC>(aData);
|
||||
resultFF = new FastFile_COD4_PC(aData);
|
||||
} else if (aGame == GAME_COD5) {
|
||||
resultFF = std::make_shared<FastFile_COD5_PC>(aData);
|
||||
resultFF = new FastFile_COD5_PC(aData);
|
||||
} else if (aGame == GAME_COD6) {
|
||||
resultFF = std::make_shared<FastFile_COD6_PC>(aData);
|
||||
resultFF = new FastFile_COD6_PC(aData);
|
||||
} else if (aGame == GAME_COD7) {
|
||||
resultFF = std::make_shared<FastFile_COD7_PC>(aData);
|
||||
resultFF = new FastFile_COD7_PC(aData);
|
||||
} else if (aGame == GAME_COD8) {
|
||||
resultFF = std::make_shared<FastFile_COD8_PC>(aData);
|
||||
resultFF = new FastFile_COD8_PC(aData);
|
||||
} else if (aGame == GAME_COD9) {
|
||||
resultFF = std::make_shared<FastFile_COD9_PC>(aData);
|
||||
resultFF = new FastFile_COD9_PC(aData);
|
||||
} else if (aGame == GAME_COD10) {
|
||||
resultFF = std::make_shared<FastFile_COD10_PC>(aData);
|
||||
resultFF = new FastFile_COD10_PC(aData);
|
||||
} else if (aGame == GAME_COD11) {
|
||||
resultFF = std::make_shared<FastFile_COD11_PC>(aData);
|
||||
resultFF = new FastFile_COD11_PC(aData);
|
||||
} else if (aGame == GAME_COD12) {
|
||||
resultFF = std::make_shared<FastFile_COD12_PC>(aData);
|
||||
resultFF = new FastFile_COD12_PC(aData);
|
||||
}
|
||||
} else if (aPlatform == PLATFORM_PS3) {
|
||||
if (aGame == GAME_COD4) {
|
||||
resultFF = std::make_shared<FastFile_COD4_PS3>(aData);
|
||||
resultFF = new FastFile_COD4_PS3(aData);
|
||||
} else if (aGame == GAME_COD5) {
|
||||
resultFF = std::make_shared<FastFile_COD5_PS3>(aData);
|
||||
resultFF = new FastFile_COD5_PS3(aData);
|
||||
} else if (aGame == GAME_COD6) {
|
||||
resultFF = std::make_shared<FastFile_COD6_PS3>(aData);
|
||||
resultFF = new FastFile_COD6_PS3(aData);
|
||||
} else if (aGame == GAME_COD7) {
|
||||
resultFF = std::make_shared<FastFile_COD7_PS3>(aData);
|
||||
resultFF = new FastFile_COD7_PS3(aData);
|
||||
} else if (aGame == GAME_COD8) {
|
||||
resultFF = std::make_shared<FastFile_COD8_PS3>(aData);
|
||||
resultFF = new FastFile_COD8_PS3(aData);
|
||||
} else if (aGame == GAME_COD9) {
|
||||
resultFF = std::make_shared<FastFile_COD9_PS3>(aData);
|
||||
resultFF = new FastFile_COD9_PS3(aData);
|
||||
} else if (aGame == GAME_COD10) {
|
||||
resultFF = std::make_shared<FastFile_COD10_PS3>(aData);
|
||||
resultFF = new FastFile_COD10_PS3(aData);
|
||||
} else if (aGame == GAME_COD11) {
|
||||
resultFF = std::make_shared<FastFile_COD11_PS3>(aData);
|
||||
resultFF = new FastFile_COD11_PS3(aData);
|
||||
} else if (aGame == GAME_COD12) {
|
||||
resultFF = std::make_shared<FastFile_COD12_PS3>(aData);
|
||||
resultFF = new FastFile_COD12_PS3(aData);
|
||||
}
|
||||
} else if (aPlatform == PLATFORM_WII) {
|
||||
if (aGame == GAME_COD4) {
|
||||
resultFF = std::make_shared<FastFile_COD4_Wii>(aData);
|
||||
resultFF = new FastFile_COD4_Wii(aData);
|
||||
} else if (aGame == GAME_COD7) {
|
||||
resultFF = std::make_shared<FastFile_COD7_Wii>(aData);
|
||||
resultFF = new FastFile_COD7_Wii(aData);
|
||||
} else if (aGame == GAME_COD8) {
|
||||
resultFF = std::make_shared<FastFile_COD8_Wii>(aData);
|
||||
resultFF = new FastFile_COD8_Wii(aData);
|
||||
}
|
||||
} else if (aPlatform == PLATFORM_WIIU) {
|
||||
if (aGame == GAME_COD9) {
|
||||
resultFF = std::make_shared<FastFile_COD9_WiiU>(aData);
|
||||
resultFF = new FastFile_COD9_WiiU(aData);
|
||||
} else if (aGame == GAME_COD10) {
|
||||
resultFF = std::make_shared<FastFile_COD10_WiiU>(aData);
|
||||
resultFF = new FastFile_COD10_WiiU(aData);
|
||||
}
|
||||
}
|
||||
if (resultFF) {
|
||||
|
||||
@ -81,7 +81,7 @@ IWIFile::IWIFile(const QString &aFilePath) :
|
||||
file.close();
|
||||
}
|
||||
|
||||
IWIFile::IWIFile(DDSFile &aDDSFile) {
|
||||
IWIFile::IWIFile(const DDSFile &aDDSFile) {
|
||||
// Ensure the DDS file has mipmaps
|
||||
if (aDDSFile.mipmaps.isEmpty()) {
|
||||
qDebug() << "Error: No mipmaps found in DDS file!";
|
||||
@ -136,7 +136,7 @@ IWIFile::~IWIFile() {
|
||||
|
||||
}
|
||||
|
||||
void IWIFile::SetupExportDirs() {
|
||||
void IWIFile::SetupExportDirs() const {
|
||||
QDir dir = QDir::currentPath();
|
||||
if (!dir.exists("exports/")) {
|
||||
dir.mkdir("exports/");
|
||||
@ -156,7 +156,7 @@ void IWIFile::SetupExportDirs() {
|
||||
}
|
||||
}
|
||||
|
||||
bool IWIFile::SaveIWI() {
|
||||
bool IWIFile::SaveIWI() const {
|
||||
SetupExportDirs();
|
||||
QFile file("exports/iwi/" + fileStem + ".iwi");
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
@ -210,7 +210,7 @@ bool IWIFile::SaveIWI() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IWIFile::SaveDDS() {
|
||||
bool IWIFile::SaveDDS() const {
|
||||
SetupExportDirs();
|
||||
QFile file("exports/dds/" + fileStem + ".dds");
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
@ -267,7 +267,7 @@ bool IWIFile::SaveDDS() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IWIFile::SavePNG() {
|
||||
bool IWIFile::SavePNG() const {
|
||||
DDSFile ddsFile(*this);
|
||||
if (!ddsFile.SavePNG()) {
|
||||
qDebug() << "Error: Failed to save PNG file: " << fileStem + ".png";
|
||||
@ -276,7 +276,7 @@ bool IWIFile::SavePNG() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IWIFile::SaveJPG() {
|
||||
bool IWIFile::SaveJPG() const {
|
||||
DDSFile ddsFile(*this);
|
||||
if (!ddsFile.SavePNG()) {
|
||||
qDebug() << "Error: Failed to save JPG file: " << fileStem + ".jpg";
|
||||
|
||||
@ -9,6 +9,8 @@
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
|
||||
#include "ddsfile.h"
|
||||
|
||||
// Supported versions
|
||||
static const QVector<quint8> supportedVersions = {
|
||||
0x05, // CoD2
|
||||
@ -18,8 +20,6 @@ static const QVector<quint8> supportedVersions = {
|
||||
0x1B // CoDBO2
|
||||
};
|
||||
|
||||
class DDSFile;
|
||||
|
||||
struct IWIHeader {
|
||||
char Magic[3];
|
||||
quint8 Version;
|
||||
@ -50,16 +50,16 @@ public:
|
||||
|
||||
IWIFile();
|
||||
IWIFile(const QString &aFilePath);
|
||||
IWIFile(DDSFile &aDDSFile);
|
||||
IWIFile(const DDSFile &aDDSFile);
|
||||
IWIFile(const IWIFile &iwiFile);
|
||||
IWIFile& operator=(const IWIFile& other);
|
||||
~IWIFile();
|
||||
|
||||
bool SaveIWI();
|
||||
bool SaveDDS();
|
||||
bool SavePNG();
|
||||
bool SaveJPG();
|
||||
void SetupExportDirs();
|
||||
bool SaveIWI() const;
|
||||
bool SaveDDS() const;
|
||||
bool SavePNG() const;
|
||||
bool SaveJPG() const;
|
||||
void SetupExportDirs() const;
|
||||
};
|
||||
|
||||
#endif // IWIFILE_H
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
#include "assets_cod10_360.h"
|
||||
|
||||
Assets_COD10_360::Assets_COD10_360()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD10_360::~Assets_COD10_360()
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef ASSETS_COD10_360_H
|
||||
#define ASSETS_COD10_360_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD10_360 : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD10_360();
|
||||
~Assets_COD10_360();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD10_360_H
|
||||
@ -1,11 +0,0 @@
|
||||
#include "assets_cod11_360.h"
|
||||
|
||||
Assets_COD11_360::Assets_COD11_360()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD11_360::~Assets_COD11_360()
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef ASSETS_COD11_360_H
|
||||
#define ASSETS_COD11_360_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD11_360 : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD11_360();
|
||||
~Assets_COD11_360();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD11_360_H
|
||||
@ -1,11 +0,0 @@
|
||||
#include "assets_cod12_360.h"
|
||||
|
||||
Assets_COD12_360::Assets_COD12_360()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD12_360::~Assets_COD12_360()
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef ASSETS_COD12_360_H
|
||||
#define ASSETS_COD12_360_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD12_360 : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD12_360();
|
||||
~Assets_COD12_360();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD12_360_H
|
||||
@ -1,11 +0,0 @@
|
||||
#include "assets_cod2_360.h"
|
||||
|
||||
Assets_COD2_360::Assets_COD2_360()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD2_360::~Assets_COD2_360()
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef ASSETS_COD2_360_H
|
||||
#define ASSETS_COD2_360_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD2_360 : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD2_360();
|
||||
~Assets_COD2_360();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD2_360_H
|
||||
@ -1,12 +0,0 @@
|
||||
#include "assets_cod4_360.h"
|
||||
|
||||
Assets_COD4_360::Assets_COD4_360(QObject *parent)
|
||||
: Assets(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD4_360::~Assets_COD4_360() {
|
||||
|
||||
}
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
#ifndef ASSETS_COD4_360_H
|
||||
#define ASSETS_COD4_360_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD4_360 : public Assets
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Assets_COD4_360(QObject *parent = nullptr);
|
||||
~Assets_COD4_360();
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD4_360_H
|
||||
@ -1,11 +0,0 @@
|
||||
#include "assets_cod5_360.h"
|
||||
|
||||
Assets_COD5_360::Assets_COD5_360()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD5_360::~Assets_COD5_360()
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef ASSETS_COD5_360_H
|
||||
#define ASSETS_COD5_360_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD5_360 : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD5_360();
|
||||
~Assets_COD5_360();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD5_360_H
|
||||
@ -1,11 +0,0 @@
|
||||
#include "assets_cod6_360.h"
|
||||
|
||||
Assets_COD6_360::Assets_COD6_360()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD6_360::~Assets_COD6_360()
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef ASSETS_COD6_360_H
|
||||
#define ASSETS_COD6_360_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD6_360 : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD6_360();
|
||||
~Assets_COD6_360();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD6_360_H
|
||||
@ -1,11 +0,0 @@
|
||||
#include "assets_cod7_360.h"
|
||||
|
||||
Assets_COD7_360::Assets_COD7_360()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD7_360::~Assets_COD7_360()
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef ASSETS_COD7_360_H
|
||||
#define ASSETS_COD7_360_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD7_360 : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD7_360();
|
||||
~Assets_COD7_360();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD7_360_H
|
||||
@ -1,11 +0,0 @@
|
||||
#include "assets_cod8_360.h"
|
||||
|
||||
Assets_COD8_360::Assets_COD8_360()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD8_360::~Assets_COD8_360()
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef ASSETS_COD8_360_H
|
||||
#define ASSETS_COD8_360_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD8_360 : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD8_360();
|
||||
~Assets_COD8_360();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD8_360_H
|
||||
@ -1,11 +0,0 @@
|
||||
#include "assets_cod9_360.h"
|
||||
|
||||
Assets_COD9_360::Assets_COD9_360()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD9_360::~Assets_COD9_360()
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef ASSETS_COD9_360_H
|
||||
#define ASSETS_COD9_360_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD9_360 : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD9_360();
|
||||
~Assets_COD9_360();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD9_360_H
|
||||
@ -1,11 +0,0 @@
|
||||
#include "assets_cod10_pc.h"
|
||||
|
||||
Assets_COD10_PC::Assets_COD10_PC()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Assets_COD10_PC::~Assets_COD10_PC()
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef ASSETS_COD10_PC_H
|
||||
#define ASSETS_COD10_PC_H
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
class Assets_COD10_PC : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD10_PC();
|
||||
~Assets_COD10_PC();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD10_PC_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user