Rename additional .null variables

This commit is contained in:
Rob Loach 2022-07-30 17:43:46 -04:00
parent ec4acc7cf4
commit 54fd67bddd
No known key found for this signature in database
GPG Key ID: 627C60834A74A21A
21 changed files with 56 additions and 56 deletions

View File

@ -61,7 +61,7 @@ static struct
struct nk_font_atlas atlas;
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
unsigned int max_vertex_buffer;
unsigned int max_index_buffer;
@ -137,7 +137,7 @@ nk_d3d11_render(ID3D11DeviceContext *context, enum nk_anti_aliasing AA)
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;
config.tex_null = d3d11.null;
config.tex_null = d3d11.tex_null;
{/* setup buffers to load vertices and elements */
struct nk_buffer vbuf, ibuf;
@ -603,7 +603,7 @@ nk_d3d11_font_stash_end(void)
assert(SUCCEEDED(hr));}
ID3D11Texture2D_Release(font_texture);}
nk_font_atlas_end(&d3d11.atlas, nk_handle_ptr(d3d11.font_texture_view), &d3d11.null);
nk_font_atlas_end(&d3d11.atlas, nk_handle_ptr(d3d11.font_texture_view), &d3d11.tex_null);
if (d3d11.atlas.default_font)
nk_style_set_font(&d3d11.ctx, &d3d11.atlas.default_font->handle);
}

View File

@ -109,7 +109,7 @@ static struct
struct nk_font_atlas atlas;
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
unsigned int max_vertex_buffer;
unsigned int max_index_buffer;
unsigned int max_user_textures;
@ -198,7 +198,7 @@ nk_d3d12_render(ID3D12GraphicsCommandList *command_list, enum nk_anti_aliasing A
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;
config.tex_null = d3d12.null;
config.tex_null = d3d12.tex_null;
struct nk_buffer vbuf, ibuf;
nk_buffer_init_fixed(&vbuf, &ptr_data[sizeof(float) * 4 * 4], (size_t)d3d12.max_vertex_buffer);
@ -863,7 +863,7 @@ nk_d3d12_font_stash_end(ID3D12GraphicsCommandList *command_list)
ID3D12Device_CreateShaderResourceView(d3d12.device, d3d12.font_texture, &srv_desc, srv_handle);
/* Done with nk atlas data. Atlas will be served with texture id 0 */
nk_font_atlas_end(&d3d12.atlas, nk_handle_id(0), &d3d12.null);
nk_font_atlas_end(&d3d12.atlas, nk_handle_id(0), &d3d12.tex_null);
/* Setup default font */
if (d3d12.atlas.default_font)

View File

@ -58,7 +58,7 @@ static struct {
struct nk_font_atlas atlas;
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
D3DVIEWPORT9 viewport;
D3DMATRIX projection;
@ -150,7 +150,7 @@ nk_d3d9_render(enum nk_anti_aliasing AA)
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;
config.tex_null = d3d9.null;
config.tex_null = d3d9.tex_null;
/* convert shapes into vertexes */
nk_buffer_init_default(&vbuf);
@ -248,7 +248,7 @@ nk_d3d9_create_font_texture()
hr = IDirect3DTexture9_UnlockRect(d3d9.texture, 0);
NK_ASSERT(SUCCEEDED(hr));
nk_font_atlas_end(&d3d9.atlas, nk_handle_ptr(d3d9.texture), &d3d9.null);
nk_font_atlas_end(&d3d9.atlas, nk_handle_ptr(d3d9.texture), &d3d9.tex_null);
}
NK_API void

View File

@ -53,7 +53,7 @@ NK_API void nk_gflw3_scroll_callback(GLFWwindow *win, double xof
struct nk_glfw_device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint font_tex;
};
@ -288,7 +288,7 @@ nk_glfw3_font_stash_end(void)
const void *image; int w, h;
image = nk_font_atlas_bake(&glfw.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_glfw3_device_upload_atlas(image, w, h);
nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex), &glfw.ogl.null);
nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex), &glfw.ogl.tex_null);
if (glfw.atlas.default_font)
nk_style_set_font(&glfw.ctx, &glfw.atlas.default_font->handle);
}

View File

@ -26,7 +26,7 @@ enum nk_glfw_init_state{
struct nk_glfw_device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint vbo, vao, ebo;
GLuint prog;
GLuint vert_shdr;
@ -403,7 +403,7 @@ nk_glfw3_font_stash_end(struct nk_glfw* glfw)
const void *image; int w, h;
image = nk_font_atlas_bake(&glfw->atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_glfw3_device_upload_atlas(glfw, image, w, h);
nk_font_atlas_end(&glfw->atlas, nk_handle_id((int)glfw->ogl.font_tex), &glfw->ogl.null);
nk_font_atlas_end(&glfw->atlas, nk_handle_id((int)glfw->ogl.font_tex), &glfw->ogl.tex_null);
if (glfw->atlas.default_font)
nk_style_set_font(&glfw->ctx, &glfw->atlas.default_font->handle);
}

View File

@ -72,7 +72,7 @@ struct nk_glfw_vertex {
struct nk_glfw_device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint vbo, vao, ebo;
GLuint prog;
GLuint vert_shdr;
@ -553,7 +553,7 @@ nk_glfw3_font_stash_end(void)
const void *image; int w, h;
image = nk_font_atlas_bake(&glfw.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_glfw3_device_upload_atlas(image, w, h);
nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex_index), &glfw.ogl.null);
nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex_index), &glfw.ogl.tex_null);
if (glfw.atlas.default_font)
nk_style_set_font(&glfw.ctx, &glfw.atlas.default_font->handle);
}

View File

@ -33,7 +33,7 @@ NK_API void nk_sdl_shutdown(void);
struct nk_sdl_device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint font_tex;
};
@ -226,7 +226,7 @@ nk_sdl_font_stash_end(void)
const void *image; int w, h;
image = nk_font_atlas_bake(&sdl.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_sdl_device_upload_atlas(image, w, h);
nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.null);
nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.tex_null);
if (sdl.atlas.default_font)
nk_style_set_font(&sdl.ctx, &sdl.atlas.default_font->handle);
}

View File

@ -40,7 +40,7 @@ NK_API void nk_sdl_device_create(void);
struct nk_sdl_device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint vbo, vao, ebo;
GLuint prog;
GLuint vert_shdr;
@ -334,7 +334,7 @@ nk_sdl_font_stash_end(void)
const void *image; int w, h;
image = nk_font_atlas_bake(&sdl.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_sdl_device_upload_atlas(image, w, h);
nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.null);
nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.tex_null);
if (sdl.atlas.default_font)
nk_style_set_font(&sdl.ctx, &sdl.atlas.default_font->handle);

View File

@ -43,7 +43,7 @@ NK_API void nk_sdl_device_create(void);
struct nk_sdl_device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint vbo, ebo;
GLuint prog;
GLuint vert_shdr;
@ -335,7 +335,7 @@ nk_sdl_font_stash_end(void)
const void *image; int w, h;
image = nk_font_atlas_bake(&sdl.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_sdl_device_upload_atlas(image, w, h);
nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.null);
nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.tex_null);
if (sdl.atlas.default_font)
nk_style_set_font(&sdl.ctx, &sdl.atlas.default_font->handle);

View File

@ -44,7 +44,7 @@ NK_API void nk_sdl_shutdown(void);
struct nk_sdl_device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
SDL_Texture *font_tex;
};
@ -259,7 +259,7 @@ nk_sdl_font_stash_end(void)
const void *image; int w, h;
image = nk_font_atlas_bake(&sdl.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_sdl_device_upload_atlas(image, w, h);
nk_font_atlas_end(&sdl.atlas, nk_handle_ptr(sdl.ogl.font_tex), &sdl.ogl.null);
nk_font_atlas_end(&sdl.atlas, nk_handle_ptr(sdl.ogl.font_tex), &sdl.ogl.tex_null);
if (sdl.atlas.default_font)
nk_style_set_font(&sdl.ctx, &sdl.atlas.default_font->handle);
}

View File

@ -34,7 +34,7 @@ NK_API void nk_sfml_shutdown(void);
struct nk_sfml_device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint font_tex;
};
@ -245,7 +245,7 @@ nk_sfml_font_stash_end()
const void* img;
img = nk_font_atlas_bake(&sfml.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_sfml_device_upload_atlas(img, w, h);
nk_font_atlas_end(&sfml.atlas, nk_handle_id((int)sfml.ogl.font_tex), &sfml.ogl.null);
nk_font_atlas_end(&sfml.atlas, nk_handle_id((int)sfml.ogl.font_tex), &sfml.ogl.tex_null);
if(sfml.atlas.default_font)
nk_style_set_font(&sfml.ctx, &sfml.atlas.default_font->handle);
}

View File

@ -43,7 +43,7 @@ NK_API void nk_sfml_device_destroy(void);
struct nk_sfml_device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint vbo, vao, ebo;
GLuint prog;
GLuint vert_shdr;
@ -353,7 +353,7 @@ nk_sfml_font_stash_end()
int w, h;
image = nk_font_atlas_bake(&sfml.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_sfml_device_upload_atlas(image, w, h);
nk_font_atlas_end(&sfml.atlas, nk_handle_id((int)sfml.ogl.font_tex), &sfml.ogl.null);
nk_font_atlas_end(&sfml.atlas, nk_handle_id((int)sfml.ogl.font_tex), &sfml.ogl.tex_null);
if(sfml.atlas.default_font)
nk_style_set_font(&sfml.ctx, &sfml.atlas.default_font->handle);
}

View File

@ -60,7 +60,7 @@ struct nk_x11_vertex {
struct nk_x11_device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint font_tex;
};
@ -226,7 +226,7 @@ nk_x11_font_stash_end(void)
const void *image; int w, h;
image = nk_font_atlas_bake(&x11.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_x11_device_upload_atlas(image, w, h);
nk_font_atlas_end(&x11.atlas, nk_handle_id((int)x11.ogl.font_tex), &x11.ogl.null);
nk_font_atlas_end(&x11.atlas, nk_handle_id((int)x11.ogl.font_tex), &x11.ogl.tex_null);
if (x11.atlas.default_font)
nk_style_set_font(&x11.ctx, &x11.atlas.default_font->handle);
}

View File

@ -173,7 +173,7 @@ struct nk_x11_device {
struct opengl_info info;
#endif
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint vbo, vao, ebo;
GLuint prog;
GLuint vert_shdr;
@ -592,7 +592,7 @@ nk_x11_font_stash_end(void)
const void *image; int w, h;
image = nk_font_atlas_bake(&x11.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
nk_x11_device_upload_atlas(image, w, h);
nk_font_atlas_end(&x11.atlas, nk_handle_id((int)x11.ogl.font_tex), &x11.ogl.null);
nk_font_atlas_end(&x11.atlas, nk_handle_id((int)x11.ogl.font_tex), &x11.ogl.tex_null);
if (x11.atlas.default_font)
nk_style_set_font(&x11.ctx, &x11.atlas.default_font->handle);
}

View File

@ -637,7 +637,7 @@ cfg.circle_segment_count = 22;
cfg.curve_segment_count = 22;
cfg.arc_segment_count = 22;
cfg.global_alpha = 1.0f;
cfg.null = dev->null;
cfg.tex_null = dev->null;
//
// setup buffers and convert
struct nk_buffer cmds, verts, idx;

View File

@ -52,7 +52,7 @@ struct nk_glfw_vertex {
struct device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint vbo, vao, ebo;
GLuint prog;
GLuint vert_shdr;
@ -441,7 +441,7 @@ int main(int argc, char *argv[])
font = nk_font_atlas_add_default(&atlas, 13, 0);
image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
device_upload_atlas(&device, image, w, h);
nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);
nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.tex_null);
nk_init_default(&ctx, &font->handle);
glEnable(GL_TEXTURE_2D);

View File

@ -478,7 +478,7 @@ struct nk_glfw_vertex {
struct device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint vbo, vao, ebo;
GLuint prog;
GLuint vert_shdr;
@ -795,7 +795,7 @@ int main(int argc, char *argv[])
media.font_22 = nk_font_atlas_add_from_file(&atlas, "../../extra_font/Roboto-Regular.ttf", 22.0f, &cfg);
image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
device_upload_atlas(&device, image, w, h);
nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);}
nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.tex_null);}
nk_init_default(&ctx, &media.font_14->handle);}
/* icons */

View File

@ -527,7 +527,7 @@ struct nk_glfw_vertex {
struct device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint vbo, vao, ebo;
GLuint prog;
GLuint vert_shdr;
@ -823,7 +823,7 @@ int main(int argc, char *argv[])
else font = nk_font_atlas_add_default(&atlas, 13.0f, NULL);
image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
device_upload_atlas(&device, image, w, h);
nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);}
nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.tex_null);}
nk_init_default(&ctx, &font->handle);}
/* icons */

View File

@ -79,7 +79,7 @@ struct nk_glfw_vertex {
struct device {
struct nk_buffer cmds;
struct nk_draw_null_texture null;
struct nk_draw_null_texture tex_null;
GLuint vbo, vao, ebo;
GLuint prog;
GLuint vert_shdr;
@ -388,7 +388,7 @@ int main(int argc, char *argv[])
else font = nk_font_atlas_add_default(&atlas, 13.0f, NULL);
image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
device_upload_atlas(&device, image, w, h);
nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);}
nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.tex_null);}
nk_init_default(&ctx, &font->handle);}
{ /* skin */

View File

@ -17703,20 +17703,20 @@ failed:
}
NK_API void
nk_font_atlas_end(struct nk_font_atlas *atlas, nk_handle texture,
struct nk_draw_null_texture *null)
struct nk_draw_null_texture *tex_null)
{
int i = 0;
struct nk_font *font_iter;
NK_ASSERT(atlas);
if (!atlas) {
if (!null) return;
null->texture = texture;
null->uv = nk_vec2(0.5f,0.5f);
if (!tex_null) return;
tex_null->texture = texture;
tex_null->uv = nk_vec2(0.5f,0.5f);
}
if (null) {
null->texture = texture;
null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width;
null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height;
if (tex_null) {
tex_null->texture = texture;
tex_null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width;
tex_null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height;
}
for (font_iter = atlas->fonts; font_iter; font_iter = font_iter->next) {
font_iter->texture = texture;

View File

@ -1276,20 +1276,20 @@ failed:
}
NK_API void
nk_font_atlas_end(struct nk_font_atlas *atlas, nk_handle texture,
struct nk_draw_null_texture *null)
struct nk_draw_null_texture *tex_null)
{
int i = 0;
struct nk_font *font_iter;
NK_ASSERT(atlas);
if (!atlas) {
if (!null) return;
null->texture = texture;
null->uv = nk_vec2(0.5f,0.5f);
if (!tex_null) return;
tex_null->texture = texture;
tex_null->uv = nk_vec2(0.5f,0.5f);
}
if (null) {
null->texture = texture;
null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width;
null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height;
if (tex_null) {
tex_null->texture = texture;
tex_null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width;
tex_null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height;
}
for (font_iter = atlas->fonts; font_iter; font_iter = font_iter->next) {
font_iter->texture = texture;