X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fdrvutil.c;h=00ab5ced1a6a156b164cf07d50393f5a9e66cadf;hb=dd2491a82880ed9b01b5d66b1814d271921797a4;hp=41df6046358283abb847f2551c8dae2b3d72478c;hpb=e9d9b80381037589fd59209ad66e79008ef2e9f6;p=tpg%2Facess2.git diff --git a/Kernel/drvutil.c b/Kernel/drvutil.c index 41df6046..00ab5ced 100644 --- a/Kernel/drvutil.c +++ b/Kernel/drvutil.c @@ -236,18 +236,19 @@ int DrvUtil_Video_WriteLFB(tDrvUtil_Video_BufInfo *FBInfo, size_t Offset, size_t // Copy to Frambuffer if( FBInfo->Pitch != FBInfo->Width*4 ) { + Uint32 *px; // Pitch isn't 4*Width x = Offset % FBInfo->Width; y = Offset / FBInfo->Height; - dest = (Uint8*)FBInfo->Framebuffer + y*FBInfo->Pitch; + px = (Uint32*)FBInfo->Framebuffer + y*FBInfo->Pitch/4; for( ; Length >= 4; Length -= 4, x ) { - ((Uint32*)dest)[x++] = *src ++; + px[x++] = *src ++; if( x == FBInfo->Width ) { x = 0; - dest += FBInfo->Pitch; + px += FBInfo->Pitch; } } } @@ -538,6 +539,9 @@ void DrvUtil_Video_2D_Blit(void *Ent, Uint16 DstX, Uint16 DstY, Uint16 SrcX, Uin } } } + else if(W == FBInfo->Width && FBInfo->Pitch == FBInfo->Width*bytes_per_px) { + memmove((Uint8*)FBInfo->Framebuffer + dst, (Uint8*)FBInfo->Framebuffer + src, H*FBInfo->Pitch); + } else { // Normal copy is OK while( H -- ) {