diff --git a/CMakeLists.txt b/CMakeLists.txt index 4df4bfe..c4091b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.11) project(raylib_nuklear DESCRIPTION "raylib_nuklear: Nuklear immediate mode GUI for raylib." HOMEPAGE_URL "https://github.com/robloach/raylib-nuklear" - VERSION 5.0.0 + VERSION 5.0.1 LANGUAGES C ) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 0d4b172..a0b3966 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -3,6 +3,7 @@ add_library(raylib_nuklear INTERFACE) target_include_directories(raylib_nuklear INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) install(FILES raylib-nuklear.h + raylib-nuklear-font.h nuklear.h DESTINATION include ) diff --git a/include/nuklear.h b/include/nuklear.h index df46501..5d91400 100644 --- a/include/nuklear.h +++ b/include/nuklear.h @@ -9694,14 +9694,16 @@ nk_draw_list_push_image(struct nk_draw_list *list, nk_handle texture) struct nk_draw_command *prev = nk_draw_list_command_last(list); if (prev->elem_count == 0) { prev->texture = texture; - #ifdef NK_INCLUDE_COMMAND_USERDATA + #ifdef NK_INCLUDE_COMMAND_USERDATA prev->userdata = list->userdata; - #endif - } else if (prev->texture.id != texture.id - #ifdef NK_INCLUDE_COMMAND_USERDATA - || prev->userdata.id != list->userdata.id - #endif - ) nk_draw_list_push_command(list, prev->clip_rect, texture); + #endif + } else if (prev->texture.id != texture.id + #ifdef NK_INCLUDE_COMMAND_USERDATA + || prev->userdata.id != list->userdata.id + #endif + ) { + nk_draw_list_push_command(list, prev->clip_rect, texture); + } } } #ifdef NK_INCLUDE_COMMAND_USERDATA diff --git a/include/raylib-nuklear.h b/include/raylib-nuklear.h index 05efab6..88b2bba 100644 --- a/include/raylib-nuklear.h +++ b/include/raylib-nuklear.h @@ -590,7 +590,7 @@ DrawNuklear(struct nk_context * ctx) case NK_COMMAND_POLYGON: { const struct nk_command_polygon *p = (const struct nk_command_polygon*)cmd; Color color = ColorFromNuklear(p->color); - struct Vector2* points = (struct Vector2*)MemAlloc((p->point_count + 1) * (unsigned short)sizeof(Vector2)); + struct Vector2* points = (struct Vector2*)MemAlloc((unsigned int)((size_t)(p->point_count + 1) * sizeof(Vector2))); unsigned short i; for (i = 0; i < p->point_count; i++) { points[i].x = p->points[i].x * scale; @@ -605,7 +605,7 @@ DrawNuklear(struct nk_context * ctx) // TODO: Implement NK_COMMAND_POLYGON_FILLED const struct nk_command_polygon_filled *p = (const struct nk_command_polygon_filled*)cmd; Color color = ColorFromNuklear(p->color); - struct Vector2* points = (struct Vector2*)MemAlloc((p->point_count + 1) * (unsigned short)sizeof(Vector2)); + struct Vector2* points = (struct Vector2*)MemAlloc((unsigned int)((size_t)(p->point_count + 1) * sizeof(Vector2))); unsigned short i; for (i = 0; i < p->point_count; i++) { points[i].x = p->points[i].x * scale;