dummytile updates

git-svn-id: https://svn.eduke32.com/eduke32@257 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-08-04 04:01:17 +00:00
parent b68ea8f84f
commit ab6da3c5a4
2 changed files with 17 additions and 19 deletions

View file

@ -443,6 +443,7 @@ static int defsparser(scriptfile *script)
case T_DUMMYTILE:
{
int tile, xsiz, ysiz;
extern char faketile[MAXTILES];
if (scriptfile_getsymbol(script,&tile)) break;
if (scriptfile_getsymbol(script,&xsiz)) break;
@ -450,17 +451,14 @@ static int defsparser(scriptfile *script)
if(xsiz >= 0) tilesizx[tile] = xsiz;
if(ysiz >= 0) tilesizy[tile] = ysiz;
invalidatetile(tile,-1,-1);
if (waloff[tile] == 0)
{
walock[tile] = 199;
allocache(&waloff[tile],xsiz*ysiz,&walock[tile]);
}
faketile[tile] = 1;
break;
}
case T_DUMMYTILERANGE:
{
int tile1,tile2,xsiz,ysiz,i;
extern char faketile[MAXTILES];
if (scriptfile_getnumber(script,&tile1)) break;
if (scriptfile_getnumber(script,&tile2)) break;
@ -480,12 +478,7 @@ static int defsparser(scriptfile *script)
{
if(xsiz >= 0) tilesizx[i] = xsiz;
if(ysiz >= 0) tilesizy[i] = ysiz;
invalidatetile(i,-1,-1);
if (waloff[i] == 0)
{
walock[i] = 199;
allocache(&waloff[i],xsiz*ysiz,&walock[i]);
}
faketile[i] = 1;
}
}
}

View file

@ -7402,6 +7402,8 @@ long loadpics(char *filename, long askedsize)
// loadtile
//
char cachedebug = 0;
char faketile[MAXTILES];
void loadtile(short tilenume)
{
char *ptr;
@ -7433,15 +7435,18 @@ void loadtile(short tilenume)
allocache(&waloff[tilenume],dasiz,&walock[tilenume]);
}
if (artfilplc != tilefileoffs[tilenume])
if(!faketile[tilenume])
{
klseek(artfil,tilefileoffs[tilenume]-artfilplc,BSEEK_CUR);
if (artfilplc != tilefileoffs[tilenume])
{
klseek(artfil,tilefileoffs[tilenume]-artfilplc,BSEEK_CUR);
faketimerhandler();
}
ptr = (char *)waloff[tilenume];
kread(artfil,ptr,dasiz);
faketimerhandler();
}
ptr = (char *)waloff[tilenume];
kread(artfil,ptr,dasiz);
faketimerhandler();
artfilplc = tilefileoffs[tilenume]+dasiz;
artfilplc = tilefileoffs[tilenume]+dasiz;
} else Bmemset((char *)waloff[tilenume],1,dasiz);
}