RED When Excited
Where Do You Want To Be Tomorrow?



RWE Shapes Library


Statement: LELoadShapes


Modes: Amiga
Syntax: LELoadShapes shapenum#,[shapenum#,]filename$[,palette#]

This attempt to load shapes from an LEShapes file, if there is a palette saved in the shape file this will be loaded into the specified palette. You can miss out an upper shape limit or a palette number or both!
Due to a limitation of the Blitz library system you cannot use the following form of the command:
     LELoadShapes 0,"shapesfile",0
You will get a "Can't convert types error". To get around this simply do:
     LELoadShapes 0,Max Shape,"shapesfile",0

Statement: LESaveShapes


Modes: Amiga
Syntax: LESaveShapes shapenum#,shapenum#,filename$[,palette#]

This saves shapes and a palette in an IFF type file (not an picture). The palette can be saved along with the shape file. If no palette is passed or the passed palette is empty, no palette data will be saved.

Statement/Function: LECludgeShapes


Modes: Amiga/Blitz
Syntax: LECludgeShapes shape#,shape#,address,palette#

This command decodes a shape file (that may have a palette) saved by LESaveShapes. It can cope with compresses or uncompressed data, and conforms with Acids standards for indicating that a shape has been cludged. If you wish to decompress as many shapes as are in the shapes file you may do:
      LECludgeShapes shape#,Maximum Shapes-1,address,palette#
This will decode all the shapes in the file with NO OVERRUN like acids library.
There are some considerations with where in memory you want to place you LEShapes file to be Cludged. If you're shapes file is: Then Cludge shapes will not create a second copy of the shapes data. There is no point caching a compressed LEShapes file to Chip MEM. I would recommed caching compressed files to fast mem.

Statement/Function: CludgeShapes


Modes: Amiga/Blitz
Syntax: [success]=CludgeShapes(shape#,numshapes,address)

This allows the creation of shapes through INCBIN statements. It allocates chip memory for each shape and copies the data into this. It does the same as LoadShapes except it grabs shapes from memory.

EXAMPLE:
    suc=BLoad("myshapes",0)
    suc=CludgeShapes(0,50,Start(0))
    MouseWait
    End

Statement: LECompressShapes


Modes: Amiga
Syntax: LECompressShapes Boolean

By default LESaveShapes compresses shapes in a shape file. The compressor is quite intelligent in that if the compressed shape is larger (oxymoron any one?) than the orginal (this can happen, honest) it saves the full data from the old shape.

If you wish to turn shape compression on or off, call LECompressShapes with the correct parameter.

Below is a small table comparing the same shape files stored in 3 different ways. For very small shape files (1-3 shapes) you may find turning compression off result in the saving of a few bytes. The bigger the file, the larger the saving.
Shapes SaveShapes LESaveShapes NO COMPRESSION LESaveShapes WITH COMPRESSION
440 76912 bytes 68940 bytes 54091 bytes
223 43008 bytes 38576 bytes 35646 bytes