ACE icon indicating copy to clipboard operation
ACE copied to clipboard

New bitmap struct type

Open tehKaiN opened this issue 9 years ago • 3 comments

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.

tehKaiN avatar Sep 06 '16 08:09 tehKaiN

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.

tehKaiN avatar Oct 26 '17 17:10 tehKaiN

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.

SamuraiCrow avatar Feb 19 '19 00:02 SamuraiCrow

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.

tehKaiN avatar Jun 14 '20 18:06 tehKaiN