Fix more clang warnings

This commit is contained in:
Flakebi 2015-02-05 00:05:41 +01:00
parent 19ce806563
commit 366f8a26bb
19 changed files with 42 additions and 59 deletions

View File

@ -70,7 +70,7 @@ inline void GrahamScanConvexHull2D(btAlignedObjectArray<GrahamVector2>& original
{
const btVector3& left = originalPoints[i];
const btVector3& right = originalPoints[0];
if (left.x() < right.x() || !(right.x() < left.x()) && left.y() < right.y())
if (left.x() < right.x() || (!(right.x() < left.x()) && left.y() < right.y()))
{
originalPoints.swap(0,i);
}

View File

@ -87,7 +87,7 @@ void CAnimatedMeshSceneNode::buildFrameNr(u32 timeMs)
}
}
if ((StartFrame==EndFrame))
if (StartFrame == EndFrame)
{
CurrentFrameNr = (f32)StartFrame; //Support for non animated meshes
}

View File

@ -73,12 +73,12 @@ u32 CGUIContextMenu::getItemCount() const
//! Adds a menu item.
u32 CGUIContextMenu::addItem(const wchar_t* text, s32 commandId, bool enabled, bool hasSubMenu, bool checked, bool autoChecking)
{
return insertItem(Items.size(), text, commandId, enabled, hasSubMenu, checked, autoChecking);
return insertItem(Items.size(), text, commandId, enabled, hasSubMenu, checked, autoChecking);
}
//! Insert a menu item at specified position.
u32 CGUIContextMenu::insertItem(u32 idx, const wchar_t* text, s32 commandId, bool enabled,
bool hasSubMenu, bool checked, bool autoChecking)
bool hasSubMenu, bool checked, bool autoChecking)
{
SItem s;
s.Enabled = enabled;
@ -96,16 +96,16 @@ u32 CGUIContextMenu::insertItem(u32 idx, const wchar_t* text, s32 commandId, boo
s.SubMenu->setVisible(false);
}
u32 result = idx;
if ( idx < Items.size() )
{
Items.insert(s, idx);
}
else
{
Items.push_back(s);
result = Items.size() - 1;
}
u32 result = idx;
if ( idx < Items.size() )
{
Items.insert(s, idx);
}
else
{
Items.push_back(s);
result = Items.size() - 1;
}
recalculateSize();
return result;
@ -129,8 +129,8 @@ void CGUIContextMenu::setSubMenu(u32 index, CGUIContextMenu* menu)
if (index >= Items.size())
return;
if (menu)
menu->grab();
if (menu)
menu->grab();
if (Items[index].SubMenu)
Items[index].SubMenu->drop();
@ -522,8 +522,6 @@ void CGUIContextMenu::draw()
recalculateSize();
}
IGUISpriteBank* sprites = skin->getSpriteBank();
core::rect<s32> rect = AbsoluteRect;
core::rect<s32>* clip = 0;
@ -583,12 +581,14 @@ void CGUIContextMenu::draw()
font->draw(Items[i].Text.c_str(), rect,
skin->getColor(c), false, true, clip);
// draw submenu symbol
//IGUISpriteBank* sprites = skin->getSpriteBank();
//if (Items[i].SubMenu && sprites)
//{
// core::rect<s32> r = rect;
// r.UpperLeftCorner.X = r.LowerRightCorner.X - 15;
//
//
// sprites->draw2DSprite(skin->getIcon(EGDI_CURSOR_RIGHT),
// r.getCenter(), clip, skin->getColor(c),
// (i == HighLighted) ? ChangeTime : 0,
@ -667,19 +667,19 @@ void CGUIContextMenu::recalculateSize()
const s32 w = Items[i].SubMenu->getAbsolutePosition().getWidth();
const s32 h = Items[i].SubMenu->getAbsolutePosition().getHeight();
core::rect<s32> subRect(width-5, Items[i].PosY, width+w-5, Items[i].PosY+h);
core::rect<s32> subRect(width-5, Items[i].PosY, width+w-5, Items[i].PosY+h);
// if it would be drawn beyond the right border, then add it to the left side
gui::IGUIElement * root = Environment->getRootGUIElement();
if ( root )
{
core::rect<s32> rectRoot( root->getAbsolutePosition() );
if ( getAbsolutePosition().UpperLeftCorner.X+subRect.LowerRightCorner.X > rectRoot.LowerRightCorner.X )
{
subRect.UpperLeftCorner.X = -w;
subRect.LowerRightCorner.X = 0;
}
}
// if it would be drawn beyond the right border, then add it to the left side
gui::IGUIElement * root = Environment->getRootGUIElement();
if ( root )
{
core::rect<s32> rectRoot( root->getAbsolutePosition() );
if ( getAbsolutePosition().UpperLeftCorner.X+subRect.LowerRightCorner.X > rectRoot.LowerRightCorner.X )
{
subRect.UpperLeftCorner.X = -w;
subRect.LowerRightCorner.X = 0;
}
}
Items[i].SubMenu->setRelativePosition(subRect);
}

View File

@ -74,7 +74,6 @@ void CGUIImage::draw()
return;
IGUISkin* skin = Environment->getSkin();
video::IVideoDriver* driver = Environment->getVideoDriver();
if (Texture)
{
@ -88,7 +87,7 @@ void CGUIImage::draw()
//}
//else
//{
// driver->draw2DImage(Texture, AbsoluteRect.UpperLeftCorner,
// Environment->getVideoDriver()->draw2DImage(Texture, AbsoluteRect.UpperLeftCorner,
// core::rect<s32>(core::position2d<s32>(0,0), core::dimension2di(Texture->getOriginalSize())),
// &AbsoluteClippingRect, Color, UseAlphaChannel);
//}

View File

@ -547,12 +547,12 @@ static GLXContext getMeAGLContext(Display *display, GLXFBConfig glxFBConfig)
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
None
};
int legacyctx[] =
/*int legacyctx[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 2,
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
None
};
};*/
PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = 0;
glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)
glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );

View File

@ -155,6 +155,8 @@ namespace video
SColor color,
bool useAlphaChannelOfTexture);
// Import draw2DImage method from base class
using CNullDriver::draw2DImage;
//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0,

View File

@ -28,7 +28,7 @@ CParticleAnimatedMeshSceneNodeEmitter::CParticleAnimatedMeshSceneNodeEmitter(
MinStartColor(minStartColor), MaxStartColor(maxStartColor),
MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax),
MaxStartSize(maxStartSize), MinStartSize(minStartSize),
Time(0), Emitted(0), MaxAngleDegrees(maxAngleDegrees),
Time(0), MaxAngleDegrees(maxAngleDegrees),
EveryMeshVertex(everyMeshVertex), UseNormalDirection(useNormalDirection)
{
#ifdef _DEBUG

View File

@ -146,7 +146,6 @@ private:
core::dimension2df MaxStartSize, MinStartSize;
u32 Time;
u32 Emitted;
s32 MaxAngleDegrees;
bool EveryMeshVertex;

View File

@ -25,7 +25,7 @@ CParticleBoxEmitter::CParticleBoxEmitter(
MaxParticlesPerSecond(maxParticlesPerSecond),
MinStartColor(minStartColor), MaxStartColor(maxStartColor),
MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax),
Time(0), Emitted(0), MaxAngleDegrees(maxAngleDegrees)
Time(0), MaxAngleDegrees(maxAngleDegrees)
{
#ifdef _DEBUG
setDebugName("CParticleBoxEmitter");

View File

@ -121,7 +121,6 @@ private:
u32 MinLifeTime, MaxLifeTime;
u32 Time;
u32 Emitted;
s32 MaxAngleDegrees;
};

View File

@ -27,7 +27,7 @@ CParticleCylinderEmitter::CParticleCylinderEmitter(
MaxParticlesPerSecond(maxParticlesPerSecond),
MinStartColor(minStartColor), MaxStartColor(maxStartColor),
MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax),
Radius(radius), Length(length), Time(0), Emitted(0),
Radius(radius), Length(length), Time(0),
MaxAngleDegrees(maxAngleDegrees), OutlineOnly(outlineOnly)
{
#ifdef _DEBUG

View File

@ -150,7 +150,6 @@ private:
f32 Length;
u32 Time;
u32 Emitted;
s32 MaxAngleDegrees;
bool OutlineOnly;

View File

@ -27,7 +27,7 @@ CParticleSphereEmitter::CParticleSphereEmitter(
MaxParticlesPerSecond(maxParticlesPerSecond),
MinStartColor(minStartColor), MaxStartColor(maxStartColor),
MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax),
Time(0), Emitted(0), MaxAngleDegrees(maxAngleDegrees)
Time(0), MaxAngleDegrees(maxAngleDegrees)
{
#ifdef _DEBUG
setDebugName("CParticleSphereEmitter");

View File

@ -129,7 +129,6 @@ private:
u32 MinLifeTime, MaxLifeTime;
u32 Time;
u32 Emitted;
s32 MaxAngleDegrees;
};

View File

@ -67,11 +67,3 @@ void CutsceneGUI::renderGlobal(float dt)
}
}
// -----------------------------------------------------------------------------
void CutsceneGUI::renderPlayerView(const AbstractKart *kart)
{
}
// -----------------------------------------------------------------------------

View File

@ -53,9 +53,7 @@ public:
void setSubtitle(const core::stringw& subtitle) { m_subtitle = subtitle; }
virtual void renderGlobal(float dt);
// Take functions of base class
using RaceGUIBase::renderPlayerView;
virtual void renderPlayerView(const AbstractKart *kart);
virtual void renderPlayerView(const Camera *camera, float dt){}
virtual const core::dimension2du getMiniMapSize() const OVERRIDE
{

View File

@ -14,7 +14,6 @@
#include "network/network_manager.hpp"
#include "states_screens/state_manager.hpp"
static const char RANDOM_KART_ID[] = "randomkart";
static const char ID_LOCKED[] = "locked/";
using namespace GUIEngine;

View File

@ -62,9 +62,6 @@ private:
// Minimap related variables
// -------------------------
/** The mini map of the track. */
video::ITexture *m_mini_map;
video::ITexture *m_trophy1;
video::ITexture *m_trophy2;
video::ITexture *m_trophy3;

View File

@ -227,7 +227,7 @@ public:
{ assert(false); return core::dimension2du(0, 0); }
/** No kart specific view needs to be rendered in the result gui. */
virtual void renderPlayerView(const AbstractKart *kart) {}
virtual void renderPlayerView(const Camera *camera, float dt) {}
virtual void onUpdate(float dt) OVERRIDE;