move malloc
This commit is contained in:
parent
167c0f26db
commit
18a363a8e0
Binary file not shown.
Binary file not shown.
|
@ -1086,6 +1086,7 @@ void updateBounds(int top, int bottom, int left, int right) {
|
||||||
#ifdef COMMAND_CACHING
|
#ifdef COMMAND_CACHING
|
||||||
int lastCalls = 0;
|
int lastCalls = 0;
|
||||||
int currentCalls;
|
int currentCalls;
|
||||||
|
const struct nk_command *lastCmd;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NK_API void nk_quickdraw_render(WindowPtr window, struct nk_context *ctx) {
|
NK_API void nk_quickdraw_render(WindowPtr window, struct nk_context *ctx) {
|
||||||
|
@ -1136,7 +1137,6 @@ NK_API void nk_quickdraw_render(WindowPtr window, struct nk_context *ctx) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef COMMAND_CACHING
|
#ifdef COMMAND_CACHING
|
||||||
const struct nk_command *lastCmd = malloc(sizeof(struct nk_command));
|
|
||||||
lastCmd = nk_ptr_add_const(struct nk_command, last, 0);
|
lastCmd = nk_ptr_add_const(struct nk_command, last, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1499,6 +1499,10 @@ NK_API struct nk_context* nk_quickdraw_init(unsigned int width, unsigned int hei
|
||||||
NkQuickDrawFont *quickdrawfont = nk_quickdraw_font_create_from_file();
|
NkQuickDrawFont *quickdrawfont = nk_quickdraw_font_create_from_file();
|
||||||
struct nk_user_font *font = &quickdrawfont->nk;
|
struct nk_user_font *font = &quickdrawfont->nk;
|
||||||
|
|
||||||
|
#ifdef COMMAND_CACHING
|
||||||
|
lastCmd = malloc(sizeof(struct nk_command));
|
||||||
|
#endif
|
||||||
|
|
||||||
last = calloc(1, MAX_MEMORY_IN_KB * 1024);
|
last = calloc(1, MAX_MEMORY_IN_KB * 1024);
|
||||||
buf = calloc(1, MAX_MEMORY_IN_KB * 1024);
|
buf = calloc(1, MAX_MEMORY_IN_KB * 1024);
|
||||||
nk_init_fixed(&quickdraw.nuklear_context, buf, MAX_MEMORY_IN_KB * 1024, font);
|
nk_init_fixed(&quickdraw.nuklear_context, buf, MAX_MEMORY_IN_KB * 1024, font);
|
||||||
|
|
Loading…
Reference in New Issue