IW5 support initial commit

This commit is contained in:
Jan
2021-07-23 01:12:36 +02:00
parent c6ea52018a
commit f201dfafd8
102 changed files with 8835 additions and 0 deletions

View File

View File

@ -0,0 +1,5 @@
#pragma once
namespace IW5
{
}

View File

@ -0,0 +1,43 @@
#include "GameIW5.h"
#include <algorithm>
#include "IW5.h"
using namespace IW5;
GameIW5 g_GameIW5;
std::string GameIW5::GetFullName()
{
return "Call Of Duty: Modern Warfare 3";
}
std::string GameIW5::GetShortName()
{
return "IW5";
}
void GameIW5::AddZone(Zone* zone)
{
m_zones.push_back(zone);
}
void GameIW5::RemoveZone(Zone* zone)
{
const auto foundEntry = std::find(m_zones.begin(), m_zones.end(), zone);
if (foundEntry != m_zones.end())
m_zones.erase(foundEntry);
}
std::vector<Zone*> GameIW5::GetZones()
{
return m_zones;
}
std::vector<GameLanguagePrefix> GameIW5::GetLanguagePrefixes()
{
std::vector<GameLanguagePrefix> prefixes;
return prefixes;
}

View File

@ -0,0 +1,17 @@
#pragma once
#include "Game/IGame.h"
class GameIW5 : public IGame
{
std::vector<Zone*> m_zones;
public:
std::string GetFullName() override;
std::string GetShortName() override;
void AddZone(Zone* zone) override;
void RemoveZone(Zone* zone) override;
std::vector<Zone*> GetZones() override;
std::vector<GameLanguagePrefix> GetLanguagePrefixes() override;
};
extern GameIW5 g_GameIW5;

82
src/Common/Game/IW5/IW5.h Normal file
View File

@ -0,0 +1,82 @@
#pragma once
//#include <d3d11.h>
#include "Image/Texture.h"
#include "IW5_Assets.h"
namespace IW5
{
struct DB_AuthHash
{
char bytes[32];
};
struct DB_AuthSignature
{
char bytes[256];
};
struct DB_AuthSubHeader
{
char fastfileName[32];
unsigned int reserved;
DB_AuthHash masterBlockHashes[244];
};
struct DB_AuthHeader
{
char magic[8]; // + 0
unsigned int reserved; // + 8
DB_AuthHash subheaderHash; // + 12
DB_AuthSignature signedSubheaderHash; // + 44
DB_AuthSubHeader subheader; // + 300
};
struct ScriptStringList
{
int count;
const char** strings;
};
struct XAsset
{
XAssetType type;
XAssetHeader header;
};
struct XAssetList
{
ScriptStringList stringList;
int assetCount;
XAsset* assets;
};
struct cspField_t
{
const char* szName;
int iOffset;
int iFieldType;
};
enum csParseFieldType_t
{
CSPFT_STRING = 0,
CSPFT_STRING_MAX_STRING_CHARS,
CSPFT_STRING_MAX_QPATH,
CSPFT_STRING_MAX_OSPATH,
CSPFT_INT,
CSPFT_QBOOLEAN,
CSPFT_BOOL,
CSPFT_FLOAT,
CSPFT_MPH_TO_INCHES_PER_SEC,
CSPFT_MILLISECONDS,
CSPFT_FX,
CSPFT_XMODEL,
CSPFT_MATERIAL,
CSPFT_SOUND,
CSPFT_TRACER,
CSPFT_NUM_BASE_FIELD_TYPES,
};
}

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,12 @@
#define memb_align(x) alignas(x)
#define gcc_align(x)
#else
#ifdef __ida
#define type_align(x) __declspec(align(x))
#define tdef_align(x) __declspec(align(x))
#define memb_align(x) __declspec(align(x))
#define gcc_align(x)
#else
#ifdef _MSVC_LANG
#define type_align(x) __declspec(align(x))
#define tdef_align(x) __declspec(align(x))
@ -31,4 +37,5 @@
#define memb_align(x) __attribute__((__aligned__(x)))
#define gcc_align(x) __attribute__((__aligned__(x)))
#endif
#endif
#endif