From 733fa0fce03b7513f64450fc440fef0a126f4e92 Mon Sep 17 00:00:00 2001 From: Damien Pitard Date: Sun, 19 Dec 2021 12:32:42 +0100 Subject: [PATCH] Fixed: incompatible type for argument 1 of 'UnloadTexture' (#169) --- src/raygui.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index 1aff91e..7c2ce87 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -3282,7 +3282,7 @@ Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs) void GuiLoadStyle(const char *fileName) { #define MAX_LINE_BUFFER_SIZE 256 - + bool tryBinary = false; // Try reading the files as text file first @@ -3335,16 +3335,16 @@ void GuiLoadStyle(const char *fileName) int *values = (int *)RAYGUI_MALLOC(glyphCount*sizeof(int)); for (int i = 0; i < glyphCount; i++) values[i] = TextToInteger(chars[i]); - if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture.id); + if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture); font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, values, glyphCount); if (font.texture.id == 0) font = GetFontDefault(); RAYGUI_FREE(values); } } - else + else { - if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture.id); + if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture); font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, NULL, 0); if (font.texture.id == 0) font = GetFontDefault(); } @@ -3439,7 +3439,7 @@ void GuiLoadStyle(const char *fileName) imFont.data = (unsigned char *)RAYGUI_MALLOC(fontImageSize); fread(imFont.data, 1, fontImageSize, rgsFile); - if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture.id); + if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture); font.texture = LoadTextureFromImage(imFont); if (font.texture.id == 0) font = GetFontDefault();