ios stuff
This commit is contained in:
parent
013b1dc344
commit
da5bd119ab
@ -34,21 +34,20 @@ namespace SE
|
||||
result = f();
|
||||
|
||||
{
|
||||
boost::mutex::scoped_lock lock(FunctionMutex);
|
||||
boost::mutex::scoped_lock lock(ST::FunctionMutex);
|
||||
functionCalled = true;
|
||||
}
|
||||
FunctionFinishedCondition.notify_one();
|
||||
ST::FunctionFinishedCondition.notify_one();
|
||||
};
|
||||
|
||||
|
||||
|
||||
ST::MainThreadIoService.post(func);
|
||||
|
||||
boost::mutex::scoped_lock lock(FunctionMutex);
|
||||
boost::mutex::scoped_lock lock(ST::FunctionMutex);
|
||||
|
||||
while (!functionCalled)
|
||||
{
|
||||
FunctionFinishedCondition.wait(lock);
|
||||
ST::FunctionFinishedCondition.wait(lock);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -333,7 +333,7 @@ bool TModelManager::AddLiteModel(const std::string& filename, const std::string&
|
||||
if (LiteModelMap.count(modelName) != 0)
|
||||
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))
|
||||
throw ErrorFileNotCorrect(filename);
|
||||
|
@ -29,10 +29,9 @@ void TResourceManager::Update(cardinal timer)
|
||||
|
||||
GUIManager.Update(timer);
|
||||
|
||||
//ST::MainThreadIoService.run();
|
||||
ST::MainThreadIoService.run_one();
|
||||
ST::MainThreadIoService.poll_one();
|
||||
ST::MainThreadIoService.reset();
|
||||
|
||||
//ST::MainThreadIoService.reset();
|
||||
}
|
||||
|
||||
TResourceManager::~TResourceManager()
|
||||
|
@ -18,7 +18,8 @@ namespace SE
|
||||
|
||||
std::string IosGetFileReadPath(const std::string& filename)
|
||||
{
|
||||
|
||||
@autoreleasepool
|
||||
{
|
||||
NSString* nsFullFileName = [NSString stringWithCString:filename.c_str() encoding:NSUTF8StringEncoding];
|
||||
|
||||
NSString* nsFileShortName = [nsFullFileName lastPathComponent];
|
||||
@ -32,11 +33,14 @@ std::string IosGetFileReadPath(const std::string& filename)
|
||||
NSString *filePath = [[NSBundle mainBundle] pathForResource:nsFileShortNameWithoutExt ofType:nsFileExt inDirectory:nsFilePath];
|
||||
|
||||
return std::string([filePath UTF8String]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::string IosGetFilePathUserData(const std::string& filename)
|
||||
{
|
||||
@autoreleasepool
|
||||
{
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
|
||||
NSUserDomainMask, YES);
|
||||
|
||||
@ -47,6 +51,7 @@ std::string IosGetFilePathUserData(const std::string& filename)
|
||||
NSString* file = [docDir stringByAppendingString:[NSString stringWithCString:filename.c_str() encoding:NSUTF8StringEncoding]];
|
||||
|
||||
return std::string([[NSFileManager defaultManager] fileSystemRepresentationWithPath:file]);
|
||||
}
|
||||
}
|
||||
|
||||
void IosSwitchToScreen()
|
||||
|
Loading…
Reference in New Issue
Block a user