mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 21:07:42 +00:00
Merge branch 'master' of ssh://git.axiodl.com:6431/AxioDL/hecl
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "boo/graphicsdev/IGraphicsDataFactory.hpp"
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
||||
|
||||
#include "hecl.hpp"
|
||||
#include "../extern/boo/xxhash/xxhash.h"
|
||||
|
||||
namespace hecl::Backend {
|
||||
struct ExtensionSlot;
|
||||
@@ -186,7 +194,7 @@ struct Function {
|
||||
};
|
||||
|
||||
struct ExtensionSlot {
|
||||
const char* shaderMacro;
|
||||
const char* shaderMacro = nullptr;
|
||||
size_t texCount = 0;
|
||||
const Backend::TextureInfo* texs = nullptr;
|
||||
Backend::BlendFactor srcFactor = Backend::BlendFactor::Original;
|
||||
@@ -201,14 +209,13 @@ struct ExtensionSlot {
|
||||
bool forceAlphaTest = false;
|
||||
bool diffuseOnly = false;
|
||||
|
||||
ExtensionSlot(size_t texCount = 0,
|
||||
const Backend::TextureInfo* texs = nullptr,
|
||||
Backend::BlendFactor srcFactor = Backend::BlendFactor::Original,
|
||||
Backend::BlendFactor dstFactor = Backend::BlendFactor::Original,
|
||||
Backend::ZTest depthTest = Backend::ZTest::Original,
|
||||
Backend::CullMode cullMode = Backend::CullMode::Backface, bool noDepthWrite = false,
|
||||
bool noColorWrite = false, bool noAlphaWrite = false, bool noAlphaOverwrite = false,
|
||||
bool noReflection = false, bool forceAlphaTest = false, bool diffuseOnly = false)
|
||||
constexpr ExtensionSlot(size_t texCount = 0, const Backend::TextureInfo* texs = nullptr,
|
||||
Backend::BlendFactor srcFactor = Backend::BlendFactor::Original,
|
||||
Backend::BlendFactor dstFactor = Backend::BlendFactor::Original,
|
||||
Backend::ZTest depthTest = Backend::ZTest::Original,
|
||||
Backend::CullMode cullMode = Backend::CullMode::Backface, bool noDepthWrite = false,
|
||||
bool noColorWrite = false, bool noAlphaWrite = false, bool noAlphaOverwrite = false,
|
||||
bool noReflection = false, bool forceAlphaTest = false, bool diffuseOnly = false) noexcept
|
||||
: texCount(texCount)
|
||||
, texs(texs)
|
||||
, srcFactor(srcFactor)
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
#pragma once
|
||||
#include "hecl/hecl.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
#include "hecl/FourCC.hpp"
|
||||
#include "athena/DNA.hpp"
|
||||
#include "athena/MemoryReader.hpp"
|
||||
#include "hecl/SystemChar.hpp"
|
||||
|
||||
#include <athena/DNA.hpp>
|
||||
|
||||
namespace athena::io {
|
||||
class MemoryReader;
|
||||
}
|
||||
|
||||
namespace hecl::blender {
|
||||
enum class BlendType;
|
||||
|
||||
struct SDNABlock : public athena::io::DNA<athena::Little> {
|
||||
struct SDNABlock : public athena::io::DNA<athena::Endian::Little> {
|
||||
AT_DECL_DNA
|
||||
DNAFourCC magic;
|
||||
DNAFourCC nameMagic;
|
||||
@@ -22,11 +31,11 @@ struct SDNABlock : public athena::io::DNA<athena::Little> {
|
||||
Align<4> align3;
|
||||
DNAFourCC strcMagic;
|
||||
Value<atUint32> numStrcs;
|
||||
struct SDNAStruct : public athena::io::DNA<athena::Little> {
|
||||
struct SDNAStruct : public athena::io::DNA<athena::Endian::Little> {
|
||||
AT_DECL_DNA
|
||||
Value<atUint16> type;
|
||||
Value<atUint16> numFields;
|
||||
struct SDNAField : public athena::io::DNA<athena::Little> {
|
||||
struct SDNAField : public athena::io::DNA<athena::Endian::Little> {
|
||||
AT_DECL_DNA
|
||||
Value<atUint16> type;
|
||||
Value<atUint16> name;
|
||||
@@ -42,7 +51,7 @@ struct SDNABlock : public athena::io::DNA<athena::Little> {
|
||||
const SDNAStruct* lookupStruct(const char* n, atUint32& idx) const;
|
||||
};
|
||||
|
||||
struct FileBlock : public athena::io::DNA<athena::Little> {
|
||||
struct FileBlock : public athena::io::DNA<athena::Endian::Little> {
|
||||
AT_DECL_DNA
|
||||
DNAFourCC type;
|
||||
Value<atUint32> size;
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include <athena/Types.hpp>
|
||||
#include <athena/Global.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <athena/DNAYaml.hpp>
|
||||
#include <athena/Global.hpp>
|
||||
#include <athena/Types.hpp>
|
||||
|
||||
namespace hecl {
|
||||
namespace DNACVAR {
|
||||
enum class EType : atUint8 { Boolean, Integer, Float, Literal, Vec4f };
|
||||
enum class EType : atUint8 { Boolean, Signed, Unsigned, Real, Literal, Vec2f, Vec2d, Vec3f, Vec3d, Vec4f, Vec4d };
|
||||
|
||||
enum EFlags {
|
||||
None = -1,
|
||||
enum class EFlags {
|
||||
None = 0,
|
||||
System = (1 << 0),
|
||||
Game = (1 << 1),
|
||||
Editor = (1 << 2),
|
||||
@@ -22,18 +24,21 @@ enum EFlags {
|
||||
Archive = (1 << 7),
|
||||
InternalArchivable = (1 << 8),
|
||||
Modified = (1 << 9),
|
||||
ModifyRestart = (1 << 10) /*!< If this bit is set, any modification will inform the user that a restart is required */
|
||||
ModifyRestart = (1 << 10), //!< If this bit is set, any modification will inform the user that a restart is required
|
||||
Color = (1 << 11), //!< If this bit is set, Vec3f and Vec4f will be displayed in the console with a colored square
|
||||
NoDeveloper = (1 << 12), //!< Not even developer mode can modify this
|
||||
Any = -1
|
||||
};
|
||||
ENABLE_BITWISE_ENUM(EFlags)
|
||||
|
||||
class CVar : public athena::io::DNA<athena::Big> {
|
||||
class CVar : public athena::io::DNA<athena::Endian::Big> {
|
||||
public:
|
||||
AT_DECL_DNA
|
||||
String<-1> m_name;
|
||||
String<-1> m_value;
|
||||
};
|
||||
|
||||
struct CVarContainer : public athena::io::DNA<athena::Big> {
|
||||
struct CVarContainer : public athena::io::DNA<athena::Endian::Big> {
|
||||
AT_DECL_DNA
|
||||
Value<atUint32> magic = 'CVAR';
|
||||
Value<atUint32> cvarCount;
|
||||
@@ -53,40 +58,61 @@ public:
|
||||
using EType = DNACVAR::EType;
|
||||
using EFlags = DNACVAR::EFlags;
|
||||
|
||||
CVar(std::string_view name, std::string_view value, std::string_view help, EType type, EFlags flags,
|
||||
CVarManager& parent);
|
||||
CVar(std::string_view name, std::string_view value, std::string_view help, EFlags flags, CVarManager& parent);
|
||||
CVar(std::string_view name, float value, std::string_view help, EFlags flags, CVarManager& parent);
|
||||
CVar(std::string_view name, bool value, std::string_view help, EFlags flags, CVarManager& parent);
|
||||
CVar(std::string_view name, int value, std::string_view help, EFlags flags, CVarManager& parent);
|
||||
CVar(std::string_view name, const atVec4f& value, std::string_view help, EFlags flags, CVarManager& parent);
|
||||
CVar(std::string_view name, std::string_view value, std::string_view help, EFlags flags);
|
||||
CVar(std::string_view name, const atVec2f& value, std::string_view help, EFlags flags);
|
||||
CVar(std::string_view name, const atVec2d& value, std::string_view help, EFlags flags);
|
||||
CVar(std::string_view name, const atVec3f& value, std::string_view help, EFlags flags);
|
||||
CVar(std::string_view name, const atVec3d& value, std::string_view help, EFlags flags);
|
||||
CVar(std::string_view name, const atVec4f& value, std::string_view help, EFlags flags);
|
||||
CVar(std::string_view name, const atVec4d& value, std::string_view help, EFlags flags);
|
||||
CVar(std::string_view name, double value, std::string_view help, EFlags flags);
|
||||
CVar(std::string_view name, bool value, std::string_view help, EFlags flags);
|
||||
CVar(std::string_view name, int32_t value, std::string_view help, EFlags flags);
|
||||
CVar(std::string_view name, uint32_t value, std::string_view help, EFlags flags);
|
||||
|
||||
std::string_view name() const { return m_name; }
|
||||
std::string_view rawHelp() const { return m_help; }
|
||||
std::string help() const;
|
||||
std::string value() const { return m_value; }
|
||||
|
||||
atVec2f toVec2f(bool* isValid = nullptr) const;
|
||||
atVec2d toVec2d(bool* isValie = nullptr) const;
|
||||
atVec3f toVec3f(bool* isValid = nullptr) const;
|
||||
atVec3d toVec3d(bool* isValie = nullptr) const;
|
||||
atVec4f toVec4f(bool* isValid = nullptr) const;
|
||||
float toFloat(bool* isValid = nullptr) const;
|
||||
atVec4d toVec4d(bool* isValie = nullptr) const;
|
||||
double toReal(bool* isValid = nullptr) const;
|
||||
bool toBoolean(bool* isValid = nullptr) const;
|
||||
int toInteger(bool* isValid = nullptr) const;
|
||||
int32_t toSigned(bool* isValid = nullptr) const;
|
||||
uint32_t toUnsigned(bool* isValid = nullptr) const;
|
||||
std::wstring toWideLiteral(bool* isValid = nullptr) const;
|
||||
std::string toLiteral(bool* isValid = nullptr) const;
|
||||
|
||||
bool fromVec2f(const atVec2f& val);
|
||||
bool fromVec2d(const atVec2d& val);
|
||||
bool fromVec3f(const atVec3f& val);
|
||||
bool fromVec3d(const atVec3d& val);
|
||||
bool fromVec4f(const atVec4f& val);
|
||||
bool fromFloat(float val);
|
||||
bool fromVec4d(const atVec4d& val);
|
||||
bool fromReal(double val);
|
||||
bool fromBoolean(bool val);
|
||||
bool fromInteger(int val);
|
||||
bool fromInteger(int32_t val);
|
||||
bool fromInteger(uint32_t val);
|
||||
bool fromLiteral(std::string_view val);
|
||||
bool fromLiteral(std::wstring_view val);
|
||||
bool fromLiteralToType(std::string_view val, bool setDefault = false);
|
||||
bool fromLiteralToType(std::wstring_view val, bool setDefault = false);
|
||||
bool fromLiteralToType(std::string_view val);
|
||||
bool fromLiteralToType(std::wstring_view val);
|
||||
|
||||
bool isFloat() const { return m_type == EType::Float; }
|
||||
bool isBoolean() const { return m_type == EType::Boolean; }
|
||||
bool isInteger() const { return m_type == EType::Integer; }
|
||||
bool isLiteral() const { return m_type == EType::Literal; }
|
||||
bool isVec2f() const { return m_type == EType::Vec2f; }
|
||||
bool isVec2d() const { return m_type == EType::Vec2d; }
|
||||
bool isVec3f() const { return m_type == EType::Vec3f; }
|
||||
bool isVec3d() const { return m_type == EType::Vec3d; }
|
||||
bool isVec4f() const { return m_type == EType::Vec4f; }
|
||||
bool isVec4d() const { return m_type == EType::Vec4d; }
|
||||
bool isFloat() const { return m_type == EType::Real; }
|
||||
bool isBoolean() const { return m_type == EType::Boolean; }
|
||||
bool isInteger() const { return m_type == EType::Signed || m_type == EType::Unsigned; }
|
||||
bool isLiteral() const { return m_type == EType::Literal; }
|
||||
bool isModified() const;
|
||||
bool modificationRequiresRestart() const;
|
||||
bool isReadOnly() const;
|
||||
@@ -94,10 +120,10 @@ public:
|
||||
bool isHidden() const;
|
||||
bool isArchive() const;
|
||||
bool isInternalArchivable() const;
|
||||
bool isNoDeveloper() const;
|
||||
bool isColor() const;
|
||||
bool wasDeserialized() const;
|
||||
bool hasDefaultValue() const;
|
||||
void clearModified();
|
||||
void setModified();
|
||||
|
||||
EType type() const { return m_type; }
|
||||
EFlags flags() const { return (m_unlocked ? m_oldFlags : m_flags); }
|
||||
@@ -119,19 +145,24 @@ public:
|
||||
|
||||
void addListener(ListenerFunc func) { m_listeners.push_back(std::move(func)); }
|
||||
|
||||
bool isValidInput(std::string_view input) const;
|
||||
bool isValidInput(std::wstring_view input) const;
|
||||
|
||||
private:
|
||||
CVar(std::string_view name, std::string_view help, EType type) : m_help(help), m_type(type) { m_name = name; }
|
||||
void dispatch();
|
||||
EType m_type;
|
||||
void clearModified();
|
||||
void setModified();
|
||||
std::string m_help;
|
||||
EType m_type;
|
||||
std::string m_defaultValue;
|
||||
EFlags m_flags;
|
||||
EFlags m_oldFlags;
|
||||
EFlags m_flags = EFlags::None;
|
||||
EFlags m_oldFlags = EFlags::None;
|
||||
bool m_unlocked = false;
|
||||
bool m_wasDeserialized = false;
|
||||
|
||||
CVarManager& m_mgr;
|
||||
|
||||
std::vector<ListenerFunc> m_listeners;
|
||||
bool safeToModify(EType type) const;
|
||||
void init(EFlags flags, bool removeColor=true);
|
||||
};
|
||||
|
||||
class CVarUnlocker {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "CVarManager.hpp"
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "hecl/CVarManager.hpp"
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
@@ -14,7 +18,7 @@ using namespace std::literals;
|
||||
#elif defined(__APPLE__)
|
||||
#define DEFAULT_GRAPHICS_API "Metal"sv
|
||||
#else
|
||||
#define DEFAULT_GRAPHICS_API "OpenGL"sv
|
||||
#define DEFAULT_GRAPHICS_API "Vulkan"sv
|
||||
#endif
|
||||
|
||||
struct CVarCommons {
|
||||
@@ -43,13 +47,13 @@ struct CVarCommons {
|
||||
|
||||
void setGraphicsApi(std::string_view api) { m_graphicsApi->fromLiteral(api); }
|
||||
|
||||
uint32_t getSamples() const { return std::max(uint32_t(1), uint32_t(m_drawSamples->toInteger())); }
|
||||
uint32_t getSamples() const { return std::max(1u, m_drawSamples->toUnsigned()); }
|
||||
|
||||
void setSamples(uint32_t v) { m_drawSamples->fromInteger(std::max(uint32_t(1), v)); }
|
||||
|
||||
uint32_t getAnisotropy() const { return std::max(uint32_t(1), uint32_t(m_texAnisotropy->toInteger())); }
|
||||
uint32_t getAnisotropy() const { return std::max(1u, uint32_t(m_texAnisotropy->toUnsigned())); }
|
||||
|
||||
void setAnisotropy(uint32_t v) { m_texAnisotropy->fromInteger(std::max(uint32_t(1), v)); }
|
||||
void setAnisotropy(uint32_t v) { m_texAnisotropy->fromInteger(std::max(1u, v)); }
|
||||
|
||||
bool getDeepColor() const { return m_deepColor->toBoolean(); }
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "CVar.hpp"
|
||||
|
||||
#include "hecl/CVar.hpp"
|
||||
#include "hecl/SystemChar.hpp"
|
||||
|
||||
namespace hecl {
|
||||
@@ -17,7 +20,7 @@ class CVarManager final {
|
||||
using CVarContainer = DNACVAR::CVarContainer;
|
||||
template <typename T>
|
||||
CVar* _newCVar(std::string_view name, std::string_view help, const T& value, CVar::EFlags flags) {
|
||||
if (CVar* ret = registerCVar(std::make_unique<CVar>(name, value, help, flags, *this))) {
|
||||
if (CVar* ret = registerCVar(std::make_unique<CVar>(name, value, help, flags))) {
|
||||
deserialize(ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -36,20 +39,44 @@ public:
|
||||
CVarManager(hecl::Runtime::FileStoreManager& store, bool useBinary = false);
|
||||
~CVarManager();
|
||||
|
||||
CVar* newCVar(std::string_view name, std::string_view help, const atVec2f& value, CVar::EFlags flags) {
|
||||
return _newCVar<atVec2f>(name, help, value, flags);
|
||||
}
|
||||
CVar* newCVar(std::string_view name, std::string_view help, const atVec2d& value, CVar::EFlags flags) {
|
||||
return _newCVar<atVec2d>(name, help, value, flags);
|
||||
}
|
||||
CVar* newCVar(std::string_view name, std::string_view help, const atVec3f& value, CVar::EFlags flags) {
|
||||
return _newCVar<atVec3f>(name, help, value, flags);
|
||||
}
|
||||
CVar* newCVar(std::string_view name, std::string_view help, const atVec3d& value, CVar::EFlags flags) {
|
||||
return _newCVar<atVec3d>(name, help, value, flags);
|
||||
}
|
||||
CVar* newCVar(std::string_view name, std::string_view help, const atVec4f& value, CVar::EFlags flags) {
|
||||
return _newCVar<atVec4f>(name, help, value, flags);
|
||||
}
|
||||
CVar* newCVar(std::string_view name, std::string_view help, const atVec4d& value, CVar::EFlags flags) {
|
||||
return _newCVar<atVec4d>(name, help, value, flags);
|
||||
}
|
||||
CVar* newCVar(std::string_view name, std::string_view help, std::string_view value, CVar::EFlags flags) {
|
||||
return _newCVar<std::string_view>(name, help, value, flags);
|
||||
}
|
||||
CVar* newCVar(std::string_view name, std::string_view help, bool value, CVar::EFlags flags) {
|
||||
return _newCVar<bool>(name, help, value, flags);
|
||||
}
|
||||
// Float and double are internally identical, all floating point values are stored as `double`
|
||||
CVar* newCVar(std::string_view name, std::string_view help, float value, CVar::EFlags flags) {
|
||||
return _newCVar<float>(name, help, value, flags);
|
||||
return _newCVar<double>(name, help, static_cast<double>(value), flags);
|
||||
}
|
||||
CVar* newCVar(std::string_view name, std::string_view help, int value, CVar::EFlags flags) {
|
||||
return _newCVar<int>(name, help, value, flags);
|
||||
CVar* newCVar(std::string_view name, std::string_view help, double value, CVar::EFlags flags) {
|
||||
return _newCVar<double>(name, help, value, flags);
|
||||
}
|
||||
// Integer CVars can be seamlessly converted between either type, the distinction is to make usage absolutely clear
|
||||
CVar* newCVar(std::string_view name, std::string_view help, int32_t value, CVar::EFlags flags) {
|
||||
return _newCVar<int32_t>(name, help, value, flags);
|
||||
}
|
||||
|
||||
CVar* newCVar(std::string_view name, std::string_view help, uint32_t value, CVar::EFlags flags) {
|
||||
return _newCVar<uint32_t>(name, help, value, flags);
|
||||
}
|
||||
|
||||
CVar* registerCVar(std::unique_ptr<CVar>&& cvar);
|
||||
@@ -63,13 +90,15 @@ public:
|
||||
}
|
||||
|
||||
std::vector<CVar*> archivedCVars() const;
|
||||
std::vector<CVar*> cvars(CVar::EFlags filter = CVar::EFlags::None) const;
|
||||
std::vector<CVar*> cvars(CVar::EFlags filter = CVar::EFlags::Any) const;
|
||||
|
||||
void deserialize(CVar* cvar);
|
||||
void serialize();
|
||||
|
||||
static CVarManager* instance();
|
||||
|
||||
void proc();
|
||||
|
||||
void list(class Console* con, const std::vector<std::string>& args);
|
||||
void setCVar(class Console* con, const std::vector<std::string>& args);
|
||||
void getCVar(class Console* con, const std::vector<std::string>& args);
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "hecl.hpp"
|
||||
#include "Database.hpp"
|
||||
#include "boo/ThreadLocalPtr.hpp"
|
||||
#include "hecl/Blender/Token.hpp"
|
||||
#include <list>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
#include "hecl/Blender/Token.hpp"
|
||||
#include "hecl/hecl.hpp"
|
||||
#include "hecl/SystemChar.hpp"
|
||||
|
||||
#include <boo/ThreadLocalPtr.hpp>
|
||||
|
||||
namespace hecl::Database {
|
||||
class IDataSpec;
|
||||
}
|
||||
|
||||
namespace hecl {
|
||||
class MultiProgressPrinter;
|
||||
|
||||
extern int CpuCountOverride;
|
||||
void SetCpuCountOverride(int argc, const SystemChar** argv);
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
#pragma once
|
||||
#include "boo/graphicsdev/IGraphicsDataFactory.hpp"
|
||||
#include "boo/graphicsdev/GL.hpp"
|
||||
#include "boo/graphicsdev/Vulkan.hpp"
|
||||
#include "boo/graphicsdev/D3D.hpp"
|
||||
#include "boo/graphicsdev/Metal.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include <boo/graphicsdev/D3D.hpp>
|
||||
#include <boo/graphicsdev/GL.hpp>
|
||||
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
||||
#include <boo/graphicsdev/Metal.hpp>
|
||||
#include <boo/graphicsdev/Vulkan.hpp>
|
||||
|
||||
namespace hecl {
|
||||
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include "boo/IWindow.hpp"
|
||||
#include "logvisor/logvisor.hpp"
|
||||
|
||||
#include <boo/System.hpp>
|
||||
#include <logvisor/logvisor.hpp>
|
||||
|
||||
namespace boo {
|
||||
class IWindow;
|
||||
|
||||
enum class EModifierKey;
|
||||
enum class ESpecialKey;
|
||||
|
||||
struct IGraphicsCommandQueue;
|
||||
} // namespace boo
|
||||
|
||||
namespace hecl {
|
||||
class CVarManager;
|
||||
|
||||
@@ -3,17 +3,15 @@
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include <logvisor/logvisor.hpp>
|
||||
#include "hecl/hecl.hpp"
|
||||
|
||||
#include "hecl.hpp"
|
||||
#include <logvisor/logvisor.hpp>
|
||||
|
||||
namespace hecl {
|
||||
class ClientProcess;
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include "athena/DNA.hpp"
|
||||
|
||||
#include <athena/DNA.hpp>
|
||||
#include <logvisor/logvisor.hpp>
|
||||
|
||||
namespace hecl {
|
||||
|
||||
@@ -32,26 +34,26 @@ public:
|
||||
constexpr FourCC& operator=(const FourCC&) noexcept = default;
|
||||
constexpr FourCC& operator=(FourCC&&) noexcept = default;
|
||||
|
||||
constexpr bool operator==(const FourCC& other) const { return num == other.num; }
|
||||
constexpr bool operator!=(const FourCC& other) const { return !operator==(other); }
|
||||
constexpr bool operator==(const char* other) const {
|
||||
constexpr bool operator==(const FourCC& other) const noexcept { return num == other.num; }
|
||||
constexpr bool operator!=(const FourCC& other) const noexcept { return !operator==(other); }
|
||||
constexpr bool operator==(const char* other) const noexcept {
|
||||
return other[0] == fcc[0] && other[1] == fcc[1] && other[2] == fcc[2] && other[3] == fcc[3];
|
||||
}
|
||||
constexpr bool operator!=(const char* other) const { return !operator==(other); }
|
||||
constexpr bool operator==(int32_t other) const { return num == uint32_t(other); }
|
||||
constexpr bool operator!=(int32_t other) const { return !operator==(other); }
|
||||
constexpr bool operator==(uint32_t other) const { return num == other; }
|
||||
constexpr bool operator!=(uint32_t other) const { return !operator==(other); }
|
||||
constexpr bool operator!=(const char* other) const noexcept { return !operator==(other); }
|
||||
constexpr bool operator==(int32_t other) const noexcept { return num == uint32_t(other); }
|
||||
constexpr bool operator!=(int32_t other) const noexcept { return !operator==(other); }
|
||||
constexpr bool operator==(uint32_t other) const noexcept { return num == other; }
|
||||
constexpr bool operator!=(uint32_t other) const noexcept { return !operator==(other); }
|
||||
|
||||
std::string toString() const { return std::string(std::begin(fcc), std::end(fcc)); }
|
||||
constexpr uint32_t toUint32() const { return num; }
|
||||
constexpr const char* getChars() const { return fcc; }
|
||||
constexpr char* getChars() { return fcc; }
|
||||
constexpr bool IsValid() const { return num != 0; }
|
||||
constexpr uint32_t toUint32() const noexcept { return num; }
|
||||
constexpr const char* getChars() const noexcept { return fcc; }
|
||||
constexpr char* getChars() noexcept { return fcc; }
|
||||
constexpr bool IsValid() const noexcept { return num != 0; }
|
||||
};
|
||||
#define FOURCC(chars) FourCC(SBIG(chars))
|
||||
|
||||
using BigDNA = athena::io::DNA<athena::Big>;
|
||||
using BigDNA = athena::io::DNA<athena::Endian::Big>;
|
||||
|
||||
/** FourCC with DNA read/write */
|
||||
class DNAFourCC final : public BigDNA, public FourCC {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "hecl/hecl.hpp"
|
||||
#include "athena/DNA.hpp"
|
||||
#include <athena/DNA.hpp>
|
||||
|
||||
namespace hecl {
|
||||
|
||||
@@ -12,7 +11,7 @@ enum class HMDLTopology : atUint32 {
|
||||
|
||||
#define HECL_HMDL_META_SZ 32
|
||||
|
||||
struct HMDLMeta : athena::io::DNA<athena::Big> {
|
||||
struct HMDLMeta : athena::io::DNA<athena::Endian::Big> {
|
||||
AT_DECL_DNA
|
||||
Value<atUint32> magic = 'TACO';
|
||||
Value<HMDLTopology> topology;
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "hecl.hpp"
|
||||
#include <cstdint>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#include "hecl/SystemChar.hpp"
|
||||
|
||||
#if _WIN32
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
namespace hecl {
|
||||
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "hecl/hecl.hpp"
|
||||
#include "PipelineBase.hpp"
|
||||
#include "hecl/PipelineBase.hpp"
|
||||
|
||||
#include <boo/BooObject.hpp>
|
||||
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
||||
|
||||
/* CMake-curated rep classes for the application */
|
||||
#include "ApplicationReps.hpp"
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
#pragma once
|
||||
#include "Compilers.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "hecl/Compilers.hpp"
|
||||
|
||||
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
||||
#include "../extern/boo/xxhash/xxhash.h"
|
||||
|
||||
#define HECL_RUNTIME 1
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "hecl.hpp"
|
||||
#include "boo/graphicsdev/IGraphicsDataFactory.hpp"
|
||||
#include <unordered_map>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
#include "hecl/SystemChar.hpp"
|
||||
|
||||
#include <boo/BooObject.hpp>
|
||||
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
||||
|
||||
namespace hecl {
|
||||
struct HMDLMeta;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#pragma once
|
||||
#include <variant>
|
||||
|
||||
#include <cassert>
|
||||
#include "athena/DNA.hpp"
|
||||
#include <type_traits>
|
||||
#include <variant>
|
||||
|
||||
#include <athena/DNA.hpp>
|
||||
|
||||
/*
|
||||
* The TypedVariant system is a type-safe union implementation capable of selecting
|
||||
@@ -199,62 +202,67 @@ private:
|
||||
TypedVariantBigDNA(TypedVariant<_Types...> var) : TypedVariant<_Types...>(std::move(var)) {}
|
||||
};
|
||||
|
||||
#define AT_SPECIALIZE_TYPED_VARIANT_BIGDNA(...) \
|
||||
template <> \
|
||||
template <> \
|
||||
inline void hecl::TypedVariantBigDNA<__VA_ARGS__>::Enumerate<athena::io::DNA<athena::Big>::Read>(typename Read::StreamT & r) { \
|
||||
EnumType variant_type = {}; \
|
||||
Do<athena::io::DNA<athena::Big>::Read>(athena::io::PropId("variant_type"sv), variant_type, r); \
|
||||
static_cast<TypedVariant<__VA_ARGS__>&>(*this) = Build(variant_type); \
|
||||
visit([&](auto& var) { var.read(r); }); \
|
||||
} \
|
||||
\
|
||||
template <> \
|
||||
template <> \
|
||||
inline void hecl::TypedVariantBigDNA<__VA_ARGS__>::Enumerate<athena::io::DNA<athena::Big>::Write>(typename Write::StreamT & w) { \
|
||||
visit([&](auto& var) { \
|
||||
using T = std::decay_t<decltype(var)>; \
|
||||
EnumType variant_type = T::variant_type(); \
|
||||
Do<athena::io::DNA<athena::Big>::Write>(athena::io::PropId("variant_type"sv), variant_type, w); \
|
||||
var.write(w); \
|
||||
}); \
|
||||
} \
|
||||
\
|
||||
template <> \
|
||||
template <> \
|
||||
inline void hecl::TypedVariantBigDNA<__VA_ARGS__>::Enumerate<athena::io::DNA<athena::Big>::BinarySize>(typename BinarySize::StreamT & sz) { \
|
||||
visit([&](auto& var) { \
|
||||
using T = std::decay_t<decltype(var)>; \
|
||||
EnumType variant_type = T::variant_type(); \
|
||||
Do<athena::io::DNA<athena::Big>::BinarySize>(athena::io::PropId("variant_type"sv), variant_type, sz); \
|
||||
var.binarySize(sz); \
|
||||
}); \
|
||||
} \
|
||||
template <> \
|
||||
inline std::string_view hecl::TypedVariantBigDNA<__VA_ARGS__>::DNAType() { \
|
||||
return "hecl::TypedVariantBigDNA<" #__VA_ARGS__ ">"sv; \
|
||||
}
|
||||
#define AT_SPECIALIZE_TYPED_VARIANT_BIGDNA(...) \
|
||||
template <> \
|
||||
template <> \
|
||||
inline void hecl::TypedVariantBigDNA<__VA_ARGS__>::Enumerate<athena::io::DNA<athena::Endian::Big>::Read>( \
|
||||
typename Read::StreamT & r) { \
|
||||
EnumType variant_type = {}; \
|
||||
Do<athena::io::DNA<athena::Endian::Big>::Read>(athena::io::PropId("variant_type"sv), variant_type, r); \
|
||||
static_cast<TypedVariant<__VA_ARGS__>&>(*this) = Build(variant_type); \
|
||||
visit([&](auto& var) { var.read(r); }); \
|
||||
} \
|
||||
\
|
||||
template <> \
|
||||
template <> \
|
||||
inline void hecl::TypedVariantBigDNA<__VA_ARGS__>::Enumerate<athena::io::DNA<athena::Endian::Big>::Write>( \
|
||||
typename Write::StreamT & w) { \
|
||||
visit([&](auto& var) { \
|
||||
using T = std::decay_t<decltype(var)>; \
|
||||
EnumType variant_type = T::variant_type(); \
|
||||
Do<athena::io::DNA<athena::Endian::Big>::Write>(athena::io::PropId("variant_type"sv), variant_type, w); \
|
||||
var.write(w); \
|
||||
}); \
|
||||
} \
|
||||
\
|
||||
template <> \
|
||||
template <> \
|
||||
inline void hecl::TypedVariantBigDNA<__VA_ARGS__>::Enumerate<athena::io::DNA<athena::Endian::Big>::BinarySize>( \
|
||||
typename BinarySize::StreamT & sz) { \
|
||||
visit([&](auto& var) { \
|
||||
using T = std::decay_t<decltype(var)>; \
|
||||
EnumType variant_type = T::variant_type(); \
|
||||
Do<athena::io::DNA<athena::Endian::Big>::BinarySize>(athena::io::PropId("variant_type"sv), variant_type, sz); \
|
||||
var.binarySize(sz); \
|
||||
}); \
|
||||
} \
|
||||
template <> \
|
||||
inline std::string_view hecl::TypedVariantBigDNA<__VA_ARGS__>::DNAType() { \
|
||||
return "hecl::TypedVariantBigDNA<" #__VA_ARGS__ ">"sv; \
|
||||
}
|
||||
|
||||
#define AT_SPECIALIZE_TYPED_VARIANT_BIGDNA_YAML(...) \
|
||||
AT_SPECIALIZE_TYPED_VARIANT_BIGDNA(__VA_ARGS__) \
|
||||
template <> \
|
||||
template <> \
|
||||
inline void hecl::TypedVariantBigDNA<__VA_ARGS__>::Enumerate<athena::io::DNA<athena::Big>::ReadYaml>(typename ReadYaml::StreamT & r) { \
|
||||
EnumType variant_type = {}; \
|
||||
Do<athena::io::DNA<athena::Big>::ReadYaml>(athena::io::PropId("variant_type"sv), variant_type, r); \
|
||||
static_cast<TypedVariant<__VA_ARGS__>&>(*this) = Build(variant_type); \
|
||||
visit([&](auto& var) { var.read(r); }); \
|
||||
} \
|
||||
\
|
||||
template <> \
|
||||
template <> \
|
||||
inline void hecl::TypedVariantBigDNA<__VA_ARGS__>::Enumerate<athena::io::DNA<athena::Big>::WriteYaml>(typename WriteYaml::StreamT & w) { \
|
||||
visit([&](auto& var) { \
|
||||
using T = std::decay_t<decltype(var)>; \
|
||||
EnumType variant_type = T::variant_type(); \
|
||||
Do<athena::io::DNA<athena::Big>::WriteYaml>(athena::io::PropId("variant_type"sv), variant_type, w); \
|
||||
var.write(w); \
|
||||
}); \
|
||||
}
|
||||
#define AT_SPECIALIZE_TYPED_VARIANT_BIGDNA_YAML(...) \
|
||||
AT_SPECIALIZE_TYPED_VARIANT_BIGDNA(__VA_ARGS__) \
|
||||
template <> \
|
||||
template <> \
|
||||
inline void hecl::TypedVariantBigDNA<__VA_ARGS__>::Enumerate<athena::io::DNA<athena::Endian::Big>::ReadYaml>( \
|
||||
typename ReadYaml::StreamT & r) { \
|
||||
EnumType variant_type = {}; \
|
||||
Do<athena::io::DNA<athena::Endian::Big>::ReadYaml>(athena::io::PropId("variant_type"sv), variant_type, r); \
|
||||
static_cast<TypedVariant<__VA_ARGS__>&>(*this) = Build(variant_type); \
|
||||
visit([&](auto& var) { var.read(r); }); \
|
||||
} \
|
||||
\
|
||||
template <> \
|
||||
template <> \
|
||||
inline void hecl::TypedVariantBigDNA<__VA_ARGS__>::Enumerate<athena::io::DNA<athena::Endian::Big>::WriteYaml>( \
|
||||
typename WriteYaml::StreamT & w) { \
|
||||
visit([&](auto& var) { \
|
||||
using T = std::decay_t<decltype(var)>; \
|
||||
EnumType variant_type = T::variant_type(); \
|
||||
Do<athena::io::DNA<athena::Endian::Big>::WriteYaml>(athena::io::PropId("variant_type"sv), variant_type, w); \
|
||||
var.write(w); \
|
||||
}); \
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <boo/boo.hpp>
|
||||
#include <vector>
|
||||
#include <cstdlib>
|
||||
#include <atomic>
|
||||
#include "BitVector.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "hecl/BitVector.hpp"
|
||||
|
||||
#include <boo/BooObject.hpp>
|
||||
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
||||
|
||||
namespace hecl {
|
||||
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <boo/boo.hpp>
|
||||
#include <vector>
|
||||
#include <cstdlib>
|
||||
#include <atomic>
|
||||
#include "BitVector.hpp"
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "hecl/BitVector.hpp"
|
||||
|
||||
#include <boo/BooObject.hpp>
|
||||
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
||||
|
||||
namespace hecl {
|
||||
|
||||
|
||||
@@ -63,26 +63,27 @@ namespace blender {
|
||||
enum class BlendType { None, Mesh, ColMesh, Armature, Actor, Area,
|
||||
World, MapArea, MapUniverse, Frame, PathMesh };
|
||||
|
||||
class ANIMOutStream;
|
||||
class Connection;
|
||||
class Token;
|
||||
class DataStream;
|
||||
class PyOutStream;
|
||||
class ANIMOutStream;
|
||||
struct Mesh;
|
||||
struct Material;
|
||||
class Token;
|
||||
|
||||
struct Action;
|
||||
struct Actor;
|
||||
struct Armature;
|
||||
struct Bone;
|
||||
struct ColMesh;
|
||||
struct World;
|
||||
struct Light;
|
||||
struct MapArea;
|
||||
struct MapUniverse;
|
||||
struct Actor;
|
||||
struct Armature;
|
||||
struct Action;
|
||||
struct Bone;
|
||||
struct PathMesh;
|
||||
struct Material;
|
||||
struct Matrix3f;
|
||||
struct Matrix4f;
|
||||
struct Mesh;
|
||||
struct PathMesh;
|
||||
struct PoolSkinIndex;
|
||||
struct World;
|
||||
|
||||
extern class Token SharedBlenderToken;
|
||||
} // namespace blender
|
||||
|
||||
Reference in New Issue
Block a user