Namespace ST for global vars
This commit is contained in:
1 parent
61ada33ee1
commit
7d8bcec025
14 files changed
+58
-94
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user