PongHighScores.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. #ifndef __PONGHIGHSCORES__
  5. #define __PONGHIGHSCORES__
  6. #include <stdio.h>
  7. class PongApp;
  8. #define NOF_HIGH_SCORES 7
  9. #define SCORE_DISPLAY_WIDTH 20
  10. #define SCORE_DISPLAY_HEIGHT NOF_HIGH_SCORES
  11. #define SCORE_TAG_CHARACTERS 32
  12. class PongHighScores {
  13. public:
  14. PongHighScores( PongApp *app, unsigned int new_score_entry = 0 );
  15. ~PongHighScores();
  16. void die() { visible = false; }
  17. int update( const float frameTime );
  18. void render();
  19. bool enterCharacter( unsigned char character );
  20. protected:
  21. void buildScreen();
  22. float angle;
  23. bool textInputEnabled;
  24. int newScorePos; // if something else than -1, indicates which line is the new score made into the list
  25. int orderScores(int followPos); // return the position of the followpos
  26. char scoreTags[ NOF_HIGH_SCORES ][SCORE_TAG_CHARACTERS];
  27. unsigned int scores[ NOF_HIGH_SCORES ];
  28. void createDisplayGrid();
  29. float fade;
  30. bool visible;
  31. char displayGrid[SCORE_DISPLAY_HEIGHT][SCORE_DISPLAY_WIDTH];
  32. unsigned char displayGridRandom[SCORE_DISPLAY_HEIGHT][SCORE_DISPLAY_WIDTH];
  33. PongApp *pongApp;
  34. };
  35. #endif