raylibtech / rtools

rtools feedback and issues
17 stars 1 forks source link

[rGuiIcons] Generated C-Code seem outdated #13

Closed furudbat closed 2 years ago

furudbat commented 2 years ago

I'm made some custom icons with rGuiIcons ONE, but when I include the ricons.h-file, I getting this Error(s):

  1. Error C2078 too many initializers ricons.h:546

Seems like the generated ricons uses a different guiIcons array size:
(custom) ricons.h:

static unsigned int guiIcons[RICON_MAX_ICONS] = {

default icons (from raygui.h):

static unsigned int guiIcons[RICON_MAX_ICONS*RICON_DATA_ELEMENTS] = {

Solution:
Use RICON_MAX_ICONS*RICON_DATA_ELEMENTS for the array size.

  1. Error C2065 'RICON_MAX_NAME_LENGTH': undeclared identifier raygui.h:3644

Solution:
Add #define RICON_MAX_NAME_LENGTH 32.

Environment: OS: Windows 10 Compiler: MSVC (2019) raylib Version: 4.0-dev (from github)
raygui Version: 3.0-dev (from github)
rGuiIcons ONE Version: 1.0 (from itch.io)

My raygui.c:

#define RAYGUI_SUPPORT_RICONS
#define RAYGUI_SUPPORT_CUSTOM_RICONS
#define RAYGUI_IMPLEMENTATION
#include <raylib.h>
#include <raygui.h>

My Header:

#include <raylib.h>
#undef RAYGUI_IMPLEMENTATION
#define RAYGUI_SUPPORT_RICONS
#define RAYGUI_SUPPORT_CUSTOM_RICONS
#include <raygui.h>
raysan5 commented 2 years ago

@furudbat thanks for reporting! raygui and ricons changed lately and I need to update the tools.

raysan5 commented 2 years ago

@furudbat Updated source code, I'm planning a new release by the end of the month.