Ran indent.sh

This commit is contained in:
Bill Kendrick 2024-06-01 02:12:00 -07:00
parent 7507ea7217
commit 3cf3af76aa
2 changed files with 20 additions and 16 deletions

View file

@ -41,7 +41,8 @@ char *polyfill_icon_filenames[NUM_TOOLS] = {
"polyfill.png", "polyfill.png",
}; };
enum { enum
{
SND_PLACE, SND_PLACE,
SND_MOVE, SND_MOVE,
SND_REMOVE, SND_REMOVE,
@ -300,22 +301,24 @@ polyfill_drag(magic_api * api, int which ATTRIBUTE_UNUSED,
if (polyfill_editing == polyfill_num_pts - 1 && if (polyfill_editing == polyfill_num_pts - 1 &&
polyfill_num_pts >= 3 && polyfill_num_pts >= 3 &&
x >= polyfill_pt_x[0] - SNAP_SIZE && x >= polyfill_pt_x[0] - SNAP_SIZE &&
x <= polyfill_pt_x[0] + SNAP_SIZE && x <= polyfill_pt_x[0] + SNAP_SIZE && y >= polyfill_pt_y[0] - SNAP_SIZE && y <= polyfill_pt_y[0] + SNAP_SIZE)
y >= polyfill_pt_y[0] - SNAP_SIZE && {
y <= polyfill_pt_y[0] + SNAP_SIZE) {
/* If placing/moving the final (red) point, and it's /* If placing/moving the final (red) point, and it's
near the initial (green) point, play an electrostatic sound */ near the initial (green) point, play an electrostatic sound */
api->playsound(snd_effects[SND_NEARBY], (x * 255) / canvas->w, 255); api->playsound(snd_effects[SND_NEARBY], (x * 255) / canvas->w, 255);
} else if (polyfill_editing == 0 && }
polyfill_num_pts >= 3 && else if (polyfill_editing == 0 &&
x >= polyfill_pt_x[polyfill_num_pts - 1] - SNAP_SIZE && polyfill_num_pts >= 3 &&
x <= polyfill_pt_x[polyfill_num_pts - 1] + SNAP_SIZE && x >= polyfill_pt_x[polyfill_num_pts - 1] - SNAP_SIZE &&
y >= polyfill_pt_y[polyfill_num_pts - 1] - SNAP_SIZE && x <= polyfill_pt_x[polyfill_num_pts - 1] + SNAP_SIZE &&
y <= polyfill_pt_y[polyfill_num_pts - 1] + SNAP_SIZE) { y >= polyfill_pt_y[polyfill_num_pts - 1] - SNAP_SIZE && y <= polyfill_pt_y[polyfill_num_pts - 1] + SNAP_SIZE)
{
/* If moving the initial (green) point, and it's /* If moving the initial (green) point, and it's
near the final (red) point, also play an electrostatic sound */ near the final (red) point, also play an electrostatic sound */
api->playsound(snd_effects[SND_NEARBY], (x * 255) / canvas->w, 255); api->playsound(snd_effects[SND_NEARBY], (x * 255) / canvas->w, 255);
} else { }
else
{
/* Otherwise, play the normal "moving a point" sound */ /* Otherwise, play the normal "moving a point" sound */
api->playsound(snd_effects[SND_MOVE], (x * 255) / canvas->w, 255); api->playsound(snd_effects[SND_MOVE], (x * 255) / canvas->w, 255);
} }
@ -443,9 +446,9 @@ polyfill_release(magic_api * api, int which ATTRIBUTE_UNUSED,
/* Update snapshot ahead of next polygon */ /* Update snapshot ahead of next polygon */
SDL_BlitSurface(canvas, NULL, polyfill_snapshot, NULL); SDL_BlitSurface(canvas, NULL, polyfill_snapshot, NULL);
/* Play "finish" sound effect */ /* Play "finish" sound effect */
api->playsound(snd_effects[SND_FINISH], 128 /* TODO could be clever and determine midpoint of polygon */, 255); api->playsound(snd_effects[SND_FINISH], 128 /* TODO could be clever and determine midpoint of polygon */ , 255);
#ifdef DEBUG #ifdef DEBUG
printf("Retract the undo we just took (ahead of finishing polygon)!\n"); printf("Retract the undo we just took (ahead of finishing polygon)!\n");
@ -491,7 +494,7 @@ polyfill_release(magic_api * api, int which ATTRIBUTE_UNUSED,
} }
polyfill_num_pts--; polyfill_num_pts--;
/* Play "remove" sound effect */ /* Play "remove" sound effect */
api->playsound(snd_effects[SND_REMOVE], (x * 255) / canvas->w, 255); api->playsound(snd_effects[SND_REMOVE], (x * 255) / canvas->w, 255);
} }
} }

View file

@ -23769,7 +23769,8 @@ static Uint8 magic_touched(int x, int y)
/** /**
* Removes the latest undo recorded * Removes the latest undo recorded
*/ */
void magic_retract_undo(void) { void magic_retract_undo(void)
{
if (cur_undo > 0) if (cur_undo > 0)
cur_undo--; cur_undo--;
else else