+
diff --git a/data/shaders/dof.frag b/data/shaders/dof.frag
index 35259d26d..90938d68f 100644
--- a/data/shaders/dof.frag
+++ b/data/shaders/dof.frag
@@ -21,62 +21,58 @@ void main()
vec2 offset = 10. / screen;
- vec4 col = texture2D(tex, uv);
+ vec4 col = texture(tex, uv);
vec4 colOriginal = col;
// Weight from here http://artmartinsh.blogspot.fr/2010/02/glsl-lens-blur-filter-with-bokeh.html
- col += texture2D(tex, uv + (vec2(0.0, 0.4) * offset) * blur);
- col += texture2D(tex, uv + (vec2(0.15, 0.37) * offset) * blur);
- col += texture2D(tex, uv + (vec2(0.29,0.29) * offset) * blur);
- col += texture2D(tex, uv + (vec2(-0.37,0.15) * offset) * blur);
- col += texture2D(tex, uv + (vec2(0.4, 0.0) * offset) * blur);
- col += texture2D(tex, uv + (vec2(0.37, -0.15) * offset) * blur);
- col += texture2D(tex, uv + (vec2(0.29, -0.29) * offset) * blur);
- col += texture2D(tex, uv + (vec2(-0.15, -0.37) * offset) * blur);
- col += texture2D(tex, uv + (vec2(0.0, -0.4) * offset) * blur);
- col += texture2D(tex, uv + (vec2(-0.15, 0.37) * offset) * blur);
- col += texture2D(tex, uv + (vec2(-0.29, 0.29) * offset) * blur);
- col += texture2D(tex, uv + (vec2(0.37, 0.15) * offset) * blur);
- col += texture2D(tex, uv + (vec2(-0.4, 0.0) * offset) * blur);
- col += texture2D(tex, uv + (vec2(-0.37, -0.15) * offset) * blur);
- col += texture2D(tex, uv + (vec2(-0.29, -0.29) * offset) * blur);
- col += texture2D(tex, uv + (vec2(0.15, -0.37) * offset) * blur);
+ col += texture(tex, uv + (vec2(0.0, 0.4) * offset) * blur);
+ col += texture(tex, uv + (vec2(0.15, 0.37) * offset) * blur);
+ col += texture(tex, uv + (vec2(0.29,0.29) * offset) * blur);
+ col += texture(tex, uv + (vec2(-0.37,0.15) * offset) * blur);
+ col += texture(tex, uv + (vec2(0.4, 0.0) * offset) * blur);
+ col += texture(tex, uv + (vec2(0.37, -0.15) * offset) * blur);
+ col += texture(tex, uv + (vec2(0.29, -0.29) * offset) * blur);
+ col += texture(tex, uv + (vec2(-0.15, -0.37) * offset) * blur);
+ col += texture(tex, uv + (vec2(0.0, -0.4) * offset) * blur);
+ col += texture(tex, uv + (vec2(-0.15, 0.37) * offset) * blur);
+ col += texture(tex, uv + (vec2(-0.29, 0.29) * offset) * blur);
+ col += texture(tex, uv + (vec2(0.37, 0.15) * offset) * blur);
+ col += texture(tex, uv + (vec2(-0.4, 0.0) * offset) * blur);
+ col += texture(tex, uv + (vec2(-0.37, -0.15) * offset) * blur);
+ col += texture(tex, uv + (vec2(-0.29, -0.29) * offset) * blur);
+ col += texture(tex, uv + (vec2(0.15, -0.37) * offset) * blur);
- col += texture2D(tex, uv + (vec2(0.15, 0.37) * offset) * blur * 0.9);
- col += texture2D(tex, uv + (vec2(-0.37, 0.15) * offset) * blur * 0.9);
- col += texture2D(tex, uv + (vec2(0.37, -0.15) * offset) * blur * 0.9);
- col += texture2D(tex, uv + (vec2(-0.15, -0.37) * offset) * blur * 0.9);
- col += texture2D(tex, uv + (vec2(-0.15, 0.37) * offset) * blur * 0.9);
- col += texture2D(tex, uv + (vec2(0.37, 0.15) * offset) * blur * 0.9);
- col += texture2D(tex, uv + (vec2(-0.37, -0.15) * offset) * blur * 0.9);
- col += texture2D(tex, uv + (vec2(0.15, -0.37) * offset) * blur * 0.9);
+ col += texture(tex, uv + (vec2(0.15, 0.37) * offset) * blur * 0.9);
+ col += texture(tex, uv + (vec2(-0.37, 0.15) * offset) * blur * 0.9);
+ col += texture(tex, uv + (vec2(0.37, -0.15) * offset) * blur * 0.9);
+ col += texture(tex, uv + (vec2(-0.15, -0.37) * offset) * blur * 0.9);
+ col += texture(tex, uv + (vec2(-0.15, 0.37) * offset) * blur * 0.9);
+ col += texture(tex, uv + (vec2(0.37, 0.15) * offset) * blur * 0.9);
+ col += texture(tex, uv + (vec2(-0.37, -0.15) * offset) * blur * 0.9);
+ col += texture(tex, uv + (vec2(0.15, -0.37) * offset) * blur * 0.9);
- col += texture2D(tex, uv + (vec2(0.29, 0.29) * offset) * blur * 0.7);
- col += texture2D(tex, uv + (vec2(0.4, 0.0) * offset) * blur * 0.7);
- col += texture2D(tex, uv + (vec2(0.29, -0.29) * offset) * blur * 0.7);
- col += texture2D(tex, uv + (vec2(0.0, -0.4) * offset) * blur * 0.7);
- col += texture2D(tex, uv + (vec2(-0.29, 0.29) * offset) * blur * 0.7);
- col += texture2D(tex, uv + (vec2(-0.4, 0.0) * offset) * blur * 0.7);
- col += texture2D(tex, uv + (vec2(-0.29, -0.29) * offset) * blur * 0.7);
- col += texture2D(tex, uv + (vec2(0.0, 0.4) * offset) * blur *0.7);
+ col += texture(tex, uv + (vec2(0.29, 0.29) * offset) * blur * 0.7);
+ col += texture(tex, uv + (vec2(0.4, 0.0) * offset) * blur * 0.7);
+ col += texture(tex, uv + (vec2(0.29, -0.29) * offset) * blur * 0.7);
+ col += texture(tex, uv + (vec2(0.0, -0.4) * offset) * blur * 0.7);
+ col += texture(tex, uv + (vec2(-0.29, 0.29) * offset) * blur * 0.7);
+ col += texture(tex, uv + (vec2(-0.4, 0.0) * offset) * blur * 0.7);
+ col += texture(tex, uv + (vec2(-0.29, -0.29) * offset) * blur * 0.7);
+ col += texture(tex, uv + (vec2(0.0, 0.4) * offset) * blur *0.7);
- col += texture2D(tex, uv + (vec2(0.29, 0.29) * offset) * blur * 0.4);
- col += texture2D(tex, uv + (vec2(0.4, 0.0) * offset) * blur * 0.4);
- col += texture2D(tex, uv + (vec2(0.29, -0.29) * offset) * blur * 0.4);
- col += texture2D(tex, uv + (vec2(0.0, -0.4) * offset) * blur * 0.4);
- col += texture2D(tex, uv + (vec2(-0.29, 0.29) * offset) * blur * 0.4);
- col += texture2D(tex, uv + (vec2(-0.4, 0.0) * offset) * blur * 0.4);
- col += texture2D(tex, uv + (vec2(-0.29, -0.29) * offset) * blur * 0.4);
- col += texture2D(tex, uv + (vec2(0.0, 0.4) * offset) * blur * 0.4);
+ col += texture(tex, uv + (vec2(0.29, 0.29) * offset) * blur * 0.4);
+ col += texture(tex, uv + (vec2(0.4, 0.0) * offset) * blur * 0.4);
+ col += texture(tex, uv + (vec2(0.29, -0.29) * offset) * blur * 0.4);
+ col += texture(tex, uv + (vec2(0.0, -0.4) * offset) * blur * 0.4);
+ col += texture(tex, uv + (vec2(-0.29, 0.29) * offset) * blur * 0.4);
+ col += texture(tex, uv + (vec2(-0.4, 0.0) * offset) * blur * 0.4);
+ col += texture(tex, uv + (vec2(-0.29, -0.29) * offset) * blur * 0.4);
+ col += texture(tex, uv + (vec2(0.0, 0.4) * offset) * blur * 0.4);
col = vec4(col.rgb / 41.0, col.a);
depth = clamp((FragPos.z/280), 0., 1.);
depth = (1 - depth);
vec3 final = colOriginal.rgb * depth + col.rgb * (1 - depth);
-/*
- FragColor.xyz = vec3(depth);
- FragColor.a = 1.0;
- */
FragColor = vec4(final, 1.);
}
diff --git a/data/shaders/ssao.frag b/data/shaders/ssao.frag
index 824b773d6..95daf0f89 100644
--- a/data/shaders/ssao.frag
+++ b/data/shaders/ssao.frag
@@ -26,10 +26,10 @@ out float AO;
const float sigma = 1.;
const float tau = 7.;
-const float beta = 0.0001;
+const float beta = 0.001;
const float epsilon = .00001;
-const float radius = 1.5;
-const float k = 1.;
+const float radius = 1.;
+const float k = 1.5;
#define SAMPLES 16
@@ -64,9 +64,8 @@ void main(void)
float h = r * alpha;
vec2 offset = h * vec2(cos(theta), sin(theta)) * screen;
- float m = round(log2(h) + 7);
+ float m = round(log2(h) + 6);
ivec2 ioccluder_uv = ivec2(x, y) + ivec2(offset);
- ioccluder_uv = (ioccluder_uv << int(m)) >> int(m);
if (ioccluder_uv.x < 0 || ioccluder_uv.x > screen.x || ioccluder_uv.y < 0 || ioccluder_uv.y > screen.y) continue;
diff --git a/lib/irrlicht/include/IGUISkin.h b/lib/irrlicht/include/IGUISkin.h
index d3bf337df..53664f3da 100644
--- a/lib/irrlicht/include/IGUISkin.h
+++ b/lib/irrlicht/include/IGUISkin.h
@@ -12,6 +12,7 @@
namespace irr
{
+namespace video { class ITexture; }
namespace gui
{
class IGUIFont;
@@ -564,6 +565,10 @@ namespace gui
//! get the type of this skin
virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
+
+ virtual void draw2DImage(const video::ITexture* texture, const core::rect& destRect,
+ const core::rect& sourceRect, const core::rect* clipRect,
+ const video::SColor* const colors, bool useAlphaChannelOfTexture) = 0;
};
diff --git a/lib/irrlicht/source/Irrlicht/CGUIButton.cpp b/lib/irrlicht/source/Irrlicht/CGUIButton.cpp
index 5a451cdbd..21be74646 100644
--- a/lib/irrlicht/source/Irrlicht/CGUIButton.cpp
+++ b/lib/irrlicht/source/Irrlicht/CGUIButton.cpp
@@ -249,11 +249,16 @@ void CGUIButton::draw()
pos.X -= ImageRect.getWidth() / 2;
pos.Y -= ImageRect.getHeight() / 2;
- driver->draw2DImage(Image,
- ScaleImage? AbsoluteRect :
- core::recti(pos, ImageRect.getSize()),
- ImageRect, &AbsoluteClippingRect,
- 0, UseAlphaChannel);
+ skin->draw2DImage(Image,
+ ScaleImage ? AbsoluteRect :
+ core::recti(pos, ImageRect.getSize()),
+ ImageRect, &AbsoluteClippingRect,
+ 0, UseAlphaChannel);
+ //driver->draw2DImage(Image,
+ // ScaleImage? AbsoluteRect :
+ // core::recti(pos, ImageRect.getSize()),
+ // ImageRect, &AbsoluteClippingRect,
+ // 0, UseAlphaChannel);
}
}
else
diff --git a/lib/irrlicht/source/Irrlicht/CGUISkin.cpp b/lib/irrlicht/source/Irrlicht/CGUISkin.cpp
index b0b2b39c3..df3238e5c 100644
--- a/lib/irrlicht/source/Irrlicht/CGUISkin.cpp
+++ b/lib/irrlicht/source/Irrlicht/CGUISkin.cpp
@@ -179,6 +179,13 @@ CGUISkin::~CGUISkin()
}
+void CGUISkin::draw2DImage(const video::ITexture* texture, const core::rect& destRect,
+ const core::rect& sourceRect, const core::rect* clipRect,
+ const video::SColor* const colors, bool useAlphaChannelOfTexture)
+{
+ Driver->draw2DImage(texture, destRect, sourceRect, clipRect, colors, useAlphaChannelOfTexture);
+}
+
//! returns default color
video::SColor CGUISkin::getColor(EGUI_DEFAULT_COLOR color) const
{
diff --git a/lib/irrlicht/source/Irrlicht/CGUISkin.h b/lib/irrlicht/source/Irrlicht/CGUISkin.h
index 903d856d6..ebaab6d2a 100644
--- a/lib/irrlicht/source/Irrlicht/CGUISkin.h
+++ b/lib/irrlicht/source/Irrlicht/CGUISkin.h
@@ -224,6 +224,10 @@ namespace gui
//! scripting languages, editors, debuggers or xml deserialization purposes.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
+ virtual void draw2DImage(const video::ITexture* texture, const core::rect& destRect,
+ const core::rect& sourceRect, const core::rect* clipRect,
+ const video::SColor* const colors, bool useAlphaChannelOfTexture);
+
private:
video::SColor Colors[EGDC_COUNT];
diff --git a/src/graphics/glwrap.cpp b/src/graphics/glwrap.cpp
index 4dfd2f2bc..638f3f192 100644
--- a/src/graphics/glwrap.cpp
+++ b/src/graphics/glwrap.cpp
@@ -490,6 +490,7 @@ ScopedGPUTimer::ScopedGPUTimer(GPUTimer &timer)
if (!UserConfigParams::m_profiler_enabled) return;
if (profiler.isFrozen()) return;
+#ifdef GL_TIME_ELAPSED
irr::video::COpenGLDriver *gl_driver = (irr::video::COpenGLDriver *)irr_driver->getDevice()->getVideoDriver();
if (!timer.initialised)
{
@@ -497,14 +498,17 @@ ScopedGPUTimer::ScopedGPUTimer(GPUTimer &timer)
timer.initialised = true;
}
gl_driver->extGlBeginQuery(GL_TIME_ELAPSED, timer.query);
+#endif
}
ScopedGPUTimer::~ScopedGPUTimer()
{
if (!UserConfigParams::m_profiler_enabled) return;
if (profiler.isFrozen()) return;
+#ifdef GL_TIME_ELAPSED
irr::video::COpenGLDriver *gl_driver = (irr::video::COpenGLDriver *)irr_driver->getDevice()->getVideoDriver();
gl_driver->extGlEndQuery(GL_TIME_ELAPSED);
+#endif
}
GPUTimer::GPUTimer() : initialised(false)
diff --git a/src/graphics/glwrap.hpp b/src/graphics/glwrap.hpp
index df3827d0f..56fd99ee4 100644
--- a/src/graphics/glwrap.hpp
+++ b/src/graphics/glwrap.hpp
@@ -5,6 +5,12 @@
# include
# include
# define OGL32CTX
+# ifdef GL_ARB_instanced_arrays
+# define glVertexAttribDivisor glVertexAttribDivisorARB
+# endif
+# ifndef GL_TEXTURE_SWIZZLE_RGBA
+# define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
+# endif
#elif defined(ANDROID)
# include
#elif defined(WIN32)
diff --git a/src/graphics/gpuparticles.cpp b/src/graphics/gpuparticles.cpp
index 8b14bee60..0aed43cd4 100644
--- a/src/graphics/gpuparticles.cpp
+++ b/src/graphics/gpuparticles.cpp
@@ -195,7 +195,7 @@ void ParticleSystemProxy::generateParticlesFromBoxEmitter(scene::IParticleBoxEmi
memcpy(&(initialvalue[i].PositionX), &(particles[i].PositionX), 3 * sizeof(float));
generateLifetimeSizeDirection(emitter, initialvalue[i].Lifetime, initialvalue[i].Size,
initialvalue[i].DirectionX, initialvalue[i].DirectionY, initialvalue[i].DirectionZ);
- memcpy(&(particles[i].DirectionX), &(initialvalue[i].DirectionZ), 4 * sizeof(float));
+ memcpy(&(particles[i].DirectionX), &(initialvalue[i].DirectionX), 4 * sizeof(float));
}
glBindBuffer(GL_ARRAY_BUFFER, initial_values_buffer);
glBufferData(GL_ARRAY_BUFFER, count * sizeof(ParticleData), initialvalue, GL_STREAM_DRAW);
diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp
index 9a2d40b1f..b0d218543 100644
--- a/src/graphics/irr_driver.cpp
+++ b/src/graphics/irr_driver.cpp
@@ -112,6 +112,7 @@ IrrDriver::IrrDriver()
m_wind = new Wind();
m_mipviz = m_wireframe = m_normals = m_ssaoviz = \
m_lightviz = m_shadowviz = m_distortviz = 0;
+ SkyboxCubeMap = 0;
} // IrrDriver
// ----------------------------------------------------------------------------
@@ -436,16 +437,24 @@ void IrrDriver::initDevice()
GLMajorVersion = 2;
GLMinorVersion = 1;
- glGetIntegerv(GL_MAJOR_VERSION, &GLMajorVersion);
- glGetIntegerv(GL_MINOR_VERSION, &GLMinorVersion);
+ // Call to glGetIntegerv should not be made if --no-graphics is used
+ if(!ProfileWorld::isNoGraphics())
+ {
+ glGetIntegerv(GL_MAJOR_VERSION, &GLMajorVersion);
+ glGetIntegerv(GL_MINOR_VERSION, &GLMinorVersion);
+ }
Log::info("IrrDriver", "OPENGL VERSION IS %d.%d", GLMajorVersion, GLMinorVersion);
m_glsl = (GLMajorVersion > 3 || (GLMajorVersion == 3 && GLMinorVersion >= 1));
// Parse extensions
hasVSLayer = false;
- const GLubyte *extensions = glGetString(GL_EXTENSIONS);
- if (extensions && strstr((const char*)extensions, "GL_AMD_vertex_shader_layer") != NULL)
+ // Default false value for hasVSLayer if --no-graphics argument is used
+ if (!ProfileWorld::isNoGraphics())
+ {
+ const GLubyte *extensions = glGetString(GL_EXTENSIONS);
+ if (extensions && strstr((const char*)extensions, "GL_AMD_vertex_shader_layer") != NULL)
hasVSLayer = true;
+ }
@@ -1201,7 +1210,7 @@ void IrrDriver::suppressSkyBox()
{
SkyboxTextures.clear();
SphericalHarmonicsTextures.clear();
- if (SkyboxCubeMap)
+ if ((SkyboxCubeMap) && (!ProfileWorld::isNoGraphics()))
glDeleteTextures(1, &SkyboxCubeMap);
SkyboxCubeMap = 0;
}
@@ -2305,7 +2314,7 @@ void IrrDriver::applyObjectPassShader()
// ----------------------------------------------------------------------------
-scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy,
+scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy, float radius,
float r, float g, float b, bool sun, scene::ISceneNode* parent)
{
if (m_glsl)
@@ -2314,7 +2323,7 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy,
LightNode *light = NULL;
if (!sun)
- light = new LightNode(m_scene_manager, parent, energy, r, g, b);
+ light = new LightNode(m_scene_manager, parent, energy, radius, r, g, b);
else
light = new SunNode(m_scene_manager, parent, r, g, b);
diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp
index 08cd55b4b..04ebfbf1f 100644
--- a/src/graphics/irr_driver.hpp
+++ b/src/graphics/irr_driver.hpp
@@ -563,8 +563,8 @@ public:
void applyObjectPassShader();
void applyObjectPassShader(scene::ISceneNode * const node, bool rimlit = false);
// ------------------------------------------------------------------------
- scene::ISceneNode *addLight(const core::vector3df &pos, float energy = 1., float r = 1.0f,
- float g = 1.0f, float b = 1.0f, bool sun = false, scene::ISceneNode* parent = NULL);
+ scene::ISceneNode *addLight(const core::vector3df &pos, float energy, float radius, float r,
+ float g, float b, bool sun = false, scene::ISceneNode* parent = NULL);
// ------------------------------------------------------------------------
void clearLights();
// ------------------------------------------------------------------------
diff --git a/src/graphics/light.cpp b/src/graphics/light.cpp
index d534ad4cb..068809995 100644
--- a/src/graphics/light.cpp
+++ b/src/graphics/light.cpp
@@ -34,10 +34,11 @@ using namespace core;
aabbox3df LightNode::box;
-LightNode::LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float e, float r, float g, float b):
+LightNode::LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float e, float d, float r, float g, float b):
ISceneNode(parent == NULL ? mgr->getRootSceneNode() : parent, mgr, -1)
{
m_energy = e;
+ m_radius = d;
m_energy_multiplier = 1.0f;
m_color[0] = r;
m_color[1] = g;
diff --git a/src/graphics/light.hpp b/src/graphics/light.hpp
index 1f17c5aad..62b3bd44f 100644
--- a/src/graphics/light.hpp
+++ b/src/graphics/light.hpp
@@ -40,7 +40,7 @@ class LightNode: public scene::ISceneNode
#endif
public:
- LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float energy, float r, float g, float b);
+ LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float energy, float d, float r, float g, float b);
virtual ~LightNode();
virtual void render() OVERRIDE;
@@ -55,7 +55,7 @@ public:
virtual u32 getMaterialCount() const OVERRIDE { return 1; }
virtual bool isPointLight() { return true; }
- //float getRadius() const { return m_radius; }
+ float getRadius() const { return m_radius; }
float getEnergy() const { return m_energy; }
float getEffectiveEnergy() const { return m_energy_multiplier * m_energy; }
core::vector3df getColor() const { return core::vector3df(m_color[0], m_color[1], m_color[2]); }
@@ -66,7 +66,7 @@ public:
protected:
static core::aabbox3df box;
- //float m_radius;
+ float m_radius;
float m_color[3];
float m_energy;
diff --git a/src/graphics/render.cpp b/src/graphics/render.cpp
index 13e71a5c8..342eb945c 100644
--- a/src/graphics/render.cpp
+++ b/src/graphics/render.cpp
@@ -341,6 +341,8 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, std::vector
renderDisplacement();
PROFILER_POP_CPU_MARKER();
}
+ // Ensure that no object will be drawn after that by using invalid pass
+ irr_driver->setPhase(PASS_COUNT);
}
// --------------------------------------------
@@ -684,7 +686,7 @@ void IrrDriver::computeCameraMatrix(scene::ICameraSceneNode * const camnode)
glBindBuffer(GL_UNIFORM_BUFFER, SharedObject::ViewProjectionMatrixesUBO);
glBufferSubData(GL_UNIFORM_BUFFER, 0, 16 * 8 * sizeof(float), tmp);
- delete tmp;
+ delete []tmp;
}
void IrrDriver::renderShadows()
@@ -874,7 +876,7 @@ void IrrDriver::renderLights(scene::ICameraSceneNode * const camnode, float dt)
PointLightsInfo[lightnum].blue = col.Z;
// Light radius
- PointLightsInfo[lightnum].radius = 20 * light_node->getEffectiveEnergy();
+ PointLightsInfo[lightnum].radius = light_node->getRadius();
}
}
if (lightnum > MAXLIGHT)
diff --git a/src/graphics/sun.cpp b/src/graphics/sun.cpp
index dd20a74b4..3399cd668 100644
--- a/src/graphics/sun.cpp
+++ b/src/graphics/sun.cpp
@@ -35,7 +35,7 @@ using namespace scene;
using namespace core;
SunNode::SunNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float r, float g, float b):
- LightNode(mgr, parent, 0., r, g, b)
+ LightNode(mgr, parent, 0., 0., r, g, b)
{
m_color[0] = r;
m_color[1] = g;
diff --git a/src/guiengine/skin.cpp b/src/guiengine/skin.cpp
index e0d015a90..6d2292573 100644
--- a/src/guiengine/skin.cpp
+++ b/src/guiengine/skin.cpp
@@ -2267,6 +2267,15 @@ void Skin::drawIcon (IGUIElement *element, EGUI_DEFAULT_ICON icon,
// -----------------------------------------------------------------------------
+void Skin::draw2DImage(const video::ITexture* texture, const core::rect& destRect,
+ const core::rect& sourceRect, const core::rect* clipRect,
+ const video::SColor* const colors, bool useAlphaChannelOfTexture)
+{
+ ::draw2DImage(texture, destRect, sourceRect, clipRect, colors, useAlphaChannelOfTexture);
+}
+
+// -----------------------------------------------------------------------------
+
video::SColor Skin::getColor (EGUI_DEFAULT_COLOR color) const
{
/*
diff --git a/src/guiengine/skin.hpp b/src/guiengine/skin.hpp
index 3c8eac393..f13a5066a 100644
--- a/src/guiengine/skin.hpp
+++ b/src/guiengine/skin.hpp
@@ -381,6 +381,11 @@ namespace GUIEngine
const core::rect< s32 > &rect,
const core::rect< s32 > *clip,
core::rect* checkClientArea=0);
+
+ virtual void draw2DImage(const video::ITexture* texture, const core::rect& destRect,
+ const core::rect& sourceRect, const core::rect* clipRect,
+ const video::SColor* const colors, bool useAlphaChannelOfTexture);
+
virtual void drawIcon (gui::IGUIElement *element,
gui::EGUI_DEFAULT_ICON icon,
const core::position2di position,
diff --git a/src/karts/controller/skidding_ai.cpp b/src/karts/controller/skidding_ai.cpp
index 309b05974..ee36e1745 100644
--- a/src/karts/controller/skidding_ai.cpp
+++ b/src/karts/controller/skidding_ai.cpp
@@ -1276,8 +1276,8 @@ void SkiddingAI::handleItems(const float dt)
break;
// Don't fire if the kart we are aiming at is invulnerable.
- if (fire_backwards && m_kart_behind->isInvulnerable() ||
- !fire_backwards && m_kart_ahead->isInvulnerable() )
+ if ((fire_backwards && m_kart_behind && m_kart_behind->isInvulnerable()) ||
+ (!fire_backwards && m_kart_ahead && m_kart_ahead->isInvulnerable()) )
return;
float distance = fire_backwards ? m_distance_behind
diff --git a/src/main.cpp b/src/main.cpp
index 9b286c32f..09eaf0e34 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -856,7 +856,7 @@ int handleCmdLine()
}
} // --laps
- if(CommandLine::has("--profile-laps=", &n))
+ if(CommandLine::has("--profile-laps", &n))
{
if (n < 0)
{
diff --git a/src/network/protocols/connect_to_server.cpp b/src/network/protocols/connect_to_server.cpp
index 0cc8d314f..bc4dda7fd 100644
--- a/src/network/protocols/connect_to_server.cpp
+++ b/src/network/protocols/connect_to_server.cpp
@@ -153,7 +153,7 @@ void ConnectToServer::asynchronousUpdate()
if (m_server_address.ip == 0 || m_server_address.port == 0)
{ // server data not correct, hide address and stop
m_state = HIDING_ADDRESS;
- Log::error("ConnectToServer", "Server address is "ADDRESS_FORMAT, ADDRESS_ARGS(m_server_address.ip, m_server_address.port));
+ Log::error("ConnectToServer", "Server address is " ADDRESS_FORMAT, ADDRESS_ARGS(m_server_address.ip, m_server_address.port));
m_current_protocol_id = m_listener->requestStart(new HidePublicAddress());
return;
}
diff --git a/src/states_screens/feature_unlocked.cpp b/src/states_screens/feature_unlocked.cpp
index 07b24c348..d251c56e4 100644
--- a/src/states_screens/feature_unlocked.cpp
+++ b/src/states_screens/feature_unlocked.cpp
@@ -302,7 +302,7 @@ void FeatureUnlockedCutScene::init()
120, 120));
const core::vector3df &sun_pos = core::vector3df( 0, 200, 100.0f );
- m_light = irr_driver->addLight(sun_pos, 10000.0f, 1, 1, 1);
+ m_light = irr_driver->addLight(sun_pos, 10000.0f, 1., 1, 1, 1, true);
#ifdef DEBUG
m_light->setName("light");
#endif
diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp
index d66f9530b..fb4da2928 100644
--- a/src/tracks/track.cpp
+++ b/src/tracks/track.cpp
@@ -1719,7 +1719,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
}
const video::SColorf tmpf(m_sun_diffuse_color);
- m_sun = irr_driver->addLight(m_sun_position, 0., tmpf.r, tmpf.g, tmpf.b, true);
+ m_sun = irr_driver->addLight(m_sun_position, 0., 0., tmpf.r, tmpf.g, tmpf.b, true);
if (!irr_driver->isGLSL())
{
diff --git a/src/tracks/track_object_presentation.cpp b/src/tracks/track_object_presentation.cpp
index 02345c57f..c6d9f95e4 100644
--- a/src/tracks/track_object_presentation.cpp
+++ b/src/tracks/track_object_presentation.cpp
@@ -675,15 +675,15 @@ TrackObjectPresentationLight::TrackObjectPresentationLight(const XMLNode& xml_no
xml_node.get("color", &m_color);
const video::SColorf colorf(m_color);
- //m_distance = 25.0f;
- //xml_node.get("distance", &m_distance);
-
m_energy = 1.0f;
xml_node.get("energy", &m_energy);
+ m_distance = 20. * m_energy;
+ xml_node.get("distance", &m_distance);
+
if (irr_driver->isGLSL())
{
- m_node = irr_driver->addLight(m_init_xyz, m_energy, colorf.r, colorf.g, colorf.b, false, parent);
+ m_node = irr_driver->addLight(m_init_xyz, m_energy, m_distance, colorf.r, colorf.g, colorf.b, false, parent);
}
else
{
diff --git a/src/tracks/track_object_presentation.hpp b/src/tracks/track_object_presentation.hpp
index 561df9ff5..ba7bb95a5 100644
--- a/src/tracks/track_object_presentation.hpp
+++ b/src/tracks/track_object_presentation.hpp
@@ -307,7 +307,7 @@ class TrackObjectPresentationLight : public TrackObjectPresentationSceneNode
{
private:
video::SColor m_color;
- //float m_distance;
+ float m_distance;
float m_energy;
public:
diff --git a/src/utils/crash_reporting.cpp b/src/utils/crash_reporting.cpp
index 3caf1d9a3..67cb3fcc3 100644
--- a/src/utils/crash_reporting.cpp
+++ b/src/utils/crash_reporting.cpp
@@ -20,7 +20,7 @@
#include "log.hpp"
#include
-#ifdef WIN32
+#if defined(WIN32) && !defined(DEBUG)
// --------------------- Windows version -----------------
#include
#include