Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions animation.c3
Original file line number Diff line number Diff line change
Expand Up @@ -216,51 +216,50 @@ fn void animation_list_debug_tab() {
@pool() {

imgui::table_set_column_index(0);
imgui::text(string::tformat_zstr("%d", index));
imgui::textf("%d", index);

imgui::table_set_column_index(1);
imgui::text(string::tformat_zstr("%s", animation.animation_type));
imgui::textf("%s", animation.animation_type);

imgui::table_set_column_index(2);
switch(animation.animation_type) {
case SEQUENCE:
case GROUP:
imgui::text(string::tformat_zstr("animations: %s", animation.animations));
imgui::textf("animations: %s", animation.animations);

case LOOP:
imgui::text(string::tformat_zstr("animation: %s", animation.animation_to_loop));
imgui::textf("animation: %s", animation.animation_to_loop);

case SLIDE:
imgui::text(string::tformat_zstr(
"character: %s, slide from %d,%d to %d,%d, over %.2f seconds",
imgui::textf("character: %s, slide from %d,%d to %d,%d, over %.2f seconds",
common::characters[animation.character_index].name,
animation.slide_from.x,
animation.slide_from.y,
animation.slide_to.x,
animation.slide_to.y,
animation.duration

));
);

imgui::table_set_column_index(3);

imgui::text(string::tformat_zstr("%.2f", animation.step));
imgui::textf("%.2f", animation.step);

case PAUSE:
imgui::text(string::tformat_zstr("duration: %d", animation.duration));
imgui::textf("duration: %d", animation.duration);

imgui::table_set_column_index(3);
imgui::text(string::tformat_zstr("%.2f", animation.step));
imgui::textf("%.2f", animation.step);

case TURN:
imgui::text(string::tformat_zstr(
imgui::textf(
"character: %s, turn %s",
common::characters[animation.character_index].name,
animation.turn_to.value
));
);

imgui::table_set_column_index(3);
imgui::text(string::tformat_zstr("%.2f", animation.step));
imgui::textf("%.2f", animation.step);

case IDLE:
}
Expand Down Expand Up @@ -293,24 +292,24 @@ fn void Animation.imgui_debug_visualize(&animation, AnimationIndex list_index) {
animation_list[animation.animation_to_loop].imgui_debug_visualize(list_index);
case SLIDE:
imgui::same_line();
imgui::text(string::tformat_zstr(
imgui::textf(
"slide '%s' from %.2f,%.2f to %.2f,%.2f",
common::characters[animation.character_index].name,
animation.slide_from.x,
animation.slide_from.y,
animation.slide_to.x,
animation.slide_to.y
));
);
imgui::progress_bar(animation.step / animation.duration, {0.0, 0.0}, null);
case PAUSE:
imgui::progress_bar(animation.step / animation.duration, {0.0, 0.0}, null);
case TURN:
imgui::same_line();
imgui::text(string::tformat_zstr(
imgui::textf(
"turn '%s' %s",
common::characters[animation.character_index].name,
animation.turn_to.value
));
);
imgui::progress_bar(animation.step, { 0.0, 0.0 }, null);
case IDLE: break;
}
Expand Down
7 changes: 7 additions & 0 deletions imgui.c3
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ extern fn void begin(ZString title,
extern fn void end() @extern("igEnd");
extern fn void show_demo_window(bool*) @extern("igShowDemoWindow");
extern fn void text(ZString) @extern("igText");
macro void textf(String format, args...) @format(0)
{
@pool()
{
text(string::tformat_zstr(format, ...args));
};
}
extern fn bool button(ZString, ImVec2 size = {0.0, 0.0}) @extern("igButton");
extern fn bool begin_tab_bar(ZString, SomeFlags flag = 0) @extern("igBeginTabBar");
extern fn void end_tab_bar() @extern("igEndTabBar");
Expand Down