bitpack_ctx ctx = {
.mode = k_bitpack_compress,
.buffer = frame->animdata,
- .buffer_len = size,
+ .buffer_len = sys->animator_size,
.bytes = 0,
};
bitpack_bytes( ctx, sizeof(animator->root_co), animator->root_co );
bitpack_qquat( ctx, animator->root_q );
+
bitpack_qv3f( ctx, 8, -1.0f, 1.0f, animator->offset );
bitpack_qv3f( ctx, 8, -1.0f, 1.0f, animator->local_cog );
bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->slide );
bitpack_qv2f( ctx, 8, -1.0f, 1.0f, animator->grab );
bitpack_qf32( ctx, 16, 0.0f, 120.0f, &animator->push_time );
+ bitpack_qf32( ctx, 16, 0.0f, 120.0f, &animator->jump_time );
}
#endif /* PLAYER_SKATE_C */
w->state.outro_start_time = 0.0;
}
+static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){
+ struct player_walk_animator *animator = data;
+ bitpack_bytes( ctx, sizeof(*animator), animator );
+}
#endif /* PLAYER_DEVICE_WALK_H */
static void player__walk_transition (void);
static void player__walk_reset (ent_spawn *rp );
static void player__walk_restore (void);
+static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data );
struct player_subsystem_interface static player_subsystem_walk = {
.system_register = player__walk_register,
.animate = player__walk_animate,
.post_animate = player__walk_post_animate,
.pose = player__walk_pose,
+ .network_animator_exchange = player__walk_animator_exchange,
.animator_data = &player_walk.animator,
.animator_size = sizeof(player_walk.animator),
static struct player_avatar localplayer_avatar;
int main( int argc, char *argv[] ){
+#if 0
+ u8 buf[ 512 ];
+ bitpack_ctx ctx = {
+ .buffer = buf,
+ .buffer_len = 512,
+ .bytes = 0,
+ .mode = k_bitpack_compress
+ };
+
+ v4f q = { 0.388, -0.565, 0.515, 0.515 };
+ vg_info( "q: %f %f %f %f\n", q[0], q[1], q[2], q[3] );
+
+ /* compress */
+ bitpack_qquat( &ctx, q );
+
+ vg_info( "compressed bytes: %u\n", ctx.bytes );
+
+ /* decompress */
+ ctx.bytes = 0;
+ ctx.mode = k_bitpack_decompress;
+
+ bitpack_qquat( &ctx, q );
+ vg_info( "q: %f %f %f %f\n", q[0], q[1], q[2], q[3] );
+
+ return 0;
+#endif
+
vg_mem.use_libc_malloc = 0;
vg_set_mem_quota( 160*1024*1024 );
vg_enter( argc, argv, "Voyager Game Engine" );