fixed crash with non-ASCII chars

svn-id: r6577
This commit is contained in:
Max Horn 2003-01-30 16:02:20 +00:00
parent 439046716b
commit 756c059a12
2 changed files with 8 additions and 8 deletions

View File

@ -124,7 +124,7 @@ bool NutRenderer::loadFont(const char *filename, const char *dir) {
return true;
}
int32 NutRenderer::getCharWidth(char c) {
int32 NutRenderer::getCharWidth(byte c) {
debug(2, "NutRenderer::getCharWidth() called");
if (_loaded == false) {
debug(2, "NutRenderer::getCharWidth() Font is not loaded");
@ -134,7 +134,7 @@ int32 NutRenderer::getCharWidth(char c) {
return READ_LE_UINT16(_dataSrc + _offsets[c] + 6);
}
int32 NutRenderer::getCharHeight(char c) {
int32 NutRenderer::getCharHeight(byte c) {
debug(2, "NutRenderer::getCharHeight() called");
if (_loaded == false) {
debug(2, "NutRenderer::getCharHeight() Font is not loaded");
@ -144,7 +144,7 @@ int32 NutRenderer::getCharHeight(char c) {
return READ_LE_UINT16(_dataSrc + _offsets[c] + 8);
}
int32 NutRenderer::getStringWidth(char *string) {
int32 NutRenderer::getStringWidth(byte *string) {
debug(2, "NutRenderer::getStringWidth() called");
if (_loaded == false) {
debug(2, "NutRenderer::getStringWidth() Font is not loaded");
@ -161,7 +161,7 @@ int32 NutRenderer::getStringWidth(char *string) {
return length;
}
void NutRenderer::drawChar(char c, int32 x, int32 y, byte color, bool useMask) {
void NutRenderer::drawChar(byte c, int32 x, int32 y, byte color, bool useMask) {
debug(2, "NutRenderer::drawChar('%c', %d, %d, %d, %d) called", c, x, y, (int)color, useMask);
if (_loaded == false) {
debug(2, "NutRenderer::drawChar() Font is not loaded");

View File

@ -41,11 +41,11 @@ public:
~NutRenderer();
bool loadFont(const char *filename, const char *dir);
void drawChar(char c, int32 x, int32 y, byte color, bool useMask);
void drawChar(byte c, int32 x, int32 y, byte color, bool useMask);
// void drawString(const char *string, int32 x, int32 y, byte color, int32 mode);
int32 getCharWidth(char c);
int32 getCharHeight(char c);
int32 getStringWidth(char *string);
int32 getCharWidth(byte c);
int32 getCharHeight(byte c);
int32 getStringWidth(byte *string);
};