Sample code time:
for(size_t i=0; i<500; ++i)
if((rand()%2 == 0) && (vSprites.size() > 100))
size_t nOfs = (size_t)rand()%vSprites.size();
case 0: case 1: case 2:
strRes = "Data/Test/32.bmp"; ++nCounts;
case 3: case 4:
strRes = "Data/Test/64.bmp"; ++nCounts;
strRes = "Data/Test/128.bmp"; ++nCounts;
p = NEW SOSprite("foo");
I have a debug flag to fill all unused / freed texture space with magenta, so I can catch bugs. It'll be slow as shit though, since it locks the texture for every texture deallocation. But anyway, the result of the above code after loading the background map:
Green dots are "32", red are "64" and the blue things are "128".
Not too shabby. And it works pretty nicely.
I need to have a think about how to do sprites still, I can probably abuse the fact the maps batch sprites anyway, but it still seems pretty expensive to sort them into a multiset prior to rendering.
I'm ill. There's some bug of some sort going around our office, which I've been suffering with for 4 days, but since Beta has been due I decided against taking a day or 2 off. I was considering phoning in sick today, but then I figured I was awake anyway and it wouldn't be too hectic a day so I may as well go in. And similarly, I feel shitty just now but I might as well go in tomorrow since it's the last day of the week and I can sleep most of Saturday before going out to a par-tay at a friends house.
Oh well. Bed.