Skip to content

Instantly share code, notes, and snippets.

@fl4shk
Created July 26, 2015 20:55
Show Gist options
  • Save fl4shk/08feb2f96d08cc033418 to your computer and use it in GitHub Desktop.
Save fl4shk/08feb2f96d08cc033418 to your computer and use it in GitHub Desktop.
// There are a total of 16 sprite palettes, each with 15 colors (and one
// transparent "color"). I have decided to combine the identification of
// sprite tilesets and the sprite palette slots into a single enum. This
// should work fine for now.
enum sprite_gfx_category
{
// The player uses sprite palette slot 0
sgc_player,
// Powerup sprites use sprite palette slot 1
sgc_powerup,
// Enemy sprites use sprite palette slots 2, 3, and 4
sgc_enemy_0,
sgc_enemy_1,
sgc_enemy_2,
// This is the number of sprite graphics categories, automatically
// updated by the compiler. This might count as a simple hack since
// I'm basically abusing the way enums work.
sgc_count,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment