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

Function GUI_Screen_Copy

src/gui/gui.c:2614–2646  ·  view source on GitHub ↗

* Wrapper around GFX_Screen_Copy. Protects against wrong input values. * @param xSrc The X-coordinate on the source divided by 8. * @param ySrc The Y-coordinate on the source. * @param xDst The X-coordinate on the destination divided by 8. * @param yDst The Y-coordinate on the destination. * @param width The width divided by 8. * @param height The height. * @param screenSrc The ID of the so

Source from the content-addressed store, hash-verified

2612 * @param screenDst The ID of the destination screen.
2613 */
2614void GUI_Screen_Copy(int16 xSrc, int16 ySrc, int16 xDst, int16 yDst, int16 width, int16 height, Screen screenSrc, Screen screenDst)
2615{
2616 if (width > SCREEN_WIDTH / 8) width = SCREEN_WIDTH / 8;
2617 if (height > SCREEN_HEIGHT) height = SCREEN_HEIGHT;
2618
2619 if (xSrc < 0) {
2620 xDst -= xSrc;
2621 width += xSrc;
2622 xSrc = 0;
2623 }
2624
2625 if (xSrc >= SCREEN_WIDTH / 8 || xDst >= SCREEN_WIDTH / 8) return;
2626
2627 if (xDst < 0) {
2628 xSrc -= xDst;
2629 width += xDst;
2630 xDst = 0;
2631 }
2632
2633 if (ySrc < 0) {
2634 yDst -= ySrc;
2635 height += ySrc;
2636 ySrc = 0;
2637 }
2638
2639 if (yDst < 0) {
2640 ySrc -= yDst;
2641 height += yDst;
2642 yDst = 0;
2643 }
2644
2645 GFX_Screen_Copy(xSrc * 8, ySrc, xDst * 8, yDst, width * 8, height, screenSrc, screenDst);
2646}
2647
2648static uint32 GUI_FactoryWindow_CreateWidgets(void)
2649{

Callers 15

GameCredits_PlayFunction · 0.85
GameLoop_GameCreditsFunction · 0.85
Gameloop_LogosFunction · 0.85
GUI_DisplayTextFunction · 0.85
GUI_EndStats_ShowFunction · 0.85
GUI_PickHouseFunction · 0.85
GUI_DrawCreditsFunction · 0.85
GUI_FactoryWindow_InitFunction · 0.85

Calls 1

GFX_Screen_CopyFunction · 0.85

Tested by

no test coverage detected