create array for bitmap

BlitzPlus Forums/BlitzPlus Programming/create array for bitmap

pyro821(Posted 2005) [#1]
I have an idea for a game I want to make. But I have to know how to make and array for a bitmap. I really need someones help and i would be very happy if someone could help.


Grey Alien(Posted 2005) [#2]
Do you mean an array of pointers to more than one bitmap or just read a bitmap's pixel colours into an array, or something else?


CS_TBL(Posted 2005) [#3]
in case of the pointers:

Create a bank of size: amount_of_images * 4

And poke an int with the handle of the image at each 4th position in the bank.

Likewise, read the images out with peekint, each 4th position..

In the store-bitmap-in-array-case..:
Why would you want that, unless it's a workaround for not having to access the harddisk? There are smarter methods for that..


ozak(Posted 2005) [#4]
You could use it for per-pixel collision detection/destruction like in worms :)


Ross C(Posted 2005) [#5]

In the store-bitmap-in-array-case..:
Why would you want that, unless it's a workaround for not having to access the harddisk? There are smarter methods for that..



It's useful if you have to look up a pixel value and check to see if a pixel is at a certain co-ord, without having to use a read pixel command, which would be slower. Even banks are slower than 2d arrays in general.