Stardew Engine
Loading...
Searching...
No Matches
Atlas.h File Reference
#include "IntTypes.h"
#include "HandleDefs.h"
#include <cglm/cglm.h>
#include <stdbool.h>
Include dependency graph for Atlas.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _AtlasSprite
 
struct  AtlasAnimation
 
struct  FontSize
 
struct  FontAtlasAdditionSpec
 
struct  EndAtlasOptions
 

Macros

#define VECTOR(a)   a*
 
#define MAX_FONT_NAME_SIZE   128
 
#define MAX_FONT_PATH_SIZE   256
 
#define MAX_NUM_FONT_SIZES   32
 

Typedefs

typedef struct DrawContext DrawContext
 
typedef struct _xmlNode xmlNode
 
typedef struct _AtlasSprite AtlasSprite
 

Functions

void At_Init ()
 
void At_BeginAtlas ()
 
hSprite At_AddSprite (const char *imgPath, int topLeftXPx, int topRightYPx, int widthPx, int heightPx, const char *name)
 
HFont At_AddFont (const struct FontAtlasAdditionSpec *pFontSpec)
 
hAtlas At_EndAtlas (struct DrawContext *pDC)
 
hAtlas At_EndAtlasEx (struct DrawContext *pDC, struct EndAtlasOptions *pOptions)
 
void At_DestroyAtlas (hAtlas atlas, struct DrawContext *pDC)
 
hSprite At_FindSprite (const char *name, hAtlas atlas)
 
AtlasSpriteAt_GetSprite (hSprite sprite, hAtlas atlas)
 
hTexture At_GetAtlasTexture (hAtlas atlas)
 
float At_PixelsToPts (float val)
 
hAtlas At_LoadAtlas (xmlNode *child0, struct DrawContext *pDC)
 
hAtlas At_LoadAtlasEx (xmlNode *child0, struct DrawContext *pDC, struct EndAtlasOptions *pOptions)
 
hSprite At_TilemapIndexToSprite (hAtlas atlas, TileIndex tileIndex)
 
void At_SerializeAtlas (struct BinarySerializer *pSerializer, hAtlas *atlas, struct DrawContext *pDC)
 
void At_BeginTileset (int beginI)
 
void At_EndTileset (int endI)
 
void At_SetCurrent (hAtlas atlas, DrawContext *pDC)
 
struct AtlasAnimationAt_FindAnim (hAtlas atlas, const char *name)
 
HFont Fo_FindFont (hAtlas hAtlas, const char *fontName, float sizePts)
 
float Fo_CharWidth (hAtlas hAtlas, HFont hFont, char c)
 
float Fo_CharHeight (hAtlas hAtlas, HFont hFont, char c)
 
float Fo_StringWidth (hAtlas hAtlas, HFont hFont, const char *stringVal)
 
float Fo_StringHeight (hAtlas hAtlas, HFont hFont, const char *stringVal)
 
AtlasSpriteFo_GetCharSprite (hAtlas hAtlas, HFont hFont, char c)
 
float Fo_GetMaxYBearing (hAtlas hAtlas, HFont hFont, const char *str)
 
bool Fo_TryGetCharBearing (hAtlas hAtlas, HFont hFont, char c, vec2 outBearing)
 
bool Fo_TryGetCharAdvance (hAtlas hAtlas, HFont hFont, char c, float *outAdvance)
 

Macro Definition Documentation

◆ MAX_FONT_NAME_SIZE

#define MAX_FONT_NAME_SIZE   128

◆ MAX_FONT_PATH_SIZE

#define MAX_FONT_PATH_SIZE   256

◆ MAX_NUM_FONT_SIZES

#define MAX_NUM_FONT_SIZES   32

◆ VECTOR

#define VECTOR (   a)    a*

Typedef Documentation

◆ AtlasSprite

typedef struct _AtlasSprite AtlasSprite

◆ DrawContext

typedef struct DrawContext DrawContext

◆ xmlNode

typedef struct _xmlNode xmlNode

Function Documentation

◆ At_AddFont()

HFont At_AddFont ( const struct FontAtlasAdditionSpec pFontSpec)

◆ At_AddSprite()

hSprite At_AddSprite ( const char *  imgPath,
int  topLeftXPx,
int  topRightYPx,
int  widthPx,
int  heightPx,
const char *  name 
)

◆ At_BeginAtlas()

void At_BeginAtlas ( )

◆ At_BeginTileset()

void At_BeginTileset ( int  beginI)

◆ At_DestroyAtlas()

void At_DestroyAtlas ( hAtlas  atlas,
struct DrawContext pDC 
)

◆ At_EndAtlas()

hAtlas At_EndAtlas ( struct DrawContext pDC)

◆ At_EndAtlasEx()

hAtlas At_EndAtlasEx ( struct DrawContext pDC,
struct EndAtlasOptions pOptions 
)

◆ At_EndTileset()

void At_EndTileset ( int  endI)

◆ At_FindAnim()

struct AtlasAnimation * At_FindAnim ( hAtlas  atlas,
const char *  name 
)

◆ At_FindSprite()

hSprite At_FindSprite ( const char *  name,
hAtlas  atlas 
)

◆ At_GetAtlasTexture()

hTexture At_GetAtlasTexture ( hAtlas  atlas)

◆ At_GetSprite()

AtlasSprite * At_GetSprite ( hSprite  sprite,
hAtlas  atlas 
)

◆ At_Init()

void At_Init ( )

◆ At_LoadAtlas()

hAtlas At_LoadAtlas ( xmlNode child0,
struct DrawContext pDC 
)

◆ At_LoadAtlasEx()

hAtlas At_LoadAtlasEx ( xmlNode child0,
struct DrawContext pDC,
struct EndAtlasOptions pOptions 
)

◆ At_PixelsToPts()

float At_PixelsToPts ( float  val)

◆ At_SerializeAtlas()

void At_SerializeAtlas ( struct BinarySerializer pSerializer,
hAtlas atlas,
struct DrawContext pDC 
)
Parameters
pSerializerbinary serialzier to load or save
atlasIf loading, point to an unititialized handle to output the new handle If saving point to the handle of the atlas you want to save
pDC

◆ At_SetCurrent()

void At_SetCurrent ( hAtlas  atlas,
DrawContext pDC 
)

◆ At_TilemapIndexToSprite()

hSprite At_TilemapIndexToSprite ( hAtlas  atlas,
TileIndex  tileIndex 
)

◆ Fo_CharHeight()

float Fo_CharHeight ( hAtlas  hAtlas,
HFont  hFont,
char  c 
)

◆ Fo_CharWidth()

float Fo_CharWidth ( hAtlas  hAtlas,
HFont  hFont,
char  c 
)

◆ Fo_FindFont()

HFont Fo_FindFont ( hAtlas  hAtlas,
const char *  fontName,
float  sizePts 
)

◆ Fo_GetCharSprite()

AtlasSprite * Fo_GetCharSprite ( hAtlas  hAtlas,
HFont  hFont,
char  c 
)

◆ Fo_GetMaxYBearing()

float Fo_GetMaxYBearing ( hAtlas  hAtlas,
HFont  hFont,
const char *  str 
)

◆ Fo_StringHeight()

float Fo_StringHeight ( hAtlas  hAtlas,
HFont  hFont,
const char *  stringVal 
)

◆ Fo_StringWidth()

float Fo_StringWidth ( hAtlas  hAtlas,
HFont  hFont,
const char *  stringVal 
)

◆ Fo_TryGetCharAdvance()

bool Fo_TryGetCharAdvance ( hAtlas  hAtlas,
HFont  hFont,
char  c,
float *  outAdvance 
)

◆ Fo_TryGetCharBearing()

bool Fo_TryGetCharBearing ( hAtlas  hAtlas,
HFont  hFont,
char  c,
vec2  outBearing 
)