From 37265689cf92a3b4c5f39bda3f8bb57ff145d5e9 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 14 Sep 2013 17:58:46 +0000 Subject: [PATCH] Add support for "orig_sizex" and "orig_sizey" parameters to "texture" block in def files. This is the same as using "dummytile" before defining a texture. Needed for compatibility with the .def files from Megaton, not because I like arbitrarily adding extranneous shit. :p git-svn-id: https://svn.eduke32.com/eduke32@4062 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/defs.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index 47c75e1e0..a42d998d2 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -71,6 +71,7 @@ enum scripttoken_t T_MAKEPALOOKUP, T_REMAPPAL, T_REMAPSELF, T_RED,T_GREEN,T_BLUE, T_TEXTURE,T_ALPHACUT,T_XSCALE,T_YSCALE,T_SPECPOWER,T_SPECFACTOR,T_NOCOMPRESS,T_NODOWNSIZE, + T_ORIGSIZEX,T_ORIGSIZEY, T_UNDEFMODEL,T_UNDEFMODELRANGE,T_UNDEFMODELOF,T_UNDEFTEXTURE,T_UNDEFTEXTURERANGE, T_ALPHAHACK,T_ALPHAHACKRANGE, T_SPRITECOL,T_2DCOL, @@ -1751,7 +1752,7 @@ static int32_t defsparser(scriptfile *script) case T_PAL: { char *paltokptr = script->ltextptr, *palend; - int32_t pal=-1; + int32_t pal=-1, xsiz = 0, ysiz = 0; char *fn = NULL; double alphacut = -1.0, xscale = 1.0, yscale = 1.0, specpower = 1.0, specfactor = 1.0; #ifdef USE_OPENGL @@ -1768,6 +1769,7 @@ static int32_t defsparser(scriptfile *script) { "specfactor", T_SPECFACTOR }, { "specularfactor", T_SPECFACTOR }, { "parallaxbias", T_SPECFACTOR }, { "nocompress", T_NOCOMPRESS }, { "nodownsize", T_NODOWNSIZE }, + { "orig_sizex", T_ORIGSIZEX }, { "orig_sizey", T_ORIGSIZEY } }; if (scriptfile_getsymbol(script,&pal)) break; @@ -1794,6 +1796,12 @@ static int32_t defsparser(scriptfile *script) case T_NODOWNSIZE: flags |= 16; break; #endif + case T_ORIGSIZEX: + scriptfile_getnumber(script, &xsiz); + break; + case T_ORIGSIZEY: + scriptfile_getnumber(script, &ysiz); + break; default: break; } @@ -1816,6 +1824,12 @@ static int32_t defsparser(scriptfile *script) if (check_file_exist(fn)) break; + if (xsiz > 0 && ysiz > 0) + { + set_tilesiz(tile, xsiz, ysiz); + Bmemset(&picanm[tile], 0, sizeof(picanm_t)); + faketilesiz[tile] = -1; + } #ifdef USE_OPENGL xscale = 1.0f / xscale; yscale = 1.0f / yscale;