From: hgn Date: Tue, 14 Mar 2023 18:21:05 +0000 (+0000) Subject: bugs/map edits X-Git-Url: https://skaterift.com/git/?a=commitdiff_plain;h=26bde92c7084971f13352b37fd4d1ea528b45dcf;p=carveJwlIkooP6JGAAIwe30JlM.git bugs/map edits --- diff --git a/audio.h b/audio.h index f70edf5..eb58b26 100644 --- a/audio.h +++ b/audio.h @@ -127,8 +127,8 @@ audio_clip audio_ui[] = { }; audio_clip audio_music[] = { - { .path = "sound/song.ogg", .flags = AUDIO_FLAG_VORBIS }, - { .path = "sound/skate.ogg", .flags = AUDIO_FLAG_VORBIS }, + { .path = "sound/song.ogg", .flags = k_audio_format_vorbis }, + { .path = "sound/skate.ogg", .flags = k_audio_format_vorbis }, }; #if 0 diff --git a/blender_export.py b/blender_export.py index 1291cff..d0a1c8a 100644 --- a/blender_export.py +++ b/blender_export.py @@ -801,7 +801,10 @@ class classtype_logic_wire(Structure): def get_targeted_methods( scene, context ): #{ obj = context.object - invalid = [('0',"","")] + invalid = [('0',"",""), + ('1',"",""), + ('2',"",""), + ('3',"","")] if obj.cv_data.target: #{ @@ -1117,6 +1120,8 @@ class classtype_audio(Structure): flags |= 0x200 if obj.cv_data.audio_format == 'remain compressed': flags |= 0x400 + if obj.cv_data.audio_format == 'synthetic bird': + flags |= 0x1000 _.flags = flags _.volume = obj.cv_data.fltp @@ -1144,71 +1149,6 @@ class classtype_audio(Structure): #} #} -# Classtype 14 -# -# Purpose: Plays some audio (44100hz .ogg vorbis only) -# NOTE: There is a 32mb limit on the audio buffer, world audio is -# decompressed and stored in signed 16 bit integers (2 bytes) -# per sample. -# -# volume: not used if has 3D flag -# flags: -# AUDIO_FLAG_LOOP 0x1 -# AUDIO_FLAG_SPACIAL_3D 0x4 (Probably what you want) -# AUDIO_FLAG_AUTO_START 0x8 (Play when the world starts) -# ...... -# the rest are just internal flags, only use the above 3. -# -class classtype_audio(Structure): -#{ - _pack_ = 1 - _fields_ = [("pstr_file",c_uint32), - ("flags",c_uint32), - ("volume",c_float)] - - def encode_obj(_, node,node_def ): - #{ - node.classtype = 14 - - obj = node_def['obj'] - - _.pstr_file = encoder_process_pstr( obj.cv_data.strp ) - - flags = 0x00 - if obj.cv_data.bp0: flags |= 0x1 - if obj.cv_data.bp1: flags |= 0x4 - if obj.cv_data.bp2: flags |= 0x8 - - if obj.cv_data.audio_format == 'stereo': - flags |= 0x200 - if obj.cv_data.audio_format == 'remain compressed': - flags |= 0x400 - - _.flags = flags - _.volume = obj.cv_data.fltp - #} - - @staticmethod - def editor_interface( layout, obj ): - #{ - layout.prop( obj.cv_data, "strp", text = "File (.ogg)" ) - - layout.prop( obj.cv_data, "bp0", text = "Looping" ) - layout.prop( obj.cv_data, "bp1", text = "3D Audio" ) - layout.prop( obj.cv_data, "bp2", text = "Auto Start" ) - layout.prop( obj.cv_data, "audio_format" ) - - layout.prop( obj.cv_data, "fltp", text = "Volume (0-1)" ) - #} - - @staticmethod - def draw_scene_helpers( obj ): - #{ - global cv_view_verts, cv_view_colours - - cv_draw_sphere( obj.location, obj.scale[0], [1,1,0,1] ) - #} -#} # Classtype 200 # @@ -3137,7 +3077,8 @@ class CV_OBJ_SETTINGS(bpy.types.PropertyGroup): items = [ ('mono', "mono", "", 0), ('stereo', "stereo", "", 1), - ('remain compressed', "remain compressed", "", 2) + ('remain compressed', "remain compressed", "", 2), + ('synthetic bird',"synthetic bird","",3) ]) #} diff --git a/maps_src/mp_home.mdl b/maps_src/mp_home.mdl index 4684fc7..d451ace 100644 Binary files a/maps_src/mp_home.mdl and b/maps_src/mp_home.mdl differ diff --git a/maps_src/mp_mtzero.mdl b/maps_src/mp_mtzero.mdl index 1699810..a6dde60 100644 Binary files a/maps_src/mp_mtzero.mdl and b/maps_src/mp_mtzero.mdl differ diff --git a/skaterift.c b/skaterift.c index ad01803..e5d2288 100644 --- a/skaterift.c +++ b/skaterift.c @@ -416,6 +416,7 @@ VG_STATIC void vg_update_post(void) m3x3_mulv( main_camera.transform, ears, ears ); v3_copy( ears, vg_audio.listener_ears ); v3_copy( main_camera.transform[3], vg_audio.listener_pos ); + v3_copy( localplayer.rb.v, vg_audio.listener_velocity ); audio_unlock(); #if 0 diff --git a/world.h b/world.h index 106b824..b1fc80d 100644 --- a/world.h +++ b/world.h @@ -900,7 +900,7 @@ VG_STATIC void world_update( world_instance *world, v3f pos ) sfd_update(); if( debug_logic_bricks ) - logic_bricks_debug( world ); + logic_bricks_debug( world, pos ); /* process soundscape transactions */ audio_lock(); diff --git a/world_logic_bricks.h b/world_logic_bricks.h index c4d5358..6d1ea26 100644 --- a/world_logic_bricks.h +++ b/world_logic_bricks.h @@ -37,7 +37,7 @@ VG_STATIC void logic_bricks_debug_connection( world_instance *world, vg_line( from->co, to->co, clamped ); } -VG_STATIC void logic_bricks_debug( world_instance *world ) +VG_STATIC void logic_bricks_debug( world_instance *world, v3f pos ) { v3f white = {1.0f,1.0f,1.0f}, red = {1.0f,0.2f,0.1f}, @@ -50,6 +50,9 @@ VG_STATIC void logic_bricks_debug( world_instance *world ) struct logic_brick_ref *ref = &world->logic_bricks[i]; mdl_node *node = ref->node; + if( v3_dist2( node->co, pos ) > 50.0f*50.0f ) + continue; + void *entdata = mdl_get_entdata( world->meta, node ); if( ref->node->classtype == k_classtype_logic_wire ) @@ -173,7 +176,9 @@ VG_STATIC void logic_chances_call( world_instance *world, { mdl_node *pnext = mdl_node_from_id( world->meta, inf->targets[red] ); - if( pnext->classtype == k_classtype_logic_wire ) + if( (pnext->classtype == k_classtype_logic_wire) || + (pnext->classtype == k_classtype_logic_chances) || + (pnext->classtype == k_classtype_signal_splitter) ) { packet->location = pnext->sub_uid; }