Commit 9184ea4c authored by cutealien's avatar cutealien

Merged revisions 4057-4071 from 1.7 branch.

- GUIEditor attributes have now scrollbar to be editable
- Remove warning when compiling line2d::intersectWith with other types than f32.
- CodeBlocks tests project file now compiling also on Linux.
- Slightly more lenient comparison in test textureRenderStates


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4072 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d9a6ac31
...@@ -294,6 +294,10 @@ The following names can be queried for the given types: ...@@ -294,6 +294,10 @@ The following names can be queried for the given types:
----------------------------- -----------------------------
Changes in 1.7.3 (??.??.2011) Changes in 1.7.3 (??.??.2011)
- GUIEditor attributes have now scrollbar to be editable
- Remove warning when compiling line2d::intersectWith with other types than f32.
- Document that triangle3d::isPointInside should not be used with int's. - Document that triangle3d::isPointInside should not be used with int's.
- triangle3d::isPointInsideFast handles 'on-border' cases now consistently. - triangle3d::isPointInsideFast handles 'on-border' cases now consistently.
......
...@@ -78,13 +78,13 @@ class line2d ...@@ -78,13 +78,13 @@ class line2d
{ {
// Uses the method given at: // Uses the method given at:
// http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ // http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
const f32 commonDenominator = (l.end.Y - l.start.Y)*(end.X - start.X) - const f32 commonDenominator = (f32)(l.end.Y - l.start.Y)*(end.X - start.X) -
(l.end.X - l.start.X)*(end.Y - start.Y); (l.end.X - l.start.X)*(end.Y - start.Y);
const f32 numeratorA = (l.end.X - l.start.X)*(start.Y - l.start.Y) - const f32 numeratorA = (f32)(l.end.X - l.start.X)*(start.Y - l.start.Y) -
(l.end.Y - l.start.Y)*(start.X -l.start.X); (l.end.Y - l.start.Y)*(start.X -l.start.X);
const f32 numeratorB = (end.X - start.X)*(start.Y - l.start.Y) - const f32 numeratorB = (f32)(end.X - start.X)*(start.Y - l.start.Y) -
(end.Y - start.Y)*(start.X -l.start.X); (end.Y - start.Y)*(start.X -l.start.X);
if(equals(commonDenominator, 0.f)) if(equals(commonDenominator, 0.f))
...@@ -142,7 +142,8 @@ class line2d ...@@ -142,7 +142,8 @@ class line2d
out += l.start; out += l.start;
if (l.end != maxp && l.end != minp) if (l.end != maxp && l.end != minp)
out += l.end; out += l.end;
out *= 0.5f; out.X = (T)(out.X*0.5f);
out.Y = (T)(out.Y*0.5f);
} }
return true; // coincident return true; // coincident
...@@ -162,8 +163,8 @@ class line2d ...@@ -162,8 +163,8 @@ class line2d
return false; // Outside the line segment return false; // Outside the line segment
// Calculate the intersection point. // Calculate the intersection point.
out.X = start.X + uA * (end.X - start.X); out.X = (T)(start.X + uA * (end.X - start.X));
out.Y = start.Y + uA * (end.Y - start.Y); out.Y = (T)(start.Y + uA * (end.Y - start.Y));
return true; return true;
} }
......
...@@ -98,7 +98,7 @@ int main(int argumentCount, char * arguments[]) ...@@ -98,7 +98,7 @@ int main(int argumentCount, char * arguments[])
TEST(md2Animation); TEST(md2Animation);
TEST(meshTransform); TEST(meshTransform);
TEST(skinnedMesh); TEST(skinnedMesh);
TEST(testGeometryCreator); TEST(testGeometryCreator);
TEST(writeImageToFile); TEST(writeImageToFile);
TEST(ioScene); TEST(ioScene);
// all driver checks // all driver checks
......
...@@ -6,21 +6,21 @@ ...@@ -6,21 +6,21 @@
<Option pch_mode="2" /> <Option pch_mode="2" />
<Option compiler="gcc" /> <Option compiler="gcc" />
<Build> <Build>
<Target title="Debug"> <Target title="Win32 Debug">
<Option output="..\bin\gcc\tests" prefix_auto="1" extension_auto="1" /> <Option output="../bin/gcc/tests" prefix_auto="1" extension_auto="1" />
<Option object_output=".\Debug\" /> <Option object_output="./Debug/" />
<Option type="1" /> <Option type="1" />
<Option compiler="gcc" /> <Option compiler="gcc" />
<Compiler> <Compiler>
<Add option="-g" /> <Add option="-g" />
</Compiler> </Compiler>
<Linker> <Linker>
<Add directory="..\lib\Win32-gcc\" /> <Add directory="../lib/Win32-gcc/" />
</Linker> </Linker>
</Target> </Target>
<Target title="Release"> <Target title="Win32 Release">
<Option output="..\bin\gcc\tests" prefix_auto="1" extension_auto="1" /> <Option output="../bin/gcc/tests" prefix_auto="1" extension_auto="1" />
<Option object_output=".\Release\" /> <Option object_output="./Release/" />
<Option type="1" /> <Option type="1" />
<Option compiler="gcc" /> <Option compiler="gcc" />
<Compiler> <Compiler>
...@@ -30,15 +30,30 @@ ...@@ -30,15 +30,30 @@
<Add option="-s" /> <Add option="-s" />
</Linker> </Linker>
</Target> </Target>
<Target title="Linux Debug">
<Option platforms="Unix;" />
<Option output="../bin/gcc/tests" prefix_auto="1" extension_auto="1" />
<Option object_output="./Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
<Linker>
<Add library="Xxf86vm" />
<Add library="GL" />
<Add directory="../lib/Linux/" />
</Linker>
</Target>
</Build> </Build>
<Compiler> <Compiler>
<Add option="-Wall" /> <Add option="-Wall" />
<Add option="-fexceptions" /> <Add option="-fexceptions" />
<Add directory="..\include" /> <Add directory="../include" />
</Compiler> </Compiler>
<Linker> <Linker>
<Add library="Irrlicht" /> <Add library="Irrlicht" />
<Add directory="..\lib\gcc" /> <Add directory="../lib/gcc" />
</Linker> </Linker>
<Unit filename="2dmaterial.cpp" /> <Unit filename="2dmaterial.cpp" />
<Unit filename="anti-aliasing.cpp" /> <Unit filename="anti-aliasing.cpp" />
...@@ -60,6 +75,7 @@ ...@@ -60,6 +75,7 @@
<Unit filename="filesystem.cpp" /> <Unit filename="filesystem.cpp" />
<Unit filename="flyCircleAnimator.cpp" /> <Unit filename="flyCircleAnimator.cpp" />
<Unit filename="guiDisabledMenu.cpp" /> <Unit filename="guiDisabledMenu.cpp" />
<Unit filename="ioScene.cpp" />
<Unit filename="irrArray.cpp" /> <Unit filename="irrArray.cpp" />
<Unit filename="irrCoreEquals.cpp" /> <Unit filename="irrCoreEquals.cpp" />
<Unit filename="irrList.cpp" /> <Unit filename="irrList.cpp" />
...@@ -77,7 +93,6 @@ ...@@ -77,7 +93,6 @@
<Unit filename="meshLoaders.cpp" /> <Unit filename="meshLoaders.cpp" />
<Unit filename="meshTransform.cpp" /> <Unit filename="meshTransform.cpp" />
<Unit filename="mrt.cpp" /> <Unit filename="mrt.cpp" />
<Unit filename="orthocam.cpp" />
<Unit filename="planeMatrix.cpp" /> <Unit filename="planeMatrix.cpp" />
<Unit filename="projectionMatrix.cpp" /> <Unit filename="projectionMatrix.cpp" />
<Unit filename="removeCustomAnimator.cpp" /> <Unit filename="removeCustomAnimator.cpp" />
...@@ -88,21 +103,22 @@ ...@@ -88,21 +103,22 @@
<Unit filename="serializeAttributes.cpp" /> <Unit filename="serializeAttributes.cpp" />
<Unit filename="skinnedMesh.cpp" /> <Unit filename="skinnedMesh.cpp" />
<Unit filename="softwareDevice.cpp" /> <Unit filename="softwareDevice.cpp" />
<Unit filename="stencilShadow.cpp" />
<Unit filename="terrainSceneNode.cpp" /> <Unit filename="terrainSceneNode.cpp" />
<Unit filename="testaabbox.cpp" />
<Unit filename="testDimension2d.cpp" /> <Unit filename="testDimension2d.cpp" />
<Unit filename="testGeometryCreator.cpp" /> <Unit filename="testGeometryCreator.cpp" />
<Unit filename="testQuaternion.cpp" /> <Unit filename="testQuaternion.cpp" />
<Unit filename="testS3DVertex.cpp" /> <Unit filename="testS3DVertex.cpp" />
<Unit filename="testUtils.cpp" /> <Unit filename="testUtils.cpp" />
<Unit filename="testUtils.h" />
<Unit filename="testVector2d.cpp" /> <Unit filename="testVector2d.cpp" />
<Unit filename="testVector3d.cpp" /> <Unit filename="testVector3d.cpp" />
<Unit filename="testXML.cpp" /> <Unit filename="testXML.cpp" />
<Unit filename="testaabbox.cpp" />
<Unit filename="textureFeatures.cpp" /> <Unit filename="textureFeatures.cpp" />
<Unit filename="textureRenderStates.cpp" /> <Unit filename="textureRenderStates.cpp" />
<Unit filename="timer.cpp" /> <Unit filename="timer.cpp" />
<Unit filename="transparentMaterials.cpp" /> <Unit filename="transparentMaterials.cpp" />
<Unit filename="triangle3d.cpp" />
<Unit filename="triangleSelector.cpp" /> <Unit filename="triangleSelector.cpp" />
<Unit filename="vectorPositionDimension2d.cpp" /> <Unit filename="vectorPositionDimension2d.cpp" />
<Unit filename="videoDriver.cpp" /> <Unit filename="videoDriver.cpp" />
......
...@@ -50,7 +50,7 @@ static bool manyTextures(video::E_DRIVER_TYPE driverType) ...@@ -50,7 +50,7 @@ static bool manyTextures(video::E_DRIVER_TYPE driverType)
smgr->drawAll(); smgr->drawAll();
// draw meshbuffer // draw meshbuffer
driver->setMaterial(mat); driver->setMaterial(mat);
driver->drawMeshBuffer(mesh); driver->drawMeshBuffer(mesh);
driver->endScene(); driver->endScene();
mesh->drop(); mesh->drop();
...@@ -198,14 +198,14 @@ static bool testTextureMatrixInMixedScenes(video::E_DRIVER_TYPE driverType) ...@@ -198,14 +198,14 @@ static bool testTextureMatrixInMixedScenes(video::E_DRIVER_TYPE driverType)
gui->drawAll(); gui->drawAll();
driver->endScene(); driver->endScene();
bool result = takeScreenshotAndCompareAgainstReference(driver, "-textureMatrixInMixedScenes.png", 99.34f); bool result = takeScreenshotAndCompareAgainstReference(driver, "-textureMatrixInMixedScenes.png", 99.33f);
device->closeDevice(); device->closeDevice();
device->run(); device->run();
device->drop(); device->drop();
return result; return result;
} }
// animated texture matrix test. // animated texture matrix test.
static bool textureMatrix(video::E_DRIVER_TYPE driverType) static bool textureMatrix(video::E_DRIVER_TYPE driverType)
......
...@@ -83,11 +83,11 @@ void CGUIAttributeEditor::refreshAttribs() ...@@ -83,11 +83,11 @@ void CGUIAttributeEditor::refreshAttribs()
// try to create attribute // try to create attribute
stringc str = Attribs->getAttributeTypeString(i); stringc str = Attribs->getAttributeTypeString(i);
str += "_attribute"; str += "_attribute";
CGUIAttribute* n = (CGUIAttribute*)Environment->addGUIElement(str.c_str(), this); CGUIAttribute* n = (CGUIAttribute*)Environment->addGUIElement(str.c_str(), 0);
// if this doesn't exist, use a string editor // if this doesn't exist, use a string editor
if (!n) if (!n)
n = (CGUIAttribute*)Environment->addGUIElement("string_attribute", this); n = (CGUIAttribute*)Environment->addGUIElement("string_attribute", 0);
if (n) if (n)
{ {
...@@ -96,6 +96,11 @@ void CGUIAttributeEditor::refreshAttribs() ...@@ -96,6 +96,11 @@ void CGUIAttributeEditor::refreshAttribs()
n->grab(); n->grab();
} }
// We can't set "this" as parent above as we need functionality
// of the overloaded addChild which isn't called in the constructor.
// (that's a general Irrlicht messup with too fat constructors)
addChild(n);
AttribList[i]->setSubElement(true); AttribList[i]->setSubElement(true);
AttribList[i]->setRelativePosition(r); AttribList[i]->setRelativePosition(r);
AttribList[i]->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); AttribList[i]->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
......
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