ref: e3ee7778d1321c57f818466f7fc1672dec56f283
parent: 715b95962d111d961ae73d448696bc4fc483ed21
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Sep 2 14:07:19 EDT 2024
bitpixel: simplify the branching
--- a/rast.c
+++ b/rast.c
@@ -775,13 +775,11 @@
int i;
if(bg->bitDepth == 1){
- if(bg->format == 2 || bg->format == 5){
- i = y*bg->pitchBits + x;
+ i = y*bg->pitchBits + x;
+ if(bg->format == 2 || bg->format == 5)
x = i - (i & ~7);
- return (bg->image[i>>3] & (0x80>>x)) ? 0 : 255;
- }
- i = y*bg->pitchBits+x;
- x &= 7;
+ else
+ x &= 7;
return (bg->image[i>>3] & (0x80>>x)) ? 0 : 255;
}else if(bg->bitDepth == 4){
/* FIXME */