From 55f788ef0d8fee6dab1691144a4e1bacd881a9bb Mon Sep 17 00:00:00 2001 From: TimeServ Date: Wed, 21 Dec 2005 07:00:33 +0000 Subject: [PATCH] removed Draw_PicFromWad so we only use the "safe" version killed some Sys_Errors transtable loading to vfs log rotation fix server cosmetic changes git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1731 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/merged.h | 2 -- engine/client/renderer.c | 5 ----- engine/common/log.c | 1 + engine/gl/gl_draw.c | 16 ++++++---------- engine/gl/gl_draw.h | 1 - engine/gl/gltod3d/gl_fakegl.cpp | 1 - engine/server/pr_cmds.c | 2 +- engine/server/sv_ents.c | 2 +- engine/server/sv_user.c | 2 +- engine/sw/d_trans.c | 9 ++++----- engine/sw/sw_draw.c | 10 ++++++++-- 11 files changed, 22 insertions(+), 29 deletions(-) diff --git a/engine/client/merged.h b/engine/client/merged.h index e68641561..bc967bd13 100644 --- a/engine/client/merged.h +++ b/engine/client/merged.h @@ -14,7 +14,6 @@ extern r_qrenderer_t qrenderer; extern char *q_renderername; -extern mpic_t *(*Draw_PicFromWad) (char *name); extern mpic_t *(*Draw_SafePicFromWad) (char *name); extern mpic_t *(*Draw_CachePic) (char *path); extern mpic_t *(*Draw_SafeCachePic) (char *path); @@ -121,7 +120,6 @@ typedef struct { char *name[4]; r_qrenderer_t rtype; - mpic_t *(*Draw_PicFromWad) (char *name); mpic_t *(*Draw_SafePicFromWad) (char *name); mpic_t *(*Draw_CachePic) (char *path); mpic_t *(*Draw_SafeCachePic) (char *path); diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 267b08b34..6ec5f3aa1 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -546,7 +546,6 @@ void Renderer_Init(void) } -mpic_t *(*Draw_PicFromWad) (char *name); mpic_t *(*Draw_SafePicFromWad) (char *name); mpic_t *(*Draw_CachePic) (char *path); mpic_t *(*Draw_SafeCachePic) (char *path); @@ -641,7 +640,6 @@ rendererinfo_t dedicatedrendererinfo = { }, QR_NONE, - NULL, //Draw_PicFromWad; NULL, //Draw_PicFromWad; //Not supported NULL, //Draw_CachePic; NULL, //Draw_SafeCachePic; @@ -750,7 +748,6 @@ rendererinfo_t softwarerendererinfo = { QR_SOFTWARE, SWDraw_PicFromWad, - SWDraw_PicFromWad, //Not supported SWDraw_CachePic, SWDraw_SafeCachePic, SWDraw_Init, @@ -843,7 +840,6 @@ rendererinfo_t openglrendererinfo = { QR_OPENGL, - GLDraw_PicFromWad, GLDraw_SafePicFromWad, GLDraw_CachePic, GLDraw_SafeCachePic, @@ -1222,7 +1218,6 @@ void R_SetRenderer(int wanted) q_renderername = ri->name[0]; - Draw_PicFromWad = ri->Draw_PicFromWad; Draw_SafePicFromWad = ri->Draw_SafePicFromWad; //Not supported Draw_CachePic = ri->Draw_CachePic; Draw_SafeCachePic = ri->Draw_SafeCachePic; diff --git a/engine/common/log.c b/engine/common/log.c index 5f516bfb9..77e03a19b 100644 --- a/engine/common/log.c +++ b/engine/common/log.c @@ -162,6 +162,7 @@ void Con_Log (char *s) { x = VFS_GETLEN(fi); VFS_CLOSE(fi); + x += i; // add string size to file size to never go over } else x = 0; diff --git a/engine/gl/gl_draw.c b/engine/gl/gl_draw.c index a2675815d..49e1fb4b4 100644 --- a/engine/gl/gl_draw.c +++ b/engine/gl/gl_draw.c @@ -320,7 +320,12 @@ mpic_t *GLDraw_SafePicFromWad (char *name) return &pic->pic; if (glmenu_numcachepics == MAX_CACHED_PICS) - Sys_Error ("menu_numcachepics == MAX_CACHED_PICS"); + { + Con_Printf ("menu_numcachepics == MAX_CACHED_PICS\n"); + failedpic = name; + return NULL; + } + glmenu_numcachepics++; strcpy(pic->name, name); @@ -334,15 +339,6 @@ mpic_t *GLDraw_SafePicFromWad (char *name) return &pic->pic; } -mpic_t *GLDraw_PicFromWad (char *name) -{ - mpic_t *pic = GLDraw_SafePicFromWad (name); - if (!pic) - Sys_Error ("GLDraw_PicFromWad: failed to load %s", name); - - return pic; -} - mpic_t *GLDraw_SafeCachePic (char *path) { int height; diff --git a/engine/gl/gl_draw.h b/engine/gl/gl_draw.h index 38f56265f..3a85f0966 100644 --- a/engine/gl/gl_draw.h +++ b/engine/gl/gl_draw.h @@ -43,7 +43,6 @@ void GLDraw_FadeScreen (void); void GLDraw_String (int x, int y, const qbyte *str); void GLDraw_Alt_String (int x, int y, const qbyte *str); mpic_t *GLDraw_SafePicFromWad (char *name); -mpic_t *GLDraw_PicFromWad (char *name); mpic_t *GLDraw_SafeCachePic (char *path); mpic_t *GLDraw_CachePic (char *path); void GLDraw_Crosshair(void); diff --git a/engine/gl/gltod3d/gl_fakegl.cpp b/engine/gl/gltod3d/gl_fakegl.cpp index a25ee5fb2..8bbb943fa 100644 --- a/engine/gl/gltod3d/gl_fakegl.cpp +++ b/engine/gl/gltod3d/gl_fakegl.cpp @@ -4078,7 +4078,6 @@ rendererinfo_t d3drendererinfo = { QR_OPENGL, - GLDraw_PicFromWad, GLDraw_SafePicFromWad, GLDraw_CachePic, GLDraw_SafeCachePic, diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index cc0dc56f1..58e4594f0 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -9615,7 +9615,7 @@ void PR_ResetBuiltins(progstype_t type) //fix all nulls to PF_FIXME and add any PR_EnableEBFSBuiltin("forcedemoframe", 103)!= 103) Con_Printf("Failed to register all MVDSV builtins\n"); else - Con_Printf("Be aware that MVDSV does not follow standards. Please encourage your mod developers to not require pr_imitatemvdsv to be set.\n"); + Con_Printf("Be aware that MVDSV does not follow standards. Please encourage mod developers to not require pr_imitatemvdsv to be set.\n"); } } diff --git a/engine/server/sv_ents.c b/engine/server/sv_ents.c index dcaf12aae..802564169 100644 --- a/engine/server/sv_ents.c +++ b/engine/server/sv_ents.c @@ -1985,7 +1985,7 @@ void SV_GibFilterInit(void) file = COM_LoadStackFile("gibfiltr.cfg", buffer, sizeof(buffer)); if (!file) { - Con_Printf("gibfiltr.cfg file was not found. Using defaults\n"); + Con_DPrintf("gibfiltr.cfg file was not found. Using defaults\n"); SV_GibFilterAdd("progs/gib1.mdl", -1, -1); SV_GibFilterAdd("progs/gib2.mdl", -1, -1); SV_GibFilterAdd("progs/gib3.mdl", -1, -1); diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index 721920fbc..9ff360539 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -3640,7 +3640,7 @@ void SV_FilterImpulseInit(void) s = COM_LoadStackFile("impfiltr.cfg", buffer, sizeof(buffer)); if (!s) - Con_Printf("impfiltr.cfg not found. Impulse filters are disabled\n"); + Con_DPrintf("impfiltr.cfg not found. Impulse filters are disabled\n"); while(s) { diff --git a/engine/sw/d_trans.c b/engine/sw/d_trans.c index df6ccfcb6..7fdd076bc 100644 --- a/engine/sw/d_trans.c +++ b/engine/sw/d_trans.c @@ -149,7 +149,7 @@ qbyte GetPaletteNoFB(int red, int green, int blue) void MakeVideoPalette(void) { - FILE *f; + vfsfile_t *f; int r, g, b; // allocate memory @@ -158,11 +158,10 @@ void MakeVideoPalette(void) // pal555to8 = Hunk_AllocName(PAL555_SIZE, "RGB data"); // load in previously created table - COM_FOpenFile ("pal555.pal", &f); - if (f) + if ((f = FS_OpenVFS("pal555.pal", "rb", FS_BASE))) { - fread(pal555to8, 1, PAL555_SIZE, f); //cached - fclose(f); + VFS_READ(f, pal555to8, PAL555_SIZE); + VFS_CLOSE(f); return; } diff --git a/engine/sw/sw_draw.c b/engine/sw/sw_draw.c index 5785e775f..e6d7125b9 100644 --- a/engine/sw/sw_draw.c +++ b/engine/sw/sw_draw.c @@ -246,7 +246,10 @@ mpic_t *SWDraw_ConcharsMalloc (void) if (i == swmenu_numcachepics) { if (swmenu_numcachepics == MAX_CACHED_PICS) - Sys_Error ("menu_numcachepics == MAX_CACHED_PICS"); + { + Con_Printf ("menu_numcachepics == MAX_CACHED_PICS\n"); + return NULL; + } swmenu_numcachepics++; pic->cache.fake = true; pic->cache.data = BZ_Malloc(sizeof(qpic_t) + 128*128); @@ -290,7 +293,10 @@ mpic_t *SWDraw_MallocPic (char *path) if (i == swmenu_numcachepics) { if (swmenu_numcachepics == MAX_CACHED_PICS) - Sys_Error ("menu_numcachepics == MAX_CACHED_PICS"); + { + Con_Printf ("menu_numcachepics == MAX_CACHED_PICS\n"); + return NULL; + } swmenu_numcachepics++; pic->cache.fake = false; pic->cache.data = NULL;