Re: [AD] About Elias' bug |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> However, I'm a little puzzled by the results you got for conversions from
> 8-bit (8->15 normal specifically), given that the codes in blit3b.diff and
> blit4.diff are exactly the same.
Yes, I was wondering about the timing results earlier - that's why I put the complicated timing code inside pink.c. And still, it didn't change anything. The following program has maybe something to do with it:
In about 50% of the runs it reports about 2000 blits/second, in the other 50% it reports about 4000 blits/second. I have 3 explanations so far: Some mistake I made in the code, some memory alignment issue, something with the clock() function.
--
Elias Pschernig
#include <allegro.h>
#include <time.h>
#include <stdio.h>
int main(void) {
BITMAP *b;
int startclock, t, n;
float timing;
allegro_init();
b = create_bitmap(400,400);
printf("accuracy %d / second\n", CLOCKS_PER_SEC);
startclock = clock();
for(n=0; n<32768; n++) {
blit(b, b, 0, 0, 1, 1, b->w, b->h);
}
t = clock();
if(t == startclock) t++;
timing = (float)CLOCKS_PER_SEC * (float)n / (float) (t - startclock);
printf("start: %d, end: %d, runs: %d -> %.1f\n", startclock, t, n, timing);
return 0;
} END_OF_MAIN();