only support indexed color mode, get rid of enum/branching on color modes

This commit is contained in:
asrael 2026-02-27 15:53:25 -06:00
parent 9f657ffcf9
commit e0a5d34d29
25 changed files with 142 additions and 286 deletions

View file

@ -316,6 +316,7 @@ void pxl8_world_init_local_player(pxl8_world* world, f32 x, f32 y, f32 z) {
world->local_player.flags = PXL8_SIM_FLAG_ALIVE | PXL8_SIM_FLAG_PLAYER | PXL8_SIM_FLAG_GROUNDED;
world->local_player.kind = 0;
world->client_tick = 0;
world->pointer_motion = (pxl8_vec2){0};
#ifdef PXL8_ASYNC_THREADS
world->render_state[0] = world->local_player;
@ -323,6 +324,20 @@ void pxl8_world_init_local_player(pxl8_world* world, f32 x, f32 y, f32 z) {
#endif
}
void pxl8_world_set_look(pxl8_world* world, f32 yaw, f32 pitch) {
if (!world) return;
world->local_player.yaw = yaw;
world->local_player.pitch = pitch;
world->pointer_motion = (pxl8_vec2){.yaw = yaw, .pitch = pitch};
#ifdef PXL8_ASYNC_THREADS
world->render_state[0].yaw = yaw;
world->render_state[0].pitch = pitch;
world->render_state[1].yaw = yaw;
world->render_state[1].pitch = pitch;
#endif
}
pxl8_sim_entity* pxl8_world_local_player(pxl8_world* world) {
if (!world) return NULL;
#ifdef PXL8_ASYNC_THREADS

View file

@ -37,6 +37,7 @@ void pxl8_world_set_bsp_material(pxl8_world* world, u16 material_id, const pxl8_
void pxl8_world_set_sim_config(pxl8_world* world, const pxl8_sim_config* config);
void pxl8_world_init_local_player(pxl8_world* world, f32 x, f32 y, f32 z);
void pxl8_world_set_look(pxl8_world* world, f32 yaw, f32 pitch);
pxl8_sim_entity* pxl8_world_local_player(pxl8_world* world);
pxl8_sim_world pxl8_world_sim_world(const pxl8_world* world, pxl8_vec3 pos);
void pxl8_world_predict(pxl8_world* world, pxl8_net* net, const pxl8_input_msg* input, f32 dt);