#include "world_sfd.h"
#include "shaders/scene_scoretext.h"
#include "shaders/scene_vertex_blend.h"
+#include "network.h"
+#include "entity.h"
-static f32 sfd_encode_glyph( char c )
-{
+static f32 sfd_encode_glyph( char c ){
int value = 0;
if( c >= 'a' && c <= 'z' )
value = c-'a'+11;
return (float)value;
}
-VG_STATIC void sfd_encode( u32 row, const char *str )
+static void sfd_encode( u32 row, const char *str )
{
int end=0;
u32 row_h = world_sfd.h -1 -row;
}
}
-VG_STATIC void world_sfd_update( world_instance *world, v3f pos ){
+static void world_sfd_update( world_instance *world, v3f pos ){
if( mdl_arrcount( &world->ent_route ) ){
u32 closest = 0;
float min_dist = INFINITY;
}
}
- if( (world_sfd.active_route_board != closest) || network_scores_updated )
- {
+ if( (world_sfd.active_route_board != closest) || network_scores_updated ){
network_scores_updated = 0;
world_sfd.active_route_board = closest;
-
ent_route *route = mdl_arritm( &world->ent_route, closest );
- u32 id = route->official_track_id;
+
+ addon_reg *world_reg = world_static.addon_hub;
+ if( world_static.active_instance )
+ world_reg = world_static.addon_client;
+
+ char mod_uid[ ADDON_UID_MAX ];
+ addon_alias_uid( &world_reg->alias, mod_uid );
+
+ network_request_scoreboard(
+ mod_uid,
+ mdl_pstr( &world->meta, route->pstr_name ),
+ 0 );
+#if 0
+ u32 id = route->anon.official_track_id;
if( id != 0xffffffff ){
struct netmsg_board *local_board =
sfd_encode( 0, mdl_pstr( &world->meta, route->pstr_name ) );
sfd_encode( 1, "No data" );
}
+#endif
}
}
}
}
-VG_STATIC void bind_terrain_noise(void);
-VG_STATIC void sfd_render( world_instance *world, camera *cam, m4x3f transform )
-{
+static void bind_terrain_noise(void);
+static void sfd_render( world_instance *world, camera *cam, m4x3f transform ){
mesh_bind( &world_sfd.mesh_display );
shader_scene_scoretext_use();
shader_scene_scoretext_uTexMain(1);
-
- world_link_lighting_ub( world, _shader_scene_scoretext.id );
- world_bind_position_texture( world, _shader_scene_scoretext.id,
- _uniform_scene_scoretext_g_world_depth, 2 );
- world_bind_light_array( world, _shader_scene_scoretext.id,
- _uniform_scene_scoretext_uLightsArray, 3 );
- world_bind_light_index( world, _shader_scene_scoretext.id,
- _uniform_scene_scoretext_uLightsIndex, 4 );
+ WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_scoretext );
bind_terrain_noise();
shader_scene_vertex_blend_use();
shader_scene_vertex_blend_uTexGarbage(0);
shader_scene_vertex_blend_uTexGradients(1);
- world_link_lighting_ub( world, _shader_scene_vertex_blend.id );
- world_bind_position_texture( world, _shader_scene_vertex_blend.id,
- _uniform_scene_vertex_blend_g_world_depth, 2 );
- world_bind_light_array( world, _shader_scene_vertex_blend.id,
- _uniform_scene_vertex_blend_uLightsArray, 3 );
- world_bind_light_index( world, _shader_scene_vertex_blend.id,
- _uniform_scene_vertex_blend_uLightsIndex, 4 );
+ WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_vertex_blend );
+
bind_terrain_noise();
glActiveTexture( GL_TEXTURE1 );
glBindTexture( GL_TEXTURE_2D, world_sfd.tex_scoretex );
mdl_draw_submesh( &world_sfd.sm_base );
}
-VG_STATIC int world_sfd_test( int argc, const char *argv[] )
-{
+static int world_sfd_test( int argc, const char *argv[] ){
if( argc == 2 ){
int row = vg_min( vg_max(atoi(argv[0]),0), world_sfd.h);
sfd_encode( row, argv[1] );
return 0;
}
-VG_STATIC void world_sfd_init(void)
-{
+static void world_sfd_init(void){
vg_info( "world_sfd_init\n" );
shader_scene_scoretext_register();
vg_console_reg_cmd( "sfd", world_sfd_test, NULL );