move zoneloaderfactories in their respective game namespaces

This commit is contained in:
Jan
2020-10-17 16:04:26 +02:00
parent f0c8ffa6be
commit f3afaf3110
5 changed files with 76 additions and 66 deletions

View File

@ -16,25 +16,27 @@
#include "Utils/ClassUtils.h"
#include <cassert>
#include "Loading/Steps/StepLoadZoneContent.h"
#include "ContentLoader.h"
#include "ContentLoaderT6.h"
#include "Game/T6/GameAssetPoolT6.h"
#include "Game/T6/GameT6.h"
#include "Game/GameLanguage.h"
const std::string ZoneLoaderFactoryT6::MAGIC_SIGNED_TREYARCH = "TAff0100";
const std::string ZoneLoaderFactoryT6::MAGIC_SIGNED_ASSET_BUILDER = "ABff0100";
const std::string ZoneLoaderFactoryT6::MAGIC_UNSIGNED = "TAffu100";
const std::string ZoneLoaderFactoryT6::MAGIC_UNSIGNED_SERVER = "TAsvu100";
const int ZoneLoaderFactoryT6::VERSION = 147;
using namespace T6;
const int ZoneLoaderFactoryT6::STREAM_COUNT = 4;
const int ZoneLoaderFactoryT6::XCHUNK_SIZE = 0x8000;
const int ZoneLoaderFactoryT6::VANILLA_BUFFER_SIZE = 0x80000;
const int ZoneLoaderFactoryT6::OFFSET_BLOCK_BIT_COUNT = 3;
const block_t ZoneLoaderFactoryT6::INSERT_BLOCK = T6::XFILE_BLOCK_VIRTUAL;
const std::string ZoneLoaderFactory::MAGIC_SIGNED_TREYARCH = "TAff0100";
const std::string ZoneLoaderFactory::MAGIC_SIGNED_ASSET_BUILDER = "ABff0100";
const std::string ZoneLoaderFactory::MAGIC_UNSIGNED = "TAffu100";
const std::string ZoneLoaderFactory::MAGIC_UNSIGNED_SERVER = "TAsvu100";
const int ZoneLoaderFactory::VERSION = 147;
const std::string ZoneLoaderFactoryT6::MAGIC_AUTH_HEADER = "PHEEBs71";
const uint8_t ZoneLoaderFactoryT6::SALSA20_KEY_TREYARCH[]
const int ZoneLoaderFactory::STREAM_COUNT = 4;
const int ZoneLoaderFactory::XCHUNK_SIZE = 0x8000;
const int ZoneLoaderFactory::VANILLA_BUFFER_SIZE = 0x80000;
const int ZoneLoaderFactory::OFFSET_BLOCK_BIT_COUNT = 3;
const block_t ZoneLoaderFactory::INSERT_BLOCK = T6::XFILE_BLOCK_VIRTUAL;
const std::string ZoneLoaderFactory::MAGIC_AUTH_HEADER = "PHEEBs71";
const uint8_t ZoneLoaderFactory::SALSA20_KEY_TREYARCH[]
{
0x64, 0x1D, 0x8A, 0x2F,
0xE3, 0x1D, 0x3A, 0xA6,
@ -46,7 +48,7 @@ const uint8_t ZoneLoaderFactoryT6::SALSA20_KEY_TREYARCH[]
0x5E, 0xDC, 0x50, 0xBE
};
const uint8_t ZoneLoaderFactoryT6::RSA_PUBLIC_KEY_TREYARCH[]
const uint8_t ZoneLoaderFactory::RSA_PUBLIC_KEY_TREYARCH[]
{
0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01,
0x00, 0xc7, 0x9d, 0x33, 0xe0, 0x75, 0xaf, 0xef,
@ -84,7 +86,7 @@ const uint8_t ZoneLoaderFactoryT6::RSA_PUBLIC_KEY_TREYARCH[]
0x8b, 0x02, 0x03, 0x01, 0x00, 0x01
};
class ZoneLoaderFactoryT6::ZoneLoaderFactoryT6Impl
class ZoneLoaderFactory::Impl
{
static GameLanguage GetZoneLanguage(std::string& zoneName)
{
@ -258,7 +260,7 @@ public:
zoneLoader->AddLoadingStep(new StepAllocXBlocks());
// Start of the zone content
zoneLoader->AddLoadingStep(new StepLoadZoneContent(new ContentLoaderT6(), zone, OFFSET_BLOCK_BIT_COUNT, INSERT_BLOCK));
zoneLoader->AddLoadingStep(new StepLoadZoneContent(new ContentLoader(), zone, OFFSET_BLOCK_BIT_COUNT, INSERT_BLOCK));
if(isSecure)
{
@ -270,7 +272,7 @@ public:
}
};
ZoneLoader* ZoneLoaderFactoryT6::CreateLoaderForHeader(ZoneHeader& header, std::string& fileName)
ZoneLoader* ZoneLoaderFactory::CreateLoaderForHeader(ZoneHeader& header, std::string& fileName)
{
return ZoneLoaderFactoryT6Impl::CreateLoaderForHeader(header, fileName);
return Impl::CreateLoaderForHeader(header, fileName);
}

View File

@ -3,26 +3,29 @@
#include "Loading/IZoneLoaderFactory.h"
#include <string>
class ZoneLoaderFactoryT6 final : public IZoneLoaderFactory
namespace T6
{
static const std::string MAGIC_SIGNED_TREYARCH;
static const std::string MAGIC_SIGNED_ASSET_BUILDER;
static const std::string MAGIC_UNSIGNED;
static const std::string MAGIC_UNSIGNED_SERVER;
static const int VERSION;
class ZoneLoaderFactory final : public IZoneLoaderFactory
{
static const std::string MAGIC_SIGNED_TREYARCH;
static const std::string MAGIC_SIGNED_ASSET_BUILDER;
static const std::string MAGIC_UNSIGNED;
static const std::string MAGIC_UNSIGNED_SERVER;
static const int VERSION;
static const int STREAM_COUNT;
static const int XCHUNK_SIZE;
static const int VANILLA_BUFFER_SIZE;
static const int OFFSET_BLOCK_BIT_COUNT;
static const block_t INSERT_BLOCK;
static const int STREAM_COUNT;
static const int XCHUNK_SIZE;
static const int VANILLA_BUFFER_SIZE;
static const int OFFSET_BLOCK_BIT_COUNT;
static const block_t INSERT_BLOCK;
static const std::string MAGIC_AUTH_HEADER;
static const uint8_t SALSA20_KEY_TREYARCH[];
static const uint8_t RSA_PUBLIC_KEY_TREYARCH[];
static const std::string MAGIC_AUTH_HEADER;
static const uint8_t SALSA20_KEY_TREYARCH[];
static const uint8_t RSA_PUBLIC_KEY_TREYARCH[];
class ZoneLoaderFactoryT6Impl;
class Impl;
public:
ZoneLoader* CreateLoaderForHeader(ZoneHeader& header, std::string& fileName) override;
};
public:
ZoneLoader* CreateLoaderForHeader(ZoneHeader& header, std::string& fileName) override;
};
}