From abc4dcca885e5a0bc45322c60b040841f69bbc58 Mon Sep 17 00:00:00 2001 From: hgn Date: Wed, 22 Nov 2023 04:04:12 +0000 Subject: [PATCH] fix legacy behaviour for trigger exits --- blender_export.py | 7 +++++-- maps_src/dev_hub/main.mdl | Bin 221056 -> 221056 bytes shaders/scene_override.h | 3 +-- world_volumes.c | 17 ++++++++++------- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/blender_export.py b/blender_export.py index 4b7cf7f..5eb5975 100644 --- a/blender_export.py +++ b/blender_export.py @@ -1851,7 +1851,10 @@ def sr_compile( collection ): if obj_data.target:#{ volume.target = sr_entity_id( obj_data.target ) volume._anon.trigger.event = obj_data.target_event - volume._anon.trigger.event_leave = obj_data.target_event_leave + + ev = 0xffffffff if obj_data.target_event_leave < 0 else \ + obj_data.target_event_leave + volume._anon.trigger.event_leave = ev #} sr_ent_push(volume) @@ -2978,7 +2981,7 @@ class SR_OBJECT_ENT_VOLUME(bpy.types.PropertyGroup):#{ type=bpy.types.Object, name="Target", \ poll=lambda self,obj: sr_filter_ent_type(obj,SR_TRIGGERABLE)) target_event: bpy.props.IntProperty( name="Enter Ev" ) - target_event_leave: bpy.props.IntProperty( name="Leave Ev" ) + target_event_leave: bpy.props.IntProperty( name="Leave Ev", default=-1 ) @staticmethod def inspect_target( layout, data, propname, evs = ['_event'] ):#{ diff --git a/maps_src/dev_hub/main.mdl b/maps_src/dev_hub/main.mdl index 43fb44ef1ba799ae38c64cf889b8f4f46a3a032a..e573635ec7e48257a2b24615076d0860a9f4d4db 100644 GIT binary patch delta 31 jcmZqJ&)cw{cS8ve%YPtfuHb2};9&$}rtK9x%pAc0=0yyG delta 30 kcmZqJ&)cw{cS8x! 0.0 ){\n" " float height = fract( aCo.y * 0.1 );\n" " float lg = 2.0*length(vec2(dFdx(height), dFdy(height)));\n" -" vfrag *= 1.0f+(lg*0.4*uIsoAmt);\n" +" vfrag *= 1.0f+(lg*0.2*uIsoAmt);\n" " }\n" "\n" -"\n" " oColour = vec4( vfrag, 1.0 );\n" " //oColour = vec4( vfrag, 1.0 );\n" "}\n" diff --git a/world_volumes.c b/world_volumes.c index 23b8299..7f2b685 100644 --- a/world_volumes.c +++ b/world_volumes.c @@ -19,16 +19,19 @@ static void world_volumes_update( world_instance *world, v3f pos ){ world_static.active_trigger_volumes[ j ++ ] = idx; boxf cube = {{-1.0f,-1.0f,-1.0f},{1.0f,1.0f,1.0f}}; vg_line_boxf_transformed( volume->to_world, cube, 0xff00ccff ); - /* triggr on stay ..... */ } else{ - /* trigger on exit...... */ - ent_call basecall; - basecall.function = k_ent_function_trigger_leave; - basecall.id = mdl_entity_id( k_ent_volume, idx ); - basecall.data = NULL; + /* + * LEGACY BEHAVIOUR: < v104 does not have leave events + */ + if( world->meta.info.version >= 104 ){ + ent_call basecall; + basecall.function = k_ent_function_trigger_leave; + basecall.id = mdl_entity_id( k_ent_volume, idx ); + basecall.data = NULL; - entity_call( world, &basecall ); + entity_call( world, &basecall ); + } } } world_static.active_trigger_volume_count = j; -- 2.25.1