k_shader_boundary = 6,
k_shader_fxglow = 7,
k_shader_cubemap = 8,
+ k_shader_walking = 9,
+ k_shader_foliage = 10,
k_shader_override = 30000
};
job->indices, job->indice_count );
}
-static void mdl_async_load_glmesh( mdl_context *mdl, glmesh *mesh )
-{
+static void mdl_async_load_glmesh( mdl_context *mdl, glmesh *mesh,
+ u32 *fixup_table ){
mdl_array *arr_vertices = mdl_find_array( mdl, "mdl_vert" );
mdl_array *arr_indices = mdl_find_array( mdl, "mdl_indice" );
mdl_load_array_file_buffer( mdl, arr_indices, job->indices,
sizeof(mdl_indice) );
+ if( fixup_table ){
+ for( u32 i=0; i<job->vertex_count; i ++ ){
+ mdl_vert *vert = &job->verts[i];
+
+ for( u32 j=0; j<4; j++ ){
+ vert->groups[j] = fixup_table[vert->groups[j]];
+ }
+ }
+ }
+
/*
* Unpack the indices (if there are meshes)
* ---------------------------------------------------------
/* uploads the glmesh, and textures. everything is saved into the mdl_context */
static void mdl_async_full_load_std( mdl_context *mdl ){
- mdl_async_load_glmesh( mdl, &mdl->mesh );
+ mdl_async_load_glmesh( mdl, &mdl->mesh, NULL );
for( u32 i=0; i<mdl_arrcount( &mdl->textures ); i ++ ){
vg_linear_clear( vg_mem.scratch );