#include "world_load.h"
#include "world_volumes.h"
#include "world_gate.h"
+#include <string.h>
/*
* Add all triangles from the model, which match the material ID
vg_align8(sizeof(GLuint)*world->texture_count) );
world->textures[0] = vg.tex_missing;
- for( u32 i=0; i<mdl_arrcount(&world->meta.textures); i++ ){
+ for( u32 i=0; i<mdl_arrcount(&world->meta.textures); i++ )
+ {
mdl_texture *tex = mdl_arritm( &world->meta.textures, i );
- if( !tex->file.pack_size ){
+ if( !tex->file.pack_size )
+ {
vg_fatal_error( "World models must have packed textures!" );
}
struct world_surface *errmat = &world->surfaces[0];
memset( errmat, 0, sizeof(struct world_surface) );
- for( u32 i=0; i<mdl_arrcount(&world->meta.materials); i++ ){
+ for( u32 i=0; i<mdl_arrcount(&world->meta.materials); i++ )
+ {
struct world_surface *surf = &world->surfaces[i+1];
surf->info = *(mdl_material *)mdl_arritm( &world->meta.materials, i );
surf->flags = 0;
+
+ if( surf->info.shader == k_shader_standard_cutout ||
+ surf->info.shader == k_shader_foliage )
+ {
+ struct shader_props_standard *props = surf->info.props.compiled;
+ surf->alpha_tex = props->tex_diffuse;
+ }
+ else
+ surf->alpha_tex = 0;
}
}