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

Function GUI_StrategicMap_DrawRegion

src/gui/gui.c:3233–3255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3231}
3232
3233static void GUI_StrategicMap_DrawRegion(uint8 houseId, uint16 region, bool progressive)
3234{
3235 char key[4];
3236 char buffer[81];
3237 int16 x;
3238 int16 y;
3239 uint8 *sprite;
3240
3241 GUI_Palette_CreateRemap(houseId);
3242
3243 sprintf(key, "%d", region);
3244
3245 Ini_GetString("PIECES", key, NULL, buffer, sizeof(buffer), g_fileRegionINI);
3246 sscanf(buffer, "%hd,%hd", &x, &y);
3247
3248 sprite = g_sprites[477 + region];
3249
3250 GUI_DrawSprite(SCREEN_1, sprite, x + 8, y + 24, 0, DRAWSPRITE_FLAG_REMAP, g_remap, 1);
3251
3252 if (!progressive) return;
3253
3254 GUI_Screen_FadeIn2(x + 8, y + 24, Sprite_GetWidth(sprite), Sprite_GetHeight(sprite), SCREEN_1, SCREEN_0, GUI_StrategicMap_FastForwardToggleWithESC() ? 0 : 1, false);
3255}
3256
3257static void GUI_StrategicMap_PrepareRegions(uint16 campaignID)
3258{

Calls 7

GUI_Palette_CreateRemapFunction · 0.85
Ini_GetStringFunction · 0.85
GUI_DrawSpriteFunction · 0.85
GUI_Screen_FadeIn2Function · 0.85
Sprite_GetWidthFunction · 0.85
Sprite_GetHeightFunction · 0.85

Tested by

no test coverage detected