proxy models
[carveJwlIkooP6JGAAIwe30JlM.git] / ent_miniworld.c
index bc59d470f6c17e2aeb6ee8f169c76a4f4839c661..54ce8ae5c6782752897d639da0014fbad417430e 100644 (file)
@@ -14,6 +14,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 +38,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];