X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2FWM%2Fvideo.c;h=a65ddf961c2863d03d4a2d3634bd8090c0d95245;hb=8f92cf66ba8b0bd8cc27c09075d4fa9dcb68cbd0;hp=1306ebaeb9dea9579c596a9f884e8626ce78ce5f;hpb=cb0be723b41f33efa5d679426f4212e9f1719e1f;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/WM/video.c b/Usermode/Applications/axwin3_src/WM/video.c index 1306ebae..a65ddf96 100644 --- a/Usermode/Applications/axwin3_src/WM/video.c +++ b/Usermode/Applications/axwin3_src/WM/video.c @@ -19,8 +19,7 @@ void Video_Setup(void); void Video_SetCursorPos(short X, short Y); void Video_Update(void); -void Video_FillRect(short X, short Y, short W, short H, uint32_t Color); -void Video_DrawRect(short X, short Y, short W, short H, uint32_t Color); +void Video_FillRect(int X, int Y, int W, int H, uint32_t Color); // === GLOBALS === int giVideo_CursorX; @@ -91,6 +90,25 @@ void Video_SetCursorPos(short X, short Y) ioctl(giTerminalFD, TERM_IOCTL_GETSETCURSOR, &pos); } +void Video_FillRect(int X, int Y, int W, int H, uint32_t Colour) +{ + uint32_t *dest; + int i; + + if(X < 0 || Y < 0) return; + if(W >= giScreenWidth) return; + if(H >= giScreenHeight) return; + if(X + W >= giScreenWidth) W = giScreenWidth - W; + if(Y + H >= giScreenHeight) W = giScreenHeight - H; + + dest = gpScreenBuffer + Y * giScreenWidth + X; + while(H --) + { + for( i = W; i --; dest ++ ) *dest = Colour; + dest += giScreenWidth - W; + } +} + /** * \brief Blit an entire buffer to the screen * \note Assumes Pitch = 4*W