Merge branch 'master' of https://github.com/supertuxkart/stk-code
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -87,7 +87,7 @@ void CAnimatedMeshSceneNode::buildFrameNr(u32 timeMs)
|
||||
}
|
||||
}
|
||||
|
||||
if ((StartFrame==EndFrame))
|
||||
if (StartFrame == EndFrame)
|
||||
{
|
||||
CurrentFrameNr = (f32)StartFrame; //Support for non animated meshes
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -697,6 +697,8 @@ void CColorConverter::convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, s32 sN
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()),
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
//}
|
||||
|
||||
@@ -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" );
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -146,7 +146,6 @@ private:
|
||||
core::dimension2df MaxStartSize, MinStartSize;
|
||||
|
||||
u32 Time;
|
||||
u32 Emitted;
|
||||
s32 MaxAngleDegrees;
|
||||
|
||||
bool EveryMeshVertex;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -121,7 +121,6 @@ private:
|
||||
u32 MinLifeTime, MaxLifeTime;
|
||||
|
||||
u32 Time;
|
||||
u32 Emitted;
|
||||
s32 MaxAngleDegrees;
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -150,7 +150,6 @@ private:
|
||||
f32 Length;
|
||||
|
||||
u32 Time;
|
||||
u32 Emitted;
|
||||
s32 MaxAngleDegrees;
|
||||
|
||||
bool OutlineOnly;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -136,7 +136,6 @@ private:
|
||||
u32 MinLifeTime, MaxLifeTime;
|
||||
|
||||
u32 Time;
|
||||
u32 Emitted;
|
||||
s32 MaxAngleDegrees;
|
||||
};
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -129,7 +129,6 @@ private:
|
||||
u32 MinLifeTime, MaxLifeTime;
|
||||
|
||||
u32 Time;
|
||||
u32 Emitted;
|
||||
s32 MaxAngleDegrees;
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -548,6 +548,14 @@ void Camera::update(float dt)
|
||||
// - the kart should not be visible, but it works)
|
||||
m_camera->setNearValue(27.0);
|
||||
}
|
||||
else if (UserConfigParams::m_camera_debug==5)
|
||||
{
|
||||
core::vector3df xyz = m_kart->getXYZ().toIrrVector();
|
||||
Vec3 offset(3, 0, 0);
|
||||
offset = m_kart->getTrans()(offset);
|
||||
m_camera->setTarget(xyz);
|
||||
m_camera->setPosition(offset.toIrrVector());
|
||||
}
|
||||
// Update the first person camera
|
||||
else if (UserConfigParams::m_camera_debug == 3)
|
||||
{
|
||||
|
||||
@@ -329,7 +329,6 @@ private:
|
||||
void renderNormalsVisualisation();
|
||||
void renderTransparent();
|
||||
void renderParticles();
|
||||
void computeSunVisibility();
|
||||
void renderShadows();
|
||||
void renderRSM();
|
||||
void renderGlow(std::vector<GlowData>& glows);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -182,7 +182,6 @@ namespace irr
|
||||
gui::IGUISpriteBank* IconBank;
|
||||
gui::IGUIScrollBar* ScrollBar;
|
||||
u32 selectTime;
|
||||
u32 LastKeyTime;
|
||||
core::stringw KeyBuffer;
|
||||
bool Selecting;
|
||||
bool DrawBack;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -43,7 +43,10 @@ namespace GUIEngine
|
||||
|
||||
/** Current scroll offset. */
|
||||
float m_scroll_offset;
|
||||
|
||||
|
||||
// Hide overloaded methods
|
||||
using Widget::setText;
|
||||
|
||||
public:
|
||||
|
||||
LEAK_CHECK()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#include "physics/btKartRaycast.hpp"
|
||||
#include "physics/physics.hpp"
|
||||
#include "race/history.hpp"
|
||||
#include "tracks/terrain_info.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "tracks/track_manager.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
@@ -398,7 +399,7 @@ void Kart::reset()
|
||||
Vec3 front(0, 0, getKartLength()*0.5f);
|
||||
m_xyz_front = getTrans()(front);
|
||||
|
||||
m_terrain_info->update(getTrans());
|
||||
m_terrain_info->update(getTrans().getBasis());
|
||||
|
||||
// Reset is also called when the kart is created, at which time
|
||||
// m_controller is not yet defined, so this has to be tested here.
|
||||
@@ -1204,14 +1205,6 @@ void Kart::update(float dt)
|
||||
new RescueAnimation(this, /*is_auto_rescue*/true);
|
||||
}
|
||||
|
||||
// Add a certain epsilon (0.3) to the height of the kart. This avoids
|
||||
// problems of the ray being cast from under the track (which happened
|
||||
// e.g. on tux tollway when jumping down from the ramp, when the chassis
|
||||
// partly tunnels through the track). While tunneling should not be
|
||||
// happening (since Z velocity is clamped), the epsilon is left in place
|
||||
// just to be on the safe side (it will not hit the chassis itself).
|
||||
Vec3 epsilon(0,0.3f,0);
|
||||
|
||||
// Make sure that the ray doesn't hit the kart. This is done by
|
||||
// resetting the collision filter group, so that this collision
|
||||
// object is ignored during raycasting.
|
||||
@@ -1225,7 +1218,34 @@ void Kart::update(float dt)
|
||||
Vec3 front(0, 0, getKartLength()*0.5f);
|
||||
m_xyz_front = getTrans()(front);
|
||||
|
||||
m_terrain_info->update(getTrans(), epsilon);
|
||||
// After the physics step was done, the position of the wheels (as stored
|
||||
// in wheelInfo) is actually outdated, since the chassis was moved
|
||||
// according to the force acting from the wheels. So the cnter of the
|
||||
// chassis is not at the center of the wheels anymore, it is somewhat
|
||||
// moved forward (depending on speed and fps). In very extreme cases
|
||||
// (see bug 2246) the center of the chassis can actually be ahead of the
|
||||
// front wheels. So if we do a raycast to detect the terrain from the
|
||||
// current chassis, that raycast might be ahead of the wheels - which
|
||||
// results in incorrect rescues (the wheels are still on the ground,
|
||||
// but the raycast happens ahead of the front wheels and are over
|
||||
// a rescue texture).
|
||||
// To avoid this problem, we do the raycast for terrain detection from
|
||||
// the center of the 4 wheel positions (in world coordinates).
|
||||
|
||||
Vec3 from(0, 0, 0);
|
||||
for (unsigned int i = 0; i < 4; i++)
|
||||
from += m_vehicle->getWheelInfo(i).m_raycastInfo.m_hardPointWS;
|
||||
|
||||
// Add a certain epsilon (0.3) to the height of the kart. This avoids
|
||||
// problems of the ray being cast from under the track (which happened
|
||||
// e.g. on tux tollway when jumping down from the ramp, when the chassis
|
||||
// partly tunnels through the track). While tunneling should not be
|
||||
// happening (since Z velocity is clamped), the epsilon is left in place
|
||||
// just to be on the safe side (it will not hit the chassis itself).
|
||||
from = from/4 + Vec3(0,0.3f,0);
|
||||
|
||||
m_terrain_info->update(getTrans().getBasis(), from);
|
||||
|
||||
if(m_body->getBroadphaseHandle())
|
||||
{
|
||||
m_body->getBroadphaseHandle()->m_collisionFilterGroup = old_group;
|
||||
@@ -2253,7 +2273,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
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "karts/kart_properties.hpp"
|
||||
#include "karts/player_difficulty.hpp"
|
||||
#include "tracks/terrain_info.hpp"
|
||||
#include "utils/no_copy.hpp"
|
||||
|
||||
class btKart;
|
||||
@@ -52,6 +51,7 @@ class Skidding;
|
||||
class SkidMarks;
|
||||
class SlipStream;
|
||||
class Stars;
|
||||
class TerrainInfo;
|
||||
|
||||
/** The main kart class. All type of karts are of this object, but with
|
||||
* different controllers. The controllers are what turn a kart into a
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -123,6 +123,7 @@ World::World() : WorldStatus(), m_clear_color(255,100,101,140)
|
||||
m_schedule_tutorial = false;
|
||||
m_is_network_world = false;
|
||||
m_weather = NULL;
|
||||
m_force_disable_fog = false;
|
||||
|
||||
m_stop_music_when_dialog_open = true;
|
||||
|
||||
@@ -740,6 +741,12 @@ void World::moveKartTo(AbstractKart* kart, const btTransform &transform)
|
||||
kart->setRotation(pos.getRotation());
|
||||
|
||||
kart->getBody()->setCenterOfMassTransform(pos);
|
||||
// The raycast to determine the terrain underneath the kart is done from
|
||||
// the centre point of the 4 wheel positions. After a rescue, the wheel
|
||||
// positions need to be updated (otherwise the raycast will be done from
|
||||
// the previous position, which might be the position that triggered
|
||||
// the rescue in the first place).
|
||||
kart->getVehicle()->updateAllWheelPositions();
|
||||
|
||||
// Project kart to surface of track
|
||||
// This will set the physics transform
|
||||
|
||||
@@ -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++)
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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++)
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "karts/kart.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "physics/triangle_mesh.hpp"
|
||||
#include "tracks/terrain_info.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
|
||||
#define ROLLING_INFLUENCE_FIX
|
||||
@@ -361,13 +362,20 @@ const btTransform& btKart::getChassisWorldTransform() const
|
||||
} // getChassisWorldTransform
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void btKart::updateVehicle( btScalar step )
|
||||
void btKart::updateAllWheelPositions()
|
||||
{
|
||||
for (int i=0;i<getNumWheels();i++)
|
||||
{
|
||||
updateWheelTransform(i,false);
|
||||
}
|
||||
|
||||
} // updateAllWheelPositions
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void btKart::updateVehicle( btScalar step )
|
||||
{
|
||||
updateAllWheelPositions();
|
||||
|
||||
const btTransform& chassisTrans = getChassisWorldTransform();
|
||||
|
||||
btVector3 forwardW(chassisTrans.getBasis()[0][m_indexForwardAxis],
|
||||
@@ -980,6 +988,10 @@ void btKart::updateFriction(btScalar timeStep)
|
||||
// ----------------------------------------------------------------------------
|
||||
void btKart::debugDraw(btIDebugDraw* debugDrawer)
|
||||
{
|
||||
const btVector3 &from = m_kart->getTerrainInfo()->getOrigin();
|
||||
const btVector3 &to = m_kart->getTerrainInfo()->getHitPoint();
|
||||
debugDrawer->drawLine(from, to, btVector3(0.5, 0.5, 0));
|
||||
|
||||
for (int v=0;v<getNumWheels();v++)
|
||||
{
|
||||
btVector3 wheelColor(0,1,1);
|
||||
|
||||
@@ -180,6 +180,7 @@ public:
|
||||
void setSliding(bool active);
|
||||
void instantSpeedIncreaseTo(float speed);
|
||||
void capSpeed(float max_speed);
|
||||
void updateAllWheelPositions();
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns true if both rear visual wheels touch the ground. */
|
||||
bool visualWheelsTouchGround() const
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -67,11 +67,3 @@ void CutsceneGUI::renderGlobal(float dt)
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CutsceneGUI::renderPlayerView(const AbstractKart *kart)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -70,7 +70,6 @@ public:
|
||||
int deviceID,
|
||||
int btnID,
|
||||
int axisDir,
|
||||
int axisRange,
|
||||
int value);
|
||||
|
||||
/** \brief implement callback from parent class GUIEngine::Screen */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -837,8 +837,15 @@ void RaceResultGUI::determineGPLayout()
|
||||
ri->m_y_pos = (float)(m_top+rank*m_distance_between_rows);
|
||||
int p = race_manager->getKartPrevScore(kart_id);
|
||||
ri->m_current_displayed_points = (float)p;
|
||||
ri->m_new_points =
|
||||
(float)race_manager->getPositionScore(kart->getPosition());
|
||||
if (kart->isEliminated())
|
||||
{
|
||||
ri->m_new_points = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ri->m_new_points =
|
||||
(float)race_manager->getPositionScore(kart->getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
// Now update the GP ranks, and determine the new position
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -66,21 +66,26 @@ void TerrainInfo::update(const Vec3 &from)
|
||||
->castRay(from, to, &m_hit_point, &m_material,
|
||||
&m_normal, /*interpolate*/false);
|
||||
} // update
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Update the terrain information based on the latest position.
|
||||
* \param Position from which to start the rayast from.
|
||||
* \param tran The transform ov the kart
|
||||
* \param from World coordinates from which to start the raycast.
|
||||
*/
|
||||
void TerrainInfo::update(const btTransform &trans, const Vec3 &offset)
|
||||
void TerrainInfo::update(const btMatrix3x3 &rotation, const Vec3 &from)
|
||||
{
|
||||
m_last_material = m_material;
|
||||
btVector3 from = trans(offset);
|
||||
// Save the origin for debug drawing
|
||||
m_origin_ray = from;
|
||||
|
||||
// Compute the 'to' vector by rotating a long 'down' vectory by the
|
||||
// kart rotation, and adding the start point to it.
|
||||
btVector3 to(0, -10000.0f, 0);
|
||||
to = trans(to);
|
||||
to = from + rotation*to;
|
||||
|
||||
const TriangleMesh &tm = World::getWorld()->getTrack()->getTriangleMesh();
|
||||
tm.castRay(from, to, &m_hit_point, &m_material, &m_normal,
|
||||
/*interpolate*/true);
|
||||
|
||||
// Now also raycast against all track objects (that are driveable). If
|
||||
// there should be a closer result (than the one against the main track
|
||||
// mesh), its data will be returned.
|
||||
|
||||
@@ -40,6 +40,9 @@ private:
|
||||
/** The point that was hit. */
|
||||
Vec3 m_hit_point;
|
||||
|
||||
/** DEBUG only: origin of raycast. */
|
||||
Vec3 m_origin_ray;
|
||||
|
||||
public:
|
||||
TerrainInfo();
|
||||
TerrainInfo(const Vec3 &pos);
|
||||
@@ -47,14 +50,14 @@ public:
|
||||
|
||||
bool getSurfaceInfo(const Vec3 &from, Vec3 *position,
|
||||
const Material **m);
|
||||
virtual void update(const btTransform &trans, const Vec3 &offset);
|
||||
virtual void update(const btMatrix3x3 &rotation, const Vec3 &from);
|
||||
virtual void update(const Vec3 &from);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Simple wrapper with no offset. */
|
||||
virtual void update(const btTransform &trans)
|
||||
virtual void update(const btMatrix3x3 &rotation)
|
||||
{
|
||||
update(trans, Vec3(0,0,0));
|
||||
update(rotation, Vec3(0,0,0));
|
||||
}
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns the height of the terrain. we're currently above */
|
||||
@@ -75,6 +78,7 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns the hit point of the raycast. */
|
||||
const btVector3& getHitPoint() const { return m_hit_point; }
|
||||
const Vec3& getOrigin() const { return m_origin_ray; }
|
||||
|
||||
}; // TerrainInfo
|
||||
|
||||
|
||||
@@ -2440,7 +2440,7 @@ bool Track::findGround(AbstractKart *kart)
|
||||
|
||||
btTransform t = kart->getBody()->getCenterOfMassTransform();
|
||||
// The computer offset is slightly too large, it should take
|
||||
// the default suspension rest insteat of suspension rest (i.e. the
|
||||
// the default suspension rest instead of suspension rest (i.e. the
|
||||
// length of the suspension with the weight of the kart resting on
|
||||
// it). On the other hand this initial bouncing looks nice imho
|
||||
// - so I'll leave it in for now.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ enum DebugMenuCommand
|
||||
DEBUG_GUI_CAM_TOP,
|
||||
DEBUG_GUI_CAM_WHEEL,
|
||||
DEBUG_GUI_CAM_BEHIND_KART,
|
||||
DEBUG_GUI_CAM_SIDE_OF_KART,
|
||||
DEBUG_GUI_CAM_NORMAL,
|
||||
DEBUG_GUI_CAM_SMOOTH,
|
||||
DEBUG_GUI_CAM_ATTACH,
|
||||
@@ -251,8 +252,9 @@ bool onEvent(const SEvent &event)
|
||||
sub->addItem(L"Toggle GUI", DEBUG_GUI_TOGGLE);
|
||||
sub->addItem(L"Hide karts", DEBUG_GUI_HIDE_KARTS);
|
||||
sub->addItem(L"Top view", DEBUG_GUI_CAM_TOP);
|
||||
sub->addItem(L"Wheel view", DEBUG_GUI_CAM_WHEEL);
|
||||
sub->addItem(L"Behind wheel view", DEBUG_GUI_CAM_WHEEL);
|
||||
sub->addItem(L"Behind kart view", DEBUG_GUI_CAM_BEHIND_KART);
|
||||
sub->addItem(L"Side of kart view", DEBUG_GUI_CAM_SIDE_OF_KART);
|
||||
sub->addItem(L"First person view", DEBUG_GUI_CAM_FREE);
|
||||
sub->addItem(L"Normal view", DEBUG_GUI_CAM_NORMAL);
|
||||
sub->addItem(L"Toggle smooth camera", DEBUG_GUI_CAM_SMOOTH);
|
||||
@@ -527,6 +529,11 @@ bool onEvent(const SEvent &event)
|
||||
UserConfigParams::m_camera_debug = 4;
|
||||
irr_driver->getDevice()->getCursorControl()->setVisible(true);
|
||||
}
|
||||
else if (cmdID == DEBUG_GUI_CAM_SIDE_OF_KART)
|
||||
{
|
||||
UserConfigParams::m_camera_debug = 5;
|
||||
irr_driver->getDevice()->getCursorControl()->setVisible(true);
|
||||
}
|
||||
else if (cmdID == DEBUG_GUI_CAM_FREE)
|
||||
{
|
||||
UserConfigParams::m_camera_debug = 3;
|
||||
|
||||
Reference in New Issue
Block a user