create Xcode project for mac for bundled app
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "log.h"
|
||||
#include "asset.h"
|
||||
|
||||
#ifdef __IOS__
|
||||
#ifdef __APPLE__
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
@@ -24,11 +24,12 @@ bool Asset::open(const char* path)
|
||||
m_len = (int)AAsset_getLength(m_asset);
|
||||
m_data = (uint8_t*)AAsset_getBuffer(m_asset);
|
||||
#else
|
||||
#ifdef __IOS__
|
||||
NSString* bundle_path = [[NSBundle mainBundle] bundlePath];
|
||||
#ifdef __APPLE__
|
||||
NSString* bundle_path = [[NSBundle mainBundle] resourcePath];
|
||||
std::string base = [bundle_path cStringUsingEncoding:1];
|
||||
file_path = base + "/" + path;
|
||||
#endif
|
||||
LOG("asset file: %s", file_path.c_str());
|
||||
if (!(m_fp = fopen(file_path.c_str(), "rb")))
|
||||
{
|
||||
LOG("errno = %d", errno);
|
||||
|
||||
Reference in New Issue
Block a user