Skip to content

Commit

Permalink
Add higher-bit chipset support
Browse files Browse the repository at this point in the history
  • Loading branch information
lumiscosity committed Apr 20, 2024
1 parent 42f540a commit b4d8957
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions lmu2png/src/chipset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,20 @@
bool stChipset::GenerateFromSurface(SDL_Surface * Surface)
{
// Set base surface, used for generating the tileset
BaseSurface = Surface;
ChipsetSurface = SDL_CreateRGBSurface(0, 32 * 16, 45 * 16, 8, 0, 0, 0, 0);

// Copy pallete and Color Key
SDL_SetSurfacePalette(ChipsetSurface, Surface->format->palette);
uint32_t ckey;
SDL_GetColorKey(Surface, &ckey);
SDL_SetColorKey(ChipsetSurface, SDL_TRUE, ckey);
BaseSurface = Surface;
if (BaseSurface->format->palette) {
ChipsetSurface = SDL_CreateRGBSurface(0, 32 * 16, 45 * 16, 8, 0, 0, 0, 0);

// Copy pallete and Color Key
SDL_SetSurfacePalette(ChipsetSurface, Surface->format->palette);
uint32_t ckey;
SDL_GetColorKey(Surface, &ckey);
SDL_SetColorKey(ChipsetSurface, SDL_TRUE, ckey);
}
else {
ChipsetSurface = SDL_CreateRGBSurface(0, 32 * 16, 45 * 16, 32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);
}


int CurrentTile = 0;

Expand Down

0 comments on commit b4d8957

Please sign in to comment.