added F1 keybind to cycle through log verbosity
This commit is contained in:
parent
0827f9467c
commit
2fa75e6ced
11
src/fencer.c
11
src/fencer.c
|
@ -10,14 +10,22 @@
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
#include "tilemap.h"
|
#include "tilemap.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
|
#include <SDL2/SDL_scancode.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
static Player* player = NULL;
|
static Player* player = NULL;
|
||||||
static Level* level = NULL;
|
static Level* level = NULL;
|
||||||
|
|
||||||
static
|
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;
|
g_camera.fov = 40;
|
||||||
|
|
||||||
player = malloc(sizeof(Player));
|
player = malloc(sizeof(Player));
|
||||||
|
@ -36,6 +44,7 @@ static
|
||||||
void draw() {
|
void draw() {
|
||||||
level_draw(level);
|
level_draw(level);
|
||||||
sprite_entity_draw(Player_as_SpriteEntity(player));
|
sprite_entity_draw(Player_as_SpriteEntity(player));
|
||||||
|
physics_entity_debug_draw(Player_as_PhysicsEntity(player));
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
|
|
Loading…
Reference in a new issue