123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|600|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz Max -> Loading/Modifying Pallettes of 256 color bitmaps

Sat, 25 Aug 2007, 21:54
Mog
Hello all. Does anyone know the format structure of a 256 color bitmap? I am trying to make a loader that can also modify the pallette on the fly within games (So you can make team colors easily)

-=-=-
I am Busy Mongoose - My Website

Dev PC: AMD 8150-FX, 16gb Ram, GeForce GTX 680 2gb

Current Project: Pyroxene
Sat, 25 Aug 2007, 21:56
HoboBen
Wotsit format usually has everything.

This bit and this bit have some links.

-=-=-
blog | work | code | more code
Sun, 26 Aug 2007, 00:08
Mog
Seems at the moment I have it working slightly well, though the drawing routine is a little fickle.

*Edit* Here is my code. It's messy but I want to see if this will produce the same results that im getting.



-=-=-
I am Busy Mongoose - My Website

Dev PC: AMD 8150-FX, 16gb Ram, GeForce GTX 680 2gb

Current Project: Pyroxene
Sun, 26 Aug 2007, 04:41
spinal
I did this recently to read a specific size and bit depth image, it should work fine if you read the palette size and image dimensions from the header.



I think the main thing to remember is that the palette has 4 entries per color, rather than 3.

-=-=-
Check out my excellent homepage!
Sun, 26 Aug 2007, 06:03
Teasy
If you only need to replace a few colors,
you could apply a mask to a color on the loaded image
drawn on top of a background of the new color.

I have a function for this in Blitz2D/3D,
but I think it's possible to convert it to BlitzMax.



Sun, 26 Aug 2007, 23:00
Mog
All of this works (The Loader at Least...) But one stupid detail is giving me a headache: I'm using really large bitmaps (ones like 4096x8192 .. so thats one of the reasons why i wanted a 256 color bitmap loader in the first place: Vmem conservation!) But it seems theres no quick way to draw them! Pixmaps are ungodly slow, and simply converting them to an image rebloats them to use 24 bit color! How did they do this back in the old days with games like Starcraft? I'm failing to make the connection...

-=-=-
I am Busy Mongoose - My Website

Dev PC: AMD 8150-FX, 16gb Ram, GeForce GTX 680 2gb

Current Project: Pyroxene
Mon, 27 Aug 2007, 08:02
mike_g
I have noticed that big bitmaps sometimes do weird things on different systems. Probably to do with the graphics cards. Since 4096x8192 is bigger than any screen anyways could you not perhaps split it into, say, eighths and tile it?
Mon, 27 Aug 2007, 23:45
Mog
It's not exactly a Bitmap -- It's a Pixmap that gets 'Windowed' into an image buffer.

-=-=-
I am Busy Mongoose - My Website

Dev PC: AMD 8150-FX, 16gb Ram, GeForce GTX 680 2gb

Current Project: Pyroxene