From eeac25c9d07fc253e9208723a8e21d3a5b552d50 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 22 Dec 2010 14:21:46 +0000 Subject: [PATCH] Complement of commit 33789: Fix for [#25175] bge.logic.mouse.position[1] wrong when using autostart Porting the fix when Fullscreen flag is on (~ scene.gm->fullscreen) I still see some issues with that, a difference between width/height. To be addressed later. --- source/blender/makesrna/intern/rna_actuator.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 2fa93bcecdd..dc3c597780b 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -438,6 +438,15 @@ static void rna_Actuator_Armature_update(Main *bmain, Scene *scene, PointerRNA * constraint[0] = 0; } +static void rna_Actuator_sound_sound_set(PointerRNA *ptr, PointerRNA value) +{ + bActuator *act = (bActuator *)ptr->data; + bSoundActuator *sa = (bSoundActuator *) act->data; + + sa->sound = value.data; + ((ID *)value.data)->us += 1; +} + /* note: the following set functions exists only to avoid id refcounting */ static void rna_Actuator_editobject_mesh_set(PointerRNA *ptr, PointerRNA value) { @@ -895,6 +904,7 @@ static void rna_def_sound_actuator(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Sound"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_struct_ui_text(srna, "Sound", "Sound file"); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_sound_sound_set", NULL, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);