Quote:
Originally Posted by CrazY.
Basically this is a "hack" method, I was thinking of something like bit-fields, but even so, it was worth the try.
|
Basically this is what you have to use and there is no better solution. Using array of 2056 cells is painful. (Thats 8 kB of memory
)
Bit-fields can only be used to store several boolean values (
8) in a single byte. So you can't just store float numbers such as 100.0 in one bit. Also a variable can store up to 32 values (4 bytes * 8 bits = 32 boolean values) and that's the reason why often can be seen, bit-flags to be used for players instead of array of 32 cells.