@@ -2069,8 +2069,9 @@ _clipLine(SDL_Surface *dst, Sint16 *x1, Sint16 *y1, Sint16 *x2, Sint16 *y2)
2069
2069
draw = 1 ;
2070
2070
break ;
2071
2071
}
2072
- else if (CLIP_REJECT (code1 , code2 ))
2072
+ else if (CLIP_REJECT (code1 , code2 )) {
2073
2073
break ;
2074
+ }
2074
2075
else {
2075
2076
if (CLIP_INSIDE (code1 )) {
2076
2077
swaptmp = * x2 ;
@@ -3270,10 +3271,12 @@ arcColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start,
3270
3271
end %= 360 ;
3271
3272
// 0 <= start & end < 360; note that sometimes start > end - if so, arc
3272
3273
// goes back through 0.
3273
- while (start < 0 )
3274
+ while (start < 0 ) {
3274
3275
start += 360 ;
3275
- while (end < 0 )
3276
+ }
3277
+ while (end < 0 ) {
3276
3278
end += 360 ;
3279
+ }
3277
3280
start %= 360 ;
3278
3281
end %= 360 ;
3279
3282
@@ -3317,13 +3320,15 @@ arcColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start,
3317
3320
// pixel at x = ((int)temp).
3318
3321
3319
3322
// and whether to draw in this octant initially
3320
- if (oct % 2 )
3323
+ if (oct % 2 ) {
3321
3324
drawoct |=
3322
3325
(1 << oct ); // this is basically like saying drawoct[oct]
3323
3326
// = true, if drawoct were a bool array
3324
- else
3327
+ }
3328
+ else {
3325
3329
drawoct &= 255 - (1 << oct ); // this is basically like saying
3326
3330
// drawoct[oct] = false
3331
+ }
3327
3332
}
3328
3333
if (oct == endoct ) {
3329
3334
// need to compute stopval_end for this octant
@@ -3364,10 +3369,12 @@ arcColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start,
3364
3369
drawoct &= 255 - (1 << oct );
3365
3370
}
3366
3371
}
3367
- else if (oct % 2 )
3372
+ else if (oct % 2 ) {
3368
3373
drawoct &= 255 - (1 << oct );
3369
- else
3374
+ }
3375
+ else {
3370
3376
drawoct |= (1 << oct );
3377
+ }
3371
3378
}
3372
3379
else if (oct != startoct ) { // already verified that it's != endoct
3373
3380
drawoct |= (1 << oct ); // draw this entire segment
@@ -3421,48 +3428,60 @@ arcColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start,
3421
3428
xmcx = x - cx ;
3422
3429
// always check if we're drawing a certain octant before adding
3423
3430
// a pixel to that octant.
3424
- if (drawoct & 4 )
3431
+ if (drawoct & 4 ) {
3425
3432
result |= fastPixelColorNolock (
3426
3433
dst , xmcx , ypcy ,
3427
3434
color ); // drawoct & 4 = 22; drawoct[2]
3428
- if (drawoct & 2 )
3435
+ }
3436
+ if (drawoct & 2 ) {
3429
3437
result |= fastPixelColorNolock (dst , xpcx , ypcy , color );
3430
- if (drawoct & 32 )
3438
+ }
3439
+ if (drawoct & 32 ) {
3431
3440
result |= fastPixelColorNolock (dst , xmcx , ymcy , color );
3432
- if (drawoct & 64 )
3441
+ }
3442
+ if (drawoct & 64 ) {
3433
3443
result |= fastPixelColorNolock (dst , xpcx , ymcy , color );
3444
+ }
3434
3445
}
3435
3446
else {
3436
- if (drawoct & 6 )
3447
+ if (drawoct & 6 ) {
3437
3448
result |= fastPixelColorNolock (
3438
3449
dst , x , ypcy ,
3439
3450
color ); // 4 + 2; drawoct[2] || drawoct[1]
3440
- if (drawoct & 96 )
3451
+ }
3452
+ if (drawoct & 96 ) {
3441
3453
result |=
3442
3454
fastPixelColorNolock (dst , x , ymcy , color ); // 32 + 64
3455
+ }
3443
3456
}
3444
3457
3445
3458
xpcy = x + cy ;
3446
3459
xmcy = x - cy ;
3447
3460
if (cx > 0 && cx != cy ) {
3448
3461
ypcx = y + cx ;
3449
3462
ymcx = y - cx ;
3450
- if (drawoct & 8 )
3463
+ if (drawoct & 8 ) {
3451
3464
result |= fastPixelColorNolock (dst , xmcy , ypcx , color );
3452
- if (drawoct & 1 )
3465
+ }
3466
+ if (drawoct & 1 ) {
3453
3467
result |= fastPixelColorNolock (dst , xpcy , ypcx , color );
3454
- if (drawoct & 16 )
3468
+ }
3469
+ if (drawoct & 16 ) {
3455
3470
result |= fastPixelColorNolock (dst , xmcy , ymcx , color );
3456
- if (drawoct & 128 )
3471
+ }
3472
+ if (drawoct & 128 ) {
3457
3473
result |= fastPixelColorNolock (dst , xpcy , ymcx , color );
3474
+ }
3458
3475
}
3459
3476
else if (cx == 0 ) {
3460
- if (drawoct & 24 )
3477
+ if (drawoct & 24 ) {
3461
3478
result |=
3462
3479
fastPixelColorNolock (dst , xmcy , y , color ); // 8 + 16
3463
- if (drawoct & 129 )
3480
+ }
3481
+ if (drawoct & 129 ) {
3464
3482
result |=
3465
3483
fastPixelColorNolock (dst , xpcy , y , color ); // 1 + 128
3484
+ }
3466
3485
}
3467
3486
3468
3487
/*
@@ -3471,16 +3490,20 @@ arcColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start,
3471
3490
if (stopval_start == cx ) {
3472
3491
// works like an on-off switch because start & end may be in
3473
3492
// the same octant.
3474
- if (drawoct & (1 << startoct ))
3493
+ if (drawoct & (1 << startoct )) {
3475
3494
drawoct &= 255 - (1 << startoct );
3476
- else
3495
+ }
3496
+ else {
3477
3497
drawoct |= (1 << startoct );
3498
+ }
3478
3499
}
3479
3500
if (stopval_end == cx ) {
3480
- if (drawoct & (1 << endoct ))
3501
+ if (drawoct & (1 << endoct )) {
3481
3502
drawoct &= 255 - (1 << endoct );
3482
- else
3503
+ }
3504
+ else {
3483
3505
drawoct |= (1 << endoct );
3506
+ }
3484
3507
}
3485
3508
3486
3509
/*
@@ -3519,41 +3542,53 @@ arcColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start,
3519
3542
3520
3543
// always check if we're drawing a certain octant before adding
3521
3544
// a pixel to that octant.
3522
- if (drawoct & 4 )
3545
+ if (drawoct & 4 ) {
3523
3546
result |= pixelColorNolock (dst , xmcx , ypcy , color );
3524
- if (drawoct & 2 )
3547
+ }
3548
+ if (drawoct & 2 ) {
3525
3549
result |= pixelColorNolock (dst , xpcx , ypcy , color );
3526
- if (drawoct & 32 )
3550
+ }
3551
+ if (drawoct & 32 ) {
3527
3552
result |= pixelColorNolock (dst , xmcx , ymcy , color );
3528
- if (drawoct & 64 )
3553
+ }
3554
+ if (drawoct & 64 ) {
3529
3555
result |= pixelColorNolock (dst , xpcx , ymcy , color );
3556
+ }
3530
3557
}
3531
3558
else {
3532
- if (drawoct & 96 )
3559
+ if (drawoct & 96 ) {
3533
3560
result |= pixelColorNolock (dst , x , ymcy , color );
3534
- if (drawoct & 6 )
3561
+ }
3562
+ if (drawoct & 6 ) {
3535
3563
result |= pixelColorNolock (dst , x , ypcy , color );
3564
+ }
3536
3565
}
3537
3566
3538
3567
xpcy = x + cy ;
3539
3568
xmcy = x - cy ;
3540
3569
if (cx > 0 && cx != cy ) {
3541
3570
ypcx = y + cx ;
3542
3571
ymcx = y - cx ;
3543
- if (drawoct & 8 )
3572
+ if (drawoct & 8 ) {
3544
3573
result |= pixelColorNolock (dst , xmcy , ypcx , color );
3545
- if (drawoct & 1 )
3574
+ }
3575
+ if (drawoct & 1 ) {
3546
3576
result |= pixelColorNolock (dst , xpcy , ypcx , color );
3547
- if (drawoct & 16 )
3577
+ }
3578
+ if (drawoct & 16 ) {
3548
3579
result |= pixelColorNolock (dst , xmcy , ymcx , color );
3549
- if (drawoct & 128 )
3580
+ }
3581
+ if (drawoct & 128 ) {
3550
3582
result |= pixelColorNolock (dst , xpcy , ymcx , color );
3583
+ }
3551
3584
}
3552
3585
else if (cx == 0 ) {
3553
- if (drawoct & 24 )
3586
+ if (drawoct & 24 ) {
3554
3587
result |= pixelColorNolock (dst , xmcy , y , color );
3555
- if (drawoct & 129 )
3588
+ }
3589
+ if (drawoct & 129 ) {
3556
3590
result |= pixelColorNolock (dst , xpcy , y , color );
3591
+ }
3557
3592
}
3558
3593
3559
3594
/*
@@ -3562,16 +3597,20 @@ arcColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start,
3562
3597
if (stopval_start == cx ) {
3563
3598
// works like an on-off switch.
3564
3599
// This is just in case start & end are in the same octant.
3565
- if (drawoct & (1 << startoct ))
3600
+ if (drawoct & (1 << startoct )) {
3566
3601
drawoct &= 255 - (1 << startoct );
3567
- else
3602
+ }
3603
+ else {
3568
3604
drawoct |= (1 << startoct );
3605
+ }
3569
3606
}
3570
3607
if (stopval_end == cx ) {
3571
- if (drawoct & (1 << endoct ))
3608
+ if (drawoct & (1 << endoct )) {
3572
3609
drawoct &= 255 - (1 << endoct );
3573
- else
3610
+ }
3611
+ else {
3574
3612
drawoct |= (1 << endoct );
3613
+ }
3575
3614
}
3576
3615
3577
3616
/*
@@ -4362,11 +4401,13 @@ aaellipseColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry,
4362
4401
xp -- ;
4363
4402
d += t - b2 ;
4364
4403
4365
- if (d >= 0 )
4404
+ if (d >= 0 ) {
4366
4405
ys = yp - 1 ;
4406
+ }
4367
4407
else if ((d - s - a2 ) > 0 ) {
4368
- if ((2 * d - s - a2 ) >= 0 )
4408
+ if ((2 * d - s - a2 ) >= 0 ) {
4369
4409
ys = yp + 1 ;
4410
+ }
4370
4411
else {
4371
4412
ys = yp ;
4372
4413
yp ++ ;
@@ -4423,11 +4464,13 @@ aaellipseColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry,
4423
4464
yp ++ ;
4424
4465
d -= s + a2 ;
4425
4466
4426
- if (d <= 0 )
4467
+ if (d <= 0 ) {
4427
4468
xs = xp + 1 ;
4469
+ }
4428
4470
else if ((d + t - b2 ) < 0 ) {
4429
- if ((2 * d + t - b2 ) <= 0 )
4471
+ if ((2 * d + t - b2 ) <= 0 ) {
4430
4472
xs = xp - 1 ;
4473
+ }
4431
4474
else {
4432
4475
xs = xp ;
4433
4476
xp -- ;
0 commit comments