-fix bug in cache for atlas import/export

-fix some menus
-fixed bug in out transition curves
-detect and remove file:/// in collada
-remove multiscript for now
-remove dependencies on mouse in OS, moved to Input
-avoid fscache from screwing up (fix might make it slower, but it works)
-funcref was missing, it's there now
This commit is contained in:
Juan Linietsky
2014-03-13 22:57:24 -03:00
parent a65edb4caa
commit 31ce3c5fd0
136 changed files with 10784 additions and 1578 deletions

View File

@ -140,7 +140,7 @@ mpc_bool_t AudioStreamMPC::_mpc_canseek(mpc_reader *p_reader) {
bool AudioStreamMPC::_can_mix() const {
return active && !paused;
return /*active &&*/ !paused;
}

View File

@ -0,0 +1,111 @@
#include "stream_peer_ssl.h"
int StreamPeerSSL::bio_create( BIO *b ) {
b->init = 1;
b->num = 0;
b->ptr = NULL;
b->flags = 0;
return 1;
}
int StreamPeerSSL::bio_destroy( BIO *b ) {
if ( b == NULL ) return 0;
b->ptr = NULL; /* sb_tls_remove() will free it */
b->init = 0;
b->flags = 0;
return 1;
}
int StreamPeerSSL::bio_read( BIO *b, char *buf, int len ) {
if ( buf == NULL || len <= 0 ) return 0;
StreamPeerSSL * sp = (StreamPeerSSL*)b->ptr;
if (sp->base.is_null())
return 0;
BIO_clear_retry_flags( b );
Error err;
int ret=0;
if (sp->block) {
err = sp->base->get_data((const uint8_t*)buf,len);
if (err==OK)
ret=len;
} else {
err = sp->base->get_partial_data((const uint8_t*)buf,len,ret);
if (err==OK && ret!=len) {
BIO_set_retry_write( b );
}
}
return ret;
}
int StreamPeerSSL::bio_write( BIO *b, const char *buf, int len ) {
if ( buf == NULL || len <= 0 ) return 0;
StreamPeerSSL * sp = (StreamPeerSSL*)b->ptr;
if (sp->base.is_null())
return 0;
BIO_clear_retry_flags( b );
Error err;
int wrote=0;
if (sp->block) {
err = sp->base->put_data((const uint8_t*)buf,len);
if (err==OK)
wrote=len;
} else {
err = sp->base->put_partial_data((const uint8_t*)buf,len,wrote);
if (err==OK && wrote!=len) {
BIO_set_retry_write( b );
}
}
return wrote;
}
long StreamPeerSSL::bio_ctrl( BIO *b, int cmd, long num, void *ptr ) {
if ( cmd == BIO_CTRL_FLUSH ) {
/* The OpenSSL library needs this */
return 1;
}
return 0;
}
int StreamPeerSSL::bio_gets( BIO *b, char *buf, int len ) {
return -1;
}
int StreamPeerSSL::bio_puts( BIO *b, const char *str ) {
return StreamPeerSSL::bio_write( b, str, strlen( str ) );
}
BIO_METHOD StreamPeerSSL::bio_methods =
{
( 100 | 0x400 ), /* it's a source/sink BIO */
"sockbuf glue",
StreamPeerSSL::bio_write,
StreamPeerSSL::bio_read,
StreamPeerSSL::bio_puts,
StreamPeerSSL::bio_gets,
StreamPeerSSL::bio_ctrl,
StreamPeerSSL::bio_create,
StreamPeerSSL::bio_destroy
};
StreamPeerSSL::StreamPeerSSL() {
}

View File

@ -0,0 +1,26 @@
#ifndef STREAM_PEER_SSL_H
#define STREAM_PEER_SSL_H
#include "io/stream_peer.h"
class StreamPeerSSL : public StreamPeer {
OBJ_TYPE(StreamPeerSSL,StreamPeer);
Ref<StreamPeer> base;
bool block;
static BIO_METHOD bio_methods;
static int bio_create( BIO *b );
static int bio_destroy( BIO *b );
static int bio_read( BIO *b, char *buf, int len );
static int bio_write( BIO *b, const char *buf, int len );
static long bio_ctrl( BIO *b, int cmd, long num, void *ptr );
static int bio_gets( BIO *b, char *buf, int len );
static int bio_puts( BIO *b, const char *str );
public:
StreamPeerSSL();
};
#endif // STREAM_PEER_SSL_H

View File

@ -97,7 +97,7 @@ long AudioStreamOGGVorbis::_ov_tell_func(void *_f) {
bool AudioStreamOGGVorbis::_can_mix() const {
return playing && !paused;
return /*playing &&*/ !paused;
}
@ -125,6 +125,8 @@ void AudioStreamOGGVorbis::update() {
if (ret<0) {
playing = false;
setting_up=false;
ERR_EXPLAIN("Error reading OGG Vorbis File: "+file);
ERR_BREAK(ret<0);
} else if (ret==0) { // end of song, reload?
@ -135,7 +137,8 @@ void AudioStreamOGGVorbis::update() {
if (!has_loop()) {
playing=false;
playing=false;
setting_up=false;
repeats=1;
return;
}
@ -145,6 +148,7 @@ void AudioStreamOGGVorbis::update() {
int errv = ov_open_callbacks(f,&vf,NULL,0,_ov_callbacks);
if (errv!=0) {
playing=false;
setting_up=false;
return; // :(
}
@ -179,6 +183,8 @@ void AudioStreamOGGVorbis::play() {
playing=false;
setting_up=true;
update();
if (!setting_up)
return;
setting_up=false;
playing=true;
}