Merge branch 'Flakebi-fixes'

This commit is contained in:
hiker 2015-07-24 10:24:05 +10:00
commit c10bd01703
66 changed files with 121 additions and 204 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

@ -83,6 +83,8 @@ enet_protocol_dispatch_incoming_commands (ENetHost * host, ENetEvent * event)
}
return 1;
default:
break;
}
}
@ -863,6 +865,8 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer *
enet_list_empty (& peer -> sentReliableCommands))
enet_peer_disconnect (peer, peer -> eventData);
break;
default:
break;
}
return 0;

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

@ -1867,6 +1867,9 @@ public:
// Attribute implemented for texture references
class CTextureAttribute : public IAttribute
{
// Explicitly hide base method
using IAttribute::setTexture;
public:
CTextureAttribute(const char* name, video::ITexture* value, video::IVideoDriver* driver, const io::path& filename)

View File

@ -697,6 +697,8 @@ void CColorConverter::convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, s32 sN
#endif
}
break;
default:
break;
}
}

View File

@ -233,7 +233,6 @@ void CGUIButton::draw()
return;
IGUISkin* skin = Environment->getSkin();
video::IVideoDriver* driver = Environment->getVideoDriver();
// todo: move sprite up and text down if the pressed state has a sprite
const core::position2di spritePos = AbsoluteRect.getCenter();
@ -254,6 +253,7 @@ void CGUIButton::draw()
core::recti(pos, ImageRect.getSize()),
ImageRect, &AbsoluteClippingRect,
0, UseAlphaChannel);
//video::IVideoDriver* driver = Environment->getVideoDriver();
//driver->draw2DImage(Image,
// ScaleImage? AbsoluteRect :
// core::recti(pos, ImageRect.getSize()),

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,6 @@ static GLXContext getMeAGLContext(Display *display, GLXFBConfig glxFBConfig, boo
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
None
};
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 @@ CParticleRingEmitter::CParticleRingEmitter(
MaxParticlesPerSecond(maxParticlesPerSecond),
MinStartColor(minStartColor), MaxStartColor(maxStartColor),
MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax),
Time(0), Emitted(0), MaxAngleDegrees(maxAngleDegrees)
Time(0), MaxAngleDegrees(maxAngleDegrees)
{
#ifdef _DEBUG
setDebugName("CParticleRingEmitter");

View File

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

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

@ -2286,6 +2286,7 @@ IMeshWriter* CSceneManager::createMeshWriter(EMESH_WRITER_TYPE type)
case EMWT_COLLADA:
case EMWT_STL:
case EMWT_OBJ:
case EMWT_PLY:
return 0;
}

View File

@ -4,7 +4,7 @@
#include "IrrCompileConfig.h"
static const char* const copyright = "Irrlicht Engine (c) 2002-2012 Nikolaus Gebhardt";
//static const char* const copyright = "Irrlicht Engine (c) 2002-2012 Nikolaus Gebhardt";
#ifdef _IRR_WINDOWS_
#include <windows.h>

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

@ -469,8 +469,6 @@ void draw2DVertexPrimitiveList(video::ITexture *tex, const void* vertices,
Primitive2DList::getInstance()->use();
Primitive2DList::getInstance()->setUniforms();
const video::SOverrideMaterial &m = irr_driver->getVideoDriver()
->getOverrideMaterial();
compressTexture(tex, false);
Primitive2DList::getInstance()->setTextureUnits(getTextureGLuint(tex));
glDrawElements(GL_TRIANGLE_FAN, primitiveCount, GL_UNSIGNED_SHORT, 0);

View File

@ -329,7 +329,6 @@ private:
void renderNormalsVisualisation();
void renderTransparent();
void renderParticles();
void computeSunVisibility();
void renderShadows();
void renderRSM();
void renderGlow(std::vector<GlowData>& glows);

View File

@ -153,7 +153,7 @@ void LODNode::updateVisibility(bool* shown)
void LODNode::OnRegisterSceneNode()
{
bool shown;
bool shown = false;
updateVisibility(&shown);
const u32 now = irr_driver->getDevice()->getTimer()->getTime();

View File

@ -796,6 +796,8 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
m->MaterialType = Shaders::getShader(ES_GRASS_REF);
m->setTexture(1, glossytex);
return;
default:
break;
}
if (!m->getTexture(0))

View File

@ -522,10 +522,6 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, unsigned po
} // end glow
PROFILER_POP_CPU_MARKER();
PROFILER_PUSH_CPU_MARKER("- Lensflare/godray", 0x00, 0xFF, 0xFF);
computeSunVisibility();
PROFILER_POP_CPU_MARKER();
// Render transparent
{
PROFILER_PUSH_CPU_MARKER("- Transparent Pass", 0xFF, 0x00, 0x00);
@ -629,17 +625,6 @@ void IrrDriver::renderFixed(float dt)
// ----------------------------------------------------------------------------
void IrrDriver::computeSunVisibility()
{
// Is the lens flare enabled & visible? Check last frame's query.
bool hasgodrays = false;
if (World::getWorld() != NULL)
{
hasgodrays = World::getWorld()->getTrack()->hasGodRays();
}
}
void IrrDriver::renderParticles()
{
glDepthMask(GL_FALSE);

View File

@ -53,7 +53,10 @@ public:
}; // SkyboxShader
// ============================================================================
static float getTexelValue(unsigned i, unsigned j, size_t width, size_t height,
//***************************************************************************
// Currently unused functions, they will be used later so please DON'T remove
//***************************************************************************
/*static float getTexelValue(unsigned i, unsigned j, size_t width, size_t height,
float *Coeff, float *Y00, float *Y1minus1,
float *Y10, float *Y11, float *Y2minus2,
float * Y2minus1, float * Y20, float *Y21,
@ -70,10 +73,10 @@ static float getTexelValue(unsigned i, unsigned j, size_t width, size_t height,
+ Y21[idx] * Coeff[7] + Y22[idx] * Coeff[8];
reconstructedVal /= solidangle;
return MAX2(255.0f * reconstructedVal, 0.f);
} // getTexelValue
}*/ // getTexelValue
// ----------------------------------------------------------------------------
static void unprojectSH(float *output[], size_t width, size_t height,
/*static void unprojectSH(float *output[], size_t width, size_t height,
float *Y00[], float *Y1minus1[], float *Y10[],
float *Y11[], float *Y2minus2[], float *Y2minus1[],
float * Y20[], float *Y21[], float *Y22[],
@ -108,16 +111,16 @@ static void unprojectSH(float *output[], size_t width, size_t height,
}
}
}
} // unprojectSH
}*/ // unprojectSH
// ----------------------------------------------------------------------------
static void displayCoeff(float *SHCoeff)
/*static void displayCoeff(float *SHCoeff)
{
printf("L00:%f\n", SHCoeff[0]);
printf("L1-1:%f, L10:%f, L11:%f\n", SHCoeff[1], SHCoeff[2], SHCoeff[3]);
printf("L2-2:%f, L2-1:%f, L20:%f, L21:%f, L22:%f\n",
SHCoeff[4], SHCoeff[5], SHCoeff[6], SHCoeff[7], SHCoeff[8]);
} // displayCoeff
}*/ // displayCoeff
// ----------------------------------------------------------------------------
void swapPixels(char *old_img, char *new_img, unsigned stride, unsigned old_i,

View File

@ -64,7 +64,7 @@ private:
bool m_diffuse_coefficients_calculated;
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

@ -1267,6 +1267,12 @@ void Skin::drawSpinnerBody(const core::recti &rect, Widget* widget,
params=&SkinConfig::m_render_params["spinner3::neutral"];
else if(player_id==3)
params=&SkinConfig::m_render_params["spinner4::neutral"];
else
{
Log::fatal("Skin::drawSpinnerBody", "Unknown playerID (more than 4 players?)");
// Silence compiler warning
params = NULL;
}
}
else if (widget->m_deactivated)
{

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

@ -105,21 +105,8 @@ void LabelWidget::add()
m_element->setTabStop(false);
m_element->setTabGroup(false);
if (m_scroll_speed > 0)
{
IGUIFont* font = m_title_font ? GUIEngine::getTitleFont()
: GUIEngine::getFont();
core::dimension2du r = font->getDimension(getText().c_str());
//m_scroll_offset = (float)r.Width;
// start scrolled off
m_scroll_offset = -999;
}
else
{
if (m_scroll_speed <= 0)
m_element->setNotClipped(true);
}
} // add
// ----------------------------------------------------------------------------
@ -139,16 +126,11 @@ void LabelWidget::setText(const wchar_t *text, bool expandIfNeeded)
rect.LowerRightCorner.X = rect.UpperLeftCorner.X + fwidth;
m_element->setRelativePosition(rect);
m_element->updateAbsolutePosition();
//((IGUIStaticText*)m_element)->setBackgroundColor( video::SColor(255,255,0,0) );
}
}
if (m_scroll_speed > 0)
{
//m_scroll_offset = (float)m_element->getAbsolutePosition().getWidth();
m_scroll_offset = (float)m_w;
}
Widget::setText(text);
if (m_element)
@ -181,7 +163,6 @@ bool LabelWidget::scrolledOff() const
void LabelWidget::setScrollSpeed(float speed)
{
//m_scroll_offset = 0;
m_scroll_speed = speed;
} // setScrollSpeed

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

@ -30,8 +30,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

@ -2253,7 +2253,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

@ -67,7 +67,7 @@ Skidding::~Skidding()
void Skidding::reset()
{
m_skid_time = 0.0f;
m_skid_state = m_skid_visual_time<=0 ? SKID_OLD : SKID_NONE;
m_skid_state = SKID_NONE;
m_skid_factor = 1.0f;
m_real_steering = 0.0f;
m_visual_rotation = 0.0f;
@ -95,20 +95,8 @@ void Skidding::reset()
*/
void Skidding::updateSteering(float steer, float dt)
{
if(m_skid_state==SKID_OLD)
{
float speed = m_kart->getSpeed();
float current_max_speed = m_kart->getCurrentMaxSpeed();
float speed_ratio = speed / current_max_speed;
m_real_steering = steer * m_skid_factor;
m_visual_rotation = m_real_steering /m_skid_max * speed_ratio;
return;
}
// Now only new skidding is happening
switch(m_skid_state)
{
case SKID_OLD: assert(false);
break;
case SKID_SHOW_GFX_LEFT:
case SKID_SHOW_GFX_RIGHT:
case SKID_NONE:
@ -178,7 +166,6 @@ float Skidding::getSteeringWhenSkidding(float steering) const
{
switch(m_skid_state)
{
case SKID_OLD: assert(false); break;
case SKID_SHOW_GFX_LEFT:
case SKID_SHOW_GFX_RIGHT:
case SKID_BREAK:
@ -257,13 +244,6 @@ void Skidding::update(float dt, bool is_on_ground,
else
if(m_skid_factor<1.0f) m_skid_factor = 1.0f;
// FIXME hiker: remove once the new skidding code is finished.
if(m_skid_state == SKID_OLD)
{
updateSteering(steering, dt);
return;
}
// If skidding was started and a graphical jump should still
// be displayed, update the data
if(m_remaining_jump_time>0)

View File

@ -74,7 +74,6 @@ private:
float m_jump_speed;
public:
/** SKID_OLD: old skidding, will be removed. */
/** SKID_NONE: Kart is currently not skidding.
* SKID_ACCUMULATE_LEFT: Kart is skidding to the left and accumulating
* for bonus.
@ -83,9 +82,8 @@ public:
* and the kart was turning left.
* SKID_SHOW_GFX_RIGHT: Similar for turning right.
* SKID_BREAK: Skidding was stopped without bonus */
enum SkidState {SKID_OLD, SKID_NONE, SKID_ACCUMULATE_LEFT,
SKID_ACCUMULATE_RIGHT, SKID_SHOW_GFX_LEFT,
SKID_SHOW_GFX_RIGHT, SKID_BREAK} ;
enum SkidState { SKID_NONE, SKID_ACCUMULATE_LEFT, SKID_ACCUMULATE_RIGHT,
SKID_SHOW_GFX_LEFT, SKID_SHOW_GFX_RIGHT, SKID_BREAK} ;
private:
/** The current skidding state. */

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

@ -173,22 +173,29 @@ class NetworkString
return result;
}
// Another function for n == 1 to surpress warnings in clang
template<typename T>
T get(int pos) const
{
return m_string[pos];
}
inline int getInt(int pos = 0) const { return get<int,4>(pos); }
inline uint32_t getUInt(int pos = 0) const { return get<uint32_t,4>(pos); }
inline uint32_t getUInt32(int pos = 0) const { return get<uint32_t,4>(pos); }
inline uint16_t getUInt16(int pos = 0) const { return get<uint16_t,2>(pos); }
inline uint8_t getUInt8(int pos = 0) const { return get<uint8_t,1>(pos); }
inline char getChar(int pos = 0) const { return get<char,1>(pos); }
inline unsigned char getUChar(int pos = 0) const { return get<unsigned char,1>(pos); }
inline uint8_t getUInt8(int pos = 0) const { return get<uint8_t>(pos); }
inline char getChar(int pos = 0) const { return get<char>(pos); }
inline unsigned char getUChar(int pos = 0) const { return get<unsigned char>(pos); }
std::string getString(int pos, int len) const { return std::string(m_string.begin()+pos, m_string.begin()+pos+len); }
inline int gi(int pos = 0) const { return get<int,4>(pos); }
inline uint32_t gui(int pos = 0) const { return get<uint32_t,4>(pos); }
inline uint32_t gui32(int pos = 0) const { return get<uint32_t,4>(pos); }
inline uint16_t gui16(int pos = 0) const { return get<uint16_t,2>(pos); }
inline uint8_t gui8(int pos = 0) const { return get<uint8_t,1>(pos); }
inline char gc(int pos = 0) const { return get<char,1>(pos); }
inline unsigned char guc(int pos = 0) const { return get<unsigned char,1>(pos); }
inline uint8_t gui8(int pos = 0) const { return get<uint8_t>(pos); }
inline char gc(int pos = 0) const { return get<char>(pos); }
inline unsigned char guc(int pos = 0) const { return get<unsigned char>(pos); }
std::string gs(int pos, int len) const { return std::string(m_string.begin()+pos, m_string.begin()+pos+len); }
double getDouble(int pos = 0) //!< BEWARE OF PRECISION
@ -219,13 +226,22 @@ class NetworkString
return result;
}
// Another function for n == 1 to surpress warnings in clang
template<typename T>
T getAndRemove(int pos)
{
T result = m_string[pos];
remove(pos, 1);
return result;
}
inline int getAndRemoveInt(int pos = 0) { return getAndRemove<int,4>(pos); }
inline uint32_t getAndRemoveUInt(int pos = 0) { return getAndRemove<uint32_t,4>(pos); }
inline uint32_t getAndRemoveUInt32(int pos = 0) { return getAndRemove<uint32_t,4>(pos); }
inline uint16_t getAndRemoveUInt16(int pos = 0) { return getAndRemove<uint16_t,2>(pos); }
inline uint8_t getAndRemoveUInt8(int pos = 0) { return getAndRemove<uint8_t,1>(pos); }
inline char getAndRemoveChar(int pos = 0) { return getAndRemove<char,1>(pos); }
inline unsigned char getAndRemoveUChar(int pos = 0) { return getAndRemove<unsigned char,1>(pos); }
inline uint8_t getAndRemoveUInt8(int pos = 0) { return getAndRemove<uint8_t>(pos); }
inline char getAndRemoveChar(int pos = 0) { return getAndRemove<char>(pos); }
inline unsigned char getAndRemoveUChar(int pos = 0) { return getAndRemove<unsigned char>(pos); }
double getAndRemoveDouble(int pos = 0) //!< BEWARE OF PRECISION
{
for (int i = 0; i < 8; i++)

View File

@ -47,6 +47,7 @@ bool SynchronizationProtocol::notifyEventAsynchronous(Event* event)
uint32_t sequence = data.gui32(6);
std::vector<STKPeer*> peers = NetworkManager::getInstance()->getPeers();
assert(peers.size() > 0);
if (m_listener->isServer())
{
@ -57,7 +58,7 @@ bool SynchronizationProtocol::notifyEventAsynchronous(Event* event)
}
}
uint8_t peer_id;
uint8_t peer_id = 0;
for (unsigned int i = 0; i < peers.size(); i++)
{
if (peers[i]->isSamePeer(*event->peer))

View File

@ -29,7 +29,7 @@
template<typename S>
S getHighestInHistogram(std::map<S,int>* histogram)
{
S best_item;
S best_item = histogram->begin()->first;
uint8_t highest_count = histogram->begin()->second;
for (typename std::map<S, int>::iterator it = histogram->begin();
it != histogram->end(); it++)

View File

@ -55,7 +55,6 @@ namespace Scripting
kart->setXYZ(v);
unsigned int index = World::getWorld()->getRescuePositionIndex(kart);
btTransform s = World::getWorld()->getRescueTransform(index);
const btVector3 &xyz = s.getOrigin();
s.setRotation(btQuaternion(btVector3(0.0f, 1.0f, 0.0f), 0.0f));
World::getWorld()->moveKartTo(kart, s);
}

View File

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

View File

@ -53,7 +53,7 @@ public:
void setSubtitle(const core::stringw& subtitle) { m_subtitle = subtitle; }
virtual void renderGlobal(float dt);
virtual void renderPlayerView(const AbstractKart *kart);
virtual void renderPlayerView(const Camera *camera, float dt){}
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

@ -52,17 +52,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;
@ -72,9 +63,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

@ -31,7 +31,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

@ -272,7 +272,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

@ -414,9 +414,9 @@ void RaceGUIBase::preRenderCallback(const Camera *camera)
// ----------------------------------------------------------------------------
void RaceGUIBase::renderPlayerView(const Camera *camera, float dt)
{
#if 0
const core::recti &viewport = camera->getViewport();
#if 0
if (m_lightning > 0.0f)
{
GLint glviewport[4];

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

@ -233,7 +233,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;
@ -246,7 +246,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

@ -338,9 +338,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:

View File

@ -74,13 +74,13 @@ void TrackSector::update(const Vec3 &xyz)
}
else
{
bool has_prerequisite = false;
//bool has_prerequisite = false;
for (unsigned int i=0; i<checkline_requirements.size(); i++)
{
if (m_last_triggered_checkline == checkline_requirements[i])
{
has_prerequisite = true;
//has_prerequisite = true;
m_last_valid_graph_node = m_current_graph_node;
break;
}