View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/index.html.
video_mode: the new video mode
This callback is here because gfx needs to update the config when the screen is resized. But... we did not want to make gfx depend on cfg "directly". It’s cleaner to pass parameters with Scheme, in the long run, it should make things easier. So this callback is the solution. Another side effect is that this way there’s a tangible obvious trace of this updating of config status by the gfx module. Seeing it sticking out like a thumb isn’t a bad thing.
Return value: none
Functions which will call quit
(), free
(), destroy
() on whatever
smob object that has threads and/or requires hardware ressources.
This is to be called before the Guile interpreter ends. This is because
when it garbage collects objects at the end of the program, it has
no idea of what order to use when freeing objects. So if an object
which uses another one in a thread is freed after the other is freed,
you get a (rather unexplainabled if not warned) segfault.
Return value: none
Sends a quit message and displays a newline.
Return value: none
argc: number of args as passed to main argv: array of strings as passed to main
Fixes environment variables (path related) so that program can find its requirements. This must be called early in the program flow (else other calls might fail).
Return value: 1 if success, 0 if failure
Register all the functions, make them callable from Guile. This is a very simple yet long and very usefull function, without it Guile has no knowledge of what LW6 is.
Return value: 1 on success, 0 if failed.
c_line: the line typed by the user
This function will be called every time a message is typed on the console. It runs the given line in the current Guile environment.
Return value: none
argc: number of args as passed to main argv: array of strings as passed to main
Initializes global values to their defaults.
Return value: 1 on success, 0 if failed
argc: number of args as passed to main argv: array of strings as passed to main
Frees global values. Will also garbage collect objects in case Guile failed to do it perfectly (or we failed to tell Guile how to do it).
Return value: none.
argc: the argc parameter of the main
() function, that is, the number
of command-line args.
argv: the argv parameter of the main
() function, that is, an array
containing pointers on command-line args.
This function is directly called by main
(). This means by linking
against libliquidwar6 and calling it, you would have a program
that is almost exactly the "official" upstream liquidwar6 binary,
except you can tweak it and have all the power to call whatever
other functions you like, embed it. In short, everything the binary
does, you can do it in your own binarn, by linking against the
library and calling this function.
Return value: 1 if success, zero if failure. Note that this
is the "standard" C / liquidwar6 way to proceed, but your main
()
function should return 0 if success, else an error code. Typical
use is "return !lw6_main(argc, argv);".
argc: the number of command-line args, as passed to main()
argv: an array of strings containing command-line args, as passed to main()
run_game: a pointer to a boolean which will contain true (1) if the game must be launched, or false (0) if the option is such that game must be skipped. Example: –copyright, –help, ...
Return value: non-zero if success, 0 if error. The error can be, for instance, the test suite returning "no, tests were not OK".
Displays a short help message.
Return value: none
Displays the version of the game.
Return value: none
Displays the copyright of the game (short version).
Return value: none
Displays the copyright of the game (long version).
Return value: none
Displays the program bench value.
Return value: none
Displays the program pedigree, think of this as version on steroids.
Return value: none
Displays the host on which the program was compiled.
Return value: none
Displays various paths used by the game.
Return value: none
Displays the list of modules compiled with the game.
Return value: none
Displays the list of ’quick’ options.
Return value: none
Displays the list of ’doc’ options.
Return value: none
Displays the list of ’show’ options.
Return value: none
Displays the list of ’path’ options.
Return value: none
Displays the list of ’players’ options.
Return value: none
Displays the list of ’input’ options.
Return value: none
Displays the list of ’graphics’ options.
Return value: none
Displays the list of ’sound’ options.
Return value: none
Displays the list of ’network’ options.
Return value: none
Displays the list of ’map’ options.
Return value: none
Displays the list of ’map rules’ options.
Return value: none
Displays the list of ’map hints’ options.
Return value: none
Displays the list of ’map style’ options.
Return value: none
Displays the list of ’map teams’ options.
Return value: none
Displays the list of ’funcs’.
Return value: none
Displays the list of ’hooks’.
Return value: none
Displays the list of ’advanced’ options.
Return value: none
Displays the list of options aliases.
Return value: none
Displays the list of team colors.
Return value: none
Displays the list of weapons.
Return value: none
Displays the list of all known options.
Return value: none
Displays the about message for a keyword.
Return value: none
Displays ’hello’ at the beginning of the program.
Return value: none
Displays ’goodbye’, typically use at end of program to know it’s over and everything went fine.
Return value: none
c_dsp: the display object
Creates an SCM ’dsp’ object from C data.
Return value: the SCM object
dsp: the dsp to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’dsp’ object.
Return value: a pointer, *not* a copy, must not be freed
dsp_smob: the smob to free
Frees a dsp smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_snd: the sound object
Creates an SCM ’snd’ object from C data.
Return value: the SCM object
snd: the snd to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’snd’ object.
Return value: a pointer, *not* a copy, must not be freed
snd_smob: the smob to free
Frees a snd smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_map: the map object
Creates an SCM ’map’ object from C data.
Return value: the SCM object
map: the map to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’map’ object.
Return value: a pointer, *not* a copy, must not be freed
map_smob: the smob to free
Frees a map smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_menu: the menu object
Creates an SCM ’menu’ object from C data.
Return value: the SCM object
menu: the menu to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’menu’ object.
Return value: a pointer, *not* a copy, must not be freed
menu_smob: the smob to free
Frees a menu smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_game_struct: the game struct object
map: the map (SCM object) referenced
Creates an SCM ’game-struct’ object from C data. Passing the map object enables the garbage collector not to free the map until the game struct is freed.
Return value: the SCM object
game_struct: the game_struct to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’game_struct’ object.
Return value: a pointer, *not* a copy, must not be freed
game_struct_smob: the smob to free
Frees a game_struct smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_game_state: the game state object
game_struct: the game struct (SCM object) referenced
Creates an SCM ’game_state’ object from C data. Passing game_struct enables the garbage collector not to free the game_struct until the game_state is freed.
Return value: the SCM object
game_state: the game_state to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’game_state’ object.
Return value: a pointer, *not* a copy, must not be freed
game_state_smob: the smob to free
Frees a game_state smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_pilot: the pilot object
Creates an SCM ’pilot’ object from C data.
Return value: the SCM object
pilot: the pilot to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’pilot’ object.
Return value: a pointer, *not* a copy, must not be freed
pilot_smob: the smob to free
Frees a pilot smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_bot: the bot object
game_state: the game state
pilot: the pilot
Creates an SCM ’bot’ object from C data. Passing game_state and pilot enables the garbage collector not the free them until bot is freed.
Return value: the SCM object
bot: the bot to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’bot’ object.
Return value: a pointer, *not* a copy, must not be freed
bot_smob: the smob to free
Frees a bot smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_look: the look object
Creates an SCM ’look’ object from C data.
Return value: the SCM object
look: the look to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’look’ object.
Return value: a pointer, *not* a copy, must not be freed
look_smob: the smob to free
Frees a look smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_loader: the loader object
Creates an SCM ’loader’ object from C data.
Return value: the SCM object
loader: the loader to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’loader’ object.
Return value: a pointer, *not* a copy, must not be freed
loader_smob: the smob to free
Frees a loader smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_db: the database object
Creates an SCM ’db’ object from C data.
Return value: the SCM object
db: the db to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’db’ object.
Return value: a pointer, *not* a copy, must not be freed
db_smob: the smob to free
Frees a db smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_node: the node object
db: the db (SCM object) referenced
Creates an SCM ’node’ object from C data. Passing db enables the garbage collector not to free db until node is freed.
Return value: the SCM object
node: the node to convert (SCM object)
Gets the internal C pointer corresponding to the scheme ’node’ object.
Return value: a pointer, *not* a copy, must not be freed
node_smob: the smob to free
Frees a node smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
Register all smobs to Guile.
Return value: 1 on success, 0 if failed.
mode: 0 for check only, 1 for full test
Runs the liquidwar6 core module test suite, this will mostly test how Guile script integration works, loading a sample script and running it. It does not launch all the other sub modules tests.
Return value: 1 if test is successfull, 0 on error.