X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_skateshop.c;h=ed222168ab59a94e2aab0df426645fa78b06e453;hb=5f6a4f9df6c8accc89f1920bfe9ace3cbac4c4b6;hp=86fc9714d039dd11f0563d4d845f9dec084114e1;hpb=a109f126d8adab622e38fbcc2d4281e75255246a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_skateshop.c b/ent_skateshop.c index 86fc971..ed22216 100644 --- a/ent_skateshop.c +++ b/ent_skateshop.c @@ -1,5 +1,8 @@ #include "vg/vg_steam_ugc.h" #include "vg/vg_msg.h" +#include "vg/vg_tex.h" +#include "vg/vg_image.h" +#include "vg/vg_loader.h" #include "ent_skateshop.h" #include "world.h" #include "player.h" @@ -10,6 +13,11 @@ #include "save.h" #include "network.h" +struct global_skateshop global_skateshop = +{ + .render={.reg_id=0xffffffff,.world_reg=0xffffffff} +}; + /* * Checks string equality but does a hash check first */ @@ -143,7 +151,8 @@ static void skateshop_op_board_scan(void){ } /* TODO: migrate to addon.c */ -static void skateshop_autostart_loading(void){ +void skateshop_autostart_loading(void) +{ if( !vg_loader_availible() ) return; SDL_AtomicLock( &addon_system.sl_cache_using_resources ); @@ -194,7 +203,8 @@ static void skateshop_init_async(void *_data,u32 size){ /* * VG event init */ -static void skateshop_init(void){ +void skateshop_init(void) +{ vg_async_call( skateshop_init_async, NULL, 0 ); } @@ -228,7 +238,8 @@ static void skateshop_server_helper_update(void){ * VG event preupdate */ void temp_update_playermodel(void); -static void ent_skateshop_preupdate( ent_skateshop *shop, int active ){ +void ent_skateshop_preupdate( ent_skateshop *shop, int active ) +{ if( !active ) return; /* input filter */ @@ -436,7 +447,8 @@ static void ent_skateshop_preupdate( ent_skateshop *shop, int active ){ } } -static void skateshop_world_preupdate( world_instance *world ){ +void skateshop_world_preupdate( world_instance *world ) +{ for( u32 i=0; ient_skateshop); i++ ){ ent_skateshop *shop = mdl_arritm( &world->ent_skateshop, i ); @@ -707,7 +719,8 @@ none:; /* * World: render event */ -static void skateshop_render( ent_skateshop *shop ){ +void skateshop_render( ent_skateshop *shop ) +{ if( shop->type == k_skateshop_type_boardshop ) skateshop_render_boardshop( shop ); else if( shop->type == k_skateshop_type_charshop ) @@ -720,7 +733,8 @@ static void skateshop_render( ent_skateshop *shop ){ vg_fatal_error( "Unknown store (%u)\n", shop->type ); } -static void skateshop_render_nonfocused( world_instance *world, camera *cam ){ +void skateshop_render_nonfocused( world_instance *world, vg_camera *cam ) +{ for( u32 j=0; jent_skateshop ); j ++ ){ ent_skateshop *shop = mdl_arritm(&world->ent_skateshop, j ); @@ -774,7 +788,8 @@ static void ent_skateshop_helpers_pickable( const char *acceptance ){ /* * Entity logic: entrance event */ -static void ent_skateshop_call( world_instance *world, ent_call *call ){ +void ent_skateshop_call( world_instance *world, ent_call *call ) +{ u32 index = mdl_entity_id_id( call->id ); ent_skateshop *shop = mdl_arritm( &world->ent_skateshop, index ); vg_info( "skateshop_call\n" );