struct world_pass *pass ){
if( !mdl_arrcount( &world->ent_prop ) ) return;
- /* HACK: use the first material for every prop entity */
- ent_prop *first = mdl_arritm( &world->ent_prop, 0 );
- if( !first->submesh_count ) return;
-
- mdl_submesh *sm = mdl_arritm( &world->meta.submeshs, first->submesh_start );
- if( sm->material_id != material_id ) return;
struct world_surface *mat = &world->surfaces[ material_id ];
pass->fn_bind_textures( world, mat );
if( prop->flags & 0x1 ) continue;
for( u32 k=0; k<prop->submesh_count; k++ ){
- sm = mdl_arritm( &world->meta.submeshs, prop->submesh_start+k );
+ mdl_submesh *sm =
+ mdl_arritm( &world->meta.submeshs, prop->submesh_start+k );
+
+ if( sm->material_id != material_id ) continue;
m4x3f mmdl;
mdl_transform_m4x3( &prop->transform, mmdl );