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
This commit is contained in:
TimeServ 2005-12-21 07:00:33 +00:00
parent 208626a9a2
commit 55f788ef0d
11 changed files with 22 additions and 29 deletions

View file

@ -14,7 +14,6 @@ extern r_qrenderer_t qrenderer;
extern char *q_renderername; extern char *q_renderername;
extern mpic_t *(*Draw_PicFromWad) (char *name);
extern mpic_t *(*Draw_SafePicFromWad) (char *name); extern mpic_t *(*Draw_SafePicFromWad) (char *name);
extern mpic_t *(*Draw_CachePic) (char *path); extern mpic_t *(*Draw_CachePic) (char *path);
extern mpic_t *(*Draw_SafeCachePic) (char *path); extern mpic_t *(*Draw_SafeCachePic) (char *path);
@ -121,7 +120,6 @@ typedef struct {
char *name[4]; char *name[4];
r_qrenderer_t rtype; r_qrenderer_t rtype;
mpic_t *(*Draw_PicFromWad) (char *name);
mpic_t *(*Draw_SafePicFromWad) (char *name); mpic_t *(*Draw_SafePicFromWad) (char *name);
mpic_t *(*Draw_CachePic) (char *path); mpic_t *(*Draw_CachePic) (char *path);
mpic_t *(*Draw_SafeCachePic) (char *path); mpic_t *(*Draw_SafeCachePic) (char *path);

View file

@ -546,7 +546,6 @@ void Renderer_Init(void)
} }
mpic_t *(*Draw_PicFromWad) (char *name);
mpic_t *(*Draw_SafePicFromWad) (char *name); mpic_t *(*Draw_SafePicFromWad) (char *name);
mpic_t *(*Draw_CachePic) (char *path); mpic_t *(*Draw_CachePic) (char *path);
mpic_t *(*Draw_SafeCachePic) (char *path); mpic_t *(*Draw_SafeCachePic) (char *path);
@ -641,7 +640,6 @@ rendererinfo_t dedicatedrendererinfo = {
}, },
QR_NONE, QR_NONE,
NULL, //Draw_PicFromWad;
NULL, //Draw_PicFromWad; //Not supported NULL, //Draw_PicFromWad; //Not supported
NULL, //Draw_CachePic; NULL, //Draw_CachePic;
NULL, //Draw_SafeCachePic; NULL, //Draw_SafeCachePic;
@ -750,7 +748,6 @@ rendererinfo_t softwarerendererinfo = {
QR_SOFTWARE, QR_SOFTWARE,
SWDraw_PicFromWad, SWDraw_PicFromWad,
SWDraw_PicFromWad, //Not supported
SWDraw_CachePic, SWDraw_CachePic,
SWDraw_SafeCachePic, SWDraw_SafeCachePic,
SWDraw_Init, SWDraw_Init,
@ -843,7 +840,6 @@ rendererinfo_t openglrendererinfo = {
QR_OPENGL, QR_OPENGL,
GLDraw_PicFromWad,
GLDraw_SafePicFromWad, GLDraw_SafePicFromWad,
GLDraw_CachePic, GLDraw_CachePic,
GLDraw_SafeCachePic, GLDraw_SafeCachePic,
@ -1222,7 +1218,6 @@ void R_SetRenderer(int wanted)
q_renderername = ri->name[0]; q_renderername = ri->name[0];
Draw_PicFromWad = ri->Draw_PicFromWad;
Draw_SafePicFromWad = ri->Draw_SafePicFromWad; //Not supported Draw_SafePicFromWad = ri->Draw_SafePicFromWad; //Not supported
Draw_CachePic = ri->Draw_CachePic; Draw_CachePic = ri->Draw_CachePic;
Draw_SafeCachePic = ri->Draw_SafeCachePic; Draw_SafeCachePic = ri->Draw_SafeCachePic;

View file

@ -162,6 +162,7 @@ void Con_Log (char *s)
{ {
x = VFS_GETLEN(fi); x = VFS_GETLEN(fi);
VFS_CLOSE(fi); VFS_CLOSE(fi);
x += i; // add string size to file size to never go over
} }
else else
x = 0; x = 0;

View file

@ -320,7 +320,12 @@ mpic_t *GLDraw_SafePicFromWad (char *name)
return &pic->pic; return &pic->pic;
if (glmenu_numcachepics == MAX_CACHED_PICS) 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++; glmenu_numcachepics++;
strcpy(pic->name, name); strcpy(pic->name, name);
@ -334,15 +339,6 @@ mpic_t *GLDraw_SafePicFromWad (char *name)
return &pic->pic; 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) mpic_t *GLDraw_SafeCachePic (char *path)
{ {
int height; int height;

View file

@ -43,7 +43,6 @@ void GLDraw_FadeScreen (void);
void GLDraw_String (int x, int y, const qbyte *str); void GLDraw_String (int x, int y, const qbyte *str);
void GLDraw_Alt_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_SafePicFromWad (char *name);
mpic_t *GLDraw_PicFromWad (char *name);
mpic_t *GLDraw_SafeCachePic (char *path); mpic_t *GLDraw_SafeCachePic (char *path);
mpic_t *GLDraw_CachePic (char *path); mpic_t *GLDraw_CachePic (char *path);
void GLDraw_Crosshair(void); void GLDraw_Crosshair(void);

View file

@ -4078,7 +4078,6 @@ rendererinfo_t d3drendererinfo = {
QR_OPENGL, QR_OPENGL,
GLDraw_PicFromWad,
GLDraw_SafePicFromWad, GLDraw_SafePicFromWad,
GLDraw_CachePic, GLDraw_CachePic,
GLDraw_SafeCachePic, GLDraw_SafeCachePic,

View file

@ -9615,7 +9615,7 @@ void PR_ResetBuiltins(progstype_t type) //fix all nulls to PF_FIXME and add any
PR_EnableEBFSBuiltin("forcedemoframe", 103)!= 103) PR_EnableEBFSBuiltin("forcedemoframe", 103)!= 103)
Con_Printf("Failed to register all MVDSV builtins\n"); Con_Printf("Failed to register all MVDSV builtins\n");
else 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");
} }
} }

View file

@ -1985,7 +1985,7 @@ void SV_GibFilterInit(void)
file = COM_LoadStackFile("gibfiltr.cfg", buffer, sizeof(buffer)); file = COM_LoadStackFile("gibfiltr.cfg", buffer, sizeof(buffer));
if (!file) 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/gib1.mdl", -1, -1);
SV_GibFilterAdd("progs/gib2.mdl", -1, -1); SV_GibFilterAdd("progs/gib2.mdl", -1, -1);
SV_GibFilterAdd("progs/gib3.mdl", -1, -1); SV_GibFilterAdd("progs/gib3.mdl", -1, -1);

View file

@ -3640,7 +3640,7 @@ void SV_FilterImpulseInit(void)
s = COM_LoadStackFile("impfiltr.cfg", buffer, sizeof(buffer)); s = COM_LoadStackFile("impfiltr.cfg", buffer, sizeof(buffer));
if (!s) 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) while(s)
{ {

View file

@ -149,7 +149,7 @@ qbyte GetPaletteNoFB(int red, int green, int blue)
void MakeVideoPalette(void) void MakeVideoPalette(void)
{ {
FILE *f; vfsfile_t *f;
int r, g, b; int r, g, b;
// allocate memory // allocate memory
@ -158,11 +158,10 @@ void MakeVideoPalette(void)
// pal555to8 = Hunk_AllocName(PAL555_SIZE, "RGB data"); // pal555to8 = Hunk_AllocName(PAL555_SIZE, "RGB data");
// load in previously created table // load in previously created table
COM_FOpenFile ("pal555.pal", &f); if ((f = FS_OpenVFS("pal555.pal", "rb", FS_BASE)))
if (f)
{ {
fread(pal555to8, 1, PAL555_SIZE, f); //cached VFS_READ(f, pal555to8, PAL555_SIZE);
fclose(f); VFS_CLOSE(f);
return; return;
} }

View file

@ -246,7 +246,10 @@ mpic_t *SWDraw_ConcharsMalloc (void)
if (i == swmenu_numcachepics) if (i == swmenu_numcachepics)
{ {
if (swmenu_numcachepics == MAX_CACHED_PICS) 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++; swmenu_numcachepics++;
pic->cache.fake = true; pic->cache.fake = true;
pic->cache.data = BZ_Malloc(sizeof(qpic_t) + 128*128); 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 (i == swmenu_numcachepics)
{ {
if (swmenu_numcachepics == MAX_CACHED_PICS) 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++; swmenu_numcachepics++;
pic->cache.fake = false; pic->cache.fake = false;
pic->cache.data = NULL; pic->cache.data = NULL;