nuklear_window: fix misleading variable names
This commit is contained in:
parent
aeb1826913
commit
6fce4d209f
14
nuklear.h
14
nuklear.h
@ -16176,8 +16176,8 @@ nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
|
|||||||
{
|
{
|
||||||
struct nk_window *win;
|
struct nk_window *win;
|
||||||
struct nk_style *style;
|
struct nk_style *style;
|
||||||
nk_hash title_hash;
|
nk_hash name_hash;
|
||||||
int title_len;
|
int name_len;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
NK_ASSERT(ctx);
|
NK_ASSERT(ctx);
|
||||||
@ -16190,12 +16190,12 @@ nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
|
|||||||
|
|
||||||
/* find or create window */
|
/* find or create window */
|
||||||
style = &ctx->style;
|
style = &ctx->style;
|
||||||
title_len = (int)nk_strlen(name);
|
name_len = (int)nk_strlen(name);
|
||||||
title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
|
name_hash = nk_murmur_hash(name, (int)name_len, NK_WINDOW_TITLE);
|
||||||
win = nk_find_window(ctx, title_hash, name);
|
win = nk_find_window(ctx, name_hash, name);
|
||||||
if (!win) {
|
if (!win) {
|
||||||
/* create new window */
|
/* create new window */
|
||||||
nk_size name_length = (nk_size)nk_strlen(name);
|
nk_size name_length = (nk_size)name_len;
|
||||||
win = (struct nk_window*)nk_create_window(ctx);
|
win = (struct nk_window*)nk_create_window(ctx);
|
||||||
NK_ASSERT(win);
|
NK_ASSERT(win);
|
||||||
if (!win) return 0;
|
if (!win) return 0;
|
||||||
@ -16207,7 +16207,7 @@ nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
|
|||||||
|
|
||||||
win->flags = flags;
|
win->flags = flags;
|
||||||
win->bounds = bounds;
|
win->bounds = bounds;
|
||||||
win->name = title_hash;
|
win->name = name_hash;
|
||||||
name_length = NK_MIN(name_length, NK_WINDOW_MAX_NAME-1);
|
name_length = NK_MIN(name_length, NK_WINDOW_MAX_NAME-1);
|
||||||
NK_MEMCPY(win->name_string, name, name_length);
|
NK_MEMCPY(win->name_string, name, name_length);
|
||||||
win->name_string[name_length] = 0;
|
win->name_string[name_length] = 0;
|
||||||
|
@ -144,8 +144,8 @@ nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
|
|||||||
{
|
{
|
||||||
struct nk_window *win;
|
struct nk_window *win;
|
||||||
struct nk_style *style;
|
struct nk_style *style;
|
||||||
nk_hash title_hash;
|
nk_hash name_hash;
|
||||||
int title_len;
|
int name_len;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
NK_ASSERT(ctx);
|
NK_ASSERT(ctx);
|
||||||
@ -158,12 +158,12 @@ nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
|
|||||||
|
|
||||||
/* find or create window */
|
/* find or create window */
|
||||||
style = &ctx->style;
|
style = &ctx->style;
|
||||||
title_len = (int)nk_strlen(name);
|
name_len = (int)nk_strlen(name);
|
||||||
title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
|
name_hash = nk_murmur_hash(name, (int)name_len, NK_WINDOW_TITLE);
|
||||||
win = nk_find_window(ctx, title_hash, name);
|
win = nk_find_window(ctx, name_hash, name);
|
||||||
if (!win) {
|
if (!win) {
|
||||||
/* create new window */
|
/* create new window */
|
||||||
nk_size name_length = (nk_size)nk_strlen(name);
|
nk_size name_length = (nk_size)name_len;
|
||||||
win = (struct nk_window*)nk_create_window(ctx);
|
win = (struct nk_window*)nk_create_window(ctx);
|
||||||
NK_ASSERT(win);
|
NK_ASSERT(win);
|
||||||
if (!win) return 0;
|
if (!win) return 0;
|
||||||
@ -175,7 +175,7 @@ nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
|
|||||||
|
|
||||||
win->flags = flags;
|
win->flags = flags;
|
||||||
win->bounds = bounds;
|
win->bounds = bounds;
|
||||||
win->name = title_hash;
|
win->name = name_hash;
|
||||||
name_length = NK_MIN(name_length, NK_WINDOW_MAX_NAME-1);
|
name_length = NK_MIN(name_length, NK_WINDOW_MAX_NAME-1);
|
||||||
NK_MEMCPY(win->name_string, name, name_length);
|
NK_MEMCPY(win->name_string, name, name_length);
|
||||||
win->name_string[name_length] = 0;
|
win->name_string[name_length] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user