From ef99aafee9a30eb4cce0768bf593fc3014591bbc Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 12 Mar 2021 18:01:14 +0100 Subject: [PATCH] Renamed some functions --- examples/image_exporter/image_exporter.c | 6 +++--- examples/image_raw_importer/image_raw_importer.c | 4 ++-- examples/portable_window/portable_window.c | 2 +- src/raygui.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/image_exporter/image_exporter.c b/examples/image_exporter/image_exporter.c index aaa844e..678c12f 100644 --- a/examples/image_exporter/image_exporter.c +++ b/examples/image_exporter/image_exporter.c @@ -102,12 +102,12 @@ int main(int argc, char *argv[0]) if (fileFormatActive == 0) // PNG { - if ((GetExtension(fileName) == NULL) || (!IsFileExtension(fileName, ".png"))) strcat(fileName, ".png\0"); // No extension provided + if ((GetFileExtension(fileName) == NULL) || (!IsFileExtension(fileName, ".png"))) strcat(fileName, ".png\0"); // No extension provided ExportImage(image, fileName); } else if (fileFormatActive == 1) // RAW { - if ((GetExtension(fileName) == NULL) || (!IsFileExtension(fileName, ".raw"))) strcat(fileName, ".raw\0"); // No extension provided + if ((GetFileExtension(fileName) == NULL) || (!IsFileExtension(fileName, ".raw"))) strcat(fileName, ".raw\0"); // No extension provided int dataSize = GetPixelDataSize(image.width, image.height, image.format); @@ -147,7 +147,7 @@ int main(int argc, char *argv[0]) DrawTextureEx(texture, (Vector2){ screenWidth/2 - (float)texture.width*imageScale/2, screenHeight/2 - (float)texture.height*imageScale/2 }, 0.0f, imageScale, WHITE); DrawRectangleLinesEx(imageRec, 1, CheckCollisionPointRec(GetMousePosition(), imageRec) ? RED : DARKGRAY); - DrawText(FormatText("SCALE: %.2f%%", imageScale*100.0f), 20, screenHeight - 40, 20, GetColor(GuiGetStyle(DEFAULT, LINE_COLOR))); + DrawText(TextFormat("SCALE: %.2f%%", imageScale*100.0f), 20, screenHeight - 40, 20, GetColor(GuiGetStyle(DEFAULT, LINE_COLOR))); } else { diff --git a/examples/image_raw_importer/image_raw_importer.c b/examples/image_raw_importer/image_raw_importer.c index b4a86dc..53870fc 100644 --- a/examples/image_raw_importer/image_raw_importer.c +++ b/examples/image_raw_importer/image_raw_importer.c @@ -174,7 +174,7 @@ int main() if (texture.id != 0) { DrawTextureEx(texture, (Vector2){ screenWidth/2 - texture.width*imageScale/2, screenHeight/2 - texture.height*imageScale/2 }, 0, imageScale, WHITE); - DrawText(FormatText("SCALE x%.0f", imageScale), 20, screenHeight - 40, 20, GetColor(GuiGetStyle(DEFAULT, LINE_COLOR))); + DrawText(TextFormat("SCALE x%.0f", imageScale), 20, screenHeight - 40, 20, GetColor(GuiGetStyle(DEFAULT, LINE_COLOR))); } else DrawText("drag & drop RAW image file", 320, 180, 10, GetColor(GuiGetStyle(DEFAULT, LINE_COLOR))); @@ -187,7 +187,7 @@ int main() GuiLabel((Rectangle){ windowOffset.x + 10, windowOffset.y + 30, 65, 20 }, "Import file:"); GuiLabel((Rectangle){ windowOffset.x + 85, windowOffset.y + 30, 75, 20 }, fileName); GuiLabel((Rectangle){ windowOffset.x + 10, windowOffset.y + 50, 65, 20 }, "File size:"); - GuiLabel((Rectangle){ windowOffset.x + 85, windowOffset.y + 50, 75, 20 }, FormatText("%i bytes", dataSize)); + GuiLabel((Rectangle){ windowOffset.x + 85, windowOffset.y + 50, 75, 20 }, TextFormat("%i bytes", dataSize)); GuiGroupBox((Rectangle){ windowOffset.x + 10, windowOffset.y + 85, 180, 80 }, "Resolution"); GuiLabel((Rectangle){ windowOffset.x + 20, windowOffset.y + 100, 33, 25 }, "Width:"); if (GuiValueBox((Rectangle){ windowOffset.x + 60, windowOffset.y + 100, 80, 25 }, NULL, &widthValue, 0, 8192, widthEditMode)) widthEditMode = !widthEditMode; diff --git a/examples/portable_window/portable_window.c b/examples/portable_window/portable_window.c index 8f73702..3982c19 100644 --- a/examples/portable_window/portable_window.c +++ b/examples/portable_window/portable_window.c @@ -81,7 +81,7 @@ int main() exitWindow = GuiWindowBox((Rectangle){ 0, 0, screenWidth, screenHeight }, "PORTABLE WINDOW"); - DrawText(FormatText("Mouse Position: [ %.0f, %.0f ]", mousePosition.x, mousePosition.y), 10, 40, 10, DARKGRAY); + DrawText(TextFormat("Mouse Position: [ %.0f, %.0f ]", mousePosition.x, mousePosition.y), 10, 40, 10, DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/src/raygui.h b/src/raygui.h index 355db72..027cf82 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -606,7 +606,7 @@ static Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float static void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // -- GuiDrawText() static Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // -- GuiLoadStyle() -static char *LoadText(const char *fileName); // -- GuiLoadStyle() +static char *LoadFileText(const char *fileName); // -- GuiLoadStyle() static const char *GetDirectoryPath(const char *filePath); // -- GuiLoadStyle() //------------------------------------------------------------------------------- @@ -2790,7 +2790,7 @@ void GuiLoadStyle(const char *fileName) { // Load characters from charmap file, // expected '\n' separated list of integer values - char *charValues = LoadText(charmapFileName); + char *charValues = LoadFileText(charmapFileName); if (charValues != NULL) { int charsCount = 0;