mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Remove HW_buffer_counter after IrrlichtMt fix to remove HWBufferMap (#12232)
Keep code and use version check instead, for backwards compatibility
This commit is contained in:
		@@ -907,7 +907,10 @@ private:
 | 
			
		||||
 | 
			
		||||
	bool m_does_lost_focus_pause_game = false;
 | 
			
		||||
 | 
			
		||||
#if IRRLICHT_VERSION_MT_REVISION < 5
 | 
			
		||||
	int m_reset_HW_buffer_counter = 0;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_TOUCHSCREENGUI
 | 
			
		||||
	bool m_cache_hold_aux1;
 | 
			
		||||
#endif
 | 
			
		||||
@@ -3990,6 +3993,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
 | 
			
		||||
	/*
 | 
			
		||||
		==================== End scene ====================
 | 
			
		||||
	*/
 | 
			
		||||
#if IRRLICHT_VERSION_MT_REVISION < 5
 | 
			
		||||
	if (++m_reset_HW_buffer_counter > 500) {
 | 
			
		||||
		/*
 | 
			
		||||
		  Periodically remove all mesh HW buffers.
 | 
			
		||||
@@ -4011,6 +4015,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
 | 
			
		||||
		driver->removeAllHardwareBuffers();
 | 
			
		||||
		m_reset_HW_buffer_counter = 0;
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	driver->endScene();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1390,12 +1390,14 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
 | 
			
		||||
MapBlockMesh::~MapBlockMesh()
 | 
			
		||||
{
 | 
			
		||||
	for (scene::IMesh *m : m_mesh) {
 | 
			
		||||
#if IRRLICHT_VERSION_MT_REVISION < 5
 | 
			
		||||
		if (m_enable_vbo) {
 | 
			
		||||
			for (u32 i = 0; i < m->getMeshBufferCount(); i++) {
 | 
			
		||||
				scene::IMeshBuffer *buf = m->getMeshBuffer(i);
 | 
			
		||||
				RenderingEngine::get_video_driver()->removeHardwareBuffer(buf);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		m->drop();
 | 
			
		||||
	}
 | 
			
		||||
	delete m_minimap_mapblock;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user