Working on compile issues for iOS
This commit is contained in:
parent
eeea116022
commit
3a02df7739
21 changed files with 100 additions and 136 deletions
|
@ -11,7 +11,7 @@ os:
|
||||||
- osx
|
- osx
|
||||||
|
|
||||||
env:
|
env:
|
||||||
#- GODOT_TARGET=iphone
|
- GODOT_TARGET=iphone
|
||||||
- GODOT_TARGET=osx
|
- GODOT_TARGET=osx
|
||||||
- GODOT_TARGET=x11
|
- GODOT_TARGET=x11
|
||||||
#- GODOT_TARGET=android
|
#- GODOT_TARGET=android
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
#include "rasterizer_canvas_gles3.h"
|
#include "rasterizer_canvas_gles3.h"
|
||||||
#include "os/os.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) {
|
static _FORCE_INLINE_ void store_transform2d(const Transform2D& p_mtx, float* p_array) {
|
||||||
|
|
||||||
p_array[ 0]=p_mtx.elements[0][0];
|
p_array[ 0]=p_mtx.elements[0][0];
|
||||||
|
|
|
@ -237,7 +237,7 @@ void RasterizerGLES3::set_current_render_target(RID p_render_target){
|
||||||
storage->frame.current_rt=NULL;
|
storage->frame.current_rt=NULL;
|
||||||
storage->frame.clear_request=false;
|
storage->frame.clear_request=false;
|
||||||
glViewport(0,0,OS::get_singleton()->get_window_size().width,OS::get_singleton()->get_window_size().height);
|
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();
|
canvas->canvas_begin();
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER,storage->config.system_fbo);
|
glBindFramebuffer(GL_FRAMEBUFFER,RasterizerStorageGLES3::system_fbo);
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D,rt->color);
|
glBindTexture(GL_TEXTURE_2D,rt->color);
|
||||||
canvas->draw_generic_textured_rect(p_screen_rect,Rect2(0,0,1,-1));
|
canvas->draw_generic_textured_rect(p_screen_rect,Rect2(0,0,1,-1));
|
||||||
|
|
|
@ -3,6 +3,11 @@
|
||||||
#include "os/os.h"
|
#include "os/os.h"
|
||||||
#include "rasterizer_canvas_gles3.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]={
|
static const GLenum _cube_side_enum[6]={
|
||||||
|
|
||||||
GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
|
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);
|
GL_TEXTURE_2D, shadow_atlas->depth, 0);
|
||||||
|
|
||||||
glViewport(0,0,shadow_atlas->size,shadow_atlas->size);
|
glViewport(0,0,shadow_atlas->size,shadow_atlas->size);
|
||||||
glClearDepth(0);
|
glClearDepth(0.0f);
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
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);
|
glViewport(0,0,storage->frame.current_rt->width,storage->frame.current_rt->height);
|
||||||
|
|
||||||
glColorMask(0,0,0,0);
|
glColorMask(0,0,0,0);
|
||||||
|
glClearDepth(1.0f);
|
||||||
glClearDepth(1.0);
|
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
glClear(GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
|
|
||||||
|
@ -3866,7 +3870,7 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fb_cleared) {
|
if (!fb_cleared) {
|
||||||
glClearDepth(1.0);
|
glClearDepth(1.0f);
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
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);
|
_render_mrts(env,p_cam_projection);
|
||||||
}
|
}
|
||||||
|
|
||||||
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
glEnable(GL_DEPTH_TEST);
|
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);
|
glEnable(GL_SCISSOR_TEST);
|
||||||
glClearDepth(1.0);
|
glClearDepth(1.0f);
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
glClear(GL_DEPTH_BUFFER_BIT);
|
||||||
glDisable(GL_SCISSOR_TEST);
|
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);
|
glViewport(local_x,local_y,local_width,local_height);
|
||||||
glScissor(local_x,local_y,local_width,local_height);
|
glScissor(local_x,local_y,local_width,local_height);
|
||||||
glEnable(GL_SCISSOR_TEST);
|
glEnable(GL_SCISSOR_TEST);
|
||||||
glClearDepth(1.0);
|
glClearDepth(1.0f);
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
glClear(GL_DEPTH_BUFFER_BIT);
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
//glDisable(GL_DEPTH_TEST);
|
//glDisable(GL_DEPTH_TEST);
|
||||||
|
|
|
@ -78,6 +78,8 @@
|
||||||
#define _EXT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
|
#define _EXT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
|
||||||
#define _EXT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F
|
#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) {
|
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;
|
} break;
|
||||||
case Image::FORMAT_RGB565: {
|
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-)
|
//#warning TODO: Convert tod 555 if 565 is not supported (GLES3.3-)
|
||||||
r_gl_internal_format=GL_RGB5;
|
r_gl_internal_format=GL_RGB5;
|
||||||
|
#endif
|
||||||
//r_gl_internal_format=GL_RGB565;
|
//r_gl_internal_format=GL_RGB565;
|
||||||
r_gl_format=GL_RGB;
|
r_gl_format=GL_RGB;
|
||||||
r_gl_type=GL_UNSIGNED_SHORT_5_6_5;
|
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_T, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, 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);
|
glDeleteFramebuffers(1, &tmp_fb);
|
||||||
|
|
||||||
Texture * ctex = memnew( Texture );
|
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_S, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 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);
|
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);
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->color, 0);
|
||||||
|
|
||||||
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo);
|
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
|
||||||
|
|
||||||
ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE );
|
ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE );
|
||||||
|
|
||||||
|
@ -5610,7 +5616,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){
|
||||||
|
|
||||||
|
|
||||||
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo);
|
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
|
||||||
|
|
||||||
if (status != GL_FRAMEBUFFER_COMPLETE) {
|
if (status != GL_FRAMEBUFFER_COMPLETE) {
|
||||||
printf("err status: %x\n",status);
|
printf("err status: %x\n",status);
|
||||||
|
@ -5643,7 +5649,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){
|
||||||
ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE );
|
ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE );
|
||||||
}
|
}
|
||||||
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo);
|
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
|
||||||
|
|
||||||
if (status != GL_FRAMEBUFFER_COMPLETE) {
|
if (status != GL_FRAMEBUFFER_COMPLETE) {
|
||||||
_render_target_clear(rt);
|
_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;
|
rt->effects.mip_maps[i].levels=level;
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
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);
|
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||||
//printf("errnum: %x\n",status);
|
//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() );
|
ERR_FAIL_COND_V( status != GL_FRAMEBUFFER_COMPLETE, RID() );
|
||||||
|
|
||||||
|
@ -6296,7 +6302,7 @@ void RasterizerStorageGLES3::initialize() {
|
||||||
config.render_arch=RENDER_ARCH_DESKTOP;
|
config.render_arch=RENDER_ARCH_DESKTOP;
|
||||||
//config.fbo_deferred=int(Globals::get_singleton()->get("rendering/gles3/lighting_technique"));
|
//config.fbo_deferred=int(Globals::get_singleton()->get("rendering/gles3/lighting_technique"));
|
||||||
|
|
||||||
config.system_fbo=0;
|
RasterizerStorageGLES3::system_fbo=0;
|
||||||
|
|
||||||
|
|
||||||
//// extensions config
|
//// extensions config
|
||||||
|
|
|
@ -24,6 +24,7 @@ public:
|
||||||
|
|
||||||
RasterizerCanvasGLES3 *canvas;
|
RasterizerCanvasGLES3 *canvas;
|
||||||
RasterizerSceneGLES3 *scene;
|
RasterizerSceneGLES3 *scene;
|
||||||
|
static GLuint system_fbo; //on some devices, such as apple, screen is rendered to yet another fbo.
|
||||||
|
|
||||||
enum RenderArchitecture {
|
enum RenderArchitecture {
|
||||||
RENDER_ARCH_MOBILE,
|
RENDER_ARCH_MOBILE,
|
||||||
|
@ -34,8 +35,6 @@ public:
|
||||||
|
|
||||||
RenderArchitecture render_arch;
|
RenderArchitecture render_arch;
|
||||||
|
|
||||||
GLuint system_fbo; //on some devices, such as apple, screen is rendered to yet another fbo.
|
|
||||||
|
|
||||||
bool shrink_textures_x2;
|
bool shrink_textures_x2;
|
||||||
bool use_fast_texture_filter;
|
bool use_fast_texture_filter;
|
||||||
bool use_anisotropic_filter;
|
bool use_anisotropic_filter;
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#import "gl_view.h"
|
#import "gl_view.h"
|
||||||
#import "view_controller.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>
|
#import <CoreMotion/CoreMotion.h>
|
||||||
|
|
||||||
@interface AppDelegate : NSObject <UIApplicationDelegate, GLViewDelegate> {
|
@interface AppDelegate : NSObject <UIApplicationDelegate, GLViewDelegate> {
|
||||||
|
|
|
@ -284,12 +284,12 @@ static int frame_count = 0;
|
||||||
//glView.autoresizesSubviews = YES;
|
//glView.autoresizesSubviews = YES;
|
||||||
//[glView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth];
|
//[glView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth];
|
||||||
|
|
||||||
int backingWidth;
|
int backingWidth;
|
||||||
int backingHeight;
|
int backingHeight;
|
||||||
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
|
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
|
||||||
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
|
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 = [[ViewController alloc] init];
|
||||||
view_controller.view = glView;
|
view_controller.view = glView;
|
||||||
|
@ -305,16 +305,6 @@ static int frame_count = 0;
|
||||||
[window makeKeyAndVisible];
|
[window makeKeyAndVisible];
|
||||||
|
|
||||||
//Configure and start accelerometer
|
//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) {
|
if (!motionInitialised) {
|
||||||
motionManager = [[CMMotionManager alloc] init];
|
motionManager = [[CMMotionManager alloc] init];
|
||||||
if (motionManager.deviceMotionAvailable) {
|
if (motionManager.deviceMotionAvailable) {
|
||||||
|
@ -365,10 +355,10 @@ static int frame_count = 0;
|
||||||
|
|
||||||
if (motionInitialised) {
|
if (motionInitialised) {
|
||||||
///@TODO is this the right place to clean this up?
|
///@TODO is this the right place to clean this up?
|
||||||
[motionManager stopDeviceMotionUpdates];
|
[motionManager stopDeviceMotionUpdates];
|
||||||
[motionManager release];
|
[motionManager release];
|
||||||
motionManager = nil;
|
motionManager = nil;
|
||||||
motionInitialised = NO;
|
motionInitialised = NO;
|
||||||
};
|
};
|
||||||
|
|
||||||
iphone_finish();
|
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 {
|
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
|
||||||
#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED
|
#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED
|
||||||
return [[[FacebookScorer sharedInstance] facebook] handleOpenURL:url];
|
return [[[FacebookScorer sharedInstance] facebook] handleOpenURL:url];
|
||||||
|
|
|
@ -155,8 +155,8 @@ int AudioDriverIphone::get_mix_rate() const {
|
||||||
return 44100;
|
return 44100;
|
||||||
};
|
};
|
||||||
|
|
||||||
AudioDriver::OutputFormat AudioDriverIphone::get_output_format() const {
|
AudioDriver::SpeakerMode AudioDriverIphone::get_speaker_mode() const {
|
||||||
return OUTPUT_STEREO;
|
return SPEAKER_MODE_STEREO;
|
||||||
};
|
};
|
||||||
|
|
||||||
void AudioDriverIphone::lock() {
|
void AudioDriverIphone::lock() {
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* 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>
|
#include <AudioUnit/AudioUnit.h>
|
||||||
|
|
||||||
|
@ -56,7 +57,7 @@ public:
|
||||||
virtual Error init();
|
virtual Error init();
|
||||||
virtual void start();
|
virtual void start();
|
||||||
virtual int get_mix_rate() const;
|
virtual int get_mix_rate() const;
|
||||||
virtual OutputFormat get_output_format() const;
|
virtual SpeakerMode get_speaker_mode() const;
|
||||||
virtual void lock();
|
virtual void lock();
|
||||||
virtual void unlock();
|
virtual void unlock();
|
||||||
virtual void finish();
|
virtual void finish();
|
||||||
|
|
|
@ -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\\\"')
|
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
|
elif (env["arch"] == "arm64"): # arm64
|
||||||
env["bits"] = "64"
|
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=['-DNEED_LONG_INT'])
|
||||||
env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON'])
|
env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON'])
|
||||||
else: # armv7
|
else: # armv7
|
||||||
env["arch"] = "arm"
|
env["arch"] = "arm"
|
||||||
env["bits"] = "32"
|
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"):
|
if (env["arch"] == "x86"):
|
||||||
env['IPHONEPLATFORM'] = 'iPhoneSimulator'
|
env['IPHONEPLATFORM'] = 'iPhoneSimulator'
|
||||||
|
@ -94,7 +94,7 @@ def configure(env):
|
||||||
'-F$IPHONESDK',
|
'-F$IPHONESDK',
|
||||||
])
|
])
|
||||||
elif (env["arch"] == "arm64"):
|
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',
|
'-isysroot', '$IPHONESDK',
|
||||||
#'-stdlib=libc++',
|
#'-stdlib=libc++',
|
||||||
'-framework', 'Foundation',
|
'-framework', 'Foundation',
|
||||||
|
@ -113,7 +113,7 @@ def configure(env):
|
||||||
'-framework', 'CoreMotion',
|
'-framework', 'CoreMotion',
|
||||||
])
|
])
|
||||||
else:
|
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',
|
'-isysroot', '$IPHONESDK',
|
||||||
'-framework', 'Foundation',
|
'-framework', 'Foundation',
|
||||||
'-framework', 'UIKit',
|
'-framework', 'UIKit',
|
||||||
|
|
|
@ -182,11 +182,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";
|
||||||
StringArray names;
|
PoolStringArray names;
|
||||||
StringArray titles;
|
PoolStringArray titles;
|
||||||
StringArray unachieved_descriptions;
|
PoolStringArray unachieved_descriptions;
|
||||||
StringArray achieved_descriptions;
|
PoolStringArray achieved_descriptions;
|
||||||
IntArray maximum_points;
|
PoolIntArray maximum_points;
|
||||||
Array hidden;
|
Array hidden;
|
||||||
Array replayable;
|
Array replayable;
|
||||||
|
|
||||||
|
@ -239,8 +239,8 @@ void GameCenter::request_achievements() {
|
||||||
ret["type"] = "achievements";
|
ret["type"] = "achievements";
|
||||||
if (error == nil) {
|
if (error == nil) {
|
||||||
ret["result"] = "ok";
|
ret["result"] = "ok";
|
||||||
StringArray names;
|
PoolStringArray names;
|
||||||
RealArray percentages;
|
PoolRealArray percentages;
|
||||||
|
|
||||||
for (int i=0; i<[achievements count]; i++) {
|
for (int i=0; i<[achievements count]; i++) {
|
||||||
|
|
||||||
|
|
|
@ -274,7 +274,7 @@ static void clear_touches() {
|
||||||
nil];
|
nil];
|
||||||
|
|
||||||
// Create our EAGLContext, and if successful make it current and create our framebuffer.
|
// 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])
|
if(!context || ![EAGLContext setCurrentContext:context] || ![self createFramebuffer])
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,12 +78,12 @@ Variant nsobject_to_variant(NSObject* object) {
|
||||||
return String::utf8(str != NULL ? str : "");
|
return String::utf8(str != NULL ? str : "");
|
||||||
}
|
}
|
||||||
else if ([object isKindOfClass:[NSData class]]) {
|
else if ([object isKindOfClass:[NSData class]]) {
|
||||||
ByteArray ret;
|
PoolByteArray 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]);
|
||||||
{
|
{
|
||||||
ByteArray::Write w = ret.write();
|
PoolByteArray::Write w = ret.write();
|
||||||
copymem(w.ptr(), [data bytes], [data length]);
|
copymem(w.ptr(), [data bytes], [data length]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,9 +199,9 @@ NSObject* variant_to_nsobject(Variant v) {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
else if (v.get_type() == Variant::RAW_ARRAY) {
|
else if (v.get_type() == Variant::POOL_BYTE_ARRAY) {
|
||||||
ByteArray arr = v;
|
PoolByteArray arr = v;
|
||||||
ByteArray::Read r = arr.read();
|
PoolByteArray::Read r = arr.read();
|
||||||
NSData* result = [NSData dataWithBytes:r.ptr() length:arr.size()];
|
NSData* result = [NSData dataWithBytes:r.ptr() length:arr.size()];
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ ICloud::ICloud() {
|
||||||
Dictionary ret;
|
Dictionary ret;
|
||||||
ret["type"] = "key_value_changed";
|
ret["type"] = "key_value_changed";
|
||||||
|
|
||||||
//StringArray result_keys;
|
//PoolStringArray result_keys;
|
||||||
//Array result_values;
|
//Array result_values;
|
||||||
Dictionary keyValues;
|
Dictionary keyValues;
|
||||||
String reason = "";
|
String reason = "";
|
||||||
|
|
|
@ -89,11 +89,11 @@ void InAppStore::_bind_methods() {
|
||||||
Dictionary ret;
|
Dictionary ret;
|
||||||
ret["type"] = "product_info";
|
ret["type"] = "product_info";
|
||||||
ret["result"] = "ok";
|
ret["result"] = "ok";
|
||||||
StringArray titles;
|
PoolStringArray titles;
|
||||||
StringArray descriptions;
|
PoolStringArray descriptions;
|
||||||
RealArray prices;
|
PoolRealArray prices;
|
||||||
StringArray ids;
|
PoolStringArray ids;
|
||||||
StringArray localized_prices;
|
PoolStringArray localized_prices;
|
||||||
|
|
||||||
for (int i=0; i<[products count]; i++) {
|
for (int i=0; i<[products count]; i++) {
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ void InAppStore::_bind_methods() {
|
||||||
ret["ids"] = ids;
|
ret["ids"] = ids;
|
||||||
ret["localized_prices"] = localized_prices;
|
ret["localized_prices"] = localized_prices;
|
||||||
|
|
||||||
StringArray invalid_ids;
|
PoolStringArray invalid_ids;
|
||||||
|
|
||||||
for (NSString* ipid in response.invalidProductIdentifiers) {
|
for (NSString* ipid in response.invalidProductIdentifiers) {
|
||||||
|
|
||||||
|
@ -134,7 +134,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);
|
||||||
|
|
||||||
StringArray pids = params["product_ids"];
|
PoolStringArray 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];
|
||||||
|
|
|
@ -30,11 +30,9 @@
|
||||||
|
|
||||||
#include "os_iphone.h"
|
#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_raster.h"
|
||||||
#include "servers/visual/visual_server_wrap_mt.h"
|
//#include "servers/visual/visual_server_wrap_mt.h"
|
||||||
|
|
||||||
#include "main/main.h"
|
#include "main/main.h"
|
||||||
#include "audio_driver_iphone.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", false)?1:0) << PortraitDown);
|
||||||
supported_orientations |= ((GLOBAL_DEF("video_mode/allow_vertical_flipped", false)?1:0) << PortraitUp);
|
supported_orientations |= ((GLOBAL_DEF("video_mode/allow_vertical_flipped", false)?1:0) << PortraitUp);
|
||||||
|
|
||||||
rasterizer_gles22 = memnew( RasterizerGLES2(false, false, false) );
|
RasterizerGLES3::register_config();
|
||||||
rasterizer = rasterizer_gles22;
|
RasterizerGLES3::make_current();
|
||||||
rasterizer_gles22->set_base_framebuffer(gl_view_base_fb);
|
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) {
|
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
|
||||||
|
|
||||||
visual_server = memnew(VisualServerWrapMT(visual_server, false));
|
visual_server = memnew(VisualServerWrapMT(visual_server, false));
|
||||||
};
|
};
|
||||||
visual_server->init();
|
*/
|
||||||
|
|
||||||
visual_server->init();
|
visual_server->init();
|
||||||
visual_server->cursor_set_visible(false, 0);
|
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->set_singleton();
|
||||||
audio_driver->init();
|
audio_driver->init();
|
||||||
|
|
||||||
sample_manager = memnew( SampleManagerMallocSW );
|
// init physics servers
|
||||||
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();
|
|
||||||
|
|
||||||
//
|
|
||||||
physics_server = memnew( PhysicsServerSW );
|
physics_server = memnew( PhysicsServerSW );
|
||||||
physics_server->init();
|
physics_server->init();
|
||||||
//physics_2d_server = memnew( Physics2DServerSW );
|
//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
|
#ifdef IOS_SCORELOOP_ENABLED
|
||||||
scoreloop = memnew(ScoreloopIOS);
|
scoreloop = memnew(ScoreloopIOS);
|
||||||
Globals::get_singleton()->add_singleton(Globals::Singleton("Scoreloop", scoreloop));
|
GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("Scoreloop", scoreloop));
|
||||||
scoreloop->connect();
|
scoreloop->connect();
|
||||||
#endif
|
#endif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef GAME_CENTER_ENABLED
|
#ifdef GAME_CENTER_ENABLED
|
||||||
game_center = memnew(GameCenter);
|
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();
|
game_center->connect();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STOREKIT_ENABLED
|
#ifdef STOREKIT_ENABLED
|
||||||
store_kit = memnew(InAppStore);
|
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
|
#endif
|
||||||
|
|
||||||
#ifdef ICLOUD_ENABLED
|
#ifdef ICLOUD_ENABLED
|
||||||
icloud = memnew(ICloud);
|
icloud = memnew(ICloud);
|
||||||
Globals::get_singleton()->add_singleton(Globals::Singleton("ICloud", icloud));
|
GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("ICloud", icloud));
|
||||||
//icloud->connect();
|
//icloud->connect();
|
||||||
#endif
|
#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 {
|
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));
|
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_x=input->get_last_mouse_speed().x;
|
||||||
ev.mouse_motion.speed_y=input->get_mouse_speed().y;
|
ev.mouse_motion.speed_y=input->get_last_mouse_speed().y;
|
||||||
ev.mouse_motion.button_mask = 1; // pressed
|
ev.mouse_motion.button_mask = 1; // pressed
|
||||||
|
|
||||||
queue_event(ev);
|
queue_event(ev);
|
||||||
|
@ -394,7 +384,7 @@ void OSIPhone::finalize() {
|
||||||
|
|
||||||
visual_server->finish();
|
visual_server->finish();
|
||||||
memdelete(visual_server);
|
memdelete(visual_server);
|
||||||
memdelete(rasterizer);
|
// memdelete(rasterizer);
|
||||||
|
|
||||||
physics_server->finish();
|
physics_server->finish();
|
||||||
memdelete(physics_server);
|
memdelete(physics_server);
|
||||||
|
@ -402,14 +392,8 @@ void OSIPhone::finalize() {
|
||||||
physics_2d_server->finish();
|
physics_2d_server->finish();
|
||||||
memdelete(physics_2d_server);
|
memdelete(physics_2d_server);
|
||||||
|
|
||||||
spatial_sound_server->finish();
|
|
||||||
memdelete(spatial_sound_server);
|
|
||||||
|
|
||||||
memdelete(input);
|
memdelete(input);
|
||||||
|
|
||||||
spatial_sound_2d_server->finish();
|
|
||||||
memdelete(spatial_sound_2d_server);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void OSIPhone::set_mouse_show(bool p_show) { };
|
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) {
|
int OSIPhone::set_base_framebuffer(int p_fb) {
|
||||||
|
|
||||||
if (rasterizer_gles22) {
|
RasterizerStorageGLES3::system_fbo = gl_view_base_fb;
|
||||||
rasterizer_gles22->set_base_framebuffer(p_fb);
|
|
||||||
};
|
|
||||||
return 0;
|
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());
|
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;
|
return ERR_INVALID_PARAMETER;
|
||||||
} else {
|
} 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://"))
|
} else if (p_path.begins_with("user://"))
|
||||||
p_path = p_path.replace("user:/", get_data_dir());
|
p_path = p_path.replace("user:/", get_data_dir());
|
||||||
|
@ -579,10 +562,8 @@ void OSIPhone::native_video_stop() {
|
||||||
|
|
||||||
OSIPhone::OSIPhone(int width, int height) {
|
OSIPhone::OSIPhone(int width, int height) {
|
||||||
|
|
||||||
rasterizer_gles22 = NULL;
|
|
||||||
main_loop = NULL;
|
main_loop = NULL;
|
||||||
visual_server = NULL;
|
visual_server = NULL;
|
||||||
rasterizer = NULL;
|
|
||||||
|
|
||||||
VideoMode vm;
|
VideoMode vm;
|
||||||
vm.fullscreen = true;
|
vm.fullscreen = true;
|
||||||
|
|
|
@ -39,10 +39,7 @@
|
||||||
#include "servers/physics/physics_server_sw.h"
|
#include "servers/physics/physics_server_sw.h"
|
||||||
#include "servers/physics_2d/physics_2d_server_sw.h"
|
#include "servers/physics_2d/physics_2d_server_sw.h"
|
||||||
#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
|
#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
|
||||||
#include "servers/audio/audio_server_sw.h"
|
#include "servers/audio_server.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 "main/input_default.h"
|
#include "main/input_default.h"
|
||||||
#include "game_center.h"
|
#include "game_center.h"
|
||||||
#include "in_app_store.h"
|
#include "in_app_store.h"
|
||||||
|
@ -50,7 +47,7 @@
|
||||||
|
|
||||||
|
|
||||||
class AudioDriverIphone;
|
class AudioDriverIphone;
|
||||||
class RasterizerGLES2;
|
// class RasterizerGLES2;
|
||||||
|
|
||||||
class OSIPhone : public OS_Unix {
|
class OSIPhone : public OS_Unix {
|
||||||
|
|
||||||
|
@ -71,18 +68,13 @@ private:
|
||||||
|
|
||||||
uint8_t supported_orientations;
|
uint8_t supported_orientations;
|
||||||
|
|
||||||
Rasterizer *rasterizer;
|
// Rasterizer *rasterizer;
|
||||||
|
// RasterizerGLES2* rasterizer_gles22;
|
||||||
RasterizerGLES2* rasterizer_gles22;
|
|
||||||
|
|
||||||
VisualServer *visual_server;
|
VisualServer *visual_server;
|
||||||
PhysicsServer* physics_server;
|
PhysicsServer* physics_server;
|
||||||
Physics2DServer *physics_2d_server;
|
Physics2DServer *physics_2d_server;
|
||||||
|
|
||||||
AudioServerSW *audio_server;
|
|
||||||
SampleManagerMallocSW *sample_manager;
|
|
||||||
SpatialSoundServerSW *spatial_sound_server;
|
|
||||||
SpatialSound2DServerSW *spatial_sound_2d_server;
|
|
||||||
AudioDriverIphone* audio_driver;
|
AudioDriverIphone* audio_driver;
|
||||||
|
|
||||||
#ifdef GAME_CENTER_ENABLED
|
#ifdef GAME_CENTER_ENABLED
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
#include <alloca.h>
|
#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
|
#define PLATFORM_REFCOUNT
|
||||||
|
|
||||||
|
|
|
@ -1705,7 +1705,6 @@ void BakedLight::create_debug_mesh(DebugMode p_mode) {
|
||||||
#else
|
#else
|
||||||
mmi->set_owner(get_owner());
|
mmi->set_owner(get_owner());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BakedLight::_debug_mesh_albedo() {
|
void BakedLight::_debug_mesh_albedo() {
|
||||||
|
|
|
@ -1324,7 +1324,6 @@ void GIProbe::_create_debug_mesh(Baker *p_baker) {
|
||||||
#else
|
#else
|
||||||
mmi->set_owner(get_owner());
|
mmi->set_owner(get_owner());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GIProbe::_debug_bake() {
|
void GIProbe::_debug_bake() {
|
||||||
|
|
|
@ -123,6 +123,7 @@ void VisualServerRaster::finish(){
|
||||||
VSG::rasterizer->finalize();
|
VSG::rasterizer->finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* STATUS INFORMATION */
|
/* STATUS INFORMATION */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue