1) Updated project file for latest changes.

2) Removed compiler warnings.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4270 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2009-12-07 00:45:49 +00:00
parent 22d233b46c
commit bf5f9bb050
4 changed files with 30 additions and 22 deletions

View File

@ -572,7 +572,7 @@ void ScalableFont::draw(const core::stringw& text, const core::rect<s32>& positi
offsets.push_back(offset);
}
offset.X += (area.width + area.overhang + GlobalKerningWidth) * m_scale;
offset.X += (int)((area.width + area.overhang + GlobalKerningWidth) * m_scale);
}
//SpriteBank->draw2DSpriteBatch(indices, offsets, clip, color);

View File

@ -589,12 +589,12 @@ void Skin::drawButton(Widget* w, const core::rect< s32 > &rect, const bool press
{
core::rect< s32 > sized_rect = rect;
core::position2d<u32> center = core::position2d<u32>(irr_driver->getFrameSize()/2);
const float size = sin(m_dialog_size*M_PI_2);
const float size = sin(m_dialog_size*M_PI*0.5f);
sized_rect.UpperLeftCorner.X = center.X + (int)(rect.UpperLeftCorner.X - center.X)*size;
sized_rect.UpperLeftCorner.Y = center.Y + (int)(rect.UpperLeftCorner.Y - center.Y)*size;
sized_rect.LowerRightCorner.X = center.X + (int)(rect.LowerRightCorner.X - center.X)*size;
sized_rect.LowerRightCorner.Y = center.Y + (int)(rect.LowerRightCorner.Y - center.Y)*size;
sized_rect.UpperLeftCorner.X = center.X + (int)((rect.UpperLeftCorner.X - center.X)*size);
sized_rect.UpperLeftCorner.Y = center.Y + (int)((rect.UpperLeftCorner.Y - center.Y)*size);
sized_rect.LowerRightCorner.X = center.X + (int)((rect.LowerRightCorner.X - center.X)*size);
sized_rect.LowerRightCorner.Y = center.Y + (int)((rect.LowerRightCorner.Y - center.Y)*size);
if (focused)
drawBoxFromStretchableTexture(w, sized_rect, SkinConfig::m_render_params["button::focused"]);
@ -1140,12 +1140,12 @@ void Skin::draw3DSunkenPane (IGUIElement *element, video::SColor bgcolor, bool f
if (m_dialog && m_dialog_size < 1.0f && widget->m_parent != NULL && widget->m_parent->getType() == gui::EGUIET_WINDOW)
{
core::position2d<u32> center = core::position2d<u32>(irr_driver->getFrameSize()/2);
const float size = sin(m_dialog_size*M_PI_2);
const float size = sin(m_dialog_size*M_PI*0.5f);
borderArea.UpperLeftCorner.X = center.X + (int)(rect.UpperLeftCorner.X - center.X)*size;
borderArea.UpperLeftCorner.Y = center.Y + (int)(rect.UpperLeftCorner.Y - center.Y)*size;
borderArea.LowerRightCorner.X = center.X + (int)(rect.LowerRightCorner.X - center.X)*size;
borderArea.LowerRightCorner.Y = center.Y + (int)(rect.LowerRightCorner.Y - center.Y)*size;
borderArea.UpperLeftCorner.X = center.X + (int)((rect.UpperLeftCorner.X - center.X)*size);
borderArea.UpperLeftCorner.Y = center.Y + (int)((rect.UpperLeftCorner.Y - center.Y)*size);
borderArea.LowerRightCorner.X = center.X + (int)((rect.LowerRightCorner.X - center.X)*size);
borderArea.LowerRightCorner.Y = center.Y + (int)((rect.LowerRightCorner.Y - center.Y)*size);
}
GUIEngine::getDriver()->draw2DRectangle( colorFocus, borderArea );
@ -1160,12 +1160,12 @@ void Skin::draw3DSunkenPane (IGUIElement *element, video::SColor bgcolor, bool f
if (m_dialog && m_dialog_size < 1.0f && widget->m_parent != NULL && widget->m_parent->getType() == gui::EGUIET_WINDOW)
{
core::position2d<u32> center = core::position2d<u32>(irr_driver->getFrameSize()/2);
const float size = sin(m_dialog_size*M_PI_2);
const float size = sin(m_dialog_size*M_PI*0.5f);
core::rect< s32 > sizedRect;
sizedRect.UpperLeftCorner.X = center.X + (int)(rect.UpperLeftCorner.X - center.X)*size;
sizedRect.UpperLeftCorner.Y = center.Y + (int)(rect.UpperLeftCorner.Y - center.Y)*size;
sizedRect.LowerRightCorner.X = center.X + (int)(rect.LowerRightCorner.X - center.X)*size;
sizedRect.LowerRightCorner.Y = center.Y + (int)(rect.LowerRightCorner.Y - center.Y)*size;
sizedRect.UpperLeftCorner.X = center.X + (int)((rect.UpperLeftCorner.X - center.X)*size);
sizedRect.UpperLeftCorner.Y = center.Y + (int)((rect.UpperLeftCorner.Y - center.Y)*size);
sizedRect.LowerRightCorner.X = center.X + (int)((rect.LowerRightCorner.X - center.X)*size);
sizedRect.LowerRightCorner.Y = center.Y + (int)((rect.LowerRightCorner.Y - center.Y)*size);
GUIEngine::getDriver()->draw2DRectangle( color, sizedRect );
}
else
@ -1190,7 +1190,7 @@ void Skin::drawBGFadeColor()
{
// fade out background
SColor color = SkinConfig::m_colors["dialog_background::neutral"];
if (m_dialog_size < 1.0f) color.setAlpha( color.getAlpha()*m_dialog_size );
if (m_dialog_size < 1.0f) color.setAlpha( (unsigned int)(color.getAlpha()*m_dialog_size ));
GUIEngine::getDriver()->draw2DRectangle( color,
core::rect< s32 >(position2d< s32 >(0,0) ,
GUIEngine::getDriver()->getCurrentRenderTargetSize()) );
@ -1207,7 +1207,7 @@ core::rect< s32 > Skin::draw3DWindowBackground (IGUIElement *element, bool drawT
core::position2d<s32> center = sized_rect.getCenter();
const int w = sized_rect.getWidth();
const int h = sized_rect.getHeight();
const float size = sin(m_dialog_size*M_PI_2);
const float size = sin(m_dialog_size*M_PI*0.5f);
sized_rect.UpperLeftCorner.X = (int)(center.X - (w/2.0f)*size);
sized_rect.UpperLeftCorner.Y = (int)(center.Y - (h/2.0f)*size);
sized_rect.LowerRightCorner.X = (int)(center.X + (w/2.0f)*size);

View File

@ -296,6 +296,10 @@
RelativePath="..\..\guiengine\abstract_state_manager.cpp"
>
</File>
<File
RelativePath="..\..\guiengine\CGUIFont.cpp"
>
</File>
<File
RelativePath="..\..\guiengine\engine.cpp"
>
@ -982,6 +986,10 @@
RelativePath="..\..\guiengine\abstract_state_manager.hpp"
>
</File>
<File
RelativePath="..\..\guiengine\CGUIFont.h"
>
</File>
<File
RelativePath="..\..\guiengine\engine.hpp"
>

View File

@ -189,13 +189,13 @@ void FeatureUnlockedCutScene::onUpdate(float dt, irr::video::IVideoDriver* drive
//printf("m_key_angle = %f\n", m_key_angle);
m_key->setRotation( core::vector3df(0, m_key_angle*90.0f, -m_key_angle*90.0f) );
const int GIFT_EXIT_FROM = 7.0f;
const int GIFT_EXIT_TO = 20.0f;
const int GIFT_EXIT_FROM = 7;
const int GIFT_EXIT_TO = 20;
if (m_global_time > GIFT_EXIT_FROM && m_global_time < GIFT_EXIT_TO && m_root_gift_node != NULL)
{
const double chest_top_angle = ((double)(m_global_time - GIFT_EXIT_FROM)*3/(double)GIFT_EXIT_TO)*110.0;
m_chest_top->setRotation( core::vector3df( 360-std::min(110.0, chest_top_angle), 0, 0 ));
m_chest_top->setRotation( core::vector3df( 360.0f-(float)std::min(110.0, chest_top_angle), 0, 0 ));
if (chest_top_angle < 110.0)
{
core::vector3df chestpos = m_chest_top->getPosition();
@ -204,7 +204,7 @@ void FeatureUnlockedCutScene::onUpdate(float dt, irr::video::IVideoDriver* drive
}
core::vector3df pos = m_root_gift_node->getPosition();
pos.Y = sin( (m_global_time - GIFT_EXIT_FROM)*M_PI*1.5/GIFT_EXIT_TO )*50;
pos.Y = sin( (float)((m_global_time - GIFT_EXIT_FROM)*M_PI*1.5/GIFT_EXIT_TO) )*50.0f;
pos.X += 5*dt;
pos.Z += 5*dt;