X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=model.h;h=ba1c3f228c8cc827176bc9a8b4a92126c82cba8a;hb=888e62fcd8f9777cee774fbb8fab2e52660303a7;hp=c054d18127e27e85113a7437cff74f3748ac465a;hpb=23733c7ba8fac9eb4ac1f4839c400f0248abee6e;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/model.h b/model.h index c054d18..ba1c3f2 100644 --- a/model.h +++ b/model.h @@ -8,7 +8,7 @@ #include "skaterift.h" #define MDL_VERSION_MIN 101 -#define MDL_VERSION_NR 104 +#define MDL_VERSION_NR 105 enum mdl_shader{ k_shader_standard = 0, @@ -20,15 +20,19 @@ enum mdl_shader{ k_shader_boundary = 6, k_shader_fxglow = 7, k_shader_cubemap = 8, + k_shader_walking = 9, + k_shader_foliage = 10, k_shader_override = 30000 }; enum mdl_surface_prop{ - k_surface_prop_concrete = 0, - k_surface_prop_wood = 1, - k_surface_prop_grass = 2, - k_surface_prop_tiles = 3, - k_surface_prop_metal = 4 + k_surface_prop_concrete = 0, + k_surface_prop_wood = 1, + k_surface_prop_grass = 2, + k_surface_prop_tiles = 3, + k_surface_prop_metal = 4, + k_surface_prop_snow = 5, + k_surface_prop_sand = 6 }; enum material_flag{ @@ -608,8 +612,8 @@ static void async_mdl_load_glmesh( void *payload, u32 size ) 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" ); @@ -635,6 +639,16 @@ static void mdl_async_load_glmesh( mdl_context *mdl, glmesh *mesh ) mdl_load_array_file_buffer( mdl, arr_indices, job->indices, sizeof(mdl_indice) ); + if( fixup_table ){ + for( u32 i=0; ivertex_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) * --------------------------------------------------------- @@ -669,7 +683,7 @@ static void mdl_async_load_glmesh( mdl_context *mdl, glmesh *mesh ) /* 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; itextures ); i ++ ){ vg_linear_clear( vg_mem.scratch );