Adds a border to the surface with the background color backgroundcolor.

PREFIX void spAddColorToTarget(

Uint16

destColor,

Sint32

interpolation

)

Adds a colored layer to the target surface.

PREFIX void spAddSpriteToCollection(

spSpriteCollectionPointer

collection,

spSpritePointer

sprite

)

This adds a existing (!)

PREFIX void spAddTranslation(

spTextPointer

text,

Uint16

language,

const

char

*

translation

)

Adds a translation to a text.

PREFIX Sint32 spAsin(

Sint32

value

)

Calculates the arcus sinus of a fixed point value

PREFIX Sint32 spAtof(

char

*

buffer

)

Converts a string to a Sint32 fixed point number like atof.

PREFIX void spBindTexture(

SDL_Surface

*

texture

)

This texture will be used for all following draw operations with textures

PREFIX void spBlit3D(

Sint32

x1,

Sint32

y1,

Sint32

z1,

SDL_Surface

*

surface

)

Blits a surface in 3d space very fast.

PREFIX void spBlitPart3D(

Sint32

x1,

Sint32

y1,

Sint32

z1,

SDL_Surface

*

surface,

Sint32

sx,

Sint32

sy,

Sint32

w,

Sint32

h

)

Blits a part of a surface in 3d space very fast.

PREFIX void spBlitSurface(

Sint32

x,

Sint32

y,

Sint32

z,

SDL_Surface

*

surface

)

Draws a Surface on the target.

PREFIX void spBlitSurfacePart(

Sint32

x,

Sint32

y,

Sint32

z,

SDL_Surface

*

surface,

Sint32

sx,

Sint32

sy,

Sint32

w,

Sint32

h

)

Draws a part of a Surface on the target.

PREFIX void spChangeBundle(

spTextPointer

text,

spBundlePointer

bundle

)

Texts can change their bundles.

PREFIX void spClearCache(

void

)

Deletes ALL cached surfaces!

PREFIX void spClearTarget(

Uint32

color

)

Clears the Rendertarget.

PREFIX void spCollapsePrimitives(

int

value

)

Determines, whether ellipses, rectangles, ellipses borders and rectangle borders can collapse to an (unseeable) object smaller than one pixel.

PREFIX void spConfigFree(

spConfigPointer

config

)

Frees the struct if you don’t need it anymore

PREFIX int spConfigGetBool(

spConfigPointer

config,

char

*

key,

int

default_value

)

Returns the bool value to a specific key.

PREFIX int spConfigGetBoolWithComment(

spConfigPointer

config,

char

*

key,

int

default_value,

char

*

comment

)

Returns the bool value to a specific key.

PREFIX float spConfigGetFloat(

spConfigPointer

config,

char

*

key,

float

default_value

)

Returns the float value to a specific key.

PREFIX float spConfigGetFloatWithComment(

spConfigPointer

config,

char

*

key,

float

default_value,

char

*

comment

)

Returns the float value to a specific key.

PREFIX int spConfigGetInt(

spConfigPointer

config,

char

*

key,

int

default_value

)

Returns the int value to a specific key.

PREFIX int spConfigGetIntWithComment(

spConfigPointer

config,

char

*

key,

int

default_value,

char

*

comment

)

Returns the int value to a specific key.

PREFIX char* spConfigGetPath(

char

*

buffer,

char

*

subfolder,

char

*

file

)

Returns the path to config files, which may be everywhere on different targets, e.g.

PREFIX char* spConfigGetString(

spConfigPointer

config,

char

*

key,

char

*

default_value

)

Returns the string value to a specific key.

PREFIX char* spConfigGetStringWithComment(

spConfigPointer

config,

char

*

key,

char

*

default_value,

char

*

comment

)

Returns the string value to a specific key.

PREFIX spConfigPointer spConfigRead(

char

*

filename,

char

*

subfolder

)

Reads a config and saves it to a spConfig struct

PREFIX void spConfigSetBool(

spConfigPointer

config,

char

*

key,

int

value

)

Sets the bool value to a specific key.

PREFIX void spConfigSetBoolWithComment(

spConfigPointer

config,

char

*

key,

int

value,

char

*

comment

)

Sets the bool value to a specific key.

PREFIX void spConfigSetFloat(

spConfigPointer

config,

char

*

key,

float

value

)

Sets the float value to a specific key.

PREFIX void spConfigSetFloatWithComment(

spConfigPointer

config,

char

*

key,

float

value,

char

*

comment

)

Sets the float value to a specific key.

PREFIX void spConfigSetInt(

spConfigPointer

config,

char

*

key,

int

value

)

Sets the int value to a specific key.

PREFIX void spConfigSetIntWithComment(

spConfigPointer

config,

char

*

key,

int

value,

char

*

comment

)

Sets the int value to a specific key.

PREFIX void spConfigWrite(

spConfigPointer

config

)

Writes the config to the file.

PREFIX SDL_Surface* spCopySurface(

SDL_Surface

*

surface

)

This creates a “copy” of a surface.

PREFIX Sint32 spCos(

Sint32

value

)

Calculates the cosinus of a fixed point value

PREFIX SDL_Surface* spCreateDefaultWindow(

void

)

Creates a default window with no fullscreen for PC, but resizeable for PC.

PREFIX spFileError spCreateDirectoryChain(

const

char

*

directories

)

Creates a directory chain (like /home/user/.config/pinball/settings) if it not exists already.

PREFIX SDL_Surface* spCreateSurface(

int

width,

int

height

)

Creates a 16 Surface 100% compatible to the engine.

PREFIX spTextPointer spCreateText(

const

char

*

caption,

spBundlePointer

bundle

)

Creates a new text, which contains different translations of the same text.

PREFIX spTextBlockPointer spCreateTextBlock(

const unsigned

char

*

text,

int

max_width,

spFontPointer

font

)

Creates an spTextBlock out of an text.

PREFIX spBundlePointer spCreateTextBundle(

void

)

Creates a text bundle.

PREFIX spTextPointer spCreateTextWithTranslation(

const

char

*

caption,

spBundlePointer

bundle,

Uint16

language,

const

char

*

translation

)

Works like a mix of spCreateText and spAddTranslation.

PREFIX SDL_Surface* spCreateWindow(

int

width,

int

height,

int

fullscreen,

int

allowresize

)

Creates the Window in the plattform depended resolution.

PREFIX void spDeactivatePattern(

void

)

Deactivates the pattern.

PREFIX void spDeleteBundle(

spBundlePointer

bundle,

int

keepText

)

Deletes a whole bundle.

PREFIX void spDeleteSprite(

spSpritePointer

sprite

)

Deletes a sprite and all subsprites.

PREFIX void spDeleteSpriteCollection(

spSpriteCollectionPointer

collection,

int

keepSprites

)

Deletes a collection.

PREFIX void spDeleteSurface(

SDL_Surface

*

surface

)

Deletes a surface, if it is not cached or the reference counter reaches 0.

PREFIX void spDeleteText(

spTextPointer

text

)

Deletes a text.

PREFIX void spDeleteTextBlock(

spTextBlockPointer

block

)

Deletes a text block created by spCreateTextBlock.

PREFIX void spDisableCaching(

void

)

Disables chaching of surfaces.

PREFIX void spDrawInExtraThread(

int

value

)

Determines, whether an extra thread is used for drawing.

PREFIX void spDrawSprite(

Sint32

x,

Sint32

y,

Sint32

z,

spSpritePointer

sprite

)

Draws a sprite with z set and test.

PREFIX void spDrawSprite3D(

Sint32

x,

Sint32

y,

Sint32

z,

spSpritePointer

sprite

)

Draws a sprite with z set and test in 3d space.

PREFIX void spEllipse(

Sint32

x,

Sint32

y,

Sint32

z,

Sint32

rx,

Sint32

ry,

Uint32

color

)

Draws a filled ellipse.

PREFIX void spEllipse3D(

Sint32

x,

Sint32

y,

Sint32

z,

Sint32

rx,

Sint32

ry,

Uint16

color

)

Draws a billboard ellipse in 3d space.

PREFIX void spEllipseBorder(

Sint32

x,

Sint32

y,

Sint32

z,

Sint32

rx,

Sint32

ry,

Sint32

bx,

Sint32

by,

Uint32

color

)

Draws a filled ellipse border.

PREFIX void spEllipseBorder3D(

Sint32

x,

Sint32

y,

Sint32

z,

Sint32

rx,

Sint32

ry,

Sint32

bx,

Sint32

by,

Uint16

color

)

Draws a billboard ellipse border in 3d space.

PREFIX void spEmulateBlendingWithPattern(

Sint32

value

)

Decides, whether real blending (maybe slow) is used or an emulation of blending using pattern in a dithering like way.

PREFIX void spEnableCaching(

void

)

Enables caching surfaces.

PREFIX void spEnableLight(

int

number,

Sint32

active

)

Specifies, whether a light is used or not for the light calculation.

PREFIX void spFileDeleteList(

spFileListPointer

list

)

Deletes a list created by spFileGetDirectory.

PREFIX int spFileExists(

const

char

*

filename

)

Tests, whether the file “filename” exists ;-)

PREFIX spFileError spFileGetDirectory(

spFileListPointer

*

pointer,

char

*

directory,

int

recursive,

int

no_hidden_files

)

Searches for files Puts a double linked list of found files in directory to pointer, found files are directly extracted from the system and may very well not be ordered.

PREFIX void spFileSortList(

spFileListPointer

*

list,

spFileSortType

sortBy

)

Sorts the file list like you want.

PREFIX void spFlip(

void

)

Draws the changes in the window Surface on the screen.

PREFIX void spFloodFill(

int

x,

int

y,

Uint16

color

)

Fills the target at the given position with a color using flood fill.

PREFIX void spFontAdd(

spFontPointer

font,

char

*

characters,

Uint16

color

)

Adds characters to the font.

PREFIX void spFontAddArrowButton(

spFontPointer

font,

Uint32

character,

int

direction,

Uint16

fgColor,

Uint16

bgColor

)

Adds an arrow button the the font.

PREFIX void spFontAddBorder(

spFontPointer

font,

Uint16

bordercolor

)

For better viewing on different backgrounds, most of the time it is useful to have a border around the letters.

PREFIX void spFontAddButton(

spFontPointer

font,

Uint32

character,

char

*

caption,

Uint16

fgColor,

Uint16

bgColor

)

Adds a button the the font.

PREFIX void spFontAddEveryLetterOfTextBundle(

spFontPointer

font,

spBundlePointer

bundle,

Uint16

color

)

Adds every letter used in the given sparrowText Bundle of Translations.

PREFIX void spFontAddRange(

spFontPointer

font,

char

*

from,

char

*

to,

Uint16

color

)

Adds a range of utf8 characters to the font defined by a start and end character

PREFIX void spFontChangeArrowButton(

spFontPointer

font,

spLetterPointer

letter,

Uint32

character,

int

direction,

Uint16

fgColor,

Uint16

bgColor

)

Same like spFontChangeLetter, but for the arrow buttons.

PREFIX void spFontChangeButton(

spFontPointer

font,

spLetterPointer

letter,

Uint32

character,

char

*

caption,

Uint16

fgColor,

Uint16

bgColor

)

Same like spFontChangeLetter, but for the Buttons.

PREFIX void spFontChangeCacheSize(

spFontPointer

font,

Sint32

size

)

Changes to size of the cache.

PREFIX void spFontChangeLetter(

spFontPointer

font,

spLetterPointer

letter,

Uint32

character,

Uint16

color

)

Once I had a bug in sparrowFont.

PREFIX void spFontDelete(

spFontPointer

font

)

Deletes a font

PREFIX int spFontDraw(

Sint32

x,

Sint32

y,

Sint32

z,

const unsigned

char

*

text,

spFontPointer

font

)

Draws a left aligned text to the render target

PREFIX int spFontDrawMiddle(

Sint32

x,

Sint32

y,

Sint32

z,

const unsigned

char

*

text,

spFontPointer

font

)

Draws a center aligned text to the render target

PREFIX int spFontDrawRight(

Sint32

x,

Sint32

y,

Sint32

z,

const unsigned

char

*

text,

spFontPointer

font

)

Draws a right aligned text to the render target

PREFIX int spFontDrawTextBlock(

spTextBlockAlignment

alignment,

Sint32

x,

Sint32

y,

Sint32

z,

spTextBlockPointer

block,

Sint32

height,

Sint32

position,

spFontPointer

font

)

Draws a previously created text block with a maximum height.

PREFIX spLetterPointer spFontGetButton(

spFontPointer

font,

Uint32

character

)

Works like spFontGetLetter but for buttons.

PREFIX Sint32 spFontGetCacheStart(

spFontPointer

font

)

Returns the start of the cache.

PREFIX spLetterPointer spFontGetLetter(

spFontPointer

font,

Uint32

character

)

Returns the letter struct of a letter

PREFIX char* spFontGetLetterString(

spFontPointer

font,

unsigned

char

*

buffer,

int

length

)

Generates a string to use maybe for another call of spFontAdd.

PREFIX Uint32 spFontGetUnicodeFromUTF8(

const

char

*

sign

)

Converts a utf8 sign to unicode

PREFIX char* spFontGetUTF8FromUnicode(

Uint32

sign,

char

*

buffer,

int

len

)

Converts a unicode character to utf8

PREFIX spFontPointer spFontLoad(

const

char

*

fontname,

Uint32

size

)

Loads a ttf font

PREFIX void spFontMulWidth(

spFontPointer

font,

Sint32

factor

)

This function changes the width, which is similar to the distance of the letters, of the whole font.

PREFIX void spFontReplaceColor(

spFontPointer

font,

Uint16

oldcolor,

Uint16

newcolor

)

If you want to change the color of every letter in the font, use this function.

Sets the starting and end sign for buttons, the defaults are ‘[‘ and ‘]’, which means, that “[A]” will be drawn as a button with the caption A, if you called spFontAddButton(font,’A’,”A”,fg,bg) before.

PREFIX void spFontSetButtonStrategy(

int

strategy

)

Sets the strategy used to determine, whether buttons are round (like normal buttons on handhelds) or quadric (like keyboard buttons).

Sets the starting and end sign for semantic buttons from sparrowMapping, the defaults are ‘{‘ and ‘}’, which means, that “{fire}” will be drawn as the button mapping to “fire”.

PREFIX void spFontSetShadeColor(

int

value

)

Sets the “background” color, if you want to shade smoothly.

PREFIX void spFontShadeButtons(

int

value

)

Desides, whether the button font should be shaded or not.

PREFIX int spFontWidth(

const unsigned

char

*

text,

spFontPointer

font

)

Width of a text

Gives you the blue value of a color.

Returns like spGetRGB a 16 bit color out of RGB values, but it is faster and a little bit inaccurate - if you don’t mind, don’t see it or need it VERY often ingame, use this!

PREFIX int spGetFPS(

void

)

Returns the FPS of the Loop Function

Gives you the green value of a color.

PREFIX Sint32 spGetHFromColor(

Uint16

color

)

Gives you the hue of a color.

PREFIX Sint32 spGetHorizontalOrigin(

void

)

Returns the horizontal origin.

PREFIX Uint16 spGetHSV(

Sint32

h,

Uint8

s,

Uint8

v

)

Returns a 16 bit color defined by the HSV values.

PREFIX PspInput spGetInput(

void

)

Returns a pointer of the spInput struct, where the input values will be set.

PREFIX int spGetLastAxisType(

void

)

Gives you the last used axis type (digital or analog).

PREFIX Sint32* spGetMatrix(

void

)

Returns you the REAL modelview matrix pointer!

PREFIX Sint32* spGetOne_over_x_pointer(

void

)

Returns a pointer/array of SP_ONE (65536) values of 1/x

PREFIX int spGetPixelPosition(

Sint32

x,

Sint32

y

)

Returns where the pixel is in relation to the screen.

PREFIX Uint16 spGetPossibleLanguage(

int

nr

)

Gives you the language code for a possible language identified by its number.

PREFIX char* spGetPossibleLanguageName(

int

nr

)

Gives you the language name for a possible language identified by its number.

PREFIX int spGetPossibleLanguagesCount(

void

)

Gets you the total number of all possible languages, if you read them with spReadPossibleLanguages.

PREFIX Sint32* spGetProjectionMatrix(

void

)

Returns the projetion matrix pointer.

Gives you the blue value of a color.

Gives you the greeen value of a color.

Gives you the red value of a color.

PREFIX SDL_Surface* spGetRenderTarget(

void

)

Returns the render target.

PREFIX Sint32* spGetRenderTargetZBuffer(

void

)

Returns a pointer to the zBuffer of the render target

Gives you the red value of a color.

PREFIX Uint16 spGetRGB(

int

r,

int

g,

int

b

)

Returns a 16 bit RGB color

PREFIX Uint8 spGetSFromColor(

Uint16

color

)

Gives you the saturation of a color.

PREFIX Sint32 spGetSizeFactor(

void

)

Returns a fixed point factor for the screen size.

PREFIX Uint16* spGetTargetPixel(

void

)

Returns a pointer to the raw 16 bit pixel data.

PREFIX char* spGetTranslation(

spTextPointer

text

)

Gives you the translation a text in the default language or (if not avaible) in the first added language.

PREFIX char* spGetTranslationFromCaption(

spBundlePointer

bundle,

char

*

caption

)

Gives you the translation in the default language of a text.

PREFIX Sint32 spGetVerticalOrigin(

void

)

Returns the vertical origin.

PREFIX SDL_Surface* spGetVirtualKeyboard(

void

)

This functions returns the precalculated and prescaled keyboard design.

PREFIX int spGetVirtualKeyboardShiftState(

void

)

Returns the state of the Shift mode of the virtual keyboard.

PREFIX int spGetVirtualKeyboardState(

void

)

Gives the virtual keyboard state set by spSetVirtualKeyboard.

PREFIX SDL_Surface* spGetWindowSurface(

void

)

Returns the window Surface.

PREFIX Sint32 spGetZFar(

void

)

Gets the value, to which the zbuffer will be reseted.

PREFIX Sint32 spGetZNear(

void

)

Gets the value, to which the zbuffer will be reseted.

PREFIX void spHorizentalLine(

Uint16

*

pixel,

Sint32

x,

Sint32

y,

Sint32

l_,

Uint32

color_,

Uint32

check,

Sint32

engineWindowX,

Sint32

engineWindowY

)

Draws a fast horizental line with one color.

PREFIX void spIdentity(

void

)

Sets the modelview matrix to the identity matrix.

PREFIX void spInitCore(

void

)

spInitCore initializes SDL, SDL_TTF and other stuff.

PREFIX void spInitMapping(

void

)

Inits sparrowMapping.

PREFIX void spInitMath(

void

)

Initializes the fixed point look up tables for sin, cos, etc.

PREFIX void spInitNet(

void

)

Initializes sparrowNet.

PREFIX void spInitPrimitives(

void

)

Initializes some Look up tables and the zBufferCache.

PREFIX void spInterpolateTargetToColor(

Uint16

destColor,

Sint32

interpolation

)

Interpolates the target to a color.

PREFIX int spIsCachingEnabled(

void

)

Says, whether caching of surfaces is enabled or not.

PREFIX int spIsKeyboardPolled(

void

)

Says, whether input from the keyboard is polled.

PREFIX void spLine(

Sint32

x1,

Sint32

y1,

Sint32

z1,

Sint32

x2,

Sint32

y2,

Sint32

z2,

Uint32

color

)

Draws a colored line

PREFIX void spLine3D(

Sint32

x1,

Sint32

y1,

Sint32

z1,

Sint32

x2,

Sint32

y2,

Sint32

z2,

Uint16

color

)

Draws a line in the 3d space with the given color.

PREFIX spBundlePointer spLoadBundle(

const

char

*

filename,

int

own_bundle

)

Loads a bundle out of a text file.

PREFIX spSpriteCollectionPointer spLoadSpriteCollection(

char

*

filename,

SDL_Surface

*

fallback_surface

)

Loads the a sprite Collection from a ssc-file and returns it as a sprite collection.

PREFIX SDL_Surface* spLoadSurface(

const

char

*

name

)

Loads a 16 Surface needed by the engine.

PREFIX SDL_Surface* spLoadSurfaceZoom(

const

char

*

name,

Sint32

zoom

)

Loads and zoomes a 16 Surface needed by the engine.

PREFIX void spLockRenderTarget(

void

)

Locks the RenderTarget.

PREFIX int spLoop(

void

( *spDraw )( void ),

int

( *spCalc )( Uint32 steps ),

Uint32

minwait,

void

( *spResize )( Uint16 w, Uint16 h ),

void

( *spEvent )( SDL_Event *e )

)

Starts a main loop

PREFIX void spMapButtonAdd(

int

id,

char

*

name,

char

*

caption,

int

poolButton

)

Adds a semantic button identified by name or a self given ID (advise: Use #define MY_FIRE_BUTTON 0 or similar for the id).

PREFIX char* spMapButtonByID(

int

id

)

Returns the caption of the real button behind the mapping via it’s ID.

PREFIX char* spMapButtonByName(

char

*

name

)

Returns the caption of the real button behind the mapping via it’s name.

PREFIX void spMapCancelChange(

void

)

Cancels the mapping change started with spMapStartChangeByID or spMapStartChangeByName.

PREFIX char* spMapCaptionByID(

int

id

)

Returns the caption of the semantic button via it’s ID.

PREFIX char* spMapCaptionByName(

char

*

name

)

Returns the caption of the semantic button via it’s name.

PREFIX int spMapChange(

int

id,

int

poolButton

)

Changes the mapping of an existing button with the setup strategy (see spMapSetStrategy).

PREFIX void spMapChangeNextInPool(

int

id

)

Sets the mapping to the next possible button in the pool.

PREFIX void spMapChangePreviousInPool(

int

id

)

Sets the mapping to the previous possible button in the pool.

PREFIX void spMapClean(

void

)

Deletes all mappings and all buttons in the pool.

PREFIX int spMapContinueChange(

void

)

Interpretates to user input to change the mapping of a semantic button.

PREFIX int spMapGetByID(

int

id

)

Returns the state of the button given by the id.

PREFIX int spMapGetByName(

char

*

name

)

Returns the state of the button given by the name.

Returns the name of the semantic button caption of last collision if spMapContinueChange returned 2.

PREFIX char* spMapLastCollisionPool(

void

)

Returns the name of the pool button of last collision if spMapContinueChange returned 2.

PREFIX void spMapLoad(

char

*

subfolder,

char

*

filename

)

Loads a mapping.

PREFIX void spMapPoolAdd(

int

button_id,

char

*

caption

)

Every button, which shall be useable by the user have to be added to the button pool.