This commit is contained in:
Juan Linietsky 2015-12-31 00:33:07 -03:00
commit 335c52ba03
118 changed files with 2126 additions and 1172 deletions

View File

@ -1,14 +1,48 @@
language: cpp
compiler:
- gcc
before_install:
before_script:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
- sudo apt-get install -qq scons pkg-config libx11-dev libxcursor-dev build-essential libasound2-dev libfreetype6-dev libgl1-mesa-dev libglu-dev
- if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; fi
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
script: scons platform=x11
sudo: required
dist: trusty
compiler:
- gcc
- clang
os:
- linux
- osx
env:
- GODOT_TARGET=iphone
- GODOT_TARGET=osx
- GODOT_TARGET=x11
- GODOT_TARGET=android
- GODOT_TARGET=windows
matrix:
exclude:
- os: linux
env: GODOT_TARGET=iphone
- os: linux
env: GODOT_TARGET=osx
- os: linux
env: GODOT_TARGET=android
- os: osx
env: GODOT_TARGET=x11
- os: osx
env: GODOT_TARGET=windows
- compiler: gcc
env: GODOT_TARGET=iphone
- compiler: clang
env: GODOT_TARGET=android
- compiler: clang
env: GODOT_TARGET=windows
before_script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; sudo apt-get install -y scons pkg-config libx11-dev libxcursor-dev build-essential libasound2-dev libfreetype6-dev libgl1-mesa-dev libglu-dev libssl-dev libxinerama-dev libevdev-dev libudev-dev; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$GODOT_TARGET" = "windows" ]; then sudo apt-get update -qq; sudo apt-get install -y mingw32 mingw-w64; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install scons; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then brew update; brew install android-sdk android-ndk; export ANDROID_HOME=/usr/local/opt/android-sdk; export ANDROID_NDK_ROOT=/usr/local/opt/android-ndk; fi
script:
- scons platform=$GODOT_TARGET CXX=$CXX

View File

@ -62,8 +62,8 @@ void _ResourceLoader::_bind_methods() {
ObjectTypeDB::bind_method(_MD("load:Resource","path","type_hint", "p_no_cache"),&_ResourceLoader::load,DEFVAL(""), DEFVAL(false));
ObjectTypeDB::bind_method(_MD("get_recognized_extensions_for_type","type"),&_ResourceLoader::get_recognized_extensions_for_type);
ObjectTypeDB::bind_method(_MD("set_abort_on_missing_resources","abort"),&_ResourceLoader::set_abort_on_missing_resources);
ObjectTypeDB::bind_method(_MD("get_dependencies"),&_ResourceLoader::get_dependencies);
ObjectTypeDB::bind_method(_MD("has"),&_ResourceLoader::has);
ObjectTypeDB::bind_method(_MD("get_dependencies","path"),&_ResourceLoader::get_dependencies);
ObjectTypeDB::bind_method(_MD("has","path"),&_ResourceLoader::has);
}
_ResourceLoader::_ResourceLoader() {
@ -96,7 +96,7 @@ _ResourceSaver *_ResourceSaver::singleton=NULL;
void _ResourceSaver::_bind_methods() {
ObjectTypeDB::bind_method(_MD("save","path","resource:Resource"),&_ResourceSaver::save, DEFVAL(0));
ObjectTypeDB::bind_method(_MD("save","path","resource:Resource","flags"),&_ResourceSaver::save,DEFVAL(0));
ObjectTypeDB::bind_method(_MD("get_recognized_extensions","type"),&_ResourceSaver::get_recognized_extensions);
BIND_CONSTANT(FLAG_RELATIVE_PATHS);
@ -812,7 +812,7 @@ void _OS::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_unix_time"),&_OS::get_unix_time);
ObjectTypeDB::bind_method(_MD("get_system_time_msec"), &_OS::get_system_time_msec);
ObjectTypeDB::bind_method(_MD("set_icon"),&_OS::set_icon);
ObjectTypeDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon);
ObjectTypeDB::bind_method(_MD("delay_usec","usec"),&_OS::delay_usec);
ObjectTypeDB::bind_method(_MD("delay_msec","msec"),&_OS::delay_msec);
@ -851,9 +851,9 @@ void _OS::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_frames_per_second"),&_OS::get_frames_per_second);
ObjectTypeDB::bind_method(_MD("print_all_textures_by_size"),&_OS::print_all_textures_by_size);
ObjectTypeDB::bind_method(_MD("print_resources_by_type"),&_OS::print_resources_by_type);
ObjectTypeDB::bind_method(_MD("print_resources_by_type","types"),&_OS::print_resources_by_type);
ObjectTypeDB::bind_method(_MD("native_video_play"),&_OS::native_video_play);
ObjectTypeDB::bind_method(_MD("native_video_play","path","volume","audio_track","subtitle_track"),&_OS::native_video_play);
ObjectTypeDB::bind_method(_MD("native_video_is_playing"),&_OS::native_video_is_playing);
ObjectTypeDB::bind_method(_MD("native_video_stop"),&_OS::native_video_stop);
ObjectTypeDB::bind_method(_MD("native_video_pause"),&_OS::native_video_pause);

View File

@ -410,15 +410,15 @@ bool PHashTranslation::_set(const StringName& p_name, const Variant& p_value) {
String name = p_name.operator String();
if (name=="hash_table") {
hash_table=p_value;
print_line("translation: loaded hash table of size: "+itos(hash_table.size()));
//print_line("translation: loaded hash table of size: "+itos(hash_table.size()));
} else if (name=="bucket_table") {
bucket_table=p_value;
print_line("translation: loaded bucket table of size: "+itos(bucket_table.size()));
//print_line("translation: loaded bucket table of size: "+itos(bucket_table.size()));
} else if (name=="strings") {
strings=p_value;
print_line("translation: loaded string table of size: "+itos(strings.size()));
//print_line("translation: loaded string table of size: "+itos(strings.size()));
} else if (name=="load_from") {
print_line("generating");
//print_line("generating");
generate(p_value);
} else
return false;

View File

@ -137,7 +137,7 @@ bool Globals::_set(const StringName& p_name, const Variant& p_value) {
props[p_name].order=last_order++;
}
} else {
props[p_name]=VariantContainer(p_value,last_order++ + registering_order?0:NO_ORDER_BASE);
props[p_name]=VariantContainer(p_value,last_order++ + (registering_order?0:NO_ORDER_BASE));
}
}
@ -1391,11 +1391,11 @@ void Globals::_bind_methods() {
ObjectTypeDB::bind_method(_MD("localize_path","path"),&Globals::localize_path);
ObjectTypeDB::bind_method(_MD("globalize_path","path"),&Globals::globalize_path);
ObjectTypeDB::bind_method(_MD("save"),&Globals::save);
ObjectTypeDB::bind_method(_MD("has_singleton"),&Globals::has_singleton);
ObjectTypeDB::bind_method(_MD("get_singleton"),&Globals::get_singleton_object);
ObjectTypeDB::bind_method(_MD("load_resource_pack"),&Globals::_load_resource_pack);
ObjectTypeDB::bind_method(_MD("has_singleton","name"),&Globals::has_singleton);
ObjectTypeDB::bind_method(_MD("get_singleton","name"),&Globals::get_singleton_object);
ObjectTypeDB::bind_method(_MD("load_resource_pack","pack"),&Globals::_load_resource_pack);
ObjectTypeDB::bind_method(_MD("save_custom"),&Globals::_save_custom_bnd);
ObjectTypeDB::bind_method(_MD("save_custom","file"),&Globals::_save_custom_bnd);
}

View File

@ -205,7 +205,7 @@ void ConfigFile::_bind_methods(){
ObjectTypeDB::bind_method(_MD("has_section_key","section","key"),&ConfigFile::has_section_key);
ObjectTypeDB::bind_method(_MD("get_sections"),&ConfigFile::_get_sections);
ObjectTypeDB::bind_method(_MD("get_section_keys"),&ConfigFile::_get_section_keys);
ObjectTypeDB::bind_method(_MD("get_section_keys","section"),&ConfigFile::_get_section_keys);
ObjectTypeDB::bind_method(_MD("load:Error","path"),&ConfigFile::load);
ObjectTypeDB::bind_method(_MD("save:Error","path"),&ConfigFile::save);

View File

@ -385,15 +385,15 @@ void XMLParser::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_node_data"),&XMLParser::get_node_data);
ObjectTypeDB::bind_method(_MD("get_node_offset"),&XMLParser::get_node_offset);
ObjectTypeDB::bind_method(_MD("get_attribute_count"),&XMLParser::get_attribute_count);
ObjectTypeDB::bind_method(_MD("get_attribute_name"),&XMLParser::get_attribute_name);
ObjectTypeDB::bind_method(_MD("get_attribute_value"),(String (XMLParser::*)(int) const) &XMLParser::get_attribute_value);
ObjectTypeDB::bind_method(_MD("has_attribute"),&XMLParser::has_attribute);
ObjectTypeDB::bind_method(_MD("get_named_attribute_value"), (String (XMLParser::*)(const String&) const) &XMLParser::get_attribute_value);
ObjectTypeDB::bind_method(_MD("get_named_attribute_value_safe"), &XMLParser::get_attribute_value_safe);
ObjectTypeDB::bind_method(_MD("get_attribute_name","idx"),&XMLParser::get_attribute_name);
ObjectTypeDB::bind_method(_MD("get_attribute_value","idx"),(String (XMLParser::*)(int) const) &XMLParser::get_attribute_value);
ObjectTypeDB::bind_method(_MD("has_attribute","name"),&XMLParser::has_attribute);
ObjectTypeDB::bind_method(_MD("get_named_attribute_value","name"), (String (XMLParser::*)(const String&) const) &XMLParser::get_attribute_value);
ObjectTypeDB::bind_method(_MD("get_named_attribute_value_safe","name"), &XMLParser::get_attribute_value_safe);
ObjectTypeDB::bind_method(_MD("is_empty"),&XMLParser::is_empty);
ObjectTypeDB::bind_method(_MD("get_current_line"),&XMLParser::get_current_line);
ObjectTypeDB::bind_method(_MD("skip_section"),&XMLParser::skip_section);
ObjectTypeDB::bind_method(_MD("seek"),&XMLParser::seek);
ObjectTypeDB::bind_method(_MD("seek","pos"),&XMLParser::seek);
ObjectTypeDB::bind_method(_MD("open","file"),&XMLParser::open);
ObjectTypeDB::bind_method(_MD("open_buffer","buffer"),&XMLParser::open_buffer);

View File

@ -187,7 +187,6 @@ Vector2 Vector2::snapped(const Vector2& p_by) const {
Vector2 Vector2::clamped(real_t p_len) const {
return *this;
real_t l = length();
Vector2 v = *this;
if (l>0 && p_len<l) {

View File

@ -1550,7 +1550,7 @@ void Object::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get","property"),&Object::_get_bind);
ObjectTypeDB::bind_method(_MD("get_property_list"),&Object::_get_property_list_bind);
ObjectTypeDB::bind_method(_MD("get_method_list"),&Object::_get_method_list_bind);
ObjectTypeDB::bind_method(_MD("notification","what"),&Object::notification,DEFVAL(false));
ObjectTypeDB::bind_method(_MD("notification","what","reversed"),&Object::notification,DEFVAL(false));
ObjectTypeDB::bind_method(_MD("get_instance_ID"),&Object::get_instance_ID);
ObjectTypeDB::bind_method(_MD("set_script","script:Script"),&Object::set_script);
@ -1615,7 +1615,7 @@ void Object::_bind_methods() {
ObjectTypeDB::bind_method(_MD("callv:Variant","method","arg_array"),&Object::callv);
ObjectTypeDB::bind_method(_MD("has_method"),&Object::has_method);
ObjectTypeDB::bind_method(_MD("has_method","method"),&Object::has_method);
ObjectTypeDB::bind_method(_MD("get_signal_list"),&Object::_get_signal_list);

View File

@ -62,8 +62,8 @@ void Input::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_mouse_mode","mode"),&Input::set_mouse_mode);
ObjectTypeDB::bind_method(_MD("get_mouse_mode"),&Input::get_mouse_mode);
ObjectTypeDB::bind_method(_MD("warp_mouse_pos","to"),&Input::warp_mouse_pos);
ObjectTypeDB::bind_method(_MD("action_press"),&Input::action_press);
ObjectTypeDB::bind_method(_MD("action_release"),&Input::action_release);
ObjectTypeDB::bind_method(_MD("action_press","action"),&Input::action_press);
ObjectTypeDB::bind_method(_MD("action_release","action"),&Input::action_release);
ObjectTypeDB::bind_method(_MD("set_custom_mouse_cursor","image:Texture","hotspot"),&Input::set_custom_mouse_cursor,DEFVAL(Vector2()));
BIND_CONSTANT( MOUSE_MODE_VISIBLE );

View File

@ -278,7 +278,7 @@ void Resource::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_import_metadata","metadata"),&Resource::set_import_metadata);
ObjectTypeDB::bind_method(_MD("get_import_metadata"),&Resource::get_import_metadata);
ObjectTypeDB::bind_method(_MD("duplicate"),&Resource::duplicate,DEFVAL(false));
ObjectTypeDB::bind_method(_MD("duplicate","subresources"),&Resource::duplicate,DEFVAL(false));
ADD_SIGNAL( MethodInfo("changed") );
ADD_PROPERTY( PropertyInfo(Variant::STRING,"resource/path",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR ), _SCS("set_path"),_SCS("get_path"));
ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"resource/name"), _SCS("set_name"),_SCS("get_name"));

View File

@ -165,6 +165,7 @@ public:
virtual String make_function(const String& p_class,const String& p_name,const StringArray& p_args) const=0;
virtual Error complete_code(const String& p_code, const String& p_base_path, Object*p_owner,List<String>* r_options,String& r_call_hint) { return ERR_UNAVAILABLE; }
virtual void auto_indent_code(String& p_code,int p_from_line,int p_to_line) const=0;
virtual void add_global_constant(const StringName& p_variable,const Variant& p_value)=0;
/* DEBUGGER FUNCTIONS */

View File

@ -626,7 +626,7 @@ bool TranslationServer::_load_translations(const String& p_from) {
for(int i=0;i<tcount;i++) {
print_line( "Loading translation from " + r[i] );
//print_line( "Loading translation from " + r[i] );
Ref<Translation> tr = ResourceLoader::load(r[i]);
if (tr.is_valid())
add_translation(tr);
@ -670,10 +670,10 @@ void TranslationServer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_locale","locale"),&TranslationServer::set_locale);
ObjectTypeDB::bind_method(_MD("get_locale"),&TranslationServer::get_locale);
ObjectTypeDB::bind_method(_MD("translate"),&TranslationServer::translate);
ObjectTypeDB::bind_method(_MD("translate","message"),&TranslationServer::translate);
ObjectTypeDB::bind_method(_MD("add_translation"),&TranslationServer::add_translation);
ObjectTypeDB::bind_method(_MD("remove_translation"),&TranslationServer::remove_translation);
ObjectTypeDB::bind_method(_MD("add_translation","translation:Translation"),&TranslationServer::add_translation);
ObjectTypeDB::bind_method(_MD("remove_translation","translation:Translation"),&TranslationServer::remove_translation);
ObjectTypeDB::bind_method(_MD("clear"),&TranslationServer::clear);

File diff suppressed because it is too large Load Diff

View File

@ -446,18 +446,19 @@ CPLoader::Error CPLoader_MOD::load_song(const char *p_file,CPSong *p_song,bool p
if (sid.is_null()) {
continue; //empty sample, not stored?
}
sm->lock_data(sid);
uint8_t *dataptr = (uint8_t*)sm->get_data(sid);
int len=sm->get_size(sid);
for (int s=0;s<len;s++) {
uint8_t d=file->get_byte();
//d-=128; //convert to signed
int8_t*ds=(int8_t*)&d;
int16_t d16=*ds;
d16<<=8;
sm->set_data( sid, s, d16 );
dataptr[s]=*ds;
}
sm->unlock_data(sid);
}
file->close();

View File

@ -196,8 +196,12 @@ CPLoader::Error CPLoader_S3M::load_sample(CPSample *p_sample) {
if (id.is_null())
return FILE_OUT_OF_MEMORY;
sm->lock_data(id);
void *dataptr = sm->get_data(id);
for (int c=0;c<(data_is_stereo?2:1);c++) {
int chans = (data_is_stereo?2:1);
for (int c=0;c<chans;c++) {
for (int i=0;i<sample_size;i++) {
if (data_is_16bits) {
@ -206,7 +210,7 @@ CPLoader::Error CPLoader_S3M::load_sample(CPSample *p_sample) {
s-=32768; //toggle sign
int16_t *v=(int16_t*)&s;
sm->set_data(id,i,*v,c);
((int16_t*)dataptr)[i*chans+c]=*v;
} else {
@ -214,16 +218,16 @@ CPLoader::Error CPLoader_S3M::load_sample(CPSample *p_sample) {
uint8_t s=file->get_byte();
s-=128; //toggle sign
v=(int8_t*)&s;
int16_t v16=*v;
v16<<=8;
sm->set_data(id,i,v16,c);
((int8_t*)dataptr)[i*chans+c]=*v;
}
}
}
sm->unlock_data(id);
sm->set_loop_begin( id, loop_begin );
sm->set_loop_end( id, loop_end );

View File

@ -627,6 +627,10 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool
CPSample *sample=song->get_sample(sample_index[j]);
CPSample_ID sid=sample->get_sample_data();
sm->lock_data(sid);
void*dataptr=sm->get_data(sid);
if (sm->is_16bits( sid)) {
int16_t old=0;
@ -638,8 +642,9 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool
int16_t sampleval=file->get_word();
newsample=sampleval+old;
old=newsample;
sm->set_data( sid, k, newsample );
((int16_t*)dataptr)[k]=newsample;
//sm->set_data( sid, k, newsample );
}
} else {
@ -653,10 +658,15 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool
newsample=sampleval+old;
old=newsample;
sm->set_data( sid, k, (int16_t)newsample << 8 );
((int8_t*)dataptr)[k]=newsample;
//sm->set_data( sid, k, (int16_t)newsample << 8 );
}
}
sm->unlock_data(sid);
}
for (int j=0;j<96;j++) {

View File

@ -739,12 +739,12 @@ void ShaderGLES2::set_custom_shader(uint32_t p_code_id) {
void ShaderGLES2::free_custom_shader(uint32_t p_code_id) {
if (! custom_code_map.has( p_code_id )) {
/* if (! custom_code_map.has( p_code_id )) {
print_line("no code id "+itos(p_code_id));
} else {
print_line("freed code id "+itos(p_code_id));
}
}*/
ERR_FAIL_COND(! custom_code_map.has( p_code_id ));
if (conditional_version.code_version==p_code_id)

View File

@ -22,18 +22,19 @@ png_sources = [
"png/image_loader_png.cpp"
]
if ("neon_enabled" in env and env["neon_enabled"]):
if ("neon_enabled" in env and env["neon_enabled"]):
env.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=2"])
env_neon = env.Clone();
if "S_compiler" in env:
env_neon['CC'] = env['S_compiler']
env_neon.Append(CPPFLAGS=["-DPNG_ARM_NEON"])
#env_neon.Append(CPPFLAGS=["-DPNG_ARM_NEON"])
import os
# Currently .ASM filter_neon.S does not compile on NT.
if (os.name!="nt"):
env_neon.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=2"])
png_sources.append(env_neon.Object("#drivers/png/arm/arm_init.c"))
png_sources.append(env_neon.Object("#drivers/png/arm/filter_neon.S"))
else:
env.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=0"])
env.drivers_sources+=png_sources

View File

@ -81,6 +81,11 @@ Error ThreadPosix::set_name(const String& p_name) {
ERR_FAIL_COND_V(pthread == 0, ERR_UNCONFIGURED);
#ifdef PTHREAD_NO_RENAME
return ERR_UNAVAILABLE;
#else
#ifdef PTHREAD_RENAME_SELF
// check if thread is the same as caller
@ -100,6 +105,8 @@ Error ThreadPosix::set_name(const String& p_name) {
#endif
return err == 0 ? OK : ERR_INVALID_PARAMETER;
#endif // PTHREAD_NO_RENAME
};
void ThreadPosix::make_default() {

View File

@ -17,6 +17,8 @@
#include "./bit_reader_inl.h"
#define JAVASCRIPT_ENABLED // testing
//------------------------------------------------------------------------------
// VP8BitReader
@ -40,7 +42,13 @@ void VP8InitBitReader(VP8BitReader* const br,
br->bits_ = -8; // to load the very first 8bits
br->eof_ = 0;
VP8BitReaderSetBuffer(br, start, size);
#ifdef JAVASCRIPT_ENABLED // html5 required aligned reads
while(((uintptr_t)br->buf_ & 1) != 0 && !br->eof_)
VP8LoadFinalBytes(br);
#else
VP8LoadNewBytes(br);
#endif
}
void VP8RemapBitReader(VP8BitReader* const br, ptrdiff_t offset) {

View File

@ -37,6 +37,12 @@ extern "C" {
// BITS can be any multiple of 8 from 8 to 56 (inclusive).
// Pick values that fit natural register size.
#ifdef JAVASCRIPT_ENABLED
#define BITS 16
#else
#if defined(__i386__) || defined(_M_IX86) // x86 32bit
#define BITS 24
#elif defined(__x86_64__) || defined(_M_X64) // x86 64bit
@ -49,6 +55,8 @@ extern "C" {
#define BITS 24 // TODO(skal): test aarch64 and find the proper BITS value.
#endif
#endif
//------------------------------------------------------------------------------
// Derived types and constants:
// bit_t = natural register type for storing 'value_' (which is BITS+8 bits)

View File

@ -56,7 +56,7 @@
#ifdef TOOLS_ENABLED
#include "tools/editor/editor_node.h"
#include "tools/editor/project_manager.h"
#include "tools/editor/console.h"
#include "tools/pck/pck_packer.h"
#endif
@ -1330,6 +1330,12 @@ bool Main::start() {
continue;
String name = s.get_slicec('/',1);
String path = Globals::get_singleton()->get(s);
bool global_var=false;
if (path.begins_with("*")) {
global_var=true;
path=path.substr(1,path.length()-1);
}
RES res = ResourceLoader::load(path);
ERR_EXPLAIN("Can't autoload: "+path);
ERR_CONTINUE(res.is_null());
@ -1355,7 +1361,16 @@ bool Main::start() {
ERR_EXPLAIN("Path in autoload not a node or script: "+path);
ERR_CONTINUE(!n);
n->set_name(name);
sml->get_root()->add_child(n);
if (global_var) {
for(int i=0;i<ScriptServer::get_language_count();i++) {
ScriptServer::get_language(i)->add_global_constant(name,n);
}
}
}
}

View File

@ -1156,6 +1156,10 @@ Error GDCompiler::_parse_block(CodeGen& codegen,const GDParser::BlockNode *p_blo
codegen.opcodes.push_back(GDFunction::OPCODE_ASSERT);
codegen.opcodes.push_back(ret);
} break;
case GDParser::Node::TYPE_BREAKPOINT: {
// try subblocks
codegen.opcodes.push_back(GDFunction::OPCODE_BREAKPOINT);
} break;
case GDParser::Node::TYPE_LOCAL_VAR: {
@ -1181,7 +1185,7 @@ Error GDCompiler::_parse_block(CodeGen& codegen,const GDParser::BlockNode *p_blo
}
Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *p_class,const GDParser::FunctionNode *p_func) {
Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *p_class,const GDParser::FunctionNode *p_func,bool p_for_ready) {
Vector<int> bytecode;
CodeGen codegen;
@ -1212,9 +1216,9 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *
/* Parse initializer -if applies- */
bool is_initializer=false || !p_func;
bool is_initializer=!p_for_ready && !p_func;
if (!p_func || String(p_func->name)=="_init") {
if (is_initializer || (p_func && String(p_func->name)=="_init")) {
//parse initializer for class members
if (!p_func && p_class->extends_used && p_script->native.is_null()){
@ -1232,6 +1236,17 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *
}
if (p_for_ready || (p_func && String(p_func->name)=="_ready")) {
//parse initializer for class members
if (p_class->ready->statements.size()) {
Error err = _parse_block(codegen,p_class->ready,stack_level);
if (err)
return err;
}
}
/* Parse default argument code -if applies- */
Vector<int> defarg_addr;
@ -1260,7 +1275,10 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *
func_name=p_func->name;
} else {
func_name="_init";
if (p_for_ready)
func_name="_ready";
else
func_name="_init";
}
codegen.opcodes.push_back(GDFunction::OPCODE_END);
@ -1614,10 +1632,14 @@ Error GDCompiler::_parse_class(GDScript *p_script,GDScript *p_owner,const GDPars
//parse methods
bool has_initializer=false;
bool has_ready=false;
for(int i=0;i<p_class->functions.size();i++) {
if (!has_initializer && p_class->functions[i]->name=="_init")
has_initializer=true;
if (!has_ready && p_class->functions[i]->name=="_ready")
has_ready=true;
Error err = _parse_function(p_script,p_class,p_class->functions[i]);
if (err)
return err;
@ -1640,6 +1662,13 @@ Error GDCompiler::_parse_class(GDScript *p_script,GDScript *p_owner,const GDPars
return err;
}
if (!has_ready && p_class->ready->statements.size()) {
//create a constructor
Error err = _parse_function(p_script,p_class,NULL,true);
if (err)
return err;
}
#ifdef DEBUG_ENABLED
//validate setters/getters if debug is enabled
for(int i=0;i<p_class->variables.size();i++) {

View File

@ -143,7 +143,7 @@ class GDCompiler {
int _parse_assign_right_expression(CodeGen& codegen,const GDParser::OperatorNode *p_expression, int p_stack_level);
int _parse_expression(CodeGen& codegen,const GDParser::Node *p_expression, int p_stack_level,bool p_root=false,bool p_initializer=false);
Error _parse_block(CodeGen& codegen,const GDParser::BlockNode *p_block,int p_stack_level=0,int p_break_addr=-1,int p_continue_addr=-1);
Error _parse_function(GDScript *p_script,const GDParser::ClassNode *p_class,const GDParser::FunctionNode *p_func);
Error _parse_function(GDScript *p_script,const GDParser::ClassNode *p_class,const GDParser::FunctionNode *p_func,bool p_for_ready=false);
Error _parse_class(GDScript *p_script,GDScript *p_owner,const GDParser::ClassNode *p_class);
int err_line;
int err_column;

View File

@ -1147,8 +1147,54 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const
}
}
//autoloads as singletons
List<PropertyInfo> props;
Globals::get_singleton()->get_property_list(&props);
for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) {
String s = E->get().name;
if (!s.begins_with("autoload/"))
continue;
String name = s.get_slice("/",1);
if (name==String(p_identifier)) {
String path = Globals::get_singleton()->get(s);
if (path.begins_with("*")) {
String script =path.substr(1,path.length());
if (!script.ends_with(".gd")) {
//not a script, try find the script anyway,
//may have some success
script=script.basename()+".gd";
}
if (FileAccess::exists(script)) {
//print_line("is a script");
Ref<Script> scr;
if (ScriptCodeCompletionCache::get_sigleton())
scr = ScriptCodeCompletionCache::get_sigleton()->get_cached_resource(script);
else
scr = ResourceLoader::load(script);
r_type.obj_type="Node";
r_type.type=Variant::OBJECT;
r_type.script=scr;
r_type.value=Variant();
return true;
}
}
}
}
//global
for(Map<StringName,int>::Element *E=GDScriptLanguage::get_singleton()->get_global_map().front();E;E=E->next()) {
if (E->key()==p_identifier) {
@ -1336,6 +1382,24 @@ static void _find_identifiers(GDCompletionContext& context,int p_line,bool p_onl
result.insert(_type_names[i]);
}
//autoload singletons
List<PropertyInfo> props;
Globals::get_singleton()->get_property_list(&props);
for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) {
String s = E->get().name;
if (!s.begins_with("autoload/"))
continue;
String name = s.get_slice("/",1);
String path = Globals::get_singleton()->get(s);
if (path.begins_with("*")) {
result.insert(name);
}
}
for(const Map<StringName,int>::Element *E=GDScriptLanguage::get_singleton()->get_global_map().front();E;E=E->next()) {
result.insert(E->key().operator String());
}

View File

@ -75,20 +75,28 @@ bool GDParser::_enter_indent_block(BlockNode* p_block) {
if (tokenizer->get_token()!=GDTokenizer::TK_NEWLINE) {
_set_error("newline expected after ':'.");
return false;
// be more python-like
int current = tab_level.back()->get();
tab_level.push_back(current+1);
return true;
//_set_error("newline expected after ':'.");
//return false;
}
while(true) {
if (tokenizer->get_token()!=GDTokenizer::TK_NEWLINE) {
print_line("no newline");
return false; //wtf
} else if (tokenizer->get_token(1)!=GDTokenizer::TK_NEWLINE) {
int indent = tokenizer->get_token_line_indent();
int current = tab_level.back()->get();
if (indent<=current)
if (indent<=current) {
print_line("current: "+itos(current)+" indent: "+itos(indent));
print_line("less than current");
return false;
}
tab_level.push_back(indent);
tokenizer->advance();
@ -1588,6 +1596,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
p_block->sub_blocks.push_back(cf_if->body);
if (!_enter_indent_block(cf_if->body)) {
_set_error("Expected intended block after 'if'");
p_block->end_line=tokenizer->get_token_line();
return;
}
@ -1647,6 +1656,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
if (!_enter_indent_block(cf_if->body)) {
_set_error("Expected indented block after 'elif'");
p_block->end_line=tokenizer->get_token_line();
return;
}
@ -1661,7 +1671,6 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
} else if (tokenizer->get_token()==GDTokenizer::TK_CF_ELSE) {
if (tab_level.back()->get() > indent_level) {
_set_error("Invalid indent");
return;
}
@ -1673,6 +1682,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
p_block->sub_blocks.push_back(cf_if->body_else);
if (!_enter_indent_block(cf_if->body_else)) {
_set_error("Expected indented block after 'else'");
p_block->end_line=tokenizer->get_token_line();
return;
}
@ -1713,6 +1723,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
p_block->sub_blocks.push_back(cf_while->body);
if (!_enter_indent_block(cf_while->body)) {
_set_error("Expected indented block after 'while'");
p_block->end_line=tokenizer->get_token_line();
return;
}
@ -1764,6 +1775,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
p_block->sub_blocks.push_back(cf_for->body);
if (!_enter_indent_block(cf_for->body)) {
_set_error("Expected indented block after 'while'");
p_block->end_line=tokenizer->get_token_line();
return;
}
@ -1850,6 +1862,17 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
return;
}
} break;
case GDTokenizer::TK_PR_BREAKPOINT: {
tokenizer->advance();
BreakpointNode *bn = alloc_node<BreakpointNode>();
p_block->statements.push_back(bn);
if (!_end_statement()) {
_set_error("Expected end of statement after breakpoint.");
return;
}
} break;
default: {
Node *expression = _parse_and_reduce_expression(p_block,p_static,false,true);
@ -2058,6 +2081,8 @@ void GDParser::_parse_class(ClassNode *p_class) {
ClassNode *newclass = alloc_node<ClassNode>();
newclass->initializer = alloc_node<BlockNode>();
newclass->initializer->parent_class=newclass;
newclass->ready = alloc_node<BlockNode>();
newclass->ready->parent_class=newclass;
newclass->name=name;
newclass->owner=p_class;
@ -2767,6 +2792,17 @@ void GDParser::_parse_class(ClassNode *p_class) {
}
}; //fallthrough to var
case GDTokenizer::TK_PR_ONREADY: {
if (token==GDTokenizer::TK_PR_ONREADY) {
//may be fallthrough from export, ignore if so
tokenizer->advance();
if (tokenizer->get_token()!=GDTokenizer::TK_PR_VAR) {
_set_error("Expected 'var'.");
return;
}
}
}; //fallthrough to var
case GDTokenizer::TK_PR_VAR: {
//variale declaration and (eventual) initialization
@ -2777,6 +2813,8 @@ void GDParser::_parse_class(ClassNode *p_class) {
current_export=PropertyInfo();
}
bool onready = tokenizer->get_token(-1)==GDTokenizer::TK_PR_ONREADY;
tokenizer->advance();
if (tokenizer->get_token()!=GDTokenizer::TK_IDENTIFIER) {
@ -2807,6 +2845,21 @@ void GDParser::_parse_class(ClassNode *p_class) {
return;
}
//discourage common error
if (!onready && subexpr->type==Node::TYPE_OPERATOR) {
OperatorNode *op=static_cast<OperatorNode*>(subexpr);
if (op->op==OperatorNode::OP_CALL && op->arguments[0]->type==Node::TYPE_SELF && op->arguments[1]->type==Node::TYPE_IDENTIFIER) {
IdentifierNode *id=static_cast<IdentifierNode*>(op->arguments[1]);
if (id->name=="get_node") {
_set_error("Use 'onready var "+String(member.identifier)+" = get_node(..)' instead");
return;
}
}
}
member.expression=subexpr;
if (autoexport) {
@ -2853,12 +2906,19 @@ void GDParser::_parse_class(ClassNode *p_class) {
op->arguments.push_back(id);
op->arguments.push_back(subexpr);
#ifdef DEBUG_ENABLED
NewLineNode *nl = alloc_node<NewLineNode>();
nl->line=line;
p_class->initializer->statements.push_back(nl);
if (onready)
p_class->ready->statements.push_back(nl);
else
p_class->initializer->statements.push_back(nl);
#endif
p_class->initializer->statements.push_back(op);
if (onready)
p_class->ready->statements.push_back(op);
else
p_class->initializer->statements.push_back(op);
@ -3009,6 +3069,8 @@ Error GDParser::_parse(const String& p_base_path) {
ClassNode *main_class = alloc_node<ClassNode>();
main_class->initializer = alloc_node<BlockNode>();
main_class->initializer->parent_class=main_class;
main_class->ready = alloc_node<BlockNode>();
main_class->ready->parent_class=main_class;
current_class=main_class;
_parse_class(main_class);

View File

@ -54,6 +54,7 @@ public:
TYPE_CONTROL_FLOW,
TYPE_LOCAL_VAR,
TYPE_ASSERT,
TYPE_BREAKPOINT,
TYPE_NEWLINE,
};
@ -105,6 +106,7 @@ public:
Vector<FunctionNode*> static_functions;
Vector<Signal> _signals;
BlockNode *initializer;
BlockNode *ready;
ClassNode *owner;
//Vector<Node*> initializers;
int end_line;
@ -275,6 +277,10 @@ public:
AssertNode() { type=TYPE_ASSERT; }
};
struct BreakpointNode : public Node {
BreakpointNode() { type=TYPE_BREAKPOINT; }
};
struct NewLineNode : public Node {
NewLineNode() { type=TYPE_NEWLINE; }
};

View File

@ -1077,6 +1077,14 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
ip+=2;
} continue;
case OPCODE_BREAKPOINT: {
#ifdef DEBUG_ENABLED
if (ScriptDebugger::get_singleton()) {
GDScriptLanguage::get_singleton()->debug_break("Breakpoint Statement",true);
}
#endif
ip+=1;
} continue;
case OPCODE_LINE: {
CHECK_SPACE(2);
@ -2570,6 +2578,12 @@ void GDScriptLanguage::_add_global(const StringName& p_name,const Variant& p_val
_global_array=global_array.ptr();
}
void GDScriptLanguage::add_global_constant(const StringName& p_variable,const Variant& p_value) {
_add_global(p_variable,p_value);
}
void GDScriptLanguage::init() {
@ -2646,6 +2660,7 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const {
"elif",
"enum",
"extends" ,
"onready",
"for" ,
"func" ,
"if" ,
@ -2665,6 +2680,7 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const {
"or",
"export",
"assert",
"breakpoint",
"yield",
"static",
"float",

View File

@ -71,6 +71,7 @@ public:
OPCODE_ITERATE_BEGIN,
OPCODE_ITERATE,
OPCODE_ASSERT,
OPCODE_BREAKPOINT,
OPCODE_LINE,
OPCODE_END
};
@ -529,6 +530,7 @@ public:
virtual String make_function(const String& p_class,const String& p_name,const StringArray& p_args) const;
virtual Error complete_code(const String& p_code, const String& p_base_path, Object*p_owner,List<String>* r_options,String& r_call_hint);
virtual void auto_indent_code(String& p_code,int p_from_line,int p_to_line) const;
virtual void add_global_constant(const StringName& p_variable,const Variant& p_value);
/* DEBUGGER FUNCTIONS */

View File

@ -98,6 +98,7 @@ const char* GDTokenizer::token_names[TK_MAX]={
"assert",
"yield",
"signal",
"breakpoint",
"'['",
"']'",
"'{'",
@ -851,6 +852,7 @@ void GDTokenizerText::_advance() {
{TK_PR_FUNCTION,"function"},
{TK_PR_CLASS,"class"},
{TK_PR_EXTENDS,"extends"},
{TK_PR_ONREADY,"onready"},
{TK_PR_TOOL,"tool"},
{TK_PR_STATIC,"static"},
{TK_PR_EXPORT,"export"},
@ -860,6 +862,7 @@ void GDTokenizerText::_advance() {
{TK_PR_ASSERT,"assert"},
{TK_PR_YIELD,"yield"},
{TK_PR_SIGNAL,"signal"},
{TK_PR_BREAKPOINT,"breakpoint"},
{TK_PR_CONST,"const"},
//controlflow
{TK_CF_IF,"if"},
@ -1040,7 +1043,7 @@ void GDTokenizerText::advance(int p_amount) {
//////////////////////////////////////////////////////////////////////////////////////////////////////
#define BYTECODE_VERSION 5
#define BYTECODE_VERSION 7
Error GDTokenizerBuffer::set_code_buffer(const Vector<uint8_t> & p_buffer) {

View File

@ -95,6 +95,7 @@ public:
TK_PR_FUNCTION,
TK_PR_CLASS,
TK_PR_EXTENDS,
TK_PR_ONREADY,
TK_PR_TOOL,
TK_PR_STATIC,
TK_PR_EXPORT,
@ -105,6 +106,7 @@ public:
TK_PR_ASSERT,
TK_PR_YIELD,
TK_PR_SIGNAL,
TK_PR_BREAKPOINT,
TK_BRACKET_OPEN,
TK_BRACKET_CLOSE,
TK_CURLY_BRACKET_OPEN,

View File

@ -1096,7 +1096,7 @@ void GridMap::_bind_methods() {
// ObjectTypeDB::bind_method(_MD("_recreate_octants"),&GridMap::_recreate_octants);
ObjectTypeDB::bind_method(_MD("_update_dirty_map_callback"),&GridMap::_update_dirty_map_callback);
ObjectTypeDB::bind_method(_MD("resource_changed"),&GridMap::resource_changed);
ObjectTypeDB::bind_method(_MD("resource_changed","resource"),&GridMap::resource_changed);
ObjectTypeDB::bind_method(_MD("set_center_x","enable"),&GridMap::set_center_x);
ObjectTypeDB::bind_method(_MD("get_center_x"),&GridMap::get_center_x);

View File

@ -59,11 +59,11 @@ def configure(env):
import string
if (env["bits"]=="64"):
#env['CCFLAGS'] = string.split('-arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -miphoneos-version-min=5.1.1 -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -Wno-invalid-offsetof -ffast-math -m64 -DDEBUG -D_DEBUG -MMD -MT dependencies -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 -gdwarf-2 -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=5.1.1 -isysroot $IPHONESDK')
env.Append(CPPFLAGS=['-DNEED_LONG_INT'])
env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON'])
else:
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 -gdwarf-2 -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 /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')
if (env["bits"]=="64"):
env.Append(LINKFLAGS=['-arch', 'arm64', '-Wl,-dead_strip', '-miphoneos-version-min=5.1.1',
@ -116,12 +116,12 @@ def configure(env):
if (env["target"]=="release"):
env.Append(CCFLAGS=['-O3', '-ffast-math', '-DNS_BLOCK_ASSERTIONS=1','-Wall'])
env.Append(LINKFLAGS=['-O3', '-ffast-math'])
env.Append(CCFLAGS=['-O3', '-DNS_BLOCK_ASSERTIONS=1','-Wall', '-gdwarf-2']) # removed -ffast-math
env.Append(LINKFLAGS=['-O3']) #
elif env["target"] == "release_debug":
env.Append(CCFLAGS=['-Os', '-ffast-math', '-DNS_BLOCK_ASSERTIONS=1','-Wall','-DDEBUG_ENABLED'])
env.Append(LINKFLAGS=['-Os', '-ffast-math'])
env.Append(CCFLAGS=['-Os', '-DNS_BLOCK_ASSERTIONS=1','-Wall','-DDEBUG_ENABLED'])
env.Append(LINKFLAGS=['-Os'])
env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED'])
elif (env["target"]=="debug"):
@ -131,7 +131,7 @@ def configure(env):
elif (env["target"]=="profile"):
env.Append(CCFLAGS=['-g','-pg', '-Os', '-ffast-math'])
env.Append(CCFLAGS=['-g','-pg', '-Os'])
env.Append(LINKFLAGS=['-pg'])

View File

@ -33,7 +33,7 @@ void AudioServerJavascript::sample_set_description(RID p_sample, const String& p
}
String AudioServerJavascript::sample_get_description(RID p_sample, const String& p_description) const{
String AudioServerJavascript::sample_get_description(RID p_sample) const{
return String();
}

View File

@ -95,7 +95,7 @@ public:
virtual RID sample_create(SampleFormat p_format, bool p_stereo, int p_length);
virtual void sample_set_description(RID p_sample, const String& p_description);
virtual String sample_get_description(RID p_sample, const String& p_description) const;
virtual String sample_get_description(RID p_sample) const;
virtual SampleFormat sample_get_format(RID p_sample) const;
virtual bool sample_is_stereo(RID p_sample) const;

View File

@ -80,7 +80,7 @@ def configure(env):
env.opus_fixed_point="yes"
env.Append(CPPFLAGS=["-fno-exceptions",'-DNO_SAFE_CAST','-fno-rtti'])
env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL','-DMPC_FIXED_POINT','-DTYPED_METHOD_BIND','-DNO_THREADS'])
env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DNO_FCNTL','-DMPC_FIXED_POINT','-DTYPED_METHOD_BIND','-DNO_THREADS'])
env.Append(CPPFLAGS=['-DGLES2_ENABLED'])
env.Append(CPPFLAGS=['-DGLES_NO_CLIENT_ARRAYS'])
env.Append(CPPFLAGS=['-s','ASM_JS=1'])
@ -98,3 +98,10 @@ def configure(env):
#print "CCCOM is:", env.subst('$CCCOM')
#print "P: ", env['p'], " Platofrm: ", env['platform']
import methods
env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } )
env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } )
env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } )
#env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } )

View File

@ -100,6 +100,13 @@ int joystick_windows::check_free_joy_slot() const {
// adapted from SDL2, works a lot better than the MSDN version
bool joystick_windows::is_xinput_device(const GUID *p_guid) {
static GUID IID_ValveStreamingGamepad = { MAKELONG(0x28DE, 0x11FF), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } };
static GUID IID_X360WiredGamepad = { MAKELONG(0x045E, 0x02A1), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } };
static GUID IID_X360WirelessGamepad = { MAKELONG(0x045E, 0x028E), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } };
if (p_guid == &IID_ValveStreamingGamepad || p_guid == &IID_X360WiredGamepad || p_guid == &IID_X360WirelessGamepad)
return true;
PRAWINPUTDEVICELIST dev_list = NULL;
unsigned int dev_list_count = 0;
@ -144,7 +151,7 @@ bool joystick_windows::setup_dinput_joystick(const DIDEVICEINSTANCE* instance) {
return false;
d_joysticks[joystick_count] = dinput_gamepad();
dinput_gamepad* joy = &d_joysticks[num];
dinput_gamepad* joy = &d_joysticks[joystick_count];
const DWORD devtype = (instance->dwDevType & 0xFF);
@ -168,7 +175,8 @@ bool joystick_windows::setup_dinput_joystick(const DIDEVICEINSTANCE* instance) {
guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
id_to_change = num;
id_to_change = joystick_count;
joy->di_joy->SetDataFormat(&c_dfDIJoystick2);
joy->di_joy->SetCooperativeLevel(*hWnd, DISCL_FOREGROUND);
joy->di_joy->EnumObjects(objectsCallback, this, NULL);
@ -218,7 +226,7 @@ void joystick_windows::setup_joystick_object(const DIDEVICEOBJECTINSTANCE *ob, i
dinput_gamepad &joy = d_joysticks[p_joy_id];
res = joy.di_joy->SetProperty(DIPROP_RANGE, &prop_range.diph);
res = IDirectInputDevice8_SetProperty(joy.di_joy, DIPROP_RANGE, &prop_range.diph);
if (FAILED(res))
return;
@ -365,13 +373,13 @@ unsigned int joystick_windows::process_joysticks(unsigned int p_last_id) {
IDirectInputDevice8_Acquire(joy->di_joy);
joy->di_joy->Poll();
}
if (FAILED(hr = d_joysticks[i].di_joy->GetDeviceState(sizeof(DIJOYSTATE2), &js))) {
if (FAILED(hr = joy->di_joy->GetDeviceState(sizeof(DIJOYSTATE2), &js))) {
//printf("failed to read joy #%d\n", i);
continue;
}
p_last_id = post_hat(p_last_id, i, js.rgdwPOV[0]);
p_last_id = post_hat(p_last_id, joy->id, js.rgdwPOV[0]);
for (int j = 0; j < 128; j++) {
@ -379,7 +387,7 @@ unsigned int joystick_windows::process_joysticks(unsigned int p_last_id) {
if (!joy->last_buttons[j]) {
p_last_id = input->joy_button(p_last_id, i, j, true);
p_last_id = input->joy_button(p_last_id, joy->id, j, true);
joy->last_buttons[j] = true;
}
}
@ -387,7 +395,7 @@ unsigned int joystick_windows::process_joysticks(unsigned int p_last_id) {
if (joy->last_buttons[j]) {
p_last_id = input->joy_button(p_last_id, i, j, false);
p_last_id = input->joy_button(p_last_id, joy->id, j, false);
joy->last_buttons[j] = false;
}
}
@ -402,7 +410,7 @@ unsigned int joystick_windows::process_joysticks(unsigned int p_last_id) {
for (int k=0; k<count; k++) {
if (joy->joy_axis[j] == axes[k]) {
p_last_id = input->joy_axis(p_last_id, i, j, axis_correct(values[k]));
p_last_id = input->joy_axis(p_last_id, joy->id, j, axis_correct(values[k]));
break;
};
};

View File

@ -45,10 +45,6 @@ def can_build():
print("xinerama not found.. x11 disabled.")
return False
x11_error=os.system("pkg-config libevdev --modversion > /dev/null ")
if (x11_error):
print("evdev not found.. x11 disabled.")
return False
return True # X11 enabled
@ -133,7 +129,6 @@ def configure(env):
env.ParseConfig('pkg-config x11 --cflags --libs')
env.ParseConfig('pkg-config xinerama --cflags --libs')
env.ParseConfig('pkg-config xcursor --cflags --libs')
env.ParseConfig('pkg-config libevdev --cflags --libs')
if (env["openssl"]=="yes"):
env.ParseConfig('pkg-config openssl --cflags --libs')
@ -155,7 +150,18 @@ def configure(env):
env.Append(CPPFLAGS=['-DOPENGL_ENABLED','-DGLEW_ENABLED'])
if platform.system() == 'Linux':
env.Append(CPPFLAGS=["-DALSA_ENABLED"])
env.Append(LIBS=['asound', 'udev'])
env.Append(LIBS=['asound'])
if not os.system("pkg-config --exists libudev"):
if not os.system("pkg-config --exists libevdev"):
print("Enabling udev/evdev")
env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"])
env.ParseConfig('pkg-config libudev --cflags --libs')
env.ParseConfig('pkg-config libevdev --cflags --libs')
else:
print("libevdev development libraries not found, disabling gamepad support")
else:
print("libudev development libraries not found, disabling gamepad support")
if (env["pulseaudio"]=="yes"):
if not os.system("pkg-config --exists libpulse-simple"):

View File

@ -28,7 +28,7 @@
/*************************************************************************/
//author: Andreas Haas <hondres, liugam3@gmail.com>
#ifdef __linux__
#ifdef JOYDEV_ENABLED
#include "joystick_linux.h"
#include "print_string.h"

View File

@ -30,7 +30,7 @@
//author: Andreas Haas <hondres, liugam3@gmail.com>
#ifndef JOYSTICK_LINUX_H
#define JOYSTICK_LINUX_H
#ifdef __linux__
#ifdef JOYDEV_ENABLED
#include "main/input_default.h"
#include "os/thread.h"
#include "os/mutex.h"

View File

@ -426,7 +426,7 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
physics_2d_server->init();
input = memnew( InputDefault );
#ifdef __linux__
#ifdef JOYDEV_ENABLED
joystick = memnew( joystick_linux(input));
#endif
_ensure_data_dir();
@ -461,7 +461,7 @@ void OS_X11::finalize() {
physics_2d_server->finish();
memdelete(physics_2d_server);
#ifdef __linux__
#ifdef JOYDEV_ENABLED
memdelete(joystick);
#endif
memdelete(input);
@ -1753,7 +1753,7 @@ void OS_X11::run() {
while (!force_quit) {
process_xevents(); // get rid of pending events
#ifdef __linux__
#ifdef JOYDEV_ENABLED
event_id = joystick->process_joysticks(event_id);
#endif
if (Main::iteration()==true)

View File

@ -126,7 +126,7 @@ class OS_X11 : public OS_Unix {
InputDefault *input;
#ifdef __linux__
#ifdef JOYDEV_ENABLED
joystick_linux *joystick;
#endif

View File

@ -652,7 +652,7 @@ void Area2D::_bind_methods() {
ADD_SIGNAL( MethodInfo("area_exit",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D")));
ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Replace"),_SCS("set_space_override_mode"),_SCS("get_space_override_mode"));
ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Combine-Replace,Replace,Replace-Combine"),_SCS("set_space_override_mode"),_SCS("get_space_override_mode"));
ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"gravity_point"),_SCS("set_gravity_is_point"),_SCS("is_gravity_a_point"));
ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"gravity_distance_scale", PROPERTY_HINT_RANGE,"0,1024,0.001"),_SCS("set_gravity_distance_scale"),_SCS("get_gravity_distance_scale"));
ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"gravity_vec"),_SCS("set_gravity_vector"),_SCS("get_gravity_vector"));

View File

@ -40,7 +40,9 @@ public:
enum SpaceOverride {
SPACE_OVERRIDE_DISABLED,
SPACE_OVERRIDE_COMBINE,
SPACE_OVERRIDE_REPLACE
SPACE_OVERRIDE_COMBINE_REPLACE,
SPACE_OVERRIDE_REPLACE,
SPACE_OVERRIDE_REPLACE_COMBINE
};
private:

View File

@ -503,7 +503,7 @@ void Camera2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_camera_pos"),&Camera2D::get_camera_pos);
ObjectTypeDB::bind_method(_MD("get_camera_screen_center"),&Camera2D::get_camera_screen_center);
ObjectTypeDB::bind_method(_MD("set_zoom"),&Camera2D::set_zoom);
ObjectTypeDB::bind_method(_MD("set_zoom","zoom"),&Camera2D::set_zoom);
ObjectTypeDB::bind_method(_MD("get_zoom"),&Camera2D::get_zoom);

View File

@ -773,7 +773,7 @@ void CanvasItem::draw_set_transform(const Point2& p_offset, float p_rot, const S
Matrix32 xform(p_rot,p_offset);
xform.scale_basis(p_scale);
VisualServer::get_singleton()->canvas_item_set_transform(canvas_item,xform);
VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item,xform);
}
void CanvasItem::draw_polygon(const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, Ref<Texture> p_texture) {
@ -1080,7 +1080,7 @@ void CanvasItem::_bind_methods() {
ObjectTypeDB::bind_method(_MD("draw_line","from","to","color","width"),&CanvasItem::draw_line,DEFVAL(1.0));
ObjectTypeDB::bind_method(_MD("draw_rect","rect","color"),&CanvasItem::draw_rect);
ObjectTypeDB::bind_method(_MD("draw_circle","pos","radius","color"),&CanvasItem::draw_circle);
ObjectTypeDB::bind_method(_MD("draw_texture","texture:Texture","pos"),&CanvasItem::draw_texture);
ObjectTypeDB::bind_method(_MD("draw_texture","texture:Texture","pos","modulate"),&CanvasItem::draw_texture,DEFVAL(Color(1,1,1,1)));
ObjectTypeDB::bind_method(_MD("draw_texture_rect","texture:Texture","rect","tile","modulate","transpose"),&CanvasItem::draw_texture_rect,DEFVAL(Color(1,1,1)),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("draw_texture_rect_region","texture:Texture","rect","src_rect","modulate","transpose"),&CanvasItem::draw_texture_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("draw_style_box","style_box:StyleBox","rect"),&CanvasItem::draw_style_box);

View File

@ -197,7 +197,7 @@ public:
void set_blend_mode(BlendMode p_blend_mode);
BlendMode get_blend_mode() const;
void set_light_mask(int p_light_mask);
virtual void set_light_mask(int p_light_mask);
int get_light_mask() const;
void set_opacity(float p_opacity);

View File

@ -257,10 +257,10 @@ void CollisionPolygon2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_polygon","polygon"),&CollisionPolygon2D::set_polygon);
ObjectTypeDB::bind_method(_MD("get_polygon"),&CollisionPolygon2D::get_polygon);
ObjectTypeDB::bind_method(_MD("set_build_mode"),&CollisionPolygon2D::set_build_mode);
ObjectTypeDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon2D::set_build_mode);
ObjectTypeDB::bind_method(_MD("get_build_mode"),&CollisionPolygon2D::get_build_mode);
ObjectTypeDB::bind_method(_MD("set_trigger"),&CollisionPolygon2D::set_trigger);
ObjectTypeDB::bind_method(_MD("set_trigger","trigger"),&CollisionPolygon2D::set_trigger);
ObjectTypeDB::bind_method(_MD("is_trigger"),&CollisionPolygon2D::is_trigger);
ObjectTypeDB::bind_method(_MD("_set_shape_range","shape_range"),&CollisionPolygon2D::_set_shape_range);

View File

@ -164,11 +164,17 @@ void PinJoint2D::_notification(int p_what) {
switch(p_what) {
case NOTIFICATION_DRAW: {
if (is_inside_tree() && get_tree()->is_editor_hint()) {
draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(0,-10),Point2(0,+10),Color(0.7,0.6,0.0,0.5),3);
if (!is_inside_tree())
break;
if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}
draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(0,-10),Point2(0,+10),Color(0.7,0.6,0.0,0.5),3);
} break;
}
@ -241,13 +247,17 @@ void GrooveJoint2D::_notification(int p_what) {
switch(p_what) {
case NOTIFICATION_DRAW: {
if (is_inside_tree() && get_tree()->is_editor_hint()) {
if (!is_inside_tree())
break;
draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(-10,initial_offset),Point2(+10,initial_offset),Color(0.8,0.8,0.9,0.5),5);
if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}
draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(-10,initial_offset),Point2(+10,initial_offset),Color(0.8,0.8,0.9,0.5),5);
} break;
}
}
@ -339,12 +349,17 @@ void DampedSpringJoint2D::_notification(int p_what) {
switch(p_what) {
case NOTIFICATION_DRAW: {
if (is_inside_tree() && get_tree()->is_editor_hint()) {
draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3);
if (!is_inside_tree())
break;
if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}
draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3);
draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3);
} break;
}
}

View File

@ -273,7 +273,7 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) {
if (navpoly.is_valid()) {
nav_id = navigation->navpoly_create(navpoly,get_relative_transform(navigation),this);
nav_id = navigation->navpoly_create(navpoly,get_relative_transform_to_parent(navigation),this);
}
}
@ -309,7 +309,7 @@ void NavigationPolygonInstance::_notification(int p_what) {
if (enabled && navpoly.is_valid()) {
nav_id = navigation->navpoly_create(navpoly,get_relative_transform(navigation),this);
nav_id = navigation->navpoly_create(navpoly,get_relative_transform_to_parent(navigation),this);
}
break;
}
@ -321,7 +321,7 @@ void NavigationPolygonInstance::_notification(int p_what) {
case NOTIFICATION_TRANSFORM_CHANGED: {
if (navigation && nav_id!=-1) {
navigation->navpoly_set_transform(nav_id,get_relative_transform(navigation));
navigation->navpoly_set_transform(nav_id,get_relative_transform_to_parent(navigation));
}
} break;
@ -409,7 +409,7 @@ void NavigationPolygonInstance::set_navigation_polygon(const Ref<NavigationPolyg
}
if (navigation && navpoly.is_valid() && enabled) {
nav_id = navigation->navpoly_create(navpoly,get_relative_transform(navigation),this);
nav_id = navigation->navpoly_create(navpoly,get_relative_transform_to_parent(navigation),this);
}
//update_gizmo();
_change_notify("navpoly");

View File

@ -333,17 +333,18 @@ int Node2D::get_z() const{
return z;
}
Matrix32 Node2D::get_relative_transform(const Node *p_parent) const {
Matrix32 Node2D::get_relative_transform_to_parent(const Node *p_parent) const {
if (p_parent==this)
return Matrix32();
Node2D *parent_2d = get_parent()->cast_to<Node2D>();
ERR_FAIL_COND_V(!parent_2d,Matrix32());
if (p_parent==parent_2d)
return get_transform();
else
return parent_2d->get_relative_transform(p_parent) * get_transform();
return parent_2d->get_relative_transform_to_parent(p_parent) * get_transform();
}
@ -394,9 +395,9 @@ void Node2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_z_as_relative","enable"),&Node2D::set_z_as_relative);
ObjectTypeDB::bind_method(_MD("is_z_relative"),&Node2D::is_z_relative);
ObjectTypeDB::bind_method(_MD("edit_set_pivot"),&Node2D::edit_set_pivot);
ObjectTypeDB::bind_method(_MD("edit_set_pivot","pivot"),&Node2D::edit_set_pivot);
ObjectTypeDB::bind_method(_MD("get_relative_transform"),&Node2D::get_relative_transform);
ObjectTypeDB::bind_method(_MD("get_relative_transform_to_parent","parent"),&Node2D::get_relative_transform_to_parent);
ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"transform/pos"),_SCS("set_pos"),_SCS("get_pos"));
ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"transform/rot",PROPERTY_HINT_RANGE,"-1440,1440,0.1"),_SCS("_set_rotd"),_SCS("_get_rotd"));

View File

@ -99,7 +99,7 @@ public:
void set_z_as_relative(bool p_enabled);
bool is_z_relative() const;
Matrix32 get_relative_transform(const Node *p_parent) const;
Matrix32 get_relative_transform_to_parent(const Node *p_parent) const;

View File

@ -193,7 +193,7 @@ void ParallaxBackground::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_limit_begin"),&ParallaxBackground::get_limit_begin);
ObjectTypeDB::bind_method(_MD("set_limit_end","ofs"),&ParallaxBackground::set_limit_end);
ObjectTypeDB::bind_method(_MD("get_limit_end"),&ParallaxBackground::get_limit_end);
ObjectTypeDB::bind_method(_MD("set_ignore_camera_zoom"), &ParallaxBackground::set_ignore_camera_zoom);
ObjectTypeDB::bind_method(_MD("set_ignore_camera_zoom","ignore"), &ParallaxBackground::set_ignore_camera_zoom);
ObjectTypeDB::bind_method(_MD("is_ignore_camera_zoom"), &ParallaxBackground::is_ignore_camera_zoom);

View File

@ -994,6 +994,15 @@ DVector<Vector2> Particles2D::get_emission_points() const{
return emission_points;
}
void Particles2D::reset() {
for(int i=0;i<particles.size();i++) {
particles[i].active=false;
}
time=0;
active_count=0;
}
void Particles2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_emitting","active"),&Particles2D::set_emitting);
@ -1057,6 +1066,7 @@ void Particles2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles2D::get_color_phase_pos);
ObjectTypeDB::bind_method(_MD("pre_process","time"),&Particles2D::pre_process);
ObjectTypeDB::bind_method(_MD("reset"),&Particles2D::reset);
ObjectTypeDB::bind_method(_MD("set_use_local_space","enable"),&Particles2D::set_use_local_space);
ObjectTypeDB::bind_method(_MD("is_using_local_space"),&Particles2D::is_using_local_space);

View File

@ -248,6 +248,7 @@ public:
DVector<Vector2> get_emission_points() const;
void pre_process(float p_delta);
void reset();
Particles2D();
};

View File

@ -31,9 +31,13 @@
void Path2D::_notification(int p_what) {
if (p_what==NOTIFICATION_DRAW && curve.is_valid() && is_inside_tree() && get_tree()->is_editor_hint()) {
if (p_what==NOTIFICATION_DRAW && curve.is_valid()) {
//draw the curve!!
if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_navigation_hint()) {
return;
}
for(int i=0;i<curve->get_point_count();i++) {
Vector2 prev_p=curve->get_point_pos(i);

View File

@ -118,7 +118,7 @@ void TileMap::_update_quadrant_transform() {
Matrix32 nav_rel;
if (navigation)
nav_rel = get_relative_transform(navigation);
nav_rel = get_relative_transform_to_parent(navigation);
for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) {
@ -261,7 +261,7 @@ void TileMap::_update_dirty_quadrants() {
Vector2 tcenter = cell_size/2;
Matrix32 nav_rel;
if (navigation)
nav_rel = get_relative_transform(navigation);
nav_rel = get_relative_transform_to_parent(navigation);
Vector2 qofs;
@ -333,6 +333,8 @@ void TileMap::_update_dirty_quadrants() {
Matrix32 xform;
xform.set_origin( q.pos );
vs->canvas_item_set_transform( canvas_item, xform );
vs->canvas_item_set_light_mask(canvas_item,get_light_mask());
q.canvas_items.push_back(canvas_item);
if (debug_shapes) {
@ -1105,7 +1107,16 @@ int TileMap::get_occluder_light_mask() const{
return occluder_light_mask;
}
void TileMap::set_light_mask(int p_light_mask) {
CanvasItem::set_light_mask(p_light_mask);
for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) {
for (List<RID>::Element *F=E->get().canvas_items.front();F;F=F->next()) {
VisualServer::get_singleton()->canvas_item_set_light_mask(F->get(),get_light_mask());
}
}
}
void TileMap::_bind_methods() {

View File

@ -253,6 +253,8 @@ public:
void set_occluder_light_mask(int p_mask);
int get_occluder_light_mask() const;
virtual void set_light_mask(int p_light_mask);
void clear();
TileMap();

View File

@ -579,7 +579,7 @@ void Area::_bind_methods() {
ADD_SIGNAL( MethodInfo("area_enter",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area")));
ADD_SIGNAL( MethodInfo("area_exit",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area")));
ADD_PROPERTY( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Replace"),_SCS("set_space_override_mode"),_SCS("get_space_override_mode"));
ADD_PROPERTY( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Combine-Replace,Replace,Replace-Combine"),_SCS("set_space_override_mode"),_SCS("get_space_override_mode"));
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"gravity_point"),_SCS("set_gravity_is_point"),_SCS("is_gravity_a_point"));
ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity_distance_scale", PROPERTY_HINT_RANGE,"0,1024,0.001"),_SCS("set_gravity_distance_scale"),_SCS("get_gravity_distance_scale"));
ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"gravity_vec"),_SCS("set_gravity_vector"),_SCS("get_gravity_vector"));

View File

@ -40,7 +40,9 @@ public:
enum SpaceOverride {
SPACE_OVERRIDE_DISABLED,
SPACE_OVERRIDE_COMBINE,
SPACE_OVERRIDE_REPLACE
SPACE_OVERRIDE_COMBINE_REPLACE,
SPACE_OVERRIDE_REPLACE,
SPACE_OVERRIDE_REPLACE_COMBINE
};
private:

View File

@ -402,7 +402,7 @@ int CollisionShape::_get_update_shape_index() const{
void CollisionShape::_bind_methods() {
//not sure if this should do anything
ObjectTypeDB::bind_method(_MD("resource_changed"),&CollisionShape::resource_changed);
ObjectTypeDB::bind_method(_MD("resource_changed","resource"),&CollisionShape::resource_changed);
ObjectTypeDB::bind_method(_MD("set_shape","shape"),&CollisionShape::set_shape);
ObjectTypeDB::bind_method(_MD("get_shape"),&CollisionShape::get_shape);
ObjectTypeDB::bind_method(_MD("_add_to_collision_object"),&CollisionShape::_add_to_collision_object);

View File

@ -236,7 +236,7 @@ void CollisionPolygon::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_add_to_collision_object"),&CollisionPolygon::_add_to_collision_object);
ObjectTypeDB::bind_method(_MD("set_build_mode"),&CollisionPolygon::set_build_mode);
ObjectTypeDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon::set_build_mode);
ObjectTypeDB::bind_method(_MD("get_build_mode"),&CollisionPolygon::get_build_mode);
ObjectTypeDB::bind_method(_MD("set_depth","depth"),&CollisionPolygon::set_depth);

View File

@ -487,9 +487,9 @@ bool Light::is_editor_only() const{
void Light::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_parameter","variable","value"), &Light::set_parameter );
ObjectTypeDB::bind_method(_MD("get_parameter"), &Light::get_parameter );
ObjectTypeDB::bind_method(_MD("get_parameter","variable"), &Light::get_parameter );
ObjectTypeDB::bind_method(_MD("set_color","color","value"), &Light::set_color );
ObjectTypeDB::bind_method(_MD("get_color"), &Light::get_color );
ObjectTypeDB::bind_method(_MD("get_color","color"), &Light::get_color );
ObjectTypeDB::bind_method(_MD("set_project_shadows","enable"), &Light::set_project_shadows );
ObjectTypeDB::bind_method(_MD("has_project_shadows"), &Light::has_project_shadows );
ObjectTypeDB::bind_method(_MD("set_projector","projector:Texture"), &Light::set_projector );

View File

@ -422,14 +422,14 @@ void Particles::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_variable","variable","value"),&Particles::set_variable);
ObjectTypeDB::bind_method(_MD("get_variable","variable"),&Particles::get_variable);
ObjectTypeDB::bind_method(_MD("set_randomness","variable","randomness"),&Particles::set_randomness);
ObjectTypeDB::bind_method(_MD("get_randomness"),&Particles::get_randomness);
ObjectTypeDB::bind_method(_MD("get_randomness","variable"),&Particles::get_randomness);
ObjectTypeDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles::set_color_phase_pos);
ObjectTypeDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles::get_color_phase_pos);
ObjectTypeDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles::set_color_phase_color);
ObjectTypeDB::bind_method(_MD("get_color_phase_color","phase"),&Particles::get_color_phase_color);
ObjectTypeDB::bind_method(_MD("set_material","material:Material"),&Particles::set_material);
ObjectTypeDB::bind_method(_MD("get_material:Material"),&Particles::get_material);
ObjectTypeDB::bind_method(_MD("set_emit_timeout"),&Particles::set_emit_timeout);
ObjectTypeDB::bind_method(_MD("set_emit_timeout","timeout"),&Particles::set_emit_timeout);
ObjectTypeDB::bind_method(_MD("get_emit_timeout"),&Particles::get_emit_timeout);
ObjectTypeDB::bind_method(_MD("set_height_from_velocity","enable"),&Particles::set_height_from_velocity);
ObjectTypeDB::bind_method(_MD("has_height_from_velocity"),&Particles::has_height_from_velocity);

View File

@ -332,7 +332,7 @@ void SpatialStreamPlayer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_stream","stream:Stream"),&SpatialStreamPlayer::set_stream);
ObjectTypeDB::bind_method(_MD("get_stream:Stream"),&SpatialStreamPlayer::get_stream);
ObjectTypeDB::bind_method(_MD("play"),&SpatialStreamPlayer::play,DEFVAL(0));
ObjectTypeDB::bind_method(_MD("play","offset"),&SpatialStreamPlayer::play,DEFVAL(0));
ObjectTypeDB::bind_method(_MD("stop"),&SpatialStreamPlayer::stop);
ObjectTypeDB::bind_method(_MD("is_playing"),&SpatialStreamPlayer::is_playing);

View File

@ -312,16 +312,14 @@ void EventPlayer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_pos"),&EventPlayer::get_pos);
ObjectTypeDB::bind_method(_MD("seek_pos","time"),&EventPlayer::seek_pos);
ObjectTypeDB::bind_method(_MD("get_length"),&EventPlayer::get_length);
ObjectTypeDB::bind_method(_MD("set_autoplay","enabled"),&EventPlayer::set_autoplay);
ObjectTypeDB::bind_method(_MD("has_autoplay"),&EventPlayer::has_autoplay);
ObjectTypeDB::bind_method(_MD("set_channel_volume","idx","channel_volume"),&EventPlayer::set_channel_volume);
ObjectTypeDB::bind_method(_MD("get_channel_volume""idx"),&EventPlayer::get_channel_volume);
ObjectTypeDB::bind_method(_MD("get_length"),&EventPlayer::get_length);
ObjectTypeDB::bind_method(_MD("get_channel_last_note_time"),&EventPlayer::get_channel_last_note_time);
ObjectTypeDB::bind_method(_MD("get_channel_volume","idx"),&EventPlayer::get_channel_volume);
ObjectTypeDB::bind_method(_MD("get_channel_last_note_time","idx"),&EventPlayer::get_channel_last_note_time);
ObjectTypeDB::bind_method(_MD("_set_play","play"),&EventPlayer::_set_play);
ObjectTypeDB::bind_method(_MD("_get_play"),&EventPlayer::_get_play);

View File

@ -333,7 +333,7 @@ void StreamPlayer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_stream","stream:Stream"),&StreamPlayer::set_stream);
ObjectTypeDB::bind_method(_MD("get_stream:Stream"),&StreamPlayer::get_stream);
ObjectTypeDB::bind_method(_MD("play"),&StreamPlayer::play,DEFVAL(0));
ObjectTypeDB::bind_method(_MD("play","offset"),&StreamPlayer::play,DEFVAL(0));
ObjectTypeDB::bind_method(_MD("stop"),&StreamPlayer::stop);
ObjectTypeDB::bind_method(_MD("is_playing"),&StreamPlayer::is_playing);

View File

@ -916,6 +916,7 @@ void Control::_window_show_tooltip() {
void Control::_window_call_input(Control *p_control,const InputEvent& p_input) {
_block();
while(p_control) {
@ -932,6 +933,9 @@ void Control::_window_call_input(Control *p_control,const InputEvent& p_input) {
break;
p_control=p_control->data.parent;
}
_unblock();
}
void Control::_window_input_event(InputEvent p_event) {
@ -1067,6 +1071,7 @@ void Control::_window_input_event(InputEvent p_event) {
Size2 pos = mpos;
pos = window->focus_inv_xform.xform(pos);
window->mouse_over->drop_data(pos,window->drag_data);
window->drag_data=Variant();
//change mouse accordingly

View File

@ -49,7 +49,7 @@ void FileDialog::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
refresh->set_icon(get_icon("Reload","EditorIcons"));
refresh->set_icon(get_icon("reload"));
}
if (p_what==NOTIFICATION_DRAW) {
@ -650,7 +650,7 @@ void FileDialog::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_vbox:VBoxContainer"),&FileDialog::get_vbox);
ObjectTypeDB::bind_method(_MD("set_access","access"),&FileDialog::set_access);
ObjectTypeDB::bind_method(_MD("get_access"),&FileDialog::get_access);
ObjectTypeDB::bind_method(_MD("set_show_hidden_files"),&FileDialog::set_show_hidden_files);
ObjectTypeDB::bind_method(_MD("set_show_hidden_files","show"),&FileDialog::set_show_hidden_files);
ObjectTypeDB::bind_method(_MD("is_showing_hidden_files"),&FileDialog::is_showing_hidden_files);
ObjectTypeDB::bind_method(_MD("_select_drive"),&FileDialog::_select_drive);
ObjectTypeDB::bind_method(_MD("_make_dir"),&FileDialog::_make_dir);

View File

@ -304,7 +304,7 @@ void OptionButton::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_item_count"),&OptionButton::get_item_count);
ObjectTypeDB::bind_method(_MD("add_separator"),&OptionButton::add_separator);
ObjectTypeDB::bind_method(_MD("clear"),&OptionButton::clear);
ObjectTypeDB::bind_method(_MD("select"),&OptionButton::select);
ObjectTypeDB::bind_method(_MD("select","idx"),&OptionButton::select);
ObjectTypeDB::bind_method(_MD("get_selected"),&OptionButton::get_selected);
ObjectTypeDB::bind_method(_MD("get_selected_ID"),&OptionButton::get_selected_ID);
ObjectTypeDB::bind_method(_MD("get_selected_metadata"),&OptionButton::get_selected_metadata);

View File

@ -45,6 +45,16 @@ void Popup::_notification(int p_what) {
emit_signal("popup_hide");
}
}
if (p_what==NOTIFICATION_ENTER_TREE) {
//small helper to make editing of these easier in editor
#ifdef TOOLS_ENABLED
if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) {
set_as_toplevel(false);
}
#endif
}
}
void Popup::_fix_size() {

View File

@ -898,7 +898,7 @@ void PopupMenu::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_item_icon","idx","icon"),&PopupMenu::set_item_icon);
ObjectTypeDB::bind_method(_MD("set_item_accelerator","idx","accel"),&PopupMenu::set_item_accelerator);
ObjectTypeDB::bind_method(_MD("set_item_metadata","idx","metadata"),&PopupMenu::set_item_metadata);
ObjectTypeDB::bind_method(_MD("set_item_checked","idx"),&PopupMenu::set_item_checked);
ObjectTypeDB::bind_method(_MD("set_item_checked","idx","checked"),&PopupMenu::set_item_checked);
ObjectTypeDB::bind_method(_MD("set_item_disabled","idx","disabled"),&PopupMenu::set_item_disabled);
ObjectTypeDB::bind_method(_MD("set_item_submenu","idx","submenu"),&PopupMenu::set_item_submenu);
ObjectTypeDB::bind_method(_MD("set_item_as_separator","idx","enable"),&PopupMenu::set_item_as_separator);

View File

@ -216,11 +216,10 @@ void Range::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_val"),&Range::get_val);
ObjectTypeDB::bind_method(_MD("get_value"),&Range::get_val);
ObjectTypeDB::bind_method(_MD("get_min"),&Range::get_min);
ObjectTypeDB::bind_method(_MD("get_max"),&Range::get_max);
ObjectTypeDB::bind_method(_MD("get_step"),&Range::get_step);
ObjectTypeDB::bind_method(_MD("get_page"),&Range::get_page);
ObjectTypeDB::bind_method(_MD("get_unit_value"),&Range::get_unit_value);
ObjectTypeDB::bind_method(_MD("get_rounded_values"),&Range::get_rounded_values);
ObjectTypeDB::bind_method(_MD("get_max"),&Range::get_max);
ObjectTypeDB::bind_method(_MD("get_step"),&Range::get_step);
ObjectTypeDB::bind_method(_MD("get_page"),&Range::get_page);
ObjectTypeDB::bind_method(_MD("get_unit_value"),&Range::get_unit_value);
ObjectTypeDB::bind_method(_MD("set_val","value"),&Range::set_val);
ObjectTypeDB::bind_method(_MD("set_value","value"),&Range::set_val);
ObjectTypeDB::bind_method(_MD("set_min","minimum"),&Range::set_min);
@ -228,7 +227,8 @@ void Range::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_step","step"),&Range::set_step);
ObjectTypeDB::bind_method(_MD("set_page","pagesize"),&Range::set_page);
ObjectTypeDB::bind_method(_MD("set_unit_value","value"),&Range::set_unit_value);
ObjectTypeDB::bind_method(_MD("set_rounded_values"),&Range::set_rounded_values);
ObjectTypeDB::bind_method(_MD("set_rounded_values","enabled"),&Range::set_rounded_values);
ObjectTypeDB::bind_method(_MD("is_rounded_values"),&Range::is_rounded_values);
ObjectTypeDB::bind_method(_MD("set_exp_unit_value","enabled"),&Range::set_exp_unit_value);
ObjectTypeDB::bind_method(_MD("is_unit_value_exp"),&Range::is_unit_value_exp);
@ -244,16 +244,18 @@ void Range::_bind_methods() {
ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/page" ), _SCS("set_page"), _SCS("get_page") );
ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/value" ), _SCS("set_val"), _SCS("get_val") );
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "range/exp_edit" ), _SCS("set_exp_unit_value"), _SCS("is_unit_value_exp") );
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "rounded_values" ), _SCS("set_rounded_values"), _SCS("get_rounded_values") );
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "range/rounded" ), _SCS("set_rounded_values"), _SCS("is_rounded_values") );
}
void Range::set_rounded_values(bool p){
_rounded_values = p;
void Range::set_rounded_values(bool p_enable) {
_rounded_values = p_enable;
}
bool Range::get_rounded_values() const{
return _rounded_values;
bool Range::is_rounded_values() const {
return _rounded_values;
}
void Range::set_exp_unit_value(bool p_enable) {

View File

@ -72,22 +72,23 @@ public:
void set_step(double p_step);
void set_page(double p_page);
void set_unit_value(double p_value);
void set_rounded_values(bool);
double get_val() const;
double get_min() const;
double get_max() const;
double get_step() const;
double get_page() const;
double get_unit_value() const;
bool get_rounded_values() const;
void set_rounded_values(bool p_enable);
bool is_rounded_values() const;
void set_exp_unit_value(bool p_enable);
bool is_unit_value_exp() const;
void share(Range *p_range);
void unshare();
Range();
~Range();

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,7 @@ public:
enum ItemType {
ITEM_MAIN,
ITEM_FRAME,
ITEM_TEXT,
ITEM_IMAGE,
ITEM_NEWLINE,
@ -64,6 +64,7 @@ public:
ITEM_ALIGN,
ITEM_INDENT,
ITEM_LIST,
ITEM_TABLE,
ITEM_META
};
@ -72,6 +73,24 @@ protected:
static void _bind_methods();
private:
struct Item;
struct Line {
Item *from;
Vector<int> offset_caches;
Vector<int> height_caches;
Vector<int> space_caches;
int height_cache;
int height_accum_cache;
int char_count;
int minimum_width;
Line() { from=NULL; char_count=0; }
};
struct Item {
int index;
@ -79,18 +98,26 @@ private:
ItemType type;
List<Item*> subitems;
List<Item*>::Element *E;
int line;
void _clear_children() { while (subitems.size()) { memdelete(subitems.front()->get()); subitems.pop_front(); } }
Item() { parent=NULL; E=NULL; }
Item() { parent=NULL; E=NULL; line=0;}
virtual ~Item() { _clear_children(); }
};
struct ItemMain : public Item {
struct ItemFrame : public Item{
ItemMain() { type=ITEM_MAIN; }
int parent_line;
bool cell;
Vector<Line> lines;
int first_invalid_line;
ItemFrame *parent_frame;
ItemFrame() { type=ITEM_FRAME; parent_frame=NULL; cell=false; parent_line=0; }
};
struct ItemText : public Item {
String text;
@ -150,11 +177,28 @@ private:
ItemNewline() { type=ITEM_NEWLINE; }
};
ItemMain *main;
struct ItemTable : public Item{
struct Column {
bool expand;
int expand_ratio;
int min_width;
int width;
};
Vector<Column> columns;
int total_width;
ItemTable() { type=ITEM_TABLE; }
};
ItemFrame *main;
Item *current;
ItemFrame *current_frame;
VScrollBar *vscroll;
bool scroll_visible;
bool scroll_follow;
bool scroll_following;
@ -163,34 +207,16 @@ private:
bool updating_scroll;
int current_idx;
struct Line {
Item *from;
Vector<int> offset_caches;
Vector<int> height_caches;
Vector<int> space_caches;
int height_cache;
int height_accum_cache;
int char_count;
Line() { from=NULL; char_count=0; }
};
Vector<Line> lines;
int first_invalid_line;
int tab_size;
bool underline_meta;
Align default_align;
void _invalidate_current_line();
void _validate_line_caches();
void _invalidate_current_line(ItemFrame *p_frame);
void _validate_line_caches(ItemFrame *p_frame);
void _add_item(Item *p_item, bool p_enter=false);
void _add_item(Item *p_item, bool p_enter=false,bool p_ensure_newline=false);
@ -227,8 +253,8 @@ private:
int visible_characters;
void _process_line(int &y, int p_width, int p_line, ProcessMode p_mode,const Ref<Font> &p_base_font,const Color &p_base_color,const Point2i& p_click_pos=Point2i(),Item **r_click_item=NULL,int *r_click_char=NULL,bool *r_outside=NULL,int p_char_count=0);
void _find_click(const Point2i& p_click,Item **r_click_item=NULL,int *r_click_char=NULL,bool *r_outside=NULL);
void _process_line(ItemFrame *p_frame,const Vector2& p_ofs,int &y, int p_width, int p_line, ProcessMode p_mode,const Ref<Font> &p_base_font,const Color &p_base_color,const Point2i& p_click_pos=Point2i(),Item **r_click_item=NULL,int *r_click_char=NULL,bool *r_outside=NULL,int p_char_count=0);
void _find_click(ItemFrame *p_frame, const Point2i& p_click,Item **r_click_item=NULL,int *r_click_char=NULL,bool *r_outside=NULL);
Ref<Font> _find_font(Item *p_item);
@ -242,12 +268,12 @@ private:
void _scroll_changed(double);
void _input_event(InputEvent p_event);
Item *_get_next_item(Item* p_item);
Item *_get_next_item(Item* p_item, bool p_free=false);
bool use_bbcode;
String bbcode;
void _update_all_lines();
protected:
void _notification(int p_what);
@ -264,6 +290,10 @@ public:
void push_indent(int p_level);
void push_list(ListType p_list);
void push_meta(const Variant& p_data);
void push_table(int p_columns);
void set_table_column_expand(int p_column, bool p_expand, int p_ratio=1);
int get_current_table_column() const;
void push_cell();
void pop();
void clear();

View File

@ -3742,10 +3742,10 @@ void TextEdit::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_line_count"),&TextEdit::get_line_count);
ObjectTypeDB::bind_method(_MD("get_text"),&TextEdit::get_text);
ObjectTypeDB::bind_method(_MD("get_line"),&TextEdit::get_line);
ObjectTypeDB::bind_method(_MD("get_line","line"),&TextEdit::get_line);
ObjectTypeDB::bind_method(_MD("cursor_set_column","column"),&TextEdit::cursor_set_column);
ObjectTypeDB::bind_method(_MD("cursor_set_line","line"),&TextEdit::cursor_set_line);
ObjectTypeDB::bind_method(_MD("cursor_set_column","column","adjust_viewport"),&TextEdit::cursor_set_column,DEFVAL(false));
ObjectTypeDB::bind_method(_MD("cursor_set_line","line","adjust_viewport"),&TextEdit::cursor_set_line,DEFVAL(false));
ObjectTypeDB::bind_method(_MD("cursor_get_column"),&TextEdit::cursor_get_column);
ObjectTypeDB::bind_method(_MD("cursor_get_line"),&TextEdit::cursor_get_line);

View File

@ -42,22 +42,22 @@ Size2 TextureButton::get_minimum_size() const {
else
rscale= hover->get_size();
} else
rscale= pressed->get_size()*scale;
rscale=pressed->get_size();
} else
rscale= normal->get_size();
return rscale*scale;
return rscale*scale.abs();
}
bool TextureButton::has_point(const Point2& p_point) const {
if (scale[0] <= 0 || scale[1] <= 0) {
if (scale[0] == 0 || scale[1] == 0) {
return false;
}
Point2 ppos = p_point/scale;
Point2 ppos = p_point/scale.abs();
if (click_mask.is_valid()) {

View File

@ -672,7 +672,7 @@ void TreeItem::_bind_methods() {
ObjectTypeDB::bind_method(_MD("clear_custom_bg_color","column"),&TreeItem::clear_custom_bg_color);
ObjectTypeDB::bind_method(_MD("get_custom_bg_color","column"),&TreeItem::get_custom_bg_color);
ObjectTypeDB::bind_method(_MD("add_button","column","button:Texture"),&TreeItem::add_button);
ObjectTypeDB::bind_method(_MD("add_button","column","button:Texture","button_idx"),&TreeItem::add_button);
ObjectTypeDB::bind_method(_MD("get_button_count","column"),&TreeItem::get_button_count);
ObjectTypeDB::bind_method(_MD("get_button:Texture","column","button_idx"),&TreeItem::get_button);
ObjectTypeDB::bind_method(_MD("erase_button","column","button_idx"),&TreeItem::erase_button);
@ -3193,11 +3193,11 @@ void Tree::_bind_methods() {
ObjectTypeDB::bind_method(_MD("create_item:TreeItem","parent:TreeItem"),&Tree::_create_item,DEFVAL((Object*)NULL));
ObjectTypeDB::bind_method(_MD("get_root:TreeItem"),&Tree::get_root);
ObjectTypeDB::bind_method(_MD("set_column_min_width"),&Tree::set_column_min_width);
ObjectTypeDB::bind_method(_MD("set_column_expand"),&Tree::set_column_expand);
ObjectTypeDB::bind_method(_MD("get_column_width"),&Tree::get_column_width);
ObjectTypeDB::bind_method(_MD("set_column_min_width","column","min_width"),&Tree::set_column_min_width);
ObjectTypeDB::bind_method(_MD("set_column_expand","column","expand"),&Tree::set_column_expand);
ObjectTypeDB::bind_method(_MD("get_column_width","column"),&Tree::get_column_width);
ObjectTypeDB::bind_method(_MD("set_hide_root"),&Tree::set_hide_root);
ObjectTypeDB::bind_method(_MD("set_hide_root","enable"),&Tree::set_hide_root);
ObjectTypeDB::bind_method(_MD("get_next_selected:TreeItem","from:TreeItem"),&Tree::_get_next_selected);
ObjectTypeDB::bind_method(_MD("get_selected:TreeItem"),&Tree::get_selected);
ObjectTypeDB::bind_method(_MD("get_selected_column"),&Tree::get_selected_column);

View File

@ -271,6 +271,7 @@ void VideoPlayer::set_paused(bool p_paused) {
playback->set_paused(p_paused);
set_process(!p_paused);
};
last_audio_time = 0;
};
bool VideoPlayer::is_paused() const {

View File

@ -802,6 +802,7 @@ void Node::remove_child(Node *p_child) {
}
ERR_FAIL_COND( idx==-1 );
//ERR_FAIL_COND( p_child->data.blocked > 0 );
//if (data.scene) { does not matter
@ -856,7 +857,10 @@ Node *Node::_get_child_by_name(const StringName& p_name) const {
Node *Node::_get_node(const NodePath& p_path) const {
ERR_FAIL_COND_V( !data.inside_tree && p_path.is_absolute(), NULL );
if (!data.inside_tree && p_path.is_absolute()) {
ERR_EXPLAIN("Can't use get_node() with absolute paths from outside the active scene tree.");
ERR_FAIL_V(NULL);
}
Node *current=NULL;
Node *root=NULL;
@ -2001,7 +2005,7 @@ void Node::_bind_methods() {
ObjectTypeDB::bind_method(_MD("is_greater_than","node:Node"),&Node::is_greater_than);
ObjectTypeDB::bind_method(_MD("get_path"),&Node::get_path);
ObjectTypeDB::bind_method(_MD("get_path_to","node:Node"),&Node::get_path_to);
ObjectTypeDB::bind_method(_MD("add_to_group","group"),&Node::add_to_group,DEFVAL(false));
ObjectTypeDB::bind_method(_MD("add_to_group","group","persistent"),&Node::add_to_group,DEFVAL(false));
ObjectTypeDB::bind_method(_MD("remove_from_group","group"),&Node::remove_from_group);
ObjectTypeDB::bind_method(_MD("is_in_group","group"),&Node::is_in_group);
ObjectTypeDB::bind_method(_MD("move_child","child_node:Node","to_pos"),&Node::move_child);

View File

@ -1586,7 +1586,7 @@ void SceneTree::_bind_methods() {
ObjectTypeDB::bind_method(_MD("notify_group","call_flags","group","notification"),&SceneTree::notify_group);
ObjectTypeDB::bind_method(_MD("set_group","call_flags","group","property","value"),&SceneTree::set_group);
ObjectTypeDB::bind_method(_MD("get_nodes_in_group"),&SceneTree::_get_nodes_in_group);
ObjectTypeDB::bind_method(_MD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group);
ObjectTypeDB::bind_method(_MD("get_root:Viewport"),&SceneTree::get_root);

View File

@ -1456,7 +1456,7 @@ void Viewport::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_as_audio_listener_2d","enable"), &Viewport::set_as_audio_listener_2d);
ObjectTypeDB::bind_method(_MD("is_audio_listener_2d","enable"), &Viewport::is_audio_listener_2d);
ObjectTypeDB::bind_method(_MD("set_render_target_to_screen_rect"), &Viewport::set_render_target_to_screen_rect);
ObjectTypeDB::bind_method(_MD("set_render_target_to_screen_rect","rect"), &Viewport::set_render_target_to_screen_rect);
ObjectTypeDB::bind_method(_MD("get_mouse_pos"), &Viewport::get_mouse_pos);
ObjectTypeDB::bind_method(_MD("warp_mouse","to_pos"), &Viewport::warp_mouse);

View File

@ -543,7 +543,11 @@ void make_default_theme() {
t->set_constant("close_v_ofs","WindowDialog", 20 );
t->set_constant("titlebar_height","WindowDialog", 18 );
t->set_constant("title_height","WindowDialog", 20 );
// File Dialog
t->set_icon("reload","FileDialog",make_icon( icon_reload_png ));
// Popup
@ -797,6 +801,8 @@ void make_default_theme() {
t->set_color("selection_color","RichTextLabel", Color(0.1,0.1,1,0.8) );
t->set_constant("line_separation","RichTextLabel", 1 );
t->set_constant("table_hseparation","RichTextLabel", 3 );
t->set_constant("table_vseparation","RichTextLabel", 3 );

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

View File

@ -194,6 +194,11 @@ static const unsigned char icon_play_png[]={
};
static const unsigned char icon_reload_png[]={
0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x94,0x49,0x44,0x41,0x54,0x38,0x8d,0x85,0xd3,0xbd,0x6a,0x55,0x41,0x14,0xc5,0xf1,0xdf,0xb9,0x1f,0x91,0x20,0x5a,0x89,0xd8,0x8,0x4b,0xd0,0x42,0x1f,0xc0,0x42,0x4,0x4b,0xb,0x1b,0x9b,0xbc,0x80,0x58,0x45,0xc5,0x56,0x51,0x50,0x6b,0x21,0x9d,0xa5,0x6f,0x20,0x88,0x20,0xa8,0xad,0xa8,0xa0,0x2f,0x60,0x21,0xe8,0x4e,0x63,0xa9,0x85,0x22,0x31,0x37,0x37,0xb1,0xb8,0x73,0xc2,0xf1,0x23,0x38,0xd5,0x9c,0x61,0xaf,0x3d,0x7b,0xfe,0x6b,0x9d,0xce,0x1e,0xab,0xaa,0xc6,0x18,0xa1,0xc3,0xe,0xb6,0x92,0xec,0xfc,0x59,0x37,0xda,0x43,0x8,0xc7,0x70,0x9,0x37,0xb0,0xd2,0xd7,0x56,0x55,0x57,0x55,0xbb,0xf5,0xdd,0x1f,0xe2,0xae,0x9,0x9f,0xe2,0x24,0xb6,0x6,0x97,0x8c,0xf0,0x32,0xc9,0xb9,0xaa,0x9a,0x62,0x96,0x64,0xd1,0xa0,0x75,0x1c,0xe3,0x2,0x9e,0x34,0xc1,0x2b,0x3c,0xc6,0x3a,0x8e,0xe3,0x76,0xab,0x59,0xc6,0x41,0xfc,0xc0,0xbc,0x6f,0x30,0xc6,0x61,0x7c,0x6e,0xe2,0x53,0x49,0xde,0x57,0xd5,0x12,0xb6,0xd1,0x25,0x99,0x55,0xd5,0x3,0xac,0x36,0x1e,0xd3,0x5d,0x6,0x49,0xe6,0x78,0xd4,0xc4,0xe7,0xf1,0xa9,0x9d,0x6f,0x26,0xd9,0xc2,0xac,0x7d,0x5f,0xc1,0x73,0xcc,0xab,0xea,0x7a,0x55,0x4d,0x7b,0x30,0x37,0x71,0x6,0xdf,0x70,0x34,0xc9,0xc6,0x90,0x4d,0x92,0x21,0xa3,0x15,0xec,0xc3,0x6a,0x92,0x59,0x57,0x55,0x13,0x4c,0xdb,0x9b,0x36,0x92,0x2c,0x57,0xd5,0xb8,0x4d,0xf5,0xcf,0x55,0x55,0x33,0x4c,0x92,0x74,0xa3,0x46,0x7a,0x8e,0x13,0x38,0xd8,0x1a,0xfe,0x53,0x3c,0xb0,0xef,0x4b,0xbf,0x19,0xb5,0xf1,0x36,0xf1,0x31,0xc9,0xcc,0x22,0x34,0xff,0x5b,0x87,0xf1,0x95,0xbf,0x73,0xb0,0x86,0x5b,0xf8,0x89,0xed,0xfe,0xed,0x83,0xdb,0x97,0x70,0x19,0x6b,0x78,0x88,0xab,0xbd,0x8d,0x13,0x9c,0xc6,0x6b,0xac,0x27,0x49,0xb3,0x70,0x96,0x64,0xa7,0xc1,0x9b,0xe0,0x90,0x66,0x75,0x92,0xae,0xaa,0xba,0xde,0xc6,0xad,0x24,0x6f,0xf0,0xc,0x47,0xaa,0xea,0x3b,0x2e,0xe,0xb2,0xbf,0xdf,0x22,0xd2,0x7d,0x4e,0xce,0xb7,0x34,0xee,0xec,0x26,0x71,0x60,0xd5,0x5d,0xdc,0xb1,0x0,0xd9,0xff,0x17,0x2c,0xb2,0x30,0xc5,0x59,0xbc,0xee,0xeb,0xfb,0x9,0x86,0x84,0xef,0xe1,0x0,0xee,0xe3,0x2d,0x3e,0xe0,0x5,0xae,0x25,0xe9,0xf0,0x6e,0xc8,0xe6,0x37,0x88,0x3,0x58,0x1d,0xc6,0x2d,0x85,0xfd,0xf9,0x92,0x85,0x5b,0x86,0xd,0x7e,0x1,0x82,0x4c,0xaa,0x69,0x77,0x3c,0x4b,0x15,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
};
static const unsigned char icon_stop_png[]={
0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xde,0x9,0xf,0x14,0x33,0x24,0x62,0xd4,0x2f,0x95,0x0,0x0,0x0,0x39,0x49,0x44,0x41,0x54,0x38,0x8d,0x63,0x60,0xa0,0x6,0xf8,0xf0,0xe1,0x3,0x33,0xb9,0x7a,0x18,0x61,0x2,0xf,0x1f,0x3e,0xfc,0x4f,0x8a,0x1,0xf2,0xf2,0xf2,0x8c,0xc,0xc,0xc,0xc,0x4c,0xa4,0xda,0x8c,0xe,0x46,0xd,0x18,0x35,0x60,0x70,0x18,0xc0,0xc0,0xc0,0x40,0x59,0x66,0xa2,0x18,0x0,0x0,0x2a,0xc7,0xf,0x64,0xd5,0xe,0x11,0x85,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
};

View File

@ -517,7 +517,7 @@ void Font::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_descent"),&Font::get_descent);
ObjectTypeDB::bind_method(_MD("add_kerning_pair","char_a","char_b","kerning"),&Font::add_kerning_pair);
ObjectTypeDB::bind_method(_MD("get_kerning_pair"),&Font::get_kerning_pair);
ObjectTypeDB::bind_method(_MD("get_kerning_pair","char_a","char_b"),&Font::get_kerning_pair);
ObjectTypeDB::bind_method(_MD("add_texture","texture:Texture"),&Font::add_texture);
ObjectTypeDB::bind_method(_MD("add_char","character","texture","rect","align","advance"),&Font::add_char,DEFVAL(Point2()),DEFVAL(-1));

View File

@ -971,7 +971,7 @@ void Mesh::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_morph_target_mode","mode"),&Mesh::set_morph_target_mode);
ObjectTypeDB::bind_method(_MD("get_morph_target_mode"),&Mesh::get_morph_target_mode);
ObjectTypeDB::bind_method(_MD("add_surface","primitive","arrays","morph_arrays"),&Mesh::add_surface,DEFVAL(Array()));
ObjectTypeDB::bind_method(_MD("add_surface","primitive","arrays","morph_arrays","alphasort"),&Mesh::add_surface,DEFVAL(Array()),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("get_surface_count"),&Mesh::get_surface_count);
ObjectTypeDB::bind_method(_MD("surface_remove","surf_idx"),&Mesh::surface_remove);
ObjectTypeDB::bind_method(_MD("surface_get_array_len","surf_idx"),&Mesh::surface_get_array_len);

View File

@ -224,13 +224,13 @@ void MultiMesh::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_mesh","mesh:Mesh"),&MultiMesh::set_mesh);
ObjectTypeDB::bind_method(_MD("get_mesh:Mesh"),&MultiMesh::get_mesh);
ObjectTypeDB::bind_method(_MD("set_instance_count"),&MultiMesh::set_instance_count);
ObjectTypeDB::bind_method(_MD("set_instance_count","count"),&MultiMesh::set_instance_count);
ObjectTypeDB::bind_method(_MD("get_instance_count"),&MultiMesh::get_instance_count);
ObjectTypeDB::bind_method(_MD("set_instance_transform"),&MultiMesh::set_instance_transform);
ObjectTypeDB::bind_method(_MD("get_instance_transform"),&MultiMesh::get_instance_transform);
ObjectTypeDB::bind_method(_MD("set_instance_color"),&MultiMesh::set_instance_color);
ObjectTypeDB::bind_method(_MD("get_instance_color"),&MultiMesh::get_instance_color);
ObjectTypeDB::bind_method(_MD("set_aabb"),&MultiMesh::set_aabb);
ObjectTypeDB::bind_method(_MD("set_instance_transform","instance","transform"),&MultiMesh::set_instance_transform);
ObjectTypeDB::bind_method(_MD("get_instance_transform","instance"),&MultiMesh::get_instance_transform);
ObjectTypeDB::bind_method(_MD("set_instance_color","instance","color"),&MultiMesh::set_instance_color);
ObjectTypeDB::bind_method(_MD("get_instance_color","instance"),&MultiMesh::get_instance_color);
ObjectTypeDB::bind_method(_MD("set_aabb","visibility_aabb"),&MultiMesh::set_aabb);
ObjectTypeDB::bind_method(_MD("get_aabb"),&MultiMesh::get_aabb);
ObjectTypeDB::bind_method(_MD("generate_aabb"),&MultiMesh::generate_aabb);

View File

@ -179,25 +179,25 @@ void ShaderGraph::_bind_methods() {
ObjectTypeDB::bind_method(_MD("default_get_value","shader_type","id","param_id"), &ShaderGraph::default_get_value);
ObjectTypeDB::bind_method(_MD("scalar_const_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_const_node_set_value);
ObjectTypeDB::bind_method(_MD("scalar_const_node_get_value","shader_type","id"),&ShaderGraph::scalar_const_node_set_value);
ObjectTypeDB::bind_method(_MD("scalar_const_node_get_value","shader_type","id"),&ShaderGraph::scalar_const_node_get_value);
ObjectTypeDB::bind_method(_MD("vec_const_node_set_value","shader_type","id","value"),&ShaderGraph::vec_const_node_set_value);
ObjectTypeDB::bind_method(_MD("vec_const_node_get_value","shader_type","id"),&ShaderGraph::vec_const_node_set_value);
ObjectTypeDB::bind_method(_MD("vec_const_node_get_value","shader_type","id"),&ShaderGraph::vec_const_node_get_value);
ObjectTypeDB::bind_method(_MD("rgb_const_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_const_node_set_value);
ObjectTypeDB::bind_method(_MD("rgb_const_node_get_value","shader_type","id"),&ShaderGraph::rgb_const_node_set_value);
ObjectTypeDB::bind_method(_MD("rgb_const_node_get_value","shader_type","id"),&ShaderGraph::rgb_const_node_get_value);
ObjectTypeDB::bind_method(_MD("xform_const_node_set_value","shader_type","id","value"),&ShaderGraph::xform_const_node_set_value);
ObjectTypeDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_set_value);
ObjectTypeDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_get_value);
// void get_node_list(ShaderType p_which,List<int> *p_node_list) const;
ObjectTypeDB::bind_method(_MD("texture_node_set_filter_size","shader_type","id","filter_size"),&ShaderGraph::texture_node_set_filter_size);
ObjectTypeDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_set_filter_size);
ObjectTypeDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_get_filter_size);
ObjectTypeDB::bind_method(_MD("texture_node_set_filter_strength","shader_type","id","filter_strength"),&ShaderGraph::texture_node_set_filter_strength);
ObjectTypeDB::bind_method(_MD("texture_node_get_filter_strength","shader_type","id"),&ShaderGraph::texture_node_set_filter_strength);
ObjectTypeDB::bind_method(_MD("texture_node_get_filter_strength","shader_type","id"),&ShaderGraph::texture_node_get_filter_strength);
ObjectTypeDB::bind_method(_MD("scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::scalar_op_node_set_op);
ObjectTypeDB::bind_method(_MD("scalar_op_node_get_op","shader_type","id"),&ShaderGraph::scalar_op_node_get_op);

View File

@ -83,7 +83,7 @@ void StyleBox::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_center_size"),&StyleBox::get_center_size);
ObjectTypeDB::bind_method(_MD("get_offset"),&StyleBox::get_offset);
ObjectTypeDB::bind_method(_MD("draw"),&StyleBox::draw);
ObjectTypeDB::bind_method(_MD("draw","canvas_item","rect"),&StyleBox::draw);
ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin/left", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_LEFT );
ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin/right", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_RIGHT );
@ -182,10 +182,10 @@ void StyleBoxTexture::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_texture:Texture"),&StyleBoxTexture::get_texture);
ObjectTypeDB::bind_method(_MD("set_margin_size","margin","size"),&StyleBoxTexture::set_margin_size);
ObjectTypeDB::bind_method(_MD("get_margin_size"),&StyleBoxTexture::get_margin_size);
ObjectTypeDB::bind_method(_MD("get_margin_size","margin"),&StyleBoxTexture::get_margin_size);
ObjectTypeDB::bind_method(_MD("set_expand_margin_size","margin","size"),&StyleBoxTexture::set_expand_margin_size);
ObjectTypeDB::bind_method(_MD("get_expand_margin_size"),&StyleBoxTexture::get_expand_margin_size);
ObjectTypeDB::bind_method(_MD("get_expand_margin_size","margin"),&StyleBoxTexture::get_expand_margin_size);
ObjectTypeDB::bind_method(_MD("set_draw_center","enable"),&StyleBoxTexture::set_draw_center);
ObjectTypeDB::bind_method(_MD("get_draw_center"),&StyleBoxTexture::get_draw_center);
@ -392,7 +392,7 @@ void StyleBoxImageMask::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_expand","expand"),&StyleBoxImageMask::set_expand);
ObjectTypeDB::bind_method(_MD("get_expand"),&StyleBoxImageMask::get_expand);
ObjectTypeDB::bind_method(_MD("set_expand_margin_size","margin","size"),&StyleBoxImageMask::set_expand_margin_size);
ObjectTypeDB::bind_method(_MD("get_expand_margin_size"),&StyleBoxImageMask::get_expand_margin_size);
ObjectTypeDB::bind_method(_MD("get_expand_margin_size","margin"),&StyleBoxImageMask::get_expand_margin_size);
ADD_PROPERTY( PropertyInfo(Variant::IMAGE, "image"), _SCS("set_image"), _SCS("get_image"));
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "expand"), _SCS("set_expand"), _SCS("get_expand"));

View File

@ -70,9 +70,9 @@ void Texture::_bind_methods() {
ObjectTypeDB::bind_method(_MD("has_alpha"),&Texture::has_alpha);
ObjectTypeDB::bind_method(_MD("set_flags","flags"),&Texture::set_flags);
ObjectTypeDB::bind_method(_MD("get_flags"),&Texture::get_flags);
ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","modulate"),&Texture::draw,DEFVAL(Color(1,1,1)),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("draw_rect","canvas_item","rect","tile","modulate"),&Texture::draw_rect,DEFVAL(Color(1,1,1)),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("draw_rect_region","canvas_item","rect","src_rect","modulate"),&Texture::draw_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","modulate","transpose"),&Texture::draw,DEFVAL(Color(1,1,1)),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("draw_rect","canvas_item","rect","tile","modulate","transpose"),&Texture::draw_rect,DEFVAL(Color(1,1,1)),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("draw_rect_region","canvas_item","rect","src_rect","modulate","transpose"),&Texture::draw_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false));
BIND_CONSTANT( FLAG_MIPMAPS );
BIND_CONSTANT( FLAG_REPEAT );

View File

@ -552,36 +552,36 @@ void Theme::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_icon:Texture","name","type"),&Theme::get_icon);
ObjectTypeDB::bind_method(_MD("has_icon","name","type"),&Theme::has_icon);
ObjectTypeDB::bind_method(_MD("clear_icon","name","type"),&Theme::clear_icon);
ObjectTypeDB::bind_method(_MD("get_icon_list"),&Theme::_get_icon_list);
ObjectTypeDB::bind_method(_MD("get_icon_list","type"),&Theme::_get_icon_list);
ObjectTypeDB::bind_method(_MD("set_stylebox","name","type","texture:StyleBox"),&Theme::set_stylebox);
ObjectTypeDB::bind_method(_MD("get_stylebox:StyleBox","name","type"),&Theme::get_stylebox);
ObjectTypeDB::bind_method(_MD("has_stylebox","name","type"),&Theme::has_stylebox);
ObjectTypeDB::bind_method(_MD("clear_stylebox","name","type"),&Theme::clear_stylebox);
ObjectTypeDB::bind_method(_MD("get_stylebox_list"),&Theme::_get_stylebox_list);
ObjectTypeDB::bind_method(_MD("get_stylebox_list","type"),&Theme::_get_stylebox_list);
ObjectTypeDB::bind_method(_MD("set_font","name","type","font:Font"),&Theme::set_font);
ObjectTypeDB::bind_method(_MD("get_font:Font","name","type"),&Theme::get_font);
ObjectTypeDB::bind_method(_MD("has_font","name","type"),&Theme::has_font);
ObjectTypeDB::bind_method(_MD("clear_font","name","type"),&Theme::clear_font);
ObjectTypeDB::bind_method(_MD("get_font_list"),&Theme::_get_font_list);
ObjectTypeDB::bind_method(_MD("get_font_list","type"),&Theme::_get_font_list);
ObjectTypeDB::bind_method(_MD("set_color","name","type","color"),&Theme::set_color);
ObjectTypeDB::bind_method(_MD("get_color","name","type"),&Theme::get_color);
ObjectTypeDB::bind_method(_MD("has_color","name","type"),&Theme::has_color);
ObjectTypeDB::bind_method(_MD("clear_color","name","type"),&Theme::clear_color);
ObjectTypeDB::bind_method(_MD("get_color_list"),&Theme::_get_color_list);
ObjectTypeDB::bind_method(_MD("get_color_list","type"),&Theme::_get_color_list);
ObjectTypeDB::bind_method(_MD("set_constant","name","type","constant"),&Theme::set_constant);
ObjectTypeDB::bind_method(_MD("get_constant","name","type"),&Theme::get_constant);
ObjectTypeDB::bind_method(_MD("has_constant","name","type"),&Theme::has_constant);
ObjectTypeDB::bind_method(_MD("clear_constant","name","type"),&Theme::clear_constant);
ObjectTypeDB::bind_method(_MD("get_constant_list"),&Theme::_get_constant_list);
ObjectTypeDB::bind_method(_MD("get_constant_list","type"),&Theme::_get_constant_list);
ObjectTypeDB::bind_method(_MD("set_default_font","font"),&Theme::set_default_theme_font);
ObjectTypeDB::bind_method(_MD("get_default_font"),&Theme::get_default_theme_font);
ObjectTypeDB::bind_method(_MD("get_type_list"),&Theme::_get_type_list);
ObjectTypeDB::bind_method(_MD("get_type_list","type"),&Theme::_get_type_list);
ObjectTypeDB::bind_method("copy_default_theme",&Theme::copy_default_theme);

View File

@ -360,7 +360,7 @@ void AudioServerSW::sample_set_description(RID p_sample, const String& p_descrip
AUDIO_LOCK
sample_manager->sample_set_description(p_sample,p_description);
}
String AudioServerSW::sample_get_description(RID p_sample, const String& p_description) const {
String AudioServerSW::sample_get_description(RID p_sample) const {
AUDIO_LOCK
return sample_manager->sample_get_description(p_sample);
@ -767,8 +767,6 @@ void AudioServerSW::_thread_func(void *self) {
AudioServerSW *as=(AudioServerSW *)self;
as->thread->set_name("AudioServerSW");
while (!as->exit_update_thread) {
as->_update_streams(true);
OS::get_singleton()->delay_usec(5000);
@ -809,6 +807,7 @@ void AudioServerSW::init() {
#ifndef NO_THREADS
exit_update_thread=false;
thread = Thread::create(_thread_func,this);
thread->set_name("AudioServerSW");
#endif
}

View File

@ -118,7 +118,7 @@ public:
virtual RID sample_create(SampleFormat p_format, bool p_stereo, int p_length);
virtual void sample_set_description(RID p_sample, const String& p_description);
virtual String sample_get_description(RID p_sample, const String& p_description) const;
virtual String sample_get_description(RID p_sample) const;
virtual SampleFormat sample_get_format(RID p_sample) const;
virtual bool sample_is_stereo(RID p_sample) const;

View File

@ -88,7 +88,7 @@ void AudioServer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("sample_get_length","sample"), &AudioServer::sample_get_length );
ObjectTypeDB::bind_method(_MD("sample_set_signed_data","sample","data"), &AudioServer::sample_set_signed_data );
ObjectTypeDB::bind_method(_MD("sample_set_data","sample"), &AudioServer::sample_set_data );
ObjectTypeDB::bind_method(_MD("sample_set_data","sample","data"), &AudioServer::sample_set_data );
ObjectTypeDB::bind_method(_MD("sample_get_data","sample"), &AudioServer::sample_get_data );
ObjectTypeDB::bind_method(_MD("sample_set_mix_rate","sample","mix_rate"), &AudioServer::sample_set_mix_rate );

View File

@ -160,7 +160,7 @@ public:
virtual RID sample_create(SampleFormat p_format, bool p_stereo, int p_length)=0;
virtual void sample_set_description(RID p_sample, const String& p_description)=0;
virtual String sample_get_description(RID p_sample, const String& p_description) const=0;
virtual String sample_get_description(RID p_sample) const=0;
virtual SampleFormat sample_get_format(RID p_sample) const=0;
virtual bool sample_is_stereo(RID p_sample) const=0;

View File

@ -406,29 +406,41 @@ void BodySW::integrate_forces(real_t p_step) {
return;
AreaSW *def_area = get_space()->get_default_area();
AreaSW *damp_area = def_area;
// AreaSW *damp_area = def_area;
ERR_FAIL_COND(!def_area);
int ac = areas.size();
bool replace = false;
bool stopped = false;
gravity = Vector3(0,0,0);
area_linear_damp = 0;
area_angular_damp = 0;
if (ac) {
areas.sort();
const AreaCMP *aa = &areas[0];
damp_area = aa[ac-1].area;
for(int i=ac-1;i>=0;i--) {
_compute_area_gravity_and_dampenings(aa[i].area);
if (aa[i].area->get_space_override_mode() == PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE) {
replace = true;
break;
// damp_area = aa[ac-1].area;
for(int i=ac-1;i>=0 && !stopped;i--) {
PhysicsServer::AreaSpaceOverrideMode mode=aa[i].area->get_space_override_mode();
switch (mode) {
case PhysicsServer::AREA_SPACE_OVERRIDE_COMBINE:
case PhysicsServer::AREA_SPACE_OVERRIDE_COMBINE_REPLACE: {
_compute_area_gravity_and_dampenings(aa[i].area);
stopped = mode==PhysicsServer::AREA_SPACE_OVERRIDE_COMBINE_REPLACE;
} break;
case PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE:
case PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE_COMBINE: {
gravity = Vector3(0,0,0);
area_angular_damp = 0;
area_linear_damp = 0;
_compute_area_gravity_and_dampenings(aa[i].area);
stopped = mode==PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE;
} break;
default: {}
}
}
}
if( !replace ) {
if( !stopped ) {
_compute_area_gravity_and_dampenings(def_area);
}

View File

@ -517,7 +517,7 @@ void PhysicsServerSW::body_set_mode(RID p_body, BodyMode p_mode) {
body->set_mode(p_mode);
};
PhysicsServer::BodyMode PhysicsServerSW::body_get_mode(RID p_body, BodyMode p_mode) const {
PhysicsServer::BodyMode PhysicsServerSW::body_get_mode(RID p_body) const {
BodySW *body = body_owner.get(p_body);
ERR_FAIL_COND_V(!body,BODY_MODE_STATIC);

View File

@ -146,7 +146,7 @@ public:
virtual RID body_get_space(RID p_body) const;
virtual void body_set_mode(RID p_body, BodyMode p_mode);
virtual BodyMode body_get_mode(RID p_body, BodyMode p_mode) const;
virtual BodyMode body_get_mode(RID p_body) const;
virtual void body_add_shape(RID p_body, RID p_shape, const Transform& p_transform=Transform());
virtual void body_set_shape(RID p_body, int p_shape_idx,RID p_shape);

Some files were not shown because too many files have changed in this diff Show More