mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 06:40:18 +00:00
More C89 build fixes
This commit is contained in:
parent
4fb3a7f1b7
commit
e74e402cdc
@ -840,6 +840,8 @@ endif
|
||||
|
||||
# Record
|
||||
|
||||
ifneq ($(C89_BUILD), 1)
|
||||
# ffmpeg and friends are not C89-compliant APIs.
|
||||
ifeq ($(HAVE_FFMPEG), 1)
|
||||
OBJ += record/drivers/record_ffmpeg.o \
|
||||
cores/ffmpeg_core.o
|
||||
@ -847,6 +849,7 @@ ifeq ($(HAVE_FFMPEG), 1)
|
||||
DEFINES += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS) $(SWRESAMPLE_CFLAGS)
|
||||
DEFINES += -DHAVE_FFMPEG -Iffmpeg
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COMPRESSION), 1)
|
||||
DEFINES += -DHAVE_COMPRESSION
|
||||
|
@ -305,12 +305,13 @@ void CORE_PREFIX(retro_reset)(void)
|
||||
|
||||
static void check_variables(void)
|
||||
{
|
||||
struct retro_variable color_var;
|
||||
struct retro_variable color_var, var, fft_var, fft_ms_var;
|
||||
|
||||
(void)var;
|
||||
(void)fft_var;
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
struct retro_variable var = {
|
||||
.key = "ffmpeg_temporal_interp"
|
||||
};
|
||||
var.key = "ffmpeg_temporal_interp";
|
||||
|
||||
if (CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
@ -322,9 +323,7 @@ static void check_variables(void)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GL_FFT
|
||||
struct retro_variable fft_var = {
|
||||
.key = "ffmpeg_fft_resolution",
|
||||
};
|
||||
fft_var.key = "ffmpeg_fft_resolution";
|
||||
|
||||
fft_width = 1280;
|
||||
fft_height = 720;
|
||||
@ -339,9 +338,7 @@ static void check_variables(void)
|
||||
}
|
||||
}
|
||||
|
||||
struct retro_variable fft_ms_var = {
|
||||
.key = "ffmpeg_fft_multisample",
|
||||
};
|
||||
fft_ms_var.key = "ffmpeg_fft_multisample";
|
||||
|
||||
if (CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &fft_ms_var) && fft_ms_var.value)
|
||||
fft_multisample = strtoul(fft_ms_var.value, NULL, 0);
|
||||
@ -1107,7 +1104,7 @@ static void decode_thread(void *data)
|
||||
{
|
||||
unsigned i;
|
||||
AVFrame *aud_frame, *vid_frame;
|
||||
SwrContext *swr[audio_streams_num];
|
||||
SwrContext *swr[audio_streams_num] = {NULL};
|
||||
void *conv_frame_buf = NULL;
|
||||
size_t frame_size = 0;
|
||||
int16_t *audio_buffer = NULL;
|
||||
|
@ -236,7 +236,8 @@ static void wait_flip(bool block)
|
||||
|
||||
/* This buffer is not on-screen anymore. Release it to GBM. */
|
||||
gbm_surface_release_buffer(drm->g_gbm_surface, drm->g_bo);
|
||||
drm->g_bo = drm->g_next_bo; // This buffer is being shown now.
|
||||
/* This buffer is being shown now. */
|
||||
drm->g_bo = drm->g_next_bo;
|
||||
}
|
||||
|
||||
static void queue_flip(void)
|
||||
|
@ -315,7 +315,9 @@ static bool compile_shader(glsl_shader_data_t *glsl,
|
||||
const char *define, const char *program)
|
||||
{
|
||||
GLint status;
|
||||
const char *source[4];
|
||||
char version[32] = {0};
|
||||
|
||||
if (glsl_core && !strstr(program, "#version"))
|
||||
{
|
||||
unsigned version_no = 0;
|
||||
@ -341,11 +343,13 @@ static bool compile_shader(glsl_shader_data_t *glsl,
|
||||
RARCH_LOG("[GL]: Using GLSL version %u.\n", version_no);
|
||||
}
|
||||
|
||||
{
|
||||
const char *source[] = { version, define, glsl->glsl_alias_define, program };
|
||||
glShaderSource(shader, ARRAY_SIZE(source), source, NULL);
|
||||
glCompileShader(shader);
|
||||
}
|
||||
source[0]= version;
|
||||
source[1] = define;
|
||||
source[2] = glsl->glsl_alias_define;
|
||||
source[3] = program;
|
||||
|
||||
glShaderSource(shader, ARRAY_SIZE(source), source, NULL);
|
||||
glCompileShader(shader);
|
||||
|
||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
|
||||
print_shader_log(shader);
|
||||
|
@ -139,7 +139,7 @@ static void hidpad_ps3_packet_handler(void *data, uint8_t *packet, uint16_t size
|
||||
RETRO_DEVICE_ID_JOYPAD_A,
|
||||
RETRO_DEVICE_ID_JOYPAD_B,
|
||||
RETRO_DEVICE_ID_JOYPAD_Y,
|
||||
16 //< PS Button
|
||||
16 /* PS Button */
|
||||
};
|
||||
struct hidpad_ps3_data *device = (struct hidpad_ps3_data*)data;
|
||||
|
||||
|
@ -31,7 +31,7 @@ enum connect_ps4_dpad_states
|
||||
DPAD_DOWN_LEFT = 0x5,
|
||||
DPAD_LEFT = 0x6,
|
||||
DPAD_LEFT_UP = 0x7,
|
||||
DPAD_OFF = 0x8,
|
||||
DPAD_OFF = 0x8
|
||||
};
|
||||
|
||||
struct ps4buttons
|
||||
|
@ -54,18 +54,29 @@ static bool png_write_crc(FILE *file, const uint8_t *data, size_t size)
|
||||
|
||||
static bool png_write_ihdr(FILE *file, const struct png_ihdr *ihdr)
|
||||
{
|
||||
uint8_t ihdr_raw[] = {
|
||||
'0', '0', '0', '0', /* Size */
|
||||
'I', 'H', 'D', 'R',
|
||||
|
||||
0, 0, 0, 0, /* Width */
|
||||
0, 0, 0, 0, /* Height */
|
||||
ihdr->depth,
|
||||
ihdr->color_type,
|
||||
ihdr->compression,
|
||||
ihdr->filter,
|
||||
ihdr->interlace,
|
||||
};
|
||||
uint8_t ihdr_raw[21];
|
||||
|
||||
ihdr_raw[0] = '0'; /* Size */
|
||||
ihdr_raw[1] = '0';
|
||||
ihdr_raw[2] = '0';
|
||||
ihdr_raw[3] = '0';
|
||||
ihdr_raw[4] = 'I';
|
||||
ihdr_raw[5] = 'H';
|
||||
ihdr_raw[6] = 'D';
|
||||
ihdr_raw[7] = 'R';
|
||||
ihdr_raw[8] = 0; /* Width */
|
||||
ihdr_raw[9] = 0;
|
||||
ihdr_raw[10] = 0;
|
||||
ihdr_raw[11] = 0;
|
||||
ihdr_raw[12] = 0; /* Height */
|
||||
ihdr_raw[13] = 0;
|
||||
ihdr_raw[14] = 0;
|
||||
ihdr_raw[15] = 0;
|
||||
ihdr_raw[16] = ihdr->depth; /* Depth */
|
||||
ihdr_raw[17] = ihdr->color_type;
|
||||
ihdr_raw[18] = ihdr->compression;
|
||||
ihdr_raw[19] = ihdr->filter;
|
||||
ihdr_raw[20] = ihdr->interlace;
|
||||
|
||||
dword_write_be(ihdr_raw + 0, sizeof(ihdr_raw) - 8);
|
||||
dword_write_be(ihdr_raw + 8, ihdr->width);
|
||||
|
Loading…
x
Reference in New Issue
Block a user