git repos / blockattack-game

commit de766069

sago007 · 2017-11-27 14:09
de766069d9d0a79f398a9edc4f9b66df9a525875 patch · browse files
parent 0491865722d813f71bb8fb8318a00e5ae8902e75

Changed the score display to use the font wrapper rather than NFont directly

Changed files

M source/code/BlockGameSdl.inc before
M source/code/global.hpp before
M source/code/main.cpp before
diff --git a/source/code/BlockGameSdl.inc b/source/code/BlockGameSdl.inc index 66db8ee..bda9d6d 100644 --- a/source/code/BlockGameSdl.inc +++ b/source/code/BlockGameSdl.inc
@@ -290,10 +290,10 @@ public:
void DoPaintJob() {
DrawIMG(boardBackBack,globalData.screen,this->GetTopX()-60,this->GetTopY()-68);
- globalData.nf_scoreboard_font.draw(globalData.screen, this->GetTopX()+310,this->GetTopY()-68+148,_("Score:") );
- globalData.nf_scoreboard_font.draw(globalData.screen, this->GetTopX()+310,this->GetTopY()-68+197,_("Time:") );
- globalData.nf_scoreboard_font.draw(globalData.screen, this->GetTopX()+310,this->GetTopY()-68+246,_("Chain:") );
- globalData.nf_scoreboard_font.draw(globalData.screen, this->GetTopX()+310,this->GetTopY()-68+295,_("Speed:") );
+ globalData.scoreboard_font.draw(globalData.screen, this->GetTopX()+310,this->GetTopY()-68+148,_("Score:") );
+ globalData.scoreboard_font.draw(globalData.screen, this->GetTopX()+310,this->GetTopY()-68+197,_("Time:") );
+ globalData.scoreboard_font.draw(globalData.screen, this->GetTopX()+310,this->GetTopY()-68+246,_("Chain:") );
+ globalData.scoreboard_font.draw(globalData.screen, this->GetTopX()+310,this->GetTopY()-68+295,_("Speed:") );
DrawImgBoard(backBoard, 0, 0);
PaintBricks();
diff --git a/source/code/global.hpp b/source/code/global.hpp index c8af0b0..d0117a1 100644 --- a/source/code/global.hpp +++ b/source/code/global.hpp
@@ -54,7 +54,7 @@ struct GlobalData {
sago::SagoSprite iLevelCheckBox;
sago::SagoSprite iLevelCheckBoxMarked;
sago::SagoSprite iCheckBoxArea;
- NFont nf_scoreboard_font;
+ FontWrapper scoreboard_font;
NFont nf_standard_blue_font;
FontWrapper button_font;
bool MusicEnabled; //true if background music is enabled
diff --git a/source/code/main.cpp b/source/code/main.cpp index 7f7e7e1..670aa58 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp
@@ -198,7 +198,7 @@ static int InitImages(sago::SagoSpriteHolder& holder) {
globalData.button_font.load(globalData.screen, holder.GetDataHolder().getFontPtr("freeserif", 24), nf_button_color);
globalData.nf_standard_blue_font.load(globalData.screen, holder.GetDataHolder().getFontPtr("freeserif", 30), nf_standard_blue_color);
nf_standard_small_font.load(globalData.screen, holder.GetDataHolder().getFontPtr("freeserif", 16), nf_standard_small_color);
- globalData.nf_scoreboard_font.load(globalData.screen, holder.GetDataHolder().getFontPtr("penguinattack", 20), nf_button_color);
+ globalData.scoreboard_font.load(globalData.screen, holder.GetDataHolder().getFontPtr("penguinattack", 20), nf_button_color);
//Loads the sound if sound present
if (!globalData.NoSound) {