|
Stardew Engine
|
#include "Atlas.h"#include "DynArray.h"#include "ImageFileRegstry.h"#include <string.h>#include <stdlib.h>#include "AssertLib.h"#include <ft2build.h>#include "stb/stb_image_write.h"#include "DrawContext.h"#include "SharedPtr.h"#include "FloatingPointLib.h"#include <libxml/parser.h>#include <libxml/tree.h>#include "BinarySerializer.h"#include "BitField2D.h"#include "StringKeyHashMap.h"#include "Log.h"
Data Structures | |
| struct | AtlasSpriteFontData |
| struct | AtlasFont |
| struct | Atlas |
| struct | AtlasRect |
| struct | FreeSpaceRun |
Macros | |
| #define | STB_IMAGE_WRITE_IMPLEMENTATION |
| #define | ATLAS_SPRITE_BORDER_PXLS 1 |
| #define | MERGE_FREE_SPACES |
| #define | ATLAS_HANDLE_BOUNDS_CHECK_NO_RETURN(atlas) |
| #define | ATLAS_HANDLE_BOUNDS_CHECK(atlas, rVal) |
| #define | FONT_HANDLE_BOUNDS_CHECK(hAtlas, hFont, rVal) |
Functions | |
| Atlas * | AqcuireAtlas () |
| void | At_SetCurrent (hAtlas atlas, DrawContext *pDC) |
| void | At_Init () |
| void | At_BeginAtlas () |
| hSprite | At_AddSprite (const char *imgPath, int topLeftXPx, int topLeftYPx, int widthPx, int heightPx, const char *name) |
| float | At_PixelsToPts (float val) |
| HFont | At_AddFont (const struct FontAtlasAdditionSpec *pFontSpec) |
| int | SortFunc (const void *a, const void *b) |
| VECTOR (struct AtlasRect) | |
| bool | FitsInRect (const AtlasSprite *sprite, const struct AtlasRect *rect) |
| int | FindFittingFreeSpace (const AtlasSprite *sprite, VECTOR(struct AtlasRect) freeSpace) |
| struct FreeSpaceRun * | FindRunInPrevRow (VECTOR(struct FreeSpaceRun) prevRow, struct FreeSpaceRun *pRun) |
| struct AtlasRect * | MergeFreeSpace (struct AtlasRect *pFreeSpace, struct Bitfield2D *pBF, int w, int h) |
| int | FreeSpaceSortFunc (const void *a, const void *b) |
| void | BlitAtlasSprite (u8 *dst, size_t dstWidthPx, AtlasSprite *pSprite) |
| void | CopyNestedPositions (Atlas *pAtlasDest, AtlasSprite *spritesCopySrc, int spritesCopySrcSize) |
| size_t | CountTotalSpritesInFonts (Atlas *pAtlas) |
| 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) |
| AtlasSprite * | At_GetSprite (hSprite sprite, hAtlas atlas) |
| hTexture | At_GetAtlasTexture (hAtlas atlas) |
| hAtlas | At_LoadAtlas (xmlNode *child0, DrawContext *pDC) |
| hAtlas | At_LoadAtlasEx (xmlNode *child0, DrawContext *pDC, struct EndAtlasOptions *pOptions) |
| hSprite | At_TilemapIndexToSprite (hAtlas atlas, TileIndex tileIndex) |
| void | At_SerializeAtlas (struct BinarySerializer *pSerializer, hAtlas *atlas, struct DrawContext *pDC) |
| 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) |
| AtlasSprite * | Fo_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) |
| void | At_BeginTileset (int beginI) |
| void | At_EndTileset (int endI) |
| struct AtlasAnimation * | At_FindAnim (hAtlas atlas, const char *name) |
Variables | |
| FT_Library | gFTLib |
| #define ATLAS_HANDLE_BOUNDS_CHECK | ( | atlas, | |
| rVal | |||
| ) |
| #define ATLAS_HANDLE_BOUNDS_CHECK_NO_RETURN | ( | atlas | ) |
| #define ATLAS_SPRITE_BORDER_PXLS 1 |
| #define FONT_HANDLE_BOUNDS_CHECK | ( | hAtlas, | |
| hFont, | |||
| rVal | |||
| ) |
| #define MERGE_FREE_SPACES |
| #define STB_IMAGE_WRITE_IMPLEMENTATION |
| Atlas * AqcuireAtlas | ( | ) |
| HFont At_AddFont | ( | const struct FontAtlasAdditionSpec * | pFontSpec | ) |
| hSprite At_AddSprite | ( | const char * | imgPath, |
| int | topLeftXPx, | ||
| int | topLeftYPx, | ||
| int | widthPx, | ||
| int | heightPx, | ||
| const char * | name | ||
| ) |
| void At_BeginAtlas | ( | ) |
| void At_BeginTileset | ( | int | beginI | ) |
| void At_DestroyAtlas | ( | hAtlas | atlas, |
| struct DrawContext * | pDC | ||
| ) |
| hAtlas At_EndAtlas | ( | struct DrawContext * | pDC | ) |
| hAtlas At_EndAtlasEx | ( | struct DrawContext * | pDC, |
| struct EndAtlasOptions * | pOptions | ||
| ) |
| void At_EndTileset | ( | int | endI | ) |
| struct AtlasAnimation * At_FindAnim | ( | hAtlas | atlas, |
| const char * | name | ||
| ) |
| AtlasSprite * At_GetSprite | ( | hSprite | sprite, |
| hAtlas | atlas | ||
| ) |
| void At_Init | ( | ) |
| hAtlas At_LoadAtlas | ( | xmlNode * | child0, |
| DrawContext * | pDC | ||
| ) |
| hAtlas At_LoadAtlasEx | ( | xmlNode * | child0, |
| DrawContext * | pDC, | ||
| struct EndAtlasOptions * | pOptions | ||
| ) |
| float At_PixelsToPts | ( | float | val | ) |
| void At_SerializeAtlas | ( | struct BinarySerializer * | pSerializer, |
| hAtlas * | atlas, | ||
| struct DrawContext * | pDC | ||
| ) |
| pSerializer | binary serialzier to load or save |
| atlas | If 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 |
| void At_SetCurrent | ( | hAtlas | atlas, |
| DrawContext * | pDC | ||
| ) |
| void BlitAtlasSprite | ( | u8 * | dst, |
| size_t | dstWidthPx, | ||
| AtlasSprite * | pSprite | ||
| ) |
| void CopyNestedPositions | ( | Atlas * | pAtlasDest, |
| AtlasSprite * | spritesCopySrc, | ||
| int | spritesCopySrcSize | ||
| ) |
| size_t CountTotalSpritesInFonts | ( | Atlas * | pAtlas | ) |
| int FindFittingFreeSpace | ( | const AtlasSprite * | sprite, |
| VECTOR(struct AtlasRect) | freeSpace | ||
| ) |
| struct FreeSpaceRun * FindRunInPrevRow | ( | VECTOR(struct FreeSpaceRun) | prevRow, |
| struct FreeSpaceRun * | pRun | ||
| ) |
| bool FitsInRect | ( | const AtlasSprite * | sprite, |
| const struct AtlasRect * | rect | ||
| ) |
| AtlasSprite * Fo_GetCharSprite | ( | hAtlas | hAtlas, |
| HFont | hFont, | ||
| char | c | ||
| ) |
| int FreeSpaceSortFunc | ( | const void * | a, |
| const void * | b | ||
| ) |
| struct AtlasRect * MergeFreeSpace | ( | struct AtlasRect * | pFreeSpace, |
| struct Bitfield2D * | pBF, | ||
| int | w, | ||
| int | h | ||
| ) |
| int SortFunc | ( | const void * | a, |
| const void * | b | ||
| ) |
| static VECTOR | ( | struct AtlasRect | ) |
| FT_Library gFTLib |