diff --git a/MAKE.bat b/MAKE.bat index 6f2163f..3fddd3b 100644 --- a/MAKE.bat +++ b/MAKE.bat @@ -468,6 +468,10 @@ if "%1"=="fwk_mir" ( ) tools\fwkren.exe _fwk\tools\cook.ini from + tools\fwkren.exe _fwk\engine\v4k.c from + tools\fwkren.exe _fwk\engine\v4k.h from + move _fwk\engine\v4k.h _fwk\engine\fwk.h + move _fwk\engine\v4k.c _fwk\engine\fwk.c echo All done. endlocal diff --git a/demos/99-gui.c b/demos/99-gui.c index 6017ccb..3f5d8d0 100644 --- a/demos/99-gui.c +++ b/demos/99-gui.c @@ -3,7 +3,7 @@ int main() { window_create(65.0, 0 ); - gui_pushskin(gui_skinned("golden.ase", 4.0f)); + gui_pushskin(gui_skinned("golden.ase", 1.0f)); skinned_t *skinned = C_CAST(skinned_t*, gui_userdata()); vec4 pos = vec4(400,400,100, 30); diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index 6c59501..1f41fa4 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -359089,7 +359089,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl *value = posx2slider(usablerect, min, max, input(MOUSE_X), step); } float sliderx = slider2posx(min, max, *value, step, usablerect.z); - vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.75f, (slidersize.y*.5f - cursorsize.y*.5f)); + vec2 cursorpos = vec2(sliderx+(usablerect.x-rect.x)-cursorsize.x*.5f, (slidersize.y*.5f - cursorsize.y*.5f)); vec4 cursorrect = rect; cursorrect.x += cursorpos.x; cursorrect.y += cursorpos.y; diff --git a/engine/split/v4k_gui.c b/engine/split/v4k_gui.c index e2bf9f7..77df43e 100644 --- a/engine/split/v4k_gui.c +++ b/engine/split/v4k_gui.c @@ -227,7 +227,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl *value = posx2slider(usablerect, min, max, input(MOUSE_X), step); } float sliderx = slider2posx(min, max, *value, step, usablerect.z); - vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.75f, (slidersize.y*.5f - cursorsize.y*.5f)); + vec2 cursorpos = vec2(sliderx+(usablerect.x-rect.x)-cursorsize.x*.5f, (slidersize.y*.5f - cursorsize.y*.5f)); vec4 cursorrect = rect; cursorrect.x += cursorpos.x; cursorrect.y += cursorpos.y; diff --git a/engine/v4k.c b/engine/v4k.c index e0cc27d..2a31c52 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -11237,7 +11237,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl *value = posx2slider(usablerect, min, max, input(MOUSE_X), step); } float sliderx = slider2posx(min, max, *value, step, usablerect.z); - vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.75f, (slidersize.y*.5f - cursorsize.y*.5f)); + vec2 cursorpos = vec2(sliderx+(usablerect.x-rect.x)-cursorsize.x*.5f, (slidersize.y*.5f - cursorsize.y*.5f)); vec4 cursorrect = rect; cursorrect.x += cursorpos.x; cursorrect.y += cursorpos.y;