ios stuff
This commit is contained in:
parent
013b1dc344
commit
da5bd119ab
@ -34,21 +34,20 @@ namespace SE
|
|||||||
result = f();
|
result = f();
|
||||||
|
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(FunctionMutex);
|
boost::mutex::scoped_lock lock(ST::FunctionMutex);
|
||||||
functionCalled = true;
|
functionCalled = true;
|
||||||
}
|
}
|
||||||
FunctionFinishedCondition.notify_one();
|
ST::FunctionFinishedCondition.notify_one();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ST::MainThreadIoService.post(func);
|
ST::MainThreadIoService.post(func);
|
||||||
|
|
||||||
boost::mutex::scoped_lock lock(FunctionMutex);
|
boost::mutex::scoped_lock lock(ST::FunctionMutex);
|
||||||
|
|
||||||
while (!functionCalled)
|
while (!functionCalled)
|
||||||
{
|
{
|
||||||
FunctionFinishedCondition.wait(lock);
|
ST::FunctionFinishedCondition.wait(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -333,7 +333,7 @@ bool TModelManager::AddLiteModel(const std::string& filename, const std::string&
|
|||||||
if (LiteModelMap.count(modelName) != 0)
|
if (LiteModelMap.count(modelName) != 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
boost::shared_array<byte> fileArr = CreateMemFromFile<byte>((ST::PathToResources + filename), fileSize);
|
boost::shared_array<unsigned char> fileArr = CreateMemFromFile<unsigned char>((ST::PathToResources + filename), fileSize);
|
||||||
|
|
||||||
if (!(fileArr[0] == 'L' && fileArr[1] == 'M' && fileArr[2] == 0 && fileArr[3] == 1))
|
if (!(fileArr[0] == 'L' && fileArr[1] == 'M' && fileArr[2] == 0 && fileArr[3] == 1))
|
||||||
throw ErrorFileNotCorrect(filename);
|
throw ErrorFileNotCorrect(filename);
|
||||||
|
@ -29,10 +29,9 @@ void TResourceManager::Update(cardinal timer)
|
|||||||
|
|
||||||
GUIManager.Update(timer);
|
GUIManager.Update(timer);
|
||||||
|
|
||||||
//ST::MainThreadIoService.run();
|
ST::MainThreadIoService.poll_one();
|
||||||
ST::MainThreadIoService.run_one();
|
ST::MainThreadIoService.reset();
|
||||||
|
|
||||||
//ST::MainThreadIoService.reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TResourceManager::~TResourceManager()
|
TResourceManager::~TResourceManager()
|
||||||
|
@ -18,7 +18,8 @@ namespace SE
|
|||||||
|
|
||||||
std::string IosGetFileReadPath(const std::string& filename)
|
std::string IosGetFileReadPath(const std::string& filename)
|
||||||
{
|
{
|
||||||
|
@autoreleasepool
|
||||||
|
{
|
||||||
NSString* nsFullFileName = [NSString stringWithCString:filename.c_str() encoding:NSUTF8StringEncoding];
|
NSString* nsFullFileName = [NSString stringWithCString:filename.c_str() encoding:NSUTF8StringEncoding];
|
||||||
|
|
||||||
NSString* nsFileShortName = [nsFullFileName lastPathComponent];
|
NSString* nsFileShortName = [nsFullFileName lastPathComponent];
|
||||||
@ -33,9 +34,12 @@ std::string IosGetFileReadPath(const std::string& filename)
|
|||||||
|
|
||||||
return std::string([filePath UTF8String]);
|
return std::string([filePath UTF8String]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string IosGetFilePathUserData(const std::string& filename)
|
std::string IosGetFilePathUserData(const std::string& filename)
|
||||||
|
{
|
||||||
|
@autoreleasepool
|
||||||
{
|
{
|
||||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
|
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
|
||||||
NSUserDomainMask, YES);
|
NSUserDomainMask, YES);
|
||||||
@ -48,6 +52,7 @@ std::string IosGetFilePathUserData(const std::string& filename)
|
|||||||
|
|
||||||
return std::string([[NSFileManager defaultManager] fileSystemRepresentationWithPath:file]);
|
return std::string([[NSFileManager defaultManager] fileSystemRepresentationWithPath:file]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void IosSwitchToScreen()
|
void IosSwitchToScreen()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user