aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2024-05-28 07:54:34 -0600
committerRandy Palamar <randy@rnpnr.xyz>2024-05-30 05:30:10 -0600
commit9bfb31fcbee028eaecce75a743f2a0bd50b5807c (patch)
tree00c36f8595fbd42636ed00c2c199d5b9c8454f62 /vis-lua.c
parent70fa1e8594be04c203179e8249a27ae648a81e71 (diff)
downloadvis-9bfb31fcbee028eaecce75a743f2a0bd50b5807c.tar.gz
vis-9bfb31fcbee028eaecce75a743f2a0bd50b5807c.tar.xz
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.
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c7
1 files changed, 1 insertions, 6 deletions
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);