Working on console interaction...
This commit is contained in:
14
ascii.cpp
14
ascii.cpp
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user