[quake3-commits] r1980 - in trunk/code: renderer sdl

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat May 14 10:32:44 EDT 2011


Author: thilo
Date: 2011-05-14 10:32:43 -0400 (Sat, 14 May 2011)
New Revision: 1980

Modified:
   trunk/code/renderer/tr_backend.c
   trunk/code/renderer/tr_bsp.c
   trunk/code/renderer/tr_cmds.c
   trunk/code/renderer/tr_image.c
   trunk/code/renderer/tr_image_bmp.c
   trunk/code/renderer/tr_image_jpg.c
   trunk/code/renderer/tr_image_tga.c
   trunk/code/renderer/tr_shade.c
   trunk/code/renderer/tr_shade_calc.c
   trunk/code/renderer/tr_shader.c
   trunk/code/renderer/tr_sky.c
   trunk/code/sdl/sdl_glimp.c
Log:
Remove newlines from Com_Error calls, patch by DevHC


Modified: trunk/code/renderer/tr_backend.c
===================================================================
--- trunk/code/renderer/tr_backend.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_backend.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -189,7 +189,7 @@
 		qglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD );
 		break;
 	default:
-		ri.Error( ERR_DROP, "GL_TexEnv: invalid env '%d' passed\n", env );
+		ri.Error( ERR_DROP, "GL_TexEnv: invalid env '%d' passed", env );
 		break;
 	}
 }
@@ -264,7 +264,7 @@
 				break;
 			default:
 				srcFactor = GL_ONE;		// to get warning to shut up
-				ri.Error( ERR_DROP, "GL_State: invalid src blend state bits\n" );
+				ri.Error( ERR_DROP, "GL_State: invalid src blend state bits" );
 				break;
 			}
 
@@ -296,7 +296,7 @@
 				break;
 			default:
 				dstFactor = GL_ONE;		// to get warning to shut up
-				ri.Error( ERR_DROP, "GL_State: invalid dst blend state bits\n" );
+				ri.Error( ERR_DROP, "GL_State: invalid dst blend state bits" );
 				break;
 			}
 

Modified: trunk/code/renderer/tr_bsp.c
===================================================================
--- trunk/code/renderer/tr_bsp.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_bsp.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -1800,7 +1800,7 @@
 	byte		*startMarker;
 
 	if ( tr.worldMapLoaded ) {
-		ri.Error( ERR_DROP, "ERROR: attempted to redundantly load world map\n" );
+		ri.Error( ERR_DROP, "ERROR: attempted to redundantly load world map" );
 	}
 
 	// set default sun direction to be used if it isn't

Modified: trunk/code/renderer/tr_cmds.c
===================================================================
--- trunk/code/renderer/tr_cmds.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_cmds.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -411,7 +411,7 @@
 
 		R_SyncRenderThread();
 		if ((err = qglGetError()) != GL_NO_ERROR)
-			ri.Error(ERR_FATAL, "RE_BeginFrame() - glGetError() failed (0x%x)!\n", err);
+			ri.Error(ERR_FATAL, "RE_BeginFrame() - glGetError() failed (0x%x)!", err);
 	}
 
 	if (glConfig.stereoEnabled) {

Modified: trunk/code/renderer/tr_image.c
===================================================================
--- trunk/code/renderer/tr_image.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_image.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -780,14 +780,14 @@
 	long		hash;
 
 	if (strlen(name) >= MAX_QPATH ) {
-		ri.Error (ERR_DROP, "R_CreateImage: \"%s\" is too long\n", name);
+		ri.Error (ERR_DROP, "R_CreateImage: \"%s\" is too long", name);
 	}
 	if ( !strncmp( name, "*lightmap", 9 ) ) {
 		isLightmap = qtrue;
 	}
 
 	if ( tr.numImages == MAX_DRAWIMAGES ) {
-		ri.Error( ERR_DROP, "R_CreateImage: MAX_DRAWIMAGES hit\n");
+		ri.Error( ERR_DROP, "R_CreateImage: MAX_DRAWIMAGES hit");
 	}
 
 	image = tr.images[tr.numImages] = ri.Hunk_Alloc( sizeof( image_t ), h_low );

Modified: trunk/code/renderer/tr_image_bmp.c
===================================================================
--- trunk/code/renderer/tr_image_bmp.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_image_bmp.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -76,7 +76,7 @@
 
 	if (length < 54)
 	{
-		ri.Error( ERR_DROP, "LoadBMP: header too short (%s)\n", name );
+		ri.Error( ERR_DROP, "LoadBMP: header too short (%s)", name );
 	}
 
 	buf_p = buffer.b;
@@ -116,7 +116,7 @@
 	if ( bmpHeader.bitsPerPixel == 8 )
 	{
 		if (buf_p + sizeof(bmpHeader.palette) > end)
-			ri.Error( ERR_DROP, "LoadBMP: header too short (%s)\n", name );
+			ri.Error( ERR_DROP, "LoadBMP: header too short (%s)", name );
 
 		Com_Memcpy( bmpHeader.palette, buf_p, sizeof( bmpHeader.palette ) );
 		buf_p += sizeof(bmpHeader.palette);
@@ -124,26 +124,26 @@
 
 	if (buffer.b + bmpHeader.bitmapDataOffset > end)
 	{
-		ri.Error( ERR_DROP, "LoadBMP: invalid offset value in header (%s)\n", name );
+		ri.Error( ERR_DROP, "LoadBMP: invalid offset value in header (%s)", name );
 	}
 
 	buf_p = buffer.b + bmpHeader.bitmapDataOffset;
 
 	if ( bmpHeader.id[0] != 'B' && bmpHeader.id[1] != 'M' ) 
 	{
-		ri.Error( ERR_DROP, "LoadBMP: only Windows-style BMP files supported (%s)\n", name );
+		ri.Error( ERR_DROP, "LoadBMP: only Windows-style BMP files supported (%s)", name );
 	}
 	if ( bmpHeader.fileSize != length )
 	{
-		ri.Error( ERR_DROP, "LoadBMP: header size does not match file size (%u vs. %u) (%s)\n", bmpHeader.fileSize, length, name );
+		ri.Error( ERR_DROP, "LoadBMP: header size does not match file size (%u vs. %u) (%s)", bmpHeader.fileSize, length, name );
 	}
 	if ( bmpHeader.compression != 0 )
 	{
-		ri.Error( ERR_DROP, "LoadBMP: only uncompressed BMP files supported (%s)\n", name );
+		ri.Error( ERR_DROP, "LoadBMP: only uncompressed BMP files supported (%s)", name );
 	}
 	if ( bmpHeader.bitsPerPixel < 8 )
 	{
-		ri.Error( ERR_DROP, "LoadBMP: monochrome and 4-bit BMP files not supported (%s)\n", name );
+		ri.Error( ERR_DROP, "LoadBMP: monochrome and 4-bit BMP files not supported (%s)", name );
 	}
 
 	switch ( bmpHeader.bitsPerPixel )
@@ -154,7 +154,7 @@
 		case 32:
 			break;
 		default:
-			ri.Error( ERR_DROP, "LoadBMP: illegal pixel_size '%hu' in file '%s'\n", bmpHeader.bitsPerPixel, name );
+			ri.Error( ERR_DROP, "LoadBMP: illegal pixel_size '%hu' in file '%s'", bmpHeader.bitsPerPixel, name );
 			break;
 	}
 
@@ -167,11 +167,11 @@
 	if(columns <= 0 || !rows || numPixels > 0x1FFFFFFF // 4*1FFFFFFF == 0x7FFFFFFC < 0x7FFFFFFF
 	    || ((numPixels * 4) / columns) / 4 != rows)
 	{
-	  ri.Error (ERR_DROP, "LoadBMP: %s has an invalid image size\n", name);
+	  ri.Error (ERR_DROP, "LoadBMP: %s has an invalid image size", name);
 	}
 	if(buf_p + numPixels*bmpHeader.bitsPerPixel/8 > end)
 	{
-	  ri.Error (ERR_DROP, "LoadBMP: file truncated (%s)\n", name);
+	  ri.Error (ERR_DROP, "LoadBMP: file truncated (%s)", name);
 	}
 
 	if ( width ) 

Modified: trunk/code/renderer/tr_image_jpg.c
===================================================================
--- trunk/code/renderer/tr_image_jpg.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_image_jpg.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -51,7 +51,7 @@
   /* Let the memory manager delete any temp files before we die */
   jpeg_destroy(cinfo);
   
-  ri.Error(ERR_FATAL, "%s\n", buffer);
+  ri.Error(ERR_FATAL, "%s", buffer);
 }
 
 static void R_JPGOutputMessage(j_common_ptr cinfo)
@@ -169,7 +169,7 @@
     ri.FS_FreeFile (fbuffer.v);
     jpeg_destroy_decompress(&cinfo);
   
-    ri.Error(ERR_DROP, "LoadJPG: %s has an invalid image format: %dx%d*4=%d, components: %d\n", filename,
+    ri.Error(ERR_DROP, "LoadJPG: %s has an invalid image format: %dx%d*4=%d, components: %d", filename,
 		    cinfo.output_width, cinfo.output_height, pixelcount * 4, cinfo.output_components);
   }
 
@@ -298,7 +298,7 @@
   jpeg_destroy_compress(cinfo);
   
   // Make crash fatal or we would probably leak memory.
-  ri.Error(ERR_FATAL, "Output buffer for encoded JPEG image has insufficient size of %d bytes\n",
+  ri.Error(ERR_FATAL, "Output buffer for encoded JPEG image has insufficient size of %d bytes",
            dest->size);
 
   return FALSE;

Modified: trunk/code/renderer/tr_image_tga.c
===================================================================
--- trunk/code/renderer/tr_image_tga.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_image_tga.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -70,7 +70,7 @@
 
 	if(length < 18)
 	{
-		ri.Error( ERR_DROP, "LoadTGA: header too short (%s)\n", name );
+		ri.Error( ERR_DROP, "LoadTGA: header too short (%s)", name );
 	}
 
 	buf_p = buffer.b;
@@ -103,17 +103,17 @@
 		&& targa_header.image_type!=10
 		&& targa_header.image_type != 3 ) 
 	{
-		ri.Error (ERR_DROP, "LoadTGA: Only type 2 (RGB), 3 (gray), and 10 (RGB) TGA images supported\n");
+		ri.Error (ERR_DROP, "LoadTGA: Only type 2 (RGB), 3 (gray), and 10 (RGB) TGA images supported");
 	}
 
 	if ( targa_header.colormap_type != 0 )
 	{
-		ri.Error( ERR_DROP, "LoadTGA: colormaps not supported\n" );
+		ri.Error( ERR_DROP, "LoadTGA: colormaps not supported" );
 	}
 
 	if ( ( targa_header.pixel_size != 32 && targa_header.pixel_size != 24 ) && targa_header.image_type != 3 )
 	{
-		ri.Error (ERR_DROP, "LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n");
+		ri.Error (ERR_DROP, "LoadTGA: Only 32 or 24 bit images supported (no colormaps)");
 	}
 
 	columns = targa_header.width;
@@ -122,7 +122,7 @@
 
 	if(!columns || !rows || numPixels > 0x7FFFFFFF || numPixels / columns / 4 != rows)
 	{
-		ri.Error (ERR_DROP, "LoadTGA: %s has an invalid image size\n", name);
+		ri.Error (ERR_DROP, "LoadTGA: %s has an invalid image size", name);
 	}
 
 
@@ -131,7 +131,7 @@
 	if (targa_header.id_length != 0)
 	{
 		if (buf_p + targa_header.id_length > end)
-			ri.Error( ERR_DROP, "LoadTGA: header too short (%s)\n", name );
+			ri.Error( ERR_DROP, "LoadTGA: header too short (%s)", name );
 
 		buf_p += targa_header.id_length;  // skip TARGA image comment
 	}
@@ -140,7 +140,7 @@
 	{ 
 		if(buf_p + columns*rows*targa_header.pixel_size/8 > end)
 		{
-			ri.Error (ERR_DROP, "LoadTGA: file truncated (%s)\n", name);
+			ri.Error (ERR_DROP, "LoadTGA: file truncated (%s)", name);
 		}
 
 		// Uncompressed RGB or gray scale image
@@ -183,7 +183,7 @@
 					*pixbuf++ = alphabyte;
 					break;
 				default:
-					ri.Error( ERR_DROP, "LoadTGA: illegal pixel_size '%d' in file '%s'\n", targa_header.pixel_size, name );
+					ri.Error( ERR_DROP, "LoadTGA: illegal pixel_size '%d' in file '%s'", targa_header.pixel_size, name );
 					break;
 				}
 			}
@@ -201,12 +201,12 @@
 			pixbuf = targa_rgba + row*columns*4;
 			for(column=0; column<columns; ) {
 				if(buf_p + 1 > end)
-					ri.Error (ERR_DROP, "LoadTGA: file truncated (%s)\n", name);
+					ri.Error (ERR_DROP, "LoadTGA: file truncated (%s)", name);
 				packetHeader= *buf_p++;
 				packetSize = 1 + (packetHeader & 0x7f);
 				if (packetHeader & 0x80) {        // run-length packet
 					if(buf_p + targa_header.pixel_size/8 > end)
-						ri.Error (ERR_DROP, "LoadTGA: file truncated (%s)\n", name);
+						ri.Error (ERR_DROP, "LoadTGA: file truncated (%s)", name);
 					switch (targa_header.pixel_size) {
 						case 24:
 								blue = *buf_p++;
@@ -221,7 +221,7 @@
 								alphabyte = *buf_p++;
 								break;
 						default:
-							ri.Error( ERR_DROP, "LoadTGA: illegal pixel_size '%d' in file '%s'\n", targa_header.pixel_size, name );
+							ri.Error( ERR_DROP, "LoadTGA: illegal pixel_size '%d' in file '%s'", targa_header.pixel_size, name );
 							break;
 					}
 	
@@ -244,7 +244,7 @@
 				else {                            // non run-length packet
 
 					if(buf_p + targa_header.pixel_size/8*packetSize > end)
-						ri.Error (ERR_DROP, "LoadTGA: file truncated (%s)\n", name);
+						ri.Error (ERR_DROP, "LoadTGA: file truncated (%s)", name);
 					for(j=0;j<packetSize;j++) {
 						switch (targa_header.pixel_size) {
 							case 24:
@@ -267,7 +267,7 @@
 									*pixbuf++ = alphabyte;
 									break;
 							default:
-								ri.Error( ERR_DROP, "LoadTGA: illegal pixel_size '%d' in file '%s'\n", targa_header.pixel_size, name );
+								ri.Error( ERR_DROP, "LoadTGA: illegal pixel_size '%d' in file '%s'", targa_header.pixel_size, name );
 								break;
 						}
 						column++;

Modified: trunk/code/renderer/tr_shade.c
===================================================================
--- trunk/code/renderer/tr_shade.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_shade.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -1096,7 +1096,7 @@
 				break;
 
 			default:
-				ri.Error( ERR_DROP, "ERROR: unknown texmod '%d' in shader '%s'\n", pStage->bundle[b].texMods[tm].type, tess.shader->name );
+				ri.Error( ERR_DROP, "ERROR: unknown texmod '%d' in shader '%s'", pStage->bundle[b].texMods[tm].type, tess.shader->name );
 				break;
 			}
 		}

Modified: trunk/code/renderer/tr_shade_calc.c
===================================================================
--- trunk/code/renderer/tr_shade_calc.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_shade_calc.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -48,7 +48,7 @@
 		break;
 	}
 
-	ri.Error( ERR_DROP, "TableForFunc called with invalid function '%d' in shader '%s'\n", func, tess.shader->name );
+	ri.Error( ERR_DROP, "TableForFunc called with invalid function '%d' in shader '%s'", func, tess.shader->name );
 	return NULL;
 }
 

Modified: trunk/code/renderer/tr_shader.c
===================================================================
--- trunk/code/renderer/tr_shader.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_shader.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -363,7 +363,7 @@
 	texModInfo_t *tmi;
 
 	if ( stage->bundle[0].numTexMods == TR_MAX_TEXMODS ) {
-		ri.Error( ERR_DROP, "ERROR: too many tcMod stages in shader '%s'\n", shader.name );
+		ri.Error( ERR_DROP, "ERROR: too many tcMod stages in shader '%s'", shader.name );
 		return;
 	}
 

Modified: trunk/code/renderer/tr_sky.c
===================================================================
--- trunk/code/renderer/tr_sky.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/renderer/tr_sky.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -475,7 +475,7 @@
 
 			if ( tess.numVertexes >= SHADER_MAX_VERTEXES )
 			{
-				ri.Error( ERR_DROP, "SHADER_MAX_VERTEXES hit in FillCloudySkySide()\n" );
+				ri.Error( ERR_DROP, "SHADER_MAX_VERTEXES hit in FillCloudySkySide()" );
 			}
 		}
 	}

Modified: trunk/code/sdl/sdl_glimp.c
===================================================================
--- trunk/code/sdl/sdl_glimp.c	2011-05-14 14:28:31 UTC (rev 1979)
+++ trunk/code/sdl/sdl_glimp.c	2011-05-14 14:32:43 UTC (rev 1980)
@@ -719,7 +719,7 @@
 	}
 
 	// Nothing worked, give up
-	ri.Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem\n" );
+	ri.Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem" );
 
 success:
 	// This values force the UI to disable driver selection



More information about the quake3-commits mailing list