From f694c745f792e82eb20f21f6058279ada5f0fd99 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 5 Apr 2011 13:34:54 +0000 Subject: [PATCH] - winner has a small crown under their name now :) --- source/glest_game/global/core_data.cpp | 4 +++ source/glest_game/global/core_data.h | 3 +++ source/glest_game/main/battle_end.cpp | 34 +++++++++++++++++++++----- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/source/glest_game/global/core_data.cpp b/source/glest_game/global/core_data.cpp index ae18e500..72f3641a 100644 --- a/source/glest_game/global/core_data.cpp +++ b/source/glest_game/global/core_data.cpp @@ -119,6 +119,10 @@ void CoreData::load() { checkedCheckBoxTexture->setForceCompressionDisabled(true); checkedCheckBoxTexture->getPixmap()->load(dir+"/menu/textures/checkbox_checked.tga"); + gameWinnerTexture= renderer.newTexture2D(rsGlobal); + gameWinnerTexture->setForceCompressionDisabled(true); + gameWinnerTexture->getPixmap()->load(dir+"/misc_textures/game_winner.png"); + //display font Config &config= Config::getInstance(); string displayFontNamePrefix=config.getString("FontDisplayPrefix"); diff --git a/source/glest_game/global/core_data.h b/source/glest_game/global/core_data.h index c24f0b34..1a42005a 100644 --- a/source/glest_game/global/core_data.h +++ b/source/glest_game/global/core_data.h @@ -58,6 +58,7 @@ private: Texture2D *verticalLineTexture; Texture2D *checkBoxTexture; Texture2D *checkedCheckBoxTexture; + Texture2D *gameWinnerTexture; Font2D *displayFont; Font2D *menuFontNormal; @@ -85,6 +86,8 @@ public: Texture2D *getCheckBoxTexture() const {return checkBoxTexture;} Texture2D *getCheckedCheckBoxTexture() const {return checkedCheckBoxTexture;} + Texture2D *getGameWinnerTexture() const {return gameWinnerTexture;} + size_t getLogoTextureExtraCount() const {return logoTextureList.size();} Texture2D *getLogoTextureExtra(int idx) const {return logoTextureList[idx];} diff --git a/source/glest_game/main/battle_end.cpp b/source/glest_game/main/battle_end.cpp index 6a3ed456..312862c9 100644 --- a/source/glest_game/main/battle_end.cpp +++ b/source/glest_game/main/battle_end.cpp @@ -79,13 +79,30 @@ void BattleEnd::render(){ renderer.reset2d(); renderer.renderBackground(CoreData::getInstance().getBackgroundTexture()); + int winnerIndex = -1; + int bestScore = -1; + for(int i=0; i bestScore) { + bestScore = score; + winnerIndex = i; + } + } + textRenderer->begin(CoreData::getInstance().getMenuFontNormal()); int lm= 20; int bm= 100; - for(int i=0; irender(stats.getPlayerName(i).c_str(), textX, bm+400, false, &color); } else { - textRenderer->render((lang.get("Player")+" "+intToStr(i+1)).c_str(), textX, bm+400,false, &color); + textRenderer->render((lang.get("Player") + " " + intToStr(i+1)).c_str(), textX, bm+400,false, &color); } if(stats.getPersonalityType(i) == fpt_Observer) {