Procházet zdrojové kódy

Fix hero movement rendering

AlexVinS před 11 roky
rodič
revize
ac7703ffb0
2 změnil soubory, kde provedl 11 přidání a 4 odebrání
  1. 10 2
      client/CPlayerInterface.cpp
  2. 1 2
      client/gui/CGuiHandler.cpp

+ 10 - 2
client/CPlayerInterface.cpp

@@ -324,8 +324,16 @@ void CPlayerInterface::heroMoved(const TryMoveHero & details)
 		movementPxStep(details, i, hp, hero);
 		adventureInt->updateScreen = true;
 		adventureInt->show(screen);
-		CSDL_Ext::update(screen);
-		GH.mainFPSmng->framerateDelay(); //for animation purposes
+		{
+			//evil returns here ...
+			//todo: get rid of it 
+			logGlobal->traceStream() << "before [un]locks in " << __FUNCTION__;
+			auto unlockPim = vstd::makeUnlockGuard(*pim); //let frame to be rendered
+			GH.mainFPSmng->framerateDelay(); //for animation purposes
+			logGlobal->traceStream() << "after [un]locks in " << __FUNCTION__;		
+		}
+		//CSDL_Ext::update(screen);
+		
 	} //for(int i=1; i<32; i+=4)
 	//main moving done
 

+ 1 - 2
client/gui/CGuiHandler.cpp

@@ -169,8 +169,7 @@ void CGuiHandler::updateTime()
 
 void CGuiHandler::handleEvents()
 {
-	//player interface may want special event handling 
-	
+	//player interface may want special event handling 	
 	if(nullptr != LOCPLINT && LOCPLINT->capturedAllEvents())
 		return;