mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-11-23 05:12:05 +00:00
chore: do not make filename constants separate variables
This commit is contained in:
@@ -198,9 +198,8 @@ namespace BSP
|
|||||||
{
|
{
|
||||||
std::unique_ptr<BSPData> createBSPData(const std::string& mapName, ISearchPath& searchPath)
|
std::unique_ptr<BSPData> createBSPData(const std::string& mapName, ISearchPath& searchPath)
|
||||||
{
|
{
|
||||||
std::string gfxFbxFileName = "map_gfx.fbx";
|
const auto gfxFbxPath = BSPUtil::getFileNameForBSPAsset("map_gfx.fbx");
|
||||||
std::string gfxFbxPath = BSPUtil::getFileNameForBSPAsset(gfxFbxFileName);
|
const auto gfxFile = searchPath.Open(gfxFbxPath);
|
||||||
auto gfxFile = searchPath.Open(gfxFbxPath);
|
|
||||||
if (!gfxFile.IsOpen())
|
if (!gfxFile.IsOpen())
|
||||||
{
|
{
|
||||||
con::error("Failed to open map gfx fbx file: {}", gfxFbxPath);
|
con::error("Failed to open map gfx fbx file: {}", gfxFbxPath);
|
||||||
@@ -228,8 +227,7 @@ namespace BSP
|
|||||||
}
|
}
|
||||||
|
|
||||||
ufbx_scene* colScene;
|
ufbx_scene* colScene;
|
||||||
std::string colFbxFileName = "map_col.fbx";
|
const auto colFbxPath = BSPUtil::getFileNameForBSPAsset("map_col.fbx");
|
||||||
const auto colFbxPath = BSPUtil::getFileNameForBSPAsset(colFbxFileName);
|
|
||||||
const auto colFile = searchPath.Open(colFbxPath);
|
const auto colFile = searchPath.Open(colFbxPath);
|
||||||
if (!colFile.IsOpen())
|
if (!colFile.IsOpen())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -717,8 +717,7 @@ namespace BSP
|
|||||||
gfxWorld.outdoorLookupMatrix[3].z = zScale;
|
gfxWorld.outdoorLookupMatrix[3].z = zScale;
|
||||||
gfxWorld.outdoorLookupMatrix[3].w = 1.0f;
|
gfxWorld.outdoorLookupMatrix[3].w = 1.0f;
|
||||||
|
|
||||||
const std::string outdoorImageName = std::string("$outdoor");
|
const auto outdoorImageAsset = m_context.LoadDependency<AssetImage>("$outdoor");
|
||||||
auto outdoorImageAsset = m_context.LoadDependency<AssetImage>(outdoorImageName);
|
|
||||||
if (!outdoorImageAsset)
|
if (!outdoorImageAsset)
|
||||||
{
|
{
|
||||||
con::error("ERROR! unable to find outdoor image $outdoor!");
|
con::error("ERROR! unable to find outdoor image $outdoor!");
|
||||||
|
|||||||
@@ -79,8 +79,7 @@ namespace BSP
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
json entJs;
|
json entJs;
|
||||||
std::string entityFileName = "entities.json";
|
const auto entityFilePath = BSPUtil::getFileNameForBSPAsset("entities.json");
|
||||||
std::string entityFilePath = BSPUtil::getFileNameForBSPAsset(entityFileName);
|
|
||||||
const auto entFile = m_search_path.Open(entityFilePath);
|
const auto entFile = m_search_path.Open(entityFilePath);
|
||||||
if (!entFile.IsOpen())
|
if (!entFile.IsOpen())
|
||||||
{
|
{
|
||||||
@@ -96,8 +95,7 @@ namespace BSP
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
json spawnJs;
|
json spawnJs;
|
||||||
std::string spawnFileName = "spawns.json";
|
const auto spawnFilePath = BSPUtil::getFileNameForBSPAsset("spawns.json");
|
||||||
std::string spawnFilePath = BSPUtil::getFileNameForBSPAsset(spawnFileName);
|
|
||||||
const auto spawnFile = m_search_path.Open(spawnFilePath);
|
const auto spawnFile = m_search_path.Open(spawnFilePath);
|
||||||
if (!spawnFile.IsOpen())
|
if (!spawnFile.IsOpen())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user