Major scoped-enum refactor

This commit is contained in:
Jack Andersen 2015-11-20 15:16:07 -10:00
parent 4c09ded013
commit e423db32ee
83 changed files with 958 additions and 904 deletions

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "MathLib"] [submodule "MathLib"]
path = MathLib path = MathLib
url = https://github.com/AxioDL/MathLib.git url = https://github.com/AxioDL/MathLib.git
[submodule "libSpecter"]
path = libSpecter
url = https://github.com/AxioDL/libSpecter.git

View File

@ -15,7 +15,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
include_directories(/usr/local/include) include_directories(/usr/local/include)
endif() endif()
set(BOO_INCLUDE_DIR hecl/extern/libBoo/include) set(BOO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hecl/extern/libBoo/include)
set(HECL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hecl/include
${CMAKE_CURRENT_SOURCE_DIR}/hecl/blender)
set(HECL_DATASPEC_DECLS set(HECL_DATASPEC_DECLS
"/* RetroCommon specs */ "/* RetroCommon specs */
@ -31,6 +33,8 @@ set(HECL_DATASPEC_PUSHES
HECL::Database::DATA_SPEC_REGISTRY.push_back(&Retro::SpecEntMP2); HECL::Database::DATA_SPEC_REGISTRY.push_back(&Retro::SpecEntMP2);
HECL::Database::DATA_SPEC_REGISTRY.push_back(&Retro::SpecEntMP3);") HECL::Database::DATA_SPEC_REGISTRY.push_back(&Retro::SpecEntMP3);")
add_subdirectory(hecl) add_subdirectory(hecl)
add_subdirectory(libSpecter)
set(SPECTER_INCLUDE_DIR libSpecter/include)
add_subdirectory(NODLib) add_subdirectory(NODLib)
set(NODLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/NODLib/include) set(NODLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/NODLib/include)
add_definitions(-DZE_ATHENA_TYPES=1) add_definitions(-DZE_ATHENA_TYPES=1)
@ -38,9 +42,10 @@ add_subdirectory(MathLib)
set(MATHLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/MathLib/include) set(MATHLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/MathLib/include)
include_directories(${ATHENA_INCLUDE_DIR} ${LOG_VISOR_INCLUDE_DIR} ${HECL_INCLUDE_DIR} include_directories(${ATHENA_INCLUDE_DIR} ${LOG_VISOR_INCLUDE_DIR} ${HECL_INCLUDE_DIR}
${NODLIB_INCLUDE_DIR} ${MATHLIB_INCLUDE_DIR} ${BOO_INCLUDE_DIR} ${NODLIB_INCLUDE_DIR} ${MATHLIB_INCLUDE_DIR} ${BOO_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}) ${SPECTER_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(DataSpec) add_subdirectory(DataSpec)
#disable Runtime on FreeBSD for now #disable Runtime on FreeBSD for now
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
add_subdirectory(Editor)
add_subdirectory(Runtime) add_subdirectory(Runtime)
endif() endif()

View File

@ -13,7 +13,7 @@ namespace Blender
bool BuildMasterShader(const HECL::ProjectPath& path) bool BuildMasterShader(const HECL::ProjectPath& path)
{ {
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(path, HECL::BlenderConnection::TypeNone)) if (!conn.createBlend(path, HECL::BlenderConnection::BlendType::None))
return false; return false;
{ {
HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true);

View File

@ -52,9 +52,9 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn,
if (cmdlE) if (cmdlE)
{ {
HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE); HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);
if (force || cmdlPath.getPathType() == HECL::ProjectPath::PT_NONE) if (force || cmdlPath.getPathType() == HECL::ProjectPath::Type::None)
{ {
if (!conn.createBlend(cmdlPath, HECL::BlenderConnection::TypeMesh)) if (!conn.createBlend(cmdlPath, HECL::BlenderConnection::BlendType::Mesh))
return false; return false;
HECL::SystemStringView bestNameView(pakRouter.getBestEntryName(*cmdlE)); HECL::SystemStringView bestNameView(pakRouter.getBestEntryName(*cmdlE));
@ -80,7 +80,7 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn,
fileChanged(bestNameView.sys_str().c_str()); fileChanged(bestNameView.sys_str().c_str());
/* Establish ANCS blend */ /* Establish ANCS blend */
if (!conn.createBlend(outPath, HECL::BlenderConnection::TypeActor)) if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Actor))
return false; return false;
HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true);

View File

@ -14,18 +14,18 @@ size_t ComputeBitstreamSize(size_t keyFrameCount, const std::vector<Channel>& ch
{ {
switch (chan.type) switch (chan.type)
{ {
case Channel::ROTATION: case Channel::Type::Rotation:
bitsPerKeyFrame += 1; bitsPerKeyFrame += 1;
case Channel::TRANSLATION: case Channel::Type::Translation:
case Channel::SCALE: case Channel::Type::Scale:
bitsPerKeyFrame += chan.q[0]; bitsPerKeyFrame += chan.q[0];
bitsPerKeyFrame += chan.q[1]; bitsPerKeyFrame += chan.q[1];
bitsPerKeyFrame += chan.q[2]; bitsPerKeyFrame += chan.q[2];
break; break;
case Channel::KF_HEAD: case Channel::Type::KfHead:
bitsPerKeyFrame += 1; bitsPerKeyFrame += 1;
break; break;
case Channel::ROTATION_MP3: case Channel::Type::RotationMP3:
bitsPerKeyFrame += chan.q[0]; bitsPerKeyFrame += chan.q[0];
bitsPerKeyFrame += chan.q[1]; bitsPerKeyFrame += chan.q[1];
bitsPerKeyFrame += chan.q[2]; bitsPerKeyFrame += chan.q[2];
@ -153,27 +153,27 @@ BitstreamReader::read(const atUint8* data,
keys.reserve(keyFrameCount); keys.reserve(keyFrameCount);
switch (chan.type) switch (chan.type)
{ {
case Channel::ROTATION: case Channel::Type::Rotation:
{ {
QuantizedRot qr = {{chan.i[0], chan.i[1], chan.i[2]}, false}; QuantizedRot qr = {{chan.i[0], chan.i[1], chan.i[2]}, false};
keys.emplace_back(DequantizeRotation(qr, rotDiv)); keys.emplace_back(DequantizeRotation(qr, rotDiv));
break; break;
} }
case Channel::TRANSLATION: case Channel::Type::Translation:
{ {
keys.push_back({chan.i[0] * transMult, chan.i[1] * transMult, chan.i[2] * transMult}); keys.push_back({chan.i[0] * transMult, chan.i[1] * transMult, chan.i[2] * transMult});
break; break;
} }
case Channel::SCALE: case Channel::Type::Scale:
{ {
keys.push_back({chan.i[0] / float(rotDiv), chan.i[1] / float(rotDiv), chan.i[2] / float(rotDiv)}); keys.push_back({chan.i[0] / float(rotDiv), chan.i[1] / float(rotDiv), chan.i[2] / float(rotDiv)});
break; break;
} }
case Channel::KF_HEAD: case Channel::Type::KfHead:
{ {
break; break;
} }
case Channel::ROTATION_MP3: case Channel::Type::RotationMP3:
{ {
QuantizedRot qr = {{chan.i[1], chan.i[2], chan.i[3]}, bool(chan.i[0] & 0x1)}; QuantizedRot qr = {{chan.i[1], chan.i[2], chan.i[3]}, bool(chan.i[0] & 0x1)};
keys.emplace_back(DequantizeRotation_3(qr, rotDiv)); keys.emplace_back(DequantizeRotation_3(qr, rotDiv));
@ -191,7 +191,7 @@ BitstreamReader::read(const atUint8* data,
QuantizedValue& p = *ait; QuantizedValue& p = *ait;
switch (chan.type) switch (chan.type)
{ {
case Channel::ROTATION: case Channel::Type::Rotation:
{ {
bool wBit = dequantizeBit(data); bool wBit = dequantizeBit(data);
p[0] += dequantize(data, chan.q[0]); p[0] += dequantize(data, chan.q[0]);
@ -201,7 +201,7 @@ BitstreamReader::read(const atUint8* data,
kit->emplace_back(DequantizeRotation(qr, rotDiv)); kit->emplace_back(DequantizeRotation(qr, rotDiv));
break; break;
} }
case Channel::TRANSLATION: case Channel::Type::Translation:
{ {
atInt16 val1 = dequantize(data, chan.q[0]); atInt16 val1 = dequantize(data, chan.q[0]);
p[0] += val1; p[0] += val1;
@ -212,7 +212,7 @@ BitstreamReader::read(const atUint8* data,
kit->push_back({p[0] * transMult, p[1] * transMult, p[2] * transMult}); kit->push_back({p[0] * transMult, p[1] * transMult, p[2] * transMult});
break; break;
} }
case Channel::SCALE: case Channel::Type::Scale:
{ {
p[0] += dequantize(data, chan.q[0]); p[0] += dequantize(data, chan.q[0]);
p[1] += dequantize(data, chan.q[1]); p[1] += dequantize(data, chan.q[1]);
@ -220,12 +220,12 @@ BitstreamReader::read(const atUint8* data,
kit->push_back({p[0] / float(rotDiv), p[1] / float(rotDiv), p[2] / float(rotDiv)}); kit->push_back({p[0] / float(rotDiv), p[1] / float(rotDiv), p[2] / float(rotDiv)});
break; break;
} }
case Channel::KF_HEAD: case Channel::Type::KfHead:
{ {
bool aBit = dequantizeBit(data); bool aBit = dequantizeBit(data);
break; break;
} }
case Channel::ROTATION_MP3: case Channel::Type::RotationMP3:
{ {
atInt16 val1 = dequantize(data, chan.q[0]); atInt16 val1 = dequantize(data, chan.q[0]);
p[0] += val1; p[0] += val1;
@ -301,7 +301,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
{ {
switch (chan.type) switch (chan.type)
{ {
case Channel::TRANSLATION: case Channel::Type::Translation:
{ {
const Value* last = &(*kit)[0]; const Value* last = &(*kit)[0];
for (auto it=kit->begin() + 1; for (auto it=kit->begin() + 1;
@ -331,20 +331,20 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
chan.q[2] = 1; chan.q[2] = 1;
switch (chan.type) switch (chan.type)
{ {
case Channel::ROTATION: case Channel::Type::Rotation:
{ {
QuantizedRot qr = QuantizeRotation((*kit)[0], rotDivOut); QuantizedRot qr = QuantizeRotation((*kit)[0], rotDivOut);
chan.i = qr.v; chan.i = qr.v;
break; break;
} }
case Channel::TRANSLATION: case Channel::Type::Translation:
{ {
chan.i = {atInt16((*kit)[0].v3.vec[0] / transMultOut), chan.i = {atInt16((*kit)[0].v3.vec[0] / transMultOut),
atInt16((*kit)[0].v3.vec[1] / transMultOut), atInt16((*kit)[0].v3.vec[1] / transMultOut),
atInt16((*kit)[0].v3.vec[2] / transMultOut)}; atInt16((*kit)[0].v3.vec[2] / transMultOut)};
break; break;
} }
case Channel::SCALE: case Channel::Type::Scale:
{ {
chan.i = {atInt16((*kit)[0].v3.vec[0] * rotDivOut), chan.i = {atInt16((*kit)[0].v3.vec[0] * rotDivOut),
atInt16((*kit)[0].v3.vec[1] * rotDivOut), atInt16((*kit)[0].v3.vec[1] * rotDivOut),
@ -362,7 +362,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
{ {
switch (chan.type) switch (chan.type)
{ {
case Channel::ROTATION: case Channel::Type::Rotation:
{ {
QuantizedRot qrLast = QuantizeRotation((*kit)[0], rotDivOut); QuantizedRot qrLast = QuantizeRotation((*kit)[0], rotDivOut);
for (auto it=kit->begin() + 1; for (auto it=kit->begin() + 1;
@ -377,7 +377,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
} }
break; break;
} }
case Channel::TRANSLATION: case Channel::Type::Translation:
{ {
QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] / transMultOut), QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] / transMultOut),
atInt16((*kit)[0].v3.vec[1] / transMultOut), atInt16((*kit)[0].v3.vec[1] / transMultOut),
@ -396,7 +396,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
} }
break; break;
} }
case Channel::SCALE: case Channel::Type::Scale:
{ {
QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] * rotDivOut), QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] * rotDivOut),
atInt16((*kit)[0].v3.vec[1] * rotDivOut), atInt16((*kit)[0].v3.vec[1] * rotDivOut),
@ -430,7 +430,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
{ {
switch (chan.type) switch (chan.type)
{ {
case Channel::ROTATION: case Channel::Type::Rotation:
{ {
QuantizedRot qrLast = QuantizeRotation((*kit)[0], rotDivOut); QuantizedRot qrLast = QuantizeRotation((*kit)[0], rotDivOut);
for (auto it=kit->begin() + 1; for (auto it=kit->begin() + 1;
@ -446,7 +446,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
} }
break; break;
} }
case Channel::TRANSLATION: case Channel::Type::Translation:
{ {
QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] / transMultOut), QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] / transMultOut),
atInt16((*kit)[0].v3.vec[1] / transMultOut), atInt16((*kit)[0].v3.vec[1] / transMultOut),
@ -465,7 +465,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
} }
break; break;
} }
case Channel::SCALE: case Channel::Type::Scale:
{ {
QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] * rotDivOut), QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] * rotDivOut),
atInt16((*kit)[0].v3.vec[1] * rotDivOut), atInt16((*kit)[0].v3.vec[1] * rotDivOut),

View File

@ -44,13 +44,13 @@ struct QuantizedRot
}; };
struct Channel struct Channel
{ {
enum Type enum class Type
{ {
ROTATION, Rotation,
TRANSLATION, Translation,
SCALE, Scale,
KF_HEAD, KfHead,
ROTATION_MP3 RotationMP3
} type; } type;
QuantizedValue i = {}; QuantizedValue i = {};
atUint8 q[4] = {}; atUint8 q[4] = {};

View File

@ -17,14 +17,14 @@ void ReadBabeDeadLightToBlender(HECL::BlenderConnection::PyOutStream& os,
{ {
switch (light.lightType) switch (light.lightType)
{ {
case BabeDeadLight::LightLocalAmbient: case BabeDeadLight::LightType::LocalAmbient:
case BabeDeadLight::LightLocalAmbient2: case BabeDeadLight::LightType::LocalAmbient2:
os.format("bg_node.inputs[0].default_value = (%f,%f,%f,1.0)\n" os.format("bg_node.inputs[0].default_value = (%f,%f,%f,1.0)\n"
"bg_node.inputs[1].default_value = %f\n", "bg_node.inputs[1].default_value = %f\n",
light.color.vec[0], light.color.vec[1], light.color.vec[2], light.color.vec[0], light.color.vec[1], light.color.vec[2],
light.q / 8.0); light.q / 8.0);
return; return;
case BabeDeadLight::LightDirectional: case BabeDeadLight::LightType::Directional:
os.format("lamp = bpy.data.lamps.new('LAMP_%01u_%03u', 'SUN')\n" os.format("lamp = bpy.data.lamps.new('LAMP_%01u_%03u', 'SUN')\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n" "lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
"lamp_obj.rotation_mode = 'QUATERNION'\n" "lamp_obj.rotation_mode = 'QUATERNION'\n"
@ -32,13 +32,13 @@ void ReadBabeDeadLightToBlender(HECL::BlenderConnection::PyOutStream& os,
"\n", s, l, "\n", s, l,
light.direction.vec[0], light.direction.vec[1], light.direction.vec[2]); light.direction.vec[0], light.direction.vec[1], light.direction.vec[2]);
break; break;
case BabeDeadLight::LightCustom: case BabeDeadLight::LightType::Custom:
os.format("lamp = bpy.data.lamps.new('LAMP_%01u_%03u', 'POINT')\n" os.format("lamp = bpy.data.lamps.new('LAMP_%01u_%03u', 'POINT')\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n" "lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
"\n", s, l); "\n", s, l);
break; break;
case BabeDeadLight::LightSpot: case BabeDeadLight::LightType::Spot:
case BabeDeadLight::LightSpot2: case BabeDeadLight::LightType::Spot2:
os.format("lamp = bpy.data.lamps.new('LAMP_%01u_%03u', 'SPOT')\n" os.format("lamp = bpy.data.lamps.new('LAMP_%01u_%03u', 'SPOT')\n"
"lamp.spot_size = %f\n" "lamp.spot_size = %f\n"
"lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n" "lamp_obj = bpy.data.objects.new(lamp.name, lamp)\n"
@ -69,14 +69,14 @@ void ReadBabeDeadLightToBlender(HECL::BlenderConnection::PyOutStream& os,
switch (light.falloff) switch (light.falloff)
{ {
case BabeDeadLight::FalloffConstant: case BabeDeadLight::Falloff::Constant:
os << "falloff_node.inputs[0].default_value *= 75.0\n" os << "falloff_node.inputs[0].default_value *= 75.0\n"
"lamp.node_tree.links.new(falloff_node.outputs[2], lamp.node_tree.nodes['Emission'].inputs[1])\n"; "lamp.node_tree.links.new(falloff_node.outputs[2], lamp.node_tree.nodes['Emission'].inputs[1])\n";
break; break;
case BabeDeadLight::FalloffLinear: case BabeDeadLight::Falloff::Linear:
os << "lamp.node_tree.links.new(falloff_node.outputs[1], lamp.node_tree.nodes['Emission'].inputs[1])\n"; os << "lamp.node_tree.links.new(falloff_node.outputs[1], lamp.node_tree.nodes['Emission'].inputs[1])\n";
break; break;
case BabeDeadLight::FalloffQuadratic: case BabeDeadLight::Falloff::Quadratic:
os << "lamp.node_tree.links.new(falloff_node.outputs[0], lamp.node_tree.nodes['Emission'].inputs[1])\n"; os << "lamp.node_tree.links.new(falloff_node.outputs[0], lamp.node_tree.nodes['Emission'].inputs[1])\n";
break; break;
default: break; default: break;

View File

@ -159,7 +159,7 @@ void ReadMaterialSetToBlender_1_2(HECL::BlenderConnection::PyOutStream& os,
const NOD::Node* node; const NOD::Node* node;
const typename PAKRouter::EntryType* texEntry = pakRouter.lookupEntry(tex, &node); const typename PAKRouter::EntryType* texEntry = pakRouter.lookupEntry(tex, &node);
HECL::ProjectPath txtrPath = pakRouter.getWorking(texEntry); HECL::ProjectPath txtrPath = pakRouter.getWorking(texEntry);
if (txtrPath.getPathType() == HECL::ProjectPath::PT_NONE) if (txtrPath.getPathType() == HECL::ProjectPath::Type::None)
{ {
PAKEntryReadStream rs = texEntry->beginReadStream(*node); PAKEntryReadStream rs = texEntry->beginReadStream(*node);
TXTR::Extract(rs, txtrPath); TXTR::Extract(rs, txtrPath);
@ -1259,9 +1259,9 @@ bool WriteCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath
/* Surfaces */ /* Surfaces */
GX::Primitive prim; GX::Primitive prim;
if (mesh.topology == HECL::TopologyTriangles) if (mesh.topology == HECL::HMDLTopology::Triangles)
prim = GX::TRIANGLES; prim = GX::TRIANGLES;
else if (mesh.topology == HECL::TopologyTriStrips) else if (mesh.topology == HECL::HMDLTopology::TriStrips)
prim = GX::TRIANGLESTRIP; prim = GX::TRIANGLESTRIP;
else else
LogDNACommon.report(LogVisor::FatalError, "unrecognized mesh output mode"); LogDNACommon.report(LogVisor::FatalError, "unrecognized mesh output mode");

View File

@ -19,10 +19,10 @@ bool ReadMAPAToBlender(HECL::BlenderConnection& conn,
{ {
/* Rename MAPA for consistency */ /* Rename MAPA for consistency */
HECL::ProjectPath mapaPath(outPath.getParentPath(), _S("!map.blend")); HECL::ProjectPath mapaPath(outPath.getParentPath(), _S("!map.blend"));
if (!force && mapaPath.getPathType() == HECL::ProjectPath::PT_FILE) if (!force && mapaPath.getPathType() == HECL::ProjectPath::Type::File)
return true; return true;
if (!conn.createBlend(mapaPath, HECL::BlenderConnection::TypeMapArea)) if (!conn.createBlend(mapaPath, HECL::BlenderConnection::BlendType::MapArea))
return false; return false;
HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true);
@ -177,7 +177,7 @@ bool ReadMAPAToBlender(HECL::BlenderConnection& conn,
/* World background */ /* World background */
HECL::ProjectPath worldBlend(outPath.getParentPath().getParentPath(), "!world.blend"); HECL::ProjectPath worldBlend(outPath.getParentPath().getParentPath(), "!world.blend");
if (worldBlend.getPathType() == HECL::ProjectPath::PT_FILE) if (worldBlend.getPathType() == HECL::ProjectPath::Type::File)
os.linkBackground("//../!world.blend", "World"); os.linkBackground("//../!world.blend", "World");
os.centerView(); os.centerView();

View File

@ -21,7 +21,7 @@ bool ReadMLVLToBlender(HECL::BlenderConnection& conn,
{ {
/* Rename MLVL for consistency */ /* Rename MLVL for consistency */
HECL::ProjectPath mlvlPath(outPath.getParentPath(), _S("!world.blend")); HECL::ProjectPath mlvlPath(outPath.getParentPath(), _S("!world.blend"));
if (!force && mlvlPath.getPathType() == HECL::ProjectPath::PT_FILE) if (!force && mlvlPath.getPathType() == HECL::ProjectPath::Type::File)
return true; return true;
/* Link Skybox CMDL */ /* Link Skybox CMDL */
@ -33,7 +33,7 @@ bool ReadMLVLToBlender(HECL::BlenderConnection& conn,
} }
/* Create World Blend */ /* Create World Blend */
if (!conn.createBlend(mlvlPath, HECL::BlenderConnection::TypeWorld)) if (!conn.createBlend(mlvlPath, HECL::BlenderConnection::BlendType::World))
return false; return false;
HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true); HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true);
os.format("import bpy\n" os.format("import bpy\n"

View File

@ -52,14 +52,14 @@ public:
struct UniqueResult struct UniqueResult
{ {
enum Type enum class Type
{ {
UNIQUE_NOTFOUND, NotFound,
UNIQUE_PAK, Pak,
UNIQUE_LEVEL, Level,
UNIQUE_AREA, Area,
UNIQUE_LAYER Layer
} m_type = UNIQUE_NOTFOUND; } m_type = Type::NotFound;
const HECL::SystemString* m_levelName = nullptr; const HECL::SystemString* m_levelName = nullptr;
const HECL::SystemString* m_areaName = nullptr; const HECL::SystemString* m_areaName = nullptr;
const HECL::SystemString* m_layerName = nullptr; const HECL::SystemString* m_layerName = nullptr;
@ -69,7 +69,7 @@ struct UniqueResult
template<class PAKBRIDGE> template<class PAKBRIDGE>
void checkEntry(const PAKBRIDGE& pakBridge, const typename PAKBRIDGE::PAKType::Entry& entry) void checkEntry(const PAKBRIDGE& pakBridge, const typename PAKBRIDGE::PAKType::Entry& entry)
{ {
UniqueResult::Type resultType = UniqueResult::UNIQUE_NOTFOUND; UniqueResult::Type resultType = UniqueResult::Type::NotFound;
bool foundOneLayer = false; bool foundOneLayer = false;
const HECL::SystemString* levelName = nullptr; const HECL::SystemString* levelName = nullptr;
typename PAKBRIDGE::PAKType::IDType levelId; typename PAKBRIDGE::PAKType::IDType levelId;
@ -80,7 +80,7 @@ struct UniqueResult
if (entry.id == lpair.first) if (entry.id == lpair.first)
{ {
levelName = &lpair.second.name; levelName = &lpair.second.name;
resultType = UniqueResult::UNIQUE_LEVEL; resultType = UniqueResult::Type::Level;
break; break;
} }
@ -95,22 +95,22 @@ struct UniqueResult
{ {
if (areaId == pair.first) if (areaId == pair.first)
{ {
resultType = UniqueResult::UNIQUE_AREA; resultType = UniqueResult::Type::Area;
} }
else if (levelId == lpair.first) else if (levelId == lpair.first)
{ {
resultType = UniqueResult::UNIQUE_LEVEL; resultType = UniqueResult::Type::Level;
break; break;
} }
else else
{ {
m_type = UniqueResult::UNIQUE_PAK; m_type = UniqueResult::Type::Pak;
return; return;
} }
continue; continue;
} }
else else
resultType = UniqueResult::UNIQUE_LAYER; resultType = UniqueResult::Type::Layer;
levelName = &lpair.second.name; levelName = &lpair.second.name;
levelId = lpair.first; levelId = lpair.first;
areaId = pair.first; areaId = pair.first;
@ -125,22 +125,22 @@ struct UniqueResult
{ {
if (areaId == pair.first) if (areaId == pair.first)
{ {
resultType = UniqueResult::UNIQUE_AREA; resultType = UniqueResult::Type::Area;
} }
else if (levelId == lpair.first) else if (levelId == lpair.first)
{ {
resultType = UniqueResult::UNIQUE_LEVEL; resultType = UniqueResult::Type::Level;
break; break;
} }
else else
{ {
m_type = UniqueResult::UNIQUE_PAK; m_type = UniqueResult::Type::Pak;
return; return;
} }
continue; continue;
} }
else else
resultType = UniqueResult::UNIQUE_AREA; resultType = UniqueResult::Type::Area;
levelName = &lpair.second.name; levelName = &lpair.second.name;
levelId = lpair.first; levelId = lpair.first;
areaId = pair.first; areaId = pair.first;
@ -150,11 +150,11 @@ struct UniqueResult
} }
m_type = resultType; m_type = resultType;
m_levelName = levelName; m_levelName = levelName;
if (resultType == UniqueResult::UNIQUE_LAYER || resultType == UniqueResult::UNIQUE_AREA) if (resultType == UniqueResult::Type::Layer || resultType == UniqueResult::Type::Area)
{ {
const typename PAKBRIDGE::Level::Area& area = pakBridge.m_levelDeps.at(levelId).areas.at(areaId); const typename PAKBRIDGE::Level::Area& area = pakBridge.m_levelDeps.at(levelId).areas.at(areaId);
m_areaName = &area.name; m_areaName = &area.name;
if (resultType == UniqueResult::UNIQUE_LAYER) if (resultType == UniqueResult::Type::Layer)
{ {
const typename PAKBRIDGE::Level::Area::Layer& layer = area.layers[layerIdx]; const typename PAKBRIDGE::Level::Area::Layer& layer = area.layers[layerIdx];
m_layerName = &layer.name; m_layerName = &layer.name;
@ -164,7 +164,7 @@ struct UniqueResult
HECL::ProjectPath uniquePath(const HECL::ProjectPath& pakPath) const HECL::ProjectPath uniquePath(const HECL::ProjectPath& pakPath) const
{ {
if (m_type == UNIQUE_PAK) if (m_type == Type::Pak)
return pakPath; return pakPath;
HECL::ProjectPath levelDir; HECL::ProjectPath levelDir;
@ -174,13 +174,13 @@ struct UniqueResult
levelDir = pakPath; levelDir = pakPath;
levelDir.makeDir(); levelDir.makeDir();
if (m_type == UNIQUE_AREA) if (m_type == Type::Area)
{ {
HECL::ProjectPath areaDir(levelDir, *m_areaName); HECL::ProjectPath areaDir(levelDir, *m_areaName);
areaDir.makeDir(); areaDir.makeDir();
return areaDir; return areaDir;
} }
else if (m_type == UNIQUE_LAYER) else if (m_type == Type::Layer)
{ {
HECL::ProjectPath areaDir(levelDir, *m_areaName); HECL::ProjectPath areaDir(levelDir, *m_areaName);
areaDir.makeDir(); areaDir.makeDir();
@ -521,7 +521,7 @@ public:
/* TODO: Position after extracted item */ /* TODO: Position after extracted item */
HECL::ProjectPath cooked = getCooked(item); HECL::ProjectPath cooked = getCooked(item);
if (force || cooked.getPathType() == HECL::ProjectPath::PT_NONE) if (force || cooked.getPathType() == HECL::ProjectPath::Type::None)
{ {
PAKEntryReadStream s = item->beginReadStream(*m_node); PAKEntryReadStream s = item->beginReadStream(*m_node);
FILE* fout = HECL::Fopen(cooked.getAbsolutePath().c_str(), _S("wb")); FILE* fout = HECL::Fopen(cooked.getAbsolutePath().c_str(), _S("wb"));
@ -532,7 +532,7 @@ public:
HECL::ProjectPath working = getWorking(item, extractor); HECL::ProjectPath working = getWorking(item, extractor);
if (extractor.func_a) /* Doesn't need PAKRouter access */ if (extractor.func_a) /* Doesn't need PAKRouter access */
{ {
if (force || working.getPathType() == HECL::ProjectPath::PT_NONE) if (force || working.getPathType() == HECL::ProjectPath::Type::None)
{ {
PAKEntryReadStream s = item->beginReadStream(*m_node); PAKEntryReadStream s = item->beginReadStream(*m_node);
extractor.func_a(s, working); extractor.func_a(s, working);
@ -540,7 +540,7 @@ public:
} }
else if (extractor.func_b) /* Needs PAKRouter access */ else if (extractor.func_b) /* Needs PAKRouter access */
{ {
if (force || working.getPathType() == HECL::ProjectPath::PT_NONE) if (force || working.getPathType() == HECL::ProjectPath::Type::None)
{ {
PAKEntryReadStream s = item->beginReadStream(*m_node); PAKEntryReadStream s = item->beginReadStream(*m_node);
extractor.func_b(m_dataSpec, s, working, *this, *item, force, extractor.func_b(m_dataSpec, s, working, *this, *item, force,

View File

@ -12,20 +12,20 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::read(A
unk2 = reader.readFloatBig(); unk2 = reader.readFloatBig();
switch (DataType(parmType)) switch (DataType(parmType))
{ {
case DataType::DTInt32: case DataType::Int32:
parmVals[0].int32 = reader.readInt32Big(); parmVals[0].int32 = reader.readInt32Big();
parmVals[1].int32 = reader.readInt32Big(); parmVals[1].int32 = reader.readInt32Big();
break; break;
case DataType::DTUInt32: case DataType::UInt32:
case DataType::DTEnum: case DataType::Enum:
parmVals[0].uint32 = reader.readUint32Big(); parmVals[0].uint32 = reader.readUint32Big();
parmVals[1].uint32 = reader.readUint32Big(); parmVals[1].uint32 = reader.readUint32Big();
break; break;
case DataType::DTFloat: case DataType::Float:
parmVals[0].float32 = reader.readFloatBig(); parmVals[0].float32 = reader.readFloatBig();
parmVals[1].float32 = reader.readFloatBig(); parmVals[1].float32 = reader.readFloatBig();
break; break;
case DataType::DTBool: case DataType::Bool:
parmVals[0].bool1 = reader.readBool(); parmVals[0].bool1 = reader.readBool();
parmVals[1].bool1 = reader.readBool(); parmVals[1].bool1 = reader.readBool();
break; break;
@ -39,20 +39,20 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::write(
writer.writeFloatBig(unk2); writer.writeFloatBig(unk2);
switch (DataType(parmType)) switch (DataType(parmType))
{ {
case DataType::DTInt32: case DataType::Int32:
writer.writeInt32Big(parmVals[0].int32); writer.writeInt32Big(parmVals[0].int32);
writer.writeInt32Big(parmVals[1].int32); writer.writeInt32Big(parmVals[1].int32);
break; break;
case DataType::DTUInt32: case DataType::UInt32:
case DataType::DTEnum: case DataType::Enum:
writer.writeUint32Big(parmVals[0].uint32); writer.writeUint32Big(parmVals[0].uint32);
writer.writeUint32Big(parmVals[0].uint32); writer.writeUint32Big(parmVals[0].uint32);
break; break;
case DataType::DTFloat: case DataType::Float:
writer.writeFloatBig(parmVals[0].float32); writer.writeFloatBig(parmVals[0].float32);
writer.writeFloatBig(parmVals[0].float32); writer.writeFloatBig(parmVals[0].float32);
break; break;
case DataType::DTBool: case DataType::Bool:
writer.writeBool(parmVals[0].bool1); writer.writeBool(parmVals[0].bool1);
writer.writeBool(parmVals[0].bool1); writer.writeBool(parmVals[0].bool1);
break; break;
@ -64,13 +64,13 @@ size_t ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::bina
__isz += 12; __isz += 12;
switch (DataType(parmType)) switch (DataType(parmType))
{ {
case DataType::DTInt32: case DataType::Int32:
case DataType::DTUInt32: case DataType::UInt32:
case DataType::DTEnum: case DataType::Enum:
case DataType::DTFloat: case DataType::Float:
__isz += 8; __isz += 8;
break; break;
case DataType::DTBool: case DataType::Bool:
__isz += 2; __isz += 2;
break; break;
} }
@ -85,20 +85,20 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::fromYA
reader.enterSubVector("parmVals"); reader.enterSubVector("parmVals");
switch (DataType(parmType)) switch (DataType(parmType))
{ {
case DataType::DTInt32: case DataType::Int32:
parmVals[0].int32 = reader.readInt32(nullptr); parmVals[0].int32 = reader.readInt32(nullptr);
parmVals[1].int32 = reader.readInt32(nullptr); parmVals[1].int32 = reader.readInt32(nullptr);
break; break;
case DataType::DTUInt32: case DataType::UInt32:
case DataType::DTEnum: case DataType::Enum:
parmVals[0].uint32 = reader.readUint32(nullptr); parmVals[0].uint32 = reader.readUint32(nullptr);
parmVals[1].uint32 = reader.readUint32(nullptr); parmVals[1].uint32 = reader.readUint32(nullptr);
break; break;
case DataType::DTFloat: case DataType::Float:
parmVals[0].float32 = reader.readFloat(nullptr); parmVals[0].float32 = reader.readFloat(nullptr);
parmVals[1].float32 = reader.readFloat(nullptr); parmVals[1].float32 = reader.readFloat(nullptr);
break; break;
case DataType::DTBool: case DataType::Bool:
parmVals[0].bool1 = reader.readBool(nullptr); parmVals[0].bool1 = reader.readBool(nullptr);
parmVals[1].bool1 = reader.readBool(nullptr); parmVals[1].bool1 = reader.readBool(nullptr);
break; break;
@ -115,20 +115,20 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::toYAML
writer.enterSubVector("parmVals"); writer.enterSubVector("parmVals");
switch (DataType(parmType)) switch (DataType(parmType))
{ {
case DataType::DTInt32: case DataType::Int32:
writer.writeInt32(nullptr, parmVals[0].int32); writer.writeInt32(nullptr, parmVals[0].int32);
writer.writeInt32(nullptr, parmVals[1].int32); writer.writeInt32(nullptr, parmVals[1].int32);
break; break;
case DataType::DTUInt32: case DataType::UInt32:
case DataType::DTEnum: case DataType::Enum:
writer.writeUint32(nullptr, parmVals[0].uint32); writer.writeUint32(nullptr, parmVals[0].uint32);
writer.writeUint32(nullptr, parmVals[0].uint32); writer.writeUint32(nullptr, parmVals[0].uint32);
break; break;
case DataType::DTFloat: case DataType::Float:
writer.writeFloat(nullptr, parmVals[0].float32); writer.writeFloat(nullptr, parmVals[0].float32);
writer.writeFloat(nullptr, parmVals[0].float32); writer.writeFloat(nullptr, parmVals[0].float32);
break; break;
case DataType::DTBool: case DataType::Bool:
writer.writeBool(nullptr, parmVals[0].bool1); writer.writeBool(nullptr, parmVals[0].bool1);
writer.writeBool(nullptr, parmVals[0].bool1); writer.writeBool(nullptr, parmVals[0].bool1);
break; break;
@ -160,17 +160,17 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(Athena::io:
{ {
switch (ParmInfo::DataType(pi.parmType)) switch (ParmInfo::DataType(pi.parmType))
{ {
case ParmInfo::DTInt32: case ParmInfo::DataType::Int32:
ai.parmVals.emplace_back(reader.readInt32Big()); ai.parmVals.emplace_back(reader.readInt32Big());
break; break;
case ParmInfo::DTUInt32: case ParmInfo::DataType::UInt32:
case ParmInfo::DTEnum: case ParmInfo::DataType::Enum:
ai.parmVals.emplace_back(reader.readUint32Big()); ai.parmVals.emplace_back(reader.readUint32Big());
break; break;
case ParmInfo::DTFloat: case ParmInfo::DataType::Float:
ai.parmVals.emplace_back(reader.readFloatBig()); ai.parmVals.emplace_back(reader.readFloatBig());
break; break;
case ParmInfo::DTBool: case ParmInfo::DataType::Bool:
ai.parmVals.emplace_back(reader.readBool()); ai.parmVals.emplace_back(reader.readBool());
break; break;
default: break; default: break;
@ -199,17 +199,17 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::write(Athena::io
pVal = *it++; pVal = *it++;
switch (ParmInfo::DataType(pi.parmType)) switch (ParmInfo::DataType(pi.parmType))
{ {
case ParmInfo::DTInt32: case ParmInfo::DataType::Int32:
writer.writeInt32Big(pVal.int32); writer.writeInt32Big(pVal.int32);
break; break;
case ParmInfo::DTUInt32: case ParmInfo::DataType::UInt32:
case ParmInfo::DTEnum: case ParmInfo::DataType::Enum:
writer.writeUint32Big(pVal.uint32); writer.writeUint32Big(pVal.uint32);
break; break;
case ParmInfo::DTFloat: case ParmInfo::DataType::Float:
writer.writeFloatBig(pVal.float32); writer.writeFloatBig(pVal.float32);
break; break;
case ParmInfo::DTBool: case ParmInfo::DataType::Bool:
writer.writeBool(pVal.bool1); writer.writeBool(pVal.bool1);
break; break;
default: break; default: break;
@ -228,13 +228,13 @@ size_t ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::binarySize(siz
{ {
switch (ParmInfo::DataType(pi.parmType)) switch (ParmInfo::DataType(pi.parmType))
{ {
case ParmInfo::DTInt32: case ParmInfo::DataType::Int32:
case ParmInfo::DTUInt32: case ParmInfo::DataType::UInt32:
case ParmInfo::DTEnum: case ParmInfo::DataType::Enum:
case ParmInfo::DTFloat: case ParmInfo::DataType::Float:
__isz += animInfos.size() * 4; __isz += animInfos.size() * 4;
break; break;
case ParmInfo::DTBool: case ParmInfo::DataType::Bool:
__isz += animInfos.size(); __isz += animInfos.size();
break; break;
default: break; default: break;
@ -262,17 +262,17 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::fromYAML(Athena:
{ {
switch (ParmInfo::DataType(pi.parmType)) switch (ParmInfo::DataType(pi.parmType))
{ {
case ParmInfo::DTInt32: case ParmInfo::DataType::Int32:
ai.parmVals.emplace_back(reader.readInt32(nullptr)); ai.parmVals.emplace_back(reader.readInt32(nullptr));
break; break;
case ParmInfo::DTUInt32: case ParmInfo::DataType::UInt32:
case ParmInfo::DTEnum: case ParmInfo::DataType::Enum:
ai.parmVals.emplace_back(reader.readUint32(nullptr)); ai.parmVals.emplace_back(reader.readUint32(nullptr));
break; break;
case ParmInfo::DTFloat: case ParmInfo::DataType::Float:
ai.parmVals.emplace_back(reader.readFloat(nullptr)); ai.parmVals.emplace_back(reader.readFloat(nullptr));
break; break;
case ParmInfo::DTBool: case ParmInfo::DataType::Bool:
ai.parmVals.emplace_back(reader.readBool(nullptr)); ai.parmVals.emplace_back(reader.readBool(nullptr));
break; break;
default: break; default: break;
@ -303,17 +303,17 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::toYAML(Athena::i
pVal = *it++; pVal = *it++;
switch (ParmInfo::DataType(pi.parmType)) switch (ParmInfo::DataType(pi.parmType))
{ {
case ParmInfo::DTInt32: case ParmInfo::DataType::Int32:
writer.writeInt32(nullptr, pVal.int32); writer.writeInt32(nullptr, pVal.int32);
break; break;
case ParmInfo::DTUInt32: case ParmInfo::DataType::UInt32:
case ParmInfo::DTEnum: case ParmInfo::DataType::Enum:
writer.writeUint32(nullptr, pVal.uint32); writer.writeUint32(nullptr, pVal.uint32);
break; break;
case ParmInfo::DTFloat: case ParmInfo::DataType::Float:
writer.writeFloat(nullptr, pVal.float32); writer.writeFloat(nullptr, pVal.float32);
break; break;
case ParmInfo::DTBool: case ParmInfo::DataType::Bool:
writer.writeBool(nullptr, pVal.bool1); writer.writeBool(nullptr, pVal.bool1);
break; break;
default: break; default: break;
@ -665,23 +665,23 @@ void ANCS::AnimationSet::MetaAnimFactory::read(Athena::io::IStreamReader& reader
IMetaAnim::Type type(IMetaAnim::Type(reader.readUint32Big())); IMetaAnim::Type type(IMetaAnim::Type(reader.readUint32Big()));
switch (type) switch (type)
{ {
case IMetaAnim::MAPrimitive: case IMetaAnim::Type::Primitive:
m_anim.reset(new struct MetaAnimPrimitive); m_anim.reset(new struct MetaAnimPrimitive);
m_anim->read(reader); m_anim->read(reader);
break; break;
case IMetaAnim::MABlend: case IMetaAnim::Type::Blend:
m_anim.reset(new struct MetaAnimBlend); m_anim.reset(new struct MetaAnimBlend);
m_anim->read(reader); m_anim->read(reader);
break; break;
case IMetaAnim::MAPhaseBlend: case IMetaAnim::Type::PhaseBlend:
m_anim.reset(new struct MetaAnimPhaseBlend); m_anim.reset(new struct MetaAnimPhaseBlend);
m_anim->read(reader); m_anim->read(reader);
break; break;
case IMetaAnim::MARandom: case IMetaAnim::Type::Random:
m_anim.reset(new struct MetaAnimRandom); m_anim.reset(new struct MetaAnimRandom);
m_anim->read(reader); m_anim->read(reader);
break; break;
case IMetaAnim::MASequence: case IMetaAnim::Type::Sequence:
m_anim.reset(new struct MetaAnimSequence); m_anim.reset(new struct MetaAnimSequence);
m_anim->read(reader); m_anim->read(reader);
break; break;
@ -695,7 +695,7 @@ void ANCS::AnimationSet::MetaAnimFactory::write(Athena::io::IStreamWriter& write
{ {
if (!m_anim) if (!m_anim)
return; return;
writer.writeInt32Big(m_anim->m_type); writer.writeInt32Big(atUint32(m_anim->m_type));
m_anim->write(writer); m_anim->write(writer);
} }
@ -760,19 +760,19 @@ void ANCS::AnimationSet::MetaTransFactory::read(Athena::io::IStreamReader& reade
IMetaTrans::Type type(IMetaTrans::Type(reader.readUint32Big())); IMetaTrans::Type type(IMetaTrans::Type(reader.readUint32Big()));
switch (type) switch (type)
{ {
case IMetaTrans::MTMetaAnim: case IMetaTrans::Type::MetaAnim:
m_trans.reset(new struct MetaTransMetaAnim); m_trans.reset(new struct MetaTransMetaAnim);
m_trans->read(reader); m_trans->read(reader);
break; break;
case IMetaTrans::MTTrans: case IMetaTrans::Type::Trans:
m_trans.reset(new struct MetaTransTrans); m_trans.reset(new struct MetaTransTrans);
m_trans->read(reader); m_trans->read(reader);
break; break;
case IMetaTrans::MTPhaseTrans: case IMetaTrans::Type::PhaseTrans:
m_trans.reset(new struct MetaTransPhaseTrans); m_trans.reset(new struct MetaTransPhaseTrans);
m_trans->read(reader); m_trans->read(reader);
break; break;
case IMetaTrans::MTNoTrans: case IMetaTrans::Type::NoTrans:
default: default:
m_trans.reset(nullptr); m_trans.reset(nullptr);
break; break;
@ -783,10 +783,10 @@ void ANCS::AnimationSet::MetaTransFactory::write(Athena::io::IStreamWriter& writ
{ {
if (!m_trans) if (!m_trans)
{ {
writer.writeInt32Big(IMetaTrans::MTNoTrans); writer.writeInt32Big(atUint32(IMetaTrans::Type::NoTrans));
return; return;
} }
writer.writeInt32Big(m_trans->m_type); writer.writeInt32Big(atUint32(m_trans->m_type));
m_trans->write(writer); m_trans->write(writer);
} }

View File

@ -66,13 +66,13 @@ struct ANCS : BigYAML
{ {
DECL_YAML DECL_YAML
Delete expl; Delete expl;
enum DataType enum class DataType
{ {
DTInt32 = 0, Int32 = 0,
DTUInt32 = 1, UInt32 = 1,
DTFloat = 2, Float = 2,
DTBool = 3, Bool = 3,
DTEnum = 4 Enum = 4
}; };
union Parm union Parm
{ {
@ -159,13 +159,13 @@ struct ANCS : BigYAML
{ {
Delete expl; Delete expl;
virtual ~IMetaAnim() {} virtual ~IMetaAnim() {}
enum Type enum class Type
{ {
MAPrimitive = 0, Primitive = 0,
MABlend = 1, Blend = 1,
MAPhaseBlend = 2, PhaseBlend = 2,
MARandom = 3, Random = 3,
MASequence = 4 Sequence = 4
} m_type; } m_type;
const char* m_typeStr; const char* m_typeStr;
IMetaAnim(Type type, const char* typeStr) IMetaAnim(Type type, const char* typeStr)
@ -180,7 +180,7 @@ struct ANCS : BigYAML
}; };
struct MetaAnimPrimitive : IMetaAnim struct MetaAnimPrimitive : IMetaAnim
{ {
MetaAnimPrimitive() : IMetaAnim(MAPrimitive, "Primitive") {} MetaAnimPrimitive() : IMetaAnim(Type::Primitive, "Primitive") {}
DECL_YAML DECL_YAML
UniqueID32 animId; UniqueID32 animId;
Value<atUint32> animIdx; Value<atUint32> animIdx;
@ -195,7 +195,7 @@ struct ANCS : BigYAML
}; };
struct MetaAnimBlend : IMetaAnim struct MetaAnimBlend : IMetaAnim
{ {
MetaAnimBlend() : IMetaAnim(MABlend, "Blend") {} MetaAnimBlend() : IMetaAnim(Type::Blend, "Blend") {}
DECL_YAML DECL_YAML
MetaAnimFactory animA; MetaAnimFactory animA;
MetaAnimFactory animB; MetaAnimFactory animB;
@ -210,7 +210,7 @@ struct ANCS : BigYAML
}; };
struct MetaAnimPhaseBlend : IMetaAnim struct MetaAnimPhaseBlend : IMetaAnim
{ {
MetaAnimPhaseBlend() : IMetaAnim(MAPhaseBlend, "PhaseBlend") {} MetaAnimPhaseBlend() : IMetaAnim(Type::PhaseBlend, "PhaseBlend") {}
DECL_YAML DECL_YAML
MetaAnimFactory animA; MetaAnimFactory animA;
MetaAnimFactory animB; MetaAnimFactory animB;
@ -225,7 +225,7 @@ struct ANCS : BigYAML
}; };
struct MetaAnimRandom : IMetaAnim struct MetaAnimRandom : IMetaAnim
{ {
MetaAnimRandom() : IMetaAnim(MARandom, "Random") {} MetaAnimRandom() : IMetaAnim(Type::Random, "Random") {}
DECL_YAML DECL_YAML
Value<atUint32> animCount; Value<atUint32> animCount;
struct Child : BigYAML struct Child : BigYAML
@ -244,7 +244,7 @@ struct ANCS : BigYAML
}; };
struct MetaAnimSequence : IMetaAnim struct MetaAnimSequence : IMetaAnim
{ {
MetaAnimSequence() : IMetaAnim(MASequence, "Sequence") {} MetaAnimSequence() : IMetaAnim(Type::Sequence, "Sequence") {}
DECL_YAML DECL_YAML
Value<atUint32> animCount; Value<atUint32> animCount;
Vector<MetaAnimFactory, DNA_COUNT(animCount)> children; Vector<MetaAnimFactory, DNA_COUNT(animCount)> children;
@ -268,12 +268,12 @@ struct ANCS : BigYAML
{ {
Delete expl; Delete expl;
virtual ~IMetaTrans() {} virtual ~IMetaTrans() {}
enum Type enum class Type
{ {
MTMetaAnim = 0, MetaAnim = 0,
MTTrans = 1, Trans = 1,
MTPhaseTrans = 2, PhaseTrans = 2,
MTNoTrans = 3, NoTrans = 3,
} m_type; } m_type;
const char* m_typeStr; const char* m_typeStr;
IMetaTrans(Type type, const char* typeStr) IMetaTrans(Type type, const char* typeStr)
@ -287,13 +287,13 @@ struct ANCS : BigYAML
}; };
struct MetaTransMetaAnim : IMetaTrans struct MetaTransMetaAnim : IMetaTrans
{ {
MetaTransMetaAnim() : IMetaTrans(MTMetaAnim, "MetaAnim") {} MetaTransMetaAnim() : IMetaTrans(Type::MetaAnim, "MetaAnim") {}
DECL_YAML DECL_YAML
MetaAnimFactory anim; MetaAnimFactory anim;
}; };
struct MetaTransTrans : IMetaTrans struct MetaTransTrans : IMetaTrans
{ {
MetaTransTrans() : IMetaTrans(MTTrans, "Trans") {} MetaTransTrans() : IMetaTrans(Type::Trans, "Trans") {}
DECL_YAML DECL_YAML
Value<float> time; Value<float> time;
Value<atUint32> unk1; Value<atUint32> unk1;
@ -303,7 +303,7 @@ struct ANCS : BigYAML
}; };
struct MetaTransPhaseTrans : IMetaTrans struct MetaTransPhaseTrans : IMetaTrans
{ {
MetaTransPhaseTrans() : IMetaTrans(MTPhaseTrans, "PhaseTrans") {} MetaTransPhaseTrans() : IMetaTrans(Type::PhaseTrans, "PhaseTrans") {}
DECL_YAML DECL_YAML
Value<float> time; Value<float> time;
Value<atUint32> unk1; Value<atUint32> unk1;
@ -397,25 +397,25 @@ struct ANCS : BigYAML
std::function<void(const HECL::SystemChar*)> fileChanged) std::function<void(const HECL::SystemChar*)> fileChanged)
{ {
HECL::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml")); HECL::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml"));
HECL::ProjectPath::PathType yamlType = yamlPath.getPathType(); HECL::ProjectPath::Type yamlType = yamlPath.getPathType();
HECL::ProjectPath blendPath = outPath.getWithExtension(_S(".blend")); HECL::ProjectPath blendPath = outPath.getWithExtension(_S(".blend"));
HECL::ProjectPath::PathType blendType = blendPath.getPathType(); HECL::ProjectPath::Type blendType = blendPath.getPathType();
if (force || if (force ||
yamlType == HECL::ProjectPath::PT_NONE || yamlType == HECL::ProjectPath::Type::None ||
blendType == HECL::ProjectPath::PT_NONE) blendType == HECL::ProjectPath::Type::None)
{ {
ANCS ancs; ANCS ancs;
ancs.read(rs); ancs.read(rs);
if (force || yamlType == HECL::ProjectPath::PT_NONE) if (force || yamlType == HECL::ProjectPath::Type::None)
{ {
FILE* fp = HECL::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb")); FILE* fp = HECL::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb"));
ancs.toYAMLFile(fp); ancs.toYAMLFile(fp);
fclose(fp); fclose(fp);
} }
if (force || blendType == HECL::ProjectPath::PT_NONE) if (force || blendType == HECL::ProjectPath::Type::None)
{ {
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
DNAANCS::ReadANCSToBlender<PAKRouter<PAKBridge>, ANCS, MaterialSet, DNACMDL::SurfaceHeader_1_2, 2> DNAANCS::ReadANCSToBlender<PAKRouter<PAKBridge>, ANCS, MaterialSet, DNACMDL::SurfaceHeader_1_2, 2>
@ -432,7 +432,7 @@ struct ANCS : BigYAML
{ {
/* Search for yaml */ /* Search for yaml */
HECL::ProjectPath yamlPath = inPath.getWithExtension(_S(".yaml"), true); HECL::ProjectPath yamlPath = inPath.getWithExtension(_S(".yaml"), true);
if (yamlPath.getPathType() != HECL::ProjectPath::PT_FILE) if (yamlPath.getPathType() != HECL::ProjectPath::Type::File)
Log.report(LogVisor::FatalError, _S("'%s' not found as file"), Log.report(LogVisor::FatalError, _S("'%s' not found as file"),
yamlPath.getRelativePath().c_str()); yamlPath.getRelativePath().c_str());

View File

@ -49,7 +49,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co
for (int c=0 ; c<4 ; ++c) for (int c=0 ; c<4 ; ++c)
{ {
auto frameit = frames.begin(); auto frameit = frames.begin();
ao.changeCurve(ANIMOutStream::CurveType::CurveRotate, c, rotKeys.size()); ao.changeCurve(ANIMOutStream::CurveType::Rotate, c, rotKeys.size());
for (const DNAANIM::Value& val : rotKeys) for (const DNAANIM::Value& val : rotKeys)
ao.write(*frameit++, val.v4.vec[c]); ao.write(*frameit++, val.v4.vec[c]);
} }
@ -60,7 +60,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co
for (int c=0 ; c<3 ; ++c) for (int c=0 ; c<3 ; ++c)
{ {
auto frameit = frames.begin(); auto frameit = frames.begin();
ao.changeCurve(ANIMOutStream::CurveType::CurveTranslate, c, transKeys.size()); ao.changeCurve(ANIMOutStream::CurveType::Translate, c, transKeys.size());
for (const DNAANIM::Value& val : transKeys) for (const DNAANIM::Value& val : transKeys)
ao.write(*frameit++, val.v3.vec[c]); ao.write(*frameit++, val.v3.vec[c]);
} }
@ -98,13 +98,13 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader)
atUint8 idx = reader.readUByte(); atUint8 idx = reader.readUByte();
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION; chan.type = DNAANIM::Channel::Type::Rotation;
if (idx != 0xff) if (idx != 0xff)
{ {
bones.back().second = true; bones.back().second = true;
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION; chan.type = DNAANIM::Channel::Type::Translation;
} }
} }
@ -273,7 +273,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION; chan.type = DNAANIM::Channel::Type::Rotation;
chan.i[0] = desc.initRX; chan.i[0] = desc.initRX;
chan.q[0] = desc.qRX; chan.q[0] = desc.qRX;
chan.i[1] = desc.initRY; chan.i[1] = desc.initRY;
@ -287,7 +287,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION; chan.type = DNAANIM::Channel::Type::Translation;
chan.i[0] = desc.initTX; chan.i[0] = desc.initTX;
chan.q[0] = desc.qTX; chan.q[0] = desc.qTX;
chan.i[1] = desc.initTY; chan.i[1] = desc.initTY;

View File

@ -40,7 +40,7 @@ struct CMDL
/* Do extract */ /* Do extract */
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(outPath, HECL::BlenderConnection::TypeMesh)) if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Mesh))
return false; return false;
DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, DNACMDL::SurfaceHeader_1_2, 2> DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, DNACMDL::SurfaceHeader_1_2, 2>
(conn, rs, pakRouter, entry, dataSpec, loadRp); (conn, rs, pakRouter, entry, dataSpec, loadRp);
@ -65,7 +65,7 @@ struct CMDL
/* HMDL cook test */ /* HMDL cook test */
HECL::ProjectPath tempOut = outPath.getWithExtension(_S(".recook"), true); HECL::ProjectPath tempOut = outPath.getWithExtension(_S(".recook"), true);
HECL::BlenderConnection::DataStream ds = conn.beginData(); HECL::BlenderConnection::DataStream ds = conn.beginData();
DNACMDL::Mesh mesh = ds.compileMesh(HECL::TopologyTriStrips, 16); DNACMDL::Mesh mesh = ds.compileMesh(HECL::HMDLTopology::TriStrips, 16);
ds.close(); ds.close();
DNACMDL::WriteHMDLCMDL<HMDLMaterialSet, DNACMDL::SurfaceHeader_1_2, 2>(tempOut, outPath, mesh); DNACMDL::WriteHMDLCMDL<HMDLMaterialSet, DNACMDL::SurfaceHeader_1_2, 2>(tempOut, outPath, mesh);
#endif #endif

View File

@ -66,7 +66,7 @@ void Material::AddTextureAnim(Stream& out,
{ {
switch (type) switch (type)
{ {
case UVAnimation::ANIM_MV_INV_NOTRANS: case UVAnimation::Mode::MvInvNoTranslation:
out.format("for link in list(tex_links):\n" out.format("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_%u':\n" " if link.from_node.label == 'MTX_%u':\n"
" tex_links.remove(link)\n" " tex_links.remove(link)\n"
@ -81,7 +81,7 @@ void Material::AddTextureAnim(Stream& out,
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n", " new_nodetree.links.new(node.outputs[0], soc_to)\n\n",
idx); idx);
break; break;
case UVAnimation::ANIM_MV_INV: case UVAnimation::Mode::MvInv:
out.format("for link in list(tex_links):\n" out.format("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_%u':\n" " if link.from_node.label == 'MTX_%u':\n"
" tex_links.remove(link)\n" " tex_links.remove(link)\n"
@ -96,7 +96,7 @@ void Material::AddTextureAnim(Stream& out,
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n", " new_nodetree.links.new(node.outputs[0], soc_to)\n\n",
idx); idx);
break; break;
case UVAnimation::ANIM_SCROLL: case UVAnimation::Mode::Scroll:
out.format("for link in list(tex_links):\n" out.format("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_%u':\n" " if link.from_node.label == 'MTX_%u':\n"
" tex_links.remove(link)\n" " tex_links.remove(link)\n"
@ -113,7 +113,7 @@ void Material::AddTextureAnim(Stream& out,
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n", " new_nodetree.links.new(node.outputs[0], soc_to)\n\n",
idx, vals[0], vals[1], vals[2], vals[3]); idx, vals[0], vals[1], vals[2], vals[3]);
break; break;
case UVAnimation::ANIM_ROTATION: case UVAnimation::Mode::Rotation:
out.format("for link in list(tex_links):\n" out.format("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_%u':\n" " if link.from_node.label == 'MTX_%u':\n"
" tex_links.remove(link)\n" " tex_links.remove(link)\n"
@ -130,7 +130,7 @@ void Material::AddTextureAnim(Stream& out,
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n", " new_nodetree.links.new(node.outputs[0], soc_to)\n\n",
idx, vals[0], vals[1]); idx, vals[0], vals[1]);
break; break;
case UVAnimation::ANIM_HSTRIP: case UVAnimation::Mode::HStrip:
out.format("for link in list(tex_links):\n" out.format("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_%u':\n" " if link.from_node.label == 'MTX_%u':\n"
" tex_links.remove(link)\n" " tex_links.remove(link)\n"
@ -149,7 +149,7 @@ void Material::AddTextureAnim(Stream& out,
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n", " new_nodetree.links.new(node.outputs[0], soc_to)\n\n",
idx, vals[0], vals[1], vals[2], vals[3]); idx, vals[0], vals[1], vals[2], vals[3]);
break; break;
case UVAnimation::ANIM_VSTRIP: case UVAnimation::Mode::VStrip:
out.format("for link in list(tex_links):\n" out.format("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_%u':\n" " if link.from_node.label == 'MTX_%u':\n"
" tex_links.remove(link)\n" " tex_links.remove(link)\n"
@ -168,7 +168,7 @@ void Material::AddTextureAnim(Stream& out,
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n", " new_nodetree.links.new(node.outputs[0], soc_to)\n\n",
idx, vals[0], vals[1], vals[2], vals[3]); idx, vals[0], vals[1], vals[2], vals[3]);
break; break;
case UVAnimation::ANIM_MODEL: case UVAnimation::Mode::Model:
out.format("for link in list(tex_links):\n" out.format("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_%u':\n" " if link.from_node.label == 'MTX_%u':\n"
" tex_links.remove(link)\n" " tex_links.remove(link)\n"
@ -183,7 +183,7 @@ void Material::AddTextureAnim(Stream& out,
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n", " new_nodetree.links.new(node.outputs[0], soc_to)\n\n",
idx); idx);
break; break;
case UVAnimation::ANIM_MODE_WHO_MUST_NOT_BE_NAMED: case UVAnimation::Mode::WhoMustNotBeNamed:
out.format("for link in list(tex_links):\n" out.format("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_%u':\n" " if link.from_node.label == 'MTX_%u':\n"
" tex_links.remove(link)\n" " tex_links.remove(link)\n"
@ -200,7 +200,7 @@ void Material::AddTextureAnim(Stream& out,
" new_nodetree.links.new(node.outputs[0], soc_to)\n\n", " new_nodetree.links.new(node.outputs[0], soc_to)\n\n",
idx, vals[0], vals[1]); idx, vals[0], vals[1]);
break; break;
case UVAnimation::ANIM_MODE_8: case UVAnimation::Mode::Eight:
out.format("for link in list(tex_links):\n" out.format("for link in list(tex_links):\n"
" if link.from_node.label == 'MTX_%u':\n" " if link.from_node.label == 'MTX_%u':\n"
" tex_links.remove(link)\n" " tex_links.remove(link)\n"
@ -283,23 +283,23 @@ void Material::AddDynamicAlpha(Stream& out, unsigned idx)
} }
enum CombinerType enum class Combiner
{ {
COMB_ADD, Add,
COMB_SUB, Sub,
COMB_MULT Mult
}; };
static void AddColorCombiner(Stream& out, CombinerType type, static void AddColorCombiner(Stream& out, Combiner type,
const char* a, const char* b, const char* v) const char* a, const char* b, const char* v)
{ {
out << "combiner_node = new_nodetree.nodes.new('ShaderNodeMixRGB')\n" out << "combiner_node = new_nodetree.nodes.new('ShaderNodeMixRGB')\n"
"combiner_node.inputs[0].default_value = 1.0\n" "combiner_node.inputs[0].default_value = 1.0\n"
"gridder.place_node_right(combiner_node, 2, 0)\n"; "gridder.place_node_right(combiner_node, 2, 0)\n";
if (type == COMB_ADD) if (type == Combiner::Add)
out << "combiner_node.blend_type = 'ADD'\n"; out << "combiner_node.blend_type = 'ADD'\n";
else if (type == COMB_SUB) else if (type == Combiner::Sub)
out << "combiner_node.blend_type = 'SUBTRACT'\n"; out << "combiner_node.blend_type = 'SUBTRACT'\n";
else if (type == COMB_MULT) else if (type == Combiner::Mult)
out << "combiner_node.blend_type = 'MULTIPLY'\n"; out << "combiner_node.blend_type = 'MULTIPLY'\n";
if (a) if (a)
@ -366,16 +366,16 @@ static void AddColorCombiner(Stream& out, CombinerType type,
out << "color_combiner_sockets.append(combiner_node.outputs['Color'])\n\n"; out << "color_combiner_sockets.append(combiner_node.outputs['Color'])\n\n";
} }
static void AddAlphaCombiner(Stream& out, enum CombinerType type, static void AddAlphaCombiner(Stream& out, Combiner type,
const char* a, const char* b, const char* v) const char* a, const char* b, const char* v)
{ {
out << "combiner_node = new_nodetree.nodes.new('ShaderNodeMath')\n" out << "combiner_node = new_nodetree.nodes.new('ShaderNodeMath')\n"
"gridder.place_node_right(combiner_node, 2, 1)\n"; "gridder.place_node_right(combiner_node, 2, 1)\n";
if (type == COMB_ADD) if (type == Combiner::Add)
out << "combiner_node.operation = 'ADD'\n"; out << "combiner_node.operation = 'ADD'\n";
else if (type == COMB_SUB) else if (type == Combiner::Sub)
out << "combiner_node.operation = 'SUBTRACT'\n"; out << "combiner_node.operation = 'SUBTRACT'\n";
else if (type == COMB_MULT) else if (type == Combiner::Mult)
out << "combiner_node.operation = 'MULTIPLY'\n"; out << "combiner_node.operation = 'MULTIPLY'\n";
if (a) if (a)
@ -578,7 +578,7 @@ static void AddTEVStage(Stream& out, const MaterialSet::Material::TEVStage& stag
stage.colorInD() != GX::CC_ZERO) stage.colorInD() != GX::CC_ZERO)
{ {
c_tev_opts |= 0x1f; c_tev_opts |= 0x1f;
AddColorCombiner(out, COMB_ADD, cd, ca, nullptr); AddColorCombiner(out, Combiner::Add, cd, ca, nullptr);
++c_combiner_idx; ++c_combiner_idx;
} }
else if (stage.colorInA() != GX::CC_ZERO && else if (stage.colorInA() != GX::CC_ZERO &&
@ -599,11 +599,11 @@ static void AddTEVStage(Stream& out, const MaterialSet::Material::TEVStage& stag
if (!(c_tev_opts & 1)) if (!(c_tev_opts & 1))
{ {
/* A nodes */ /* A nodes */
AddColorCombiner(out, COMB_SUB, "ONE", ca, nullptr); AddColorCombiner(out, Combiner::Sub, "ONE", ca, nullptr);
++c_combiner_idx; ++c_combiner_idx;
if (strcmp(cc, "ONE")) if (strcmp(cc, "ONE"))
{ {
AddColorCombiner(out, COMB_MULT, cc, "color_combiner_sockets[-1]", nullptr); AddColorCombiner(out, Combiner::Mult, cc, "color_combiner_sockets[-1]", nullptr);
++c_combiner_idx; ++c_combiner_idx;
} }
} }
@ -629,7 +629,7 @@ static void AddTEVStage(Stream& out, const MaterialSet::Material::TEVStage& stag
} }
else else
{ {
AddColorCombiner(out, COMB_MULT, cc, cb, nullptr); AddColorCombiner(out, Combiner::Mult, cc, cb, nullptr);
++c_combiner_idx; ++c_combiner_idx;
} }
} }
@ -637,14 +637,14 @@ static void AddTEVStage(Stream& out, const MaterialSet::Material::TEVStage& stag
if (!(c_tev_opts & 4)) if (!(c_tev_opts & 4))
{ {
/* A+B node */ /* A+B node */
AddColorCombiner(out, COMB_ADD, c_soc_log[0], c_soc_log[1], nullptr); AddColorCombiner(out, Combiner::Add, c_soc_log[0], c_soc_log[1], nullptr);
++c_combiner_idx; ++c_combiner_idx;
} }
if (!(c_tev_opts & 8)) if (!(c_tev_opts & 8))
{ {
/* +D node */ /* +D node */
AddColorCombiner(out, COMB_ADD, cd, c_soc_log[0], nullptr); AddColorCombiner(out, Combiner::Add, cd, c_soc_log[0], nullptr);
++c_combiner_idx; ++c_combiner_idx;
} }
@ -666,7 +666,7 @@ static void AddTEVStage(Stream& out, const MaterialSet::Material::TEVStage& stag
stage.alphaInD() != GX::CA_ZERO) stage.alphaInD() != GX::CA_ZERO)
{ {
a_tev_opts |= 0x1f; a_tev_opts |= 0x1f;
AddAlphaCombiner(out, COMB_ADD, ad, aa, nullptr); AddAlphaCombiner(out, Combiner::Add, ad, aa, nullptr);
++a_combiner_idx; ++a_combiner_idx;
} }
else if (stage.alphaInA() != GX::CA_ZERO && else if (stage.alphaInA() != GX::CA_ZERO &&
@ -687,11 +687,11 @@ static void AddTEVStage(Stream& out, const MaterialSet::Material::TEVStage& stag
if (!(a_tev_opts & 1)) if (!(a_tev_opts & 1))
{ {
/* A nodes */ /* A nodes */
AddAlphaCombiner(out, COMB_SUB, "ONE", aa, nullptr); AddAlphaCombiner(out, Combiner::Sub, "ONE", aa, nullptr);
++a_combiner_idx; ++a_combiner_idx;
if (strcmp(ac, "ONE")) if (strcmp(ac, "ONE"))
{ {
AddAlphaCombiner(out, COMB_MULT, ac, "alpha_combiner_sockets[-1]", nullptr); AddAlphaCombiner(out, Combiner::Mult, ac, "alpha_combiner_sockets[-1]", nullptr);
++a_combiner_idx; ++a_combiner_idx;
} }
} }
@ -717,7 +717,7 @@ static void AddTEVStage(Stream& out, const MaterialSet::Material::TEVStage& stag
} }
else else
{ {
AddAlphaCombiner(out, COMB_MULT, ac, ab, nullptr); AddAlphaCombiner(out, Combiner::Mult, ac, ab, nullptr);
++a_combiner_idx; ++a_combiner_idx;
} }
} }
@ -725,14 +725,14 @@ static void AddTEVStage(Stream& out, const MaterialSet::Material::TEVStage& stag
if (!(a_tev_opts & 4)) if (!(a_tev_opts & 4))
{ {
/* A+B node */ /* A+B node */
AddAlphaCombiner(out, COMB_ADD, a_soc_log[0], a_soc_log[1], nullptr); AddAlphaCombiner(out, Combiner::Add, a_soc_log[0], a_soc_log[1], nullptr);
++a_combiner_idx; ++a_combiner_idx;
} }
if (!(a_tev_opts & 8)) if (!(a_tev_opts & 8))
{ {
/* +D node */ /* +D node */
AddAlphaCombiner(out, COMB_ADD, ad, a_soc_log[0], nullptr); AddAlphaCombiner(out, Combiner::Add, ad, a_soc_log[0], nullptr);
++a_combiner_idx; ++a_combiner_idx;
} }
@ -829,9 +829,9 @@ void _ConstructMaterial(Stream& out,
/* Blend factors */ /* Blend factors */
using BlendFactor = Material::BlendFactor; using BlendFactor = Material::BlendFactor;
if (material.blendDstFac != BlendFactor::GX_BL_ZERO) if (material.blendDstFac != BlendFactor::BL_ZERO)
{ {
if (material.blendDstFac == BlendFactor::GX_BL_ONE) if (material.blendDstFac == BlendFactor::BL_ONE)
out << "new_material.game_settings.alpha_blend = 'ADD'\n" out << "new_material.game_settings.alpha_blend = 'ADD'\n"
"new_material.use_transparency = True\n" "new_material.use_transparency = True\n"
"new_material.transparency_method = 'RAYTRACE'\n" "new_material.transparency_method = 'RAYTRACE'\n"
@ -1212,13 +1212,13 @@ HMDLMaterialSet::Material::Material(HECL::Frontend::Frontend& FE,
uvAnimsCount = 0; uvAnimsCount = 0;
for (const HECL::Frontend::IR::Instruction& inst : heclIr.m_instructions) for (const HECL::Frontend::IR::Instruction& inst : heclIr.m_instructions)
{ {
if (inst.m_op != HECL::Frontend::IR::OpCall) if (inst.m_op != HECL::Frontend::IR::OpType::Call)
continue; continue;
if (inst.m_call.m_name.compare("Texture")) if (inst.m_call.m_name.compare("Texture"))
continue; continue;
const HECL::Frontend::IR::Instruction& sourceInst = inst.getChildInst(heclIr, 1); const HECL::Frontend::IR::Instruction& sourceInst = inst.getChildInst(heclIr, 1);
if (sourceInst.m_op != HECL::Frontend::IR::OpCall) if (sourceInst.m_op != HECL::Frontend::IR::OpType::Call)
continue; continue;
if (sourceInst.m_call.m_name.compare(0, 11, "RetroUVMode")) if (sourceInst.m_call.m_name.compare(0, 11, "RetroUVMode"))
continue; continue;
@ -1241,12 +1241,12 @@ MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
const std::vector<atVec4f>& gameArgs) const std::vector<atVec4f>& gameArgs)
{ {
if (!gameFunction.compare("RetroUVMode0Node")) if (!gameFunction.compare("RetroUVMode0Node"))
mode = ANIM_MV_INV_NOTRANS; mode = Mode::MvInvNoTranslation;
else if (!gameFunction.compare("RetroUVMode1Node")) else if (!gameFunction.compare("RetroUVMode1Node"))
mode = ANIM_MV_INV; mode = Mode::MvInv;
else if (!gameFunction.compare("RetroUVMode2Node")) else if (!gameFunction.compare("RetroUVMode2Node"))
{ {
mode = ANIM_SCROLL; mode = Mode::Scroll;
if (gameArgs.size() < 2) if (gameArgs.size() < 2)
Log.report(LogVisor::FatalError, "Mode2 UV anim requires 2 vector arguments"); Log.report(LogVisor::FatalError, "Mode2 UV anim requires 2 vector arguments");
vals[0] = gameArgs[0].vec[0]; vals[0] = gameArgs[0].vec[0];
@ -1256,7 +1256,7 @@ MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
} }
else if (!gameFunction.compare("RetroUVMode3Node")) else if (!gameFunction.compare("RetroUVMode3Node"))
{ {
mode = ANIM_ROTATION; mode = Mode::Rotation;
if (gameArgs.size() < 2) if (gameArgs.size() < 2)
Log.report(LogVisor::FatalError, "Mode3 UV anim requires 2 arguments"); Log.report(LogVisor::FatalError, "Mode3 UV anim requires 2 arguments");
vals[0] = gameArgs[0].vec[0]; vals[0] = gameArgs[0].vec[0];
@ -1264,7 +1264,7 @@ MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
} }
else if (!gameFunction.compare("RetroUVMode4Node")) else if (!gameFunction.compare("RetroUVMode4Node"))
{ {
mode = ANIM_HSTRIP; mode = Mode::HStrip;
if (gameArgs.size() < 4) if (gameArgs.size() < 4)
Log.report(LogVisor::FatalError, "Mode4 UV anim requires 4 arguments"); Log.report(LogVisor::FatalError, "Mode4 UV anim requires 4 arguments");
vals[0] = gameArgs[0].vec[0]; vals[0] = gameArgs[0].vec[0];
@ -1274,7 +1274,7 @@ MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
} }
else if (!gameFunction.compare("RetroUVMode5Node")) else if (!gameFunction.compare("RetroUVMode5Node"))
{ {
mode = ANIM_VSTRIP; mode = Mode::VStrip;
if (gameArgs.size() < 4) if (gameArgs.size() < 4)
Log.report(LogVisor::FatalError, "Mode5 UV anim requires 4 arguments"); Log.report(LogVisor::FatalError, "Mode5 UV anim requires 4 arguments");
vals[0] = gameArgs[0].vec[0]; vals[0] = gameArgs[0].vec[0];
@ -1283,10 +1283,10 @@ MaterialSet::Material::UVAnimation::UVAnimation(const std::string& gameFunction,
vals[3] = gameArgs[3].vec[0]; vals[3] = gameArgs[3].vec[0];
} }
else if (!gameFunction.compare("RetroUVMode6Node")) else if (!gameFunction.compare("RetroUVMode6Node"))
mode = ANIM_MODEL; mode = Mode::Model;
else if (!gameFunction.compare("RetroUVMode7Node")) else if (!gameFunction.compare("RetroUVMode7Node"))
{ {
mode = ANIM_MODE_WHO_MUST_NOT_BE_NAMED; mode = Mode::WhoMustNotBeNamed;
if (gameArgs.size() < 2) if (gameArgs.size() < 2)
Log.report(LogVisor::FatalError, "Mode7 UV anim requires 2 arguments"); Log.report(LogVisor::FatalError, "Mode7 UV anim requires 2 arguments");
vals[0] = gameArgs[0].vec[0]; vals[0] = gameArgs[0].vec[0];

View File

@ -138,18 +138,7 @@ struct MaterialSet : BigDNA
Vector<atUint32, DNA_COUNT(flags.konstValuesEnabled())> konstCount; Vector<atUint32, DNA_COUNT(flags.konstValuesEnabled())> konstCount;
Vector<GX::Color, DNA_COUNT(flags.konstValuesEnabled() ? konstCount[0] : 0)> konstColors; Vector<GX::Color, DNA_COUNT(flags.konstValuesEnabled() ? konstCount[0] : 0)> konstColors;
/** Slightly modified blend enums in Retro's implementation */ using BlendFactor = GX::BlendFactor;
enum BlendFactor : atUint16
{
GX_BL_ZERO,
GX_BL_ONE,
GX_BL_SRCCLR,
GX_BL_INVSRCCLR,
GX_BL_SRCALPHA,
GX_BL_INVSRCALPHA,
GX_BL_DSTALPHA,
GX_BL_INVDSTALPHA
};
Value<BlendFactor> blendDstFac; Value<BlendFactor> blendDstFac;
Value<BlendFactor> blendSrcFac; Value<BlendFactor> blendSrcFac;
Vector<atUint32, DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot; Vector<atUint32, DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot;
@ -266,17 +255,17 @@ struct MaterialSet : BigDNA
struct UVAnimation : BigDNA struct UVAnimation : BigDNA
{ {
Delete expl; Delete expl;
enum Mode : atUint32 enum class Mode
{ {
ANIM_MV_INV_NOTRANS, MvInvNoTranslation,
ANIM_MV_INV, MvInv,
ANIM_SCROLL, Scroll,
ANIM_ROTATION, Rotation,
ANIM_HSTRIP, HStrip,
ANIM_VSTRIP, VStrip,
ANIM_MODEL, Model,
ANIM_MODE_WHO_MUST_NOT_BE_NAMED, WhoMustNotBeNamed,
ANIM_MODE_8 Eight
} mode; } mode;
float vals[9]; float vals[9];
void read(Athena::io::IStreamReader& reader) void read(Athena::io::IStreamReader& reader)
@ -284,24 +273,24 @@ struct MaterialSet : BigDNA
mode = Mode(reader.readUint32Big()); mode = Mode(reader.readUint32Big());
switch (mode) switch (mode)
{ {
case ANIM_MV_INV_NOTRANS: case Mode::MvInvNoTranslation:
case ANIM_MV_INV: case Mode::MvInv:
case ANIM_MODEL: case Mode::Model:
break; break;
case ANIM_SCROLL: case Mode::Scroll:
case ANIM_HSTRIP: case Mode::HStrip:
case ANIM_VSTRIP: case Mode::VStrip:
vals[0] = reader.readFloatBig(); vals[0] = reader.readFloatBig();
vals[1] = reader.readFloatBig(); vals[1] = reader.readFloatBig();
vals[2] = reader.readFloatBig(); vals[2] = reader.readFloatBig();
vals[3] = reader.readFloatBig(); vals[3] = reader.readFloatBig();
break; break;
case ANIM_ROTATION: case Mode::Rotation:
case ANIM_MODE_WHO_MUST_NOT_BE_NAMED: case Mode::WhoMustNotBeNamed:
vals[0] = reader.readFloatBig(); vals[0] = reader.readFloatBig();
vals[1] = reader.readFloatBig(); vals[1] = reader.readFloatBig();
break; break;
case ANIM_MODE_8: case Mode::Eight:
vals[0] = reader.readFloatBig(); vals[0] = reader.readFloatBig();
vals[1] = reader.readFloatBig(); vals[1] = reader.readFloatBig();
vals[2] = reader.readFloatBig(); vals[2] = reader.readFloatBig();
@ -316,27 +305,27 @@ struct MaterialSet : BigDNA
} }
void write(Athena::io::IStreamWriter& writer) const void write(Athena::io::IStreamWriter& writer) const
{ {
writer.writeUint32Big(mode); writer.writeUint32Big(atUint32(mode));
switch (mode) switch (mode)
{ {
case ANIM_MV_INV_NOTRANS: case Mode::MvInvNoTranslation:
case ANIM_MV_INV: case Mode::MvInv:
case ANIM_MODEL: case Mode::Model:
break; break;
case ANIM_SCROLL: case Mode::Scroll:
case ANIM_HSTRIP: case Mode::HStrip:
case ANIM_VSTRIP: case Mode::VStrip:
writer.writeFloatBig(vals[0]); writer.writeFloatBig(vals[0]);
writer.writeFloatBig(vals[1]); writer.writeFloatBig(vals[1]);
writer.writeFloatBig(vals[2]); writer.writeFloatBig(vals[2]);
writer.writeFloatBig(vals[3]); writer.writeFloatBig(vals[3]);
break; break;
case ANIM_ROTATION: case Mode::Rotation:
case ANIM_MODE_WHO_MUST_NOT_BE_NAMED: case Mode::WhoMustNotBeNamed:
writer.writeFloatBig(vals[0]); writer.writeFloatBig(vals[0]);
writer.writeFloatBig(vals[1]); writer.writeFloatBig(vals[1]);
break; break;
case ANIM_MODE_8: case Mode::Eight:
writer.writeFloatBig(vals[0]); writer.writeFloatBig(vals[0]);
writer.writeFloatBig(vals[1]); writer.writeFloatBig(vals[1]);
writer.writeFloatBig(vals[2]); writer.writeFloatBig(vals[2]);
@ -353,18 +342,18 @@ struct MaterialSet : BigDNA
{ {
switch (mode) switch (mode)
{ {
case ANIM_MV_INV_NOTRANS: case Mode::MvInvNoTranslation:
case ANIM_MV_INV: case Mode::MvInv:
case ANIM_MODEL: case Mode::Model:
return __isz + 4; return __isz + 4;
case ANIM_SCROLL: case Mode::Scroll:
case ANIM_HSTRIP: case Mode::HStrip:
case ANIM_VSTRIP: case Mode::VStrip:
return __isz + 20; return __isz + 20;
case ANIM_ROTATION: case Mode::Rotation:
case ANIM_MODE_WHO_MUST_NOT_BE_NAMED: case Mode::WhoMustNotBeNamed:
return __isz + 12; return __isz + 12;
case ANIM_MODE_8: case Mode::Eight:
return __isz + 40; return __isz + 40;
} }
return __isz + 4; return __isz + 4;

View File

@ -11,11 +11,11 @@ namespace DNAMP1
struct DeafBabe : BigDNA struct DeafBabe : BigDNA
{ {
DECL_DNA DECL_DNA
enum BspNodeType : atUint32 enum class BspNodeType : atUint32
{ {
BspNodeInvalid, Invalid,
BspNodeBranch, Branch,
BspNodeLeaf Leaf
}; };
struct Material : BigDNA struct Material : BigDNA
@ -25,7 +25,7 @@ struct DeafBabe : BigDNA
bool fireThrough() const {return material >> 18 & 0x1;} bool fireThrough() const {return material >> 18 & 0x1;}
void setFireThrough(bool v) {material &= ~0x40000; material |= v << 18;} void setFireThrough(bool v) {material &= ~0x40000; material |= v << 18;}
enum Type enum class Type
{ {
Mat0, Mat0,
MatGround, MatGround,
@ -39,7 +39,7 @@ struct DeafBabe : BigDNA
MatLeaves MatLeaves
}; };
Type type() const {return Type(material & 0xff);} Type type() const {return Type(material & 0xff);}
void setType(Type t) {material &= ~0xff; material |= t;} void setType(Type t) {material &= ~0xff; material |= atUint32(t);}
}; };
struct Edge : BigDNA struct Edge : BigDNA

View File

@ -27,30 +27,30 @@ struct MAPA : BigDNA
struct MappableObject : BigDNA struct MappableObject : BigDNA
{ {
DECL_DNA DECL_DNA
enum Type : atUint32 enum class Type : atUint32
{ {
MOBlueDoor = 0, BlueDoor = 0,
MOShieldDoor = 1, ShieldDoor = 1,
MOIceDoor = 2, IceDoor = 2,
MOWaveDoor = 3, WaveDoor = 3,
MOPlasmaDoor = 4, PlasmaDoor = 4,
MOBigDoor1 = 5, BigDoor1 = 5,
MOBigDoor2 = 6, BigDoor2 = 6,
MOIceDoorCeiling = 7, IceDoorCeiling = 7,
MOIceDoorFloor = 8, IceDoorFloor = 8,
MOWaveDoorCeiling = 9, WaveDoorCeiling = 9,
MOWaveDoorFloor = 10, WaveDoorFloor = 10,
MOIceDoorFloor2 = 13, IceDoorFloor2 = 13,
MOWaveDoorFloor2 = 14, WaveDoorFloor2 = 14,
MODownArrowYellow = 27, /* Maintenance Tunnel */ DownArrowYellow = 27, /* Maintenance Tunnel */
MOUpArrowYellow = 28, /* Phazon Processing Center */ UpArrowYellow = 28, /* Phazon Processing Center */
MODownArrowGreen = 29, /* Elevator A */ DownArrowGreen = 29, /* Elevator A */
MOUpArrowGreen = 30, /* Elite Control Access */ UpArrowGreen = 30, /* Elite Control Access */
MODownArrowRed = 31, /* Elevator B */ DownArrowRed = 31, /* Elevator B */
MOUpArrowRed = 32, /* Fungal Hall Access */ UpArrowRed = 32, /* Fungal Hall Access */
MOTransportLift = 33, TransportLift = 33,
MOSaveStation = 34, SaveStation = 34,
MOMissileStation = 37 MissileStation = 37
}; };
Value<Type> type; Value<Type> type;
Value<atUint32> unknown1; Value<atUint32> unknown1;

View File

@ -68,7 +68,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Rename MREA for consistency */ /* Rename MREA for consistency */
HECL::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend")); HECL::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend"));
if (!force && mreaPath.getPathType() == HECL::ProjectPath::PT_FILE) if (!force && mreaPath.getPathType() == HECL::ProjectPath::Type::File)
return true; return true;
/* Do extract */ /* Do extract */
@ -77,7 +77,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
rs.seekAlign32(); rs.seekAlign32();
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(mreaPath, HECL::BlenderConnection::TypeArea)) if (!conn.createBlend(mreaPath, HECL::BlenderConnection::BlendType::Area))
return false; return false;
/* Open Py Stream and read sections */ /* Open Py Stream and read sections */

View File

@ -38,19 +38,19 @@ struct MREA
{ {
DECL_DNA DECL_DNA
Value<atUint32> flags; Value<atUint32> flags;
enum ThermalLevel enum class ThermalLevel
{ {
ThermalCool, Cool,
ThermalHot, Hot,
ThermalWarm Warm
}; };
static const char* GetThermalLevelStr(ThermalLevel t) static const char* GetThermalLevelStr(ThermalLevel t)
{ {
switch (t) switch (t)
{ {
case ThermalCool: return "COOL"; case ThermalLevel::Cool: return "COOL";
case ThermalHot: return "HOT"; case ThermalLevel::Hot: return "HOT";
case ThermalWarm: return "WARM"; case ThermalLevel::Warm: return "WARM";
default: break; default: break;
} }
return nullptr; return nullptr;
@ -62,7 +62,7 @@ struct MREA
bool disableXray() const {return flags >> 3 & 0x1;} bool disableXray() const {return flags >> 3 & 0x1;}
void setDisableXray(bool v) {flags &= ~0x8; flags |= v << 3;} void setDisableXray(bool v) {flags &= ~0x8; flags |= v << 3;}
ThermalLevel thermalLevel() const {return ThermalLevel(flags >> 4 & 0x3);} ThermalLevel thermalLevel() const {return ThermalLevel(flags >> 4 & 0x3);}
void setThermalLevel(ThermalLevel v) {flags &= ~0x30; flags |= v << 4;} void setThermalLevel(ThermalLevel v) {flags &= ~0x30; flags |= atUint32(v) << 4;}
const char* thermalLevelStr() const {return GetThermalLevelStr(thermalLevel());} const char* thermalLevelStr() const {return GetThermalLevelStr(thermalLevel());}
} visorFlags; } visorFlags;
Value<atVec4f> xfMtx[3]; Value<atVec4f> xfMtx[3];
@ -72,20 +72,20 @@ struct MREA
struct BabeDeadLight : BigDNA struct BabeDeadLight : BigDNA
{ {
DECL_DNA DECL_DNA
enum LightType : atUint32 enum class LightType : atUint32
{ {
LightLocalAmbient, LocalAmbient,
LightDirectional, Directional,
LightCustom, Custom,
LightSpot, Spot,
LightSpot2, Spot2,
LightLocalAmbient2 LocalAmbient2
}; };
enum Falloff : atUint32 enum class Falloff : atUint32
{ {
FalloffConstant, Constant,
FalloffLinear, Linear,
FalloffQuadratic Quadratic
}; };
Value<LightType> lightType; Value<LightType> lightType;
Value<atVec3f> color; Value<atVec3f> color;

View File

@ -16,11 +16,11 @@ struct SCAN : BigYAML
UniqueID32 frame; UniqueID32 frame;
UniqueID32 string; UniqueID32 string;
enum ScanSpeed enum class ScanSpeed : atUint32
{ Normal, Slow }; { Normal, Slow };
Value<ScanSpeed> scanSpeed; Value<ScanSpeed> scanSpeed;
enum Category enum class Category : atUint32
{ {
None, None,
SpacePirateData, SpacePirateData,
@ -38,7 +38,7 @@ struct SCAN : BigYAML
DECL_YAML DECL_YAML
UniqueID32 texture; UniqueID32 texture;
Value<float> appearanceRange; Value<float> appearanceRange;
enum Position enum class Position : atInt32
{ {
Pane0, Pane0,
Pane1, Pane1,

View File

@ -41,11 +41,11 @@ void SCLY::exportToLayerDirectories(const PAK::Entry& entry, PAKRouter<PAKBridge
for (atUint32 i = 0; i < layerCount; i++) for (atUint32 i = 0; i < layerCount; i++)
{ {
HECL::ProjectPath layerPath = pakRouter.getAreaLayerWorking(entry.id, i); HECL::ProjectPath layerPath = pakRouter.getAreaLayerWorking(entry.id, i);
if (layerPath.getPathType() == HECL::ProjectPath::PT_NONE) if (layerPath.getPathType() == HECL::ProjectPath::Type::None)
layerPath.makeDir(); layerPath.makeDir();
HECL::ProjectPath yamlFile = HECL::ProjectPath(layerPath, _S("objects.yaml")); HECL::ProjectPath yamlFile = HECL::ProjectPath(layerPath, _S("objects.yaml"));
if (force || yamlFile.getPathType() == HECL::ProjectPath::PT_NONE) if (force || yamlFile.getPathType() == HECL::ProjectPath::Type::None)
{ {
FILE* yaml = HECL::Fopen(yamlFile.getAbsolutePath().c_str(), _S("wb")); FILE* yaml = HECL::Fopen(yamlFile.getAbsolutePath().c_str(), _S("wb"));
layers[i].toYAMLFile(yaml); layers[i].toYAMLFile(yaml);

View File

@ -12,7 +12,7 @@ namespace DNAMP1
struct AreaAttributes : IScriptObject struct AreaAttributes : IScriptObject
{ {
DECL_YAML DECL_YAML
enum EWeatherType enum class EWeatherType : atUint32
{ {
None, None,
Snow, Snow,

View File

@ -9,82 +9,82 @@ namespace Retro
namespace DNAMP1 namespace DNAMP1
{ {
enum EPickupType enum class EPickupType : atUint32
{ {
PkPowerBeam, PowerBeam,
PkIceBeam, IceBeam,
PkWaveBeam, WaveBeam,
PkPlasmaBeam, PlasmaBeam,
PkMissile, Missile,
PkScanVisor, ScanVisor,
PkMorphBallBomb, MorphBallBomb,
PkPowerBomb, PowerBomb,
PkFlamethrower, Flamethrower,
PkChargeBeam, ChargeBeam,
PkXRayVisor, XRayVisor,
PkIceSpreader, IceSpreader,
PkSpaceJump, SpaceJump,
PkMorphBall, MorphBall,
PkCombatVisor, CombatVisor,
PkSpiderBall, SpiderBall,
PkPowerSuit, PowerSuit,
PkGravitySuit, GravitySuit,
PkVariaSuit, VariaSuit,
PkPhazonSuit, PhazonSuit,
PkEnergyTank, EnergyTank,
PkUnknownItem1, UnknownItem1,
PkHealthRefill, HealthRefill,
PkUnknownItem2, UnknownItem2,
PkWaveBuster, WaveBuster,
PkTruth, Truth,
PkStrength, Strength,
PkElder, Elder,
PkWild, Wild,
PkLifeGiver, LifeGiver,
PkWarrior, Warrior,
PkChozo, Chozo,
PkNature, Nature,
PkSun, Sun,
PkWorld, World,
PkSpirit, Spirit,
PkNewborn Newborn
}; };
enum ESpecialFunctionType enum class ESpecialFunctionType : atUint32
{ {
SpFnWhat, What,
SpFnPlayerFollowLocator, PlayerFollowLocator,
SpFnSpinnerController, SpinnerController,
SpFnObjectFollowLocator, ObjectFollowLocator,
SpFnFunction4, Function4,
SpFnInventoryActivator, InventoryActivator,
SpFnMapStation, MapStation,
SpFnSaveStation, SaveStation,
SpFnIntroBossRingController, IntroBossRingController,
SpFnViewFrustumTest, ViewFrustumTest,
SpFnShotSpinnerController, ShotSpinnerController,
SpFnEscapeSequence, EscapeSequence,
SpFnBossEnergyBar, BossEnergyBar,
SpFnEndGame, EndGame,
SpFnHUDFadeIn, HUDFadeIn,
SpFnCinematicSkip, CinematicSkip,
SpFnScriptLyaerController, ScriptLyaerController,
SpFnRainSimulator, RainSimulator,
SpFnAreaDamage, AreaDamage,
SpFnObjectFollowObject, ObjectFollowObject,
SpFnHintSystem, HintSystem,
SpFnDropBomb, DropBomb,
SpFnFunction22, Function22,
SpFnMissileStation, MissileStation,
SpFnBillboard, Billboard,
SpFnPlayerInAreaRelay, PlayerInAreaRelay,
SpFnHUDTarget, HUDTarget,
SpFnFogFader, FogFader,
SpFnEnterLogbook, EnterLogbook,
SpFnPowerBombStation, PowerBombStation,
SpFnEnding, Ending,
SpFnFusionRelay, FusionRelay,
SpFnWeaponSwitch // PAL Only WeaponSwitch // PAL Only
}; };
struct AnimationParameters : BigYAML struct AnimationParameters : BigYAML

View File

@ -220,25 +220,25 @@ struct ANCS : BigYAML
std::function<void(const HECL::SystemChar*)> fileChanged) std::function<void(const HECL::SystemChar*)> fileChanged)
{ {
HECL::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml")); HECL::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml"));
HECL::ProjectPath::PathType yamlType = yamlPath.getPathType(); HECL::ProjectPath::Type yamlType = yamlPath.getPathType();
HECL::ProjectPath blendPath = outPath.getWithExtension(_S(".blend")); HECL::ProjectPath blendPath = outPath.getWithExtension(_S(".blend"));
HECL::ProjectPath::PathType blendType = blendPath.getPathType(); HECL::ProjectPath::Type blendType = blendPath.getPathType();
if (force || if (force ||
yamlType == HECL::ProjectPath::PT_NONE || yamlType == HECL::ProjectPath::Type::None ||
blendType == HECL::ProjectPath::PT_NONE) blendType == HECL::ProjectPath::Type::None)
{ {
ANCS ancs; ANCS ancs;
ancs.read(rs); ancs.read(rs);
if (force || yamlType == HECL::ProjectPath::PT_NONE) if (force || yamlType == HECL::ProjectPath::Type::None)
{ {
FILE* fp = HECL::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb")); FILE* fp = HECL::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb"));
ancs.toYAMLFile(fp); ancs.toYAMLFile(fp);
fclose(fp); fclose(fp);
} }
if (force || blendType == HECL::ProjectPath::PT_NONE) if (force || blendType == HECL::ProjectPath::Type::None)
{ {
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
DNAANCS::ReadANCSToBlender<PAKRouter<PAKBridge>, ANCS, MaterialSet, DNACMDL::SurfaceHeader_1_2, 4> DNAANCS::ReadANCSToBlender<PAKRouter<PAKBridge>, ANCS, MaterialSet, DNACMDL::SurfaceHeader_1_2, 4>

View File

@ -60,7 +60,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co
for (int c=0 ; c<4 ; ++c) for (int c=0 ; c<4 ; ++c)
{ {
auto frameit = frames.begin(); auto frameit = frames.begin();
ao.changeCurve(ANIMOutStream::CurveType::CurveRotate, c, rotKeys.size()); ao.changeCurve(ANIMOutStream::CurveType::Rotate, c, rotKeys.size());
for (const DNAANIM::Value& val : rotKeys) for (const DNAANIM::Value& val : rotKeys)
ao.write(*frameit++, val.v4.vec[c]); ao.write(*frameit++, val.v4.vec[c]);
} }
@ -72,7 +72,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co
for (int c=0 ; c<3 ; ++c) for (int c=0 ; c<3 ; ++c)
{ {
auto frameit = frames.begin(); auto frameit = frames.begin();
ao.changeCurve(ANIMOutStream::CurveType::CurveTranslate, c, transKeys.size()); ao.changeCurve(ANIMOutStream::CurveType::Translate, c, transKeys.size());
for (const DNAANIM::Value& val : transKeys) for (const DNAANIM::Value& val : transKeys)
ao.write(*frameit++, val.v3.vec[c]); ao.write(*frameit++, val.v3.vec[c]);
} }
@ -84,7 +84,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co
for (int c=0 ; c<3 ; ++c) for (int c=0 ; c<3 ; ++c)
{ {
auto frameit = frames.begin(); auto frameit = frames.begin();
ao.changeCurve(ANIMOutStream::CurveType::CurveScale, c, scaleKeys.size()); ao.changeCurve(ANIMOutStream::CurveType::Scale, c, scaleKeys.size());
for (const DNAANIM::Value& val : scaleKeys) for (const DNAANIM::Value& val : scaleKeys)
ao.write(*frameit++, val.v3.vec[c]); ao.write(*frameit++, val.v3.vec[c]);
} }
@ -147,21 +147,21 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader)
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION; chan.type = DNAANIM::Channel::Type::Rotation;
chanKeys.emplace_back(); chanKeys.emplace_back();
} }
if (std::get<1>(bone.second)) if (std::get<1>(bone.second))
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION; chan.type = DNAANIM::Channel::Type::Translation;
chanKeys.emplace_back(); chanKeys.emplace_back();
} }
if (std::get<2>(bone.second)) if (std::get<2>(bone.second))
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::SCALE; chan.type = DNAANIM::Channel::Type::Scale;
chanKeys.emplace_back(); chanKeys.emplace_back();
} }
} }
@ -405,7 +405,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION; chan.type = DNAANIM::Channel::Type::Rotation;
chan.i[0] = desc.initRX; chan.i[0] = desc.initRX;
chan.q[0] = desc.qRX; chan.q[0] = desc.qRX;
chan.i[1] = desc.initRY; chan.i[1] = desc.initRY;
@ -419,7 +419,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION; chan.type = DNAANIM::Channel::Type::Translation;
chan.i[0] = desc.initTX; chan.i[0] = desc.initTX;
chan.q[0] = desc.qTX; chan.q[0] = desc.qTX;
chan.i[1] = desc.initTY; chan.i[1] = desc.initTY;
@ -433,7 +433,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::SCALE; chan.type = DNAANIM::Channel::Type::Scale;
chan.i[0] = desc.initSX; chan.i[0] = desc.initSX;
chan.q[0] = desc.qSX; chan.q[0] = desc.qSX;
chan.i[1] = desc.initSY; chan.i[1] = desc.initSY;

View File

@ -38,7 +38,7 @@ struct CMDL
/* Do extract */ /* Do extract */
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(outPath, HECL::BlenderConnection::TypeMesh)) if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Mesh))
return false; return false;
DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, DNACMDL::SurfaceHeader_1_2, 4> DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, DNACMDL::SurfaceHeader_1_2, 4>
(conn, rs, pakRouter, entry, dataSpec, loadRp); (conn, rs, pakRouter, entry, dataSpec, loadRp);

View File

@ -38,7 +38,7 @@ struct MaterialSet : BigDNA
Vector<atUint32, DNA_COUNT(flags.konstValuesEnabled())> konstCount; Vector<atUint32, DNA_COUNT(flags.konstValuesEnabled())> konstCount;
Vector<GX::Color, DNA_COUNT(flags.konstValuesEnabled() ? konstCount[0] : 0)> konstColors; Vector<GX::Color, DNA_COUNT(flags.konstValuesEnabled() ? konstCount[0] : 0)> konstColors;
using BlendFactor = DNAMP1::MaterialSet::Material::BlendFactor; using BlendFactor = GX::BlendFactor;
Value<BlendFactor> blendDstFac; Value<BlendFactor> blendDstFac;
Value<BlendFactor> blendSrcFac; Value<BlendFactor> blendSrcFac;
Vector<atUint32, DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot; Vector<atUint32, DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot;

View File

@ -20,7 +20,7 @@ struct DeafBabe : BigDNA
bool fireThrough() const {return material >> 18 & 0x1;} bool fireThrough() const {return material >> 18 & 0x1;}
void setFireThrough(bool v) {material &= ~0x40000; material |= v << 18;} void setFireThrough(bool v) {material &= ~0x40000; material |= v << 18;}
enum Type enum class Type
{ {
Mat0, Mat0,
MatGround, MatGround,
@ -34,7 +34,7 @@ struct DeafBabe : BigDNA
MatLeaves MatLeaves
}; };
Type type() const {return Type(material & 0xff);} Type type() const {return Type(material & 0xff);}
void setType(Type t) {material &= ~0xff; material |= t;} void setType(Type t) {material &= ~0xff; material |= atUint64(t);}
}; };
using Edge = DNAMP1::DeafBabe::Edge; using Edge = DNAMP1::DeafBabe::Edge;

View File

@ -169,7 +169,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Rename MREA for consistency */ /* Rename MREA for consistency */
HECL::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend")); HECL::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend"));
if (!force && mreaPath.getPathType() == HECL::ProjectPath::PT_FILE) if (!force && mreaPath.getPathType() == HECL::ProjectPath::Type::File)
return true; return true;
/* Do extract */ /* Do extract */
@ -191,7 +191,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Start up blender connection */ /* Start up blender connection */
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(mreaPath, HECL::BlenderConnection::TypeArea)) if (!conn.createBlend(mreaPath, HECL::BlenderConnection::BlendType::Area))
return false; return false;
/* Open Py Stream and read sections */ /* Open Py Stream and read sections */

View File

@ -86,19 +86,19 @@ struct MREA
{ {
DECL_DNA DECL_DNA
Value<atUint32> flags; Value<atUint32> flags;
enum ThermalLevel enum class ThermalLevel
{ {
ThermalCool, Cool,
ThermalHot, Hot,
ThermalWarm Warm
}; };
static const char* GetThermalLevelStr(ThermalLevel t) static const char* GetThermalLevelStr(ThermalLevel t)
{ {
switch (t) switch (t)
{ {
case ThermalCool: return "COOL"; case ThermalLevel::Cool: return "COOL";
case ThermalHot: return "HOT"; case ThermalLevel::Hot: return "HOT";
case ThermalWarm: return "WARM"; case ThermalLevel::Warm: return "WARM";
default: break; default: break;
} }
return nullptr; return nullptr;
@ -110,7 +110,7 @@ struct MREA
bool disableXray() const {return flags >> 3 & 0x1;} bool disableXray() const {return flags >> 3 & 0x1;}
void setDisableXray(bool v) {flags &= ~0x8; flags |= v << 3;} void setDisableXray(bool v) {flags &= ~0x8; flags |= v << 3;}
ThermalLevel thermalLevel() const {return ThermalLevel(flags >> 4 & 0x3);} ThermalLevel thermalLevel() const {return ThermalLevel(flags >> 4 & 0x3);}
void setThermalLevel(ThermalLevel v) {flags &= ~0x30; flags |= v << 4;} void setThermalLevel(ThermalLevel v) {flags &= ~0x30; flags |= atUint32(v) << 4;}
const char* thermalLevelStr() const {return GetThermalLevelStr(thermalLevel());} const char* thermalLevelStr() const {return GetThermalLevelStr(thermalLevel());}
} visorFlags; } visorFlags;
Value<atVec4f> xfMtx[3]; Value<atVec4f> xfMtx[3];

View File

@ -77,7 +77,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co
for (int c=0 ; c<4 ; ++c) for (int c=0 ; c<4 ; ++c)
{ {
auto frameit = frames.begin(); auto frameit = frames.begin();
ao.changeCurve(ANIMOutStream::CurveType::CurveRotate, c, rotKeys.size()); ao.changeCurve(ANIMOutStream::CurveType::Rotate, c, rotKeys.size());
for (const DNAANIM::Value& val : rotKeys) for (const DNAANIM::Value& val : rotKeys)
ao.write(*frameit++, val.v4.vec[c]); ao.write(*frameit++, val.v4.vec[c]);
} }
@ -89,7 +89,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co
for (int c=0 ; c<3 ; ++c) for (int c=0 ; c<3 ; ++c)
{ {
auto frameit = frames.begin(); auto frameit = frames.begin();
ao.changeCurve(ANIMOutStream::CurveType::CurveTranslate, c, transKeys.size()); ao.changeCurve(ANIMOutStream::CurveType::Translate, c, transKeys.size());
for (const DNAANIM::Value& val : transKeys) for (const DNAANIM::Value& val : transKeys)
ao.write(*frameit++, val.v3.vec[c]); ao.write(*frameit++, val.v3.vec[c]);
} }
@ -101,7 +101,7 @@ void ANIM::IANIM::sendANIMToBlender(HECL::BlenderConnection::PyOutStream& os, co
for (int c=0 ; c<3 ; ++c) for (int c=0 ; c<3 ; ++c)
{ {
auto frameit = frames.begin(); auto frameit = frames.begin();
ao.changeCurve(ANIMOutStream::CurveType::CurveScale, c, scaleKeys.size()); ao.changeCurve(ANIMOutStream::CurveType::Scale, c, scaleKeys.size());
for (const DNAANIM::Value& val : scaleKeys) for (const DNAANIM::Value& val : scaleKeys)
ao.write(*frameit++, val.v3.vec[c]); ao.write(*frameit++, val.v3.vec[c]);
} }
@ -159,7 +159,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader)
channels.clear(); channels.clear();
chanKeys.clear(); chanKeys.clear();
channels.emplace_back(); channels.emplace_back();
channels.back().type = DNAANIM::Channel::KF_HEAD; channels.back().type = DNAANIM::Channel::Type::KfHead;
chanKeys.emplace_back(); chanKeys.emplace_back();
for (const std::pair<atUint32, std::tuple<bool,bool,bool>>& bone : bones) for (const std::pair<atUint32, std::tuple<bool,bool,bool>>& bone : bones)
{ {
@ -167,21 +167,21 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader)
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION; chan.type = DNAANIM::Channel::Type::Rotation;
chanKeys.emplace_back(); chanKeys.emplace_back();
} }
if (std::get<1>(bone.second)) if (std::get<1>(bone.second))
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION; chan.type = DNAANIM::Channel::Type::Translation;
chanKeys.emplace_back(); chanKeys.emplace_back();
} }
if (std::get<2>(bone.second)) if (std::get<2>(bone.second))
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::SCALE; chan.type = DNAANIM::Channel::Type::Scale;
chanKeys.emplace_back(); chanKeys.emplace_back();
} }
} }
@ -469,7 +469,7 @@ void ANIM::ANIM1::read(Athena::io::IStreamReader& reader)
channels.clear(); channels.clear();
channels.reserve(boneChannelCount + 1); channels.reserve(boneChannelCount + 1);
channels.emplace_back(); channels.emplace_back();
channels.back().type = DNAANIM::Channel::KF_HEAD; channels.back().type = DNAANIM::Channel::Type::KfHead;
auto initsIt = initBlock.begin(); auto initsIt = initBlock.begin();
auto bitsIt = chanBitCounts.begin(); auto bitsIt = chanBitCounts.begin();
for (const std::pair<atUint32, std::tuple<bool,bool,bool>>& bone : bones) for (const std::pair<atUint32, std::tuple<bool,bool,bool>>& bone : bones)
@ -478,7 +478,7 @@ void ANIM::ANIM1::read(Athena::io::IStreamReader& reader)
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION_MP3; chan.type = DNAANIM::Channel::Type::RotationMP3;
chan.i[0] = *initsIt++; chan.i[0] = *initsIt++;
chan.q[0] = *bitsIt++; chan.q[0] = *bitsIt++;
chan.i[1] = *initsIt++; chan.i[1] = *initsIt++;
@ -493,7 +493,7 @@ void ANIM::ANIM1::read(Athena::io::IStreamReader& reader)
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION; chan.type = DNAANIM::Channel::Type::Translation;
chan.i[0] = *initsIt++; chan.i[0] = *initsIt++;
chan.q[0] = *bitsIt++; chan.q[0] = *bitsIt++;
chan.i[1] = *initsIt++; chan.i[1] = *initsIt++;
@ -506,7 +506,7 @@ void ANIM::ANIM1::read(Athena::io::IStreamReader& reader)
{ {
channels.emplace_back(); channels.emplace_back();
DNAANIM::Channel& chan = channels.back(); DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::SCALE; chan.type = DNAANIM::Channel::Type::Scale;
chan.i[0] = *initsIt++; chan.i[0] = *initsIt++;
chan.q[0] = *bitsIt++; chan.q[0] = *bitsIt++;
chan.i[1] = *initsIt++; chan.i[1] = *initsIt++;

View File

@ -84,23 +84,23 @@ void CHAR::AnimationInfo::MetaAnimFactory::read(Athena::io::IStreamReader& reade
IMetaAnim::Type type(IMetaAnim::Type(reader.readUint32Big())); IMetaAnim::Type type(IMetaAnim::Type(reader.readUint32Big()));
switch (type) switch (type)
{ {
case IMetaAnim::MAPrimitive: case IMetaAnim::Type::Primitive:
m_anim.reset(new struct MetaAnimPrimitive); m_anim.reset(new struct MetaAnimPrimitive);
m_anim->read(reader); m_anim->read(reader);
break; break;
case IMetaAnim::MABlend: case IMetaAnim::Type::Blend:
m_anim.reset(new struct MetaAnimBlend); m_anim.reset(new struct MetaAnimBlend);
m_anim->read(reader); m_anim->read(reader);
break; break;
case IMetaAnim::MAPhaseBlend: case IMetaAnim::Type::PhaseBlend:
m_anim.reset(new struct MetaAnimPhaseBlend); m_anim.reset(new struct MetaAnimPhaseBlend);
m_anim->read(reader); m_anim->read(reader);
break; break;
case IMetaAnim::MARandom: case IMetaAnim::Type::Random:
m_anim.reset(new struct MetaAnimRandom); m_anim.reset(new struct MetaAnimRandom);
m_anim->read(reader); m_anim->read(reader);
break; break;
case IMetaAnim::MASequence: case IMetaAnim::Type::Sequence:
m_anim.reset(new struct MetaAnimSequence); m_anim.reset(new struct MetaAnimSequence);
m_anim->read(reader); m_anim->read(reader);
break; break;
@ -114,7 +114,7 @@ void CHAR::AnimationInfo::MetaAnimFactory::write(Athena::io::IStreamWriter& writ
{ {
if (!m_anim) if (!m_anim)
return; return;
writer.writeInt32Big(m_anim->m_type); writer.writeInt32Big(atInt32(m_anim->m_type));
m_anim->write(writer); m_anim->write(writer);
} }

View File

@ -131,13 +131,13 @@ struct CHAR : BigYAML
{ {
Delete expl; Delete expl;
virtual ~IMetaAnim() {} virtual ~IMetaAnim() {}
enum Type enum class Type
{ {
MAPrimitive = 0, Primitive = 0,
MABlend = 1, Blend = 1,
MAPhaseBlend = 2, PhaseBlend = 2,
MARandom = 3, Random = 3,
MASequence = 4 Sequence = 4
} m_type; } m_type;
const char* m_typeStr; const char* m_typeStr;
IMetaAnim(Type type, const char* typeStr) IMetaAnim(Type type, const char* typeStr)
@ -152,7 +152,7 @@ struct CHAR : BigYAML
}; };
struct MetaAnimPrimitive : IMetaAnim struct MetaAnimPrimitive : IMetaAnim
{ {
MetaAnimPrimitive() : IMetaAnim(MAPrimitive, "Primitive") {} MetaAnimPrimitive() : IMetaAnim(Type::Primitive, "Primitive") {}
DECL_YAML DECL_YAML
UniqueID64 animId; UniqueID64 animId;
Value<atUint32> animIdx; Value<atUint32> animIdx;
@ -167,7 +167,7 @@ struct CHAR : BigYAML
}; };
struct MetaAnimBlend : IMetaAnim struct MetaAnimBlend : IMetaAnim
{ {
MetaAnimBlend() : IMetaAnim(MABlend, "Blend") {} MetaAnimBlend() : IMetaAnim(Type::Blend, "Blend") {}
DECL_YAML DECL_YAML
MetaAnimFactory animA; MetaAnimFactory animA;
MetaAnimFactory animB; MetaAnimFactory animB;
@ -182,7 +182,7 @@ struct CHAR : BigYAML
}; };
struct MetaAnimPhaseBlend : IMetaAnim struct MetaAnimPhaseBlend : IMetaAnim
{ {
MetaAnimPhaseBlend() : IMetaAnim(MAPhaseBlend, "PhaseBlend") {} MetaAnimPhaseBlend() : IMetaAnim(Type::PhaseBlend, "PhaseBlend") {}
DECL_YAML DECL_YAML
MetaAnimFactory animA; MetaAnimFactory animA;
MetaAnimFactory animB; MetaAnimFactory animB;
@ -197,7 +197,7 @@ struct CHAR : BigYAML
}; };
struct MetaAnimRandom : IMetaAnim struct MetaAnimRandom : IMetaAnim
{ {
MetaAnimRandom() : IMetaAnim(MARandom, "Random") {} MetaAnimRandom() : IMetaAnim(Type::Random, "Random") {}
DECL_YAML DECL_YAML
Value<atUint32> animCount; Value<atUint32> animCount;
struct Child : BigYAML struct Child : BigYAML
@ -216,7 +216,7 @@ struct CHAR : BigYAML
}; };
struct MetaAnimSequence : IMetaAnim struct MetaAnimSequence : IMetaAnim
{ {
MetaAnimSequence() : IMetaAnim(MASequence, "Sequence") {} MetaAnimSequence() : IMetaAnim(Type::Sequence, "Sequence") {}
DECL_YAML DECL_YAML
Value<atUint32> animCount; Value<atUint32> animCount;
Vector<MetaAnimFactory, DNA_COUNT(animCount)> children; Vector<MetaAnimFactory, DNA_COUNT(animCount)> children;
@ -315,25 +315,25 @@ struct CHAR : BigYAML
std::function<void(const HECL::SystemChar*)> fileChanged) std::function<void(const HECL::SystemChar*)> fileChanged)
{ {
HECL::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml")); HECL::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml"));
HECL::ProjectPath::PathType yamlType = yamlPath.getPathType(); HECL::ProjectPath::Type yamlType = yamlPath.getPathType();
HECL::ProjectPath blendPath = outPath.getWithExtension(_S(".blend")); HECL::ProjectPath blendPath = outPath.getWithExtension(_S(".blend"));
HECL::ProjectPath::PathType blendType = blendPath.getPathType(); HECL::ProjectPath::Type blendType = blendPath.getPathType();
if (force || if (force ||
yamlType == HECL::ProjectPath::PT_NONE || yamlType == HECL::ProjectPath::Type::None ||
blendType == HECL::ProjectPath::PT_NONE) blendType == HECL::ProjectPath::Type::None)
{ {
CHAR aChar; CHAR aChar;
aChar.read(rs); aChar.read(rs);
if (force || yamlType == HECL::ProjectPath::PT_NONE) if (force || yamlType == HECL::ProjectPath::Type::None)
{ {
FILE* fp = HECL::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb")); FILE* fp = HECL::Fopen(yamlPath.getAbsolutePath().c_str(), _S("wb"));
aChar.toYAMLFile(fp); aChar.toYAMLFile(fp);
fclose(fp); fclose(fp);
} }
if (force || blendType == HECL::ProjectPath::PT_NONE) if (force || blendType == HECL::ProjectPath::Type::None)
{ {
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
DNAANCS::ReadANCSToBlender<PAKRouter<PAKBridge>, CHAR, MaterialSet, DNACMDL::SurfaceHeader_3, 4> DNAANCS::ReadANCSToBlender<PAKRouter<PAKBridge>, CHAR, MaterialSet, DNACMDL::SurfaceHeader_3, 4>

View File

@ -38,7 +38,7 @@ struct CMDL
/* Do extract */ /* Do extract */
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(outPath, HECL::BlenderConnection::TypeMesh)) if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Mesh))
return false; return false;
DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, DNACMDL::SurfaceHeader_3, 5> DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, DNACMDL::SurfaceHeader_3, 5>
(conn, rs, pakRouter, entry, dataSpec, loadRp); (conn, rs, pakRouter, entry, dataSpec, loadRp);

View File

@ -90,7 +90,7 @@ void MaterialSet::ConstructMaterial(Stream& out,
{ {
factory.section->constructNode(out, pakRouter, entry, prevSection, i++, texMapIdx, texMtxIdx, kColorIdx); factory.section->constructNode(out, pakRouter, entry, prevSection, i++, texMapIdx, texMtxIdx, kColorIdx);
Material::SectionPASS* pass = dynamic_cast<Material::SectionPASS*>(factory.section.get()); Material::SectionPASS* pass = dynamic_cast<Material::SectionPASS*>(factory.section.get());
if (!pass || (pass && pass->subtype.toUint32() != Material::SectionPASS::RFLV)) if (!pass || (pass && Material::SectionPASS::Subtype(pass->subtype.toUint32()) != Material::SectionPASS::Subtype::RFLV))
prevSection = factory.section.get(); prevSection = factory.section.get();
} }
@ -119,7 +119,7 @@ void Material::SectionPASS::constructNode(HECL::BlenderConnection::PyOutStream&
const NOD::Node* node; const NOD::Node* node;
const PAK::Entry* texEntry = pakRouter.lookupEntry(txtrId, &node); const PAK::Entry* texEntry = pakRouter.lookupEntry(txtrId, &node);
HECL::ProjectPath txtrPath = pakRouter.getWorking(texEntry); HECL::ProjectPath txtrPath = pakRouter.getWorking(texEntry);
if (txtrPath.getPathType() == HECL::ProjectPath::PT_NONE) if (txtrPath.getPathType() == HECL::ProjectPath::Type::None)
{ {
PAKEntryReadStream rs = texEntry->beginReadStream(*node); PAKEntryReadStream rs = texEntry->beginReadStream(*node);
TXTR::Extract(rs, txtrPath); TXTR::Extract(rs, txtrPath);
@ -148,7 +148,7 @@ void Material::SectionPASS::constructNode(HECL::BlenderConnection::PyOutStream&
} }
/* Special case for RFLV (environment UV mask) */ /* Special case for RFLV (environment UV mask) */
if (subtype.toUint32() == RFLV) if (Subtype(subtype.toUint32()) == Subtype::RFLV)
{ {
if (txtrId) if (txtrId)
out << "rflv_tex_node = texture_nodes[-1]\n"; out << "rflv_tex_node = texture_nodes[-1]\n";
@ -159,63 +159,63 @@ void Material::SectionPASS::constructNode(HECL::BlenderConnection::PyOutStream&
bool linkRAS = false; bool linkRAS = false;
out << "prev_pnode = pnode\n" out << "prev_pnode = pnode\n"
"pnode = new_nodetree.nodes.new('ShaderNodeGroup')\n"; "pnode = new_nodetree.nodes.new('ShaderNodeGroup')\n";
switch (subtype) switch (Subtype(subtype.toUint32()))
{ {
case DIFF: case Subtype::DIFF:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassDIFF']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassDIFF']\n";
linkRAS = true; linkRAS = true;
break; break;
case RIML: case Subtype::RIML:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassRIML']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassRIML']\n";
if (idx == 0) if (idx == 0)
linkRAS = true; linkRAS = true;
break; break;
case BLOL: case Subtype::BLOL:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassBLOL']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassBLOL']\n";
if (idx == 0) if (idx == 0)
linkRAS = true; linkRAS = true;
break; break;
case BLOD: case Subtype::BLOD:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassBLOD']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassBLOD']\n";
if (idx == 0) if (idx == 0)
linkRAS = true; linkRAS = true;
break; break;
case CLR: case Subtype::CLR:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassCLR']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassCLR']\n";
if (idx == 0) if (idx == 0)
linkRAS = true; linkRAS = true;
break; break;
case TRAN: case Subtype::TRAN:
if (flags.TRANInvert()) if (flags.TRANInvert())
out << "pnode.node_tree = bpy.data.node_groups['RetroPassTRANInv']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassTRANInv']\n";
else else
out << "pnode.node_tree = bpy.data.node_groups['RetroPassTRAN']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassTRAN']\n";
break; break;
case INCA: case Subtype::INCA:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassINCA']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassINCA']\n";
break; break;
case RFLV: case Subtype::RFLV:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassRFLV']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassRFLV']\n";
break; break;
case RFLD: case Subtype::RFLD:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassRFLD']\n" out << "pnode.node_tree = bpy.data.node_groups['RetroPassRFLD']\n"
"if rflv_tex_node:\n" "if rflv_tex_node:\n"
" new_nodetree.links.new(rflv_tex_node.outputs['Color'], pnode.inputs['Mask Color'])\n" " new_nodetree.links.new(rflv_tex_node.outputs['Color'], pnode.inputs['Mask Color'])\n"
" new_nodetree.links.new(rflv_tex_node.outputs['Value'], pnode.inputs['Mask Alpha'])\n"; " new_nodetree.links.new(rflv_tex_node.outputs['Value'], pnode.inputs['Mask Alpha'])\n";
break; break;
case LRLD: case Subtype::LRLD:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassLRLD']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassLRLD']\n";
break; break;
case LURD: case Subtype::LURD:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassLURD']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassLURD']\n";
break; break;
case BLOI: case Subtype::BLOI:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassBLOI']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassBLOI']\n";
break; break;
case XRAY: case Subtype::XRAY:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassXRAY']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassXRAY']\n";
break; break;
case TOON: case Subtype::TOON:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassTOON']\n"; out << "pnode.node_tree = bpy.data.node_groups['RetroPassTOON']\n";
break; break;
default: break; default: break;
@ -233,11 +233,11 @@ void Material::SectionPASS::constructNode(HECL::BlenderConnection::PyOutStream&
"new_nodetree.links.new(material_node.outputs['Alpha'], pnode.inputs['Prev Alpha'])\n"; "new_nodetree.links.new(material_node.outputs['Alpha'], pnode.inputs['Prev Alpha'])\n";
else if (prevSection) else if (prevSection)
{ {
if (prevSection->m_type == ISection::PASS && if (prevSection->m_type == ISection::Type::PASS &&
static_cast<const SectionPASS*>(prevSection)->subtype.toUint32() != RFLV) Subtype(static_cast<const SectionPASS*>(prevSection)->subtype.toUint32()) != Subtype::RFLV)
out << "new_nodetree.links.new(prev_pnode.outputs['Next Color'], pnode.inputs['Prev Color'])\n" out << "new_nodetree.links.new(prev_pnode.outputs['Next Color'], pnode.inputs['Prev Color'])\n"
"new_nodetree.links.new(prev_pnode.outputs['Next Alpha'], pnode.inputs['Prev Alpha'])\n"; "new_nodetree.links.new(prev_pnode.outputs['Next Alpha'], pnode.inputs['Prev Alpha'])\n";
else if (prevSection->m_type == ISection::CLR) else if (prevSection->m_type == ISection::Type::CLR)
out << "new_nodetree.links.new(kcolor_nodes[-1][0].outputs[0], pnode.inputs['Prev Color'])\n" out << "new_nodetree.links.new(kcolor_nodes[-1][0].outputs[0], pnode.inputs['Prev Color'])\n"
"new_nodetree.links.new(kcolor_nodes[-1][1].outputs[0], pnode.inputs['Prev Alpha'])\n"; "new_nodetree.links.new(kcolor_nodes[-1][1].outputs[0], pnode.inputs['Prev Alpha'])\n";
} }
@ -256,9 +256,9 @@ void Material::SectionCLR::constructNode(HECL::BlenderConnection::PyOutStream& o
unsigned& kColorIdx) const unsigned& kColorIdx) const
{ {
DNAMP1::MaterialSet::Material::AddKcolor(out, color, kColorIdx++); DNAMP1::MaterialSet::Material::AddKcolor(out, color, kColorIdx++);
switch (subtype) switch (Subtype(subtype.toUint32()))
{ {
case DIFB: case Subtype::DIFB:
out << "kc_node.label += ' DIFB'\n" out << "kc_node.label += ' DIFB'\n"
"ka_node.label += ' DIFB'\n"; "ka_node.label += ' DIFB'\n";
break; break;
@ -275,21 +275,21 @@ void Material::SectionINT::constructNode(HECL::BlenderConnection::PyOutStream& o
unsigned& texMtxIdx, unsigned& texMtxIdx,
unsigned& kColorIdx) const unsigned& kColorIdx) const
{ {
switch (subtype) switch (Subtype(subtype.toUint32()))
{ {
case OPAC: case Subtype::OPAC:
out.format("new_material.retro_opac = %d\n", value); out.format("new_material.retro_opac = %d\n", value);
break; break;
case BLOD: case Subtype::BLOD:
out.format("new_material.retro_blod = %d\n", value); out.format("new_material.retro_blod = %d\n", value);
break; break;
case BLOI: case Subtype::BLOI:
out.format("new_material.retro_bloi = %d\n", value); out.format("new_material.retro_bloi = %d\n", value);
break; break;
case BNIF: case Subtype::BNIF:
out.format("new_material.retro_bnif = %d\n", value); out.format("new_material.retro_bnif = %d\n", value);
break; break;
case XRBR: case Subtype::XRBR:
out.format("new_material.retro_xrbr = %d\n", value); out.format("new_material.retro_xrbr = %d\n", value);
break; break;
default: break; default: break;

View File

@ -57,7 +57,7 @@ struct MaterialSet : BigDNA
struct ISection : BigDNA struct ISection : BigDNA
{ {
Delete expl; Delete expl;
enum Type enum class Type : atUint32
{ {
PASS = SBIG('PASS'), PASS = SBIG('PASS'),
CLR = SBIG('CLR '), CLR = SBIG('CLR '),
@ -75,10 +75,10 @@ struct MaterialSet : BigDNA
}; };
struct SectionPASS : ISection struct SectionPASS : ISection
{ {
SectionPASS() : ISection(ISection::PASS) {} SectionPASS() : ISection(ISection::Type::PASS) {}
DECL_DNA DECL_DNA
Value<atUint32> size; Value<atUint32> size;
enum Subtype enum class Subtype : atUint32
{ {
DIFF = SBIG('DIFF'), DIFF = SBIG('DIFF'),
RIML = SBIG('RIML'), RIML = SBIG('RIML'),
@ -126,9 +126,9 @@ struct MaterialSet : BigDNA
}; };
struct SectionCLR : ISection struct SectionCLR : ISection
{ {
SectionCLR() : ISection(ISection::CLR) {} SectionCLR() : ISection(ISection::Type::CLR) {}
DECL_DNA DECL_DNA
enum Subtype enum class Subtype : atUint32
{ {
CLR = SBIG('CLR '), CLR = SBIG('CLR '),
DIFB = SBIG('DIFB') DIFB = SBIG('DIFB')
@ -147,9 +147,9 @@ struct MaterialSet : BigDNA
}; };
struct SectionINT : ISection struct SectionINT : ISection
{ {
SectionINT() : ISection(ISection::INT) {} SectionINT() : ISection(ISection::Type::INT) {}
DECL_DNA DECL_DNA
enum Subtype enum class Subtype : atUint32
{ {
OPAC = SBIG('OPAC'), OPAC = SBIG('OPAC'),
BLOD = SBIG('BLOD'), BLOD = SBIG('BLOD'),
@ -177,17 +177,17 @@ struct MaterialSet : BigDNA
{ {
DNAFourCC type; DNAFourCC type;
type.read(reader); type.read(reader);
switch (type) switch (ISection::Type(type.toUint32()))
{ {
case ISection::PASS: case ISection::Type::PASS:
section.reset(new struct SectionPASS); section.reset(new struct SectionPASS);
section->read(reader); section->read(reader);
break; break;
case ISection::CLR: case ISection::Type::CLR:
section.reset(new struct SectionCLR); section.reset(new struct SectionCLR);
section->read(reader); section->read(reader);
break; break;
case ISection::INT: case ISection::Type::INT:
section.reset(new struct SectionINT); section.reset(new struct SectionINT);
section->read(reader); section->read(reader);
break; break;

View File

@ -79,7 +79,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Rename MREA for consistency */ /* Rename MREA for consistency */
HECL::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend")); HECL::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend"));
if (!force && mreaPath.getPathType() == HECL::ProjectPath::PT_FILE) if (!force && mreaPath.getPathType() == HECL::ProjectPath::Type::File)
return true; return true;
/* Do extract */ /* Do extract */
@ -104,7 +104,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Start up blender connection */ /* Start up blender connection */
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(mreaPath, HECL::BlenderConnection::TypeArea)) if (!conn.createBlend(mreaPath, HECL::BlenderConnection::BlendType::Area))
return false; return false;
/* Open Py Stream and read sections */ /* Open Py Stream and read sections */

View File

@ -80,20 +80,20 @@ struct MREA
struct BabeDeadLight : BigDNA struct BabeDeadLight : BigDNA
{ {
DECL_DNA DECL_DNA
enum LightType : atUint32 enum class LightType : atUint32
{ {
LightLocalAmbient, LocalAmbient,
LightDirectional, Directional,
LightCustom, Custom,
LightSpot, Spot,
LightSpot2, Spot2,
LightLocalAmbient2 LocalAmbient2
}; };
enum Falloff : atUint32 enum class Falloff : atUint32
{ {
FalloffConstant, Constant,
FalloffLinear, Linear,
FalloffQuadratic Quadratic
}; };
Value<LightType> lightType; Value<LightType> lightType;
Value<atVec4f> color; Value<atVec4f> color;

View File

@ -84,7 +84,7 @@ void SpecBase::doExtract(const ExtractPassInfo& info, FProgress progress)
NOD::Partition* data = m_disc->getDataPartition(); NOD::Partition* data = m_disc->getDataPartition();
const NOD::Node& root = data->getFSTRoot(); const NOD::Node& root = data->getFSTRoot();
for (const NOD::Node& child : root) for (const NOD::Node& child : root)
if (child.getKind() == NOD::Node::NODE_FILE) if (child.getKind() == NOD::Node::Kind::File)
child.extractToDirectory(target, ctx); child.extractToDirectory(target, ctx);
progress(_S("Trilogy Files"), _S(""), 1, 1.0); progress(_S("Trilogy Files"), _S(""), 1, 1.0);
} }
@ -101,7 +101,7 @@ bool SpecBase::canCook(const HECL::ProjectPath& path)
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.openBlend(path)) if (!conn.openBlend(path))
return false; return false;
if (conn.getBlendType() != HECL::BlenderConnection::TypeNone) if (conn.getBlendType() != HECL::BlenderConnection::BlendType::None)
return true; return true;
} }
else if (HECL::IsPathPNG(path)) else if (HECL::IsPathPNG(path))
@ -129,19 +129,19 @@ void SpecBase::doCook(const HECL::ProjectPath& path, const HECL::ProjectPath& co
return; return;
switch (conn.getBlendType()) switch (conn.getBlendType())
{ {
case HECL::BlenderConnection::TypeMesh: case HECL::BlenderConnection::BlendType::Mesh:
{ {
HECL::BlenderConnection::DataStream ds = conn.beginData(); HECL::BlenderConnection::DataStream ds = conn.beginData();
cookMesh(cookedPath, path, ds, fast, progress); cookMesh(cookedPath, path, ds, fast, progress);
break; break;
} }
case HECL::BlenderConnection::TypeActor: case HECL::BlenderConnection::BlendType::Actor:
{ {
HECL::BlenderConnection::DataStream ds = conn.beginData(); HECL::BlenderConnection::DataStream ds = conn.beginData();
cookActor(cookedPath, path, ds, fast, progress); cookActor(cookedPath, path, ds, fast, progress);
break; break;
} }
case HECL::BlenderConnection::TypeArea: case HECL::BlenderConnection::BlendType::Area:
{ {
HECL::BlenderConnection::DataStream ds = conn.beginData(); HECL::BlenderConnection::DataStream ds = conn.beginData();
cookArea(cookedPath, path, ds, fast, progress); cookArea(cookedPath, path, ds, fast, progress);

View File

@ -289,7 +289,7 @@ struct SpecMP1 : SpecBase
void cookMesh(const HECL::ProjectPath& out, const HECL::ProjectPath& in, void cookMesh(const HECL::ProjectPath& out, const HECL::ProjectPath& in,
BlendStream& ds, bool fast, FCookProgress progress) const BlendStream& ds, bool fast, FCookProgress progress) const
{ {
Mesh mesh = ds.compileMesh(fast ? HECL::TopologyTriangles : HECL::TopologyTriStrips, -1, Mesh mesh = ds.compileMesh(fast ? HECL::HMDLTopology::Triangles : HECL::HMDLTopology::TriStrips, -1,
[&progress](int surfCount) [&progress](int surfCount)
{ {
progress(HECL::SysFormat(_S("%d"), surfCount).c_str()); progress(HECL::SysFormat(_S("%d"), surfCount).c_str());

56
Editor/main.cpp Normal file
View File

@ -0,0 +1,56 @@
#include <LogVisor/LogVisor.hpp>
#include <boo/boo.hpp>
#include <Specter/Specter.hpp>
namespace RUDE
{
struct Application : boo::IApplicationCallback
{
boo::IWindow* m_mainWindow;
int appMain(boo::IApplication* app)
{
m_mainWindow = app->newWindow(_S("RUDE"));
return 0;
}
void appQuitting(boo::IApplication*)
{
}
void appFilesOpen(boo::IApplication*, const std::vector<boo::SystemString>&)
{
}
};
}
#if _WIN32
int wmain(int argc, const boo::SystemChar** argv)
#else
int main(int argc, const boo::SystemChar** argv)
#endif
{
LogVisor::RegisterConsoleLogger();
RUDE::Application appCb;
int ret = ApplicationRun(boo::IApplication::EPlatformType::Auto,
appCb, _S("rude"), _S("RUDE"), argc, argv);
printf("IM DYING!!\n");
return ret;
}
#if _WIN32
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int)
{
int argc = 0;
const boo::SystemChar** argv = (const wchar_t**)(CommandLineToArgvW(lpCmdLine, &argc));
static boo::SystemChar selfPath[1024];
GetModuleFileNameW(nullptr, selfPath, 1024);
static const boo::SystemChar* booArgv[32] = {};
booArgv[0] = selfPath;
for (int i=0 ; i<argc ; ++i)
booArgv[i+1] = argv[i];
LogVisor::CreateWin32Console();
return wmain(argc+1, booArgv);
}
#endif

@ -1 +1 @@
Subproject commit fca8742f99a012d4681fa622707d92dfa6152c87 Subproject commit b757bcd36815ec038b325e203c6d4787086998ae

2
NODLib

@ -1 +1 @@
Subproject commit 3bbfad76f91359a829bade0b8b2a8be238caa403 Subproject commit 168ff506a33ebe72483e1f718d032fe7edf7f840

View File

@ -12,7 +12,7 @@ public:
CAudioStateWin() : CIOWin("CAudioStateWin") {} CAudioStateWin() : CIOWin("CAudioStateWin") {}
CIOWin::EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) CIOWin::EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{ {
return MsgRetNormal; return EMessageReturn::Normal;
} }
}; };

View File

@ -12,11 +12,11 @@ namespace Retro
class CSfxManager class CSfxManager
{ {
enum ESfxChannels enum class ESfxChannels
{ {
}; };
enum ESfxAudibility enum class ESfxAudibility
{ {
Aud0, Aud0,
Aud1, Aud1,

View File

@ -7,12 +7,12 @@
namespace Retro namespace Retro
{ {
enum ECollisionResponseType enum class ECollisionResponseType
{ {
CR_Unknown12 = 0xC, Unknown12 = 0xC,
}; };
enum EMaterialTypes enum class EMaterialTypes
{ {
}; };
@ -24,7 +24,7 @@ class CWeaponMode;
class CActor : public CEntity class CActor : public CEntity
{ {
protected: protected:
enum Flags enum class Flags
{ {
Unknown5 = (1 << 5), Unknown5 = (1 << 5),
Unknown6 = (1 << 6), Unknown6 = (1 << 6),
@ -55,7 +55,7 @@ public:
virtual Zeus::CVector3f GetOrbitPosition() virtual Zeus::CVector3f GetOrbitPosition()
{ return Zeus::CVector3f(x40_unknown, x50_unknown, x60_unknown); } { return Zeus::CVector3f(x40_unknown, x50_unknown, x60_unknown); }
virtual ECollisionResponseType GetCollisionResponseType(const Zeus::CVector3f&, const Zeus::CVector3f&, CWeaponMode&, int) { return CR_Unknown12; } virtual ECollisionResponseType GetCollisionResponseType(const Zeus::CVector3f&, const Zeus::CVector3f&, CWeaponMode&, int) { return ECollisionResponseType::Unknown12; }
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){} void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){}
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){ } void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&){ }
void RemoveMaterial(EMaterialTypes, EMaterialTypes, CStateManager&){ } void RemoveMaterial(EMaterialTypes, EMaterialTypes, CStateManager&){ }

View File

@ -13,11 +13,11 @@ namespace Retro
{ {
/* TODO: Figure out what all this is for and move it somewhere appropriate */ /* TODO: Figure out what all this is for and move it somewhere appropriate */
enum EStateMsg enum class EStateMsg
{ {
}; };
enum EListenNoiseType enum class EListenNoiseType
{ {
}; };

View File

@ -9,25 +9,25 @@ namespace Retro
{ {
class CIOWin; class CIOWin;
enum EArchMsgTarget enum class EArchMsgTarget
{ {
TargetIOWinManager = 0, IOWinManager = 0,
TargetGame = 1 Game = 1
}; };
enum EArchMsgType enum class EArchMsgType
{ {
MsgRemoveIOWin = 0, RemoveIOWin = 0,
MsgCreateIOWin = 1, CreateIOWin = 1,
MsgChangeIOWinPriority = 2, ChangeIOWinPriority = 2,
MsgRemoveAllIOWins = 3, RemoveAllIOWins = 3,
MsgTimerTick = 4, TimerTick = 4,
MsgUserInput = 5, UserInput = 5,
MsgSetGameState = 6, SetGameState = 6,
MsgControllerStatus = 7, ControllerStatus = 7,
MsgQuitGameplay = 8, QuitGameplay = 8,
MsgUpdateBegin = 10, UpdateBegin = 10,
MsgFrameBegin = 11, FrameBegin = 11,
}; };
struct IArchMsgParm struct IArchMsgParm
@ -101,11 +101,11 @@ class MakeMsg
public: public:
static CArchitectureMessage CreateQuitGameplay(EArchMsgTarget target) static CArchitectureMessage CreateQuitGameplay(EArchMsgTarget target)
{ {
return CArchitectureMessage(target, MsgQuitGameplay, new CArchMsgParmNull()); return CArchitectureMessage(target, EArchMsgType::QuitGameplay, new CArchMsgParmNull());
} }
static CArchitectureMessage CreateControllerStatus(EArchMsgTarget target, u16 a, bool b) static CArchitectureMessage CreateControllerStatus(EArchMsgTarget target, u16 a, bool b)
{ {
return CArchitectureMessage(target, MsgControllerStatus, new CArchMsgParmControllerStatus(a, b)); return CArchitectureMessage(target, EArchMsgType::ControllerStatus, new CArchMsgParmControllerStatus(a, b));
} }
static const CArchMsgParmInt32& GetParmNewGameflowState(const CArchitectureMessage& msg) static const CArchMsgParmInt32& GetParmNewGameflowState(const CArchitectureMessage& msg)
{ {
@ -117,7 +117,7 @@ public:
} }
static CArchitectureMessage CreateUserInput(EArchMsgTarget target, const CFinalInput& input) static CArchitectureMessage CreateUserInput(EArchMsgTarget target, const CFinalInput& input)
{ {
return CArchitectureMessage(target, MsgUserInput, new CArchMsgParmUserInput(input)); return CArchitectureMessage(target, EArchMsgType::UserInput, new CArchMsgParmUserInput(input));
} }
static const CArchMsgParmReal32& GetParmTimerTick(const CArchitectureMessage& msg) static const CArchMsgParmReal32& GetParmTimerTick(const CArchitectureMessage& msg)
{ {
@ -125,7 +125,7 @@ public:
} }
static CArchitectureMessage CreateTimerTick(EArchMsgTarget target, float val) static CArchitectureMessage CreateTimerTick(EArchMsgTarget target, float val)
{ {
return CArchitectureMessage(target, MsgTimerTick, new CArchMsgParmReal32(val)); return CArchitectureMessage(target, EArchMsgType::TimerTick, new CArchMsgParmReal32(val));
} }
static const CArchMsgParmInt32Int32VoidPtr& GetParmChangeIOWinPriority(const CArchitectureMessage& msg) static const CArchMsgParmInt32Int32VoidPtr& GetParmChangeIOWinPriority(const CArchitectureMessage& msg)
{ {
@ -137,7 +137,7 @@ public:
} }
static CArchitectureMessage CreateCreateIOWin(EArchMsgTarget target, int pmin, int pmax, CIOWin* iowin) static CArchitectureMessage CreateCreateIOWin(EArchMsgTarget target, int pmin, int pmax, CIOWin* iowin)
{ {
return CArchitectureMessage(target, MsgCreateIOWin, new CArchMsgParmInt32Int32VoidPtr(pmin, pmax, iowin)); return CArchitectureMessage(target, EArchMsgType::CreateIOWin, new CArchMsgParmInt32Int32VoidPtr(pmin, pmax, iowin));
} }
static const CArchMsgParmVoidPtr& GetParmDeleteIOWin(const CArchitectureMessage& msg) static const CArchMsgParmVoidPtr& GetParmDeleteIOWin(const CArchitectureMessage& msg)
{ {

View File

@ -8,11 +8,11 @@ namespace Retro
const char* DecodeARAMFile(const char* name); const char* DecodeARAMFile(const char* name);
enum ESeekOrigin enum class ESeekOrigin
{ {
OriginBegin = 0, Begin = 0,
OriginCur = 1, Cur = 1,
OriginEnd = 2 End = 2
}; };
struct DVDFileInfo; struct DVDFileInfo;

View File

@ -11,11 +11,11 @@ public:
virtual bool IsComplete()=0; virtual bool IsComplete()=0;
virtual void PostCancelRequest()=0; virtual void PostCancelRequest()=0;
enum EMediaType enum class EMediaType
{ {
MediaARAM = 0, ARAM = 0,
MediaReal = 1, Real = 1,
MediaNOD = 2 NOD = 2
}; };
virtual EMediaType GetMediaType() const=0; virtual EMediaType GetMediaType() const=0;
}; };
@ -26,7 +26,7 @@ public:
void WaitUntilComplete(); void WaitUntilComplete();
bool IsComplete(); bool IsComplete();
void PostCancelRequest(); void PostCancelRequest();
EMediaType GetMediaType() const {return MediaNOD;} EMediaType GetMediaType() const {return EMediaType::NOD;}
}; };
class CDvdRequest : public IDvdRequest class CDvdRequest : public IDvdRequest
@ -34,7 +34,7 @@ class CDvdRequest : public IDvdRequest
void WaitUntilComplete(); void WaitUntilComplete();
bool IsComplete(); bool IsComplete();
void PostCancelRequest(); void PostCancelRequest();
EMediaType GetMediaType() const { return MediaReal; } EMediaType GetMediaType() const { return EMediaType::Real; }
}; };
} }

View File

@ -11,30 +11,30 @@ void CEntity::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateM
{ {
switch (msg) switch (msg)
{ {
case MsgActivate: case EScriptObjectMessage::Activate:
if (!GetActive()) if (!GetActive())
{ {
SetActive(true); SetActive(true);
SendScriptMsgs(StActive, stateMgr, MsgNone); SendScriptMsgs(EScriptObjectState::Active, stateMgr, EScriptObjectMessage::None);
} }
break; break;
case MsgDeactivate: case EScriptObjectMessage::Deactivate:
if (GetActive()) if (GetActive())
{ {
SetActive(false); SetActive(false);
SendScriptMsgs(StInactive, stateMgr, MsgNone); SendScriptMsgs(EScriptObjectState::Inactive, stateMgr, EScriptObjectMessage::None);
} }
break; break;
case MsgToggleActive: case EScriptObjectMessage::ToggleActive:
if (GetActive()) if (GetActive())
{ {
SetActive(false); SetActive(false);
SendScriptMsgs(StInactive, stateMgr, MsgNone); SendScriptMsgs(EScriptObjectState::Inactive, stateMgr, EScriptObjectMessage::None);
} }
else else
{ {
SetActive(true); SetActive(true);
SendScriptMsgs(StActive, stateMgr, MsgNone); SendScriptMsgs(EScriptObjectState::Active, stateMgr, EScriptObjectMessage::None);
} }
break; break;
default: break; default: break;

View File

@ -9,15 +9,15 @@ class CFinalInput;
const char* StringForControlOption(int); const char* StringForControlOption(int);
enum EDebugMenu enum class EDebugMenu
{ {
}; };
enum EDebugOptions enum class EDebugOptions
{ {
}; };
enum EDebugMainMenu enum class EDebugMainMenu
{ {
}; };
@ -31,7 +31,7 @@ public:
class CGameDebug class CGameDebug
{ {
public: public:
enum EReturnValue enum class EReturnValue
{ {
}; };

View File

@ -14,12 +14,12 @@ class CIOWin
std::string m_name; std::string m_name;
size_t m_nameHash; size_t m_nameHash;
public: public:
enum EMessageReturn enum class EMessageReturn
{ {
MsgRetNormal = 0, Normal = 0,
MsgRetExit = 1, Exit = 1,
MsgRetRemoveIOWinAndExit = 2, RemoveIOWinAndExit = 2,
MsgRetRemoveIOWin = 3 RemoveIOWin = 3
}; };
virtual ~CIOWin() {} virtual ~CIOWin() {}
CIOWin(const char* name) : m_name(name) {m_nameHash = std::hash<std::string>()(m_name);} CIOWin(const char* name) : m_name(name) {m_nameHash = std::hash<std::string>()(m_name);}

View File

@ -9,7 +9,7 @@ bool CIOWinManager::OnIOWinMessage(const CArchitectureMessage& msg)
{ {
switch (msg.GetType()) switch (msg.GetType())
{ {
case MsgRemoveIOWin: case EArchMsgType::RemoveIOWin:
{ {
const CArchMsgParmVoidPtr& parm = MakeMsg::GetParmDeleteIOWin(msg); const CArchMsgParmVoidPtr& parm = MakeMsg::GetParmDeleteIOWin(msg);
CIOWin* iow = FindIOWin(*static_cast<const std::string*>(parm.x4_parm1)); CIOWin* iow = FindIOWin(*static_cast<const std::string*>(parm.x4_parm1));
@ -17,14 +17,14 @@ bool CIOWinManager::OnIOWinMessage(const CArchitectureMessage& msg)
RemoveIOWin(iow); RemoveIOWin(iow);
return false; return false;
} }
case MsgCreateIOWin: case EArchMsgType::CreateIOWin:
{ {
const CArchMsgParmInt32Int32VoidPtr& parm = MakeMsg::GetParmCreateIOWin(msg); const CArchMsgParmInt32Int32VoidPtr& parm = MakeMsg::GetParmCreateIOWin(msg);
rstl::rc_ptr<CIOWin> iow(static_cast<CIOWin*>(parm.xc_parm3)); rstl::rc_ptr<CIOWin> iow(static_cast<CIOWin*>(parm.xc_parm3));
AddIOWin(iow, parm.x4_parm1, parm.x8_parm2); AddIOWin(iow, parm.x4_parm1, parm.x8_parm2);
return false; return false;
} }
case MsgChangeIOWinPriority: case EArchMsgType::ChangeIOWinPriority:
{ {
const CArchMsgParmInt32Int32VoidPtr& parm = MakeMsg::GetParmChangeIOWinPriority(msg); const CArchMsgParmInt32Int32VoidPtr& parm = MakeMsg::GetParmChangeIOWinPriority(msg);
CIOWin* iow = FindIOWin(*static_cast<const std::string*>(parm.xc_parm3)); CIOWin* iow = FindIOWin(*static_cast<const std::string*>(parm.xc_parm3));
@ -32,7 +32,7 @@ bool CIOWinManager::OnIOWinMessage(const CArchitectureMessage& msg)
ChangeIOWinPriority(iow, parm.x4_parm1, parm.x8_parm2); ChangeIOWinPriority(iow, parm.x4_parm1, parm.x8_parm2);
return false; return false;
} }
case MsgRemoveAllIOWins: case EArchMsgType::RemoveAllIOWins:
{ {
RemoveAllIOWins(); RemoveAllIOWins();
return true; return true;
@ -76,7 +76,7 @@ bool CIOWinManager::DistributeOneMessage(const CArchitectureMessage& msg,
while (x8_localGatherQueue) while (x8_localGatherQueue)
{ {
CArchitectureMessage msg = x8_localGatherQueue.Pop(); CArchitectureMessage msg = x8_localGatherQueue.Pop();
if (msg.GetTarget() == TargetIOWinManager) if (msg.GetTarget() == EArchMsgTarget::IOWinManager)
{ {
if (OnIOWinMessage(msg)) if (OnIOWinMessage(msg))
{ {
@ -91,16 +91,16 @@ bool CIOWinManager::DistributeOneMessage(const CArchitectureMessage& msg,
switch (mret) switch (mret)
{ {
case CIOWin::MsgRetRemoveIOWinAndExit: case CIOWin::EMessageReturn::RemoveIOWinAndExit:
case CIOWin::MsgRetRemoveIOWin: case CIOWin::EMessageReturn::RemoveIOWin:
RemoveIOWin(iow); RemoveIOWin(iow);
default: break; default: break;
} }
switch (mret) switch (mret)
{ {
case CIOWin::MsgRetExit: case CIOWin::EMessageReturn::Exit:
case CIOWin::MsgRetRemoveIOWinAndExit: case CIOWin::EMessageReturn::RemoveIOWinAndExit:
return false; return false;
default: break; default: break;
} }

View File

@ -8,19 +8,19 @@ CIOWin::EMessageReturn CMainFlowBase::OnMessage(const CArchitectureMessage& msg,
{ {
switch (msg.GetType()) switch (msg.GetType())
{ {
case MsgTimerTick: case EArchMsgType::TimerTick:
AdvanceGameState(queue); AdvanceGameState(queue);
break; break;
case MsgSetGameState: case EArchMsgType::SetGameState:
{ {
const CArchMsgParmInt32& state = MakeMsg::GetParmNewGameflowState(msg); const CArchMsgParmInt32& state = MakeMsg::GetParmNewGameflowState(msg);
x14_gameState = EClientFlowStates(state.x4_parm); x14_gameState = EClientFlowStates(state.x4_parm);
SetGameState(x14_gameState, queue); SetGameState(x14_gameState, queue);
return MsgRetExit; return EMessageReturn::Exit;
} }
default: break; default: break;
} }
return MsgRetNormal; return EMessageReturn::Normal;
} }
} }

View File

@ -6,12 +6,12 @@
namespace Retro namespace Retro
{ {
enum EClientFlowStates enum class EClientFlowStates
{ {
ClientFlowUnspecified = -1, Unspecified = -1,
ClientFlowFrontEnd = 7, FrontEnd = 7,
ClientFlowGameLoad = 13, GameLoad = 13,
ClientFlowMoviePlay = 14 MoviePlay = 14
}; };
class CMainFlowBase : public CIOWin class CMainFlowBase : public CIOWin

View File

@ -75,9 +75,9 @@ void* operator new(std::size_t sz)
{ {
Retro::CCallStack cs("?\?(?\?)", "UnknownType"); Retro::CCallStack cs("?\?(?\?)", "UnknownType");
return Retro::CMemory::Alloc(sz, return Retro::CMemory::Alloc(sz,
Retro::IAllocator::HintNone, Retro::IAllocator::EHint::None,
Retro::IAllocator::ScopeDefault, Retro::IAllocator::EScope::Default,
Retro::IAllocator::TypePrimitive, Retro::IAllocator::EType::Primitive,
cs); cs);
} }
@ -86,9 +86,9 @@ void* operator new(std::size_t sz,
{ {
Retro::CCallStack cs(funcName, typeName); Retro::CCallStack cs(funcName, typeName);
return Retro::CMemory::Alloc(sz, return Retro::CMemory::Alloc(sz,
Retro::IAllocator::HintNone, Retro::IAllocator::EHint::None,
Retro::IAllocator::ScopeDefault, Retro::IAllocator::EScope::Default,
Retro::IAllocator::TypePrimitive, Retro::IAllocator::EType::Primitive,
cs); cs);
} }
@ -101,9 +101,9 @@ void* operator new[](std::size_t sz)
{ {
Retro::CCallStack cs("?\?(?\?)", "UnknownType"); Retro::CCallStack cs("?\?(?\?)", "UnknownType");
return Retro::CMemory::Alloc(sz, return Retro::CMemory::Alloc(sz,
Retro::IAllocator::HintNone, Retro::IAllocator::EHint::None,
Retro::IAllocator::ScopeDefault, Retro::IAllocator::EScope::Default,
Retro::IAllocator::TypeArray, Retro::IAllocator::EType::Array,
cs); cs);
} }
@ -112,9 +112,9 @@ void* operator new[](std::size_t sz,
{ {
Retro::CCallStack cs(funcName, typeName); Retro::CCallStack cs(funcName, typeName);
return Retro::CMemory::Alloc(sz, return Retro::CMemory::Alloc(sz,
Retro::IAllocator::HintNone, Retro::IAllocator::EHint::None,
Retro::IAllocator::ScopeDefault, Retro::IAllocator::EScope::Default,
Retro::IAllocator::TypeArray, Retro::IAllocator::EType::Array,
cs); cs);
} }

View File

@ -11,7 +11,7 @@ class CVector3f;
class CMoviePlayer : public CDvdFile class CMoviePlayer : public CDvdFile
{ {
public: public:
enum EPlayMode enum class EPlayMode
{ {
}; };

View File

@ -7,16 +7,16 @@
namespace Retro namespace Retro
{ {
enum EGameObjectList enum class EGameObjectList
{ {
ListAll, All,
ListActor, Actor,
ListPhysicsActor, PhysicsActor,
ListGameCamera, GameCamera,
ListGameLight, GameLight,
ListListeningAi, ListeningAi,
ListAiWaypoint, AiWaypoint,
ListPlatformAndDoor, PlatformAndDoor,
}; };
class CObjectList class CObjectList

View File

@ -23,12 +23,12 @@ public:
}; };
private: private:
bool x28_b24_ctFlag; bool x28_b24_ctFlag;
enum EAsyncPhase enum class EAsyncPhase
{ {
PakAsyncWarmup = 0, Warmup = 0,
PakAsyncInitialHeader = 1, InitialHeader = 1,
PakAsyncDataLoad = 2, DataLoad = 2,
PakAsyncLoaded = 3 Loaded = 3
} x2c_asyncLoadPhase; } x2c_asyncLoadPhase;
IDvdRequest* x34_dvdReq; IDvdRequest* x34_dvdReq;
std::vector<std::pair<std::string, SObjectTag>> x4c_nameList; std::vector<std::pair<std::string, SObjectTag>> x4c_nameList;
@ -52,19 +52,19 @@ public:
void Warmup() {} void Warmup() {}
void AsyncIdle() void AsyncIdle()
{ {
if (x2c_asyncLoadPhase == PakAsyncLoaded) if (x2c_asyncLoadPhase == EAsyncPhase::Loaded)
return; return;
if (x34_dvdReq && x34_dvdReq->IsComplete()) if (x34_dvdReq && x34_dvdReq->IsComplete())
return; return;
switch (x2c_asyncLoadPhase) switch (x2c_asyncLoadPhase)
{ {
case PakAsyncWarmup: case EAsyncPhase::Warmup:
Warmup(); Warmup();
break; break;
case PakAsyncInitialHeader: case EAsyncPhase::InitialHeader:
InitialHeaderLoad(); InitialHeaderLoad();
break; break;
case PakAsyncDataLoad: case EAsyncPhase::DataLoad:
DataLoad(); DataLoad();
break; break;
default: break; default: break;

View File

@ -13,7 +13,7 @@ class CPlayMovieBase : public CIOWin
public: public:
CPlayMovieBase(const char* iowName, const char* path) CPlayMovieBase(const char* iowName, const char* path)
: CIOWin(iowName), x18_moviePlayer(path, 0.0, false) {} : CIOWin(iowName), x18_moviePlayer(path, 0.0, false) {}
EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) {return MsgRetNormal;} EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) {return EMessageReturn::Normal;}
void Draw() const {} void Draw() const {}
}; };

View File

@ -40,12 +40,12 @@ CInputStream* CResLoader::LoadNewResourcePartSync(const SObjectTag& tag, int off
{ {
CCallStack cs(AT_PRETTY_FUNCTION, "UnknownType"); CCallStack cs(AT_PRETTY_FUNCTION, "UnknownType");
buf = CMemory::Alloc(length, buf = CMemory::Alloc(length,
IAllocator::HintLarge, IAllocator::EHint::Large,
IAllocator::ScopeDefault, IAllocator::EScope::Default,
IAllocator::TypePrimitive, IAllocator::EType::Primitive,
cs); cs);
} }
file->SyncSeekRead(buf, length, OriginBegin, x50_cachedResInfo->x4_offset + offset); file->SyncSeekRead(buf, length, ESeekOrigin::Begin, x50_cachedResInfo->x4_offset + offset);
return new CMemoryInStream((atUint8*)buf, length, !extBuf); return new CMemoryInStream((atUint8*)buf, length, !extBuf);
} }
@ -54,11 +54,11 @@ void CResLoader::LoadMemResourceSync(const SObjectTag& tag, void** bufOut, int*
CPakFile* file = FindResourceForLoad(tag); CPakFile* file = FindResourceForLoad(tag);
CCallStack cs(AT_PRETTY_FUNCTION, "UnknownType"); CCallStack cs(AT_PRETTY_FUNCTION, "UnknownType");
void* buf = CMemory::Alloc(x50_cachedResInfo->x8_size, void* buf = CMemory::Alloc(x50_cachedResInfo->x8_size,
IAllocator::HintLarge, IAllocator::EHint::Large,
IAllocator::ScopeDefault, IAllocator::EScope::Default,
IAllocator::TypePrimitive, IAllocator::EType::Primitive,
cs); cs);
file->SyncSeekRead(buf, x50_cachedResInfo->x8_size, OriginBegin, file->SyncSeekRead(buf, x50_cachedResInfo->x8_size, ESeekOrigin::Begin,
x50_cachedResInfo->x4_offset); x50_cachedResInfo->x4_offset);
*bufOut = buf; *bufOut = buf;
*sizeOut = x50_cachedResInfo->x8_size; *sizeOut = x50_cachedResInfo->x8_size;
@ -85,12 +85,12 @@ CInputStream* CResLoader::LoadNewResourceSync(const SObjectTag& tag, void* extBu
{ {
CCallStack cs(AT_PRETTY_FUNCTION, "UnknownType"); CCallStack cs(AT_PRETTY_FUNCTION, "UnknownType");
buf = CMemory::Alloc(resSz, buf = CMemory::Alloc(resSz,
IAllocator::HintLarge, IAllocator::EHint::Large,
IAllocator::ScopeDefault, IAllocator::EScope::Default,
IAllocator::TypePrimitive, IAllocator::EType::Primitive,
cs); cs);
} }
file->SyncSeekRead(buf, resSz, OriginBegin, x50_cachedResInfo->x4_offset); file->SyncSeekRead(buf, resSz, ESeekOrigin::Begin, x50_cachedResInfo->x4_offset);
CInputStream* newStrm = new CMemoryInStream((atUint8*)buf, resSz, !extBuf); CInputStream* newStrm = new CMemoryInStream((atUint8*)buf, resSz, !extBuf);
if (x50_cachedResInfo->xb_compressed) if (x50_cachedResInfo->xb_compressed)
{ {
@ -103,13 +103,13 @@ CInputStream* CResLoader::LoadNewResourceSync(const SObjectTag& tag, void* extBu
IDvdRequest* CResLoader::LoadResourcePartAsync(const SObjectTag& tag, int offset, int length, void* buf) IDvdRequest* CResLoader::LoadResourcePartAsync(const SObjectTag& tag, int offset, int length, void* buf)
{ {
return FindResourceForLoad(tag.id)->AsyncSeekRead(buf, length, return FindResourceForLoad(tag.id)->AsyncSeekRead(buf, length,
OriginBegin, x50_cachedResInfo->x4_offset + offset); ESeekOrigin::Begin, x50_cachedResInfo->x4_offset + offset);
} }
IDvdRequest* CResLoader::LoadResourceAsync(const SObjectTag& tag, void* buf) IDvdRequest* CResLoader::LoadResourceAsync(const SObjectTag& tag, void* buf)
{ {
return FindResourceForLoad(tag.id)->AsyncSeekRead(buf, ROUND_UP_32(x50_cachedResInfo->x8_size), return FindResourceForLoad(tag.id)->AsyncSeekRead(buf, ROUND_UP_32(x50_cachedResInfo->x8_size),
OriginBegin, x50_cachedResInfo->x4_offset); ESeekOrigin::Begin, x50_cachedResInfo->x4_offset);
} }
bool CResLoader::GetResourceCompression(const SObjectTag& tag) bool CResLoader::GetResourceCompression(const SObjectTag& tag)
@ -161,7 +161,7 @@ void CResLoader::AsyncIdlePakLoading()
++it) ++it)
{ {
(*it)->AsyncIdle(); (*it)->AsyncIdle();
if ((*it)->x2c_asyncLoadPhase == CPakFile::PakAsyncLoaded) if ((*it)->x2c_asyncLoadPhase == CPakFile::EAsyncPhase::Loaded)
{ {
MoveToCorrectLoadedList(std::move(*it)); MoveToCorrectLoadedList(std::move(*it));
it = x34_pakLoadingList.erase(it); it = x34_pakLoadingList.erase(it);

View File

@ -23,16 +23,16 @@ class IRenderer
public: public:
typedef void(*TDrawableCallback)(const void*, const void*, int); typedef void(*TDrawableCallback)(const void*, const void*, int);
typedef void(*TReflectionCallback)(void*, const CVector3f&); typedef void(*TReflectionCallback)(void*, const CVector3f&);
enum EDrawableSorting enum class EDrawableSorting
{ {
}; };
enum EDebugOption enum class EDebugOption
{ {
}; };
enum EPrimitiveType enum class EPrimitiveType
{ {
}; };
enum ERglFogMode enum class ERglFogMode
{ {
}; };

View File

@ -12,21 +12,21 @@ class IAllocator
{ {
public: public:
virtual ~IAllocator() {} virtual ~IAllocator() {}
enum EHint enum class EHint
{ {
HintNone = 0x0, None = 0x0,
HintTopOfHeap = 0x1, TopOfHeap = 0x1,
HintLarge = 0x2 Large = 0x2
}; };
enum EScope enum class EScope
{ {
ScopeNone = 0, None = 0,
ScopeDefault = 1 Default = 1
}; };
enum EType enum class EType
{ {
TypePrimitive = 0, Primitive = 0,
TypeArray = 1 Array = 1
}; };
struct SAllocInfo struct SAllocInfo
{ {

View File

@ -71,18 +71,18 @@ CFinalInput::CFinalInput(int cIdx, float dt,
x23_enableAnaRightNegYP(DRADown() && !prevInput.DRADown()), x23_enableAnaRightNegYP(DRADown() && !prevInput.DRADown()),
x24_anaLeftTriggerP(DLTrigger() && !prevInput.DLTrigger()), x24_anaLeftTriggerP(DLTrigger() && !prevInput.DLTrigger()),
x28_anaRightTriggerP(DRTrigger() && !prevInput.DRTrigger()), x28_anaRightTriggerP(DRTrigger() && !prevInput.DRTrigger()),
x2c_b24_A(data.m_btns & boo::DOL_A), x2c_b24_A(data.m_btns & uint16_t(boo::EDolphinControllerButtons::A)),
x2c_b25_B(data.m_btns & boo::DOL_B), x2c_b25_B(data.m_btns & uint16_t(boo::EDolphinControllerButtons::B)),
x2c_b26_X(data.m_btns & boo::DOL_X), x2c_b26_X(data.m_btns & uint16_t(boo::EDolphinControllerButtons::X)),
x2c_b27_Y(data.m_btns & boo::DOL_Y), x2c_b27_Y(data.m_btns & uint16_t(boo::EDolphinControllerButtons::Y)),
x2c_b28_Z(data.m_btns & boo::DOL_Z), x2c_b28_Z(data.m_btns & uint16_t(boo::EDolphinControllerButtons::Z)),
x2c_b29_L(data.m_btns & boo::DOL_L), x2c_b29_L(data.m_btns & uint16_t(boo::EDolphinControllerButtons::L)),
x2c_b30_R(data.m_btns & boo::DOL_R), x2c_b30_R(data.m_btns & uint16_t(boo::EDolphinControllerButtons::R)),
x2c_b31_DPUp(data.m_btns & boo::DOL_UP), x2c_b31_DPUp(data.m_btns & uint16_t(boo::EDolphinControllerButtons::Up)),
x2d_b24_DPRight(data.m_btns & boo::DOL_RIGHT), x2d_b24_DPRight(data.m_btns & uint16_t(boo::EDolphinControllerButtons::Right)),
x2d_b25_DPDown(data.m_btns & boo::DOL_DOWN), x2d_b25_DPDown(data.m_btns & uint16_t(boo::EDolphinControllerButtons::Down)),
x2d_b26_DPLeft(data.m_btns & boo::DOL_LEFT), x2d_b26_DPLeft(data.m_btns & uint16_t(boo::EDolphinControllerButtons::Left)),
x2d_b27_Start(data.m_btns & boo::DOL_START), x2d_b27_Start(data.m_btns & uint16_t(boo::EDolphinControllerButtons::Start)),
x2d_b28_PA(DA() && !prevInput.DA()), x2d_b28_PA(DA() && !prevInput.DA()),
x2d_b29_PB(DB() && !prevInput.DB()), x2d_b29_PB(DB() && !prevInput.DB()),
x2d_b30_PX(DX() && !prevInput.DX()), x2d_b30_PX(DX() && !prevInput.DX()),
@ -157,18 +157,18 @@ CFinalInput::CFinalInput(int cIdx, float dt,
x23_enableAnaRightNegYP(DRADown() && !prevInput.DRADown()), x23_enableAnaRightNegYP(DRADown() && !prevInput.DRADown()),
x24_anaLeftTriggerP(DLTrigger() && !prevInput.DLTrigger()), x24_anaLeftTriggerP(DLTrigger() && !prevInput.DLTrigger()),
x28_anaRightTriggerP(DRTrigger() && !prevInput.DRTrigger()), x28_anaRightTriggerP(DRTrigger() && !prevInput.DRTrigger()),
x2c_b24_A(data.m_mouseButtons[boo::BUTTON_PRIMARY]), x2c_b24_A(data.m_mouseButtons[int(boo::EMouseButton::Primary)]),
x2c_b25_B(data.m_charKeys[' ']), x2c_b25_B(data.m_charKeys[' ']),
x2c_b26_X(data.m_charKeys['c']), x2c_b26_X(data.m_charKeys['c']),
x2c_b27_Y(data.m_mouseButtons[boo::BUTTON_SECONDARY]), x2c_b27_Y(data.m_mouseButtons[int(boo::EMouseButton::Secondary)]),
x2c_b28_Z(data.m_charKeys['\t']), x2c_b28_Z(data.m_charKeys['\t']),
x2c_b29_L(data.m_charKeys['q']), x2c_b29_L(data.m_charKeys['q']),
x2c_b30_R(data.m_charKeys['e']), x2c_b30_R(data.m_charKeys['e']),
x2c_b31_DPUp(data.m_specialKeys[boo::KEY_UP]), x2c_b31_DPUp(data.m_specialKeys[int(boo::ESpecialKey::Up)]),
x2d_b24_DPRight(data.m_specialKeys[boo::KEY_RIGHT]), x2d_b24_DPRight(data.m_specialKeys[int(boo::ESpecialKey::Right)]),
x2d_b25_DPDown(data.m_specialKeys[boo::KEY_DOWN]), x2d_b25_DPDown(data.m_specialKeys[int(boo::ESpecialKey::Down)]),
x2d_b26_DPLeft(data.m_specialKeys[boo::KEY_LEFT]), x2d_b26_DPLeft(data.m_specialKeys[int(boo::ESpecialKey::Left)]),
x2d_b27_Start(data.m_specialKeys[boo::KEY_ESC]), x2d_b27_Start(data.m_specialKeys[int(boo::ESpecialKey::Esc)]),
x2d_b28_PA(DA() && !prevInput.DA()), x2d_b28_PA(DA() && !prevInput.DA()),
x2d_b29_PB(DB() && !prevInput.DB()), x2d_b29_PB(DB() && !prevInput.DB()),
x2d_b30_PX(DX() && !prevInput.DX()), x2d_b30_PX(DX() && !prevInput.DX()),

View File

@ -16,8 +16,8 @@ void CInputGenerator::Update(float dt, CArchitectureQueue& queue)
{ {
bool connected; bool connected;
EStatusChange change = m_dolphinCb.getStatusChange(i, connected); EStatusChange change = m_dolphinCb.getStatusChange(i, connected);
if (change) if (change != EStatusChange::NoChange)
queue.Push(std::move(MakeMsg::CreateControllerStatus(TargetGame, i, connected))); queue.Push(std::move(MakeMsg::CreateControllerStatus(EArchMsgTarget::Game, i, connected)));
if (connected) if (connected)
{ {
CFinalInput input = m_dolphinCb.getFinalInput(i, dt, m_leftDiv, m_rightDiv); CFinalInput input = m_dolphinCb.getFinalInput(i, dt, m_leftDiv, m_rightDiv);
@ -26,13 +26,13 @@ void CInputGenerator::Update(float dt, CArchitectureQueue& queue)
input |= kbInput; input |= kbInput;
kbUsed = true; kbUsed = true;
} }
queue.Push(std::move(MakeMsg::CreateUserInput(TargetGame, input))); queue.Push(std::move(MakeMsg::CreateUserInput(EArchMsgTarget::Game, input)));
} }
} }
/* Send straight keyboard input if no first controller present */ /* Send straight keyboard input if no first controller present */
if (!kbUsed) if (!kbUsed)
queue.Push(std::move(MakeMsg::CreateUserInput(TargetGame, kbInput))); queue.Push(std::move(MakeMsg::CreateUserInput(EArchMsgTarget::Game, kbInput)));
} }
} }

View File

@ -12,11 +12,11 @@ class CArchitectureQueue;
class CInputGenerator : public boo::DeviceFinder class CInputGenerator : public boo::DeviceFinder
{ {
enum EStatusChange enum class EStatusChange
{ {
StatusNoChange = 0, NoChange = 0,
StatusConnected = 1, Connected = 1,
StatusDisconnected = 2 Disconnected = 2
}; };
/* When the sticks are used as logical (digital) input, /* When the sticks are used as logical (digital) input,
@ -41,11 +41,11 @@ public:
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton button, boo::EModifierKey) void mouseDown(const boo::SWindowCoord&, boo::EMouseButton button, boo::EModifierKey)
{ {
m_data.m_mouseButtons[button] = true; m_data.m_mouseButtons[int(button)] = true;
} }
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton button, boo::EModifierKey) void mouseUp(const boo::SWindowCoord&, boo::EMouseButton button, boo::EModifierKey)
{ {
m_data.m_mouseButtons[button] = false; m_data.m_mouseButtons[int(button)] = false;
} }
void mouseMove(const boo::SWindowCoord& coord) void mouseMove(const boo::SWindowCoord& coord)
{ {
@ -72,19 +72,19 @@ public:
} }
void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey, bool) void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey, bool)
{ {
m_data.m_specialKeys[key] = true; m_data.m_specialKeys[int(key)] = true;
} }
void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey) void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey)
{ {
m_data.m_specialKeys[key] = false; m_data.m_specialKeys[int(key)] = false;
} }
void modKeyDown(boo::EModifierKey mod, bool) void modKeyDown(boo::EModifierKey mod, bool)
{ {
m_data.m_modMask = boo::EModifierKey(m_data.m_modMask | mod); m_data.m_modMask = m_data.m_modMask | mod;
} }
void modKeyUp(boo::EModifierKey mod) void modKeyUp(boo::EModifierKey mod)
{ {
m_data.m_modMask = boo::EModifierKey(m_data.m_modMask & ~mod); m_data.m_modMask = m_data.m_modMask & ~mod;
} }
void reset() void reset()
@ -112,13 +112,13 @@ public:
void controllerConnected(unsigned idx, boo::EDolphinControllerType) void controllerConnected(unsigned idx, boo::EDolphinControllerType)
{ {
/* Controller thread */ /* Controller thread */
m_statusChanges[idx].store(StatusConnected); m_statusChanges[idx].store(EStatusChange::Connected);
} }
void controllerDisconnected(unsigned idx, boo::EDolphinControllerType) void controllerDisconnected(unsigned idx, boo::EDolphinControllerType)
{ {
/* Controller thread */ /* Controller thread */
std::unique_lock<std::mutex> lk(m_stateLock); std::unique_lock<std::mutex> lk(m_stateLock);
m_statusChanges[idx].store(StatusDisconnected); m_statusChanges[idx].store(EStatusChange::Disconnected);
m_states[idx].reset(); m_states[idx].reset();
} }
void controllerUpdate(unsigned idx, boo::EDolphinControllerType, void controllerUpdate(unsigned idx, boo::EDolphinControllerType,
@ -144,10 +144,10 @@ public:
EStatusChange getStatusChange(unsigned idx, bool& connected) EStatusChange getStatusChange(unsigned idx, bool& connected)
{ {
/* Game thread */ /* Game thread */
EStatusChange ch = m_statusChanges[idx].exchange(StatusNoChange); EStatusChange ch = m_statusChanges[idx].exchange(EStatusChange::NoChange);
if (ch == StatusConnected) if (ch == EStatusChange::Connected)
m_connected[idx] = true; m_connected[idx] = true;
else if (ch == StatusDisconnected) else if (ch == EStatusChange::Disconnected)
m_connected[idx] = false; m_connected[idx] = false;
connected = m_connected[idx]; connected = m_connected[idx];
return ch; return ch;

View File

@ -11,7 +11,7 @@ struct CKeyboardMouseControllerData
bool m_charKeys[256] = {}; bool m_charKeys[256] = {};
bool m_specialKeys[26] = {}; bool m_specialKeys[26] = {};
bool m_mouseButtons[6] = {}; bool m_mouseButtons[6] = {};
boo::EModifierKey m_modMask = boo::MKEY_NONE; boo::EModifierKey m_modMask = boo::EModifierKey::None;
boo::SWindowCoord m_mouseCoord; boo::SWindowCoord m_mouseCoord;
boo::SScrollDelta m_accumScroll; boo::SScrollDelta m_accumScroll;
}; };

View File

@ -193,7 +193,7 @@ static bool skCommandFilterFlag[kCommandFilterCount];
void ControlMapper::SetCommandFiltered(ECommands cmd, bool filtered) void ControlMapper::SetCommandFiltered(ECommands cmd, bool filtered)
{ {
skCommandFilterFlag[cmd] = filtered; skCommandFilterFlag[int(cmd)] = filtered;
} }
void ControlMapper::ResetCommandFilters() void ControlMapper::ResetCommandFilters()
@ -204,12 +204,12 @@ void ControlMapper::ResetCommandFilters()
bool ControlMapper::GetPressInput(ECommands cmd, const CFinalInput& input) bool ControlMapper::GetPressInput(ECommands cmd, const CFinalInput& input)
{ {
if (!skCommandFilterFlag[cmd]) if (!skCommandFilterFlag[int(cmd)])
return false; return false;
EFunctionList func = EFunctionList(g_tweakPlayerControl->GetMapping(cmd)); EFunctionList func = EFunctionList(g_tweakPlayerControl->GetMapping(atUint32(cmd)));
if (func > FuncMAX) if (func > EFunctionList::MAX)
return false; return false;
BoolReturnFn fn = skPressFuncs[func]; BoolReturnFn fn = skPressFuncs[int(func)];
if (!fn) if (!fn)
return false; return false;
return (input.*fn)(); return (input.*fn)();
@ -217,12 +217,12 @@ bool ControlMapper::GetPressInput(ECommands cmd, const CFinalInput& input)
bool ControlMapper::GetDigitalInput(ECommands cmd, const CFinalInput& input) bool ControlMapper::GetDigitalInput(ECommands cmd, const CFinalInput& input)
{ {
if (!skCommandFilterFlag[cmd]) if (!skCommandFilterFlag[int(cmd)])
return false; return false;
EFunctionList func = EFunctionList(g_tweakPlayerControl->GetMapping(cmd)); EFunctionList func = EFunctionList(g_tweakPlayerControl->GetMapping(atUint32(cmd)));
if (func > FuncMAX) if (func > EFunctionList::MAX)
return false; return false;
BoolReturnFn fn = skDigitalFuncs[func]; BoolReturnFn fn = skDigitalFuncs[int(func)];
if (!fn) if (!fn)
return false; return false;
return (input.*fn)(); return (input.*fn)();
@ -230,12 +230,12 @@ bool ControlMapper::GetDigitalInput(ECommands cmd, const CFinalInput& input)
float ControlMapper::GetAnalogInput(ECommands cmd, const CFinalInput& input) float ControlMapper::GetAnalogInput(ECommands cmd, const CFinalInput& input)
{ {
if (!skCommandFilterFlag[cmd]) if (!skCommandFilterFlag[int(cmd)])
return 0.0; return 0.0;
EFunctionList func = EFunctionList(g_tweakPlayerControl->GetMapping(cmd)); EFunctionList func = EFunctionList(g_tweakPlayerControl->GetMapping(atUint32(cmd)));
if (func > FuncMAX) if (func > EFunctionList::MAX)
return 0.0; return 0.0;
FloatReturnFn fn = skAnalogFuncs[func]; FloatReturnFn fn = skAnalogFuncs[int(func)];
if (!fn) if (!fn)
return 0.0; return 0.0;
return (input.*fn)(); return (input.*fn)();
@ -243,16 +243,16 @@ float ControlMapper::GetAnalogInput(ECommands cmd, const CFinalInput& input)
const char* ControlMapper::GetDescriptionForCommand(ECommands cmd) const char* ControlMapper::GetDescriptionForCommand(ECommands cmd)
{ {
if (cmd > CmdMAX) if (cmd > ECommands::MAX)
return nullptr; return nullptr;
return skCommandDescs[cmd]; return skCommandDescs[int(cmd)];
} }
const char* ControlMapper::GetDescriptionForFunction(EFunctionList func) const char* ControlMapper::GetDescriptionForFunction(EFunctionList func)
{ {
if (func > FuncMAX) if (func > EFunctionList::MAX)
return nullptr; return nullptr;
return skFunctionDescs[func]; return skFunctionDescs[int(func)];
} }
} }

View File

@ -8,97 +8,97 @@ class CFinalInput;
class ControlMapper class ControlMapper
{ {
public: public:
enum ECommands enum class ECommands
{ {
CmdForward, Forward,
CmdBackward, Backward,
CmdTurnLeft, TurnLeft,
CmdTurnRight, TurnRight,
CmdStrafeLeft, StrafeLeft,
CmdStrafeRight, StrafeRight,
CmdLookLeft, LookLeft,
CmdLookRight, LookRight,
CmdLookUp, LookUp,
CmdLookDown, LookDown,
CmdJumpOrBoost, JumpOrBoost,
CmdFireOrBomb, FireOrBomb,
CmdMissileOrPowerBomb, MissileOrPowerBomb,
CmdMorph, Morph,
CmdAimUp, AimUp,
CmdAimDown, AimDown,
CmdCycleBeamUp, CycleBeamUp,
CmdCycleBeamDown, CycleBeamDown,
CmdCycleItem, CycleItem,
CmdPowerBeam, PowerBeam,
CmdIceBeam, IceBeam,
CmdWaveBeam, WaveBeam,
CmdPlasmaBeam, PlasmaBeam,
CmdToggleHolster, ToggleHolster,
CmdOrbitClose, OrbitClose,
CmdOrbitFar, OrbitFar,
CmdOrbitObject, OrbitObject,
CmdOrbitSelect, OrbitSelect,
CmdOrbitConfirm, OrbitConfirm,
CmdOrbitLeft, OrbitLeft,
CmdOrbitRight, OrbitRight,
CmdOrbitUp, OrbitUp,
CmdOrbitDown, OrbitDown,
CmdLookHold1, LookHold1,
CmdLookHold2, LookHold2,
CmdLookZoomIn, LookZoomIn,
CmdLookZoomOut, LookZoomOut,
CmdAimHold, AimHold,
CmdMapCircleUp, MapCircleUp,
CmdMapCircleDown, MapCircleDown,
CmdMapCircleLeft, MapCircleLeft,
CmdMapCircleRight, MapCircleRight,
CmdMapMoveForward, MapMoveForward,
CmdMapMoveBack, MapMoveBack,
CmdMapMoveLeft, MapMoveLeft,
CmdMapMoveRight, MapMoveRight,
CmdMapZoomIn, MapZoomIn,
CmdMapZoomOut, MapZoomOut,
CmdChaseCamera, ChaseCamera,
CmdXrayVisor, XrayVisor,
CmdThermoVisor, ThermoVisor,
CmdInviroVisor, InviroVisor,
CmdNoVisor, NoVisor,
CmdVisorMenu, VisorMenu,
CmdVisorUp, VisorUp,
CmdVisorDown, VisorDown,
CmdUseSheild=0x3B, UseSheild=0x3B,
CmdScanItem=0x3C, ScanItem=0x3C,
CmdUNKNOWN, UNKNOWN,
CmdNone, None,
CmdMAX MAX
}; };
enum EFunctionList enum class EFunctionList
{ {
FuncNone, None,
FuncLeftStickUp, LeftStickUp,
FuncLeftStickDown, LeftStickDown,
FuncLeftStickLeft, LeftStickLeft,
FuncLeftStickRight, LeftStickRight,
FuncRightStickUp, RightStickUp,
FuncRightStickDown, RightStickDown,
FuncRightStickLeft, RightStickLeft,
FuncRightStickRight, RightStickRight,
FuncLeftTrigger, LeftTrigger,
FuncRightTrigger, RightTrigger,
FuncDPadUp, DPadUp,
FuncDPadDown, DPadDown,
FuncDPadLeft, DPadLeft,
FuncDPadRight, DPadRight,
FuncAButton, AButton,
FuncBButton, BButton,
FuncXButton, XButton,
FuncYButton, YButton,
FuncZButton, ZButton,
FuncLeftTriggerPress, LeftTriggerPress,
FuncRightTriggerPress, RightTriggerPress,
FuncStart, Start,
FuncMAX // default case MAX // default case
}; };
static void SetCommandFiltered(ECommands cmd, bool filtered); static void SetCommandFiltered(ECommands cmd, bool filtered);

View File

@ -9,11 +9,11 @@ namespace Retro
class IController class IController
{ {
public: public:
enum EMotorState enum class EMotorState
{ {
MotorStop = 0, Stop = 0,
MotorRumble = 1, Rumble = 1,
MotorStopHard = 2 StopHard = 2
}; };
virtual void Poll()=0; virtual void Poll()=0;
virtual void SetMotorState(EMotorState state)=0; virtual void SetMotorState(EMotorState state)=0;

View File

@ -57,7 +57,7 @@ void CFrontEndUI::UpdateMovies(float dt)
void CFrontEndUI::Update(float dt, CArchitectureQueue& queue) void CFrontEndUI::Update(float dt, CArchitectureQueue& queue)
{} {}
CIOWin::EMessageReturn CFrontEndUI::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) CIOWin::EMessageReturn CFrontEndUI::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{return MsgRetNormal;} {return EMessageReturn::Normal;}
void CFrontEndUI::StartGame() void CFrontEndUI::StartGame()
{} {}
void CFrontEndUI::InitializeFrame() void CFrontEndUI::InitializeFrame()

View File

@ -16,10 +16,10 @@ namespace MP1
class CFrontEndUI : public CIOWin class CFrontEndUI : public CIOWin
{ {
public: public:
enum EMenuMovie enum class EMenuMovie
{ {
}; };
enum EScreen enum class EScreen
{ {
}; };

View File

@ -12,14 +12,14 @@ CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg,
{ {
switch (msg.GetType()) switch (msg.GetType())
{ {
case MsgTimerTick: case EArchMsgType::TimerTick:
{ {
const CArchMsgParmReal32& tick = MakeMsg::GetParmTimerTick(msg); const CArchMsgParmReal32& tick = MakeMsg::GetParmTimerTick(msg);
g_GameState->WorldTransitionManager(); g_GameState->WorldTransitionManager();
} }
default: break; default: break;
} }
return MsgRetExit; return EMessageReturn::Exit;
} }
void CMFGameLoader::Draw() const void CMFGameLoader::Draw() const

View File

@ -14,12 +14,12 @@ class CStopwatch;
namespace MP1 namespace MP1
{ {
enum EGameplayResult enum class EGameplayResult
{ {
GameplayResultNone, None,
GameplayResultWin, Win,
GameplayResultLose, Lose,
GameplayResultPlaying Playing
}; };
class WindowCallback : public boo::IWindowCallback class WindowCallback : public boo::IWindowCallback

View File

@ -16,15 +16,15 @@ void CMainFlow::AdvanceGameState(CArchitectureQueue& queue)
{ {
switch (x14_gameState) switch (x14_gameState)
{ {
case ClientFlowFrontEnd: case EClientFlowStates::FrontEnd:
CMainFlow::SetGameState(ClientFlowGameLoad, queue); CMainFlow::SetGameState(EClientFlowStates::GameLoad, queue);
break; break;
case ClientFlowUnspecified: case EClientFlowStates::Unspecified:
case ClientFlowGameLoad: case EClientFlowStates::GameLoad:
CMainFlow::SetGameState(ClientFlowMoviePlay, queue); CMainFlow::SetGameState(EClientFlowStates::MoviePlay, queue);
break; break;
case ClientFlowMoviePlay: case EClientFlowStates::MoviePlay:
CMainFlow::SetGameState(ClientFlowFrontEnd, queue); CMainFlow::SetGameState(EClientFlowStates::FrontEnd, queue);
break; break;
} }
} }
@ -33,11 +33,11 @@ void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue)
{ {
switch (state) switch (state)
{ {
case ClientFlowFrontEnd: case EClientFlowStates::FrontEnd:
{ {
if (g_main->GetGameplayResult() == GameplayResultNone) if (g_main->GetGameplayResult() == EGameplayResult::None)
{ {
g_main->SetGameplayResult(GameplayResultPlaying); g_main->SetGameplayResult(EGameplayResult::Playing);
break; break;
} }
CResLoader& loader = g_ResFactory->GetLoader(); CResLoader& loader = g_ResFactory->GetLoader();
@ -45,23 +45,23 @@ void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue)
loader.AsyncIdlePakLoading(); loader.AsyncIdlePakLoading();
g_main->LoadAudio(); g_main->LoadAudio();
g_main->RegisterResourceTweaks(); g_main->RegisterResourceTweaks();
queue.Push(std::move(MakeMsg::CreateCreateIOWin(TargetIOWinManager, 12, 11, new CFrontEndUI(queue)))); queue.Push(std::move(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 12, 11, new CFrontEndUI(queue))));
break; break;
} }
case ClientFlowGameLoad: case EClientFlowStates::GameLoad:
{ {
queue.Push(std::move(MakeMsg::CreateCreateIOWin(TargetIOWinManager, 10, 1000, new CMFGameLoader()))); queue.Push(std::move(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 10, 1000, new CMFGameLoader())));
break; break;
} }
case ClientFlowMoviePlay: case EClientFlowStates::MoviePlay:
{ {
switch (g_main->GetGameplayResult()) switch (g_main->GetGameplayResult())
{ {
case GameplayResultWin: case EGameplayResult::Win:
queue.Push(std::move(MakeMsg::CreateCreateIOWin(TargetIOWinManager, 12, 11, new CPlayMovie(CPlayMovie::MovieWinGame)))); queue.Push(std::move(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 12, 11, new CPlayMovie(CPlayMovie::EWhichMovie::WinGame))));
break; break;
case GameplayResultLose: case EGameplayResult::Lose:
queue.Push(std::move(MakeMsg::CreateCreateIOWin(TargetIOWinManager, 12, 11, new CPlayMovie(CPlayMovie::MovieLoseGame)))); queue.Push(std::move(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 12, 11, new CPlayMovie(CPlayMovie::EWhichMovie::LoseGame))));
break; break;
default: break; default: break;
} }

View File

@ -13,15 +13,15 @@ extern const char* kMovies[];
class CPlayMovie : public CPlayMovieBase class CPlayMovie : public CPlayMovieBase
{ {
public: public:
enum EWhichMovie enum class EWhichMovie
{ {
MovieWinGame, WinGame,
MovieLoseGame LoseGame
}; };
private: private:
EWhichMovie x14_which; EWhichMovie x14_which;
public: public:
CPlayMovie(EWhichMovie which) : CPlayMovieBase("CPlayMovie", kMovies[which]), x14_which(which) {} CPlayMovie(EWhichMovie which) : CPlayMovieBase("CPlayMovie", kMovies[int(which)]), x14_which(which) {}
}; };
} }

View File

@ -128,7 +128,7 @@ CMain::CMain()
: x6c_memSys(CMemorySys::GetGameAllocator()) : x6c_memSys(CMemorySys::GetGameAllocator())
{ {
g_main = this; g_main = this;
xe4_gameplayResult = GameplayResultPlaying; xe4_gameplayResult = EGameplayResult::Playing;
} }
void CMain::RegisterResourceTweaks() void CMain::RegisterResourceTweaks()
{ {
@ -217,7 +217,7 @@ int main(int argc, const char* argv[])
LogVisor::RegisterConsoleLogger(); LogVisor::RegisterConsoleLogger();
Retro::TOneStatic<Retro::MP1::CMain> main; Retro::TOneStatic<Retro::MP1::CMain> main;
int ret = boo::ApplicationRun(boo::IApplication::PLAT_AUTO, *main, int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, *main,
_S("mp1"), _S("MP1"), argc, argv); _S("mp1"), _S("MP1"), argc, argv);
return ret; return ret;
} }

View File

@ -4,68 +4,68 @@
namespace Retro namespace Retro
{ {
enum EScriptObjectState enum class EScriptObjectState
{ {
StActive, Active,
StArrived, Arrived,
StClosed, Closed,
StEntered, Entered,
StExited, Exited,
StInactive, Inactive,
StInside, Inside,
StMaxReached, MaxReached,
StOpen, Open,
StZero, Zero,
StAttack, Attack,
StUNKS1, UNKS1,
StRetreat, Retreat,
StPatrol, Patrol,
StDead, Dead,
StCameraPath, CameraPath,
StCameraTarget, CameraTarget,
StUNKS2, UNKS2,
StPlay, Play,
StUNKS3, UNKS3,
StDeathRattle, DeathRattle,
StUNKS4, UNKS4,
StDamage, Damage,
StUNKS6, UNKS6,
StUNKS5, UNKS5,
StModify, Modify,
StUNKS7, UNKS7,
StUNKS8, UNKS8,
StScanDone, ScanDone,
StUNKS9, UNKS9,
StDFST, DFST,
StReflectedDamage, ReflectedDamage,
StInheritBounds InheritBounds
}; };
enum EScriptObjectMessage enum class EScriptObjectMessage
{ {
MsgNone = -1, None = -1,
MsgUNKM1 = 0, UNKM1 = 0,
MsgActivate, Activate,
MsgUNKM2, UNKM2,
MsgClose, Close,
MsgDeactivate, Deactivate,
MsgDecrement, Decrement,
MsgFollow, Follow,
MsgIncrement, Increment,
MsgNext, Next,
MsgOpen, Open,
MsgReset, Reset,
MsgResetAndStart, ResetAndStart,
MsgSetToMax, SetToMax,
MsgSetToZero, SetToZero,
MsgStart, Start,
MsgStop, Stop,
MsgStopAndReset, StopAndReset,
MsgToggleActive, ToggleActive,
MsgUNKM3, UNKM3,
MsgAction, Action,
MsgPlay, Play,
MsgAlert Alert
}; };
} }

2
hecl

@ -1 +1 @@
Subproject commit bc45b3f9e96616f61fadc14ab714886e6adfa459 Subproject commit 58d169f0aa6f42c17c9125ecf07a4e492720e3b8

1
libSpecter Submodule

@ -0,0 +1 @@
Subproject commit 9e975559867abef7aa4493999556aab176ae4d97