summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/osx/export/export.cpp15
-rw-r--r--platform/osx/godot_main_osx.mm7
-rw-r--r--platform/osx/os_osx.h1
-rw-r--r--platform/osx/os_osx.mm11
-rw-r--r--platform/windows/os_windows.cpp14
5 files changed, 38 insertions, 10 deletions
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index 7f749030ec..2ec76fe0dd 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -88,8 +88,15 @@ public:
};
void EditorExportPlatformOSX::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) {
-
- // what does this need to do?
+ if (p_preset->get("texture_format/s3tc")) {
+ r_features->push_back("s3tc");
+ }
+ if (p_preset->get("texture_format/etc")) {
+ r_features->push_back("etc");
+ }
+ if (p_preset->get("texture_format/etc2")) {
+ r_features->push_back("etc2");
+ }
}
void EditorExportPlatformOSX::get_export_options(List<ExportOption> *r_options) {
@@ -112,6 +119,10 @@ void EditorExportPlatformOSX::get_export_options(List<ExportOption> *r_options)
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/identity"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "codesign/entitlements"), ""));
#endif
+
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), true));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), false));
}
void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_t> &p_data) {
diff --git a/platform/osx/godot_main_osx.mm b/platform/osx/godot_main_osx.mm
index 83d782cc2f..84e58a7323 100644
--- a/platform/osx/godot_main_osx.mm
+++ b/platform/osx/godot_main_osx.mm
@@ -74,6 +74,13 @@ int main(int argc, char **argv) {
}
}
+#ifdef DEBUG_ENABLED
+ // lets report the path we made current after all that
+ char cwd[4096];
+ getcwd(cwd, 4096);
+ printf("Current path: %s\n", cwd);
+#endif
+
OS_OSX os;
Error err = Main::setup(argv[0], argc - first_arg, &argv[first_arg]);
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h
index ebaebd84ce..ee44d8c570 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -181,6 +181,7 @@ public:
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen = 0) const;
virtual String get_executable_path() const;
+ virtual String get_resource_dir() const;
virtual LatinKeyboardVariant get_latin_keyboard_variant() const;
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index f502fb9a9c..ffc497b780 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1736,6 +1736,17 @@ String OS_OSX::get_executable_path() const {
}
}
+String OS_OSX::get_resource_dir() const {
+ // start with our executable path
+ String path = get_executable_path();
+
+ int pos = path.find_last("/Contents/MacOS/");
+ if (pos < 0)
+ return OS::get_resource_dir();
+
+ return path.substr(0, pos) + "/Contents/Resources/";
+}
+
// Returns string representation of keys, if they are printable.
//
static NSString *createStringForKeys(const CGKeyCode *keyCode, int length) {
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index f6b5edc2c9..1052db393b 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -888,12 +888,11 @@ static int QueryDpiForMonitor(HMONITOR hmon, _MonitorDpiType dpiType = MDT_Defau
}
typedef enum _SHC_PROCESS_DPI_AWARENESS {
- SHC_PROCESS_DPI_UNAWARE = 0,
- SHC_PROCESS_SYSTEM_DPI_AWARE = 1,
- SHC_PROCESS_PER_MONITOR_DPI_AWARE = 2
+ SHC_PROCESS_DPI_UNAWARE = 0,
+ SHC_PROCESS_SYSTEM_DPI_AWARE = 1,
+ SHC_PROCESS_PER_MONITOR_DPI_AWARE = 2
} SHC_PROCESS_DPI_AWARENESS;
-
void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
main_loop = NULL;
@@ -902,12 +901,12 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
WNDCLASSEXW wc;
if (is_hidpi_allowed()) {
- HMODULE Shcore = LoadLibraryW(L"Shcore.dll");;
+ HMODULE Shcore = LoadLibraryW(L"Shcore.dll");
if (Shcore != NULL) {
- typedef HRESULT (WINAPI *SetProcessDpiAwareness_t)(SHC_PROCESS_DPI_AWARENESS);
+ typedef HRESULT(WINAPI * SetProcessDpiAwareness_t)(SHC_PROCESS_DPI_AWARENESS);
- SetProcessDpiAwareness_t SetProcessDpiAwareness = (SetProcessDpiAwareness_t)GetProcAddress(Shcore, "SetProcessDpiAwareness");
+ SetProcessDpiAwareness_t SetProcessDpiAwareness = (SetProcessDpiAwareness_t)GetProcAddress(Shcore, "SetProcessDpiAwareness");
if (SetProcessDpiAwareness) {
SetProcessDpiAwareness(SHC_PROCESS_SYSTEM_DPI_AWARE);
@@ -915,7 +914,6 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
}
}
-
video_mode = p_desired;
//printf("**************** desired %s, mode %s\n", p_desired.fullscreen?"true":"false", video_mode.fullscreen?"true":"false");
RECT WindowRect;