summary refs log tree commit diff stats
path: root/hslist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'hslist.cpp')
-rw-r--r--hslist.cpp15
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
3SDL_Surface* HighscoreList::render() 8SDL_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);