X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2FWM%2Fvideo.c;h=2f6fff8345c28e08cd062bee089cafabb9292c82;hb=e3aca1210498cec4f1cb4d9337aeb774990194a0;hp=002856063cf77035c0dd57a00c727b1b194aaca7;hpb=7b44b19a9b3886de7871c2f3ea85bb3eacf74c83;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/WM/video.c b/Usermode/Applications/axwin3_src/WM/video.c index 00285606..2f6fff83 100644 --- a/Usermode/Applications/axwin3_src/WM/video.c +++ b/Usermode/Applications/axwin3_src/WM/video.c @@ -15,6 +15,7 @@ #include #include #include +#include "include/lowlevel.h" // === IMPORTS === extern int giTerminalFD_Input; @@ -88,6 +89,7 @@ void Video_Setup(void) // Create local framebuffer (back buffer) gpScreenBuffer = malloc( giScreenWidth*giScreenHeight*4 ); + //gpScreenBuffer = _SysMemMap( giTerminalFD, 0, giScreenWidth*giScreenHeight*4, NULL); // Set cursor position and bitmap { @@ -158,19 +160,17 @@ void Video_SetCursorPos(short X, short Y) 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 < 0 || H < 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; + uint32_t *dest = gpScreenBuffer + Y * giScreenWidth + X; while(H --) { - for( i = W; i --; dest ++ ) *dest = Colour; + for( int i = W; i --; dest ++ ) *dest = Colour; dest += giScreenWidth - W; } }