From: hgn Date: Wed, 22 Nov 2023 04:04:12 +0000 (+0000) Subject: fix legacy behaviour for trigger exits X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=abc4dcca885e5a0bc45322c60b040841f69bbc58;p=carveJwlIkooP6JGAAIwe30JlM.git fix legacy behaviour for trigger exits --- 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 43fb44e..e573635 100644 Binary files a/maps_src/dev_hub/main.mdl and b/maps_src/dev_hub/main.mdl differ diff --git a/shaders/scene_override.h b/shaders/scene_override.h index 74caeff..6ef67c9 100644 --- a/shaders/scene_override.h +++ b/shaders/scene_override.h @@ -521,10 +521,9 @@ static struct vg_shader _shader_scene_override = { " if( uIsoAmt > 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;