Merging r6288 through r6336 from trunk to ogl-es branch

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6337 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2022-04-15 18:51:09 +00:00
parent 67469c8899
commit 2d63fdba3d
115 changed files with 1828 additions and 1154 deletions

View File

@ -18,7 +18,7 @@ all: all_linux
# target specific settings
all_linux: SYSTEM=Linux
all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../lib/$(SYSTEM) -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor
all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../lib/$(SYSTEM) -lIrrlicht -lGL -lXxf86vm -lX11
all_win32 clean_win32: SYSTEM=Win32-gcc
all_win32: LDFLAGS = -L../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm

View File

@ -27,12 +27,12 @@ static bool doTestWith(E_DRIVER_TYPE driverType,
cube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp"));
cube->setMaterialFlag(video::EMF_LIGHTING, false);
ITexture * Texture = device->getVideoDriver()->getTexture("../media/portal2.bmp");
ITexture * texture = device->getVideoDriver()->getTexture("../media/portal2.bmp");
device->getVideoDriver()->makeColorKeyTexture(Texture,
device->getVideoDriver()->makeColorKeyTexture(texture,
position2d<s32>(64,64),
zeroTexels);
device->getVideoDriver()->makeColorKeyTexture(Texture,
device->getVideoDriver()->makeColorKeyTexture(texture,
position2d<s32>(64,64),
zeroTexels);
(void)smgr->addCameraSceneNode();
@ -40,9 +40,9 @@ static bool doTestWith(E_DRIVER_TYPE driverType,
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140));
smgr->drawAll();
driver->draw2DImage(Texture,
driver->draw2DImage(texture,
position2di(40, 40),
rect<s32>(0, 0, Texture->getSize().Width, Texture->getSize().Height),
recti(texture->getOriginalSize()),
0,
SColor(255,255,255,255),
true);

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -96,7 +96,7 @@ bool orthoCam(void)
// passed &= testOrthoCam(video::EDT_SOFTWARE);
passed &= testOrthoCam(video::EDT_BURNINGSVIDEO);
passed &= testOrthoCam(video::EDT_DIRECT3D9);
SLOW_SWITCH;
// TODO: not sure if burnings could work? Currently it doesn't.
passed &= testOrthoStencil(video::EDT_OPENGL);
passed &= testOrthoStencil(video::EDT_DIRECT3D9);

View File

@ -45,14 +45,13 @@ static bool testWith2DImage(video::E_DRIVER_TYPE driverType)
//draw the image :
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 200, 200, 200));
driver->draw2DImage (image,
core::rect < s32 >
(64 - image->getSize ().Width / 2,
64 - image->getSize ().Height / 2,
64 + image->getSize ().Width / 2,
64 + image->getSize ().Height / 2),
core::rect < s32 > (0, 0, image->getSize ().Width,
image->getSize ().Height), 0, colors,
true);
core::recti(
64 - image->getOriginalSize().Width / 2,
64 - image->getOriginalSize().Height / 2,
64 + image->getOriginalSize().Width / 2,
64 + image->getOriginalSize().Height / 2),
core::recti(image->getOriginalSize()),
0, colors, true);
driver->endScene ();
//then create a model and apply to it the RTT Texture
@ -76,14 +75,13 @@ static bool testWith2DImage(video::E_DRIVER_TYPE driverType)
//draw img
driver->draw2DImage (image,
core::rect < s32 >
(64 - image->getSize ().Width / 2,
64 - image->getSize ().Height / 2,
64 + image->getSize ().Width / 2,
64 + image->getSize ().Height / 2),
core::rect < s32 > (0, 0, image->getSize ().Width,
image->getSize ().Height), 0,
colors, true);
core::recti(
64 - image->getOriginalSize().Width / 2,
64 - image->getOriginalSize().Height / 2,
64 + image->getOriginalSize().Width / 2,
64 + image->getOriginalSize().Height / 2),
core::recti(image->getOriginalSize()),
0, colors, true);
//call this is important :
//if not called, the bug won't appear
@ -243,7 +241,7 @@ bool rttAndText(video::E_DRIVER_TYPE driverType)
driver->beginScene(0, video::SColor(255,255, 255, 255));
driver->setRenderTargetEx(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));
driver->draw2DImage(driver->getTexture("../media/fireball.bmp"), core::recti(0, 0, renderTargetTex->getSize().Width, renderTargetTex->getSize().Height), core::recti(0, 0, 64, 64));
driver->draw2DImage(driver->getTexture("../media/fireball.bmp"), core::recti(renderTargetTex->getOriginalSize()), core::recti(0, 0, 64, 64));
guienv->getBuiltInFont()->draw(L"OMGGG =!", core::rect<s32>(120, 100, 256, 256), video::SColor(255, 0, 0, 255));
driver->setRenderTargetEx(0, 0, 0);
driver->endScene();

View File

@ -5,10 +5,10 @@
using namespace irr;
static irr::u8 aa = 0; // AntiAlias used in testShotsInShots
// Tests screenshots features
bool testShots(video::E_DRIVER_TYPE type)
static bool testShots(video::E_DRIVER_TYPE type)
{
IrrlichtDevice *device = createDevice(type, core::dimension2d<u32>(160, 120), 32);
if (!device)
@ -75,9 +75,82 @@ bool testShots(video::E_DRIVER_TYPE type)
return true;
}
// render some recognizable stuff
static void drawSomeStuff(video::IVideoDriver* driver)
{
driver->draw2DRectangle(core::recti(5,5,155,115),
video::SColor(255, 100, 0, 0),
video::SColor(255, 0, 200, 0),
video::SColor(255, 0, 0, 200),
video::SColor(255, 20, 150, 150));
driver->draw2DLine(core::position2di(10,10), core::position2di(150,110), video::SColor(255,250,50,0));
driver->draw2DLine(core::position2di(0,120), core::position2di(80,60), video::SColor(255,50,50,250));
}
// Make a screenshot, then draw it again (scaled down) together with the stuff the screenshot was made from
static bool testShotsOfShots(video::E_DRIVER_TYPE type)
{
SIrrlichtCreationParameters params;
params.AntiAlias = aa;
params.WindowSize = core::dimension2du(160, 120);
params.DriverType = type;
IrrlichtDevice *device = createDeviceEx(params);
if (!device)
return true; // in case the driver type does not exist
video::IVideoDriver* driver = device->getVideoDriver();
logTestString("Testing driver %ls\n", driver->getName());
stabilizeScreenBackground(driver);
device->run();
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
drawSomeStuff(driver);
driver->endScene();
video::IImage* img = driver->createScreenShot();
bool result = true;
if ( img )
{
video::ITexture * screenshot = driver->addTexture(io::path("firstScreenshot"), img);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
drawSomeStuff(driver);
driver->draw2DImage(screenshot, core::recti(0, 30, 80, 90), core::recti(screenshot->getOriginalSize()), 0, 0, 0);
driver->endScene();
img->drop();
irr::core::stringc name("-shotsInShots");
name += irr::core::stringc((int)aa);
name += ".png";
result = takeScreenshotAndCompareAgainstReference(driver, name.c_str());
if ( !result )
{
logTestString("driver color format: %s\n", video::ColorFormatNames[driver->getColorFormat()]);
}
}
else
{
logTestString("Failed to create a screenshot");
result = false;
}
device->closeDevice();
device->run();
device->drop();
return result;
}
bool screenshot()
{
bool result = true;
TestWithAllHWDrivers(testShots);
aa = 0;
TestWithAllDrivers(testShotsOfShots);
aa = 2; // testing something that might cause troubles with Nouveau on some systems
TestWithAllDrivers(testShotsOfShots);
return result;
}

View File

@ -77,7 +77,7 @@ bool testGeometryCreator(void)
{
smgr->drawAll();
driver->endScene();
result = takeScreenshotAndCompareAgainstReference(driver, "-testGeometryCreator.png", 99.994f);
result = takeScreenshotAndCompareAgainstReference(driver, "-testGeometryCreator.png", 99.989f);
}
smgr->clear();

View File

@ -1,4 +1,4 @@
Tests finished. 72 tests of 72 passed.
Compiled as DEBUG
Test suite pass at GMT Thu Jan 6 13:59:44 2022
Tests finished. 72 tests of 72 passed.
Compiled as DEBUG
Test suite pass at GMT Thu Apr 14 16:41:11 2022

View File

@ -107,7 +107,7 @@
<Unit filename="irrString.cpp" />
<Unit filename="lightMaps.cpp" />
<Unit filename="lights.cpp" />
<Unit filename="line2d.cpp" />
<Unit filename="line2d.cpp" />
<Unit filename="loadTextures.cpp" />
<Unit filename="main.cpp" />
<Unit filename="makeColorKeyTexture.cpp" />
@ -117,6 +117,7 @@
<Unit filename="meshLoaders.cpp" />
<Unit filename="meshTransform.cpp" />
<Unit filename="mrt.cpp" />
<Unit filename="orthoCam.cpp" />
<Unit filename="planeMatrix.cpp" />
<Unit filename="projectionMatrix.cpp" />
<Unit filename="removeCustomAnimator.cpp" />
@ -127,6 +128,7 @@
<Unit filename="serializeAttributes.cpp" />
<Unit filename="skinnedMesh.cpp" />
<Unit filename="softwareDevice.cpp" />
<Unit filename="stencilshadow.cpp" />
<Unit filename="terrainSceneNode.cpp" />
<Unit filename="testDimension2d.cpp" />
<Unit filename="testGeometryCreator.cpp" />
@ -150,10 +152,6 @@
<Unit filename="videoDriver.cpp" />
<Unit filename="viewPort.cpp" />
<Unit filename="writeImageToFile.cpp" />
<Extensions>
<code_completion />
<debugger />
<envvars />
</Extensions>
<Extensions />
</Project>
</CodeBlocks_project_file>