Can't you tell some names of the used algorithms so I can seek them on the internet? How can it work so quick in full screen? How many divisions are there in the inner loop of the application? How is it clipped? How can you make a color lighter or darker? Do you really have to get the r g b -values, edit them and put them in 1 int again with lots of << and >> operators?
Sorry for the late reply, but i was on a trip to sweden for two weeks. The inner loop for a point-sampled pixel looks like this
for (int tx=x+yPos; tx<=end; tx++) {
if (zbuffer[tx]>iz) {
col=texels[((((t1&texClampU)>>18)+(((t2&texClampV)>>18)<<shift)))];
r=(((col>>16))*(srI>>10))>>16;
g=(((col>>8)&255)*(sgI>>10))>>16;
b=((col&255)*(sbI>>10))>>16;
if ((r&0xffffff00)!=0) { r=(255>>(byte) (r>>28&8)); }
if ((g&0xffffff00)!=0) { g=(255>>(byte) (g>>28&8)); }
if ((b&0xffffff00)!=0) { b=(255>>(byte) (b>>28&8)); }
pixels[tx]=b|(g<<8)|(r<<16);
zbuffer[tx]=iz;
}
t1+=dus;
t2+=dvs;
srI+=delr;
sgI+=delg;
sbI+=delb;
iz+=delz;
}
In the inner loop, the subspans are linear interpolated, so no division is needed here. In the loop that does the subdivision, no division is needed too because it has all been replaced by multiplying with 1/(whatever).
I don't know where to look on the net for a better description, because it's simply the way i'm doing these things for ages now.
Please note that this is the inner loop of the SoftGL-Renderer which requires some multiplications and supports texture-wrapping from version 0.92 (to be released...) on, so it's a bit slower than the Legacy-Renderer, but not much.