CHGame 0.3.0
Libraries for the CHGame handheld
Loading...
Searching...
No Matches

The sixteen house colours and pal::: felt themes, fades, flashes and colour cycling. More...

Namespaces

namespace  pal
 The palette: themes, fades, flashes and colour cycling.
 

Enumerations

enum  : uint8_t {
  INK = 0 ,
  WHITE ,
  FELT_DK ,
  FELT ,
  FELT_LT ,
  SILVER ,
  RED ,
  WINE ,
  GOLD ,
  WOOD ,
  BLUE ,
  NAVY ,
  SKIN ,
  CYAN ,
  FX_A ,
  FX_B
}
 The house colours, by palette index. More...
 

Detailed Description

The sixteen house colours and pal::: felt themes, fades, flashes and colour cycling.

Draw with the colour names (gfx_clear(FELT), text35(x, y, s, GOLD)). Set the palette up once with pal::init(), then every frame:

pal::tick(); // once per logic tick: FX_A/FX_B cycle, flashes count down
pal::commit(); // before the flush: hands the colours to CHGfx if they changed
// ... draw ...
void gfx_flushAsync(void)
Starts sending the whole framebuffer and returns at once; the DMA interrupt does the rest.
void gfx_wait(void)
Waits until the flush in flight, if any, has finished.
void tick()
Advance the colour cycling and any flash by one tick.
void commit()
Work out the final colours and hand them to CHGfx if any changed.

Colours are RGB444 (0xRGB, 4 bits a channel), the 12 bpp panel's own grid.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : uint8_t

The house colours, by palette index.

A game that needs other colours in a slot passes its own table to pal::init() and names the slot itself (CHDominoes has BONE and SLATE where SKIN and CYAN are).

Enumerator
INK 

0: black (0x000), outlines and text.

WHITE 

1: white (0xFFF).

FELT_DK 

2: dark felt; re-dyed by pal::setTheme().

FELT 

3: the table felt; re-dyed by pal::setTheme().

FELT_LT 

4: light felt; re-dyed by pal::setTheme().

SILVER 

5: light grey (0xBBC).

RED 

6: red (0xE12).

WINE 

7: dark red (0x702).

GOLD 

8: gold (0xFC2).

WOOD 

9: brown (0x741), table rails.

BLUE 

10: blue (0x26E).

NAVY 

11: dark blue (0x125).

SKIN 

12: skin tone (0xFB8).

CYAN 

13: cyan (0x6EF).

FX_A 

14: animated by pal::tick() while cycling is on (see pal::Mode).

FX_B 

15: animated by pal::tick() while cycling is on (see pal::Mode).