comparison libmlk-adventure/adventure/trace_hud.c @ 276:8d41e317c07b

adventure: enable trace_hud
author David Demelier <markand@malikania.fr>
date Sun, 13 Dec 2020 11:10:35 +0100
parents 71b3b7036de7
children 196264679079
comparison
equal deleted inserted replaced
275:f89a53abb314 276:8d41e317c07b
18 18
19 #include <assert.h> 19 #include <assert.h>
20 #include <stdio.h> 20 #include <stdio.h>
21 #include <string.h> 21 #include <string.h>
22 22
23 #include <core/action.h>
23 #include <core/font.h> 24 #include <core/font.h>
24 #include <core/trace.h> 25 #include <core/trace.h>
25 #include <core/window.h> 26 #include <core/window.h>
26 27
27 #include <ui/label.h> 28 #include <ui/label.h>
111 void 112 void
112 trace_hud_clear(void) 113 trace_hud_clear(void)
113 { 114 {
114 memset(&data, 0, sizeof (data)); 115 memset(&data, 0, sizeof (data));
115 } 116 }
117
118 static bool
119 update(struct action *a, unsigned int ticks)
120 {
121 (void)a;
122
123 trace_hud_update(ticks);
124
125 return false;
126 }
127
128 static void
129 draw(struct action *a)
130 {
131 (void)a;
132
133 trace_hud_draw();
134 }
135
136 struct action *
137 trace_hud_action(void)
138 {
139 static struct action a = {
140 .update = update,
141 .draw = draw
142 };
143
144 return &a;
145 }