SHARE
TWEET

Untitled

a guest Jun 19th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*  render.h
  2.  *  header for handling all screen renders
  3.  *  dependent on ansi.h for console prints
  4.  *  (optional) dependent on led.h for led-display prints
  5.  */
  6. #include "ansi.h"
  7. #include "window.h"
  8.  
  9. #ifndef _RENDER_H
  10. #define _RENDER_H
  11.  
  12. #define MENU_MAIN       0x01
  13. #define MENU_PLAY       0x02
  14. #define MENU_SETTINGS   0x03
  15. #define MENU_HIGHSCORE  0x04
  16. #define MENU_ABOUT      0x05
  17.  
  18. #define LEVEL_TEXT_LINES        12
  19. #defime MAX_TEXT_BUFFER_SIZE    64
  20.  
  21.  
  22. static char text_buffer[MAX_TEXT_BUFFER_SIZE];
  23. // Render Striker
  24.  
  25. void render_striker(struct Striker s) {
  26.     // put what to do here
  27.  
  28. }
  29.  
  30. // Render Ball
  31.  
  32. void render_ball(struct Ball b) {
  33.     // put what to do here
  34.  
  35. }
  36.  
  37. // Render Map
  38. void render_map(struct Box level[]) {
  39.     // put whatever here
  40. }
  41.  
  42. // Render Menu
  43. void render_menu(char menu) {
  44.  
  45.     switch (menu) {
  46.         case (MENU_MAIN) :
  47.             // Do stuff to render main-menu
  48.  
  49.             break;
  50.         case (MENU_PLAY) :
  51.             // Do stuff to render play-menu (submenu)
  52.  
  53.             break;
  54.         case (MENU_SETTINGS) :
  55.             // Do stuff to render settings-menu (submenu)
  56.  
  57.             break;
  58.         case (MENU_HIGHSCORE) :
  59.             // Do stuff to render highscore-menu (submenu)
  60.  
  61.             break;
  62.         case (MENU_ABOUT) :
  63.             // Do stuff to render about-menu (submenu)
  64.  
  65.             break;
  66.         default :
  67.             printf("Menu Error.");
  68.             break;
  69.     }
  70. }
  71.  
  72. void render_levelsplash(char level,char x, char y) {
  73.     char i;
  74.     gotoxy(x,y);
  75.     savePos();
  76.     // put level render here
  77.     for (i = 0; i < LEVEL_TEXT_LINES; i++) {
  78.         ROMtoRAM(text_buffer,level_ascii[i]);
  79.         newLine(i);
  80.         printArray(text_buffer);
  81.         ROMroRAM(text_buffer,numbers_ascii[level][i]);
  82.     }
  83.     malloc(sizeof(int));
  84. }
  85.  
  86.  
  87.  
  88. #endif //_RENDER_H
RAW Paste Data
Top