Namespace ST for global vars

This commit is contained in:
vladislav.khorev committed 2013-02-21 13:14:46 +00:00
1 parent 61ada33ee1
commit 7d8bcec025
14 files changed
+58 -94

No files matched your search

+8 -1
View File
@@ -25,6 +25,13 @@ WINDOWS AND ANDROID
namespace SE
{
namespace ST
{
extern std::string PathToResources;
}
bool findString(char* in, char* list);
//utility for opengl extensions parsing. Not safe
@@ -243,7 +250,7 @@ std::string GetFilePath(const std::string& filename);
//Special for IOS, because Foundation.h conflicts with sq_plus.h
// Obviously, this returns ResourceManager->PathToResources
// Obviously, this returns ST::PathToResources
std::string GetPathToResources();
#endif
+7 -2
View File
@@ -8,8 +8,13 @@
namespace SE
{
extern boost::asio::io_service MainThreadIoService;
namespace ST
{
extern boost::asio::io_service MainThreadIoService;
extern boost::thread::id MainThreadId;
}
#ifndef UTILS_ENGINE
+2 -29
View File
@@ -10,34 +10,7 @@ namespace SE
template<typename RETURNTYPE>
RETURNTYPE PerformInMainThread(boost::function<RETURNTYPE()> f)
{
/*
if (boost::this_thread::get_id() == ResourceManager->MainThreadId)
{
return f();
}
else
{
RETURNTYPE result;
boost::mutex ServiceLock;
ServiceLock.lock();
boost::function<void()> cover_f = [&result, &ServiceLock, f]()
{
result = f();
ServiceLock.unlock();
};
MainThreadIoService.post(cover_f);
ServiceLock.lock();
ServiceLock.unlock();
return result;
}*/
if (boost::this_thread::get_id() == ResourceManager->MainThreadId)
if (boost::this_thread::get_id() == ST::MainThreadId)
{
return f();
}
@@ -56,7 +29,7 @@ namespace SE
serviceLock.lock();
MainThreadIoService.post(func);
ST::MainThreadIoService.post(func);
serviceLock.lock();
serviceLock.unlock();