mirror of
https://github.com/libretro/RetroArch.git
synced 2024-10-07 22:33:27 +00:00
Take out image driver
This commit is contained in:
parent
f5b8ccff4b
commit
e1387a7b0b
8
Makefile
8
Makefile
@ -37,7 +37,6 @@ OBJ = frontend/frontend.o \
|
||||
gfx/scaler/scaler_int.o \
|
||||
gfx/scaler/scaler_filter.o \
|
||||
gfx/image/image_rpng.o \
|
||||
gfx/image_context.o \
|
||||
gfx/fonts/fonts.o \
|
||||
gfx/fonts/bitmapfont.o \
|
||||
audio/resampler.o \
|
||||
@ -319,10 +318,11 @@ ifeq ($(HAVE_FREETYPE), 1)
|
||||
DEFINES += $(FREETYPE_CFLAGS)
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(HAVE_SDL_IMAGE), 1)
|
||||
OBJ += gfx/image/image_sdl.o
|
||||
LIBS += $(SDL_IMAGE_LIBS)
|
||||
DEFINES += $(SDL_IMAGE_CFLAGS)
|
||||
#OBJ += gfx/image/image_sdl.o
|
||||
#LIBS += $(SDL_IMAGE_LIBS)
|
||||
#DEFINES += $(SDL_IMAGE_CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_ZLIB), 1)
|
||||
|
@ -39,7 +39,6 @@ OBJ = frontend/platform/platform_emscripten.o \
|
||||
gfx/fonts/fonts.o \
|
||||
gfx/fonts/bitmapfont.o \
|
||||
gfx/image/image_rpng.o \
|
||||
gfx/image_context.o \
|
||||
audio/resampler.o \
|
||||
audio/sinc.o \
|
||||
audio/cc_resampler.o \
|
||||
|
@ -44,7 +44,6 @@ OBJ = frontend/frontend.o \
|
||||
gfx/fonts/fonts.o \
|
||||
gfx/fonts/bitmapfont.o \
|
||||
gfx/image/image_rpng.o \
|
||||
gfx/image_context.o \
|
||||
audio/resampler.o \
|
||||
audio/dsp_filter.o \
|
||||
audio/sinc.o \
|
||||
|
13
config.def.h
13
config.def.h
@ -83,11 +83,6 @@ enum
|
||||
INPUT_RWEBINPUT,
|
||||
INPUT_NULL,
|
||||
|
||||
IMAGE_SDL,
|
||||
IMAGE_XDK,
|
||||
IMAGE_PS3,
|
||||
IMAGE_RPNG,
|
||||
|
||||
CAMERA_V4L2,
|
||||
CAMERA_RWEBCAM,
|
||||
CAMERA_ANDROID,
|
||||
@ -206,14 +201,6 @@ enum
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_NULL
|
||||
#endif
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#define IMAGE_DEFAULT_DRIVER IMAGE_PS3
|
||||
#elif defined(_XBOX1)
|
||||
#define IMAGE_DEFAULT_DRIVER IMAGE_XDK
|
||||
#else
|
||||
#define IMAGE_DEFAULT_DRIVER IMAGE_RPNG
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_V4L2)
|
||||
#define CAMERA_DEFAULT_DRIVER CAMERA_V4L2
|
||||
#elif defined(EMSCRIPTEN)
|
||||
|
6
driver.c
6
driver.c
@ -355,7 +355,6 @@ void init_drivers_pre(void)
|
||||
#ifdef HAVE_CAMERA
|
||||
find_camera_driver();
|
||||
#endif
|
||||
find_image_driver();
|
||||
#ifdef HAVE_LOCATION
|
||||
find_location_driver();
|
||||
#endif
|
||||
@ -533,9 +532,6 @@ void init_drivers(void)
|
||||
driver.osk_data_own = !driver.osk_data;
|
||||
#endif
|
||||
|
||||
if (!driver.image)
|
||||
find_image_driver();
|
||||
|
||||
adjust_system_rates();
|
||||
|
||||
g_extern.frame_count = 0;
|
||||
@ -579,8 +575,6 @@ void uninit_drivers(void)
|
||||
|
||||
uninit_video_input();
|
||||
|
||||
driver.image = NULL;
|
||||
|
||||
#ifdef HAVE_CAMERA
|
||||
uninit_camera();
|
||||
|
||||
|
5
driver.h
5
driver.h
@ -25,7 +25,7 @@
|
||||
#include <stdint.h>
|
||||
#include "msvc/msvc_compat.h"
|
||||
#include "gfx/scaler/scaler.h"
|
||||
#include "gfx/image_context.h"
|
||||
#include "gfx/image/image.h"
|
||||
#include "gfx/filters/softfilter.h"
|
||||
#include "audio/dsp_filter.h"
|
||||
#include "input/overlay.h"
|
||||
@ -455,7 +455,6 @@ typedef struct driver
|
||||
{
|
||||
const frontend_ctx_driver_t *frontend_ctx;
|
||||
const audio_driver_t *audio;
|
||||
const image_ctx_driver_t *image;
|
||||
const video_driver_t *video;
|
||||
const input_driver_t *input;
|
||||
#ifdef HAVE_OSK
|
||||
@ -550,8 +549,6 @@ void uninit_drivers(void);
|
||||
void global_init_drivers(void);
|
||||
void global_uninit_drivers(void);
|
||||
|
||||
void init_image_input(void);
|
||||
|
||||
void init_video_input(void);
|
||||
void uninit_video_input(void);
|
||||
void init_audio(void);
|
||||
|
@ -389,7 +389,6 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
|
||||
file_list_push(rgui->selection_buf, "Audio Device", RGUI_SETTINGS_DRIVER_AUDIO_DEVICE, 0);
|
||||
file_list_push(rgui->selection_buf, "Audio Resampler", RGUI_SETTINGS_DRIVER_AUDIO_RESAMPLER, 0);
|
||||
file_list_push(rgui->selection_buf, "Input Driver", RGUI_SETTINGS_DRIVER_INPUT, 0);
|
||||
file_list_push(rgui->selection_buf, "Image Driver", RGUI_SETTINGS_DRIVER_IMAGE, 0);
|
||||
#ifdef HAVE_CAMERA
|
||||
file_list_push(rgui->selection_buf, "Camera Driver", RGUI_SETTINGS_DRIVER_CAMERA, 0);
|
||||
#endif
|
||||
@ -3245,12 +3244,6 @@ static int menu_common_setting_set(void *data, unsigned setting, unsigned action
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
find_next_input_driver();
|
||||
break;
|
||||
case RGUI_SETTINGS_DRIVER_IMAGE:
|
||||
if (action == RGUI_ACTION_LEFT)
|
||||
find_prev_image_driver();
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
find_next_image_driver();
|
||||
break;
|
||||
#ifdef HAVE_CAMERA
|
||||
case RGUI_SETTINGS_DRIVER_CAMERA:
|
||||
if (action == RGUI_ACTION_LEFT)
|
||||
@ -4016,9 +4009,6 @@ static void menu_common_setting_set_label(char *type_str, size_t type_str_size,
|
||||
case RGUI_SETTINGS_DRIVER_INPUT:
|
||||
strlcpy(type_str, g_settings.input.driver, type_str_size);
|
||||
break;
|
||||
case RGUI_SETTINGS_DRIVER_IMAGE:
|
||||
strlcpy(type_str, g_settings.image.driver, type_str_size);
|
||||
break;
|
||||
#ifdef HAVE_CAMERA
|
||||
case RGUI_SETTINGS_DRIVER_CAMERA:
|
||||
strlcpy(type_str, g_settings.camera.driver, type_str_size);
|
||||
|
@ -112,7 +112,6 @@ typedef enum
|
||||
RGUI_SETTINGS_DRIVER_AUDIO_DEVICE,
|
||||
RGUI_SETTINGS_DRIVER_AUDIO_RESAMPLER,
|
||||
RGUI_SETTINGS_DRIVER_INPUT,
|
||||
RGUI_SETTINGS_DRIVER_IMAGE,
|
||||
RGUI_SETTINGS_DRIVER_CAMERA,
|
||||
RGUI_SETTINGS_DRIVER_LOCATION,
|
||||
RGUI_SETTINGS_DRIVER_MENU,
|
||||
|
@ -442,8 +442,7 @@ static void rmenu_init_assets(void *data)
|
||||
|
||||
menu_texture = (struct texture_image*)calloc(1, sizeof(*menu_texture));
|
||||
|
||||
if (driver.image && driver.image->load)
|
||||
driver.image->load(driver.video_data, g_extern.menu_texture_path, menu_texture);
|
||||
texture_image_load(driver.video_data, g_extern.menu_texture_path, menu_texture);
|
||||
rgui->width = menu_texture->width;
|
||||
rgui->height = menu_texture->height;
|
||||
|
||||
@ -464,8 +463,7 @@ static void *rmenu_init(void)
|
||||
|
||||
static void rmenu_free_assets(void *data)
|
||||
{
|
||||
if (driver.image && driver.image->free)
|
||||
driver.image->free(driver.video_data, menu_texture);
|
||||
texture_image_free(driver.video_data, menu_texture);
|
||||
|
||||
menu_texture_inited = false;
|
||||
}
|
||||
|
@ -324,16 +324,6 @@ void *menu_init(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!driver.image)
|
||||
{
|
||||
RARCH_ERR("Image driver not initialized.\n");
|
||||
RARCH_WARN("Trying to bring up image driver interface.\n");
|
||||
find_image_driver();
|
||||
|
||||
if (!driver.image)
|
||||
RARCH_ERR("Still couldn't initialize image driver.\n");
|
||||
}
|
||||
|
||||
if (driver.menu_ctx->init)
|
||||
rgui = (rgui_handle_t*)driver.menu_ctx->init();
|
||||
|
||||
|
@ -192,11 +192,6 @@ struct settings
|
||||
} menu;
|
||||
#endif
|
||||
|
||||
struct
|
||||
{
|
||||
char driver[32];
|
||||
} image;
|
||||
|
||||
#ifdef HAVE_CAMERA
|
||||
struct
|
||||
{
|
||||
@ -713,7 +708,6 @@ const char *config_get_default_osk(void);
|
||||
const char *config_get_default_video(void);
|
||||
const char *config_get_default_audio(void);
|
||||
const char *config_get_default_input(void);
|
||||
const char *config_get_default_image(void);
|
||||
|
||||
#include "conf/config_file.h"
|
||||
bool config_load_file(const char *path, bool set_defaults);
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <EGL/egl.h>
|
||||
|
||||
#include "../../frontend/platform/platform_android.h"
|
||||
#include "../image/image.h"
|
||||
|
||||
#include "../fonts/gl_font.h"
|
||||
#include <stdint.h>
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "../../driver.h"
|
||||
#include "../gfx_common.h"
|
||||
#include "../gl_common.h"
|
||||
#include "../image/image.h"
|
||||
|
||||
#include "../fonts/gl_font.h"
|
||||
#include <stdint.h>
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <sys/platform.h>
|
||||
#include <GLES2/gl2.h>
|
||||
|
||||
#include "../image/image.h"
|
||||
|
||||
#include "../fonts/gl_font.h"
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include "../image/image.h"
|
||||
#include "../../general.h"
|
||||
#include "../../input/input_common.h"
|
||||
#include "../../input/keyboard_line.h"
|
||||
|
2
gfx/gl.c
2
gfx/gl.c
@ -22,7 +22,7 @@
|
||||
#include "../driver.h"
|
||||
#include "../performance.h"
|
||||
#include "scaler/scaler.h"
|
||||
#include "image_context.h"
|
||||
#include "image/image.h"
|
||||
#include "../file.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
@ -17,11 +17,11 @@
|
||||
#define __RARCH_IMAGE_CONTEXT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../boolean.h"
|
||||
#include "../../boolean.h"
|
||||
|
||||
#ifdef _XBOX1
|
||||
#include <xtl.h>
|
||||
#include "../xdk/xdk_defines.h"
|
||||
#include "../../xdk/xdk_defines.h"
|
||||
#endif
|
||||
|
||||
struct texture_image
|
||||
@ -46,13 +46,14 @@ typedef struct image_ctx_driver
|
||||
const char *ident;
|
||||
} image_ctx_driver_t;
|
||||
|
||||
#if 0
|
||||
extern const image_ctx_driver_t image_ctx_xdk1;
|
||||
extern const image_ctx_driver_t image_ctx_ps3;
|
||||
extern const image_ctx_driver_t image_ctx_sdl;
|
||||
extern const image_ctx_driver_t image_ctx_rpng;
|
||||
#endif
|
||||
|
||||
void find_prev_image_driver(void);
|
||||
void find_next_image_driver(void);
|
||||
void find_image_driver(void);
|
||||
bool texture_image_load(void *data, const char *path, void *img);
|
||||
void texture_image_free(void *data, void *img);
|
||||
|
||||
#endif
|
@ -18,7 +18,7 @@
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#include "../image_context.h"
|
||||
#include "image.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -304,7 +304,7 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ps3_image_load(void *data, const char *path, void *image_data)
|
||||
bool texture_image_load(void *data, const char *path, void *image_data)
|
||||
{
|
||||
(void)data;
|
||||
struct texture_image *out_img = (struct texture_image*)image_data;
|
||||
@ -326,7 +326,7 @@ static bool ps3_image_load(void *data, const char *path, void *image_data)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ps3_image_free(void *data, void *image_data)
|
||||
void texture_image_free(void *data, void *image_data)
|
||||
{
|
||||
struct texture_image *img = (struct texture_image*)image_data;
|
||||
|
||||
@ -334,9 +334,3 @@ static void ps3_image_free(void *data, void *image_data)
|
||||
free(img->pixels);
|
||||
memset(img, 0, sizeof(*img));
|
||||
}
|
||||
|
||||
const image_ctx_driver_t image_ctx_ps3 = {
|
||||
ps3_image_load,
|
||||
ps3_image_free,
|
||||
"ps3",
|
||||
};
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#include "../image_context.h"
|
||||
#include "image.h"
|
||||
#include "../../file.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -202,7 +202,7 @@ static bool rpng_gx_convert_texture32(struct texture_image *image)
|
||||
|
||||
#endif
|
||||
|
||||
static void rpng_image_free(void *data, void *image_data)
|
||||
void texture_image_free(void *data, void *image_data)
|
||||
{
|
||||
struct texture_image *img = (struct texture_image*)image_data;
|
||||
|
||||
@ -210,7 +210,7 @@ static void rpng_image_free(void *data, void *image_data)
|
||||
memset(img, 0, sizeof(*img));
|
||||
}
|
||||
|
||||
static bool rpng_image_load(void *data, const char *path, void *image_data)
|
||||
bool texture_image_load(void *data, const char *path, void *image_data)
|
||||
{
|
||||
(void)data;
|
||||
bool ret;
|
||||
@ -235,9 +235,3 @@ static bool rpng_image_load(void *data, const char *path, void *image_data)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
const image_ctx_driver_t image_ctx_rpng = {
|
||||
rpng_image_load,
|
||||
rpng_image_free,
|
||||
"rpng",
|
||||
};
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#include "../image_context.h"
|
||||
#include "image.h"
|
||||
#include "../../file.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -107,7 +107,7 @@ static bool sdl_load_argb_shift(const char *path, struct texture_image *out_img,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool sdl_image_load(void *data, const char *path, void *image_data)
|
||||
bool texture_image_load(void *data, const char *path, void *image_data)
|
||||
{
|
||||
bool ret;
|
||||
(void)data;
|
||||
@ -123,15 +123,9 @@ static bool sdl_image_load(void *data, const char *path, void *image_data)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void sdl_image_free(void *data, void *image_data)
|
||||
void texture_image_free(void *data, void *image_data)
|
||||
{
|
||||
struct texture_image *img = (struct texture_image*)image_data;
|
||||
free(img->pixels);
|
||||
memset(img, 0, sizeof(*img));
|
||||
}
|
||||
|
||||
const image_ctx_driver_t image_ctx_sdl = {
|
||||
sdl_image_load,
|
||||
sdl_image_free,
|
||||
"sdl",
|
||||
};
|
||||
|
@ -14,10 +14,10 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../image_context.h"
|
||||
#include "image.h"
|
||||
#include "../../xdk/xdk_d3d.h"
|
||||
|
||||
static bool xdk_image_load(void *data, const char *path, void *image_data)
|
||||
bool texture_image_load(void *data, const char *path, void *image_data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
struct texture_image *out_img = (struct texture_image*)image_data;
|
||||
@ -55,7 +55,7 @@ static bool xdk_image_load(void *data, const char *path, void *image_data)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void xdk_image_free(void *data, void *image_data)
|
||||
void texture_image_free(void *data, void *image_data)
|
||||
{
|
||||
struct texture_image *img = (struct texture_image*)image_data;
|
||||
|
||||
@ -68,9 +68,3 @@ static void xdk_image_free(void *data, void *image_data)
|
||||
img->pixels->Release();
|
||||
memset(img, 0, sizeof(*img));
|
||||
}
|
||||
|
||||
const image_ctx_driver_t image_ctx_xdk = {
|
||||
xdk_image_load,
|
||||
xdk_image_free,
|
||||
"xdk",
|
||||
};
|
||||
|
@ -1,97 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2014 - 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-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../general.h"
|
||||
#include "gfx_context.h"
|
||||
#include "../general.h"
|
||||
#include <string.h>
|
||||
#include "image_context.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../config.h"
|
||||
#endif
|
||||
|
||||
static const image_ctx_driver_t *image_ctx_drivers[] = {
|
||||
#if defined(__CELLOS_LV2__)
|
||||
&image_ctx_ps3,
|
||||
#endif
|
||||
#if defined(_XBOX1)
|
||||
&image_ctx_xdk1,
|
||||
#endif
|
||||
&image_ctx_rpng,
|
||||
#if defined(HAVE_SDL_IMAGE)
|
||||
&image_ctx_sdl,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
static int find_image_driver_index(const char *driver)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; image_ctx_drivers[i]; i++)
|
||||
if (strcasecmp(driver, image_ctx_drivers[i]->ident) == 0)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void find_image_driver(void)
|
||||
{
|
||||
int i;
|
||||
if (driver.image)
|
||||
return;
|
||||
|
||||
i = find_image_driver_index(g_settings.image.driver);
|
||||
if (i >= 0)
|
||||
driver.image = image_ctx_drivers[i];
|
||||
else
|
||||
{
|
||||
unsigned d;
|
||||
RARCH_WARN("Couldn't find any image driver named \"%s\"\n", g_settings.image.driver);
|
||||
RARCH_LOG_OUTPUT("Available image drivers are:\n");
|
||||
for (d = 0; image_ctx_drivers[d]; d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", image_ctx_drivers[d]->ident);
|
||||
RARCH_WARN("Going to default to first image driver...\n");
|
||||
|
||||
driver.image = image_ctx_drivers[0];
|
||||
|
||||
if (!driver.image)
|
||||
rarch_fail(1, "find_image_driver()");
|
||||
}
|
||||
}
|
||||
|
||||
void find_prev_image_driver(void)
|
||||
{
|
||||
int i = find_image_driver_index(g_settings.image.driver);
|
||||
if (i > 0)
|
||||
{
|
||||
strlcpy(g_settings.image.driver, image_ctx_drivers[i - 1]->ident, sizeof(g_settings.image.driver));
|
||||
driver.image = (image_ctx_driver_t*)image_ctx_drivers[i - 1];
|
||||
}
|
||||
else
|
||||
RARCH_WARN("Couldn't find any previous image driver (current one: \"%s\").\n", g_settings.image.driver);
|
||||
}
|
||||
|
||||
void find_next_image_driver(void)
|
||||
{
|
||||
int i = find_image_driver_index(g_settings.image.driver);
|
||||
if (i >= 0 && image_ctx_drivers[i + 1])
|
||||
{
|
||||
strlcpy(g_settings.image.driver, image_ctx_drivers[i + 1]->ident, sizeof(g_settings.image.driver));
|
||||
driver.image = (image_ctx_driver_t*)image_ctx_drivers[i + 1];
|
||||
}
|
||||
else
|
||||
RARCH_WARN("Couldn't find any next image driver (current one: \"%s\").\n", g_settings.image.driver);
|
||||
}
|
@ -60,17 +60,11 @@ bool gl_load_luts(const struct gfx_shader *generic_shader, GLuint *lut_textures)
|
||||
glGenTextures(num_luts, lut_textures);
|
||||
for (i = 0; i < num_luts; i++)
|
||||
{
|
||||
bool ret = false;
|
||||
struct texture_image img = {0};
|
||||
RARCH_LOG("Loading texture image from: \"%s\" ...\n",
|
||||
generic_shader->lut[i].path);
|
||||
|
||||
ret = driver.image && driver.image->load;
|
||||
|
||||
if (ret)
|
||||
ret = driver.image->load(driver.video_data, generic_shader->lut[i].path, &img);
|
||||
|
||||
if (!ret)
|
||||
if (!texture_image_load(driver.video_data, generic_shader->lut[i].path, &img))
|
||||
{
|
||||
RARCH_ERR("Failed to load texture image from: \"%s\"\n", generic_shader->lut[i].path);
|
||||
return false;
|
||||
@ -80,9 +74,7 @@ bool gl_load_luts(const struct gfx_shader *generic_shader, GLuint *lut_textures)
|
||||
gl_wrap_type_to_enum(generic_shader->lut[i].wrap),
|
||||
generic_shader->lut[i].filter != RARCH_FILTER_NEAREST,
|
||||
generic_shader->lut[i].mipmap);
|
||||
|
||||
if (driver.image && driver.image->free)
|
||||
driver.image->free(driver.video_data, &img);
|
||||
texture_image_free(driver.video_data, &img);
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
@ -167,12 +167,10 @@ VIDEO IMAGE
|
||||
#include "../gfx/image/image_ps3.c"
|
||||
#elif defined(_XBOX1)
|
||||
#include "../gfx/image/image_xdk1.c"
|
||||
#elif defined(HAVE_SDL_IMAGE)
|
||||
#include "../gfx/image/image_sdl.c"
|
||||
#else
|
||||
#include "../gfx/image/image_rpng.c"
|
||||
#endif
|
||||
|
||||
#include "../gfx/image_context.c"
|
||||
#include "../gfx/image/image_rpng.c"
|
||||
#include "../gfx/rpng/rpng.c"
|
||||
|
||||
/*============================================================
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "../general.h"
|
||||
#include "../driver.h"
|
||||
#include "../libretro.h"
|
||||
#include "../gfx/image_context.h"
|
||||
#include "../gfx/image/image.h"
|
||||
#include "../conf/config_file.h"
|
||||
#include "../compat/posix_string.h"
|
||||
#include "input_common.h"
|
||||
@ -163,15 +163,12 @@ static void input_overlay_free_overlay(struct overlay *overlay)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (driver.image && driver.image->free)
|
||||
for (i = 0; i < overlay->size; i++)
|
||||
driver.image->free(driver.video_data, &overlay->descs[i].image);
|
||||
for (i = 0; i < overlay->size; i++)
|
||||
texture_image_free(driver.video_data, &overlay->descs[i].image);
|
||||
|
||||
free(overlay->load_images);
|
||||
free(overlay->descs);
|
||||
|
||||
if (driver.image && driver.image->free)
|
||||
driver.image->free(driver.video_data, &overlay->image);
|
||||
texture_image_free(driver.video_data, &overlay->image);
|
||||
}
|
||||
|
||||
static void input_overlay_free_overlays(input_overlay_t *ol)
|
||||
@ -202,9 +199,8 @@ static bool input_overlay_load_desc(input_overlay_t *ol, config_file_t *conf, st
|
||||
fill_pathname_resolve_relative(path, ol->overlay_path, image_path, sizeof(path));
|
||||
|
||||
struct texture_image img = {0};
|
||||
if (driver.image && driver.image->load)
|
||||
if (driver.image->load(driver.video_data, path, &img))
|
||||
desc->image = img;
|
||||
if (texture_image_load(driver.video_data, path, &img))
|
||||
desc->image = img;
|
||||
}
|
||||
|
||||
char overlay_desc_normalized_key[64];
|
||||
@ -352,21 +348,13 @@ static bool input_overlay_load_overlay(input_overlay_t *ol, config_file_t *conf,
|
||||
if (config_get_path(conf, overlay_path_key, overlay_path, sizeof(overlay_path)))
|
||||
{
|
||||
struct texture_image img = {0};
|
||||
bool ret = false;
|
||||
|
||||
fill_pathname_resolve_relative(overlay_resolved_path, config_path,
|
||||
overlay_path, sizeof(overlay_resolved_path));
|
||||
|
||||
ret = driver.image && driver.image->load;
|
||||
|
||||
if (ret)
|
||||
{
|
||||
ret = driver.image->load(driver.video_data, overlay_resolved_path, &img);
|
||||
if(ret)
|
||||
overlay->image = img;
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
if (texture_image_load(driver.video_data, overlay_resolved_path, &img))
|
||||
overlay->image = img;
|
||||
else
|
||||
{
|
||||
RARCH_ERR("[Overlay]: Failed to load image: %s.\n", overlay_resolved_path);
|
||||
return false;
|
||||
|
@ -241,7 +241,6 @@
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsC</CompileAs>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\gfx\image\image_rpng.c" />
|
||||
<ClCompile Include="..\..\gfx\image_context.c" />
|
||||
<ClCompile Include="..\..\gfx\rpng\rpng.c" />
|
||||
<ClCompile Include="..\..\gfx\shader_cg.c" />
|
||||
<ClCompile Include="..\..\gfx\shader_glsl.c" />
|
||||
@ -339,4 +338,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -240,9 +240,6 @@
|
||||
<ClCompile Include="..\..\frontend\platform\platform_null.c">
|
||||
<Filter>frontend\platform</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\gfx\image_context.c">
|
||||
<Filter>gfx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\gfx\image\image_rpng.c">
|
||||
<Filter>gfx\image</Filter>
|
||||
</ClCompile>
|
||||
@ -321,4 +318,4 @@
|
||||
<UniqueIdentifier>{4a5338d9-92ad-4d07-bb1a-97bd6eb475e4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -80,9 +80,6 @@
|
||||
# Load up a specific config file based on the core being used.
|
||||
# core_specific_config = false
|
||||
|
||||
# Image driver to use. "rpng", "sdl"
|
||||
# image_driver = "rpng"
|
||||
|
||||
#### Video
|
||||
|
||||
# Video driver to use. "gl", "xvideo", "sdl"
|
||||
|
22
settings.c
22
settings.c
@ -221,28 +221,10 @@ const char *config_get_default_location(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *config_get_default_image(void)
|
||||
{
|
||||
switch (IMAGE_DEFAULT_DRIVER)
|
||||
{
|
||||
case IMAGE_SDL:
|
||||
return "sdl";
|
||||
case IMAGE_XDK:
|
||||
return "xdk";
|
||||
case IMAGE_PS3:
|
||||
return "ps3";
|
||||
case IMAGE_RPNG:
|
||||
return "rpng";
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void config_set_defaults(void)
|
||||
{
|
||||
unsigned i, j;
|
||||
const char *def_video = config_get_default_video();
|
||||
const char *def_image = config_get_default_image();
|
||||
const char *def_audio = config_get_default_audio();
|
||||
const char *def_input = config_get_default_input();
|
||||
#ifdef HAVE_MENU
|
||||
@ -274,8 +256,6 @@ void config_set_defaults(void)
|
||||
strlcpy(g_settings.audio.driver, def_audio, sizeof(g_settings.audio.driver));
|
||||
if (def_input)
|
||||
strlcpy(g_settings.input.driver, def_input, sizeof(g_settings.input.driver));
|
||||
if (def_image)
|
||||
strlcpy(g_settings.image.driver, def_image, sizeof(g_settings.image.driver));
|
||||
#ifdef HAVE_MENU
|
||||
if (def_menu)
|
||||
strlcpy(g_settings.menu.driver, def_menu, sizeof(g_settings.menu.driver));
|
||||
@ -989,7 +969,6 @@ bool config_load_file(const char *path, bool set_defaults)
|
||||
CONFIG_GET_BOOL(location.allow, "location_allow");
|
||||
#endif
|
||||
|
||||
CONFIG_GET_STRING(image.driver, "image_driver");
|
||||
CONFIG_GET_STRING(video.driver, "video_driver");
|
||||
CONFIG_GET_STRING(menu.driver, "menu_driver");
|
||||
CONFIG_GET_STRING(video.gl_context, "video_gl_context");
|
||||
@ -1378,7 +1357,6 @@ bool config_save_file(const char *path)
|
||||
config_set_int(conf, "video_fullscreen_y", g_settings.video.fullscreen_y);
|
||||
config_set_string(conf,"video_driver", g_settings.video.driver);
|
||||
config_set_string(conf,"menu_driver", g_settings.menu.driver);
|
||||
config_set_string(conf,"image_driver", g_settings.image.driver);
|
||||
config_set_bool(conf, "video_vsync", g_settings.video.vsync);
|
||||
config_set_bool(conf, "video_hard_sync", g_settings.video.hard_sync);
|
||||
config_set_int(conf, "video_hard_sync_frames", g_settings.video.hard_sync_frames);
|
||||
|
@ -475,7 +475,6 @@ const rarch_setting_t* setting_data_get_list(void)
|
||||
#endif
|
||||
CONFIG_STRING(g_settings.audio.driver, "audio_driver", "Audio Driver", config_get_default_audio())
|
||||
CONFIG_STRING(g_settings.input.driver, "input_driver", "Input Driver", config_get_default_input())
|
||||
CONFIG_STRING(g_settings.image.driver, "image_driver", "Image Driver", config_get_default_image())
|
||||
#ifdef HAVE_CAMERA
|
||||
CONFIG_STRING(g_settings.camera.device, "camera_device", "Camera Driver", config_get_default_camera())
|
||||
#endif
|
||||
|
@ -23,7 +23,7 @@
|
||||
#endif
|
||||
#include "../gfx/shader_common.h"
|
||||
#include "../gfx/shader_parse.h"
|
||||
#include "../gfx/image_context.h"
|
||||
#include "../gfx/image/image.h"
|
||||
#include "../gfx/fonts/d3d_font.h"
|
||||
|
||||
#include "../gfx/gfx_context.h"
|
||||
|
Loading…
Reference in New Issue
Block a user