summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAnton Yabchinskiy <arn@bestmx.ru>2015-01-05 23:56:24 +0300
committerAnton Yabchinskiy <arn@bestmx.ru>2015-01-05 23:56:24 +0300
commita7875c586af74302584544d777b189f4cb85c393 (patch)
treef4929f77383d835b5be8b6e099b9db59000af610 /drivers
parent4ab1bcde35a02cfe7b25d630720de1cc81ef5a1a (diff)
parent8c4dd8de3919b789eac1a0f030563008bdcd44f5 (diff)
Merge branch 'master' of github.com:okamstudio/godot
Diffstat (limited to 'drivers')
-rw-r--r--drivers/builtin_openssl2/openssl/md5.h4
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp19
-rw-r--r--drivers/mpc/audio_stream_mpc.cpp8
-rw-r--r--drivers/theoraplayer/SCsub10
-rw-r--r--drivers/theoraplayer/src/TheoraVideoClip.cpp1
-rw-r--r--drivers/theoraplayer/video_stream_theoraplayer.cpp6
-rw-r--r--drivers/unix/memory_pool_static_malloc.cpp8
-rw-r--r--drivers/webp/dsp/dsp.h2
-rw-r--r--drivers/webp/utils/bit_reader.h1
9 files changed, 39 insertions, 20 deletions
diff --git a/drivers/builtin_openssl2/openssl/md5.h b/drivers/builtin_openssl2/openssl/md5.h
index 8f392f0ec6..765be94335 100644
--- a/drivers/builtin_openssl2/openssl/md5.h
+++ b/drivers/builtin_openssl2/openssl/md5.h
@@ -105,9 +105,9 @@ typedef struct MD5state_st
unsigned int num;
} MD5_CTX;
-#ifdef OPENSSL_FIPS
+//#ifdef OPENSSL_FIPS
int private_MD5_Init(MD5_CTX *c);
-#endif
+//#endif
//#define MD5_Init _SSL_MD5_Init
#define MD5_Final _SSL_MD5_Final
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index 9d47084c1c..fdf73a6c21 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -139,11 +139,13 @@ static _FORCE_INLINE_ uint16_t make_half_float(float f) {
else if (exp <= 0x38000000)
{
- // store a denorm half-float value or zero
+ /*// store a denorm half-float value or zero
exp = (0x38000000 - exp) >> 23;
mantissa >>= (14 + exp);
hf = (((uint16_t)sign) << 15) | (uint16_t)(mantissa);
+ */
+ hf=0; //denormals do not work for 3D, convert to zero
}
else
{
@@ -969,7 +971,7 @@ void RasterizerGLES2::texture_set_data(RID p_texture,const Image& p_image,VS::Cu
- if (img.detect_alpha()==Image::ALPHA_BLEND) {
+ if ((!texture->flags&VS::TEXTURE_FLAG_VIDEO_SURFACE) && img.detect_alpha()==Image::ALPHA_BLEND) {
texture->has_alpha=true;
}
@@ -4224,7 +4226,6 @@ void RasterizerGLES2::capture_viewport(Image* r_capture) {
}
w=DVector<uint8_t>::Write();
-
r_capture->create(viewport.width,viewport.height,0,Image::FORMAT_RGBA,pixels);
//r_capture->flip_y();
@@ -8188,8 +8189,18 @@ void RasterizerGLES2::canvas_draw_polygon(int p_vertex_count, const int* p_indic
}
if (p_indices) {
-
+#ifdef GLEW_ENABLED
glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_INT, p_indices );
+#else
+ static const int _max_draw_poly_indices = 16*1024; // change this size if needed!!!
+ ERR_FAIL_COND(p_vertex_count > _max_draw_poly_indices);
+ static uint16_t _draw_poly_indices[_max_draw_poly_indices];
+ for (int i=0; i<p_vertex_count; i++) {
+ _draw_poly_indices[i] = p_indices[i];
+ };
+ glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_SHORT, _draw_poly_indices );
+#endif
+ //glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_INT, p_indices );
} else {
glDrawArrays(GL_TRIANGLES,0,p_vertex_count);
}
diff --git a/drivers/mpc/audio_stream_mpc.cpp b/drivers/mpc/audio_stream_mpc.cpp
index d94f57e683..cd8125c9af 100644
--- a/drivers/mpc/audio_stream_mpc.cpp
+++ b/drivers/mpc/audio_stream_mpc.cpp
@@ -8,6 +8,7 @@ Error AudioStreamMPC::_open_file() {
f=NULL;
}
Error err;
+ //printf("mpc open file %ls\n", file.c_str());
f=FileAccess::open(file,FileAccess::READ,&err);
if (err) {
@@ -16,9 +17,10 @@ Error AudioStreamMPC::_open_file() {
return err;
}
- f->seek_end(0);
- streamlen=f->get_pos();
- f->seek(0);
+ //printf("file size is %i\n", f->get_len());
+ //f->seek_end(0);
+ streamlen=f->get_len();
+ //f->seek(0);
if (streamlen<=0) {
memdelete(f);
f=NULL;
diff --git a/drivers/theoraplayer/SCsub b/drivers/theoraplayer/SCsub
index cd8cabcc94..419f2b65ae 100644
--- a/drivers/theoraplayer/SCsub
+++ b/drivers/theoraplayer/SCsub
@@ -61,13 +61,17 @@ src/YUV/C/yuv420_rgb_c.c
src/TheoraVideoFrame.cpp
""")
+env_theora = env.Clone()
+
if env["platform"] == "iphone":
sources.append("src/AVFoundation/TheoraVideoClip_AVFoundation.mm")
env.Append(LINKFLAGS=['-framework', 'CoreVideo', '-framework', 'CoreMedia', '-framework', 'AVFoundation'])
+ if env["target"] == "release":
+ env_theora.Append(CPPFLAGS=["-D_IOS", "-D__ARM_NEON__", "-fstrict-aliasing", "-fmessage-length=210", "-fdiagnostics-show-note-include-stack", "-fmacro-backtrace-limit=0", "-fcolor-diagnostics", "-Wno-trigraphs", "-fpascal-strings", "-fvisibility=hidden", "-fvisibility-inlines-hidden"])
-env_theora = env.Clone()
-
-env_theora.Append(CPPFLAGS=["-D_YUV_C", "-D_LIB", "-D__THEORA"])
+env_theora.Append(CPPFLAGS=["-D_LIB", "-D__THEORA"]) # removed -D_YUV_C
+env_theora.Append(CPPFLAGS=["-D_YUV_LIBYUV", "-DLIBYUV_NEON"])
+#env_theora.Append(CPPFLAGS=["-D_YUV_C"])
if env["platform"] == "iphone":
env_theora.Append(CPPFLAGS=["-D__AVFOUNDATION"])
diff --git a/drivers/theoraplayer/src/TheoraVideoClip.cpp b/drivers/theoraplayer/src/TheoraVideoClip.cpp
index ed9f2c22da..16897ee80e 100644
--- a/drivers/theoraplayer/src/TheoraVideoClip.cpp
+++ b/drivers/theoraplayer/src/TheoraVideoClip.cpp
@@ -249,6 +249,7 @@ int TheoraVideoClip::discardOutdatedFrames(float absTime)
if (nPop > 0)
{
+#define _DEBUG
#ifdef _DEBUG
std::string log = getName() + ": dropped frame ";
diff --git a/drivers/theoraplayer/video_stream_theoraplayer.cpp b/drivers/theoraplayer/video_stream_theoraplayer.cpp
index 62dee1336a..9f4a44ae9d 100644
--- a/drivers/theoraplayer/video_stream_theoraplayer.cpp
+++ b/drivers/theoraplayer/video_stream_theoraplayer.cpp
@@ -215,7 +215,7 @@ public:
channels = p_channels;
freq = p_freq;
total_wrote = 0;
- rb_power = 12;
+ rb_power = 22;
rb.resize(rb_power);
};
@@ -258,10 +258,12 @@ public:
void update(float time_increase)
{
+ float prev_time = mTime;
//mTime = (float)(stream->get_total_wrote()) / freq;
//mTime = MAX(0,mTime-AudioServer::get_singleton()->get_output_delay());
//mTime = (float)sample_count / channels / freq;
mTime += time_increase;
+ if (mTime - prev_time > .02) printf("time increase %f secs\n", mTime - prev_time);
//float duration=mClip->getDuration();
//if (mTime > duration) mTime=duration;
//printf("time at timer is %f, %f, samples %i\n", mTime, time_increase, sample_count);
@@ -386,7 +388,7 @@ void VideoStreamTheoraplayer::pop_frame(Ref<ImageTexture> p_tex) {
{
DVector<uint8_t>::Write wr = data.write();
uint8_t* ptr = wr.ptr();
- copymem(ptr, f->getBuffer(), imgsize);
+ memcpy(ptr, f->getBuffer(), imgsize);
}
/*
for (int i=0; i<h; i++) {
diff --git a/drivers/unix/memory_pool_static_malloc.cpp b/drivers/unix/memory_pool_static_malloc.cpp
index fa1266b2df..4711f4f090 100644
--- a/drivers/unix/memory_pool_static_malloc.cpp
+++ b/drivers/unix/memory_pool_static_malloc.cpp
@@ -40,10 +40,9 @@
* so BE CAREFUL!
*/
-
void* MemoryPoolStaticMalloc::alloc(size_t p_bytes,const char *p_description) {
- #if DFAULT_ALIGNMENT == 1
+ #if DEFAULT_ALIGNMENT == 1
return _alloc(p_bytes, p_description);
@@ -123,7 +122,7 @@ void* MemoryPoolStaticMalloc::_alloc(size_t p_bytes,const char *p_description) {
void* MemoryPoolStaticMalloc::realloc(void *p_memory,size_t p_bytes) {
- #if DFAULT_ALIGNMENT == 1
+ #if DEFAULT_ALIGNMENT == 1
return _realloc(p_memory,p_bytes);
#else
@@ -172,7 +171,6 @@ void* MemoryPoolStaticMalloc::_realloc(void *p_memory,size_t p_bytes) {
bool single_element = (ringptr->next == ringptr) && (ringptr->prev == ringptr);
bool is_list = ( ringlist == ringptr );
-
RingPtr *new_ringptr=(RingPtr*)::realloc(ringptr, p_bytes+sizeof(RingPtr));
ERR_FAIL_COND_V( new_ringptr == 0, NULL ); /// reallocation failed
@@ -213,7 +211,7 @@ void MemoryPoolStaticMalloc::free(void *p_ptr) {
ERR_FAIL_COND( !MemoryPoolStatic::get_singleton());
- #if DFAULT_ALIGNMENT == 1
+ #if DEFAULT_ALIGNMENT == 1
_free(p_ptr);
#else
diff --git a/drivers/webp/dsp/dsp.h b/drivers/webp/dsp/dsp.h
index 9ff53174d4..afe30413c6 100644
--- a/drivers/webp/dsp/dsp.h
+++ b/drivers/webp/dsp/dsp.h
@@ -33,7 +33,7 @@ extern "C" {
#define WEBP_ANDROID_NEON // Android targets that might support NEON
#endif
-#if (defined(__ARM_NEON__) || defined(WEBP_ANDROID_NEON)) && !defined(PSP2_ENABLED)
+#if ( (defined(__ARM_NEON__) && !defined(__aarch64__)) || defined(WEBP_ANDROID_NEON)) && !defined(PSP2_ENABLED)
#define WEBP_USE_NEON
#endif
diff --git a/drivers/webp/utils/bit_reader.h b/drivers/webp/utils/bit_reader.h
index d80b497149..43cd948fd4 100644
--- a/drivers/webp/utils/bit_reader.h
+++ b/drivers/webp/utils/bit_reader.h
@@ -1,3 +1,4 @@
+//
// Copyright 2010 Google Inc. All Rights Reserved.
//
// This code is licensed under the same terms as WebM: