From 9f2509da79d3a63853ac785538aa69c3888770aa Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 10 Feb 2014 10:02:42 -0800 Subject: [PATCH] Exposed the font character size and SDLTest_DrawCharacter() to make it easier to do custom debug text layout --- include/SDL_test_font.h | 16 ++- src/test/SDL_test_font.c | 264 +++++++++++++++++++-------------------- 2 files changed, 147 insertions(+), 133 deletions(-) diff --git a/include/SDL_test_font.h b/include/SDL_test_font.h index dd19f0782..8d51d4a9b 100644 --- a/include/SDL_test_font.h +++ b/include/SDL_test_font.h @@ -38,6 +38,20 @@ extern "C" { /* Function prototypes */ +#define FONT_CHARACTER_SIZE 8 + +/** + * \brief Draw a string in the currently set font. + * + * \param renderer The renderer to draw on. + * \param x The X coordinate of the upper left corner of the character. + * \param y The Y coordinate of the upper left corner of the character. + * \param c The character to draw. + * + * \returns Returns 0 on success, -1 on failure. + */ +int SDLTest_DrawCharacter( SDL_Renderer *renderer, int x, int y, char c ); + /** * \brief Draw a string in the currently set font. * @@ -48,7 +62,7 @@ extern "C" { * * \returns Returns 0 on success, -1 on failure. */ -int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s); +int SDLTest_DrawString( SDL_Renderer * renderer, int x, int y, const char *s ); /* Ends C function definitions when using C++ */ diff --git a/src/test/SDL_test_font.c b/src/test/SDL_test_font.c index 9e419e317..a6bc40cef 100644 --- a/src/test/SDL_test_font.c +++ b/src/test/SDL_test_font.c @@ -1569,7 +1569,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 128 0x80 '�' + * 128 0x80 '' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ @@ -1581,7 +1581,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x78, /* 01111000 */ /* - * 129 0x81 '�' + * 129 0x81 '' */ 0xcc, /* 11001100 */ 0x00, /* 00000000 */ @@ -1593,7 +1593,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 130 0x82 '�' + * 130 0x82 '' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ @@ -1605,7 +1605,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 131 0x83 '�' + * 131 0x83 '' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ @@ -1617,7 +1617,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 132 0x84 '�' + * 132 0x84 '' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ @@ -1629,7 +1629,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 133 0x85 '�' + * 133 0x85 '' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ @@ -1641,7 +1641,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 134 0x86 '�' + * 134 0x86 '' */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ @@ -1653,7 +1653,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 135 0x87 '�' + * 135 0x87 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -1665,7 +1665,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x38, /* 00111000 */ /* - * 136 0x88 '�' + * 136 0x88 '' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ @@ -1677,7 +1677,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 137 0x89 '�' + * 137 0x89 '' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ @@ -1689,7 +1689,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 138 0x8a '�' + * 138 0x8a '' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ @@ -1701,7 +1701,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 139 0x8b '�' + * 139 0x8b '' */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ @@ -1713,7 +1713,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 140 0x8c '�' + * 140 0x8c '' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ @@ -1725,7 +1725,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 141 0x8d '�' + * 141 0x8d '' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ @@ -1737,7 +1737,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 142 0x8e '�' + * 142 0x8e '' */ 0xc6, /* 11000110 */ 0x38, /* 00111000 */ @@ -1749,7 +1749,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 143 0x8f '�' + * 143 0x8f '' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ @@ -1761,7 +1761,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 144 0x90 '�' + * 144 0x90 '' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ @@ -1773,7 +1773,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 145 0x91 '�' + * 145 0x91 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -1785,7 +1785,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 146 0x92 '�' + * 146 0x92 '' */ 0x3e, /* 00111110 */ 0x6c, /* 01101100 */ @@ -1797,7 +1797,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 147 0x93 '�' + * 147 0x93 '' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ @@ -1809,7 +1809,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 148 0x94 '�' + * 148 0x94 '' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ @@ -1821,7 +1821,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 149 0x95 '�' + * 149 0x95 '' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ @@ -1833,7 +1833,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 150 0x96 '�' + * 150 0x96 '' */ 0x78, /* 01111000 */ 0x84, /* 10000100 */ @@ -1845,7 +1845,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 151 0x97 '�' + * 151 0x97 '' */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ @@ -1857,7 +1857,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 152 0x98 '�' + * 152 0x98 '' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ @@ -1869,7 +1869,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0xfc, /* 11111100 */ /* - * 153 0x99 '�' + * 153 0x99 '' */ 0xc6, /* 11000110 */ 0x38, /* 00111000 */ @@ -1881,7 +1881,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 154 0x9a '�' + * 154 0x9a '' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ @@ -1893,7 +1893,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 155 0x9b '�' + * 155 0x9b '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -1905,7 +1905,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 156 0x9c '�' + * 156 0x9c '' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ @@ -1917,7 +1917,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 157 0x9d '�' + * 157 0x9d '' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ @@ -1929,7 +1929,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 158 0x9e '�' + * 158 0x9e '' */ 0xf8, /* 11111000 */ 0xcc, /* 11001100 */ @@ -1941,7 +1941,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0xc7, /* 11000111 */ /* - * 159 0x9f '�' + * 159 0x9f '' */ 0x0e, /* 00001110 */ 0x1b, /* 00011011 */ @@ -1953,7 +1953,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 160 0xa0 '�' + * 160 0xa0 '' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ @@ -1965,7 +1965,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 161 0xa1 '�' + * 161 0xa1 '' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ @@ -1977,7 +1977,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 162 0xa2 '�' + * 162 0xa2 '' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ @@ -1989,7 +1989,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 163 0xa3 '�' + * 163 0xa3 '' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ @@ -2001,7 +2001,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 164 0xa4 '�' + * 164 0xa4 '' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ @@ -2013,7 +2013,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 165 0xa5 '�' + * 165 0xa5 '' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ @@ -2025,7 +2025,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 166 0xa6 '�' + * 166 0xa6 '' */ 0x3c, /* 00111100 */ 0x6c, /* 01101100 */ @@ -2037,7 +2037,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 167 0xa7 '�' + * 167 0xa7 '' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ @@ -2049,7 +2049,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 168 0xa8 '�' + * 168 0xa8 '' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ @@ -2061,7 +2061,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 169 0xa9 '�' + * 169 0xa9 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2073,7 +2073,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 170 0xaa '�' + * 170 0xaa '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2085,7 +2085,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 171 0xab '�' + * 171 0xab '' */ 0x63, /* 01100011 */ 0xe6, /* 11100110 */ @@ -2097,7 +2097,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x0f, /* 00001111 */ /* - * 172 0xac '�' + * 172 0xac '' */ 0x63, /* 01100011 */ 0xe6, /* 11100110 */ @@ -2109,7 +2109,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x06, /* 00000110 */ /* - * 173 0xad '�' + * 173 0xad '' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ @@ -2121,7 +2121,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 174 0xae '�' + * 174 0xae '' */ 0x00, /* 00000000 */ 0x33, /* 00110011 */ @@ -2133,7 +2133,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 175 0xaf '�' + * 175 0xaf '' */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ @@ -2145,7 +2145,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 176 0xb0 '�' + * 176 0xb0 '' */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ @@ -2157,7 +2157,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x88, /* 10001000 */ /* - * 177 0xb1 '�' + * 177 0xb1 '' */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ @@ -2169,7 +2169,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0xaa, /* 10101010 */ /* - * 178 0xb2 '�' + * 178 0xb2 '' */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ @@ -2181,7 +2181,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0xdd, /* 11011101 */ /* - * 179 0xb3 '�' + * 179 0xb3 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2193,7 +2193,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 180 0xb4 '�' + * 180 0xb4 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2205,7 +2205,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 181 0xb5 '�' + * 181 0xb5 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2217,7 +2217,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 182 0xb6 '�' + * 182 0xb6 '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2229,7 +2229,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 183 0xb7 '�' + * 183 0xb7 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2241,7 +2241,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 184 0xb8 '�' + * 184 0xb8 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2253,7 +2253,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 185 0xb9 '�' + * 185 0xb9 '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2265,7 +2265,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 186 0xba '�' + * 186 0xba '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2277,7 +2277,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 187 0xbb '�' + * 187 0xbb '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2289,7 +2289,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 188 0xbc '�' + * 188 0xbc '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2301,7 +2301,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 189 0xbd '�' + * 189 0xbd '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2313,7 +2313,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 190 0xbe '�' + * 190 0xbe '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2325,7 +2325,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 191 0xbf '�' + * 191 0xbf '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2337,7 +2337,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 192 0xc0 '�' + * 192 0xc0 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2349,7 +2349,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 193 0xc1 '�' + * 193 0xc1 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2361,7 +2361,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 194 0xc2 '�' + * 194 0xc2 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2373,7 +2373,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 195 0xc3 '�' + * 195 0xc3 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2385,7 +2385,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 196 0xc4 '�' + * 196 0xc4 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2397,7 +2397,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 197 0xc5 '�' + * 197 0xc5 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2409,7 +2409,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 198 0xc6 '�' + * 198 0xc6 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2421,7 +2421,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 199 0xc7 '�' + * 199 0xc7 '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2433,7 +2433,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 200 0xc8 '�' + * 200 0xc8 '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2445,7 +2445,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 201 0xc9 '�' + * 201 0xc9 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2457,7 +2457,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 202 0xca '�' + * 202 0xca '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2469,7 +2469,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 203 0xcb '�' + * 203 0xcb '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2481,7 +2481,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 204 0xcc '�' + * 204 0xcc '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2493,7 +2493,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 205 0xcd '�' + * 205 0xcd '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2505,7 +2505,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 206 0xce '�' + * 206 0xce '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2517,7 +2517,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 207 0xcf '�' + * 207 0xcf '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2529,7 +2529,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 208 0xd0 '�' + * 208 0xd0 '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2541,7 +2541,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 209 0xd1 '�' + * 209 0xd1 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2553,7 +2553,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 210 0xd2 '�' + * 210 0xd2 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2565,7 +2565,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 211 0xd3 '�' + * 211 0xd3 '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2577,7 +2577,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 212 0xd4 '�' + * 212 0xd4 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2589,7 +2589,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 213 0xd5 '�' + * 213 0xd5 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2601,7 +2601,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 214 0xd6 '�' + * 214 0xd6 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2613,7 +2613,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 215 0xd7 '�' + * 215 0xd7 '' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ @@ -2625,7 +2625,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x36, /* 00110110 */ /* - * 216 0xd8 '�' + * 216 0xd8 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2637,7 +2637,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 217 0xd9 '�' + * 217 0xd9 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2649,7 +2649,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 218 0xda '�' + * 218 0xda '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2661,7 +2661,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 219 0xdb '�' + * 219 0xdb '' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ @@ -2673,7 +2673,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0xff, /* 11111111 */ /* - * 220 0xdc '�' + * 220 0xdc '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2685,7 +2685,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0xff, /* 11111111 */ /* - * 221 0xdd '�' + * 221 0xdd '' */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ @@ -2697,7 +2697,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0xf0, /* 11110000 */ /* - * 222 0xde '�' + * 222 0xde '' */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ @@ -2709,7 +2709,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x0f, /* 00001111 */ /* - * 223 0xdf '�' + * 223 0xdf '' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ @@ -2721,7 +2721,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 224 0xe0 '�' + * 224 0xe0 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2733,7 +2733,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 225 0xe1 '�' + * 225 0xe1 '' */ 0x78, /* 01111000 */ 0xcc, /* 11001100 */ @@ -2745,7 +2745,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 226 0xe2 '�' + * 226 0xe2 '' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ @@ -2757,7 +2757,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 227 0xe3 '�' + * 227 0xe3 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2769,7 +2769,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 228 0xe4 '�' + * 228 0xe4 '' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ @@ -2781,7 +2781,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 229 0xe5 '�' + * 229 0xe5 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2793,7 +2793,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 230 0xe6 '�' + * 230 0xe6 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2805,7 +2805,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0xc0, /* 11000000 */ /* - * 231 0xe7 '�' + * 231 0xe7 '' */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ @@ -2817,7 +2817,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 232 0xe8 '�' + * 232 0xe8 '' */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ @@ -2829,7 +2829,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x7e, /* 01111110 */ /* - * 233 0xe9 '�' + * 233 0xe9 '' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ @@ -2841,7 +2841,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 234 0xea '�' + * 234 0xea '' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ @@ -2853,7 +2853,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 235 0xeb '�' + * 235 0xeb '' */ 0x0e, /* 00001110 */ 0x18, /* 00011000 */ @@ -2865,7 +2865,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 236 0xec '�' + * 236 0xec '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -2877,7 +2877,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 237 0xed '�' + * 237 0xed '' */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ @@ -2889,7 +2889,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0xc0, /* 11000000 */ /* - * 238 0xee '�' + * 238 0xee '' */ 0x1e, /* 00011110 */ 0x30, /* 00110000 */ @@ -2901,7 +2901,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 239 0xef '�' + * 239 0xef '' */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ @@ -2913,7 +2913,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 240 0xf0 '�' + * 240 0xf0 '' */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ @@ -2925,7 +2925,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 241 0xf1 '�' + * 241 0xf1 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2937,7 +2937,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 242 0xf2 '�' + * 242 0xf2 '' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ @@ -2949,7 +2949,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 243 0xf3 '�' + * 243 0xf3 '' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ @@ -2961,7 +2961,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 244 0xf4 '�' + * 244 0xf4 '' */ 0x0e, /* 00001110 */ 0x1b, /* 00011011 */ @@ -2973,7 +2973,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x18, /* 00011000 */ /* - * 245 0xf5 '�' + * 245 0xf5 '' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ @@ -2985,7 +2985,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x70, /* 01110000 */ /* - * 246 0xf6 '�' + * 246 0xf6 '' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ @@ -2997,7 +2997,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 247 0xf7 '�' + * 247 0xf7 '' */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ @@ -3009,7 +3009,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 248 0xf8 '�' + * 248 0xf8 '' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ @@ -3021,7 +3021,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 249 0xf9 '�' + * 249 0xf9 '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -3033,7 +3033,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 250 0xfa '�' + * 250 0xfa '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -3045,7 +3045,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 251 0xfb '�' + * 251 0xfb '' */ 0x0f, /* 00001111 */ 0x0c, /* 00001100 */ @@ -3057,7 +3057,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x1c, /* 00011100 */ /* - * 252 0xfc '�' + * 252 0xfc '' */ 0x6c, /* 01101100 */ 0x36, /* 00110110 */ @@ -3069,7 +3069,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 253 0xfd '�' + * 253 0xfd '' */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ @@ -3081,7 +3081,7 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { 0x00, /* 00000000 */ /* - * 254 0xfe '�' + * 254 0xfe '' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ @@ -3109,16 +3109,16 @@ static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { /* ---- Character */ -/* ! +/*! \brief Global cache for 8x8 pixel font textures created at runtime. */ static SDL_Texture *SDLTest_CharTextureCache[256]; int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c) { - const Uint32 charWidth = 8; - const Uint32 charHeight = 8; - const Uint32 charSize = 8; + const Uint32 charWidth = FONT_CHARACTER_SIZE; + const Uint32 charHeight = FONT_CHARACTER_SIZE; + const Uint32 charSize = FONT_CHARACTER_SIZE; SDL_Rect srect; SDL_Rect drect; int result; @@ -3221,7 +3221,7 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c) int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s) { - const Uint32 charWidth = 8; + const Uint32 charWidth = FONT_CHARACTER_SIZE; int result = 0; int curx = x; int cury = y;