Import code from previous AssetBuilder version

This commit is contained in:
Jan
2019-09-24 10:45:09 +02:00
parent 5609557516
commit 0d8432d4f7
919 changed files with 154412 additions and 26 deletions

View File

@ -0,0 +1,11 @@
#pragma once
#include "Zone/ZoneTypes.h"
class IZoneStream
{
public:
virtual ~IZoneStream() = default;
virtual void PushBlock(block_t block) = 0;
virtual block_t PopBlock() = 0;
};

View File

@ -0,0 +1,9 @@
#pragma once
#include <string>
class XAssetDependency
{
public:
int m_type;
std::string m_name;
};

View File

@ -0,0 +1,33 @@
#include "XBlock.h"
#include <cassert>
XBlock::XBlock(const std::string& name, const int index, const Type type)
{
m_name = name;
m_index = index;
m_type = type;
m_buffer = nullptr;
m_buffer_size = 0;
}
XBlock::~XBlock()
{
delete[] m_buffer;
m_buffer = nullptr;
}
void XBlock::Alloc(const size_t blockSize)
{
delete[] m_buffer;
if(blockSize > 0)
{
m_buffer = new uint8_t[blockSize];
m_buffer_size = blockSize;
}
else
{
m_buffer = nullptr;
m_buffer_size = 0;
}
}

View File

@ -0,0 +1,26 @@
#pragma once
#include <string>
class XBlock
{
public:
enum Type
{
BLOCK_TYPE_TEMP,
BLOCK_TYPE_RUNTIME,
BLOCK_TYPE_DELAY,
BLOCK_TYPE_NORMAL
};
std::string m_name;
int m_index;
Type m_type;
uint8_t* m_buffer;
size_t m_buffer_size;
XBlock(const std::string& name, int index, Type type);
~XBlock();
void Alloc(size_t blockSize);
};

View File

@ -0,0 +1,14 @@
#include "Zone.h"
Zone::Zone(std::string name, const zone_priority_t priority, IZoneAssetPools* pools, IGame* game)
{
m_name = std::move(name);
m_priority = priority;
m_pools = pools;
m_game = game;
}
IZoneAssetPools* Zone::GetPools() const
{
return m_pools;
}

View File

@ -0,0 +1,21 @@
#pragma once
#include "ZoneTypes.h"
#include "Pool/IZoneAssetPools.h"
#include "Game/IGame.h"
#include <string>
class IGame;
class Zone
{
std::string m_name;
zone_priority_t m_priority;
IZoneAssetPools* m_pools;
public:
IGame* m_game;
Zone(std::string name, zone_priority_t priority, IZoneAssetPools* pools, IGame* game);
IZoneAssetPools* GetPools() const;
};

View File

@ -0,0 +1,24 @@
#pragma once
#include <cstdint>
struct ZoneHeader
{
uint8_t m_magic[8];
uint32_t m_version;
};
#ifdef _WIN64
typedef uint32_t scr_string_t;
typedef uint64_t xchunk_size_t;
typedef uint64_t xblock_size_t;
typedef uint64_t zone_pointer_t;
#elif _WIN32
typedef uint16_t scr_string_t;
typedef uint32_t xchunk_size_t;
typedef uint32_t xblock_size_t;
typedef uint32_t zone_pointer_t;
#endif
typedef int block_t;
typedef int asset_type_t;
typedef unsigned int zone_priority_t;