Working on compile issues for iOS

This commit is contained in:
BastiaanOlij 2017-01-07 19:33:11 +11:00
parent eeea116022
commit 3a02df7739
21 changed files with 100 additions and 136 deletions

View file

@ -11,7 +11,7 @@ os:
- osx
env:
#- GODOT_TARGET=iphone
- GODOT_TARGET=iphone
- GODOT_TARGET=osx
- GODOT_TARGET=x11
#- GODOT_TARGET=android

View file

@ -1,6 +1,11 @@
#include "rasterizer_canvas_gles3.h"
#include "os/os.h"
#ifdef IPHONE_ENABLED
// for some reason glClearDepth seems to have been removed in iOS ES3.h
#define glClearDepth glClearDepthf
#endif
static _FORCE_INLINE_ void store_transform2d(const Transform2D& p_mtx, float* p_array) {
p_array[ 0]=p_mtx.elements[0][0];

View file

@ -237,7 +237,7 @@ void RasterizerGLES3::set_current_render_target(RID p_render_target){
storage->frame.current_rt=NULL;
storage->frame.clear_request=false;
glViewport(0,0,OS::get_singleton()->get_window_size().width,OS::get_singleton()->get_window_size().height);
glBindFramebuffer(GL_FRAMEBUFFER,storage->config.system_fbo);
glBindFramebuffer(GL_FRAMEBUFFER,RasterizerStorageGLES3::system_fbo);
}
}
@ -268,7 +268,7 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target,const Rec
canvas->canvas_begin();
glDisable(GL_BLEND);
glBindFramebuffer(GL_FRAMEBUFFER,storage->config.system_fbo);
glBindFramebuffer(GL_FRAMEBUFFER,RasterizerStorageGLES3::system_fbo);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D,rt->color);
canvas->draw_generic_textured_rect(p_screen_rect,Rect2(0,0,1,-1));

View file

@ -3,6 +3,11 @@
#include "os/os.h"
#include "rasterizer_canvas_gles3.h"
#ifdef IPHONE_ENABLED
// for some reason glClearDepth seems to have been removed in iOS ES3.h
#define glClearDepth glClearDepthf
#endif
static const GLenum _cube_side_enum[6]={
GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
@ -141,7 +146,7 @@ void RasterizerSceneGLES3::shadow_atlas_set_size(RID p_atlas,int p_size){
GL_TEXTURE_2D, shadow_atlas->depth, 0);
glViewport(0,0,shadow_atlas->size,shadow_atlas->size);
glClearDepth(0);
glClearDepth(0.0f);
glClear(GL_DEPTH_BUFFER_BIT);
}
@ -3753,8 +3758,7 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C
glViewport(0,0,storage->frame.current_rt->width,storage->frame.current_rt->height);
glColorMask(0,0,0,0);
glClearDepth(1.0);
glClearDepth(1.0f);
glClear(GL_DEPTH_BUFFER_BIT);
@ -3866,7 +3870,7 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C
}
if (!fb_cleared) {
glClearDepth(1.0);
glClearDepth(1.0f);
glClear(GL_DEPTH_BUFFER_BIT);
}
@ -3973,7 +3977,6 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C
_render_mrts(env,p_cam_projection);
}
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glEnable(GL_BLEND);
glDepthMask(GL_TRUE);
glEnable(GL_DEPTH_TEST);
@ -4419,7 +4422,7 @@ void RasterizerSceneGLES3::render_shadow(RID p_light,RID p_shadow_atlas,int p_pa
}
glEnable(GL_SCISSOR_TEST);
glClearDepth(1.0);
glClearDepth(1.0f);
glClear(GL_DEPTH_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
@ -4472,7 +4475,7 @@ void RasterizerSceneGLES3::render_shadow(RID p_light,RID p_shadow_atlas,int p_pa
glViewport(local_x,local_y,local_width,local_height);
glScissor(local_x,local_y,local_width,local_height);
glEnable(GL_SCISSOR_TEST);
glClearDepth(1.0);
glClearDepth(1.0f);
glClear(GL_DEPTH_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
//glDisable(GL_DEPTH_TEST);

View file

@ -78,6 +78,8 @@
#define _EXT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
#define _EXT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F
GLuint RasterizerStorageGLES3::system_fbo = 0;
Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image& p_image, Image::Format p_format, uint32_t p_flags,GLenum& r_gl_format,GLenum& r_gl_internal_format,GLenum &r_gl_type,bool &r_compressed,bool &srgb) {
@ -133,8 +135,12 @@ Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image& p_image, Ima
} break;
case Image::FORMAT_RGB565: {
#ifdef IPHONE_ENABLED
r_gl_internal_format=GL_RGB565;
#else
//#warning TODO: Convert tod 555 if 565 is not supported (GLES3.3-)
r_gl_internal_format=GL_RGB5;
#endif
//r_gl_internal_format=GL_RGB565;
r_gl_format=GL_RGB;
r_gl_type=GL_UNSIGNED_SHORT_5_6_5;
@ -1186,7 +1192,7 @@ RID RasterizerStorageGLES3::texture_create_radiance_cubemap(RID p_source,int p_r
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
glDeleteFramebuffers(1, &tmp_fb);
Texture * ctex = memnew( Texture );
@ -1351,7 +1357,7 @@ void RasterizerStorageGLES3::skybox_set_texture(RID p_skybox, RID p_cube_map, in
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
glDeleteFramebuffers(1, &tmp_fb);
}
@ -5523,7 +5529,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->color, 0);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE );
@ -5610,7 +5616,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
if (status != GL_FRAMEBUFFER_COMPLETE) {
printf("err status: %x\n",status);
@ -5643,7 +5649,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){
ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE );
}
glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
if (status != GL_FRAMEBUFFER_COMPLETE) {
_render_target_clear(rt);
@ -5712,7 +5718,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){
}
glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
rt->effects.mip_maps[i].levels=level;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@ -5941,7 +5947,7 @@ RID RasterizerStorageGLES3::canvas_light_shadow_buffer_create(int p_width) {
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
//printf("errnum: %x\n",status);
glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
ERR_FAIL_COND_V( status != GL_FRAMEBUFFER_COMPLETE, RID() );
@ -6296,7 +6302,7 @@ void RasterizerStorageGLES3::initialize() {
config.render_arch=RENDER_ARCH_DESKTOP;
//config.fbo_deferred=int(Globals::get_singleton()->get("rendering/gles3/lighting_technique"));
config.system_fbo=0;
RasterizerStorageGLES3::system_fbo=0;
//// extensions config

View file

@ -24,6 +24,7 @@ public:
RasterizerCanvasGLES3 *canvas;
RasterizerSceneGLES3 *scene;
static GLuint system_fbo; //on some devices, such as apple, screen is rendered to yet another fbo.
enum RenderArchitecture {
RENDER_ARCH_MOBILE,
@ -34,8 +35,6 @@ public:
RenderArchitecture render_arch;
GLuint system_fbo; //on some devices, such as apple, screen is rendered to yet another fbo.
bool shrink_textures_x2;
bool use_fast_texture_filter;
bool use_anisotropic_filter;

View file

@ -30,8 +30,6 @@
#import "gl_view.h"
#import "view_controller.h"
// Old accelerometer approach deprecated since IOS 7.0
// Include coremotion for accelerometer, gyroscope and magnetometer access, available since IOS 4.0 but some functionality won't work for anything before IOS 5.0
#import <CoreMotion/CoreMotion.h>
@interface AppDelegate : NSObject <UIApplicationDelegate, GLViewDelegate> {

View file

@ -284,12 +284,12 @@ static int frame_count = 0;
//glView.autoresizesSubviews = YES;
//[glView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth];
int backingWidth;
int backingHeight;
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
int backingWidth;
int backingHeight;
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
iphone_main(backingWidth, backingHeight, gargc, gargv);
iphone_main(backingWidth, backingHeight, gargc, gargv);
view_controller = [[ViewController alloc] init];
view_controller.view = glView;
@ -305,16 +305,6 @@ static int frame_count = 0;
[window makeKeyAndVisible];
//Configure and start accelerometer
/*
Old accelerometer approach deprecated since IOS 7.0
last_accel[0] = 0;
last_accel[1] = 0;
last_accel[2] = 0;
[[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0 / kAccelerometerFrequency)];
[[UIAccelerometer sharedAccelerometer] setDelegate:self];
*/
if (!motionInitialised) {
motionManager = [[CMMotionManager alloc] init];
if (motionManager.deviceMotionAvailable) {
@ -365,10 +355,10 @@ static int frame_count = 0;
if (motionInitialised) {
///@TODO is this the right place to clean this up?
[motionManager stopDeviceMotionUpdates];
[motionManager release];
motionManager = nil;
motionInitialised = NO;
[motionManager stopDeviceMotionUpdates];
[motionManager release];
motionManager = nil;
motionInitialised = NO;
};
iphone_finish();
@ -416,16 +406,6 @@ static int frame_count = 0;
};
}
/*
Depricated since IOS 7.0
- (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration {
//Use a basic low-pass filter to only keep the gravity in the accelerometer values
accel[0] = acceleration.x; // * kFilteringFactor + accel[0] * (1.0 - kFilteringFactor);
accel[1] = acceleration.y; // * kFilteringFactor + accel[1] * (1.0 - kFilteringFactor);
accel[2] = acceleration.z; // * kFilteringFactor + accel[2] * (1.0 - kFilteringFactor);
}
*/
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED
return [[[FacebookScorer sharedInstance] facebook] handleOpenURL:url];

View file

@ -155,8 +155,8 @@ int AudioDriverIphone::get_mix_rate() const {
return 44100;
};
AudioDriver::OutputFormat AudioDriverIphone::get_output_format() const {
return OUTPUT_STEREO;
AudioDriver::SpeakerMode AudioDriverIphone::get_speaker_mode() const {
return SPEAKER_MODE_STEREO;
};
void AudioDriverIphone::lock() {

View file

@ -26,7 +26,8 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "servers/audio/audio_server_sw.h"
#include "servers/audio_server.h"
#include <AudioUnit/AudioUnit.h>
@ -56,7 +57,7 @@ public:
virtual Error init();
virtual void start();
virtual int get_mix_rate() const;
virtual OutputFormat get_output_format() const;
virtual SpeakerMode get_speaker_mode() const;
virtual void lock();
virtual void unlock();
virtual void finish();

View file

@ -62,13 +62,13 @@ def configure(env):
env['CCFLAGS'] = string.split('-arch i386 -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fasm-blocks -Wall -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -isysroot $IPHONESDK -mios-simulator-version-min=4.3 -DCUSTOM_MATRIX_TRANSFORM_H=\\\"build/iphone/matrix4_iphone.h\\\" -DCUSTOM_VECTOR3_TRANSFORM_H=\\\"build/iphone/vector3_iphone.h\\\"')
elif (env["arch"] == "arm64"): # arm64
env["bits"] = "64"
env['CCFLAGS'] = string.split('-fno-objc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -fvisibility=hidden -Wno-sign-conversion -MMD -MT dependencies -miphoneos-version-min=5.1.1 -isysroot $IPHONESDK')
env['CCFLAGS'] = string.split('-fno-objc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -fvisibility=hidden -Wno-sign-conversion -MMD -MT dependencies -miphoneos-version-min=7.0 -isysroot $IPHONESDK')
env.Append(CPPFLAGS=['-DNEED_LONG_INT'])
env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON'])
else: # armv7
env["arch"] = "arm"
env["bits"] = "32"
env['CCFLAGS'] = string.split('-fno-objc-arc -arch armv7 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -fvisibility=hidden -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=5.1.1 -MMD -MT dependencies -isysroot $IPHONESDK')
env['CCFLAGS'] = string.split('-fno-objc-arc -arch armv7 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -isysroot $IPHONESDK -fvisibility=hidden -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=7.0 -MMD -MT dependencies -isysroot $IPHONESDK')
if (env["arch"] == "x86"):
env['IPHONEPLATFORM'] = 'iPhoneSimulator'
@ -94,7 +94,7 @@ def configure(env):
'-F$IPHONESDK',
])
elif (env["arch"] == "arm64"):
env.Append(LINKFLAGS=['-arch', 'arm64', '-Wl,-dead_strip', '-miphoneos-version-min=5.1.1',
env.Append(LINKFLAGS=['-arch', 'arm64', '-Wl,-dead_strip', '-miphoneos-version-min=7.0',
'-isysroot', '$IPHONESDK',
#'-stdlib=libc++',
'-framework', 'Foundation',
@ -113,7 +113,7 @@ def configure(env):
'-framework', 'CoreMotion',
])
else:
env.Append(LINKFLAGS=['-arch', 'armv7', '-Wl,-dead_strip', '-miphoneos-version-min=5.1.1',
env.Append(LINKFLAGS=['-arch', 'armv7', '-Wl,-dead_strip', '-miphoneos-version-min=7.0',
'-isysroot', '$IPHONESDK',
'-framework', 'Foundation',
'-framework', 'UIKit',

View file

@ -182,11 +182,11 @@ void GameCenter::request_achievement_descriptions() {
ret["type"] = "achievement_descriptions";
if (error == nil) {
ret["result"] = "ok";
StringArray names;
StringArray titles;
StringArray unachieved_descriptions;
StringArray achieved_descriptions;
IntArray maximum_points;
PoolStringArray names;
PoolStringArray titles;
PoolStringArray unachieved_descriptions;
PoolStringArray achieved_descriptions;
PoolIntArray maximum_points;
Array hidden;
Array replayable;
@ -239,8 +239,8 @@ void GameCenter::request_achievements() {
ret["type"] = "achievements";
if (error == nil) {
ret["result"] = "ok";
StringArray names;
RealArray percentages;
PoolStringArray names;
PoolRealArray percentages;
for (int i=0; i<[achievements count]; i++) {

View file

@ -274,7 +274,7 @@ static void clear_touches() {
nil];
// Create our EAGLContext, and if successful make it current and create our framebuffer.
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
if(!context || ![EAGLContext setCurrentContext:context] || ![self createFramebuffer])
{

View file

@ -78,12 +78,12 @@ Variant nsobject_to_variant(NSObject* object) {
return String::utf8(str != NULL ? str : "");
}
else if ([object isKindOfClass:[NSData class]]) {
ByteArray ret;
PoolByteArray ret;
NSData* data = (NSData*)object;
if ([data length] > 0) {
ret.resize([data length]);
{
ByteArray::Write w = ret.write();
PoolByteArray::Write w = ret.write();
copymem(w.ptr(), [data bytes], [data length]);
}
}
@ -199,9 +199,9 @@ NSObject* variant_to_nsobject(Variant v) {
}
return result;
}
else if (v.get_type() == Variant::RAW_ARRAY) {
ByteArray arr = v;
ByteArray::Read r = arr.read();
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()];
return result;
}
@ -333,7 +333,7 @@ ICloud::ICloud() {
Dictionary ret;
ret["type"] = "key_value_changed";
//StringArray result_keys;
//PoolStringArray result_keys;
//Array result_values;
Dictionary keyValues;
String reason = "";

View file

@ -89,11 +89,11 @@ void InAppStore::_bind_methods() {
Dictionary ret;
ret["type"] = "product_info";
ret["result"] = "ok";
StringArray titles;
StringArray descriptions;
RealArray prices;
StringArray ids;
StringArray localized_prices;
PoolStringArray titles;
PoolStringArray descriptions;
PoolRealArray prices;
PoolStringArray ids;
PoolStringArray localized_prices;
for (int i=0; i<[products count]; i++) {
@ -114,7 +114,7 @@ void InAppStore::_bind_methods() {
ret["ids"] = ids;
ret["localized_prices"] = localized_prices;
StringArray invalid_ids;
PoolStringArray invalid_ids;
for (NSString* ipid in response.invalidProductIdentifiers) {
@ -134,7 +134,7 @@ Error InAppStore::request_product_info(Variant p_params) {
Dictionary params = p_params;
ERR_FAIL_COND_V(!params.has("product_ids"), ERR_INVALID_PARAMETER);
StringArray pids = params["product_ids"];
PoolStringArray pids = params["product_ids"];
printf("************ request product info! %i\n", pids.size());
NSMutableArray* array = [[[NSMutableArray alloc] initWithCapacity:pids.size()] autorelease];

View file

@ -30,11 +30,9 @@
#include "os_iphone.h"
#include "drivers/gles2/rasterizer_gles2.h"
#include "drivers/gles3/rasterizer_gles3.h"
#include "servers/visual/visual_server_raster.h"
#include "servers/visual/visual_server_wrap_mt.h"
//#include "servers/visual/visual_server_wrap_mt.h"
#include "main/main.h"
#include "audio_driver_iphone.h"
@ -109,16 +107,17 @@ void OSIPhone::initialize(const VideoMode& p_desired,int p_video_driver,int p_au
supported_orientations |= ((GLOBAL_DEF("video_mode/allow_vertical", false)?1:0) << PortraitDown);
supported_orientations |= ((GLOBAL_DEF("video_mode/allow_vertical_flipped", false)?1:0) << PortraitUp);
rasterizer_gles22 = memnew( RasterizerGLES2(false, false, false) );
rasterizer = rasterizer_gles22;
rasterizer_gles22->set_base_framebuffer(gl_view_base_fb);
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();
RasterizerStorageGLES3::system_fbo = gl_view_base_fb;
visual_server = memnew( VisualServerRaster(rasterizer) );
visual_server = memnew( VisualServerRaster() );
/*
FIXME: Reimplement threaded rendering? Or remove?
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
visual_server = memnew(VisualServerWrapMT(visual_server, false));
};
visual_server->init();
*/
visual_server->init();
visual_server->cursor_set_visible(false, 0);
@ -127,16 +126,7 @@ void OSIPhone::initialize(const VideoMode& p_desired,int p_video_driver,int p_au
audio_driver->set_singleton();
audio_driver->init();
sample_manager = memnew( SampleManagerMallocSW );
audio_server = memnew( AudioServerSW(sample_manager) );
audio_server->init();
spatial_sound_server = memnew( SpatialSoundServerSW );
spatial_sound_server->init();
spatial_sound_2d_server = memnew( SpatialSound2DServerSW );
spatial_sound_2d_server->init();
//
// init physics servers
physics_server = memnew( PhysicsServerSW );
physics_server->init();
//physics_2d_server = memnew( Physics2DServerSW );
@ -148,28 +138,28 @@ void OSIPhone::initialize(const VideoMode& p_desired,int p_video_driver,int p_au
/*
#ifdef IOS_SCORELOOP_ENABLED
scoreloop = memnew(ScoreloopIOS);
Globals::get_singleton()->add_singleton(Globals::Singleton("Scoreloop", scoreloop));
GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("Scoreloop", scoreloop));
scoreloop->connect();
#endif
*/
#ifdef GAME_CENTER_ENABLED
game_center = memnew(GameCenter);
Globals::get_singleton()->add_singleton(Globals::Singleton("GameCenter", game_center));
GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("GameCenter", game_center));
game_center->connect();
#endif
#ifdef STOREKIT_ENABLED
store_kit = memnew(InAppStore);
Globals::get_singleton()->add_singleton(Globals::Singleton("InAppStore", store_kit));
GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("InAppStore", store_kit));
#endif
#ifdef ICLOUD_ENABLED
icloud = memnew(ICloud);
Globals::get_singleton()->add_singleton(Globals::Singleton("ICloud", icloud));
GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("ICloud", icloud));
//icloud->connect();
#endif
Globals::get_singleton()->add_singleton(Globals::Singleton("iOS", memnew(iOS)));
GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("iOS", memnew(iOS)));
};
MainLoop *OSIPhone::get_main_loop() const {
@ -294,8 +284,8 @@ void OSIPhone::mouse_move(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_
};
input->set_mouse_pos(Point2(ev.mouse_motion.x,ev.mouse_motion.y));
ev.mouse_motion.speed_x=input->get_mouse_speed().x;
ev.mouse_motion.speed_y=input->get_mouse_speed().y;
ev.mouse_motion.speed_x=input->get_last_mouse_speed().x;
ev.mouse_motion.speed_y=input->get_last_mouse_speed().y;
ev.mouse_motion.button_mask = 1; // pressed
queue_event(ev);
@ -394,7 +384,7 @@ void OSIPhone::finalize() {
visual_server->finish();
memdelete(visual_server);
memdelete(rasterizer);
// memdelete(rasterizer);
physics_server->finish();
memdelete(physics_server);
@ -402,14 +392,8 @@ void OSIPhone::finalize() {
physics_2d_server->finish();
memdelete(physics_2d_server);
spatial_sound_server->finish();
memdelete(spatial_sound_server);
memdelete(input);
spatial_sound_2d_server->finish();
memdelete(spatial_sound_2d_server);
};
void OSIPhone::set_mouse_show(bool p_show) { };
@ -456,9 +440,8 @@ bool OSIPhone::can_draw() const {
int OSIPhone::set_base_framebuffer(int p_fb) {
if (rasterizer_gles22) {
rasterizer_gles22->set_base_framebuffer(p_fb);
};
RasterizerStorageGLES3::system_fbo = gl_view_base_fb;
return 0;
};
@ -542,7 +525,7 @@ Error OSIPhone::native_video_play(String p_path, float p_volume, String p_audio_
print("Unable to play %S using the native player as it resides in a .pck file\n", p_path.c_str());
return ERR_INVALID_PARAMETER;
} else {
p_path = p_path.replace("res:/", Globals::get_singleton()->get_resource_path());
p_path = p_path.replace("res:/", GlobalConfig::get_singleton()->get_resource_path());
}
} else if (p_path.begins_with("user://"))
p_path = p_path.replace("user:/", get_data_dir());
@ -579,10 +562,8 @@ void OSIPhone::native_video_stop() {
OSIPhone::OSIPhone(int width, int height) {
rasterizer_gles22 = NULL;
main_loop = NULL;
visual_server = NULL;
rasterizer = NULL;
VideoMode vm;
vm.fullscreen = true;

View file

@ -39,10 +39,7 @@
#include "servers/physics/physics_server_sw.h"
#include "servers/physics_2d/physics_2d_server_sw.h"
#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
#include "servers/audio/audio_server_sw.h"
#include "servers/audio/sample_manager_sw.h"
#include "servers/spatial_sound/spatial_sound_server_sw.h"
#include "servers/spatial_sound_2d/spatial_sound_2d_server_sw.h"
#include "servers/audio_server.h"
#include "main/input_default.h"
#include "game_center.h"
#include "in_app_store.h"
@ -50,7 +47,7 @@
class AudioDriverIphone;
class RasterizerGLES2;
// class RasterizerGLES2;
class OSIPhone : public OS_Unix {
@ -71,18 +68,13 @@ private:
uint8_t supported_orientations;
Rasterizer *rasterizer;
RasterizerGLES2* rasterizer_gles22;
// Rasterizer *rasterizer;
// RasterizerGLES2* rasterizer_gles22;
VisualServer *visual_server;
PhysicsServer* physics_server;
Physics2DServer *physics_2d_server;
AudioServerSW *audio_server;
SampleManagerMallocSW *sample_manager;
SpatialSoundServerSW *spatial_sound_server;
SpatialSound2DServerSW *spatial_sound_2d_server;
AudioDriverIphone* audio_driver;
#ifdef GAME_CENTER_ENABLED

View file

@ -27,8 +27,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include <alloca.h>
#define GLES2_INCLUDE_H <ES2/gl.h>
// #define GLES2_INCLUDE_H <ES2/gl.h>
#define GLES3_INCLUDE_H <ES3/gl.h>
#define PLATFORM_REFCOUNT

View file

@ -1705,7 +1705,6 @@ void BakedLight::create_debug_mesh(DebugMode p_mode) {
#else
mmi->set_owner(get_owner());
#endif
}
void BakedLight::_debug_mesh_albedo() {

View file

@ -1324,7 +1324,6 @@ void GIProbe::_create_debug_mesh(Baker *p_baker) {
#else
mmi->set_owner(get_owner());
#endif
}
void GIProbe::_debug_bake() {

View file

@ -123,6 +123,7 @@ void VisualServerRaster::finish(){
VSG::rasterizer->finalize();
}
/* STATUS INFORMATION */