diff --git a/changes.txt b/changes.txt index eb85059d..9c9c6349 100644 --- a/changes.txt +++ b/changes.txt @@ -8,6 +8,8 @@ Changes in ogl-es (not yet released - will be merged with trunk at some point) -------------------------- Changes in 1.9 (not yet released) +- Fix: addFileArchive now grab()'s the archive when you pass one in by pointer. +- Fix: Prevent division by 0 in CGUIScrollBar::setPos - Fix: Add missing serialization to CSceneNodeAnimatorCameraFPS and CSceneNodeAnimatorCameraMaya - Fix: File-open dialog now restores the original locale after modifying it internally - Fix first calculation of the camerascenenode boundingsphere. diff --git a/source/Irrlicht/CFileSystem.cpp b/source/Irrlicht/CFileSystem.cpp index da89bc30..9bbc1ec9 100644 --- a/source/Irrlicht/CFileSystem.cpp +++ b/source/Irrlicht/CFileSystem.cpp @@ -428,15 +428,22 @@ bool CFileSystem::addFileArchive(IReadFile* file, bool ignoreCase, //! Adds an archive to the file system. bool CFileSystem::addFileArchive(IFileArchive* archive) { - for (u32 i = 0; i < FileArchives.size(); ++i) + if ( archive ) { - if (archive == FileArchives[i]) + for (u32 i=0; i < FileArchives.size(); ++i) { - return false; + if (archive == FileArchives[i]) + { + return false; + } } + FileArchives.push_back(archive); + archive->grab(); + + return true; } - FileArchives.push_back(archive); - return true; + + return false; } diff --git a/source/Irrlicht/CGUIScrollBar.cpp b/source/Irrlicht/CGUIScrollBar.cpp index f99c84fa..e0a8a030 100644 --- a/source/Irrlicht/CGUIScrollBar.cpp +++ b/source/Irrlicht/CGUIScrollBar.cpp @@ -348,20 +348,22 @@ void CGUIScrollBar::setPos(s32 pos) { Pos = core::s32_clamp ( pos, Min, Max ); - if (Horizontal) + if ( core::isnotzero ( range() ) ) { - f32 f = (RelativeRect.getWidth() - ((f32)RelativeRect.getHeight()*3.0f)) / range(); - DrawPos = (s32)( ( ( Pos - Min ) * f) + ((f32)RelativeRect.getHeight() * 0.5f)); - DrawHeight = RelativeRect.getHeight(); - } - else - { - f32 f = (RelativeRect.getHeight() - ((f32)RelativeRect.getWidth()*3.0f)) / range(); + if (Horizontal) + { + f32 f = (RelativeRect.getWidth() - ((f32)RelativeRect.getHeight()*3.0f)) / range(); + DrawPos = (s32)( ( ( Pos - Min ) * f) + ((f32)RelativeRect.getHeight() * 0.5f)); + DrawHeight = RelativeRect.getHeight(); + } + else + { + f32 f = (RelativeRect.getHeight() - ((f32)RelativeRect.getWidth()*3.0f)) / range(); - DrawPos = (s32)( ( ( Pos - Min ) * f) + ((f32)RelativeRect.getWidth() * 0.5f)); - DrawHeight = RelativeRect.getWidth(); + DrawPos = (s32)( ( ( Pos - Min ) * f) + ((f32)RelativeRect.getWidth() * 0.5f)); + DrawHeight = RelativeRect.getWidth(); + } } - }