axx0/Civ2-clone

Some issues with BitmapStorage

Closed this issue · 0 comments

axx0 commented
  1. The Raylib.LoadImageFromMemory function for _imageCache

    _imageCache[sourceKey] = Raylib.LoadImageFromMemory(Path.GetExtension(path).ToLowerInvariant(), File.ReadAllBytes(path));

    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:

    if (bitmapStorage.Transparencies != null)

    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.