From 7dcfbdf103fce75722325f2891b6ef8071cc1caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Thu, 16 Nov 2023 14:36:39 +0100 Subject: [PATCH] sync fwk --- MAKE.bat | 4 +--- demos/01-demo2d.c | 2 +- demos/09-cubemap.c | 4 +--- demos/99-spine.c | 10 +++++----- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/MAKE.bat b/MAKE.bat index d46b9ba..7ce5957 100644 --- a/MAKE.bat +++ b/MAKE.bat @@ -804,9 +804,7 @@ if "!v4k!"=="yes" ( rem editor if "!editor!"=="yes" ( set edit=-DCOOK_ON_DEMAND -!echo! editor3 && !cc! !o! editor3.exe tools\editor\editor3.c !edit! -Iengine/joint !args! || set rc=1 -set edit=-DUI_LESSER_SPACING -DUI_ICONS_SMALL !edit! -!echo! editor && !cc! !o! editor.exe tools\editor\editor.c !edit! !import! !args! || set rc=1 +!echo! editor && !cc! !o! editor.exe tools\editor\editor.c !edit! -Iengine/joint !args! || set rc=1 rem if "!cc!"=="cl" ( rem set plug_export=/LD diff --git a/demos/01-demo2d.c b/demos/01-demo2d.c index 9b6dbd6..7dc45f6 100644 --- a/demos/01-demo2d.c +++ b/demos/01-demo2d.c @@ -136,7 +136,7 @@ int main() { } if( ui_panel("Tiled", 0)) { ui_float("Zoom in", &cam.position.z); - tiled_ui(&tmx); + ui_tiled(&tmx); ui_panel_end(); } /*if( ui_panel("Spine", 0)) { diff --git a/demos/09-cubemap.c b/demos/09-cubemap.c index 52a9040..c2a5bf9 100644 --- a/demos/09-cubemap.c +++ b/demos/09-cubemap.c @@ -81,9 +81,7 @@ int main(int argc, char** argv) { } ui_separator(); for (int i = 0; i < 9; i++) { - vec3 remap = scale3(add3(sky.cubemap.sh[i], vec3(1,1,1)), 127.5f); // -1..+1 -> 0..255 - ui_color3(va("SH Coefficient [%d]", i), &remap.x); - sky.cubemap.sh[i] = sub3(scale3(remap, 1/127.5f), vec3(1,1,1)); + ui_color3f(va("SH Coefficient [%d]", i), &sky.cubemap.sh[i].x); } ui_panel_end(); } diff --git a/demos/99-spine.c b/demos/99-spine.c index 27a6c61..5f2454b 100644 --- a/demos/99-spine.c +++ b/demos/99-spine.c @@ -12,9 +12,9 @@ #include "v4k.h" #define spine spine2 #define spine_render spine_render2 -#define spine_ui spine_ui2 #define spine_animate spine_animate2 #define spine_skin spine_skin2 +#define ui_spine ui_spine2 enum { _64 = 64 }; // max bones @@ -395,7 +395,7 @@ void spine_render(spine_t *p, vec3 offset, unsigned flags) { float deg_rect = self->rect_id ? p->skins[p->skin].rects[self->rect_id].deg : 0; float tilt = p->atlas[self->atlas_id].deg + self->deg2 - deg_rect; // + self->deg2 + deg_rect + p->atlas[self->atlas_id].deg unsigned tint = ~0u; - sprite_rect(p->texture, rect, zindex, add3(vec3(target.x,target.y,1),vec3(offsx,offsy,0)), tilt, tint); + sprite_rect(p->texture, rect, zindex, add4(vec4(target.x,target.y,1,1),vec4(offsx,offsy,0,0)), tilt, tint); } } @@ -438,7 +438,7 @@ void spine_animate(spine_t *p, float *time, float *maxtime, float delta) { } } -void spine_ui(spine_t *p) { +void ui_spine(spine_t *p) { if( ui_collapse(va("Anims: %d", array_count(p->anims)), va("%p-a", p))) { for each_array_ptr(p->anims, spine_anim_t, q) { @@ -514,7 +514,7 @@ void spine_ui(spine_t *p) { sprite_rect(p->texture, // rect: vec4(r->x*1.0/p->texture.w,r->y*1.0/p->texture.h,(r->x+r->w)*1.0/p->texture.w,(r->y+r->h)*1.0/p->texture.h), ptr4(&r->x), // atlas - 0, vec3(0,0,0), r->deg + tilt, tint); + 0, vec4(0,0,1,1), r->deg + tilt, tint); sprite_flush(); camera_get_active()->position = vec3(+window_width()/3,window_height()/2.25,2); } @@ -559,7 +559,7 @@ int main() { if(ui_button("Load")) { s = spine("goblins.json", "goblins.atlas", 0); } - spine_ui(&s); + ui_spine(&s); if(ui_bool("Draw Skin", &do_skin)); if(ui_bool("Draw Skeleton", &do_skel)); ui_panel_end();