mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-07-02 22:14:37 +00:00
Minor changes; based on russian opensource patch.
This commit is contained in:
parent
c7d7e6126f
commit
283fc0086e
5 changed files with 35 additions and 40 deletions
|
@ -241,6 +241,7 @@ public:
|
|||
BB_MAKE_WRITE_OP(float);
|
||||
BB_MAKE_WRITE_OP(double);
|
||||
BB_MAKE_WRITE_OP(int);
|
||||
BB_MAKE_WRITE_OP(unsigned int);
|
||||
|
||||
ByteBuffer &operator<<(bool value)
|
||||
{
|
||||
|
@ -272,6 +273,7 @@ public:
|
|||
BB_MAKE_READ_OP(float);
|
||||
BB_MAKE_READ_OP(double);
|
||||
BB_MAKE_READ_OP(int);
|
||||
BB_MAKE_READ_OP(unsigned int);
|
||||
|
||||
ByteBuffer &operator>>(bool &value)
|
||||
{
|
||||
|
|
|
@ -74,7 +74,7 @@ bool GLFont::Create (const char *file_name, int tex, bool loadTexture)
|
|||
vfclose(fh);
|
||||
#endif
|
||||
|
||||
int dummy;
|
||||
ByteBuffer::uint32 dummy;
|
||||
|
||||
// Read the header from file
|
||||
header.tex = tex;
|
||||
|
@ -197,7 +197,7 @@ int GLFont::GetEndChar (void)
|
|||
return header.end_char;
|
||||
}
|
||||
//*******************************************************************
|
||||
void GLFont::GetCharSize (int c, std::pair<int, int> *size)
|
||||
void GLFont::GetCharSize (unsigned int c, std::pair<int, int> *size)
|
||||
{
|
||||
//Make sure character is in range
|
||||
if (c < header.start_char || c > header.end_char)
|
||||
|
@ -218,7 +218,7 @@ void GLFont::GetCharSize (int c, std::pair<int, int> *size)
|
|||
}
|
||||
}
|
||||
//*******************************************************************
|
||||
int GLFont::GetCharWidth (int c)
|
||||
int GLFont::GetCharWidth (unsigned int c)
|
||||
{
|
||||
//Make sure in range
|
||||
if (c < header.start_char || c > header.end_char)
|
||||
|
@ -242,7 +242,7 @@ int GLFont::GetCharWidth (int c)
|
|||
}
|
||||
}
|
||||
//*******************************************************************
|
||||
int GLFont::GetCharHeight (int c)
|
||||
int GLFont::GetCharHeight (unsigned int c)
|
||||
{
|
||||
//Make sure in range
|
||||
if (c < header.start_char || c > header.end_char)
|
||||
|
@ -268,7 +268,7 @@ void GLFont::Begin (void)
|
|||
void GLFont::GetStringSize (const std::string &text, std::pair<int, int> *size)
|
||||
{
|
||||
unsigned int i;
|
||||
char c;
|
||||
unsigned char c;
|
||||
GLFontChar *glfont_char;
|
||||
float width;
|
||||
|
||||
|
@ -282,7 +282,7 @@ void GLFont::GetStringSize (const std::string &text, std::pair<int, int> *size)
|
|||
for (i = 0; i < text.size(); i++)
|
||||
{
|
||||
//Make sure character is in range
|
||||
c = (char)text[i];
|
||||
c = (unsigned char)text[i];
|
||||
|
||||
if (c < header.start_char || c > header.end_char)
|
||||
continue;
|
||||
|
|
|
@ -36,9 +36,9 @@ private:
|
|||
//glFont header structure
|
||||
struct
|
||||
{
|
||||
int tex;
|
||||
int tex_width, tex_height;
|
||||
int start_char, end_char;
|
||||
unsigned int tex;
|
||||
unsigned int tex_width, tex_height;
|
||||
unsigned int start_char, end_char;
|
||||
GLFontChar *chars;
|
||||
} header;
|
||||
|
||||
|
@ -70,9 +70,9 @@ public:
|
|||
int GetEndChar (void);
|
||||
|
||||
//Character size retrieval methods
|
||||
void GetCharSize (int c, std::pair<int, int> *size);
|
||||
int GetCharWidth (int c);
|
||||
int GetCharHeight (int c);
|
||||
void GetCharSize (unsigned int c, std::pair<int, int> *size);
|
||||
int GetCharWidth (unsigned int c);
|
||||
int GetCharHeight (unsigned int c);
|
||||
|
||||
void GetStringSize (const std::string &text, std::pair<int, int> *size);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue