|
AnimaEngine
1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
|
GUI global state tracking, rendering options, and control flow wrappers. More...
#include <stddef.h>#include "gui_platform.h"#include "anima_backend.h"#include "pokemon_catalog.h"Go to the source code of this file.
Data Structures | |
| struct | GuiPreview |
| Texture and temporal data cache for animating species previews. More... | |
| struct | GuiState |
| State variables and option flags for the main immediate-mode GUI editor. More... | |
Macros | |
| #define | GUI_TEXT_CAPACITY 4096 |
| #define | GUI_SEARCH_CAPACITY 128 |
| #define | GUI_STATUS_CAPACITY 512 |
| #define | GUI_OUTPUT_ROOT "out" |
| #define | GUI_GIF_DELAY_MIN_CS 1 |
| #define | GUI_GIF_DELAY_MAX_CS 50 |
| #define | GUI_GIF_DELAY_DEFAULT_CS 5 |
Typedefs | |
| typedef enum GuiPreviewMode | GuiPreviewMode |
| Categorization of current preview viewport drawing state. More... | |
| typedef struct GuiPreview | GuiPreview |
| Texture and temporal data cache for animating species previews. More... | |
| typedef struct GuiState | GuiState |
| State variables and option flags for the main immediate-mode GUI editor. More... | |
Enumerations | |
| enum | GuiPreviewMode { PREVIEW_GIF , PREVIEW_SPRITESHEET , PREVIEW_STATIC_IDLE , PREVIEW_IDLE_BREAK , PREVIEW_COMPOSED , PREVIEW_NMAR_ANIMATION , PREVIEW_NMCR_MAP } |
| Categorization of current preview viewport drawing state. More... | |
Functions | |
| void | GuiState_Init (GuiState *state) |
| Initializes default options inside a GuiState structure. More... | |
| int | GuiState_LoadAndValidateRom (GuiState *state, const char *path) |
| Validates NDS ROM header and initializes internal directory mappings. More... | |
| void | GuiState_SetStatus (GuiState *state, const char *text) |
| Sets statusbar notification message. More... | |
| void | GuiState_CopyText (char *dst, size_t dst_size, const char *src) |
| Helper utility to safely copy a string with bounding limit constraints. More... | |
| const char * | GuiState_BaseName (const char *path) |
| Extracts file basename from full absolute or relative path. More... | |
| void | GuiState_SanitizePath (const char *name, char *out, size_t out_size) |
| Sanitizes folder name by stripping out illegal character blocks. More... | |
| void | GuiState_BuildOutputDir (const PokemonCatalogEntry *entry, char *buf, size_t sz) |
| Builds directory path where current species assets will be written. More... | |
| int | GuiState_EntryMatchesQuery (const PokemonCatalogEntry *entry, const char *query) |
| Checks if a Pokemon species matches the search filtering text query. More... | |
| const PokemonCatalogEntry * | GuiState_SelectedEntry (int dex_id) |
| Retrieves the species catalog entry matching index. More... | |
| int | GuiState_GetFormCount (const GuiState *state, int dex_id) |
| Retrieves form count for a species. More... | |
| const char * | GuiState_GetFormName (const GuiState *state, int dex_id, int form_idx) |
| Retrieves user-friendly label name of alternate form index. More... | |
| void | GuiState_UpdatePreview (GuiPreview *p) |
| Advances active viewport frame index based on real-world elapsed frame delta time. More... | |
| void | GuiState_UnloadPreview (GuiPreview *p) |
| Deallocates texture cache and color frames stored inside preview struct. More... | |
| int | GuiState_GifDelayCs (const GuiState *state) |
| Retrieves the current custom GIF frame delay. More... | |
| void | GuiState_SetGifDelayCs (GuiState *state, int delay_cs) |
| Sets the custom GIF frame delay. More... | |
| int | GuiState_TryLoadPreview (GuiState *state, const PokemonCatalogEntry *entry) |
| Attempts to load the preview for a Pokemon catalog entry. More... | |
| int | GuiState_RefreshAssets (GuiState *state, const PokemonCatalogEntry *entry) |
| Scans ROM files to discover all asset variants for selected species. More... | |
| void | GuiState_RunExport (GuiState *state, const PokemonCatalogEntry *entry, int export_spritesheets, int export_static, int export_gif, int export_idle_break, int export_composed) |
| Performs batch export run for currently selected Pokemon. More... | |
| void | GuiState_ExportCurrent (GuiState *state, const PokemonCatalogEntry *entry) |
| Exports the currently active preview asset view to its default output file path. More... | |
| void | GuiState_ExportDsFiles (GuiState *state, const PokemonCatalogEntry *entry) |
| Raw dumps individual compressed Nitro NARC blocks for selected species to disk. More... | |
| void | GuiState_ExportAllAssets (GuiState *state, const PokemonCatalogEntry *entry) |
| Recursively renders and writes all assets discovered for species. More... | |
GUI global state tracking, rendering options, and control flow wrappers.
| #define GUI_GIF_DELAY_DEFAULT_CS 5 |
Fallback default GIF frame duration in centiseconds.
| #define GUI_GIF_DELAY_MAX_CS 50 |
Upper bound constraint for custom GIF frame duration.
| #define GUI_GIF_DELAY_MIN_CS 1 |
Lower bound constraint for custom GIF frame duration.
| #define GUI_OUTPUT_ROOT "out" |
Default root output directory relative to project root.
| #define GUI_SEARCH_CAPACITY 128 |
Maximum size for species search filter queries.
| #define GUI_STATUS_CAPACITY 512 |
Maximum size for GUI footer messages.
| #define GUI_TEXT_CAPACITY 4096 |
Maximum size for ROM path storage.
| typedef struct GuiPreview GuiPreview |
Texture and temporal data cache for animating species previews.
| typedef enum GuiPreviewMode GuiPreviewMode |
Categorization of current preview viewport drawing state.
State variables and option flags for the main immediate-mode GUI editor.
| enum GuiPreviewMode |
Categorization of current preview viewport drawing state.
| const char* GuiState_BaseName | ( | const char * | path | ) |
Extracts file basename from full absolute or relative path.
| path | File path. |
| void GuiState_BuildOutputDir | ( | const PokemonCatalogEntry * | entry, |
| char * | buf, | ||
| size_t | sz | ||
| ) |
Builds directory path where current species assets will be written.
| entry | Pointer to Pokemon catalog entry. |
| buf | Output path buffer. |
| sz | Size of output path buffer. |
| void GuiState_CopyText | ( | char * | dst, |
| size_t | dst_size, | ||
| const char * | src | ||
| ) |
Helper utility to safely copy a string with bounding limit constraints.
| dst | Destination buffer. |
| dst_size | Destination capacity limit in bytes. |
| src | Source string. |
| int GuiState_EntryMatchesQuery | ( | const PokemonCatalogEntry * | entry, |
| const char * | query | ||
| ) |
Checks if a Pokemon species matches the search filtering text query.
| entry | Pointer to Pokemon catalog entry. |
| query | Search query text filter. |
| void GuiState_ExportAllAssets | ( | GuiState * | state, |
| const PokemonCatalogEntry * | entry | ||
| ) |
Recursively renders and writes all assets discovered for species.
| state | Global GUI state. |
| entry | Catalog entry. |
| void GuiState_ExportCurrent | ( | GuiState * | state, |
| const PokemonCatalogEntry * | entry | ||
| ) |
Exports the currently active preview asset view to its default output file path.
| state | Global GUI state. |
| entry | Catalog entry. |
| void GuiState_ExportDsFiles | ( | GuiState * | state, |
| const PokemonCatalogEntry * | entry | ||
| ) |
Raw dumps individual compressed Nitro NARC blocks for selected species to disk.
| state | Global GUI state. |
| entry | Catalog entry. |
| int GuiState_GetFormCount | ( | const GuiState * | state, |
| int | dex_id | ||
| ) |
Retrieves form count for a species.
| state | Global GUI state pointer. |
| dex_id | National Dex ID. |
| const char* GuiState_GetFormName | ( | const GuiState * | state, |
| int | dex_id, | ||
| int | form_idx | ||
| ) |
Retrieves user-friendly label name of alternate form index.
| state | Global GUI state pointer. |
| dex_id | National Dex ID. |
| form_idx | Form index. |
| int GuiState_GifDelayCs | ( | const GuiState * | state | ) |
Retrieves the current custom GIF frame delay.
| state | Global GUI state pointer. |
| void GuiState_Init | ( | GuiState * | state | ) |
Initializes default options inside a GuiState structure.
| state | Pointer to state to initialize. |
| int GuiState_LoadAndValidateRom | ( | GuiState * | state, |
| const char * | path | ||
| ) |
Validates NDS ROM header and initializes internal directory mappings.
| state | Global GUI state pointer. |
| path | Path to NDS ROM file. |
| int GuiState_RefreshAssets | ( | GuiState * | state, |
| const PokemonCatalogEntry * | entry | ||
| ) |
Scans ROM files to discover all asset variants for selected species.
| state | Global GUI state pointer. |
| entry | Pokemon catalog entry. |
| void GuiState_RunExport | ( | GuiState * | state, |
| const PokemonCatalogEntry * | entry, | ||
| int | export_spritesheets, | ||
| int | export_static, | ||
| int | export_gif, | ||
| int | export_idle_break, | ||
| int | export_composed | ||
| ) |
Performs batch export run for currently selected Pokemon.
| state | Global GUI state. |
| entry | Catalog entry. |
| export_spritesheets | 1 to generate sheets. |
| export_static | 1 to generate static first-frame. |
| export_gif | 1 to write standard GIF. |
| export_idle_break | 1 to write break GIF. |
| export_composed | 1 to write merged loop. |
| void GuiState_SanitizePath | ( | const char * | name, |
| char * | out, | ||
| size_t | out_size | ||
| ) |
Sanitizes folder name by stripping out illegal character blocks.
| name | Source directory folder name. |
| out | Destination buffer. |
| out_size | Size of destination buffer. |
| const PokemonCatalogEntry* GuiState_SelectedEntry | ( | int | dex_id | ) |
Retrieves the species catalog entry matching index.
| dex_id | National Dex ID (1 to 649). |
| void GuiState_SetGifDelayCs | ( | GuiState * | state, |
| int | delay_cs | ||
| ) |
Sets the custom GIF frame delay.
| state | Global GUI state pointer. |
| delay_cs | Custom delay in centiseconds. |
| void GuiState_SetStatus | ( | GuiState * | state, |
| const char * | text | ||
| ) |
Sets statusbar notification message.
| state | Global GUI state pointer. |
| text | Format string. |
| int GuiState_TryLoadPreview | ( | GuiState * | state, |
| const PokemonCatalogEntry * | entry | ||
| ) |
Attempts to load the preview for a Pokemon catalog entry.
| state | Global GUI state pointer. |
| entry | Pokemon catalog entry. |
| void GuiState_UnloadPreview | ( | GuiPreview * | p | ) |
Deallocates texture cache and color frames stored inside preview struct.
| p | Pointer to preview struct. |
| void GuiState_UpdatePreview | ( | GuiPreview * | p | ) |
Advances active viewport frame index based on real-world elapsed frame delta time.
| p | Pointer to active preview structure to advance. |