diff -Nauwr Irrlicht/CD3D8Texture.cpp Irrlicht/CD3D8Texture.cpp --- Irrlicht/CD3D8Texture.cpp 2005-08-20 22:20:34.000000000 +0200 +++ Irrlicht/CD3D8Texture.cpp 2005-09-24 08:32:00.000000000 +0200 @@ -139,7 +139,7 @@ format = D3DFMT_A1R5G5B5; hr = Device->CreateTexture(optSize.Width, optSize.Height, - (flags & ETCF_CREATE_MIP_MAPS) ? 0 : 1, // number of mipmaplevels (0 = automatic all) + mipmaps, // number of mipmaplevels (0 = automatic all) 0, D3DFMT_A1R5G5B5, D3DPOOL_MANAGED, &Texture); } diff -Nauwr Irrlicht/CD3D9MaterialRenderer.h Irrlicht/CD3D9MaterialRenderer.h --- Irrlicht/CD3D9MaterialRenderer.h 2005-08-20 22:17:50.000000000 +0200 +++ Irrlicht/CD3D9MaterialRenderer.h 2005-09-24 08:41:12.000000000 +0200 @@ -206,7 +206,7 @@ pID3DDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE ); pID3DDevice->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE ); - pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); + pID3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE ); pID3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); pID3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); diff -Nauwr Irrlicht/CD3D9Texture.cpp Irrlicht/CD3D9Texture.cpp --- Irrlicht/CD3D9Texture.cpp 2005-08-20 22:20:48.000000000 +0200 +++ Irrlicht/CD3D9Texture.cpp 2005-09-25 19:16:14.000000000 +0200 @@ -61,12 +61,13 @@ if (copyTexture() && generateMipLevels) { // create mip maps. - #ifndef _IRR_COMPILE_WITH_DIRECT3D_8_ + + #ifndef _IRR_COMPILE_WITH_DIRECT3D_9_ // The D3DXFilterTexture function seems to get linked wrong when // compiling with both D3D8 and 9, causing it not to work in the D3D9 device. // So mipmapgeneration is replaced with my own bad generation in d3d 8 when // compiling with both D3D 8 and 9. - HRESULT hr = D3DXFilterTexture(Texture, NULL, D3DX_DEFAULT, D3DX_DEFAULT); + HRESULT hr = D3DXFilterTexture(Texture, NULL, 0, D3DX_DEFAULT ); if (FAILED(hr)) os::Printer::log("Could not create direct3d mip map levels.", ELL_WARNING); else @@ -283,8 +286,7 @@ DWORD usage = 0; - // This enables hardware mip map generation. I disabled this again in 0.7.1, because - // some cards or drivers seem to have problems with this. + //// This enables hardware mip map generation. // D3DCAPS9 caps; // Device->GetDeviceCaps(&caps); // if (caps.Caps2 & D3DCAPS2_CANAUTOGENMIPMAP) @@ -305,7 +307,7 @@ format = D3DFMT_A1R5G5B5; hr = Device->CreateTexture(optSize.Width, optSize.Height, - (flags & ETCF_CREATE_MIP_MAPS) ? 0 : 1, // number of mipmaplevels (0 = automatic all) + mipmaps, // number of mipmaplevels (0 = automatic all) 0, D3DFMT_A1R5G5B5, D3DPOOL_MANAGED, &Texture, NULL); } diff -Nauwr Irrlicht/CFileList.cpp Irrlicht/CFileList.cpp --- Irrlicht/CFileList.cpp 2005-08-24 20:28:32.000000000 +0200 +++ Irrlicht/CFileList.cpp 2005-09-21 20:44:28.000000000 +0200 @@ -40,7 +40,7 @@ Path = tmp; struct _finddata_t c_file; - s32 hFile; + intptr_t hFile; FileEntry entry; if( (hFile = _findfirst( "*", &c_file )) != -1L ) diff -Nauwr Irrlicht/COpenGLMaterialRenderer.h Irrlicht/COpenGLMaterialRenderer.h --- Irrlicht/COpenGLMaterialRenderer.h 2005-08-20 22:17:48.000000000 +0200 +++ Irrlicht/COpenGLMaterialRenderer.h 2005-09-26 16:29:24.000000000 +0200 @@ -201,6 +199,7 @@ glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PREVIOUS_EXT); glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); } //! Returns if the material is transparent. diff -Nauwr Irrlicht/CSceneManager.cpp Irrlicht/CSceneManager.cpp --- Irrlicht/CSceneManager.cpp 2005-08-24 18:01:14.000000000 +0200 +++ Irrlicht/CSceneManager.cpp 2005-09-27 15:50:08.000000000 +0200 @@ -639,13 +708,11 @@ if (!node->getAutomaticCulling()) return false; - ICameraSceneNode* cam = getActiveCamera(); - if (!cam) + if( !ActiveCamera ) return false; - core::aabbox3d tbox = node->getBoundingBox(); - node->getAbsoluteTransformation().transformBox(tbox); - return !(tbox.intersectsWithBox(cam->getViewFrustrum()->boundingBox)); + core::aabbox3d tbox = node->getTransformedBoundingBox(); + return !(tbox.intersectsWithBox(ActiveCameraFrustrumBBox)); // This is a slower but more exact version: // @@ -665,20 +732,25 @@ { case ESNRP_LIGHT_AND_CAMERA: LightAndCameraList.push_back(node); + + if( ActiveCamera ) + { + ActiveCameraFrustrumBBox = ActiveCamera->getViewFrustrum()->boundingBox; + } break; case ESNRP_SKY_BOX: SkyBoxList.push_back(node); break; case ESNRP_SOLID: - if (!isCulled(node)) + if (node->isVisible() && !isCulled(node)) SolidNodeList.push_back(node); break; case ESNRP_TRANSPARENT: - if (!isCulled(node)) + if (node->isVisible() && !isCulled(node)) TransparentNodeList.push_back(TransparentNodeEntry(node, camTransPos)); break; case ESNRP_AUTOMATIC: - if (!isCulled(node)) + if (node->isVisible() && !isCulled(node)) { s32 count = node->getMaterialCount(); @@ -700,7 +772,7 @@ } break; case ESNRP_SHADOW: - if (!isCulled(node)) + if (node->isVisible() && !isCulled(node)) ShadowNodeList.push_back(node); break; } diff -Nauwr Irrlicht/CSceneManager.h Irrlicht/CSceneManager.h --- Irrlicht/CSceneManager.h 2005-08-20 22:17:50.000000000 +0200 +++ Irrlicht/CSceneManager.h 2005-09-27 15:46:54.000000000 +0200 @@ -384,6 +411,7 @@ //! current active camera ICameraSceneNode* ActiveCamera; + core::aabbox3df ActiveCameraFrustrumBBox; core::vector3df camTransPos; // Position of camera for transparent nodes. video::SColor ShadowColor; diff -Nauwr Irrlicht/include/irrMath.h Irrlicht/include/irrMath.h --- Irrlicht/include/irrMath.h 2005-08-20 22:17:44.000000000 +0200 +++ Irrlicht/include/irrMath.h 2005-09-19 12:24:30.000000000 +0200 @@ -17,11 +17,26 @@ //! Constant for PI. const f32 PI = 3.14159f; + //! Constant for 64 bit PI + const f64 PI64 = 3.1415926535897932384626433832795; + //! Constant for converting bettween degrees and radiants. - const f64 GRAD_PI = 180.0 / 3.1415926535897932384626433832795; + const f64 GRAD_PI = 180.0 / PI64; //! Constant for converting bettween degrees and radiants. - const f64 GRAD_PI2 = 3.1415926535897932384626433832795 / 180.0; + const f64 GRAD_PI2 = PI64 / 180.0; + + //! 32bit Constant for converting from degrees to radians + const f32 DEGTORAD = PI / 180.0f; + + //! 32bit constant for converting from radians to degrees + const f32 RADTODEG = 180.0f / PI; + + //! 64bit constant for converting from degrees to radians + const f64 DEGTORAD64 = PI64 / 180.0; + + //! 64bit constant for converting from radians to degrees + const f64 RADTODEG64 = 180.0 / PI64; //! returns minimum of two values. Own implementation to get rid of the STL. template