added F1 keybind to cycle through log verbosity

This commit is contained in:
Sara 2023-10-25 23:24:26 +02:00
parent 0827f9467c
commit 2fa75e6ced

View file

@ -10,14 +10,22 @@
#include "sprite.h"
#include "tilemap.h"
#include "player.h"
#include <SDL2/SDL_scancode.h>
#include <assert.h>
static Player* player = NULL;
static Level* level = NULL;
static
void play() {
void toggle_info_key(int down) {
if(down) {
g_debug_log_lvl = (g_debug_log_lvl + 1) % 4;
}
}
static
void play() {
input_add_key_action(SDL_SCANCODE_F1, &toggle_info_key);
g_camera.fov = 40;
player = malloc(sizeof(Player));
@ -36,6 +44,7 @@ static
void draw() {
level_draw(level);
sprite_entity_draw(Player_as_SpriteEntity(player));
physics_entity_debug_draw(Player_as_PhysicsEntity(player));
}
int main(int argc, char* argv[]) {