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

Function GUI_DrawBorder

src/gui/gui.c:1967–1987  ·  view source on GitHub ↗

* Draw a border. * * @param left Left position of the border. * @param top Top position of the border. * @param width Width of the border. * @param height Height of the border. * @param colourSchemaIndex Index of the colourSchema used. * @param fill True if you want the border to be filled. */

Source from the content-addressed store, hash-verified

1965 * @param fill True if you want the border to be filled.
1966 */
1967void GUI_DrawBorder(uint16 left, uint16 top, uint16 width, uint16 height, uint16 colourSchemaIndex, bool fill)
1968{
1969 uint16 *colourSchema;
1970
1971 if (!fill) GFX_Screen_SetDirty(SCREEN_ACTIVE, left, top, left + width, top + height);
1972
1973 width -= 1;
1974 height -= 1;
1975
1976 colourSchema = s_colourBorderSchema[colourSchemaIndex];
1977
1978 if (fill) GUI_DrawFilledRectangle(left, top, left + width, top + height, colourSchema[0] & 0xFF);
1979
1980 GUI_DrawLine(left, top + height, left + width, top + height, colourSchema[1] & 0xFF);
1981 GUI_DrawLine(left + width, top, left + width, top + height, colourSchema[1] & 0xFF);
1982 GUI_DrawLine(left, top, left + width, top, colourSchema[2] & 0xFF);
1983 GUI_DrawLine(left, top, left, top + height, colourSchema[2] & 0xFF);
1984
1985 GFX_PutPixel(left, top + height, colourSchema[3] & 0xFF);
1986 GFX_PutPixel(left + width, top, colourSchema[3] & 0xFF);
1987}
1988
1989/**
1990 * Display a hint to the user. Only show each hint exactly once.

Callers 7

GUI_DrawProgressbarFunction · 0.85
GUI_Widget_DrawBorderFunction · 0.85
GUI_Security_ShowFunction · 0.85

Calls 4

GFX_Screen_SetDirtyFunction · 0.85
GUI_DrawFilledRectangleFunction · 0.85
GUI_DrawLineFunction · 0.85
GFX_PutPixelFunction · 0.85

Tested by

no test coverage detected