summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/SCsub2
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp15
-rw-r--r--drivers/png/image_loader_png.cpp7
-rw-r--r--drivers/theora/video_stream_theora.cpp29
-rw-r--r--drivers/theora/video_stream_theora.h2
5 files changed, 47 insertions, 8 deletions
diff --git a/drivers/SCsub b/drivers/SCsub
index a00d7fc3f9..701738c9f8 100644
--- a/drivers/SCsub
+++ b/drivers/SCsub
@@ -63,7 +63,7 @@ import string
if env['vsproj']=="yes":
env.AddToVSProject(env.drivers_sources)
-if (False): #split drivers, this used to be needed for windows until separate builders for windows were created
+if (env.split_drivers): #split drivers, this used to be needed for windows until separate builders for windows were created
for f in env.drivers_sources:
fname = ""
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index f0978228ff..e3a3e7def3 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -9260,7 +9260,13 @@ void RasterizerGLES2::_canvas_item_setup_shader_params(CanvasItemMaterial *mater
glReadBuffer(GL_BACK);
}
#endif
- glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height);
+ if (current_rt) {
+ glCopyTexSubImage2D(GL_TEXTURE_2D,0,viewport.x,viewport.y,viewport.x,viewport.y,viewport.width,viewport.height);
+ canvas_shader.set_uniform(CanvasShaderGLES2::TEXSCREEN_SCREEN_CLAMP,Color(float(x)/framebuffer.width,float(viewport.y)/framebuffer.height,float(x+viewport.width)/framebuffer.width,float(y+viewport.height)/framebuffer.height));
+ //window_size.height-(viewport.height+viewport.y)
+ } else {
+ glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height);
+ }
// if (current_clip) {
// // print_line(" a clip ");
// }
@@ -9457,7 +9463,12 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const
glReadBuffer(GL_BACK);
}
#endif
- glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,w,h);
+ if (current_rt) {
+ glCopyTexSubImage2D(GL_TEXTURE_2D,0,viewport.x,viewport.y,viewport.x,viewport.y,viewport.width,viewport.height);
+ //window_size.height-(viewport.height+viewport.y)
+ } else {
+ glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height);
+ }
// if (current_clip) {
// // print_line(" a clip ");
// }
diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp
index a86e747d80..50b26d601a 100644
--- a/drivers/png/image_loader_png.cpp
+++ b/drivers/png/image_loader_png.cpp
@@ -124,6 +124,13 @@ Error ImageLoaderPNG::_load_image(void *rf_up,png_rw_ptr p_func,Image *p_image)
png_read_update_info(png, info);
}
+ if (png_get_valid(png,info,PNG_INFO_tRNS)) {
+// png_set_expand_gray_1_2_4_to_8(png);
+ png_set_tRNS_to_alpha(png);
+ png_read_update_info(png, info);
+ png_get_IHDR(png, info, &width, &height, &depth, &color, NULL, NULL, NULL);
+ }
+
int palette_colors = 0;
int palette_components = 0;
int components = 0;
diff --git a/drivers/theora/video_stream_theora.cpp b/drivers/theora/video_stream_theora.cpp
index 0659f007e5..1d2e6b9dda 100644
--- a/drivers/theora/video_stream_theora.cpp
+++ b/drivers/theora/video_stream_theora.cpp
@@ -38,8 +38,16 @@ int VideoStreamPlaybackTheora:: buffer_data() {
}
int VideoStreamPlaybackTheora::queue_page(ogg_page *page){
- if(theora_p)ogg_stream_pagein(&to,page);
- if(vorbis_p)ogg_stream_pagein(&vo,page);
+ if(theora_p) {
+ ogg_stream_pagein(&to,page);
+ if (to.e_o_s)
+ theora_eos=true;
+ }
+ if(vorbis_p) {
+ ogg_stream_pagein(&vo,page);
+ if (vo.e_o_s)
+ vorbis_eos=true;
+ }
return 0;
}
@@ -238,6 +246,8 @@ void VideoStreamPlaybackTheora::clear() {
videobuf_ready = 0;
frames_pending = 0;
videobuf_time = 0;
+ theora_eos=false;
+ vorbis_eos=false;
if (file) {
memdelete(file);
@@ -281,6 +291,9 @@ void VideoStreamPlaybackTheora::set_file(const String& p_file) {
th_comment_init(&tc);
th_info_init(&ti);
+ theora_eos=false;
+ vorbis_eos=false;
+
/* Ogg file open; parse the headers */
/* Only interested in Vorbis/Theora streams */
int stateflag = 0;
@@ -499,7 +512,9 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
bool frame_done=false;
bool audio_done=false;
- while (!frame_done || !audio_done) {
+ bool theora_done=false;
+
+ while (!frame_done || (!audio_done && !vorbis_eos)) {
//a frame needs to be produced
ogg_packet op;
@@ -641,10 +656,14 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
break;
}
}
+
+
+ //print_line("no theora: "+itos(no_theora)+" theora eos: "+itos(theora_eos)+" frame done "+itos(frame_done));
+
#ifdef THEORA_USE_THREAD_STREAMING
- if (file && thread_eof && (no_vorbis || no_theora) && ring_buffer.data_left()==0) {
+ if (file && thread_eof && no_theora && theora_eos && ring_buffer.data_left()==0) {
#else
- if (file && /*!videobuf_ready && */ (no_vorbis || no_theora) && file->eof_reached()) {
+ if (file && /*!videobuf_ready && */ no_theora && theora_eos) {
#endif
printf("video done, stopping\n");
stop();
diff --git a/drivers/theora/video_stream_theora.h b/drivers/theora/video_stream_theora.h
index 3e144c0125..f07acb2935 100644
--- a/drivers/theora/video_stream_theora.h
+++ b/drivers/theora/video_stream_theora.h
@@ -36,6 +36,8 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback {
void video_write(void);
float get_time() const;
+ bool theora_eos;
+ bool vorbis_eos;
ogg_sync_state oy;
ogg_page og;