From: hgn Date: Fri, 6 Sep 2024 03:26:42 +0000 (+0100) Subject: change list_size to ARRAY_LEN X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=10688ca396083596dc7464af70d9d970ae3717e0;p=carveJwlIkooP6JGAAIwe30JlM.git change list_size to ARRAY_LEN --- diff --git a/addon.c b/addon.c index 34e16f8..6769b5a 100644 --- a/addon.c +++ b/addon.c @@ -486,7 +486,7 @@ void addon_mount_workshop_items(void) struct async_workshop_filepath_info *info = call1->payload; info->buf = path; info->id = id; - info->len = vg_list_size(path); + info->len = VG_ARRAY_LEN(path); vg_async_dispatch( call1, async_workshop_get_filepath ); vg_async_stall(); /* too bad! */ diff --git a/audio.c b/audio.c index a5080cd..dda8a2d 100644 --- a/audio.c +++ b/audio.c @@ -180,28 +180,28 @@ static audio_clip air_synth = { void audio_init(void) { - audio_clip_loadn( audio_board, vg_list_size(audio_board), NULL ); - audio_clip_loadn( audio_taps, vg_list_size(audio_taps), NULL ); - audio_clip_loadn( audio_flips, vg_list_size(audio_flips), NULL ); - audio_clip_loadn( audio_hits, vg_list_size(audio_hits), NULL ); - audio_clip_loadn( audio_ambience, vg_list_size(audio_ambience), NULL ); + audio_clip_loadn( audio_board, VG_ARRAY_LEN(audio_board), NULL ); + audio_clip_loadn( audio_taps, VG_ARRAY_LEN(audio_taps), NULL ); + audio_clip_loadn( audio_flips, VG_ARRAY_LEN(audio_flips), NULL ); + audio_clip_loadn( audio_hits, VG_ARRAY_LEN(audio_hits), NULL ); + audio_clip_loadn( audio_ambience, VG_ARRAY_LEN(audio_ambience), NULL ); audio_clip_loadn( &audio_splash, 1, NULL ); audio_clip_loadn( &audio_gate_pass, 1, NULL ); audio_clip_loadn( &audio_gate_lap, 1, NULL ); audio_clip_loadn( &audio_gate_ambient, 1, NULL ); - audio_clip_loadn( audio_jumps, vg_list_size(audio_jumps), NULL ); - audio_clip_loadn( audio_lands, vg_list_size(audio_lands), NULL ); - audio_clip_loadn( audio_water, vg_list_size(audio_water), NULL ); - audio_clip_loadn( audio_grass, vg_list_size(audio_grass), NULL ); - audio_clip_loadn( audio_footsteps, vg_list_size(audio_footsteps), NULL ); + audio_clip_loadn( audio_jumps, VG_ARRAY_LEN(audio_jumps), NULL ); + audio_clip_loadn( audio_lands, VG_ARRAY_LEN(audio_lands), NULL ); + audio_clip_loadn( audio_water, VG_ARRAY_LEN(audio_water), NULL ); + audio_clip_loadn( audio_grass, VG_ARRAY_LEN(audio_grass), NULL ); + audio_clip_loadn( audio_footsteps, VG_ARRAY_LEN(audio_footsteps), NULL ); audio_clip_loadn( audio_footsteps_grass, - vg_list_size(audio_footsteps_grass), NULL ); + VG_ARRAY_LEN(audio_footsteps_grass), NULL ); audio_clip_loadn( audio_footsteps_wood, - vg_list_size(audio_footsteps_wood), NULL ); - audio_clip_loadn( audio_rewind, vg_list_size(audio_rewind), NULL ); - audio_clip_loadn( audio_ui, vg_list_size(audio_ui), NULL ); - audio_clip_loadn( audio_challenge, vg_list_size(audio_challenge), NULL ); + VG_ARRAY_LEN(audio_footsteps_wood), NULL ); + audio_clip_loadn( audio_rewind, VG_ARRAY_LEN(audio_rewind), NULL ); + audio_clip_loadn( audio_ui, VG_ARRAY_LEN(audio_ui), NULL ); + audio_clip_loadn( audio_challenge, VG_ARRAY_LEN(audio_challenge), NULL ); audio_lock(); audio_set_lfo_wave( 0, k_lfo_polynomial_bipolar, 80.0f ); diff --git a/client.c b/client.c index b958425..e06c253 100644 --- a/client.c +++ b/client.c @@ -10,6 +10,8 @@ #include "player_remote.h" #include "menu.h" +const char* __asan_default_options() { return "detect_leaks=0"; } + struct game_client g_client = { .demo_mode = 1 @@ -77,7 +79,7 @@ void vg_launch_opt(void) int main( int argc, char *argv[] ) { network_set_host( "skaterift.com", NULL ); - vg_mem.use_libc_malloc = 0; + vg_mem.use_libc_malloc = 1; vg_set_mem_quota( 160*1024*1024 ); vg_enter( argc, argv, "Voyager Game Engine" ); return 0; diff --git a/ent_relay.c b/ent_relay.c index 1f97584..b22b0b5 100644 --- a/ent_relay.c +++ b/ent_relay.c @@ -7,7 +7,7 @@ entity_call_result ent_relay_call( world_instance *world, ent_call *call ) if( call->function == 0 ) { - for( u32 i=0; itargets); i++ ) + for( u32 i=0; itargets); i++ ) { if( relay->targets[i][0] ) { diff --git a/ent_skateshop.c b/ent_skateshop.c index f2b4a17..ded707c 100644 --- a/ent_skateshop.c +++ b/ent_skateshop.c @@ -445,7 +445,7 @@ void skateshop_world_preupdate( world_instance *world ) static void skateshop_render_boardshop( ent_skateshop *shop ){ world_instance *world = world_current_instance(); - u32 slot_count = vg_list_size(global_skateshop.shop_view_slots); + u32 slot_count = VG_ARRAY_LEN(global_skateshop.shop_view_slots); ent_marker *mark_rack = mdl_arritm( &world->ent_marker, mdl_entity_id_id(shop->boards.id_rack)), @@ -733,7 +733,7 @@ void skateshop_render_nonfocused( world_instance *world, vg_camera *cam ) if( !mark_rack ) continue; - u32 slot_count = vg_list_size(global_skateshop.shop_view_slots); + u32 slot_count = VG_ARRAY_LEN(global_skateshop.shop_view_slots); for( u32 i=0; i= vg_list_size(table) ){ + if( type >= VG_ARRAY_LEN(table) ){ vg_error( "call to entity type: %u is out of range\n", type ); return; } diff --git a/gui.h b/gui.h index 3823c15..46e2e1e 100644 --- a/gui.h +++ b/gui.h @@ -78,7 +78,7 @@ static void gui_helper_clear(void){ } static struct gui_helper *gui_new_helper( vg_input_op *bind, vg_str *out_text ){ - if( gui.helper_count >= vg_list_size(gui.helpers) ){ + if( gui.helper_count >= VG_ARRAY_LEN(gui.helpers) ){ vg_error( "Too many helpers\n" ); return NULL; } @@ -283,7 +283,7 @@ static int gui_showtrick_ccmd( int argc, const char *argv[] ) static void gui_draw_icon( enum gui_icon icon, v2f co, f32 size ) { - if( gui.icon_draw_count == vg_list_size(gui.icon_draw_buffer) ) + if( gui.icon_draw_count == VG_ARRAY_LEN(gui.icon_draw_buffer) ) return; struct icon_call *call = &gui.icon_draw_buffer[ gui.icon_draw_count ++ ]; diff --git a/menu.c b/menu.c index f9b4c3e..1f2b9c8 100644 --- a/menu.c +++ b/menu.c @@ -613,7 +613,7 @@ void menu_gui( ui_context *ctx ) if( menu.main_index == -1 ) menu.main_index ++; - if( menu.main_index == vg_list_size(opts) ) + if( menu.main_index == VG_ARRAY_LEN(opts) ) menu.main_index --; audio_lock(); @@ -635,7 +635,7 @@ void menu_gui( ui_context *ctx ) x += 32 + spacer; } - for( i32 i=0; ifile ); fclose( mdl->file ); - vg_file_print_invalid( mdl->file ); - vg_fatal_error( "Corrupt model" ); + vg_fatal_exit(); } /* @@ -33,8 +34,10 @@ void mdl_fread_pack_file( mdl_context *mdl, mdl_file *info, void *dst ) { if( !info->pack_size ) { - vg_warn( "path: %s\n", mdl_pstr( mdl, info->pstr_path ) ); - vg_fatal_error( "Packed file is only a header; it is not packed" ); + vg_fatal_condition(); + vg_info( "Packed file is only a header; it is not packed" ); + vg_info( "path: %s\n", mdl_pstr( mdl, info->pstr_path ) ); + vg_fatal_exit(); } fseek( mdl->file, mdl->pack_base_offset+info->pack_offset, SEEK_SET ); @@ -350,8 +353,9 @@ void mdl_open( mdl_context *mdl, const char *path, void *lin_alloc ) if( !mdl->file ) { - vg_error( "mdl_open('%s'): %s\n", path, strerror(errno) ); - vg_fatal_error( "see above for details" ); + vg_fatal_condition(); + vg_info( "mdl_open('%s'): %s\n", path, strerror(errno) ); + vg_fatal_exit(); } u64 l = fread( &mdl->info, sizeof(mdl_header), 1, mdl->file ); @@ -360,11 +364,12 @@ void mdl_open( mdl_context *mdl, const char *path, void *lin_alloc ) if( mdl->info.version < MDL_VERSION_MIN ) { - vg_warn( "For model: %s\n", path ); - vg_warn( " version: %u (min: %u, current: %u)\n", + vg_fatal_condition(); + vg_info( "Legacy model version incompatable" ); + vg_info( "For model: %s\n", path ); + vg_info( " version: %u (min: %u, current: %u)\n", mdl->info.version, MDL_VERSION_MIN, MDL_VERSION_NR ); - - vg_fatal_error( "Legacy model version incompatable" ); + vg_fatal_exit(); } mdl_load_array_file( mdl, &mdl->index, &mdl->info.index, lin_alloc, @@ -465,8 +470,6 @@ static void mesh_upload( glmesh *mesh, stride, (void *)offsetof(mdl_vert, groups) ); glEnableVertexAttribArray( 5 ); - VG_CHECK_GL_ERR(); - mesh->indice_count = indice_count; mesh->loaded = 1; } @@ -618,7 +621,9 @@ void mdl_async_load_glmesh( mdl_context *mdl, glmesh *mesh, u32 *fixup_table ) } else { - vg_fatal_error( "no vertex/indice data\n" ); + vg_fatal_condition(); + vg_info( "No vertex/indice data in model file\n" ); + vg_fatal_exit(); } } diff --git a/network.c b/network.c index 6d6178e..0869612 100644 --- a/network.c +++ b/network.c @@ -57,7 +57,7 @@ static void on_auth_ticket_recieved( void *result, void *context ){ if( SteamAPI_ISteamUser_GetEncryptedAppTicket( hSteamUser, network_client.app_symmetric_key, - vg_list_size(network_client.app_symmetric_key), + VG_ARRAY_LEN(network_client.app_symmetric_key), &network_client.app_key_length )){ vg_success( " Loaded app ticket\n" ); } @@ -316,7 +316,7 @@ static void network_disconnect(void){ network_client.remote = 0; network_client.state = k_ESteamNetworkingConnectionState_None; - for( int i=0; istatus == k_world_status_loaded ){ world_routes_clear( instance ); diff --git a/player_glide.c b/player_glide.c index 3cbcb28..d9977ce 100644 --- a/player_glide.c +++ b/player_glide.c @@ -214,7 +214,7 @@ bool glider_physics( v2f steer ) rigidbody _null = {0}; _null.inv_mass = 0.0f; m3x3_zero( _null.iI ); - for( u32 i=0; i < vg_list_size(player_glide.parts); i ++ ){ + for( u32 i=0; i < VG_ARRAY_LEN(player_glide.parts); i ++ ){ m4x3f mmdl; m4x3_mul( rb->to_world, player_glide.parts[i].mdl, mmdl ); @@ -401,7 +401,7 @@ void player_glide_bind(void) m3x3f I; m3x3_zero( I ); - for( u32 i=0; itransform.co, player_glide.trail_positions[ player_glide.trail_count ++ ] ); - if( player_glide.trail_count == vg_list_size(trails_glider) ) + if( player_glide.trail_count == VG_ARRAY_LEN(trails_glider) ) break; } /* allocate effects */ - for( u32 i=0; istatus == k_world_status_loaded ){ world_routes_clear( instance ); diff --git a/player_ragdoll.c b/player_ragdoll.c index 6f9d430..1527d10 100644 --- a/player_ragdoll.c +++ b/player_ragdoll.c @@ -177,7 +177,7 @@ void setup_ragdoll_from_skeleton( struct skeleton *sk, if( !(bone->collider) ) continue; - if( rd->part_count > vg_list_size(rd->parts) ) + if( rd->part_count > VG_ARRAY_LEN(rd->parts) ) vg_fatal_error( "Playermodel has too many colliders" ); u32 part_id = rd->part_count; diff --git a/player_remote.c b/player_remote.c index e8ca56c..6fdf04f 100644 --- a/player_remote.c +++ b/player_remote.c @@ -60,7 +60,7 @@ static void relink_remote_player_worlds( u32 client_id ){ */ void relink_all_remote_player_worlds(void) { - for( u32 i=0; iactive ) relink_remote_player_worlds(i); @@ -84,7 +84,7 @@ void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ) netmsg_playerjoin *playerjoin = msg->m_pData; if( !packet_minsize( msg, sizeof(*playerjoin) )) return; - if( playerjoin->index < vg_list_size(netplayers.list) ){ + if( playerjoin->index < VG_ARRAY_LEN(netplayers.list) ){ struct network_player *player = &netplayers.list[ playerjoin->index ]; player_remote_clear( player ); player->active = 1; @@ -97,7 +97,7 @@ void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ) struct interp_buffer *buf = &netplayers.interp_data[playerjoin->index]; buf->t = -99999999.9; - for( u32 i=0; iframes); i ++ ){ + for( u32 i=0; iframes); i ++ ){ buf->frames[i].active = 0; } @@ -112,7 +112,7 @@ void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ) netmsg_playerleave *playerleave = msg->m_pData; if( !packet_minsize( msg, sizeof(*playerleave) )) return; - if( playerleave->index < vg_list_size(netplayers.list) ){ + if( playerleave->index < VG_ARRAY_LEN(netplayers.list) ){ struct network_player *player = &netplayers.list[ playerleave->index ]; player_remote_clear( player ); player->active = 0; @@ -126,7 +126,7 @@ void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ) netmsg_playerusername *update = msg->m_pData; if( !packet_minsize( msg, sizeof(*update) )) return; - if( update->index < vg_list_size(netplayers.list) ){ + if( update->index < VG_ARRAY_LEN(netplayers.list) ){ struct network_player *player = &netplayers.list[ update->index ]; network_msgstring( update->name, msg->m_cbSize, sizeof(*update), @@ -149,7 +149,7 @@ void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ) netmsg_playerframe *frame = msg->m_pData; - if( frame->client >= vg_list_size(netplayers.list) ){ + if( frame->client >= VG_ARRAY_LEN(netplayers.list) ){ vg_error( "inetmsg_playerframe: player index out of range\n" ); return; } @@ -163,7 +163,7 @@ void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ) struct interp_frame *dest = NULL; f64 min_time = INFINITY; - for( u32 i=0; iframes); i++ ){ + for( u32 i=0; iframes); i++ ){ struct interp_frame *ifr = &ib->frames[i]; if( !ifr->active ){ @@ -253,7 +253,7 @@ void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ) netmsg_playeritem *item = msg->m_pData; if( !packet_minsize( msg, sizeof(*item)+1 )) return; - if( item->client >= vg_list_size(netplayers.list) ){ + if( item->client >= VG_ARRAY_LEN(netplayers.list) ){ vg_error( "inetmsg_playerframe: player index out of range\n" ); return; } @@ -402,7 +402,7 @@ void remote_player_debug_update(void) netplayers.last_data_measurement = vg.time_real; u32 total_down = 0; - for( u32 i=0; iactive ){ total_down += player->down_bytes; @@ -470,7 +470,7 @@ void remote_player_network_imgui( ui_context *ctx, m4x4f pv ) { k_ESteamNetworkingConnectionState_Linger, "Linger" }, { k_ESteamNetworkingConnectionState_Dead, "Dead" } }; - for( u32 i=0; iactive ) @@ -636,7 +636,7 @@ void animate_remote_player( u32 index ) *abs_max_frame = NULL; struct interp_buffer *buf = &netplayers.interp_data[index]; - for( u32 i=0; iframes); i ++ ){ + for( u32 i=0; iframes); i ++ ){ struct interp_frame *ifr = &buf->frames[i]; if( ifr->active ){ @@ -680,7 +680,7 @@ void animate_remote_player( u32 index ) */ void animate_remote_players(void) { - for( u32 i=0; iactive ) continue; diff --git a/player_replay.c b/player_replay.c index 0db1ca4..950ad78 100644 --- a/player_replay.c +++ b/player_replay.c @@ -1124,7 +1124,7 @@ void skaterift_replay_imgui( ui_context *ctx ) if( !absorb_by_keyframe && ui_click_down( ctx, UI_MOUSE_LEFT ) ) { - u32 max = vg_list_size( player_replay.keyframes ); + u32 max = VG_ARRAY_LEN( player_replay.keyframes ); if( player_replay.keyframe_count == max ) { ui_start_modal( ctx, "Maximum keyframes reached", UI_MODAL_BAD ); diff --git a/player_skate.c b/player_skate.c index 5024750..aea7027 100644 --- a/player_skate.c +++ b/player_skate.c @@ -59,7 +59,7 @@ void player__skate_bind(void){ { &player_skate.anim_handplant, "handplant" }, }; - for( u32 i=0; inormal ); sample_count ++; - if( sample_count == vg_list_size( samples ) ) + if( sample_count == VG_ARRAY_LEN( samples ) ) goto too_many_samples; } } @@ -3248,7 +3248,7 @@ void player__skate_pose( void *_animator, player_pose *pose ){ 0.75f, 0.75f }; - for( int i=0; ikeyframes[apply_to[i]-1].co[0] += animator->offset[0]*add_grab_mod; pose->keyframes[apply_to[i]-1].co[2] += animator->offset[2]*add_grab_mod; } @@ -3258,7 +3258,7 @@ void player__skate_pose( void *_animator, player_pose *pose ){ v3f origin; v3_add( sk->bones[localplayer.id_hip].co, kf_hip->co, origin ); - for( int i=0; ikeyframes[apply_to[i]-1]; keyframe_rotate_around( kf, origin, sk->bones[apply_to[i]].co, animator->qfixuptotal ); @@ -3439,7 +3439,7 @@ void player__skate_pose( void *_animator, player_pose *pose ){ v4f qskid; q_axis_angle( qskid, (v3f){0,1,0}, -animator->steer[1]*0.2f ); - for( u32 i=0; ikeyframes[ skidders[i]-1 ]; keyframe_rotate_around( kf, (v3f){0,0,0.4f*(animator->z*2.0f-1.0f)*amt}, diff --git a/render.c b/render.c index aa0cfab..fada4a5 100644 --- a/render.c +++ b/render.c @@ -53,8 +53,6 @@ static void async_render_init( void *payload, u32 size ) sizeof(float)*2, (void*)0 ); glEnableVertexAttribArray( 0 ); - VG_CHECK_GL_ERR(); - glBindFramebuffer( GL_FRAMEBUFFER, 0 ); g_render.ready = 1; } diff --git a/scene.c b/scene.c index f472f2c..a94fbca 100644 --- a/scene.c +++ b/scene.c @@ -214,8 +214,6 @@ void async_scene_upload( void *payload, u32 size ) stride, (void *)offsetof(scene_vert, uv) ); glEnableVertexAttribArray( 2 ); - VG_CHECK_GL_ERR(); - mesh->indice_count = ctx->indice_count; mesh->loaded = 1; diff --git a/skaterift.c b/skaterift.c index d9ff9d1..36e087f 100644 --- a/skaterift.c +++ b/skaterift.c @@ -351,7 +351,7 @@ static void render_scene(void) /* Draw world */ glEnable( GL_DEPTH_TEST ); - for( u32 i=0; i= vg_list_size(world_static.instances) ){ + if( index >= VG_ARRAY_LEN(world_static.instances) ){ vg_error( "Instance ID out of range (%u)\n", index ); return; } diff --git a/world_entity.c b/world_entity.c index e75cb29..b85e6fa 100644 --- a/world_entity.c +++ b/world_entity.c @@ -129,7 +129,7 @@ void world_entity_focus_preupdate(void) [ k_ent_npc ] = ent_npc_preupdate, }; - if( (type > vg_list_size(table)) || (table[type] == NULL) ) + if( (type > VG_ARRAY_LEN(table)) || (table[type] == NULL) ) { vg_fatal_error( "No pre-update method set for entity (%u#%u)\n", type, index ); @@ -255,7 +255,7 @@ void world_gen_entities_init( world_instance *world ) { k_ent_npc, &world->ent_npc } }; - for( u32 i=0; iname, mdl_pstr(&world->meta,route->pstr_name))){ diff --git a/world_gate.c b/world_gate.c index 2a236d4..3e6fdbb 100644 --- a/world_gate.c +++ b/world_gate.c @@ -354,7 +354,7 @@ void world_link_gates_async( void *payload, u32 size ) const char *key = mdl_pstr( &world->meta, gate->key ); vg_info( "key: %s\n", key ); - for( u32 i=0; istatus != k_world_status_loaded ) continue; diff --git a/world_gen.c b/world_gen.c index 91e5b7b..e51836d 100644 --- a/world_gen.c +++ b/world_gen.c @@ -71,10 +71,10 @@ static void world_gen_add_blob( vg_rand *rand, world_instance *world, const u32 indices[] = { 0,1,3, 0,3,2, 2,3,5, 2,5,4 }; - if( scene->vertex_count + vg_list_size(verts) > scene->max_vertices ) + if( scene->vertex_count + VG_ARRAY_LEN(verts) > scene->max_vertices ) vg_fatal_error( "Scene vertex buffer overflow" ); - if( scene->indice_count + vg_list_size(indices) > scene->max_indices ) + if( scene->indice_count + VG_ARRAY_LEN(indices) > scene->max_indices ) vg_fatal_error( "Scene index buffer overflow" ); scene_vert *dst_verts = &scene->arrvertices[ scene->vertex_count ]; @@ -82,7 +82,7 @@ static void world_gen_add_blob( vg_rand *rand, world_instance *world, scene_vert *ref = &world->scene_geo.arrvertices[ hit->tri[0] ]; - for( u32 i=0; iuv, pvert->uv ); } - for( u32 i=0; ivertex_count; - scene->vertex_count += vg_list_size(verts); - scene->indice_count += vg_list_size(indices); + scene->vertex_count += VG_ARRAY_LEN(verts); + scene->indice_count += VG_ARRAY_LEN(indices); } /* @@ -485,7 +485,7 @@ void world_gen_compute_light_indices( world_instance *world ) u32 count = 0; float influences[6] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; - const int N = vg_list_size( influences ); + const int N = VG_ARRAY_LEN( influences ); for( u32 j=0; jent_light); j ++ ){ ent_light *light = mdl_arritm( &world->ent_light, j ); diff --git a/world_load.c b/world_load.c index dafd58d..30c2b2c 100644 --- a/world_load.c +++ b/world_load.c @@ -438,7 +438,7 @@ int world_freeable( world_instance *world ) if( world->status != k_world_status_unloading ) return 0; u8 world_id = (world - world_static.instances) + 1; - for( u32 i=world_id; iubo_lighting ); - VG_CHECK_GL_ERR(); } } @@ -551,11 +550,11 @@ static void world_render_challenges( world_instance *world, index = mdl_entity_id_id( id ); if( type == k_ent_objective ) { - if( objective_count < vg_list_size(objective_list) ) + if( objective_count < VG_ARRAY_LEN(objective_list) ) objective_list[ objective_count ++ ] = index; } else if( type == k_ent_challenge ){ - if( challenge_count < vg_list_size(challenge_list) ) + if( challenge_count < VG_ARRAY_LEN(challenge_list) ) challenge_list[ challenge_count ++ ] = index; } } @@ -979,12 +978,12 @@ static void render_other_entities( world_instance *world, vg_camera *cam ) if( type == k_ent_glider ) { - if( glider_count < vg_list_size(glider_list) ) + if( glider_count < VG_ARRAY_LEN(glider_list) ) glider_list[ glider_count ++ ] = index; } else if( type == k_ent_npc ) { - if( npc_count < vg_list_size(npc_list) ) + if( npc_count < VG_ARRAY_LEN(npc_list) ) npc_list[ npc_count ++ ] = index; } } diff --git a/world_routes.c b/world_routes.c index c4b3393..e4fd80e 100644 --- a/world_routes.c +++ b/world_routes.c @@ -203,7 +203,7 @@ static void world_routes_debug( world_instance *world ) u32 cc = 0xffcccccc; if( route->active_checkpoint != 0xffff ){ - cc = colours[i%vg_list_size(colours)]; + cc = colours[i%VG_ARRAY_LEN(colours)]; } for( int i=0; icheckpoints_count; i++ ){ @@ -564,7 +564,7 @@ void world_gen_routes_ent_init( world_instance *world ) route->flags |= k_ent_route_flag_out_of_zone; route->anon.official_track_id = 0xffffffff; - for( u32 j=0; jmeta,route->pstr_name))){ route->anon.official_track_id = j; diff --git a/world_volumes.c b/world_volumes.c index ae507d0..b74e493 100644 --- a/world_volumes.c +++ b/world_volumes.c @@ -78,7 +78,7 @@ void world_volumes_update( world_instance *world, v3f pos ) goto next_volume; if( world_static.active_trigger_volume_count > - vg_list_size(world_static.active_trigger_volumes) ) continue; + VG_ARRAY_LEN(world_static.active_trigger_volumes) ) continue; v3f local; m4x3_mulv( volume->to_local, pos, local );