|
Ludum Dare 29
HackSoc's entry for the Ludum Dare Jam 29
|

Functions | |
| void | mvaddprintf (unsigned int y, unsigned int x, const char *fmt,...) |
| char * | strdup (const char *str) |
| void | mvaddchcol (unsigned int y, unsigned int x, char chr, int fg, int bg, bool bold) |
| const void ** | list_choice (bool nochoice, const char *prompt, const char *prompt2, bool multi, bool empty, const char *choices[], const void *results[]) |
| const void * | random_choice (const void *choices[]) |
| void | show_help () |
| void * | _xalloc (size_t size) |
| void | _xfree (void **ptr) |
| void* _xalloc | ( | size_t | size | ) |
Allocate (and zero) memory and immediately bail out if it fails.
| size | Amount of memory to allocate (in bytes). |
| void _xfree | ( | void ** | ptr | ) |
Free a non-NULL pointer.
| ptr | Pointer to memory to free. |
| const void** list_choice | ( | bool | nochoice, |
| const char * | prompt, | ||
| const char * | prompt2, | ||
| bool | multi, | ||
| bool | empty, | ||
| const char * | choices[], | ||
| const void * | results[] | ||
| ) |
Select from a list of things, berate the player if they enter a bad choice. This clears the screen before and after running.
| nochoice | This isn't a choice, just a list. |
| prompt | The initial question. |
| prompt2 | The prompt to use after a bad choice. |
| multi | Allow multiple selections. |
| empty | Allow an empty selection. |
| choices | NULL-terminated list of choice names. |
| results | NULL-terminated list of actual results. |


| void mvaddchcol | ( | unsigned int | y, |
| unsigned int | x, | ||
| char | chr, | ||
| int | fg, | ||
| int | bg, | ||
| bool | bold | ||
| ) |
Render the given char at the given position with the given colour pair.
| y | The Y position |
| x | The X position |
| chr | The character to render |
| fg | The foreground colour |
| bg | The background colour |
| bold | Whether to bold or not |

| void mvaddprintf | ( | unsigned int | y, |
| unsigned int | x, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
printf the given string at the given position.
| y | y-coordinate of the screen. |
| x | x-coordinate of the screen. |
| fmt | Format of the string. |

| const void* random_choice | ( | const void * | choices[] | ) |
Select a random value from a list
| choices | NULL-terminates list of choices. |

| void show_help | ( | ) |
Show some help text to the player.


| char* strdup | ( | const char * | str | ) |
Duplicate a string
| str | String to duplicate |

1.8.7