From 8c5f06c37f3c267ecd8f867cd49765c366b5f47c Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Thu, 18 Aug 2022 23:11:29 -0400 Subject: many additions --- bitmap_calls.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bitmap_calls.cpp') diff --git a/bitmap_calls.cpp b/bitmap_calls.cpp index 5d549c2..a67cd0b 100644 --- a/bitmap_calls.cpp +++ b/bitmap_calls.cpp @@ -19,6 +19,7 @@ // never even did any measuring to see if there was any speedup-- but I // couldn't resist it. I like doing the software rendering stuff. + // TODO(fox): I could write an AVX version of this function, but it may not be // that much faster since we have to do a bit of uninterleaving. @@ -29,11 +30,11 @@ void Bitmap_ConvertPacking(void *Buffer, void *DestBuffer, uint16 Width, uint16 uint8 *Src = (uint8 *)Buffer; uint8 *Temp = (uint8 *)DestBuffer; uint32 RemainderPixels = Width % 4; + uint16 WidthP, HeightP; + Bitmap_CalcPackedDimensions(Width, Height, &WidthP, &HeightP); for (uint32 Y = 0; Y < Height; Y++) { uint32 X = 0; while (X < Width - RemainderPixels) { - uint16 WidthP, HeightP; - Bitmap_CalcPackedDimensions(Width, Height, &WidthP, &HeightP); uint32 XLookup = (X >> 2)*16 + (X % 4); uint32 YLookup = (Y >> 2)*(WidthP*4) + (Y % 4)*4; uint32 PixelToSeek = XLookup + YLookup; @@ -210,8 +211,6 @@ Bitmap_CopyToPointer(void *Input, void *Output, uint16 BytesPerPixel, uint64 Tot uint64 RemainderBytes = TotalBytes % ByteOffset; while (bytes <= TotalBytes - RemainderBytes) { - if (bytes > 2496*4) - int pp = 0; uint8 *Pixel = (uint8 *)Row + bytes; uint8 *Pixel2 = (uint8 *)Row2 + bytes; #if ARM -- cgit v1.2.3