]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge branch 'picomodel-obj-surface-vertexes' into 'master'
authorThomas Debesse <gitlab@illwieckz.net>
Sun, 4 Nov 2018 17:45:56 +0000 (17:45 +0000)
committerThomas Debesse <gitlab@illwieckz.net>
Sun, 4 Nov 2018 17:45:56 +0000 (17:45 +0000)
Fix over allocating vertexes for OBJ models with multiple surfaces

See merge request xonotic/netradiant!107

libs/picomodel/pm_obj.c

index e5e03e41217778de07bb41ac14f120c28e0ff889..6e11a1cdbaca6875bce3d01f474b0212a690f375 100644 (file)
@@ -524,8 +524,9 @@ static picoModel_t *_obj_load( PM_PARAMS_LOAD ){
                newSurface = PicoNewSurface( model ); \
                if ( newSurface == NULL ) {     \
                        _obj_error_return( "Error allocating surface" ); } \
-               /* reset face index for surface */ \
+               /* reset face index and vertex index for surface */ \
                curFace = 0; \
+               curVertex = 0; \
                /* if we can, assign the previous shader to this surface */     \
                if ( curSurface ) {     \
                        PicoSetSurfaceShader( newSurface, curSurface->shader ); } \