Link CFontImageDef

This commit is contained in:
Luke Street 2022-10-01 15:00:38 -04:00
parent 1e30daa096
commit bbf3b658c2
5 changed files with 7 additions and 16 deletions

View File

@ -13,10 +13,11 @@ public:
CFontImageDef(const TToken< CTexture >& texture, const CVector2f& cropFactor); CFontImageDef(const TToken< CTexture >& texture, const CVector2f& cropFactor);
CFontImageDef(const rstl::vector< TToken< CTexture > >& texture, float fps, CFontImageDef(const rstl::vector< TToken< CTexture > >& texture, float fps,
const CVector2f& cropFactor); const CVector2f& cropFactor);
bool IsLoaded() const; bool IsLoaded() const;
//inline short GetWidth() { } // inline short GetWidth() { }
int GetHeight() { int GetHeight() {
TToken<CTexture> tex = mTextures[0]; TToken< CTexture > tex = mTextures[0];
return tex.GetT()->GetHeight() * mCropFactor.GetY(); return tex.GetT()->GetHeight() * mCropFactor.GetY();
} }
int CalculateBaseline(); int CalculateBaseline();

View File

@ -40,21 +40,13 @@ public:
inline const_iterator end() const { return const_iterator(xc_items + x4_count); } 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() : 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 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) { vector(int count, const T& v) : x4_count(count), x8_capacity(count) {
if (x4_count * sizeof(T) == 0) { if (x4_count * sizeof(T) == 0) {
xc_items = NULL; xc_items = NULL;
} else { } else {
x0_allocator.allocate(xc_items, x4_count * sizeof(T)); 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) { vector(const vector& other) {
x4_count = other.x4_count; x4_count = other.x4_count;

View File

@ -60,7 +60,6 @@ FORCEFILES
CloseEnough.o CloseEnough.o
CParticleGen.o CParticleGen.o
CWarp.o CWarp.o
CFontImageDef.o
CImageInstruction.o CImageInstruction.o
RumbleFxTable.o RumbleFxTable.o
CGuiWidgetDrawParms.o CGuiWidgetDrawParms.o

View File

@ -602,7 +602,7 @@ KYOTO_2 :=\
$(BUILD_DIR)/src/Kyoto/CTimeProvider.o\ $(BUILD_DIR)/src/Kyoto/CTimeProvider.o\
$(BUILD_DIR)/asm/Kyoto/CARAMToken.o\ $(BUILD_DIR)/asm/Kyoto/CARAMToken.o\
$(BUILD_DIR)/asm/Kyoto/Audio/CMidiManager.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/CImageInstruction.o\
$(BUILD_DIR)/asm/Kyoto/Text/CTextRenderBuffer.o\ $(BUILD_DIR)/asm/Kyoto/Text/CTextRenderBuffer.o\
$(BUILD_DIR)/asm/Kyoto/Graphics/CCubeMoviePlayer.o\ $(BUILD_DIR)/asm/Kyoto/Graphics/CCubeMoviePlayer.o\

View File

@ -2,9 +2,8 @@
#include <Kyoto/Text/CFontImageDef.hpp> #include <Kyoto/Text/CFontImageDef.hpp>
CFontImageDef::CFontImageDef(const TToken< CTexture >& texture, const CVector2f& cropFactor) 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(); rstl::vector< TToken< CTexture > >::iterator it = mTextures.begin();
for (; it != mTextures.end(); ++it) { for (; it != mTextures.end(); ++it) {
it->Lock(); it->Lock();
} }