mirror of https://github.com/vurtun/nuklear.git
Fixed a case where rendering would assert if a temporary buffer failed 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.pull/659/head
parent
d374953d27
commit
47bc15f37f
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue