- new debug system

This commit is contained in:
2022-10-28 13:49:08 +02:00
parent a029771b07
commit 1a732d7c71
4 changed files with 96 additions and 168 deletions

View File

@@ -1,36 +1,9 @@
#include "mini.h"
int current_editor = 0;
void do_terminal() {
cls(0);
pdebug();
}
void do_sprite_editor() {
cls(14);
//palt(0, false);
rectfill(0, 0, 160, 7, 2);
rectfill(0, 115, 160, 119, 2);
sspr(0, 0, 128, 32, 0, 83);
sspr(0, 0, 8, 8, 8, 16, 64, 64);
rect(8, 16, 72, 80, 0);
spr(17, mousex(), mousey());
if (mbtn(1) && mousex()>=8 && mousey()>=8 && mousex()<72 && mousey()<72) {
sset((mousex()-8)/8, (mousey()-16)/8);
}
}
void loop() {
if (btnp(KEY_TAB)) {
current_editor = (++current_editor)%5;
}
switch(current_editor) {
case 0:
do_terminal();
break;
case 1:
do_sprite_editor();
break;
}
settrans(255);
setcolor(0,0xff0000);
const int w=scrw();
const int h=scrh();
rect(0,0,w-1,h-1,0);
}