|
Swadge ESP32-S2
APIs to develop for the Magfest Swadge
|
The data structures and Helper functions for utilizing Swadgesonas.
Macros | |
| #define | SWSN_HEIGHT 64 |
| #define | SWSN_WIDTH 64 |
Enumerations | |
| enum | paletteSwap_t { COLOR_HAIR , COLOR_SKIN , COLOR_EYES , COLOR_CLOTHES , COLOR_HAT , COLOR_GLASSES } |
Functions | |
| void | saveSwadgesona (swadgesona_t *sw, int idx) |
| Saves the Swadgesona to the NVS in the given slot. | |
| void | loadSwadgesona (swadgesona_t *sw, int idx) |
| Loads a swadgesona from the NVS. | |
| void | copySwadgesona (swadgesona_t *to, swadgesona_t *from) |
| Copy one swadgesona to another. | |
| void | generateRandomSwadgesona (swadgesona_t *sw) |
| Generates a random Swadgesona automatically. | |
| void | generateSwadgesonaImage (swadgesona_t *sw, bool drawBody) |
| Generates the image based on the included data. | |
| void | loadSPSona (swadgesonaCore_t *sw) |
| Loads the swadgepass sona. | |
| bool | getFeatureWSG (swadgesona_t *sw, features_t feature, wsg_t *dest) |
| Copy the sprite and color at an index to a wsg_t. This function allocates memory for the wsg_t, please freeWsg() when done with image. | |
Variables | |
| const char | spSonaNVSKey [] = "spSona" |
| #define SWSN_HEIGHT 64 |
| #define SWSN_WIDTH 64 |
| enum paletteSwap_t |
| void saveSwadgesona | ( | swadgesona_t * | sw, |
| int | idx ) |
Saves the Swadgesona to the NVS in the given slot.
| sw | Swadgesona data to save. provide the entire wrapper |
| idx | Index of slot to put swadgesona into |
| void loadSwadgesona | ( | swadgesona_t * | sw, |
| int | idx ) |
Loads a swadgesona from the NVS.
| sw | Swadgesona data to load. Will be randomized if the data doesn't exist. |
| idx | Index of slot to put swadgesona into |
| void copySwadgesona | ( | swadgesona_t * | to, |
| swadgesona_t * | from ) |
Copy one swadgesona to another.
| to | The swadgesona to copy to |
| from | The source swadgesona |
| void generateRandomSwadgesona | ( | swadgesona_t * | sw | ) |
Generates a random Swadgesona automatically.
| sw | Swadgesona to load data into. |
| void generateSwadgesonaImage | ( | swadgesona_t * | sw, |
| bool | drawBody ) |
Generates the image based on the included data.
| sw | Swadgesona wrapper used ot generate the image |
| drawBody | Whether or not to draw the shirt/neck |
| void loadSPSona | ( | swadgesonaCore_t * | sw | ) |
Loads the swadgepass sona.
| sw | Data out. Is set to NULL if nothing is loaded |
| bool getFeatureWSG | ( | swadgesona_t * | sw, |
| features_t | feature, | ||
| wsg_t * | dest ) |
Copy the sprite and color at an index to a wsg_t. This function allocates memory for the wsg_t, please freeWsg() when done with image.
| sw | Swadgesona to extract wsg from |
| feature | The feature to load |
| dest | The place to save the file into |
| const char spSonaNVSKey[] = "spSona" |