mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-04-07 23:27:12 +00:00
remove unused code from BitmapFont
This commit is contained in:
parent
5fab8f4d81
commit
7e51dc55b7
2 changed files with 6 additions and 44 deletions
|
@ -88,10 +88,6 @@ BitmapText::BitmapText(const BmpFont& bmpFont)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitmapText::autoKern()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int BitmapText::getWidthOnScreen()
|
int BitmapText::getWidthOnScreen()
|
||||||
{
|
{
|
||||||
return text.size()*(fontDrawSize/2);
|
return text.size()*(fontDrawSize/2);
|
||||||
|
@ -102,7 +98,7 @@ void BitmapText::setAlign(Align align)
|
||||||
this->align = align;
|
this->align = align;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string BitmapText::getText()
|
const std::string& BitmapText::getText()
|
||||||
{
|
{
|
||||||
return this->text;
|
return this->text;
|
||||||
}
|
}
|
||||||
|
@ -179,23 +175,6 @@ void BitmapText::formatText()
|
||||||
{
|
{
|
||||||
lines.push_back(text);
|
lines.push_back(text);
|
||||||
}
|
}
|
||||||
colorIndices.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BitmapText::updateWordColoring()
|
|
||||||
{
|
|
||||||
colorIndices.resize(lines.size());
|
|
||||||
for (size_t i = 0; i < colorIndices.size(); i++)
|
|
||||||
{
|
|
||||||
colorIndices[i].resize(lines[i].size());
|
|
||||||
for (size_t j = 0; j < colorIndices[i].size(); j++)
|
|
||||||
{
|
|
||||||
colorIndices[i][j] = Vector(1,1,1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BitmapText::isEmpty()
|
bool BitmapText::isEmpty()
|
||||||
|
@ -255,22 +234,10 @@ void BitmapText::onUpdate(float dt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector BitmapText::getColorIndex(size_t i, size_t j)
|
|
||||||
{
|
|
||||||
Vector c(1,1,1);
|
|
||||||
if ( i < colorIndices.size() && j < colorIndices[i].size())
|
|
||||||
{
|
|
||||||
c = colorIndices[i][j];
|
|
||||||
}
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BitmapText::onRender(const RenderState& rs) const
|
void BitmapText::onRender(const RenderState& rs) const
|
||||||
{
|
{
|
||||||
const Vector top = bmpFont.fontTopColor;
|
const Vector top = bmpFont.fontTopColor * color;
|
||||||
const Vector btm = bmpFont.fontBtmColor;
|
const Vector btm = bmpFont.fontBtmColor * color;
|
||||||
float top_color[3] = {top.x*color.x, top.y*color.y, top.z*color.z};
|
|
||||||
float bottom_color[3] = {btm.x*color.x, btm.y*color.y, btm.z*color.z};
|
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
@ -304,7 +271,7 @@ void BitmapText::onRender(const RenderState& rs) const
|
||||||
float la = 1.0f-(scrollDelay/scrollSpeed);
|
float la = 1.0f-(scrollDelay/scrollSpeed);
|
||||||
|
|
||||||
|
|
||||||
font->DrawString(theLine, scale, x, y, top_color, bottom_color, alpha.x, la);
|
font->DrawString(theLine, scale, x, y, &top.x, &btm.x, alpha.x, la);
|
||||||
y += adj;
|
y += adj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -319,7 +286,7 @@ void BitmapText::onRender(const RenderState& rs) const
|
||||||
font->GetStringSize(lines[i], &sz);
|
font->GetStringSize(lines[i], &sz);
|
||||||
x = -sz.first*0.5f*scale;
|
x = -sz.first*0.5f*scale;
|
||||||
}
|
}
|
||||||
font->DrawString(lines[i], scale, x, y, top_color, bottom_color, alpha.x, 1);
|
font->DrawString(lines[i], scale, x, y, &top.x, &btm.x, alpha.x, 1);
|
||||||
y += adj;
|
y += adj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,11 +57,8 @@ public:
|
||||||
void stopScrollingText();
|
void stopScrollingText();
|
||||||
bool isEmpty();
|
bool isEmpty();
|
||||||
virtual void setAlign(Align align) OVERRIDE;
|
virtual void setAlign(Align align) OVERRIDE;
|
||||||
std::string getText();
|
const std::string& getText();
|
||||||
int getWidthOnScreen();
|
int getWidthOnScreen();
|
||||||
Vector getColorIndex(size_t i, size_t j);
|
|
||||||
void updateWordColoring();
|
|
||||||
void autoKern();
|
|
||||||
virtual float getHeight() const OVERRIDE;
|
virtual float getHeight() const OVERRIDE;
|
||||||
void unloadDevice() OVERRIDE;
|
void unloadDevice() OVERRIDE;
|
||||||
void reloadDevice() OVERRIDE;
|
void reloadDevice() OVERRIDE;
|
||||||
|
@ -85,8 +82,6 @@ protected:
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
typedef std::vector<std::string> Lines;
|
typedef std::vector<std::string> Lines;
|
||||||
Lines lines;
|
Lines lines;
|
||||||
typedef std::vector<Vector> ColorIndices;
|
|
||||||
std::vector<ColorIndices> colorIndices;
|
|
||||||
std::string text;
|
std::string text;
|
||||||
float textWidth;
|
float textWidth;
|
||||||
float maxW;
|
float maxW;
|
||||||
|
|
Loading…
Add table
Reference in a new issue