29 lines
891 B
Plaintext
29 lines
891 B
Plaintext
$OpenBSD: patch-polygon_h,v 1.1 2010/05/22 13:43:24 espie Exp $
|
|
--- polygon.h.orig Sat May 22 15:27:46 2010
|
|
+++ polygon.h Sat May 22 15:40:14 2010
|
|
@@ -28,8 +28,8 @@ struct PolygonEngine : public Bitmap<Pixel> {
|
|
#define super (1<<superSampleShift)
|
|
void apply(Pixel *dest) {
|
|
Pixel sum=0;
|
|
- int count = width*height;
|
|
- Pixel *src = data;
|
|
+ int count = this->width*this->height;
|
|
+ Pixel *src = this->data;
|
|
while(count--) {
|
|
sum += *(src++);
|
|
if (sum)
|
|
@@ -40,10 +40,10 @@ struct PolygonEngine : public Bitmap<Pixel> {
|
|
|
|
void add(Pixel color,int x,int y) {
|
|
if (y < 0) return;
|
|
- if (y >= height) return;
|
|
+ if (y >= this->height) return;
|
|
if (x < 0) x = 0;
|
|
- if (x > width) x = width;
|
|
- data[x+y*width] += color;
|
|
+ if (x > this->width) x = this->width;
|
|
+ this->data[x+y*this->width] += color;
|
|
}
|
|
|
|
/* Color is char[layers] */
|