]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - wad.c
Implement Con_Error(f) and Con_Warn(f), error and warning, for prettier colors
[xonotic/darkplaces.git] / wad.c
diff --git a/wad.c b/wad.c
index fabffc3b9205aeb50e16ae56c858a27d11805279..b05227512b855dd606e5e9853a084a35700c174d 100644 (file)
--- a/wad.c
+++ b/wad.c
@@ -174,22 +174,22 @@ void W_LoadTextureWadFile (char *filename, int complain)
        if (!file)
        {
                if (complain)
-                       Con_Printf("W_LoadTextureWadFile: couldn't find %s\n", filename);
+                       Con_Errorf("W_LoadTextureWadFile: couldn't find %s\n", filename);
                return;
        }
 
        if (FS_Read(file, &header, sizeof(wadinfo_t)) != sizeof(wadinfo_t))
-       {Con_Print("W_LoadTextureWadFile: unable to read wad header\n");FS_Close(file);file = NULL;return;}
+       {Con_Error("W_LoadTextureWadFile: unable to read wad header\n");FS_Close(file);file = NULL;return;}
 
        if(memcmp(header.identification, "WAD3", 4))
-       {Con_Printf("W_LoadTextureWadFile: Wad file %s doesn't have WAD3 id\n",filename);FS_Close(file);file = NULL;return;}
+       {Con_Errorf("W_LoadTextureWadFile: Wad file %s doesn't have WAD3 id\n",filename);FS_Close(file);file = NULL;return;}
 
        numlumps = LittleLong(header.numlumps);
        if (numlumps < 1 || numlumps > 65536)
-       {Con_Printf("W_LoadTextureWadFile: invalid number of lumps (%i)\n", numlumps);FS_Close(file);file = NULL;return;}
+       {Con_Errorf("W_LoadTextureWadFile: invalid number of lumps (%i)\n", numlumps);FS_Close(file);file = NULL;return;}
        infotableofs = LittleLong(header.infotableofs);
        if (FS_Seek (file, infotableofs, SEEK_SET))
-       {Con_Print("W_LoadTextureWadFile: unable to seek to lump table\n");FS_Close(file);file = NULL;return;}
+       {Con_Error("W_LoadTextureWadFile: unable to seek to lump table\n");FS_Close(file);file = NULL;return;}
 
        if (!wad.hlwads.mempool)
                Mem_ExpandableArray_NewArray(&wad.hlwads, cls.permanentmempool, sizeof(mwad_t), 16);
@@ -200,7 +200,7 @@ void W_LoadTextureWadFile (char *filename, int complain)
 
        if (!w->lumps)
        {
-               Con_Print("W_LoadTextureWadFile: unable to allocate temporary memory for lump table\n");
+               Con_Error("W_LoadTextureWadFile: unable to allocate temporary memory for lump table\n");
                FS_Close(w->file);
                w->file = NULL;
                w->numlumps = 0;
@@ -209,7 +209,7 @@ void W_LoadTextureWadFile (char *filename, int complain)
 
        if (FS_Read(file, w->lumps, sizeof(lumpinfo_t) * w->numlumps) != (fs_offset_t)sizeof(lumpinfo_t) * numlumps)
        {
-               Con_Print("W_LoadTextureWadFile: unable to read lump table\n");
+               Con_Error("W_LoadTextureWadFile: unable to read lump table\n");
                FS_Close(w->file);
                w->file = NULL;
                w->numlumps = 0;