2007-01-29 01:18:16 +00:00
|
|
|
// here lies the GREAT JUSTICE RENDERER
|
|
|
|
// TODO :
|
|
|
|
// - recursive drawrooms with cliplane stack (support for full portal engine with occlusion queries)
|
|
|
|
// - crossed walls (tier drops stones)
|
|
|
|
// - skies
|
|
|
|
// - mirrors
|
|
|
|
// - fullbright (multitexture OR)
|
|
|
|
// - masks and sprites ! (use sortcnt and regular drawmask or recode it ?)
|
|
|
|
// - classic shading
|
|
|
|
// --------------------- CLASSIC LIMIT ---------------------
|
|
|
|
// - mdsprites (tags)
|
|
|
|
// - lights (dynamic phong)
|
|
|
|
// - dynamic shadowmaps
|
|
|
|
// - normalmap palette (unified gpu program, parallax mapping)
|
|
|
|
// - shadow volumes
|
|
|
|
// - hardware particles
|
|
|
|
// - multitextured decals ? (on models too)
|
|
|
|
// --------------- FIRST PUBLIC RELEASE LIMIT --------------
|
|
|
|
// - horizon mapping (precalculate the horizon maps and store them into the gl cache ?)
|
|
|
|
// - post processing ([HDR-]bloom and possibly DOF)
|
|
|
|
// - MD5 (hardware skinning ?)
|
|
|
|
|
|
|
|
#ifndef _polymer_h_
|
|
|
|
# define _polymer_h_
|
|
|
|
|
|
|
|
# include "compat.h"
|
|
|
|
# include "build.h"
|
|
|
|
# include "glbuild.h"
|
|
|
|
# include "osd.h"
|
|
|
|
# include "polymost.h"
|
2006-09-27 17:55:49 +00:00
|
|
|
# include "pragmas.h"
|
2007-07-01 06:32:03 +00:00
|
|
|
# include <math.h>
|
|
|
|
|
|
|
|
//# define differentsign(x, y) ((((x) < 0) && ((y) > 0)) || (((x) > 0) && ((y) < 0)))
|
2006-09-29 21:36:12 +00:00
|
|
|
|
2007-01-29 01:18:16 +00:00
|
|
|
// CVARS
|
2006-10-15 18:51:41 +00:00
|
|
|
extern int pr_cliplanes;
|
2007-01-29 01:18:16 +00:00
|
|
|
extern int pr_fov;
|
2007-07-01 06:32:03 +00:00
|
|
|
extern int pr_showportals;
|
2007-01-29 01:18:16 +00:00
|
|
|
extern int pr_verbosity;
|
|
|
|
extern int pr_wireframe;
|
|
|
|
|
|
|
|
// DATA
|
2006-08-30 23:32:39 +00:00
|
|
|
typedef struct s_prsector {
|
2006-09-27 17:55:49 +00:00
|
|
|
// geometry
|
2006-09-27 02:23:27 +00:00
|
|
|
GLdouble* verts;
|
|
|
|
GLfloat* floorbuffer;
|
|
|
|
GLfloat* ceilbuffer;
|
2006-09-29 21:36:12 +00:00
|
|
|
// attributes
|
|
|
|
GLfloat floorcolor[4], ceilcolor[4];
|
2006-10-19 23:51:44 +00:00
|
|
|
GLuint floorglpic, ceilglpic, floorfbglpic, ceilfbglpic;
|
2006-09-27 17:55:49 +00:00
|
|
|
// elements
|
2006-10-04 09:54:25 +00:00
|
|
|
GLushort* floorindices;
|
|
|
|
GLushort* ceilindices;
|
2006-09-27 02:23:27 +00:00
|
|
|
short curindice;
|
2006-09-27 17:55:49 +00:00
|
|
|
int indicescount;
|
|
|
|
|
2006-10-15 18:51:41 +00:00
|
|
|
char controlstate; // bit 1: up-to-date, bit 2: geometry invalidated
|
2006-10-14 23:33:10 +00:00
|
|
|
char drawingstate; // 0: fcuk, 1: in queue, 2: todraw, 3: drawn
|
2006-09-27 02:23:27 +00:00
|
|
|
} _prsector;
|
2006-09-29 21:36:12 +00:00
|
|
|
|
|
|
|
typedef struct s_prwall {
|
|
|
|
// geometry
|
|
|
|
GLfloat* wallbuffer;
|
|
|
|
GLfloat* overbuffer;
|
2006-10-15 18:51:41 +00:00
|
|
|
GLfloat* portal;
|
2006-09-29 21:36:12 +00:00
|
|
|
// attributes
|
|
|
|
GLfloat wallcolor[4], overcolor[4];
|
2006-10-19 23:51:44 +00:00
|
|
|
GLfloat wallglpic, overglpic, wallfbglpic, overfbglpic;
|
2006-09-29 21:36:12 +00:00
|
|
|
|
|
|
|
char underover;
|
|
|
|
char invalidate;
|
2007-07-01 06:32:03 +00:00
|
|
|
char drawn;
|
2006-09-29 21:36:12 +00:00
|
|
|
} _prwall;
|
|
|
|
|
2006-10-14 23:33:10 +00:00
|
|
|
typedef struct s_cliplane {
|
|
|
|
_equation left, right, clip;
|
|
|
|
_point2d ref;
|
|
|
|
} _cliplane;
|
|
|
|
|
2007-01-29 01:18:16 +00:00
|
|
|
extern _prsector* prsectors[MAXSECTORS];
|
|
|
|
extern _prwall* prwalls[MAXWALLS];
|
|
|
|
|
|
|
|
// CONTROL
|
2006-10-15 18:51:41 +00:00
|
|
|
extern int updatesectors;
|
2007-01-29 01:18:16 +00:00
|
|
|
|
2006-09-29 21:36:12 +00:00
|
|
|
// EXTERNAL FUNCTIONS
|
|
|
|
int polymer_init(void);
|
|
|
|
void polymer_glinit(void);
|
|
|
|
void polymer_loadboard(void);
|
2007-12-12 17:42:14 +00:00
|
|
|
void polymer_drawrooms(int daposx, int daposy, int daposz, short daang, int dahoriz, short dacursectnum, int root);
|
|
|
|
void polymer_rotatesprite(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);
|
|
|
|
void polymer_drawmaskwall(int damaskwallcnt);
|
|
|
|
void polymer_drawsprite(int snum);
|
2006-10-15 18:51:41 +00:00
|
|
|
// SECTORS
|
2006-09-29 21:36:12 +00:00
|
|
|
int polymer_initsector(short sectnum);
|
|
|
|
int polymer_updatesector(short sectnum);
|
|
|
|
void PR_CALLBACK polymer_tesscombine(GLdouble v[3], GLdouble *data[4], GLfloat weight[4], GLdouble **out);
|
|
|
|
void PR_CALLBACK polymer_tesserror(GLenum error);
|
|
|
|
void PR_CALLBACK polymer_tessedgeflag(GLenum error);
|
|
|
|
void PR_CALLBACK polymer_tessvertex(void* vertex, void* sector);
|
|
|
|
int polymer_buildfloor(short sectnum);
|
2006-10-14 23:33:10 +00:00
|
|
|
void polymer_drawsector(short sectnum);
|
2006-10-15 18:51:41 +00:00
|
|
|
// WALLS
|
2006-09-29 21:36:12 +00:00
|
|
|
int polymer_initwall(short wallnum);
|
2007-01-29 01:18:16 +00:00
|
|
|
void polymer_updatewall(short wallnum);
|
|
|
|
void polymer_drawwall(short wallnum);
|
2006-10-14 23:33:10 +00:00
|
|
|
// HSR
|
2007-03-22 18:28:41 +00:00
|
|
|
void polymer_extractfrustum(GLdouble* modelview, GLdouble* projection);
|
2007-07-01 06:32:03 +00:00
|
|
|
void polymer_drawroom(short sectnum);
|
|
|
|
int polymer_checkportal(short wallnum);
|
2006-10-15 18:51:41 +00:00
|
|
|
int polymer_portalinfrustum(short wallnum);
|
2007-07-01 06:32:03 +00:00
|
|
|
float polymer_pointdistancetoplane(GLfloat* point, GLfloat* plane);
|
|
|
|
void polymer_lineplaneintersection(GLfloat *point1, GLfloat *point2, float dist1, float dist2, GLfloat *output);
|
|
|
|
int polymer_cliptofrustum(short wallnum, int mask);
|
|
|
|
void polymer_getportal(GLfloat* portalpoints, int portalpointcount, GLint* output);
|
|
|
|
void polymer_drawportal(void);
|
2006-10-18 03:59:28 +00:00
|
|
|
// SKIES
|
|
|
|
void polymer_initskybox(void);
|
2006-10-19 23:51:44 +00:00
|
|
|
void polymer_getsky(void);
|
2006-10-18 03:59:28 +00:00
|
|
|
void polymer_drawskyquad(int p1, int p2, GLfloat height);
|
2007-01-29 01:18:16 +00:00
|
|
|
void polymer_drawartsky(short tilenum);
|
|
|
|
|
|
|
|
#endif // !_polymer_h_
|