Pal load

From Bennu Wiki
Jump to navigation Jump to search


Syntax

INT pal_load ( <STRING filename>, [ <POINTER id>] )

Description

Loads a color palette from a file.

The current palette is switched to the loaded one. Note that one can load a palette from an 8bit FPG or MAP file (the remaining graphic data will not be loaded) or a PAL file.

The previous name load_pal() is deprecated.

Parameters

STRING filename - The filename of the file that you wish to load the palette from (including extension and possible path).
POINTER id - Optional parameter, for loading a palette in the background.


Returns

INT : graphID

-2 - Waiting for the file to be loaded, see notes.
-1 - There was an error loading the file.
>=0 - The graphID of the newly created palette.


the following applies for versions prior rc282:

INT : Error.

-1 - Error: could not open file; corrupt or truncated file; file doesn't contain palette information.
0 - Error: could not obtain filename; some FPL error.
1 - No error: palette was loaded with success.


Example

Program example;
Begin

    load_pal("example.pal");

    Loop
        frame;
    End

End

Notes

The optional parameter id was introduced in version rc282 and allows you to load resources in the background. It used with the Offset operator. See example below:

      load_pal("archivo_gordo.pal", &idpal);
      while(idpal==-2)
            say("Big File Loading ....");
            frame;
      end
      if(idpal==-1)
          say("Something went wrong!!");
          exit(); // o return
      end

      say("Big file loaded ok!!");


Mod_map
Constants
B'"`UNIQ--nowiki-00000005-QINU`"'CLEARCHARSET'"`UNIQ--nowiki-00000005-QINU`"'CP850CHARSET'"`UNIQ--nowiki-00000005-QINU`"'ISO8859G'"`UNIQ--nowiki-00000005-QINU`"'ANIMATION'"`UNIQ--nowiki-00000005-QINU`"'SPEEDG'"`UNIQ--nowiki-00000005-QINU`"'ANIMATION'"`UNIQ--nowiki-00000005-QINU`"'STEPG'"`UNIQ--nowiki-00000005-QINU`"'ANIMATION'"`UNIQ--nowiki-00000005-QINU`"'STEPSG'"`UNIQ--nowiki-00000005-QINU`"'CENTER'"`UNIQ--nowiki-00000005-QINU`"'XG'"`UNIQ--nowiki-00000005-QINU`"'CENTER'"`UNIQ--nowiki-00000005-QINU`"'YG'"`UNIQ--nowiki-00000005-QINU`"'DEPTHG'"`UNIQ--nowiki-00000005-QINU`"'FRAMESG'"`UNIQ--nowiki-00000005-QINU`"'HEIGHTG'"`UNIQ--nowiki-00000005-QINU`"'PITCHG'"`UNIQ--nowiki-00000005-QINU`"'WIDEG'"`UNIQ--nowiki-00000005-QINU`"'WIDTHG'"`UNIQ--nowiki-00000005-QINU`"'X'"`UNIQ--nowiki-00000005-QINU`"'CENTERG'"`UNIQ--nowiki-00000005-QINU`"'Y'"`UNIQ--nowiki-00000005-QINU`"'CENTERNFB'"`UNIQ--nowiki-00000005-QINU`"'FIXEDWIDTHNFB'"`UNIQ--nowiki-00000005-QINU`"'VARIABLEWIDTH
Functions Bdfload()Centerset()Colorfind()Colorsget()Colorsset()Fade()Fadeoff()Fadeon()Fntload()Fntnew()Fntsave()Fntunload()Fpgadd()Fpgdel()Fpgexists()Fpgload()Fpgnew()Fpgsave()Fpgunload()Getpixel()Glyphget()Glyphset()Graphicinfo()Graphicset()Mapblockcopy()Mapbuffer()Mapclear()Mapclone()Mapdel()Mapexists()Mapgetpixel()Mapinfo()Mapinfoget()Mapinfoset()Mapload()Mapname()Mapnew()Mapput()Mapputpixel()Mapsave()Mapsetname()Mapunload()Mapxput()Mapxputnp()Palclone()Paldel()Palget()Palload()Palmapassign()Palmapgetid()Palmapremove()Palnew()Palrefresh()Palsave()Palset()Palunload()Paletteconvert()Paletteroll()Pcxload()Pngload()Pngsave()Pointget()Pointset()Putpixel()Rgb()Rgbget()Rgba()Rgbaget()