diff options
| author | Ray <[email protected]> | 2021-06-23 09:58:49 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-06-23 09:58:49 +0200 |
| commit | 3db26f82eae53677c2e4ee6a4a5901fa8eb5f190 (patch) | |
| tree | b8a6a638aacb916d26f17979612bfbf9f70d1a12 /examples/text | |
| parent | 716e26aa37e352f0188824bc2de7dd3035f7413c (diff) | |
| download | raylib-3db26f82eae53677c2e4ee6a4a5901fa8eb5f190.tar.gz raylib-3db26f82eae53677c2e4ee6a4a5901fa8eb5f190.zip | |
WARNING: BREAKING: Functions renamed!
RENAMED: GetCodepoints() -> LoadCodepoints(), now codepoint array data is loaded dynamically instead of reusing a limited static buffer.
ADDED: UnloadCodepoints() to safely free loaded codepoints
RENAMED: GetNextCodepoint() -> GetCodepoint()
Diffstat (limited to 'examples/text')
| -rw-r--r-- | examples/text/text_draw_3d.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/text/text_draw_3d.c b/examples/text/text_draw_3d.c index a579a528..8ce576b6 100644 --- a/examples/text/text_draw_3d.c +++ b/examples/text/text_draw_3d.c @@ -291,7 +291,7 @@ int main(void) for (int i = 0; i < layers; ++i) { Color clr = light; - if(multicolor) clr = multi[i]; + if (multicolor) clr = multi[i]; DrawTextWave3D(font, text, (Vector3){ -tbox.x/2.0f, layerDistance*i, -4.5f }, fontSize, fontSpacing, lineSpacing, true, &wcfg, time, clr); } @@ -465,7 +465,7 @@ void DrawTextCodepoint3D(Font font, int codepoint, Vector3 position, float fontS float width = (float)(font.recs[index].width + 2.0f*font.charsPadding)/(float)font.baseSize*scale; float height = (float)(font.recs[index].height + 2.0f*font.charsPadding)/(float)font.baseSize*scale; - if(font.texture.id > 0) + if (font.texture.id > 0) { const float x = 0.0f; const float y = 0.0f; @@ -477,7 +477,7 @@ void DrawTextCodepoint3D(Font font, int codepoint, Vector3 position, float fontS const float tw = (srcRec.x+srcRec.width)/font.texture.width; const float th = (srcRec.y+srcRec.height)/font.texture.height; - if(SHOW_LETTER_BOUNDRY) + if (SHOW_LETTER_BOUNDRY) DrawCubeWiresV((Vector3){ position.x + width/2, position.y, position.z + height/2}, (Vector3){ width, LETTER_BOUNDRY_SIZE, height }, LETTER_BOUNDRY_COLOR); #if defined(RAYLIB_NEW_RLGL) @@ -533,7 +533,7 @@ void DrawText3D(Font font, const char *text, Vector3 position, float fontSize, f { // Get next codepoint from byte string and glyph index in font int codepointByteCount = 0; - int codepoint = GetNextCodepoint(&text[i], &codepointByteCount); + int codepoint = GetCodepoint(&text[i], &codepointByteCount); int index = GetGlyphIndex(font, codepoint); // NOTE: Normally we exit the decoding sequence as soon as a bad byte is found (and return 0x3f) @@ -582,7 +582,7 @@ Vector3 MeasureText3D(Font font, const char* text, float fontSize, float fontSpa lenCounter++; int next = 0; - letter = GetNextCodepoint(&text[i], &next); + letter = GetCodepoint(&text[i], &next); index = GetGlyphIndex(font, letter); // NOTE: normally we exit the decoding sequence as soon as a bad byte is found (and return 0x3f) @@ -632,7 +632,7 @@ void DrawTextWave3D(Font font, const char *text, Vector3 position, float fontSiz { // Get next codepoint from byte string and glyph index in font int codepointByteCount = 0; - int codepoint = GetNextCodepoint(&text[i], &codepointByteCount); + int codepoint = GetCodepoint(&text[i], &codepointByteCount); int index = GetGlyphIndex(font, codepoint); // NOTE: Normally we exit the decoding sequence as soon as a bad byte is found (and return 0x3f) @@ -649,7 +649,7 @@ void DrawTextWave3D(Font font, const char *text, Vector3 position, float fontSiz } else if (codepoint == '~') { - if (GetNextCodepoint(&text[i+1], &codepointByteCount) == '~') + if (GetCodepoint(&text[i+1], &codepointByteCount) == '~') { codepointByteCount += 1; wave = !wave; @@ -698,7 +698,7 @@ Vector3 MeasureTextWave3D(Font font, const char* text, float fontSize, float fon lenCounter++; int next = 0; - letter = GetNextCodepoint(&text[i], &next); + letter = GetCodepoint(&text[i], &next); index = GetGlyphIndex(font, letter); // NOTE: normally we exit the decoding sequence as soon as a bad byte is found (and return 0x3f) @@ -708,7 +708,7 @@ Vector3 MeasureTextWave3D(Font font, const char* text, float fontSize, float fon if (letter != '\n') { - if(letter == '~' && GetNextCodepoint(&text[i+1], &next) == '~') + if (letter == '~' && GetCodepoint(&text[i+1], &next) == '~') { i++; } |
