From: Zack Middleton Date: Wed, 31 Oct 2018 02:00:20 +0000 (-0500) Subject: Print OBJ/MTL filename in all picomodel OBJ loader messages X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=54ae19e50ef2565fdce98c852a6996149c4f54ca;p=xonotic%2Fnetradiant.git Print OBJ/MTL filename in all picomodel OBJ loader messages Filename was previously only displayed in OBJ fatal error. --- diff --git a/libs/picomodel/pm_obj.c b/libs/picomodel/pm_obj.c index e342ab08..3e2a65db 100644 --- a/libs/picomodel/pm_obj.c +++ b/libs/picomodel/pm_obj.c @@ -291,7 +291,7 @@ static int _obj_mtl_load( picoModel_t *model ){ /* validate material name */ if ( name == NULL || !strlen( name ) ) { - _pico_printf( PICO_ERROR,"Missing material name in MTL, line %d.",p->curLine ); + _pico_printf( PICO_ERROR,"Missing material name in MTL %s, line %d.",fileName,p->curLine ); _obj_mtl_error_return; } /* create a new pico shader */ @@ -321,7 +321,7 @@ static int _obj_mtl_load( picoModel_t *model ){ /* validate map name */ if ( mapName == NULL || !strlen( mapName ) ) { - _pico_printf( PICO_ERROR,"Missing material map name in MTL, line %d.",p->curLine ); + _pico_printf( PICO_ERROR,"Missing material map name in MTL %s, line %d.",fileName,p->curLine ); _obj_mtl_error_return; } /* create a new pico shader */ @@ -706,7 +706,7 @@ static picoModel_t *_obj_load( PM_PARAMS_LOAD ){ int i; if ( curSurface == NULL ) { - _pico_printf( PICO_WARNING,"No group defined for faces, so creating an autoSurface in OBJ, line %d.",p->curLine ); + _pico_printf( PICO_WARNING,"No group defined for faces, so creating an autoSurface in OBJ %s, line %d.",model->fileName,p->curLine ); AUTO_GROUPNAME( autoGroupNameBuf ); NEW_SURFACE( autoGroupNameBuf ); } @@ -889,20 +889,20 @@ static picoModel_t *_obj_load( PM_PARAMS_LOAD ){ name = _pico_parse( p,0 ); if ( curFace != 0 || curSurface == NULL ) { - _pico_printf( PICO_WARNING,"No group defined for usemtl, so creating an autoSurface in OBJ, line %d.",p->curLine ); + _pico_printf( PICO_WARNING,"No group defined for usemtl, so creating an autoSurface in OBJ %s, line %d.",model->fileName,p->curLine ); AUTO_GROUPNAME( autoGroupNameBuf ); NEW_SURFACE( autoGroupNameBuf ); } /* validate material name */ if ( name == NULL || !strlen( name ) ) { - _pico_printf( PICO_ERROR,"Missing material name in OBJ, line %d.",p->curLine ); + _pico_printf( PICO_ERROR,"Missing material name in OBJ %s, line %d.",model->fileName,p->curLine ); } else { shader = PicoFindShader( model, name, 1 ); if ( shader == NULL ) { - _pico_printf( PICO_WARNING,"Undefined material name in OBJ, line %d. Making a default shader.",p->curLine ); + _pico_printf( PICO_WARNING,"Undefined material name in OBJ %s, line %d. Making a default shader.",model->fileName,p->curLine ); /* create a new pico shader */ shader = PicoNewShader( model );