* dont use realtime mipmaps by default
* fix void rendering
* fix max Z rendering
This commit is contained in:
Eduardo Bart 2012-03-21 14:30:57 -03:00
parent 57adcb38bd
commit 28633a9e20
4 changed files with 12 additions and 17 deletions

View File

@ -43,17 +43,9 @@ void Graphics::init()
!GLEW_ARB_fragment_program || !GLEW_ARB_fragment_shader || !GLEW_ARB_fragment_program || !GLEW_ARB_fragment_shader ||
!GLEW_ARB_texture_non_power_of_two || !GLEW_ARB_multitexture) !GLEW_ARB_texture_non_power_of_two || !GLEW_ARB_multitexture)
logFatal("Some OpenGL 2.0 extensions is not supported by your system graphics, please try updating your video drivers or buy a new hardware."); logFatal("Some OpenGL 2.0 extensions is not supported by your system graphics, please try updating your video drivers or buy a new hardware.");
m_useFBO = GLEW_ARB_framebuffer_object;
m_useBilinearFiltering = true; m_useFBO = m_useFBO && GLEW_ARB_framebuffer_object;
m_generateMipmaps = true; m_generateHardwareMipmaps = m_generateHardwareMipmaps && m_useFBO; // glGenerateMipmap is supported when FBO is
m_generateHardwareMipmaps = m_useFBO; // glGenerateMipmap is supported when FBO is
m_generateRealtimeMipmaps = m_generateHardwareMipmaps;
#else
m_useFBO = true; // FBOs is always supported by mobile devices
m_useBilinearFiltering = true;
m_generateMipmaps = true;
m_generateHardwareMipmaps = true;
m_realtimeMipmapGeneration = false; // realtime mipmaps can be slow on mobile devices
#endif #endif
glEnable(GL_BLEND); glEnable(GL_BLEND);

View File

@ -52,10 +52,10 @@ private:
Size m_viewportSize; Size m_viewportSize;
TexturePtr m_emptyTexture; TexturePtr m_emptyTexture;
Boolean<false> m_useFBO; Boolean<true> m_useFBO;
Boolean<false> m_useBilinearFiltering; Boolean<true> m_useBilinearFiltering;
Boolean<false> m_generateMipmaps; Boolean<true> m_generateMipmaps;
Boolean<false> m_generateHardwareMipmaps; Boolean<true> m_generateHardwareMipmaps;
Boolean<false> m_generateRealtimeMipmaps; Boolean<false> m_generateRealtimeMipmaps;
}; };

View File

@ -519,7 +519,7 @@ int MapView::getLastVisibleFloor()
// view only underground floors when below sea level // view only underground floors when below sea level
if(cameraPosition.z > Otc::SEA_FLOOR) if(cameraPosition.z > Otc::SEA_FLOOR)
return cameraPosition.z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE; return std::min(cameraPosition.z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE, (int)Otc::MAX_Z);
else else
return Otc::SEA_FLOOR; return Otc::SEA_FLOOR;
} }

View File

@ -115,12 +115,15 @@ void ThingsType::parseThingType(std::stringstream& fin, ThingType& thingType)
ThingType *ThingsType::getThingType(uint16 id, Categories category) ThingType *ThingsType::getThingType(uint16 id, Categories category)
{ {
if(id == 0)
return &m_emptyThingType;
if(category == Item) if(category == Item)
id -= 100; id -= 100;
else if(category == Creature || category == Effect || category == Missile) else if(category == Creature || category == Effect || category == Missile)
id -= 1; id -= 1;
if(id == 0 || id >= m_things[category].size()) if(id >= m_things[category].size())
return &m_emptyThingType; return &m_emptyThingType;
return &m_things[category][id]; return &m_things[category][id];
} }