mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Sanitize hard coded render mode numbers... replace all references to rendmode 0, 3, 4, etc with proper REND_CLASSIC, REND_POLYMOST, REND_POLYMER labels.
git-svn-id: https://svn.eduke32.com/eduke32@3784 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
dc0b74e846
commit
f8cc394fa3
17 changed files with 91 additions and 91 deletions
|
@ -1359,7 +1359,7 @@ extern void initialize_engine_globals(void);
|
|||
static inline void push_nofog(void)
|
||||
{
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= REND_POLYMOST)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
bglPushAttrib(GL_ENABLE_BIT);
|
||||
bglDisable(GL_FOG);
|
||||
|
@ -1370,7 +1370,7 @@ static inline void push_nofog(void)
|
|||
static inline void pop_nofog(void)
|
||||
{
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= REND_POLYMOST)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
bglPopAttrib();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ static inline float getshadefactor(int32_t shade)
|
|||
{
|
||||
int32_t shadebound = (shadescale_unbounded || shade>=numshades) ? numshades : numshades-1;
|
||||
float clamped_shade = min(max(shade*shadescale, 0), shadebound);
|
||||
if (rendmode == REND_POLYMOST && r_usetileshades &&
|
||||
if (getrendermode() == REND_POLYMOST && r_usetileshades &&
|
||||
(!usehightile || !hicfindsubst(globalpicnum, globalpal, 0)) &&
|
||||
(!usemodels || md_tilehasmodel(globalpicnum, globalpal) < 0)) return 1.f;
|
||||
return ((float)(numshades-clamped_shade))/(float)numshades;
|
||||
|
|
|
@ -446,7 +446,7 @@ void M32_ResetFakeRORTiles(void)
|
|||
#ifdef POLYMER
|
||||
# ifdef YAX_ENABLE
|
||||
// END_TWEAK ceiling/floor fake 'TROR' pics, see BEGIN_TWEAK in engine.c
|
||||
if (rendmode==4 && showinvisibility)
|
||||
if (getrendermode() == REND_POLYMER && showinvisibility)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
|
@ -473,7 +473,7 @@ void M32_DrawRoomsAndMasks(void)
|
|||
M32_ResetFakeRORTiles();
|
||||
|
||||
#ifdef POLYMER
|
||||
if (rendmode == 4 && searchit == 2)
|
||||
if (getrendermode() == REND_POLYMER && searchit == 2)
|
||||
{
|
||||
polymer_editorpick();
|
||||
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
|
||||
|
|
|
@ -708,7 +708,7 @@ static int32_t defsparser(scriptfile *script)
|
|||
}
|
||||
md_setmisc(lastmodelid,(float)scale, shadeoffs,0.0,0.0,0);
|
||||
# ifdef POLYMER
|
||||
if (glrendmode==4)
|
||||
if (glrendmode == REND_POLYMER)
|
||||
md3postload_polymer((md3model_t *)models[lastmodelid]);
|
||||
# endif
|
||||
#endif
|
||||
|
@ -1345,7 +1345,7 @@ static int32_t defsparser(scriptfile *script)
|
|||
}
|
||||
# endif
|
||||
|
||||
if (glrendmode==4)
|
||||
if (glrendmode == REND_POLYMER)
|
||||
md3postload_polymer((md3model_t *)models[lastmodelid]);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -803,7 +803,7 @@ void yax_tweakpicnums(int32_t bunchnum, int32_t cf, int32_t restore)
|
|||
}
|
||||
#ifdef POLYMER
|
||||
// will be called only in editor
|
||||
if (rendmode==4)
|
||||
if (getrendermode() == REND_POLYMER)
|
||||
{
|
||||
if (!restore)
|
||||
{
|
||||
|
@ -4506,7 +4506,7 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i
|
|||
|
||||
// WGR2 SVN: select new episode after playing wgmicky1 with Polymer
|
||||
// (maybe switched to classic earlier).
|
||||
// --> rendmode==0, glrendmode==4, we end up with globalpicnum==266,
|
||||
// --> rendmode==0, glgetrendermode() == REND_POLYMER, we end up with globalpicnum==266,
|
||||
// picsiz...==9 and dapskybits==3
|
||||
// FIXME ?
|
||||
if (k < 0)
|
||||
|
@ -5532,13 +5532,13 @@ static void drawsprite_opengl(int32_t snum)
|
|||
{
|
||||
//============================================================================= //POLYMOST BEGINS
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode == 3)
|
||||
if (getrendermode() == REND_POLYMOST)
|
||||
{
|
||||
polymost_drawsprite(snum);
|
||||
bglDisable(GL_POLYGON_OFFSET_FILL);
|
||||
}
|
||||
# ifdef POLYMER
|
||||
else if (rendmode == 4)
|
||||
else if (getrendermode() == REND_POLYMER)
|
||||
{
|
||||
bglEnable(GL_ALPHA_TEST);
|
||||
bglEnable(GL_BLEND);
|
||||
|
@ -6559,9 +6559,9 @@ static void drawmaskwall(int16_t damaskwallcnt)
|
|||
|
||||
//============================================================================= //POLYMOST BEGINS
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode == 3) { polymost_drawmaskwall(damaskwallcnt); return; }
|
||||
if (getrendermode() == REND_POLYMOST) { polymost_drawmaskwall(damaskwallcnt); return; }
|
||||
# ifdef POLYMER
|
||||
if (rendmode == 4)
|
||||
if (getrendermode() == REND_POLYMER)
|
||||
{
|
||||
bglEnable(GL_ALPHA_TEST);
|
||||
bglEnable(GL_BLEND);
|
||||
|
@ -6670,7 +6670,7 @@ static void fillpolygon(int32_t npoints)
|
|||
xb1[z] = 0;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3 && qsetmode == 200) { polymost_fillpolygon(npoints); return; }
|
||||
if (getrendermode() >= REND_POLYMOST && qsetmode == 200) { polymost_fillpolygon(npoints); return; }
|
||||
#endif
|
||||
|
||||
miny = INT32_MAX; maxy = INT32_MIN;
|
||||
|
@ -7190,7 +7190,7 @@ static void dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t
|
|||
|
||||
//============================================================================= //POLYMOST BEGINS
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3 && qsetmode == 200)
|
||||
if (getrendermode() >= REND_POLYMOST && qsetmode == 200)
|
||||
{
|
||||
polymost_dorotatesprite(sx,sy,z,a,picnum,dashade,dapalnum,dastat,daalpha,cx1,cy1,cx2,cy2,uniqid);
|
||||
return;
|
||||
|
@ -8819,7 +8819,7 @@ int32_t drawrooms(int32_t daposx, int32_t daposy, int32_t daposz,
|
|||
|
||||
#ifdef USE_OPENGL
|
||||
# ifdef POLYMER
|
||||
if (rendmode == 4)
|
||||
if (getrendermode() == REND_POLYMER)
|
||||
{
|
||||
# ifdef YAX_ENABLE
|
||||
// BEGIN_TWEAK ceiling/floor fake 'TROR' pics, see END_TWEAK in build.c
|
||||
|
@ -8842,7 +8842,8 @@ int32_t drawrooms(int32_t daposx, int32_t daposy, int32_t daposz,
|
|||
|
||||
//============================================================================= //POLYMOST BEGINS
|
||||
polymost_drawrooms();
|
||||
if (rendmode)
|
||||
|
||||
if (getrendermode() != REND_CLASSIC)
|
||||
return 0;
|
||||
//============================================================================= //POLYMOST ENDS
|
||||
#endif
|
||||
|
@ -9328,7 +9329,7 @@ killsprite:
|
|||
}
|
||||
|
||||
#ifdef POLYMER
|
||||
if (rendmode == 4)
|
||||
if (getrendermode() == REND_POLYMER)
|
||||
polymer_drawmasks();
|
||||
#endif
|
||||
|
||||
|
@ -9729,7 +9730,7 @@ static int32_t finish_loadboard(const vec3_t *dapos, int16_t *dacursectnum, int1
|
|||
Bmemset(spritesmooth, 0, sizeof(spritesmooth_t)*(MAXSPRITES+MAXUNIQHUDID));
|
||||
|
||||
# ifdef POLYMER
|
||||
if (rendmode == 4)
|
||||
if (getrendermode() == REND_POLYMER)
|
||||
{
|
||||
if ((myflags&4)==0)
|
||||
polymer_loadboard();
|
||||
|
@ -10465,7 +10466,7 @@ int32_t loadmaphack(const char *filename)
|
|||
light.publicflags.emitshadow = 1;
|
||||
light.publicflags.negative = 0;
|
||||
|
||||
if (rendmode == 4)
|
||||
if (getrendermode() == REND_POLYMER)
|
||||
{
|
||||
if (maphacklightcnt == PR_MAXLIGHTS)
|
||||
{
|
||||
|
@ -10755,7 +10756,7 @@ int32_t setgamemode(char davidoption, int32_t daxdim, int32_t daydim, int32_t da
|
|||
|
||||
#ifdef USE_OPENGL
|
||||
if (dabpp > 8) rendmode = glrendmode; // GL renderer
|
||||
else if (dabpp == 8 && j > 8) rendmode = 0; // going from GL to software activates softpolymost
|
||||
else if (dabpp == 8 && j > 8) rendmode = REND_CLASSIC;
|
||||
#endif
|
||||
|
||||
xdim = daxdim; ydim = daydim;
|
||||
|
@ -10789,16 +10790,16 @@ int32_t setgamemode(char davidoption, int32_t daxdim, int32_t daydim, int32_t da
|
|||
if (searchx < 0) { searchx = halfxdimen; searchy = (ydimen>>1); }
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
polymost_glreset();
|
||||
polymost_glinit();
|
||||
}
|
||||
# ifdef POLYMER
|
||||
if (rendmode == 4)
|
||||
if (getrendermode() == REND_POLYMER)
|
||||
{
|
||||
if (!polymer_init())
|
||||
rendmode = 3;
|
||||
rendmode = REND_POLYMOST;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -14317,7 +14318,7 @@ void setbrightness(char dabrightness, uint8_t dapalid, uint8_t flags)
|
|||
}
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
// Only reset the textures if the corresponding preserve flags are clear and
|
||||
// either (a) the new palette is different to the last, or (b) the brightness
|
||||
|
@ -14332,7 +14333,7 @@ void setbrightness(char dabrightness, uint8_t dapalid, uint8_t flags)
|
|||
if (!(flags&8) && doinvalidate)
|
||||
gltexinvalidatetype(INVALIDATE_ART);
|
||||
#ifdef POLYMER
|
||||
if ((rendmode == 4) && doinvalidate)
|
||||
if ((getrendermode() == REND_POLYMER) && doinvalidate)
|
||||
polymer_texinvalidate();
|
||||
#endif
|
||||
}
|
||||
|
@ -14423,7 +14424,7 @@ void clearview(int32_t dacol)
|
|||
if (qsetmode != 200) return;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
palette_t p = getpal(dacol);
|
||||
|
||||
|
@ -14461,7 +14462,7 @@ void clearallviews(int32_t dacol)
|
|||
//dacol += (dacol<<8); dacol += (dacol<<16);
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
palette_t p = getpal(dacol);
|
||||
|
||||
|
@ -14490,7 +14491,7 @@ void clearallviews(int32_t dacol)
|
|||
void plotpixel(int32_t x, int32_t y, char col)
|
||||
{
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3 && qsetmode == 200)
|
||||
if (getrendermode() >= REND_POLYMOST && qsetmode == 200)
|
||||
{
|
||||
palette_t p = getpal(col);
|
||||
|
||||
|
@ -14511,7 +14512,7 @@ void plotlines2d(const int32_t *xx, const int32_t *yy, int32_t numpoints, char c
|
|||
int32_t i;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3 && qsetmode == 200)
|
||||
if (getrendermode() >= REND_POLYMOST && qsetmode == 200)
|
||||
{
|
||||
palette_t p = getpal(col);
|
||||
|
||||
|
@ -14548,7 +14549,7 @@ char getpixel(int32_t x, int32_t y)
|
|||
char r;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3 && qsetmode == 200) return 0;
|
||||
if (getrendermode() >= REND_POLYMOST && qsetmode == 200) return 0;
|
||||
#endif
|
||||
|
||||
begindrawing(); //{{{
|
||||
|
@ -14577,7 +14578,7 @@ void setviewtotile(int16_t tilenume, int32_t xsiz, int32_t ysiz)
|
|||
bakrendmode = rendmode;
|
||||
baktile = tilenume;
|
||||
}
|
||||
rendmode = 0;//2;
|
||||
rendmode = REND_CLASSIC;//2;
|
||||
#endif
|
||||
copybufbyte(&startumost[windowx1],&bakumost[windowx1],(windowx2-windowx1+1)*sizeof(bakumost[0]));
|
||||
copybufbyte(&startdmost[windowx1],&bakdmost[windowx1],(windowx2-windowx1+1)*sizeof(bakdmost[0]));
|
||||
|
@ -14680,7 +14681,7 @@ void preparemirror(int32_t dax, int32_t day, int16_t daang, int16_t dawall,
|
|||
void completemirror(void)
|
||||
{
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode)
|
||||
if (getrendermode() != REND_CLASSIC)
|
||||
return;
|
||||
#endif
|
||||
|
||||
|
@ -15018,7 +15019,7 @@ void drawline256(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col)
|
|||
col = palookup[0][col];
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
palette_t p = getpal(col);
|
||||
|
||||
|
@ -16327,7 +16328,7 @@ void printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const
|
|||
#ifdef USE_OPENGL
|
||||
if (!polymost_printext256(xpos,ypos,col,backcol,name,fontsize)) return;
|
||||
# if 0
|
||||
if (rendmode >= 3 && qsetmode == 200)
|
||||
if (getrendermode() >= REND_POLYMOST && qsetmode == 200)
|
||||
{
|
||||
int32_t xx, yy;
|
||||
int32_t lc=-1;
|
||||
|
@ -16474,7 +16475,7 @@ static int32_t screencapture_png(const char *filename, char inverseit, const cha
|
|||
int32_t i;
|
||||
BFILE *fp;
|
||||
# ifdef USE_OPENGL
|
||||
# define HICOLOR (rendmode>=3 && qsetmode==200)
|
||||
# define HICOLOR (getrendermode() >= REND_POLYMOST && qsetmode==200)
|
||||
# else
|
||||
# define HICOLOR 0
|
||||
# endif
|
||||
|
@ -16638,7 +16639,7 @@ static int32_t screencapture_tga(const char *filename, char inverseit)
|
|||
}
|
||||
|
||||
# ifdef USE_OPENGL
|
||||
if (rendmode >= 3 && qsetmode == 200)
|
||||
if (getrendermode() >= REND_POLYMOST && qsetmode == 200)
|
||||
{
|
||||
head[1] = 0; // no colourmap
|
||||
head[2] = 2; // uncompressed truecolour
|
||||
|
@ -16663,7 +16664,7 @@ static int32_t screencapture_tga(const char *filename, char inverseit)
|
|||
|
||||
// palette first
|
||||
# ifdef USE_OPENGL
|
||||
if (rendmode < 3 || (rendmode >= 3 && qsetmode != 200))
|
||||
if (getrendermode() < REND_POLYMOST || (getrendermode() >= REND_POLYMOST && qsetmode != 200))
|
||||
# endif
|
||||
{
|
||||
//getpalette(0,256,palette);
|
||||
|
@ -16676,7 +16677,7 @@ static int32_t screencapture_tga(const char *filename, char inverseit)
|
|||
}
|
||||
|
||||
# ifdef USE_OPENGL
|
||||
if (rendmode >= 3 && qsetmode == 200)
|
||||
if (getrendermode() >= REND_POLYMOST && qsetmode == 200)
|
||||
{
|
||||
char c;
|
||||
// 24bit
|
||||
|
@ -16768,7 +16769,7 @@ int32_t setrendermode(int32_t renderer)
|
|||
if (!polymer_init())
|
||||
renderer = 3;
|
||||
}
|
||||
else if (rendmode==4) // going from Polymer to another renderer
|
||||
else if (getrendermode() == REND_POLYMER) // going from Polymer to another renderer
|
||||
{
|
||||
delete_maphack_lights();
|
||||
G_Polymer_UnInit();
|
||||
|
@ -16781,7 +16782,7 @@ int32_t setrendermode(int32_t renderer)
|
|||
basepalreset = 1;
|
||||
|
||||
rendmode = renderer;
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
glrendmode = rendmode;
|
||||
#endif
|
||||
|
||||
|
@ -16821,7 +16822,7 @@ void invalidatetile(int16_t tilenume, int32_t pal, int32_t how)
|
|||
int32_t numpal, firstpal, np;
|
||||
int32_t hp;
|
||||
|
||||
if (rendmode < 3) return;
|
||||
if (getrendermode() < REND_POLYMOST) return;
|
||||
|
||||
if (pal < 0)
|
||||
{
|
||||
|
@ -16857,7 +16858,7 @@ void invalidatetile(int16_t tilenume, int32_t pal, int32_t how)
|
|||
void setpolymost2dview(void)
|
||||
{
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode < 3) return;
|
||||
if (getrendermode() < REND_POLYMOST) return;
|
||||
|
||||
bglViewport(0,0,xres,yres);
|
||||
bglMatrixMode(GL_PROJECTION);
|
||||
|
|
|
@ -3353,7 +3353,7 @@ mdmodel_t *mdload(const char *filnam)
|
|||
md3postload_common(vm3);
|
||||
|
||||
#ifdef POLYMER
|
||||
if (glrendmode!=4)
|
||||
if (glrendmode != REND_POLYMER)
|
||||
if (!md3postload_polymer_check(vm3))
|
||||
{
|
||||
mdfree(vm);
|
||||
|
|
|
@ -982,7 +982,7 @@ void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t da
|
|||
float pos[3];
|
||||
pthtyp* pth;
|
||||
|
||||
if (!rendmode) return;
|
||||
if (getrendermode() == REND_CLASSIC) return;
|
||||
|
||||
begindrawing();
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ int32_t glpolygonmode = 0; // 0:GL_FILL,1:GL_LINE,2:GL_POINT //FUK
|
|||
int32_t glwidescreen = 0;
|
||||
int32_t glprojectionhacks = 1;
|
||||
static GLuint polymosttext = 0;
|
||||
int32_t glrendmode = 3;
|
||||
int32_t glrendmode = REND_POLYMOST;
|
||||
|
||||
// This variable, and 'shadeforfullbrightpass' control the drawing of
|
||||
// fullbright tiles. Also see 'fullbrightloadingpass'.
|
||||
|
@ -314,7 +314,7 @@ void gltexapplyprops(void)
|
|||
int32_t i;
|
||||
pthtyp *pth;
|
||||
|
||||
if (rendmode == REND_CLASSIC)
|
||||
if (getrendermode() == REND_CLASSIC)
|
||||
return;
|
||||
|
||||
if (glinfo.maxanisotropy > 1.0)
|
||||
|
@ -1323,7 +1323,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
|
|||
loadtile(globalpicnum);
|
||||
if (!waloff[globalpicnum])
|
||||
{
|
||||
if (rendmode < 3) return;
|
||||
if (getrendermode() < REND_POLYMOST) return;
|
||||
tsizx = tsizy = 1; method = 1; //Hack to update Z-buffer for invalid mirror textures
|
||||
}
|
||||
}
|
||||
|
@ -1372,7 +1372,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
|
|||
n = j;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
float hackscx, hackscy;
|
||||
|
||||
|
@ -1401,7 +1401,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
|
|||
// If we aren't rendmode 3, we're in Polymer, which means this code is
|
||||
// used for rotatesprite only. Polymer handles all the material stuff,
|
||||
// just submit the geometry and don't mess with textures.
|
||||
if (rendmode == 3)
|
||||
if (getrendermode() == REND_POLYMOST)
|
||||
{
|
||||
bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0);
|
||||
|
||||
|
@ -1722,7 +1722,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
|
|||
texunits--;
|
||||
}
|
||||
|
||||
if (rendmode == 3)
|
||||
if (getrendermode() == REND_POLYMOST)
|
||||
{
|
||||
if (srepeat)
|
||||
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP);
|
||||
|
@ -1745,6 +1745,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
if (rendmode == 1)
|
||||
{
|
||||
if (method&3) //Only draw border around sprites/maskwalls
|
||||
|
@ -1757,6 +1758,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
|
|||
//ox /= (double)n; oy /= (double)n;
|
||||
//for(i=0,j=n-1;i<n;j=i,i++) drawline2d(px[i]+(ox-px[i])*.125,py[i]+(oy-py[i])*.125,px[j]+(ox-px[j])*.125,py[j]+(oy-py[j])*.125,31);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -2391,7 +2393,7 @@ static void polymost_drawalls(int32_t bunch)
|
|||
{
|
||||
//Parallaxing sky... hacked for Ken's mountain texture; paper-sky only :/
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
calc_and_apply_fog_factor(sec->floorpicnum, sec->floorshade, sec->visibility, sec->floorpal, 0.005);
|
||||
|
||||
|
@ -2625,7 +2627,7 @@ static void polymost_drawalls(int32_t bunch)
|
|||
#endif
|
||||
}
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
skyclamphack = 0;
|
||||
if (!nofog)
|
||||
|
@ -2670,7 +2672,7 @@ static void polymost_drawalls(int32_t bunch)
|
|||
else if ((nextsectnum < 0) || (!(sector[nextsectnum].ceilingstat&1)))
|
||||
{
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
calc_and_apply_fog_factor(sec->ceilingpicnum, sec->ceilingshade, sec->visibility, sec->ceilingpal, 0.005);
|
||||
|
||||
|
@ -2907,7 +2909,7 @@ static void polymost_drawalls(int32_t bunch)
|
|||
#endif
|
||||
}
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
skyclamphack = 0;
|
||||
if (!nofog)
|
||||
|
@ -3190,13 +3192,13 @@ void polymost_drawrooms()
|
|||
int32_t i, j, n, n2, closest;
|
||||
double ox, oy, oz, ox2, oy2, oz2, r, px[6], py[6], pz[6], px2[6], py2[6], pz2[6], sx[6], sy[6];
|
||||
|
||||
if (!rendmode) return;
|
||||
if (getrendermode() == REND_CLASSIC) return;
|
||||
|
||||
begindrawing();
|
||||
frameoffset = frameplace + windowy1*bytesperline + windowx1;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
resizeglcheck();
|
||||
#ifdef YAX_ENABLE
|
||||
|
@ -3502,7 +3504,7 @@ void polymost_drawrooms()
|
|||
bunchlast[closest] = bunchlast[numbunches];
|
||||
}
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
bglDepthFunc(GL_LEQUAL); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS
|
||||
|
||||
|
@ -3721,7 +3723,7 @@ void polymost_drawsprite(int32_t snum)
|
|||
#ifdef USE_OPENGL
|
||||
calc_and_apply_fog(tspr->picnum, globalshade, sector[tspr->sectnum].visibility, sector[tspr->sectnum].floorpal);
|
||||
|
||||
while (rendmode >= 3 && !(spriteext[spritenum].flags&SPREXT_NOTMD))
|
||||
while (getrendermode() >= REND_POLYMOST && !(spriteext[spritenum].flags&SPREXT_NOTMD))
|
||||
{
|
||||
if (usemodels && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].modelid >= 0 && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].framenum >= 0)
|
||||
{
|
||||
|
@ -4153,7 +4155,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
|||
#endif
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3 && usemodels && hudmem[(dastat&4)>>2][picnum].angadd)
|
||||
if (getrendermode() >= REND_POLYMOST && usemodels && hudmem[(dastat&4)>>2][picnum].angadd)
|
||||
{
|
||||
const int32_t tilenum = Ptile2tile(picnum,dapalnum);
|
||||
|
||||
|
@ -4232,7 +4234,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
|||
if (dastat&4) { x1 = -x1; y1 = -y1; }
|
||||
|
||||
// In Polymost, we don't care if the model is very big
|
||||
if (rendmode < 4)
|
||||
if (getrendermode() < REND_POLYMER)
|
||||
{
|
||||
tspr.xrepeat = tspr.yrepeat = 32;
|
||||
|
||||
|
@ -4269,7 +4271,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
|||
glox1 = -1; //Force fullscreen (glox1=-1 forces it to restore)
|
||||
}
|
||||
|
||||
if (rendmode < 4)
|
||||
if (getrendermode() < REND_POLYMER)
|
||||
{
|
||||
bglMatrixMode(GL_PROJECTION);
|
||||
memset(m,0,sizeof(m));
|
||||
|
@ -4303,7 +4305,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
|||
spriteext[tspr.owner].alpha = daalpha / 255.0f;
|
||||
|
||||
if (!nofog) bglDisable(GL_FOG);
|
||||
if (rendmode < 4)
|
||||
if (getrendermode() < REND_POLYMER)
|
||||
mddraw(&tspr);
|
||||
# ifdef POLYMER
|
||||
else
|
||||
|
@ -4376,7 +4378,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
|||
ogstang = gstang; gstang = 0.0;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
bglViewport(0,0,xdim,ydim); glox1 = -1; //Force fullscreen (glox1=-1 forces it to restore)
|
||||
bglMatrixMode(GL_PROJECTION);
|
||||
|
@ -4392,7 +4394,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
|||
bglEnable(GL_TEXTURE_2D);
|
||||
|
||||
# ifdef POLYMER
|
||||
if (rendmode >= 4) {
|
||||
if (getrendermode() == REND_POLYMER) {
|
||||
polymer_inb4rotatesprite(picnum, dapalnum, dashade);
|
||||
r_detailmapping = 0;
|
||||
r_glowmapping = 0;
|
||||
|
@ -4523,10 +4525,10 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
|||
}
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
# ifdef POLYMER
|
||||
if (rendmode >= 4) {
|
||||
if (getrendermode() == REND_POLYMER) {
|
||||
r_detailmapping = olddetailmapping;
|
||||
r_glowmapping = oldglowmapping;
|
||||
polymer_postrotatesprite();
|
||||
|
@ -4765,7 +4767,7 @@ int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, i
|
|||
int32_t i;
|
||||
pthtyp *pth;
|
||||
|
||||
if ((rendmode < 3) || (qsetmode != 200)) return(-1);
|
||||
if ((getrendermode() < REND_POLYMOST) || (qsetmode != 200)) return(-1);
|
||||
|
||||
if (!glinfo.texnpot)
|
||||
{
|
||||
|
@ -4923,7 +4925,7 @@ int32_t polymost_printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t ba
|
|||
bricolor(&p, col);
|
||||
bricolor(&b, arbackcol);
|
||||
|
||||
if ((rendmode < 3) || (qsetmode != 200)) return(-1);
|
||||
if ((getrendermode() < REND_POLYMOST) || (qsetmode != 200)) return(-1);
|
||||
|
||||
if (!polymosttext)
|
||||
{
|
||||
|
@ -5226,7 +5228,7 @@ void polymost_precache(int32_t dapicnum, int32_t dapalnum, int32_t datype)
|
|||
// while sprites are clamped
|
||||
int32_t mid;
|
||||
|
||||
if (rendmode < 3) return;
|
||||
if (getrendermode() < REND_POLYMOST) return;
|
||||
|
||||
if ((palookup[dapalnum] == NULL) && (dapalnum < (MAXPALOOKUPS - RESERVEDPALS))) return;//dapalnum = 0;
|
||||
|
||||
|
|
|
@ -608,7 +608,7 @@ int32_t map_undoredo(int32_t dir)
|
|||
Bassert(Numsprites == mapstate->num[2]);
|
||||
|
||||
#ifdef POLYMER
|
||||
if (qsetmode == 200 && rendmode == 4)
|
||||
if (qsetmode == 200 && getrendermode() == REND_POLYMER)
|
||||
polymer_loadboard();
|
||||
#endif
|
||||
#ifdef YAX_ENABLE
|
||||
|
@ -4071,7 +4071,7 @@ static int32_t DrawTiles(int32_t iTopLeft, int32_t iSelected, int32_t nXTiles, i
|
|||
#ifdef USE_OPENGL
|
||||
setpolymost2dview();
|
||||
|
||||
if (rendmode >= 3)
|
||||
if (getrendermode() >= REND_POLYMOST)
|
||||
{
|
||||
bglEnable(GL_TEXTURE_2D);
|
||||
|
||||
|
@ -4146,7 +4146,7 @@ restart:
|
|||
enddrawing();
|
||||
showframe(1);
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3 && lazyselector)
|
||||
if (getrendermode() >= REND_POLYMOST && lazyselector)
|
||||
bglDrawBuffer(GL_BACK);
|
||||
#endif
|
||||
return 1;
|
||||
|
@ -4178,7 +4178,7 @@ restart:
|
|||
showframe(1);
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (rendmode >= 3 && lazyselector)
|
||||
if (getrendermode() >= REND_POLYMOST && lazyselector)
|
||||
bglDrawBuffer(GL_BACK);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -537,7 +537,7 @@ void COMMON_clearbackground(int32_t numcols, int32_t numrows)
|
|||
UNREFERENCED_PARAMETER(numcols);
|
||||
|
||||
# ifdef USE_OPENGL
|
||||
if (rendmode>=3 && qsetmode==200)
|
||||
if (getrendermode() >= REND_POLYMOST && qsetmode==200)
|
||||
{
|
||||
setpolymost2dview();
|
||||
bglColor4f(0,0,0,0.67f);
|
||||
|
|
|
@ -653,8 +653,8 @@ int32_t CONFIG_ReadSetup(void)
|
|||
|
||||
#ifdef POLYMER
|
||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Polymer", &dummy);
|
||||
if (dummy > 0 && ud.config.ScreenBPP >= 16) glrendmode = 4;
|
||||
else glrendmode = 3;
|
||||
if (dummy > 0 && ud.config.ScreenBPP >= 16) glrendmode = REND_POLYMER;
|
||||
else glrendmode = REND_POLYMOST;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -793,7 +793,7 @@ void CONFIG_WriteSetup(uint32_t flags)
|
|||
SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "NoAutoLoad",ud.config.NoAutoLoad,FALSE,FALSE);
|
||||
|
||||
#ifdef POLYMER
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Polymer",glrendmode == 4,FALSE,FALSE);
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Polymer",glrendmode == REND_POLYMER,FALSE,FALSE);
|
||||
#endif
|
||||
|
||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenBPP",ud.config.ScreenBPP,FALSE,FALSE); // JBF 20040523
|
||||
|
|
|
@ -416,7 +416,7 @@ static int32_t __fastcall VM_AccessTsprite(int32_t how, int32_t lVar1, int32_t l
|
|||
}
|
||||
else
|
||||
{
|
||||
// check whether rendmode==4 ?
|
||||
// check whether getrendermode() == REND_POLYMER ?
|
||||
if ((unsigned)i >= PR_MAXLIGHTS)
|
||||
{
|
||||
M32_ERROR("invalid light index (%d)", i);
|
||||
|
|
|
@ -514,7 +514,7 @@ void G_CacheMapData(void)
|
|||
if (k == MAXPALOOKUPS-RESERVEDPALS-1)
|
||||
break;
|
||||
#ifdef POLYMER
|
||||
if (rendmode!=4 || !polymer_havehighpalookup(0, k))
|
||||
if (getrendermode() != REND_POLYMER || !polymer_havehighpalookup(0, k))
|
||||
#endif
|
||||
polymost_precache(i,k,type);
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ void G_CacheMapData(void)
|
|||
if (r_glowmapping && !KB_KeyPressed(sc_Space))
|
||||
polymost_precache(i,GLOWPAL,type);
|
||||
#ifdef POLYMER
|
||||
if (rendmode==4)
|
||||
if (getrendermode() == REND_POLYMER)
|
||||
{
|
||||
if (pr_specularmapping && !KB_KeyPressed(sc_Space))
|
||||
polymost_precache(i,SPECULARPAL,type);
|
||||
|
|
|
@ -343,7 +343,7 @@ int32_t G_SavePlayer(int32_t spot)
|
|||
}
|
||||
|
||||
#ifdef POLYMER
|
||||
if (rendmode == 4)
|
||||
if (getrendermode() == REND_POLYMER)
|
||||
polymer_resetlights();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -367,7 +367,7 @@ void G_AnimateCamSprite(void)
|
|||
G_SetupCamTile(OW, TILE_VIEWSCR);
|
||||
#ifdef POLYMER
|
||||
// HACK: force texture update on viewscreen sprite in Polymer!
|
||||
if (rendmode==4)
|
||||
if (getrendermode() == REND_POLYMER)
|
||||
sprite[i].filler ^= (1<<1);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -35,9 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "common.h"
|
||||
#include "common_game.h"
|
||||
|
||||
#define RDR_POLYMOST 3 // sould be defined elsewhere
|
||||
#define RDR_POLYMER 4 // sould be defined elsewhere
|
||||
|
||||
enum
|
||||
{
|
||||
NONE,
|
||||
|
@ -156,7 +153,7 @@ static void on_polymercheck_toggled(GtkToggleButton *togglebutton, gpointer user
|
|||
UNREFERENCED_PARAMETER(user_data);
|
||||
if (gtk_toggle_button_get_active(togglebutton))
|
||||
{
|
||||
glrendmode = RDR_POLYMER;
|
||||
glrendmode = REND_POLYMER;
|
||||
settings.polymer = TRUE;
|
||||
if (settings.bpp3d == 8)
|
||||
{
|
||||
|
@ -166,7 +163,7 @@ static void on_polymercheck_toggled(GtkToggleButton *togglebutton, gpointer user
|
|||
}
|
||||
else
|
||||
{
|
||||
glrendmode = RDR_POLYMOST;
|
||||
glrendmode = REND_POLYMOST;
|
||||
settings.polymer = FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -741,7 +741,7 @@ int32_t startwin_run(void)
|
|||
settings.flags = 0;
|
||||
if (ud.config.ScreenMode) settings.flags |= 1;
|
||||
#ifdef POLYMER
|
||||
if (glrendmode == 4) settings.flags |= 2;
|
||||
if (glrendmode == REND_POLYMER) settings.flags |= 2;
|
||||
#endif
|
||||
if (ud.config.NoAutoLoad) settings.flags |= 4;
|
||||
settings.xdim = ud.config.ScreenWidth;
|
||||
|
@ -779,8 +779,8 @@ int32_t startwin_run(void)
|
|||
{
|
||||
ud.config.ScreenMode = (settings.flags&1);
|
||||
#ifdef POLYMER
|
||||
if (settings.flags & 2) glrendmode = 4;
|
||||
else glrendmode = 3;
|
||||
if (settings.flags & 2) glrendmode = REND_POLYMER;
|
||||
else glrendmode = REND_POLYMOST;
|
||||
#endif
|
||||
if (settings.flags & 4) ud.config.NoAutoLoad = 1;
|
||||
else ud.config.NoAutoLoad = 0;
|
||||
|
|
Loading…
Reference in a new issue