From 9bfb31fcbee028eaecce75a743f2a0bd50b5807c Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Tue, 28 May 2024 07:54:34 -0600 Subject: remove the vis->initialized member I already fixed the reason that this even existed (vis_event_emit getting called at random times when the editor wasn't ready). The option checking in main() was moved up because I noticed it was in the wrong place while thinking about where to emit the INIT event. There is no reason to do a bunch of useless work just to print the version. --- vis-lua.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'vis-lua.c') diff --git a/vis-lua.c b/vis-lua.c index 629886f..e3e85c3 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -3608,18 +3608,13 @@ static void vis_lua_ui_draw(Vis *vis) { } bool vis_event_emit(Vis *vis, enum VisEvents id, ...) { - if (!vis->initialized) { - vis->initialized = true; - ui_init(&vis->ui, vis); - vis_lua_init(vis); - } - va_list ap; va_start(ap, id); bool ret = true; switch (id) { case VIS_EVENT_INIT: + vis_lua_init(vis); break; case VIS_EVENT_START: vis_lua_start(vis); -- cgit v1.2.3