Usermode/AxWin3 - Cleaning up, graphics fixes and working on text cursor
[tpg/acess2.git] / Usermode / Applications / axwin3_src / WM / video.c
index 1306eba..f359884 100644 (file)
@@ -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; W --; dest ++)      *dest = Colour;
+               dest += giScreenWidth - W;
+       }
+}
+
 /**
  * \brief Blit an entire buffer to the screen
  * \note Assumes Pitch = 4*W

UCC git Repository :: git.ucc.asn.au