re-add non-local gates
[carveJwlIkooP6JGAAIwe30JlM.git] / ent_skateshop.c
index 8a03ff1e6ab46b7772ff1905ecedbdaf9675b419..427347d430379a153f2b1206f396a804d5744cb4 100644 (file)
@@ -10,7 +10,6 @@
 #include "player.h"
 #include "gui.h"
 #include "menu.h"
-#include "pointcloud.h"
 #include "highscores.h"
 #include "steam.h"
 #include "addon.h"
@@ -122,63 +121,6 @@ static u16 skateshop_selected_cache_id(void){
    else return 0;
 }
 
-static void pointcloud_async_end(void *_, u32 __)
-{
-   pointcloud_animate( k_pointcloud_anim_opening );
-}
-
-static void pointcloud_clear_async(void *_, u32 __)
-{
-   pointcloud.count = 0;
-   pointcloud_animate( k_pointcloud_anim_opening );
-}
-
-static void skateshop_world_preview_loader_thread( void *_data )
-{
-   addon_reg *reg = _data;
-
-   char path_buf[4096];
-   vg_str path;
-   vg_strnull( &path, path_buf, 4096 );
-   addon_get_content_folder( reg, &path );
-   vg_strcat( &path, "/preview.bin" );
-
-   vg_linear_clear(vg_mem.scratch);
-   u32 size;
-   
-   void *data = vg_file_read( vg_mem.scratch, path_buf, &size );
-   if( data ){
-      if( size < sizeof(pointcloud_buffer) ){
-         vg_async_call( pointcloud_clear_async, NULL, 0 );
-         return;
-      }
-      
-      vg_async_item *call = vg_async_alloc(size);
-      pointcloud_buffer *pcbuf = call->payload;
-      memcpy( pcbuf, data, size );
-
-      u32 point_count = (size-sizeof(pointcloud_buffer)) /
-                           sizeof(struct pointcloud_vert);
-      pcbuf->max = point_count;
-      pcbuf->count = point_count;
-      pcbuf->op = k_pointcloud_op_clear;
-
-      vg_async_dispatch( call, async_pointcloud_sub );
-      vg_async_call( pointcloud_async_end, NULL, 0 );
-   }
-   else{
-      vg_async_call( pointcloud_clear_async, NULL, 0 );
-   }
-}
-
-static void skateshop_world_preview_loader_thread_and_end( void *_data ){
-   skateshop_world_preview_loader_thread( _data );
-}
-
-static void skateshop_load_world_preview( addon_reg *reg ){
-   vg_loader_start( skateshop_world_preview_loader_thread_and_end, reg );
-}
-
 /*
  * VG event preupdate 
  */
@@ -195,8 +137,7 @@ static void ent_skateshop_preupdate( ent_skateshop *shop, int active ){
       
    v3f dir = {0.0f,-1.0f,0.0f};
    mdl_transform_vector( &ref->transform, dir, dir );
-   m3x3_mulv( localplayer.invbasis, dir, dir );
-   player_vector_angles( world_static.focus_cam.angles, dir, 1.0f, 0.0f );
+   v3_angles( dir, world_static.focus_cam.angles );
 
    v3f lookat;
    if( shop->type == k_skateshop_type_boardshop ||
@@ -337,6 +278,7 @@ static void ent_skateshop_preupdate( ent_skateshop *shop, int active ){
          }
       }
       
+#if 0
       if( change && pointcloud_idle() ){
          pointcloud_animate( k_pointcloud_anim_hiding );
       }
@@ -374,6 +316,7 @@ static void ent_skateshop_preupdate( ent_skateshop *shop, int active ){
             }
          }
       }
+#endif
    }
    else{
       vg_fatal_error( "Unknown store (%u)\n", shop->type );
@@ -633,6 +576,7 @@ static void skateshop_render_worldshop( ent_skateshop *shop ){
    m4x3_mul( mtext, mlocal, mtextmdl );
    font3d_simple_draw( 0, bufsubtext, &skaterift.cam, mtextmdl );
 
+#if 0
    /* pointcloud */
    m4x3f mmdl;
    mdl_transform_m4x3( &mark_display->transform, mmdl );
@@ -644,6 +588,7 @@ static void skateshop_render_worldshop( ent_skateshop *shop ){
    pointcloud_render( world, &skaterift.cam, mmdl );
    glDisable(GL_BLEND);
    glEnable(GL_DEPTH_TEST);
+#endif
 }
 
 /*
@@ -706,7 +651,6 @@ static void ent_skateshop_call( world_instance *world, ent_call *call ){
       }
       else if( shop->type == k_skateshop_type_worldshop ){
          ent_skateshop_helpers_pickable( "open rift" );
-         pointcloud_animate( k_pointcloud_anim_opening );
          skateshop_op_world_scan();
       }
    }