MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / GUI_DrawInterfaceAndRadar

Function GUI_DrawInterfaceAndRadar

src/gui/gui.c:2068–2142  ·  view source on GitHub ↗

* Draw the interface (borders etc etc) and radar on the screen. * @param screenID The screen to draw the radar on. if SCREEN_0, SCREEN_1 is used as back buffer */

Source from the content-addressed store, hash-verified

2066 * @param screenID The screen to draw the radar on. if SCREEN_0, SCREEN_1 is used as back buffer
2067 */
2068void GUI_DrawInterfaceAndRadar(Screen screenID)
2069{
2070 PoolFindStruct find;
2071 Screen oldScreenID;
2072 Widget *w;
2073
2074 oldScreenID = GFX_Screen_SetActive((screenID == SCREEN_0) ? SCREEN_1 : screenID);
2075
2076 g_viewport_forceRedraw = true;
2077
2078 Sprites_LoadImage("SCREEN.CPS", SCREEN_1, NULL);
2079 GUI_DrawSprite(SCREEN_1, g_sprites[11], 192, 0, 0, 0); /* "Credits" */
2080
2081 GUI_Palette_RemapScreen(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_1, g_remap);
2082
2083
2084 g_textDisplayNeedsUpdate = true;
2085
2086 GUI_Widget_Viewport_RedrawMap(SCREEN_ACTIVE);
2087
2088 GUI_DrawScreen(SCREEN_ACTIVE);
2089
2090 GUI_Widget_ActionPanel_Draw(true);
2091
2092 w = GUI_Widget_Get_ByIndex(g_widgetLinkedListHead, 1);
2093 GUI_Widget_Draw(w);
2094
2095 w = GUI_Widget_Get_ByIndex(g_widgetLinkedListHead, 2);
2096 GUI_Widget_Draw(w);
2097
2098 find.houseID = HOUSE_INVALID;
2099 find.index = 0xFFFF;
2100 find.type = 0xFFFF;
2101
2102 while (true) {
2103 Structure *s;
2104
2105 s = Structure_Find(&find);
2106 if (s == NULL) break;
2107 if (s->o.type == STRUCTURE_SLAB_1x1 || s->o.type == STRUCTURE_SLAB_2x2 || s->o.type == STRUCTURE_WALL) continue;
2108
2109 Structure_UpdateMap(s);
2110 }
2111
2112 find.houseID = HOUSE_INVALID;
2113 find.index = 0xFFFF;
2114 find.type = 0xFFFF;
2115
2116 while (true) {
2117 Unit *u;
2118
2119 u = Unit_Find(&find);
2120 if (u == NULL) break;
2121
2122 Unit_UpdateMap(1, u);
2123 }
2124
2125 if (screenID == SCREEN_0) {

Callers 3

GUI_ChangeSelectionTypeFunction · 0.85
GUI_Widget_Mentat_ClickFunction · 0.85
GUI_Widget_Options_ClickFunction · 0.85

Calls 15

GFX_Screen_SetActiveFunction · 0.85
Sprites_LoadImageFunction · 0.85
GUI_DrawSpriteFunction · 0.85
GUI_Palette_RemapScreenFunction · 0.85
GUI_DrawScreenFunction · 0.85
GUI_Widget_Get_ByIndexFunction · 0.85
GUI_Widget_DrawFunction · 0.85
Structure_FindFunction · 0.85
Structure_UpdateMapFunction · 0.85
Unit_FindFunction · 0.85

Tested by

no test coverage detected