diff --git a/src/graphic/Fast3D/gfx_pc.cpp b/src/graphic/Fast3D/gfx_pc.cpp index d7b43eaac..4efe6683e 100644 --- a/src/graphic/Fast3D/gfx_pc.cpp +++ b/src/graphic/Fast3D/gfx_pc.cpp @@ -890,15 +890,15 @@ static void import_texture_raw(int tile, bool importReplacement) { uint16_t width = metadata->width; uint16_t height = metadata->height; - LUS::TextureType type = metadata->type; - std::shared_ptr resource = metadata->resource; + Fast::TextureType type = metadata->type; + std::shared_ptr resource = metadata->resource; // if texture type is CI4 or CI8 we need to apply tlut to it switch (type) { - case LUS::TextureType::Palette4bpp: + case Fast::TextureType::Palette4bpp: import_texture_ci4(tile, importReplacement); return; - case LUS::TextureType::Palette8bpp: + case Fast::TextureType::Palette8bpp: import_texture_ci8(tile, importReplacement); return; default: @@ -2556,7 +2556,7 @@ static void gfx_s2dex_bg_copy(F3DuObjBg* bg) { RawTexMetadata rawTexMetadata = {}; if ((bool)gfx_check_image_signature((char*)data)) { - std::shared_ptr tex = std::static_pointer_cast( + std::shared_ptr tex = std::static_pointer_cast( Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess((char*)data)); texFlags = tex->Flags; rawTexMetadata.width = tex->Width; @@ -2595,7 +2595,7 @@ static void gfx_s2dex_bg_1cyc(F3DuObjBg* bg) { RawTexMetadata rawTexMetadata = {}; if ((bool)gfx_check_image_signature((char*)data)) { - std::shared_ptr tex = std::static_pointer_cast( + std::shared_ptr tex = std::static_pointer_cast( Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess((char*)data)); texFlags = tex->Flags; rawTexMetadata.width = tex->Width; @@ -2919,7 +2919,7 @@ bool gfx_movemem_handler_otr(F3DGfx** cmd0) { if (ucode_handler_index == ucode_f3dex2) { gfx_sp_movemem_f3dex2(index, offset, ResourceGetDataByCrc(hash)); } else { - auto light = (LUS::LightEntry*)ResourceGetDataByCrc(hash); + auto light = (Fast::LightEntry*)ResourceGetDataByCrc(hash); uintptr_t data = (uintptr_t)&light->Ambient; gfx_sp_movemem_f3d(index, offset, (void*)(data + (hasOffset == 1 ? 0x8 : 0))); } @@ -3298,7 +3298,7 @@ bool gfx_set_timg_handler_rdp(F3DGfx** cmd0) { if ((i & 1) != 1) { if (gfx_check_image_signature(imgData) == 1) { - std::shared_ptr tex = std::static_pointer_cast( + std::shared_ptr tex = std::static_pointer_cast( Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgData)); if (tex == nullptr) { @@ -3336,7 +3336,7 @@ bool gfx_set_timg_otr_hash_handler_custom(F3DGfx** cmd0) { return false; } - std::shared_ptr texture = std::static_pointer_cast( + std::shared_ptr texture = std::static_pointer_cast( Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(ResourceGetNameByCrc(hash))); if (texture != nullptr) { texFlags = texture->Flags; @@ -3399,7 +3399,7 @@ bool gfx_set_timg_otr_filepath_handler_custom(F3DGfx** cmd0) { uint32_t texFlags = 0; RawTexMetadata rawTexMetadata = {}; - std::shared_ptr texture = std::static_pointer_cast( + std::shared_ptr texture = std::static_pointer_cast( Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(fileName)); if (texture != nullptr) { texFlags = texture->Flags; @@ -4414,10 +4414,10 @@ void gfx_register_blended_texture(const char* name, uint8_t* mask, uint8_t* repl } if (gfx_check_image_signature(reinterpret_cast(replacement))) { - LUS::Texture* tex = std::static_pointer_cast( - Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess( - reinterpret_cast(replacement))) - .get(); + Fast::Texture* tex = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess( + reinterpret_cast(replacement))) + .get(); replacement = tex->ImageData; } diff --git a/src/graphic/Fast3D/gfx_pc.h b/src/graphic/Fast3D/gfx_pc.h index bb8acee12..38fab091b 100644 --- a/src/graphic/Fast3D/gfx_pc.h +++ b/src/graphic/Fast3D/gfx_pc.h @@ -113,8 +113,8 @@ struct LoadedVertex { struct RawTexMetadata { uint16_t width, height; float h_byte_scale = 1, v_pixel_scale = 1; - std::shared_ptr resource; - LUS::TextureType type; + std::shared_ptr resource; + Fast::TextureType type; }; #define MAX_BUFFERED 256 diff --git a/src/public/bridge/resourcebridge.cpp b/src/public/bridge/resourcebridge.cpp index 38411cea0..eb5790dd2 100644 --- a/src/public/bridge/resourcebridge.cpp +++ b/src/public/bridge/resourcebridge.cpp @@ -81,7 +81,7 @@ void* ResourceGetDataByCrc(uint64_t crc) { } uint16_t ResourceGetTexWidthByName(const char* name) { - const auto res = static_pointer_cast(ResourceLoad(name)); + const auto res = static_pointer_cast(ResourceLoad(name)); if (res != nullptr) { return res->Width; @@ -92,7 +92,7 @@ uint16_t ResourceGetTexWidthByName(const char* name) { } uint16_t ResourceGetTexWidthByCrc(uint64_t crc) { - const auto res = static_pointer_cast(ResourceLoad(crc)); + const auto res = static_pointer_cast(ResourceLoad(crc)); if (res != nullptr) { return res->Width; @@ -103,7 +103,7 @@ uint16_t ResourceGetTexWidthByCrc(uint64_t crc) { } uint16_t ResourceGetTexHeightByName(const char* name) { - const auto res = static_pointer_cast(ResourceLoad(name)); + const auto res = static_pointer_cast(ResourceLoad(name)); if (res != nullptr) { return res->Height; @@ -114,7 +114,7 @@ uint16_t ResourceGetTexHeightByName(const char* name) { } uint16_t ResourceGetTexHeightByCrc(uint64_t crc) { - const auto res = static_pointer_cast(ResourceLoad(crc)); + const auto res = static_pointer_cast(ResourceLoad(crc)); if (res != nullptr) { return res->Height; @@ -125,7 +125,7 @@ uint16_t ResourceGetTexHeightByCrc(uint64_t crc) { } size_t ResourceGetTexSizeByName(const char* name) { - const auto res = static_pointer_cast(ResourceLoad(name)); + const auto res = static_pointer_cast(ResourceLoad(name)); if (res != nullptr) { return res->ImageDataSize; @@ -136,7 +136,7 @@ size_t ResourceGetTexSizeByName(const char* name) { } size_t ResourceGetTexSizeByCrc(uint64_t crc) { - const auto res = static_pointer_cast(ResourceLoad(crc)); + const auto res = static_pointer_cast(ResourceLoad(crc)); if (res != nullptr) { return res->ImageDataSize; diff --git a/src/resource/ResourceType.h b/src/resource/ResourceType.h index 70808c63e..daf821d98 100644 --- a/src/resource/ResourceType.h +++ b/src/resource/ResourceType.h @@ -3,26 +3,22 @@ namespace Ship { enum class ResourceType { - // Not set None = 0x00000000, + Blob = 0x4F424C42, // OBLB Json = 0x4A534F4E, // JSON }; } // namespace Ship -namespace LUS { +namespace Fast { enum class ResourceType { - // Not set None = 0x00000000, - // Common - Archive = 0x4F415243, // OARC (UNUSED) DisplayList = 0x4F444C54, // ODLT - Vertex = 0x4F565458, // OVTX + Light = 0x46669697, // LGTS Matrix = 0x4F4D5458, // OMTX - Blob = 0x4F424C42, // OBLB Texture = 0x4F544558, // OTEX - Light = 0x46669697, // LGTS + Vertex = 0x4F565458, // OVTX }; -} // namespace LUS +} // namespace Fast diff --git a/src/resource/factory/BlobFactory.cpp b/src/resource/factory/BlobFactory.cpp index ea5b777b5..7b1e9b43e 100644 --- a/src/resource/factory/BlobFactory.cpp +++ b/src/resource/factory/BlobFactory.cpp @@ -2,7 +2,7 @@ #include "resource/type/Blob.h" #include "spdlog/spdlog.h" -namespace LUS { +namespace Ship { std::shared_ptr ResourceFactoryBinaryBlobV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; @@ -21,4 +21,4 @@ std::shared_ptr ResourceFactoryBinaryBlobV0::ReadResource(std:: return blob; } -} // namespace LUS +} // namespace Ship diff --git a/src/resource/factory/BlobFactory.h b/src/resource/factory/BlobFactory.h index d791ee77b..2a6109a4e 100644 --- a/src/resource/factory/BlobFactory.h +++ b/src/resource/factory/BlobFactory.h @@ -3,9 +3,9 @@ #include "resource/Resource.h" #include "resource/ResourceFactoryBinary.h" -namespace LUS { +namespace Ship { class ResourceFactoryBinaryBlobV0 : public Ship::ResourceFactoryBinary { public: std::shared_ptr ReadResource(std::shared_ptr file) override; }; -}; // namespace LUS +}; // namespace Ship diff --git a/src/resource/factory/DisplayListFactory.cpp b/src/resource/factory/DisplayListFactory.cpp index 4ab1e4698..97587f862 100644 --- a/src/resource/factory/DisplayListFactory.cpp +++ b/src/resource/factory/DisplayListFactory.cpp @@ -4,7 +4,7 @@ #include "libultraship/libultra/gbi.h" #include "graphic/Fast3D/lus_gbi.h" -namespace LUS { +namespace Fast { std::unordered_map renderModes = { { "G_RM_ZB_OPA_SURF", G_RM_ZB_OPA_SURF }, { "G_RM_AA_ZB_OPA_SURF", G_RM_AA_ZB_OPA_SURF }, @@ -1127,4 +1127,4 @@ std::shared_ptr ResourceFactoryXMLDisplayListV0::ReadResource(s return dl; } -} // namespace LUS +} // namespace Fast diff --git a/src/resource/factory/DisplayListFactory.h b/src/resource/factory/DisplayListFactory.h index a492932f3..282c7f25d 100644 --- a/src/resource/factory/DisplayListFactory.h +++ b/src/resource/factory/DisplayListFactory.h @@ -4,7 +4,7 @@ #include "resource/ResourceFactoryBinary.h" #include "resource/ResourceFactoryXML.h" -namespace LUS { +namespace Fast { class ResourceFactoryDisplayList { protected: uint32_t GetCombineLERPValue(const char* valStr); @@ -19,4 +19,4 @@ class ResourceFactoryXMLDisplayListV0 : public ResourceFactoryDisplayList, publi public: std::shared_ptr ReadResource(std::shared_ptr file) override; }; -} // namespace LUS +} // namespace Fast diff --git a/src/resource/factory/LightFactory.cpp b/src/resource/factory/LightFactory.cpp index 60d511d9b..ac53c08d4 100644 --- a/src/resource/factory/LightFactory.cpp +++ b/src/resource/factory/LightFactory.cpp @@ -1,7 +1,7 @@ #include "resource/factory/LightFactory.h" #include "resource/type/Light.h" -std::shared_ptr LUS::ResourceFactoryBinaryLightV0::ReadResource(std::shared_ptr file) { +std::shared_ptr Fast::ResourceFactoryBinaryLightV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; } diff --git a/src/resource/factory/LightFactory.h b/src/resource/factory/LightFactory.h index 48a036c76..49e957b7d 100644 --- a/src/resource/factory/LightFactory.h +++ b/src/resource/factory/LightFactory.h @@ -3,9 +3,9 @@ #include "resource/Resource.h" #include "resource/ResourceFactoryBinary.h" -namespace LUS { +namespace Fast { class ResourceFactoryBinaryLightV0 : public Ship::ResourceFactoryBinary { public: std::shared_ptr ReadResource(std::shared_ptr file) override; }; -} // namespace LUS \ No newline at end of file +} // namespace Fast \ No newline at end of file diff --git a/src/resource/factory/MatrixFactory.cpp b/src/resource/factory/MatrixFactory.cpp index a65438082..3b16eaa53 100644 --- a/src/resource/factory/MatrixFactory.cpp +++ b/src/resource/factory/MatrixFactory.cpp @@ -2,7 +2,7 @@ #include "resource/type/Matrix.h" #include "spdlog/spdlog.h" -namespace LUS { +namespace Fast { std::shared_ptr ResourceFactoryBinaryMatrixV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; @@ -23,4 +23,4 @@ std::shared_ptr ResourceFactoryBinaryMatrixV0::ReadResource(std return matrix; } -} // namespace LUS +} // namespace Fast diff --git a/src/resource/factory/MatrixFactory.h b/src/resource/factory/MatrixFactory.h index 4e2b555e4..270c06881 100644 --- a/src/resource/factory/MatrixFactory.h +++ b/src/resource/factory/MatrixFactory.h @@ -3,9 +3,9 @@ #include "resource/Resource.h" #include "resource/ResourceFactoryBinary.h" -namespace LUS { +namespace Fast { class ResourceFactoryBinaryMatrixV0 : public Ship::ResourceFactoryBinary { public: std::shared_ptr ReadResource(std::shared_ptr file) override; }; -} // namespace LUS +} // namespace Fast diff --git a/src/resource/factory/TextureFactory.cpp b/src/resource/factory/TextureFactory.cpp index cb017a285..5b422de1b 100644 --- a/src/resource/factory/TextureFactory.cpp +++ b/src/resource/factory/TextureFactory.cpp @@ -2,7 +2,7 @@ #include "resource/type/Texture.h" #include "spdlog/spdlog.h" -namespace LUS { +namespace Fast { std::shared_ptr ResourceFactoryBinaryTextureV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { @@ -44,4 +44,4 @@ std::shared_ptr ResourceFactoryBinaryTextureV1::ReadResource(st return texture; } -} // namespace LUS +} // namespace Fast diff --git a/src/resource/factory/TextureFactory.h b/src/resource/factory/TextureFactory.h index e9e76dda0..467a79abc 100644 --- a/src/resource/factory/TextureFactory.h +++ b/src/resource/factory/TextureFactory.h @@ -3,7 +3,7 @@ #include "resource/Resource.h" #include "resource/ResourceFactoryBinary.h" -namespace LUS { +namespace Fast { class ResourceFactoryBinaryTextureV0 : public Ship::ResourceFactoryBinary { public: std::shared_ptr ReadResource(std::shared_ptr file) override; @@ -13,4 +13,4 @@ class ResourceFactoryBinaryTextureV1 : public Ship::ResourceFactoryBinary { public: std::shared_ptr ReadResource(std::shared_ptr file) override; }; -} // namespace LUS +} // namespace Fast diff --git a/src/resource/factory/VertexFactory.cpp b/src/resource/factory/VertexFactory.cpp index 4e369f491..b7c57e925 100644 --- a/src/resource/factory/VertexFactory.cpp +++ b/src/resource/factory/VertexFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" #include "libultraship/libultra/gbi.h" -namespace LUS { +namespace Fast { std::shared_ptr ResourceFactoryBinaryVertexV0::ReadResource(std::shared_ptr file) { if (!FileHasValidFormatAndReader(file)) { return nullptr; @@ -67,4 +67,4 @@ std::shared_ptr ResourceFactoryXMLVertexV0::ReadResource(std::s return vertex; } -} // namespace LUS +} // namespace Fast diff --git a/src/resource/factory/VertexFactory.h b/src/resource/factory/VertexFactory.h index 007cf91ee..d67555221 100644 --- a/src/resource/factory/VertexFactory.h +++ b/src/resource/factory/VertexFactory.h @@ -4,7 +4,7 @@ #include "resource/ResourceFactoryBinary.h" #include "resource/ResourceFactoryXML.h" -namespace LUS { +namespace Fast { class ResourceFactoryBinaryVertexV0 : public Ship::ResourceFactoryBinary { public: std::shared_ptr ReadResource(std::shared_ptr file) override; @@ -14,4 +14,4 @@ class ResourceFactoryXMLVertexV0 : public Ship::ResourceFactoryXML { public: std::shared_ptr ReadResource(std::shared_ptr file) override; }; -} // namespace LUS +} // namespace Fast diff --git a/src/resource/type/Blob.cpp b/src/resource/type/Blob.cpp index d2d636079..7e94e95c2 100644 --- a/src/resource/type/Blob.cpp +++ b/src/resource/type/Blob.cpp @@ -1,6 +1,6 @@ #include "Blob.h" -namespace LUS { +namespace Ship { Blob::Blob() : Resource(std::shared_ptr()) { } @@ -11,4 +11,4 @@ void* Blob::GetPointer() { size_t Blob::GetPointerSize() { return Data.size() * sizeof(uint8_t); } -} // namespace LUS +} // namespace Ship diff --git a/src/resource/type/Blob.h b/src/resource/type/Blob.h index 5bdc5b7d2..4c59cfdcb 100644 --- a/src/resource/type/Blob.h +++ b/src/resource/type/Blob.h @@ -2,7 +2,7 @@ #include "resource/Resource.h" -namespace LUS { +namespace Ship { class Blob : public Ship::Resource { public: using Resource::Resource; @@ -14,4 +14,4 @@ class Blob : public Ship::Resource { std::vector Data; }; -}; // namespace LUS +}; // namespace Ship diff --git a/src/resource/type/DisplayList.cpp b/src/resource/type/DisplayList.cpp index d0aa30748..03d0acd80 100644 --- a/src/resource/type/DisplayList.cpp +++ b/src/resource/type/DisplayList.cpp @@ -1,7 +1,7 @@ #include "resource/type/DisplayList.h" #include -namespace LUS { +namespace Fast { DisplayList::DisplayList() : Resource(std::shared_ptr()) { } @@ -18,4 +18,4 @@ Gfx* DisplayList::GetPointer() { size_t DisplayList::GetPointerSize() { return Instructions.size() * sizeof(Gfx); } -} // namespace LUS +} // namespace Fast diff --git a/src/resource/type/DisplayList.h b/src/resource/type/DisplayList.h index 9ec95959d..4284993aa 100644 --- a/src/resource/type/DisplayList.h +++ b/src/resource/type/DisplayList.h @@ -5,7 +5,7 @@ #include "public/bridge/gfxbridge.h" #include -namespace LUS { +namespace Fast { class DisplayList : public Ship::Resource { public: using Resource::Resource; @@ -20,4 +20,4 @@ class DisplayList : public Ship::Resource { std::vector Instructions; std::vector Strings; }; -} // namespace LUS +} // namespace Fast diff --git a/src/resource/type/Light.cpp b/src/resource/type/Light.cpp index f043b6719..5f0277cdf 100644 --- a/src/resource/type/Light.cpp +++ b/src/resource/type/Light.cpp @@ -1,6 +1,6 @@ #include "Light.h" -namespace LUS { +namespace Fast { LightEntry* Light::GetPointer() { return &mLight; } @@ -8,4 +8,4 @@ LightEntry* Light::GetPointer() { size_t Light::GetPointerSize() { return sizeof(mLight); } -} // namespace LUS \ No newline at end of file +} // namespace Fast \ No newline at end of file diff --git a/src/resource/type/Light.h b/src/resource/type/Light.h index 98664eb8a..596647833 100644 --- a/src/resource/type/Light.h +++ b/src/resource/type/Light.h @@ -3,7 +3,7 @@ #include #include "resource/Resource.h" -namespace LUS { +namespace Fast { /* We have to keep the Pads since its probably an @@ -62,4 +62,4 @@ class Light : public Ship::Resource { LightEntry mLight; std::vector mLightData; }; -} // namespace LUS \ No newline at end of file +} // namespace Fast \ No newline at end of file diff --git a/src/resource/type/Matrix.cpp b/src/resource/type/Matrix.cpp index c45c07177..d4d166feb 100644 --- a/src/resource/type/Matrix.cpp +++ b/src/resource/type/Matrix.cpp @@ -1,6 +1,6 @@ #include "resource/type/Matrix.h" -namespace LUS { +namespace Fast { Matrix::Matrix() : Resource(std::shared_ptr()) { } @@ -11,4 +11,4 @@ Mtx* Matrix::GetPointer() { size_t Matrix::GetPointerSize() { return sizeof(Mtx); } -} // namespace LUS +} // namespace Fast diff --git a/src/resource/type/Matrix.h b/src/resource/type/Matrix.h index 29dab5d68..9290d3c91 100644 --- a/src/resource/type/Matrix.h +++ b/src/resource/type/Matrix.h @@ -3,7 +3,7 @@ #include "resource/Resource.h" #include "libultraship/libultra/types.h" -namespace LUS { +namespace Fast { class Matrix : public Ship::Resource { public: using Resource::Resource; @@ -15,4 +15,4 @@ class Matrix : public Ship::Resource { Mtx Matrx; }; -} // namespace LUS +} // namespace Fast diff --git a/src/resource/type/Texture.cpp b/src/resource/type/Texture.cpp index 42deb245c..bc90d8ddc 100644 --- a/src/resource/type/Texture.cpp +++ b/src/resource/type/Texture.cpp @@ -1,6 +1,6 @@ #include "resource/type/Texture.h" -namespace LUS { +namespace Fast { Texture::Texture() : Resource(std::shared_ptr()) { } @@ -17,4 +17,4 @@ Texture::~Texture() { delete ImageData; } } -} // namespace LUS +} // namespace Fast diff --git a/src/resource/type/Texture.h b/src/resource/type/Texture.h index 65d91b726..b7179456d 100644 --- a/src/resource/type/Texture.h +++ b/src/resource/type/Texture.h @@ -4,7 +4,7 @@ #define TEX_FLAG_LOAD_AS_RAW (1 << 0) -namespace LUS { +namespace Fast { enum class TextureType { Error = 0, RGBA32bpp = 1, @@ -37,4 +37,4 @@ class Texture : public Ship::Resource { ~Texture(); }; -} // namespace LUS +} // namespace Fast diff --git a/src/resource/type/Vertex.cpp b/src/resource/type/Vertex.cpp index a4e1c6c31..a1bd18288 100644 --- a/src/resource/type/Vertex.cpp +++ b/src/resource/type/Vertex.cpp @@ -1,7 +1,7 @@ #include "resource/type/Vertex.h" #include "libultraship/libultra/gbi.h" -namespace LUS { +namespace Fast { Vertex::Vertex() : Resource(std::shared_ptr()) { } @@ -12,4 +12,4 @@ Vtx* Vertex::GetPointer() { size_t Vertex::GetPointerSize() { return VertexList.size() * sizeof(Vtx); } -} // namespace LUS +} // namespace Fast diff --git a/src/resource/type/Vertex.h b/src/resource/type/Vertex.h index 1ab7276f3..94776d23e 100644 --- a/src/resource/type/Vertex.h +++ b/src/resource/type/Vertex.h @@ -5,7 +5,7 @@ union Vtx; -namespace LUS { +namespace Fast { class Vertex : public Ship::Resource { public: using Resource::Resource; @@ -17,4 +17,4 @@ class Vertex : public Ship::Resource { std::vector VertexList; }; -} // namespace LUS +} // namespace Fast diff --git a/src/window/gui/GfxDebuggerWindow.cpp b/src/window/gui/GfxDebuggerWindow.cpp index ea4cac268..4dd7bad67 100644 --- a/src/window/gui/GfxDebuggerWindow.cpp +++ b/src/window/gui/GfxDebuggerWindow.cpp @@ -541,26 +541,26 @@ void GfxDebuggerWindow::DrawDisasNode(const F3DGfx* cmd, std::vector Gui::GetGuiWindow(const std::string& name) { } } -void Gui::LoadGuiTexture(const std::string& name, const LUS::Texture& res, const ImVec4& tint) { +void Gui::LoadGuiTexture(const std::string& name, const Fast::Texture& res, const ImVec4& tint) { GfxRenderingAPI* api = gfx_get_current_rendering_api(); std::vector texBuffer; texBuffer.reserve(res.Width * res.Height * 4); @@ -794,7 +794,7 @@ void Gui::LoadGuiTexture(const std::string& name, const LUS::Texture& res, const // For HD textures we need to load the buffer raw (similar to inside gfx_pp) if ((res.Flags & TEX_FLAG_LOAD_AS_RAW) != 0) { // Raw loading doesn't support TLUT textures - if (res.Type == LUS::TextureType::Palette4bpp || res.Type == LUS::TextureType::Palette8bpp) { + if (res.Type == Fast::TextureType::Palette4bpp || res.Type == Fast::TextureType::Palette8bpp) { // TODO convert other image types SPDLOG_WARN("ImGui::ResourceLoad: Attempting to load unsupported image type"); return; @@ -803,10 +803,10 @@ void Gui::LoadGuiTexture(const std::string& name, const LUS::Texture& res, const texBuffer.assign(res.ImageData, res.ImageData + (res.Width * res.Height * 4)); } else { switch (res.Type) { - case LUS::TextureType::RGBA32bpp: + case Fast::TextureType::RGBA32bpp: texBuffer.assign(res.ImageData, res.ImageData + (res.Width * res.Height * 4)); break; - case LUS::TextureType::RGBA16bpp: { + case Fast::TextureType::RGBA16bpp: { for (int32_t i = 0; i < res.Width * res.Height; i++) { uint8_t b1 = res.ImageData[i * 2 + 0]; uint8_t b2 = res.ImageData[i * 2 + 1]; @@ -821,7 +821,7 @@ void Gui::LoadGuiTexture(const std::string& name, const LUS::Texture& res, const } break; } - case LUS::TextureType::GrayscaleAlpha16bpp: { + case Fast::TextureType::GrayscaleAlpha16bpp: { for (int32_t i = 0; i < res.Width * res.Height; i++) { uint8_t color = res.ImageData[i * 2 + 0]; uint8_t alpha = res.ImageData[i * 2 + 1]; @@ -833,7 +833,7 @@ void Gui::LoadGuiTexture(const std::string& name, const LUS::Texture& res, const break; break; } - case LUS::TextureType::GrayscaleAlpha8bpp: { + case Fast::TextureType::GrayscaleAlpha8bpp: { for (int32_t i = 0; i < res.Width * res.Height; i++) { uint8_t ia = res.ImageData[i]; uint8_t color = ((ia >> 4) & 0xF) * 255 / 15; @@ -845,7 +845,7 @@ void Gui::LoadGuiTexture(const std::string& name, const LUS::Texture& res, const } break; } - case LUS::TextureType::GrayscaleAlpha4bpp: { + case Fast::TextureType::GrayscaleAlpha4bpp: { for (int32_t i = 0; i < res.Width * res.Height; i += 2) { uint8_t b = res.ImageData[i / 2]; @@ -867,7 +867,7 @@ void Gui::LoadGuiTexture(const std::string& name, const LUS::Texture& res, const } break; } - case LUS::TextureType::Grayscale8bpp: { + case Fast::TextureType::Grayscale8bpp: { for (int32_t i = 0; i < res.Width * res.Height; i++) { uint8_t ia = res.ImageData[i]; texBuffer.push_back(ia); @@ -877,7 +877,7 @@ void Gui::LoadGuiTexture(const std::string& name, const LUS::Texture& res, const } break; } - case LUS::TextureType::Grayscale4bpp: { + case Fast::TextureType::Grayscale4bpp: { for (int32_t i = 0; i < res.Width * res.Height; i += 2) { uint8_t b = res.ImageData[i / 2]; @@ -923,7 +923,7 @@ void Gui::LoadGuiTexture(const std::string& name, const LUS::Texture& res, const void Gui::LoadGuiTexture(const std::string& name, const std::string& path, const ImVec4& tint) { const auto res = - static_cast(Context::GetInstance()->GetResourceManager()->LoadResource(path, true).get()); + static_cast(Context::GetInstance()->GetResourceManager()->LoadResource(path, true).get()); LoadGuiTexture(name, *res, tint); } diff --git a/src/window/gui/Gui.h b/src/window/gui/Gui.h index 78248209f..ce828822e 100644 --- a/src/window/gui/Gui.h +++ b/src/window/gui/Gui.h @@ -86,7 +86,7 @@ class Gui { void LoadGuiTexture(const std::string& name, const std::string& path, const ImVec4& tint); bool HasTextureByName(const std::string& name); - void LoadGuiTexture(const std::string& name, const LUS::Texture& tex, const ImVec4& tint); + void LoadGuiTexture(const std::string& name, const Fast::Texture& tex, const ImVec4& tint); void UnloadTexture(const std::string& name); ImTextureID GetTextureByName(const std::string& name); ImVec2 GetTextureSize(const std::string& name);