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"]
path = MathLib
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)
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
"/* 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::SpecEntMP3);")
add_subdirectory(hecl)
add_subdirectory(libSpecter)
set(SPECTER_INCLUDE_DIR libSpecter/include)
add_subdirectory(NODLib)
set(NODLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/NODLib/include)
add_definitions(-DZE_ATHENA_TYPES=1)
@ -38,9 +42,10 @@ add_subdirectory(MathLib)
set(MATHLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/MathLib/include)
include_directories(${ATHENA_INCLUDE_DIR} ${LOG_VISOR_INCLUDE_DIR} ${HECL_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)
#disable Runtime on FreeBSD for now
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
add_subdirectory(Editor)
add_subdirectory(Runtime)
endif()

View File

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

View File

@ -52,9 +52,9 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn,
if (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;
HECL::SystemStringView bestNameView(pakRouter.getBestEntryName(*cmdlE));
@ -80,7 +80,7 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn,
fileChanged(bestNameView.sys_str().c_str());
/* Establish ANCS blend */
if (!conn.createBlend(outPath, HECL::BlenderConnection::TypeActor))
if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Actor))
return false;
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)
{
case Channel::ROTATION:
case Channel::Type::Rotation:
bitsPerKeyFrame += 1;
case Channel::TRANSLATION:
case Channel::SCALE:
case Channel::Type::Translation:
case Channel::Type::Scale:
bitsPerKeyFrame += chan.q[0];
bitsPerKeyFrame += chan.q[1];
bitsPerKeyFrame += chan.q[2];
break;
case Channel::KF_HEAD:
case Channel::Type::KfHead:
bitsPerKeyFrame += 1;
break;
case Channel::ROTATION_MP3:
case Channel::Type::RotationMP3:
bitsPerKeyFrame += chan.q[0];
bitsPerKeyFrame += chan.q[1];
bitsPerKeyFrame += chan.q[2];
@ -153,27 +153,27 @@ BitstreamReader::read(const atUint8* data,
keys.reserve(keyFrameCount);
switch (chan.type)
{
case Channel::ROTATION:
case Channel::Type::Rotation:
{
QuantizedRot qr = {{chan.i[0], chan.i[1], chan.i[2]}, false};
keys.emplace_back(DequantizeRotation(qr, rotDiv));
break;
}
case Channel::TRANSLATION:
case Channel::Type::Translation:
{
keys.push_back({chan.i[0] * transMult, chan.i[1] * transMult, chan.i[2] * transMult});
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)});
break;
}
case Channel::KF_HEAD:
case Channel::Type::KfHead:
{
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)};
keys.emplace_back(DequantizeRotation_3(qr, rotDiv));
@ -191,7 +191,7 @@ BitstreamReader::read(const atUint8* data,
QuantizedValue& p = *ait;
switch (chan.type)
{
case Channel::ROTATION:
case Channel::Type::Rotation:
{
bool wBit = dequantizeBit(data);
p[0] += dequantize(data, chan.q[0]);
@ -201,7 +201,7 @@ BitstreamReader::read(const atUint8* data,
kit->emplace_back(DequantizeRotation(qr, rotDiv));
break;
}
case Channel::TRANSLATION:
case Channel::Type::Translation:
{
atInt16 val1 = dequantize(data, chan.q[0]);
p[0] += val1;
@ -212,7 +212,7 @@ BitstreamReader::read(const atUint8* data,
kit->push_back({p[0] * transMult, p[1] * transMult, p[2] * transMult});
break;
}
case Channel::SCALE:
case Channel::Type::Scale:
{
p[0] += dequantize(data, chan.q[0]);
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)});
break;
}
case Channel::KF_HEAD:
case Channel::Type::KfHead:
{
bool aBit = dequantizeBit(data);
break;
}
case Channel::ROTATION_MP3:
case Channel::Type::RotationMP3:
{
atInt16 val1 = dequantize(data, chan.q[0]);
p[0] += val1;
@ -301,7 +301,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
{
switch (chan.type)
{
case Channel::TRANSLATION:
case Channel::Type::Translation:
{
const Value* last = &(*kit)[0];
for (auto it=kit->begin() + 1;
@ -331,20 +331,20 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
chan.q[2] = 1;
switch (chan.type)
{
case Channel::ROTATION:
case Channel::Type::Rotation:
{
QuantizedRot qr = QuantizeRotation((*kit)[0], rotDivOut);
chan.i = qr.v;
break;
}
case Channel::TRANSLATION:
case Channel::Type::Translation:
{
chan.i = {atInt16((*kit)[0].v3.vec[0] / transMultOut),
atInt16((*kit)[0].v3.vec[1] / transMultOut),
atInt16((*kit)[0].v3.vec[2] / transMultOut)};
break;
}
case Channel::SCALE:
case Channel::Type::Scale:
{
chan.i = {atInt16((*kit)[0].v3.vec[0] * rotDivOut),
atInt16((*kit)[0].v3.vec[1] * rotDivOut),
@ -362,7 +362,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
{
switch (chan.type)
{
case Channel::ROTATION:
case Channel::Type::Rotation:
{
QuantizedRot qrLast = QuantizeRotation((*kit)[0], rotDivOut);
for (auto it=kit->begin() + 1;
@ -377,7 +377,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
}
break;
}
case Channel::TRANSLATION:
case Channel::Type::Translation:
{
QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] / transMultOut),
atInt16((*kit)[0].v3.vec[1] / transMultOut),
@ -396,7 +396,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
}
break;
}
case Channel::SCALE:
case Channel::Type::Scale:
{
QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] * rotDivOut),
atInt16((*kit)[0].v3.vec[1] * rotDivOut),
@ -430,7 +430,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
{
switch (chan.type)
{
case Channel::ROTATION:
case Channel::Type::Rotation:
{
QuantizedRot qrLast = QuantizeRotation((*kit)[0], rotDivOut);
for (auto it=kit->begin() + 1;
@ -446,7 +446,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
}
break;
}
case Channel::TRANSLATION:
case Channel::Type::Translation:
{
QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] / transMultOut),
atInt16((*kit)[0].v3.vec[1] / transMultOut),
@ -465,7 +465,7 @@ BitstreamWriter::write(const std::vector<std::vector<Value>>& chanKeys,
}
break;
}
case Channel::SCALE:
case Channel::Type::Scale:
{
QuantizedValue last = {atInt16((*kit)[0].v3.vec[0] * rotDivOut),
atInt16((*kit)[0].v3.vec[1] * rotDivOut),

View File

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

View File

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

View File

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

View File

@ -19,10 +19,10 @@ bool ReadMAPAToBlender(HECL::BlenderConnection& conn,
{
/* Rename MAPA for consistency */
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;
if (!conn.createBlend(mapaPath, HECL::BlenderConnection::TypeMapArea))
if (!conn.createBlend(mapaPath, HECL::BlenderConnection::BlendType::MapArea))
return false;
HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true);
@ -177,7 +177,7 @@ bool ReadMAPAToBlender(HECL::BlenderConnection& conn,
/* World background */
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.centerView();

View File

@ -21,7 +21,7 @@ bool ReadMLVLToBlender(HECL::BlenderConnection& conn,
{
/* Rename MLVL for consistency */
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;
/* Link Skybox CMDL */
@ -33,7 +33,7 @@ bool ReadMLVLToBlender(HECL::BlenderConnection& conn,
}
/* Create World Blend */
if (!conn.createBlend(mlvlPath, HECL::BlenderConnection::TypeWorld))
if (!conn.createBlend(mlvlPath, HECL::BlenderConnection::BlendType::World))
return false;
HECL::BlenderConnection::PyOutStream os = conn.beginPythonOut(true);
os.format("import bpy\n"

View File

@ -52,14 +52,14 @@ public:
struct UniqueResult
{
enum Type
enum class Type
{
UNIQUE_NOTFOUND,
UNIQUE_PAK,
UNIQUE_LEVEL,
UNIQUE_AREA,
UNIQUE_LAYER
} m_type = UNIQUE_NOTFOUND;
NotFound,
Pak,
Level,
Area,
Layer
} m_type = Type::NotFound;
const HECL::SystemString* m_levelName = nullptr;
const HECL::SystemString* m_areaName = nullptr;
const HECL::SystemString* m_layerName = nullptr;
@ -69,7 +69,7 @@ struct UniqueResult
template<class PAKBRIDGE>
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;
const HECL::SystemString* levelName = nullptr;
typename PAKBRIDGE::PAKType::IDType levelId;
@ -80,7 +80,7 @@ struct UniqueResult
if (entry.id == lpair.first)
{
levelName = &lpair.second.name;
resultType = UniqueResult::UNIQUE_LEVEL;
resultType = UniqueResult::Type::Level;
break;
}
@ -95,22 +95,22 @@ struct UniqueResult
{
if (areaId == pair.first)
{
resultType = UniqueResult::UNIQUE_AREA;
resultType = UniqueResult::Type::Area;
}
else if (levelId == lpair.first)
{
resultType = UniqueResult::UNIQUE_LEVEL;
resultType = UniqueResult::Type::Level;
break;
}
else
{
m_type = UniqueResult::UNIQUE_PAK;
m_type = UniqueResult::Type::Pak;
return;
}
continue;
}
else
resultType = UniqueResult::UNIQUE_LAYER;
resultType = UniqueResult::Type::Layer;
levelName = &lpair.second.name;
levelId = lpair.first;
areaId = pair.first;
@ -125,22 +125,22 @@ struct UniqueResult
{
if (areaId == pair.first)
{
resultType = UniqueResult::UNIQUE_AREA;
resultType = UniqueResult::Type::Area;
}
else if (levelId == lpair.first)
{
resultType = UniqueResult::UNIQUE_LEVEL;
resultType = UniqueResult::Type::Level;
break;
}
else
{
m_type = UniqueResult::UNIQUE_PAK;
m_type = UniqueResult::Type::Pak;
return;
}
continue;
}
else
resultType = UniqueResult::UNIQUE_AREA;
resultType = UniqueResult::Type::Area;
levelName = &lpair.second.name;
levelId = lpair.first;
areaId = pair.first;
@ -150,11 +150,11 @@ struct UniqueResult
}
m_type = resultType;
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);
m_areaName = &area.name;
if (resultType == UniqueResult::UNIQUE_LAYER)
if (resultType == UniqueResult::Type::Layer)
{
const typename PAKBRIDGE::Level::Area::Layer& layer = area.layers[layerIdx];
m_layerName = &layer.name;
@ -164,7 +164,7 @@ struct UniqueResult
HECL::ProjectPath uniquePath(const HECL::ProjectPath& pakPath) const
{
if (m_type == UNIQUE_PAK)
if (m_type == Type::Pak)
return pakPath;
HECL::ProjectPath levelDir;
@ -174,13 +174,13 @@ struct UniqueResult
levelDir = pakPath;
levelDir.makeDir();
if (m_type == UNIQUE_AREA)
if (m_type == Type::Area)
{
HECL::ProjectPath areaDir(levelDir, *m_areaName);
areaDir.makeDir();
return areaDir;
}
else if (m_type == UNIQUE_LAYER)
else if (m_type == Type::Layer)
{
HECL::ProjectPath areaDir(levelDir, *m_areaName);
areaDir.makeDir();
@ -521,7 +521,7 @@ public:
/* TODO: Position after extracted 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);
FILE* fout = HECL::Fopen(cooked.getAbsolutePath().c_str(), _S("wb"));
@ -532,7 +532,7 @@ public:
HECL::ProjectPath working = getWorking(item, extractor);
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);
extractor.func_a(s, working);
@ -540,7 +540,7 @@ public:
}
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);
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();
switch (DataType(parmType))
{
case DataType::DTInt32:
case DataType::Int32:
parmVals[0].int32 = reader.readInt32Big();
parmVals[1].int32 = reader.readInt32Big();
break;
case DataType::DTUInt32:
case DataType::DTEnum:
case DataType::UInt32:
case DataType::Enum:
parmVals[0].uint32 = reader.readUint32Big();
parmVals[1].uint32 = reader.readUint32Big();
break;
case DataType::DTFloat:
case DataType::Float:
parmVals[0].float32 = reader.readFloatBig();
parmVals[1].float32 = reader.readFloatBig();
break;
case DataType::DTBool:
case DataType::Bool:
parmVals[0].bool1 = reader.readBool();
parmVals[1].bool1 = reader.readBool();
break;
@ -39,20 +39,20 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::write(
writer.writeFloatBig(unk2);
switch (DataType(parmType))
{
case DataType::DTInt32:
case DataType::Int32:
writer.writeInt32Big(parmVals[0].int32);
writer.writeInt32Big(parmVals[1].int32);
break;
case DataType::DTUInt32:
case DataType::DTEnum:
case DataType::UInt32:
case DataType::Enum:
writer.writeUint32Big(parmVals[0].uint32);
writer.writeUint32Big(parmVals[0].uint32);
break;
case DataType::DTFloat:
case DataType::Float:
writer.writeFloatBig(parmVals[0].float32);
writer.writeFloatBig(parmVals[0].float32);
break;
case DataType::DTBool:
case DataType::Bool:
writer.writeBool(parmVals[0].bool1);
writer.writeBool(parmVals[0].bool1);
break;
@ -64,13 +64,13 @@ size_t ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::bina
__isz += 12;
switch (DataType(parmType))
{
case DataType::DTInt32:
case DataType::DTUInt32:
case DataType::DTEnum:
case DataType::DTFloat:
case DataType::Int32:
case DataType::UInt32:
case DataType::Enum:
case DataType::Float:
__isz += 8;
break;
case DataType::DTBool:
case DataType::Bool:
__isz += 2;
break;
}
@ -85,20 +85,20 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::fromYA
reader.enterSubVector("parmVals");
switch (DataType(parmType))
{
case DataType::DTInt32:
case DataType::Int32:
parmVals[0].int32 = reader.readInt32(nullptr);
parmVals[1].int32 = reader.readInt32(nullptr);
break;
case DataType::DTUInt32:
case DataType::DTEnum:
case DataType::UInt32:
case DataType::Enum:
parmVals[0].uint32 = reader.readUint32(nullptr);
parmVals[1].uint32 = reader.readUint32(nullptr);
break;
case DataType::DTFloat:
case DataType::Float:
parmVals[0].float32 = reader.readFloat(nullptr);
parmVals[1].float32 = reader.readFloat(nullptr);
break;
case DataType::DTBool:
case DataType::Bool:
parmVals[0].bool1 = reader.readBool(nullptr);
parmVals[1].bool1 = reader.readBool(nullptr);
break;
@ -115,20 +115,20 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::toYAML
writer.enterSubVector("parmVals");
switch (DataType(parmType))
{
case DataType::DTInt32:
case DataType::Int32:
writer.writeInt32(nullptr, parmVals[0].int32);
writer.writeInt32(nullptr, parmVals[1].int32);
break;
case DataType::DTUInt32:
case DataType::DTEnum:
case DataType::UInt32:
case DataType::Enum:
writer.writeUint32(nullptr, parmVals[0].uint32);
writer.writeUint32(nullptr, parmVals[0].uint32);
break;
case DataType::DTFloat:
case DataType::Float:
writer.writeFloat(nullptr, parmVals[0].float32);
writer.writeFloat(nullptr, parmVals[0].float32);
break;
case DataType::DTBool:
case DataType::Bool:
writer.writeBool(nullptr, parmVals[0].bool1);
writer.writeBool(nullptr, parmVals[0].bool1);
break;
@ -160,17 +160,17 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(Athena::io:
{
switch (ParmInfo::DataType(pi.parmType))
{
case ParmInfo::DTInt32:
case ParmInfo::DataType::Int32:
ai.parmVals.emplace_back(reader.readInt32Big());
break;
case ParmInfo::DTUInt32:
case ParmInfo::DTEnum:
case ParmInfo::DataType::UInt32:
case ParmInfo::DataType::Enum:
ai.parmVals.emplace_back(reader.readUint32Big());
break;
case ParmInfo::DTFloat:
case ParmInfo::DataType::Float:
ai.parmVals.emplace_back(reader.readFloatBig());
break;
case ParmInfo::DTBool:
case ParmInfo::DataType::Bool:
ai.parmVals.emplace_back(reader.readBool());
break;
default: break;
@ -199,17 +199,17 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::write(Athena::io
pVal = *it++;
switch (ParmInfo::DataType(pi.parmType))
{
case ParmInfo::DTInt32:
case ParmInfo::DataType::Int32:
writer.writeInt32Big(pVal.int32);
break;
case ParmInfo::DTUInt32:
case ParmInfo::DTEnum:
case ParmInfo::DataType::UInt32:
case ParmInfo::DataType::Enum:
writer.writeUint32Big(pVal.uint32);
break;
case ParmInfo::DTFloat:
case ParmInfo::DataType::Float:
writer.writeFloatBig(pVal.float32);
break;
case ParmInfo::DTBool:
case ParmInfo::DataType::Bool:
writer.writeBool(pVal.bool1);
break;
default: break;
@ -228,13 +228,13 @@ size_t ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::binarySize(siz
{
switch (ParmInfo::DataType(pi.parmType))
{
case ParmInfo::DTInt32:
case ParmInfo::DTUInt32:
case ParmInfo::DTEnum:
case ParmInfo::DTFloat:
case ParmInfo::DataType::Int32:
case ParmInfo::DataType::UInt32:
case ParmInfo::DataType::Enum:
case ParmInfo::DataType::Float:
__isz += animInfos.size() * 4;
break;
case ParmInfo::DTBool:
case ParmInfo::DataType::Bool:
__isz += animInfos.size();
break;
default: break;
@ -262,17 +262,17 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::fromYAML(Athena:
{
switch (ParmInfo::DataType(pi.parmType))
{
case ParmInfo::DTInt32:
case ParmInfo::DataType::Int32:
ai.parmVals.emplace_back(reader.readInt32(nullptr));
break;
case ParmInfo::DTUInt32:
case ParmInfo::DTEnum:
case ParmInfo::DataType::UInt32:
case ParmInfo::DataType::Enum:
ai.parmVals.emplace_back(reader.readUint32(nullptr));
break;
case ParmInfo::DTFloat:
case ParmInfo::DataType::Float:
ai.parmVals.emplace_back(reader.readFloat(nullptr));
break;
case ParmInfo::DTBool:
case ParmInfo::DataType::Bool:
ai.parmVals.emplace_back(reader.readBool(nullptr));
break;
default: break;
@ -303,17 +303,17 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::toYAML(Athena::i
pVal = *it++;
switch (ParmInfo::DataType(pi.parmType))
{
case ParmInfo::DTInt32:
case ParmInfo::DataType::Int32:
writer.writeInt32(nullptr, pVal.int32);
break;
case ParmInfo::DTUInt32:
case ParmInfo::DTEnum:
case ParmInfo::DataType::UInt32:
case ParmInfo::DataType::Enum:
writer.writeUint32(nullptr, pVal.uint32);
break;
case ParmInfo::DTFloat:
case ParmInfo::DataType::Float:
writer.writeFloat(nullptr, pVal.float32);
break;
case ParmInfo::DTBool:
case ParmInfo::DataType::Bool:
writer.writeBool(nullptr, pVal.bool1);
break;
default: break;
@ -665,23 +665,23 @@ void ANCS::AnimationSet::MetaAnimFactory::read(Athena::io::IStreamReader& reader
IMetaAnim::Type type(IMetaAnim::Type(reader.readUint32Big()));
switch (type)
{
case IMetaAnim::MAPrimitive:
case IMetaAnim::Type::Primitive:
m_anim.reset(new struct MetaAnimPrimitive);
m_anim->read(reader);
break;
case IMetaAnim::MABlend:
case IMetaAnim::Type::Blend:
m_anim.reset(new struct MetaAnimBlend);
m_anim->read(reader);
break;
case IMetaAnim::MAPhaseBlend:
case IMetaAnim::Type::PhaseBlend:
m_anim.reset(new struct MetaAnimPhaseBlend);
m_anim->read(reader);
break;
case IMetaAnim::MARandom:
case IMetaAnim::Type::Random:
m_anim.reset(new struct MetaAnimRandom);
m_anim->read(reader);
break;
case IMetaAnim::MASequence:
case IMetaAnim::Type::Sequence:
m_anim.reset(new struct MetaAnimSequence);
m_anim->read(reader);
break;
@ -695,7 +695,7 @@ void ANCS::AnimationSet::MetaAnimFactory::write(Athena::io::IStreamWriter& write
{
if (!m_anim)
return;
writer.writeInt32Big(m_anim->m_type);
writer.writeInt32Big(atUint32(m_anim->m_type));
m_anim->write(writer);
}
@ -760,19 +760,19 @@ void ANCS::AnimationSet::MetaTransFactory::read(Athena::io::IStreamReader& reade
IMetaTrans::Type type(IMetaTrans::Type(reader.readUint32Big()));
switch (type)
{
case IMetaTrans::MTMetaAnim:
case IMetaTrans::Type::MetaAnim:
m_trans.reset(new struct MetaTransMetaAnim);
m_trans->read(reader);
break;
case IMetaTrans::MTTrans:
case IMetaTrans::Type::Trans:
m_trans.reset(new struct MetaTransTrans);
m_trans->read(reader);
break;
case IMetaTrans::MTPhaseTrans:
case IMetaTrans::Type::PhaseTrans:
m_trans.reset(new struct MetaTransPhaseTrans);
m_trans->read(reader);
break;
case IMetaTrans::MTNoTrans:
case IMetaTrans::Type::NoTrans:
default:
m_trans.reset(nullptr);
break;
@ -783,10 +783,10 @@ void ANCS::AnimationSet::MetaTransFactory::write(Athena::io::IStreamWriter& writ
{
if (!m_trans)
{
writer.writeInt32Big(IMetaTrans::MTNoTrans);
writer.writeInt32Big(atUint32(IMetaTrans::Type::NoTrans));
return;
}
writer.writeInt32Big(m_trans->m_type);
writer.writeInt32Big(atUint32(m_trans->m_type));
m_trans->write(writer);
}

View File

@ -66,13 +66,13 @@ struct ANCS : BigYAML
{
DECL_YAML
Delete expl;
enum DataType
enum class DataType
{
DTInt32 = 0,
DTUInt32 = 1,
DTFloat = 2,
DTBool = 3,
DTEnum = 4
Int32 = 0,
UInt32 = 1,
Float = 2,
Bool = 3,
Enum = 4
};
union Parm
{
@ -159,13 +159,13 @@ struct ANCS : BigYAML
{
Delete expl;
virtual ~IMetaAnim() {}
enum Type
enum class Type
{
MAPrimitive = 0,
MABlend = 1,
MAPhaseBlend = 2,
MARandom = 3,
MASequence = 4
Primitive = 0,
Blend = 1,
PhaseBlend = 2,
Random = 3,
Sequence = 4
} m_type;
const char* m_typeStr;
IMetaAnim(Type type, const char* typeStr)
@ -180,7 +180,7 @@ struct ANCS : BigYAML
};
struct MetaAnimPrimitive : IMetaAnim
{
MetaAnimPrimitive() : IMetaAnim(MAPrimitive, "Primitive") {}
MetaAnimPrimitive() : IMetaAnim(Type::Primitive, "Primitive") {}
DECL_YAML
UniqueID32 animId;
Value<atUint32> animIdx;
@ -195,7 +195,7 @@ struct ANCS : BigYAML
};
struct MetaAnimBlend : IMetaAnim
{
MetaAnimBlend() : IMetaAnim(MABlend, "Blend") {}
MetaAnimBlend() : IMetaAnim(Type::Blend, "Blend") {}
DECL_YAML
MetaAnimFactory animA;
MetaAnimFactory animB;
@ -210,7 +210,7 @@ struct ANCS : BigYAML
};
struct MetaAnimPhaseBlend : IMetaAnim
{
MetaAnimPhaseBlend() : IMetaAnim(MAPhaseBlend, "PhaseBlend") {}
MetaAnimPhaseBlend() : IMetaAnim(Type::PhaseBlend, "PhaseBlend") {}
DECL_YAML
MetaAnimFactory animA;
MetaAnimFactory animB;
@ -225,7 +225,7 @@ struct ANCS : BigYAML
};
struct MetaAnimRandom : IMetaAnim
{
MetaAnimRandom() : IMetaAnim(MARandom, "Random") {}
MetaAnimRandom() : IMetaAnim(Type::Random, "Random") {}
DECL_YAML
Value<atUint32> animCount;
struct Child : BigYAML
@ -244,7 +244,7 @@ struct ANCS : BigYAML
};
struct MetaAnimSequence : IMetaAnim
{
MetaAnimSequence() : IMetaAnim(MASequence, "Sequence") {}
MetaAnimSequence() : IMetaAnim(Type::Sequence, "Sequence") {}
DECL_YAML
Value<atUint32> animCount;
Vector<MetaAnimFactory, DNA_COUNT(animCount)> children;
@ -268,12 +268,12 @@ struct ANCS : BigYAML
{
Delete expl;
virtual ~IMetaTrans() {}
enum Type
enum class Type
{
MTMetaAnim = 0,
MTTrans = 1,
MTPhaseTrans = 2,
MTNoTrans = 3,
MetaAnim = 0,
Trans = 1,
PhaseTrans = 2,
NoTrans = 3,
} m_type;
const char* m_typeStr;
IMetaTrans(Type type, const char* typeStr)
@ -287,13 +287,13 @@ struct ANCS : BigYAML
};
struct MetaTransMetaAnim : IMetaTrans
{
MetaTransMetaAnim() : IMetaTrans(MTMetaAnim, "MetaAnim") {}
MetaTransMetaAnim() : IMetaTrans(Type::MetaAnim, "MetaAnim") {}
DECL_YAML
MetaAnimFactory anim;
};
struct MetaTransTrans : IMetaTrans
{
MetaTransTrans() : IMetaTrans(MTTrans, "Trans") {}
MetaTransTrans() : IMetaTrans(Type::Trans, "Trans") {}
DECL_YAML
Value<float> time;
Value<atUint32> unk1;
@ -303,7 +303,7 @@ struct ANCS : BigYAML
};
struct MetaTransPhaseTrans : IMetaTrans
{
MetaTransPhaseTrans() : IMetaTrans(MTPhaseTrans, "PhaseTrans") {}
MetaTransPhaseTrans() : IMetaTrans(Type::PhaseTrans, "PhaseTrans") {}
DECL_YAML
Value<float> time;
Value<atUint32> unk1;
@ -397,25 +397,25 @@ struct ANCS : BigYAML
std::function<void(const HECL::SystemChar*)> fileChanged)
{
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::PathType blendType = blendPath.getPathType();
HECL::ProjectPath::Type blendType = blendPath.getPathType();
if (force ||
yamlType == HECL::ProjectPath::PT_NONE ||
blendType == HECL::ProjectPath::PT_NONE)
yamlType == HECL::ProjectPath::Type::None ||
blendType == HECL::ProjectPath::Type::None)
{
ANCS ancs;
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"));
ancs.toYAMLFile(fp);
fclose(fp);
}
if (force || blendType == HECL::ProjectPath::PT_NONE)
if (force || blendType == HECL::ProjectPath::Type::None)
{
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
DNAANCS::ReadANCSToBlender<PAKRouter<PAKBridge>, ANCS, MaterialSet, DNACMDL::SurfaceHeader_1_2, 2>
@ -432,7 +432,7 @@ struct ANCS : BigYAML
{
/* Search for yaml */
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"),
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)
{
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)
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)
{
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)
ao.write(*frameit++, val.v3.vec[c]);
}
@ -98,13 +98,13 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader)
atUint8 idx = reader.readUByte();
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION;
chan.type = DNAANIM::Channel::Type::Rotation;
if (idx != 0xff)
{
bones.back().second = true;
channels.emplace_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();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION;
chan.type = DNAANIM::Channel::Type::Rotation;
chan.i[0] = desc.initRX;
chan.q[0] = desc.qRX;
chan.i[1] = desc.initRY;
@ -287,7 +287,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION;
chan.type = DNAANIM::Channel::Type::Translation;
chan.i[0] = desc.initTX;
chan.q[0] = desc.qTX;
chan.i[1] = desc.initTY;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -68,7 +68,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Rename MREA for consistency */
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;
/* Do extract */
@ -77,7 +77,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
rs.seekAlign32();
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(mreaPath, HECL::BlenderConnection::TypeArea))
if (!conn.createBlend(mreaPath, HECL::BlenderConnection::BlendType::Area))
return false;
/* Open Py Stream and read sections */

View File

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

View File

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

View File

@ -41,11 +41,11 @@ void SCLY::exportToLayerDirectories(const PAK::Entry& entry, PAKRouter<PAKBridge
for (atUint32 i = 0; i < layerCount; 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();
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"));
layers[i].toYAMLFile(yaml);

View File

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

View File

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

View File

@ -220,25 +220,25 @@ struct ANCS : BigYAML
std::function<void(const HECL::SystemChar*)> fileChanged)
{
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::PathType blendType = blendPath.getPathType();
HECL::ProjectPath::Type blendType = blendPath.getPathType();
if (force ||
yamlType == HECL::ProjectPath::PT_NONE ||
blendType == HECL::ProjectPath::PT_NONE)
yamlType == HECL::ProjectPath::Type::None ||
blendType == HECL::ProjectPath::Type::None)
{
ANCS ancs;
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"));
ancs.toYAMLFile(fp);
fclose(fp);
}
if (force || blendType == HECL::ProjectPath::PT_NONE)
if (force || blendType == HECL::ProjectPath::Type::None)
{
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
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)
{
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)
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)
{
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)
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)
{
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)
ao.write(*frameit++, val.v3.vec[c]);
}
@ -147,21 +147,21 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader)
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION;
chan.type = DNAANIM::Channel::Type::Rotation;
chanKeys.emplace_back();
}
if (std::get<1>(bone.second))
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION;
chan.type = DNAANIM::Channel::Type::Translation;
chanKeys.emplace_back();
}
if (std::get<2>(bone.second))
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::SCALE;
chan.type = DNAANIM::Channel::Type::Scale;
chanKeys.emplace_back();
}
}
@ -405,7 +405,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION;
chan.type = DNAANIM::Channel::Type::Rotation;
chan.i[0] = desc.initRX;
chan.q[0] = desc.qRX;
chan.i[1] = desc.initRY;
@ -419,7 +419,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION;
chan.type = DNAANIM::Channel::Type::Translation;
chan.i[0] = desc.initTX;
chan.q[0] = desc.qTX;
chan.i[1] = desc.initTY;
@ -433,7 +433,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::SCALE;
chan.type = DNAANIM::Channel::Type::Scale;
chan.i[0] = desc.initSX;
chan.q[0] = desc.qSX;
chan.i[1] = desc.initSY;

View File

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

View File

@ -38,7 +38,7 @@ struct MaterialSet : BigDNA
Vector<atUint32, DNA_COUNT(flags.konstValuesEnabled())> konstCount;
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> blendSrcFac;
Vector<atUint32, DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot;

View File

@ -20,7 +20,7 @@ struct DeafBabe : BigDNA
bool fireThrough() const {return material >> 18 & 0x1;}
void setFireThrough(bool v) {material &= ~0x40000; material |= v << 18;}
enum Type
enum class Type
{
Mat0,
MatGround,
@ -34,7 +34,7 @@ struct DeafBabe : BigDNA
MatLeaves
};
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;

View File

@ -169,7 +169,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Rename MREA for consistency */
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;
/* Do extract */
@ -191,7 +191,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Start up blender connection */
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(mreaPath, HECL::BlenderConnection::TypeArea))
if (!conn.createBlend(mreaPath, HECL::BlenderConnection::BlendType::Area))
return false;
/* Open Py Stream and read sections */

View File

@ -86,19 +86,19 @@ struct MREA
{
DECL_DNA
Value<atUint32> flags;
enum ThermalLevel
enum class ThermalLevel
{
ThermalCool,
ThermalHot,
ThermalWarm
Cool,
Hot,
Warm
};
static const char* GetThermalLevelStr(ThermalLevel t)
{
switch (t)
{
case ThermalCool: return "COOL";
case ThermalHot: return "HOT";
case ThermalWarm: return "WARM";
case ThermalLevel::Cool: return "COOL";
case ThermalLevel::Hot: return "HOT";
case ThermalLevel::Warm: return "WARM";
default: break;
}
return nullptr;
@ -110,7 +110,7 @@ struct MREA
bool disableXray() const {return flags >> 3 & 0x1;}
void setDisableXray(bool v) {flags &= ~0x8; flags |= v << 3;}
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());}
} visorFlags;
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)
{
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)
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)
{
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)
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)
{
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)
ao.write(*frameit++, val.v3.vec[c]);
}
@ -159,7 +159,7 @@ void ANIM::ANIM0::read(Athena::io::IStreamReader& reader)
channels.clear();
chanKeys.clear();
channels.emplace_back();
channels.back().type = DNAANIM::Channel::KF_HEAD;
channels.back().type = DNAANIM::Channel::Type::KfHead;
chanKeys.emplace_back();
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();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION;
chan.type = DNAANIM::Channel::Type::Rotation;
chanKeys.emplace_back();
}
if (std::get<1>(bone.second))
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION;
chan.type = DNAANIM::Channel::Type::Translation;
chanKeys.emplace_back();
}
if (std::get<2>(bone.second))
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::SCALE;
chan.type = DNAANIM::Channel::Type::Scale;
chanKeys.emplace_back();
}
}
@ -469,7 +469,7 @@ void ANIM::ANIM1::read(Athena::io::IStreamReader& reader)
channels.clear();
channels.reserve(boneChannelCount + 1);
channels.emplace_back();
channels.back().type = DNAANIM::Channel::KF_HEAD;
channels.back().type = DNAANIM::Channel::Type::KfHead;
auto initsIt = initBlock.begin();
auto bitsIt = chanBitCounts.begin();
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();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::ROTATION_MP3;
chan.type = DNAANIM::Channel::Type::RotationMP3;
chan.i[0] = *initsIt++;
chan.q[0] = *bitsIt++;
chan.i[1] = *initsIt++;
@ -493,7 +493,7 @@ void ANIM::ANIM1::read(Athena::io::IStreamReader& reader)
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::TRANSLATION;
chan.type = DNAANIM::Channel::Type::Translation;
chan.i[0] = *initsIt++;
chan.q[0] = *bitsIt++;
chan.i[1] = *initsIt++;
@ -506,7 +506,7 @@ void ANIM::ANIM1::read(Athena::io::IStreamReader& reader)
{
channels.emplace_back();
DNAANIM::Channel& chan = channels.back();
chan.type = DNAANIM::Channel::SCALE;
chan.type = DNAANIM::Channel::Type::Scale;
chan.i[0] = *initsIt++;
chan.q[0] = *bitsIt++;
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()));
switch (type)
{
case IMetaAnim::MAPrimitive:
case IMetaAnim::Type::Primitive:
m_anim.reset(new struct MetaAnimPrimitive);
m_anim->read(reader);
break;
case IMetaAnim::MABlend:
case IMetaAnim::Type::Blend:
m_anim.reset(new struct MetaAnimBlend);
m_anim->read(reader);
break;
case IMetaAnim::MAPhaseBlend:
case IMetaAnim::Type::PhaseBlend:
m_anim.reset(new struct MetaAnimPhaseBlend);
m_anim->read(reader);
break;
case IMetaAnim::MARandom:
case IMetaAnim::Type::Random:
m_anim.reset(new struct MetaAnimRandom);
m_anim->read(reader);
break;
case IMetaAnim::MASequence:
case IMetaAnim::Type::Sequence:
m_anim.reset(new struct MetaAnimSequence);
m_anim->read(reader);
break;
@ -114,7 +114,7 @@ void CHAR::AnimationInfo::MetaAnimFactory::write(Athena::io::IStreamWriter& writ
{
if (!m_anim)
return;
writer.writeInt32Big(m_anim->m_type);
writer.writeInt32Big(atInt32(m_anim->m_type));
m_anim->write(writer);
}

View File

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

View File

@ -38,7 +38,7 @@ struct CMDL
/* Do extract */
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(outPath, HECL::BlenderConnection::TypeMesh))
if (!conn.createBlend(outPath, HECL::BlenderConnection::BlendType::Mesh))
return false;
DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, DNACMDL::SurfaceHeader_3, 5>
(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);
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();
}
@ -119,7 +119,7 @@ void Material::SectionPASS::constructNode(HECL::BlenderConnection::PyOutStream&
const NOD::Node* node;
const PAK::Entry* texEntry = pakRouter.lookupEntry(txtrId, &node);
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);
TXTR::Extract(rs, txtrPath);
@ -148,7 +148,7 @@ void Material::SectionPASS::constructNode(HECL::BlenderConnection::PyOutStream&
}
/* Special case for RFLV (environment UV mask) */
if (subtype.toUint32() == RFLV)
if (Subtype(subtype.toUint32()) == Subtype::RFLV)
{
if (txtrId)
out << "rflv_tex_node = texture_nodes[-1]\n";
@ -159,63 +159,63 @@ void Material::SectionPASS::constructNode(HECL::BlenderConnection::PyOutStream&
bool linkRAS = false;
out << "prev_pnode = pnode\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";
linkRAS = true;
break;
case RIML:
case Subtype::RIML:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassRIML']\n";
if (idx == 0)
linkRAS = true;
break;
case BLOL:
case Subtype::BLOL:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassBLOL']\n";
if (idx == 0)
linkRAS = true;
break;
case BLOD:
case Subtype::BLOD:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassBLOD']\n";
if (idx == 0)
linkRAS = true;
break;
case CLR:
case Subtype::CLR:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassCLR']\n";
if (idx == 0)
linkRAS = true;
break;
case TRAN:
case Subtype::TRAN:
if (flags.TRANInvert())
out << "pnode.node_tree = bpy.data.node_groups['RetroPassTRANInv']\n";
else
out << "pnode.node_tree = bpy.data.node_groups['RetroPassTRAN']\n";
break;
case INCA:
case Subtype::INCA:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassINCA']\n";
break;
case RFLV:
case Subtype::RFLV:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassRFLV']\n";
break;
case RFLD:
case Subtype::RFLD:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassRFLD']\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['Value'], pnode.inputs['Mask Alpha'])\n";
break;
case LRLD:
case Subtype::LRLD:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassLRLD']\n";
break;
case LURD:
case Subtype::LURD:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassLURD']\n";
break;
case BLOI:
case Subtype::BLOI:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassBLOI']\n";
break;
case XRAY:
case Subtype::XRAY:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassXRAY']\n";
break;
case TOON:
case Subtype::TOON:
out << "pnode.node_tree = bpy.data.node_groups['RetroPassTOON']\n";
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";
else if (prevSection)
{
if (prevSection->m_type == ISection::PASS &&
static_cast<const SectionPASS*>(prevSection)->subtype.toUint32() != RFLV)
if (prevSection->m_type == ISection::Type::PASS &&
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"
"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"
"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
{
DNAMP1::MaterialSet::Material::AddKcolor(out, color, kColorIdx++);
switch (subtype)
switch (Subtype(subtype.toUint32()))
{
case DIFB:
case Subtype::DIFB:
out << "kc_node.label += ' DIFB'\n"
"ka_node.label += ' DIFB'\n";
break;
@ -275,21 +275,21 @@ void Material::SectionINT::constructNode(HECL::BlenderConnection::PyOutStream& o
unsigned& texMtxIdx,
unsigned& kColorIdx) const
{
switch (subtype)
switch (Subtype(subtype.toUint32()))
{
case OPAC:
case Subtype::OPAC:
out.format("new_material.retro_opac = %d\n", value);
break;
case BLOD:
case Subtype::BLOD:
out.format("new_material.retro_blod = %d\n", value);
break;
case BLOI:
case Subtype::BLOI:
out.format("new_material.retro_bloi = %d\n", value);
break;
case BNIF:
case Subtype::BNIF:
out.format("new_material.retro_bnif = %d\n", value);
break;
case XRBR:
case Subtype::XRBR:
out.format("new_material.retro_xrbr = %d\n", value);
break;
default: break;

View File

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

View File

@ -79,7 +79,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Rename MREA for consistency */
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;
/* Do extract */
@ -104,7 +104,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
/* Start up blender connection */
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
if (!conn.createBlend(mreaPath, HECL::BlenderConnection::TypeArea))
if (!conn.createBlend(mreaPath, HECL::BlenderConnection::BlendType::Area))
return false;
/* Open Py Stream and read sections */

View File

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

View File

@ -84,7 +84,7 @@ void SpecBase::doExtract(const ExtractPassInfo& info, FProgress progress)
NOD::Partition* data = m_disc->getDataPartition();
const NOD::Node& root = data->getFSTRoot();
for (const NOD::Node& child : root)
if (child.getKind() == NOD::Node::NODE_FILE)
if (child.getKind() == NOD::Node::Kind::File)
child.extractToDirectory(target, ctx);
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();
if (!conn.openBlend(path))
return false;
if (conn.getBlendType() != HECL::BlenderConnection::TypeNone)
if (conn.getBlendType() != HECL::BlenderConnection::BlendType::None)
return true;
}
else if (HECL::IsPathPNG(path))
@ -129,19 +129,19 @@ void SpecBase::doCook(const HECL::ProjectPath& path, const HECL::ProjectPath& co
return;
switch (conn.getBlendType())
{
case HECL::BlenderConnection::TypeMesh:
case HECL::BlenderConnection::BlendType::Mesh:
{
HECL::BlenderConnection::DataStream ds = conn.beginData();
cookMesh(cookedPath, path, ds, fast, progress);
break;
}
case HECL::BlenderConnection::TypeActor:
case HECL::BlenderConnection::BlendType::Actor:
{
HECL::BlenderConnection::DataStream ds = conn.beginData();
cookActor(cookedPath, path, ds, fast, progress);
break;
}
case HECL::BlenderConnection::TypeArea:
case HECL::BlenderConnection::BlendType::Area:
{
HECL::BlenderConnection::DataStream ds = conn.beginData();
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,
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(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") {}
CIOWin::EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{
return MsgRetNormal;
return EMessageReturn::Normal;
}
};

View File

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

View File

@ -7,12 +7,12 @@
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
{
protected:
enum Flags
enum class Flags
{
Unknown5 = (1 << 5),
Unknown6 = (1 << 6),
@ -55,7 +55,7 @@ public:
virtual Zeus::CVector3f GetOrbitPosition()
{ 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, 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 */
enum EStateMsg
enum class EStateMsg
{
};
enum EListenNoiseType
enum class EListenNoiseType
{
};

View File

@ -9,25 +9,25 @@ namespace Retro
{
class CIOWin;
enum EArchMsgTarget
enum class EArchMsgTarget
{
TargetIOWinManager = 0,
TargetGame = 1
IOWinManager = 0,
Game = 1
};
enum EArchMsgType
enum class EArchMsgType
{
MsgRemoveIOWin = 0,
MsgCreateIOWin = 1,
MsgChangeIOWinPriority = 2,
MsgRemoveAllIOWins = 3,
MsgTimerTick = 4,
MsgUserInput = 5,
MsgSetGameState = 6,
MsgControllerStatus = 7,
MsgQuitGameplay = 8,
MsgUpdateBegin = 10,
MsgFrameBegin = 11,
RemoveIOWin = 0,
CreateIOWin = 1,
ChangeIOWinPriority = 2,
RemoveAllIOWins = 3,
TimerTick = 4,
UserInput = 5,
SetGameState = 6,
ControllerStatus = 7,
QuitGameplay = 8,
UpdateBegin = 10,
FrameBegin = 11,
};
struct IArchMsgParm
@ -101,11 +101,11 @@ class MakeMsg
public:
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)
{
return CArchitectureMessage(target, MsgControllerStatus, new CArchMsgParmControllerStatus(a, b));
return CArchitectureMessage(target, EArchMsgType::ControllerStatus, new CArchMsgParmControllerStatus(a, b));
}
static const CArchMsgParmInt32& GetParmNewGameflowState(const CArchitectureMessage& msg)
{
@ -117,7 +117,7 @@ public:
}
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)
{
@ -125,7 +125,7 @@ public:
}
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)
{
@ -137,7 +137,7 @@ public:
}
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)
{

View File

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

View File

@ -11,11 +11,11 @@ public:
virtual bool IsComplete()=0;
virtual void PostCancelRequest()=0;
enum EMediaType
enum class EMediaType
{
MediaARAM = 0,
MediaReal = 1,
MediaNOD = 2
ARAM = 0,
Real = 1,
NOD = 2
};
virtual EMediaType GetMediaType() const=0;
};
@ -26,7 +26,7 @@ public:
void WaitUntilComplete();
bool IsComplete();
void PostCancelRequest();
EMediaType GetMediaType() const {return MediaNOD;}
EMediaType GetMediaType() const {return EMediaType::NOD;}
};
class CDvdRequest : public IDvdRequest
@ -34,7 +34,7 @@ class CDvdRequest : public IDvdRequest
void WaitUntilComplete();
bool IsComplete();
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)
{
case MsgActivate:
case EScriptObjectMessage::Activate:
if (!GetActive())
{
SetActive(true);
SendScriptMsgs(StActive, stateMgr, MsgNone);
SendScriptMsgs(EScriptObjectState::Active, stateMgr, EScriptObjectMessage::None);
}
break;
case MsgDeactivate:
case EScriptObjectMessage::Deactivate:
if (GetActive())
{
SetActive(false);
SendScriptMsgs(StInactive, stateMgr, MsgNone);
SendScriptMsgs(EScriptObjectState::Inactive, stateMgr, EScriptObjectMessage::None);
}
break;
case MsgToggleActive:
case EScriptObjectMessage::ToggleActive:
if (GetActive())
{
SetActive(false);
SendScriptMsgs(StInactive, stateMgr, MsgNone);
SendScriptMsgs(EScriptObjectState::Inactive, stateMgr, EScriptObjectMessage::None);
}
else
{
SetActive(true);
SendScriptMsgs(StActive, stateMgr, MsgNone);
SendScriptMsgs(EScriptObjectState::Active, stateMgr, EScriptObjectMessage::None);
}
break;
default: break;

View File

@ -9,15 +9,15 @@ class CFinalInput;
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
{
public:
enum EReturnValue
enum class EReturnValue
{
};

View File

@ -14,12 +14,12 @@ class CIOWin
std::string m_name;
size_t m_nameHash;
public:
enum EMessageReturn
enum class EMessageReturn
{
MsgRetNormal = 0,
MsgRetExit = 1,
MsgRetRemoveIOWinAndExit = 2,
MsgRetRemoveIOWin = 3
Normal = 0,
Exit = 1,
RemoveIOWinAndExit = 2,
RemoveIOWin = 3
};
virtual ~CIOWin() {}
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())
{
case MsgRemoveIOWin:
case EArchMsgType::RemoveIOWin:
{
const CArchMsgParmVoidPtr& parm = MakeMsg::GetParmDeleteIOWin(msg);
CIOWin* iow = FindIOWin(*static_cast<const std::string*>(parm.x4_parm1));
@ -17,14 +17,14 @@ bool CIOWinManager::OnIOWinMessage(const CArchitectureMessage& msg)
RemoveIOWin(iow);
return false;
}
case MsgCreateIOWin:
case EArchMsgType::CreateIOWin:
{
const CArchMsgParmInt32Int32VoidPtr& parm = MakeMsg::GetParmCreateIOWin(msg);
rstl::rc_ptr<CIOWin> iow(static_cast<CIOWin*>(parm.xc_parm3));
AddIOWin(iow, parm.x4_parm1, parm.x8_parm2);
return false;
}
case MsgChangeIOWinPriority:
case EArchMsgType::ChangeIOWinPriority:
{
const CArchMsgParmInt32Int32VoidPtr& parm = MakeMsg::GetParmChangeIOWinPriority(msg);
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);
return false;
}
case MsgRemoveAllIOWins:
case EArchMsgType::RemoveAllIOWins:
{
RemoveAllIOWins();
return true;
@ -76,7 +76,7 @@ bool CIOWinManager::DistributeOneMessage(const CArchitectureMessage& msg,
while (x8_localGatherQueue)
{
CArchitectureMessage msg = x8_localGatherQueue.Pop();
if (msg.GetTarget() == TargetIOWinManager)
if (msg.GetTarget() == EArchMsgTarget::IOWinManager)
{
if (OnIOWinMessage(msg))
{
@ -91,16 +91,16 @@ bool CIOWinManager::DistributeOneMessage(const CArchitectureMessage& msg,
switch (mret)
{
case CIOWin::MsgRetRemoveIOWinAndExit:
case CIOWin::MsgRetRemoveIOWin:
case CIOWin::EMessageReturn::RemoveIOWinAndExit:
case CIOWin::EMessageReturn::RemoveIOWin:
RemoveIOWin(iow);
default: break;
}
switch (mret)
{
case CIOWin::MsgRetExit:
case CIOWin::MsgRetRemoveIOWinAndExit:
case CIOWin::EMessageReturn::Exit:
case CIOWin::EMessageReturn::RemoveIOWinAndExit:
return false;
default: break;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@ class CPlayMovieBase : public CIOWin
public:
CPlayMovieBase(const char* iowName, const char* path)
: 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 {}
};

View File

@ -40,12 +40,12 @@ CInputStream* CResLoader::LoadNewResourcePartSync(const SObjectTag& tag, int off
{
CCallStack cs(AT_PRETTY_FUNCTION, "UnknownType");
buf = CMemory::Alloc(length,
IAllocator::HintLarge,
IAllocator::ScopeDefault,
IAllocator::TypePrimitive,
IAllocator::EHint::Large,
IAllocator::EScope::Default,
IAllocator::EType::Primitive,
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);
}
@ -54,11 +54,11 @@ void CResLoader::LoadMemResourceSync(const SObjectTag& tag, void** bufOut, int*
CPakFile* file = FindResourceForLoad(tag);
CCallStack cs(AT_PRETTY_FUNCTION, "UnknownType");
void* buf = CMemory::Alloc(x50_cachedResInfo->x8_size,
IAllocator::HintLarge,
IAllocator::ScopeDefault,
IAllocator::TypePrimitive,
IAllocator::EHint::Large,
IAllocator::EScope::Default,
IAllocator::EType::Primitive,
cs);
file->SyncSeekRead(buf, x50_cachedResInfo->x8_size, OriginBegin,
file->SyncSeekRead(buf, x50_cachedResInfo->x8_size, ESeekOrigin::Begin,
x50_cachedResInfo->x4_offset);
*bufOut = buf;
*sizeOut = x50_cachedResInfo->x8_size;
@ -85,12 +85,12 @@ CInputStream* CResLoader::LoadNewResourceSync(const SObjectTag& tag, void* extBu
{
CCallStack cs(AT_PRETTY_FUNCTION, "UnknownType");
buf = CMemory::Alloc(resSz,
IAllocator::HintLarge,
IAllocator::ScopeDefault,
IAllocator::TypePrimitive,
IAllocator::EHint::Large,
IAllocator::EScope::Default,
IAllocator::EType::Primitive,
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);
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)
{
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)
{
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)
@ -161,7 +161,7 @@ void CResLoader::AsyncIdlePakLoading()
++it)
{
(*it)->AsyncIdle();
if ((*it)->x2c_asyncLoadPhase == CPakFile::PakAsyncLoaded)
if ((*it)->x2c_asyncLoadPhase == CPakFile::EAsyncPhase::Loaded)
{
MoveToCorrectLoadedList(std::move(*it));
it = x34_pakLoadingList.erase(it);

View File

@ -23,16 +23,16 @@ class IRenderer
public:
typedef void(*TDrawableCallback)(const void*, const void*, int);
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:
virtual ~IAllocator() {}
enum EHint
enum class EHint
{
HintNone = 0x0,
HintTopOfHeap = 0x1,
HintLarge = 0x2
None = 0x0,
TopOfHeap = 0x1,
Large = 0x2
};
enum EScope
enum class EScope
{
ScopeNone = 0,
ScopeDefault = 1
None = 0,
Default = 1
};
enum EType
enum class EType
{
TypePrimitive = 0,
TypeArray = 1
Primitive = 0,
Array = 1
};
struct SAllocInfo
{

View File

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

View File

@ -16,8 +16,8 @@ void CInputGenerator::Update(float dt, CArchitectureQueue& queue)
{
bool connected;
EStatusChange change = m_dolphinCb.getStatusChange(i, connected);
if (change)
queue.Push(std::move(MakeMsg::CreateControllerStatus(TargetGame, i, connected)));
if (change != EStatusChange::NoChange)
queue.Push(std::move(MakeMsg::CreateControllerStatus(EArchMsgTarget::Game, i, connected)));
if (connected)
{
CFinalInput input = m_dolphinCb.getFinalInput(i, dt, m_leftDiv, m_rightDiv);
@ -26,13 +26,13 @@ void CInputGenerator::Update(float dt, CArchitectureQueue& queue)
input |= kbInput;
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 */
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
{
enum EStatusChange
enum class EStatusChange
{
StatusNoChange = 0,
StatusConnected = 1,
StatusDisconnected = 2
NoChange = 0,
Connected = 1,
Disconnected = 2
};
/* When the sticks are used as logical (digital) input,
@ -41,11 +41,11 @@ public:
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)
{
m_data.m_mouseButtons[button] = false;
m_data.m_mouseButtons[int(button)] = false;
}
void mouseMove(const boo::SWindowCoord& coord)
{
@ -72,19 +72,19 @@ public:
}
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)
{
m_data.m_specialKeys[key] = false;
m_data.m_specialKeys[int(key)] = false;
}
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)
{
m_data.m_modMask = boo::EModifierKey(m_data.m_modMask & ~mod);
m_data.m_modMask = m_data.m_modMask & ~mod;
}
void reset()
@ -112,13 +112,13 @@ public:
void controllerConnected(unsigned idx, boo::EDolphinControllerType)
{
/* Controller thread */
m_statusChanges[idx].store(StatusConnected);
m_statusChanges[idx].store(EStatusChange::Connected);
}
void controllerDisconnected(unsigned idx, boo::EDolphinControllerType)
{
/* Controller thread */
std::unique_lock<std::mutex> lk(m_stateLock);
m_statusChanges[idx].store(StatusDisconnected);
m_statusChanges[idx].store(EStatusChange::Disconnected);
m_states[idx].reset();
}
void controllerUpdate(unsigned idx, boo::EDolphinControllerType,
@ -144,10 +144,10 @@ public:
EStatusChange getStatusChange(unsigned idx, bool& connected)
{
/* Game thread */
EStatusChange ch = m_statusChanges[idx].exchange(StatusNoChange);
if (ch == StatusConnected)
EStatusChange ch = m_statusChanges[idx].exchange(EStatusChange::NoChange);
if (ch == EStatusChange::Connected)
m_connected[idx] = true;
else if (ch == StatusDisconnected)
else if (ch == EStatusChange::Disconnected)
m_connected[idx] = false;
connected = m_connected[idx];
return ch;

View File

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

View File

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

View File

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

View File

@ -9,11 +9,11 @@ namespace Retro
class IController
{
public:
enum EMotorState
enum class EMotorState
{
MotorStop = 0,
MotorRumble = 1,
MotorStopHard = 2
Stop = 0,
Rumble = 1,
StopHard = 2
};
virtual void Poll()=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)
{}
CIOWin::EMessageReturn CFrontEndUI::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{return MsgRetNormal;}
{return EMessageReturn::Normal;}
void CFrontEndUI::StartGame()
{}
void CFrontEndUI::InitializeFrame()

View File

@ -16,10 +16,10 @@ namespace MP1
class CFrontEndUI : public CIOWin
{
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())
{
case MsgTimerTick:
case EArchMsgType::TimerTick:
{
const CArchMsgParmReal32& tick = MakeMsg::GetParmTimerTick(msg);
g_GameState->WorldTransitionManager();
}
default: break;
}
return MsgRetExit;
return EMessageReturn::Exit;
}
void CMFGameLoader::Draw() const

View File

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

View File

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

View File

@ -13,15 +13,15 @@ extern const char* kMovies[];
class CPlayMovie : public CPlayMovieBase
{
public:
enum EWhichMovie
enum class EWhichMovie
{
MovieWinGame,
MovieLoseGame
WinGame,
LoseGame
};
private:
EWhichMovie x14_which;
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())
{
g_main = this;
xe4_gameplayResult = GameplayResultPlaying;
xe4_gameplayResult = EGameplayResult::Playing;
}
void CMain::RegisterResourceTweaks()
{
@ -217,7 +217,7 @@ int main(int argc, const char* argv[])
LogVisor::RegisterConsoleLogger();
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);
return ret;
}

View File

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

2
hecl

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

1
libSpecter Submodule

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