12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #include <Foundation/Foundation.h>
- #include <UIKit/UIKit.h>
- #include "common.h"
- #include "palcfg.h"
- #include "util.h"
- LPCSTR
- UTIL_BasePath(
- VOID
- )
- {
- static char buf[4096] = "";
- if (buf[0] == '\0')
- {
- #ifdef CYDIA
- char *p = SDL_GetBasePath();
- if (p != NULL)
- {
- strcpy(buf, p);
- free(p);
- }
- #else
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
- NSString *documentsDirectory = [[paths objectAtIndex:0] stringByAppendingString:@"/"];
- strcpy(buf, [documentsDirectory UTF8String]);
- #endif
- }
- return buf;
- }
- LPCSTR
- UTIL_SavePath(
- VOID
- )
- {
- static char buf[4096] = "";
- if (buf[0] == '\0')
- {
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
- NSString *documentsDirectory = [[paths objectAtIndex:0] stringByAppendingString:@"/"];
- strcpy(buf, [documentsDirectory UTF8String]);
- }
- return buf;
- }
- BOOL
- UTIL_GetScreenSize(
- DWORD *pdwScreenWidth,
- DWORD *pdwScreenHeight
- )
- {
- return (pdwScreenWidth && pdwScreenHeight && *pdwScreenWidth && *pdwScreenHeight);
- }
- BOOL
- UTIL_IsAbsolutePath(
- LPCSTR lpszFileName
- )
- {
- return FALSE;
- }
- INT
- UTIL_Platform_Init(
- int argc,
- char* argv[]
- )
- {
- UTIL_LogAddOutputCallback([](LOGLEVEL, const char* str, const char*)->void {
- NSLog(@"%s",str);
- }, PAL_DEFAULT_LOGLEVEL);
- gConfig.fLaunchSetting = NO;
- return 0;
- }
- VOID
- UTIL_Platform_Quit(
- VOID
- )
- {
- }
|