X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player.h;h=c9f13f729bd8953220694f15f5ac22419f9fd99a;hb=e3bf80ff27b675f5e7f87dcebd16fab6fe08df7a;hp=1a97e1a2b0de8ace2b91be91618fdf586ae2d36b;hpb=5430d708f058626a6c8fed7dd2aa8ba5f0a06c84;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player.h b/player.h index 1a97e1a..c9f13f7 100644 --- a/player.h +++ b/player.h @@ -1,3 +1,168 @@ +#ifndef PLAYER_H +#define PLAYER_H + +#include "player_api.h" + +#include "player_common.h" +#include "player_walk.h" +#include "player_skate.h" +//#include "player_dead.h" + +struct player_instance +{ + /* transform definition */ + rigidbody rb; + v3f angles; + + /* + * Camera management + * --------------------------- + */ + camera cam; /* output final camera */ + + enum camera_mode + { + k_cam_firstperson = 0, + k_cam_thirdperson = 1 + } + camera_mode; + float camera_type_blend; + + struct + { + v3f co, angles; + } + cam1, cam3; + + teleport_gate *gate_waiting; + + /* + * Input + * -------------------------------- + */ + struct input_binding *input_js1h, + *input_js1v, + *input_js2h, + *input_js2v, + *input_jump, + *input_push, + *input_walk, + *input_walkh, + *input_walkv, + *input_use, + *input_reset, + *input_grab, + *input_camera; + + /* + * Animation + * -------------------------------------------------- + */ + + struct player_avatar *playeravatar; + glmesh *playermesh; + struct player_ragdoll ragdoll; + vg_tex2d *playertex; + + /* + * Subsystems + * ------------------------------------------------- + */ + + enum player_subsystem + { + k_player_subsystem_walk = 0, + k_player_subsystem_skate = 1, + k_player_subsystem_dead = 2 + } + subsystem; + + struct player_skate _skate; + struct player_walk _walk; + //struct player_dead _dead; +}; + +/* + * Gameloop tables + * --------------------------------------------------------- + */ + +VG_STATIC +void (*_player_bind[])( player_instance *player ) = +{ + player__walk_bind, + player__skate_bind, + NULL +}; + +VG_STATIC +void (*_player_reset[])( player_instance *player, struct respawn_point *rp ) = +{ + NULL, + player__skate_reset, + NULL +}; + +VG_STATIC +void (*_player_pre_update[])( player_instance *player ) = +{ + player__walk_pre_update, + player__skate_pre_update, + NULL +}; + +VG_STATIC +void( *_player_update[])( player_instance *player ) = +{ + player__walk_update, + player__skate_update, + NULL +}; + +VG_STATIC +void( *_player_post_update[])( player_instance *player ) = +{ + player__walk_post_update, + player__skate_post_update, + NULL +}; + +VG_STATIC +void( *_player_im_gui[])( player_instance *player ) = +{ + player__walk_im_gui, + player__skate_im_gui, + NULL +}; + +VG_STATIC +void( *_player_animate[])( player_instance *player, player_animation *dest ) = +{ + player__walk_animate, + player__skate_animate, + NULL +}; + +VG_STATIC +void( *_player_post_animate[])( player_instance *player ) = +{ + player__walk_post_animate, + player__skate_post_animate, + NULL +}; + +/* implementation */ + +#include "player.c" +#include "player_common.c" +#include "player_walk.c" +#include "player_skate.c" +//#include "player_dead.c" + +#endif /* PLAYER_H */ + + +#if 0 /* * Copyright (C) 2021-2023 Mt.ZERO Software, Harry Godden - All Rights Reserved */ @@ -908,3 +1073,4 @@ VG_STATIC void player_restore_frame(void) } #endif /* PLAYER_H */ +#endif