2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-08-19 16:51:30 +00:00

Major scoped-enum refactor

This commit is contained in:
Jack Andersen 2015-11-20 15:13:06 -10:00
parent daa446588b
commit 0a457d854a
23 changed files with 385 additions and 386 deletions

View File

@ -15,7 +15,6 @@ endif()
configure_file(DataSpecRegistry.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/DataSpecRegistry.hpp @ONLY) configure_file(DataSpecRegistry.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/DataSpecRegistry.hpp @ONLY)
set(HECL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/blender CACHE PATH "HECL include path" FORCE)
set(ATHENA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/Athena/include) set(ATHENA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/Athena/include)
set(ATHENA_INCLUDE_DIR ${ATHENA_INCLUDE_DIR} PARENT_SCOPE) set(ATHENA_INCLUDE_DIR ${ATHENA_INCLUDE_DIR} PARENT_SCOPE)
set(SQUISH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/libSquish) set(SQUISH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/libSquish)

View File

@ -341,7 +341,7 @@ BlenderConnection::BlenderConnection(int verbosityLevel)
InstallAddon(blenderAddonPath.c_str()); InstallAddon(blenderAddonPath.c_str());
++installAttempt; ++installAttempt;
if (installAttempt >= 2) if (installAttempt >= 2)
BlenderLog.report(LogVisor::FatalError, "unable to install blender addon using '%s'", blenderAddonPath.c_str()); BlenderLog.report(LogVisor::FatalError, _S("unable to install blender addon using '%s'"), blenderAddonPath.c_str());
continue; continue;
} }
else if (!strcmp(lineBuf, "ADDONINSTALLED")) else if (!strcmp(lineBuf, "ADDONINSTALLED"))
@ -386,7 +386,7 @@ bool BlenderConnection::createBlend(const ProjectPath& path, BlendType type)
"BlenderConnection::createBlend() musn't be called with stream active"); "BlenderConnection::createBlend() musn't be called with stream active");
return false; return false;
} }
_writeLine(("CREATE \"" + path.getAbsolutePathUTF8() + "\" " + BlendTypeStrs[type] + " \"" + m_startupBlend + "\"").c_str()); _writeLine(("CREATE \"" + path.getAbsolutePathUTF8() + "\" " + BlendTypeStrs[int(type)] + " \"" + m_startupBlend + "\"").c_str());
char lineBuf[256]; char lineBuf[256];
_readLine(lineBuf, sizeof(lineBuf)); _readLine(lineBuf, sizeof(lineBuf));
if (!strcmp(lineBuf, "FINISHED")) if (!strcmp(lineBuf, "FINISHED"))
@ -416,7 +416,7 @@ bool BlenderConnection::openBlend(const ProjectPath& path, bool force)
m_loadedBlend = path; m_loadedBlend = path;
_writeLine("GETTYPE"); _writeLine("GETTYPE");
_readLine(lineBuf, sizeof(lineBuf)); _readLine(lineBuf, sizeof(lineBuf));
m_loadedType = TypeNone; m_loadedType = BlendType::None;
unsigned idx = 0; unsigned idx = 0;
while (BlendTypeStrs[idx]) while (BlendTypeStrs[idx])
{ {

View File

@ -35,15 +35,15 @@ class HMDLBuffers;
class BlenderConnection class BlenderConnection
{ {
public: public:
enum BlendType enum class BlendType
{ {
TypeNone, None,
TypeMesh, Mesh,
TypeActor, Actor,
TypeArea, Area,
TypeWorld, World,
TypeMapArea, MapArea,
TypeMapUniverse MapUniverse
}; };
private: private:
bool m_lock = false; bool m_lock = false;
@ -54,7 +54,7 @@ private:
#endif #endif
int m_readpipe[2]; int m_readpipe[2];
int m_writepipe[2]; int m_writepipe[2];
BlendType m_loadedType = TypeNone; BlendType m_loadedType = BlendType::None;
ProjectPath m_loadedBlend; ProjectPath m_loadedBlend;
std::string m_startupBlend; std::string m_startupBlend;
size_t _readLine(char* buf, size_t bufSz); size_t _readLine(char* buf, size_t bufSz);
@ -72,11 +72,11 @@ public:
bool saveBlend(); bool saveBlend();
void deleteBlend(); void deleteBlend();
enum ANIMCurveType enum class ANIMCurveType
{ {
CurveRotate, Rotate,
CurveTranslate, Translate,
CurveScale Scale
}; };
class PyOutStream : public std::ostream class PyOutStream : public std::ostream
@ -522,7 +522,7 @@ public:
static const char* MeshOutputModeString(HMDLTopology topology) static const char* MeshOutputModeString(HMDLTopology topology)
{ {
static const char* STRS[] = {"TRIANGLES", "TRISTRIPS"}; static const char* STRS[] = {"TRIANGLES", "TRISTRIPS"};
return STRS[topology]; return STRS[int(topology)];
} }
@ -530,7 +530,7 @@ public:
Mesh compileMesh(HMDLTopology topology, int skinSlotCount=10, Mesh compileMesh(HMDLTopology topology, int skinSlotCount=10,
Mesh::SurfProgFunc surfProg=[](int){}) Mesh::SurfProgFunc surfProg=[](int){})
{ {
if (m_parent->m_loadedType != TypeMesh) if (m_parent->m_loadedType != BlendType::Mesh)
BlenderLog.report(LogVisor::FatalError, _S("%s is not a MESH blend"), BlenderLog.report(LogVisor::FatalError, _S("%s is not a MESH blend"),
m_parent->m_loadedBlend.getAbsolutePath().c_str()); m_parent->m_loadedBlend.getAbsolutePath().c_str());
@ -551,7 +551,7 @@ public:
Mesh compileMesh(const std::string& name, HMDLTopology topology, int skinSlotCount=10, Mesh compileMesh(const std::string& name, HMDLTopology topology, int skinSlotCount=10,
Mesh::SurfProgFunc surfProg=[](int){}) Mesh::SurfProgFunc surfProg=[](int){})
{ {
if (m_parent->m_loadedType != TypeArea) if (m_parent->m_loadedType != BlendType::Area)
BlenderLog.report(LogVisor::FatalError, _S("%s is not an AREA blend"), BlenderLog.report(LogVisor::FatalError, _S("%s is not an AREA blend"),
m_parent->m_loadedBlend.getAbsolutePath().c_str()); m_parent->m_loadedBlend.getAbsolutePath().c_str());
@ -572,7 +572,7 @@ public:
Mesh compileAllMeshes(HMDLTopology topology, int skinSlotCount=10, float maxOctantLength=5.0, Mesh compileAllMeshes(HMDLTopology topology, int skinSlotCount=10, float maxOctantLength=5.0,
Mesh::SurfProgFunc surfProg=[](int){}) Mesh::SurfProgFunc surfProg=[](int){})
{ {
if (m_parent->m_loadedType != TypeArea) if (m_parent->m_loadedType != BlendType::Area)
BlenderLog.report(LogVisor::FatalError, _S("%s is not an AREA blend"), BlenderLog.report(LogVisor::FatalError, _S("%s is not an AREA blend"),
m_parent->m_loadedBlend.getAbsolutePath().c_str()); m_parent->m_loadedBlend.getAbsolutePath().c_str());
@ -657,7 +657,7 @@ public:
Actor compileActor() Actor compileActor()
{ {
if (m_parent->m_loadedType != TypeActor) if (m_parent->m_loadedType != BlendType::Actor)
BlenderLog.report(LogVisor::FatalError, _S("%s is not an ACTOR blend"), BlenderLog.report(LogVisor::FatalError, _S("%s is not an ACTOR blend"),
m_parent->m_loadedBlend.getAbsolutePath().c_str()); m_parent->m_loadedBlend.getAbsolutePath().c_str());

View File

@ -73,7 +73,7 @@ public:
m_specPasses.reserve(HECL::Database::DATA_SPEC_REGISTRY.size()); m_specPasses.reserve(HECL::Database::DATA_SPEC_REGISTRY.size());
for (const HECL::Database::DataSpecEntry* entry : HECL::Database::DATA_SPEC_REGISTRY) for (const HECL::Database::DataSpecEntry* entry : HECL::Database::DATA_SPEC_REGISTRY)
{ {
HECL::Database::IDataSpec* ds = entry->m_factory(*m_useProj, HECL::Database::TOOL_EXTRACT); HECL::Database::IDataSpec* ds = entry->m_factory(*m_useProj, HECL::Database::DataSpecTool::Extract);
if (ds) if (ds)
{ {
if (ds->canExtract(m_einfo, m_reps)) if (ds->canExtract(m_einfo, m_reps))

2
hecl/extern/Athena vendored

@ -1 +1 @@
Subproject commit 18e94dbc54cf1e88d7c5b697e96b05a1f583edee Subproject commit cdacc014f3c269f07c166499e0618bd879b412a5

2
hecl/extern/libBoo vendored

@ -1 +1 @@
Subproject commit 62fae6004226348bdf5e3b0f5401d091128ec86e Subproject commit c9edf8dd8573662921522d40cdd38837f7db2154

View File

@ -391,7 +391,7 @@ struct GX : IBackend
return -1; return -1;
} }
enum BlendFactor enum BlendFactor : uint16_t
{ {
BL_ZERO, BL_ZERO,
BL_ONE, BL_ONE,
@ -524,14 +524,14 @@ struct GX : IBackend
private: private:
struct TraceResult struct TraceResult
{ {
enum enum class Type
{ {
TraceInvalid, Invalid,
TraceTEVStage, TEVStage,
TraceTEVColorArg, TEVColorArg,
TraceTEVAlphaArg, TEVAlphaArg,
TraceTEVKColorSel, TEVKColorSel,
TraceTEVKAlphaSel TEVKAlphaSel
} type; } type;
union union
{ {
@ -541,12 +541,12 @@ private:
GX::TevKColorSel tevKColorSel; GX::TevKColorSel tevKColorSel;
GX::TevKAlphaSel tevKAlphaSel; GX::TevKAlphaSel tevKAlphaSel;
}; };
TraceResult() : type(TraceInvalid) {} TraceResult() : type(Type::Invalid) {}
TraceResult(GX::TEVStage* stage) : type(TraceTEVStage), tevStage(stage) {} TraceResult(GX::TEVStage* stage) : type(Type::TEVStage), tevStage(stage) {}
TraceResult(GX::TevColorArg arg) : type(TraceTEVColorArg), tevColorArg(arg) {} TraceResult(GX::TevColorArg arg) : type(Type::TEVColorArg), tevColorArg(arg) {}
TraceResult(GX::TevAlphaArg arg) : type(TraceTEVAlphaArg), tevAlphaArg(arg) {} TraceResult(GX::TevAlphaArg arg) : type(Type::TEVAlphaArg), tevAlphaArg(arg) {}
TraceResult(GX::TevKColorSel arg) : type(TraceTEVKColorSel), tevKColorSel(arg) {} TraceResult(GX::TevKColorSel arg) : type(Type::TEVKColorSel), tevKColorSel(arg) {}
TraceResult(GX::TevKAlphaSel arg) : type(TraceTEVKAlphaSel), tevKAlphaSel(arg) {} TraceResult(GX::TevKAlphaSel arg) : type(Type::TEVKAlphaSel), tevKAlphaSel(arg) {}
}; };
unsigned addKColor(Diagnostics& diag, const SourceLocation& loc, const Color& color); unsigned addKColor(Diagnostics& diag, const SourceLocation& loc, const Color& color);

View File

@ -32,11 +32,11 @@ struct ProgrammableCommon : IBackend
std::vector<TexSampling> m_texSamplings; std::vector<TexSampling> m_texSamplings;
unsigned m_texMapEnd = 0; unsigned m_texMapEnd = 0;
enum TexGenSrc enum class TexGenSrc
{ {
TG_POS, Position,
TG_NRM, Normal,
TG_UV UV
}; };
struct TexCoordGen struct TexCoordGen

View File

@ -38,10 +38,10 @@ class PackageDepsgraph
public: public:
struct Node struct Node
{ {
enum enum class Type
{ {
NODE_DATA, Data,
NODE_GROUP Group
} type; } type;
ProjectPath path; ProjectPath path;
ProjectPath cookedPath; ProjectPath cookedPath;
@ -132,11 +132,11 @@ public:
/** /**
* @brief Pre-emptive indication of what the constructed DataSpec is used for * @brief Pre-emptive indication of what the constructed DataSpec is used for
*/ */
enum DataSpecTool enum class DataSpecTool
{ {
TOOL_EXTRACT, Extract,
TOOL_COOK, Cook,
TOOL_PACKAGE Package
}; };
extern std::vector<const struct DataSpecEntry*> DATA_SPEC_REGISTRY; extern std::vector<const struct DataSpecEntry*> DATA_SPEC_REGISTRY;
@ -175,22 +175,22 @@ protected:
/** /**
* @brief Byte-order of target system * @brief Byte-order of target system
*/ */
enum DataEndianness enum class DataEndianness
{ {
DE_NONE, None,
DE_BIG, /**< Big-endian (PowerPC) */ Big, /**< Big-endian (PowerPC) */
DE_LITTLE /**< Little-endian (Intel) */ Little /**< Little-endian (Intel) */
}; };
/** /**
* @brief Data-formats of target system * @brief Data-formats of target system
*/ */
enum DataPlatform enum class DataPlatform
{ {
DP_NONE, None,
DP_GENERIC, /**< Scanline textures and 3-way shader bundle (GLSL, HLSL, SPIR-V) */ Generic, /**< Scanline textures and 3-way shader bundle (GLSL, HLSL, SPIR-V) */
DP_REVOLUTION, /**< Tiled textures and GX register buffers */ Revolution, /**< Tiled textures and GX register buffers */
DP_CAFE /**< Swizzled textures and R700 shader objects */ Cafe /**< Swizzled textures and R700 shader objects */
}; };
typedef std::function<void(const void* data, size_t len)> FDataAppender; typedef std::function<void(const void* data, size_t len)> FDataAppender;
@ -294,12 +294,12 @@ public:
* *
* This is used to provide pretty colors during the cook operation * This is used to provide pretty colors during the cook operation
*/ */
enum Cost enum class Cost
{ {
C_NONE, None,
C_LIGHT, Light,
C_MEDIUM, Medium,
C_HEAVY Heavy
}; };
/** /**

View File

@ -44,19 +44,19 @@ public:
class Parser class Parser
{ {
public: public:
enum TokenType enum class TokenType
{ {
TokenNone, None,
TokenSourceBegin, SourceBegin,
TokenSourceEnd, SourceEnd,
TokenNumLiteral, NumLiteral,
TokenVectorSwizzle, VectorSwizzle,
TokenEvalGroupStart, EvalGroupStart,
TokenEvalGroupEnd, EvalGroupEnd,
TokenFunctionStart, FunctionStart,
TokenFunctionEnd, FunctionEnd,
TokenFunctionArgDelim, FunctionArgDelim,
TokenArithmeticOp, ArithmeticOp,
}; };
private: private:
Diagnostics& m_diag; Diagnostics& m_diag;
@ -73,33 +73,33 @@ public:
std::string m_tokenString; std::string m_tokenString;
int m_tokenInt = 0; int m_tokenInt = 0;
float m_tokenFloat = 0.0; float m_tokenFloat = 0.0;
Token() : m_type(TokenNone) {} Token() : m_type(TokenType::None) {}
Token(TokenType type, SourceLocation loc) : m_type(type), m_location(loc) {} Token(TokenType type, SourceLocation loc) : m_type(type), m_location(loc) {}
const char* typeString() const const char* typeString() const
{ {
switch (m_type) switch (m_type)
{ {
case TokenNone: case TokenType::None:
return "None"; return "None";
case TokenSourceBegin: case TokenType::SourceBegin:
return "SourceBegin"; return "SourceBegin";
case TokenSourceEnd: case TokenType::SourceEnd:
return "SourceEnd"; return "SourceEnd";
case TokenNumLiteral: case TokenType::NumLiteral:
return "NumLiteral"; return "NumLiteral";
case TokenVectorSwizzle: case TokenType::VectorSwizzle:
return "VectorSwizzle"; return "VectorSwizzle";
case TokenEvalGroupStart: case TokenType::EvalGroupStart:
return "EvalGroupStart"; return "EvalGroupStart";
case TokenEvalGroupEnd: case TokenType::EvalGroupEnd:
return "EvalGroupEnd"; return "EvalGroupEnd";
case TokenFunctionStart: case TokenType::FunctionStart:
return "FunctionStart"; return "FunctionStart";
case TokenFunctionEnd: case TokenType::FunctionEnd:
return "FunctionEnd"; return "FunctionEnd";
case TokenFunctionArgDelim: case TokenType::FunctionArgDelim:
return "FunctionArgDelim"; return "FunctionArgDelim";
case TokenArithmeticOp: case TokenType::ArithmeticOp:
return "ArithmeticOp"; return "ArithmeticOp";
default: break; default: break;
} }
@ -121,11 +121,11 @@ struct IR : BigDNA
enum OpType : uint8_t enum OpType : uint8_t
{ {
OpNone, /**< NOP */ None, /**< NOP */
OpCall, /**< Deferred function insertion for HECL backend using specified I/O regs */ Call, /**< Deferred function insertion for HECL backend using specified I/O regs */
OpLoadImm, /**< Load a constant (numeric literal) into register */ LoadImm, /**< Load a constant (numeric literal) into register */
OpArithmetic, /**< Perform binary arithmetic between registers */ Arithmetic, /**< Perform binary arithmetic between registers */
OpSwizzle /**< Vector insertion/extraction/swizzling operation */ Swizzle /**< Vector insertion/extraction/swizzling operation */
}; };
using RegID = atUint16; using RegID = atUint16;
@ -134,7 +134,7 @@ struct IR : BigDNA
{ {
Delete _d; Delete _d;
OpType m_op = OpNone; OpType m_op = OpType::None;
RegID m_target = RegID(-1); RegID m_target = RegID(-1);
SourceLocation m_loc; SourceLocation m_loc;
@ -154,17 +154,17 @@ struct IR : BigDNA
enum ArithmeticOpType : uint8_t enum ArithmeticOpType : uint8_t
{ {
ArithmeticOpNone, None,
ArithmeticOpAdd, Add,
ArithmeticOpSubtract, Subtract,
ArithmeticOpMultiply, Multiply,
ArithmeticOpDivide Divide
}; };
struct Arithmetic : BigDNA struct Arithmetic : BigDNA
{ {
DECL_DNA DECL_DNA
Value<ArithmeticOpType> m_op = ArithmeticOpNone; Value<ArithmeticOpType> m_op = ArithmeticOpType::None;
Value<atUint16> m_instIdxs[2]; Value<atUint16> m_instIdxs[2];
} m_arithmetic; } m_arithmetic;
@ -181,11 +181,11 @@ struct IR : BigDNA
{ {
switch (m_op) switch (m_op)
{ {
case OpCall: case OpType::Call:
return m_call.m_argInstIdxs.size(); return m_call.m_argInstIdxs.size();
case OpArithmetic: case OpType::Arithmetic:
return 2; return 2;
case OpSwizzle: case OpType::Swizzle:
return 1; return 1;
default: default:
LogModule.report(LogVisor::FatalError, "invalid op type"); LogModule.report(LogVisor::FatalError, "invalid op type");
@ -197,13 +197,13 @@ struct IR : BigDNA
{ {
switch (m_op) switch (m_op)
{ {
case OpCall: case OpType::Call:
return ir.m_instructions.at(m_call.m_argInstIdxs.at(idx)); return ir.m_instructions.at(m_call.m_argInstIdxs.at(idx));
case OpArithmetic: case OpType::Arithmetic:
if (idx > 1) if (idx > 1)
LogModule.report(LogVisor::FatalError, "arithmetic child idx must be 0 or 1"); LogModule.report(LogVisor::FatalError, "arithmetic child idx must be 0 or 1");
return ir.m_instructions.at(m_arithmetic.m_instIdxs[idx]); return ir.m_instructions.at(m_arithmetic.m_instIdxs[idx]);
case OpSwizzle: case OpType::Swizzle:
if (idx > 0) if (idx > 0)
LogModule.report(LogVisor::FatalError, "swizzle child idx must be 0"); LogModule.report(LogVisor::FatalError, "swizzle child idx must be 0");
return ir.m_instructions.at(m_swizzle.m_instIdx); return ir.m_instructions.at(m_swizzle.m_instIdx);
@ -215,7 +215,7 @@ struct IR : BigDNA
const atVec4f& getImmVec() const const atVec4f& getImmVec() const
{ {
if (m_op != OpLoadImm) if (m_op != OpType::LoadImm)
LogModule.report(LogVisor::FatalError, "invalid op type"); LogModule.report(LogVisor::FatalError, "invalid op type");
return m_loadImm.m_immVec; return m_loadImm.m_immVec;
} }
@ -227,16 +227,16 @@ struct IR : BigDNA
switch (m_op) switch (m_op)
{ {
default: break; default: break;
case OpCall: case OpType::Call:
m_call.read(reader); m_call.read(reader);
break; break;
case OpLoadImm: case OpType::LoadImm:
m_loadImm.read(reader); m_loadImm.read(reader);
break; break;
case OpArithmetic: case OpType::Arithmetic:
m_arithmetic.read(reader); m_arithmetic.read(reader);
break; break;
case OpSwizzle: case OpType::Swizzle:
m_swizzle.read(reader); m_swizzle.read(reader);
break; break;
} }
@ -249,16 +249,16 @@ struct IR : BigDNA
switch (m_op) switch (m_op)
{ {
default: break; default: break;
case OpCall: case OpType::Call:
m_call.write(writer); m_call.write(writer);
break; break;
case OpLoadImm: case OpType::LoadImm:
m_loadImm.write(writer); m_loadImm.write(writer);
break; break;
case OpArithmetic: case OpType::Arithmetic:
m_arithmetic.write(writer); m_arithmetic.write(writer);
break; break;
case OpSwizzle: case OpType::Swizzle:
m_swizzle.write(writer); m_swizzle.write(writer);
break; break;
} }
@ -270,16 +270,16 @@ struct IR : BigDNA
switch (m_op) switch (m_op)
{ {
default: break; default: break;
case OpCall: case OpType::Call:
sz = m_call.binarySize(sz); sz = m_call.binarySize(sz);
break; break;
case OpLoadImm: case OpType::LoadImm:
sz = m_loadImm.binarySize(sz); sz = m_loadImm.binarySize(sz);
break; break;
case OpArithmetic: case OpType::Arithmetic:
sz = m_arithmetic.binarySize(sz); sz = m_arithmetic.binarySize(sz);
break; break;
case OpSwizzle: case OpType::Swizzle:
sz = m_swizzle.binarySize(sz); sz = m_swizzle.binarySize(sz);
break; break;
} }

View File

@ -194,13 +194,13 @@ static inline SystemChar* Getcwd(SystemChar* buf, int maxlen)
#endif #endif
} }
enum FileLockType enum class FileLockType
{ {
LNONE = 0, None = 0,
LREAD, Read,
LWRITE Write
}; };
static inline FILE* Fopen(const SystemChar* path, const SystemChar* mode, FileLockType lock=LNONE) static inline FILE* Fopen(const SystemChar* path, const SystemChar* mode, FileLockType lock=FileLockType::None)
{ {
#if HECL_UCS2 #if HECL_UCS2
FILE* fp = _wfopen(path, mode); FILE* fp = _wfopen(path, mode);
@ -212,13 +212,13 @@ static inline FILE* Fopen(const SystemChar* path, const SystemChar* mode, FileLo
LogModule.report(LogVisor::FatalError, "fopen %s: %s", path, strerror(errno)); LogModule.report(LogVisor::FatalError, "fopen %s: %s", path, strerror(errno));
#endif #endif
if (lock) if (lock != FileLockType::None)
{ {
#if _WIN32 #if _WIN32
OVERLAPPED ov = {}; OVERLAPPED ov = {};
LockFileEx((HANDLE)(uintptr_t)_fileno(fp), (lock == LWRITE) ? LOCKFILE_EXCLUSIVE_LOCK : 0, 0, 0, 1, &ov); LockFileEx((HANDLE)(uintptr_t)_fileno(fp), (lock == LWRITE) ? LOCKFILE_EXCLUSIVE_LOCK : 0, 0, 0, 1, &ov);
#else #else
if (flock(fileno(fp), ((lock == LWRITE) ? LOCK_EX : LOCK_SH) | LOCK_NB)) if (flock(fileno(fp), ((lock == FileLockType::Write) ? LOCK_EX : LOCK_SH) | LOCK_NB))
LogModule.report(LogVisor::FatalError, "flock %s: %s", path, strerror(errno)); LogModule.report(LogVisor::FatalError, "flock %s: %s", path, strerror(errno));
#endif #endif
} }
@ -741,20 +741,20 @@ public:
/** /**
* @brief Type of path * @brief Type of path
*/ */
enum PathType enum class Type
{ {
PT_NONE, /**< If path doesn't reference a valid filesystem entity, this is returned */ None, /**< If path doesn't reference a valid filesystem entity, this is returned */
PT_FILE, /**< Singular file path (confirmed with filesystem) */ File, /**< Singular file path (confirmed with filesystem) */
PT_DIRECTORY, /**< Singular directory path (confirmed with filesystem) */ Directory, /**< Singular directory path (confirmed with filesystem) */
PT_GLOB, /**< Glob-path (whenever one or more '*' occurs in syntax) */ Glob, /**< Glob-path (whenever one or more '*' occurs in syntax) */
PT_LINK /**< Link (symlink on POSIX, ShellLink on Windows) */ Link /**< Link (symlink on POSIX, ShellLink on Windows) */
}; };
/** /**
* @brief Get type of path based on syntax and filesystem queries * @brief Get type of path based on syntax and filesystem queries
* @return Type of path * @return Type of path
*/ */
PathType getPathType() const; Type getPathType() const;
/** /**
* @brief Get time of last modification with special behaviors for directories and glob-paths * @brief Get time of last modification with special behaviors for directories and glob-paths

View File

@ -7,10 +7,10 @@
namespace HECL namespace HECL
{ {
enum HMDLTopology : atUint32 enum class HMDLTopology : atUint32
{ {
TopologyTriangles, Triangles,
TopologyTriStrips, TriStrips,
}; };
#define HECL_HMDL_META_SZ 32 #define HECL_HMDL_META_SZ 32

View File

@ -105,7 +105,7 @@ class ShaderCacheExtensions
{ {
friend class ShaderCacheManager; friend class ShaderCacheManager;
boo::IGraphicsDataFactory::Platform m_plat; boo::IGraphicsDataFactory::Platform m_plat;
ShaderCacheExtensions() : m_plat(boo::IGraphicsDataFactory::PlatformNull) {} ShaderCacheExtensions() : m_plat(boo::IGraphicsDataFactory::Platform::Null) {}
uint64_t hashExtensions() const; uint64_t hashExtensions() const;
public: public:
@ -130,7 +130,7 @@ public:
/* Index-0 has special default-meaning */ /* Index-0 has special default-meaning */
m_extensionSlots.emplace_back(); m_extensionSlots.emplace_back();
} }
operator bool() const {return m_plat != boo::IGraphicsDataFactory::PlatformNull;} operator bool() const {return m_plat != boo::IGraphicsDataFactory::Platform::Null;}
/* Strings must remain resident!! (intended to be stored static const) */ /* Strings must remain resident!! (intended to be stored static const) */
unsigned registerExtensionSlot(Function lighting, Function post) unsigned registerExtensionSlot(Function lighting, Function post)

View File

@ -15,11 +15,11 @@ std::string GLSL::EmitTexGenSource2(TexGenSrc src, int uvIdx) const
{ {
switch (src) switch (src)
{ {
case TG_POS: case TexGenSrc::Position:
return "posIn.xy\n"; return "posIn.xy\n";
case TG_NRM: case TexGenSrc::Normal:
return "normIn.xy\n"; return "normIn.xy\n";
case TG_UV: case TexGenSrc::UV:
return HECL::Format("uvIn[%u]", uvIdx); return HECL::Format("uvIn[%u]", uvIdx);
default: break; default: break;
} }
@ -30,11 +30,11 @@ std::string GLSL::EmitTexGenSource4(TexGenSrc src, int uvIdx) const
{ {
switch (src) switch (src)
{ {
case TG_POS: case TexGenSrc::Position:
return "vec4(posIn, 1.0)\n"; return "vec4(posIn, 1.0)\n";
case TG_NRM: case TexGenSrc::Normal:
return "vec4(normIn, 1.0)\n"; return "vec4(normIn, 1.0)\n";
case TG_UV: case TexGenSrc::UV:
return HECL::Format("vec4(uvIn[%u], 0.0, 1.0)", uvIdx); return HECL::Format("vec4(uvIn[%u], 0.0, 1.0)", uvIdx);
default: break; default: break;
} }
@ -284,8 +284,8 @@ struct GLSLBackendFactory : IShaderBackendFactory
ShaderCachedData dataOut(tag, cachedSz); ShaderCachedData dataOut(tag, cachedSz);
Athena::io::MemoryWriter w(dataOut.m_data.get(), dataOut.m_sz); Athena::io::MemoryWriter w(dataOut.m_data.get(), dataOut.m_sz);
w.writeUByte(m_backend.m_texMapEnd); w.writeUByte(m_backend.m_texMapEnd);
w.writeUByte(m_backend.m_blendSrc); w.writeUByte(atUint8(m_backend.m_blendSrc));
w.writeUByte(m_backend.m_blendDst); w.writeUByte(atUint8(m_backend.m_blendDst));
w.writeString(vertSource); w.writeString(vertSource);
w.writeString(fragSource); w.writeString(fragSource);
@ -349,8 +349,8 @@ struct GLSLBackendFactory : IShaderBackendFactory
ShaderCachedData dataOut(tag, cachedSz); ShaderCachedData dataOut(tag, cachedSz);
Athena::io::MemoryWriter w(dataOut.m_data.get(), dataOut.m_sz); Athena::io::MemoryWriter w(dataOut.m_data.get(), dataOut.m_sz);
w.writeUByte(m_backend.m_texMapEnd); w.writeUByte(m_backend.m_texMapEnd);
w.writeUByte(m_backend.m_blendSrc); w.writeUByte(atUint8(m_backend.m_blendSrc));
w.writeUByte(m_backend.m_blendDst); w.writeUByte(atUint8(m_backend.m_blendDst));
w.writeString(vertSource); w.writeString(vertSource);
for (const std::string src : fragSources) for (const std::string src : fragSources)
w.writeString(src); w.writeString(src);

View File

@ -71,7 +71,7 @@ GX::TEVStage& GX::addTEVStage(Diagnostics& diag, const SourceLocation& loc)
unsigned GX::RecursiveTraceTexGen(const IR& ir, Diagnostics& diag, const IR::Instruction& inst, TexMtx mtx) unsigned GX::RecursiveTraceTexGen(const IR& ir, Diagnostics& diag, const IR::Instruction& inst, TexMtx mtx)
{ {
if (inst.m_op != IR::OpCall) if (inst.m_op != IR::OpType::Call)
diag.reportBackendErr(inst.m_loc, "TexCoordGen resolution requires function"); diag.reportBackendErr(inst.m_loc, "TexCoordGen resolution requires function");
const std::string& tcgName = inst.m_call.m_name; const std::string& tcgName = inst.m_call.m_name;
@ -109,7 +109,7 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
{ {
switch (inst.m_op) switch (inst.m_op)
{ {
case IR::OpCall: case IR::OpType::Call:
{ {
const std::string& name = inst.m_call.m_name; const std::string& name = inst.m_call.m_name;
if (!name.compare("Texture")) if (!name.compare("Texture"))
@ -147,7 +147,7 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
diag.reportBackendErr(inst.m_loc, "GX backend unable to interpret '%s'", name.c_str()); diag.reportBackendErr(inst.m_loc, "GX backend unable to interpret '%s'", name.c_str());
break; break;
} }
case IR::OpLoadImm: case IR::OpType::LoadImm:
{ {
const atVec4f& vec = inst.m_loadImm.m_immVec; const atVec4f& vec = inst.m_loadImm.m_immVec;
if (vec.vec[0] == 0.f && vec.vec[1] == 0.f && vec.vec[2] == 0.f) if (vec.vec[0] == 0.f && vec.vec[1] == 0.f && vec.vec[2] == 0.f)
@ -157,14 +157,14 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
unsigned idx = addKColor(diag, inst.m_loc, vec); unsigned idx = addKColor(diag, inst.m_loc, vec);
return TraceResult(TevKColorSel(TEV_KCSEL_K0 + idx)); return TraceResult(TevKColorSel(TEV_KCSEL_K0 + idx));
} }
case IR::OpArithmetic: case IR::OpType::Arithmetic:
{ {
ArithmeticOp op = inst.m_arithmetic.m_op; ArithmeticOp op = inst.m_arithmetic.m_op;
const IR::Instruction& aInst = inst.getChildInst(ir, 0); const IR::Instruction& aInst = inst.getChildInst(ir, 0);
const IR::Instruction& bInst = inst.getChildInst(ir, 1); const IR::Instruction& bInst = inst.getChildInst(ir, 1);
TraceResult aTrace; TraceResult aTrace;
TraceResult bTrace; TraceResult bTrace;
if (aInst.m_op != IR::OpArithmetic && bInst.m_op == IR::OpArithmetic) if (aInst.m_op != IR::OpType::Arithmetic && bInst.m_op == IR::OpType::Arithmetic)
{ {
bTrace = RecursiveTraceColor(ir, diag, bInst); bTrace = RecursiveTraceColor(ir, diag, bInst);
aTrace = RecursiveTraceColor(ir, diag, aInst); aTrace = RecursiveTraceColor(ir, diag, aInst);
@ -174,8 +174,8 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
aTrace = RecursiveTraceColor(ir, diag, aInst); aTrace = RecursiveTraceColor(ir, diag, aInst);
bTrace = RecursiveTraceColor(ir, diag, bInst); bTrace = RecursiveTraceColor(ir, diag, bInst);
} }
if (aTrace.type == TraceResult::TraceTEVStage && if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVStage && bTrace.type == TraceResult::Type::TEVStage &&
getStageIdx(aTrace.tevStage) > getStageIdx(bTrace.tevStage)) getStageIdx(aTrace.tevStage) > getStageIdx(bTrace.tevStage))
{ {
TraceResult tmp = aTrace; TraceResult tmp = aTrace;
@ -184,28 +184,28 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
} }
TevKColorSel newKColor = TEV_KCSEL_1; TevKColorSel newKColor = TEV_KCSEL_1;
if (aTrace.type == TraceResult::TraceTEVKColorSel && if (aTrace.type == TraceResult::Type::TEVKColorSel &&
bTrace.type == TraceResult::TraceTEVKColorSel) bTrace.type == TraceResult::Type::TEVKColorSel)
diag.reportBackendErr(inst.m_loc, "unable to handle 2 KColors in one stage"); diag.reportBackendErr(inst.m_loc, "unable to handle 2 KColors in one stage");
else if (aTrace.type == TraceResult::TraceTEVKColorSel) else if (aTrace.type == TraceResult::Type::TEVKColorSel)
{ {
newKColor = aTrace.tevKColorSel; newKColor = aTrace.tevKColorSel;
aTrace.type = TraceResult::TraceTEVColorArg; aTrace.type = TraceResult::Type::TEVColorArg;
aTrace.tevColorArg = CC_KONST; aTrace.tevColorArg = CC_KONST;
} }
else if (bTrace.type == TraceResult::TraceTEVKColorSel) else if (bTrace.type == TraceResult::Type::TEVKColorSel)
{ {
newKColor = bTrace.tevKColorSel; newKColor = bTrace.tevKColorSel;
bTrace.type = TraceResult::TraceTEVColorArg; bTrace.type = TraceResult::Type::TEVColorArg;
bTrace.tevColorArg = CC_KONST; bTrace.tevColorArg = CC_KONST;
} }
switch (op) switch (op)
{ {
case ArithmeticOp::ArithmeticOpAdd: case ArithmeticOp::Add:
{ {
if (aTrace.type == TraceResult::TraceTEVStage && if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVStage) bTrace.type == TraceResult::Type::TEVStage)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
TEVStage* b = bTrace.tevStage; TEVStage* b = bTrace.tevStage;
@ -228,8 +228,8 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
b->m_color[3] = CC_CPREV; b->m_color[3] = CC_CPREV;
return TraceResult(b); return TraceResult(b);
} }
else if (aTrace.type == TraceResult::TraceTEVStage && else if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVColorArg) bTrace.type == TraceResult::Type::TEVColorArg)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
if (a->m_color[3] != CC_ZERO) if (a->m_color[3] != CC_ZERO)
@ -238,8 +238,8 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
a->m_kColor = newKColor; a->m_kColor = newKColor;
return TraceResult(a); return TraceResult(a);
} }
else if (aTrace.type == TraceResult::TraceTEVColorArg && else if (aTrace.type == TraceResult::Type::TEVColorArg &&
bTrace.type == TraceResult::TraceTEVStage) bTrace.type == TraceResult::Type::TEVStage)
{ {
TEVStage* b = bTrace.tevStage; TEVStage* b = bTrace.tevStage;
if (b->m_color[3] != CC_ZERO) if (b->m_color[3] != CC_ZERO)
@ -250,10 +250,10 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
} }
break; break;
} }
case ArithmeticOp::ArithmeticOpSubtract: case ArithmeticOp::Subtract:
{ {
if (aTrace.type == TraceResult::TraceTEVStage && if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVStage) bTrace.type == TraceResult::Type::TEVStage)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
TEVStage* b = bTrace.tevStage; TEVStage* b = bTrace.tevStage;
@ -269,8 +269,8 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
b->m_cop = TEV_SUB; b->m_cop = TEV_SUB;
return TraceResult(b); return TraceResult(b);
} }
else if (aTrace.type == TraceResult::TraceTEVStage && else if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVColorArg) bTrace.type == TraceResult::Type::TEVColorArg)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
if (a->m_color[3] != CC_ZERO) if (a->m_color[3] != CC_ZERO)
@ -282,10 +282,10 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
} }
break; break;
} }
case ArithmeticOp::ArithmeticOpMultiply: case ArithmeticOp::Multiply:
{ {
if (aTrace.type == TraceResult::TraceTEVStage && if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVStage) bTrace.type == TraceResult::Type::TEVStage)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
TEVStage* b = bTrace.tevStage; TEVStage* b = bTrace.tevStage;
@ -305,8 +305,8 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
b->m_color[3] = CC_ZERO; b->m_color[3] = CC_ZERO;
return TraceResult(b); return TraceResult(b);
} }
else if (aTrace.type == TraceResult::TraceTEVColorArg && else if (aTrace.type == TraceResult::Type::TEVColorArg &&
bTrace.type == TraceResult::TraceTEVColorArg) bTrace.type == TraceResult::Type::TEVColorArg)
{ {
TEVStage& stage = addTEVStage(diag, inst.m_loc); TEVStage& stage = addTEVStage(diag, inst.m_loc);
stage.m_color[1] = aTrace.tevColorArg; stage.m_color[1] = aTrace.tevColorArg;
@ -314,8 +314,8 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
stage.m_kColor = newKColor; stage.m_kColor = newKColor;
return TraceResult(&stage); return TraceResult(&stage);
} }
else if (aTrace.type == TraceResult::TraceTEVStage && else if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVColorArg) bTrace.type == TraceResult::Type::TEVColorArg)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
if (a->m_color[1] != CC_ZERO) if (a->m_color[1] != CC_ZERO)
@ -334,8 +334,8 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
a->m_kColor = newKColor; a->m_kColor = newKColor;
return TraceResult(a); return TraceResult(a);
} }
else if (aTrace.type == TraceResult::TraceTEVColorArg && else if (aTrace.type == TraceResult::Type::TEVColorArg &&
bTrace.type == TraceResult::TraceTEVStage) bTrace.type == TraceResult::Type::TEVStage)
{ {
TEVStage* b = bTrace.tevStage; TEVStage* b = bTrace.tevStage;
if (b->m_color[1] != CC_ZERO) if (b->m_color[1] != CC_ZERO)
@ -362,13 +362,13 @@ GX::TraceResult GX::RecursiveTraceColor(const IR& ir, Diagnostics& diag, const I
diag.reportBackendErr(inst.m_loc, "unable to convert arithmetic to TEV stage"); diag.reportBackendErr(inst.m_loc, "unable to convert arithmetic to TEV stage");
} }
case IR::OpSwizzle: case IR::OpType::Swizzle:
{ {
if (inst.m_swizzle.m_idxs[0] == 3 && inst.m_swizzle.m_idxs[1] == 3 && if (inst.m_swizzle.m_idxs[0] == 3 && inst.m_swizzle.m_idxs[1] == 3 &&
inst.m_swizzle.m_idxs[2] == 3 && inst.m_swizzle.m_idxs[3] == -1) inst.m_swizzle.m_idxs[2] == 3 && inst.m_swizzle.m_idxs[3] == -1)
{ {
const IR::Instruction& cInst = inst.getChildInst(ir, 0); const IR::Instruction& cInst = inst.getChildInst(ir, 0);
if (cInst.m_op != IR::OpCall) if (cInst.m_op != IR::OpType::Call)
diag.reportBackendErr(inst.m_loc, "only functions accepted for alpha swizzle"); diag.reportBackendErr(inst.m_loc, "only functions accepted for alpha swizzle");
return RecursiveTraceColor(ir, diag, cInst, true); return RecursiveTraceColor(ir, diag, cInst, true);
} }
@ -386,7 +386,7 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
{ {
switch (inst.m_op) switch (inst.m_op)
{ {
case IR::OpCall: case IR::OpType::Call:
{ {
const std::string& name = inst.m_call.m_name; const std::string& name = inst.m_call.m_name;
if (!name.compare("Texture")) if (!name.compare("Texture"))
@ -443,7 +443,7 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
diag.reportBackendErr(inst.m_loc, "GX backend unable to interpret '%s'", name.c_str()); diag.reportBackendErr(inst.m_loc, "GX backend unable to interpret '%s'", name.c_str());
break; break;
} }
case IR::OpLoadImm: case IR::OpType::LoadImm:
{ {
const atVec4f& vec = inst.m_loadImm.m_immVec; const atVec4f& vec = inst.m_loadImm.m_immVec;
if (vec.vec[0] == 0.f) if (vec.vec[0] == 0.f)
@ -451,14 +451,14 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
unsigned idx = addKAlpha(diag, inst.m_loc, vec.vec[0]); unsigned idx = addKAlpha(diag, inst.m_loc, vec.vec[0]);
return TraceResult(TevKAlphaSel(TEV_KASEL_K0_A + idx)); return TraceResult(TevKAlphaSel(TEV_KASEL_K0_A + idx));
} }
case IR::OpArithmetic: case IR::OpType::Arithmetic:
{ {
ArithmeticOp op = inst.m_arithmetic.m_op; ArithmeticOp op = inst.m_arithmetic.m_op;
const IR::Instruction& aInst = inst.getChildInst(ir, 0); const IR::Instruction& aInst = inst.getChildInst(ir, 0);
const IR::Instruction& bInst = inst.getChildInst(ir, 1); const IR::Instruction& bInst = inst.getChildInst(ir, 1);
TraceResult aTrace; TraceResult aTrace;
TraceResult bTrace; TraceResult bTrace;
if (aInst.m_op != IR::OpArithmetic && bInst.m_op == IR::OpArithmetic) if (aInst.m_op != IR::OpType::Arithmetic && bInst.m_op == IR::OpType::Arithmetic)
{ {
bTrace = RecursiveTraceAlpha(ir, diag, bInst); bTrace = RecursiveTraceAlpha(ir, diag, bInst);
aTrace = RecursiveTraceAlpha(ir, diag, aInst); aTrace = RecursiveTraceAlpha(ir, diag, aInst);
@ -470,28 +470,28 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
} }
TevKAlphaSel newKAlpha = TEV_KASEL_1; TevKAlphaSel newKAlpha = TEV_KASEL_1;
if (aTrace.type == TraceResult::TraceTEVKAlphaSel && if (aTrace.type == TraceResult::Type::TEVKAlphaSel &&
bTrace.type == TraceResult::TraceTEVKAlphaSel) bTrace.type == TraceResult::Type::TEVKAlphaSel)
diag.reportBackendErr(inst.m_loc, "unable to handle 2 KAlphas in one stage"); diag.reportBackendErr(inst.m_loc, "unable to handle 2 KAlphas in one stage");
else if (aTrace.type == TraceResult::TraceTEVKAlphaSel) else if (aTrace.type == TraceResult::Type::TEVKAlphaSel)
{ {
newKAlpha = aTrace.tevKAlphaSel; newKAlpha = aTrace.tevKAlphaSel;
aTrace.type = TraceResult::TraceTEVAlphaArg; aTrace.type = TraceResult::Type::TEVAlphaArg;
aTrace.tevAlphaArg = CA_KONST; aTrace.tevAlphaArg = CA_KONST;
} }
else if (bTrace.type == TraceResult::TraceTEVKAlphaSel) else if (bTrace.type == TraceResult::Type::TEVKAlphaSel)
{ {
newKAlpha = bTrace.tevKAlphaSel; newKAlpha = bTrace.tevKAlphaSel;
bTrace.type = TraceResult::TraceTEVAlphaArg; bTrace.type = TraceResult::Type::TEVAlphaArg;
bTrace.tevAlphaArg = CA_KONST; bTrace.tevAlphaArg = CA_KONST;
} }
switch (op) switch (op)
{ {
case ArithmeticOp::ArithmeticOpAdd: case ArithmeticOp::Add:
{ {
if (aTrace.type == TraceResult::TraceTEVStage && if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVStage) bTrace.type == TraceResult::Type::TEVStage)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
TEVStage* b = bTrace.tevStage; TEVStage* b = bTrace.tevStage;
@ -511,8 +511,8 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
b->m_alpha[3] = CA_APREV; b->m_alpha[3] = CA_APREV;
return TraceResult(b); return TraceResult(b);
} }
else if (aTrace.type == TraceResult::TraceTEVStage && else if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVAlphaArg) bTrace.type == TraceResult::Type::TEVAlphaArg)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
if (a->m_alpha[3] != CA_ZERO) if (a->m_alpha[3] != CA_ZERO)
@ -521,8 +521,8 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
a->m_kAlpha = newKAlpha; a->m_kAlpha = newKAlpha;
return TraceResult(a); return TraceResult(a);
} }
else if (aTrace.type == TraceResult::TraceTEVAlphaArg && else if (aTrace.type == TraceResult::Type::TEVAlphaArg &&
bTrace.type == TraceResult::TraceTEVStage) bTrace.type == TraceResult::Type::TEVStage)
{ {
TEVStage* b = bTrace.tevStage; TEVStage* b = bTrace.tevStage;
if (b->m_alpha[3] != CA_ZERO) if (b->m_alpha[3] != CA_ZERO)
@ -533,10 +533,10 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
} }
break; break;
} }
case ArithmeticOp::ArithmeticOpSubtract: case ArithmeticOp::Subtract:
{ {
if (aTrace.type == TraceResult::TraceTEVStage && if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVStage) bTrace.type == TraceResult::Type::TEVStage)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
TEVStage* b = bTrace.tevStage; TEVStage* b = bTrace.tevStage;
@ -558,8 +558,8 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
b->m_alpha[3] = CA_APREV; b->m_alpha[3] = CA_APREV;
return TraceResult(b); return TraceResult(b);
} }
else if (aTrace.type == TraceResult::TraceTEVStage && else if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVAlphaArg) bTrace.type == TraceResult::Type::TEVAlphaArg)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
if (a->m_aop != TEV_SUB) if (a->m_aop != TEV_SUB)
@ -572,10 +572,10 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
} }
break; break;
} }
case ArithmeticOp::ArithmeticOpMultiply: case ArithmeticOp::Multiply:
{ {
if (aTrace.type == TraceResult::TraceTEVStage && if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVStage) bTrace.type == TraceResult::Type::TEVStage)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
TEVStage* b = bTrace.tevStage; TEVStage* b = bTrace.tevStage;
@ -595,8 +595,8 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
b->m_alpha[3] = CA_ZERO; b->m_alpha[3] = CA_ZERO;
return TraceResult(b); return TraceResult(b);
} }
else if (aTrace.type == TraceResult::TraceTEVAlphaArg && else if (aTrace.type == TraceResult::Type::TEVAlphaArg &&
bTrace.type == TraceResult::TraceTEVAlphaArg) bTrace.type == TraceResult::Type::TEVAlphaArg)
{ {
TEVStage& stage = addTEVStage(diag, inst.m_loc); TEVStage& stage = addTEVStage(diag, inst.m_loc);
stage.m_color[3] = CC_CPREV; stage.m_color[3] = CC_CPREV;
@ -605,8 +605,8 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
stage.m_kAlpha = newKAlpha; stage.m_kAlpha = newKAlpha;
return TraceResult(&stage); return TraceResult(&stage);
} }
else if (aTrace.type == TraceResult::TraceTEVStage && else if (aTrace.type == TraceResult::Type::TEVStage &&
bTrace.type == TraceResult::TraceTEVAlphaArg) bTrace.type == TraceResult::Type::TEVAlphaArg)
{ {
TEVStage* a = aTrace.tevStage; TEVStage* a = aTrace.tevStage;
if (a->m_alpha[1] != CA_ZERO) if (a->m_alpha[1] != CA_ZERO)
@ -625,8 +625,8 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
a->m_kAlpha = newKAlpha; a->m_kAlpha = newKAlpha;
return TraceResult(a); return TraceResult(a);
} }
else if (aTrace.type == TraceResult::TraceTEVAlphaArg && else if (aTrace.type == TraceResult::Type::TEVAlphaArg &&
bTrace.type == TraceResult::TraceTEVStage) bTrace.type == TraceResult::Type::TEVStage)
{ {
TEVStage* b = bTrace.tevStage; TEVStage* b = bTrace.tevStage;
if (b->m_alpha[1] != CA_ZERO) if (b->m_alpha[1] != CA_ZERO)
@ -653,13 +653,13 @@ GX::TraceResult GX::RecursiveTraceAlpha(const IR& ir, Diagnostics& diag, const I
diag.reportBackendErr(inst.m_loc, "unable to convert arithmetic to TEV stage"); diag.reportBackendErr(inst.m_loc, "unable to convert arithmetic to TEV stage");
} }
case IR::OpSwizzle: case IR::OpType::Swizzle:
{ {
if (inst.m_swizzle.m_idxs[0] == 3 && inst.m_swizzle.m_idxs[1] == 3 && if (inst.m_swizzle.m_idxs[0] == 3 && inst.m_swizzle.m_idxs[1] == 3 &&
inst.m_swizzle.m_idxs[2] == 3 && inst.m_swizzle.m_idxs[3] == -1) inst.m_swizzle.m_idxs[2] == 3 && inst.m_swizzle.m_idxs[3] == -1)
{ {
const IR::Instruction& cInst = inst.getChildInst(ir, 0); const IR::Instruction& cInst = inst.getChildInst(ir, 0);
if (cInst.m_op != IR::OpCall) if (cInst.m_op != IR::OpType::Call)
diag.reportBackendErr(inst.m_loc, "only functions accepted for alpha swizzle"); diag.reportBackendErr(inst.m_loc, "only functions accepted for alpha swizzle");
return RecursiveTraceAlpha(ir, diag, cInst); return RecursiveTraceAlpha(ir, diag, cInst);
} }

View File

@ -42,7 +42,7 @@ unsigned ProgrammableCommon::addTexSampling(unsigned mapIdx, unsigned tcgIdx)
unsigned ProgrammableCommon::RecursiveTraceTexGen(const IR& ir, Diagnostics& diag, unsigned ProgrammableCommon::RecursiveTraceTexGen(const IR& ir, Diagnostics& diag,
const IR::Instruction& inst, int mtx) const IR::Instruction& inst, int mtx)
{ {
if (inst.m_op != IR::OpCall) if (inst.m_op != IR::OpType::Call)
diag.reportBackendErr(inst.m_loc, "TexCoordGen resolution requires function"); diag.reportBackendErr(inst.m_loc, "TexCoordGen resolution requires function");
const std::string& tcgName = inst.m_call.m_name; const std::string& tcgName = inst.m_call.m_name;
@ -52,12 +52,12 @@ unsigned ProgrammableCommon::RecursiveTraceTexGen(const IR& ir, Diagnostics& dia
diag.reportBackendErr(inst.m_loc, "TexCoordGen UV(layerIdx) requires one argument"); diag.reportBackendErr(inst.m_loc, "TexCoordGen UV(layerIdx) requires one argument");
const IR::Instruction& idxInst = inst.getChildInst(ir, 0); const IR::Instruction& idxInst = inst.getChildInst(ir, 0);
const atVec4f& idxImm = idxInst.getImmVec(); const atVec4f& idxImm = idxInst.getImmVec();
return addTexCoordGen(TG_UV, idxImm.vec[0], mtx); return addTexCoordGen(TexGenSrc::UV, idxImm.vec[0], mtx);
} }
else if (!tcgName.compare("Normal")) else if (!tcgName.compare("Normal"))
return addTexCoordGen(TG_NRM, -1, mtx); return addTexCoordGen(TexGenSrc::Normal, -1, mtx);
else if (!tcgName.compare("View")) else if (!tcgName.compare("View"))
return addTexCoordGen(TG_POS, -1, mtx); return addTexCoordGen(TexGenSrc::Position, -1, mtx);
/* Otherwise treat as game-specific function */ /* Otherwise treat as game-specific function */
const IR::Instruction& tcgSrcInst = inst.getChildInst(ir, 0); const IR::Instruction& tcgSrcInst = inst.getChildInst(ir, 0);
@ -79,7 +79,7 @@ std::string ProgrammableCommon::RecursiveTraceColor(const IR& ir, Diagnostics& d
{ {
switch (inst.m_op) switch (inst.m_op)
{ {
case IR::OpCall: case IR::OpType::Call:
{ {
const std::string& name = inst.m_call.m_name; const std::string& name = inst.m_call.m_name;
if (!name.compare("Texture")) if (!name.compare("Texture"))
@ -111,12 +111,12 @@ std::string ProgrammableCommon::RecursiveTraceColor(const IR& ir, Diagnostics& d
diag.reportBackendErr(inst.m_loc, "unable to interpret '%s'", name.c_str()); diag.reportBackendErr(inst.m_loc, "unable to interpret '%s'", name.c_str());
break; break;
} }
case IR::OpLoadImm: case IR::OpType::LoadImm:
{ {
const atVec4f& vec = inst.m_loadImm.m_immVec; const atVec4f& vec = inst.m_loadImm.m_immVec;
return EmitVec3(vec); return EmitVec3(vec);
} }
case IR::OpArithmetic: case IR::OpType::Arithmetic:
{ {
ArithmeticOp op = inst.m_arithmetic.m_op; ArithmeticOp op = inst.m_arithmetic.m_op;
const IR::Instruction& aInst = inst.getChildInst(ir, 0); const IR::Instruction& aInst = inst.getChildInst(ir, 0);
@ -126,19 +126,19 @@ std::string ProgrammableCommon::RecursiveTraceColor(const IR& ir, Diagnostics& d
switch (op) switch (op)
{ {
case ArithmeticOp::ArithmeticOpAdd: case ArithmeticOp::Add:
{ {
return EmitAdd(aTrace, bTrace); return EmitAdd(aTrace, bTrace);
} }
case ArithmeticOp::ArithmeticOpSubtract: case ArithmeticOp::Subtract:
{ {
return EmitSub(aTrace, bTrace); return EmitSub(aTrace, bTrace);
} }
case ArithmeticOp::ArithmeticOpMultiply: case ArithmeticOp::Multiply:
{ {
return EmitMult(aTrace, bTrace); return EmitMult(aTrace, bTrace);
} }
case ArithmeticOp::ArithmeticOpDivide: case ArithmeticOp::Divide:
{ {
return EmitDiv(aTrace, bTrace); return EmitDiv(aTrace, bTrace);
} }
@ -146,7 +146,7 @@ std::string ProgrammableCommon::RecursiveTraceColor(const IR& ir, Diagnostics& d
diag.reportBackendErr(inst.m_loc, "invalid arithmetic op"); diag.reportBackendErr(inst.m_loc, "invalid arithmetic op");
} }
} }
case IR::OpSwizzle: case IR::OpType::Swizzle:
{ {
const IR::Instruction& aInst = inst.getChildInst(ir, 0); const IR::Instruction& aInst = inst.getChildInst(ir, 0);
std::string aTrace = RecursiveTraceColor(ir, diag, aInst); std::string aTrace = RecursiveTraceColor(ir, diag, aInst);
@ -164,7 +164,7 @@ std::string ProgrammableCommon::RecursiveTraceAlpha(const IR& ir, Diagnostics& d
{ {
switch (inst.m_op) switch (inst.m_op)
{ {
case IR::OpCall: case IR::OpType::Call:
{ {
const std::string& name = inst.m_call.m_name; const std::string& name = inst.m_call.m_name;
if (!name.compare("Texture")) if (!name.compare("Texture"))
@ -196,12 +196,12 @@ std::string ProgrammableCommon::RecursiveTraceAlpha(const IR& ir, Diagnostics& d
diag.reportBackendErr(inst.m_loc, "unable to interpret '%s'", name.c_str()); diag.reportBackendErr(inst.m_loc, "unable to interpret '%s'", name.c_str());
break; break;
} }
case IR::OpLoadImm: case IR::OpType::LoadImm:
{ {
const atVec4f& vec = inst.m_loadImm.m_immVec; const atVec4f& vec = inst.m_loadImm.m_immVec;
return EmitVal(vec.vec[0]); return EmitVal(vec.vec[0]);
} }
case IR::OpArithmetic: case IR::OpType::Arithmetic:
{ {
ArithmeticOp op = inst.m_arithmetic.m_op; ArithmeticOp op = inst.m_arithmetic.m_op;
const IR::Instruction& aInst = inst.getChildInst(ir, 0); const IR::Instruction& aInst = inst.getChildInst(ir, 0);
@ -211,19 +211,19 @@ std::string ProgrammableCommon::RecursiveTraceAlpha(const IR& ir, Diagnostics& d
switch (op) switch (op)
{ {
case ArithmeticOp::ArithmeticOpAdd: case ArithmeticOp::Add:
{ {
return EmitAdd(aTrace, bTrace); return EmitAdd(aTrace, bTrace);
} }
case ArithmeticOp::ArithmeticOpSubtract: case ArithmeticOp::Subtract:
{ {
return EmitSub(aTrace, bTrace); return EmitSub(aTrace, bTrace);
} }
case ArithmeticOp::ArithmeticOpMultiply: case ArithmeticOp::Multiply:
{ {
return EmitMult(aTrace, bTrace); return EmitMult(aTrace, bTrace);
} }
case ArithmeticOp::ArithmeticOpDivide: case ArithmeticOp::Divide:
{ {
return EmitDiv(aTrace, bTrace); return EmitDiv(aTrace, bTrace);
} }
@ -231,7 +231,7 @@ std::string ProgrammableCommon::RecursiveTraceAlpha(const IR& ir, Diagnostics& d
diag.reportBackendErr(inst.m_loc, "invalid arithmetic op"); diag.reportBackendErr(inst.m_loc, "invalid arithmetic op");
} }
} }
case IR::OpSwizzle: case IR::OpType::Swizzle:
{ {
const IR::Instruction& aInst = inst.getChildInst(ir, 0); const IR::Instruction& aInst = inst.getChildInst(ir, 0);
std::string aTrace = RecursiveTraceAlpha(ir, diag, aInst); std::string aTrace = RecursiveTraceAlpha(ir, diag, aInst);
@ -253,19 +253,19 @@ void ProgrammableCommon::reset(const IR& ir, Diagnostics& diag, const char* back
bool doAlpha = false; bool doAlpha = false;
if (!rootCall.m_call.m_name.compare("HECLOpaque")) if (!rootCall.m_call.m_name.compare("HECLOpaque"))
{ {
m_blendSrc = boo::BlendFactorOne; m_blendSrc = boo::BlendFactor::One;
m_blendDst = boo::BlendFactorZero; m_blendDst = boo::BlendFactor::Zero;
} }
else if (!rootCall.m_call.m_name.compare("HECLAlpha")) else if (!rootCall.m_call.m_name.compare("HECLAlpha"))
{ {
m_blendSrc = boo::BlendFactorSrcAlpha; m_blendSrc = boo::BlendFactor::SrcAlpha;
m_blendDst = boo::BlendFactorInvSrcAlpha; m_blendDst = boo::BlendFactor::InvSrcAlpha;
doAlpha = true; doAlpha = true;
} }
else if (!rootCall.m_call.m_name.compare("HECLAdditive")) else if (!rootCall.m_call.m_name.compare("HECLAdditive"))
{ {
m_blendSrc = boo::BlendFactorSrcAlpha; m_blendSrc = boo::BlendFactor::SrcAlpha;
m_blendDst = boo::BlendFactorOne; m_blendDst = boo::BlendFactor::One;
doAlpha = true; doAlpha = true;
} }
else else

View File

@ -53,7 +53,7 @@ std::vector<std::string>& Project::ConfigFile::lockAndRead()
if (m_lockedFile) if (m_lockedFile)
return m_lines; return m_lines;
m_lockedFile = HECL::Fopen(m_filepath.c_str(), _S("a+"), LWRITE); m_lockedFile = HECL::Fopen(m_filepath.c_str(), _S("a+"), FileLockType::Write);
std::string mainString; std::string mainString;
char readBuf[1024]; char readBuf[1024];
@ -151,7 +151,7 @@ bool Project::ConfigFile::unlockAndCommit()
} }
SystemString newPath = m_filepath + _S(".part"); SystemString newPath = m_filepath + _S(".part");
FILE* newFile = HECL::Fopen(newPath.c_str(), _S("w"), LWRITE); FILE* newFile = HECL::Fopen(newPath.c_str(), _S("w"), FileLockType::Write);
bool fail = false; bool fail = false;
for (const std::string& line : m_lines) for (const std::string& line : m_lines)
{ {
@ -383,7 +383,7 @@ static void VisitFile(const ProjectPath& path, bool force, bool fast,
ProjectPath cooked = path.getCookedPath(*spec.first); ProjectPath cooked = path.getCookedPath(*spec.first);
if (fast) if (fast)
cooked = cooked.getWithExtension(_S(".fast")); cooked = cooked.getWithExtension(_S(".fast"));
if (force || cooked.getPathType() == ProjectPath::PT_NONE || if (force || cooked.getPathType() == ProjectPath::Type::None ||
path.getModtime() > cooked.getModtime()) path.getModtime() > cooked.getModtime())
{ {
progress.reportFile(spec.first); progress.reportFile(spec.first);
@ -411,15 +411,15 @@ static void VisitDirectory(const ProjectPath& dir,
{ {
switch (child.second.getPathType()) switch (child.second.getPathType())
{ {
case ProjectPath::PT_FILE: case ProjectPath::Type::File:
{ {
++childFileCount; ++childFileCount;
break; break;
} }
case ProjectPath::PT_LINK: case ProjectPath::Type::Link:
{ {
ProjectPath target = child.second.resolveLink(); ProjectPath target = child.second.resolveLink();
if (target.getPathType() == ProjectPath::PT_FILE) if (target.getPathType() == ProjectPath::Type::File)
++childFileCount; ++childFileCount;
break; break;
} }
@ -435,16 +435,16 @@ static void VisitDirectory(const ProjectPath& dir,
{ {
switch (child.second.getPathType()) switch (child.second.getPathType())
{ {
case ProjectPath::PT_FILE: case ProjectPath::Type::File:
{ {
progress.changeFile(child.first.c_str(), progNum++/progDenom); progress.changeFile(child.first.c_str(), progNum++/progDenom);
VisitFile(child.second, force, fast, specInsts, progress); VisitFile(child.second, force, fast, specInsts, progress);
break; break;
} }
case ProjectPath::PT_LINK: case ProjectPath::Type::Link:
{ {
ProjectPath target = child.second.resolveLink(); ProjectPath target = child.second.resolveLink();
if (target.getPathType() == ProjectPath::PT_FILE) if (target.getPathType() == ProjectPath::Type::File)
{ {
progress.changeFile(target.getLastComponent(), progNum++/progDenom); progress.changeFile(target.getLastComponent(), progNum++/progDenom);
VisitFile(target, force, fast, specInsts, progress); VisitFile(target, force, fast, specInsts, progress);
@ -463,7 +463,7 @@ static void VisitDirectory(const ProjectPath& dir,
{ {
switch (child.second.getPathType()) switch (child.second.getPathType())
{ {
case ProjectPath::PT_DIRECTORY: case ProjectPath::Type::Directory:
{ {
VisitDirectory(child.second, recursive, force, fast, specInsts, progress); VisitDirectory(child.second, recursive, force, fast, specInsts, progress);
break; break;
@ -488,15 +488,15 @@ static void VisitGlob(const ProjectPath& path,
{ {
switch (child.getPathType()) switch (child.getPathType())
{ {
case ProjectPath::PT_FILE: case ProjectPath::Type::File:
{ {
++childFileCount; ++childFileCount;
break; break;
} }
case ProjectPath::PT_LINK: case ProjectPath::Type::Link:
{ {
ProjectPath target = path.resolveLink(); ProjectPath target = path.resolveLink();
if (target.getPathType() == ProjectPath::PT_FILE) if (target.getPathType() == ProjectPath::Type::File)
++childFileCount; ++childFileCount;
break; break;
} }
@ -512,16 +512,16 @@ static void VisitGlob(const ProjectPath& path,
{ {
switch (child.getPathType()) switch (child.getPathType())
{ {
case ProjectPath::PT_FILE: case ProjectPath::Type::File:
{ {
progress.changeFile(child.getLastComponent(), progNum++/progDenom); progress.changeFile(child.getLastComponent(), progNum++/progDenom);
VisitFile(child, force, fast, specInsts, progress); VisitFile(child, force, fast, specInsts, progress);
break; break;
} }
case ProjectPath::PT_LINK: case ProjectPath::Type::Link:
{ {
ProjectPath target = path.resolveLink(); ProjectPath target = path.resolveLink();
if (target.getPathType() == ProjectPath::PT_FILE) if (target.getPathType() == ProjectPath::Type::File)
{ {
progress.changeFile(target.getLastComponent(), progNum++/progDenom); progress.changeFile(target.getLastComponent(), progNum++/progDenom);
VisitFile(target, force, fast, specInsts, progress); VisitFile(target, force, fast, specInsts, progress);
@ -540,7 +540,7 @@ static void VisitGlob(const ProjectPath& path,
{ {
switch (child.getPathType()) switch (child.getPathType())
{ {
case ProjectPath::PT_DIRECTORY: case ProjectPath::Type::Directory:
{ {
VisitDirectory(child, recursive, force, fast, specInsts, progress); VisitDirectory(child, recursive, force, fast, specInsts, progress);
break; break;
@ -560,34 +560,34 @@ bool Project::cookPath(const ProjectPath& path, FProgress progress,
for (const ProjectDataSpec& spec : m_compiledSpecs) for (const ProjectDataSpec& spec : m_compiledSpecs)
if (spec.active) if (spec.active)
specInsts.emplace_back(&spec.spec, specInsts.emplace_back(&spec.spec,
std::unique_ptr<IDataSpec>(spec.spec.m_factory(*this, TOOL_COOK))); std::unique_ptr<IDataSpec>(spec.spec.m_factory(*this, DataSpecTool::Cook)));
/* Iterate complete directory/file/glob list */ /* Iterate complete directory/file/glob list */
CookProgress cookProg(progress); CookProgress cookProg(progress);
switch (path.getPathType()) switch (path.getPathType())
{ {
case ProjectPath::PT_FILE: case ProjectPath::Type::File:
{ {
cookProg.changeFile(path.getLastComponent(), 0.0); cookProg.changeFile(path.getLastComponent(), 0.0);
VisitFile(path, force, fast, specInsts, cookProg); VisitFile(path, force, fast, specInsts, cookProg);
break; break;
} }
case ProjectPath::PT_LINK: case ProjectPath::Type::Link:
{ {
ProjectPath target = path.resolveLink(); ProjectPath target = path.resolveLink();
if (target.getPathType() == ProjectPath::PT_FILE) if (target.getPathType() == ProjectPath::Type::File)
{ {
cookProg.changeFile(target.getLastComponent(), 0.0); cookProg.changeFile(target.getLastComponent(), 0.0);
VisitFile(target, force, fast, specInsts, cookProg); VisitFile(target, force, fast, specInsts, cookProg);
} }
break; break;
} }
case ProjectPath::PT_DIRECTORY: case ProjectPath::Type::Directory:
{ {
VisitDirectory(path, recursive, force, fast, specInsts, cookProg); VisitDirectory(path, recursive, force, fast, specInsts, cookProg);
break; break;
} }
case ProjectPath::PT_GLOB: case ProjectPath::Type::Glob:
{ {
VisitGlob(path, recursive, force, fast, specInsts, cookProg); VisitGlob(path, recursive, force, fast, specInsts, cookProg);
break; break;

View File

@ -13,15 +13,15 @@ static IR::Instruction::ArithmeticOpType ArithType(int aChar)
switch (aChar) switch (aChar)
{ {
case '+': case '+':
return IR::Instruction::ArithmeticOpAdd; return IR::Instruction::ArithmeticOpType::Add;
case '-': case '-':
return IR::Instruction::ArithmeticOpSubtract; return IR::Instruction::ArithmeticOpType::Subtract;
case '*': case '*':
return IR::Instruction::ArithmeticOpMultiply; return IR::Instruction::ArithmeticOpType::Multiply;
case '/': case '/':
return IR::Instruction::ArithmeticOpDivide; return IR::Instruction::ArithmeticOpType::Divide;
default: default:
return IR::Instruction::ArithmeticOpNone; return IR::Instruction::ArithmeticOpType::None;
} }
} }
@ -79,7 +79,7 @@ void Lexer::consumeAllTokens(Parser& parser)
{ {
reset(); reset();
Parser::Token firstTok = parser.consumeToken(); Parser::Token firstTok = parser.consumeToken();
if (firstTok.m_type != Parser::TokenSourceBegin) if (firstTok.m_type != Parser::TokenType::SourceBegin)
{ {
m_diag.reportLexerErr(firstTok.m_location, "expected start token"); m_diag.reportLexerErr(firstTok.m_location, "expected start token");
return; return;
@ -93,15 +93,15 @@ void Lexer::consumeAllTokens(Parser& parser)
{ {
std::vector<SourceLocation> funcStack; std::vector<SourceLocation> funcStack;
std::vector<SourceLocation> groupStack; std::vector<SourceLocation> groupStack;
while (lastNode->m_tok.m_type != Parser::TokenSourceEnd) while (lastNode->m_tok.m_type != Parser::TokenType::SourceEnd)
{ {
Parser::Token tok = parser.consumeToken(); Parser::Token tok = parser.consumeToken();
switch (tok.m_type) switch (tok.m_type)
{ {
case Parser::TokenEvalGroupStart: case Parser::TokenType::EvalGroupStart:
groupStack.push_back(tok.m_location); groupStack.push_back(tok.m_location);
break; break;
case Parser::TokenEvalGroupEnd: case Parser::TokenType::EvalGroupEnd:
if (groupStack.empty()) if (groupStack.empty())
{ {
m_diag.reportLexerErr(tok.m_location, "unbalanced group detected"); m_diag.reportLexerErr(tok.m_location, "unbalanced group detected");
@ -109,10 +109,10 @@ void Lexer::consumeAllTokens(Parser& parser)
} }
groupStack.pop_back(); groupStack.pop_back();
break; break;
case Parser::TokenFunctionStart: case Parser::TokenType::FunctionStart:
funcStack.push_back(tok.m_location); funcStack.push_back(tok.m_location);
break; break;
case Parser::TokenFunctionEnd: case Parser::TokenType::FunctionEnd:
if (funcStack.empty()) if (funcStack.empty())
{ {
m_diag.reportLexerErr(tok.m_location, "unbalanced function detected"); m_diag.reportLexerErr(tok.m_location, "unbalanced function detected");
@ -120,11 +120,11 @@ void Lexer::consumeAllTokens(Parser& parser)
} }
funcStack.pop_back(); funcStack.pop_back();
break; break;
case Parser::TokenSourceEnd: case Parser::TokenType::SourceEnd:
case Parser::TokenNumLiteral: case Parser::TokenType::NumLiteral:
case Parser::TokenVectorSwizzle: case Parser::TokenType::VectorSwizzle:
case Parser::TokenFunctionArgDelim: case Parser::TokenType::FunctionArgDelim:
case Parser::TokenArithmeticOp: case Parser::TokenType::ArithmeticOp:
break; break;
default: default:
m_diag.reportLexerErr(tok.m_location, "invalid token"); m_diag.reportLexerErr(tok.m_location, "invalid token");
@ -150,7 +150,7 @@ void Lexer::consumeAllTokens(Parser& parser)
} }
/* Ensure first non-start node is a function */ /* Ensure first non-start node is a function */
if (firstNode->m_next->m_tok.m_type != Parser::TokenFunctionStart) if (firstNode->m_next->m_tok.m_type != Parser::TokenType::FunctionStart)
{ {
m_diag.reportLexerErr(firstNode->m_tok.m_location, "expected root function"); m_diag.reportLexerErr(firstNode->m_tok.m_location, "expected root function");
return; return;
@ -159,17 +159,17 @@ void Lexer::consumeAllTokens(Parser& parser)
/* Organize marked function args into implicit groups */ /* Organize marked function args into implicit groups */
for (Lexer::OperationNode* n = firstNode ; n != lastNode ; n = n->m_next) for (Lexer::OperationNode* n = firstNode ; n != lastNode ; n = n->m_next)
{ {
if (n->m_tok.m_type == Parser::TokenFunctionStart) if (n->m_tok.m_type == Parser::TokenType::FunctionStart)
{ {
if (n->m_next->m_tok.m_type != Parser::TokenFunctionEnd) if (n->m_next->m_tok.m_type != Parser::TokenType::FunctionEnd)
{ {
if (n->m_next->m_tok.m_type == Parser::TokenFunctionArgDelim) if (n->m_next->m_tok.m_type == Parser::TokenType::FunctionArgDelim)
{ {
m_diag.reportLexerErr(n->m_next->m_tok.m_location, "empty function arg"); m_diag.reportLexerErr(n->m_next->m_tok.m_location, "empty function arg");
return; return;
} }
m_pool.emplace_front(std::move( m_pool.emplace_front(std::move(
Parser::Token(Parser::TokenEvalGroupStart, n->m_next->m_tok.m_location))); Parser::Token(Parser::TokenType::EvalGroupStart, n->m_next->m_tok.m_location)));
Lexer::OperationNode* grp = &m_pool.front(); Lexer::OperationNode* grp = &m_pool.front();
grp->m_next = n->m_next; grp->m_next = n->m_next;
grp->m_prev = n; grp->m_prev = n;
@ -177,12 +177,12 @@ void Lexer::consumeAllTokens(Parser& parser)
n->m_next = grp; n->m_next = grp;
} }
} }
else if (n->m_tok.m_type == Parser::TokenFunctionEnd) else if (n->m_tok.m_type == Parser::TokenType::FunctionEnd)
{ {
if (n->m_prev->m_tok.m_type != Parser::TokenFunctionStart) if (n->m_prev->m_tok.m_type != Parser::TokenType::FunctionStart)
{ {
m_pool.emplace_front(std::move( m_pool.emplace_front(std::move(
Parser::Token(Parser::TokenEvalGroupEnd, n->m_tok.m_location))); Parser::Token(Parser::TokenType::EvalGroupEnd, n->m_tok.m_location)));
Lexer::OperationNode* grp = &m_pool.front(); Lexer::OperationNode* grp = &m_pool.front();
grp->m_next = n; grp->m_next = n;
grp->m_prev = n->m_prev; grp->m_prev = n->m_prev;
@ -190,21 +190,21 @@ void Lexer::consumeAllTokens(Parser& parser)
n->m_prev = grp; n->m_prev = grp;
} }
} }
else if (n->m_tok.m_type == Parser::TokenFunctionArgDelim) else if (n->m_tok.m_type == Parser::TokenType::FunctionArgDelim)
{ {
if (n->m_next->m_tok.m_type == Parser::TokenFunctionArgDelim || if (n->m_next->m_tok.m_type == Parser::TokenType::FunctionArgDelim ||
n->m_next->m_tok.m_type == Parser::TokenFunctionEnd) n->m_next->m_tok.m_type == Parser::TokenType::FunctionEnd)
{ {
m_diag.reportLexerErr(n->m_next->m_tok.m_location, "empty function arg"); m_diag.reportLexerErr(n->m_next->m_tok.m_location, "empty function arg");
return; return;
} }
m_pool.emplace_front(std::move( m_pool.emplace_front(std::move(
Parser::Token(Parser::TokenEvalGroupEnd, n->m_tok.m_location))); Parser::Token(Parser::TokenType::EvalGroupEnd, n->m_tok.m_location)));
Lexer::OperationNode* egrp = &m_pool.front(); Lexer::OperationNode* egrp = &m_pool.front();
m_pool.emplace_front(std::move( m_pool.emplace_front(std::move(
Parser::Token(Parser::TokenEvalGroupStart, n->m_next->m_tok.m_location))); Parser::Token(Parser::TokenType::EvalGroupStart, n->m_next->m_tok.m_location)));
Lexer::OperationNode* sgrp = &m_pool.front(); Lexer::OperationNode* sgrp = &m_pool.front();
egrp->m_next = sgrp; egrp->m_next = sgrp;
@ -222,9 +222,9 @@ void Lexer::consumeAllTokens(Parser& parser)
std::vector<Lexer::OperationNode*> groupStack; std::vector<Lexer::OperationNode*> groupStack;
for (Lexer::OperationNode* n = firstNode ; n != lastNode ; n = n->m_next) for (Lexer::OperationNode* n = firstNode ; n != lastNode ; n = n->m_next)
{ {
if (n->m_tok.m_type == Parser::TokenEvalGroupStart) if (n->m_tok.m_type == Parser::TokenType::EvalGroupStart)
groupStack.push_back(n); groupStack.push_back(n);
else if (n->m_tok.m_type == Parser::TokenEvalGroupEnd) else if (n->m_tok.m_type == Parser::TokenType::EvalGroupEnd)
{ {
Lexer::OperationNode* start = groupStack.back(); Lexer::OperationNode* start = groupStack.back();
groupStack.pop_back(); groupStack.pop_back();
@ -245,11 +245,11 @@ void Lexer::consumeAllTokens(Parser& parser)
/* Organize functions into tree-hierarchy */ /* Organize functions into tree-hierarchy */
for (Lexer::OperationNode& n : m_pool) for (Lexer::OperationNode& n : m_pool)
{ {
if (n.m_tok.m_type == Parser::TokenFunctionStart) if (n.m_tok.m_type == Parser::TokenType::FunctionStart)
{ {
for (Lexer::OperationNode* sn = n.m_next ; sn ; sn = sn->m_next) for (Lexer::OperationNode* sn = n.m_next ; sn ; sn = sn->m_next)
{ {
if (sn->m_tok.m_type == Parser::TokenFunctionEnd) if (sn->m_tok.m_type == Parser::TokenType::FunctionEnd)
{ {
n.m_sub = n.m_next; n.m_sub = n.m_next;
if (n.m_next == sn) if (n.m_next == sn)
@ -270,9 +270,9 @@ void Lexer::consumeAllTokens(Parser& parser)
/* Organize vector swizzles into tree-hierarchy */ /* Organize vector swizzles into tree-hierarchy */
for (Lexer::OperationNode& n : m_pool) for (Lexer::OperationNode& n : m_pool)
{ {
if (n.m_tok.m_type == Parser::TokenVectorSwizzle) if (n.m_tok.m_type == Parser::TokenType::VectorSwizzle)
{ {
if (n.m_prev->m_tok.m_type != Parser::TokenFunctionStart) if (n.m_prev->m_tok.m_type != Parser::TokenType::FunctionStart)
{ {
m_diag.reportLexerErr(n.m_tok.m_location, m_diag.reportLexerErr(n.m_tok.m_location,
"vector swizzles may only follow functions"); "vector swizzles may only follow functions");
@ -296,13 +296,13 @@ void Lexer::consumeAllTokens(Parser& parser)
/* Ensure evaluation groups have proper arithmetic usage */ /* Ensure evaluation groups have proper arithmetic usage */
for (Lexer::OperationNode& n : m_pool) for (Lexer::OperationNode& n : m_pool)
{ {
if (n.m_tok.m_type == Parser::TokenEvalGroupStart) if (n.m_tok.m_type == Parser::TokenType::EvalGroupStart)
{ {
int idx = 0; int idx = 0;
for (Lexer::OperationNode* sn = n.m_sub ; sn ; sn = sn->m_next, ++idx) for (Lexer::OperationNode* sn = n.m_sub ; sn ; sn = sn->m_next, ++idx)
{ {
if ((sn->m_tok.m_type == Parser::TokenArithmeticOp && !(idx & 1)) || if ((sn->m_tok.m_type == Parser::TokenType::ArithmeticOp && !(idx & 1)) ||
(sn->m_tok.m_type != Parser::TokenArithmeticOp && (idx & 1))) (sn->m_tok.m_type != Parser::TokenType::ArithmeticOp && (idx & 1)))
{ {
m_diag.reportLexerErr(sn->m_tok.m_location, "improper arithmetic expression"); m_diag.reportLexerErr(sn->m_tok.m_location, "improper arithmetic expression");
return; return;
@ -314,27 +314,27 @@ void Lexer::consumeAllTokens(Parser& parser)
/* Organize arithmetic usage into tree-hierarchy */ /* Organize arithmetic usage into tree-hierarchy */
for (Lexer::OperationNode& n : m_pool) for (Lexer::OperationNode& n : m_pool)
{ {
if (n.m_tok.m_type == Parser::TokenEvalGroupStart) if (n.m_tok.m_type == Parser::TokenType::EvalGroupStart)
{ {
Lexer::OperationNode* newSub = nullptr; Lexer::OperationNode* newSub = nullptr;
Lexer::OperationNode* lastSub = nullptr; Lexer::OperationNode* lastSub = nullptr;
for (Lexer::OperationNode* sn = n.m_sub ; sn ; sn = sn->m_next) for (Lexer::OperationNode* sn = n.m_sub ; sn ; sn = sn->m_next)
{ {
if (sn->m_tok.m_type == Parser::TokenArithmeticOp) if (sn->m_tok.m_type == Parser::TokenType::ArithmeticOp)
{ {
IR::Instruction::ArithmeticOpType op = ArithType(sn->m_tok.m_tokenInt); IR::Instruction::ArithmeticOpType op = ArithType(sn->m_tok.m_tokenInt);
if (op == IR::Instruction::ArithmeticOpMultiply || if (op == IR::Instruction::ArithmeticOpType::Multiply ||
op == IR::Instruction::ArithmeticOpDivide) op == IR::Instruction::ArithmeticOpType::Divide)
ReconnectArithmetic(sn, &lastSub, &newSub); ReconnectArithmetic(sn, &lastSub, &newSub);
} }
} }
for (Lexer::OperationNode* sn = n.m_sub ; sn ; sn = sn->m_next) for (Lexer::OperationNode* sn = n.m_sub ; sn ; sn = sn->m_next)
{ {
if (sn->m_tok.m_type == Parser::TokenArithmeticOp) if (sn->m_tok.m_type == Parser::TokenType::ArithmeticOp)
{ {
IR::Instruction::ArithmeticOpType op = ArithType(sn->m_tok.m_tokenInt); IR::Instruction::ArithmeticOpType op = ArithType(sn->m_tok.m_tokenInt);
if (op == IR::Instruction::ArithmeticOpAdd || if (op == IR::Instruction::ArithmeticOpType::Add ||
op == IR::Instruction::ArithmeticOpSubtract) op == IR::Instruction::ArithmeticOpType::Subtract)
ReconnectArithmetic(sn, &lastSub, &newSub); ReconnectArithmetic(sn, &lastSub, &newSub);
} }
} }
@ -360,7 +360,7 @@ void Lexer::EmitVec3(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar
const Lexer::OperationNode* gn = funcNode->m_sub; const Lexer::OperationNode* gn = funcNode->m_sub;
if (!gn) if (!gn)
{ {
ir.m_instructions.emplace_back(IR::OpLoadImm, funcNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::LoadImm, funcNode->m_tok.m_location);
return; return;
} }
@ -369,7 +369,7 @@ void Lexer::EmitVec3(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar
const Parser::Token* imms[3]; const Parser::Token* imms[3];
for (int i=0 ; i<3 ; ++i) for (int i=0 ; i<3 ; ++i)
{ {
if (!gn->m_sub || gn->m_sub->m_tok.m_type != Parser::TokenNumLiteral) if (!gn->m_sub || gn->m_sub->m_tok.m_type != Parser::TokenType::NumLiteral)
{ {
opt = false; opt = false;
break; break;
@ -379,7 +379,7 @@ void Lexer::EmitVec3(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar
} }
if (opt) if (opt)
{ {
ir.m_instructions.emplace_back(IR::OpLoadImm, funcNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::LoadImm, funcNode->m_tok.m_location);
atVec4f& vec = ir.m_instructions.back().m_loadImm.m_immVec; atVec4f& vec = ir.m_instructions.back().m_loadImm.m_immVec;
vec.vec[0] = imms[0]->m_tokenFloat; vec.vec[0] = imms[0]->m_tokenFloat;
vec.vec[1] = imms[1]->m_tokenFloat; vec.vec[1] = imms[1]->m_tokenFloat;
@ -398,7 +398,7 @@ void Lexer::EmitVec4(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar
const Lexer::OperationNode* gn = funcNode->m_sub; const Lexer::OperationNode* gn = funcNode->m_sub;
if (!gn) if (!gn)
{ {
ir.m_instructions.emplace_back(IR::OpLoadImm, funcNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::LoadImm, funcNode->m_tok.m_location);
return; return;
} }
@ -407,7 +407,7 @@ void Lexer::EmitVec4(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar
const Parser::Token* imms[4]; const Parser::Token* imms[4];
for (int i=0 ; i<4 ; ++i) for (int i=0 ; i<4 ; ++i)
{ {
if (!gn->m_sub || gn->m_sub->m_tok.m_type != Parser::TokenNumLiteral) if (!gn->m_sub || gn->m_sub->m_tok.m_type != Parser::TokenType::NumLiteral)
{ {
opt = false; opt = false;
break; break;
@ -417,7 +417,7 @@ void Lexer::EmitVec4(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar
} }
if (opt) if (opt)
{ {
ir.m_instructions.emplace_back(IR::OpLoadImm, funcNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::LoadImm, funcNode->m_tok.m_location);
atVec4f& vec = ir.m_instructions.back().m_loadImm.m_immVec; atVec4f& vec = ir.m_instructions.back().m_loadImm.m_immVec;
vec.vec[0] = imms[0]->m_tokenFloat; vec.vec[0] = imms[0]->m_tokenFloat;
vec.vec[1] = imms[1]->m_tokenFloat; vec.vec[1] = imms[1]->m_tokenFloat;
@ -443,7 +443,7 @@ void Lexer::EmitArithmetic(IR& ir, const Lexer::OperationNode* arithNode, IR::Re
const Parser::Token& tok = on->m_tok; const Parser::Token& tok = on->m_tok;
switch (tok.m_type) switch (tok.m_type)
{ {
case Parser::TokenFunctionStart: case Parser::TokenType::FunctionStart:
if (!tok.m_tokenString.compare("vec3")) if (!tok.m_tokenString.compare("vec3"))
EmitVec3(ir, on, tgt); EmitVec3(ir, on, tgt);
else if (!tok.m_tokenString.compare("vec4")) else if (!tok.m_tokenString.compare("vec4"))
@ -451,12 +451,12 @@ void Lexer::EmitArithmetic(IR& ir, const Lexer::OperationNode* arithNode, IR::Re
else else
RecursiveFuncCompile(ir, on, tgt); RecursiveFuncCompile(ir, on, tgt);
break; break;
case Parser::TokenEvalGroupStart: case Parser::TokenType::EvalGroupStart:
RecursiveGroupCompile(ir, on, tgt); RecursiveGroupCompile(ir, on, tgt);
break; break;
case Parser::TokenNumLiteral: case Parser::TokenType::NumLiteral:
{ {
ir.m_instructions.emplace_back(IR::OpLoadImm, arithNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::LoadImm, arithNode->m_tok.m_location);
IR::Instruction& inst = ir.m_instructions.back(); IR::Instruction& inst = ir.m_instructions.back();
inst.m_target = tgt; inst.m_target = tgt;
inst.m_loadImm.m_immVec.vec[0] = tok.m_tokenFloat; inst.m_loadImm.m_immVec.vec[0] = tok.m_tokenFloat;
@ -465,7 +465,7 @@ void Lexer::EmitArithmetic(IR& ir, const Lexer::OperationNode* arithNode, IR::Re
inst.m_loadImm.m_immVec.vec[3] = tok.m_tokenFloat; inst.m_loadImm.m_immVec.vec[3] = tok.m_tokenFloat;
break; break;
} }
case Parser::TokenVectorSwizzle: case Parser::TokenType::VectorSwizzle:
EmitVectorSwizzle(ir, on, tgt); EmitVectorSwizzle(ir, on, tgt);
break; break;
default: default:
@ -473,7 +473,7 @@ void Lexer::EmitArithmetic(IR& ir, const Lexer::OperationNode* arithNode, IR::Re
break; break;
}; };
argInsts[i] = ir.m_instructions.size() - 1; argInsts[i] = ir.m_instructions.size() - 1;
if (ir.m_instructions.back().m_op == IR::OpLoadImm) if (ir.m_instructions.back().m_op == IR::OpType::LoadImm)
opt[i] = &ir.m_instructions.back().m_loadImm.m_immVec; opt[i] = &ir.m_instructions.back().m_loadImm.m_immVec;
on = on->m_next; on = on->m_next;
} }
@ -484,25 +484,25 @@ void Lexer::EmitArithmetic(IR& ir, const Lexer::OperationNode* arithNode, IR::Re
atVec4f eval; atVec4f eval;
switch (ArithType(arithNode->m_tok.m_tokenInt)) switch (ArithType(arithNode->m_tok.m_tokenInt))
{ {
case IR::Instruction::ArithmeticOpAdd: case IR::Instruction::ArithmeticOpType::Add:
eval.vec[0] = opt[0]->vec[0] + opt[1]->vec[0]; eval.vec[0] = opt[0]->vec[0] + opt[1]->vec[0];
eval.vec[1] = opt[0]->vec[1] + opt[1]->vec[1]; eval.vec[1] = opt[0]->vec[1] + opt[1]->vec[1];
eval.vec[2] = opt[0]->vec[2] + opt[1]->vec[2]; eval.vec[2] = opt[0]->vec[2] + opt[1]->vec[2];
eval.vec[3] = opt[0]->vec[3] + opt[1]->vec[3]; eval.vec[3] = opt[0]->vec[3] + opt[1]->vec[3];
break; break;
case IR::Instruction::ArithmeticOpSubtract: case IR::Instruction::ArithmeticOpType::Subtract:
eval.vec[0] = opt[0]->vec[0] - opt[1]->vec[0]; eval.vec[0] = opt[0]->vec[0] - opt[1]->vec[0];
eval.vec[1] = opt[0]->vec[1] - opt[1]->vec[1]; eval.vec[1] = opt[0]->vec[1] - opt[1]->vec[1];
eval.vec[2] = opt[0]->vec[2] - opt[1]->vec[2]; eval.vec[2] = opt[0]->vec[2] - opt[1]->vec[2];
eval.vec[3] = opt[0]->vec[3] - opt[1]->vec[3]; eval.vec[3] = opt[0]->vec[3] - opt[1]->vec[3];
break; break;
case IR::Instruction::ArithmeticOpMultiply: case IR::Instruction::ArithmeticOpType::Multiply:
eval.vec[0] = opt[0]->vec[0] * opt[1]->vec[0]; eval.vec[0] = opt[0]->vec[0] * opt[1]->vec[0];
eval.vec[1] = opt[0]->vec[1] * opt[1]->vec[1]; eval.vec[1] = opt[0]->vec[1] * opt[1]->vec[1];
eval.vec[2] = opt[0]->vec[2] * opt[1]->vec[2]; eval.vec[2] = opt[0]->vec[2] * opt[1]->vec[2];
eval.vec[3] = opt[0]->vec[3] * opt[1]->vec[3]; eval.vec[3] = opt[0]->vec[3] * opt[1]->vec[3];
break; break;
case IR::Instruction::ArithmeticOpDivide: case IR::Instruction::ArithmeticOpType::Divide:
eval.vec[0] = opt[0]->vec[0] / opt[1]->vec[0]; eval.vec[0] = opt[0]->vec[0] / opt[1]->vec[0];
eval.vec[1] = opt[0]->vec[1] / opt[1]->vec[1]; eval.vec[1] = opt[0]->vec[1] / opt[1]->vec[1];
eval.vec[2] = opt[0]->vec[2] / opt[1]->vec[2]; eval.vec[2] = opt[0]->vec[2] / opt[1]->vec[2];
@ -514,14 +514,14 @@ void Lexer::EmitArithmetic(IR& ir, const Lexer::OperationNode* arithNode, IR::Re
} }
ir.m_instructions.pop_back(); ir.m_instructions.pop_back();
ir.m_instructions.pop_back(); ir.m_instructions.pop_back();
ir.m_instructions.emplace_back(IR::OpLoadImm, arithNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::LoadImm, arithNode->m_tok.m_location);
IR::Instruction& inst = ir.m_instructions.back(); IR::Instruction& inst = ir.m_instructions.back();
inst.m_target = target; inst.m_target = target;
inst.m_loadImm.m_immVec = eval; inst.m_loadImm.m_immVec = eval;
} }
else else
{ {
ir.m_instructions.emplace_back(IR::OpArithmetic, arithNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::Arithmetic, arithNode->m_tok.m_location);
IR::Instruction& inst = ir.m_instructions.back(); IR::Instruction& inst = ir.m_instructions.back();
inst.m_target = target; inst.m_target = target;
inst.m_arithmetic.m_instIdxs[0] = argInsts[0]; inst.m_arithmetic.m_instIdxs[0] = argInsts[0];
@ -565,7 +565,7 @@ void Lexer::EmitVectorSwizzle(IR& ir, const Lexer::OperationNode* swizNode, IR::
const Parser::Token& tok = on->m_tok; const Parser::Token& tok = on->m_tok;
switch (tok.m_type) switch (tok.m_type)
{ {
case Parser::TokenFunctionStart: case Parser::TokenType::FunctionStart:
if (!tok.m_tokenString.compare("vec3")) if (!tok.m_tokenString.compare("vec3"))
EmitVec3(ir, on, target); EmitVec3(ir, on, target);
else if (!tok.m_tokenString.compare("vec4")) else if (!tok.m_tokenString.compare("vec4"))
@ -573,12 +573,12 @@ void Lexer::EmitVectorSwizzle(IR& ir, const Lexer::OperationNode* swizNode, IR::
else else
RecursiveFuncCompile(ir, on, target); RecursiveFuncCompile(ir, on, target);
break; break;
case Parser::TokenEvalGroupStart: case Parser::TokenType::EvalGroupStart:
RecursiveGroupCompile(ir, on, target); RecursiveGroupCompile(ir, on, target);
break; break;
case Parser::TokenNumLiteral: case Parser::TokenType::NumLiteral:
{ {
ir.m_instructions.emplace_back(IR::OpLoadImm, swizNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::LoadImm, swizNode->m_tok.m_location);
IR::Instruction& inst = ir.m_instructions.back(); IR::Instruction& inst = ir.m_instructions.back();
inst.m_target = target; inst.m_target = target;
inst.m_loadImm.m_immVec.vec[0] = tok.m_tokenFloat; inst.m_loadImm.m_immVec.vec[0] = tok.m_tokenFloat;
@ -587,7 +587,7 @@ void Lexer::EmitVectorSwizzle(IR& ir, const Lexer::OperationNode* swizNode, IR::
inst.m_loadImm.m_immVec.vec[3] = tok.m_tokenFloat; inst.m_loadImm.m_immVec.vec[3] = tok.m_tokenFloat;
break; break;
} }
case Parser::TokenVectorSwizzle: case Parser::TokenType::VectorSwizzle:
EmitVectorSwizzle(ir, on, target); EmitVectorSwizzle(ir, on, target);
break; break;
default: default:
@ -596,7 +596,7 @@ void Lexer::EmitVectorSwizzle(IR& ir, const Lexer::OperationNode* swizNode, IR::
}; };
/* Optimization case: if operand imm load, pre-evalulate */ /* Optimization case: if operand imm load, pre-evalulate */
if (ir.m_instructions.back().m_op == IR::OpLoadImm && (ir.m_instructions.size() - instCount == 1)) if (ir.m_instructions.back().m_op == IR::OpType::LoadImm && (ir.m_instructions.size() - instCount == 1))
{ {
atVec4f* opt = &ir.m_instructions.back().m_loadImm.m_immVec; atVec4f* opt = &ir.m_instructions.back().m_loadImm.m_immVec;
const SourceLocation& loc = ir.m_instructions.back().m_loc; const SourceLocation& loc = ir.m_instructions.back().m_loc;
@ -626,14 +626,14 @@ void Lexer::EmitVectorSwizzle(IR& ir, const Lexer::OperationNode* swizNode, IR::
} }
ir.m_instructions.pop_back(); ir.m_instructions.pop_back();
ir.m_instructions.emplace_back(IR::OpLoadImm, swizNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::LoadImm, swizNode->m_tok.m_location);
IR::Instruction& inst = ir.m_instructions.back(); IR::Instruction& inst = ir.m_instructions.back();
inst.m_target = target; inst.m_target = target;
inst.m_loadImm.m_immVec = eval; inst.m_loadImm.m_immVec = eval;
} }
else else
{ {
ir.m_instructions.emplace_back(IR::OpSwizzle, swizNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::Swizzle, swizNode->m_tok.m_location);
IR::Instruction& inst = ir.m_instructions.back(); IR::Instruction& inst = ir.m_instructions.back();
inst.m_swizzle.m_instIdx = ir.m_instructions.size() - 2; inst.m_swizzle.m_instIdx = ir.m_instructions.size() - 2;
inst.m_target = target; inst.m_target = target;
@ -650,7 +650,7 @@ void Lexer::RecursiveGroupCompile(IR& ir, const Lexer::OperationNode* groupNode,
const Parser::Token& tok = sn->m_tok; const Parser::Token& tok = sn->m_tok;
switch (tok.m_type) switch (tok.m_type)
{ {
case Parser::TokenFunctionStart: case Parser::TokenType::FunctionStart:
if (!tok.m_tokenString.compare("vec3")) if (!tok.m_tokenString.compare("vec3"))
EmitVec3(ir, sn, tgt); EmitVec3(ir, sn, tgt);
else if (!tok.m_tokenString.compare("vec4")) else if (!tok.m_tokenString.compare("vec4"))
@ -658,12 +658,12 @@ void Lexer::RecursiveGroupCompile(IR& ir, const Lexer::OperationNode* groupNode,
else else
RecursiveFuncCompile(ir, sn, tgt); RecursiveFuncCompile(ir, sn, tgt);
break; break;
case Parser::TokenEvalGroupStart: case Parser::TokenType::EvalGroupStart:
RecursiveGroupCompile(ir, sn, tgt); RecursiveGroupCompile(ir, sn, tgt);
break; break;
case Parser::TokenNumLiteral: case Parser::TokenType::NumLiteral:
{ {
ir.m_instructions.emplace_back(IR::OpLoadImm, tok.m_location); ir.m_instructions.emplace_back(IR::OpType::LoadImm, tok.m_location);
IR::Instruction& inst = ir.m_instructions.back(); IR::Instruction& inst = ir.m_instructions.back();
inst.m_target = tgt; inst.m_target = tgt;
inst.m_loadImm.m_immVec.vec[0] = tok.m_tokenFloat; inst.m_loadImm.m_immVec.vec[0] = tok.m_tokenFloat;
@ -672,10 +672,10 @@ void Lexer::RecursiveGroupCompile(IR& ir, const Lexer::OperationNode* groupNode,
inst.m_loadImm.m_immVec.vec[3] = tok.m_tokenFloat; inst.m_loadImm.m_immVec.vec[3] = tok.m_tokenFloat;
break; break;
} }
case Parser::TokenArithmeticOp: case Parser::TokenType::ArithmeticOp:
EmitArithmetic(ir, sn, tgt); EmitArithmetic(ir, sn, tgt);
break; break;
case Parser::TokenVectorSwizzle: case Parser::TokenType::VectorSwizzle:
EmitVectorSwizzle(ir, sn, tgt); EmitVectorSwizzle(ir, sn, tgt);
break; break;
default: default:
@ -696,7 +696,7 @@ void Lexer::RecursiveFuncCompile(IR& ir, const Lexer::OperationNode* funcNode, I
RecursiveGroupCompile(ir, gn, tgt); RecursiveGroupCompile(ir, gn, tgt);
instIdxs.push_back(ir.m_instructions.size() - 1); instIdxs.push_back(ir.m_instructions.size() - 1);
} }
ir.m_instructions.emplace_back(IR::OpCall, funcNode->m_tok.m_location); ir.m_instructions.emplace_back(IR::OpType::Call, funcNode->m_tok.m_location);
IR::Instruction& inst = ir.m_instructions.back(); IR::Instruction& inst = ir.m_instructions.back();
inst.m_call.m_name = funcNode->m_tok.m_tokenString; inst.m_call.m_name = funcNode->m_tok.m_tokenString;
inst.m_call.m_argInstCount = instIdxs.size(); inst.m_call.m_argInstCount = instIdxs.size();

View File

@ -39,13 +39,13 @@ void Parser::reset(const std::string& source)
Parser::Token Parser::consumeToken() Parser::Token Parser::consumeToken()
{ {
if (!m_source) if (!m_source)
return Parser::Token(TokenNone, SourceLocation()); return Parser::Token(TokenType::None, SourceLocation());
/* If parser has just been reset, emit begin token */ /* If parser has just been reset, emit begin token */
if (m_reset) if (m_reset)
{ {
m_reset = false; m_reset = false;
return Parser::Token(TokenSourceBegin, getLocation()); return Parser::Token(TokenType::SourceBegin, getLocation());
} }
/* Skip whitespace */ /* Skip whitespace */
@ -53,7 +53,7 @@ Parser::Token Parser::consumeToken()
/* Check for source end */ /* Check for source end */
if (m_sourceIt == m_source->cend()) if (m_sourceIt == m_source->cend())
return Parser::Token(TokenSourceEnd, getLocation()); return Parser::Token(TokenType::SourceEnd, getLocation());
/* Check for numeric literal */ /* Check for numeric literal */
{ {
@ -61,7 +61,7 @@ Parser::Token Parser::consumeToken()
float val = strtof(&*m_sourceIt, &strEnd); float val = strtof(&*m_sourceIt, &strEnd);
if (&*m_sourceIt != strEnd) if (&*m_sourceIt != strEnd)
{ {
Parser::Token tok(TokenNumLiteral, getLocation()); Parser::Token tok(TokenType::NumLiteral, getLocation());
tok.m_tokenFloat = val; tok.m_tokenFloat = val;
m_sourceIt += (strEnd - &*m_sourceIt); m_sourceIt += (strEnd - &*m_sourceIt);
return tok; return tok;
@ -91,7 +91,7 @@ Parser::Token Parser::consumeToken()
} }
if (count) if (count)
{ {
Parser::Token tok(TokenVectorSwizzle, getLocation()); Parser::Token tok(TokenType::VectorSwizzle, getLocation());
for (int i=0 ; i<count ; ++i) for (int i=0 ; i<count ; ++i)
{ {
std::string::const_iterator tmp2 = tmp + i; std::string::const_iterator tmp2 = tmp + i;
@ -105,7 +105,7 @@ Parser::Token Parser::consumeToken()
/* Check for arithmetic op */ /* Check for arithmetic op */
if (*m_sourceIt == '+' || *m_sourceIt == '-' || *m_sourceIt == '*' || *m_sourceIt == '/') if (*m_sourceIt == '+' || *m_sourceIt == '-' || *m_sourceIt == '*' || *m_sourceIt == '/')
{ {
Parser::Token tok(TokenArithmeticOp, getLocation()); Parser::Token tok(TokenType::ArithmeticOp, getLocation());
tok.m_tokenInt = *m_sourceIt; tok.m_tokenInt = *m_sourceIt;
++m_sourceIt; ++m_sourceIt;
return tok; return tok;
@ -117,7 +117,7 @@ Parser::Token Parser::consumeToken()
if (m_parenStack.empty()) if (m_parenStack.empty())
{ {
m_diag.reportParserErr(getLocation(), "unexpected ')' while parsing"); m_diag.reportParserErr(getLocation(), "unexpected ')' while parsing");
return Parser::Token(TokenNone, SourceLocation()); return Parser::Token(TokenType::None, SourceLocation());
} }
Parser::Token tok(m_parenStack.back(), getLocation()); Parser::Token tok(m_parenStack.back(), getLocation());
++m_sourceIt; ++m_sourceIt;
@ -128,8 +128,8 @@ Parser::Token Parser::consumeToken()
/* Check for group start */ /* Check for group start */
if (*m_sourceIt == '(') if (*m_sourceIt == '(')
{ {
m_parenStack.push_back(TokenEvalGroupEnd); m_parenStack.push_back(TokenType::EvalGroupEnd);
Parser::Token tok(TokenEvalGroupStart, getLocation()); Parser::Token tok(TokenType::EvalGroupStart, getLocation());
++m_sourceIt; ++m_sourceIt;
return tok; return tok;
} }
@ -144,10 +144,10 @@ Parser::Token Parser::consumeToken()
skipWhitespace(tmp); skipWhitespace(tmp);
if (*tmp == '(') if (*tmp == '(')
{ {
Parser::Token tok(TokenFunctionStart, getLocation()); Parser::Token tok(TokenType::FunctionStart, getLocation());
tok.m_tokenString.assign(m_sourceIt, nameEnd); tok.m_tokenString.assign(m_sourceIt, nameEnd);
m_sourceIt = tmp + 1; m_sourceIt = tmp + 1;
m_parenStack.push_back(TokenFunctionEnd); m_parenStack.push_back(TokenType::FunctionEnd);
return tok; return tok;
} }
} }
@ -155,19 +155,19 @@ Parser::Token Parser::consumeToken()
/* Check for function arg delimitation */ /* Check for function arg delimitation */
if (*m_sourceIt == ',') if (*m_sourceIt == ',')
{ {
if (m_parenStack.empty() || m_parenStack.back() != TokenFunctionEnd) if (m_parenStack.empty() || m_parenStack.back() != TokenType::FunctionEnd)
{ {
m_diag.reportParserErr(getLocation(), "unexpected ',' while parsing"); m_diag.reportParserErr(getLocation(), "unexpected ',' while parsing");
return Parser::Token(TokenNone, SourceLocation()); return Parser::Token(TokenType::None, SourceLocation());
} }
Parser::Token tok(TokenFunctionArgDelim, getLocation()); Parser::Token tok(TokenType::FunctionArgDelim, getLocation());
++m_sourceIt; ++m_sourceIt;
return tok; return tok;
} }
/* Error condition if reached */ /* Error condition if reached */
m_diag.reportParserErr(getLocation(), "unexpected token while parsing"); m_diag.reportParserErr(getLocation(), "unexpected token while parsing");
return Parser::Token(TokenNone, SourceLocation()); return Parser::Token(TokenType::None, SourceLocation());
} }
SourceLocation Parser::getLocation() const SourceLocation Parser::getLocation() const

View File

@ -140,28 +140,28 @@ ProjectPath ProjectPath::getCookedPath(const Database::DataSpecEntry& spec) cons
return ProjectPath(m_proj->getProjectCookedPath(spec), woExt.getRelativePath()); return ProjectPath(m_proj->getProjectCookedPath(spec), woExt.getRelativePath());
} }
ProjectPath::PathType ProjectPath::getPathType() const ProjectPath::Type ProjectPath::getPathType() const
{ {
#if WIN32 #if WIN32
if (TestShellLink(m_absPath.c_str())) if (TestShellLink(m_absPath.c_str()))
return PT_LINK; return Type::Link;
#else #else
HECL::Sstat lnStat; HECL::Sstat lnStat;
if (lstat(m_absPath.c_str(), &lnStat)) if (lstat(m_absPath.c_str(), &lnStat))
return PT_NONE; return Type::None;
if (S_ISLNK(lnStat.st_mode)) if (S_ISLNK(lnStat.st_mode))
return PT_LINK; return Type::Link;
#endif #endif
if (std::regex_search(m_absPath, regGLOB)) if (std::regex_search(m_absPath, regGLOB))
return PT_GLOB; return Type::Glob;
Sstat theStat; Sstat theStat;
if (HECL::Stat(m_absPath.c_str(), &theStat)) if (HECL::Stat(m_absPath.c_str(), &theStat))
return PT_NONE; return Type::None;
if (S_ISDIR(theStat.st_mode)) if (S_ISDIR(theStat.st_mode))
return PT_DIRECTORY; return Type::Directory;
if (S_ISREG(theStat.st_mode)) if (S_ISREG(theStat.st_mode))
return PT_FILE; return Type::File;
return PT_NONE; return Type::None;
} }
Time ProjectPath::getModtime() const Time ProjectPath::getModtime() const

View File

@ -19,8 +19,8 @@ HMDLData::HMDLData(boo::IGraphicsDataFactory* factory,
if (meta.magic != 'TACO') if (meta.magic != 'TACO')
Log.report(LogVisor::FatalError, "invalid HMDL magic"); Log.report(LogVisor::FatalError, "invalid HMDL magic");
m_vbo = factory->newStaticBuffer(boo::BufferUseVertex, vbo, meta.vertStride, meta.vertCount); m_vbo = factory->newStaticBuffer(boo::BufferUse::Vertex, vbo, meta.vertStride, meta.vertCount);
m_ibo = factory->newStaticBuffer(boo::BufferUseIndex, ibo, 4, meta.indexCount); m_ibo = factory->newStaticBuffer(boo::BufferUse::Index, ibo, 4, meta.indexCount);
if (factory->bindingNeedsVertexFormat()) if (factory->bindingNeedsVertexFormat())
m_vtxFmt = NewVertexFormat(factory, meta, m_vbo, m_ibo); m_vtxFmt = NewVertexFormat(factory, meta, m_vbo, m_ibo);
@ -38,25 +38,25 @@ boo::IVertexFormat* HMDLData::NewVertexFormat(boo::IGraphicsDataFactory* factory
vdescs[i].indexBuffer = ibo; vdescs[i].indexBuffer = ibo;
} }
vdescs[0].semantic = boo::VertexSemanticPosition; vdescs[0].semantic = boo::VertexSemantic::Position;
vdescs[1].semantic = boo::VertexSemanticNormal; vdescs[1].semantic = boo::VertexSemantic::Normal;
size_t e = 2; size_t e = 2;
for (size_t i=0 ; i<meta.colorCount ; ++i, ++e) for (size_t i=0 ; i<meta.colorCount ; ++i, ++e)
{ {
vdescs[e].semantic = boo::VertexSemanticColor; vdescs[e].semantic = boo::VertexSemantic::Color;
vdescs[e].semanticIdx = i; vdescs[e].semanticIdx = i;
} }
for (size_t i=0 ; i<meta.uvCount ; ++i, ++e) for (size_t i=0 ; i<meta.uvCount ; ++i, ++e)
{ {
vdescs[e].semantic = boo::VertexSemanticUV; vdescs[e].semantic = boo::VertexSemantic::UV;
vdescs[e].semanticIdx = i; vdescs[e].semanticIdx = i;
} }
for (size_t i=0 ; i<meta.weightCount ; ++i, ++e) for (size_t i=0 ; i<meta.weightCount ; ++i, ++e)
{ {
vdescs[e].semantic = boo::VertexSemanticWeight; vdescs[e].semantic = boo::VertexSemantic::Weight;
vdescs[e].semanticIdx = i; vdescs[e].semanticIdx = i;
} }
@ -74,25 +74,25 @@ boo::IVertexFormat* ShaderTag::newVertexFormat(boo::IGraphicsDataFactory *factor
vdescs[i].indexBuffer = nullptr; vdescs[i].indexBuffer = nullptr;
} }
vdescs[0].semantic = boo::VertexSemanticPosition; vdescs[0].semantic = boo::VertexSemantic::Position;
vdescs[1].semantic = boo::VertexSemanticNormal; vdescs[1].semantic = boo::VertexSemantic::Normal;
size_t e = 2; size_t e = 2;
for (size_t i=0 ; i<m_colorCount ; ++i, ++e) for (size_t i=0 ; i<m_colorCount ; ++i, ++e)
{ {
vdescs[e].semantic = boo::VertexSemanticColor; vdescs[e].semantic = boo::VertexSemantic::Color;
vdescs[e].semanticIdx = i; vdescs[e].semanticIdx = i;
} }
for (size_t i=0 ; i<m_uvCount ; ++i, ++e) for (size_t i=0 ; i<m_uvCount ; ++i, ++e)
{ {
vdescs[e].semantic = boo::VertexSemanticUV; vdescs[e].semantic = boo::VertexSemantic::UV;
vdescs[e].semanticIdx = i; vdescs[e].semanticIdx = i;
} }
for (size_t i=0 ; i<m_weightCount ; ++i, ++e) for (size_t i=0 ; i<m_weightCount ; ++i, ++e)
{ {
vdescs[e].semantic = boo::VertexSemanticWeight; vdescs[e].semantic = boo::VertexSemantic::Weight;
vdescs[e].semanticIdx = i; vdescs[e].semanticIdx = i;
} }

View File

@ -114,7 +114,7 @@ ShaderCacheManager::ShaderCacheManager(const FileStoreManager& storeMgr,
switch (plat) switch (plat)
{ {
case boo::IGraphicsDataFactory::PlatformOGL: case boo::IGraphicsDataFactory::Platform::OGL:
m_factory.reset(_NewGLSLBackendFactory(gfxFactory)); m_factory.reset(_NewGLSLBackendFactory(gfxFactory));
break; break;
#if _WIN32 #if _WIN32

View File

@ -90,7 +90,7 @@ struct HECLApplicationCallback : boo::IApplicationCallback
/* Generate meta structure (usually statically serialized) */ /* Generate meta structure (usually statically serialized) */
HECL::HMDLMeta testMeta; HECL::HMDLMeta testMeta;
testMeta.topology = HECL::TopologyTriStrips; testMeta.topology = HECL::HMDLTopology::TriStrips;
testMeta.vertStride = 32; testMeta.vertStride = 32;
testMeta.vertCount = 4; testMeta.vertCount = 4;
testMeta.indexCount = 4; testMeta.indexCount = 4;
@ -136,10 +136,10 @@ struct HECLApplicationCallback : boo::IApplicationCallback
tex[i][j][3] = 0xff; tex[i][j][3] = 0xff;
} }
boo::ITexture* texture = boo::ITexture* texture =
gfxF->newStaticTexture(256, 256, 1, boo::TextureFormatRGBA8, tex, 256*256*4); gfxF->newStaticTexture(256, 256, 1, boo::TextureFormat::RGBA8, tex, 256*256*4);
/* Make vertex uniform buffer */ /* Make vertex uniform buffer */
vubo = gfxF->newDynamicBuffer(boo::BufferUseUniform, sizeof(VertexUBO), 1); vubo = gfxF->newDynamicBuffer(boo::BufferUse::Uniform, sizeof(VertexUBO), 1);
/* Assemble data binding */ /* Assemble data binding */
binding = testData.newShaderDataBindng(gfxF, testShaderObj, 1, (boo::IGraphicsBuffer**)&vubo, 1, &texture); binding = testData.newShaderDataBindng(gfxF, testShaderObj, 1, (boo::IGraphicsBuffer**)&vubo, 1, &texture);
@ -191,7 +191,7 @@ struct HECLApplicationCallback : boo::IApplicationCallback
float rgba[] = {sinf(frameIdx / 60.0), cosf(frameIdx / 60.0), 0.0, 1.0}; float rgba[] = {sinf(frameIdx / 60.0), cosf(frameIdx / 60.0), 0.0, 1.0};
gfxQ->setClearColor(rgba); gfxQ->setClearColor(rgba);
gfxQ->clearTarget(); gfxQ->clearTarget();
gfxQ->setDrawPrimitive(boo::PrimitiveTriStrips); gfxQ->setDrawPrimitive(boo::Primitive::TriStrips);
vuboData.modelview[3][0] = sinf(frameIdx / 60.0) * 0.5; vuboData.modelview[3][0] = sinf(frameIdx / 60.0) * 0.5;
vuboData.modelview[3][1] = cosf(frameIdx / 60.0) * 0.5; vuboData.modelview[3][1] = cosf(frameIdx / 60.0) * 0.5;
@ -232,7 +232,7 @@ int main(int argc, const boo::SystemChar** argv)
atSetExceptionHandler(AthenaExcHandler); atSetExceptionHandler(AthenaExcHandler);
LogVisor::RegisterConsoleLogger(); LogVisor::RegisterConsoleLogger();
HECLApplicationCallback appCb; HECLApplicationCallback appCb;
int ret = boo::ApplicationRun(boo::IApplication::PLAT_AUTO, int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto,
appCb, _S("heclTest"), _S("HECL Test"), argc, argv); appCb, _S("heclTest"), _S("HECL Test"), argc, argv);
printf("IM DYING!!\n"); printf("IM DYING!!\n");
return ret; return ret;