Skip to content

Commit df6eecc

Browse files
committed
Make surface parse error messages more meaningful
1 parent c521fe8 commit df6eecc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/engine/renderer/tr_bsp.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,8 @@ static void ParseTriangleSurface( dsurface_t* ds, drawVert_t* verts, bspSurface_
932932
tri->indexes[j] = LittleLong( indexes[i * 3 + j] );
933933

934934
if ( tri->indexes[j] < 0 || tri->indexes[j] >= cv->numVerts ) {
935-
Sys::Drop( "Bad index in face surface" );
935+
Sys::Drop( "Index out of range in surface: %i not in [0, %i] (index in BSP: %i, surface: indexes: %i-%i, shader: %s)",
936+
tri->indexes[j], cv->numVerts, i * 3 + j, ds->firstIndex, ds->firstIndex + ds->numIndexes, surf->shader->name );
936937
}
937938
}
938939
}
@@ -1112,7 +1113,8 @@ static void ParseMesh( dsurface_t *ds, drawVert_t *verts, bspSurface_t *surf )
11121113

11131114
if ( width < 0 || width > MAX_PATCH_SIZE || height < 0 || height > MAX_PATCH_SIZE )
11141115
{
1115-
Sys::Drop( "ParseMesh: bad size" );
1116+
Sys::Drop( "ParseMesh: bad size: width: %i (range: [0, %i]), height: %i (range: [0, %i]), surface: firstVertex: %i,"
1117+
" shader: %s", width, MAX_PATCH_SIZE, height, MAX_PATCH_SIZE, ds->firstVert, surf->shader->name );
11161118
}
11171119

11181120
verts += LittleLong( ds->firstVert );

0 commit comments

Comments
 (0)