diff --git a/include/triangle3d.h b/include/triangle3d.h index dab52497..61d23a4b 100644 --- a/include/triangle3d.h +++ b/include/triangle3d.h @@ -253,10 +253,10 @@ namespace core { // This catches some floating point troubles. // Unfortunately slightly expensive and we don't really know the best epsilon for iszero. - vector3d cp1 = bminusa.normalize().crossProduct((p1 - a).normalize()); - if (core::iszero(cp1.X, (f64)ROUNDING_ERROR_f32) - && core::iszero(cp1.Y, (f64)ROUNDING_ERROR_f32) - && core::iszero(cp1.Z, (f64)ROUNDING_ERROR_f32) ) + vector3d cp1n = bminusa.normalize().crossProduct((p1 - a).normalize()); + if (core::iszero(cp1n.X, (f64)ROUNDING_ERROR_f32) + && core::iszero(cp1n.Y, (f64)ROUNDING_ERROR_f32) + && core::iszero(cp1n.Z, (f64)ROUNDING_ERROR_f32) ) { res = 0.f; } diff --git a/source/Irrlicht/CAnimatedMeshHalfLife.cpp b/source/Irrlicht/CAnimatedMeshHalfLife.cpp index 21c054b3..b4a4e1ac 100644 --- a/source/Irrlicht/CAnimatedMeshHalfLife.cpp +++ b/source/Irrlicht/CAnimatedMeshHalfLife.cpp @@ -322,7 +322,7 @@ void CAnimatedMeshHalfLife::initModel() // initBodyparts u32 meshBuffer = 0; BodyList.clear(); - SHalflifeBody *body = (SHalflifeBody *) ((u8*) Header + Header->bodypartindex); + const SHalflifeBody *body = (const SHalflifeBody *) ((u8*) Header + Header->bodypartindex); for (i=0; i < Header->numbodyparts; ++i) { BodyPart part; @@ -369,7 +369,7 @@ void CAnimatedMeshHalfLife::initModel() for (u32 bodypart=0 ; bodypart < Header->numbodyparts ; ++bodypart) { - const SHalflifeBody *body = (SHalflifeBody *)((u8*) Header + Header->bodypartindex) + bodypart; + body = (const SHalflifeBody *)((u8*) Header + Header->bodypartindex) + bodypart; for (u32 modelnr = 0; modelnr < body->nummodels; ++modelnr) { diff --git a/source/Irrlicht/CD3D9Driver.cpp b/source/Irrlicht/CD3D9Driver.cpp index bce5b1e6..71253cde 100644 --- a/source/Irrlicht/CD3D9Driver.cpp +++ b/source/Irrlicht/CD3D9Driver.cpp @@ -2901,10 +2901,9 @@ bool CD3D9Driver::retrieveDevice(int numTries, int msSleepBetweenTries) //! resets the device bool CD3D9Driver::reset() { - u32 i; os::Printer::log("Resetting D3D9 device.", ELL_INFORMATION); - for (i = 0; igetDriverType() == EDT_DIRECT3D9) { @@ -2926,7 +2925,7 @@ bool CD3D9Driver::reset() tex->releaseTexture(); } } - for (i=0; iisRenderTarget()) { @@ -2936,7 +2935,7 @@ bool CD3D9Driver::reset() tex->releaseTexture(); } } - for (i=0; iisRenderTarget()) ((CD3D9Texture*)(Textures[i].Surface))->generateRenderTarget(); } - for (i = 0; igetDriverType() == EDT_DIRECT3D9) { @@ -3045,7 +3044,7 @@ bool CD3D9Driver::reset() } // restore occlusion queries - for (i=0; iCreateQuery(D3DQUERYTYPE_OCCLUSION, reinterpret_cast(&OcclusionQueries[i].PID)); } diff --git a/source/Irrlicht/CGUIContextMenu.cpp b/source/Irrlicht/CGUIContextMenu.cpp index 139a99f2..c28d30ab 100644 --- a/source/Irrlicht/CGUIContextMenu.cpp +++ b/source/Irrlicht/CGUIContextMenu.cpp @@ -289,12 +289,12 @@ bool CGUIContextMenu::OnEvent(const SEvent& event) { setEventParent(p); - SEvent event; - event.EventType = EET_GUI_EVENT; - event.GUIEvent.Caller = this; - event.GUIEvent.Element = 0; - event.GUIEvent.EventType = EGET_ELEMENT_CLOSED; - if ( !p->OnEvent(event) ) + SEvent eventClose; + eventClose.EventType = EET_GUI_EVENT; + eventClose.GUIEvent.Caller = this; + eventClose.GUIEvent.Element = 0; + eventClose.GUIEvent.EventType = EGET_ELEMENT_CLOSED; + if ( !p->OnEvent(eventClose) ) { if ( CloseHandling & ECMC_HIDE ) { diff --git a/source/Irrlicht/CGUIEditBox.cpp b/source/Irrlicht/CGUIEditBox.cpp index 7c6da25c..a55664e1 100644 --- a/source/Irrlicht/CGUIEditBox.cpp +++ b/source/Irrlicht/CGUIEditBox.cpp @@ -1472,10 +1472,7 @@ void CGUIEditBox::calculateScrollPos() if (!AutoScroll) return; - IGUISkin* skin = Environment->getSkin(); - if (!skin) - return; - IGUIFont* font = OverrideFont ? OverrideFont : skin->getFont(); + IGUIFont* font = getActiveFont(); if (!font) return; @@ -1489,10 +1486,6 @@ void CGUIEditBox::calculateScrollPos() // NOTE: Calculations different to vertical scrolling because setTextRect interprets VAlign relative to line but HAlign not relative to row { // get cursor position - IGUIFont* font = getActiveFont(); - if (!font) - return; - // get cursor area irr::u32 cursorWidth = font->getDimension(CursorChar.c_str()).Width; core::stringw *txtLine = hasBrokenText ? &BrokenText[cursLine] : &Text; diff --git a/source/Irrlicht/CGUIProfiler.cpp b/source/Irrlicht/CGUIProfiler.cpp index 71ae45dd..693fc88c 100644 --- a/source/Irrlicht/CGUIProfiler.cpp +++ b/source/Irrlicht/CGUIProfiler.cpp @@ -113,11 +113,11 @@ void CGUIProfiler::updateDisplay() { for ( u32 i=1; igetGroupCount(); ++i ) { - const SProfileData& groupData = Profiler->getGroupData(i); - if ( groupData.getCallsCounter() >= MinCalls ) + const SProfileData& groupDataOv = Profiler->getGroupData(i); + if (groupDataOv.getCallsCounter() >= MinCalls ) { rowIndex = DisplayTable->addRow(rowIndex); - fillRow(rowIndex, groupData, false, false); + fillRow(rowIndex, groupDataOv, false, false); ++rowIndex; } } diff --git a/source/Irrlicht/CLWOMeshFileLoader.cpp b/source/Irrlicht/CLWOMeshFileLoader.cpp index 90c8bbc8..ce158440 100644 --- a/source/Irrlicht/CLWOMeshFileLoader.cpp +++ b/source/Irrlicht/CLWOMeshFileLoader.cpp @@ -171,8 +171,7 @@ IAnimatedMesh* CLWOMeshFileLoader::createMesh(io::IReadFile* file) os::Printer::log("LWO loader: Creating geometry."); os::Printer::log("LWO loader: Assigning UV maps."); #endif - u32 i; - for (i=0; i vertexCount; vertexCount.reallocate(Materials.size()); - for (i=0; iMeshbuffer->Vertices.reallocate(vertexCount[i]); Materials[i]->Meshbuffer->Indices.reallocate(vertexCount[i]); diff --git a/source/Irrlicht/Irrlicht.ruleset b/source/Irrlicht/Irrlicht.ruleset index 81794983..157ab7ce 100644 --- a/source/Irrlicht/Irrlicht.ruleset +++ b/source/Irrlicht/Irrlicht.ruleset @@ -255,6 +255,7 @@ +