mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-10 03:51:18 +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" ) ) {
|
else if ( !_pico_stricmp( p->token, "usemtl" ) ) {
|
||||||
char *materialName;
|
char *materialName;
|
||||||
materialName = _pico_parse( p, 0 );
|
materialName = _pico_parse( p, 0 );
|
||||||
if( materialName || strlen( materialName ) ) {
|
if( materialName && strlen( materialName ) ) {
|
||||||
picoShader_t *shader;
|
picoShader_t *shader;
|
||||||
shader = PicoFindShader( model, materialName, 0 );
|
shader = PicoFindShader( model, materialName, 0 );
|
||||||
if( !shader ) {
|
if( !shader ) {
|
||||||
shader = PicoNewShader( model );
|
shader = PicoNewShader( model );
|
||||||
PicoSetShaderName( shader, materialName );
|
if( shader ) {
|
||||||
|
PicoSetShaderMapName( shader, materialName );
|
||||||
|
PicoSetShaderName( shader, materialName );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if( shader && curSurface ) {
|
if( shader && curSurface ) {
|
||||||
PicoSetSurfaceShader( curSurface, shader );
|
PicoSetSurfaceShader( curSurface, shader );
|
||||||
|
|
Loading…
Reference in a new issue