mirror of
https://github.com/glest/glest-source.git
synced 2025-08-19 14:41:23 +02:00
- finally fixing issue #102 (bad cell visible handling when fog of war turned off)
This commit is contained in:
@@ -686,7 +686,7 @@ std::vector<std::string> Socket::getLocalIPAddressList() {
|
||||
for(int ipIdx = 0; myhostent->h_addr_list[ipIdx] != NULL; ++ipIdx) {
|
||||
Ip::Inet_NtoA(SockAddrToUint32((struct in_addr *)myhostent->h_addr_list[ipIdx]), myhostaddr);
|
||||
|
||||
printf("ipIdx = %d [%s]\n",ipIdx,myhostaddr);
|
||||
//printf("ipIdx = %d [%s]\n",ipIdx,myhostaddr);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] myhostaddr = [%s]\n",__FILE__,__FUNCTION__,__LINE__,myhostaddr);
|
||||
|
||||
if(strlen(myhostaddr) > 0 &&
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user