Skip to content

Commit

Permalink
Fixed a case where rendering would assert if a temporary buffer faile…
Browse files Browse the repository at this point in the history
…d to be allocated

Other parts of the draw_list code simply fail more or less silently when the
buffers fill up. The user could allocate bigger buffers and try again, except
that these particular functions assert when they fail to allocate the buffer.
  • Loading branch information
AntiBlueQuirk committed Apr 5, 2018
1 parent d374953 commit 47bc15f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -9553,7 +9553,6 @@ nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *p
nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
size = pnt_size * ((thick_line) ? 5 : 3) * points_count;
normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
NK_ASSERT(normals);
if (!normals) return;
temp = normals + points_count;

Expand Down Expand Up @@ -9790,7 +9789,6 @@ nk_draw_list_fill_poly_convex(struct nk_draw_list *list,
nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
size = pnt_size * points_count;
normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
NK_ASSERT(normals);
if (!normals) return;
vtx = (void*)((nk_byte*)list->vertices->memory.ptr + vertex_offset);

Expand Down
2 changes: 0 additions & 2 deletions src/nuklear_vertex.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *p
nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
size = pnt_size * ((thick_line) ? 5 : 3) * points_count;
normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
NK_ASSERT(normals);
if (!normals) return;
temp = normals + points_count;

Expand Down Expand Up @@ -687,7 +686,6 @@ nk_draw_list_fill_poly_convex(struct nk_draw_list *list,
nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
size = pnt_size * points_count;
normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
NK_ASSERT(normals);
if (!normals) return;
vtx = (void*)((nk_byte*)list->vertices->memory.ptr + vertex_offset);

Expand Down

0 comments on commit 47bc15f

Please sign in to comment.