This commit is contained in:
Daveo 2001-04-27 21:42:38 +00:00
parent ba84a60371
commit 0cd2239c38
2 changed files with 15 additions and 5 deletions

View File

@ -44,9 +44,10 @@ int CActorCache::GetSizeType(int Size)
// if (Size<= 64) return(64); // if (Size<= 64) return(64);
// if (Size<=128) return(128); // if (Size<=128) return(128);
// if (Size<=256) return(256); // if (Size<=256) return(256);
return((Size+15)&-16);
// Size>>=4; // Size>>=4;
// Size<<=4; // Size<<=4;
return(Size); // return(Size);
ASSERT(!"SPRITE SIZE NOT SUPPORTED"); ASSERT(!"SPRITE SIZE NOT SUPPORTED");
return(-1); return(-1);
@ -170,7 +171,10 @@ void CActorCache::AllocCache()
int TPW=CACHE_W/SlotCount; int TPW=CACHE_W/SlotCount;
int MaxW=0; int MaxW=0;
int MaxH=0; int MaxH=0;
/* if (TPW<1) */TPW=1;
ASSERT(SlotCount<CACHE_W);
for (int i=0; i<SlotCount; i++) for (int i=0; i<SlotCount; i++)
{ {
if (MaxW<SlotList[i].Width) MaxW=SlotList[i].Width; if (MaxW<SlotList[i].Width) MaxW=SlotList[i].Width;
@ -210,7 +214,7 @@ sPoolNode *List;
List->TexY=TexY; List->TexY=TexY;
List->U=U&255; List->U=U&255;
List->V=V&255; List->V=V&255;
List->TPage=getTPage(0,0,TexX,TexX); List->TPage=getTPage(0,0,TexX,TexY);
AddNode(List,&ThisSlot->NodeList); AddNode(List,&ThisSlot->NodeList);
List++; List++;
} }
@ -242,7 +246,7 @@ void CActorCache::Reset()
SlotCount=0; SlotCount=0;
// Clear VRam // Clear VRam
RECT R={512,256,512,250}; RECT R={CACHE_X,CACHE_Y,TPAGE_W*CACHE_W,TPAGE_H*CACHE_H};
ClearImage(&R,0,255,0); ClearImage(&R,0,255,0);
} }

View File

@ -60,12 +60,18 @@ public:
TPAGE_W =256, TPAGE_W =256,
TPAGE_H =256-4, TPAGE_H =256-4,
CACHE_X =512,
CACHE_Y =256,
CACHE_W =8,
CACHE_H =1,
/*
CACHE_X =512+256, CACHE_X =512+256,
CACHE_Y =256, CACHE_Y =256,
CACHE_W =4, CACHE_W =4,
CACHE_H =1, CACHE_H =1,
CACHE_PALX =CACHE_X, */
CACHE_PALX =CACHE_X+64,
CACHE_PALY =511, CACHE_PALY =511,
CACHE_PALW =64, CACHE_PALW =64,
CACHE_PALH =1, CACHE_PALH =1,