From b863f59d148e38de753b3fd461a9ac5d439eafda Mon Sep 17 00:00:00 2001 From: karutoh Date: Wed, 24 Jan 2024 17:38:34 -0800 Subject: [PATCH] Fixed BaseObj and FontAtlas. --- CMakeLists.txt | 2 +- include/ehs/io/FontAtlas.h | 2 ++ src/BaseObj.cpp | 8 ++++---- src/io/FontAtlas.cpp | 5 +++++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b87f685..1ca2692 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,7 +258,7 @@ if (IS_ARCH_AMD64) target_link_libraries(EHS OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB) if (IS_OS_WINDOWS) - target_link_libraries(StrToHash ws2_32 avrt LWE) + target_link_libraries(StrToHash ws2_32 avrt EHS) elseif (IS_OS_LINUX) #add_compile_definitions(EHS_WOOTING) diff --git a/include/ehs/io/FontAtlas.h b/include/ehs/io/FontAtlas.h index 65f9286..73b50c0 100644 --- a/include/ehs/io/FontAtlas.h +++ b/include/ehs/io/FontAtlas.h @@ -46,6 +46,8 @@ namespace ehs UInt_64 GetGlyphScale() const; + const Array& GetGlyphs() const; + Glyph GetGlyph(Char_32 code) const; Vec2_u64 GetResolution() const; diff --git a/src/BaseObj.cpp b/src/BaseObj.cpp index 4de18ad..a127e8b 100644 --- a/src/BaseObj.cpp +++ b/src/BaseObj.cpp @@ -109,22 +109,22 @@ namespace ehs Type BaseObj::GetType() const { - return hierarchy[hierarchySize - 1]; + return hierarchy[0]; } UInt_64 BaseObj::GetTypeIdSize() const { - return hierarchy[hierarchySize - 1].GetSize(); + return hierarchy[0].GetSize(); } const Char_8* BaseObj::GetTypeId() const { - return hierarchy[hierarchySize - 1].GetId(); + return hierarchy[0].GetId(); } UInt_64 BaseObj::GetTypeHashId() const { - return hierarchy[hierarchySize - 1].GetHashId(); + return hierarchy[0].GetHashId(); } BaseObj* BaseObj::Clone() const diff --git a/src/io/FontAtlas.cpp b/src/io/FontAtlas.cpp index ecf3639..a006829 100644 --- a/src/io/FontAtlas.cpp +++ b/src/io/FontAtlas.cpp @@ -141,6 +141,11 @@ namespace ehs return glyphScale; } + const Array& FontAtlas::GetGlyphs() const + { + return glyphs; + } + Glyph FontAtlas::GetGlyph(const Char_32 code) const { for (UInt_32 i = 0; i < glyphs.Size(); ++i)