util.mm 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include <Foundation/Foundation.h>
  2. #include "palcfg.h"
  3. #include "util.h"
  4. BOOL
  5. UTIL_GetScreenSize(
  6. DWORD *pdwScreenWidth,
  7. DWORD *pdwScreenHeight
  8. )
  9. {
  10. return (pdwScreenWidth && pdwScreenHeight && *pdwScreenWidth && *pdwScreenHeight);
  11. }
  12. BOOL
  13. UTIL_IsAbsolutePath(
  14. LPCSTR lpszFileName
  15. )
  16. {
  17. return FALSE;
  18. }
  19. static void LogCallBack(LOGLEVEL, const char* str, const char*)
  20. {
  21. NSLog(@"%s",str);
  22. }
  23. INT UTIL_Platform_Startup(
  24. int argc,
  25. char* argv[]
  26. )
  27. {
  28. #if !defined(DEBUG) //for ease of debugging(specify resource dir in xcode scheme)
  29. char *p = strstr(argv[0], "/Pal.app/");
  30. if (p != NULL)
  31. {
  32. char buf[4096];
  33. strcpy(buf, argv[0]);
  34. buf[p - argv[0]] = '\0';
  35. chdir(buf);
  36. }
  37. #endif
  38. return 0;
  39. }
  40. INT
  41. UTIL_Platform_Init(
  42. int argc,
  43. char* argv[]
  44. )
  45. {
  46. UTIL_LogAddOutputCallback(LogCallBack, PAL_DEFAULT_LOGLEVEL);
  47. gConfig.fLaunchSetting = FALSE;
  48. return 0;
  49. }
  50. VOID
  51. UTIL_Platform_Quit(
  52. VOID
  53. )
  54. {
  55. }