Trading Game Dev Diary #5

Had an inspiration and was bored of the black / white screen, therefore I have added a (what I call) “display engine”. This “engine” allows to register different displays / screens and add quadrants for draw functions to it. Modules get registered to this quadrants and get drawn depending on quadrant coordinates. This little technique allows us to move modules in a simple way from quadrant to quadrant.

The whole thing now is, that you can switch between displays / screens later on, without caring about draw coordinates of those modules due the use of inherited pointers with their own current coordinates.

Furthermore I added support for color themes.

P.S. 1: Had to name it “display” due “screens” are already in use in the code. Naming is a bit off for now.

P.S. 2: It sounds a bit overcomplicated, but I want to prevent dead ends in the code as much as possible.

Output with quadrant box and module draw output from the order book.
Module currently not respecting quadrant limits yet.
The color theme function.
Was a bit surprised by GM using little endian format for HEX colors.
The init function for the trading display with one quadrant created and the reference of the order book struct.
The draw function for quadrants.