Fix some clang warnings and bugs

This commit is contained in:
Flakebi 2015-02-04 18:30:27 +01:00
parent 0051254f03
commit 32a044e292
26 changed files with 17 additions and 55 deletions

View File

@ -50,9 +50,6 @@ private:
/** The current time used in the IPOs. */
float m_current_time;
/** For cyclic animations: duration of the cycle. */
float m_cycle_length;
/** The inital position of this object. */
Vec3 m_initial_xyz;

View File

@ -267,7 +267,6 @@ void draw2DVertexPrimitiveList(video::ITexture *tex, const void* vertices,
glUseProgram(UIShader::Primitive2DList::getInstance()->Program);
UIShader::Primitive2DList::getInstance()->setUniforms();
const video::SOverrideMaterial &m = irr_driver->getVideoDriver()->getOverrideMaterial();
compressTexture(tex, false);
UIShader::Primitive2DList::getInstance()->SetTextureUnits(getTextureGLuint(tex));
glDrawElements(GL_TRIANGLE_FAN, primitiveCount, GL_UNSIGNED_SHORT, 0);

View File

@ -59,7 +59,7 @@ private:
int m_width;
int m_height;
unsigned shadowColorTex, shadowNormalTex, shadowDepthTex;
unsigned shadowColorTex, shadowDepthTex;
unsigned RSM_Color, RSM_Normal, RSM_Depth;
unsigned RH_Red, RH_Green, RH_Blue;
FrameBuffer* m_shadow_FBO, *m_RSM, *m_RH_FBO;

View File

@ -55,9 +55,6 @@ private:
/** For debugging: a simple quad to display where slipstream works. */
scene::IMesh *m_debug_mesh;
/** The texture matrix for the slipstream effect. */
core::matrix4 *m_matrix;
/** The length of the slipstream cylinder. This is used to scale
* the actual scene node correctly. */
float m_length;

View File

@ -26,7 +26,7 @@ CGUISTKListBox::CGUISTKListBox(IGUIEnvironment* environment, IGUIElement* parent
: IGUIElement(EGUIET_LIST_BOX, environment, parent, id, rectangle), Selected(-1),
ItemHeight(0),ItemHeightOverride(0),
TotalItemHeight(0), ItemsIconWidth(0), Font(0), IconBank(0),
ScrollBar(0), selectTime(0), LastKeyTime(0), Selecting(false), DrawBack(drawBack),
ScrollBar(0), selectTime(0), Selecting(false), DrawBack(drawBack),
MoveOverSelect(moveOverSelect), AutoScroll(true), HighlightWhenNotFocused(true)
{
#ifdef _DEBUG

View File

@ -182,7 +182,6 @@ namespace irr
gui::IGUISpriteBank* IconBank;
gui::IGUIScrollBar* ScrollBar;
u32 selectTime;
u32 LastKeyTime;
core::stringw KeyBuffer;
bool Selecting;
bool DrawBack;

View File

@ -43,7 +43,10 @@ namespace GUIEngine
/** Current scroll offset. */
float m_scroll_offset;
// Hide overloaded methods
using Widget::setText;
public:
LEAK_CHECK()

View File

@ -50,8 +50,6 @@ namespace GUIEngine
AlignedArray<Vec3> m_model_scale;
std::vector<int> m_model_frames;
video::ITexture* m_texture;
RTT* m_rtt_provider;
float angle;

View File

@ -28,8 +28,6 @@
#include "states_screens/kart_selection.hpp"
#include <IGUIEnvironment.h>
static const char RANDOM_KART_ID[] = "randomkart";
using namespace GUIEngine;
PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,

View File

@ -231,7 +231,7 @@ void Flyable::getClosestKart(const AbstractKart **minKart,
Vec3 delta = t.getOrigin()-trans_projectile.getOrigin();
// the Y distance is added again because karts above or below should//
// not be prioritized when aiming
float distance2 = delta.length2() + abs(t.getOrigin().getY()
float distance2 = delta.length2() + std::abs(t.getOrigin().getY()
- trans_projectile.getOrigin().getY())*2;
if(inFrontOf != NULL)

View File

@ -57,8 +57,6 @@ Plunger::Plunger(AbstractKart *kart)
btTransform kart_transform = kart->getAlignedTransform();
btMatrix3x3 kart_rotation = kart_transform.getBasis();
// The current forward vector is rotation*(0,0,1), or:
btVector3 forward(kart_rotation.getColumn(2));
float heading =kart->getHeading();
float pitch = kart->getTerrainPitch(heading);

View File

@ -199,7 +199,7 @@ private:
enum {PSA_DEFAULT, PSA_FIXED, PSA_NEW}
m_point_selection_algorithm;
#ifdef DEBUG
#ifdef AI_DEBUG
/** For skidding debugging: shows the estimated turn shape. */
ShowCurve **m_curve;

View File

@ -2281,7 +2281,7 @@ void Kart::updateEnginePowerAndBrakes(float dt)
// If not giving power (forward or reverse gear), and speed is low
// we are "parking" the kart, so in battle mode we can ambush people
if(abs(m_speed) < 5.0f)
if(std::abs(m_speed) < 5.0f)
m_vehicle->setAllBrakes(20.0f);
} // !m_brake
} // not accelerating

View File

@ -40,8 +40,7 @@
MainLoop* main_loop = 0;
MainLoop::MainLoop() :
m_abort(false),
m_frame_count(0)
m_abort(false)
{
m_curr_time = 0;
m_prev_time = 0;

View File

@ -31,7 +31,6 @@ private:
bool m_abort;
bool m_throttle_fps;
int m_frame_count;
Uint32 m_curr_time;
Uint32 m_prev_time;
float getLimitedDt();

View File

@ -53,6 +53,8 @@ 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 const core::dimension2du getMiniMapSize() const OVERRIDE

View File

@ -34,7 +34,6 @@ namespace Online { class HTTPRequest; }
class AddonsLoading : public GUIEngine::ModalDialog
{
private:
GUIEngine::LabelWidget *m_state;
GUIEngine::ProgressBarWidget *m_progress;
GUIEngine::IconButtonWidget *m_back_button;
GUIEngine::IconButtonWidget *m_install_button;

View File

@ -52,7 +52,6 @@ using namespace irr::core;
using namespace irr::gui;
using namespace irr::video;
const float ANIM_FROM = 3.0f;
const float ANIM_TO = 7.0f;
const int GIFT_EXIT_FROM = (int)ANIM_TO;
const int GIFT_EXIT_TO = GIFT_EXIT_FROM + 7;

View File

@ -54,17 +54,8 @@ using namespace irr::core;
using namespace irr::gui;
using namespace irr::video;
const float INITIAL_Y = -3.0f;
const float DURATION = 15.0f;
const float CAMERA_END_X = -15.0f;
const float CAMERA_END_Y = 1.5f;
const float CAMERA_END_Z = 5.0f;
const float CAMERA_START_X = -17.0f;
const float CAMERA_START_Y = 2.0f;
const float CAMERA_START_Z = 5.5f;
const float DISTANCE_BETWEEN_KARTS = 2.0f;
const float KART_SCALE = 0.75f;
@ -74,9 +65,6 @@ const float KART_END_X = -5.0f;
const float KART_Y = 0.0f;
const float KART_Z = 0.0f;
const float GARAGE_DOOR_OPEN_TIME = 6.0f;
const int MAX_KART_COUNT = 4;
DEFINE_SCREEN_SINGLETON( GrandPrixLose );

View File

@ -278,7 +278,6 @@ void OptionsScreenInput::filterInput(Input::InputType type,
int deviceID,
int btnID,
int axisDir,
int axisRange,
int value)
{
if (type == Input::IT_STICKMOTION || type == Input::IT_STICKBUTTON)

View File

@ -70,7 +70,6 @@ public:
int deviceID,
int btnID,
int axisDir,
int axisRange,
int value);
/** \brief implement callback from parent class GUIEngine::Screen */

View File

@ -46,9 +46,6 @@ private:
// Minimap related variables
// -------------------------
/** The mini map of the track. */
video::ITexture *m_mini_map;
/** The size of a single marker on the screen for AI karts,
* need not be a power of 2. */
int m_minimap_ai_size;

View File

@ -240,7 +240,8 @@ public:
float time,
const video::SColor &color=
video::SColor(255, 255, 0, 255),
bool important=true) { }
bool important=true,
bool big_font=false) { }
/** Should not be called anymore. */
virtual void clearAllMessages() {assert(false); }

View File

@ -65,12 +65,6 @@ private:
* display more meaningful sign-out message. */
irr::core::stringw m_sign_in_name;
/** Per player difficulty. */
GUIEngine::SpinnerWidget *m_difficulty;
/** Apply per player difficulty in singleplayer mode. */
GUIEngine::CheckBoxWidget *m_singleplayer_difficulty;
/** Online check box. */
GUIEngine::CheckBoxWidget *m_online_cb;

View File

@ -336,9 +336,9 @@ POParser::parse()
// skip UTF-8 intro that some text editors produce
// see http://en.wikipedia.org/wiki/Byte-order_mark
if (current_line.size() >= 3 &&
current_line[0] == static_cast<unsigned char>(0xef) &&
current_line[1] == static_cast<unsigned char>(0xbb) &&
current_line[2] == static_cast<unsigned char>(0xbf))
current_line[0] == static_cast<char>(0xef) &&
current_line[1] == static_cast<char>(0xbb) &&
current_line[2] == static_cast<char>(0xbf))
{
current_line = current_line.substr(3);
}

View File

@ -45,9 +45,6 @@ private:
Vec3 m_handle2;
}; // BezierData
/** Overall duration. */
float m_time;
/** Vector with all control points and handles. */
AlignedArray<BezierData> m_all_data;
public: