Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

game-string: manage game strings in libtrx #1526

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ Release/
subprojects/packagecache/
subprojects/dwarfstack-*/
subprojects/dwarfstack.wrap
subprojects/uthash-*/
subprojects/uthash.wrap
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ repos:
entry: tools/additional_lint
language: python
stages: [commit]

- id: imports
name: imports
entry: tools/sort_imports
language: system
files: \.[ch](pp)?$
6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ will be always considered supplementary.

This project uses [pre-commit](https://pre-commit.com/) to make sure the code
is formatted the right way. This tool has additional external dependencies:
`clang-format` for automatic code formatting and `include-what-you-use` to
remove unused `#include`s.
To install pre-commit:
`clang-format` for automatic code formatting. To install pre-commit:

```
python3 -m pip install --user pre-commit
Expand All @@ -83,7 +81,7 @@ pre-commit install
To install required external dependencies on Ubuntu:

```
apt-get install -y iwyu clang-format-18
apt-get install -y clang-format-18
```

After this, each time you make a commit a hook should trigger to automatically
Expand Down
7 changes: 0 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ endif

null_dep = dependency('', required: false)

if host_machine.system() == 'windows'
dep_opengl = c_compiler.find_library('opengl32')
else
dep_opengl = dependency('GL')
endif

dep_trx = trx.get_variable('dep_trx')
dep_avcodec = dependency('libavcodec', static: staticdeps)
dep_avformat = dependency('libavformat', static: staticdeps)
Expand Down Expand Up @@ -292,7 +286,6 @@ dependencies = [
dep_avformat,
dep_avutil,
dep_mathlibrary,
dep_opengl,
dep_sdl2,
dep_swresample,
dep_swscale,
Expand Down
1 change: 0 additions & 1 deletion src/game/clock.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// IWYU pragma: no_include <bits/types/struct_tm.h>
#include "game/clock.h"

#include "config.h"
Expand Down
55 changes: 5 additions & 50 deletions src/game/game_string.c
Original file line number Diff line number Diff line change
@@ -1,58 +1,13 @@
#include "game_string.h"

#include <libtrx/memory.h>
#include <libtrx/utils.h>
#include <libtrx/game/game_string.h>

#include <assert.h>
#include <stddef.h>
#include <string.h>

typedef struct ENUM_NAME_MAP {
const char *str;
const GAME_STRING_ID val;
} ENUM_NAME_MAP;

static ENUM_NAME_MAP m_EnumNameMap[];
static char *m_StringMap[GS_NUMBER_OF] = { 0 };
#undef GS_DEFINE
#define GS_DEFINE(id, str) str,
static const char *m_DefaultStringMap[GS_NUMBER_OF] = {
#include "game/game_string.def"
};

#undef GS_DEFINE
#define GS_DEFINE(id, str) \
{ \
QUOTE(id), \
GS_##id, \
},
static ENUM_NAME_MAP m_EnumNameMap[] = {
#include "game/game_string.def"
{ NULL, 0 },
};

void GameString_Set(GAME_STRING_ID id, const char *value)
{
assert(id >= 0);
assert(id < GS_NUMBER_OF);
Memory_FreePointer(&m_StringMap[id]);
m_StringMap[id] = Memory_DupStr(value);
}

const char *GameString_Get(GAME_STRING_ID id)
void GameString_Init(void)
{
return m_StringMap[id] != NULL ? (const char *)m_StringMap[id]
: m_DefaultStringMap[id];
#include "game_string.def"
}

GAME_STRING_ID GameString_IDFromEnum(const char *const str)
void GameString_Shutdown(void)
{
const ENUM_NAME_MAP *current = &m_EnumNameMap[0];
while (current->str) {
if (!strcmp(str, current->str)) {
return current->val;
}
current++;
}
return GS_INVALID;
GameString_Clear();
}
15 changes: 3 additions & 12 deletions src/game/game_string.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#pragma once

#define GS(id) GameString_Get(GS_##id)
#include <libtrx/game/game_string.h>

#undef GS_DEFINE
#define GS_DEFINE(id, str) GS_##id,
typedef enum GAME_STRING_ID {
GS_INVALID = -1,
#include "game/game_string.def"
GS_NUMBER_OF,
} GAME_STRING_ID;

void GameString_Set(GAME_STRING_ID id, const char *value);
const char *GameString_Get(GAME_STRING_ID id);
GAME_STRING_ID GameString_IDFromEnum(const char *str);
void GameString_Init(void);
void GameString_Shutdown(void);
11 changes: 6 additions & 5 deletions src/game/gameflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,14 @@ static bool GameFlow_LoadScriptGameStrings(struct json_object_s *obj)

struct json_object_element_s *strings_elem = strings_obj->start;
while (strings_elem) {
const GAME_STRING_ID key =
GameString_IDFromEnum(strings_elem->name->string);
const char *const key = strings_elem->name->string;
struct json_string_s *value = json_value_as_string(strings_elem->value);
if (!value || !value->string || key < 0 || key >= GS_NUMBER_OF) {
LOG_ERROR("invalid string key %s", strings_elem->name->string);
if (!GameString_IsKnown(key)) {
LOG_ERROR("invalid game string key: %s", key);
} else if (!value || value->string == NULL) {
LOG_ERROR("invalid game string value: %s", key);
} else {
GameString_Set(key, value->string);
GameString_Define(key, value->string);
}
strings_elem = strings_elem->next;
}
Expand Down
144 changes: 72 additions & 72 deletions src/game/option/option_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,86 +106,86 @@ static MENU m_ControlMenu = {
};

static const LAYOUT_NUM_GS_MAP m_LayoutMap[] = {
{ INPUT_LAYOUT_DEFAULT, GS_CONTROL_DEFAULT_KEYS },
{ INPUT_LAYOUT_CUSTOM_1, GS_CONTROL_CUSTOM_1 },
{ INPUT_LAYOUT_CUSTOM_2, GS_CONTROL_CUSTOM_2 },
{ INPUT_LAYOUT_CUSTOM_3, GS_CONTROL_CUSTOM_3 },
{ INPUT_LAYOUT_DEFAULT, GS_ID(CONTROL_DEFAULT_KEYS) },
{ INPUT_LAYOUT_CUSTOM_1, GS_ID(CONTROL_CUSTOM_1) },
{ INPUT_LAYOUT_CUSTOM_2, GS_ID(CONTROL_CUSTOM_2) },
{ INPUT_LAYOUT_CUSTOM_3, GS_ID(CONTROL_CUSTOM_3) },
};

static const TEXT_COLUMN_PLACEMENT CtrlTextPlacementNormal[] = {
{ INPUT_ROLE_UP, GS_KEYMAP_RUN, false },
{ INPUT_ROLE_DOWN, GS_KEYMAP_BACK, false },
{ INPUT_ROLE_LEFT, GS_KEYMAP_LEFT, false },
{ INPUT_ROLE_RIGHT, GS_KEYMAP_RIGHT, false },
{ INPUT_ROLE_DRAW, GS_KEYMAP_DRAW_WEAPON, false },
{ INPUT_ROLE_ACTION, GS_KEYMAP_ACTION, false },
{ INPUT_ROLE_JUMP, GS_KEYMAP_JUMP, false },
{ INPUT_ROLE_ROLL, GS_KEYMAP_ROLL, false },
{ INPUT_ROLE_LOOK, GS_KEYMAP_LOOK, false },
{ INPUT_ROLE_SLOW, GS_KEYMAP_WALK, false },
{ INPUT_ROLE_STEP_L, GS_KEYMAP_STEP_LEFT, true },
{ INPUT_ROLE_STEP_R, GS_KEYMAP_STEP_RIGHT, true },
{ INPUT_ROLE_OPTION, GS_KEYMAP_INVENTORY, false },
{ INPUT_ROLE_PAUSE, GS_KEYMAP_PAUSE, true },
{ INPUT_ROLE_CHANGE_TARGET, GS_KEYMAP_CHANGE_TARGET, true },
{ INPUT_ROLE_CAMERA_UP, GS_KEYMAP_CAMERA_UP, true },
{ INPUT_ROLE_CAMERA_DOWN, GS_KEYMAP_CAMERA_DOWN, true },
{ INPUT_ROLE_CAMERA_LEFT, GS_KEYMAP_CAMERA_LEFT, true },
{ INPUT_ROLE_CAMERA_RIGHT, GS_KEYMAP_CAMERA_RIGHT, true },
{ INPUT_ROLE_CAMERA_RESET, GS_KEYMAP_CAMERA_RESET, true },
{ INPUT_ROLE_EQUIP_PISTOLS, GS_KEYMAP_EQUIP_PISTOLS, true },
{ INPUT_ROLE_EQUIP_SHOTGUN, GS_KEYMAP_EQUIP_SHOTGUN, true },
{ INPUT_ROLE_EQUIP_MAGNUMS, GS_KEYMAP_EQUIP_MAGNUMS, true },
{ INPUT_ROLE_EQUIP_UZIS, GS_KEYMAP_EQUIP_UZIS, true },
{ INPUT_ROLE_USE_SMALL_MEDI, GS_KEYMAP_USE_SMALL_MEDI, true },
{ INPUT_ROLE_USE_BIG_MEDI, GS_KEYMAP_USE_BIG_MEDI, true },
{ INPUT_ROLE_SAVE, GS_KEYMAP_SAVE, true },
{ INPUT_ROLE_LOAD, GS_KEYMAP_LOAD, true },
{ INPUT_ROLE_FPS, GS_KEYMAP_FPS, true },
{ INPUT_ROLE_BILINEAR, GS_KEYMAP_BILINEAR, true },
{ INPUT_ROLE_ENTER_CONSOLE, GS_KEYMAP_ENTER_CONSOLE, true },
{ INPUT_ROLE_UP, GS_ID(KEYMAP_RUN), false },
{ INPUT_ROLE_DOWN, GS_ID(KEYMAP_BACK), false },
{ INPUT_ROLE_LEFT, GS_ID(KEYMAP_LEFT), false },
{ INPUT_ROLE_RIGHT, GS_ID(KEYMAP_RIGHT), false },
{ INPUT_ROLE_DRAW, GS_ID(KEYMAP_DRAW_WEAPON), false },
{ INPUT_ROLE_ACTION, GS_ID(KEYMAP_ACTION), false },
{ INPUT_ROLE_JUMP, GS_ID(KEYMAP_JUMP), false },
{ INPUT_ROLE_ROLL, GS_ID(KEYMAP_ROLL), false },
{ INPUT_ROLE_LOOK, GS_ID(KEYMAP_LOOK), false },
{ INPUT_ROLE_SLOW, GS_ID(KEYMAP_WALK), false },
{ INPUT_ROLE_STEP_L, GS_ID(KEYMAP_STEP_LEFT), true },
{ INPUT_ROLE_STEP_R, GS_ID(KEYMAP_STEP_RIGHT), true },
{ INPUT_ROLE_OPTION, GS_ID(KEYMAP_INVENTORY), false },
{ INPUT_ROLE_PAUSE, GS_ID(KEYMAP_PAUSE), true },
{ INPUT_ROLE_CHANGE_TARGET, GS_ID(KEYMAP_CHANGE_TARGET), true },
{ INPUT_ROLE_CAMERA_UP, GS_ID(KEYMAP_CAMERA_UP), true },
{ INPUT_ROLE_CAMERA_DOWN, GS_ID(KEYMAP_CAMERA_DOWN), true },
{ INPUT_ROLE_CAMERA_LEFT, GS_ID(KEYMAP_CAMERA_LEFT), true },
{ INPUT_ROLE_CAMERA_RIGHT, GS_ID(KEYMAP_CAMERA_RIGHT), true },
{ INPUT_ROLE_CAMERA_RESET, GS_ID(KEYMAP_CAMERA_RESET), true },
{ INPUT_ROLE_EQUIP_PISTOLS, GS_ID(KEYMAP_EQUIP_PISTOLS), true },
{ INPUT_ROLE_EQUIP_SHOTGUN, GS_ID(KEYMAP_EQUIP_SHOTGUN), true },
{ INPUT_ROLE_EQUIP_MAGNUMS, GS_ID(KEYMAP_EQUIP_MAGNUMS), true },
{ INPUT_ROLE_EQUIP_UZIS, GS_ID(KEYMAP_EQUIP_UZIS), true },
{ INPUT_ROLE_USE_SMALL_MEDI, GS_ID(KEYMAP_USE_SMALL_MEDI), true },
{ INPUT_ROLE_USE_BIG_MEDI, GS_ID(KEYMAP_USE_BIG_MEDI), true },
{ INPUT_ROLE_SAVE, GS_ID(KEYMAP_SAVE), true },
{ INPUT_ROLE_LOAD, GS_ID(KEYMAP_LOAD), true },
{ INPUT_ROLE_FPS, GS_ID(KEYMAP_FPS), true },
{ INPUT_ROLE_BILINEAR, GS_ID(KEYMAP_BILINEAR), true },
{ INPUT_ROLE_ENTER_CONSOLE, GS_ID(KEYMAP_ENTER_CONSOLE), true },
// end
{ COL_END, -1, false },
{ COL_END, NULL, false },
};

static const TEXT_COLUMN_PLACEMENT CtrlTextPlacementCheats[] = {
{ INPUT_ROLE_UP, GS_KEYMAP_RUN, false },
{ INPUT_ROLE_DOWN, GS_KEYMAP_BACK, false },
{ INPUT_ROLE_LEFT, GS_KEYMAP_LEFT, false },
{ INPUT_ROLE_RIGHT, GS_KEYMAP_RIGHT, false },
{ INPUT_ROLE_DRAW, GS_KEYMAP_DRAW_WEAPON, false },
{ INPUT_ROLE_ACTION, GS_KEYMAP_ACTION, false },
{ INPUT_ROLE_JUMP, GS_KEYMAP_JUMP, false },
{ INPUT_ROLE_ROLL, GS_KEYMAP_ROLL, false },
{ INPUT_ROLE_LOOK, GS_KEYMAP_LOOK, false },
{ INPUT_ROLE_SLOW, GS_KEYMAP_WALK, false },
{ INPUT_ROLE_STEP_L, GS_KEYMAP_STEP_LEFT, true },
{ INPUT_ROLE_STEP_R, GS_KEYMAP_STEP_RIGHT, true },
{ INPUT_ROLE_OPTION, GS_KEYMAP_INVENTORY, false },
{ INPUT_ROLE_PAUSE, GS_KEYMAP_PAUSE, true },
{ INPUT_ROLE_CHANGE_TARGET, GS_KEYMAP_CHANGE_TARGET, true },
{ INPUT_ROLE_CAMERA_UP, GS_KEYMAP_CAMERA_UP, true },
{ INPUT_ROLE_CAMERA_DOWN, GS_KEYMAP_CAMERA_DOWN, true },
{ INPUT_ROLE_CAMERA_LEFT, GS_KEYMAP_CAMERA_LEFT, true },
{ INPUT_ROLE_CAMERA_RIGHT, GS_KEYMAP_CAMERA_RIGHT, true },
{ INPUT_ROLE_CAMERA_RESET, GS_KEYMAP_CAMERA_RESET, true },
{ INPUT_ROLE_EQUIP_PISTOLS, GS_KEYMAP_EQUIP_PISTOLS, true },
{ INPUT_ROLE_EQUIP_SHOTGUN, GS_KEYMAP_EQUIP_SHOTGUN, true },
{ INPUT_ROLE_EQUIP_MAGNUMS, GS_KEYMAP_EQUIP_MAGNUMS, true },
{ INPUT_ROLE_EQUIP_UZIS, GS_KEYMAP_EQUIP_UZIS, true },
{ INPUT_ROLE_USE_SMALL_MEDI, GS_KEYMAP_USE_SMALL_MEDI, true },
{ INPUT_ROLE_USE_BIG_MEDI, GS_KEYMAP_USE_BIG_MEDI, true },
{ INPUT_ROLE_SAVE, GS_KEYMAP_SAVE, true },
{ INPUT_ROLE_LOAD, GS_KEYMAP_LOAD, true },
{ INPUT_ROLE_FPS, GS_KEYMAP_FPS, true },
{ INPUT_ROLE_BILINEAR, GS_KEYMAP_BILINEAR, true },
{ INPUT_ROLE_FLY_CHEAT, GS_KEYMAP_FLY_CHEAT, true },
{ INPUT_ROLE_ITEM_CHEAT, GS_KEYMAP_ITEM_CHEAT, true },
{ INPUT_ROLE_LEVEL_SKIP_CHEAT, GS_KEYMAP_LEVEL_SKIP_CHEAT, true },
{ INPUT_ROLE_TURBO_CHEAT, GS_KEYMAP_TURBO_CHEAT, true },
{ INPUT_ROLE_ENTER_CONSOLE, GS_KEYMAP_ENTER_CONSOLE, true },
{ INPUT_ROLE_UP, GS_ID(KEYMAP_RUN), false },
{ INPUT_ROLE_DOWN, GS_ID(KEYMAP_BACK), false },
{ INPUT_ROLE_LEFT, GS_ID(KEYMAP_LEFT), false },
{ INPUT_ROLE_RIGHT, GS_ID(KEYMAP_RIGHT), false },
{ INPUT_ROLE_DRAW, GS_ID(KEYMAP_DRAW_WEAPON), false },
{ INPUT_ROLE_ACTION, GS_ID(KEYMAP_ACTION), false },
{ INPUT_ROLE_JUMP, GS_ID(KEYMAP_JUMP), false },
{ INPUT_ROLE_ROLL, GS_ID(KEYMAP_ROLL), false },
{ INPUT_ROLE_LOOK, GS_ID(KEYMAP_LOOK), false },
{ INPUT_ROLE_SLOW, GS_ID(KEYMAP_WALK), false },
{ INPUT_ROLE_STEP_L, GS_ID(KEYMAP_STEP_LEFT), true },
{ INPUT_ROLE_STEP_R, GS_ID(KEYMAP_STEP_RIGHT), true },
{ INPUT_ROLE_OPTION, GS_ID(KEYMAP_INVENTORY), false },
{ INPUT_ROLE_PAUSE, GS_ID(KEYMAP_PAUSE), true },
{ INPUT_ROLE_CHANGE_TARGET, GS_ID(KEYMAP_CHANGE_TARGET), true },
{ INPUT_ROLE_CAMERA_UP, GS_ID(KEYMAP_CAMERA_UP), true },
{ INPUT_ROLE_CAMERA_DOWN, GS_ID(KEYMAP_CAMERA_DOWN), true },
{ INPUT_ROLE_CAMERA_LEFT, GS_ID(KEYMAP_CAMERA_LEFT), true },
{ INPUT_ROLE_CAMERA_RIGHT, GS_ID(KEYMAP_CAMERA_RIGHT), true },
{ INPUT_ROLE_CAMERA_RESET, GS_ID(KEYMAP_CAMERA_RESET), true },
{ INPUT_ROLE_EQUIP_PISTOLS, GS_ID(KEYMAP_EQUIP_PISTOLS), true },
{ INPUT_ROLE_EQUIP_SHOTGUN, GS_ID(KEYMAP_EQUIP_SHOTGUN), true },
{ INPUT_ROLE_EQUIP_MAGNUMS, GS_ID(KEYMAP_EQUIP_MAGNUMS), true },
{ INPUT_ROLE_EQUIP_UZIS, GS_ID(KEYMAP_EQUIP_UZIS), true },
{ INPUT_ROLE_USE_SMALL_MEDI, GS_ID(KEYMAP_USE_SMALL_MEDI), true },
{ INPUT_ROLE_USE_BIG_MEDI, GS_ID(KEYMAP_USE_BIG_MEDI), true },
{ INPUT_ROLE_SAVE, GS_ID(KEYMAP_SAVE), true },
{ INPUT_ROLE_LOAD, GS_ID(KEYMAP_LOAD), true },
{ INPUT_ROLE_FPS, GS_ID(KEYMAP_FPS), true },
{ INPUT_ROLE_BILINEAR, GS_ID(KEYMAP_BILINEAR), true },
{ INPUT_ROLE_FLY_CHEAT, GS_ID(KEYMAP_FLY_CHEAT), true },
{ INPUT_ROLE_ITEM_CHEAT, GS_ID(KEYMAP_ITEM_CHEAT), true },
{ INPUT_ROLE_LEVEL_SKIP_CHEAT, GS_ID(KEYMAP_LEVEL_SKIP_CHEAT), true },
{ INPUT_ROLE_TURBO_CHEAT, GS_ID(KEYMAP_TURBO_CHEAT), true },
{ INPUT_ROLE_ENTER_CONSOLE, GS_ID(KEYMAP_ENTER_CONSOLE), true },
// end
{ COL_END, -1, false },
{ COL_END, NULL, false },
};

static void Option_Control_InitMenu(void);
Expand Down
27 changes: 15 additions & 12 deletions src/game/option/option_graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,21 @@ typedef struct GRAPHICS_MENU {
} GRAPHICS_MENU;

static const GRAPHICS_OPTION_ROW m_GfxOptionRows[] = {
{ OPTION_FPS, GS_DETAIL_FPS, GS_DETAIL_DECIMAL_FMT },
{ OPTION_TEXTURE_FILTER, GS_DETAIL_TEXTURE_FILTER, GS_MISC_OFF },
{ OPTION_FBO_FILTER, GS_DETAIL_FBO_FILTER, GS_MISC_OFF },
{ OPTION_VSYNC, GS_DETAIL_VSYNC, GS_MISC_ON },
{ OPTION_BRIGHTNESS, GS_DETAIL_BRIGHTNESS, GS_DETAIL_FLOAT_FMT },
{ OPTION_UI_TEXT_SCALE, GS_DETAIL_UI_TEXT_SCALE, GS_DETAIL_FLOAT_FMT },
{ OPTION_UI_BAR_SCALE, GS_DETAIL_UI_BAR_SCALE, GS_DETAIL_FLOAT_FMT },
{ OPTION_RENDER_MODE, GS_DETAIL_RENDER_MODE, GS_DETAIL_STRING_FMT },
{ OPTION_RESOLUTION, GS_DETAIL_RESOLUTION, GS_DETAIL_RESOLUTION_FMT },
{ OPTION_PERSPECTIVE, GS_DETAIL_PERSPECTIVE, GS_MISC_ON },
{ OPTION_PRETTY_PIXELS, GS_DETAIL_PRETTY_PIXELS, GS_MISC_ON },
{ OPTION_REFLECTIONS, GS_DETAIL_REFLECTIONS, GS_MISC_ON },
{ OPTION_FPS, GS_ID(DETAIL_FPS), GS_ID(DETAIL_DECIMAL_FMT) },
{ OPTION_TEXTURE_FILTER, GS_ID(DETAIL_TEXTURE_FILTER), GS_ID(MISC_OFF) },
{ OPTION_FBO_FILTER, GS_ID(DETAIL_FBO_FILTER), GS_ID(MISC_OFF) },
{ OPTION_VSYNC, GS_ID(DETAIL_VSYNC), GS_ID(MISC_ON) },
{ OPTION_BRIGHTNESS, GS_ID(DETAIL_BRIGHTNESS), GS_ID(DETAIL_FLOAT_FMT) },
{ OPTION_UI_TEXT_SCALE, GS_ID(DETAIL_UI_TEXT_SCALE),
GS_ID(DETAIL_FLOAT_FMT) },
{ OPTION_UI_BAR_SCALE, GS_ID(DETAIL_UI_BAR_SCALE),
GS_ID(DETAIL_FLOAT_FMT) },
{ OPTION_RENDER_MODE, GS_ID(DETAIL_RENDER_MODE), GS_ID(DETAIL_STRING_FMT) },
{ OPTION_RESOLUTION, GS_ID(DETAIL_RESOLUTION),
GS_ID(DETAIL_RESOLUTION_FMT) },
{ OPTION_PERSPECTIVE, GS_ID(DETAIL_PERSPECTIVE), GS_ID(MISC_ON) },
{ OPTION_PRETTY_PIXELS, GS_ID(DETAIL_PRETTY_PIXELS), GS_ID(MISC_ON) },
{ OPTION_REFLECTIONS, GS_ID(DETAIL_REFLECTIONS), GS_ID(MISC_ON) },
// end
{ OPTION_NUMBER_OF, 0, 0 },
};
Expand Down
2 changes: 2 additions & 0 deletions src/game/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void Shell_Shutdown(void)

void Shell_Main(void)
{
GameString_Init();
Config_Read();

const char *gameflow_path = m_TR1XGameflowPath;
Expand Down Expand Up @@ -269,6 +270,7 @@ void Shell_Main(void)
}

Config_Write();
GameString_Shutdown();
}

void Shell_ExitSystem(const char *message)
Expand Down
2 changes: 0 additions & 2 deletions src/specific/s_fmv.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

// IWYU pragma: no_include <libavcodec/defs.h>

#include "specific/s_fmv.h"

#include "config.h"
Expand Down
Loading