From 757da2432b56c2673f75cfe1a190767c7533d5fe Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 7 Nov 2006 22:08:57 +0000 Subject: [PATCH] dummytile fixes git-svn-id: https://svn.eduke32.com/eduke32@330 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/defs.c | 34 ++++++++++++++++++++++++++-------- polymer/build/src/engine.c | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/polymer/build/src/defs.c b/polymer/build/src/defs.c index 99f752d0c..979a0af90 100644 --- a/polymer/build/src/defs.c +++ b/polymer/build/src/defs.c @@ -458,22 +458,31 @@ static int defsparser(scriptfile *script) break; case T_DUMMYTILE: { - int tile, xsiz, ysiz; + int tile, xsiz, ysiz, j; extern char faketile[MAXTILES]; 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; + if(xsiz > 0 && ysiz > 0) + { + tilesizx[tile] = xsiz; + tilesizy[tile] = ysiz; + faketile[tile] = 1; + picanm[tile] = 0; + + j = 15; while ((j > 1) && (pow2long[j] > xsiz)) j--; + picsiz[tile] = ((char)j); + j = 15; while ((j > 1) && (pow2long[j] > ysiz)) j--; + picsiz[tile] += ((char)(j<<4)); + } - faketile[tile] = 1; break; } case T_DUMMYTILERANGE: { - int tile1,tile2,xsiz,ysiz,i; + int tile1,tile2,xsiz,ysiz,i,j; extern char faketile[MAXTILES]; if (scriptfile_getnumber(script,&tile1)) break; @@ -492,9 +501,18 @@ static int defsparser(scriptfile *script) { if ((unsigned long)i < MAXTILES) { - if(xsiz >= 0) tilesizx[i] = xsiz; - if(ysiz >= 0) tilesizy[i] = ysiz; - faketile[i] = 1; + if(xsiz > 0 && ysiz > 0) + { + tilesizx[i] = xsiz; + tilesizy[i] = ysiz; + faketile[i] = 1; + picanm[i] = 0; + + j = 15; while ((j > 1) && (pow2long[j] > xsiz)) j--; + picsiz[i] = ((char)j); + j = 15; while ((j > 1) && (pow2long[j] > ysiz)) j--; + picsiz[i] += ((char)(j<<4)); + } } } } diff --git a/polymer/build/src/engine.c b/polymer/build/src/engine.c index 3f1a9de69..3e7100796 100644 --- a/polymer/build/src/engine.c +++ b/polymer/build/src/engine.c @@ -7628,7 +7628,7 @@ void loadtile(short tilenume) kread(artfil,ptr,dasiz); faketimerhandler(); artfilplc = tilefileoffs[tilenume]+dasiz; - } else Bmemset((char *)waloff[tilenume],0,dasiz); + } else { Bmemset((char *)waloff[tilenume],0,dasiz); faketimerhandler(); } } void checktile(short tilenume)