- finally fixing issue #102 (bad cell visible handling when fog of war turned off)

This commit is contained in:
SoftCoder
2016-05-27 16:15:27 -07:00
parent 8a88c4f11e
commit 56494f3cd2
20 changed files with 588 additions and 122 deletions

View File

@@ -26,6 +26,7 @@ namespace Shared { namespace Platform {
bool Thread::enableVerboseMode = false;
Mutex Thread::mutexthreadList;
vector<Thread *> Thread::threadList;
unsigned long Thread::mainThreadId = -1;
auto_ptr<Mutex> Mutex::mutexMutexList(new Mutex(CODE_AT_LINE));
vector<Mutex *> Mutex::mutexList;
@@ -138,6 +139,16 @@ Thread::Thread() : thread(NULL),
addThreadToList();
}
unsigned long Thread::getCurrentThreadId() {
return SDL_ThreadID();
}
void Thread::setMainThreadId() {
mainThreadId = getCurrentThreadId();
}
bool Thread::isCurrentThreadMainThread() {
return getCurrentThreadId() == mainThreadId;
}
void Thread::addThreadToList() {
MutexSafeWrapper safeMutex(&Thread::mutexthreadList);
Thread::threadList.push_back(this);