From 2f75657350f4377e41064c7ca2941e00e586be63 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 26 Jun 2021 21:07:00 +0200 Subject: [PATCH] WARNING: REMOVED: Some deprecated function names mapping Some functions/values have been deprecated for long time but some mapping was kept for convenience. Some of those mappings have been removed... --- examples/core/core_custom_frame_control.c | 8 ++++---- examples/text/text_font_spritefont.c | 2 +- examples/textures/textures_image_drawing.c | 2 +- examples/textures/textures_image_text.c | 6 +++--- src/raylib.h | 8 ++------ src/text.c | 4 ++-- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/examples/core/core_custom_frame_control.c b/examples/core/core_custom_frame_control.c index a3306d13b..93181e763 100644 --- a/examples/core/core_custom_frame_control.c +++ b/examples/core/core_custom_frame_control.c @@ -81,14 +81,14 @@ int main(void) DrawCircle((int)position, GetScreenHeight()/2 - 25, 50, RED); - DrawText(FormatText("%03.0f ms", timeCounter*1000.0f), position - 40, GetScreenHeight()/2 - 100, 20, MAROON); - DrawText(FormatText("PosX: %03.0f", position), position - 50, GetScreenHeight()/2 + 40, 20, BLACK); + DrawText(TextFormat("%03.0f ms", timeCounter*1000.0f), position - 40, GetScreenHeight()/2 - 100, 20, MAROON); + DrawText(TextFormat("PosX: %03.0f", position), position - 50, GetScreenHeight()/2 + 40, 20, BLACK); DrawText("Circle is moving at a constant 200 pixels/sec,\nindependently of the frame rate.", 10, 10, 20, DARKGRAY); DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 20, GRAY); DrawText("PRESS UP | DOWN to CHANGE TARGET FPS", 10, GetScreenHeight() - 30, 20, GRAY); - DrawText(FormatText("TARGET FPS: %i", targetFPS), GetScreenWidth() - 220, 10, 20, LIME); - DrawText(FormatText("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN); + DrawText(TextFormat("TARGET FPS: %i", targetFPS), GetScreenWidth() - 220, 10, 20, LIME); + DrawText(TextFormat("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN); EndDrawing(); diff --git a/examples/text/text_font_spritefont.c b/examples/text/text_font_spritefont.c index 424e2719e..87ce48cf8 100644 --- a/examples/text/text_font_spritefont.c +++ b/examples/text/text_font_spritefont.c @@ -5,7 +5,7 @@ * Loaded sprite fonts have been generated following XNA SpriteFont conventions: * - Characters must be ordered starting with character 32 (Space) * - Every character must be contained within the same Rectangle height -* - Every character and every line must be separated the same distance +* - Every character and every line must be separated by the same distance (margin/padding) * - Rectangles must be defined by a MAGENTA color background * * If following this constraints, a font can be provided just by an image, diff --git a/examples/textures/textures_image_drawing.c b/examples/textures/textures_image_drawing.c index ea3cb319f..2707746ce 100644 --- a/examples/textures/textures_image_drawing.c +++ b/examples/textures/textures_image_drawing.c @@ -48,7 +48,7 @@ int main(void) // Draw over image using custom font ImageDrawTextEx(&parrots, font, "PARROTS & CAT", (Vector2){ 300, 230 }, (float)font.baseSize, -2, WHITE); - UnloadFont(font); // Unload custom spritefont (already drawn used on image) + UnloadFont(font); // Unload custom font (already drawn used on image) Texture2D texture = LoadTextureFromImage(parrots); // Image converted to texture, uploaded to GPU memory (VRAM) UnloadImage(parrots); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM diff --git a/examples/textures/textures_image_text.c b/examples/textures/textures_image_text.c index cb4f0df37..7b19cd3ef 100644 --- a/examples/textures/textures_image_text.c +++ b/examples/textures/textures_image_text.c @@ -1,6 +1,6 @@ /******************************************************************************************* * -* raylib [texture] example - Image text drawing using TTF generated spritefont +* raylib [texture] example - Image text drawing using TTF generated font * * This example has been created using raylib 1.8 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) @@ -64,7 +64,7 @@ int main(void) } else DrawTexture(font.texture, screenWidth/2 - font.texture.width/2, 50, BLACK); - DrawText("PRESS SPACE to SEE USED SPRITEFONT ", 290, 420, 10, DARKGRAY); + DrawText("PRESS SPACE to SHOW FONT ATLAS USED", 290, 420, 10, DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- @@ -74,7 +74,7 @@ int main(void) //-------------------------------------------------------------------------------------- UnloadTexture(texture); // Texture unloading - UnloadFont(font); // Unload custom spritefont + UnloadFont(font); // Unload custom font CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/src/raylib.h b/src/raylib.h index 210c36b81..b27b1520a 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -158,12 +158,8 @@ #define MAGENTA CLITERAL(Color){ 255, 0, 255, 255 } // Magenta #define RAYWHITE CLITERAL(Color){ 245, 245, 245, 255 } // My own White (raylib logo) -// Temporal hacks to avoid breaking old codebases using -// deprecated raylib implementation or definitions -#define SpriteFont Font -#define FormatText TextFormat -#define LoadText LoadFileText -#define GetExtension GetFileExtension +// WARNING: Temporal hacks to avoid breaking old codebases using +// deprecated raylib implementations or definitions #define GetImageData LoadImageColors #define FILTER_POINT TEXTURE_FILTER_POINT #define FILTER_BILINEAR TEXTURE_FILTER_BILINEAR diff --git a/src/text.c b/src/text.c index 13015ef91..0a02f23e4 100644 --- a/src/text.c +++ b/src/text.c @@ -444,7 +444,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar) .mipmaps = 1 }; - // Create spritefont with all data parsed from image + // Create font with all data parsed from image Font font = { 0 }; font.texture = LoadTextureFromImage(fontClear); // Convert processed image to OpenGL texture @@ -1122,7 +1122,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing return vec; } -// Get index position for a unicode character on spritefont +// Get index position for a unicode character on font int GetGlyphIndex(Font font, int codepoint) { #ifndef GLYPH_NOTFOUND_CHAR_FALLBACK