2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-01-09 10:11:49 +00:00

chore: update image namespacing

This commit is contained in:
Jan Laupetin
2026-01-03 13:58:46 +01:00
parent b2e6f7a4ea
commit a5d1d09fa9
47 changed files with 1940 additions and 1832 deletions

View File

@@ -3,7 +3,7 @@
#include <cassert>
#include <ostream>
using namespace iwi13;
using namespace image::iwi13;
IwiWriter::IwiWriter() = default;
@@ -54,13 +54,13 @@ std::string IwiWriter::GetFileExtension()
void IwiWriter::WriteVersion(std::ostream& stream)
{
IwiVersion version{};
IwiVersionHeader version{};
version.tag[0] = 'I';
version.tag[1] = 'W';
version.tag[2] = 'i';
version.version = 13;
stream.write(reinterpret_cast<char*>(&version), sizeof(IwiVersion));
stream.write(reinterpret_cast<char*>(&version), sizeof(IwiVersionHeader));
}
void IwiWriter::FillHeader2D(IwiHeader& header, const Texture2D& texture)
@@ -101,7 +101,7 @@ void IwiWriter::DumpImage(std::ostream& stream, const Texture* texture)
if (!texture->HasMipMaps())
header.flags |= IMG_FLAG_NOMIPMAPS;
auto currentFileSize = sizeof(IwiVersion) + sizeof(IwiHeader);
auto currentFileSize = sizeof(IwiVersionHeader) + sizeof(IwiHeader);
const auto textureMipCount = texture->HasMipMaps() ? texture->GetMipMapCount() : 1;
for (auto currentMipLevel = textureMipCount - 1; currentMipLevel >= 0; currentMipLevel--)