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";
|
||||
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++) {
|
||||
|
||||
|
|
|
@ -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 = "";
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue