eco2d/code/game/src/debug_ui_actions.c

55 lines
940 B
C
Raw Normal View History

2021-05-13 12:36:07 +00:00
#include "debug_ui.h"
2021-08-10 15:21:25 +00:00
2021-05-13 12:36:07 +00:00
static inline void
ActExitGame(void) {
2021-05-13 14:12:18 +00:00
game_request_close();
2021-08-09 13:35:47 +00:00
}
static inline void
ActSpawnCar(void) {
2021-08-09 17:30:39 +00:00
ecs_entity_t e = vehicle_spawn();
ecs_entity_t plr = camera_get().ent_id;
Position const* origin = ecs_get(world_ecs(), plr, Position);
Position * dest = ecs_get_mut(world_ecs(), e, Position, NULL);
*dest = *origin;
}
2021-08-10 15:21:25 +00:00
// NOTE(zaklaus): Replay system
static inline uint8_t
CondReplayStatusOn(void) {
return is_recording;
}
static inline uint8_t
CondReplayStatusOff(void) {
return !is_recording;
}
static inline uint8_t
CondReplayDataPresent(void) {
return records != NULL && !is_recording;
}
static inline void
ActReplayBegin(void) {
debug_replay_start();
}
static inline void
ActReplayEnd(void) {
debug_replay_stop();
}
static inline void
ActReplayRun(void) {
debug_replay_run();
}
static inline void
ActReplayClear(void) {
debug_replay_clear();
}