From: <tz...@us...> - 2007-07-21 02:52:05
|
Revision: 2186 http://svn.sourceforge.net/freeorion/revision/?rev=2186&view=rev Author: tzlaine Date: 2007-07-20 19:52:07 -0700 (Fri, 20 Jul 2007) Log Message: ----------- Changed the splash screen to use the new background and logo provided by eleazzaar. This fixes the problem of the logo portion of the splash screen becoming too stretched out when running on widescreen displays. Modified Paths: -------------- trunk/FreeOrion/SConscript trunk/FreeOrion/UI/IntroScreen.cpp trunk/FreeOrion/UI/IntroScreen.h trunk/FreeOrion/UI/TurnProgressWnd.cpp trunk/FreeOrion/UI/TurnProgressWnd.h Added Paths: ----------- trunk/FreeOrion/default/data/art/logo.png trunk/FreeOrion/default/data/art/splash.png Removed Paths: ------------- trunk/FreeOrion/UI/Splash.cpp trunk/FreeOrion/UI/Splash.h trunk/FreeOrion/default/data/art/fo_logo.png trunk/FreeOrion/default/data/art/splash.jpg trunk/FreeOrion/default/data/art/splash00.png trunk/FreeOrion/default/data/art/splash01.png trunk/FreeOrion/default/data/art/splash02.png trunk/FreeOrion/default/data/art/splash10.png trunk/FreeOrion/default/data/art/splash11.png trunk/FreeOrion/default/data/art/splash12.png Modified: trunk/FreeOrion/SConscript =================================================================== --- trunk/FreeOrion/SConscript 2007-07-21 00:45:35 UTC (rev 2185) +++ trunk/FreeOrion/SConscript 2007-07-21 02:52:07 UTC (rev 2186) @@ -112,7 +112,6 @@ 'UI/ServerConnectWnd.cpp', 'UI/SidePanel.cpp', 'UI/SitRepPanel.cpp', - 'UI/Splash.cpp', 'UI/SystemIcon.cpp', 'UI/TechTreeWnd.cpp', 'UI/TurnProgressWnd.cpp', Modified: trunk/FreeOrion/UI/IntroScreen.cpp =================================================================== --- trunk/FreeOrion/UI/IntroScreen.cpp 2007-07-21 00:45:35 UTC (rev 2185) +++ trunk/FreeOrion/UI/IntroScreen.cpp 2007-07-21 02:52:07 UTC (rev 2186) @@ -11,7 +11,6 @@ #include "../util/MultiplayerCommon.h" #include "OptionsWnd.h" #include "../util/OptionsDB.h" -#include "Splash.h" #include "../util/Serialize.h" #include "../util/Version.h" @@ -139,9 +138,16 @@ static_cast<int>(GG::GUI::GetGUI()->AppWidth() * GetOptionsDB().Get<double>("UI.main-menu.x") - MAIN_MENU_WIDTH / 2), static_cast<int>(GG::GUI::GetGUI()->AppWidth() * GetOptionsDB().Get<double>("UI.main-menu.y") - MAIN_MENU_HEIGHT / 2), MAIN_MENU_WIDTH, MAIN_MENU_HEIGHT, GG::ONTOP | GG::CLICKABLE), - m_credits_wnd(0) + m_credits_wnd(0), + m_splash(new GG::StaticGraphic(0, 0, GG::GUI::GetGUI()->AppWidth(), GG::GUI::GetGUI()->AppHeight(), + ClientUI::GetTexture(ClientUI::ArtDir() / "splash.png"), + GG::GR_FITGRAPHIC)), + m_logo(new GG::StaticGraphic(0, 0, GG::GUI::GetGUI()->AppWidth(), GG::GUI::GetGUI()->AppHeight() / 10, + ClientUI::GetTexture(ClientUI::ArtDir() / "logo.png"), + GG::GR_FITGRAPHIC | GG::GR_PROPSCALE)) { - LoadSplashGraphics(m_bg_graphics); + GG::GUI::GetGUI()->Register(m_splash); + GG::GUI::GetGUI()->Register(m_logo); //create buttons m_single_player = new CUIButton(15, 12, 160, UserString("INTRO_BTN_SINGLE_PLAYER")); @@ -173,12 +179,9 @@ IntroScreen::~IntroScreen() { - for (unsigned int y = 0; y < m_bg_graphics.size(); ++y) { - for (unsigned int x = 0; x < m_bg_graphics[y].size(); ++x) { - delete m_bg_graphics[y][x]; - } - } delete m_credits_wnd; + delete m_logo; + delete m_splash; } void IntroScreen::OnSinglePlayer() Modified: trunk/FreeOrion/UI/IntroScreen.h =================================================================== --- trunk/FreeOrion/UI/IntroScreen.h 2007-07-21 00:45:35 UTC (rev 2185) +++ trunk/FreeOrion/UI/IntroScreen.h 2007-07-21 02:52:07 UTC (rev 2186) @@ -54,7 +54,8 @@ CreditsWnd* m_credits_wnd; - std::vector<std::vector<GG::StaticGraphic*> > m_bg_graphics; + GG::StaticGraphic* m_splash; + GG::StaticGraphic* m_logo; }; #endif // _IntroScreen_h_ Deleted: trunk/FreeOrion/UI/Splash.cpp =================================================================== --- trunk/FreeOrion/UI/Splash.cpp 2007-07-21 00:45:35 UTC (rev 2185) +++ trunk/FreeOrion/UI/Splash.cpp 2007-07-21 02:52:07 UTC (rev 2186) @@ -1,42 +0,0 @@ -#include "Splash.h" - -#include "ClientUI.h" -#include "../util/MultiplayerCommon.h" - -#include <GG/GUI.h> -#include <GG/StaticGraphic.h> - - -void LoadSplashGraphics(std::vector<std::vector<GG::StaticGraphic*> >& graphics) -{ - const int IMAGE_CELLS_X = 3; - const int IMAGE_CELLS_Y = 2; - int total_width = 0; - int total_height = 0; - std::vector<std::vector<boost::shared_ptr<GG::Texture> > > textures(IMAGE_CELLS_Y, std::vector<boost::shared_ptr<GG::Texture> >(IMAGE_CELLS_X)); - for (int y = 0; y < IMAGE_CELLS_Y; ++y) { - for (int x = 0; x < IMAGE_CELLS_X; ++x) { - textures[y][x] = ClientUI::GetTexture(ClientUI::ArtDir() / ("splash" + boost::lexical_cast<std::string>(y) + boost::lexical_cast<std::string>(x) + ".png")); - if (!y) - total_width += textures[0][x]->DefaultWidth(); - } - total_height += textures[y][0]->DefaultHeight(); - } - double x_scale_factor = GG::GUI::GetGUI()->AppWidth() / static_cast<double>(total_width); - double y_scale_factor = GG::GUI::GetGUI()->AppHeight() / static_cast<double>(total_height); - - int graphic_position_x = 0; - int graphic_position_y = 0; - graphics.resize(IMAGE_CELLS_Y, std::vector<GG::StaticGraphic*>(IMAGE_CELLS_X)); - for (int y = 0; y < IMAGE_CELLS_Y; ++y) { - int height = static_cast<int>(textures[y][0]->DefaultHeight() * y_scale_factor); - graphic_position_x = 0; - for (int x = 0; x < IMAGE_CELLS_X; ++x) { - int width = static_cast<int>(textures[0][x]->DefaultWidth() * x_scale_factor); - graphics[y][x] = new GG::StaticGraphic(graphic_position_x, graphic_position_y, width, height, textures[y][x], GG::GR_FITGRAPHIC); - GG::GUI::GetGUI()->Register(graphics[y][x]); - graphic_position_x += width; - } - graphic_position_y += height; - } -} Deleted: trunk/FreeOrion/UI/Splash.h =================================================================== --- trunk/FreeOrion/UI/Splash.h 2007-07-21 00:45:35 UTC (rev 2185) +++ trunk/FreeOrion/UI/Splash.h 2007-07-21 02:52:07 UTC (rev 2186) @@ -1,16 +0,0 @@ -// -*- C++ -*- -#ifndef _Splash_h_ -#define _Splash_h_ - -#include <string> -#include <vector> - -namespace GG { - class StaticGraphic; -} - -/** Loads a set of StaticGraphics that display the splash screen in chunks no larger than 512x512, to be friendly on - minimal GL implementations. */ -void LoadSplashGraphics(std::vector<std::vector<GG::StaticGraphic*> >& graphics); - -#endif // _Splash_h_ Modified: trunk/FreeOrion/UI/TurnProgressWnd.cpp =================================================================== --- trunk/FreeOrion/UI/TurnProgressWnd.cpp 2007-07-21 00:45:35 UTC (rev 2185) +++ trunk/FreeOrion/UI/TurnProgressWnd.cpp 2007-07-21 02:52:07 UTC (rev 2186) @@ -3,7 +3,6 @@ #include "CUIControls.h" #include "../client/human/HumanClientApp.h" #include "../util/MultiplayerCommon.h" -#include "Splash.h" #include "../Empire/Empire.h" #include <GG/DrawUtil.h> @@ -21,11 +20,18 @@ //////////////////////////////////////////////// TurnProgressWnd::TurnProgressWnd() : GG::Wnd(0, (GG::GUI::GetGUI()->AppHeight() - PROGRESS_WND_HEIGHT) / 2, - GG::GUI::GetGUI()->AppWidth(), PROGRESS_WND_HEIGHT, GG::ONTOP | GG::CLICKABLE) + GG::GUI::GetGUI()->AppWidth(), PROGRESS_WND_HEIGHT, GG::ONTOP | GG::CLICKABLE), + m_splash(new GG::StaticGraphic(0, 0, GG::GUI::GetGUI()->AppWidth(), GG::GUI::GetGUI()->AppHeight(), + ClientUI::GetTexture(ClientUI::ArtDir() / "splash.png"), + GG::GR_FITGRAPHIC)), + m_logo(new GG::StaticGraphic(0, 0, GG::GUI::GetGUI()->AppWidth(), GG::GUI::GetGUI()->AppHeight() / 10, + ClientUI::GetTexture(ClientUI::ArtDir() / "logo.png"), + GG::GR_FITGRAPHIC | GG::GR_PROPSCALE)) { SetText(UserString("TURN_PROGRESS_WND")); - LoadSplashGraphics(m_bg_graphics); + GG::GUI::GetGUI()->Register(m_splash); + GG::GUI::GetGUI()->Register(m_logo); m_phase_text = new GG::TextControl(0, 20, Width(), ClientUI::Pts() * 2 + 4, "", GG::GUI::GetGUI()->GetFont(ClientUI::Font(), ClientUI::Pts() * 2), ClientUI::TextColor(), GG::TF_CENTER | GG::TF_VCENTER); m_empire_text = new GG::TextControl(0, 50, Width(), ClientUI::Pts() * 2 + 4, "", GG::GUI::GetGUI()->GetFont(ClientUI::Font(), ClientUI::Pts() * 2), ClientUI::TextColor(), GG::TF_CENTER | GG::TF_VCENTER); @@ -36,11 +42,8 @@ TurnProgressWnd::~TurnProgressWnd() { - for (unsigned int y = 0; y < m_bg_graphics.size(); ++y) { - for (unsigned int x = 0; x < m_bg_graphics[y].size(); ++x) { - delete m_bg_graphics[y][x]; - } - } + delete m_logo; + delete m_splash; } void TurnProgressWnd::Render() Modified: trunk/FreeOrion/UI/TurnProgressWnd.h =================================================================== --- trunk/FreeOrion/UI/TurnProgressWnd.h 2007-07-21 00:45:35 UTC (rev 2185) +++ trunk/FreeOrion/UI/TurnProgressWnd.h 2007-07-21 02:52:07 UTC (rev 2186) @@ -26,7 +26,8 @@ private: GG::TextControl* m_phase_text; GG::TextControl* m_empire_text; - std::vector<std::vector<GG::StaticGraphic*> > m_bg_graphics; + GG::StaticGraphic* m_splash; + GG::StaticGraphic* m_logo; }; #endif // _TurnProgressWnd_h_ Deleted: trunk/FreeOrion/default/data/art/fo_logo.png =================================================================== (Binary files differ) Copied: trunk/FreeOrion/default/data/art/logo.png (from rev 2183, trunk/FreeOrion/default/data/art/fo_logo.png) =================================================================== (Binary files differ) Deleted: trunk/FreeOrion/default/data/art/splash.jpg =================================================================== (Binary files differ) Added: trunk/FreeOrion/default/data/art/splash.png =================================================================== (Binary files differ) Property changes on: trunk/FreeOrion/default/data/art/splash.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/FreeOrion/default/data/art/splash00.png =================================================================== (Binary files differ) Deleted: trunk/FreeOrion/default/data/art/splash01.png =================================================================== (Binary files differ) Deleted: trunk/FreeOrion/default/data/art/splash02.png =================================================================== (Binary files differ) Deleted: trunk/FreeOrion/default/data/art/splash10.png =================================================================== (Binary files differ) Deleted: trunk/FreeOrion/default/data/art/splash11.png =================================================================== (Binary files differ) Deleted: trunk/FreeOrion/default/data/art/splash12.png =================================================================== (Binary files differ) |