RIP domestic manners

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4535 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-01-24 23:57:50 +00:00
parent c2b2a74e28
commit 998cc50ed0
6 changed files with 23 additions and 18 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -173,8 +173,8 @@ void IrrDriver::initDevice()
// true); // true);
m_gui_env = m_device->getGUIEnvironment(); m_gui_env = m_device->getGUIEnvironment();
m_video_driver = m_device->getVideoDriver(); m_video_driver = m_device->getVideoDriver();
const std::string &font = file_manager->getFontFile("DomesticManners.xml"); //const std::string &font = file_manager->getFontFile("DomesticManners.xml");
m_race_font = m_gui_env->getFont(font.c_str()); //m_race_font = m_gui_env->getFont(font.c_str());
#if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR >= 7) #if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR >= 7)
video::SMaterial& material2D = m_video_driver->getMaterial2D(); video::SMaterial& material2D = m_video_driver->getMaterial2D();
@ -683,7 +683,7 @@ void IrrDriver::renderBulletDebugView()
*/ */
void IrrDriver::displayFPS() void IrrDriver::displayFPS()
{ {
gui::IGUIFont* font = getRaceFont(); gui::IGUIFont* font = GUIEngine::getFont();
const int fps = m_device->getVideoDriver()->getFPS(); const int fps = m_device->getVideoDriver()->getFPS();
// Min and max info tracking, per mode, so user can check game vs menus // Min and max info tracking, per mode, so user can check game vs menus

View File

@ -78,7 +78,7 @@ public:
scene::IMesh *getMesh(const std::string &name); scene::IMesh *getMesh(const std::string &name);
/** Returns the gui environment, used to add widgets to a screen. */ /** Returns the gui environment, used to add widgets to a screen. */
gui::IGUIEnvironment *getGUI() const { return m_gui_env; } gui::IGUIEnvironment *getGUI() const { return m_gui_env; }
irr::gui::IGUIFont *getRaceFont() const { return m_race_font; } //irr::gui::IGUIFont *getRaceFont() const { return m_race_font; }
bool OnEvent(const irr::SEvent &event); bool OnEvent(const irr::SEvent &event);
void setAmbientLight(const video::SColor &light); void setAmbientLight(const video::SColor &light);
video::ITexture *getTexture(const std::string &filename); video::ITexture *getTexture(const std::string &filename);

View File

@ -28,6 +28,7 @@ using namespace irr;
#include "graphics/camera.hpp" #include "graphics/camera.hpp"
#include "graphics/irr_driver.hpp" #include "graphics/irr_driver.hpp"
#include "graphics/material_manager.hpp" #include "graphics/material_manager.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/modaldialog.hpp" #include "guiengine/modaldialog.hpp"
#include "io/file_manager.hpp" #include "io/file_manager.hpp"
#include "input/input.hpp" #include "input/input.hpp"
@ -277,7 +278,7 @@ void RaceGUI::drawGlobalTimer()
pos += core::vector2d<s32>(0, UserConfigParams::m_height/2); pos += core::vector2d<s32>(0, UserConfigParams::m_height/2);
} }
gui::IGUIFont* font = irr_driver->getRaceFont(); gui::IGUIFont* font = GUIEngine::getFont();
font->draw(sw.c_str(), pos, time_color); font->draw(sw.c_str(), pos, time_color);
} // DRAWGLOBALTimer } // DRAWGLOBALTimer
@ -345,7 +346,7 @@ void RaceGUI::drawGlobalPlayerIcons(const KartIconDisplayInfo* info)
ICON_PLAYER_WIDTH = 35; ICON_PLAYER_WIDTH = 35;
} }
gui::IGUIFont* font = irr_driver->getRaceFont(); gui::IGUIFont* font = GUIEngine::getFont();
const unsigned int kart_amount = race_manager->getNumKarts(); const unsigned int kart_amount = race_manager->getNumKarts();
for(unsigned int i = 0; i < kart_amount ; i++) for(unsigned int i = 0; i < kart_amount ; i++)
{ {
@ -517,7 +518,7 @@ void RaceGUI::drawSpeed(Kart* kart, const core::recti &viewport,
offset.Y-(int)(10*minRatio), offset.Y-(int)(10*minRatio),
offset.X-(int)(30*minRatio), offset.X-(int)(30*minRatio),
offset.Y-(int)(10*minRatio) ); offset.Y-(int)(10*minRatio) );
irr_driver->getRaceFont()->draw(core::stringw("!").c_str(), pos, color); GUIEngine::getFont()->draw(core::stringw("!").c_str(), pos, color);
} }
const float speed = kart->getSpeed(); const float speed = kart->getSpeed();
@ -590,9 +591,9 @@ void RaceGUI::drawLap(const KartIconDisplayInfo* info, Kart* kart,
pos.UpperLeftCorner.X = viewport.UpperLeftCorner.X pos.UpperLeftCorner.X = viewport.UpperLeftCorner.X
+ (int)(0.15f*UserConfigParams::m_width*scaling.X); + (int)(0.15f*UserConfigParams::m_width*scaling.X);
pos.UpperLeftCorner.Y = viewport.LowerRightCorner.Y; pos.UpperLeftCorner.Y = viewport.LowerRightCorner.Y;
gui::IGUIFont* font = irr_driver->getRaceFont(); gui::IGUIFont* font = GUIEngine::getFont();
int font_height = (int)(60*scaling.Y); int font_height = (int)(font->getDimension(L"X").Height*scaling.Y);
if(kart->hasFinishedRace()) if (kart->hasFinishedRace())
{ {
static video::SColor color = video::SColor(255, 255, 255, 255); static video::SColor color = video::SColor(255, 255, 255, 255);
pos.UpperLeftCorner.Y -= 2*font_height; pos.UpperLeftCorner.Y -= 2*font_height;
@ -659,7 +660,7 @@ void RaceGUI::drawAllMessages(Kart* player_kart,
if( msg.m_kart && msg.m_kart!=player_kart) continue; if( msg.m_kart && msg.m_kart!=player_kart) continue;
core::rect<s32> pos(x, y, x, y); core::rect<s32> pos(x, y, x, y);
irr_driver->getRaceFont()->draw(core::stringw(msg.m_message.c_str()).c_str(), GUIEngine::getFont()->draw(core::stringw(msg.m_message.c_str()).c_str(),
pos, msg.m_color, true, true); pos, msg.m_color, true, true);
y+=40; y+=40;
} // for i in all messages } // for i in all messages
@ -683,7 +684,7 @@ void RaceGUI::drawGlobalMusicDescription()
{ {
if (!UserConfigParams::m_music) return; // show no music description when it's off if (!UserConfigParams::m_music) return; // show no music description when it's off
gui::IGUIFont* font = irr_driver->getRaceFont(); gui::IGUIFont* font = GUIEngine::getFont();
// ---- Manage pulsing effect // ---- Manage pulsing effect
// 3.0 is the duration of ready/set (TODO: don't hardcode) // 3.0 is the duration of ready/set (TODO: don't hardcode)
@ -778,29 +779,33 @@ void RaceGUI::drawGlobalReadySetGo()
{ {
case READY_PHASE: case READY_PHASE:
{ {
static video::SColor color = video::SColor(255, 230, 168, 158); //static video::SColor color = video::SColor(255, 230, 168, 158);
static video::SColor color = video::SColor(255, 255, 255, 255);
core::rect<s32> pos(UserConfigParams::m_width>>1, UserConfigParams::m_height>>1, core::rect<s32> pos(UserConfigParams::m_width>>1, UserConfigParams::m_height>>1,
UserConfigParams::m_width>>1, UserConfigParams::m_height>>1); UserConfigParams::m_width>>1, UserConfigParams::m_height>>1);
gui::IGUIFont* font = irr_driver->getRaceFont(); gui::IGUIFont* font = GUIEngine::getTitleFont();
font->draw(m_string_ready.c_str(), pos, color, true, true); font->draw(m_string_ready.c_str(), pos, color, true, true);
} }
break; break;
case SET_PHASE: case SET_PHASE:
{ {
static video::SColor color = video::SColor(255, 230, 230, 158); //static video::SColor color = video::SColor(255, 230, 230, 158);
static video::SColor color = video::SColor(255, 255, 255, 255);
core::rect<s32> pos(UserConfigParams::m_width>>1, UserConfigParams::m_height>>1, core::rect<s32> pos(UserConfigParams::m_width>>1, UserConfigParams::m_height>>1,
UserConfigParams::m_width>>1, UserConfigParams::m_height>>1); UserConfigParams::m_width>>1, UserConfigParams::m_height>>1);
gui::IGUIFont* font = irr_driver->getRaceFont(); gui::IGUIFont* font = GUIEngine::getTitleFont();
//I18N: as in "ready, set, go", shown at the beginning of the race //I18N: as in "ready, set, go", shown at the beginning of the race
font->draw(m_string_set.c_str(), pos, color, true, true); font->draw(m_string_set.c_str(), pos, color, true, true);
} }
break; break;
case GO_PHASE: case GO_PHASE:
{ {
static video::SColor color = video::SColor(255, 100, 209, 100); //static video::SColor color = video::SColor(255, 100, 209, 100);
static video::SColor color = video::SColor(255, 255, 255, 255);
core::rect<s32> pos(UserConfigParams::m_width>>1, UserConfigParams::m_height>>1, core::rect<s32> pos(UserConfigParams::m_width>>1, UserConfigParams::m_height>>1,
UserConfigParams::m_width>>1, UserConfigParams::m_height>>1); UserConfigParams::m_width>>1, UserConfigParams::m_height>>1);
gui::IGUIFont* font = irr_driver->getRaceFont(); //gui::IGUIFont* font = irr_driver->getRaceFont();
gui::IGUIFont* font = GUIEngine::getTitleFont();
//I18N: as in "ready, set, go", shown at the beginning of the race //I18N: as in "ready, set, go", shown at the beginning of the race
font->draw(m_string_go.c_str(), pos, color, true, true); font->draw(m_string_go.c_str(), pos, color, true, true);
} }