AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
Data Structures | Macros | Functions | Variables
gui_view_rom.c File Reference

Implementations of the ROM browser file explorer GUI layout views. More...

#include "gui_view_rom.h"
#include "gui_widgets.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>

Data Structures

struct  ExplorerEntry
 

Macros

#define IS_WINDOWS   0
 
#define SYSTEM_ROOT   "/"
 
#define MAX_EXPLORER_ENTRIES   1024
 

Functions

static GrColor Gc (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 Constructs a GrColor value. More...
 
static int CompareExplorerEntries (const void *a, const void *b)
 Sorting comparator function for ExplorerEntry list items. More...
 
static void RefreshExplorerDir (const char *path)
 Reloads explorer cache of directories and files matching path. More...
 
static int CaseInsensitiveContains (const char *haystack, const char *needle)
 Helper for case-insensitive substring matching in explorer filtering. More...
 
static void ExplorerGoUp (void)
 Navigates the current file explorer path up to its parent folder. More...
 
static void ExplorerNavigateTo (const char *subdir)
 Navigates the current file explorer path down into a subfolder. More...
 
void GuiView_DrawRomScreen (GuiState *state)
 Renders the ROM selection interface and explorer side panels. More...
 

Variables

static ExplorerEntry explorer_entries [MAX_EXPLORER_ENTRIES]
 
static int explorer_entry_count = 0
 
static char current_dir [4096] = ""
 
static char explorer_search [256] = ""
 
static int explorer_search_active = 0
 
static int explorer_scroll = 0
 
static int selected_idx = -1
 
static int explorer_initialized = 0
 
static float last_click_time = 0.0f
 
static int last_clicked_row = -1
 

Detailed Description

Implementations of the ROM browser file explorer GUI layout views.

Macro Definition Documentation

◆ IS_WINDOWS

#define IS_WINDOWS   0

◆ MAX_EXPLORER_ENTRIES

#define MAX_EXPLORER_ENTRIES   1024

◆ SYSTEM_ROOT

#define SYSTEM_ROOT   "/"

Function Documentation

◆ CaseInsensitiveContains()

static int CaseInsensitiveContains ( const char *  haystack,
const char *  needle 
)
static

Helper for case-insensitive substring matching in explorer filtering.

Parameters
haystackTarget string.
needleSubstring pattern.
Returns
1 if found; 0 if mismatch.

◆ CompareExplorerEntries()

static int CompareExplorerEntries ( const void *  a,
const void *  b 
)
static

Sorting comparator function for ExplorerEntry list items.

Parameters
aLHS element.
bRHS element.
Returns
Relative ordering value.

◆ ExplorerGoUp()

static void ExplorerGoUp ( void  )
static

Navigates the current file explorer path up to its parent folder.

◆ ExplorerNavigateTo()

static void ExplorerNavigateTo ( const char *  subdir)
static

Navigates the current file explorer path down into a subfolder.

Parameters
subdirTarget directory name.

◆ Gc()

static GrColor Gc ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
)
static

Constructs a GrColor value.

Parameters
rRed channel.
gGreen channel.
bBlue channel.
aAlpha channel.
Returns
Constructed GrColor struct.

◆ GuiView_DrawRomScreen()

void GuiView_DrawRomScreen ( GuiState state)

Renders the ROM selection interface and explorer side panels.

Parameters
stateGlobal GUI state pointer.

◆ RefreshExplorerDir()

static void RefreshExplorerDir ( const char *  path)
static

Reloads explorer cache of directories and files matching path.

Parameters
pathTarget directory path.

Variable Documentation

◆ current_dir

char current_dir[4096] = ""
static

◆ explorer_entries

ExplorerEntry explorer_entries[MAX_EXPLORER_ENTRIES]
static

◆ explorer_entry_count

int explorer_entry_count = 0
static

◆ explorer_initialized

int explorer_initialized = 0
static

◆ explorer_scroll

int explorer_scroll = 0
static

◆ explorer_search

char explorer_search[256] = ""
static

◆ explorer_search_active

int explorer_search_active = 0
static

◆ last_click_time

float last_click_time = 0.0f
static

◆ last_clicked_row

int last_clicked_row = -1
static

◆ selected_idx

int selected_idx = -1
static