Mail Archives: djgpp/2000/01/04/11:55:04
Night Walker writes:
> I'm trying to load a 1.167.727 bytes datafile, containing 3 compiled
> sprites at 24bpp.
[...]
> Simply loading the datafile in a binary ram-buffer takes less than a
> second on my AMD-K5 100Mhz, 32Mb Ram.
[...]
> it takes about 3 minutes to load it (however it is loaded perfectly).
I'm surprised that it takes as long as 3 mins, but it is normal that
this operation be quite slow. There is a lot of work involved with
loading compiled sprites: the pixel data has to be converted into
whatever encoding your graphics card is currently using, and then
compiled into a machine code format, which is neither cheap nor
especially carefully optimised. The problem is that you have too
much data: compiled sprites are good for small, frequently drawn
images, but you have a meg of them even in disk format, which will
bloat to many times that size when it gets compiled. That's a lot
of data to be shifting around, and depending on your DPMI settings
it is possible that it might even start you swapping to disk (that's
the only thing I can think that would explain a 3 mins loading time).
Solution: don't do that. Compiled sprites are a bad solution for
such large images: use RLE format instead.
> Another question: I used _install_irq() to install my own keyboard
> interrupt handler function, but after 16 keystrokes the PC Speaker
> begins to beep every keystroke.
The BIOS keyboard handler must still be getting called: perhaps your
handler is chaining to it by mistake?
Shawn Hargreaves.
- Raw text -