Commit a0724eed authored by Robert Sprowson's avatar Robert Sprowson

Minor reformatting step.

Not tested, not tagged.
parent e5100890
......@@ -1820,6 +1820,7 @@ static BOOL main_select_area (wimp_eventstr *event, void *handle)
{ wimp_wstate ws;
wimp_box clip;
main_window *window = (main_window *)handle;
if (event->e != wimp_EUSERDRAG) return FALSE;
win_remove_unknown_event_processor (main_select_area, handle);
os_swix1 (Wimp_AutoScroll, 0);
......@@ -1829,7 +1830,7 @@ static BOOL main_select_area (wimp_eventstr *event, void *handle)
clip.x1 = SCREEN_TO_WORKAREA_X(&ws, MAX(event->data.dragbox.x0, event->data.dragbox.x1));
clip.y0 = SCREEN_TO_WORKAREA_Y(&ws, MIN(event->data.dragbox.y0, event->data.dragbox.y1));
clip.y1 = SCREEN_TO_WORKAREA_Y(&ws, MAX(event->data.dragbox.y0, event->data.dragbox.y1));
main_clear_selection (window,&clip,(window->selection.flags & MW_SELDRAGRIGHT )?SI_TOGGLE:SI_SELECT);
main_clear_selection (window, &clip, (window->selection.flags & MW_SELDRAGRIGHT) ? SI_TOGGLE : SI_SELECT);
return TRUE;
}
......@@ -1838,21 +1839,20 @@ int main_selection_file_size (main_window *window)
{ main_sprite *sprite;
int size = 0;
if (!window || window->selection.count==0) return 0;
for (sprite=window->data->file.sprites;sprite != NULL; sprite = sprite->link)
{
if (sprite->flags & MSF_SELECTED)
{
sprite_header *spriteaddr = psprite_address (sprite);
size+=spriteaddr->next;
for (sprite = window->data->file.sprites; sprite != NULL; sprite = sprite->link)
{ if (sprite->flags & MSF_SELECTED)
{ sprite_header *spriteaddr = psprite_address (sprite);
size += spriteaddr->next;
}
}
return size+12;/* include file header size */
return size + sizeof (sprite_area) - sizeof (int);/* file size not area size */
}
static void main_save_finished (int at, void *handle)
static void main_save_finished (int at, void *arg)
{ main_window *window = (main_window *)handle;
{ main_window *window = (main_window *)arg;
at=at;
xfersend_clear_unknowns ();
window->selection.flags &= ~MW_SELSAVING;
......@@ -2044,8 +2044,8 @@ BOOL main_get_all_sprite_bboxes (main_window *window, main_sprite *sprite,
}
static main_sprite *main_pick_sprite (main_window *window, wimp_mousestr *mouse)
{
int is_in_graphic;
{ int is_in_graphic;
main_sprite *sprite = main_pick_sprite_bbox (window, mouse, &is_in_graphic, 0);
return (sprite && is_in_graphic) ? sprite : 0;
......@@ -2098,19 +2098,22 @@ static void spritefile_event_handler (wimp_eventstr *e, void *handle)
case wimp_ESCROLL: /* use wimp_escroll to make mousewheel work (Colin Granville) */
if (e->data.scroll.x || e->data.scroll.y)
{ switch (e->data.scroll.x)
{ case -2: e->data.scroll.o.x-=(e->data.scroll.o.box.x1-e->data.scroll.o.box.x0); break;
case -1: e->data.scroll.o.x-=64; break;
case 1: e->data.scroll.o.x+=64; break;
case 2: e->data.scroll.o.x+=(e->data.scroll.o.box.x1-e->data.scroll.o.box.x0); break;
}
switch (e->data.scroll.y)
{ case -2: e->data.scroll.o.y-=(e->data.scroll.o.box.y1-e->data.scroll.o.box.y0); break;
case -1: e->data.scroll.o.y-=64; break;
case 1: e->data.scroll.o.y+=64; break;
case 2: e->data.scroll.o.y+=(e->data.scroll.o.box.y1-e->data.scroll.o.box.y0); break;
}
if (wimpt_complain (wimp_open_wind (&e->data.scroll.o))) return;
{
switch (e->data.scroll.x)
{
case -2: e->data.scroll.o.x-=(e->data.scroll.o.box.x1-e->data.scroll.o.box.x0); break;
case -1: e->data.scroll.o.x-=64; break;
case 1: e->data.scroll.o.x+=64; break;
case 2: e->data.scroll.o.x+=(e->data.scroll.o.box.x1-e->data.scroll.o.box.x0); break;
}
switch (e->data.scroll.y)
{
case -2: e->data.scroll.o.y-=(e->data.scroll.o.box.y1-e->data.scroll.o.box.y0); break;
case -1: e->data.scroll.o.y-=64; break;
case 1: e->data.scroll.o.y+=64; break;
case 2: e->data.scroll.o.y+=(e->data.scroll.o.box.y1-e->data.scroll.o.box.y0); break;
}
if (wimpt_complain (wimp_open_wind (&e->data.scroll.o))) return;
}
break;
......@@ -2169,7 +2172,7 @@ static void spritefile_event_handler (wimp_eventstr *e, void *handle)
}
#endif
for (; currsprite != NULL ; currsprite = currsprite->link)
for (; currsprite != NULL; currsprite = currsprite->link)
{ if (++spritex == spritesperline) spritex = 0, spritey++;
ftracef2 ("x %d, y %d\n", spritex, spritey);
......@@ -2202,19 +2205,19 @@ static void spritefile_event_handler (wimp_eventstr *e, void *handle)
{ /* alt pressed */
if (e->data.but.m.bbits & (wimp_BCLICKLEFT | wimp_BCLICKRIGHT))
{ int is_over_graphic;
main_sprite *sprite = main_pick_sprite_bbox (window, &e->data.but.m,&is_over_graphic, 0);
main_sprite *sprite = main_pick_sprite_bbox (window, &e->data.but.m, &is_over_graphic, 0);
if (sprite && is_over_graphic==2 && (e->data.but.m.bbits & wimp_BCLICKLEFT))
{ /* alt click over name */
altrename_start (window, sprite);
break;
{
/* alt click over name */
altrename_start (window, sprite);
break;
}
}
break;
}
if (e->data.but.m.bbits & 4)
{ main_sprite *sprite =
main_pick_sprite (window, &e->data.but.m);
{ main_sprite *sprite = main_pick_sprite (window, &e->data.but.m);
if (sprite != NULL)
{ /*Check sprite has a valid mode. JRC 14 June 1990*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment