-#ifndef RESPAWN_C
-#define RESPAWN_C
-
-#include "world_map.h"
#include "skaterift.h"
+#include "world_map.h"
#include "world.h"
#include "input.h"
#include "gui.h"
#include "menu.h"
#include "scene.h"
+struct world_map world_map;
+
static void world_map_get_dir( v3f dir ){
/* idk */
dir[0] = -sqrtf(0.5f);
plane_pos[1] = co[2];
}
-static void respawn_map_draw_icon( camera *cam,
- enum gui_icon icon, v3f pos ){
+static void respawn_map_draw_icon( vg_camera *cam,
+ enum gui_icon icon, v3f pos ){
v4f v;
v3_copy( pos, v );
v[3] = 1.0f;
gui_draw_icon( icon, (v2f){ v[0]*0.5f+0.5f,v[1]*0.5f+0.5f }, 1.0f );
}
-static void world_map_pre_update(void){
+void world_map_pre_update(void)
+{
if( skaterift.activity != k_skaterift_world_map ) return;
if( button_down( k_srbind_mback ) ){
v2_maxv( (v2f){ bbx[0][0], bbx[0][2] }, pos, pos );
/* update camera */
- camera *cam = &world_map.cam;
+ vg_camera *cam = &world_map.cam;
v3f dir;
world_map_get_dir(dir);
cam->nearz = 10.0f;
cam->fov = 40.0f;
- camera_update_transform( cam );
- camera_update_view( cam );
- camera_update_projection( cam );
- camera_finalize( cam );
+ vg_camera_update_transform( cam );
+ vg_camera_update_view( cam );
+ vg_camera_update_projection( cam );
+ vg_camera_finalize( cam );
/* pick spawn */
world_map.spawn = NULL;
respawn_map_draw_icon( cam, k_gui_icon_rift_run_2d,
route->board_transform[3] );
}
+
+ for( u32 i=0; i<mdl_arrcount(&world->ent_glider); i ++ ){
+ ent_glider *glider = mdl_arritm( &world->ent_glider, i );
+
+ v4f colour = { 1,1,1,1 };
+
+ if( !(glider->flags & 0x1) )
+ v3_muls( colour, 0.5f, colour );
+ gui_icon_setcolour( colour );
+
+ respawn_map_draw_icon( cam, k_gui_icon_glider, glider->transform.co );
+ }
}
-static void world_map_enter(void){
+void world_map_enter(void)
+{
skaterift.activity = k_skaterift_world_map;
world_map.world_id = world_static.active_instance;
vg_str text;
if( gui_new_helper( input_joy_list[k_srjoystick_steer], &text ) )
- vg_strcat( &text, "move" );
+ vg_strcat( &text, "Move" );
if( gui_new_helper( input_button_list[k_srbind_maccept], &text ) )
- vg_strcat( &text, "spawn" );
+ vg_strcat( &text, "Spawn" );
if( gui_new_helper( input_button_list[k_srbind_mback], &text ) )
- vg_strcat( &text, "exit" );
+ vg_strcat( &text, "Exit" );
}
-
-#endif /* RESPAWN_C */