From 48ad421eb93490a2123210e268a457eb06727959 Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 26 Apr 2006 01:25:18 +0000 Subject: [PATCH] Adds dummy tile support for the def files so that placeholders for hightile textures are no longer needed in the art files git-svn-id: https://svn.eduke32.com/eduke32@116 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/defs.c | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/polymer/build/src/defs.c b/polymer/build/src/defs.c index c916ef0ca..21525fe45 100644 --- a/polymer/build/src/defs.c +++ b/polymer/build/src/defs.c @@ -61,6 +61,7 @@ enum { T_SPRITECOL,T_2DCOL, T_FOGPAL, T_LOADGRP, + T_DUMMYTILE,T_DUMMYTILERANGE }; typedef struct { char *text; int tokenid; } tokenlist; @@ -104,6 +105,8 @@ static tokenlist basetokens[] = { "2dcol", T_2DCOL }, { "fogpal", T_FOGPAL }, { "loadgrp", T_LOADGRP }, + { "dummytile", T_DUMMYTILE }, + { "dummytilerange", T_DUMMYTILERANGE }, }; static tokenlist modeltokens[] = { @@ -382,6 +385,47 @@ static int defsparser(scriptfile *script) scriptfile_getstring(script,&bs); } break; + case T_DUMMYTILE: + { + int tile, xsiz, ysiz; + + if (scriptfile_getsymbol(script,&tile)) break; + if (scriptfile_getsymbol(script,&xsiz)) break; + if (scriptfile_getsymbol(script,&ysiz)) break; + + if(xsiz >= 0) tilesizx[tile] = xsiz; + if(ysiz >= 0) tilesizy[tile] = ysiz; + invalidatetile(tile,-1,-1); + break; + } + case T_DUMMYTILERANGE: + { + int tile1,tile2,xsiz,ysiz,i; + + if (scriptfile_getsymbol(script,&tile1)) break; + if (scriptfile_getsymbol(script,&tile2)) break; + if (scriptfile_getsymbol(script,&xsiz)) break; + if (scriptfile_getsymbol(script,&ysiz)) break; + if (tile2 < tile1) { + initprintf("Warning: backwards tile range on line %s:%d\n", script->filename, scriptfile_getlinum(script,cmdtokptr)); + i = tile2; + tile2 = tile1; + tile1 = i; + } + if ((tile1 >= 0 && tile1 < MAXTILES) && (tile2 >= 0 && tile2 < MAXTILES)) + { + for (i=tile1;i<=tile2;i++) + { + if ((unsigned long)i < MAXTILES) + { + if(xsiz >= 0) tilesizx[i] = xsiz; + if(ysiz >= 0) tilesizy[i] = ysiz; + invalidatetile(i,-1,-1); + } + } + } + } + case T_DEFINEMODEL: { char *modelfn;