From bbf3b658c24547c34c7d3f3b46bebaccf1b65fea Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sat, 1 Oct 2022 15:00:38 -0400 Subject: [PATCH] Link CFontImageDef --- include/Kyoto/Text/CFontImageDef.hpp | 7 ++++--- include/rstl/vector.hpp | 10 +--------- ldscript.lcf | 1 - obj_files.mk | 2 +- src/Kyoto/Text/CFontImageDef.cpp | 3 +-- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/include/Kyoto/Text/CFontImageDef.hpp b/include/Kyoto/Text/CFontImageDef.hpp index c8ad700a..952237be 100644 --- a/include/Kyoto/Text/CFontImageDef.hpp +++ b/include/Kyoto/Text/CFontImageDef.hpp @@ -13,10 +13,11 @@ public: CFontImageDef(const TToken< CTexture >& texture, const CVector2f& cropFactor); CFontImageDef(const rstl::vector< TToken< CTexture > >& texture, float fps, const CVector2f& cropFactor); + bool IsLoaded() const; - //inline short GetWidth() { } - int GetHeight() { - TToken tex = mTextures[0]; + // inline short GetWidth() { } + int GetHeight() { + TToken< CTexture > tex = mTextures[0]; return tex.GetT()->GetHeight() * mCropFactor.GetY(); } int CalculateBaseline(); diff --git a/include/rstl/vector.hpp b/include/rstl/vector.hpp index eba4927a..a76edae1 100644 --- a/include/rstl/vector.hpp +++ b/include/rstl/vector.hpp @@ -40,21 +40,13 @@ public: inline const_iterator end() const { return const_iterator(xc_items + x4_count); } inline vector() : x4_count(0), x8_capacity(0), xc_items(NULL) {} inline vector(int count) : x4_count(0), x8_capacity(0), xc_items(0) { reserve(count); } - inline explicit vector(const T& v) : x4_count(1), x8_capacity(1) { - if (x4_count * sizeof(T) == 0) { - xc_items = NULL; - } else { - x0_allocator.allocate(xc_items, x4_count * sizeof(T)); - } - new (&xc_items[0]) T(v); - } vector(int count, const T& v) : x4_count(count), x8_capacity(count) { if (x4_count * sizeof(T) == 0) { xc_items = NULL; } else { x0_allocator.allocate(xc_items, x4_count * sizeof(T)); } - uninitialized_fill_n(xc_items, x8_capacity, v); + uninitialized_fill_n(xc_items, count, v); } vector(const vector& other) { x4_count = other.x4_count; diff --git a/ldscript.lcf b/ldscript.lcf index 74b9fc95..f85901c7 100644 --- a/ldscript.lcf +++ b/ldscript.lcf @@ -60,7 +60,6 @@ FORCEFILES CloseEnough.o CParticleGen.o CWarp.o - CFontImageDef.o CImageInstruction.o RumbleFxTable.o CGuiWidgetDrawParms.o diff --git a/obj_files.mk b/obj_files.mk index 1b359ac1..64ffe0a6 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -602,7 +602,7 @@ KYOTO_2 :=\ $(BUILD_DIR)/src/Kyoto/CTimeProvider.o\ $(BUILD_DIR)/asm/Kyoto/CARAMToken.o\ $(BUILD_DIR)/asm/Kyoto/Audio/CMidiManager.o\ - $(BUILD_DIR)/asm/Kyoto/Text/CFontImageDef.o\ + $(BUILD_DIR)/src/Kyoto/Text/CFontImageDef.o\ $(BUILD_DIR)/asm/Kyoto/Text/CImageInstruction.o\ $(BUILD_DIR)/asm/Kyoto/Text/CTextRenderBuffer.o\ $(BUILD_DIR)/asm/Kyoto/Graphics/CCubeMoviePlayer.o\ diff --git a/src/Kyoto/Text/CFontImageDef.cpp b/src/Kyoto/Text/CFontImageDef.cpp index 2ca5f0ec..b8a1f22c 100644 --- a/src/Kyoto/Text/CFontImageDef.cpp +++ b/src/Kyoto/Text/CFontImageDef.cpp @@ -2,9 +2,8 @@ #include CFontImageDef::CFontImageDef(const TToken< CTexture >& texture, const CVector2f& cropFactor) -: mFPS(0.f), mTextures(texture), mCropFactor(cropFactor) { +: mFPS(0.f), mTextures(1, texture), mCropFactor(cropFactor) { rstl::vector< TToken< CTexture > >::iterator it = mTextures.begin(); - for (; it != mTextures.end(); ++it) { it->Lock(); }