MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SetupColoursAndInitialWindow

Function SetupColoursAndInitialWindow

src/main_gui.cpp:553–577  ·  view source on GitHub ↗

* Initialise the default colours (remaps and the likes), and load the main windows. */

Source from the content-addressed store, hash-verified

551 * Initialise the default colours (remaps and the likes), and load the main windows.
552 */
553void SetupColoursAndInitialWindow()
554{
555 for (Colours i = COLOUR_BEGIN; i != COLOUR_END; i++) {
556 const uint8_t *b = GetNonSprite(GetColourPalette(i), SpriteType::Recolour) + 1;
557 assert(b != nullptr);
558 for (ColourShade j = SHADE_BEGIN; j < SHADE_END; j++) {
559 SetColourGradient(i, j, PixelColour{b[0xC6 + j]});
560 }
561 }
562
563 new MainWindow(_main_window_desc);
564
565 /* XXX: these are not done */
566 switch (_game_mode) {
567 default: NOT_REACHED();
568 case GM_MENU:
569 ShowSelectGameWindow();
570 break;
571
572 case GM_NORMAL:
573 case GM_EDITOR:
574 ShowVitalWindows();
575 break;
576 }
577}
578
579/**
580 * Show the vital in-game windows.

Callers 3

LoadIntroGameFunction · 0.85
GenerateWorldFunction · 0.85

Calls 6

GetNonSpriteFunction · 0.85
GetColourPaletteFunction · 0.85
SetColourGradientFunction · 0.85
NOT_REACHEDFunction · 0.85
ShowSelectGameWindowFunction · 0.85
ShowVitalWindowsFunction · 0.85

Tested by

no test coverage detected