aboutsummaryrefslogtreecommitdiff
path: root/Source/Font.c
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2018-11-18 20:03:35 +0100
committerXavier ASUS <xavi92psx@gmail.com>2018-11-18 20:03:35 +0100
commit2ccc0f5edd5f8e61bd0760f30b2d66f2d977b2bf (patch)
tree332a528b512d7e53ac913eb72b1e48bcbe760cad /Source/Font.c
parent4c0028bfcc5da708e47a349f060954e67fb9c2d7 (diff)
downloadairport-2ccc0f5edd5f8e61bd0760f30b2d66f2d977b2bf.tar.gz
Added "const" qualifier to some functions.
"cdrom:\ and ;1" are automatically inserted into file name, in order to save memory space. Some minor optimizations.
Diffstat (limited to 'Source/Font.c')
-rw-r--r--Source/Font.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/Font.c b/Source/Font.c
index a639acb..0eef357 100644
--- a/Source/Font.c
+++ b/Source/Font.c
@@ -20,14 +20,14 @@
* *************************************/
enum
-{
+{
// We will use the most significant bit
// for internal purposes.
SQUARE_BTN_8BIT = 128,
CROSS_BTN_8BIT,
CIRCLE_BTN_8BIT,
- TRIANGLE_BTN_8BIT
+ TRIANGLE_BTN_8BIT
};
/* *************************************
@@ -41,7 +41,7 @@ enum
static char _internal_text[FONT_INTERNAL_TEXT_BUFFER_MAX_SIZE];
static volatile unsigned char _blend_effect_lum;
-bool FontLoadImage(char* strPath, TYPE_FONT * ptrFont)
+bool FontLoadImage(const char* strPath, TYPE_FONT * ptrFont)
{
if (GfxSpriteFromFile(strPath, &ptrFont->spr) == false)
{
@@ -104,8 +104,8 @@ void FontSetSize(TYPE_FONT * ptrFont, short size)
}
void FontSetMaxCharPerLine(TYPE_FONT* ptrFont, uint8_t max)
-{
- ptrFont->max_ch_wrap = max;
+{
+ ptrFont->max_ch_wrap = max;
}
void FontSetSpacing(TYPE_FONT* ptrFont, short spacing)
@@ -118,7 +118,7 @@ void FontCyclic(void)
_blend_effect_lum -= 8;
}
-void FontPrintText(TYPE_FONT * ptrFont, short x, short y, char* str, ...)
+void FontPrintText(TYPE_FONT * ptrFont, short x, short y, const char* str, ...)
{
uint16_t i;
uint8_t line_count = 0;
@@ -176,7 +176,7 @@ void FontPrintText(TYPE_FONT * ptrFont, short x, short y, char* str, ...)
for (j = i + 1; j < result; j++)
{
if (_internal_text[j] != ' ')
- {
+ {
if (++aux_line_count >= ptrFont->max_ch_wrap)
{
line_count = 0;
@@ -184,18 +184,18 @@ void FontPrintText(TYPE_FONT * ptrFont, short x, short y, char* str, ...)
y += ptrFont->char_h;
linefeed_needed = true;
break;
- }
+ }
}
else
- {
- break;
- }
+ {
+ break;
+ }
}
}
if (linefeed_needed == false)
- {
- x += ptrFont->char_w;
+ {
+ x += ptrFont->char_w;
}
continue;