//////////////////////////////////////////////////////////////////////////////
//
// LUA INTERNAL / EXTERNAL CALLS
//
//////////////////////////////////////////////////////////////////////////////
Loader *loader;

// graphics
int luaAddConsole(lua_State *pL)		{ return(loader->lua_Function_AddConsole(pL)); }
////////////////////////////////
/*
---- STARTSECTION:blending
FAMILY:
	graphics
SYNTAX:
	blending(newvalue)
	current_blend=blending()
PARAM:
	newvalue=set new blending color from 0 (transparent) to 255 (opaque)
DESCRIPTION:
	all following draw operations will use selected blending value
SEEALSO:
EXAMPLE:
---- ENDSECTION:blending
*/
int luaBlending(lua_State *pL)			{ return(loader->lua_Function_Blending(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:circle
FAMILY:
	graphics
SYNTAX:
	circle(x, y, radius, red, green, blue)
PARAM:
	x = circle center x coordinate
	y = circle center y coordinate
	radius = circle radius
	red = red component
	green = green component
	blue = blue component
DESCRIPTION:
	draw an unfilled circle in current render target in a specified
	position with specified radius, using selected color
SEEALSO:
	fillcircle
	rendertarget
EXAMPLE:
---- ENDSECTION:circle
*/
int luaCircle(lua_State *pL)			{ return(loader->lua_Function_Circle(pL, false)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:clear
FAMILY:
	graphics
SYNTAX:
	clear(red, green, blue)
PARAM:
	red = red component
	green = green component
	blue = blue component
DESCRIPTION:
	fill current render target with specified color
SEEALSO:
	rendertarget
EXAMPLE:
---- ENDSECTION:clear
*/
int luaClear(lua_State *pL)				{ return(loader->lua_Function_Clear(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:clipping
FAMILY:
	graphics
SYNTAX:
	clipping(x1, y1, x2, y2)
	x1,y1,x2,y2 = clipping()
PARAM:
	x1 = start point x coordinate
	y1 = start point y coordinate
	x2 = end point x coordinate
	y2 = end point y coordinate
DESCRIPTION:
	Set or return clipping area for current render target.
	Any draw outside specified area, won't be visible.
SEEALSO:
	rendertarget
EXAMPLE:
	-- get clipping area
	local x1, y1, x2, y2 = clipping()

	-- set clipping area
	clipping(10,10,200,200)
---- ENDSECTION:clipping
*/
int luaClipping(lua_State *pL)			{ return(loader->lua_Function_Clipping(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:colormask
FAMILY:
	graphics
SYNTAX:
	colormask(handle, red, green, blue)
PARAM:
	handle = image handle
	red = red component
	green = green component
	blue = blue component
DESCRIPTION:
	Set trasparent color for specified image. Transparent color won't be drawed.
	Default setting can be found in "Project Settings".
SEEALSO:
EXAMPLE:
	local image = loadimage("demo.png")
	colormask(image, 255, 0,255)
---- ENDSECTION:colormask
*/
int luaColorMask(lua_State *pL)			{ return(loader->lua_Function_ColorMask(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:createimage
FAMILY:
	graphics
SYNTAX:
	createimage(handle, width, height)
	handle = createimage(width, height)
PARAM:
	handle = image handle
	width = image width
	height = image height
DESCRIPTION:
	Create an image with specified width and height. You can force creation using
	specified handle or you can let FBA autoassign a new handle. Please be careful while
	you allocate resources, your device's memory is limited.
SEEALSO:
	loadimage
EXAMPLE:
	-- create a new image 100x100 pixels
	local newimage = createimage(100,100)

	-- create a new image 100x100 pixel and force its handle to 0
	createimage(0, 100, 100)
---- ENDSECTION:createimage
*/
int luaCreateImage(lua_State *pL)		{ return(loader->lua_Function_CreateImage(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:destroyimage
FAMILY:
	graphics
SYNTAX:
	destroyimage(handle)
PARAM:
	handle = image handle
DESCRIPTION:
	Destroy image specified by handle and free its used memory.
	If you load an image over an handle already used, FBA will free
	the previous one for you, for example:

	local pic = loadimage("mypic.png")

	-- the following line will free memory used by pic and will
	-- create a new pic handle

	local newpic = loadimage(pic, "mypic.png")

SEEALSO:
createimage
loadimage
EXAMPLE:
---- ENDSECTION:destroyimage
*/
int luaDestroyImage(lua_State *pL)		{ return(loader->lua_Function_DestroyImage(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:drawimage
FAMILY:
	graphics
SYNTAX:
	drawimage(handle, sx, sy)
	drawimage(handle, sx, sy, cx1, cy1, cx2, cy2)
PARAM:
	handle = image handle
	sx = destination draw position x coordinate
	sy = destination draw position y coordinate
	cx1 = source cut rectangle upper left x coordinate
	cy1 = source cut rectangle upper top y coordinate
	cx2 = source cut rectangle lower right x coordinate
	cy2 = source cut rectangle lower right y coordinate
DESCRIPTION:
	Draw an image or a part of an image into current
	render target.
SEEALSO:
EXAMPLE:
	local handle = loadimage("myimage.png")

	-- draw an image at 50,50
	drawimage(handle, 50, 50)

	-- draw a part (0,0,20,20) of specified image on the screen at 50,50
	drawimage(handle, 50, 50, 0, 0, 20, 20)

---- ENDSECTION:drawimage
*/
int luaDrawImage(lua_State *pL)			{ return(loader->lua_Function_DrawImage(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:drawrotateimage
FAMILY:
	graphics
SYNTAX:
	drawrotateimage(handle, x, y, degrees)
PARAM:
	handle = image handle
	x = destination draw position x coordinate
	y = destination draw position y coordinate
	degrees = how much degrees you want to rotate the picture
DESCRIPTION:
	Draw a rotated image into current render target.
	The image is rotated around its center.
SEEALSO:
	rendertarget
EXAMPLE:
	local handle = loadimage("myimage.png")
	drawrotateimage(handle, 50, 50, 90)

---- ENDSECTION:drawrotateimage
*/
int luaDrawRotateImage(lua_State *pL)	{ return(loader->lua_Function_DrawRotateImage(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:drawrotatestretchimage
FAMILY:
	graphics
SYNTAX:
	drawrotatestretchimage(handlesource, handledest,
	  destx, desty, degrees,
	  sx1, sy1, sx2, sy2)
PARAM:
	handlesource = handle of source image to be rotated-stretched
	handledest = handle of destination image where to put rotated image
	destx = destination draw position x coordinate
	desty = destination draw position y coordinate
	degrees = how much degrees you want to rotate the picture
	sx1 = source rectangle x coordinate (upper left corner)
	sy1 = source rectangle y coordinate (upper left corner)
	sx2 = source rectangle x coordinate (bottom right corner)
	sy2 = source rectangle y coordinate (bottom right corner)
DESCRIPTION:
	Stretchs a source rectangle from an image specified
	by handlesource to a destination image specified by handle dest;
	then draw on current target the stretched image at destx, desty,
	rotating it by specified degrees.
SEEALSO:
	createimage
	drawstretchimage
	loadimage
	rendertarget
EXAMPLE:
	local source = loadimage("demo.png")
	local dest = createimage(200,200)

	-- stretch source on dest and draw at 50,200 rotated by 90 degrees
	drawrotatestretchimage(source, dest, 50, 200,
	  90, 0, 0, imagewidth(source)-1, imageheight(source)-1)
---- ENDSECTION:drawrotatestretchimage
*/
int luaDrawRotateStretchImage(lua_State *pL)	{ return(loader->lua_Function_DrawRotateStretchImage(pL)); }
////////////////////////////////


////////////////////////////////
/*
---- STARTSECTION:drawstretchimage
FAMILY:
	graphics
SYNTAX:
	drawstretchimage(handle, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2)
PARAM:
	handle = handle of image to be stretched
	sx1 = source rectangle x coordinate (upper left corner)
	sy1 = source rectangle y coordinate (upper left corner)
	sx2 = source rectangle x coordinate (bottom right corner)
	sy2 = source rectangle y coordinate (bottom right corner)
	dx1 = destination rectangle x coordinate (upper left corner)
	dy1 = destination rectangle y coordinate (upper left corner)
	dx2 = destination rectangle x coordinate (bottom right corner)
	dy2 = destination rectangle y coordinate (bottom right corner)
DESCRIPTION:
	Stretchs a part of image specified by rectangle [sx1, sy1, sx2, sy2]
	and render it on current render target on location specified by
	rectangle [dx1, dy1, dx2, dy2]
SEEALSO:
	createimage
	loadimage
	rendertarget
EXAMPLE:
	local source = loadimage("demo.png")
	-- take source rectangle 0,0,10,10 and stretch it to screen
	-- to 50,50,200,200
	drawstretchimage(source, 0, 0, 10, 10, 50, 50, 200, 200)
---- ENDSECTION:drawstretchimage
*/
int luaDrawStretchImage(lua_State *pL)	{ return(loader->lua_Function_DrawStretchImage(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:fillcircle
FAMILY:
	graphics
SYNTAX:
	fillcircle(x, y, radius, red, green, blue)
PARAM:
	x = circle center x coordinate
	y = circle center y coordinate
	radius = circle radius (in degrees)
	red = red component
	green = green component
	blue = blue component
DESCRIPTION:
	draw a filled circle in current render target in a specified
	position with specified radius, using selected color
SEEALSO:
	circle
	rendertarget
EXAMPLE:
---- ENDSECTION:fillcircle
*/int luaFillCircle(lua_State *pL)		{ return(loader->lua_Function_Circle(pL, true)); }
////////////////////////////////


////////////////////////////////
/*
---- STARTSECTION:fillpoly
FAMILY:
	graphics
SYNTAX:
	fillpoly(red, green, blue [,px, py][,px, py][,px, py]....)
PARAM:
	red = red component
	green = green component
	blue = blue component
	px = next point x coordinate
	py = next point y coordinate
DESCRIPTION:
	draw a filled polygon in current render target. You can
	set two or more points of polygon vertexes.
	This command accept variable arguments.
	You have to specify at least two points.
SEEALSO:
	poly
	rendertarget
EXAMPLE:
	fillpoly(255, 0, 0, 10, 10, 40, 40)
	fillpoly(255, 0, 0, 10, 10, 40, 40, 100, 87, 140, 90)
---- ENDSECTION:fillpoly
*/
int luaFillPoly(lua_State *pL)			{ return(loader->lua_Function_Poly(pL, true)); }
////////////////////////////////


////////////////////////////////
/*
---- STARTSECTION:fillrect
FAMILY:
	graphics
SYNTAX:
	fillrect(x1,y1,x2,y2,red,green,blue)
PARAM:
	red = red component
	green = green component
	blue = blue component
	x1 = x coordinate of upper left corner
	y1 = y coordinate of upper left corner
	x2 = x coordinate of bottom right corner
	y2 = y coordinate of bottom right corner
DESCRIPTION:
	draw a filled rectangle on current render target
	at specified coordinates
SEEALSO:
	rect
	rendertarget
EXAMPLE:
---- ENDSECTION:fillrect
*/
int luaFillRect(lua_State *pL)			{ return(loader->lua_Function_Rect(pL, true)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:getcolor
FAMILY:
	graphics
SYNTAX:
	getcolor(reg, green, blue)
PARAM:
	red = red component
	green = green component
	blue = blue component
DESCRIPTION:
	convert a color specified by red,green,blue components in a FBA
	color. FBA uses 16 bits color in 565 format; this function will
	help you to convert a color to 565 format.
SEEALSO:
	imagecolor
EXAMPLE:
---- ENDSECTION:getcolor
*/
int luaGetColor(lua_State *pL)			{ return(loader->lua_Function_GetColor(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:imagecolor
FAMILY:
	graphics
SYNTAX:
	color = imagecolor(handle, x, y)
	imagecolor(handle, x, y, red, green, blue)
PARAM:
	handle = handle of source image
	x = x coordinate of point
	y = y coordinate of point
	red = red component
	green = green component
	blue = blue component
DESCRIPTION:
	set/get a pixel color to/from specified image
SEEALSO:
	getcolor
EXAMPLE:
	local mypic = loadimage("test.png")

	-- set a red pixel at 100,100
	imagecolor(mypic, 100, 100, 255, 0, 0)

	-- check for pixel color at 100,100
	-- note the use of getcolor to get correct format
	if imagecolor(mypic, 100, 100) == getcolor(255,0,0) then
		debug("Yes! It's red!")
	end
---- ENDSECTION:imagecolor
*/
int luaImageColor(lua_State *pL)		{ return(loader->lua_Function_ImageColor(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:imagewidth
FAMILY:
	graphics
SYNTAX:
	width = imagewidth(handle)
PARAM:
	handle = handle of source image
DESCRIPTION:
	get width of specified image
SEEALSO:
EXAMPLE:
---- ENDSECTION:imagewidth
*/
int luaImageWidth(lua_State *pL)		{ return(loader->lua_Function_ImageWidth(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:imageheight
FAMILY:
	graphics
SYNTAX:
	height = imageheight(handle)
PARAM:
	handle = handle of source image
DESCRIPTION:
	get height of specified image
SEEALSO:
EXAMPLE:
---- ENDSECTION:imageheight
*/
int luaImageHeight(lua_State *pL)		{ return(loader->lua_Function_ImageHeight(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:line
FAMILY:
	graphics
SYNTAX:
	line(x1, y1, x2, y2, red, green, blue)
PARAM:
	x1 = first vertex x coordinate
	y1 = first vertex y coordinate
	x2 = second vertex x coordinate
	y2 = second vertex y coordinate
	red = red component
	green = green component
	blue = blue component
DESCRIPTION:
	draw a line specified by x1,y1 and x2,y2 vertexes, using
	specified color, on current render target.
SEEALSO:
	rendertarget
EXAMPLE:
---- ENDSECTION:line
*/
int luaLine(lua_State *pL)				{ return(loader->lua_Function_Line(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:loadimage
FAMILY:
	graphics
SYNTAX:
	loadimage(handle, resourcename)
	handle = loadimage(resourcename)
PARAM:
	handle = image handle
	resourcename = resource image name
DESCRIPTION:
	Load an image from resources. You can force loading using
	specified handle or you can let FBA autoassign a new handle. Please be careful while
	you load resources, your device's memory is limited.

	Supported formats are: PNG and JPG files.
SEEALSO:
	createimage
EXAMPLE:
	-- load an image from test.png resource
	local newimage = loadimage("test.png")

	-- load an image from test.jpg resource and force its handle to 0
	loadimage(0, "test.jpg")
---- ENDSECTION:loadimage
*/
int luaLoadImage(lua_State *pL)			{ return(loader->lua_Function_LoadImage(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:point
FAMILY:
	graphics
SYNTAX:
	point(x, y, red, green, blue)
PARAM:
	x = point x coordinate
	y = point y coordinate
	red = red component
	green = green component
	blue = blue component
DESCRIPTION:
	draw a point with specified color on current
	render target at specified position.
SEEALSO:
	rendertarget
EXAMPLE:
---- ENDSECTION:point
*/
int luaPoint(lua_State *pL)				{ return(loader->lua_Function_Point(pL)); }
////////////////////////////////


////////////////////////////////
/*
---- STARTSECTION:poly
FAMILY:
	graphics
SYNTAX:
	poly(red, green, blue [,px, py][,px, py][,px, py]....)
PARAM:
	red = red component
	green = green component
	blue = blue component
	px = next point x coordinate
	py = next point y coordinate
DESCRIPTION:
	draw a polygon in current render target. You can
	set two or more points of polygon vertexes.
	This command accept variable arguments.
	You have to specify at least two points.
SEEALSO:
	fillpoly
	rendertarget
EXAMPLE:
	poly(255, 0, 0, 10, 10, 40, 40)
	poly(255, 0, 0, 10, 10, 40, 40, 100, 87, 140, 90)
---- ENDSECTION:poly
*/
int luaPoly(lua_State *pL)				{ return(loader->lua_Function_Poly(pL, false)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:print
FAMILY:
	graphics
SYNTAX:
	print(x, y, text, red, green, blue)
PARAM:
	x = point x coordinate
	y = point y coordinate
	text = string to draw
	red = red component
	green = green component
	blue = blue component
DESCRIPTION:
	draw a text with specified color in specified position
	on current render target. Print uses a small text so
	usually it's used for debugging purposes. You should use
	graphic font or truetype font if you want to draw
	more complex texts.
SEEALSO:
	loadfont
	loadgfxfont
	rendertarget
EXAMPLE:
---- ENDSECTION:print
*/
int luaPrint(lua_State *pL)				{ return(loader->lua_Function_Print(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:rect
FAMILY:
	graphics
SYNTAX:
	rect(x1,y1,x2,y2,red,green,blue)
PARAM:
	red = red component
	green = green component
	blue = blue component
	x1 = x coordinate of upper left corner
	y1 = y coordinate of upper left corner
	x2 = x coordinate of bottom right corner
	y2 = y coordinate of bottom right corner
DESCRIPTION:
	draw a rectangle on current render target
	at specified coordinates
SEEALSO:
	fillrect
	rendertarget
EXAMPLE:
---- ENDSECTION:rect
*/
int luaRect(lua_State *pL)				{ return(loader->lua_Function_Rect(pL, false)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:rendertarget
FAMILY:
	graphics
SYNTAX:
	rendertarget()
	rendertarget(handle)
PARAM:
	handle = handle of image you want to promote as currente render target
DESCRIPTION:
	FBA draws on a "render target". Default render target is the screen.
	This means if you don't call rendertarget, all drawing functions output
	on the screen. You can change this behaviour calling this function.
	You can output all drawing routines on another image (for example
	for creating new images in memory after processing some other).
	If you call it without parameters, it will restore the screen as
	current render target.
SEEALSO:
EXAMPLE:
	-- load an image
	local handle = loadimage("myimage.png")

	-- create a new image and set it as new render target
	local newpic = createimage(50, 50)
	rendertarget(newpic)

	-- draw a rotated image insided the new one
	drawrotateimage(handle, 0, 0, 90)

	-- restore the screen as render target
	rendertarget()

	-- draw on the screen the new created rotated image
	drawimage(newpic, 0, 0)

---- ENDSECTION:rendertarget
*/
int luaRenderTarget(lua_State *pL)		{ return(loader->lua_Function_RenderTarget(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:screenwidth
FAMILY:
	graphics
SYNTAX:
	width = screenwidth()
PARAM:
DESCRIPTION:
	returns the screen width
SEEALSO:
	screenheight
EXAMPLE:
---- ENDSECTION:screenwidth
*/
int luaScreenWidth(lua_State *pL)		{ return(loader->lua_Function_ScreenWidth(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:screenheight
FAMILY:
	graphics
SYNTAX:
	height = screenheight()
PARAM:
DESCRIPTION:
	returns the screen height
SEEALSO:
	screenwidth
EXAMPLE:
---- ENDSECTION:screenheight
*/
int luaScreenHeight(lua_State *pL)		{ return(loader->lua_Function_ScreenHeight(pL)); }
////////////////////////////////

// misc
////////////////////////////////
/*
---- STARTSECTION:getnumiterations
FAMILY:
	misc
SYNTAX:
	count = getnumiterations()
PARAM:
DESCRIPTION:
	FBA increments an internal counter every time it calls the main loop
	function. This functions returns this counter.
SEEALSO:
EXAMPLE:
---- ENDSECTION:getnumiterations
*/
int luaGetnumiterations(lua_State *pL)	{ return(loader->lua_Function_Getnumiterations(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:getmemorystatus
FAMILY:
	misc
SYNTAX:
	value = getmemorystatus(type)
PARAM:
	type = memory info to get. Possible values:
		0 - Total physical memory
		1 - Available physical memory
		2 - Total page file
		3 - Available page file
		4 - Total virtual memory (for the process)
		5 - Available virtual memory (for the process)
		6 - System memory load in percents (0 - 100)
DESCRIPTION:
	Get status of device memory. This functions is useful
	for debugging purposes to know how much memory is using
	your application.
SEEALSO:
EXAMPLE:
---- ENDSECTION:getmemorystatus
*/
int luaGetmemorystatus(lua_State *pL)	{ return(loader->lua_Function_Getmemorystatus(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:getfps
FAMILY:
	misc
SYNTAX:
	numfps = getfps()
PARAM:
DESCRIPTION:
	Get current FPS value (Frames Per Seconds). This is useful just for debugging and shouldn't be never called
	on final releases of your game/application.
SEEALSO:
EXAMPLE:
---- ENDSECTION:getfps
*/
int luaGetfps(lua_State *pL)	{ return(loader->lua_Function_Getfps(pL)); }
////////////////////////////////


////////////////////////////////
/*
---- STARTSECTION:windowfocused
FAMILY:
	misc
SYNTAX:
	focused = windowfocused()
PARAM:
DESCRIPTION:
	Return true or false if FBA main window is currently focused (active).
SEEALSO:
EXAMPLE:
---- ENDSECTION:windowfocused
*/
int luaWindowfocused(lua_State *pL)	{ return(loader->lua_Function_Windowfocused(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:getdate
FAMILY:
	misc
SYNTAX:
	result = getdate("format")
PARAM:
	format = specify which values you need from the current date
DESCRIPTION:
	Retrieves current system date, using specified format to get
	values (minutes, hours etc).
	Valid format values are:
	y = year
	m = month
	d = day
	w = day of week
	h = hour
	n = minute
	s = second
	u = millisecond
SEEALSO:
EXAMPLE:
	result = getdate("d/m/y")
---- ENDSECTION:getdate
*/
int luaGetDate(lua_State *pL)			{ return(loader->lua_Function_GetDate(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:clock
FAMILY:
	misc
SYNTAX:
	clock = clock()
PARAM:
DESCRIPTION:
	Retrieves the number of milliseconds that have elapsed since
	the system (your PC or your pocketPC) was started
SEEALSO:
EXAMPLE:
---- ENDSECTION:clock
*/
int luaGetClock(lua_State *pL)			{ return(loader->lua_Function_GetClock(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:include
FAMILY:
	misc
SYNTAX:
	include(script_name)
PARAM:
	script_name = file name of the script you want to include
DESCRIPTION:
	Includes a FBA script from your project resources.
	The include function takes a file name and simply
	inserts that file's contents into the script that
	calls used the include function.
SEEALSO:
EXAMPLE:

	-- file1: functions.fba
	function mycoolfunction()
		debug("This is my cool function")
	end function

	-- file2: main.fba
	-- executing a function which is inside "functions.fba"

	include("functions.fba")
	mycoolfunction()
---- ENDSECTION:include
*/
int luaIncludeScript(lua_State *pL)		{ return(loader->lua_Function_Include(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:quit
FAMILY:
	misc
SYNTAX:
	quit()
PARAM:
DESCRIPTION:
	Terminate your application
SEEALSO:
EXAMPLE:
---- ENDSECTION:quit
*/
int luaQuit(lua_State *pL)				{ return(loader->lua_Function_Quit(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:debug
FAMILY:
	misc
SYNTAX:
	debug(text)
PARAM:
DESCRIPTION:
	Output some text on debug console. Debug console is visible
	at the bottom of FBA editor when you are debugging your application.
	Of course this command is not useful when you're executing your
	application on pocketpc.
SEEALSO:
EXAMPLE:
---- ENDSECTION:debug
*/
int luaDebugSocket(lua_State *pL)		{ return(loader->lua_Function_DebugSocket(pL)); }
////////////////////////////////

// controls
////////////////////////////////
/*
---- STARTSECTION:numkeypress
FAMILY:
	controls
SYNTAX:
	numpress = numkeypress(keycode)
PARAM:
	keycode = keycode to check
DESCRIPTION:
	When you press a key on your keyboard or on your pocketpc, FBA increments
	a counter every time it calls the main loop function.
	You can use this function to check how many steps elapsed since you pressed
	a key. If you aren't pressing a key, this returns 0.

	FBA has also some useful functions that return you the keycode of
	common used keys.
SEEALSO:
	keyleft
	keyright
	keyup
	keydown
	keyfire1
	keyfire2
	keyfire3
EXAMPLE:
	-- check if you're pressing the down key
	if numkeypress( keydown() ) > 0 then
		debug("Down is pressed!")
	end
---- ENDSECTION:numkeypress
*/
int luaNumKeypress(lua_State *pL)		{ return(loader->lua_Function_NumKeypress(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:keyleft
FAMILY:
	controls
SYNTAX:
	keycode = keyleft()
PARAM:
DESCRIPTION:
	Returns the keycode of left key (usually used with numkeypress)
	This is left arrow on your PC and left pad on your PocketPC.
SEEALSO:
	numkeypress
EXAMPLE:
---- ENDSECTION:keyleft
*/
int luaKeyLeft(lua_State *pL)			{ return(loader->lua_Function_KeyLeft(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:keyright
FAMILY:
	controls
SYNTAX:
	keycode = keyright()
PARAM:
DESCRIPTION:
	Returns the keycode of right key (usually used with numkeypress)
	This is right arrow on your PC and right pad on your PocketPC.
SEEALSO:
	numkeypress
EXAMPLE:
---- ENDSECTION:keyright
*/
int luaKeyRight(lua_State *pL)			{ return(loader->lua_Function_KeyRight(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:keydown
FAMILY:
	controls
SYNTAX:
	keycode = keydown()
PARAM:
DESCRIPTION:
	Returns the keycode of down key (usually used with numkeypress)
	This is down arrow on your PC and down pad on your PocketPC.
SEEALSO:
	numkeypress
EXAMPLE:
---- ENDSECTION:keydown
*/
int luaKeyDown(lua_State *pL)			{ return(loader->lua_Function_KeyDown(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:keyup
FAMILY:
	controls
SYNTAX:
	keycode = keyup()
PARAM:
DESCRIPTION:
	Returns the keycode of up key (usually used with numkeypress)
	This is up arrow on your PC and up pad on your PocketPC.
SEEALSO:
	numkeypress
EXAMPLE:
---- ENDSECTION:keyup
*/
int luaKeyUp(lua_State *pL)				{ return(loader->lua_Function_KeyUp(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:keyfire1
FAMILY:
	controls
SYNTAX:
	keycode = keyfire1()
PARAM:
DESCRIPTION:
	Returns the keycode of FIRE1 key (usually used with numkeypress)
	This is one of the hardware keys of your PocketPC (this depends from your
	device) and the SPACE key on your PC.
SEEALSO:
	numkeypress
EXAMPLE:
---- ENDSECTION:keyfire1
*/
int luaKeyFire1(lua_State *pL)			{ return(loader->lua_Function_KeyFire1(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:keyfire2
FAMILY:
	controls
SYNTAX:
	keycode = keyfire2()
PARAM:
DESCRIPTION:
	Returns the keycode of FIRE2 key (usually used with numkeypress)
	This is one of the hardware keys of your PocketPC (this depends from your
	device) and the left CTRL key on your PC.
SEEALSO:
	numkeypress
EXAMPLE:
---- ENDSECTION:keyfire2
*/
int luaKeyFire2(lua_State *pL)			{ return(loader->lua_Function_KeyFire2(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:keyfire3
FAMILY:
	controls
SYNTAX:
	keycode = keyfire3()
PARAM:
DESCRIPTION:
	Returns the keycode of FIRE3 key (usually used with numkeypress)
	This is one of the hardware keys of your PocketPC (this depends from your
	device) and the left SHIFT key on your PC.
SEEALSO:
	numkeypress
EXAMPLE:
---- ENDSECTION:keyfire3
*/
int luaKeyFire3(lua_State *pL)			{ return(loader->lua_Function_KeyFire3(pL)); }
////////////////////////////////


////////////////////////////////
/*
---- STARTSECTION:mousedown
FAMILY:
	controls
SYNTAX:
	downcount = mousedown()
PARAM:
DESCRIPTION:
	Returns how many steps elapsed since you pressed your
	mouse (or stylus) on the screen. Returns 0 if it isn't pressed.
SEEALSO:
EXAMPLE:
---- ENDSECTION:mousedown
*/
int luaMouseDown(lua_State *pL)			{ return(loader->lua_Function_MouseDown(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:mousex
FAMILY:
	controls
SYNTAX:
	x = mousex()
PARAM:
DESCRIPTION:
	Return x coordinate position of your mouse/stylus.
	Note: on pocketpc the stylus-move event occurs only when you press
	your stylus on the screen, so when you release the mouse from the
	screen/device, this function will return -1 until you click again
	your stylus/mouse.
SEEALSO:
	mousey
EXAMPLE:
---- ENDSECTION:mousex
*/
int luaMouseX(lua_State *pL)			{ return(loader->lua_Function_MouseX(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:mousey
FAMILY:
	controls
SYNTAX:
	y = mousey()
PARAM:
DESCRIPTION:
	Return y coordinate position of your mouse/stylus.
	Note: on pocketpc the stylus-move event occurs only when you press
	your stylus on the screen, so when you release the mouse from the
	screen/device, this function will return -1 until you click again
	your stylus/mouse.
SEEALSO:
	mousex
EXAMPLE:
---- ENDSECTION:mousey
*/
int luaMouseY(lua_State *pL)			{ return(loader->lua_Function_MouseY(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:mousein
FAMILY:
	controls
SYNTAX:
	inside = mousein(x1, y1, x2, y2)
PARAM:
	x1 = x coordinate of upper left corner
	y1 = y coordinate of upper left corner
	x2 = x coordinate of lower right corner
	y2 = y coordinate of lower right corner
DESCRIPTION:
	Returns if mouse/stylus is inside specified zone on the screen.
SEEALSO:
EXAMPLE:
---- ENDSECTION:mousein
*/
int luaMouseIn(lua_State *pL)			{ return(loader->lua_Function_MouseIn(pL)); }
////////////////////////////////

// sounds
#ifdef ENABLE_AUDIO

////////////////////////////////
/*
---- STARTSECTION:destroysound
FAMILY:
	sounds
SYNTAX:
	destroysound(handle)
PARAM:
	handle = handle of sound to destroy
DESCRIPTION:
	Destroy a sound previously loaded and free allocated memory.
SEEALSO:
EXAMPLE:
---- ENDSECTION:destroysound
*/
int luaDestroySound(lua_State *pL)		{ return(loader->lua_Function_DestroySound(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:destroymusic
FAMILY:
	sounds
SYNTAX:
	destroymusic(handle)
PARAM:
	handle = handle of music to destroy
DESCRIPTION:
	Destroy a music previously loaded and free allocated memory.
SEEALSO:
EXAMPLE:
---- ENDSECTION:destroymusic
*/
int luaDestroyMusic(lua_State *pL)		{ return(loader->lua_Function_DestroyMusic(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:loadsound
FAMILY:
	sounds
SYNTAX:
	handle = loadsound(filename)
	loadsound(handle, filename)
PARAM:
	handle = handle of sound
DESCRIPTION:
	Load a sound from resources. You can force loading using
	specified handle or you can let FBA autoassign a new handle. Please be careful while
	you load resources, your device's memory is limited.

	Supported sounds formats:
	8, 16 uncompressed and Microsoft ADPCM compressed mono/stereo WAVs.
SEEALSO:
EXAMPLE:
	handle = loadsound("explosion.wav")
---- ENDSECTION:loadsound
*/
int luaLoadSound(lua_State *pL)			{ return(loader->lua_Function_LoadSound(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:loadmusic
FAMILY:
	sounds
SYNTAX:
	handle = loadmusic(filename)
	loadmusic(handle, filename)
PARAM:
	handle = handle of music
DESCRIPTION:
	Load a music from resources. You can force loading using
	specified handle or you can let FBA autoassign a new handle. Please be careful while
	you load resources, your device's memory is limited.

	Supported music formats:
	MOD protracker files
SEEALSO:
EXAMPLE:
	handle = loadmusic("intro.mod")
---- ENDSECTION:loadmusic
*/
int luaLoadMusic(lua_State *pL)			{ return(loader->lua_Function_LoadMusic(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:playsound
FAMILY:
	sounds
SYNTAX:
	playsound(handle)
	playsound(handle, loop)
PARAM:
	handle = handle of sound
	loop = infinite loop the playing sound
DESCRIPTION:
	Play a loaded sound. You can specify "loop=true" if you want
	to play the sound in an infinite loop.
SEEALSO:
EXAMPLE:
---- ENDSECTION:playsound
*/
int luaPlaySound(lua_State *pL)			{ return(loader->lua_Function_PlaySound(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:playmusic
FAMILY:
	sounds
SYNTAX:
	playmusic(handle)
	playmusic(handle, loop)
PARAM:
	handle = handle of music
	loop = infinite loop the playing sound
DESCRIPTION:
	Play a loaded music. You can specify "loop=true" if you want
	to play the music in an infinite loop.
SEEALSO:
EXAMPLE:
---- ENDSECTION:playmusic
*/
int luaPlayMusic(lua_State *pL)			{ return(loader->lua_Function_PlayMusic(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:pausesound
FAMILY:
	sounds
SYNTAX:
	pausesound(handle)
PARAM:
	handle = handle of sound
DESCRIPTION:
	Pause specified sound. This is ignored if sound is not playing.
SEEALSO:
EXAMPLE:
---- ENDSECTION:pausesound
*/
int luaPauseSound(lua_State *pL)		{ return(loader->lua_Function_PauseSound(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:resumesound
FAMILY:
	sounds
SYNTAX:
	resumesound(handle)
PARAM:
	handle = handle of sound
DESCRIPTION:
	Resume playing of a previously paused sound.
SEEALSO:
EXAMPLE:
---- ENDSECTION:resumesound
*/
int luaResumeSound(lua_State *pL)		{ return(loader->lua_Function_ResumeSound(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:pausemusic
FAMILY:
	sounds
SYNTAX:
	pausemusic(handle)
PARAM:
	handle = handle of music
DESCRIPTION:
	Pause specified music. This is ignored if music is not playing.
SEEALSO:
EXAMPLE:
---- ENDSECTION:pausemusic
*/
int luaPauseMusic(lua_State *pL)		{ return(loader->lua_Function_PauseMusic(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:resumemusic
FAMILY:
	sounds
SYNTAX:
	resumemusic(handle)
PARAM:
	handle = handle of music
DESCRIPTION:
	Resume playing of a previously paused music.
SEEALSO:
EXAMPLE:
---- ENDSECTION:resumemusic
*/
int luaResumeMusic(lua_State *pL)		{ return(loader->lua_Function_ResumeMusic(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:stopmusic
FAMILY:
	sounds
SYNTAX:
	stopmusic(handle)
PARAM:
	handle = handle of music
DESCRIPTION:
	Stop playing of a music.
SEEALSO:
EXAMPLE:
---- ENDSECTION:stopmusic
*/
int luaStopMusic(lua_State *pL)			{ return(loader->lua_Function_StopMusic(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:stopsound
FAMILY:
	sounds
SYNTAX:
	stopsound(handle)
PARAM:
	handle = handle of sound
DESCRIPTION:
	Stop playing of a sound.
SEEALSO:
EXAMPLE:
---- ENDSECTION:stopsound
*/
int luaStopSound(lua_State *pL)			{ return(loader->lua_Function_StopSound(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:musicvolume
FAMILY:
	sounds
SYNTAX:
	volume = musicvolume(handle)
	musicvolume(handle, volume)
PARAM:
	handle = handle of music
	volume = volume of music
DESCRIPTION:
	Set or get volume of specified music.
	Valid values for volume are from 0 (silence) to 64 (highest volume)
SEEALSO:
EXAMPLE:
---- ENDSECTION:musicvolume
*/
int luaMusicVolume(lua_State *pL)		{ return(loader->lua_Function_MusicVolume(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:soundvolume
FAMILY:
	sounds
SYNTAX:
	volume = soundvolume(handle)
	soundvolume(handle, volume)
PARAM:
	handle = handle of sound
	volume = volume of sound
DESCRIPTION:
	Set or get volume of specified sound.
	Valid values for volume are from 0 (silence) to 64 (highest volume)
SEEALSO:
EXAMPLE:
---- ENDSECTION:soundvolume
*/
int luaSoundVolume(lua_State *pL)		{ return(loader->lua_Function_SoundVolume(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:stopallsounds
FAMILY:
	sounds
SYNTAX:
	stopallsounds()
PARAM:
DESCRIPTION:
	Stop all playing sounds.
SEEALSO:
EXAMPLE:
---- ENDSECTION:stopallsounds
*/
int luaStopAllSounds(lua_State *pL)		{ return(loader->lua_Function_StopAllSounds(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:stopallmusics
FAMILY:
	sounds
SYNTAX:
	stopallmusics()
PARAM:
DESCRIPTION:
	Stop all playing musics.
SEEALSO:
EXAMPLE:
---- ENDSECTION:stopallmusics
*/
int luaStopAllMusics(lua_State *pL)		{ return(loader->lua_Function_StopAllMusics(pL)); }
////////////////////////////////

#endif


// config files
////////////////////////////////
/*
---- STARTSECTION:openconfig
FAMILY:
	config. files
SYNTAX:
	openconfig(filename)
	openconfig(filename, cryptkey)
PARAM:
	filename = name of file to open
	cryptkey = optional crypt key from 1 to 255
DESCRIPTION:
	Open a configuration file for your application.
	Configuration files are usually used for storing useful data
	or settings for your application.

	Configurations files are similar to well-known .ini files
	of Windows system.

	You can save strings and numbers in your config. file.

	FBA allow you to keep opened just one configuration file at time.
	If you open a config.file while another one was already opened,
	FBA will automatically close (and save) the previous one.
SEEALSO:
	openconfigext
	closeconfig
EXAMPLE:
	-- open file "myconfig" for read/write values
	openconfig("myconfig")
---- ENDSECTION:openconfig
*/
int luaOpenconfig(lua_State *pL)		{ return(loader->lua_Function_Openconfig(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:openconfigext
FAMILY:
	config. files
SYNTAX:
	openconfigext(filename)
	openconfigext(filename, cryptkey)
PARAM:
	filename = name of file to open
	cryptkey = optional crypt key from 1 to 255
DESCRIPTION:
	Open a configuration file for your application from
	your external resources instead of using an internal one.
	(see Ext.Resources in your project explorer).

	Configuration files are usually used for storing useful data
	or settings for your application.

	Configurations files are similar to well-known .ini files
	of Windows system.

	You can save strings and numbers in your config. file.

	FBA allow you to keep opened just one configuration file at time.
	If you open a config.file while another one was already opened,
	FBA will automatically close (and save) the previous one.
SEEALSO:
	openconfig
	closeconfig
EXAMPLE:
	-- open file "myconfig" for read/write values
	openconfigext("myconfig")
---- ENDSECTION:openconfigext
*/
int luaOpenconfigExt(lua_State *pL)		{ return(loader->lua_Function_OpenconfigExt(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:closeconfig
FAMILY:
	config. files
SYNTAX:
	closeconfig()
PARAM:
DESCRIPTION:
	Close and save a previously opened configuration file.
SEEALSO:
	openconfig
	openconfigext
EXAMPLE:
---- ENDSECTION:closeconfig
*/
int luaCloseconfig(lua_State *pL)		{ return(loader->lua_Function_Closeconfig(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:writeconfignumber
FAMILY:
	config. files
SYNTAX:
	writeconfignumber(section, key, value)
PARAM:
	section = section name
	key = key name
	value = value to save
DESCRIPTION:
	Write a number into a previously opened configuration file.
SEEALSO:
	readconfignumber
EXAMPLE:
	openconfig("myconfig")
	writeconfignumber("options", "level", 56)
	closeconfig()

	-- This creates a file "myconfig" with following struct:
	-- [options]
	-- level = 50
---- ENDSECTION:writeconfignumber
*/
int luaWriteconfignumber(lua_State *pL)	{ return(loader->lua_Function_Writeconfignumber(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:writeconfigstring
FAMILY:
	config. files
SYNTAX:
	writeconfigstring(section, key, value)
PARAM:
	section = section name
	key = key name
	value = value to save
DESCRIPTION:
	Write a string into a previously opened configuration file.
SEEALSO:
	readconfigstring
EXAMPLE:
	openconfig("myconfig")
	writeconfigstring("options", "name", "John Red")
	closeconfig()

	-- This creates a file "myconfig" with following struct:
	-- [options]
	-- name = "John Red"
---- ENDSECTION:writeconfigstring
*/
int luaWriteconfigstring(lua_State *pL)	{ return(loader->lua_Function_Writeconfigstring(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:readconfignumber
FAMILY:
	config. files
SYNTAX:
	value = readconfignumber(section, key, default)
PARAM:
	section = section name
	key = key name
	default = default value to use if setting isn't in the file yet
DESCRIPTION:
	Read a number from a previously opened configuration file.
	If setting is not found in the file, this will return
	the default value you specified.
SEEALSO:
	writeconfignumber
EXAMPLE:
	openconfig("myconfig")
	value = readconfignumber("options", "level", 1)
	closeconfig()
---- ENDSECTION:readconfignumber
*/
int luaReadconfignumber(lua_State *pL)	{ return(loader->lua_Function_Readconfignumber(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:readconfigstring
FAMILY:
	config. files
SYNTAX:
	value = readconfigstring(section, key, default)
PARAM:
	section = section name
	key = key name
	default = default value to use if setting isn't in the file yet
DESCRIPTION:
	Read a string from a previously opened configuration file.
	If setting is not found in the file, this will return
	the default value you specified.
SEEALSO:
	writeconfigstring
EXAMPLE:
	openconfig("myconfig")
	value = readconfigstring("options", "name", "Default Player")
	closeconfig()
---- ENDSECTION:readconfigstring
*/
int luaReadconfigstring(lua_State *pL)	{ return(loader->lua_Function_Readconfigstring(pL)); }
////////////////////////////////


// Gamegrids
#ifdef ENABLE_GAMEGRID
////////////////////////////////
/*
---- STARTSECTION:creategrid
FAMILY:
	grids
SYNTAX:
	handle = creategrid(imagehandle, cols, rows, cellwidth, cellheight)
PARAM:
	imagehandle = image to use as source for grid drawing
	cols = number of grid columns
	rows = number of grid rows
	cellwidth = width of grid cell in pixels
	cellheight = height of grid cell in pixels
DESCRIPTION:
	Create a grid. A grid is a 2d matrix usually used to create
	tiled worlds. A grid is composed by several cells, each cell
	is called "tile". With this command FBA allocates memory for
	storing a world of [cols x rows] tiles.

	Grids are widely used by platform games to draw big maps.

	After you create a grid, you can specify which tile index
	you want to draw inside each cell; then you should call
	drawgrid to render full grid on the screen.
	By default FBA fills entire grid with tiles of index -1. (no tile)

	Images used by grids, are simple images files which has one or
	more tiles inside them placed horizontally.

	For example if your grid's cells are 30x30 pixel and you want to use
	an image with 5 tiles, this picture should be 150x30 pixels.

	First tile will be in the zone [0,0,30,30], second tile will be
	in the zone [30, 0, 60, 30] and so on..
	First tile has index 0.

	See tutorials for more info.
SEEALSO:
EXAMPLE:
	-- creates a grid of 50x50 cells of 30x30 pixels
	local image = loadimage("tiles.png")
	local grid = creategrid(image, 50, 50, 30, 30)
---- ENDSECTION:creategrid
*/
int luaCreateGrid(lua_State *pL)	{ return(loader->lua_Function_CreateGrid(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:destroygrid
FAMILY:
	grids
SYNTAX:
	destroygrid(handle)
PARAM:
	handle = handle of the grid
DESCRIPTION:
	Destroy a grid previously created and free memory allocated.
	Note: this command destroy just the grid object; instead
	the image used by grid, won't be destroyed.
SEEALSO:
EXAMPLE:
---- ENDSECTION:destroygrid
*/
int luaDestroyGrid(lua_State *pL)	{ return(loader->lua_Function_DestroyGrid(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:fillgrid
FAMILY:
	grids
SYNTAX:
	fillgrid(handle,tile)
	fillgrid(handle,tile,x1,y1,x2,y2)
PARAM:
	handle = handle of the grid
	tile = tile index used to fill the grid
	x1 = upper left x cell of the zone containing cells to be filled
	y1 = upper left y cell of the zone containing cells to be filled
	x2 = lower right x cell of the zone containing cells to be filled
	y2 = lower right y cell of the zone containing cells to be filled
DESCRIPTION:
	Fill a grid or a part of it with same tile index.
	If you won't pass the range to be filled, FBA will fill all cells.
	Note: cells with index -1, won't be rendered.
SEEALSO:
EXAMPLE:
---- ENDSECTION:fillgrid
*/
int luaFillGrid(lua_State *pL)		{ return(loader->lua_Function_FillGrid(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:gridcell
FAMILY:
	grids
SYNTAX:
	gridcell(handle,col,row,tile)
	tile=gridcell(handle,col,row)
PARAM:
	handle = handle of the grid
	col = column of the cell
	row = row of the cell
	tile = tile index in the cell
DESCRIPTION:
	Set or get a single cell tile index.
	Note: if you set cells with index -1, they won't be rendered.
SEEALSO:
EXAMPLE:
---- ENDSECTION:gridcell
*/
int luaGridCell(lua_State *pL)	{ return(loader->lua_Function_GridCell(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:drawgrid
FAMILY:
	grids
SYNTAX:
	drawgrid(handle,x,y,width,height)
PARAM:
	handle = handle of the grid
	x = start x coordinate where to draw the grid
	y = start y coordinate where to draw the grid
	width = width of the area to draw with the grid
	height = height of the area to draw with the grid
DESCRIPTION:
	Draw a grid to the screen at specified position,
	using width and height as clip area for drawing.
	Note: cells with index -1, won't be rendered.
SEEALSO:
	screenwidth
	screenheight
EXAMPLE:
	-- draw the grid on the entire screen
	drawgrid(grid, 0, 0, screenwidth()-1, screenheight()-1)
---- ENDSECTION:drawgrid
*/
int luaDrawGrid(lua_State *pL)		{ return(loader->lua_Function_DrawGrid(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:gridworldx
FAMILY:
	grids
SYNTAX:
	x=gridworldx(handle)
	gridworldx(handle,x)
PARAM:
	handle = handle of the grid
	x = x coordinate of the world inside the grid. This is
	  the scroll coordinate of the grid, from which FBA
	  will draw the grid.
DESCRIPTION:
	Get or set the X coordinate for the world inside the grid.
SEEALSO:
	gridworldy
EXAMPLE:
	-- scroll the world one pixel right
	gridworldx( gridworldx() + 1)
---- ENDSECTION:gridworldx
*/
int luaGridWorldX(lua_State *pL)	{ return(loader->lua_Function_GridWorldX(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:gridworldy
FAMILY:
	grids
SYNTAX:
	y=gridworldy(handle)
	gridworldy(handle,y)
PARAM:
	handle = handle of the grid
	y = y coordinate of the world inside the grid. This is
	  the scroll coordinate of the grid, from which FBA
	  will draw the grid.
DESCRIPTION:
	Get or set the Y coordinate for the world inside the grid.
SEEALSO:
	gridworldy
EXAMPLE:
	-- scroll the world one pixel up
	gridworldy( gridworldy() - 1)
---- ENDSECTION:gridworldy
*/
int luaGridWorldY(lua_State *pL)	{ return(loader->lua_Function_GridWorldY(pL)); }
////////////////////////////////

#endif

// ttf fonts
#ifdef ENABLE_TTF_EXTENSION

////////////////////////////////
/*
---- STARTSECTION:loadfont
FAMILY:
	truetype fonts
SYNTAX:
	handle=loadfont(name)
	loadfont(handle, name)
PARAM:
	name = name of the TTF truetype file inside your project resources
	handle = handle of the font
DESCRIPTION:
	This command loads a truetype font from your project resources.
	You can force the handle on which you want to load the font or let
	FBA autoassign it.
SEEALSO:
EXAMPLE:
	-- load a font
	handle=loadfont("tahoma.ttf")
---- ENDSECTION:loadfont
*/
int luaLoadFont(lua_State *pL)		{ return(loader->lua_Function_LoadFont(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:setfont
FAMILY:
	truetype fonts
SYNTAX:
	setfont(handle, size, red, green, blue)
PARAM:
	handle = handle of the font
	size = size of the font in pixels
	red = red component of font color
	green = green component of font color
	blue = blue component of font color
DESCRIPTION:
	Set size and color for the specified font.
SEEALSO:
EXAMPLE:
	-- load a font
	handle=loadfont("tahoma.ttf")
	-- set size and color
	setfont(handle, 18, 255, 0, 0)
---- ENDSECTION:setfont
*/
int luaSetFont(lua_State *pL)		{ return(loader->lua_Function_SetFont(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:drawtext
FAMILY:
	truetype fonts
SYNTAX:
	drawtext(handle, x, y, text)
PARAM:
	handle = handle of the font
	x = x coordinate where to draw text
	y = y coordinate where to draw text
	text = text to draw
DESCRIPTION:
	Draw a text on the screen using specified font.
SEEALSO:
	setfont
EXAMPLE:
---- ENDSECTION:drawtext
*/
int luaDrawText(lua_State *pL)		{ return(loader->lua_Function_DrawText(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:textwidth
FAMILY:
	truetype fonts
SYNTAX:
	textwidth(handle, text)
PARAM:
	handle = handle of the font
	text = string to measure using current font settings
DESCRIPTION:
	Get width of TTF text string, using specified font settings.
SEEALSO:
	setfont
EXAMPLE:
---- ENDSECTION:textwidth
*/
int luaTextWidth(lua_State *pL)		{ return(loader->lua_Function_TextWidth(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:destroyfont
FAMILY:
	truetype fonts
SYNTAX:
	destroyfont(handle)
PARAM:
	handle = handle of the font
DESCRIPTION:
	Destroy a loaded font and free its allocated memory.
SEEALSO:
	loadfont
EXAMPLE:
---- ENDSECTION:destroyfont
*/
int luaDestroyFont(lua_State *pL)	{ return(loader->lua_Function_DestroyFont(pL)); }
////////////////////////////////

#endif

// gfx fonts
////////////////////////////////
/*
---- STARTSECTION:loadgfxfont
FAMILY:
	gfx fonts
SYNTAX:
	handle=loadgfxfont(image, charslist, space)
PARAM:
	image = handle of image to use for font drawing
	charslist = a string with list of chars in the image
	space = space between chars (in pixels)
DESCRIPTION:
	Load a graphical font using specified image.
	The image have to be in gfx-font format, with first line
	as chars delimiters.
	See tutorials for more info.
SEEALSO:
	drawgfxtext
	destroygfxfont
	loadimage
EXAMPLE:
	-- load font image
	local image = loadimage("myfont.png")
	-- create graphical font
	local font = loadgfxfont(image, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 8)
---- ENDSECTION:loadgfxfont
*/
int luaLoadGfxFont(lua_State *pL)	{ return(loader->lua_Function_LoadGfxFont(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:drawgfxtext
FAMILY:
	gfx fonts
SYNTAX:
	drawgfxtext(handle,x,y,text,red,green,blue)
	drawgfxtext(handle,x,y,text)
PARAM:
	handle = handle of gfx font
	x = x coordinate of text to draw
	y = y coordinate of text to draw
	red = red component of font color to draw
	green = green component of font color to draw
	blue = blue component of font color to draw
DESCRIPTION:
	Draw a colored text using a previously loaded gfx-font.
	If you omit "red,green,blue" parameters, the text will be cut directly
	from strip as-is, without applying any color (used for graphical fonts).
	See fonts tutorials for more info.
SEEALSO:
	loadgfxfont
	destroygfxfont
EXAMPLE:
	-- load font image
	local image = loadimage("myfont.png")
	-- create graphical font
	local font = loadgfxfont(image, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 8)
	-- draw text
	drawgfxtext(font, 10, 10, "TEST", 255, 0, 0)
---- ENDSECTION:drawgfxtext
*/
int luaDrawGfxText(lua_State *pL)	{ return(loader->lua_Function_DrawGfxText(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:gfxtextwidth
FAMILY:
	gfx fonts
SYNTAX:
	width = gfxtextwidth(handle, text)
PARAM:
	handle = handle of gfx font
	text = string to measure
DESCRIPTION:
	Get width (in pixels) of a string, using specified gfx font.
SEEALSO:
EXAMPLE:
---- ENDSECTION:gfxtextwidth
*/
int luaGfxTextWidth(lua_State *pL){ return(loader->lua_Function_GfxTextWidth(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:destroygfxfont
FAMILY:
	gfx fonts
SYNTAX:
	destroygfxfont(handle)
PARAM:
	handle = handle of gfx font
DESCRIPTION:
	Destroy a gfx font previously loaded.
	Note: the image used by that font, won't be destroyed.
SEEALSO:
	loadgfxfont
EXAMPLE:
---- ENDSECTION:destroygfxfont
*/
int luaDestroyGfxFont(lua_State *pL){ return(loader->lua_Function_DestroyGfxFont(pL)); }
////////////////////////////////

// resources
////////////////////////////////
/*
---- STARTSECTION:openres
FAMILY:
	binary resources
SYNTAX:
	len=openres(name)
	len=openres(name,parselines)
PARAM:
	name=name of resource file inside your project resources
	parselines=if true, tell FBA to parse the file and split it in lines,
	  then you will be able to get each line with getresline
DESCRIPTION:
	Open a file from your project resources files and allocates
	memory for its buffer.
	You can specify "parselines" if you want to parse the file
	and split it in lines; in this way you will be able to get
	each line with getresline.
	This function returns length of opened resource.
	You can have just only one resource file opened at once.
	See tutorial for more info.
SEEALSO:
	openresext
	getres
	getresline
EXAMPLE:
	-- open file
	openres("myfile.txt", true)
	-- print first line
	debug( getresline(0) )
---- ENDSECTION:openres
*/
int luaOpenRes(lua_State *pL)		{ return(loader->lua_Function_OpenRes(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:openresext
FAMILY:
	binary resources
SYNTAX:
	len=openresext(name)
	len=openresext(name,parselines)
PARAM:
	name=name of resource file inside your project resources (external resources)
	parselines=if true, tell FBA to parse the file and split it in lines,
	  then you will be able to get each line with getresline
DESCRIPTION:
	Open a file from your project external resources files and allocates
	memory for its buffer.
	You can specify "parselines" if you want to parse the file
	and split it in lines; in this way you will be able to get
	each line with getresline.
	This function returns length of opened resource.
	You can have just only one resource file opened at once.
	See tutorial for more info.
SEEALSO:
	openres
	getres
	getresline
EXAMPLE:
	-- open file
	openres("myfile.txt", true)
	-- print first line
	debug( getresline(0) )
---- ENDSECTION:openresext
*/
int luaOpenResExt(lua_State *pL)		{ return(loader->lua_Function_OpenResExt(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:getres
FAMILY:
	binary resources
SYNTAX:
	string=getres()
	string=getres(from, to)
PARAM:
	from = start range of binary data to extract
	to = end range of binary data to extract
DESCRIPTION:
	Extract a binary string from previously opened resource file.
	If you don't specify [from, to] range, FBA will get entire resource.
SEEALSO:
	openres
	getresline
EXAMPLE:
	-- open file
	openres("myfile.txt")
	-- get from byte 5 to byte 10
	debug( getres(4, 9) )
---- ENDSECTION:getres
*/
int luaGetRes(lua_State *pL)		{ return(loader->lua_Function_GetRes(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:getresline
FAMILY:
	binary resources
SYNTAX:
	string=getresline()
	string=getresline(lineindex)
PARAM:
	line = extract specified line index from previously opened resource file
DESCRIPTION:
	Extract specified binary line from previously opened resource file.
	You have to open resource file with "parseline" parameter, in order
	to correctly get lines with getresline.

	If you don't specify line FBA will return total number of lines
	of opened resource.

	First line has index 0.
SEEALSO:
	openres
	openresext
	closeres
	getres
EXAMPLE:
	-- open file with parseline parameter
	openres("myfile.txt", true)
	-- print all lines
	for a=0, getresline() do
		debug(getresline(a))
	end
	closeres()
---- ENDSECTION:getresline
*/
int luaGetResLine(lua_State *pL)	{ return(loader->lua_Function_GetResLine(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:closeres
FAMILY:
	binary resources
SYNTAX:
	closeres()
PARAM:
DESCRIPTION:
	Close previously opened resource file and free its allocated memory.
SEEALSO:
	openres
	openresext
	getres
	getresline
EXAMPLE:
---- ENDSECTION:closeres
*/
int luaCloseRes(lua_State *pL)		{ return(loader->lua_Function_CloseRes(pL)); }
////////////////////////////////

// filesystem
////////////////////////////////
/*
---- STARTSECTION:openfile
FAMILY:
	binary files
SYNTAX:
	handle=openfile(filename,mode,[get_from_ext_resources])
PARAM:
	filename = name of file to open
	mode = define if you want to open file for reading or writing
	get_from_ext_resources = open file from external resources (false = default)
DESCRIPTION:
	Open a binary file inside the folder of your project or from
	your external resources.
	You can use binary files to store or read all data you need.
	Use mode "write" if you want to open the file for writing or
	"read" if you want to read from file.

	Normal open (get_from_ext_resources = false):
	FBA stores binary files inside a folder of your project, in this
	way you can safely read/write/delete files from filesystem because
	each FBA project can access only its files.

	Resources open (get_from_ext_resources = true):
	FBA open a file from your resources. In this case, the file you're trying
	to open must exists and must be added in your external resources list.
SEEALSO:
	closefile
	deletefile
	fileexists
	readfile
	writefile
EXAMPLE:
---- ENDSECTION:openfile
*/
int luaOpenFile(lua_State *pL)		{ return(loader->lua_Function_OpenFile(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:writefile
FAMILY:
	binary files
SYNTAX:
	writefile(handle,string)
PARAM:
	handle = opened file handle
	string = string to write in the file
DESCRIPTION:
	Write a binary string in specified binary file.
	The file must be opened in "write" mode.
SEEALSO:
	openfile
	readfile
EXAMPLE:
---- ENDSECTION:writefile
*/
int luaWriteFile(lua_State *pL)		{ return(loader->lua_Function_WriteFile(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:readfile
FAMILY:
	binary files
SYNTAX:
	data = readfile(handle,numchars)
PARAM:
	handle = opened file handle
	numchars = how many bytes you want to read from file
DESCRIPTION:
	Read a binary string from specified binary file.
	You must specify how much bytes you want to read from file.
	The file must be opened in "read" mode.
SEEALSO:
	openfile
	writefile
EXAMPLE:
---- ENDSECTION:readfile
*/
int luaReadFile(lua_State *pL)		{ return(loader->lua_Function_ReadFile(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:posfile
FAMILY:
	binary files
SYNTAX:
	current_position = posfile(handle)
	posfile(handle, offset, origin)
PARAM:
	handle = opened file handle
	offset = number of bytes to offset from origin
	origin = Position from where offset is added. It can be:
		s - beginning of file
		c - current position of the file pointer
		e - end of file
DESCRIPTION:
	Sets or gets the position indicator associated with the file specified by handle.

	* current_position = posfile(handle)
	It gets current position indicator.

	* posfile(handle, offset, origin)
	It sets to a new position defined by adding offset to a reference position specified by origin.
	On streams open for update (write), a call to posfile allows to switch
	between reading and writing.
SEEALSO:
	openfile
	closefile
	readfile
	writefile
EXAMPLE:
---- ENDSECTION:posfile
*/
int luaPosFile(lua_State *pL)		{ return(loader->lua_Function_PosFile(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:closefile
FAMILY:
	binary files
SYNTAX:
	closefile(handle)
PARAM:
	handle = opened file handle
DESCRIPTION:
	Close specified binary file.
SEEALSO:
	openfile
EXAMPLE:
---- ENDSECTION:closefile
*/
int luaCloseFile(lua_State *pL)		{ return(loader->lua_Function_CloseFile(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:fileexists
FAMILY:
	binary files
SYNTAX:
	result=fileexists(filename)
PARAM:
	filename = name of the file to check
DESCRIPTION:
	Check if specified file exists or not.
	Note: this won't affect your external resources (see openfile with
	get_from_ext_resources param = true). You can't delete an external
	resource file neither check if it exists.
SEEALSO:
	openfile
	closefile
EXAMPLE:
---- ENDSECTION:fileexists
*/
int luaFileExists(lua_State *pL)	{ return(loader->lua_Function_FileExists(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:deletefile
FAMILY:
	binary files
SYNTAX:
	deletefile(filename)
PARAM:
	filename = name of the file to delete
DESCRIPTION:
	Delete specified file from filesystem.
	The file must be not opened.
	Note: this won't affect your external resources (see openfile with
	get_from_ext_resources param = true). You can't delete an external
	resource file neither check if it exists.
SEEALSO:
	openfile
	fileexists
	closefile
EXAMPLE:
---- ENDSECTION:deletefile
*/
int luaDeleteFile(lua_State *pL)	{ return(loader->lua_Function_DeleteFile(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:loadlibrary
FAMILY:
	custom libraries
SYNTAX:
	loadlibrary(handle, filename)
	handle = loadlibrary(filename)
PARAM:
	handle = library handle
	filename = library file name added in external resources
DESCRIPTION:
	Load a library from external resources. You can force loading using
	specified handle or you can let FBA autoassign a new handle.

	In order to use a custom library (dll) you must provide FBA two
	versions of same library: ARM compiled version, X86 compiled version.
	(See tutorial 25 for more info).
SEEALSO:
	execlibrary
	freelibrary
EXAMPLE:
	-- load mydll.dll (note: we remove prefix "arm/x86" when loading it!)
	-- remember to add arm_mydll.dll and x86_mydll.dll in your external resources
	mydll = loadlibrary("mydll.dll")

	-- call function "my_cool_dll_function" from a dll, passing 50 and 20 as function paramters
	result = execlibrary(mydll, "my_cool_dll_function", 50, 20)

	-- free loaded library (this couldn't be necessary, but it's always better
	-- to free resources when they're not needed!
	freelibrary(mydll)
---- ENDSECTION:loadlibrary
*/
int luaLoadLibrary(lua_State *pL)			{ return(loader->lua_Function_LoadLibrary(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:freelibrary
FAMILY:
	custom libraries
SYNTAX:
	freelibrary(handle)
PARAM:
	handle = library handle
DESCRIPTION:
	Free a previous loaded library (with LoadLibrary)
	(See tutorial 25 for more info).
SEEALSO:
	execlibrary
	loadlibrary
EXAMPLE:
---- ENDSECTION:freelibrary
*/
int luaFreeLibrary(lua_State *pL)			{ return(loader->lua_Function_FreeLibrary(pL)); }
////////////////////////////////

////////////////////////////////
/*
---- STARTSECTION:execlibrary
FAMILY:
	custom libraries
SYNTAX:
	[retval = ] execlibrary(handle, function, [par1,par2...])
PARAM:
	handle = library handle
	function = function name inside library
DESCRIPTION:
	Call specified function from a loaded library.
	Note: Parameters number is variable according to your library function syntax.
SEEALSO:
	freelibrary
	loadlibrary
EXAMPLE:
---- ENDSECTION:execlibrary
*/
int luaExecLibrary(lua_State *pL)			{ return(loader->lua_Function_ExecLibrary(pL)); }
////////////////////////////////

// -- debug handler function
#ifndef RELEASE_VERSION
	void luaHookRoutine(lua_State *L, lua_Debug *ar) { loader->lua_Debug_HookRoutine(L, ar); }

	// callback ricezione dati socket (da DebugSock)
	void DebugSocketReceiveData(char *text) { loader->OnDebugReceiveSocket(text); }
#endif

// non rimuovere la linea seguente
// BEGIN IDE AUTOCUT
typedef int (lua_FunctionProto) (lua_State *pL);
static const char *LUA_func_table_name[]=			{
	"keyleft",				"keyright",				"keydown",				"keyup",
	"keyfire1",				"keyfire2",				"keyfire3",				"numkeypress",
	"mousedown",			"mousex",				"mousey",				"mousein",
	"include",				"getnumiterations",		"quit",					"debug",				"clock",
	"windowfocused",		"getfps",				"getdate",				"getmemorystatus",
#ifdef ENABLE_AUDIO
	"destroysound",			"destroymusic",
	"loadsound",			"loadmusic",			"playsound",			"playmusic",
	"pausesound",			"resumesound",			"pausemusic",			"resumemusic",
	"stopmusic",			"stopsound",			"musicvolume",			"soundvolume",
	"stopallsounds",		"stopallmusics",
#endif
	"addconsole",			"rect",					"fillrect",				"drawimage",			"clear",
	"screenwidth",			"screenheight",			"destroyimage",			"loadimage",
	"imagewidth",			"imageheight",			"print",				"blending",				"createimage",
	"colormask",			"rendertarget",			"circle",				"fillcircle",			"line",
	"point",				"getcolor",				"imagecolor",			"clipping",				"drawrotatestretchimage",
	"drawstretchimage",		"drawrotateimage",		"poly",					"fillpoly",
	"openconfig",			"closeconfig",			"writeconfignumber",	"writeconfigstring",
	"readconfigstring",		"readconfignumber",		"openconfigext",

#ifdef ENABLE_GAMEGRID
	"creategrid",			"gridcell",				"drawgrid",				"gridworldx",			"gridworldy",
	"destroygrid",			"fillgrid",
#endif
#ifdef ENABLE_TTF_EXTENSION
	"loadfont",				"setfont",				"drawtext",				"destroyfont",			"textwidth",
#endif
	"loadgfxfont",			"drawgfxtext",			"destroygfxfont",		"gfxtextwidth",
	"openres",				"getres",				"getresline",			"closeres",				"openresext",
	"openfile",				"writefile",			"readfile",				"closefile",			"fileexists",
	"deletefile",			"posfile",
	"loadlibrary",			"freelibrary",			"execlibrary",
#ifdef SOCKET_MODULE
	"initsocketengine",		"closesocketengine",	"createsocket",
#endif
	0
};
// non rimuovere la linea seguente
// END IDE AUTOCUT

static lua_FunctionProto *LUA_func_table_func[] =	{
	luaKeyLeft,				luaKeyRight,			luaKeyDown,				luaKeyUp,
	luaKeyFire1,			luaKeyFire2,			luaKeyFire3,			luaNumKeypress,
	luaMouseDown,			luaMouseX,				luaMouseY,				luaMouseIn,
	luaIncludeScript,		luaGetnumiterations,	luaQuit,				luaDebugSocket,			luaGetClock,
	luaWindowfocused,		luaGetfps,				luaGetDate,				luaGetmemorystatus,
#ifdef ENABLE_AUDIO
	luaDestroySound,		luaDestroyMusic,
	luaLoadSound,			luaLoadMusic,			luaPlaySound,			luaPlayMusic,
	luaPauseSound,			luaResumeSound,			luaPauseMusic,			luaResumeMusic,
	luaStopMusic,			luaStopSound,			luaMusicVolume,			luaSoundVolume,
	luaStopAllSounds,		luaStopAllMusics,
#endif
	luaAddConsole,			luaRect,				luaFillRect,			luaDrawImage,			luaClear,
	luaScreenWidth,			luaScreenHeight,		luaDestroyImage,		luaLoadImage,
	luaImageWidth,			luaImageHeight,			luaPrint,				luaBlending,			luaCreateImage,
	luaColorMask,			luaRenderTarget,		luaCircle,				luaFillCircle,			luaLine,
	luaPoint,				luaGetColor,			luaImageColor,			luaClipping,			luaDrawRotateStretchImage,
	luaDrawStretchImage,	luaDrawRotateImage,		luaPoly,				luaFillPoly,
	luaOpenconfig,			luaCloseconfig,			luaWriteconfignumber,	luaWriteconfigstring,
	luaReadconfigstring,	luaReadconfignumber,	luaOpenconfigExt,

#ifdef ENABLE_GAMEGRID
	luaCreateGrid,			luaGridCell,			luaDrawGrid,			luaGridWorldX,			luaGridWorldY,
	luaDestroyGrid,			luaFillGrid,
#endif
#ifdef ENABLE_TTF_EXTENSION
	luaLoadFont,			luaSetFont,				luaDrawText,			luaDestroyFont,			luaTextWidth,
#endif
	luaLoadGfxFont,			luaDrawGfxText,			luaDestroyGfxFont,		luaGfxTextWidth,
	luaOpenRes,				luaGetRes,				luaGetResLine,			luaCloseRes,			luaOpenResExt,
	luaOpenFile,			luaWriteFile,			luaReadFile,			luaCloseFile,			luaFileExists,
	luaDeleteFile,			luaPosFile,
	luaLoadLibrary,			luaFreeLibrary,			luaExecLibrary,
#ifdef SOCKET_MODULE
	luaInitSocketEngine,	luaCloseSocketEngine,	luaCreateSocket,
#endif
	0
};
