Working on console interaction...

This commit is contained in:
2021-12-04 14:52:15 +01:00
parent 8f06ad8dab
commit 528261395b
3 changed files with 25 additions and 0 deletions

View File

@@ -261,6 +261,10 @@ bool btnp(uint8_t i) {
return key_just_pressed == i;
}
uint8_t whichbtn() {
return key_just_pressed;
}
int mousex() {
return mouse_x;
}
@@ -350,6 +354,16 @@ void debug_one_line_up() {
debug_cursor = debug_total_size-debug_line_size;
}
void debugchr(const uint8_t chr) {
if (chr == 8) {
debug_text[debug_cursor--] = 32;
debug_text[debug_cursor] = 32;
} else {
debug_text[debug_cursor++] = chr;
if (debug_cursor >= debug_total_size) debug_one_line_up();
}
}
void debug(const char *str) {
const int len = SDL_strlen(str);
for (int i=0; i<len;++i) {