naev 0.12.6
ndata.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include <stdlib.h>
7
8/*
9 * Define various paths
10 */
11#define SPOB_GFX_SPACE3D_PATH \
12 "gfx/spob/space3d/"
13#define SPOB_GFX_SPACE_PATH \
14 "gfx/spob/space/"
15#define SPOB_GFX_EXTERIOR_PATH \
16 "gfx/spob/exterior/"
18#define SPOB_GFX_COMM_PATH \
19 "gfx/spob/comm/"
21#define GFX_PATH "gfx/"
22#define OVERLAY_GFX_PATH \
23 "gfx/overlays/"
25#define GUI_GFX_PATH "gfx/gui/"
26#define PORTRAIT_GFX_PATH \
27 "gfx/portraits/"
28#define SHIP_GFX_PATH "gfx/ship/"
29#define SHIP_3DGFX_PATH "gfx/ship3d/"
30#define OUTFIT_GFX_PATH "gfx/outfit/"
31#define SPFX_GFX_PATH "gfx/spfx/"
32#define FACTION_LOGO_PATH "gfx/logo/"
33#define SOUND_PATH "snd/sounds/"
34#define COMMODITY_GFX_PATH \
35 "gfx/commodity/"
36#define MAP_DECORATOR_GFX_PATH "gfx/map/"
37#define SHIP_POLYGON_PATH3D \
38 "collision/ship/"
39#define SHIP_POLYGON_PATH \
40 "gfx/ship_polygon/"
41#define OUTFIT_POLYGON_PATH \
42 "gfx/outfit/space_polygon/"
43#define ASTEROID_POLYGON_PATH \
44 "gfx/spob/space/asteroid_polygon/"
46
47#define FACTION_DATA_PATH "factions/"
48#define MISSION_DATA_PATH "missions/"
49#define EVENT_DATA_PATH "events/"
50#define UNIDIFF_DATA_PATH "unidiff/"
51#define SPFX_DATA_PATH "spfx/"
52#define DTYPE_DATA_PATH "damagetype/"
53#define SP_DATA_PATH "slots/"
54#define COMMODITY_DATA_PATH "commodities/"
55#define TECH_DATA_PATH "tech/"
56#define ASTEROID_TYPES_DATA_PATH \
57 "asteroids/types/"
58#define ASTEROID_GROUPS_DATA_PATH \
59 "asteroids/groups/"
60#define MAP_DECORATOR_DATA_PATH \
61 "map_decorator/"
62#define TRAIL_DATA_PATH "trails/"
63
64#define MISSION_LUA_PATH "missions/"
65#define EVENT_LUA_PATH "events/"
66#define OUTFIT_DATA_PATH "outfits/"
67#define EFFECT_DATA_PATH "effects/"
68#define MAP_DATA_PATH "outfits/maps/"
69#define SPOB_DATA_PATH "spob/"
70#define SPOB_DATA_LUA_PATH "spob/lua/"
71#define VIRTUALSPOB_DATA_PATH "spob_virtual/"
72#define SYSTEM_DATA_PATH "ssys/"
73#define SHIP_DATA_PATH "ships/"
74#define SHIP_DATA_LUA_PATH "ships/lua/"
75
76#define LUA_COMMON_PATH "common.lua"
77#define LOADSCREEN_DATA_PATH \
78 "loadscreen.lua"
79
80#define MUSIC_PATH "snd/music/"
81#define MUSIC_LUA_PATH "snd/music.lua"
82
83#define START_DATA_PATH "start.xml"
84
85/* Fonts should be defined in start.xml probably. */
86/* Currently our fonts/Cabin-SemiBold.otf lacks many fairly standard glyphs, so
87 * we are falling back to the monospace font which has better coverage.
88 * TODO solve this issue in a sane way. */
89#define FONT_PATH_PREFIX "fonts/"
90/* Default font path. */
91#define FONT_DEFAULT_PATH \
92 N_( "Cabin-SemiBold.otf,NanumBarunGothicBold.ttf,SourceCodePro-Semibold." \
93 "ttf,IBMPlexSansJP-Medium.otf" )
94/* Default monospace font path. */
95#define FONT_MONOSPACE_PATH \
96 N_( "SourceCodePro-Semibold.ttf,D2CodingBold.ttf,IBMPlexSansJP-Medium." \
97 "otf" )
98
99#define LUA_INCLUDE_PATH "scripts/"
100#define AI_PATH "ai/"
101
102#define GLSL_PATH "glsl/"
103
104#define AI_EQUIP_PATH "factions/equip/generic.lua"
105#define GUI_PATH "gui/"
106#define FACTIONS_PATH "factions/"
107#define GETTEXT_PATH "gettext/" /* Doesn't use ndata functions. */
108#define GETTEXT_STATS_PATH "gettext_stats/"
109#define BACKGROUND_PATH "bkg/"
110#define INTRO_PATH "intro"
111#define RESCUE_PATH "rescue.lua"
112#define AUTOEQUIP_PATH "autoequip.lua"
113#define AUTONAV_PATH "autonav.lua"
114#define COMM_PATH "comm.lua"
115#define BOARD_PATH "board.lua"
116#define SCAN_PATH "scan.lua"
117#define SAVE_UPDATER_PATH "save_updater.lua"
118#define DIFFICULTY_PATH "difficulty/"
119
120const char *ndata_primaryPath( void );
121void ndata_setupWriteDir( void );
122void ndata_setupReadDirs( void );
123void *ndata_read( const char *filename, size_t *filesize );
124char **ndata_listRecursive( const char *path );
125int ndata_backupIfExists( const char *path );
126int ndata_copyIfExists( const char *path1, const char *path2 );
127int ndata_matchExt( const char *path, const char *ext );
128int ndata_getPathDefault( char *path, int len, const char *default_path,
129 const char *filename );
int ndata_backupIfExists(const char *path)
Backup a file, if it exists.
Definition ndata.c:336
void ndata_setupReadDirs(void)
Sets up the PhysicsFS search path.
Definition ndata.c:155
int ndata_copyIfExists(const char *file1, const char *file2)
Copy a file, if it exists.
Definition ndata.c:358
void ndata_setupWriteDir(void)
Gets Naev's data path (for user data such as saves and screenshots)
Definition ndata.c:132
void * ndata_read(const char *path, size_t *filesize)
Reads a file from the ndata (will be NUL terminated).
Definition ndata.c:207
int ndata_matchExt(const char *path, const char *ext)
Sees if a file matches an extension.
Definition ndata.c:420
char ** ndata_listRecursive(const char *path)
Lists all the visible files in a directory, at any depth.
Definition ndata.c:286
const char * ndata_primaryPath(void)
Gets the primary path for where the data is.
Definition ndata.c:48
int ndata_getPathDefault(char *path, int len, const char *default_path, const char *filename)
Tries to see if a file is in a default path before seeing if it is an absolute path.
Definition ndata.c:442