Commit 6fe8e2d8 authored by hybrid's avatar hybrid

Merged from 1.5 branch to trunk, all changes from 2018 to 2041. OSX keyboard...

Merged from 1.5 branch to trunk, all changes from 2018 to 2041. OSX keyboard fix, OpenGL version fix, some tests fixed. Example 9 text position fixed.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2042 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 64f9c035
......@@ -6,7 +6,11 @@ Changes in version 1.6
- D3D devices use DISCARD for windowed renderbuffers now, can be faster.
- position2d is now a synonym for vector2d. position2d is therefore marked as deprecated, although it's unlikely to be removed.
- Changed behaviour of PixelBlend16() / PixelBlend16_simd() so that they treat the 1 bit alpha of the source pixel as boolean, i.e. they draw either the source pixel, or the destination pixel, rather than "blending". (Issue revealed by the fix to IVideoDriver::makeColorKeyTexture()).
- IVideoDriver::makeColorKeyTexture() bug fixed so that only alphas, not whole texel colors, are zeroed. An optional parameter allows using the old (buggy) behaviour for backwards compatibility.
- position2d is now a synonym for vector2d. position2d is therefore marked as deprecated, although it's unlikely to be removed.
- ISceneNodeAnimator now has a hasFinished() method.
......@@ -17,9 +21,7 @@ Changes in version 1.6
-------------------------------------
Changes in version 1.5.1 (??.?? 2009)
- Changed behaviour of PixelBlend16() / PixelBlend16_simd() so that they treat the 1 bit alpha of the source pixel as boolean, i.e. they draw either the source pixel, or the destination pixel, rather than "blending". (Issue revealed by the fix to IVideoDriver::makeColorKeyTexture()).
- IVideoDriver::makeColorKeyTexture() bug fixed so that only alphas, not whole texel colors, are zeroed. An optional parameter allows using the old (buggy) behaviour for backwards compatibility.
- OSX device now supports shift and ctrl keys.
- MD2 mesh loader: Now uses much less memory, reduced number of allocations when loading meshes.
......@@ -28,9 +30,9 @@ Changes in version 1.5 (15.12.2008)
- Construction calls for FPS camera changed to take speed in units/milliseconds, just as the setSpeed method does.
- Code::Blocks workspaces added. C::B projects (using gcc) now output to /lib/gcc and /bin/gcc, when built on either Windows or Linux.
- Code::Blocks workspaces added. C::B projects (using gcc) now output to /lib/gcc and /bin/gcc, when built on either Windows or Linux.
- Added a test suite in the /tests directory. This can be used to perform regression tests, and should be updated with new tests to verify fixes or validate new features.
- Added a test suite in the /tests directory. This can be used to perform regression tests, and should be updated with new tests to verify fixes or validate new features.
- Changed the preferred way of altering light node's radius: Use the new member methods of ILightSceneNode instead of directly modifying the SLight structure.
......@@ -40,7 +42,7 @@ Changes in version 1.5 (15.12.2008)
- Terrain heightmap and texture were flipped in order to draw them as expected (looking onto the terrain from high above will just look like the actual texture/heightmap).
- Significant internal change to the way that FPS camera jump speed and collision response animator gravity interact. The behaviour is now much more realistic, but it will require you to adjust your jump speed and gravity.
- Significant internal change to the way that FPS camera jump speed and collision response animator gravity interact. The behaviour is now much more realistic, but it will require you to adjust your jump speed and gravity.
- Skybox won't be culled anymore by nearplane or farplane.
......@@ -68,7 +70,7 @@ Changes in version 1.5 (15.12.2008)
- ISceneNode::setParent and addChild now updates node SceneManager pointers if the node was from another SceneManager.
- Basic support for joystick input events on Windows, Linux, SDL and OSX. Tested with wired Logitech and Thrustmaster wired controllers and XBox 360 wireless controller ( http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/OsxDriver )
- Basic support for joystick input events on Windows, Linux, SDL and OSX. Tested with wired Logitech and Thrustmaster wired controllers and XBox 360 wireless controller ( http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/OsxDriver )
- Fixed scaled octree nodes being incorrectly frustum culled.
......
......@@ -758,7 +758,7 @@ int main(int argc, char* argv[])
// create fps text
IGUIStaticText* fpstext = env->addStaticText(L"",
core::rect<s32>(GUI_ID_TOGGLE_DEBUG_INFO,4,570,23), true, false, bar);
core::rect<s32>(400,4,570,23), true, false, bar);
IGUIStaticText* postext = env->addStaticText(L"",
core::rect<s32>(10,50,470,80),false, false, 0, GUI_ID_POSITION_TEXT);
......
......@@ -1224,7 +1224,6 @@ IImage* CNullDriver::createImageFromFile(io::IReadFile* file)
}
//! Writes the provided image to disk file
bool CNullDriver::writeImageToFile(IImage* image, const char* filename,u32 param)
{
......@@ -1246,7 +1245,6 @@ bool CNullDriver::writeImageToFile(IImage* image, const char* filename,u32 param
}
//! Creates a software image from a byte array.
IImage* CNullDriver::createImageFromData(ECOLOR_FORMAT format,
const core::dimension2d<s32>& size,
......@@ -1307,6 +1305,7 @@ void CNullDriver::drawMeshBuffer(const scene::IMeshBuffer* mb)
drawVertexPrimitiveList(mb->getVertices(), mb->getVertexCount(), mb->getIndices(), mb->getIndexCount()/3, mb->getVertexType(), scene::EPT_TRIANGLES, mb->getIndexType());
}
CNullDriver::SHWBufferLink *CNullDriver::getBufferLink(const scene::IMeshBuffer* mb)
{
if (!mb || !isHardwareBufferRecommend(mb))
......@@ -1314,11 +1313,13 @@ CNullDriver::SHWBufferLink *CNullDriver::getBufferLink(const scene::IMeshBuffer*
//search for hardware links
core::map< const scene::IMeshBuffer*,SHWBufferLink* >::Node* node = HWBufferMap.find(mb);
if (node) return node->getValue();
if (node)
return node->getValue();
return createHardwareBuffer(mb); //no hardware links, and mesh wants one, create it
}
//! Update all hardware buffers, remove unused ones
void CNullDriver::updateAllHardwareBuffers()
{
......@@ -1342,18 +1343,22 @@ void CNullDriver::updateAllHardwareBuffers()
void CNullDriver::deleteHardwareBuffer(SHWBufferLink *HWBuffer)
{
if (!HWBuffer) return;
HWBufferMap.remove( HWBuffer->MeshBuffer );
if (!HWBuffer)
return;
HWBufferMap.remove(HWBuffer->MeshBuffer);
delete HWBuffer;
}
//! Remove hardware buffer
void CNullDriver::removeHardwareBuffer(const scene::IMeshBuffer* mb)
{
core::map<const scene::IMeshBuffer*,SHWBufferLink*>::Node* node = HWBufferMap.find(mb);
if (node) deleteHardwareBuffer( node->getValue() );
if (node)
deleteHardwareBuffer(node->getValue());
}
//! Remove all hardware buffers
void CNullDriver::removeAllHardwareBuffers()
{
......@@ -1361,6 +1366,7 @@ void CNullDriver::removeAllHardwareBuffers()
deleteHardwareBuffer(HWBufferMap.getRoot()->getValue());
}
bool CNullDriver::isHardwareBufferRecommend(const scene::IMeshBuffer* mb)
{
if (!mb || (mb->getHardwareMappingHint_Index()==scene::EHM_NEVER && mb->getHardwareMappingHint_Vertex()==scene::EHM_NEVER))
......@@ -1372,6 +1378,7 @@ bool CNullDriver::isHardwareBufferRecommend(const scene::IMeshBuffer* mb)
return true;
}
//! Only used by the internal engine. Used to notify the driver that
//! the window was resized.
void CNullDriver::OnResize(const core::dimension2d<s32>& size)
......@@ -1383,6 +1390,7 @@ void CNullDriver::OnResize(const core::dimension2d<s32>& size)
ScreenSize = size;
}
// adds a material renderer and drops it afterwards. To be used for internal creation
s32 CNullDriver::addAndDropMaterialRenderer(IMaterialRenderer* m)
{
......@@ -1556,6 +1564,7 @@ E_DRIVER_TYPE CNullDriver::getDriverType() const
return EDT_NULL;
}
//! deletes all material renderers
void CNullDriver::deleteMaterialRenders()
{
......@@ -1601,6 +1610,7 @@ IGPUProgrammingServices* CNullDriver::getGPUProgrammingServices()
return 0;
}
//! Adds a new material renderer to the VideoDriver, based on a high level shading
//! language. Currently only HLSL in D3D9 is supported.
s32 CNullDriver::addHighLevelShaderMaterial(
......@@ -1618,6 +1628,7 @@ s32 CNullDriver::addHighLevelShaderMaterial(
return -1;
}
//! Like IGPUProgrammingServices::addShaderMaterial() (look there for a detailed description),
//! but tries to load the programs from files.
s32 CNullDriver::addHighLevelShaderMaterialFromFiles(
......@@ -1672,6 +1683,7 @@ s32 CNullDriver::addHighLevelShaderMaterialFromFiles(
return result;
}
//! Like IGPUProgrammingServices::addShaderMaterial() (look there for a detailed description),
//! but tries to load the programs from files.
s32 CNullDriver::addHighLevelShaderMaterialFromFiles(
......@@ -1724,6 +1736,7 @@ s32 CNullDriver::addHighLevelShaderMaterialFromFiles(
return result;
}
//! Adds a new material renderer to the VideoDriver, using pixel and/or
//! vertex shaders to render geometry.
s32 CNullDriver::addShaderMaterial(const c8* vertexShaderProgram,
......@@ -1736,6 +1749,7 @@ s32 CNullDriver::addShaderMaterial(const c8* vertexShaderProgram,
return -1;
}
//! Like IGPUProgrammingServices::addShaderMaterial(), but tries to load the
//! programs from files.
s32 CNullDriver::addShaderMaterialFromFiles(io::IReadFile* vertexShaderProgram,
......@@ -1778,7 +1792,6 @@ s32 CNullDriver::addShaderMaterialFromFiles(io::IReadFile* vertexShaderProgram,
}
//! Like IGPUProgrammingServices::addShaderMaterial(), but tries to load the
//! programs from files.
s32 CNullDriver::addShaderMaterialFromFiles(const c8* vertexShaderProgramFileName,
......@@ -1891,6 +1904,7 @@ bool CNullDriver::setClipPlane(u32 index, const core::plane3df& plane, bool enab
return false;
}
//! Enable/disable a clipping plane.
//! There are at least 6 clipping planes available for the user to set at will.
//! \param index: The plane index. Must be between 0 and MaxUserClipPlanes.
......@@ -1912,5 +1926,3 @@ ITexture* CNullDriver::createRenderTargetTexture(const core::dimension2d<s32>& s
} // end namespace
} // end namespace
This diff is collapsed.
......@@ -116,7 +116,6 @@ namespace video
GLuint vbo_verticesSize; //tmp
GLuint vbo_indicesSize; //tmp
};
//! updates hardware buffer if needed
......
......@@ -66,7 +66,7 @@ void COpenGLExtensionHandler::dump() const
void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
{
const f32 ogl_ver = core::fast_atof(reinterpret_cast<const c8*>(glGetString(GL_VERSION)));
Version = core::floor32(ogl_ver)*100+core::ceil32(core::fract(ogl_ver)*10.0f);
Version = core::floor32(ogl_ver)*100+core::round32(core::fract(ogl_ver)*10.0f);
if ( Version >= 102)
os::Printer::log("OpenGL driver version is 1.2 or better.", ELL_INFORMATION);
else
......@@ -423,7 +423,7 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
else
{
const f32 sl_ver = core::fast_atof(reinterpret_cast<const c8*>(shaderVersion));
ShaderLanguageVersion = core::floor32(sl_ver)*100+core::ceil32(core::fract(sl_ver)*10.0f);
ShaderLanguageVersion = core::floor32(sl_ver)*100+core::round32(core::fract(sl_ver)*10.0f);
}
}
#endif
......
......@@ -61,7 +61,7 @@ namespace irr
//! Sets if the window should be resizeable in windowed mode.
virtual void setResizeAble(bool resize);
//! Activate any joysticks, and generate events for them.
//! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
//! \return Returns a pointer to a list with all video modes
......@@ -207,6 +207,7 @@ namespace irr
int _screenWidth;
int _screenHeight;
bool _active;
bool IsShiftDown, IsControlDown;
void pollJoysticks();
};
......
......@@ -329,7 +329,8 @@ namespace irr
{
//! constructor
CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
: CIrrDeviceStub(param), _window(NULL), _active(true), _oglcontext(NULL), _cglcontext(NULL)
: CIrrDeviceStub(param), _window(NULL), _active(true), _oglcontext(NULL), _cglcontext(NULL),
IsShiftDown(false), IsControlDown(false)
{
struct utsname name;
NSString *path;
......@@ -659,6 +660,36 @@ bool CIrrDeviceMacOSX::run()
postKeyEvent(event,ievent,false);
break;
case NSFlagsChanged:
ievent.EventType = irr::EET_KEY_INPUT_EVENT;
ievent.KeyInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0;
ievent.KeyInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0;
if (IsShiftDown != ievent.KeyInput.Shift)
{
ievent.KeyInput.Char = irr::KEY_SHIFT;
ievent.KeyInput.Key = irr::KEY_SHIFT;
ievent.KeyInput.PressedDown = ievent.KeyInput.Shift;
IsShiftDown = ievent.KeyInput.Shift;
postEventFromUser(ievent);
}
if (IsControlDown != ievent.KeyInput.Control)
{
ievent.KeyInput.Char = irr::KEY_CONTROL;
ievent.KeyInput.Key = irr::KEY_CONTROL;
ievent.KeyInput.PressedDown = ievent.KeyInput.Control;
IsControlDown = ievent.KeyInput.Control;
postEventFromUser(ievent);
}
[NSApp sendEvent:event];
break;
case NSLeftMouseDown:
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
ievent.MouseInput.Event = irr::EMIE_LMOUSE_PRESSED_DOWN;
......
......@@ -907,7 +907,7 @@
093973BD0E0458B200E0C987 /* CSceneNodeAnimatorCameraFPS.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSceneNodeAnimatorCameraFPS.h; sourceTree = "<group>"; };
093973BE0E0458B200E0C987 /* CSceneNodeAnimatorCameraMaya.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSceneNodeAnimatorCameraMaya.cpp; sourceTree = "<group>"; };
093973BF0E0458B200E0C987 /* CSceneNodeAnimatorCameraMaya.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSceneNodeAnimatorCameraMaya.h; sourceTree = "<group>"; };
0946CCB40EC99BBE00D945A5 /* MouseAndJoystick.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = MouseAndJoystick.app; sourceTree = BUILT_PRODUCTS_DIR; };
0946CCB40EC99BBE00D945A5 /* MouseAndJoystick.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MouseAndJoystick.app; sourceTree = BUILT_PRODUCTS_DIR; };
0946CCCA0EC99C6E00D945A5 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = 19.MouseAndJoystick/main.cpp; sourceTree = "<group>"; };
0968401E0D0F1A2300333EFD /* CB3DMeshFileLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CB3DMeshFileLoader.cpp; sourceTree = "<group>"; };
0968401F0D0F1A2300333EFD /* CB3DMeshFileLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CB3DMeshFileLoader.h; sourceTree = "<group>"; };
......@@ -1284,7 +1284,7 @@
4C53E2520A4850550014E966 /* Quake3Map.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Quake3Map.app; sourceTree = BUILT_PRODUCTS_DIR; };
4C53E26D0A4850D60014E966 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
4C53E26E0A4850D60014E966 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
4C53E38E0A4855BA0014E966 /* DemoApp-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "DemoApp-Info.plist"; sourceTree = "<group>"; };
4C53E38E0A4855BA0014E966 /* DemoApp-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "DemoApp-Info.plist"; sourceTree = "<group>"; };
4C53E6F10A485CD80014E966 /* jcapimin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = jcapimin.c; sourceTree = "<group>"; };
4C53E6F20A485CD80014E966 /* jcapistd.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = jcapistd.c; sourceTree = "<group>"; };
4C53E6F30A485CD80014E966 /* jccoefct.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = jccoefct.c; sourceTree = "<group>"; };
......@@ -3364,10 +3364,12 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "MacOSX" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 0867D691FE84028FC02AAC07 /* MacOSX */;
productRefGroup = 0867D691FE84028FC02AAC07 /* MacOSX */;
projectDirPath = "";
projectRoot = "";
targets = (
D2AAC07D0554694100DB518D /* libIrrlicht.a */,
B81CFF33097FE25F0057C06F /* Quake3Map */,
......
......@@ -74,6 +74,7 @@ int main(int argumentCount, char * arguments[])
TEST(textureRenderStates);
TEST(terrainSceneNode);
TEST(burningsVideo);
TEST(makeColorKeyTexture);
// Tests available on 1.6+
TEST(collisionResponseAnimator);
......
......@@ -45,7 +45,8 @@ bool terrainSceneNode(void)
smgr->drawAll();
driver->endScene();
bool result = takeScreenshotAndCompareAgainstReference(driver, "-terrainSceneNode-1.png");
// Note that this has to be a slightly fuzzier than usual compare to satisfy multiple OpenGL environments
bool result = takeScreenshotAndCompareAgainstReference(driver, "-terrainSceneNode-1.png", 98.3f);
if(!result)
{
logTestString("Small camera up rotation caused bad recalc.\n");
......@@ -60,7 +61,7 @@ bool terrainSceneNode(void)
smgr->drawAll();
driver->endScene();
result &= takeScreenshotAndCompareAgainstReference(driver, "-terrainSceneNode-2.png");
result &= takeScreenshotAndCompareAgainstReference(driver, "-terrainSceneNode-2.png", 98.9f);
if(!result)
{
logTestString("Large camera up rotation caused bad recalc.\n");
......
......@@ -227,7 +227,10 @@ bool openTestLog(bool startNewLog, const char * filename)
void closeTestLog(void)
{
if(logFile)
{
(void)fclose(logFile);
logFile = 0;
}
}
......
Test suite pass at GMT Mon Jan 05 14:45:04 2009
Test suite pass at GMT Mon Jan 5 15:14:30 2009
......@@ -69,4 +69,5 @@ bool vectorPositionDimension2d(void)
assert(false);
return result;
}
\ No newline at end of file
}
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