Commit e08e256f authored by hybrid's avatar hybrid

Fix docs for collision manager API, wrong return value was given.

Change default blend mode in OpenGL to SRC_ALPHA,ONE_MINUS_SRC_ALPHA
Use less precision in 2dmaterial test.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3399 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 6f27d721
......@@ -86,7 +86,7 @@ namespace scene
at a length of the far value of the camera at a position which
would be behind the 2d screen coodinates. */
virtual core::line3d<f32> getRayFromScreenCoordinates(
const core::position2d<s32> & pos, ICameraSceneNode* camera = 0) = 0;
const core::position2d<s32>& pos, ICameraSceneNode* camera = 0) = 0;
//! Calculates 2d screen position from a 3d position.
/** \param pos: 3D position in world space to be transformed
......@@ -95,12 +95,12 @@ namespace scene
camera is used.
\return 2d screen coordinates which a object in the 3d world
would have if it would be rendered to the screen. If the 3d
position is behind the camera, it is set to (-10000,-10000). In
position is behind the camera, it is set to (-1000,-1000). In
most cases you can ignore this fact, because if you use this
method for drawing a decorator over a 3d object, it will be
clipped by the screen borders. */
virtual core::position2d<s32> getScreenCoordinatesFrom3DPosition(
const core::vector3df & pos, ICameraSceneNode* camera=0) = 0;
const core::vector3df& pos, ICameraSceneNode* camera=0) = 0;
//! Gets the scene node, which is currently visible under the given screencoordinates, viewed from the currently active camera.
/** The collision tests are done using a bounding box for each
......
......@@ -470,7 +470,7 @@ void CGUIFont::draw(const core::stringw& text, const core::rect<s32>& position,
if (!Driver)
return;
core::dimension2d<s32> textDimension; // NOTE: don't make this u32 or the >> later on can fail when the dimension widht is < position width
core::dimension2d<s32> textDimension; // NOTE: don't make this u32 or the >> later on can fail when the dimension width is < position width
core::position2d<s32> offset = position.UpperLeftCorner;
if (hcenter || vcenter || clip)
......
......@@ -2460,7 +2460,7 @@ void COpenGLDriver::setRenderStates3DMode()
// Reset Texture Stages
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// switch back the matrices
glMatrixMode(GL_MODELVIEW);
......@@ -2978,14 +2978,14 @@ void COpenGLDriver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh
glMatrixMode(GL_PROJECTION);
const core::dimension2d<u32>& renderTargetSize = getCurrentRenderTargetSize();
core::matrix4 m;
m.buildProjectionMatrixOrthoLH(f32(renderTargetSize.Width), f32(-(s32)(renderTargetSize.Height)), -1.0, 1.0);
core::matrix4 m(core::matrix4::EM4CONST_NOTHING);
m.buildProjectionMatrixOrthoLH(f32(renderTargetSize.Width), f32(-(s32)(renderTargetSize.Height)), -1.0f, 1.0f);
m.setTranslation(core::vector3df(-1,1,0));
glLoadMatrixf(m.pointer());
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.375, 0.375, 0.0);
glTranslatef(0.375f, 0.375f, 0.0f);
// Make sure we set first texture matrix
if (MultiTextureExtension)
......
......@@ -105,7 +105,7 @@ static bool addBlend2d(video::E_DRIVER_TYPE type)
driver->enableMaterial2D(false);
driver->endScene();
bool result = takeScreenshotAndCompareAgainstReference(driver, "-addBlend2D.png" );
bool result = takeScreenshotAndCompareAgainstReference(driver, "-addBlend2D.png", 98.66f);
device->drop();
return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment