fixes
* dont use realtime mipmaps by default * fix void rendering * fix max Z rendering
This commit is contained in:
		
							parent
							
								
									57adcb38bd
								
							
						
					
					
						commit
						28633a9e20
					
				| 
						 | 
				
			
			@ -43,17 +43,9 @@ void Graphics::init()
 | 
			
		|||
       !GLEW_ARB_fragment_program || !GLEW_ARB_fragment_shader ||
 | 
			
		||||
       !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.");
 | 
			
		||||
    m_useFBO = GLEW_ARB_framebuffer_object;
 | 
			
		||||
    m_useBilinearFiltering = true;
 | 
			
		||||
    m_generateMipmaps = true;
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
    m_useFBO = m_useFBO && GLEW_ARB_framebuffer_object;
 | 
			
		||||
    m_generateHardwareMipmaps = m_generateHardwareMipmaps && m_useFBO; // glGenerateMipmap is supported when FBO is
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    glEnable(GL_BLEND);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,10 +52,10 @@ private:
 | 
			
		|||
    Size m_viewportSize;
 | 
			
		||||
    TexturePtr m_emptyTexture;
 | 
			
		||||
 | 
			
		||||
    Boolean<false> m_useFBO;
 | 
			
		||||
    Boolean<false> m_useBilinearFiltering;
 | 
			
		||||
    Boolean<false> m_generateMipmaps;
 | 
			
		||||
    Boolean<false> m_generateHardwareMipmaps;
 | 
			
		||||
    Boolean<true> m_useFBO;
 | 
			
		||||
    Boolean<true> m_useBilinearFiltering;
 | 
			
		||||
    Boolean<true> m_generateMipmaps;
 | 
			
		||||
    Boolean<true> m_generateHardwareMipmaps;
 | 
			
		||||
    Boolean<false> m_generateRealtimeMipmaps;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -519,7 +519,7 @@ int MapView::getLastVisibleFloor()
 | 
			
		|||
 | 
			
		||||
    // view only underground floors when below sea level
 | 
			
		||||
    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
 | 
			
		||||
        return Otc::SEA_FLOOR;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,12 +115,15 @@ void ThingsType::parseThingType(std::stringstream& fin, ThingType& thingType)
 | 
			
		|||
 | 
			
		||||
ThingType *ThingsType::getThingType(uint16 id, Categories category)
 | 
			
		||||
{
 | 
			
		||||
    if(id == 0)
 | 
			
		||||
        return &m_emptyThingType;
 | 
			
		||||
 | 
			
		||||
    if(category == Item)
 | 
			
		||||
        id -= 100;
 | 
			
		||||
    else if(category == Creature || category == Effect || category == Missile)
 | 
			
		||||
        id -= 1;
 | 
			
		||||
 | 
			
		||||
    if(id == 0 || id >= m_things[category].size())
 | 
			
		||||
    if(id >= m_things[category].size())
 | 
			
		||||
        return &m_emptyThingType;
 | 
			
		||||
    return &m_things[category][id];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue