Commit 6244b2ae authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Deleted some junk from CVS.

On creating a new sprite (which is white) an attempt is made to select the
furthest colour from white in the palette.
Corrected icon shading in create dialogue,redid create template.
On closing a file the sprites are freed in reverse order in an attempt to
make it faster (as the blocks are flex'd in the other order) - will speed
up some situations.
When there are 0 sprites in a file the "Save" entry is greyed,this was
causing a internal error nasty looking error box before.
Tweak to allow the debug to be compiled again.
Filesize info box now used OS_ConvertFileSize as the display field
overflowed for files > 1M ish.
File info box made longer than 50 characters,that was a bit stingy.
Local flood fill with transparent mask added.
Reworded some of the messages.
Added "sort by name" to misc menu - sorts the sprites by name oddly enough.
The delete rows/columns now rounds up the grid coordinates,before there
were cases where you could never quite select the edge column/row,for
example a 79*98 sprites zoomed to x8 versus x7.

Version 1.96. Tagged as 'Paint-1_96'
parent bce1bdf7
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Set Alias$@RunType_FF9 /<Obey$Dir>
Set Alias$@PrintType_FF9 /<Obey$Dir> -print
The Paint application allows you to create and edit
sprite files. A sprite file contains one or more
graphic images, each stored as a bitmap.
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
RMEnsure UtilityModule 3.50 Error This version of Paint requires RISC OS 3.50
RMEnsure SpriteExtend 0.80 This version of Paint requires Sprite Extend 0.80
If "<Wimp$ScrapDir>"="" then Error Paint requires a scrap directory: open a directory that contains the Scrap application
Set Paint$Dir <Obey$Dir>
Set Paint$Path <Obey$Dir>.,Resources:$.Resources.Paint.
/<Paint$Dir>.!Boot
WIMPSlot -min 384K
WIMPSlot -max 352K
/<Paint$Dir>.!RunImage %*0
PntID:1.89 (04-Nov-994)
BarIcon:!paint
Pnt00:Paint
circle:Circle
PntH1:\Tpaint tool \w.|M\Sset the current painting tool.|M
PntH2:This is a 'sprite \w'. It allows you to edit the sprite bitmap.|MUse \s and \a to operate the current drawing tool.
PntH3:This is a 'sprite file \w'.|MA sprite file can contain many sprites, each of which is an editable bitmap.|MDouble-click \s on a sprite to edit it.
PntH4:This is a 'sprite file \w'.|MDouble-click \s over a sprite to edit it.
PntH5:\TPaint application, an editor for sprite files.|MA sprite file contains one or more sprites. A sprite is a bitmap image.
PntH6:This is a colour \w.|M\Schoose the colour to use on the associated sprite.
PntH7:Use this \w to create a sprite.|MFill in the appropriate fields and click OK.
PntH7f:This tick-box controls whether the new sprite has a transparency mask.
PntH7t:This writable field specifies the sprite name, which must be different from the name of other sprites in the file.
PntH7v:This numeric writable field controls the width of the sprite (in pixels).
PntH7y:This numeric writable field controls the height of the sprite (in pixels).
PntH7j/PntH7k/PntH7l:These radio buttons control the horizontal resolution (in dots per inch) of the new sprite.
PntH7m/PntH7n/PntH7o:These radio buttons control the vertical resolution (in dots per inch) of the new sprite.
PntH71/PntH72/PntH73:These radio buttons control the palette-type of the new sprite.
PntH78/PntH79/PntH7a/PntH7b/PntH7c/PntH7d:These radio buttons control the number of colours available in the new sprite.
PntH7i/PntH7g/PntH7p/PntH7q:These arrows alter the size of the new sprite.
PntH8:This \w shows information about this version of Paint.
PntH9:This \w shows information about this sprite file.
PntHA:This \w shows information about this sprite.
PntHB:Use this \w to print a sprite using the currently loaded printer driver.
PntHC:\Tdither pattern selector.|MEnter a sprite name and select a pattern number using \s (1, 2, 3 or 4).|MClick \s on the OK button to add this ECF to the available painting colours.
PntHD:Click \s on the arrows to specify a new width and height of the sprite.|MClick \s on the OK button to set this new size.
PntHE:Use this \w to take a snapshot of part of the screen, as a sprite. The delay feature allows you to include menus on the snapshot.
PntHF:Snapshot already in progress
PntHH:Escape
PntHT1:\Sset or clear individual pixels in a sprite \w.
PntHT2:\Suse the spray can.|MWritable icons will appear at the bottom of the toolbox to allow the spray density and radius to be set.
PntHT3:\Suse another sprite as a paintbrush on the current one.|MA writable icon will appear at the bottom of the toolbox: enter the name of the brush into it.
PntHT4:\Scopy a portion of the sprite \w.|M\Ddefine the area to be copied, then click \s to position a copy.
PntHT5:\Smove a portion of the sprite \w.|M\Ddefine the area to be moved, then click \s to position the destination.
PntHT6:\Smove the whole sprite image.|MDrag \s within the sprite \w, and the entire picture will be translated within the sprite.
PntHT7:\Spaint lines.|MTo draw each line, click \s at each end of the line.
PntHT8:\Spaint rectangle outlines.|MTo paint each rectangle, click \s at two opposite corners of the rectangle within the sprite \w.
PntHT9:\Spaint parallelogram outlines.|MTo paint each parallelogram, click \s at three different corners.
PntHTA:\Spaint filled triangles.|MTo paint each triangle, click \s at each corner of the triangle in the sprite \w.
PntHTB:\Spaint filled rectangles.|MTo paint each rectangle, click \s at two opposite corners of the rectangle within the sprite \w.
PntHTC:\Spaint filled parallelograms.|MTo paint each parallelogram, click \s at three different corners.
PntHTD:\Sreplace one colour with another.|MClick \s in the sprite \w and the selected pixel (and adjacent or all of the same colour) will be replaced with the current paint colour.
PntHTE:\Spaint outline circles.|MTo paint each circle, click \s at its centre and then at a point on the edge.
PntHTF:\Spaint ellipse outlines.|MTo paint each ellipse, click \s at its centre, at a point that gives the width at the centre, and at a point on the edge.
PntHTG:\Spaint circular arcs.|MTo paint each arc click \s at the circle centre, and at the start and end of the arc.
PntHTH:\Spaint text, using the system font.|MEnter the desired text in the writable icon that appears when this tool is selected, then click \s in a sprite \w to paint the text.
PntHTI:\Spaint filled circles.|MTo paint each circle, click \s at its centre and then at a point on the edge.
PntHTJ:\Spaint filled ellipses.|MTo paint each ellipse, click \s at its centre, at a point that gives the width at the centre, and at a point on the edge.
PntHTK:\Spaint circle segments.|MTo paint each segment click \s at the circle centre, and at the start and end of the segment.
PntHTL:\Spaint circle sectors.|MTo paint each sector click \s at the circle centre, and at the start and end of the sector.
PntHTM:\Spaint with the current colour.|MThe current colour is set separately for each sprite \w, using the colours \w (use MENU->Paint->Show colours).
PntHTN:\SOR the current colour with the colour found when plotted.
PntHTO:\SAND the current colour with the colour found when plotted.
PntHTP:\SEOR the current colour with the colour found when plotted.
PntE1:Palette file doesn't match sprite palette
PntE2:File is not a palette file
PntE3:'%s' is not a palette file
PntE4:Cannot open file '%s'
PntE5a:Brush sprite cannot be found
PntE5b:ECF sprite cannot be found
PntE6:Sprite '%s' already exists
PntE7:You need to give the sprite a name
PntE8:Invalid height
PntE9:A printer driver must be loaded using the Printers application before you can print
PntEA:The sprite width and height must be at least 1
PntEB:File type of '%s' not recognised
PntEE:Cannot load template '%s'
PntEF:Cannot find Paint's templates
PntEG:There is not enough memory to perform this operation. Quit any unwanted applications or see the RISC OS User Guide for ways to maximise memory.
PntEH:Unable to attach icon bar menu
PntEI:Cannot initialise
PntEJ:This sprite is stored in an unrecognised screen mode
PntEL:Paint cannot flood fill locally with a transparent mask
PntEM:Shear factor too large
PntM1:© Acorn Computers Ltd, 1992
PntM2:Sprite editor
PntM3:Misc,Display,>Save,~Sprite ''|>New sprite
PntM4:Sprite
PntM5:Copy,Rename,Delete|>Save,>Info|>Print
PntM6:Copy
PntM7:Rename
PntM8:Display
PntM9:Drawing and name, Full info| Use desktop colours
PntMA:Misc,Save,Paint,Edit,>Zoom,Grid
PntMB:Save
PntMC:>Sprite,>Palette
PntMD:>Select ECF,Select colour|Show colours,Show tools|Small colours,>Edit palette
PntME:Edit
PntMF:Flip vertically,Flip horizontally,Rotate,Scale x,Scale y,Shear,>Adjust size|>Insert columns,>Insert rows,>Delete columns,>Delete rows|Mask,Palette
PntMG:Rotate
PntMH:Grid
PntMI:>Info,Snapshot ...,Quit
PntMJ:Factor
PntMK:Misc
PntML:>Info,>Sprite|>Print
PntMM:Misc
PntMN:>Info,>File
PntF1:SpriteFile
PntF2:This sprite file has been modified
PntF3:Sprite file '%s' has been modified
PntF4:<untitled>
PntF5:1 sprite file modified
PntF6:%d sprite files modified
PntF7:newsprite
PntF8:screen
PntT1:Set/clear pixels
PntT2:Filled circles
PntT3:Lines
PntT4:Circle outlines
PntT5:Filled triangles
PntT6:Filled ellipses
PntT7:Ellipse outlines
PntT8:Filled circle segments
PntT9:Filled circle sectors
PntTA:Circle outline sections
PntTB:Filled parallelograms
PntTC:Parallelogram outlines
PntTD:Filled rectangles
PntTE:Rectangle outlines
PntTF:Replace colour
PntTG:Move block
PntTH:Move whole sprite
PntTI:Copy block
PntTJ:Insert text
PntTK:Spray can
PntTL:Use sprite as brush
PntW1: Sprite file window
PntW21:%d by %d
PntW22:? by ?
PntW23:mode %d
PntW24:%s colours
PntW3:has palette
PntW3a:has true-colour palette
PntW4:no palette
PntW5:has mask
PntW6:no mask
PntW7:"%.12s" Colours
PntW8:Edit colour
PntW9:not present
PntWA:Printer in use
PntWB:Mode
PntWC:Colours
PntX:Unrecoverable internal error (%0): preserving files in %1.%2 before exiting
PntG1:Sprite ''
PntG3:Yes
PntG4:No
PntG5:Palette
ICONB0/FILER00/EDIT00:\Rsee information on Paint.
ICONB1:\Scapture part of the screen as a sprite.
ICONB2:\Smake Paint go away.
FILER0/EDIT0:\Rshow miscellaneous information.
FILER01:\Ropen a box showing information about this sprite file.
FILER1:\Rcontrol how the sprites in this sprite file are displayed.
FILER10:\Sdisplay the sprites as a drawing and a name.
FILER11:\Sdisplay the sprites with full information.
FILER12:\Sdisplay the sprites with the colours available from the desktop.
FILER2:\Ropen a save box for this sprite file.
FILER3:\Rperform various operations on this sprite.
FILER30:\Rcopy this sprite as another sprite.
FILER31:\Rchange the name of this sprite.
FILER32:\Sdelete this sprite.
FILER34/EDIT01:\Ropen a box showing information about this sprite.
FILER35/EDIT02:\Ropen a box which will enable you to print this sprite.
FILER4:\Rcreate a sprite.
EDIT1:\Rsave this sprite.
EDIT10/FILER33:\Ropen a save box to save the sprite, separately from the rest of the sprite file.
EDIT11:\Ropen a save box, to save this sprite's palette as a Palette file.
EDIT2:\Rcontrol the colours and tools used during painting.
EDIT20:\Rpaint with simple dither (Extended Colour Fill) patterns.
EDIT21:\Sselect the colour that was under the pointer when the menu was opened.
EDIT22:\Sshow the colour selector \w for this sprite. This is used to set the colours used when painting.
EDIT23:\Sshow the toolbox \w, which is used to select painting tools (paint brush, spray can etc).
EDIT24:\Stoggle the colour selector \w's size. The small display is particularly useful for 256-colour sprites.
EDIT25:\Rchange the colours of the palette (this option will be greyed out if your sprite does not have a palette).
EDIT3:\Rperform various operations on the whole sprite.
EDIT30:\Sflip this sprite vertically.
EDIT31:\Sflip this sprite horizontally.
EDIT32:\Rrotate this sprite.
EDIT33:\Rstretch this sprite horizontally.
EDIT34:\Rstretch this sprite vertically.
EDIT35:\Rshear this sprite.
EDIT36:\Rchange the physical size (number of rows and columns) of this sprite.
EDIT37:\Rinsert columns of pixels into this sprite, at the position you were pointing at when you pressed MENU.
EDIT38:\Rinsert rows of pixels into this sprite, at the position you were pointing at when you pressed MENU.
EDIT39:\Rdelete columns of pixels from this sprite, at the position you were pointing at when you pressed MENU.
EDIT3a:\Rdelete rows of pixels from this sprite, at the position you were pointing at when you pressed MENU.
EDIT3b:\Sadd or remove a mask from this sprite.|MA mask increases the size of the sprite (in memory terms) but allows the use of the 'transparent' colour, which will be added to the colour selected window.
EDIT3c:\Sadd or remove a palette from this sprite. If a sprite has no palette, the screen palette colours are used.
EDIT4:\Rzoom in on this sprite.
EDIT5:\Sturn the grid on or off (indicated by a tick).|M\Rset the colour of the grid.|MThe grid only appears when you are zoomed in by 4:1 or more.
INFO:This \w displays information about Paint.
SAVEAS:Either drag \s from the file icon to a directory display, or fill in the name of a file and click \s on OK, to save as a sprite file.
DBOXTCOL:Either drag \s on the sliders, or fill in the values for red, green and blue, or click \s on a coloured icon, or click \s on the arrows, and click \s on OK, to use the colour on the central icon.
MAGNIFIER: Either fill in the numerator and denominator, or click \s on the arrows, to use the given zoom factor.
PRINT:Fill in the number of times you want the sprite to be printed, and click \s on OK.
CLOSE:\Sanswer the question.
QUIT:\Sanswer the question.
No preview for this file type
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.95"
Module_Version SETA 195
Module_MajorVersion SETS "1.96"
Module_Version SETA 196
Module_MinorVersion SETS ""
Module_Date SETS "13 Jan 2003"
Module_ApplicationDate SETS "13-Jan-03"
Module_Date SETS "21 Feb 2003"
Module_ApplicationDate SETS "21-Feb-03"
Module_ComponentName SETS "Paint"
Module_ComponentPath SETS "RiscOS/Sources/Apps/Paint"
Module_FullVersion SETS "1.95"
Module_HelpVersion SETS "1.95 (13 Jan 2003)"
Module_FullVersion SETS "1.96"
Module_HelpVersion SETS "1.96 (21 Feb 2003)"
END
/* (1.95)
/* (1.96)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 1.95
#define Module_MajorVersion_CMHG 1.96
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 13 Jan 2003
#define Module_Date_CMHG 21 Feb 2003
#define Module_MajorVersion "1.95"
#define Module_Version 195
#define Module_MajorVersion "1.96"
#define Module_Version 196
#define Module_MinorVersion ""
#define Module_Date "13 Jan 2003"
#define Module_Date "21 Feb 2003"
#define Module_ApplicationDate "13-Jan-03"
#define Module_ApplicationDate "21-Feb-03"
#define Module_ComponentName "Paint"
#define Module_ComponentPath "RiscOS/Sources/Apps/Paint"
#define Module_FullVersion "1.95"
#define Module_HelpVersion "1.95 (13 Jan 2003)"
#define Module_LibraryVersionInfo "1:95"
#define Module_FullVersion "1.96"
#define Module_HelpVersion "1.96 (21 Feb 2003)"
#define Module_LibraryVersionInfo "1:96"
......@@ -1033,13 +1033,34 @@ void main_window_delete (main_window *thiswindow)
static void delete_file_window (main_window *window)
{ main_sprite *sprite;
main_file *file = &window->data->file;
{ main_sprite *sprite;
main_file *file = &window->data->file;
int loop=0,count=0;
ftracef0 ("delete_file_window\n");
/* delete all sprite blocks */
for (sprite=file->sprites;sprite!=NULL;sprite=file->sprites)
psprite_delete (sprite);
/* First copy all their pointers into an array */
for (sprite=file->sprites;sprite!=NULL;sprite=sprite->link)
{
count++;
}
main_sprite *todelete[count];
for (sprite=file->sprites;sprite!=NULL;sprite=sprite->link)
{
todelete[loop] = sprite;
loop++;
}
#if 1
/* And delete all the pointers in the array backwards,faster */
for (loop=count-1; loop != -1; loop--)
#else
/* And delete all the pointers in the array forwards,slow */
for (loop=0; loop<count; loop++)
#endif
{
psprite_delete (todelete[loop]);
}
ftracef0 ("deleted all sprite blocks\n");
......
......@@ -966,12 +966,16 @@ static void insdeltool_null (main_window *window, wimp_mousestr *mpos)
{ ftracef0 ("insdeltool_null\n");
if (mpos->w == window->handle)
{ int x, y;
{ int x, y, tempx, tempy;
main_scaling_block *ms = &window->data->sprite.sprite->mode;
tools_mouse_to_extent_coords (window, mpos, &x, &y);
x /= ms->scale_xmul;
y /= ms->scale_ymul;
tempx = x / ms->scale_xmul;
/* Do integer ceil() in case the xmul is a non integer multiple */
x = tempx + (((tempx * ms->scale_xmul) < x ) ? 1 : 0);
tempy = y / ms->scale_ymul;
/* Do integer ceil() in case the ymul is a non integer multiple */
y = tempy + (((tempy * ms->scale_ymul) < y ) ? 1 : 0);
ftracef2 ("extent coords are (%d, %d)\n", x, y);
if (x == Column) x = Column + 1;
......@@ -1665,7 +1669,7 @@ void menus_sprite_handler (void *handle, char *hit)
ftracef0 ("Close menu event\n");
insdel_pending |= flags << 30; /*top two bits are flags*/
number = 0x80000000;
number = (int)0x80000000;
insert = col = FALSE; /* A fiddle */
}
dbox_dispose (&insdel_d);
......@@ -2219,7 +2223,6 @@ static BOOL sprite_file_info_events (dbox d, void *event, void *handle )
return FALSE;
}
void menus_file_handler (void *handle, char *hit)
{ main_window *window = (main_window *) handle;
......@@ -2236,6 +2239,7 @@ void menus_file_handler (void *handle, char *hit)
if (hit [2])
{ dbox d;
sprite_area *sarea = window->data->file.spritearea;
char sizestring[32];
ftracef0 ("Misc about file\n");
if ((d = dbox_new ("fileInfo"))!=0)
......@@ -2243,13 +2247,134 @@ void menus_file_handler (void *handle, char *hit)
window->data->file.filename == NULL?
msgs_lookup ("PntF4"): window->data->file.filename);
dbox_setnumeric (d, d_File_Number, sarea->number);
dbox_setnumeric (d, d_File_Size, sarea->size);
dbox_setfield (d, d_File_Mod,
yesno (window->data->file.modified));
_swix (OS_ConvertFileSize, _INR(0,2), sarea->size, &sizestring, 32);
dbox_setfield (d, d_File_Size, sizestring);
dbox_setfield (d, d_File_Mod, yesno (window->data->file.modified));
dbox_show (d);
dbox_raw_eventhandler (d, sprite_file_info_events, NULL);
} }
break;
case m_Misc_SBName: {
/* Sort by name */
sprite_area *sarea = window->data->file.spritearea;
int count = sarea->number;
if (count < 2) break; /* Not worth sorting */
/* The sprite name has no terminator when it's 12 long,so copy and terminate the names */
sprite_area *sorted;
sprite_id sid;
main_sprite *sprite,*nextsprite;
main_file *file = &window->data->file;
int size = sarea->size;
int loop, next, i;
sprite_tosort tosort[count];
sprite_tosort *tosortptr[count];
ftracef1("sort - sorting %d sprites\n", count);
count = 0;
for (sprite=file->sprites;sprite!=NULL;sprite=sprite->link)
{
strncpy((char *)tosort[count].tosort, /* The heapsort copy */
((char *)sarea) + sprite->offset + 4, /* The source name */
NAME_LIMIT);
tosort[count].tosort[NAME_LIMIT] = '\0'; /* Ensure a terminator */
tosort[count].tojumble = sprite; /* Remember the corresponding sprite structure pointer */
tosortptr[count] = &tosort[count];
count++;
}
if (((int)&tosortptr) & 0xE0000000)
{
/* Too high - give it to HeapSort32 to jiggle the pointers */
if (wimpt_complain (_swix (OS_HeapSort32, _INR(0,2) | _IN(7), count, &tosortptr, 4, 0)))
break;
}
else
{
/* Give it to HeapSort to jiggle the pointers */
if (wimpt_complain (_swix (OS_HeapSort, _INR(0,2), count, &tosortptr, 4)))
break;
}
for (loop = 0; (loop < (count-1)) && (tosortptr[loop] < tosortptr[loop+1]); loop++)
{
/* Nothing */
}
if (loop==(count-1)) break; /* They were already in order */
visdelay_begin ();
/* Copy them over to a new area in the right order */
if (!flex_alloc((flex_ptr) &sorted, size))
{
werr (FALSE, msgs_lookup ("PntEG"));
break;
}
ftracef1("sort flex'd %08X\n",(char *)sorted);
sorted->size = size;
sorted->sproff = next = 16;
if ((nextsprite = m_ALLOC( sizeof(main_sprite))) == NULL)
{ main_NO_ROOM ("sort rebuild link");
visdelay_end ();
flex_free ((flex_ptr) &sorted);
break;
/* If this happens it'll revert to the old unsorted sprite */
}
file->sprites = nextsprite;
for (loop = 0; loop < count; loop++)
{
sprite = nextsprite;
sid.s.name = tosortptr[loop]->tosort;
sid.tag = sprite_id_name;
sprite_select_rp(sarea, &sid, &sid.s.addr); /* Will succeed as they were there 15 lines ago */
size = ((sprite_header *) sid.s.addr)->next;
ftracef2("sort selected %08X size %d\n",(int)sid.s.addr, size);
memcpy((char *)sorted + next,(char *)sid.s.addr, size);
next = next + size;
/* Now magic up a new sprite info block */
sprite->file = tosortptr[loop]->tojumble->file;
sprite->windows = tosortptr[loop]->tojumble->windows;
sprite->transtab = tosortptr[loop]->tojumble->transtab;
sprite->mode = tosortptr[loop]->tojumble->mode;
sprite->iconsize = tosortptr[loop]->tojumble->iconsize;
sprite->colourhandle = tosortptr[loop]->tojumble->colourhandle;
for (i = 0; i < 4; i++) sprite->ECFs [i].sarea = tosortptr[loop]->tojumble->ECFs [i].sarea;
sprite->gcol = tosortptr[loop]->tojumble->gcol;
sprite->gcol2 = tosortptr[loop]->tojumble->gcol2;
for (i = 0; i < toolspacesize; i++) sprite->toolspace [i] = tosortptr[loop]->tojumble->toolspace [i];
sprite->colourdialogue = tosortptr[loop]->tojumble->colourdialogue;
sprite->colourtitle = tosortptr[loop]->tojumble->colourtitle;
sprite->needsnull= tosortptr[loop]->tojumble->needsnull;
sprite->coloursize = tosortptr[loop]->tojumble->coloursize;
/* Free the original,as that linked list is dead now */
m_FREE(tosortptr[loop]->tojumble, sizeof(main_sprite));
nextsprite = m_ALLOC( sizeof(main_sprite));
sprite->link = nextsprite;
}
/* Free the original area,and update pointers */
m_FREE(nextsprite, sizeof(main_sprite));
sprite->link = NULL;
sorted->number = count;
sorted->freeoff = next;
flex_free((flex_ptr) &window->data->file.spritearea);
*((int *)sorted - 2) =
/* Reanchor the flex block assuming the format is
int anchor
int size
char store */
(int)&window->data->file.spritearea;
window->data->file.spritearea = sorted;
ftracef1("sort budg'd %08X\n",(char *)sorted);
psprite_recalculate_offsets (file);
menus_file_has_changed(window);
visdelay_end ();
}
break;
}
break;
......@@ -2616,6 +2741,10 @@ menu menus_file_maker (void *handle)
menu_setflags (spritefile_main_menu, m_Sprite, 0, hit_sprite == NULL);
/* When there are no sprites in the file,forbid its saving */
menu_setflags (spritefile_main_menu, m_Save, 0,
(file->spritearea->number == 0));
menu_setflags (filedisplay_menu, m_Display_Name, !file->fullinfo, 0);
menu_setflags (filedisplay_menu, m_Display_Full, file->fullinfo, 0);
menu_setflags (filedisplay_menu, m_Display_UseDT,
......
......@@ -1867,7 +1867,7 @@ finish:
* Rotate a sprite through n degrees. *
**************************************/
static void Temporary_Name (sprite_area *sarea, char *name)
void Temporary_Name (sprite_area *sarea, char *name)
{ int i;
sprite_id sid;
......@@ -2414,7 +2414,7 @@ finish:
* Generate/do Create sprite *
**********************************/
void static Decode (int *lb_bpp_out, unsigned int *mode_out)
static void Decode (int *lb_bpp_out, unsigned int *mode_out)
{ wimp_which_block which_block;
wimp_i results [7]; /*only 2 would be needed if function keys couldn't
......@@ -2655,7 +2655,13 @@ static void create_create_sprite (dbox d, main_window *window)
}
sprwindow_swap_output_to_screen ();
/* auto open sprite window here */
/* Having filled with white,find the furthest colour from white and select it */
palette_white.word = 0;
wimpt_noerr (colourtran_return_colourformode (palette_white, mode,
(wimp_paletteword *) psprite_std_palettes
[window->data->file.use_current_palette? 0: 1] [lb_bpp], &sprite->gcol));
/* Auto open sprite window here */
sprwindow_new (sprite);
if (main_current_options.tools.show_tools)
toolwindow_display (/*at pointer?*/ FALSE);
......@@ -2825,10 +2831,16 @@ static void Create_Handler (wimp_eventstr *e, void *handle)
{ /*This code altered to reflect new-format shallow sprites with
palette. JRC 5th Dec 1994*/
if (mode < 256u)
dbox_setnumeric (Create, d_Create_Mode, mode);
dbox_setnumeric (Create, d_Create_Mode, mode),
dbox_unfadefield (Create, d_Create_Mode_LabelL),
dbox_unfadefield (Create, d_Create_Mode),
dbox_unfadefield (Create, d_Create_Mode_LabelR);
else
/*No corresponding old-style mode.*/
dbox_setfield (Create, d_Create_Mode, "");
dbox_setfield (Create, d_Create_Mode, ""),
dbox_fadefield (Create, d_Create_Mode_LabelL),
dbox_fadefield (Create, d_Create_Mode),
dbox_fadefield (Create, d_Create_Mode_LabelR);
if (lb_bpp <= 3)
/*After Black, all shallow sprites can have palettes.*/
......@@ -2917,12 +2929,18 @@ void psprite_create_show (main_window *window, BOOL auto_open,
if ((unsigned) Mode < 256u)
{ /*There is a mode, so we could put a palette on*/
dbox_setnumeric (Create, d_Create_Mode, Mode);
dbox_unfadefield (Create, d_Create_Mode_LabelL),
dbox_unfadefield (Create, d_Create_Mode),
dbox_unfadefield (Create, d_Create_Mode_LabelR),