diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/alsa/audio_driver_alsa.cpp | 12 | ||||
-rw-r--r-- | drivers/alsa/audio_driver_alsa.h | 8 | ||||
-rw-r--r-- | drivers/convex_decomp/b2Polygon.cpp | 2 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 4 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_gles2.h | 2 | ||||
-rw-r--r-- | drivers/gles2/shader_compiler_gles2.cpp | 9 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_canvas_gles3.cpp | 7 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_gles3.cpp | 4 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 35 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 24 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.h | 5 | ||||
-rw-r--r-- | drivers/pulseaudio/audio_driver_pulseaudio.cpp | 6 | ||||
-rw-r--r-- | drivers/pulseaudio/audio_driver_pulseaudio.h | 8 | ||||
-rw-r--r-- | drivers/rtaudio/audio_driver_rtaudio.cpp | 29 | ||||
-rw-r--r-- | drivers/rtaudio/audio_driver_rtaudio.h | 8 | ||||
-rw-r--r-- | drivers/windows/file_access_windows.cpp | 2 | ||||
-rw-r--r-- | drivers/xaudio2/audio_driver_xaudio2.cpp | 7 | ||||
-rw-r--r-- | drivers/xaudio2/audio_driver_xaudio2.h | 9 |
18 files changed, 99 insertions, 82 deletions
diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp index b026241579..8984d412a3 100644 --- a/drivers/alsa/audio_driver_alsa.cpp +++ b/drivers/alsa/audio_driver_alsa.cpp @@ -30,11 +30,9 @@ #ifdef ALSA_ENABLED -#include <errno.h> #include "globals.h" - - +#include <errno.h> Error AudioDriverALSA::init() { @@ -46,7 +44,7 @@ Error AudioDriverALSA::init() { samples_out = NULL; mix_rate = GLOBAL_DEF("audio/mix_rate",44100); - output_format = OUTPUT_STEREO; + speaker_mode = SPEAKER_MODE_STEREO; channels = 2; @@ -205,16 +203,18 @@ int AudioDriverALSA::get_mix_rate() const { return mix_rate; }; -AudioDriverSW::OutputFormat AudioDriverALSA::get_output_format() const { +AudioDriver::SpeakerMode AudioDriverALSA::get_speaker_mode() const { - return output_format; + return speaker_mode; }; + void AudioDriverALSA::lock() { if (!thread || !mutex) return; mutex->lock(); }; + void AudioDriverALSA::unlock() { if (!thread || !mutex) diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h index df28294f56..6ab98312b2 100644 --- a/drivers/alsa/audio_driver_alsa.h +++ b/drivers/alsa/audio_driver_alsa.h @@ -26,7 +26,7 @@ /* 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" #ifdef ALSA_ENABLED @@ -35,7 +35,7 @@ #include <alsa/asoundlib.h> -class AudioDriverALSA : public AudioDriverSW { +class AudioDriverALSA : public AudioDriver { Thread* thread; Mutex* mutex; @@ -48,7 +48,7 @@ class AudioDriverALSA : public AudioDriverSW { static void thread_func(void* p_udata); unsigned int mix_rate; - OutputFormat output_format; + SpeakerMode speaker_mode; snd_pcm_uframes_t buffer_size; snd_pcm_uframes_t period_size; @@ -68,7 +68,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(); diff --git a/drivers/convex_decomp/b2Polygon.cpp b/drivers/convex_decomp/b2Polygon.cpp index f45d98250a..b6ead62c63 100644 --- a/drivers/convex_decomp/b2Polygon.cpp +++ b/drivers/convex_decomp/b2Polygon.cpp @@ -353,7 +353,7 @@ bool b2Polygon::IsUsable(bool printErrors){ b2Vec2 centroid = PolyCentroid(vertices,nVertices); b2Vec2 n1 = normals[iminus]; b2Vec2 n2 = normals[i]; - b2Vec2 v = vertices[i] - centroid;; + b2Vec2 v = vertices[i] - centroid; b2Vec2 d; d.x = b2Dot(n1, v) - toiSlop; diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 760af5100c..1486e85a04 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -3259,7 +3259,7 @@ void RasterizerGLES2::particles_set_emitting(RID p_particles, bool p_emitting) { Particles* particles = particles_owner.get( p_particles ); ERR_FAIL_COND(!particles); - particles->data.emitting=p_emitting;; + particles->data.emitting=p_emitting; } bool RasterizerGLES2::particles_is_emitting(RID p_particles) const { @@ -3468,7 +3468,7 @@ void RasterizerGLES2::particles_set_attractor_pos(RID p_particles, int p_attract Particles* particles = particles_owner.get( p_particles ); ERR_FAIL_COND(!particles); ERR_FAIL_INDEX(p_attractor,particles->data.attractor_count); - particles->data.attractors[p_attractor].pos=p_pos;; + particles->data.attractors[p_attractor].pos=p_pos; } Vector3 RasterizerGLES2::particles_get_attractor_pos(RID p_particles,int p_attractor) const { diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index f04b035560..ddcd97ec4a 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -1429,7 +1429,7 @@ public: virtual void multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color); virtual RID multimesh_get_mesh(RID p_multimesh) const; - virtual AABB multimesh_get_aabb(RID p_multimesh) const;; + virtual AABB multimesh_get_aabb(RID p_multimesh) const; virtual Transform multimesh_instance_get_transform(RID p_multimesh,int p_index) const; virtual Color multimesh_instance_get_color(RID p_multimesh,int p_index) const; diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 247a35141e..a5aa570e33 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -441,7 +441,8 @@ String ShaderCompilerGLES2::dump_node_code(SL::Node *p_node,int p_level,bool p_a } else if (custom_h && callfunc=="cosh_custom") { if (!cosh_used) { - global_code= "float cosh_custom(float val)\n"\ + global_code= + "float cosh_custom(float val)\n"\ "{\n"\ " float tmp = exp(val);\n"\ " float cosH = (tmp + 1.0 / tmp) / 2.0;\n"\ @@ -453,7 +454,8 @@ String ShaderCompilerGLES2::dump_node_code(SL::Node *p_node,int p_level,bool p_a } else if (custom_h && callfunc=="sinh_custom") { if (!sinh_used) { - global_code= "float sinh_custom(float val)\n"\ + global_code= + "float sinh_custom(float val)\n"\ "{\n"\ " float tmp = exp(val);\n"\ " float sinH = (tmp - 1.0 / tmp) / 2.0;\n"\ @@ -465,7 +467,8 @@ String ShaderCompilerGLES2::dump_node_code(SL::Node *p_node,int p_level,bool p_a } else if (custom_h && callfunc=="tanh_custom") { if (!tanh_used) { - global_code= "float tanh_custom(float val)\n"\ + global_code= + "float tanh_custom(float val)\n"\ "{\n"\ " float tmp = exp(val);\n"\ " float tanH = (tmp - 1.0 / tmp) / (tmp + 1.0 / tmp);\n"\ diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index c10611c961..458da85e74 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -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]; @@ -87,7 +92,7 @@ void RasterizerCanvasGLES3::light_internal_update(RID p_rid, Light* p_light) { if (p_light->radius_cache==0) li->ubo_data.shadow_gradient=0; else - li->ubo_data.shadow_gradient=p_light->shadow_gradient_length/(p_light->radius_cache*1.1);; + li->ubo_data.shadow_gradient=p_light->shadow_gradient_length/(p_light->radius_cache*1.1); li->ubo_data.shadow_distance_mult=(p_light->radius_cache*1.1); diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index b7616db8b1..5c6b9c5410 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -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)); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 1b531a69b9..f47fcfcd9b 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -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); } @@ -2270,9 +2275,9 @@ void RasterizerSceneGLES3::_setup_directional_light(int p_index,const Transform& float sign = li->light_ptr->negative?-1:1; Color linear_col = li->light_ptr->color.to_linear(); - ubo_data.light_color_energy[0]=linear_col.r*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; - ubo_data.light_color_energy[1]=linear_col.g*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; - ubo_data.light_color_energy[2]=linear_col.b*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[0]=linear_col.r*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY]; + ubo_data.light_color_energy[1]=linear_col.g*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY]; + ubo_data.light_color_energy[2]=linear_col.b*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY]; ubo_data.light_color_energy[3]=0; //omni, keep at 0 @@ -2427,9 +2432,9 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result,int p_light_cu float sign = li->light_ptr->negative?-1:1; Color linear_col = li->light_ptr->color.to_linear(); - ubo_data.light_color_energy[0]=linear_col.r*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; - ubo_data.light_color_energy[1]=linear_col.g*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; - ubo_data.light_color_energy[2]=linear_col.b*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[0]=linear_col.r*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY]; + ubo_data.light_color_energy[1]=linear_col.g*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY]; + ubo_data.light_color_energy[2]=linear_col.b*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY]; ubo_data.light_color_energy[3]=0; @@ -2520,9 +2525,9 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result,int p_light_cu float sign = li->light_ptr->negative?-1:1; Color linear_col = li->light_ptr->color.to_linear(); - ubo_data.light_color_energy[0]=linear_col.r*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; - ubo_data.light_color_energy[1]=linear_col.g*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; - ubo_data.light_color_energy[2]=linear_col.b*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[0]=linear_col.r*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY]; + ubo_data.light_color_energy[1]=linear_col.g*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY]; + ubo_data.light_color_energy[2]=linear_col.b*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY]; ubo_data.light_color_energy[3]=0; Vector3 pos = p_camera_inverse_transform.xform(li->transform.origin); @@ -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); diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index f096719988..9f1ff396f1 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -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 @@ -6463,7 +6469,7 @@ void RasterizerStorageGLES3::initialize() { glBufferData(GL_ARRAY_BUFFER,xf_feedback_size*1024,NULL,GL_STREAM_DRAW); } - shaders.blend_shapes.init();; + shaders.blend_shapes.init(); glGenVertexArrays(1,&resources.transform_feedback_array); diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index f9e440288f..c8f04f72c1 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -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; @@ -1011,7 +1010,7 @@ public: Particles() : particle_element(this) { emitting=false; amount=0; - lifetime=1.0;; + lifetime=1.0; pre_process_time=0.0; explosiveness=0.0; randomness=0.0; diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 3a1317cbf6..14b1b229b2 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -44,7 +44,7 @@ Error AudioDriverPulseAudio::init() { samples_out = NULL; mix_rate = GLOBAL_DEF("audio/mix_rate",44100); - output_format = OUTPUT_STEREO; + speaker_mode = SPEAKER_MODE_STEREO; channels = 2; pa_sample_spec spec; @@ -149,9 +149,9 @@ int AudioDriverPulseAudio::get_mix_rate() const { return mix_rate; } -AudioDriverSW::OutputFormat AudioDriverPulseAudio::get_output_format() const { +AudioDriver::SpeakerMode AudioDriverPulseAudio::get_speaker_mode() const { - return output_format; + return speaker_mode; } void AudioDriverPulseAudio::lock() { diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.h b/drivers/pulseaudio/audio_driver_pulseaudio.h index aa7b7a9188..36ae8c2e53 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.h +++ b/drivers/pulseaudio/audio_driver_pulseaudio.h @@ -26,7 +26,7 @@ /* 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" #ifdef PULSEAUDIO_ENABLED @@ -35,7 +35,7 @@ #include <pulse/simple.h> -class AudioDriverPulseAudio : public AudioDriverSW { +class AudioDriverPulseAudio : public AudioDriver{ Thread* thread; Mutex* mutex; @@ -48,7 +48,7 @@ class AudioDriverPulseAudio : public AudioDriverSW { static void thread_func(void* p_udata); unsigned int mix_rate; - OutputFormat output_format; + SpeakerMode speaker_mode; unsigned int buffer_size; int channels; @@ -69,7 +69,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(); diff --git a/drivers/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp index 850e5ab053..6ada0aaa68 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.cpp +++ b/drivers/rtaudio/audio_driver_rtaudio.cpp @@ -71,7 +71,7 @@ int AudioDriverRtAudio::callback( void *outputBuffer, void *inputBuffer, unsigne self->audio_server_process(nBufferFrames,buffer); - self->mutex->unlock();; + self->mutex->unlock(); return 0; } @@ -85,6 +85,8 @@ Error AudioDriverRtAudio::init() { ERR_EXPLAIN("Cannot initialize RtAudio audio driver: No devices present.") ERR_FAIL_COND_V( dac->getDeviceCount() < 1, ERR_UNAVAILABLE ); + // FIXME: Adapt to the OutputFormat -> SpeakerMode change + /* String channels = GLOBAL_DEF("audio/output","stereo"); if (channels=="5.1") @@ -95,6 +97,7 @@ Error AudioDriverRtAudio::init() { output_format=OUTPUT_MONO; else output_format=OUTPUT_STEREO; + */ RtAudio::StreamParameters parameters; parameters.deviceId = dac->getDefaultOutputDevice(); @@ -125,11 +128,10 @@ Error AudioDriverRtAudio::init() { while(true) { while( true) { - switch(output_format) { - case OUTPUT_MONO: parameters.nChannels = 1; break; - case OUTPUT_STEREO: parameters.nChannels = 2; break; - case OUTPUT_QUAD: parameters.nChannels = 4; break; - case OUTPUT_5_1: parameters.nChannels = 6; break; + switch(speaker_mode) { + case SPEAKER_MODE_STEREO: parameters.nChannels = 2; break; + case SPEAKER_SURROUND_51: parameters.nChannels = 6; break; + case SPEAKER_SURROUND_71: parameters.nChannels = 8; break; }; try { @@ -142,11 +144,10 @@ Error AudioDriverRtAudio::init() { // try with less channels ERR_PRINT("Unable to open audio, retrying with fewer channels.."); - switch(output_format) { - case OUTPUT_MONO: ERR_EXPLAIN("Unable to open audio."); ERR_FAIL_V( ERR_UNAVAILABLE ); break; - case OUTPUT_STEREO: output_format=OUTPUT_MONO; break; - case OUTPUT_QUAD: output_format=OUTPUT_STEREO; break; - case OUTPUT_5_1: output_format=OUTPUT_QUAD; break; + switch(speaker_mode) { + case SPEAKER_MODE_STEREO: speaker_mode=SPEAKER_MODE_STEREO; break; + case SPEAKER_SURROUND_51: speaker_mode=SPEAKER_SURROUND_51; break; + case SPEAKER_SURROUND_71: speaker_mode=SPEAKER_SURROUND_71; break; }; } } @@ -189,9 +190,9 @@ int AudioDriverRtAudio::get_mix_rate() const { return mix_rate; } -AudioDriverSW::OutputFormat AudioDriverRtAudio::get_output_format() const { +AudioDriver::SpeakerMode AudioDriverRtAudio::get_speaker_mode() const { - return output_format; + return speaker_mode; } void AudioDriverRtAudio::start() { @@ -229,7 +230,7 @@ AudioDriverRtAudio::AudioDriverRtAudio() mutex=NULL; mix_rate=44100; - output_format=OUTPUT_STEREO; + speaker_mode=SPEAKER_MODE_STEREO; } diff --git a/drivers/rtaudio/audio_driver_rtaudio.h b/drivers/rtaudio/audio_driver_rtaudio.h index aa7fae038a..3f293db6a6 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.h +++ b/drivers/rtaudio/audio_driver_rtaudio.h @@ -31,16 +31,16 @@ #ifdef RTAUDIO_ENABLED -#include "servers/audio/audio_server_sw.h" +#include "servers/audio_server.h" #include <RtAudio.h> -class AudioDriverRtAudio : public AudioDriverSW { +class AudioDriverRtAudio : public AudioDriver { static int callback( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *userData ); - OutputFormat output_format; + SpeakerMode speaker_mode; Mutex *mutex; RtAudio *dac; int mix_rate; @@ -53,7 +53,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(); diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 183cec96ec..894b49231b 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -50,7 +50,7 @@ void FileAccessWindows::check_errors() const { if (feof(f)) { - last_error=ERR_FILE_EOF;; + last_error=ERR_FILE_EOF; } } diff --git a/drivers/xaudio2/audio_driver_xaudio2.cpp b/drivers/xaudio2/audio_driver_xaudio2.cpp index 5be857164c..fa55c97325 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.cpp +++ b/drivers/xaudio2/audio_driver_xaudio2.cpp @@ -46,7 +46,8 @@ Error AudioDriverXAudio2::init() { mix_rate = 48000; - output_format = OUTPUT_STEREO; + // FIXME: speaker_mode seems unused in the Xaudio2 driver so far + speaker_mode = SPEAKER_MODE_STEREO; channels = 2; int latency = GLOBAL_DEF("audio/output_latency", 25); @@ -156,9 +157,9 @@ int AudioDriverXAudio2::get_mix_rate() const { return mix_rate; }; -AudioDriverSW::OutputFormat AudioDriverXAudio2::get_output_format() const { +AudioDriver::SpeakerMode AudioDriverXAudio2::get_speaker_mode() const { - return output_format; + return speaker_mode; }; float AudioDriverXAudio2::get_latency() { diff --git a/drivers/xaudio2/audio_driver_xaudio2.h b/drivers/xaudio2/audio_driver_xaudio2.h index ad880b24d5..afafb84c23 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.h +++ b/drivers/xaudio2/audio_driver_xaudio2.h @@ -29,8 +29,7 @@ #ifndef AUDIO_DRIVER_XAUDIO2_H #define AUDIO_DRIVER_XAUDIO2_H -#include "servers/audio/audio_server_sw.h" - +#include "servers/audio_server.h" #include "core/os/thread.h" #include "core/os/mutex.h" @@ -40,7 +39,7 @@ #include <xaudio2.h> #include <wrl/client.h> -class AudioDriverXAudio2 : public AudioDriverSW { +class AudioDriverXAudio2 : public AudioDriver { enum { AUDIO_BUFFERS = 2 @@ -72,7 +71,7 @@ class AudioDriverXAudio2 : public AudioDriverSW { int buffer_size; unsigned int mix_rate; - OutputFormat output_format; + SpeakerMode speaker_mode; int channels; @@ -96,7 +95,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 float get_latency(); virtual void lock(); virtual void unlock(); |