@@ -435,7 +435,7 @@
}
}
-void cBitmap::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
+void cBitmap::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color, tColor Color2)
{
if (bitmap && Intersects(x1, y1, x2, y2)) {
if (Covers(x1, y1, x2, y2))
@@ -449,10 +449,21 @@
x2 = min(x2, width - 1);
y2 = min(y2, height - 1);
tIndex c = Index(Color);
- for (int y = y1; y <= y2; y++)
+ if(!Color2){
+ for (int y = y1; y <= y2; y++)
for (int x = x1; x <= x2; x++)
- SetIndex(x, y, c);
+ SetIndex(x, y, c);
+ }else{
+ //Color2 is set, so use dithern
+ tIndex c2 = Index(Color2);
+ for (int y = y1; y <= y2; y++)
+ for (int x = x1; x <= x2; x++)
+ if(((x%2)&&(y%2)) || (!(x%2)&&!(y%2)))
+ SetIndex(x, y, c);
+ else
+ SetIndex(x, y, c2);
}
+ }
}
void cBitmap::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants)
@@ -695,10 +706,10 @@
bitmaps[i]->DrawText(x, y, s, ColorFg, ColorBg, Font, Width, Height, Alignment);
}
-void cOsd::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
+void cOsd::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color, tColor Color2)
{
for (int i = 0; i < numBitmaps; i++)
- bitmaps[i]->DrawRectangle(x1, y1, x2, y2, Color);
+ bitmaps[i]->DrawRectangle(x1, y1, x2, y2, Color,Color2);
}
void cOsd::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants)
@@ -169,7 +169,7 @@
///< will be drawn into a rectangle with the given size and the given
///< Alignment (default is top-left). If ColorBg is clrTransparent, no
///< background pixels will be drawn, which allows drawing "transparent" text.
- void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
+ void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color, tColor Color2=0);
///< Draws a filled rectangle defined by the upper left (x1, y1) and lower right
///< (x2, y2) corners with the given Color. If the rectangle covers the entire
///< bitmap area, the color palette will be reset, so that new colors can be
@@ -290,7 +290,7 @@
///< will be drawn into a rectangle with the given size and the given
///< Alignment (default is top-left). If ColorBg is clrTransparent, no
///< background pixels will be drawn, which allows drawing "transparent" text.
- virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
+ virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color, tColor Color2=0);
///< Draws a filled rectangle defined by the upper left (x1, y1) and lower right
///< (x2, y2) corners with the given Color.
virtual void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants = 0);