Resolve iOS and GLES compilation failures
This commit is contained in:
parent
6e25a5448d
commit
e03e607230
4 changed files with 31 additions and 25 deletions
|
@ -198,11 +198,11 @@ void GameCenter::request_achievement_descriptions() {
|
||||||
ret["type"] = "achievement_descriptions";
|
ret["type"] = "achievement_descriptions";
|
||||||
if (error == nil) {
|
if (error == nil) {
|
||||||
ret["result"] = "ok";
|
ret["result"] = "ok";
|
||||||
PoolStringArray names;
|
PackedStringArray names;
|
||||||
PoolStringArray titles;
|
PackedStringArray titles;
|
||||||
PoolStringArray unachieved_descriptions;
|
PackedStringArray unachieved_descriptions;
|
||||||
PoolStringArray achieved_descriptions;
|
PackedStringArray achieved_descriptions;
|
||||||
PoolIntArray maximum_points;
|
PackedIntArray maximum_points;
|
||||||
Array hidden;
|
Array hidden;
|
||||||
Array replayable;
|
Array replayable;
|
||||||
|
|
||||||
|
@ -253,8 +253,8 @@ void GameCenter::request_achievements() {
|
||||||
ret["type"] = "achievements";
|
ret["type"] = "achievements";
|
||||||
if (error == nil) {
|
if (error == nil) {
|
||||||
ret["result"] = "ok";
|
ret["result"] = "ok";
|
||||||
PoolStringArray names;
|
PackedStringArray names;
|
||||||
PoolRealArray percentages;
|
PackedRealArray percentages;
|
||||||
|
|
||||||
for (int i = 0; i < [achievements count]; i++) {
|
for (int i = 0; i < [achievements count]; i++) {
|
||||||
|
|
||||||
|
|
|
@ -80,13 +80,13 @@ Variant nsobject_to_variant(NSObject *object) {
|
||||||
const char *str = [(NSString *)object UTF8String];
|
const char *str = [(NSString *)object UTF8String];
|
||||||
return String::utf8(str != NULL ? str : "");
|
return String::utf8(str != NULL ? str : "");
|
||||||
} else if ([object isKindOfClass:[NSData class]]) {
|
} else if ([object isKindOfClass:[NSData class]]) {
|
||||||
PoolByteArray ret;
|
PackedByteArray ret;
|
||||||
NSData *data = (NSData *)object;
|
NSData *data = (NSData *)object;
|
||||||
if ([data length] > 0) {
|
if ([data length] > 0) {
|
||||||
ret.resize([data length]);
|
ret.resize([data length]);
|
||||||
{
|
{
|
||||||
PoolByteArray::Write w = ret.write();
|
// PackedByteArray::Write w = ret.write();
|
||||||
copymem(w.ptr(), [data bytes], [data length]);
|
copymem((void *)ret.ptr(), [data bytes], [data length]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -184,10 +184,10 @@ NSObject *variant_to_nsobject(Variant v) {
|
||||||
[result addObject:value];
|
[result addObject:value];
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} else if (v.get_type() == Variant::POOL_BYTE_ARRAY) {
|
} else if (v.get_type() == Variant::PACKED_BYTE_ARRAY) {
|
||||||
PoolByteArray arr = v;
|
PackedByteArray arr = v;
|
||||||
PoolByteArray::Read r = arr.read();
|
// PackedByteArray::Read r = arr.read();
|
||||||
NSData *result = [NSData dataWithBytes:r.ptr() length:arr.size()];
|
NSData *result = [NSData dataWithBytes:arr.ptr() length:arr.size()];
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
WARN_PRINT(String("Could not add unsupported type to iCloud: '" + Variant::get_type_name(v.get_type()) + "'").utf8().get_data());
|
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;
|
Dictionary ret;
|
||||||
ret["type"] = "key_value_changed";
|
ret["type"] = "key_value_changed";
|
||||||
|
|
||||||
//PoolStringArray result_keys;
|
//PackedStringArray result_keys;
|
||||||
//Array result_values;
|
//Array result_values;
|
||||||
Dictionary keyValues;
|
Dictionary keyValues;
|
||||||
String reason = "";
|
String reason = "";
|
||||||
|
|
|
@ -85,12 +85,12 @@ void InAppStore::_bind_methods() {
|
||||||
Dictionary ret;
|
Dictionary ret;
|
||||||
ret["type"] = "product_info";
|
ret["type"] = "product_info";
|
||||||
ret["result"] = "ok";
|
ret["result"] = "ok";
|
||||||
PoolStringArray titles;
|
PackedStringArray titles;
|
||||||
PoolStringArray descriptions;
|
PackedStringArray descriptions;
|
||||||
PoolRealArray prices;
|
PackedRealArray prices;
|
||||||
PoolStringArray ids;
|
PackedStringArray ids;
|
||||||
PoolStringArray localized_prices;
|
PackedStringArray localized_prices;
|
||||||
PoolStringArray currency_codes;
|
PackedStringArray currency_codes;
|
||||||
|
|
||||||
for (NSUInteger i = 0; i < [products count]; i++) {
|
for (NSUInteger i = 0; i < [products count]; i++) {
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ void InAppStore::_bind_methods() {
|
||||||
ret["localized_prices"] = localized_prices;
|
ret["localized_prices"] = localized_prices;
|
||||||
ret["currency_codes"] = currency_codes;
|
ret["currency_codes"] = currency_codes;
|
||||||
|
|
||||||
PoolStringArray invalid_ids;
|
PackedStringArray invalid_ids;
|
||||||
|
|
||||||
for (NSString *ipid in response.invalidProductIdentifiers) {
|
for (NSString *ipid in response.invalidProductIdentifiers) {
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ Error InAppStore::request_product_info(Variant p_params) {
|
||||||
Dictionary params = p_params;
|
Dictionary params = p_params;
|
||||||
ERR_FAIL_COND_V(!params.has("product_ids"), ERR_INVALID_PARAMETER);
|
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());
|
printf("************ request product info! %i\n", pids.size());
|
||||||
|
|
||||||
NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:pids.size()] autorelease];
|
NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:pids.size()] autorelease];
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
|
|
||||||
#if defined(VULKAN_ENABLED)
|
#if defined(VULKAN_ENABLED)
|
||||||
#include "servers/visual/rasterizer_rd/rasterizer_rd.h"
|
#include "servers/visual/rasterizer_rd/rasterizer_rd.h"
|
||||||
|
#import <QuartzCore/CAMetalLayer.h>
|
||||||
|
#include <vulkan/vulkan_metal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "servers/visual/visual_server_raster.h"
|
#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) {
|
Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
|
||||||
|
|
||||||
|
#if defined(OPENGL_ENABLED)
|
||||||
bool gl_initialization_error = false;
|
bool gl_initialization_error = false;
|
||||||
|
|
||||||
// FIXME: Add Vulkan support via MoltenVK. Add fallback code back?
|
// 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");
|
"Unable to initialize video driver");
|
||||||
return ERR_UNAVAILABLE;
|
return ERR_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
video_driver_index = p_video_driver;
|
video_driver_index = p_video_driver;
|
||||||
visual_server = memnew(VisualServerRaster);
|
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->init();
|
||||||
//visual_server->cursor_set_visible(false, 0);
|
//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
|
// 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;
|
RasterizerStorageGLES2::system_fbo = gl_view_base_fb;
|
||||||
|
#endif
|
||||||
|
|
||||||
AudioDriverManager::initialize(p_audio_driver);
|
AudioDriverManager::initialize(p_audio_driver);
|
||||||
|
|
||||||
|
@ -444,9 +449,10 @@ bool OSIPhone::can_draw() const {
|
||||||
};
|
};
|
||||||
|
|
||||||
int OSIPhone::set_base_framebuffer(int p_fb) {
|
int OSIPhone::set_base_framebuffer(int p_fb) {
|
||||||
|
#if defined(OPENGL_ENABLED)
|
||||||
// gl_view_base_fb has not been updated yet
|
// gl_view_base_fb has not been updated yet
|
||||||
RasterizerStorageGLES2::system_fbo = p_fb;
|
RasterizerStorageGLES2::system_fbo = p_fb;
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue