mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-10-26 08:15:54 +00:00
refactor: do not nest asset namespaces in game namespaces
* Duplicated namespace names are kind of annoying
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
#include <format>
|
||||
|
||||
using namespace IW5;
|
||||
using namespace ::image;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -38,7 +37,7 @@ namespace
|
||||
|
||||
std::unique_ptr<Texture> LoadImageFromIwi(const GfxImage& image, ISearchPath& searchPath)
|
||||
{
|
||||
const auto imageFileName = std::format("images/{}.iwi", image.name);
|
||||
const auto imageFileName = image::GetFileNameForAsset(image.name, ".iwi");
|
||||
const auto filePathImage = searchPath.Open(imageFileName);
|
||||
if (!filePathImage.IsOpen())
|
||||
{
|
||||
@@ -58,9 +57,9 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW5::image
|
||||
namespace image
|
||||
{
|
||||
Dumper::Dumper()
|
||||
DumperIW5::DumperIW5()
|
||||
{
|
||||
switch (ObjWriting::Configuration.ImageOutputFormat)
|
||||
{
|
||||
@@ -77,12 +76,12 @@ namespace IW5::image
|
||||
}
|
||||
}
|
||||
|
||||
bool Dumper::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
bool DumperIW5::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
void DumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
const auto* image = asset->Asset();
|
||||
const auto texture = LoadImageData(context.m_obj_search_path, *image);
|
||||
@@ -97,4 +96,4 @@ namespace IW5::image
|
||||
auto& stream = *assetFile;
|
||||
m_writer->DumpImage(stream, texture.get());
|
||||
}
|
||||
} // namespace IW5::image
|
||||
} // namespace image
|
||||
|
||||
Reference in New Issue
Block a user