summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Bitmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/Bitmap.cpp')
-rw-r--r--Stars45/Bitmap.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/Stars45/Bitmap.cpp b/Stars45/Bitmap.cpp
index 65adf84..9fa3b85 100644
--- a/Stars45/Bitmap.cpp
+++ b/Stars45/Bitmap.cpp
@@ -199,7 +199,7 @@ Bitmap::BitBlt(int x, int y, const Bitmap& srcBmp, int sx, int sy, int w, int h,
Color* pd = dst;
for (int n = 0; n < w; n++) {
- if (ps->Value())
+ if (ps->Value())
pd->Set(Color::FormattedBlend(ps->Value(), pd->Value()));
ps++;
pd++;
@@ -829,17 +829,17 @@ Bitmap::Default()
def.mapsize = 64*64;
def.ownpix = true;
def.pix = new(__FILE__,__LINE__) ColorIndex[def.mapsize];
-
+
// 8 bit palette mode
if (def.pix) {
ColorIndex* p = def.pix;
-
+
for (int y = 0; y < 64; y++) {
for (int x = 0; x < 64; x++) {
double distance = sqrt((x-32.0)*(x-32.0) + (y-32.0)*(y-32.0));
if (distance > 31.0) distance = 31.0;
BYTE color = 24 + (BYTE) distance;
-
+
if (x == 0 || y == 0) color = 255;
else if (x == 32 || y == 32) color = 251;
@@ -976,7 +976,7 @@ Bitmap::ClipLine(int& x1, int& y1, int& x2, int& y2)
goto clip_vertical;
if (y1 == y2)
- goto clip_horizontal;
+ goto clip_horizontal;
return true;
}
@@ -1035,7 +1035,7 @@ Bitmap::ClipLine(double& x1, double& y1, double& x2, double& y2)
goto clip_vertical;
if (y1 == y2)
- goto clip_horizontal;
+ goto clip_horizontal;
return true;
}
@@ -1109,7 +1109,7 @@ Bitmap::DrawLine(int x1, int y1, int x2, int y2, Color color)
goto draw_vertical;
if (y1 == y2)
- goto draw_horizontal;
+ goto draw_horizontal;
// plot the line using
/*
@@ -1455,15 +1455,15 @@ Bitmap::DrawEllipse(int x1, int y1, int x2, int y2, Color color, BYTE quad)
// clip super-giant ellipses:
if (x1 < 0 && y1 < 0 && x2 > width && y2 > height) {
double r2 = (a2<b2) ? a2 : b2;
-
+
if (r2 > 32 * height)
return;
-
+
double ul = (x1-x0)*(x1-x0) + (y1-y0)*(y1-y0);
double ur = (x2-x0)*(x2-x0) + (y1-y0)*(y1-y0);
double ll = (x1-x0)*(x1-x0) + (y2-y0)*(y2-y0);
double lr = (x2-x0)*(x2-x0) + (y2-y0)*(y2-y0);
-
+
if (ul > r2 && ur > r2 && ll > r2 && lr > r2)
return;
}
@@ -1525,7 +1525,7 @@ Bitmap::DrawEllipsePoints(int x0, int y0, int x, int y, Color c, BYTE quad)
if (left >= 0 && top >= 0 && quad&1) {
dst = s + top*pitch + left*pixsize;
-
+
switch (pixsize) {
case 1: *dst = (BYTE) cf; break;
case 2: { LPWORD sw = (LPWORD) dst; *sw = (WORD) cf; } break;
@@ -1535,7 +1535,7 @@ Bitmap::DrawEllipsePoints(int x0, int y0, int x, int y, Color c, BYTE quad)
if (right < width && top >= 0 && quad&2) {
dst = s + top*pitch + right*pixsize;
-
+
switch (pixsize) {
case 1: *dst = (BYTE) cf; break;
case 2: { LPWORD sw = (LPWORD) dst; *sw = (WORD) cf; } break;
@@ -1545,7 +1545,7 @@ Bitmap::DrawEllipsePoints(int x0, int y0, int x, int y, Color c, BYTE quad)
if (left >= 0 && bottom < height && quad&4) {
dst = s + bottom*pitch + left*pixsize;
-
+
switch (pixsize) {
case 1: *dst = (BYTE) cf; break;
case 2: { LPWORD sw = (LPWORD) dst; *sw = (WORD) cf; } break;
@@ -1555,7 +1555,7 @@ Bitmap::DrawEllipsePoints(int x0, int y0, int x, int y, Color c, BYTE quad)
if (right < width && bottom < height && quad&4) {
dst = s + bottom*pitch + right*pixsize;
-
+
switch (pixsize) {
case 1: *dst = (BYTE) cf; break;
case 2: { LPWORD sw = (LPWORD) dst; *sw = (WORD) cf; } break;