mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fixed CID 1197516
This commit is contained in:
parent
6196ae7fca
commit
abe4beebc6
@ -87,7 +87,7 @@ CPlayerInterface * LOCPLINT;
|
||||
CBattleInterface * CPlayerInterface::battleInt;
|
||||
|
||||
enum EMoveState {STOP_MOVE, WAITING_MOVE, CONTINUE_MOVE, DURING_MOVE};
|
||||
CondSh<EMoveState> stillMoveHero; //used during hero movement
|
||||
CondSh<EMoveState> stillMoveHero(STOP_MOVE); //used during hero movement
|
||||
|
||||
int CPlayerInterface::howManyPeople = 0;
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
CondSh<bool> CBattleInterface::animsAreDisplayed;
|
||||
CondSh<bool> CBattleInterface::animsAreDisplayed(false);
|
||||
|
||||
static void onAnimationFinished(const CStack *stack, CCreatureAnimation *anim)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@
|
||||
extern std::queue<SDL_Event> events;
|
||||
extern boost::mutex eventsM;
|
||||
|
||||
CondSh<bool> CGuiHandler::terminate_cond;
|
||||
CondSh<bool> CGuiHandler::terminate_cond(false);
|
||||
boost::thread_specific_ptr<bool> inGuiThread;
|
||||
|
||||
SObjectConstruction::SObjectConstruction(CIntObject *obj)
|
||||
|
@ -17,15 +17,14 @@ template <typename T> struct CondSh
|
||||
boost::condition_variable cond;
|
||||
boost::mutex mx;
|
||||
|
||||
CondSh() {}
|
||||
CondSh(T t) : data(t) {}
|
||||
|
||||
// set data
|
||||
void set(T t)
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lock(mx);
|
||||
boost::unique_lock<boost::mutex> lock(mx);
|
||||
data = t;
|
||||
}
|
||||
}
|
||||
|
||||
// set data and notify
|
||||
void setn(T t)
|
||||
@ -37,7 +36,7 @@ template <typename T> struct CondSh
|
||||
// get stored value
|
||||
T get()
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lock(mx);
|
||||
boost::unique_lock<boost::mutex> lock(mx);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ private:
|
||||
mutable CGameHandler * gh;
|
||||
};
|
||||
|
||||
CondSh<bool> battleMadeAction;
|
||||
CondSh<bool> battleMadeAction(false);
|
||||
CondSh<BattleResult *> battleResult(nullptr);
|
||||
template <typename T> class CApplyOnGH;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user