Swadge 2024 2.0.0
APIs to develop games 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 generateRandomSwadgesona (swadgesona_t *sw)
 Generates a random Swadgesona automatically.
 
void generateSwadgesonaImage (swadgesona_t *sw, bool drawBody)
 Generates the image based on the included data.
 
cnfsFileIdx_t getHairWSG (swadgesona_t *sw)
 Get the hair CNFS index from the swadgesona for drawing behind custom bodies.
 

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

◆ 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

◆ 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.