git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5203 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
999d677515
commit
4c0f3ede74
3 changed files with 43 additions and 17 deletions
|
@ -7836,7 +7836,7 @@ qboolean CSQC_DrawView(void)
|
|||
G_FLOAT(OFS_PARM0) = vid.width;
|
||||
G_FLOAT(OFS_PARM1) = vid.height;
|
||||
}
|
||||
G_FLOAT(OFS_PARM2) = !Key_Dest_Has(kdm_emenu) && !r_refdef.eyeoffset[0] && !r_refdef.eyeoffset[1];
|
||||
G_FLOAT(OFS_PARM2) = !Key_Dest_Has(kdm_emenu|kdm_gmenu|kdm_cwindows) && !r_refdef.eyeoffset[0] && !r_refdef.eyeoffset[1];
|
||||
|
||||
if (csqcg.f_updateviewloading && cls.state && cls.state < ca_active)
|
||||
PR_ExecuteProgram(csqcprogs, csqcg.f_updateviewloading);
|
||||
|
@ -7879,10 +7879,14 @@ qboolean CSQC_DrawHud(playerview_t *pv)
|
|||
G_FLOAT(OFS_PARM0+0) = r_refdef.grect.width;
|
||||
G_FLOAT(OFS_PARM0+1) = r_refdef.grect.height;
|
||||
G_FLOAT(OFS_PARM0+2) = 0;
|
||||
#ifdef QUAKEHUD
|
||||
G_FLOAT(OFS_PARM1) = (pv->sb_showscores?1:0) | (pv->sb_showteamscores?2:0);
|
||||
// G_FLOAT(OFS_PARM2+0) = r_refdef.grect.x;
|
||||
// G_FLOAT(OFS_PARM2+1) = r_refdef.grect.y;
|
||||
// G_FLOAT(OFS_PARM2+2) = pv-cl.playerview;
|
||||
#else
|
||||
G_FLOAT(OFS_PARM1) = false; //hmm
|
||||
#endif
|
||||
G_FLOAT(OFS_PARM2+0) = 0;//r_refdef.grect.x;
|
||||
G_FLOAT(OFS_PARM2+1) = 0;//r_refdef.grect.y;
|
||||
G_FLOAT(OFS_PARM2+2) = 0;//pv-cl.playerview;
|
||||
PR_ExecuteProgram(csqcprogs, csqcg.f_drawhud);
|
||||
|
||||
if (*r_refdef.rt_destcolour[0].texname)
|
||||
|
@ -7919,10 +7923,14 @@ qboolean CSQC_DrawScores(playerview_t *pv)
|
|||
G_FLOAT(OFS_PARM0+0) = r_refdef.grect.width;
|
||||
G_FLOAT(OFS_PARM0+1) = r_refdef.grect.height;
|
||||
G_FLOAT(OFS_PARM0+2) = 0;
|
||||
#ifdef QUAKEHUD
|
||||
G_FLOAT(OFS_PARM1) = (pv->sb_showscores?1:0) | (pv->sb_showteamscores?2:0);
|
||||
// G_FLOAT(OFS_PARM2+0) = r_refdef.grect.x;
|
||||
// G_FLOAT(OFS_PARM2+1) = r_refdef.grect.y;
|
||||
// G_FLOAT(OFS_PARM2+2) = pv-cl.playerview;
|
||||
#else
|
||||
G_FLOAT(OFS_PARM1) = false; //hmm
|
||||
#endif
|
||||
G_FLOAT(OFS_PARM2+0) = 0;//r_refdef.grect.x;
|
||||
G_FLOAT(OFS_PARM2+1) = 0;//r_refdef.grect.y;
|
||||
G_FLOAT(OFS_PARM2+2) = 0;//pv-cl.playerview;
|
||||
PR_ExecuteProgram(csqcprogs, csqcg.f_drawscores);
|
||||
|
||||
if (*r_refdef.rt_destcolour[0].texname)
|
||||
|
|
|
@ -3706,7 +3706,7 @@ void QCC_PackFile (char *src, char *name)
|
|||
pf->filepos = PRLittleLong (SafeSeek (packhandle, 0, SEEK_CUR));
|
||||
pf->filelen = PRLittleLong (remaining);
|
||||
strcpy (pf->name, name);
|
||||
printf ("%64s : %7i\n", pf->name, remaining);
|
||||
printf ("%64s : %7u\n", pf->name, (unsigned int)remaining);
|
||||
|
||||
packbytes += remaining;
|
||||
|
||||
|
@ -3720,7 +3720,7 @@ void QCC_PackFile (char *src, char *name)
|
|||
pf->filepos = PRLittleLong (lseek (packhandle, 0, SEEK_CUR));
|
||||
pf->filelen = PRLittleLong (remaining);
|
||||
strcpy (pf->name, name);
|
||||
printf ("%64s : %7i\n", pf->name, remaining);
|
||||
printf ("%64s : %7u\n", pf->name, (unsigned int)remaining);
|
||||
|
||||
packbytes += remaining;
|
||||
|
||||
|
|
|
@ -8,21 +8,39 @@
|
|||
LoadFile
|
||||
==============
|
||||
*/
|
||||
unsigned char *PDECL QCC_ReadFile (const char *fname, void *buffer, int len, size_t *sz)
|
||||
void *QCC_ReadFile(const char *fname, unsigned char *(*buf_get)(void *ctx, size_t len), void *buf_ctx, size_t *out_size)
|
||||
//unsigned char *PDECL QCC_ReadFile (const char *fname, void *buffer, int len, size_t *sz)
|
||||
{
|
||||
long length;
|
||||
size_t len;
|
||||
FILE *f;
|
||||
char *buffer;
|
||||
|
||||
f = fopen(fname, "rb");
|
||||
if (!f)
|
||||
{
|
||||
if (out_size)
|
||||
*out_size = 0;
|
||||
return NULL;
|
||||
length = fread(buffer, 1, len, f);
|
||||
}
|
||||
|
||||
fseek(f, 0, SEEK_END);
|
||||
len = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
if (buf_get)
|
||||
buffer = buf_get(buf_ctx, len+1);
|
||||
else
|
||||
buffer = malloc(len+1);
|
||||
((char*)buffer)[len] = 0;
|
||||
if (len != fread(buffer, 1, len, f))
|
||||
{
|
||||
if (!buf_get)
|
||||
free(buffer);
|
||||
buffer = NULL;
|
||||
}
|
||||
fclose(f);
|
||||
|
||||
if (length != len)
|
||||
return NULL;
|
||||
|
||||
if (sz)
|
||||
*sz = length;
|
||||
if (out_size)
|
||||
*out_size = len;
|
||||
return buffer;
|
||||
}
|
||||
int PDECL QCC_FileSize (const char *fname)
|
||||
|
|
Loading…
Reference in a new issue