bugs/map edits
authorhgn <hgodden00@gmail.com>
Tue, 14 Mar 2023 18:21:05 +0000 (18:21 +0000)
committerhgn <hgodden00@gmail.com>
Tue, 14 Mar 2023 18:21:05 +0000 (18:21 +0000)
audio.h
blender_export.py
maps_src/mp_home.mdl
maps_src/mp_mtzero.mdl
skaterift.c
world.h
world_logic_bricks.h

diff --git a/audio.h b/audio.h
index f70edf5bd783f5fdfe3c9c75d998fb6c3ee63d38..eb58b267412cd67e9bc0b6cf5614f97df51310fe 100644 (file)
--- 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
index 1291cff66b4e1158f6597cddd9bff1b2a1606690..d0a1c8aa50932b67a7cd4389865dedc983aed23c 100644 (file)
@@ -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)
       ])
 #}
 
index 4684fc7d8401c9f00cd02bcc503dde19a0a4b915..d451ace265f6c8f7bc58cf841a68640ac204e37f 100644 (file)
Binary files a/maps_src/mp_home.mdl and b/maps_src/mp_home.mdl differ
index 16998100aee47e87c050711e4c9d53678fe21f0d..a6dde601850623af86d031a2a729b3770ce93f7d 100644 (file)
Binary files a/maps_src/mp_mtzero.mdl and b/maps_src/mp_mtzero.mdl differ
index ad01803a6d02ca2d76f2990b1ea5a064aff3b1fa..e5d228865fac8e154d012f3d062603aa8b2a71a7 100644 (file)
@@ -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 106b8247334270807d2e8112095ae3fde022580b..b1fc80d9b3a1db4bc5ba46fd358c7c1146c7a041 100644 (file)
--- 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();
index c4d5358db05980376588053230928b822d1df647..6d1ea26cb4121707f9cfd0e30b0e204bfb91daef 100644 (file)
@@ -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;
          }