fs2port/port/include/palette.h
2026-05-13 21:32:05 -05:00

39 lines
1 KiB
C

// 24-bit RGB palette for the FS2 port. The Apple II hires version was
// limited to six colours and suffered colour-clash artefacts at byte
// boundaries. We map the original FS2 colour codes (0..15 in the
// scenery stream) to a richer palette so lakes are blue rather than
// purple, etc.
#ifndef PALETTE_H
#define PALETTE_H
#include <stdint.h>
typedef enum ColorE {
COLOR_BLACK = 0,
COLOR_WHITE,
COLOR_SKY_DAY,
COLOR_SKY_NIGHT,
COLOR_GROUND_DAY,
COLOR_GROUND_NIGHT,
COLOR_WATER,
COLOR_RUNWAY,
COLOR_BUILDING,
COLOR_MOUNTAIN,
COLOR_CITY,
COLOR_AIRCRAFT,
COLOR_ORANGE,
COLOR_HAZE,
COLOR_FOREST,
COLOR_DIRT,
COLOR_COUNT
} ColorE;
extern const uint32_t paletteRgb[COLOR_COUNT];
// Map a scenery-stream colour code (0..15) to one of the palette
// entries above. This replaces the original `ToHiresColorTable`,
// which collapsed the 16 codes into 6 hires colours.
ColorE paletteFromSceneryCode(uint8_t code);
#endif