PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Mapping colours?

How does PocketQuake map a 24bit RGB colour to the video buffer?

(vid_ppc.c)

The value stored in *vid.buffer is the index value used by vid_curpal. Where vid_curpal contains the re-mapped RGB number or a palette index (if HP525). So vid_curpal[*vid.buffer] returns either RGB565 or RGB555 or PaletteIndex.

Where, when, how is vid.buffer set to the index value?
Are you talking about the main PQ Source as found on this website, or one of the modified versions that added 8 bit color support? I've not seen the source to the latter yet.

Dan East
The modified (8bit) and the PQ source on website work the same.

But lets say PQ source to avoid confusion.
Okay, I understand your question now. It is set by many different drawing routines in Quake. By the 3D engine itself, by various drawing routines to draw status bar, menus, font characters, etc. That buffer is what everything in the Quake engine draws to.

Dan East
Ok, thanks for the reply. It is as I thought the method used is internal to the Quake engine and not PQ specific.
Right, that buffer represents the boundary between the internal world of quake and the OS or hardware it is displayed on. You can specify the resolution you want the engine to render at, but it is the platform-specific code's responsibility to render that buffer appropriately.

Dan East