Revert "Header cleanups - don't include retroarch.h everywhere"

This reverts commit 0e3b478f8c.
This commit is contained in:
libretroadmin 2023-01-08 09:05:46 +01:00
parent 0e3b478f8c
commit 8a3686df58
64 changed files with 166 additions and 70 deletions

View file

@ -30,6 +30,7 @@
#include "config.h"
#endif
#include "retroarch.h"
#include "verbosity.h"
#include "core_info.h"

View file

@ -26,7 +26,6 @@
#include "core_option_manager.h"
#include "msg_hash.h"
#include "retroarch.h"
/*********************/
/* Option Conversion */

View file

@ -24,7 +24,7 @@
#include <file/file_path.h>
#include "paths.h"
#include "runloop.h"
#include "retroarch.h"
#include "verbosity.h"
#include "msg_hash.h"

View file

@ -22,6 +22,7 @@
#include <d3d8.h>
#include "../../retroarch.h"
#include "../../verbosity.h"
RETRO_BEGIN_DECLS

View file

@ -24,6 +24,7 @@
#include <d3d9.h>
#include "d3d_common.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#define D3D9_DECL_FVF_TEXCOORD(stream, offset, index) \

View file

@ -35,9 +35,9 @@
#include <dxgi.h>
#include "../../driver.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#ifdef HAVE_REWIND
#include "../../state_manager.h"
#endif

View file

@ -43,6 +43,7 @@
#include "../common/d3d_common.h"
#include "../video_coord_array.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../dynamic.h"
#include "../../frontend/frontend_driver.h"

View file

@ -50,7 +50,6 @@
#include "../include/Cg/cgD3D9.h"
#include "../video_coord_array.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../dynamic.h"
#include "../../frontend/frontend_driver.h"
@ -67,6 +66,7 @@
#include "../../core.h"
#include "../../verbosity.h"
#include "../../retroarch.h"
#ifdef __WINRT__
#error "UWP does not support D3D9"

View file

@ -47,6 +47,7 @@
#include "../../driver.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../frontend/frontend_driver.h"
#include "../common/gl1_common.h"

View file

@ -54,10 +54,10 @@
#include "../../driver.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#ifdef HAVE_REWIND
#include "../../state_manager.h"
#endif
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../video_coord_array.h"

View file

@ -49,8 +49,8 @@
#ifdef HAVE_REWIND
#include "../../state_manager.h"
#endif
#include "../../retroarch.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../record/record_driver.h"

View file

@ -15,6 +15,7 @@
*/
#include <signal.h>
#include <retroarch.h>
#ifdef HAVE_CONFIG_H
#include "../../config.h"
@ -25,6 +26,7 @@
#endif
#include "../../frontend/frontend_driver.h"
#include "../../verbosity.h"
typedef struct
{

View file

@ -42,6 +42,7 @@
#include "../../configuration.h"
#include "../../dynamic.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../frontend/frontend_driver.h"

View file

@ -41,6 +41,7 @@
#include "../../configuration.h"
#include "../../dynamic.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../frontend/frontend_driver.h"

View file

@ -24,6 +24,7 @@
#include "../gfx_display.h"
#include "../../retroarch.h"
#include "../common/d3d10_common.h"
static void gfx_display_d3d10_blend_begin(void *data)

View file

@ -23,6 +23,7 @@
#include "../gfx_display.h"
#include "../../retroarch.h"
#include "../common/d3d11_common.h"
static void gfx_display_d3d11_blend_begin(void *data)

View file

@ -23,6 +23,7 @@
#include "../gfx_display.h"
#include "../../retroarch.h"
#include "../common/d3d12_common.h"
static void gfx_display_d3d12_blend_begin(void *data)

View file

@ -25,6 +25,7 @@
#include "../gfx_display.h"
#include "../../retroarch.h"
#include "../common/d3d_common.h"
#include "../common/d3d8_common.h"

View file

@ -25,6 +25,7 @@
#include "../gfx_display.h"
#include "../../retroarch.h"
#include "../common/d3d_common.h"
#include "../common/d3d9_common.h"

View file

@ -25,6 +25,7 @@
#include "../gfx_display.h"
#include "../../retroarch.h"
#include "../common/d3d_common.h"
#include "../common/d3d9_common.h"

View file

@ -21,6 +21,8 @@
#include <retro_miscellaneous.h>
#include "../../config.def.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../gfx_display.h"

View file

@ -20,6 +20,7 @@
#include "../../config.h"
#endif
#include "../../retroarch.h"
#include "../common/gl1_common.h"
#include "../gfx_display.h"

View file

@ -19,6 +19,7 @@
#include "../../config.h"
#endif
#include "../../retroarch.h"
#include "../common/gl2_common.h"
#include "../gfx_display.h"

View file

@ -24,6 +24,8 @@
#include "../gfx_display.h"
#include "../../retroarch.h"
static const float gl3_vertexes[] = {
0, 0,
1, 0,

View file

@ -21,6 +21,7 @@
#include "../gfx_display.h"
#include "../../retroarch.h"
#import "../common/metal_common.h"
static const float *gfx_display_metal_get_default_vertices(void)

View file

@ -22,6 +22,7 @@
#include "../gfx_display.h"
#include "../../retroarch.h"
#include "../common/vulkan_common.h"
/* Will do Y-flip later, but try to make it similar to GL. */

View file

@ -27,7 +27,7 @@
#include "../../config.h"
#endif
#include "../video_defines.h"
#include "../../retroarch.h"
#include "../common/gdi_common.h"
#include "../common/win32_common.h"

View file

@ -21,6 +21,7 @@
#include <retro_common_api.h>
#include "../video_shader_parse.h"
#include "../../retroarch.h"
#include "slang_reflection.h"
#include "glslang_util.h"

View file

@ -22,8 +22,9 @@
#include <boolean.h>
#include <retro_common_api.h>
#include "../retroarch.h"
#include "video_defines.h"
#include "video_driver.h"
RETRO_BEGIN_DECLS

View file

@ -29,6 +29,7 @@
#include <formats/image.h>
#include <gfx/math/matrix_4x4.h>
#include "../retroarch.h"
#include "../gfx/font_driver.h"
RETRO_BEGIN_DECLS

View file

@ -45,7 +45,6 @@
#include "../file_path_special.h"
#include "../paths.h"
#include "../retroarch.h"
#include "../runloop.h"
#if defined(HAVE_GFX_WIDGETS)
#include "gfx_widgets.h"

View file

@ -27,6 +27,7 @@
#include "video_thread_wrapper.h"
#include "font_driver.h"
#include "../retroarch.h"
#include "../runloop.h"
#include "../verbosity.h"

View file

@ -52,6 +52,8 @@
#include "../input_keymaps.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
/* Context has to be global as joypads also ride on this context. */
LPDIRECTINPUT8 g_dinput_ctx;

View file

@ -27,6 +27,8 @@
#include "../input_keymaps.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../tasks/tasks_internal.h"
#ifdef HAVE_SDL2

View file

@ -42,6 +42,7 @@ extern "C" {
#include "../input_keymaps.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
typedef struct
@ -129,13 +130,17 @@ static void winraw_destroy_window(HWND wnd)
static BOOL winraw_set_keyboard_input(HWND window)
{
RAWINPUTDEVICE rid;
settings_t *settings = config_get_ptr();
rid.dwFlags = window ? 0 : RIDEV_REMOVE;
rid.hwndTarget = window;
rid.usUsagePage = 0x01; /* Generic desktop */
rid.usUsage = 0x06; /* Keyboard */
settings_t *settings;
settings = config_get_ptr();
rid.dwFlags = window ? 0 : RIDEV_REMOVE;
rid.hwndTarget = window;
rid.usUsagePage = 0x01; /* Generic desktop */
rid.usUsage = 0x06; /* Keyboard */
if (settings->bools.input_nowinkey_enable)
rid.dwFlags |= RIDEV_NOHOTKEYS; /* Disable win keys while focused */
rid.dwFlags |= RIDEV_NOHOTKEYS; /* Disable win keys while focused */
return RegisterRawInputDevices(&rid, 1, sizeof(RAWINPUTDEVICE));
}

View file

@ -1,6 +1,6 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2015 - Hans-Kristian Arntzen
* Copyright (C) 2011-2023 - Daniel De Matteis
* Copyright (C) 2011-2017 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
@ -29,6 +29,7 @@
#include "../common/input_x11_common.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
typedef struct x11_input

View file

@ -31,9 +31,8 @@
#endif
#include "../../tasks/tasks_internal.h"
#include "../../gfx/video_driver.h"
#include "../input_driver.h"
#include "../input_keymaps.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "dinput_joypad.h"

View file

@ -42,9 +42,12 @@
#include "../../config.h"
#endif
#include "../input_driver.h"
#include "../../gfx/video_driver.h"
#include "../../config.def.h"
#include "../../tasks/tasks_internal.h"
#include "../input_driver.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "dinput_joypad.h"

View file

@ -1,10 +1,11 @@
#include <stdint.h>
#include <stdio.h>
#include "../led_driver.h"
#include "../led_defines.h"
#include "../../input/input_overlay.h"
#include "../../configuration.h"
#include "../../retroarch.h"
typedef struct
{

View file

@ -1,8 +1,9 @@
#include <stdint.h>
#include <stdio.h>
#include "../led_driver.h"
#include "../led_defines.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include <windows.h>

View file

@ -25,7 +25,6 @@
#include "../menu_driver.h"
#include "../menu_cbs.h"
#include "../../msg_hash.h"
#include "../../runloop.h"
#include "../../database_info.h"

View file

@ -41,8 +41,6 @@
#endif
#include "../../performance_counters.h"
#include "../../paths.h"
#include "../../retroarch.h"
#include "../../runloop.h"
#include "../../verbosity.h"
#ifdef HAVE_BLUETOOTH
#include "../../bluetooth/bluetooth_driver.h"

View file

@ -23,6 +23,7 @@
#include "../menu_cbs.h"
#include "../../input/input_remapping.h"
#include "../../retroarch.h"
#include "../../core_option_manager.h"
#ifdef HAVE_CHEEVOS

View file

@ -52,8 +52,6 @@
#include "../../audio/audio_driver.h"
#include "../../tasks/tasks_internal.h"
#include "../../runtime_file.h"
#include "../../retroarch.h"
#include "../../runloop.h"
#include "../../file_path_special.h"
#include "../../list_special.h"

View file

@ -35,8 +35,6 @@
#include "../../config.def.h"
#include "../../file_path_special.h"
#include "../../retroarch.h"
#include "../../runloop.h"
#ifdef HAVE_DISCORD_OWN_AVATAR
#include "../../discord/discord.h"

View file

@ -52,7 +52,6 @@
#include "../../configuration.h"
#include "../../file_path_special.h"
#include "../../runloop.h"
#include "../../gfx/drivers_font_renderer/bitmap.h"
#ifdef HAVE_LANGEXTRA

View file

@ -50,8 +50,6 @@
#include "../../core_info.h"
#include "../../core.h"
#include "../../retroarch.h"
#include "../../runloop.h"
#include "../../input/input_osk.h"

View file

@ -24,6 +24,7 @@
#include "menu_driver.h"
#include "menu_displaylist.h"
#include "../file_path_special.h"
#include "../retroarch.h"
#include "../core_info.h"
#include "../configuration.h"

View file

@ -46,11 +46,9 @@
#include "menu_driver.h"
#include "menu_cbs.h"
#include "../core_option_manager.h"
#include "../driver.h"
#include "../list_special.h"
#include "../paths.h"
#include "../retroarch.h"
#include "../tasks/task_powerstate.h"
#include "../tasks/tasks_internal.h"
#include "../verbosity.h"

View file

@ -25,10 +25,10 @@
#include "menu_driver.h"
#include "menu_cbs.h"
#include "../retroarch.h"
#include "../configuration.h"
#include "../file_path_special.h"
#include "../playlist.h"
#include "../runloop.h"
#include "../verbosity.h"
#include "../libretro-db/libretrodb.h"
#include "../tasks/tasks_internal.h"

View file

@ -21,6 +21,7 @@
#include <libretro.h>
#include "menu_defines.h"
#include "../retroarch.h"
#include "../gfx/gfx_display.h"
#include "../gfx/gfx_animation.h"

View file

@ -16,6 +16,7 @@
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <retro_assert.h>
@ -66,6 +67,7 @@ extern "C" {
}
#endif
#include "../../retroarch.h"
#include "../../verbosity.h"
#define FFMPEG3 (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))

View file

@ -25,6 +25,7 @@
#include "../list_special.h"
#include "../gfx/video_driver.h"
#include "../paths.h"
#include "../retroarch.h"
#include "../runloop.h"
#include "../verbosity.h"
@ -66,6 +67,71 @@ const char* config_get_record_driver_options(void)
return char_list_new_special(STRING_LIST_RECORD_DRIVERS, NULL);
}
#if 0
/* TODO/FIXME - not used apparently */
static void find_record_driver(const char *prefix,
bool verbosity_enabled)
{
settings_t *settings = config_get_ptr();
int i = (int)driver_find_index(
"record_driver",
settings->arrays.record_driver);
if (i >= 0)
recording_state.driver = (const record_driver_t*)record_drivers[i];
else
{
if (verbosity_enabled)
{
unsigned d;
RARCH_ERR("[Recording]: Couldn't find any %s named \"%s\".\n", prefix,
settings->arrays.record_driver);
RARCH_LOG_OUTPUT("Available %ss are:\n", prefix);
for (d = 0; record_drivers[d]; d++)
RARCH_LOG_OUTPUT("\t%s\n", record_drivers[d].ident);
RARCH_WARN("[Recording]: Going to default to first %s...\n", prefix);
}
recording_state.driver = (const record_driver_t*)record_drivers[0];
if (!recording_state.driver)
retroarch_fail(1, "find_record_driver()");
}
}
/**
* ffemu_find_backend:
* @ident : Identifier of driver to find.
*
* Finds a recording driver with the name @ident.
*
* Returns: recording driver handle if successful, otherwise
* NULL.
**/
static const record_driver_t *ffemu_find_backend(const char *ident)
{
unsigned i;
for (i = 0; record_drivers[i]; i++)
{
if (string_is_equal(record_drivers[i]->ident, ident))
return record_drivers[i];
}
return NULL;
}
static void recording_driver_free_state(void)
{
/* TODO/FIXME - this is not being called anywhere */
recording_state.gpu_width = 0;
recording_state.gpu_height = 0;
recording_state.width = 0;
recording_stte.height = 0;
}
#endif
/**
* gfx_ctx_init_first:
* @param backend

View file

@ -700,10 +700,14 @@ char *path_get_ptr(enum rarch_path_type type)
return p_rarch->path_content;
case RARCH_PATH_DEFAULT_SHADER_PRESET:
return p_rarch->path_default_shader_preset;
case RARCH_PATH_BASENAME:
return runloop_st->runtime_content_path_basename;
case RARCH_PATH_CORE_OPTIONS:
if (!path_is_empty(RARCH_PATH_CORE_OPTIONS))
return p_rarch->path_core_options_file;
break;
case RARCH_PATH_SUBSYSTEM:
return runloop_st->subsystem_path;
case RARCH_PATH_CONFIG:
if (!path_is_empty(RARCH_PATH_CONFIG))
return p_rarch->path_config_file;
@ -717,11 +721,6 @@ char *path_get_ptr(enum rarch_path_type type)
case RARCH_PATH_NONE:
case RARCH_PATH_NAMES:
break;
/* Runloop-related paths */
case RARCH_PATH_BASENAME:
return runloop_st->runtime_content_path_basename;
case RARCH_PATH_SUBSYSTEM:
return runloop_st->subsystem_path;
}
return NULL;
@ -738,10 +737,14 @@ const char *path_get(enum rarch_path_type type)
return p_rarch->path_content;
case RARCH_PATH_DEFAULT_SHADER_PRESET:
return p_rarch->path_default_shader_preset;
case RARCH_PATH_BASENAME:
return runloop_st->runtime_content_path_basename;
case RARCH_PATH_CORE_OPTIONS:
if (!path_is_empty(RARCH_PATH_CORE_OPTIONS))
return p_rarch->path_core_options_file;
break;
case RARCH_PATH_SUBSYSTEM:
return runloop_st->subsystem_path;
case RARCH_PATH_CONFIG:
if (!path_is_empty(RARCH_PATH_CONFIG))
return p_rarch->path_config_file;
@ -755,11 +758,6 @@ const char *path_get(enum rarch_path_type type)
case RARCH_PATH_NONE:
case RARCH_PATH_NAMES:
break;
/* Runloop-related paths */
case RARCH_PATH_BASENAME:
return runloop_st->runtime_content_path_basename;
case RARCH_PATH_SUBSYSTEM:
return runloop_st->subsystem_path;
}
return NULL;
@ -835,7 +833,6 @@ bool path_set(enum rarch_path_type type, const char *path)
strlcpy(p_rarch->path_content, path,
sizeof(p_rarch->path_content));
break;
/* Runloop-related paths */
case RARCH_PATH_BASENAME:
runloop_st = runloop_state_get_ptr();
strlcpy(runloop_st->runtime_content_path_basename, path,
@ -927,7 +924,6 @@ void path_clear(enum rarch_path_type type)
case RARCH_PATH_NONE:
case RARCH_PATH_NAMES:
break;
/* Runloop-related paths */
case RARCH_PATH_BASENAME:
runloop_st = runloop_state_get_ptr();
*runloop_st->runtime_content_path_basename = '\0';
@ -1078,7 +1074,6 @@ void dir_clear(enum rarch_dir_type type)
break;
case RARCH_DIR_NONE:
break;
/* Runloop-related paths */
case RARCH_DIR_CURRENT_SAVEFILE:
runloop_st = runloop_state_get_ptr();
*runloop_st->savefile_dir = '\0';
@ -1143,7 +1138,6 @@ void dir_set(enum rarch_dir_type type, const char *path)
break;
case RARCH_DIR_NONE:
break;
/* Runloop-related paths */
case RARCH_DIR_CURRENT_SAVEFILE:
runloop_st = runloop_state_get_ptr();
strlcpy(runloop_st->savefile_dir, path,
@ -3363,6 +3357,10 @@ static void global_free(struct rarch_state *p_rarch)
retro_main_log_file_deinit();
runloop_st->flags &= ~(
RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED
| RUNLOOP_FLAG_IS_SRAM_SAVE_DISABLED
| RUNLOOP_FLAG_USE_SRAM);
#ifdef HAVE_PATCH
p_rarch->flags &= ~(
RARCH_FLAGS_BPS_PREF
@ -3378,13 +3376,13 @@ static void global_free(struct rarch_state *p_rarch)
| RUNLOOP_FLAG_REMAPS_GAME_ACTIVE
| RUNLOOP_FLAG_REMAPS_CONTENT_DIR_ACTIVE);
#endif
runloop_st->flags &= ~(
RUNLOOP_FLAG_IS_SRAM_LOAD_DISABLED
| RUNLOOP_FLAG_IS_SRAM_SAVE_DISABLED
| RUNLOOP_FLAG_USE_SRAM);
runloop_st->current_core.flags &= ~(
RETRO_CORE_FLAG_HAS_SET_INPUT_DESCRIPTORS
| RETRO_CORE_FLAG_HAS_SET_SUBSYSTEMS);
runloop_st->current_core.flags &= ~(RETRO_CORE_FLAG_HAS_SET_INPUT_DESCRIPTORS
| RETRO_CORE_FLAG_HAS_SET_SUBSYSTEMS);
global = global_get_ptr();
path_clear_all();
dir_clear_all();
if (!string_is_empty(runloop_st->name.remapfile))
free(runloop_st->name.remapfile);
@ -3397,10 +3395,6 @@ static void global_free(struct rarch_state *p_rarch)
*runloop_st->name.cheatfile = '\0';
*runloop_st->name.label = '\0';
global = global_get_ptr();
path_clear_all();
dir_clear_all();
if (global)
memset(global, 0, sizeof(struct global));
retroarch_override_setting_free_state();

View file

@ -146,6 +146,12 @@ unsigned int retroarch_get_rotation(void);
void retroarch_init_task_queue(void);
/* Creates folder and core options stub file for subsequent runs */
bool core_options_create_override(bool game_specific);
bool core_options_remove_override(bool game_specific);
void core_options_reset(void);
void core_options_flush(void);
enum rarch_state_flags
{
RARCH_FLAGS_HAS_SET_USERNAME = (1 << 0),

View file

@ -314,12 +314,6 @@ typedef struct runloop runloop_state_t;
RETRO_BEGIN_DECLS
/* Creates folder and core options stub file for subsequent runs */
bool core_options_create_override(bool game_specific);
bool core_options_remove_override(bool game_specific);
void core_options_reset(void);
void core_options_flush(void);
void runloop_path_fill_names(void);
/**

View file

@ -28,7 +28,6 @@
#include "../configuration.h"
#include "../file_path_special.h"
#include "../list_special.h"
#include "../runloop.h"
#include "../verbosity.h"
#include "../input/input_driver.h"
#include "../input/input_remapping.h"

View file

@ -33,7 +33,6 @@
#include "../msg_hash.h"
#include "../playlist.h"
#include "../manual_content_scan.h"
#include "../runloop.h"
#ifdef RARCH_INTERNAL
#ifdef HAVE_MENU

View file

@ -46,7 +46,6 @@
#include "../gfx/gfx_widgets.h"
#endif
#include "../core.h"
#include "../defaults.h"
#include "../command.h"
#include "../configuration.h"

View file

@ -61,7 +61,6 @@ extern "C" {
#include "../../../msg_hash.h"
#include "../../../paths.h"
#include "../../../retroarch.h"
#include "../../../runloop.h"
#ifndef CXX_BUILD
}

View file

@ -16,6 +16,9 @@ extern "C" {
#include "../../../input/input_driver.h"
#include "../../../input/input_remapping.h"
#include "../../../network/netplay/netplay.h"
#include "../../../retroarch.h"
#include "../../../verbosity.h"
#ifndef CXX_BUILD
}

View file

@ -58,6 +58,7 @@ extern "C" {
#include <queues/task_queue.h>
#include "../ui_companion_driver.h"
#include "../../retroarch.h"
#ifndef CXX_BUILD
}

View file

@ -52,6 +52,7 @@
#include "../../driver.h"
#include "../../paths.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../tasks/tasks_internal.h"
#include "../../frontend/drivers/platform_win32.h"

View file

@ -22,6 +22,9 @@
#include "../driver.h"
#include "../list_special.h"
#include "../retroarch.h"
#include "../runloop.h"
#include "../verbosity.h"
#include "ui_companion_driver.h"