void hprint(HCard *card) { #ifdef DEBUG if(card == NULL) { printError("HCard", "Error", "hprint(HCard *)", "NULL HCard Pointer Exception!!"); } #endif printf("Month : %d ", card->month); printf("Type : "); switch(card->type) { case H_NORM: if(card->isDouble) { printf("Ssang-"); } printf("Ppi "); break; case H_ANIM: if(HCard_isBird(card)) { printf("Godori "); } else { printf("Animal "); } break; case H_LINE: printf("Ddi "); break; case H_GWAN: printf("Gwang "); break; } // Type if(card->type == H_LINE) { switch(card->five_type) { case HF_RED: printf("(Hong-Dan)"); break; case HF_BLU: printf("(Choeng-Dan)"); break; case HF_CHO: printf("(Cho-Dan)"); break; case HF_ETC: printf("(Just Dan)"); break; default: break; } } }
void Renderer_cardsmall(int xpos, int ypos, HCard const *card) { /* Draw Small Card This is discriminated by several colors. And they has some special alphabets. */ HGUI_cSet(RED, BACKGROUND, DARK); HGUI_cSet(WHITE, FOREGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+2, ypos+2); char month_string[3]; sprintf(month_string, "%d", card->month); switch(card->type) { case H_NORM: if(card->isDouble) { HGUI_cSet(BLUE, FOREGROUND, BRIGHT); HGUI_text(xpos+1, ypos, "D", false, ALIGN_LEFT); } HGUI_text(xpos+1, ypos+1, month_string, false, ALIGN_RIGHT); break; case H_ANIM: if(HCard_isBird(card)) { HGUI_cSet(YELLOW, FOREGROUND, BRIGHT); HGUI_text(xpos, ypos, "B", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+1, month_string, false, ALIGN_RIGHT); } else { HGUI_cSet(GREEN, FOREGROUND, BRIGHT); HGUI_text(xpos, ypos, "A", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+1, month_string, false, ALIGN_RIGHT); } break; case H_LINE: if(card->five_type == HF_RED) { HGUI_cSet(MAGENTA, FOREGROUND, BRIGHT); } else if(card->five_type == HF_BLU) { HGUI_cSet(BLUE, FOREGROUND, BRIGHT); } else if(card->five_type == HF_CHO) { HGUI_cSet(RED, FOREGROUND, BRIGHT); } else { HGUI_cSet(BLACK, FOREGROUND, DARK); } HGUI_text(xpos+1, ypos, "=", false, ALIGN_LEFT); HGUI_cSet(WHITE, FOREGROUND, BRIGHT); HGUI_text(xpos+1, ypos+1, month_string, false, ALIGN_RIGHT); break; case H_GWAN: HGUI_text(xpos, ypos, "*", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+1, month_string, false, ALIGN_RIGHT); break; } HGUI_cReset(); }
void Renderer_card(int xpos, int ypos, HCard const *card) { if(card == NULL) { #ifdef DEBUG printError("HGUI", "Error", "HGUI_card", "NULL Card Exception"); #endif } char month_string[3] = {0}; sprintf(month_string, "%d", card->month); switch(card->month) { case 1: HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); HGUI_cSet(BLACK, BACKGROUND, DARK); HGUI_rect(xpos , ypos+3, xpos+1, ypos+5); HGUI_rect(xpos+1, ypos+2, xpos+2, ypos+5); HGUI_rect(xpos+2, ypos+4, xpos+3, ypos+5); HGUI_rect(xpos+3, ypos+3, xpos+4, ypos+5); HGUI_rect(xpos+4, ypos+2, xpos+5, ypos+5); HGUI_cSet(WHITE, FOREGROUND, DARK); HGUI_text(xpos , ypos+3, "^", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+2, "^", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+4, "^", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+3, "^", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+2, "^", false, ALIGN_LEFT); if(card->type == H_GWAN) { HGUI_cSet(WHITE, FOREGROUND, BRIGHT); HGUI_text(xpos, ypos+4, "*", false, ALIGN_LEFT); } break; case 2: HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); HGUI_cSet(RED, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos+3, xpos+3, ypos+4); HGUI_rect(xpos+1, ypos+2, xpos+2, ypos+5); HGUI_rect(xpos+3, ypos+4, xpos+5, ypos+5); HGUI_rect(xpos+4, ypos+3, xpos+5, ypos+4); HGUI_cSet(YELLOW, BACKGROUND, BRIGHT); HGUI_rect(xpos+1, ypos+3, xpos+2, ypos+4); HGUI_rect(xpos+4, ypos+4, xpos+5, ypos+5); break; case 3: HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); if(card->type == H_GWAN) { HGUI_cSet(BLACK, FOREGROUND, DARK); HGUI_text(xpos, ypos+4, "*", false, ALIGN_LEFT); } HGUI_cSet(MAGENTA, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos+3, xpos+3, ypos+4); HGUI_rect(xpos+1, ypos+2, xpos+2, ypos+5); HGUI_rect(xpos+3, ypos+4, xpos+5, ypos+5); HGUI_rect(xpos+4, ypos+3, xpos+5, ypos+4); HGUI_cSet(MAGENTA, BACKGROUND, DARK); HGUI_rect(xpos+1, ypos+3, xpos+2, ypos+4); HGUI_rect(xpos+4, ypos+4, xpos+5, ypos+5); break; case 4: HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); HGUI_cSet(BLACK, FOREGROUND, DARK); HGUI_text(xpos+1, ypos+1, "|", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+2, "|", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+3, "|", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+4, "|", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+3, "|", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+4, "|", false, ALIGN_LEFT); HGUI_text(xpos , ypos+1, "o", false, ALIGN_LEFT); HGUI_text(xpos , ypos+3, "o", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+2, "o", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+4, "o", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+3, "o", false, ALIGN_LEFT); break; case 5: HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); if(card->type == H_ANIM) { HGUI_cSet(BLUE, BACKGROUND, BRIGHT); HGUI_cSet(YELLOW, FOREGROUND, BRIGHT); HGUI_text(xpos, ypos+4, "x xx", false, ALIGN_LEFT); } HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_cSet(BLACK, FOREGROUND, DARK); HGUI_text(xpos+1, ypos+1, "|", false, ALIGN_LEFT); // Stem 1 HGUI_text(xpos+1, ypos+2, "|", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+3, "|", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+4, "|", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+4, "|", false, ALIGN_LEFT); // Stem 2 HGUI_cSet(BLUE, BACKGROUND, DARK); HGUI_cSet(BLUE, FOREGROUND, BRIGHT); HGUI_text(xpos , ypos+2, "<", false, ALIGN_LEFT); // Flower 1 HGUI_text(xpos+2, ypos+2, ">", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+1, "^", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+3, "o", false, ALIGN_LEFT); HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_text(xpos+3, ypos+3, "x", false, ALIGN_LEFT); // Flower 2 HGUI_cSet(YELLOW, BACKGROUND, BRIGHT); HGUI_text(xpos+1, ypos+2, " ", false, ALIGN_LEFT); break; case 6: HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); if(card->type == H_ANIM) { HGUI_text(xpos+3, ypos+2, ">", false, ALIGN_LEFT); } // Butter Fly Center HGUI_cSet(RED , BACKGROUND, DARK); HGUI_cSet(YELLOW, FOREGROUND, DARK); HGUI_rect(xpos+1, ypos+2, xpos+3, ypos+4); if(card->type == H_ANIM) { HGUI_text(xpos+1, ypos+2, "<", false, ALIGN_LEFT); // Butter Fly Left HGUI_text(xpos+2, ypos+3, "|", false, ALIGN_LEFT); } // Butter Fly Center HGUI_cSet(RED , BACKGROUND, BRIGHT); HGUI_rect(xpos+1, ypos+3, xpos+2, ypos+4); HGUI_rect(xpos+2, ypos+2, xpos+3, ypos+3); if(card->type == H_ANIM) { HGUI_text(xpos+2, ypos+2, "#", false, ALIGN_LEFT); // Butter Fly Center } // Butter Fly Center HGUI_cSet(BLACK, BACKGROUND, DARK); HGUI_cSet(BLACK, FOREGROUND, BRIGHT); HGUI_text(xpos, ypos+1, "\\", false, ALIGN_LEFT); HGUI_text(xpos, ypos+4, "/", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+1, "/", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+4, "\\", false, ALIGN_LEFT); break; case 7: HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); HGUI_cSet(BLACK, FOREGROUND, DARK); HGUI_text(xpos+1, ypos+1, "|", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+2, "|", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+3, "|", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+4, "|", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+3, "|", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+4, "|", false, ALIGN_LEFT); HGUI_text(xpos , ypos+1, "o", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+4, "o", false, ALIGN_LEFT); HGUI_cSet(RED , FOREGROUND, BRIGHT); HGUI_text(xpos , ypos+3, "o", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+2, "o", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+3, "o", false, ALIGN_LEFT); break; case 8: if(card->type != H_GWAN) { HGUI_cSet(WHITE, BACKGROUND, BRIGHT); } else { HGUI_cSet(RED, BACKGROUND, DARK); } HGUI_rect(xpos, ypos, xpos+5, ypos+3); HGUI_cSet(WHITE, FOREGROUND, BRIGHT); HGUI_text(xpos+1, ypos+1, "+", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+1, "-", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+1, "+", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+2, "+", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+2, "-", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+2, "+", false, ALIGN_LEFT); HGUI_cSet(BLACK, BACKGROUND, DARK); HGUI_rect(xpos, ypos+3, xpos+5, ypos+5); if(card->type == H_GWAN) { HGUI_text(xpos, ypos+4, "*", false, ALIGN_LEFT); } break; case 9: HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); if(card->type == H_ANIM) { HGUI_cSet(BLUE, BACKGROUND, BRIGHT); HGUI_cSet(BLUE, FOREGROUND, DARK); HGUI_text(xpos, ypos+4, "~", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+4, "~", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+4, "~", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+4, "~", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+4, "~", false, ALIGN_LEFT); HGUI_text(xpos, ypos+3, "~", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+3, "~", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+3, "~", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+3, "~", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+3, "~", false, ALIGN_LEFT); } HGUI_cSet(BLACK, BACKGROUND, DARK); HGUI_cSet(BLACK, FOREGROUND, BRIGHT); HGUI_text(xpos , ypos+4, "o", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+3, "o", false, ALIGN_LEFT); HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_text(xpos+1, ypos+2, "|", false, ALIGN_LEFT); HGUI_cSet(YELLOW, BACKGROUND, BRIGHT); HGUI_cSet(RED, FOREGROUND, DARK); HGUI_text(xpos+1, ypos+4, "*", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+3, "*", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+1, "*", false, ALIGN_LEFT); HGUI_cSet(RED, BACKGROUND, BRIGHT); HGUI_cSet(YELLOW, FOREGROUND, DARK); HGUI_text(xpos+1, ypos+3, "*", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+4, "*", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+1, "*", false, ALIGN_LEFT); break; case 10: HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); HGUI_cSet(RED, FOREGROUND, BRIGHT); HGUI_text(xpos+0, ypos+3, "*", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+2, "*", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+4, "*", false, ALIGN_LEFT); HGUI_cSet(YELLOW, FOREGROUND, DARK); HGUI_text(xpos+2, ypos+3, "*", false, ALIGN_LEFT); HGUI_text(xpos+0, ypos+1, "*", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+2, "*", false, ALIGN_LEFT); HGUI_cSet(RED, FOREGROUND, DARK); HGUI_text(xpos+1, ypos+4, "*", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+3, "*", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+2, "*", false, ALIGN_LEFT); if(card->type == H_ANIM) // Draw Dear { HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_cSet(YELLOW, FOREGROUND, DARK); HGUI_text(xpos, ypos+2, "<", false, ALIGN_LEFT); // Nose HGUI_cSet(YELLOW, BACKGROUND, DARK); HGUI_rect(xpos+1, ypos+3, xpos+4, ypos+4); // Body HGUI_rect(xpos+1, ypos+2, xpos+2, ypos+3); // Head HGUI_cSet(BLACK, FOREGROUND, DARK); HGUI_text(xpos+1, ypos+2, ".", false, ALIGN_LEFT); // Eye HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_cSet(YELLOW, FOREGROUND, DARK); HGUI_text(xpos+1, ypos+4, "| |", false, ALIGN_LEFT); // LEG } break; case 11: if(card->isDouble) { HGUI_cSet(RED, BACKGROUND, DARK); HGUI_rect(xpos, ypos, xpos+5, ypos+5); HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+2); } else { HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); } HGUI_cSet(BLACK, FOREGROUND, DARK); if(card->type == H_GWAN) { HGUI_text(xpos, ypos+4, "*", false, ALIGN_LEFT); } HGUI_text(xpos+1, ypos+1, "|", false, ALIGN_LEFT); // Stem1 if(card->isDouble) { HGUI_cSet(RED, BACKGROUND, DARK); } HGUI_text(xpos+1, ypos+2, "|", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+2, "|", false, ALIGN_LEFT); // Stem2 HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_cSet(BLUE , FOREGROUND, BRIGHT); HGUI_text(xpos+2, ypos+1, "*", false, ALIGN_LEFT); if(card->isDouble) { HGUI_cSet(RED, BACKGROUND, DARK); } HGUI_text(xpos , ypos+2, "*", false, ALIGN_LEFT); HGUI_cSet(BLACK, BACKGROUND, DARK); // Poo HGUI_cSet(BLACK, FOREGROUND, BRIGHT); HGUI_text(xpos+1, ypos+2, "^", false, ALIGN_LEFT); HGUI_text(xpos+0, ypos+3, "<", false, ALIGN_LEFT); HGUI_text(xpos+1, ypos+3, "^", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+3, "^", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+3, ">", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+4, "v", false, ALIGN_LEFT); break; case 12: HGUI_cSet(WHITE, BACKGROUND, BRIGHT); HGUI_rect(xpos, ypos, xpos+5, ypos+5); if(card->type == H_GWAN) { HGUI_cSet(RED, FOREGROUND, BRIGHT); HGUI_text(xpos+2, ypos+2, "o", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+3, "T", false, ALIGN_LEFT); HGUI_text(xpos+2, ypos+4, "^", false, ALIGN_LEFT); } HGUI_cSet(BLACK, FOREGROUND, BRIGHT); HGUI_text(xpos+0, ypos+2, "\\", false, ALIGN_LEFT); // Rain HGUI_text(xpos+1, ypos+1, "\\", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+2, "/", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+3, "/", false, ALIGN_LEFT); HGUI_cSet(BLACK, BACKGROUND, DARK); HGUI_text(xpos+0, ypos+0, "O", false, ALIGN_LEFT); // Cloud Left if(card->type == H_GWAN) { HGUI_cSet(WHITE, FOREGROUND, BRIGHT); HGUI_text(xpos+0, ypos+1, "*", false, ALIGN_LEFT); HGUI_cSet(BLACK, FOREGROUND, BRIGHT); } else { HGUI_text(xpos+0, ypos+1, "O", false, ALIGN_LEFT); } HGUI_text(xpos+1, ypos+0, "O", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+0, "O", false, ALIGN_LEFT); // Cloud Right HGUI_text(xpos+3, ypos+1, "O", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+0, "O", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+1, "O", false, ALIGN_LEFT); HGUI_text(xpos+4, ypos+2, "O", false, ALIGN_LEFT); break; } if(card->type == H_GWAN) { HGUI_cSet(BLACK, BACKGROUND, DARK); HGUI_cSet(WHITE, FOREGROUND, BRIGHT); HGUI_text(xpos, ypos, "GWAN", false, ALIGN_LEFT); } HGUI_cSet(BLACK, BACKGROUND, DARK); HGUI_cSet(RED , FOREGROUND, BRIGHT); HGUI_text(xpos+4, ypos+4, month_string, false, ALIGN_RIGHT); HGUI_cReset(); // Draw DDII //HGUI_rect(xpos, ypos, xpos+5, ypos+5); if(card->type == H_LINE) { switch(card->five_type) { case HF_RED: HGUI_cSet(RED, BACKGROUND, DARK); HGUI_rect(xpos+3, ypos, xpos+4, ypos+3); HGUI_cSet(WHITE, FOREGROUND, BRIGHT); HGUI_text(xpos+3, ypos, "R", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+1, "E", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+2, "D", false, ALIGN_LEFT); break; case HF_BLU: HGUI_cSet(BLUE, BACKGROUND, BRIGHT); HGUI_rect(xpos+3, ypos, xpos+4, ypos+3); HGUI_cSet(WHITE, FOREGROUND, BRIGHT); HGUI_text(xpos+3, ypos, "B", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+1, "L", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+2, "U", false, ALIGN_LEFT); break; case HF_CHO: HGUI_cSet(RED, BACKGROUND, BRIGHT); HGUI_rect(xpos+3, ypos, xpos+4, ypos+3); HGUI_cSet(WHITE, FOREGROUND, BRIGHT); HGUI_text(xpos+3, ypos, "C", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+1, "H", false, ALIGN_LEFT); HGUI_text(xpos+3, ypos+2, "O", false, ALIGN_LEFT); break; case HF_ETC: HGUI_cSet(RED, BACKGROUND, BRIGHT); HGUI_rect(xpos+3, ypos, xpos+4, ypos+3); break; } } HGUI_cReset(); // Draw Card Property // Month char animal_string[5] = {0}; switch(card->type) { case H_ANIM: if(HCard_isBird(card)) { sprintf(animal_string, "BIRD"); } else { sprintf(animal_string, "ANIM"); } HGUI_cSet(YELLOW, FOREGROUND, BRIGHT); HGUI_text(xpos, ypos, animal_string, false, ALIGN_LEFT); HGUI_cReset(); break; } HGUI_cReset(); }