mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-09 23:01:55 +00:00
Fix obj crash (#399)
This commit is contained in:
parent
1d0feb0a4a
commit
d90ddd6cf8
1 changed files with 5 additions and 2 deletions
|
@ -863,12 +863,15 @@ static picoModel_t *_obj_load( PM_PARAMS_LOAD ){
|
|||
else if ( !_pico_stricmp( p->token, "usemtl" ) ) {
|
||||
char *materialName;
|
||||
materialName = _pico_parse( p, 0 );
|
||||
if( materialName || strlen( materialName ) ) {
|
||||
if( materialName && strlen( materialName ) ) {
|
||||
picoShader_t *shader;
|
||||
shader = PicoFindShader( model, materialName, 0 );
|
||||
if( !shader ) {
|
||||
shader = PicoNewShader( model );
|
||||
PicoSetShaderName( shader, materialName );
|
||||
if( shader ) {
|
||||
PicoSetShaderMapName( shader, materialName );
|
||||
PicoSetShaderName( shader, materialName );
|
||||
}
|
||||
}
|
||||
if( shader && curSurface ) {
|
||||
PicoSetSurfaceShader( curSurface, shader );
|
||||
|
|
Loading…
Reference in a new issue