Swadge ESP32-S2  2.0.0
APIs to develop for the Magfest Swadge
Loading...
Searching...
No Matches
swadgesona.c File Reference

Detailed Description

The data structures and Helper functions for utilizing Swadgesonas.

Author
Jeremy Stintzcum (jerem.nosp@m.y.st.nosp@m.intzc.nosp@m.um@g.nosp@m.mail..nosp@m.com)
Date
2025-10-5

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.
cnfsFileIdx_t getHairWSG (swadgesona_t *sw)
 Get the hair CNFS index from the swadgesona for drawing behind custom bodies.

Variables

const char spSonaNVSKey [] = "spSona"

Macro Definition Documentation

◆ SWSN_HEIGHT

#define SWSN_HEIGHT   64

◆ SWSN_WIDTH

#define SWSN_WIDTH   64

Enumeration Type Documentation

◆ paletteSwap_t

Enumerator
COLOR_HAIR 
COLOR_SKIN 
COLOR_EYES 
COLOR_CLOTHES 
COLOR_HAT 
COLOR_GLASSES 

Function Documentation

◆ saveSwadgesona()

void saveSwadgesona ( swadgesona_t * sw,
int idx )

Saves the Swadgesona to the NVS in the given slot.

Parameters
swSwadgesona data to save. provide the entire wrapper
idxIndex of slot to put swadgesona into

◆ loadSwadgesona()

void loadSwadgesona ( swadgesona_t * sw,
int idx )

Loads a swadgesona from the NVS.

Parameters
swSwadgesona data to load. Will be randomized if the data doesn't exist.
idxIndex of slot to put swadgesona into

◆ copySwadgesona()

void copySwadgesona ( swadgesona_t * to,
swadgesona_t * from )

Copy one swadgesona to another.

Parameters
toThe swadgesona to copy to
fromThe source swadgesona

◆ generateRandomSwadgesona()

void generateRandomSwadgesona ( swadgesona_t * sw)

Generates a random Swadgesona automatically.

Parameters
swSwadgesona to load data into.

◆ generateSwadgesonaImage()

void generateSwadgesonaImage ( swadgesona_t * sw,
bool drawBody )

Generates the image based on the included data.

Parameters
swSwadgesona wrapper used ot generate the image
drawBodyWhether or not to draw the shirt/neck

◆ loadSPSona()

void loadSPSona ( swadgesonaCore_t * sw)

Loads the swadgepass sona.

Parameters
swData out. Is set to NULL if nothing is loaded

◆ getHairWSG()

cnfsFileIdx_t getHairWSG ( swadgesona_t * sw)

Get the hair CNFS index from the swadgesona for drawing behind custom bodies.

Parameters
swSwadgesona to extract wsg from
Returns
cnfsFileIdx_t index into the CNFS system where the hairstyle is at.

Variable Documentation

◆ spSonaNVSKey

const char spSonaNVSKey[] = "spSona"