[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Question, Bug in a tutorial
Hi!
Which graphic format is recommended to be used with GGI?
PCX is too small and has just the 8 Bit Color mode. I want Truecolor
images. Any suggestions? Any sourcecode?
Now to the bug:
There is a bug in the new ggipcxview.c in the Tutorial about True
Color depths and Keyboard from Alexandre Courbot:
int main
...
unsigned char palette[768];
ggi_color ggi_palette[768];
Actually we only need 256 of the ggi_color palette, because the
ggi_color is a structure including the 3 colors.
So please change it to:
unsigned char palette[768];
ggi_color ggi_palette[256];
By the way, this little mistake consumes 4kb ((768-256)*(2*4)) !
If twenty programmers would cut and paste this code, and their
programs would run a hundrer times, each, you would have triggered a
waste of about 8 Megabyte of worldwide Ram! :)))
Many greetings,
--
~ Philipp Gühring p.guehring@poboxes.com
~ http://www.poboxes.com/p.guehring ICQ UIN: 6588261
~ Please change p.guehring@xpoint.at to p.guehring@poboxes.com