Advertisement
dominus

Untitled

Dec 11th, 2023
1,139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.51 KB | None | 0 0
  1. diff --git a/mapedit/exult_studio.cc b/mapedit/exult_studio.cc
  2. index 59817d22b..b8bad04e1 100644
  3. --- a/mapedit/exult_studio.cc
  4. +++ b/mapedit/exult_studio.cc
  5. @@ -22,11 +22,41 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  6.  
  7.  #include "studio.h"
  8.  
  9. -#ifdef _WIN32
  10. +#if defined(MACOSX) || defined(_WIN32)
  11.  #include "utils.h"
  12.  #endif
  13.  
  14.  int main(int argc, char **argv) {
  15. +
  16. +#ifdef MACOSX
  17. +   // setting up environment for Exult Studio in an app bundle
  18. +   setup_app_bundle_resource();
  19. +   if (is_system_path_defined("<APP_BUNDLE_RES>")) {
  20. +       std::string bundle_res = get_system_path("<APP_BUNDLE_RES>");
  21. +       if (U7exists(bundle_res)) {
  22. +           std::string bundle_share;
  23. +           std::string bundle_pixbuf;
  24. +           std::string bundle_im;
  25. +           bundle_share = bundle_res;
  26. +           bundle_share += "/share";
  27. +           bundle_pixbuf = bundle_res;
  28. +           bundle_pixbuf += "/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
  29. +           bundle_im = bundle_res;
  30. +           bundle_im += "/lib/gtk-3.0/3.0.0/immodules.cache";
  31. +           const gchar *b_res = bundle_res.c_str();
  32. +           const gchar *b_share = bundle_share.c_str();
  33. +           const gchar *b_pixbuf= bundle_pixbuf.c_str();
  34. +           const gchar *b_im = bundle_im.c_str();
  35. +           g_setenv("XDG_DATA_DIRS", b_share, 1);
  36. +           g_setenv("GTK_DATA_PREFIX", b_res, 1);
  37. +           g_setenv("GTK_EXE_PREFIX", b_res, 1);
  38. +           g_setenv("GTK_PATH", b_res, 1);
  39. +           g_setenv("GDK_PIXBUF_MODULE_FILE", b_pixbuf, 1);
  40. +           g_setenv("GTK_IM_MODULE_FILE", b_im, 1);
  41. +       }
  42. +   }
  43. +#endif
  44. +
  45.     ExultStudio studio(argc, argv);
  46.     studio.run();
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement