summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorSam Green <greensamuelm@gmail.com>2020-02-21 21:01:34 -0800
committerSam Green <greensamuelm@gmail.com>2020-02-21 21:01:34 -0800
commite03e607230f590d90ad7e455e370dcd982e9cfaa (patch)
tree2f70162ce1c96b136a78984e2d2ad5e75691dab3 /platform
parent6e25a5448d7c8c5a873d4355e71297baebe84b27 (diff)
Resolve iOS and GLES compilation failures
Diffstat (limited to 'platform')
-rw-r--r--platform/iphone/game_center.mm14
-rw-r--r--platform/iphone/icloud.mm16
-rw-r--r--platform/iphone/in_app_store.mm16
-rw-r--r--platform/iphone/os_iphone.cpp10
4 files changed, 31 insertions, 25 deletions
diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm
index 696f61f954..14f4b00ea6 100644
--- a/platform/iphone/game_center.mm
+++ b/platform/iphone/game_center.mm
@@ -198,11 +198,11 @@ void GameCenter::request_achievement_descriptions() {
ret["type"] = "achievement_descriptions";
if (error == nil) {
ret["result"] = "ok";
- PoolStringArray names;
- PoolStringArray titles;
- PoolStringArray unachieved_descriptions;
- PoolStringArray achieved_descriptions;
- PoolIntArray maximum_points;
+ PackedStringArray names;
+ PackedStringArray titles;
+ PackedStringArray unachieved_descriptions;
+ PackedStringArray achieved_descriptions;
+ PackedIntArray maximum_points;
Array hidden;
Array replayable;
@@ -253,8 +253,8 @@ void GameCenter::request_achievements() {
ret["type"] = "achievements";
if (error == nil) {
ret["result"] = "ok";
- PoolStringArray names;
- PoolRealArray percentages;
+ PackedStringArray names;
+ PackedRealArray percentages;
for (int i = 0; i < [achievements count]; i++) {
diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm
index f846043dde..251f78f2da 100644
--- a/platform/iphone/icloud.mm
+++ b/platform/iphone/icloud.mm
@@ -80,13 +80,13 @@ Variant nsobject_to_variant(NSObject *object) {
const char *str = [(NSString *)object UTF8String];
return String::utf8(str != NULL ? str : "");
} else if ([object isKindOfClass:[NSData class]]) {
- PoolByteArray ret;
+ PackedByteArray ret;
NSData *data = (NSData *)object;
if ([data length] > 0) {
ret.resize([data length]);
{
- PoolByteArray::Write w = ret.write();
- copymem(w.ptr(), [data bytes], [data length]);
+ // PackedByteArray::Write w = ret.write();
+ copymem((void *)ret.ptr(), [data bytes], [data length]);
}
}
return ret;
@@ -184,10 +184,10 @@ NSObject *variant_to_nsobject(Variant v) {
[result addObject:value];
}
return result;
- } else if (v.get_type() == Variant::POOL_BYTE_ARRAY) {
- PoolByteArray arr = v;
- PoolByteArray::Read r = arr.read();
- NSData *result = [NSData dataWithBytes:r.ptr() length:arr.size()];
+ } else if (v.get_type() == Variant::PACKED_BYTE_ARRAY) {
+ PackedByteArray arr = v;
+ // PackedByteArray::Read r = arr.read();
+ NSData *result = [NSData dataWithBytes:arr.ptr() length:arr.size()];
return result;
}
WARN_PRINT(String("Could not add unsupported type to iCloud: '" + Variant::get_type_name(v.get_type()) + "'").utf8().get_data());
@@ -315,7 +315,7 @@ ICloud::ICloud() {
Dictionary ret;
ret["type"] = "key_value_changed";
- //PoolStringArray result_keys;
+ //PackedStringArray result_keys;
//Array result_values;
Dictionary keyValues;
String reason = "";
diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm
index 855ab195b0..842bc44c01 100644
--- a/platform/iphone/in_app_store.mm
+++ b/platform/iphone/in_app_store.mm
@@ -85,12 +85,12 @@ void InAppStore::_bind_methods() {
Dictionary ret;
ret["type"] = "product_info";
ret["result"] = "ok";
- PoolStringArray titles;
- PoolStringArray descriptions;
- PoolRealArray prices;
- PoolStringArray ids;
- PoolStringArray localized_prices;
- PoolStringArray currency_codes;
+ PackedStringArray titles;
+ PackedStringArray descriptions;
+ PackedRealArray prices;
+ PackedStringArray ids;
+ PackedStringArray localized_prices;
+ PackedStringArray currency_codes;
for (NSUInteger i = 0; i < [products count]; i++) {
@@ -113,7 +113,7 @@ void InAppStore::_bind_methods() {
ret["localized_prices"] = localized_prices;
ret["currency_codes"] = currency_codes;
- PoolStringArray invalid_ids;
+ PackedStringArray invalid_ids;
for (NSString *ipid in response.invalidProductIdentifiers) {
@@ -133,7 +133,7 @@ Error InAppStore::request_product_info(Variant p_params) {
Dictionary params = p_params;
ERR_FAIL_COND_V(!params.has("product_ids"), ERR_INVALID_PARAMETER);
- PoolStringArray pids = params["product_ids"];
+ PackedStringArray pids = params["product_ids"];
printf("************ request product info! %i\n", pids.size());
NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:pids.size()] autorelease];
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp
index f7676a0b79..0587e734b1 100644
--- a/platform/iphone/os_iphone.cpp
+++ b/platform/iphone/os_iphone.cpp
@@ -38,6 +38,8 @@
#if defined(VULKAN_ENABLED)
#include "servers/visual/rasterizer_rd/rasterizer_rd.h"
+#import <QuartzCore/CAMetalLayer.h>
+#include <vulkan/vulkan_metal.h>
#endif
#include "servers/visual/visual_server_raster.h"
@@ -109,6 +111,7 @@ int OSIPhone::get_current_video_driver() const {
Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
+#if defined(OPENGL_ENABLED)
bool gl_initialization_error = false;
// FIXME: Add Vulkan support via MoltenVK. Add fallback code back?
@@ -125,6 +128,7 @@ Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p
"Unable to initialize video driver");
return ERR_UNAVAILABLE;
}
+#endif
video_driver_index = p_video_driver;
visual_server = memnew(VisualServerRaster);
@@ -135,9 +139,10 @@ Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p
visual_server->init();
//visual_server->cursor_set_visible(false, 0);
-
+#if defined(OPENGL_ENABLED)
// reset this to what it should be, it will have been set to 0 after visual_server->init() is called
RasterizerStorageGLES2::system_fbo = gl_view_base_fb;
+#endif
AudioDriverManager::initialize(p_audio_driver);
@@ -444,9 +449,10 @@ bool OSIPhone::can_draw() const {
};
int OSIPhone::set_base_framebuffer(int p_fb) {
-
+#if defined(OPENGL_ENABLED)
// gl_view_base_fb has not been updated yet
RasterizerStorageGLES2::system_fbo = p_fb;
+#endif
return 0;
};