Skip to content

Commit

Permalink
merges from okam repo
Browse files Browse the repository at this point in the history
  • Loading branch information
reduz committed Mar 3, 2015
1 parent 91faf8e commit 4d21981
Show file tree
Hide file tree
Showing 28 changed files with 458 additions and 233 deletions.
4 changes: 4 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@ env_base.android_source_modules=[]
env_base.android_source_files=[]
env_base.android_module_libraries=[]
env_base.android_manifest_chunk=""
env_base.android_permission_chunk=""
env_base.android_appattributes_chunk=""
env_base.disabled_modules=[]

env_base.__class__.android_module_source = methods.android_module_source
env_base.__class__.android_module_library = methods.android_module_library
env_base.__class__.android_module_file = methods.android_module_file
env_base.__class__.android_module_manifest = methods.android_module_manifest
env_base.__class__.android_module_permission = methods.android_module_permission
env_base.__class__.android_module_attribute = methods.android_module_attribute
env_base.__class__.disable_module = methods.disable_module

env_base.__class__.add_source_files = methods.add_source_files
Expand Down
8 changes: 8 additions & 0 deletions core/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,13 @@ void Object::add_user_signal(const MethodInfo& p_signal) {
signal_map[p_signal.name]=s;
}

bool Object::_has_user_signal(const StringName& p_name) const {

if (!signal_map.has(p_name))
return false;
return signal_map[p_name].user.name.length()>0;
}

struct _ObjectSignalDisconnectData {

StringName signal;
Expand Down Expand Up @@ -1431,6 +1438,7 @@ void Object::_bind_methods() {
// ObjectTypeDB::bind_method(_MD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()));

ObjectTypeDB::bind_method(_MD("add_user_signal","signal","arguments"),&Object::_add_user_signal,DEFVAL(Array()));
ObjectTypeDB::bind_method(_MD("has_user_signal","signal"),&Object::_has_user_signal);
// ObjectTypeDB::bind_method(_MD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array()));


Expand Down
1 change: 1 addition & 0 deletions core/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ friend void postinitialize_handler(Object*);
Dictionary metadata;

void _add_user_signal(const String& p_name, const Array& p_pargs=Array());
bool _has_user_signal(const StringName& p_name) const;
Variant _emit_signal(const Variant** p_args, int p_argcount, Variant::CallError& r_error);
Array _get_signal_list() const;
Array _get_signal_connection_list(const String& p_signal) const;
Expand Down
3 changes: 2 additions & 1 deletion doc/base/classes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18902,7 +18902,8 @@
collider_id: collider id of the object agaisnt which the ray was stopped[br]
collider: collider object agaisnt which the ray was stopped[br]
rid: [RID] of the object agaisnt which the ray was stopped[br]
If the ray did not intersect anything, then null is returned instead of a [Dictionary].
If the ray did not intersect anything, then an empty
dictionary (dir.empty()==true) is returned instead.
</description>
</method>
<method name="intersect_shape" >
Expand Down
24 changes: 18 additions & 6 deletions drivers/gles2/rasterizer_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4954,12 +4954,26 @@ _FORCE_INLINE_ void RasterizerGLES2::_update_material_shader_params(Material *p_
Material::UniformData ud;

bool keep=true; //keep material value
bool has_old = old_mparams.has(E->key());

Map<StringName,Material::UniformData>::Element *OLD=old_mparams.find(E->key());
bool has_old = OLD;
bool old_inuse=has_old && old_mparams[E->key()].inuse;

if (!has_old || !old_inuse)
ud.istexture=(E->get().type==ShaderLanguage::TYPE_TEXTURE || E->get().type==ShaderLanguage::TYPE_CUBEMAP);

if (!has_old || !old_inuse) {
keep=false;
else if (old_mparams[E->key()].value.get_type()!=E->value().default_value.get_type()) {
}
else if (OLD->get().value.get_type()!=E->value().default_value.get_type()) {

if (OLD->get().value.get_type()==Variant::INT && E->get().type==ShaderLanguage::TYPE_FLOAT) {
//handle common mistake using shaders (feeding ints instead of float)
OLD->get().value=float(OLD->get().value);
keep=true;
} else if (!ud.istexture && E->value().default_value.get_type()!=Variant::NIL) {

keep=false;
}
//type changed between old and new
/* if (old_mparams[E->key()].value.get_type()==Variant::OBJECT) {
if (E->value().default_value.get_type()!=Variant::_RID) //hackfor textures
Expand All @@ -4968,11 +4982,9 @@ _FORCE_INLINE_ void RasterizerGLES2::_update_material_shader_params(Material *p_
keep=false;*/

//value is invalid because type differs and default is not null
if (E->value().default_value.get_type()!=Variant::NIL)
keep=false;
;
}

ud.istexture=(E->get().type==ShaderLanguage::TYPE_TEXTURE || E->get().type==ShaderLanguage::TYPE_CUBEMAP);

if (keep) {
ud.value=old_mparams[E->key()].value;
Expand Down
8 changes: 8 additions & 0 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,14 @@ def android_module_manifest(self,file):
base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file
f = open(base_path,"rb")
self.android_manifest_chunk+=f.read()
def android_module_permission(self,file):
base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file
f = open(base_path,"rb")
self.android_permission_chunk+=f.read()
def android_module_attribute(self,file):
base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file
f = open(base_path,"rb")
self.android_appattributes_chunk+=f.read()

def disable_module(self):
self.disabled_modules.append(self.current_module)
Expand Down
4 changes: 3 additions & 1 deletion modules/gdscript/gd_tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,11 @@ void GDTokenizerText::_advance() {
is_node_path=true;

case '\'':
string_mode=STRING_SINGLE_QUOTE;
case '"': {

if (GETCHAR(0)=='\'')
string_mode=STRING_SINGLE_QUOTE;

int i=1;
if (string_mode==STRING_DOUBLE_QUOTE && GETCHAR(i)=='"' && GETCHAR(i+1)=='"') {
i+=2;
Expand Down
3 changes: 2 additions & 1 deletion modules/gridmap/grid_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ bool GridMap::_set(const StringName& p_name, const Variant& p_value) {
Octant &g = *octant_map[ok];

g.baked=b;
g.bake_instance=VS::get_singleton()->instance_create();;
g.bake_instance=VS::get_singleton()->instance_create();;
VS::get_singleton()->instance_set_base(g.bake_instance,g.baked->get_rid());
VS::get_singleton()->instance_geometry_set_baked_light(g.bake_instance,baked_light_instance?baked_light_instance->get_baked_light_instance():RID());
}
Expand Down Expand Up @@ -418,6 +418,7 @@ void GridMap::set_cell_item(int p_x,int p_y,int p_z, int p_item,int p_rot){
Octant *g = memnew( Octant );
g->dirty=true;
g->static_body = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC);
PhysicsServer::get_singleton()->body_attach_object_instance_ID(g->static_body,get_instance_ID());
if (is_inside_world())
PhysicsServer::get_singleton()->body_set_space(g->static_body,get_world()->get_space());

Expand Down
3 changes: 2 additions & 1 deletion platform/android/AndroidManifest.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:largeScreens="true"
android:xlargeScreens="true"/>

<application android:label="@string/godot_project_name_string" android:icon="@drawable/icon" android:allowBackup="false">
<application android:label="@string/godot_project_name_string" android:icon="@drawable/icon" android:allowBackup="false" $$ADD_APPATTRIBUTE_CHUNKS$$ >
<activity android:name="com.android.godot.Godot"
android:label="@string/godot_project_name_string"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
Expand All @@ -33,6 +33,7 @@ $$ADD_APPLICATION_CHUNKS$$
</application>
<uses-feature android:glEsVersion="0x00020000"/>

$$ADD_PERMISSION_CHUNKS$$
<uses-permission android:name="godot.ACCESS_CHECKIN_PROPERTIES"/>
<uses-permission android:name="godot.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="godot.ACCESS_FINE_LOCATION"/>
Expand Down
2 changes: 2 additions & 0 deletions platform/android/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ pp_basein = open(abspath+"/AndroidManifest.xml.template","rb")
pp_baseout = open(abspath+"/java/AndroidManifest.xml","wb")
manifest = pp_basein.read()
manifest = manifest.replace("$$ADD_APPLICATION_CHUNKS$$",env.android_manifest_chunk)
manifest = manifest.replace("$$ADD_PERMISSION_CHUNKS$$",env.android_permission_chunk)
manifest = manifest.replace("$$ADD_APPATTRIBUTE_CHUNKS$$",env.android_appattributes_chunk)
pp_baseout.write( manifest )


Expand Down
Loading

0 comments on commit 4d21981

Please sign in to comment.