blob: dbef69f68c1bdd6be8db6b17ef70904a1f309389 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
$NetBSD: patch-aa,v 1.1.1.1 2007/02/02 16:08:48 drochner Exp $
--- src/map/tileitem.cpp.orig 2007-01-28 15:03:48.000000000 +0100
+++ src/map/tileitem.cpp
@@ -125,15 +125,15 @@ void TileItem_AlphaSoftware::Dig(const P
while ( (uint) y <= center.y + radius + EXPLOSION_BORDER_SIZE&& y < CELL_SIZE.y )
{
//Abscisse distance from the center of the circle to the circle
- int dac = center.y - y;
+ int dac = y - center.y;
//Angle on the circle
- float angle = asin( (float)dac / (float)radius);
+ float angle = asin( (float)dac / (float)(radius + EXPLOSION_BORDER_SIZE));
//Zone of the line which needs to be emptied
int start_x, end_x, lenght;
lenght = (int) ((float) radius * cos (angle));
- lenght = lenght > 0 ? lenght : - lenght;
+// lenght = lenght > 0 ? lenght : - lenght;
start_x = center.x - lenght;
lenght *= 2;
end_x = start_x + lenght;
@@ -144,7 +144,7 @@ void TileItem_AlphaSoftware::Dig(const P
int bstart_x, bend_x, blenght;
angle = asin( (float)dac / (float)(radius + EXPLOSION_BORDER_SIZE));
blenght = (int) ((float) (radius + EXPLOSION_BORDER_SIZE) * cos (angle));
- blenght = blenght > 0 ? blenght : - blenght;
+// blenght = blenght > 0 ? blenght : - blenght;
bstart_x = center.x - blenght;
bend_x = bstart_x + (blenght - lenght/2);
Darken(bstart_x, bend_x, buf, bpp);
|