diff options
| author | Starla Insigna <starla4444@gmail.com> | 2013-08-27 11:39:37 -0400 |
|---|---|---|
| committer | Starla Insigna <starla4444@gmail.com> | 2013-08-27 11:39:37 -0400 |
| commit | ffd335aca284c286030e2b26f1a02a0441748f46 (patch) | |
| tree | bcc1c241621fe159ae7ef178122fb41c5f23eb00 /hslist.cpp | |
| parent | d47da18958b5214def5127e201f60668c566d9bb (diff) | |
| download | mazeoflife-ffd335aca284c286030e2b26f1a02a0441748f46.tar.gz mazeoflife-ffd335aca284c286030e2b26f1a02a0441748f46.tar.bz2 mazeoflife-ffd335aca284c286030e2b26f1a02a0441748f46.zip | |
Started rewriting game from scratch with SDL2
Only the title screen is currently implemented
Diffstat (limited to 'hslist.cpp')
| -rw-r--r-- | hslist.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
| diff --git a/hslist.cpp b/hslist.cpp index ec99a77..80e0801 100644 --- a/hslist.cpp +++ b/hslist.cpp | |||
| @@ -1,11 +1,16 @@ | |||
| 1 | #include "includes.h" | 1 | #include "hslist.h" |
| 2 | #include <SDL_ttf.h> | ||
| 3 | #include <SDL_net.h> | ||
| 4 | #include <sstream> | ||
| 5 | #include <fstream> | ||
| 6 | #include "util.h" | ||
| 2 | 7 | ||
| 3 | SDL_Surface* HighscoreList::render() | 8 | SDL_Surface* HighscoreList::render() |
| 4 | { | 9 | { |
| 5 | SDL_Surface* tmp = SDL_CreateRGBSurface(SDL_SWSURFACE || SDL_SRCCOLORKEY, 480, 480, 32, 0,0,0,0); | 10 | SDL_Surface* tmp = SDL_CreateRGBSurface(0, 480, 480, 32, 0,0,0,0); |
| 6 | Uint32 bgColor = SDL_MapRGB(tmp->format, 255, 255, 255); | 11 | Uint32 bgColor = SDL_MapRGB(tmp->format, 255, 255, 255); |
| 7 | SDL_FillRect(tmp, NULL, bgColor); | 12 | SDL_FillRect(tmp, NULL, bgColor); |
| 8 | SDL_SetColorKey(tmp, SDL_SRCCOLORKEY, bgColor); | 13 | SDL_SetColorKey(tmp, SDL_TRUE, bgColor); |
| 9 | TTF_Font* posFont = loadFont(40); | 14 | TTF_Font* posFont = loadFont(40); |
| 10 | TTF_Font* dataFont = loadFont(25); | 15 | TTF_Font* dataFont = loadFont(25); |
| 11 | SDL_Color fontColor = {0, 0, 0, 0}; | 16 | SDL_Color fontColor = {0, 0, 0, 0}; |
| @@ -181,10 +186,10 @@ SDL_Surface* GlobalHighscoreList::render() | |||
| 181 | { | 186 | { |
| 182 | if (fail) | 187 | if (fail) |
| 183 | { | 188 | { |
| 184 | SDL_Surface* tmp = SDL_CreateRGBSurface(SDL_SWSURFACE || SDL_SRCCOLORKEY, 480, 480, 32, 0,0,0,0); | 189 | SDL_Surface* tmp = SDL_CreateRGBSurface(0, 480, 480, 32, 0,0,0,0); |
| 185 | Uint32 bgColor = SDL_MapRGB(tmp->format, 255, 255, 255); | 190 | Uint32 bgColor = SDL_MapRGB(tmp->format, 255, 255, 255); |
| 186 | SDL_FillRect(tmp, NULL, bgColor); | 191 | SDL_FillRect(tmp, NULL, bgColor); |
| 187 | SDL_SetColorKey(tmp, SDL_SRCCOLORKEY, bgColor); | 192 | SDL_SetColorKey(tmp, SDL_TRUE, bgColor); |
| 188 | TTF_Font* dataFont = loadFont(25); | 193 | TTF_Font* dataFont = loadFont(25); |
| 189 | SDL_Color fontColor = {0, 0, 0, 0}; | 194 | SDL_Color fontColor = {0, 0, 0, 0}; |
| 190 | SDL_Surface* text = TTF_RenderText_Blended(dataFont, "Error retrieving highscores", fontColor); | 195 | SDL_Surface* text = TTF_RenderText_Blended(dataFont, "Error retrieving highscores", fontColor); |
