Civ2-clone icon indicating copy to clipboard operation
Civ2-clone copied to clipboard

Some issues with BitmapStorage

Open axx0 opened this issue 1 year ago • 0 comments

  1. The Raylib.LoadImageFromMemory function for _imageCache https://github.com/axx0/Civ2-clone/blob/1cb5c53eb77adcd8a3c72f7d1602ba7a9bd9911b/RaylibUI/Bitmaps/Images.ImportBitmaps.cs#L101 works well only for gifs but not for bmps so we probably have to use our custom implementation here (I'm referring to LoadPropertiesFromPic function in RaylibUtils).

  2. We probably don't need to define transparent colours in BitmapStorage and then do this: https://github.com/axx0/Civ2-clone/blob/1cb5c53eb77adcd8a3c72f7d1602ba7a9bd9911b/RaylibUI/Bitmaps/Images.ImportBitmaps.cs#L111 since transparent colours are already defined in the colour palette of the file (pngs work different but we already deal with that). If 1) is solved then the cached image will have transparent colours fixed.

  3. Extraction of images and textures in CityLoader, TerrainLoader, etc. differs from the implementation mentioned in 1) with _imageCache. This needs to be cleaned up so that the bitmap & texture loading logic is consistent throughout the project.

I can try to deal with this.

axx0 avatar Mar 23 '24 16:03 axx0