mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
fix non-Polymer build
git-svn-id: https://svn.eduke32.com/eduke32@1778 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
1a661b4d23
commit
b3cd9a73fe
4 changed files with 31 additions and 8 deletions
|
@ -1432,11 +1432,13 @@ static int32_t defsparser(scriptfile *script)
|
|||
case T_HIGHPALOOKUP:
|
||||
{
|
||||
char *highpaltokptr = script->ltextptr;
|
||||
int32_t pal=-1, oldpathsearchmode, fd;
|
||||
int32_t pal=-1, oldpathsearchmode;
|
||||
char *fn = NULL, *tfn = NULL;
|
||||
char *highpalend;
|
||||
#ifdef POLYMER
|
||||
int32_t fd;
|
||||
char *highpaldata;
|
||||
|
||||
#endif
|
||||
static const tokenlist highpaltokens[] =
|
||||
{
|
||||
{ "pal", T_PAL },
|
||||
|
@ -1486,6 +1488,7 @@ static int32_t defsparser(scriptfile *script)
|
|||
else Bfree(tfn);
|
||||
pathsearchmode = oldpathsearchmode;
|
||||
|
||||
#ifdef POLYMER
|
||||
fd = kopen4load(fn, 0);
|
||||
|
||||
// load the highpalookup and send it to polymer
|
||||
|
@ -1498,11 +1501,11 @@ static int32_t defsparser(scriptfile *script)
|
|||
filesize = kfilelength(fd);
|
||||
|
||||
filebuf = Bmalloc(filesize);
|
||||
if (!filebuf) { Bfree(highpaldata); break; }
|
||||
if (!filebuf) { kclose(fd); Bfree(highpaldata); break; }
|
||||
|
||||
klseek(fd, 0, SEEK_SET);
|
||||
if (kread(fd, filebuf, filesize)!=filesize)
|
||||
{ Bfree(highpaldata); initprintf("Error: didn't read all of '%s'.\n", fn); break; }
|
||||
{ kclose(fd); Bfree(highpaldata); initprintf("Error: didn't read all of '%s'.\n", fn); break; }
|
||||
|
||||
kclose(fd);
|
||||
kpgetdim(filebuf, filesize, &xsiz, &ysiz);
|
||||
|
@ -1524,6 +1527,7 @@ static int32_t defsparser(scriptfile *script)
|
|||
polymer_definehighpalookup(pal, highpaldata);
|
||||
|
||||
Bfree(highpaldata);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case T_TINT:
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "compat.h"
|
||||
#include "kplib.h"
|
||||
#include "hightile.h"
|
||||
#include "baselayer.h"
|
||||
|
||||
|
||||
palette_t hictinting[MAXPALOOKUPS];
|
||||
|
@ -166,13 +167,13 @@ int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float
|
|||
if (tilesizx[picnum]<=0 || tilesizy[picnum]<=0)
|
||||
{
|
||||
static int32_t first=1;
|
||||
OSD_Printf("warning: defined hightile replacement for empty tile %d.", picnum);
|
||||
initprintf("Warning: defined hightile replacement for empty tile %d.", picnum);
|
||||
if (first)
|
||||
{
|
||||
OSD_Printf(" Maybe some tiles???.art are not loaded?");
|
||||
initprintf(" Maybe some tilesXXX.art are not loaded?");
|
||||
first = 0;
|
||||
}
|
||||
OSD_Printf("\n");
|
||||
initprintf("\n");
|
||||
}
|
||||
|
||||
//printf("Replacement [%d,%d]: %s\n", picnum, palnum, hicreplc[i]->filename);
|
||||
|
|
|
@ -5376,6 +5376,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
|||
if (!nofog) bglDisable(GL_FOG);
|
||||
if (rendmode < 4)
|
||||
mddraw(&tspr);
|
||||
# ifdef POLYMER
|
||||
else
|
||||
{
|
||||
tspriteptr[MAXSPRITESONSCREEN] = &tspr;
|
||||
|
@ -5394,7 +5395,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
|||
bglDisable(GL_BLEND);
|
||||
bglDisable(GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
# endif
|
||||
if (!nofog) bglEnable(GL_FOG);
|
||||
#else
|
||||
mddraw(&tspr);
|
||||
|
|
|
@ -630,6 +630,23 @@ static void Gv_AddSystemVars(void)
|
|||
Gv_NewVar("pr_overridespecular",(intptr_t)&pr_overridespecular, GAMEVAR_INTPTR | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar("pr_specularpower",(intptr_t)&pr_specularpower, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar("pr_specularfactor",(intptr_t)&pr_specularfactor, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM);
|
||||
#else
|
||||
{
|
||||
// dummy Polymer variables for non-Polymer builds
|
||||
static int32_t pr_overrideparallax = 0;
|
||||
static float pr_parallaxscale = 0.1f;
|
||||
static float pr_parallaxbias = 0.0f;
|
||||
static int32_t pr_overridespecular = 0;
|
||||
static float pr_specularpower = 15.0f;
|
||||
static float pr_specularfactor = 1.0f;
|
||||
|
||||
Gv_NewVar("pr_overrideparallax",(intptr_t)&pr_overrideparallax, GAMEVAR_INTPTR | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar("pr_parallaxscale",(intptr_t)&pr_parallaxscale, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar("pr_parallaxbias",(intptr_t)&pr_parallaxbias, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar("pr_overridespecular",(intptr_t)&pr_overridespecular, GAMEVAR_INTPTR | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar("pr_specularpower",(intptr_t)&pr_specularpower, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar("pr_specularfactor",(intptr_t)&pr_specularfactor, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM);
|
||||
}
|
||||
#endif
|
||||
|
||||
g_systemVarCount = g_gameVarCount;
|
||||
|
|
Loading…
Reference in a new issue