introduced proper rectangular rendering
This commit is contained in:
+4
-12
@@ -173,8 +173,8 @@ u8 get_choice() {
|
||||
|
||||
/* Draw a room character according to the index and value */
|
||||
void render_room_item(u8 i, u8 v) {
|
||||
u8 color, topleft_x, topleft_y, topright_x, bottomleft_y,
|
||||
text_x, text_y, cheight=7, cwidth=8, left_offset = 9;
|
||||
u8 color, topleft_x, topleft_y, text_x, text_y,
|
||||
cheight=7, cwidth=8, left_offset = 9;
|
||||
if(i == 0) {
|
||||
topleft_x = 8;
|
||||
topleft_y = 0;
|
||||
@@ -188,8 +188,6 @@ void render_room_item(u8 i, u8 v) {
|
||||
topleft_x = 8;
|
||||
topleft_y = 16;
|
||||
}
|
||||
topright_x = topleft_x + cwidth - 1;
|
||||
bottomleft_y = topleft_y + cheight - 1;
|
||||
text_x = topleft_x + 1;
|
||||
text_y = topleft_y + 2;
|
||||
if(v == 0) {} /* don't render anything */
|
||||
@@ -206,10 +204,7 @@ void render_room_item(u8 i, u8 v) {
|
||||
colorxy(topleft_x, topleft_y+4, color);
|
||||
colorxy(topleft_x+4, topleft_y+4, color);
|
||||
/* draw the rectangle */
|
||||
chlinexy(topleft_x + 1, topleft_y, cwidth - 2);
|
||||
chlinexy(topleft_x + 1, bottomleft_y, cwidth - 2);
|
||||
cvlinexy(topleft_x, topleft_y + 1, cheight - 2);
|
||||
cvlinexy(topright_x, topleft_y + 1, cheight - 2);
|
||||
rect(topleft_x, topleft_y, cwidth, cheight);
|
||||
/* draw text */
|
||||
gotoxy(text_x, text_y);
|
||||
if(v < 14) {
|
||||
@@ -244,13 +239,10 @@ void render_main_scene() {
|
||||
chlinexy(0,SCREEN_HEIGHT-3,SCREEN_WIDTH);
|
||||
/* render the room */
|
||||
for(i=0;i<4;i++) render_room_item(i, room[i]);
|
||||
rect(9, 9, 6, 5);
|
||||
cputsxy(10, 10, "DECK");
|
||||
gotoxy(11, 12);
|
||||
cprintf("%02d", deck_count);
|
||||
cvlinexy(9, 10, 3);
|
||||
cvlinexy(14, 10, 3);
|
||||
chlinexy(10, 9, 4);
|
||||
chlinexy(10, 13, 4);
|
||||
/* render stats */
|
||||
gotoxy(statbase, 1);
|
||||
cprintf("Health %02d", hp);
|
||||
|
||||
Reference in New Issue
Block a user