2008-12-03 11:05:16 +00:00
|
|
|
#ifndef _polymost_h_
|
|
|
|
# define _polymost_h_
|
2006-08-30 23:32:39 +00:00
|
|
|
|
2008-12-02 10:44:39 +00:00
|
|
|
#ifdef POLYMOST
|
2006-08-30 23:32:39 +00:00
|
|
|
|
2008-12-02 10:44:39 +00:00
|
|
|
#define CULL_OFFSET 384
|
|
|
|
#define CULL_DELAY 2
|
|
|
|
#define MAXCULLCHECKS 1024
|
|
|
|
|
|
|
|
extern int lastcullcheck;
|
|
|
|
extern char cullmodel[MAXSPRITES];
|
|
|
|
extern int cullcheckcnt;
|
|
|
|
|
|
|
|
#define PI 3.14159265358979323
|
|
|
|
|
|
|
|
typedef struct { unsigned char r, g, b, a; } coltype;
|
|
|
|
|
|
|
|
extern int rendmode;
|
|
|
|
extern float gtang;
|
|
|
|
extern float glox1, gloy1;
|
|
|
|
extern double gxyaspect, grhalfxdown10x;
|
|
|
|
extern double gcosang, gsinang, gcosang2, gsinang2;
|
|
|
|
extern double gchang, gshang, gctang, gstang;
|
|
|
|
|
|
|
|
struct glfiltermodes {
|
|
|
|
char *name;
|
|
|
|
int min,mag;
|
2006-08-30 23:32:39 +00:00
|
|
|
};
|
2008-12-02 10:44:39 +00:00
|
|
|
#define numglfiltermodes 6
|
|
|
|
extern struct glfiltermodes glfiltermodes[numglfiltermodes];
|
|
|
|
|
|
|
|
extern const char *TEXCACHEDIR;
|
|
|
|
void phex(unsigned char v, char *s);
|
|
|
|
void uploadtexture(int doalloc, int xsiz, int ysiz, int intexfmt, int texfmt, coltype *pic, int tsizx, int tsizy, int dameth);
|
|
|
|
void polymost_drawsprite(int snum);
|
|
|
|
void polymost_drawmaskwall(int damaskwallcnt);
|
|
|
|
void polymost_dorotatesprite(int sx, int sy, int z, short a, short picnum,
|
|
|
|
signed char dashade, char dapalnum, char dastat, int cx1, int cy1, int cx2, int cy2, int uniqid);
|
|
|
|
void polymost_fillpolygon(int npoints);
|
|
|
|
void polymost_initosdfuncs(void);
|
|
|
|
void polymost_drawrooms(void);
|
|
|
|
|
|
|
|
void polymost_glinit(void);
|
|
|
|
void polymost_glreset(void);
|
|
|
|
|
|
|
|
void gltexinvalidate(int dapicnum, int dapalnum, int dameth);
|
|
|
|
void gltexinvalidateall(void);
|
|
|
|
void gltexinvalidate8(void);
|
|
|
|
int polymost_printext256(int xpos, int ypos, short col, short backcol, char *name, char fontsize);
|
|
|
|
|
|
|
|
// Depth peeling control
|
|
|
|
extern int r_curpeel;
|
|
|
|
extern float curpolygonoffset;
|
|
|
|
extern int peelcompiling;
|
|
|
|
|
|
|
|
// Depth peeling data
|
|
|
|
extern GLuint ztexture[3];
|
|
|
|
extern GLuint *peels;
|
|
|
|
extern GLuint *peelfbos;
|
|
|
|
extern GLuint peelprogram[2];
|
2006-08-30 23:32:39 +00:00
|
|
|
|
2008-12-02 10:44:39 +00:00
|
|
|
extern int cachefilehandle;
|
|
|
|
extern FILE *cacheindexptr;
|
|
|
|
extern struct HASH_table cacheH;
|
|
|
|
|
2008-12-13 07:23:13 +00:00
|
|
|
struct cacheitem_t
|
2008-12-02 10:44:39 +00:00
|
|
|
{
|
|
|
|
char name[BMAX_PATH];
|
|
|
|
int offset;
|
|
|
|
int len;
|
2008-12-13 07:23:13 +00:00
|
|
|
struct cacheitem_t *next;
|
2008-12-02 10:44:39 +00:00
|
|
|
};
|
|
|
|
|
2008-12-13 07:23:13 +00:00
|
|
|
typedef struct cacheitem_t texcacheindex;
|
2008-12-02 10:44:39 +00:00
|
|
|
|
|
|
|
extern texcacheindex firstcacheindex;
|
2008-12-13 07:23:13 +00:00
|
|
|
extern texcacheindex *curcacheindex;
|
2008-12-02 10:44:39 +00:00
|
|
|
extern texcacheindex *cacheptrs[MAXTILES<<2];
|
|
|
|
extern int numcacheentries;
|
|
|
|
|
|
|
|
int dxtfilter(int fil, texcachepicture *pict, char *pic, void *midbuf, char *packbuf, unsigned int miplen);
|
|
|
|
int dedxtfilter(int fil, texcachepicture *pict, char *pic, void *midbuf, char *packbuf, int ispacked);
|
|
|
|
|
|
|
|
void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *head);
|
|
|
|
|
|
|
|
extern float shadescale;
|
|
|
|
extern float alphahackarray[MAXTILES];
|
2006-08-30 23:32:39 +00:00
|
|
|
|
|
|
|
typedef struct pthtyp_t
|
|
|
|
{
|
|
|
|
struct pthtyp_t *next;
|
2008-09-12 02:07:44 +00:00
|
|
|
unsigned int glpic;
|
2006-08-30 23:32:39 +00:00
|
|
|
short picnum;
|
|
|
|
char palnum;
|
|
|
|
char effects;
|
|
|
|
char flags; // 1 = clamped (dameth&4), 2 = hightile, 4 = skybox face, 8 = hasalpha, 16 = hasfullbright, 128 = invalidated
|
|
|
|
char skyface;
|
|
|
|
hicreplctyp *hicr;
|
|
|
|
|
|
|
|
unsigned short sizx, sizy;
|
|
|
|
float scalex, scaley;
|
|
|
|
struct pthtyp_t *ofb; // only fullbright
|
2007-12-20 19:14:38 +00:00
|
|
|
|
|
|
|
char *palmap;int size;
|
2007-01-29 01:18:16 +00:00
|
|
|
} pthtyp;
|
|
|
|
|
2007-12-12 17:42:14 +00:00
|
|
|
pthtyp * gltexcache (int dapicnum, int dapalnum, int dameth);
|
2007-01-29 01:18:16 +00:00
|
|
|
|
2006-09-29 21:36:12 +00:00
|
|
|
extern palette_t hictinting[MAXPALOOKUPS];
|
2006-10-04 09:54:25 +00:00
|
|
|
extern float gtang;
|
2008-06-06 14:00:12 +00:00
|
|
|
extern int globalposx, globalposy, globalposz, globalhoriz;
|
|
|
|
extern short globalang, globalcursectnum;
|
|
|
|
extern int globalpal, cosglobalang, singlobalang;
|
|
|
|
extern int cosviewingrangeglobalang, sinviewingrangeglobalang;
|
|
|
|
extern float shadescale;
|
|
|
|
extern int globalnoeffect;
|
2008-06-09 09:25:47 +00:00
|
|
|
extern int drawingskybox;
|
2007-01-29 01:18:16 +00:00
|
|
|
|
2008-12-02 10:44:39 +00:00
|
|
|
#endif
|
2008-05-05 09:05:07 +00:00
|
|
|
|
2008-12-03 11:05:16 +00:00
|
|
|
#endif
|