summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/renderergl1/tr_model.c30
-rw-r--r--src/renderergl1/tr_model_iqm.c17
-rw-r--r--src/renderergl2/tr_model.c30
-rw-r--r--src/renderergl2/tr_model_iqm.c17
4 files changed, 62 insertions, 32 deletions
diff --git a/src/renderergl1/tr_model.c b/src/renderergl1/tr_model.c
index 770d0066..5ca53031 100644
--- a/src/renderergl1/tr_model.c
+++ b/src/renderergl1/tr_model.c
@@ -460,13 +460,15 @@ static qboolean R_LoadMD3 (model_t *mod, int lod, void *buffer, const char *mod_
LL(surf->ofsEnd);
if ( surf->numVerts > SHADER_MAX_VERTEXES ) {
- ri.Printf(PRINT_WARNING, "R_LoadMD3: %s has more than %i verts on a surface (%i).\n",
- mod_name, SHADER_MAX_VERTEXES, surf->numVerts );
+ ri.Printf(PRINT_WARNING, "R_LoadMD3: %s has more than %i verts on %s (%i).\n",
+ mod_name, SHADER_MAX_VERTEXES, surf->name[0] ? surf->name : "a surface",
+ surf->numVerts );
return qfalse;
}
if ( surf->numTriangles*3 > SHADER_MAX_INDEXES ) {
- ri.Printf(PRINT_WARNING, "R_LoadMD3: %s has more than %i triangles on a surface (%i).\n",
- mod_name, SHADER_MAX_INDEXES / 3, surf->numTriangles );
+ ri.Printf(PRINT_WARNING, "R_LoadMD3: %s has more than %i triangles on %s (%i).\n",
+ mod_name, SHADER_MAX_INDEXES / 3, surf->name[0] ? surf->name : "a surface",
+ surf->numTriangles );
return qfalse;
}
@@ -737,14 +739,16 @@ static qboolean R_LoadMDR( model_t *mod, void *buffer, int filesize, const char
// now do the checks that may fail.
if ( surf->numVerts > SHADER_MAX_VERTEXES )
{
- ri.Printf(PRINT_WARNING, "R_LoadMDR: %s has more than %i verts on a surface (%i).\n",
- mod_name, SHADER_MAX_VERTEXES, surf->numVerts );
+ ri.Printf(PRINT_WARNING, "R_LoadMDR: %s has more than %i verts on %s (%i).\n",
+ mod_name, SHADER_MAX_VERTEXES, surf->name[0] ? surf->name : "a surface",
+ surf->numVerts );
return qfalse;
}
if ( surf->numTriangles*3 > SHADER_MAX_INDEXES )
{
- ri.Printf(PRINT_WARNING, "R_LoadMDR: %s has more than %i triangles on a surface (%i).\n",
- mod_name, SHADER_MAX_INDEXES / 3, surf->numTriangles );
+ ri.Printf(PRINT_WARNING, "R_LoadMDR: %s has more than %i triangles on %s (%i).\n",
+ mod_name, SHADER_MAX_INDEXES / 3, surf->name[0] ? surf->name : "a surface",
+ surf->numTriangles );
return qfalse;
}
// lowercase the surface name so skin compares are faster
@@ -951,13 +955,15 @@ static qboolean R_LoadMD4( model_t *mod, void *buffer, const char *mod_name ) {
LL(surf->ofsEnd);
if ( surf->numVerts > SHADER_MAX_VERTEXES ) {
- ri.Printf(PRINT_WARNING, "R_LoadMD4: %s has more than %i verts on a surface (%i).\n",
- mod_name, SHADER_MAX_VERTEXES, surf->numVerts );
+ ri.Printf(PRINT_WARNING, "R_LoadMD4: %s has more than %i verts on %s (%i).\n",
+ mod_name, SHADER_MAX_VERTEXES, surf->name[0] ? surf->name : "a surface",
+ surf->numVerts );
return qfalse;
}
if ( surf->numTriangles*3 > SHADER_MAX_INDEXES ) {
- ri.Printf(PRINT_WARNING, "R_LoadMD4: %s has more than %i triangles on a surface (%i).\n",
- mod_name, SHADER_MAX_INDEXES / 3, surf->numTriangles );
+ ri.Printf(PRINT_WARNING, "R_LoadMD4: %s has more than %i triangles on %s (%i).\n",
+ mod_name, SHADER_MAX_INDEXES / 3, surf->name[0] ? surf->name : "a surface",
+ surf->numTriangles );
return qfalse;
}
diff --git a/src/renderergl1/tr_model_iqm.c b/src/renderergl1/tr_model_iqm.c
index 47d618ac..0661eb7a 100644
--- a/src/renderergl1/tr_model_iqm.c
+++ b/src/renderergl1/tr_model_iqm.c
@@ -143,6 +143,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
size_t size, joint_names;
iqmData_t *iqmData;
srfIQModel_t *surface;
+ char meshName[MAX_QPATH];
if( filesize < sizeof(iqmHeader_t) ) {
return qfalse;
@@ -311,17 +312,25 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
LL( mesh->first_triangle );
LL( mesh->num_triangles );
+ if ( mesh->name < header->num_text ) {
+ Q_strncpyz( meshName, (char*)header + header->ofs_text + mesh->name, sizeof (meshName) );
+ } else {
+ meshName[0] = '\0';
+ }
+
// check ioq3 limits
if ( mesh->num_vertexes > SHADER_MAX_VERTEXES )
{
- ri.Printf(PRINT_WARNING, "R_LoadIQM: %s has more than %i verts on a surface (%i).\n",
- mod_name, SHADER_MAX_VERTEXES, mesh->num_vertexes );
+ ri.Printf(PRINT_WARNING, "R_LoadIQM: %s has more than %i verts on %s (%i).\n",
+ mod_name, SHADER_MAX_VERTEXES, meshName[0] ? meshName : "a surface",
+ mesh->num_vertexes );
return qfalse;
}
if ( mesh->num_triangles*3 > SHADER_MAX_INDEXES )
{
- ri.Printf(PRINT_WARNING, "R_LoadIQM: %s has more than %i triangles on a surface (%i).\n",
- mod_name, SHADER_MAX_INDEXES / 3, mesh->num_triangles );
+ ri.Printf(PRINT_WARNING, "R_LoadIQM: %s has more than %i triangles on %s (%i).\n",
+ mod_name, SHADER_MAX_INDEXES / 3, meshName[0] ? meshName : "a surface",
+ mesh->num_triangles );
return qfalse;
}
diff --git a/src/renderergl2/tr_model.c b/src/renderergl2/tr_model.c
index cad7bd24..54d42a38 100644
--- a/src/renderergl2/tr_model.c
+++ b/src/renderergl2/tr_model.c
@@ -498,14 +498,16 @@ static qboolean R_LoadMD3(model_t * mod, int lod, void *buffer, int bufferSize,
if(md3Surf->numVerts > SHADER_MAX_VERTEXES)
{
- ri.Printf(PRINT_WARNING, "R_LoadMD3: %s has more than %i verts on a surface (%i)",
- modName, SHADER_MAX_VERTEXES, md3Surf->numVerts);
+ ri.Printf(PRINT_WARNING, "R_LoadMD3: %s has more than %i verts on %s (%i).\n",
+ modName, SHADER_MAX_VERTEXES, md3Surf->name[0] ? md3Surf->name : "a surface",
+ md3Surf->numVerts );
return qfalse;
}
if(md3Surf->numTriangles * 3 > SHADER_MAX_INDEXES)
{
- ri.Printf(PRINT_WARNING, "R_LoadMD3: %s has more than %i triangles on a surface (%i)",
- modName, SHADER_MAX_INDEXES / 3, md3Surf->numTriangles);
+ ri.Printf(PRINT_WARNING, "R_LoadMD3: %s has more than %i triangles on %s (%i).\n",
+ modName, SHADER_MAX_INDEXES / 3, md3Surf->name[0] ? md3Surf->name : "a surface",
+ md3Surf->numTriangles );
return qfalse;
}
@@ -997,14 +999,16 @@ static qboolean R_LoadMDR( model_t *mod, void *buffer, int filesize, const char
// now do the checks that may fail.
if ( surf->numVerts > SHADER_MAX_VERTEXES )
{
- ri.Printf(PRINT_WARNING, "R_LoadMDR: %s has more than %i verts on a surface (%i).\n",
- mod_name, SHADER_MAX_VERTEXES, surf->numVerts );
+ ri.Printf(PRINT_WARNING, "R_LoadMDR: %s has more than %i verts on %s (%i).\n",
+ mod_name, SHADER_MAX_VERTEXES, surf->name[0] ? surf->name : "a surface",
+ surf->numVerts );
return qfalse;
}
if ( surf->numTriangles*3 > SHADER_MAX_INDEXES )
{
- ri.Printf(PRINT_WARNING, "R_LoadMDR: %s has more than %i triangles on a surface (%i).\n",
- mod_name, SHADER_MAX_INDEXES / 3, surf->numTriangles );
+ ri.Printf(PRINT_WARNING, "R_LoadMDR: %s has more than %i triangles on %s (%i).\n",
+ mod_name, SHADER_MAX_INDEXES / 3, surf->name[0] ? surf->name : "a surface",
+ surf->numTriangles );
return qfalse;
}
// lowercase the surface name so skin compares are faster
@@ -1211,13 +1215,15 @@ static qboolean R_LoadMD4( model_t *mod, void *buffer, const char *mod_name ) {
LL(surf->ofsEnd);
if ( surf->numVerts > SHADER_MAX_VERTEXES ) {
- ri.Printf(PRINT_WARNING, "R_LoadMD4: %s has more than %i verts on a surface (%i).\n",
- mod_name, SHADER_MAX_VERTEXES, surf->numVerts );
+ ri.Printf(PRINT_WARNING, "R_LoadMD4: %s has more than %i verts on %s (%i).\n",
+ mod_name, SHADER_MAX_VERTEXES, surf->name[0] ? surf->name : "a surface",
+ surf->numVerts );
return qfalse;
}
if ( surf->numTriangles*3 > SHADER_MAX_INDEXES ) {
- ri.Printf(PRINT_WARNING, "R_LoadMD4: %s has more than %i triangles on a surface (%i).\n",
- mod_name, SHADER_MAX_INDEXES / 3, surf->numTriangles );
+ ri.Printf(PRINT_WARNING, "R_LoadMD4: %s has more than %i triangles on %s (%i).\n",
+ mod_name, SHADER_MAX_INDEXES / 3, surf->name[0] ? surf->name : "a surface",
+ surf->numTriangles );
return qfalse;
}
diff --git a/src/renderergl2/tr_model_iqm.c b/src/renderergl2/tr_model_iqm.c
index 0ea1961d..a06e3be7 100644
--- a/src/renderergl2/tr_model_iqm.c
+++ b/src/renderergl2/tr_model_iqm.c
@@ -142,6 +142,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
size_t size, joint_names;
iqmData_t *iqmData;
srfIQModel_t *surface;
+ char meshName[MAX_QPATH];
if( filesize < sizeof(iqmHeader_t) ) {
return qfalse;
@@ -310,17 +311,25 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
LL( mesh->first_triangle );
LL( mesh->num_triangles );
+ if ( mesh->name < header->num_text ) {
+ Q_strncpyz( meshName, (char*)header + header->ofs_text + mesh->name, sizeof (meshName) );
+ } else {
+ meshName[0] = '\0';
+ }
+
// check ioq3 limits
if ( mesh->num_vertexes > SHADER_MAX_VERTEXES )
{
- ri.Printf(PRINT_WARNING, "R_LoadIQM: %s has more than %i verts on a surface (%i).\n",
- mod_name, SHADER_MAX_VERTEXES, mesh->num_vertexes );
+ ri.Printf(PRINT_WARNING, "R_LoadIQM: %s has more than %i verts on %s (%i).\n",
+ mod_name, SHADER_MAX_VERTEXES, meshName[0] ? meshName : "a surface",
+ mesh->num_vertexes );
return qfalse;
}
if ( mesh->num_triangles*3 > SHADER_MAX_INDEXES )
{
- ri.Printf(PRINT_WARNING, "R_LoadIQM: %s has more than %i triangles on a surface (%i).\n",
- mod_name, SHADER_MAX_INDEXES / 3, mesh->num_triangles );
+ ri.Printf(PRINT_WARNING, "R_LoadIQM: %s has more than %i triangles on %s (%i).\n",
+ mod_name, SHADER_MAX_INDEXES / 3, meshName[0] ? meshName : "a surface",
+ mesh->num_triangles );
return qfalse;
}