ACE
ACE copied to clipboard
New bitmap struct type
Currently ACE uses OS version of bitmap struct, which has many flaws. Especially distinguishing whether bitmap is interleaved is nuts: BitMap: Interleaved mode.
Also, perhaps it would be good idea to attach bitmap mask at this level - either as another bitplane or as separate field.
Also, OS struct has BytesPerRow field which is useful for calculations. But there are two problems:
- there are lots of cases where pixel width is needed. Calculating it by shifting is cheap, but I guess it will be better to have it besides bytes per row field.
- currently BytesPerRow is multiplied by depth when in interleaved mode. This representation helps in code unification in blits with non-interleaved bitmaps and during display. So I guess we could keep it and a) add another field for true byte width or b) calculate true byte width using division, which is slow.
Note that the BitMap struct is designed to be able to accomodate more or less bitplanes than are currently supported by the chipset. (Variable length struct, in other words.) If embedding it in a bigger structure, add all the fields before the current BitMap struct.
Note to future self: new bitmap format should also be able to work on part of current bitmap - e.g. a smaller rectangle on the center of a bigger one.