mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-11-30 16:27:47 +00:00
refactor: do not nest asset namespaces in game namespaces
* Duplicated namespace names are kind of annoying
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
#include <format>
|
||||
|
||||
using namespace IW3;
|
||||
using namespace ::image;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -40,7 +39,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())
|
||||
{
|
||||
@@ -60,9 +59,9 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW3::image
|
||||
namespace image
|
||||
{
|
||||
Dumper::Dumper()
|
||||
DumperIW3::DumperIW3()
|
||||
{
|
||||
switch (ObjWriting::Configuration.ImageOutputFormat)
|
||||
{
|
||||
@@ -79,12 +78,12 @@ namespace IW3::image
|
||||
}
|
||||
}
|
||||
|
||||
bool Dumper::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
bool DumperIW3::ShouldDump(XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
void DumperIW3::DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset)
|
||||
{
|
||||
const auto* image = asset->Asset();
|
||||
const auto texture = LoadImageData(context.m_obj_search_path, *image);
|
||||
@@ -99,4 +98,4 @@ namespace IW3::image
|
||||
auto& stream = *assetFile;
|
||||
m_writer->DumpImage(stream, texture.get());
|
||||
}
|
||||
} // namespace IW3::image
|
||||
} // namespace image
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW3::image
|
||||
namespace image
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<GfxImage>
|
||||
class DumperIW3 final : public AbstractAssetDumper<IW3::GfxImage>
|
||||
{
|
||||
public:
|
||||
Dumper();
|
||||
DumperIW3();
|
||||
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<GfxImage>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<GfxImage>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW3::GfxImage>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW3::GfxImage>* asset) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<IImageWriter> m_writer;
|
||||
};
|
||||
} // namespace IW3::image
|
||||
} // namespace image
|
||||
|
||||
Reference in New Issue
Block a user