mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
new texcache stuff
git-svn-id: https://svn.eduke32.com/eduke32@1155 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0f385d3021
commit
cc73a2d7c6
11 changed files with 268 additions and 67 deletions
|
@ -543,6 +543,7 @@ extern int glusetexcache, glusetexcachecompression;
|
||||||
extern int glmultisample, glnvmultisamplehint;
|
extern int glmultisample, glnvmultisamplehint;
|
||||||
extern int glwidescreen, glprojectionhacks;
|
extern int glwidescreen, glprojectionhacks;
|
||||||
void gltexapplyprops (void);
|
void gltexapplyprops (void);
|
||||||
|
void invalidatecache(void);
|
||||||
|
|
||||||
extern int r_depthpeeling, r_peelscount;
|
extern int r_depthpeeling, r_peelscount;
|
||||||
extern int r_detailmapping;
|
extern int r_detailmapping;
|
||||||
|
|
|
@ -678,7 +678,7 @@ static int defsparser(scriptfile *script)
|
||||||
for (j=ysiz-1;j>=0;j--)
|
for (j=ysiz-1;j>=0;j--)
|
||||||
{
|
{
|
||||||
col = (palette_t *)&picptr[j*xsiz+i];
|
col = (palette_t *)&picptr[j*xsiz+i];
|
||||||
if (col->f != 255) { faketiledata[tile][i*ysiz+j] = 255; continue; }
|
if (col->f < alphacut) { faketiledata[tile][i*ysiz+j] = 255; continue; }
|
||||||
faketiledata[tile][i*ysiz+j] = getclosestcol(col->b>>2,col->g>>2,col->r>>2);
|
faketiledata[tile][i*ysiz+j] = getclosestcol(col->b>>2,col->g>>2,col->r>>2);
|
||||||
}
|
}
|
||||||
// initprintf(" %d %d %d %d\n",col->r,col->g,col->b,col->f);
|
// initprintf(" %d %d %d %d\n",col->r,col->g,col->b,col->f);
|
||||||
|
@ -699,7 +699,6 @@ static int defsparser(scriptfile *script)
|
||||||
|
|
||||||
Bfree(picptr);
|
Bfree(picptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case T_IMPORTTILE:
|
case T_IMPORTTILE:
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "crc32.h"
|
#include "crc32.h"
|
||||||
|
|
||||||
#include "baselayer.h"
|
#include "baselayer.h"
|
||||||
|
#include "scriptfile.h"
|
||||||
|
|
||||||
#ifdef POLYMOST
|
#ifdef POLYMOST
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
|
@ -87,7 +88,7 @@ double vid_brightness = DEFAULT_BRIGHTNESS;
|
||||||
static char globalpolytype;
|
static char globalpolytype;
|
||||||
static short *dotp1[MAXYDIM], *dotp2[MAXYDIM];
|
static short *dotp1[MAXYDIM], *dotp2[MAXYDIM];
|
||||||
|
|
||||||
static unsigned char tempbuf[MAXWALLS];
|
static char tempbuf[MAXWALLS];
|
||||||
|
|
||||||
int ebpbak, espbak;
|
int ebpbak, espbak;
|
||||||
int slopalookup[16384]; // was 2048
|
int slopalookup[16384]; // was 2048
|
||||||
|
@ -5785,6 +5786,8 @@ void uninitengine(void)
|
||||||
polymost_glreset();
|
polymost_glreset();
|
||||||
hicinit();
|
hicinit();
|
||||||
freeallmodels();
|
freeallmodels();
|
||||||
|
if (g_cachefil > -1) Bclose(g_cachefil);
|
||||||
|
if (g_indexfil != NULL) Bfclose(g_indexfil);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uninitsystem();
|
uninitsystem();
|
||||||
|
@ -7392,7 +7395,6 @@ int loadoldboard(char *filename, char fromwhere, int *daposx, int *daposy, int *
|
||||||
// loadmaphack
|
// loadmaphack
|
||||||
//
|
//
|
||||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||||
#include "scriptfile.h"
|
|
||||||
int loadmaphack(char *filename)
|
int loadmaphack(char *filename)
|
||||||
{
|
{
|
||||||
enum
|
enum
|
||||||
|
|
|
@ -560,11 +560,11 @@ static int daskinloader(int filh, intptr_t *fptr, int *bpl, int *sizx, int *sizy
|
||||||
// JONOF'S COMPRESSED TEXTURE CACHE STUFF ---------------------------------------------------
|
// JONOF'S COMPRESSED TEXTURE CACHE STUFF ---------------------------------------------------
|
||||||
int mdloadskin_trytexcache(char *fn, int len, int pal, char effect, texcacheheader *head)
|
int mdloadskin_trytexcache(char *fn, int len, int pal, char effect, texcacheheader *head)
|
||||||
{
|
{
|
||||||
int fil, fp;
|
int fp;
|
||||||
char cachefn[BMAX_PATH], *cp;
|
char cachefn[BMAX_PATH], *cp;
|
||||||
unsigned char mdsum[16];
|
unsigned char mdsum[16];
|
||||||
|
|
||||||
if (!glinfo.texcompr || !glusetexcompr || !glusetexcache) return -1;
|
if (!glinfo.texcompr || !glusetexcompr || !glusetexcache || !g_indexfil || g_cachefil < 0) return -1;
|
||||||
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
|
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
|
||||||
{
|
{
|
||||||
// lacking the necessary extensions to do this
|
// lacking the necessary extensions to do this
|
||||||
|
@ -574,17 +574,44 @@ int mdloadskin_trytexcache(char *fn, int len, int pal, char effect, texcachehead
|
||||||
}
|
}
|
||||||
|
|
||||||
md4once((unsigned char *)fn, strlen(fn), mdsum);
|
md4once((unsigned char *)fn, strlen(fn), mdsum);
|
||||||
for (cp = cachefn, fp = 0; (*cp = TEXCACHEDIR[fp]); cp++,fp++);
|
// for (cp = cachefn, fp = 0; (*cp = TEXCACHEDIR[fp]); cp++,fp++);
|
||||||
*(cp++) = '/';
|
// *(cp++) = '/';
|
||||||
|
cp = cachefn;
|
||||||
for (fp = 0; fp < 16; phex(mdsum[fp++], cp), cp+=2);
|
for (fp = 0; fp < 16; phex(mdsum[fp++], cp), cp+=2);
|
||||||
sprintf(cp, "-%x-%x%x", len, pal, effect);
|
sprintf(cp, "-%x-%x%x", len, pal, effect);
|
||||||
|
|
||||||
fil = kopen4load(cachefn, 0);
|
// fil = kopen4load(cachefn, 0);
|
||||||
if (fil < 0) return -1;
|
// if (fil < 0) return -1;
|
||||||
|
|
||||||
/* initprintf("Loading cached skin: %s\n", cachefn); */
|
if (firsttexture.next == NULL)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int offset = 0;
|
||||||
|
int len = 0;
|
||||||
|
|
||||||
if (kread(fil, head, sizeof(texcacheheader)) < (int)sizeof(texcacheheader)) goto failure;
|
texcacheindex *cacheindexptr = &firsttexture;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// initprintf("checking %s against %s\n",cachefn,cacheindexptr->name);
|
||||||
|
if (!Bstrcmp(cachefn,cacheindexptr->name))
|
||||||
|
{
|
||||||
|
offset = cacheindexptr->offset;
|
||||||
|
len = cacheindexptr->len;
|
||||||
|
// initprintf("got a match for %s offset %d\n",cachefn,offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
cacheindexptr = cacheindexptr->next;
|
||||||
|
}
|
||||||
|
while (cacheindexptr->next);
|
||||||
|
if (len == 0) return -1; // didn't find it
|
||||||
|
Blseek(g_cachefil, offset, BSEEK_SET);
|
||||||
|
}
|
||||||
|
|
||||||
|
// initprintf("Loading cached skin: %s\n", cachefn);
|
||||||
|
|
||||||
|
if (Bread(g_cachefil, head, sizeof(texcacheheader)) < (int)sizeof(texcacheheader)) goto failure;
|
||||||
if (memcmp(head->magic, "Polymost", 8)) goto failure;
|
if (memcmp(head->magic, "Polymost", 8)) goto failure;
|
||||||
|
|
||||||
head->xdim = B_LITTLE32(head->xdim);
|
head->xdim = B_LITTLE32(head->xdim);
|
||||||
|
@ -598,9 +625,10 @@ int mdloadskin_trytexcache(char *fn, int len, int pal, char effect, texcachehead
|
||||||
if (gltexmaxsize && (head->xdim > (1<<gltexmaxsize) || head->ydim > (1<<gltexmaxsize))) goto failure;
|
if (gltexmaxsize && (head->xdim > (1<<gltexmaxsize) || head->ydim > (1<<gltexmaxsize))) goto failure;
|
||||||
if (!glinfo.texnpot && (head->flags & 1)) goto failure;
|
if (!glinfo.texnpot && (head->flags & 1)) goto failure;
|
||||||
|
|
||||||
return fil;
|
return g_cachefil;
|
||||||
failure:
|
failure:
|
||||||
kclose(fil);
|
// kclose(fil);
|
||||||
|
initprintf("cache miss\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -626,7 +654,7 @@ static int mdloadskin_cached(int fil, texcacheheader *head, int *doalloc, GLuint
|
||||||
// load the mipmaps
|
// load the mipmaps
|
||||||
for (level = 0; level==0 || (pict.xdim > 1 || pict.ydim > 1); level++)
|
for (level = 0; level==0 || (pict.xdim > 1 || pict.ydim > 1); level++)
|
||||||
{
|
{
|
||||||
r = kread(fil, &pict, sizeof(texcachepicture));
|
r = Bread(fil, &pict, sizeof(texcachepicture));
|
||||||
if (r < (int)sizeof(texcachepicture)) goto failure;
|
if (r < (int)sizeof(texcachepicture)) goto failure;
|
||||||
|
|
||||||
pict.size = B_LITTLE32(pict.size);
|
pict.size = B_LITTLE32(pict.size);
|
||||||
|
@ -760,13 +788,13 @@ int mdloadskin(md2model *m, int number, int pal, int surf)
|
||||||
osizy = cachead.ydim;
|
osizy = cachead.ydim;
|
||||||
hasalpha = (cachead.flags & 2) ? 1 : 0;
|
hasalpha = (cachead.flags & 2) ? 1 : 0;
|
||||||
if (pal < (MAXPALOOKUPS - RESERVEDPALS))m->usesalpha = hasalpha;
|
if (pal < (MAXPALOOKUPS - RESERVEDPALS))m->usesalpha = hasalpha;
|
||||||
kclose(cachefil);
|
// kclose(cachefil);
|
||||||
//kclose(filh); // FIXME: uncomment when cache1d.c is fixed
|
//kclose(filh); // FIXME: uncomment when cache1d.c is fixed
|
||||||
// cachefil >= 0, so it won't be rewritten
|
// cachefil >= 0, so it won't be rewritten
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cachefil >= 0) kclose(cachefil);
|
// if (cachefil >= 0) kclose(cachefil);
|
||||||
cachefil = -1; // the compressed version will be saved to disk
|
cachefil = -1; // the compressed version will be saved to disk
|
||||||
|
|
||||||
if ((filh = kopen4load(fn, 0)) < 0) return -1;
|
if ((filh = kopen4load(fn, 0)) < 0) return -1;
|
||||||
|
|
|
@ -325,7 +325,11 @@ static void uploadtexture(int doalloc, int xsiz, int ysiz, int intexfmt, int tex
|
||||||
# include "lzwnew.h"
|
# include "lzwnew.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char TEXCACHEDIR[BMAX_PATH] = "texcache";
|
int g_cachefil = -1; // texture cache file handle
|
||||||
|
FILE *g_indexfil = NULL;
|
||||||
|
|
||||||
|
char TEXCACHEDIR[BMAX_PATH] = "textures";
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char magic[8]; // 'Polymost'
|
char magic[8]; // 'Polymost'
|
||||||
|
@ -349,6 +353,20 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea
|
||||||
|
|
||||||
int mdtims, omdtims;
|
int mdtims, omdtims;
|
||||||
float alphahackarray[MAXTILES];
|
float alphahackarray[MAXTILES];
|
||||||
|
|
||||||
|
struct cache_list
|
||||||
|
{
|
||||||
|
char name[BMAX_PATH];
|
||||||
|
int offset;
|
||||||
|
int len;
|
||||||
|
struct cache_list *next;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct cache_list texcacheindex;
|
||||||
|
|
||||||
|
texcacheindex firsttexture;
|
||||||
|
texcacheindex *datextures = NULL;
|
||||||
|
|
||||||
#include "mdsprite.c"
|
#include "mdsprite.c"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -631,7 +649,7 @@ void gltexapplyprops(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
static int LoadCacheOffsets(void);
|
||||||
static float glox1, gloy1, glox2, gloy2;
|
static float glox1, gloy1, glox2, gloy2;
|
||||||
|
|
||||||
//Use this for both initialization and uninitialization of OpenGL.
|
//Use this for both initialization and uninitialization of OpenGL.
|
||||||
|
@ -693,6 +711,29 @@ void polymost_glreset()
|
||||||
|
|
||||||
peels = NULL;
|
peels = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_cachefil != -1)
|
||||||
|
Bclose(g_cachefil);
|
||||||
|
|
||||||
|
if (g_indexfil)
|
||||||
|
Bfclose(g_indexfil);
|
||||||
|
|
||||||
|
datextures = &firsttexture;
|
||||||
|
LoadCacheOffsets();
|
||||||
|
|
||||||
|
Bstrcpy(tempbuf,TEXCACHEDIR);
|
||||||
|
Bstrcat(tempbuf,".cache");
|
||||||
|
g_indexfil = Bfopen(tempbuf, "at");
|
||||||
|
if (!g_indexfil)
|
||||||
|
{
|
||||||
|
initprintf("Unable to open cache index!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_cachefil = openfrompath(TEXCACHEDIR,BO_BINARY|BO_APPEND|BO_CREAT|BO_RDWR,BS_IREAD|BS_IWRITE);
|
||||||
|
|
||||||
|
if (g_cachefil < 0)
|
||||||
|
initprintf("Unable to open cache file!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// one-time initialization of OpenGL for polymost
|
// one-time initialization of OpenGL for polymost
|
||||||
|
@ -854,6 +895,52 @@ void polymost_glinit()
|
||||||
|
|
||||||
bglEnableClientState(GL_VERTEX_ARRAY);
|
bglEnableClientState(GL_VERTEX_ARRAY);
|
||||||
bglEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
bglEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
|
|
||||||
|
if (g_cachefil != -1)
|
||||||
|
Bclose(g_cachefil);
|
||||||
|
|
||||||
|
if (g_indexfil)
|
||||||
|
Bfclose(g_indexfil);
|
||||||
|
|
||||||
|
datextures = &firsttexture;
|
||||||
|
LoadCacheOffsets();
|
||||||
|
|
||||||
|
Bstrcpy(tempbuf,TEXCACHEDIR);
|
||||||
|
Bstrcat(tempbuf,".cache");
|
||||||
|
g_indexfil = Bfopen(tempbuf, "at");
|
||||||
|
if (!g_indexfil)
|
||||||
|
{
|
||||||
|
initprintf("Unable to open cache index!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
g_cachefil = Bopen(TEXCACHEDIR,BO_BINARY|BO_APPEND|BO_CREAT|BO_RDWR,BS_IREAD|BS_IWRITE);
|
||||||
|
|
||||||
|
if (g_cachefil < 0)
|
||||||
|
initprintf("Unable to open cache file!\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void invalidatecache(void)
|
||||||
|
{
|
||||||
|
if (g_cachefil != -1)
|
||||||
|
Bclose(g_cachefil);
|
||||||
|
|
||||||
|
if (g_indexfil)
|
||||||
|
Bfclose(g_indexfil);
|
||||||
|
|
||||||
|
datextures = &firsttexture;
|
||||||
|
|
||||||
|
Bstrcpy(tempbuf,TEXCACHEDIR);
|
||||||
|
Bstrcat(tempbuf,".cache");
|
||||||
|
g_indexfil = Bfopen(tempbuf, "wt");
|
||||||
|
if (!g_indexfil)
|
||||||
|
{
|
||||||
|
initprintf("Unable to open cache index!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
g_cachefil = Bopen(TEXCACHEDIR,BO_BINARY|BO_TRUNC|BO_CREAT|BO_RDWR,BS_IREAD|BS_IWRITE);
|
||||||
|
|
||||||
|
if (g_cachefil < 0)
|
||||||
|
initprintf("Unable to open cache file!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void resizeglcheck()
|
void resizeglcheck()
|
||||||
|
@ -1219,6 +1306,37 @@ int gloadtile_art(int dapic, int dapal, int dameth, pthtyp *pth, int doalloc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// JONOF'S COMPRESSED TEXTURE CACHE STUFF ---------------------------------------------------
|
// JONOF'S COMPRESSED TEXTURE CACHE STUFF ---------------------------------------------------
|
||||||
|
|
||||||
|
static int LoadCacheOffsets(void)
|
||||||
|
{
|
||||||
|
int foffset, fsize;
|
||||||
|
char *fname;
|
||||||
|
|
||||||
|
scriptfile *script;
|
||||||
|
|
||||||
|
Bstrcpy(tempbuf,TEXCACHEDIR);
|
||||||
|
Bstrcat(tempbuf,".cache");
|
||||||
|
script = scriptfile_fromfile(tempbuf);
|
||||||
|
|
||||||
|
if (!script) return -1;
|
||||||
|
|
||||||
|
while (!scriptfile_eof(script))
|
||||||
|
{
|
||||||
|
if (scriptfile_getstring(script, &fname)) break; // filename
|
||||||
|
if (scriptfile_getnumber(script, &foffset)) break; // offset in cache
|
||||||
|
if (scriptfile_getnumber(script, &fsize)) break; // size
|
||||||
|
|
||||||
|
strncpy(datextures->name, fname, BMAX_PATH);
|
||||||
|
datextures->offset = foffset;
|
||||||
|
datextures->len = fsize;
|
||||||
|
datextures->next = Bcalloc(1, sizeof(texcacheindex));
|
||||||
|
datextures = datextures->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
scriptfile_close(script);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static inline void phex(unsigned char v, char *s)
|
static inline void phex(unsigned char v, char *s)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
@ -1230,11 +1348,11 @@ static inline void phex(unsigned char v, char *s)
|
||||||
|
|
||||||
int trytexcache(char *fn, int len, int dameth, char effect, texcacheheader *head)
|
int trytexcache(char *fn, int len, int dameth, char effect, texcacheheader *head)
|
||||||
{
|
{
|
||||||
int fil, fp;
|
int fp;
|
||||||
char cachefn[BMAX_PATH], *cp;
|
char cachefn[BMAX_PATH], *cp;
|
||||||
unsigned char mdsum[16];
|
unsigned char mdsum[16];
|
||||||
|
|
||||||
if (!glinfo.texcompr || !glusetexcompr || !glusetexcache) return -1;
|
if (!glinfo.texcompr || !glusetexcompr || !glusetexcache || !g_indexfil || g_cachefil < 0) return -1;
|
||||||
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
|
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
|
||||||
{
|
{
|
||||||
// lacking the necessary extensions to do this
|
// lacking the necessary extensions to do this
|
||||||
|
@ -1244,19 +1362,45 @@ int trytexcache(char *fn, int len, int dameth, char effect, texcacheheader *head
|
||||||
}
|
}
|
||||||
|
|
||||||
md4once((unsigned char *)fn, strlen(fn), mdsum);
|
md4once((unsigned char *)fn, strlen(fn), mdsum);
|
||||||
for (cp = cachefn, fp = 0; (*cp = TEXCACHEDIR[fp]); cp++,fp++);
|
// for (cp = cachefn, fp = 0; (*cp = TEXCACHEDIR[fp]); cp++,fp++);
|
||||||
*(cp++) = '/';
|
// *(cp++) = '/';
|
||||||
|
cp = cachefn;
|
||||||
for (fp = 0; fp < 16; phex(mdsum[fp++], cp), cp+=2);
|
for (fp = 0; fp < 16; phex(mdsum[fp++], cp), cp+=2);
|
||||||
sprintf(cp, "-%x-%x%x", len, dameth, effect);
|
sprintf(cp, "-%x-%x%x", len, dameth, effect);
|
||||||
|
|
||||||
fil = kopen4load(cachefn, 0);
|
// fil = kopen4load(cachefn, 0);
|
||||||
if (fil < 0) return -1;
|
// if (fil < 0) return -1;
|
||||||
|
|
||||||
/* initprintf("Loading cached tex: %s\n", cachefn); */
|
if (firsttexture.next == NULL)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int offset = 0;
|
||||||
|
int len = 0;
|
||||||
|
|
||||||
if (kread(fil, head, sizeof(texcacheheader)) < (int)sizeof(texcacheheader)) goto failure;
|
texcacheindex *cacheindexptr = &firsttexture;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// initprintf("checking %s against %s\n",cachefn,cacheindexptr->name);
|
||||||
|
if (!Bstrcmp(cachefn,cacheindexptr->name))
|
||||||
|
{
|
||||||
|
offset = cacheindexptr->offset;
|
||||||
|
len = cacheindexptr->len;
|
||||||
|
// initprintf("got a match for %s offset %d\n",cachefn,offset);
|
||||||
|
// break;
|
||||||
|
}
|
||||||
|
cacheindexptr = cacheindexptr->next;
|
||||||
|
}
|
||||||
|
while (cacheindexptr->next);
|
||||||
|
if (len == 0) return -1; // didn't find it
|
||||||
|
Blseek(g_cachefil, offset, BSEEK_SET);
|
||||||
|
}
|
||||||
|
|
||||||
|
// initprintf("Loading cached tex: %s\n", cachefn);
|
||||||
|
|
||||||
|
if (Bread(g_cachefil, head, sizeof(texcacheheader)) < (int)sizeof(texcacheheader)) goto failure;
|
||||||
if (memcmp(head->magic, "Polymost", 8)) goto failure;
|
if (memcmp(head->magic, "Polymost", 8)) goto failure;
|
||||||
|
|
||||||
head->xdim = B_LITTLE32(head->xdim);
|
head->xdim = B_LITTLE32(head->xdim);
|
||||||
head->ydim = B_LITTLE32(head->ydim);
|
head->ydim = B_LITTLE32(head->ydim);
|
||||||
head->flags = B_LITTLE32(head->flags);
|
head->flags = B_LITTLE32(head->flags);
|
||||||
|
@ -1269,15 +1413,17 @@ int trytexcache(char *fn, int len, int dameth, char effect, texcacheheader *head
|
||||||
if (gltexmaxsize && (head->xdim > (1<<gltexmaxsize) || head->ydim > (1<<gltexmaxsize))) goto failure;
|
if (gltexmaxsize && (head->xdim > (1<<gltexmaxsize) || head->ydim > (1<<gltexmaxsize))) goto failure;
|
||||||
if (!glinfo.texnpot && (head->flags & 1)) goto failure;
|
if (!glinfo.texnpot && (head->flags & 1)) goto failure;
|
||||||
|
|
||||||
return fil;
|
return g_cachefil;
|
||||||
failure:
|
failure:
|
||||||
kclose(fil);
|
initprintf("cache miss\n");
|
||||||
|
// kclose(g_cachefil);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *head)
|
void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *head)
|
||||||
{
|
{
|
||||||
int fil=-1, fp;
|
// int fil=-1;
|
||||||
|
int fp;
|
||||||
char cachefn[BMAX_PATH], *cp;
|
char cachefn[BMAX_PATH], *cp;
|
||||||
unsigned char mdsum[16];
|
unsigned char mdsum[16];
|
||||||
texcachepicture pict;
|
texcachepicture pict;
|
||||||
|
@ -1287,7 +1433,7 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea
|
||||||
unsigned int padx=0, pady=0;
|
unsigned int padx=0, pady=0;
|
||||||
GLuint gi;
|
GLuint gi;
|
||||||
|
|
||||||
if (!glinfo.texcompr || !glusetexcompr || !glusetexcache) return;
|
if (!glinfo.texcompr || !glusetexcompr || !glusetexcache || !g_indexfil || g_cachefil < 0) return;
|
||||||
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
|
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
|
||||||
{
|
{
|
||||||
// lacking the necessary extensions to do this
|
// lacking the necessary extensions to do this
|
||||||
|
@ -1295,7 +1441,7 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea
|
||||||
glusetexcache = 0;
|
glusetexcache = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat(TEXCACHEDIR, &st) < 0)
|
if (stat(TEXCACHEDIR, &st) < 0)
|
||||||
|
@ -1325,21 +1471,22 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
gi = GL_FALSE;
|
gi = GL_FALSE;
|
||||||
bglGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_ARB, (GLint *)&gi);
|
bglGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_ARB, (GLint *)&gi);
|
||||||
if (gi != GL_TRUE) return;
|
if (gi != GL_TRUE) return;
|
||||||
|
|
||||||
md4once((unsigned char *)fn, strlen(fn), mdsum);
|
md4once((unsigned char *)fn, strlen(fn), mdsum);
|
||||||
for (cp = cachefn, fp = 0; (*cp = TEXCACHEDIR[fp]); cp++,fp++);
|
// for (cp = cachefn, fp = 0; (*cp = TEXCACHEDIR[fp]); cp++,fp++);
|
||||||
*(cp++) = '/';
|
// *(cp++) = '/';
|
||||||
|
cp = cachefn;
|
||||||
for (fp = 0; fp < 16; phex(mdsum[fp++], cp), cp+=2);
|
for (fp = 0; fp < 16; phex(mdsum[fp++], cp), cp+=2);
|
||||||
sprintf(cp, "-%x-%x%x", len, dameth, effect);
|
sprintf(cp, "-%x-%x%x", len, dameth, effect);
|
||||||
|
|
||||||
OSD_Printf("Writing cached tex: %s\n", cachefn);
|
OSD_Printf("Writing cached tex: %s ", cachefn);
|
||||||
|
|
||||||
fil = Bopen(cachefn,BO_BINARY|BO_CREAT|BO_TRUNC|BO_RDWR,BS_IREAD|BS_IWRITE);
|
// fil = Bopen(cachefn,BO_BINARY|BO_CREAT|BO_TRUNC|BO_RDWR,BS_IREAD|BS_IWRITE);
|
||||||
if (fil < 0) return;
|
// if (fil < 0) return;
|
||||||
|
|
||||||
memcpy(head->magic, "Polymost", 8); // sizes are set by caller
|
memcpy(head->magic, "Polymost", 8); // sizes are set by caller
|
||||||
|
|
||||||
|
@ -1350,7 +1497,12 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea
|
||||||
head->flags = B_LITTLE32(head->flags);
|
head->flags = B_LITTLE32(head->flags);
|
||||||
head->quality = B_LITTLE32(head->quality);
|
head->quality = B_LITTLE32(head->quality);
|
||||||
|
|
||||||
if (Bwrite(fil, head, sizeof(texcacheheader)) != sizeof(texcacheheader)) goto failure;
|
Bstrcpy(datextures->name, cachefn);
|
||||||
|
Blseek(g_cachefil, 0, BSEEK_END);
|
||||||
|
datextures->offset = Blseek(g_cachefil, 0, BSEEK_CUR);
|
||||||
|
initprintf("offset: %d\n",datextures->offset);
|
||||||
|
|
||||||
|
if (Bwrite(g_cachefil, head, sizeof(texcacheheader)) != sizeof(texcacheheader)) goto failure;
|
||||||
|
|
||||||
bglGetError();
|
bglGetError();
|
||||||
for (level = 0; level==0 || (padx > 1 || pady > 1); level++)
|
for (level = 0; level==0 || (padx > 1 || pady > 1); level++)
|
||||||
|
@ -1393,12 +1545,25 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea
|
||||||
bglGetCompressedTexImageARB(GL_TEXTURE_2D, level, pic);
|
bglGetCompressedTexImageARB(GL_TEXTURE_2D, level, pic);
|
||||||
if (bglGetError() != GL_NO_ERROR) goto failure;
|
if (bglGetError() != GL_NO_ERROR) goto failure;
|
||||||
|
|
||||||
if (Bwrite(fil, &pict, sizeof(texcachepicture)) != sizeof(texcachepicture)) goto failure;
|
if (Bwrite(g_cachefil, &pict, sizeof(texcachepicture)) != sizeof(texcachepicture)) goto failure;
|
||||||
if (dxtfilter(fil, &pict, pic, midbuf, packbuf, miplen)) goto failure;
|
if (dxtfilter(g_cachefil, &pict, pic, midbuf, packbuf, miplen)) goto failure;
|
||||||
}
|
}
|
||||||
|
datextures->len = Blseek(g_cachefil, 0, BSEEK_CUR) - datextures->offset;
|
||||||
|
datextures->next = (texcacheindex *)Bcalloc(1,sizeof(texcacheindex));
|
||||||
|
|
||||||
|
if (g_indexfil)
|
||||||
|
fprintf(g_indexfil, "\"%s\" %d %d\n", datextures->name, datextures->offset, datextures->len);
|
||||||
|
|
||||||
|
datextures = datextures->next;
|
||||||
|
|
||||||
|
goto success;
|
||||||
|
|
||||||
failure:
|
failure:
|
||||||
if (fil>=0) Bclose(fil);
|
initprintf("failure!\n");
|
||||||
|
datextures->offset = 0;
|
||||||
|
Bmemset(datextures->name,0,sizeof(datextures->name));
|
||||||
|
success:
|
||||||
|
// if (fil>=0) Bclose(fil);
|
||||||
if (midbuf) free(midbuf);
|
if (midbuf) free(midbuf);
|
||||||
if (pic) free(pic);
|
if (pic) free(pic);
|
||||||
if (packbuf) free(packbuf);
|
if (packbuf) free(packbuf);
|
||||||
|
@ -1429,7 +1594,7 @@ int gloadtile_cached(int fil, texcacheheader *head, int *doalloc, pthtyp *pth,in
|
||||||
// load the mipmaps
|
// load the mipmaps
|
||||||
for (level = 0; level==0 || (pict.xdim > 1 || pict.ydim > 1); level++)
|
for (level = 0; level==0 || (pict.xdim > 1 || pict.ydim > 1); level++)
|
||||||
{
|
{
|
||||||
r = kread(fil, &pict, sizeof(texcachepicture));
|
r = Bread(fil, &pict, sizeof(texcachepicture));
|
||||||
if (r < (int)sizeof(texcachepicture)) goto failure;
|
if (r < (int)sizeof(texcachepicture)) goto failure;
|
||||||
|
|
||||||
pict.size = B_LITTLE32(pict.size);
|
pict.size = B_LITTLE32(pict.size);
|
||||||
|
@ -1477,6 +1642,7 @@ int gloadtile_cached(int fil, texcacheheader *head, int *doalloc, pthtyp *pth,in
|
||||||
if (packbuf) free(packbuf);
|
if (packbuf) free(packbuf);
|
||||||
return 0;
|
return 0;
|
||||||
failure:
|
failure:
|
||||||
|
initprintf("failure!!!\n");
|
||||||
if (midbuf) free(midbuf);
|
if (midbuf) free(midbuf);
|
||||||
if (pic) free(pic);
|
if (pic) free(pic);
|
||||||
if (packbuf) free(packbuf);
|
if (packbuf) free(packbuf);
|
||||||
|
@ -1552,13 +1718,13 @@ int gloadtile_hi(int dapic,int dapalnum, int facen, hicreplctyp *hicr, int damet
|
||||||
tsizx = cachead.xdim;
|
tsizx = cachead.xdim;
|
||||||
tsizy = cachead.ydim;
|
tsizy = cachead.ydim;
|
||||||
hasalpha = (cachead.flags & 2) ? 0 : 255;
|
hasalpha = (cachead.flags & 2) ? 0 : 255;
|
||||||
kclose(cachefil);
|
// kclose(cachefil);
|
||||||
//kclose(filh); // FIXME: uncomment when cache1d.c is fixed
|
//kclose(filh); // FIXME: uncomment when cache1d.c is fixed
|
||||||
// cachefil >= 0, so it won't be rewritten
|
// cachefil >= 0, so it won't be rewritten
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cachefil >= 0) kclose(cachefil);
|
// if (cachefil >= 0) kclose(cachefil);
|
||||||
cachefil = -1; // the compressed version will be saved to disk
|
cachefil = -1; // the compressed version will be saved to disk
|
||||||
|
|
||||||
if ((filh = kopen4load(fn, 0)) < 0) return -1;
|
if ((filh = kopen4load(fn, 0)) < 0) return -1;
|
||||||
|
@ -6396,15 +6562,15 @@ int dedxtfilter(int fil, texcachepicture *pict, char *pic, void *midbuf, char *p
|
||||||
if (stride == 16) //If DXT3...
|
if (stride == 16) //If DXT3...
|
||||||
{
|
{
|
||||||
//alpha_4x4
|
//alpha_4x4
|
||||||
if (kread(fil,&cleng,4) < 4) return -1; cleng = B_LITTLE32(cleng);
|
if (Bread(fil,&cleng,4) < 4) return -1; cleng = B_LITTLE32(cleng);
|
||||||
j = (pict->size/stride)*8;
|
j = (pict->size/stride)*8;
|
||||||
#ifdef USELZF
|
#ifdef USELZF
|
||||||
if (ispacked && cleng < j) inbuf = packbuf; else inbuf = midbuf;
|
if (ispacked && cleng < j) inbuf = packbuf; else inbuf = midbuf;
|
||||||
if (kread(fil,inbuf,cleng) < cleng) return -1;
|
if (Bread(fil,inbuf,cleng) < cleng) return -1;
|
||||||
if (ispacked && cleng < j)
|
if (ispacked && cleng < j)
|
||||||
if (lzf_decompress(packbuf,cleng,midbuf,j) == 0) return -1;
|
if (lzf_decompress(packbuf,cleng,midbuf,j) == 0) return -1;
|
||||||
#else
|
#else
|
||||||
if (kread(fil,inbuf,cleng) < cleng) return -1;
|
if (Bread(fil,inbuf,cleng) < cleng) return -1;
|
||||||
if (ispacked && lzwuncompress(packbuf,cleng,midbuf,j) != j) return -1;
|
if (ispacked && lzwuncompress(packbuf,cleng,midbuf,j) != j) return -1;
|
||||||
#endif
|
#endif
|
||||||
cptr = midbuf;
|
cptr = midbuf;
|
||||||
|
@ -6414,15 +6580,15 @@ int dedxtfilter(int fil, texcachepicture *pict, char *pic, void *midbuf, char *p
|
||||||
}
|
}
|
||||||
|
|
||||||
//rgb0,rgb1
|
//rgb0,rgb1
|
||||||
if (kread(fil,&cleng,4) < 4) return -1; cleng = B_LITTLE32(cleng);
|
if (Bread(fil,&cleng,4) < 4) return -1; cleng = B_LITTLE32(cleng);
|
||||||
j = (pict->size/stride)*4;
|
j = (pict->size/stride)*4;
|
||||||
#ifdef USELZF
|
#ifdef USELZF
|
||||||
if (ispacked && cleng < j) inbuf = packbuf; else inbuf = midbuf;
|
if (ispacked && cleng < j) inbuf = packbuf; else inbuf = midbuf;
|
||||||
if (kread(fil,inbuf,cleng) < cleng) return -1;
|
if (Bread(fil,inbuf,cleng) < cleng) return -1;
|
||||||
if (ispacked && cleng < j)
|
if (ispacked && cleng < j)
|
||||||
if (lzf_decompress(packbuf,cleng,midbuf,j) == 0) return -1;
|
if (lzf_decompress(packbuf,cleng,midbuf,j) == 0) return -1;
|
||||||
#else
|
#else
|
||||||
if (kread(fil,inbuf,cleng) < cleng) return -1;
|
if (Bread(fil,inbuf,cleng) < cleng) return -1;
|
||||||
if (ispacked && lzwuncompress(packbuf,cleng,midbuf,j) != j) return -1;
|
if (ispacked && lzwuncompress(packbuf,cleng,midbuf,j) != j) return -1;
|
||||||
#endif
|
#endif
|
||||||
cptr = midbuf;
|
cptr = midbuf;
|
||||||
|
@ -6434,15 +6600,15 @@ int dedxtfilter(int fil, texcachepicture *pict, char *pic, void *midbuf, char *p
|
||||||
}
|
}
|
||||||
|
|
||||||
//index_4x4:
|
//index_4x4:
|
||||||
if (kread(fil,&cleng,4) < 4) return -1; cleng = B_LITTLE32(cleng);
|
if (Bread(fil,&cleng,4) < 4) return -1; cleng = B_LITTLE32(cleng);
|
||||||
j = (pict->size/stride)*4;
|
j = (pict->size/stride)*4;
|
||||||
#ifdef USELZF
|
#ifdef USELZF
|
||||||
if (ispacked && cleng < j) inbuf = packbuf; else inbuf = midbuf;
|
if (ispacked && cleng < j) inbuf = packbuf; else inbuf = midbuf;
|
||||||
if (kread(fil,inbuf,cleng) < cleng) return -1;
|
if (Bread(fil,inbuf,cleng) < cleng) return -1;
|
||||||
if (ispacked && cleng < j)
|
if (ispacked && cleng < j)
|
||||||
if (lzf_decompress(packbuf,cleng,midbuf,j) == 0) return -1;
|
if (lzf_decompress(packbuf,cleng,midbuf,j) == 0) return -1;
|
||||||
#else
|
#else
|
||||||
if (kread(fil,inbuf,cleng) < cleng) return -1;
|
if (Bread(fil,inbuf,cleng) < cleng) return -1;
|
||||||
if (ispacked && lzwuncompress(packbuf,cleng,midbuf,j) != j) return -1;
|
if (ispacked && lzwuncompress(packbuf,cleng,midbuf,j) != j) return -1;
|
||||||
#endif
|
#endif
|
||||||
cptr = midbuf;
|
cptr = midbuf;
|
||||||
|
|
|
@ -102,6 +102,8 @@ void P_AddAmmo(int weapon,DukePlayer_t *p,int amount)
|
||||||
|
|
||||||
void P_AddWeaponNoSwitch(DukePlayer_t *p, int weapon)
|
void P_AddWeaponNoSwitch(DukePlayer_t *p, int weapon)
|
||||||
{
|
{
|
||||||
|
int snum = sprite[p->i].yvel;
|
||||||
|
|
||||||
if (p->gotweapon[weapon] == 0)
|
if (p->gotweapon[weapon] == 0)
|
||||||
{
|
{
|
||||||
p->gotweapon[weapon] = 1;
|
p->gotweapon[weapon] = 1;
|
||||||
|
@ -110,10 +112,10 @@ void P_AddWeaponNoSwitch(DukePlayer_t *p, int weapon)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
if (aplWeaponSelectSound[p->curr_weapon][sprite[p->i].yvel])
|
if (aplWeaponSelectSound[p->curr_weapon][snum])
|
||||||
A_StopSound(aplWeaponSelectSound[p->curr_weapon][sprite[p->i].yvel],p->i);
|
A_StopSound(aplWeaponSelectSound[p->curr_weapon][snum],p->i);
|
||||||
if (aplWeaponSelectSound[weapon][sprite[p->i].yvel])
|
if (aplWeaponSelectSound[weapon][snum])
|
||||||
A_PlaySound(aplWeaponSelectSound[weapon][sprite[p->i].yvel],p->i);
|
A_PlaySound(aplWeaponSelectSound[weapon][snum],p->i);
|
||||||
#else
|
#else
|
||||||
switch (p->curr_weapon)
|
switch (p->curr_weapon)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,8 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
#include "osd.h"
|
#include "osd.h"
|
||||||
|
|
||||||
intptr_t *g_scriptPtr;
|
|
||||||
|
|
||||||
int g_scriptVersion = 13; // 13 = 1.3D-style CON files, 14 = 1.4/1.5 style CON files
|
int g_scriptVersion = 13; // 13 = 1.3D-style CON files, 14 = 1.4/1.5 style CON files
|
||||||
|
|
||||||
char g_szScriptFileName[BMAX_PATH] = "(none)"; // file we're currently compiling
|
char g_szScriptFileName[BMAX_PATH] = "(none)"; // file we're currently compiling
|
||||||
|
|
|
@ -56,6 +56,8 @@ extern char g_szScriptFileName[BMAX_PATH];
|
||||||
extern int g_totalLines,g_lineNumber;
|
extern int g_totalLines,g_lineNumber;
|
||||||
extern int g_numCompilerErrors,g_numCompilerWarnings;
|
extern int g_numCompilerErrors,g_numCompilerWarnings;
|
||||||
|
|
||||||
|
extern intptr_t *g_scriptPtr;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
|
|
|
@ -833,7 +833,7 @@ static int X_DoExecute(void)
|
||||||
//Following changed to use pointersizes
|
//Following changed to use pointersizes
|
||||||
g_t[5] = *insptr++; // Ai
|
g_t[5] = *insptr++; // Ai
|
||||||
g_t[4] = *(intptr_t *)(g_t[5]); // Action
|
g_t[4] = *(intptr_t *)(g_t[5]); // Action
|
||||||
g_t[1] = *(((intptr_t *)g_t[5])+1); // move
|
if (g_t[5]) g_t[1] = *(((intptr_t *)g_t[5])+1); // move
|
||||||
g_sp->hitag = *(((intptr_t *)g_t[5])+2); // move flags
|
g_sp->hitag = *(((intptr_t *)g_t[5])+2); // move flags
|
||||||
g_t[0] = g_t[2] = g_t[3] = 0; // count, actioncount... g_t[3] = ???
|
g_t[0] = g_t[2] = g_t[3] = 0; // count, actioncount... g_t[3] = ???
|
||||||
if (g_sp->hitag&random_angle)
|
if (g_sp->hitag&random_angle)
|
||||||
|
@ -1095,7 +1095,9 @@ static int X_DoExecute(void)
|
||||||
default:
|
default:
|
||||||
// fix for flying/jumping monsters getting stuck in water
|
// fix for flying/jumping monsters getting stuck in water
|
||||||
if (g_sp->statnum != MAXSTATUS && actorscrptr[g_sp->picnum] &&
|
if (g_sp->statnum != MAXSTATUS && actorscrptr[g_sp->picnum] &&
|
||||||
((moveptr && *(moveptr+1)) || g_sp->hitag & jumptoplayer))
|
(g_sp->hitag & jumptoplayer ||
|
||||||
|
(moveptr >= g_scriptPtr && moveptr <= (g_scriptPtr+g_scriptSize) && *(moveptr+1)))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// OSD_Printf("%d\n",*(moveptr+1));
|
// OSD_Printf("%d\n",*(moveptr+1));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1470,11 +1470,11 @@ void Gv_RefreshPointers(void)
|
||||||
aGameVars[Gv_GetVarIndex("lastvisinc")].lValue = (intptr_t)&lastvisinc;
|
aGameVars[Gv_GetVarIndex("lastvisinc")].lValue = (intptr_t)&lastvisinc;
|
||||||
aGameVars[Gv_GetVarIndex("numsectors")].lValue = (intptr_t)&numsectors;
|
aGameVars[Gv_GetVarIndex("numsectors")].lValue = (intptr_t)&numsectors;
|
||||||
aGameVars[Gv_GetVarIndex("numplayers")].lValue = (intptr_t)&numplayers;
|
aGameVars[Gv_GetVarIndex("numplayers")].lValue = (intptr_t)&numplayers;
|
||||||
aGameVars[Gv_GetVarIndex("g_currentMenu")].lValue = (intptr_t)&g_currentMenu;
|
aGameVars[Gv_GetVarIndex("cenu")].lValue = (intptr_t)&g_currentMenu;
|
||||||
aGameVars[Gv_GetVarIndex("viewingrange")].lValue = (intptr_t)&viewingrange;
|
aGameVars[Gv_GetVarIndex("viewingrange")].lValue = (intptr_t)&viewingrange;
|
||||||
aGameVars[Gv_GetVarIndex("yxaspect")].lValue = (intptr_t)&yxaspect;
|
aGameVars[Gv_GetVarIndex("yxaspect")].lValue = (intptr_t)&yxaspect;
|
||||||
aGameVars[Gv_GetVarIndex("gravitationalconstant")].lValue = (intptr_t)&g_spriteGravity;
|
aGameVars[Gv_GetVarIndex("gravitationalconstant")].lValue = (intptr_t)&g_spriteGravity;
|
||||||
aGameVars[Gv_GetVarIndex("GametypeFlags")].lValue = (intptr_t)&GametypeFlags[ud.coop];
|
aGameVars[Gv_GetVarIndex("gametypeflags")].lValue = (intptr_t)&GametypeFlags[ud.coop];
|
||||||
aGameVars[Gv_GetVarIndex("framerate")].lValue = (intptr_t)&g_currentFrameRate;
|
aGameVars[Gv_GetVarIndex("framerate")].lValue = (intptr_t)&g_currentFrameRate;
|
||||||
|
|
||||||
aGameVars[Gv_GetVarIndex("camerax")].lValue = (intptr_t)&ud.camerax;
|
aGameVars[Gv_GetVarIndex("camerax")].lValue = (intptr_t)&ud.camerax;
|
||||||
|
@ -1483,8 +1483,8 @@ void Gv_RefreshPointers(void)
|
||||||
aGameVars[Gv_GetVarIndex("cameraang")].lValue = (intptr_t)&ud.cameraang;
|
aGameVars[Gv_GetVarIndex("cameraang")].lValue = (intptr_t)&ud.cameraang;
|
||||||
aGameVars[Gv_GetVarIndex("camerahoriz")].lValue = (intptr_t)&ud.camerahoriz;
|
aGameVars[Gv_GetVarIndex("camerahoriz")].lValue = (intptr_t)&ud.camerahoriz;
|
||||||
aGameVars[Gv_GetVarIndex("camerasect")].lValue = (intptr_t)&ud.camerasect;
|
aGameVars[Gv_GetVarIndex("camerasect")].lValue = (intptr_t)&ud.camerasect;
|
||||||
aGameVars[Gv_GetVarIndex("g_cameraDistance")].lValue = (intptr_t)&g_cameraDistance;
|
aGameVars[Gv_GetVarIndex("cameradist")].lValue = (intptr_t)&g_cameraDistance;
|
||||||
aGameVars[Gv_GetVarIndex("g_cameraClock")].lValue = (intptr_t)&g_cameraClock;
|
aGameVars[Gv_GetVarIndex("cameraclock")].lValue = (intptr_t)&g_cameraClock;
|
||||||
|
|
||||||
aGameVars[Gv_GetVarIndex("myx")].lValue = (intptr_t)&myx;
|
aGameVars[Gv_GetVarIndex("myx")].lValue = (intptr_t)&myx;
|
||||||
aGameVars[Gv_GetVarIndex("myy")].lValue = (intptr_t)&myy;
|
aGameVars[Gv_GetVarIndex("myy")].lValue = (intptr_t)&myy;
|
||||||
|
|
|
@ -2531,6 +2531,7 @@ cheat_for_port_credits:
|
||||||
_bar(1,d+8,yy+7, &r_downsize,-1,enabled && x==io,MENUHIGHLIGHT(io),!enabled,0,2);
|
_bar(1,d+8,yy+7, &r_downsize,-1,enabled && x==io,MENUHIGHLIGHT(io),!enabled,0,2);
|
||||||
if (r_downsize != i)
|
if (r_downsize != i)
|
||||||
{
|
{
|
||||||
|
invalidatecache();
|
||||||
resetvideomode();
|
resetvideomode();
|
||||||
if (setgamemode(fullscreen,xdim,ydim,bpp))
|
if (setgamemode(fullscreen,xdim,ydim,bpp))
|
||||||
OSD_Printf("restartvid: Reset failed...\n");
|
OSD_Printf("restartvid: Reset failed...\n");
|
||||||
|
|
Loading…
Reference in a new issue