mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
Start going through retro_inline INLINE
This commit is contained in:
parent
a333a629ca
commit
26f2bd4cbf
@ -16,15 +16,16 @@
|
||||
|
||||
#include "render_chain.h"
|
||||
#include <string.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
static inline D3DTEXTUREFILTERTYPE translate_filter(unsigned type)
|
||||
static INLINE D3DTEXTUREFILTERTYPE translate_filter(unsigned type)
|
||||
{
|
||||
if (type == RARCH_FILTER_UNSPEC)
|
||||
return g_settings.video.smooth ? D3DTEXF_LINEAR : D3DTEXF_POINT;
|
||||
return type == RARCH_FILTER_LINEAR ? D3DTEXF_LINEAR : D3DTEXF_POINT;
|
||||
}
|
||||
|
||||
static inline D3DTEXTUREFILTERTYPE translate_filter(bool smooth)
|
||||
static INLINE D3DTEXTUREFILTERTYPE translate_filter(bool smooth)
|
||||
{
|
||||
if (smooth)
|
||||
return D3DTEXF_LINEAR;
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef _D3D_CG
|
||||
#define _D3D_CG
|
||||
|
||||
#include <retro_inline.h>
|
||||
|
||||
static const char *stock_program =
|
||||
"void main_vertex"
|
||||
"("
|
||||
@ -25,7 +27,7 @@ static const char *stock_program =
|
||||
" return color * tex2D(s0, tex);"
|
||||
"}";
|
||||
|
||||
static inline bool validate_param_name(const char *name)
|
||||
static INLINE bool validate_param_name(const char *name)
|
||||
{
|
||||
static const char *illegal[] = {
|
||||
"PREV.",
|
||||
@ -50,7 +52,7 @@ static inline bool validate_param_name(const char *name)
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline CGparameter find_param_from_semantic(
|
||||
static INLINE CGparameter find_param_from_semantic(
|
||||
CGparameter param, const std::string &sem)
|
||||
{
|
||||
while (param)
|
||||
@ -78,7 +80,7 @@ static inline CGparameter find_param_from_semantic(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline CGparameter find_param_from_semantic(CGprogram prog,
|
||||
static INLINE CGparameter find_param_from_semantic(CGprogram prog,
|
||||
const std::string &sem)
|
||||
{
|
||||
return find_param_from_semantic(cgGetFirstParameter(
|
||||
|
@ -30,6 +30,8 @@
|
||||
|
||||
#include <exynos/exynos_fimg2d.h>
|
||||
|
||||
#include <retro_inline.h>
|
||||
|
||||
#include "../../general.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../runloop.h"
|
||||
@ -164,7 +166,8 @@ struct exynos_data {
|
||||
#endif
|
||||
};
|
||||
|
||||
static inline unsigned align_common(unsigned i, unsigned j) {
|
||||
static INLINE unsigned align_common(unsigned i, unsigned j)
|
||||
{
|
||||
return (i + j - 1) & ~(j - 1);
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "../../performance.h"
|
||||
#include <gfx/scaler/scaler.h>
|
||||
#include <formats/image.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../../libretro.h"
|
||||
@ -89,7 +90,7 @@ static const GLfloat white_color[] = {
|
||||
1, 1, 1, 1,
|
||||
};
|
||||
|
||||
static inline bool gl_query_extension(gl_t *gl, const char *ext)
|
||||
static INLINE bool gl_query_extension(gl_t *gl, const char *ext)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
@ -307,7 +308,7 @@ void apple_bind_game_view_fbo(void);
|
||||
#define gl_bind_backbuffer() glBindFramebuffer(RARCH_GL_FRAMEBUFFER, 0)
|
||||
#endif
|
||||
|
||||
static inline GLenum min_filter_to_mag(GLenum type)
|
||||
static INLINE GLenum min_filter_to_mag(GLenum type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@ -870,7 +871,7 @@ static void gl_set_video_mode(void *data, unsigned width, unsigned height,
|
||||
}
|
||||
|
||||
#ifdef HAVE_FBO
|
||||
static inline void gl_start_frame_fbo(gl_t *gl)
|
||||
static INLINE void gl_start_frame_fbo(gl_t *gl)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, gl->fbo[0]);
|
||||
@ -1113,7 +1114,7 @@ static void gl_update_input_size(gl_t *gl, unsigned width,
|
||||
* to use a custom SIMD-optimized conversion routine
|
||||
* than letting GL do it. */
|
||||
#if !defined(HAVE_PSGL) && !defined(HAVE_OPENGLES2)
|
||||
static inline void gl_convert_frame_rgb16_32(gl_t *gl, void *output,
|
||||
static INLINE void gl_convert_frame_rgb16_32(gl_t *gl, void *output,
|
||||
const void *input, int width, int height, int in_pitch)
|
||||
{
|
||||
if (width != gl->scaler.in_width || height != gl->scaler.in_height)
|
||||
@ -1135,7 +1136,7 @@ static inline void gl_convert_frame_rgb16_32(gl_t *gl, void *output,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENGLES2
|
||||
static inline void gl_convert_frame_argb8888_abgr8888(gl_t *gl,
|
||||
static INLINE void gl_convert_frame_argb8888_abgr8888(gl_t *gl,
|
||||
void *output, const void *input,
|
||||
int width, int height, int in_pitch)
|
||||
{
|
||||
@ -1258,7 +1259,7 @@ static void gl_init_textures(gl_t *gl, const video_info_t *video)
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
}
|
||||
|
||||
static inline void gl_copy_frame(gl_t *gl, const void *frame,
|
||||
static INLINE void gl_copy_frame(gl_t *gl, const void *frame,
|
||||
unsigned width, unsigned height, unsigned pitch)
|
||||
{
|
||||
RARCH_PERFORMANCE_INIT(copy_frame);
|
||||
@ -1368,7 +1369,7 @@ static inline void gl_copy_frame(gl_t *gl, const void *frame,
|
||||
RARCH_PERFORMANCE_STOP(copy_frame);
|
||||
}
|
||||
|
||||
static inline void gl_set_prev_texture(gl_t *gl,
|
||||
static INLINE void gl_set_prev_texture(gl_t *gl,
|
||||
const struct gl_tex_info *tex_info)
|
||||
{
|
||||
memmove(gl->prev_info + 1, gl->prev_info,
|
||||
@ -1377,7 +1378,7 @@ static inline void gl_set_prev_texture(gl_t *gl,
|
||||
sizeof(*tex_info));
|
||||
}
|
||||
|
||||
static inline void gl_set_shader_viewport(gl_t *gl, unsigned shader)
|
||||
static INLINE void gl_set_shader_viewport(gl_t *gl, unsigned shader)
|
||||
{
|
||||
gl->shader->use(gl, shader);
|
||||
gl_set_viewport(gl, gl->win_width, gl->win_height, false, true);
|
||||
@ -1417,7 +1418,7 @@ static void gl_pbo_async_readback(gl_t *gl)
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MENU)
|
||||
static inline void gl_draw_texture(gl_t *gl)
|
||||
static INLINE void gl_draw_texture(gl_t *gl)
|
||||
{
|
||||
const GLfloat color[] = {
|
||||
1.0f, 1.0f, 1.0f, gl->menu_texture_alpha,
|
||||
@ -1928,7 +1929,7 @@ static bool resolve_extensions(gl_t *gl)
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void gl_set_texture_fmts(gl_t *gl, bool rgb32)
|
||||
static INLINE void gl_set_texture_fmts(gl_t *gl, bool rgb32)
|
||||
{
|
||||
gl->internal_fmt = RARCH_GL_INTERNAL_FORMAT16;
|
||||
gl->texture_type = RARCH_GL_TEXTURE_TYPE16;
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "../../general.h"
|
||||
#include "../../retroarch.h"
|
||||
#include <gfx/scaler/scaler.h>
|
||||
#include <retro_inline.h>
|
||||
#include "../video_viewport.h"
|
||||
#include "../video_monitor.h"
|
||||
#include "../video_context_driver.h"
|
||||
@ -152,13 +153,13 @@ static int read_sysfs(const char *fname, char *buff, size_t size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void put_pixel_rgb565(uint16_t *p,
|
||||
static INLINE void put_pixel_rgb565(uint16_t *p,
|
||||
unsigned r, unsigned g, unsigned b)
|
||||
{
|
||||
*p = (((r >> 3) & 0x1f) << 11) | (((g >> 2) & 0x3f) << 5) | ((b >> 3) & 0x1f);
|
||||
}
|
||||
|
||||
static inline void put_pixel_argb8888(uint32_t *p,
|
||||
static INLINE void put_pixel_argb8888(uint32_t *p,
|
||||
unsigned r, unsigned g, unsigned b)
|
||||
{
|
||||
*p = ((r << 16) & 0xff0000) | ((g << 8) & 0x00ff00) | ((b << 0) & 0x0000ff);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <pspgum.h>
|
||||
#include <psprtc.h>
|
||||
|
||||
#include <retro_inline.h>
|
||||
#include "psp_sdk_defines.h"
|
||||
#include "../../general.h"
|
||||
#include "../../driver.h"
|
||||
@ -118,7 +119,7 @@ typedef struct psp1_video
|
||||
#define PSP_FRAME_SLICE_COUNT (PSP_FRAME_ROWS_COUNT * PSP_FRAME_COLUMNS_COUNT)
|
||||
#define PSP_FRAME_VERTEX_COUNT (PSP_FRAME_SLICE_COUNT * 2)
|
||||
|
||||
static inline void psp_set_screen_coords (psp1_sprite_t* framecoords,
|
||||
static INLINE void psp_set_screen_coords (psp1_sprite_t* framecoords,
|
||||
int x, int y, int width, int height, unsigned rotation)
|
||||
{
|
||||
int i;
|
||||
@ -216,10 +217,9 @@ static inline void psp_set_screen_coords (psp1_sprite_t* framecoords,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static inline void psp_set_tex_coords (psp1_sprite_t* framecoords,
|
||||
static INLINE void psp_set_tex_coords (psp1_sprite_t* framecoords,
|
||||
int width, int height)
|
||||
{
|
||||
int i;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "../../retroarch.h"
|
||||
#include "../../runloop.h"
|
||||
#include "../../performance.h"
|
||||
#include <retro_inline.h>
|
||||
#include <gfx/scaler/scaler.h>
|
||||
#include "../video_viewport.h"
|
||||
#include "../video_monitor.h"
|
||||
@ -81,7 +82,7 @@ typedef struct _sdl2_video
|
||||
|
||||
static void sdl2_gfx_free(void *data);
|
||||
|
||||
static inline void sdl_tex_zero(sdl2_tex_t *t)
|
||||
static INLINE void sdl_tex_zero(sdl2_tex_t *t)
|
||||
{
|
||||
if (t->tex)
|
||||
SDL_DestroyTexture(t->tex);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <EGL/eglext.h>
|
||||
#include "../video_context_driver.h"
|
||||
#include <gfx/math/matrix_3x3.h>
|
||||
#include <retro_inline.h>
|
||||
#include "../../libretro.h"
|
||||
#include "../../general.h"
|
||||
#include "../../retroarch.h"
|
||||
@ -70,7 +71,7 @@ static void vg_set_nonblock_state(void *data, bool state)
|
||||
vg->driver->swap_interval(vg, state ? 0 : 1);
|
||||
}
|
||||
|
||||
static inline bool vg_query_extension(const char *ext)
|
||||
static INLINE bool vg_query_extension(const char *ext)
|
||||
{
|
||||
const char *str = (const char*)vgGetString(VG_EXTENSIONS);
|
||||
bool ret = str && strstr(str, ext);
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "../video_viewport.h"
|
||||
#include "../video_monitor.h"
|
||||
#include "../font_renderer_driver.h"
|
||||
#include <retro_inline.h>
|
||||
|
||||
#include "../drivers_context/x11_common.h"
|
||||
|
||||
@ -95,7 +96,7 @@ static void xvideo_sighandler(int sig)
|
||||
g_quit = 1;
|
||||
}
|
||||
|
||||
static inline void calculate_yuv(uint8_t *y, uint8_t *u, uint8_t *v, unsigned r, unsigned g, unsigned b)
|
||||
static INLINE void calculate_yuv(uint8_t *y, uint8_t *u, uint8_t *v, unsigned r, unsigned g, unsigned b)
|
||||
{
|
||||
int y_ = (int)(+((double)r * 0.257) + ((double)g * 0.504) + ((double)b * 0.098) + 16.0);
|
||||
int u_ = (int)(-((double)r * 0.148) - ((double)g * 0.291) + ((double)b * 0.439) + 128.0);
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "../video_context_driver.h"
|
||||
#include "../gl_common.h"
|
||||
#include "../video_monitor.h"
|
||||
#include <retro_inline.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
@ -61,7 +62,7 @@ static unsigned g_egl_res;
|
||||
static PFNEGLCREATEIMAGEKHRPROC peglCreateImageKHR;
|
||||
static PFNEGLDESTROYIMAGEKHRPROC peglDestroyImageKHR;
|
||||
|
||||
static inline bool gfx_ctx_vc_egl_query_extension(const char *ext)
|
||||
static INLINE bool gfx_ctx_vc_egl_query_extension(const char *ext)
|
||||
{
|
||||
const char *str = (const char*)eglQueryString(g_egl_dpy, EGL_EXTENSIONS);
|
||||
bool ret = str && strstr(str, ext);
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <float.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#ifndef PIXMAN_PRIVATE_H
|
||||
#define PIXMAN_PRIVATE_H
|
||||
@ -769,7 +770,7 @@ _pixman_iter_init_bits_stride (pixman_iter_t *iter, const pixman_iter_info_t *in
|
||||
|
||||
extern pixman_implementation_t *global_implementation;
|
||||
|
||||
static force_inline pixman_implementation_t *
|
||||
static INLINE pixman_implementation_t *
|
||||
get_implementation (void)
|
||||
{
|
||||
#ifndef TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR
|
||||
@ -840,14 +841,14 @@ struct pixman_list_t
|
||||
pixman_link_t *tail;
|
||||
};
|
||||
|
||||
static force_inline void
|
||||
static INLINE void
|
||||
pixman_list_init (pixman_list_t *list)
|
||||
{
|
||||
list->head = (pixman_link_t *)list;
|
||||
list->tail = (pixman_link_t *)list;
|
||||
}
|
||||
|
||||
static force_inline void
|
||||
static INLINE void
|
||||
pixman_list_prepend (pixman_list_t *list, pixman_link_t *link)
|
||||
{
|
||||
link->next = list->head;
|
||||
@ -856,14 +857,14 @@ pixman_list_prepend (pixman_list_t *list, pixman_link_t *link)
|
||||
list->head = link;
|
||||
}
|
||||
|
||||
static force_inline void
|
||||
static INLINE void
|
||||
pixman_list_unlink (pixman_link_t *link)
|
||||
{
|
||||
link->prev->next = link->next;
|
||||
link->next->prev = link->prev;
|
||||
}
|
||||
|
||||
static force_inline void
|
||||
static INLINE void
|
||||
pixman_list_move_to_front (pixman_list_t *list, pixman_link_t *link)
|
||||
{
|
||||
pixman_list_unlink (link);
|
||||
@ -902,7 +903,7 @@ pixman_list_move_to_front (pixman_list_t *list, pixman_link_t *link)
|
||||
|
||||
/* Conversion between 8888 and 0565 */
|
||||
|
||||
static force_inline uint16_t
|
||||
static INLINE uint16_t
|
||||
convert_8888_to_0565 (uint32_t s)
|
||||
{
|
||||
/* The following code can be compiled into just 4 instructions on ARM */
|
||||
@ -914,7 +915,7 @@ convert_8888_to_0565 (uint32_t s)
|
||||
return (uint16_t)a;
|
||||
}
|
||||
|
||||
static force_inline uint32_t
|
||||
static INLINE uint32_t
|
||||
convert_0565_to_0888 (uint16_t s)
|
||||
{
|
||||
return (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) |
|
||||
@ -922,7 +923,7 @@ convert_0565_to_0888 (uint16_t s)
|
||||
((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)));
|
||||
}
|
||||
|
||||
static force_inline uint32_t
|
||||
static INLINE uint32_t
|
||||
convert_0565_to_8888 (uint16_t s)
|
||||
{
|
||||
return convert_0565_to_0888 (s) | 0xff000000;
|
||||
@ -930,19 +931,19 @@ convert_0565_to_8888 (uint16_t s)
|
||||
|
||||
/* Trivial versions that are useful in macros */
|
||||
|
||||
static force_inline uint32_t
|
||||
static INLINE uint32_t
|
||||
convert_8888_to_8888 (uint32_t s)
|
||||
{
|
||||
return s;
|
||||
}
|
||||
|
||||
static force_inline uint32_t
|
||||
static INLINE uint32_t
|
||||
convert_x888_to_8888 (uint32_t s)
|
||||
{
|
||||
return s | 0xff000000;
|
||||
}
|
||||
|
||||
static force_inline uint16_t
|
||||
static INLINE uint16_t
|
||||
convert_0565_to_0565 (uint16_t s)
|
||||
{
|
||||
return s;
|
||||
@ -963,7 +964,7 @@ convert_0565_to_0565 (uint16_t s)
|
||||
# define SCREEN_SHIFT_RIGHT(x,n) ((x) << (n))
|
||||
#endif
|
||||
|
||||
static force_inline uint32_t
|
||||
static INLINE uint32_t
|
||||
unorm_to_unorm (uint32_t val, int from_bits, int to_bits)
|
||||
{
|
||||
uint32_t result;
|
||||
@ -1095,7 +1096,7 @@ pixman_transform_point_31_16_affine (const pixman_transform_t *t,
|
||||
|
||||
#ifdef PIXMAN_TIMERS
|
||||
|
||||
static inline uint64_t
|
||||
static INLINE uint64_t
|
||||
oil_profile_stamp_rdtsc (void)
|
||||
{
|
||||
uint32_t hi, lo;
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#define softfilter_get_implementation phosphor2x_get_implementation
|
||||
@ -78,7 +79,7 @@ struct filter_data
|
||||
#define blend_pixels_xrgb8888(a, b) (((a >> 1) & 0x7f7f7f7f) + ((b >> 1) & 0x7f7f7f7f))
|
||||
#define blend_pixels_rgb565(a, b) (((a&0xF7DE) >> 1) + ((b&0xF7DE) >> 1))
|
||||
|
||||
static inline unsigned max_component_xrgb8888(uint32_t color)
|
||||
static INLINE unsigned max_component_xrgb8888(uint32_t color)
|
||||
{
|
||||
unsigned red, green, blue, max;
|
||||
red = red_xrgb8888(color);
|
||||
@ -91,7 +92,7 @@ static inline unsigned max_component_xrgb8888(uint32_t color)
|
||||
return max;
|
||||
}
|
||||
|
||||
static inline unsigned max_component_rgb565(uint32_t color)
|
||||
static INLINE unsigned max_component_rgb565(uint32_t color)
|
||||
{
|
||||
unsigned red, green, blue, max;
|
||||
red = red_rgb565(color);
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "video_state_tracker.h"
|
||||
#include <stdlib.h>
|
||||
#include <compat/strl.h>
|
||||
#include <retro_inline.h>
|
||||
#include "../general.h"
|
||||
#include "../input/input_common.h"
|
||||
|
||||
@ -171,7 +172,7 @@ void state_tracker_free(state_tracker_t *tracker)
|
||||
free(tracker);
|
||||
}
|
||||
|
||||
static inline uint16_t state_tracker_fetch(
|
||||
static INLINE uint16_t state_tracker_fetch(
|
||||
const struct state_tracker_internal *info)
|
||||
{
|
||||
uint16_t val = info->ptr[info->addr];
|
||||
|
Loading…
Reference in New Issue
Block a user