mirror of
https://github.com/glest/glest-source.git
synced 2025-08-12 19:33:59 +02:00
Implemented the new g3d spec
This commit is contained in:
@@ -91,9 +91,8 @@ namespace Shared {
|
||||
if (masterThreadList.find(this) == masterThreadList.end()) {
|
||||
if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d] uniqueID [%s] ret [%d] END\n", __FILE__, __FUNCTION__, __LINE__, uniqueID.c_str(), ret);
|
||||
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8096, "invalid thread delete for ptr: %p", this);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
printf("invalid thread delete for ptr: %p", this);
|
||||
//throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d] uniqueID [%s] ret [%d] END\n", __FILE__, __FUNCTION__, __LINE__, uniqueID.c_str(), ret);
|
||||
|
||||
|
@@ -121,13 +121,13 @@ namespace Shared {
|
||||
findDirs(techDataPaths, techPaths);
|
||||
if (techPaths.empty() == false) {
|
||||
// Always calc megapack first so its up to date sooner
|
||||
const string megapackTechtreeName = "megapack";
|
||||
vector<string>::iterator iterFindMegaPack = std::find(techPaths.begin(), techPaths.end(), megapackTechtreeName);
|
||||
if (iterFindMegaPack != techPaths.end()) {
|
||||
techPaths.erase(iterFindMegaPack);
|
||||
techPaths.insert(techPaths.begin(), megapackTechtreeName);
|
||||
const string zetapackTechtreeName = "zetapack";
|
||||
vector<string>::iterator iterFindZetaPack = std::find(techPaths.begin(), techPaths.end(), zetapackTechtreeName);
|
||||
if (iterFindZetaPack != techPaths.end()) {
|
||||
techPaths.erase(iterFindZetaPack);
|
||||
techPaths.insert(techPaths.begin(), zetapackTechtreeName);
|
||||
|
||||
if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] Found megapack techtree and placing it at the TOP of the list\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
|
||||
if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] Found zetapack techtree and placing it at the TOP of the list\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
|
||||
}
|
||||
unsigned int techsPerWorker = ((unsigned int) techPaths.size() / (unsigned int) MAX_FileCRCPreCacheThread_WORKER_THREADS);
|
||||
if (techPaths.size() % MAX_FileCRCPreCacheThread_WORKER_THREADS != 0) {
|
||||
@@ -433,7 +433,7 @@ namespace Shared {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugError, "In [%s::%s Line: %d] Error [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, ex.what());
|
||||
if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d] uniqueID [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, this->getUniqueID().c_str());
|
||||
|
||||
throw megaglest_runtime_error(ex.what());
|
||||
//throw megaglest_runtime_error(ex.what());
|
||||
//abort();
|
||||
}
|
||||
//printf("~SimpleTaskThread LINE: %d this = %p\n",__LINE__,this);
|
||||
|
@@ -510,9 +510,8 @@ namespace Shared {
|
||||
MutexSafeWrapper safeMutexX(Mutex::mutexMutexList.get());
|
||||
std::vector<Mutex *>::iterator iterFind = std::find(Mutex::mutexList.begin(), Mutex::mutexList.end(), this);
|
||||
if (iterFind == Mutex::mutexList.end()) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8095, "In [%s::%s Line: %d] iterFind == Mutex::mutexList.end()", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
printf("In [%s::%s Line: %d] iterFind == Mutex::mutexList.end()", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
|
||||
//throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
Mutex::mutexList.erase(iterFind);
|
||||
safeMutexX.ReleaseLock();
|
||||
@@ -520,14 +519,12 @@ namespace Shared {
|
||||
|
||||
SDLMutexSafeWrapper safeMutex(&mutexAccessor, true);
|
||||
if (mutex == NULL) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8095, "In [%s::%s Line: %d] mutex == NULL refCount = %d owner [%s] deleteownerId [%s]", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, refCount, ownerId.c_str(), deleteownerId.c_str());
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
printf("In [%s::%s Line: %d] mutex == NULL refCount = %d owner [%s] deleteownerId [%s]", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, refCount, ownerId.c_str(), deleteownerId.c_str());
|
||||
//throw megaglest_runtime_error(szBuf);
|
||||
//printf("%s\n",szBuf);
|
||||
} else if (refCount >= 1) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8095, "In [%s::%s Line: %d] about to destroy mutex refCount = %d owner [%s] deleteownerId [%s]", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, refCount, ownerId.c_str(), deleteownerId.c_str());
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
printf("In [%s::%s Line: %d] about to destroy mutex refCount = %d owner [%s] deleteownerId [%s]", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, refCount, ownerId.c_str(), deleteownerId.c_str());
|
||||
//throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
|
||||
if (debugMutexLock == true) {
|
||||
@@ -609,9 +606,8 @@ namespace Shared {
|
||||
|
||||
Semaphore::~Semaphore() {
|
||||
if (semaphore == NULL) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8095, "In [%s::%s Line: %d] semaphore == NULL", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
printf("In [%s::%s Line: %d] semaphore == NULL", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
|
||||
//throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
SDL_DestroySemaphore(semaphore);
|
||||
semaphore = NULL;
|
||||
@@ -728,9 +724,8 @@ namespace Shared {
|
||||
if (debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
|
||||
|
||||
if (trigger == NULL) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8095, "In [%s::%s Line: %d] trigger == NULL", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
printf("In [%s::%s Line: %d] trigger == NULL", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
|
||||
//throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
if (debugMasterSlaveThreadController) printf("In [%s::%s Line: %d]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
|
||||
|
||||
|
Reference in New Issue
Block a user