Removed arrlen and arrwalk, which do not work

This commit is contained in:
John Alanbrook 2022-10-24 20:19:48 +00:00
parent e53cab8604
commit 9be9512e85

View file

@ -1,4 +1,4 @@
#include "window.h" #include "window.h"
#include <string.h> #include <string.h>
#include "texture.h" #include "texture.h"
#include "log.h" #include "log.h"
@ -26,27 +26,36 @@ void window_size_callback(GLFWwindow *w)
} }
struct mSDLWindow *winfind(GLFWwindow *w)
{
for (int i = 0; i < arrlen(windows); i++) {
if (windows[i].window == w)
return &windows[i];
}
return NULL;
}
void window_iconify_callback(GLFWwindow *w, int iconified) void window_iconify_callback(GLFWwindow *w, int iconified)
{ {
struct mSDLWindow *win = arrfind(windows, is_win, w); struct mSDLWindow *win = winfind(w);
win->iconified = iconified; win->iconified = iconified;
} }
void window_focus_callback(GLFWwindow *w, int focused) void window_focus_callback(GLFWwindow *w, int focused)
{ {
struct mSDLWindow *win = arrfind(windows, is_win, w); struct mSDLWindow *win = winfind(w);
win->keyboardFocus = focused; }
}
void window_maximize_callback(GLFWwindow *w, int maximized) void window_maximize_callback(GLFWwindow *w, int maximized)
{ {
struct mSDLWindow *win = arrfind(windows, is_win, w); struct mSDLWindow *win = winfind(w);
win->minimized = !maximized; win->minimized = !maximized;
} }
void window_framebuffer_size_cb(GLFWwindow *w, int width, int height) void window_framebuffer_size_cb(GLFWwindow *w, int width, int height)
{ {
struct mSDLWindow *win = arrfind(windows, is_win, w); struct mSDLWindow *win = winfind(w);
win->width = width; win->width = width;
win->height = height; win->height = height;
window_makecurrent(win); window_makecurrent(win);
@ -270,6 +279,7 @@ void window_render(struct mSDLWindow *w) {
if (script_has_sym(w->nuke_cb)) { if (script_has_sym(w->nuke_cb)) {
nuke_start(); nuke_start();
script_call_sym(w->nuke_cb); script_call_sym(w->nuke_cb);
nk_end(ctx);
nuke_end(); nuke_end();
} else if (w->nuke_gui != NULL) { } else if (w->nuke_gui != NULL) {
nuke_start(); nuke_start();
@ -282,5 +292,7 @@ void window_render(struct mSDLWindow *w) {
} }
void window_renderall() { void window_renderall() {
arrwalk(windows, window_render); //arrwalk(windows, window_render);
for (int i = 0; i < arrlen(windows); i++)
window_render(&windows[i]);
} }