X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_miniworld.c;h=cd79b4552626ca5dda89aac1bbcd0b7d1ef63419;hb=7f4c71033c06954f3094c9d51219628438b80ac8;hp=bc59d470f6c17e2aeb6ee8f169c76a4f4839c661;hpb=63fe317d7db724162561da52aa382c82ac3c29be;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_miniworld.c b/ent_miniworld.c index bc59d47..cd79b45 100644 --- a/ent_miniworld.c +++ b/ent_miniworld.c @@ -1,6 +1,7 @@ #include "entity.h" #include "ent_miniworld.h" #include "world_render.h" +#include "input.h" static void ent_miniworld_call( world_instance *world, ent_call *call ){ ent_miniworld *miniworld = mdl_arritm( &world->ent_miniworld, @@ -14,6 +15,19 @@ static void ent_miniworld_call( world_instance *world, ent_call *call ){ global_miniworld.active_id = call->id; } + else if( call->function == 1 ){ + + if( global_miniworld.active_id == call->id ) + global_miniworld.active_id = 0; + else + vg_warn( "bad call\n" ); + + if( miniworld->proxy ){ + ent_prop *prop = mdl_arritm( &world->ent_prop, + mdl_entity_id_id(miniworld->proxy) ); + prop->flags &= ~0x1; + } + } } static void ent_miniworld_render( world_instance *host_world ){ @@ -25,7 +39,20 @@ static void ent_miniworld_render( world_instance *host_world ){ ent_miniworld *miniworld = mdl_arritm( &host_world->ent_miniworld, mdl_entity_id_id(entity_id) ); + int rendering = 1; if( miniworld->purpose == k_world_purpose_invalid ) + rendering = 0; + + if( miniworld->proxy ){ + ent_prop *prop = mdl_arritm( &host_world->ent_prop, + mdl_entity_id_id(miniworld->proxy) ); + if( !rendering ) + prop->flags &= ~0x1; + else + prop->flags |= 0x1; + } + + if( !rendering ) return; world_instance *dest_world = &world_static.instances[miniworld->purpose]; @@ -37,3 +64,12 @@ static void ent_miniworld_render( world_instance *host_world ){ //render_world_routes( , &skaterift.cam, 1 ); } + +static void ent_miniworld_preupdate(void){ + if( !global_miniworld.active_id ) + return; + + if( button_down( k_srbind_use ) ){ + + } +}