mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 19:20:38 +00:00
Nocompress and nodownsize for skyboxes
git-svn-id: https://svn.eduke32.com/eduke32@5010 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
4f54c7cf88
commit
1d30b86db2
3 changed files with 21 additions and 16 deletions
|
@ -1285,7 +1285,7 @@ void hicsetpalettetint(int32_t palnum, char r, char g, char b, char effect);
|
||||||
// flags bitset: 1 = don't compress
|
// flags bitset: 1 = don't compress
|
||||||
int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float alphacut,
|
int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float alphacut,
|
||||||
float xscale, float yscale, float specpower, float specfactor, char flags);
|
float xscale, float yscale, float specpower, float specfactor, char flags);
|
||||||
int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6]);
|
int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6], int32_t flags);
|
||||||
int32_t hicclearsubst(int32_t picnum, int32_t palnum);
|
int32_t hicclearsubst(int32_t picnum, int32_t palnum);
|
||||||
|
|
||||||
int32_t Ptile2tile(int32_t tile, int32_t pallet) ATTRIBUTE((pure));
|
int32_t Ptile2tile(int32_t tile, int32_t pallet) ATTRIBUTE((pure));
|
||||||
|
|
|
@ -366,7 +366,7 @@ static int32_t defsparser(scriptfile *script)
|
||||||
}
|
}
|
||||||
if (i < 6 || !happy) break;
|
if (i < 6 || !happy) break;
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
hicsetskybox(tile,pal,fn);
|
hicsetskybox(tile,pal,fn, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1186,6 +1186,7 @@ static int32_t defsparser(scriptfile *script)
|
||||||
{ "detailscale", T_PARAM },
|
{ "detailscale", T_PARAM },
|
||||||
{ "specpower", T_SPECPOWER }, { "specularpower", T_SPECPOWER }, { "parallaxscale", T_SPECPOWER },
|
{ "specpower", T_SPECPOWER }, { "specularpower", T_SPECPOWER }, { "parallaxscale", T_SPECPOWER },
|
||||||
{ "specfactor", T_SPECFACTOR }, { "specularfactor", T_SPECFACTOR }, { "parallaxbias", T_SPECFACTOR },
|
{ "specfactor", T_SPECFACTOR }, { "specularfactor", T_SPECFACTOR }, { "parallaxbias", T_SPECFACTOR },
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (scriptfile_getbraces(script,&skinend)) break;
|
if (scriptfile_getbraces(script,&skinend)) break;
|
||||||
|
@ -1490,7 +1491,7 @@ static int32_t defsparser(scriptfile *script)
|
||||||
char *skyboxtokptr = script->ltextptr;
|
char *skyboxtokptr = script->ltextptr;
|
||||||
char *fn[6] = {0,0,0,0,0,0};
|
char *fn[6] = {0,0,0,0,0,0};
|
||||||
char *modelend;
|
char *modelend;
|
||||||
int32_t i, tile = -1, pal = 0, happy = 1;
|
int32_t i, tile = -1, pal = 0, happy = 1, flags = 0;
|
||||||
|
|
||||||
static const tokenlist skyboxtokens[] =
|
static const tokenlist skyboxtokens[] =
|
||||||
{
|
{
|
||||||
|
@ -1501,7 +1502,9 @@ static int32_t defsparser(scriptfile *script)
|
||||||
{ "bk" ,T_BACK },{ "back" ,T_BACK },
|
{ "bk" ,T_BACK },{ "back" ,T_BACK },
|
||||||
{ "lf" ,T_LEFT },{ "left" ,T_LEFT },{ "lt" ,T_LEFT },
|
{ "lf" ,T_LEFT },{ "left" ,T_LEFT },{ "lt" ,T_LEFT },
|
||||||
{ "up" ,T_TOP },{ "top" ,T_TOP },{ "ceiling",T_TOP },{ "ceil" ,T_TOP },
|
{ "up" ,T_TOP },{ "top" ,T_TOP },{ "ceiling",T_TOP },{ "ceil" ,T_TOP },
|
||||||
{ "dn" ,T_BOTTOM },{ "bottom" ,T_BOTTOM },{ "floor" ,T_BOTTOM },{ "down" ,T_BOTTOM }
|
{ "dn" ,T_BOTTOM },{ "bottom" ,T_BOTTOM },{ "floor" ,T_BOTTOM },{ "down" ,T_BOTTOM },
|
||||||
|
{ "nocompress", T_NOCOMPRESS },
|
||||||
|
{ "nodownsize", T_NODOWNSIZE },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (scriptfile_getbraces(script,&modelend)) break;
|
if (scriptfile_getbraces(script,&modelend)) break;
|
||||||
|
@ -1526,6 +1529,12 @@ static int32_t defsparser(scriptfile *script)
|
||||||
scriptfile_getstring(script,&fn[4]); break;
|
scriptfile_getstring(script,&fn[4]); break;
|
||||||
case T_BOTTOM:
|
case T_BOTTOM:
|
||||||
scriptfile_getstring(script,&fn[5]); break;
|
scriptfile_getstring(script,&fn[5]); break;
|
||||||
|
#ifdef USE_OPENGL
|
||||||
|
case T_NOCOMPRESS:
|
||||||
|
flags |= 1; break;
|
||||||
|
case T_NODOWNSIZE:
|
||||||
|
flags |= 16; break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1540,7 +1549,7 @@ static int32_t defsparser(scriptfile *script)
|
||||||
if (!happy) break;
|
if (!happy) break;
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
hicsetskybox(tile,pal,fn);
|
hicsetskybox(tile,pal,fn, flags);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -197,7 +197,7 @@ int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float
|
||||||
// hicsetskybox(picnum,pal,faces[6])
|
// hicsetskybox(picnum,pal,faces[6])
|
||||||
// Specifies a graphic files making up a skybox.
|
// Specifies a graphic files making up a skybox.
|
||||||
//
|
//
|
||||||
int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6])
|
int32_t hicsetskybox( int32_t picnum, int32_t palnum, char *faces[6], int32_t flags )
|
||||||
{
|
{
|
||||||
hicreplctyp *hr, *hrn;
|
hicreplctyp *hr, *hrn;
|
||||||
int32_t j;
|
int32_t j;
|
||||||
|
@ -222,23 +222,18 @@ int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6])
|
||||||
else hrn = hr;
|
else hrn = hr;
|
||||||
|
|
||||||
if (!hrn->skybox)
|
if (!hrn->skybox)
|
||||||
{
|
|
||||||
hrn->skybox = (struct hicskybox_t *)Xcalloc(1,sizeof(struct hicskybox_t));
|
hrn->skybox = (struct hicskybox_t *)Xcalloc(1,sizeof(struct hicskybox_t));
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (j=5; j>=0; j--)
|
for (j=0; j<6; j++)
|
||||||
{
|
DO_FREE_AND_NULL(hrn->skybox->face[j]);
|
||||||
if (hrn->skybox->face[j])
|
|
||||||
Bfree(hrn->skybox->face[j]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// store each face's filename
|
// store each face's filename
|
||||||
for (j=0; j<6; j++)
|
for (j=0; j<6; j++)
|
||||||
{
|
|
||||||
hrn->skybox->face[j] = Xstrdup(faces[j]);
|
hrn->skybox->face[j] = Xstrdup(faces[j]);
|
||||||
}
|
|
||||||
|
hrn->flags = flags;
|
||||||
|
|
||||||
if (hr == NULL)
|
if (hr == NULL)
|
||||||
{
|
{
|
||||||
|
@ -307,11 +302,12 @@ int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float
|
||||||
UNREFERENCED_PARAMETER(alphacut);
|
UNREFERENCED_PARAMETER(alphacut);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6])
|
int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6], int32_t flags)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(picnum);
|
UNREFERENCED_PARAMETER(picnum);
|
||||||
UNREFERENCED_PARAMETER(palnum);
|
UNREFERENCED_PARAMETER(palnum);
|
||||||
UNREFERENCED_PARAMETER(faces);
|
UNREFERENCED_PARAMETER(faces);
|
||||||
|
UNREFERENCED_PARAMETER(flags);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int32_t hicclearsubst(int32_t picnum, int32_t palnum)
|
int32_t hicclearsubst(int32_t picnum, int32_t palnum)
|
||||||
|
|
Loading…
Reference in a new issue