01a3602c96
OK landry@
156 lines
3.9 KiB
Plaintext
156 lines
3.9 KiB
Plaintext
$OpenBSD: patch-LapisPuzzleView_m,v 1.1 2011/06/27 06:37:07 sebastia Exp $
|
|
|
|
fix build with gcc-2.95
|
|
|
|
--- LapisPuzzleView.m.orig Wed Jun 22 16:06:16 2011
|
|
+++ LapisPuzzleView.m Wed Jun 22 16:39:38 2011
|
|
@@ -249,6 +249,11 @@ static float _grid_height;
|
|
{
|
|
NSSize gz = [__owner gridSize];
|
|
float border = gz.width/6;
|
|
+ int i;
|
|
+ NSColor *tcolor;
|
|
+ NSMutableAttributedString *str;
|
|
+ NSSize strSize;
|
|
+
|
|
[super draw];
|
|
|
|
PSsetrgbcolor(0.7,0.7,0.7);
|
|
@@ -272,7 +277,6 @@ static float _grid_height;
|
|
PSlineto((_x+_columns) * gz.width, (_y+_rows) * gz.height);
|
|
PSfill();
|
|
|
|
- int i;
|
|
for (i = 0; i <_rows; i+=2)
|
|
{
|
|
PSgsave();
|
|
@@ -321,10 +325,6 @@ static float _grid_height;
|
|
|
|
|
|
/****/
|
|
- NSColor *tcolor;
|
|
- NSMutableAttributedString *str;
|
|
- NSSize strSize;
|
|
-
|
|
PSsetrgbcolor(0,0,0);
|
|
PSsetalpha(0.8);
|
|
PSrectfill(_x * gz.width + gz.width/8, _y *gz.height + gz.height/8, gz.width - gz.width/4, gz.height - gz.height/4);
|
|
@@ -1294,10 +1294,10 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
{
|
|
if (__currentUnit)
|
|
{
|
|
+ NSMutableArray *ar;
|
|
_lockControl = YES;
|
|
/* replace timer stone with jewel */
|
|
|
|
- NSMutableArray *ar;
|
|
ar = [NSMutableArray array];
|
|
en = [_units objectEnumerator];
|
|
while ((unit = [en nextObject]))
|
|
@@ -1443,6 +1443,7 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
|
|
id m1,m2,m3;
|
|
LPUnitColorType color;
|
|
+ BOOL merge;
|
|
|
|
if (_gameOver)
|
|
{
|
|
@@ -1483,7 +1484,6 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
}
|
|
}
|
|
|
|
- BOOL merge;
|
|
do
|
|
{
|
|
merge = NO;
|
|
@@ -1497,6 +1497,7 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
|
|
if (unit_rows >= 2)
|
|
{
|
|
+ NSMutableArray *ar = [NSMutableArray array];
|
|
color = [unit unitColor];
|
|
unit_x = [unit X];
|
|
unit_y = [unit Y];
|
|
@@ -1529,7 +1530,6 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
|
|
|
|
/* check right side */
|
|
- NSMutableArray *ar = [NSMutableArray array];
|
|
for (i = 0; i < unit_rows; i++)
|
|
{
|
|
m1 = [self getUnitAtX:unit_x + unit_columns
|
|
@@ -1542,9 +1542,9 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
}
|
|
if ([ar count] == unit_rows)
|
|
{
|
|
- merge = YES;
|
|
id en2, unit2;
|
|
en2 = [ar objectEnumerator];
|
|
+ merge = YES;
|
|
while ((unit2 = [en2 nextObject]))
|
|
{
|
|
[_units removeObject:unit2];
|
|
@@ -1567,9 +1567,9 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
}
|
|
if ([ar count] == unit_rows)
|
|
{
|
|
- merge = YES;
|
|
id en2, unit2;
|
|
en2 = [ar objectEnumerator];
|
|
+ merge = YES;
|
|
while ((unit2 = [en2 nextObject]))
|
|
{
|
|
[_units removeObject:unit2];
|
|
@@ -1593,9 +1593,9 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
}
|
|
if ([ar count] == unit_columns)
|
|
{
|
|
- merge = YES;
|
|
id en2, unit2;
|
|
en2 = [ar objectEnumerator];
|
|
+ merge = YES;
|
|
while ((unit2 = [en2 nextObject]))
|
|
{
|
|
[_units removeObject:unit2];
|
|
@@ -1618,9 +1618,9 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
}
|
|
if ([ar count] == unit_columns)
|
|
{
|
|
- merge = YES;
|
|
id en2, unit2;
|
|
en2 = [ar objectEnumerator];
|
|
+ merge = YES;
|
|
while ((unit2 = [en2 nextObject]))
|
|
{
|
|
[_units removeObject:unit2];
|
|
@@ -1894,6 +1894,9 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
- (void) drawRect:(NSRect)r
|
|
{
|
|
int i;
|
|
+ id en;
|
|
+ LPUnit *unit;
|
|
+
|
|
/*
|
|
[_background compositeToPoint:NSZeroPoint
|
|
operation:NSCompositeCopy];
|
|
@@ -1921,9 +1924,6 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
}
|
|
PSstroke();
|
|
|
|
- id en;
|
|
- LPUnit *unit;
|
|
-
|
|
en = [_blowing objectEnumerator];
|
|
while ((unit = [en nextObject]))
|
|
{
|
|
@@ -1939,8 +1939,8 @@ static LPUnit * _random_unit(id owner, int x, int y, B
|
|
{
|
|
int cc,xx,yy;
|
|
LPUnit* unit;
|
|
- cc=xx=yy=0;
|
|
NSMutableSet *set = [NSMutableSet setWithCapacity:70];
|
|
+ cc=xx=yy=0;
|
|
|
|
for (yy = 13; yy >= 0 && cc < 8; yy--)
|
|
for (xx = 5; xx >= 0; xx--)
|