projects
/
vg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f585179
)
fluff
author
hgn
<hgodden00@gmail.com>
Sun, 9 Jul 2023 01:50:59 +0000
(
02:50
+0100)
committer
hgn
<hgodden00@gmail.com>
Sun, 9 Jul 2023 01:50:59 +0000
(
02:50
+0100)
vg.h
patch
|
blob
|
history
vg_m.h
patch
|
blob
|
history
diff --git
a/vg.h
b/vg.h
index 5cae23e045981fc934f9083a3e6018c4cd4655fc..132f338275933833d2a0545e6c1dfd3cb5376b9f 100644
(file)
--- a/
vg.h
+++ b/
vg.h
@@
-26,17
+26,17
@@
|IMP| | |.------------- vg_start(void) ---------------'
| | | |
| | | v
|IMP| | |.------------- vg_start(void) ---------------'
| | | |
| | | v
-|IMP| | vg_update(void)
+|IMP| | vg_
pre_
update(void)
| | | |
| | | .-----+.
| | | |
| | | .-----+.
-| | | | |
+| | | | |
called 0x to 8x
| | | | v
| | | | v
-|IMP| | '- vg_
update_fixed
(void)
+|IMP| | '- vg_
fixed_update
(void)
| | | |
| | | .-'
| | | |
| | | v
| | | |
| | | .-'
| | | |
| | | v
-|IMP| | vg_
update_post
(void)
+|IMP| | vg_
post_update
(void)
| | | |
| | | v
|IMP| | vg_render(void)
| | | |
| | | v
|IMP| | vg_render(void)
@@
-89,9
+89,9
@@
VG_STATIC void vg_launch_opt(void);
VG_STATIC void vg_start(void);
VG_STATIC void vg_framebuffer_resize(int w, int h);
VG_STATIC void vg_start(void);
VG_STATIC void vg_framebuffer_resize(int w, int h);
-VG_STATIC void vg_update(void);
-VG_STATIC void vg_
update_fixed
(void);
-VG_STATIC void vg_
update_post
(void);
+VG_STATIC void vg_
pre_
update(void);
+VG_STATIC void vg_
fixed_update
(void);
+VG_STATIC void vg_
post_update
(void);
VG_STATIC void vg_render(void);
VG_STATIC void vg_gui(void);
VG_STATIC void vg_render(void);
VG_STATIC void vg_gui(void);
@@
-391,7
+391,7
@@
VG_STATIC void _vg_gameloop_update(void)
vg_profile_begin( &vg_prof_update );
vg.engine_stage = k_engine_stage_update;
vg_profile_begin( &vg_prof_update );
vg.engine_stage = k_engine_stage_update;
- vg_update();
+ vg_
pre_
update();
/* Fixed update loop */
vg.engine_stage = k_engine_stage_update_fixed;
/* Fixed update loop */
vg.engine_stage = k_engine_stage_update_fixed;
@@
-401,11
+401,9
@@
VG_STATIC void _vg_gameloop_update(void)
vg.time_fixed_accumulator += vg.time_delta;
while( vg.time_fixed_accumulator >= VG_TIMESTEP_FIXED ){
vg.time_fixed_accumulator += vg.time_delta;
while( vg.time_fixed_accumulator >= VG_TIMESTEP_FIXED ){
- vg_
update_fixed
();
+ vg_
fixed_update
();
vg_lines.allow_input = 0;
vg_lines.allow_input = 0;
-
vg.time_fixed_accumulator -= VG_TIMESTEP_FIXED;
vg.time_fixed_accumulator -= VG_TIMESTEP_FIXED;
- //vg.accumulator = VG_MAX( 0.0, vg.accumulator );
vg.fixed_iterations ++;
if( vg.fixed_iterations == 8 ){
vg.fixed_iterations ++;
if( vg.fixed_iterations == 8 ){
@@
-416,7
+414,7
@@
VG_STATIC void _vg_gameloop_update(void)
vg.time_fixed_extrapolate = vg.time_fixed_accumulator / VG_TIMESTEP_FIXED;
vg.engine_stage = k_engine_stage_update;
vg.time_fixed_extrapolate = vg.time_fixed_accumulator / VG_TIMESTEP_FIXED;
vg.engine_stage = k_engine_stage_update;
- vg_
update_post
();
+ vg_
post_update
();
vg_profile_end( &vg_prof_update );
}
vg_profile_end( &vg_prof_update );
}
diff --git
a/vg_m.h
b/vg_m.h
index c48f13e40ee510399008ae9cfb168b61258db45b..0ded4e127302bfd0d396f14416c12710eeb3fb84 100644
(file)
--- a/
vg_m.h
+++ b/
vg_m.h
@@
-403,17
+403,22
@@
static inline f32 vg_lerpf( f32 a, f32 b, f32 t ){
return a + t*(b-a);
}
return a + t*(b-a);
}
+static inline f64 vg_lerp( f64 a, f64 b, f64 t )
+{
+ return a + t*(b-a);
+}
+
static inline void vg_slewf( f32 *a, f32 b, f32 speed ){
f32 d = vg_signf( b-*a ),
c = *a + d*speed;
*a = vg_minf( b*d, c*d ) * d;
}
static inline void vg_slewf( f32 *a, f32 b, f32 speed ){
f32 d = vg_signf( b-*a ),
c = *a + d*speed;
*a = vg_minf( b*d, c*d ) * d;
}
-static inline f64 vg_lerp( f64 a, f64 b, f64 t )
-{
- return a + t*(b-a);
+static inline f32 vg_smoothstepf( f32 x ){
+ return x*x*(3.0f - 2.0f*x);
}
}
+
/* correctly lerp around circular period -pi -> pi */
static f32 vg_alerpf( f32 a, f32 b, f32 t )
{
/* correctly lerp around circular period -pi -> pi */
static f32 vg_alerpf( f32 a, f32 b, f32 t )
{