diff --git a/Makefile.common b/Makefile.common index cdc22165f3..a29c04dd0d 100644 --- a/Makefile.common +++ b/Makefile.common @@ -149,7 +149,6 @@ OBJ += frontend/frontend.o \ gfx/video_common.o \ gfx/video_driver.o \ gfx/video_pixel_converter.o \ - gfx/video_viewport.o \ camera/camera_driver.o \ location/location_driver.o \ driver.o \ diff --git a/config.def.h b/config.def.h index ed5aaa3f86..6a2cd7291c 100644 --- a/config.def.h +++ b/config.def.h @@ -20,7 +20,6 @@ #include #include "libretro.h" #include "driver.h" -#include "gfx/video_viewport.h" #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index c39a4951d3..3aab8d707b 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -26,7 +26,6 @@ #include #include "d3d.h" -#include "../video_viewport.h" #include "../video_monitor.h" #include "../video_common.h" #include "../../dynamic.h" diff --git a/gfx/d3d/d3d.h b/gfx/d3d/d3d.h index c9cf102388..6713a497c1 100644 --- a/gfx/d3d/d3d.h +++ b/gfx/d3d/d3d.h @@ -54,7 +54,6 @@ #include "../font_driver.h" #include "../font_renderer_driver.h" #include "../video_context_driver.h" -#include "../video_viewport.h" #include "../common/d3d_common.h" #include "render_chain_driver.h" #ifdef _XBOX diff --git a/gfx/d3d/render_chain_driver.h b/gfx/d3d/render_chain_driver.h index 2f40fecc53..33d66a62c4 100644 --- a/gfx/d3d/render_chain_driver.h +++ b/gfx/d3d/render_chain_driver.h @@ -19,7 +19,6 @@ #include "../video_shader_parse.h" #include "../video_state_tracker.h" -#include "../video_viewport.h" #include "../../libretro.h" #include "../../defines/d3d_defines.h" diff --git a/gfx/drivers/ctr_gfx.c b/gfx/drivers/ctr_gfx.c index b4bf59efc4..81512807e4 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -22,7 +22,6 @@ #include "../../general.h" #include "../../driver.h" -#include "../video_viewport.h" #include "../video_monitor.h" #include "retroarch.h" diff --git a/gfx/drivers/dispmanx_gfx.c b/gfx/drivers/dispmanx_gfx.c index c7bf4b897e..07152572c5 100644 --- a/gfx/drivers/dispmanx_gfx.c +++ b/gfx/drivers/dispmanx_gfx.c @@ -16,7 +16,6 @@ #include "../../driver.h" #include "../../general.h" #include "../../retroarch.h" -#include "../video_viewport.h" #include "../video_monitor.h" #include "../video_context_driver.h" #include "../font_renderer_driver.h" diff --git a/gfx/drivers/exynos_gfx.c b/gfx/drivers/exynos_gfx.c index 2cabc6b92e..1e1cf11450 100644 --- a/gfx/drivers/exynos_gfx.c +++ b/gfx/drivers/exynos_gfx.c @@ -35,7 +35,6 @@ #include "../../general.h" #include "../../retroarch.h" #include "../../runloop.h" -#include "../video_viewport.h" #include "../video_monitor.h" #include "../font_renderer_driver.h" diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 88f84d4bf5..177b2c4d29 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -42,7 +42,6 @@ #endif #include "../font_driver.h" -#include "../video_viewport.h" #include "../video_pixel_converter.h" #include "../video_context_driver.h" #include "../video_texture.h" diff --git a/gfx/drivers/gx_gfx.c b/gfx/drivers/gx_gfx.c index adf0df795b..4b7466c89f 100644 --- a/gfx/drivers/gx_gfx.c +++ b/gfx/drivers/gx_gfx.c @@ -28,7 +28,6 @@ #include "../drivers_font_renderer/bitmap.h" #include "../../menu/menu_driver.h" #include "../../menu/menu_display.h" -#include "../video_viewport.h" #include "../video_monitor.h" #ifdef HW_RVL diff --git a/gfx/drivers/nullgfx.c b/gfx/drivers/nullgfx.c index 4e83fa3adb..0ff0a3eb23 100644 --- a/gfx/drivers/nullgfx.c +++ b/gfx/drivers/nullgfx.c @@ -16,7 +16,6 @@ #include "../../general.h" #include "../../driver.h" -#include "../video_viewport.h" static void *null_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data) diff --git a/gfx/drivers/omap_gfx.c b/gfx/drivers/omap_gfx.c index e31bec2747..aaea1538e6 100644 --- a/gfx/drivers/omap_gfx.c +++ b/gfx/drivers/omap_gfx.c @@ -21,7 +21,6 @@ #include "../../retroarch.h" #include #include -#include "../video_viewport.h" #include "../video_monitor.h" #include "../video_context_driver.h" #include "../font_renderer_driver.h" diff --git a/gfx/drivers/psp1_gfx.c b/gfx/drivers/psp1_gfx.c index de560b047c..4b7be2d30c 100644 --- a/gfx/drivers/psp1_gfx.c +++ b/gfx/drivers/psp1_gfx.c @@ -25,7 +25,6 @@ #include "../../defines/psp_defines.h" #include "../../general.h" #include "../../driver.h" -#include "../video_viewport.h" #include "../video_monitor.h" #ifndef SCEGU_SCR_WIDTH diff --git a/gfx/drivers/sdl2_gfx.c b/gfx/drivers/sdl2_gfx.c index f4e9c5f605..0444db486c 100644 --- a/gfx/drivers/sdl2_gfx.c +++ b/gfx/drivers/sdl2_gfx.c @@ -24,7 +24,6 @@ #include "../../performance.h" #include #include -#include "../video_viewport.h" #include "../video_monitor.h" #include "../video_context_driver.h" #include "../font_renderer_driver.h" diff --git a/gfx/drivers/sdl_gfx.c b/gfx/drivers/sdl_gfx.c index 44940f0209..e3126abfc6 100644 --- a/gfx/drivers/sdl_gfx.c +++ b/gfx/drivers/sdl_gfx.c @@ -21,7 +21,6 @@ #include "../../general.h" #include "../../performance.h" #include -#include "../video_viewport.h" #include "../video_monitor.h" #include "../video_context_driver.h" #include "../font_renderer_driver.h" diff --git a/gfx/drivers/sunxi_gfx.c b/gfx/drivers/sunxi_gfx.c index 5de5ca56ff..43a676e340 100644 --- a/gfx/drivers/sunxi_gfx.c +++ b/gfx/drivers/sunxi_gfx.c @@ -25,7 +25,6 @@ #include "../../general.h" #include "../../retroarch.h" -#include "../video_viewport.h" #include "../video_monitor.h" #include "../font_renderer_driver.h" diff --git a/gfx/drivers/vg.c b/gfx/drivers/vg.c index 58a1498d3c..2e689a59cc 100644 --- a/gfx/drivers/vg.c +++ b/gfx/drivers/vg.c @@ -33,7 +33,6 @@ #include "../font_renderer_driver.h" #include "../../content.h" #include "../../runloop.h" -#include "../video_viewport.h" typedef struct { diff --git a/gfx/drivers/vita2d_gfx.c b/gfx/drivers/vita2d_gfx.c index dd0d4b7fdc..007a0318de 100644 --- a/gfx/drivers/vita2d_gfx.c +++ b/gfx/drivers/vita2d_gfx.c @@ -20,7 +20,6 @@ #include "../../defines/psp_defines.h" #include "../../general.h" #include "../../driver.h" -#include "../video_viewport.h" #include "../video_monitor.h" typedef struct vita_menu_frame diff --git a/gfx/drivers/xenon360_gfx.c b/gfx/drivers/xenon360_gfx.c index 7781130030..0f44ff0c9c 100644 --- a/gfx/drivers/xenon360_gfx.c +++ b/gfx/drivers/xenon360_gfx.c @@ -25,8 +25,6 @@ #include "../../driver.h" #include "../../general.h" -#Include "../video_viewport.h" - #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gfx/drivers/xshm.c b/gfx/drivers/xshm.c index 11e7cf6857..7c438e2a4f 100644 --- a/gfx/drivers/xshm.c +++ b/gfx/drivers/xshm.c @@ -19,7 +19,6 @@ #include #include #include -#include "../video_viewport.h" #include "../video_monitor.h" #include "../font_renderer_driver.h" #include diff --git a/gfx/drivers/xvideo.c b/gfx/drivers/xvideo.c index 29d139ac35..b8bcfbb6d8 100644 --- a/gfx/drivers/xvideo.c +++ b/gfx/drivers/xvideo.c @@ -31,7 +31,6 @@ #include "../../driver.h" #include "../../general.h" -#include "../video_viewport.h" #include "../video_monitor.h" #include "../font_renderer_driver.h" diff --git a/gfx/video_driver.c b/gfx/video_driver.c index ccc6d0f626..36acb097a1 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -65,6 +65,7 @@ typedef struct video_driver_state } filter; } video_driver_state_t; +static struct retro_system_av_info video_viewport_av_info; static video_driver_state_t video_state; char rotation_lut[4][32] = @@ -1487,3 +1488,132 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data) return false; } + +/** + * video_viewport_set_config: + * + * Sets viewport to config aspect ratio. + **/ +void video_viewport_set_config(void) +{ + settings_t *settings = config_get_ptr(); + struct retro_system_av_info *av_info = video_viewport_get_system_av_info(); + + if (settings->video.aspect_ratio < 0.0f) + { + struct retro_game_geometry *geom = &av_info->geometry; + + if (!geom) + return; + + if (geom->aspect_ratio > 0.0f && settings->video.aspect_ratio_auto) + aspectratio_lut[ASPECT_RATIO_CONFIG].value = geom->aspect_ratio; + else + { + unsigned base_width = geom->base_width; + unsigned base_height = geom->base_height; + + /* Get around division by zero errors */ + if (base_width == 0) + base_width = 1; + if (base_height == 0) + base_height = 1; + aspectratio_lut[ASPECT_RATIO_CONFIG].value = + (float)base_width / base_height; /* 1:1 PAR. */ + } + } + else + aspectratio_lut[ASPECT_RATIO_CONFIG].value = + settings->video.aspect_ratio; +} + +/** + * video_viewport_get_scaled_integer: + * @vp : Viewport handle + * @width : Width. + * @height : Height. + * @aspect_ratio : Aspect ratio (in float). + * @keep_aspect : Preserve aspect ratio? + * + * Gets viewport scaling dimensions based on + * scaled integer aspect ratio. + **/ +void video_viewport_get_scaled_integer(struct video_viewport *vp, + unsigned width, unsigned height, + float aspect_ratio, bool keep_aspect) +{ + int padding_x = 0, padding_y = 0; + settings_t *settings = config_get_ptr(); + + if (!vp) + return; + + if (settings->video.aspect_ratio_idx == ASPECT_RATIO_CUSTOM) + { + struct video_viewport *custom = video_viewport_get_custom(); + + if (custom) + { + padding_x = width - custom->width; + padding_y = height - custom->height; + width = custom->width; + height = custom->height; + } + } + else + { + unsigned base_width; + /* Use system reported sizes as these define the + * geometry for the "normal" case. */ + struct retro_system_av_info *av_info = video_viewport_get_system_av_info(); + unsigned base_height = av_info ? av_info->geometry.base_height : 0; + + if (base_height == 0) + base_height = 1; + + /* Account for non-square pixels. + * This is sort of contradictory with the goal of integer scale, + * but it is desirable in some cases. + * + * If square pixels are used, base_height will be equal to + * system->av_info.base_height. */ + base_width = (unsigned)roundf(base_height * aspect_ratio); + + /* Make sure that we don't get 0x scale ... */ + if (width >= base_width && height >= base_height) + { + if (keep_aspect) + { + /* X/Y scale must be same. */ + unsigned max_scale = min(width / base_width, height / base_height); + padding_x = width - base_width * max_scale; + padding_y = height - base_height * max_scale; + } + else + { + /* X/Y can be independent, each scaled as much as possible. */ + padding_x = width % base_width; + padding_y = height % base_height; + } + } + + width -= padding_x; + height -= padding_y; + } + + vp->width = width; + vp->height = height; + vp->x = padding_x / 2; + vp->y = padding_y / 2; +} + +struct retro_system_av_info *video_viewport_get_system_av_info(void) +{ + return (struct retro_system_av_info*)&video_viewport_av_info; +} + +struct video_viewport *video_viewport_get_custom(void) +{ + settings_t *settings = config_get_ptr(); + return &settings->video_viewport_custom; +} diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 31da94382e..adcd2ba2fb 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -24,7 +24,6 @@ #include #include "video_filter.h" #include "video_shader_parse.h" -#include "video_viewport.h" #include "../libretro.h" #include "../input/input_driver.h" @@ -126,6 +125,16 @@ typedef struct video_poke_interface struct video_shader *(*get_current_shader)(void *data); } video_poke_interface_t; +typedef struct video_viewport +{ + int x; + int y; + unsigned width; + unsigned height; + unsigned full_width; + unsigned full_height; +} video_viewport_t; + typedef struct video_driver { /* Should the video driver act as an input driver as well? @@ -188,24 +197,71 @@ typedef struct video_driver unsigned (*wrap_type_to_enum)(enum gfx_wrap_type type); } video_driver_t; -extern video_driver_t video_gl; -extern video_driver_t video_psp1; -extern video_driver_t video_vita2d; -extern video_driver_t video_ctr; -extern video_driver_t video_d3d; -extern video_driver_t video_gx; -extern video_driver_t video_xenon360; -extern video_driver_t video_xvideo; -extern video_driver_t video_xdk_d3d; -extern video_driver_t video_sdl; -extern video_driver_t video_sdl2; -extern video_driver_t video_vg; -extern video_driver_t video_omap; -extern video_driver_t video_exynos; -extern video_driver_t video_dispmanx; -extern video_driver_t video_sunxi; -extern video_driver_t video_xshm; -extern video_driver_t video_null; + +enum aspect_ratio +{ + ASPECT_RATIO_4_3 = 0, + ASPECT_RATIO_16_9, + ASPECT_RATIO_16_10, + ASPECT_RATIO_16_15, + ASPECT_RATIO_1_1, + ASPECT_RATIO_2_1, + ASPECT_RATIO_3_2, + ASPECT_RATIO_3_4, + ASPECT_RATIO_4_1, + ASPECT_RATIO_4_4, + ASPECT_RATIO_5_4, + ASPECT_RATIO_6_5, + ASPECT_RATIO_7_9, + ASPECT_RATIO_8_3, + ASPECT_RATIO_8_7, + ASPECT_RATIO_19_12, + ASPECT_RATIO_19_14, + ASPECT_RATIO_30_17, + ASPECT_RATIO_32_9, + ASPECT_RATIO_CONFIG, + ASPECT_RATIO_SQUARE, + ASPECT_RATIO_CORE, + ASPECT_RATIO_CUSTOM, + + ASPECT_RATIO_END +}; + +#define LAST_ASPECT_RATIO ASPECT_RATIO_CUSTOM + +enum rotation +{ + ORIENTATION_NORMAL = 0, + ORIENTATION_VERTICAL, + ORIENTATION_FLIPPED, + ORIENTATION_FLIPPED_ROTATED, + ORIENTATION_END +}; + +extern char rotation_lut[4][32]; + +/* ABGR color format defines */ + +#define WHITE 0xffffffffu +#define RED 0xff0000ffu +#define GREEN 0xff00ff00u +#define BLUE 0xffff0000u +#define YELLOW 0xff00ffffu +#define PURPLE 0xffff00ffu +#define CYAN 0xffffff00u +#define ORANGE 0xff0063ffu +#define SILVER 0xff8c848cu +#define LIGHTBLUE 0xFFFFE0E0U +#define LIGHTORANGE 0xFFE0EEFFu + +struct aspect_ratio_elem +{ + char name[64]; + float value; +}; + +extern struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END]; + enum rarch_display_type { @@ -378,6 +434,51 @@ void video_driver_cached_frame_get(const void **data, unsigned *width, void video_driver_menu_settings(void *data, void *subgroup_data, const char *parent_group); +/** + * video_viewport_set_config: + * + * Sets viewport to config aspect ratio. + **/ +void video_viewport_set_config(void); + +/** + * video_viewport_get_scaled_integer: + * @vp : Viewport handle + * @width : Width. + * @height : Height. + * @aspect_ratio : Aspect ratio (in float). + * @keep_aspect : Preserve aspect ratio? + * + * Gets viewport scaling dimensions based on + * scaled integer aspect ratio. + **/ +void video_viewport_get_scaled_integer(struct video_viewport *vp, + unsigned width, unsigned height, + float aspect_ratio, bool keep_aspect); + +struct retro_system_av_info *video_viewport_get_system_av_info(void); + +struct video_viewport *video_viewport_get_custom(void); + +extern video_driver_t video_gl; +extern video_driver_t video_psp1; +extern video_driver_t video_vita2d; +extern video_driver_t video_ctr; +extern video_driver_t video_d3d; +extern video_driver_t video_gx; +extern video_driver_t video_xenon360; +extern video_driver_t video_xvideo; +extern video_driver_t video_xdk_d3d; +extern video_driver_t video_sdl; +extern video_driver_t video_sdl2; +extern video_driver_t video_vg; +extern video_driver_t video_omap; +extern video_driver_t video_exynos; +extern video_driver_t video_dispmanx; +extern video_driver_t video_sunxi; +extern video_driver_t video_xshm; +extern video_driver_t video_null; + #ifdef __cplusplus } #endif diff --git a/gfx/video_viewport.c b/gfx/video_viewport.c deleted file mode 100644 index d6ca776896..0000000000 --- a/gfx/video_viewport.c +++ /dev/null @@ -1,148 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2015 - 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 . - */ - -#include "../general.h" - -static struct retro_system_av_info video_viewport_av_info; - -/** - * video_viewport_set_config: - * - * Sets viewport to config aspect ratio. - **/ -void video_viewport_set_config(void) -{ - settings_t *settings = config_get_ptr(); - struct retro_system_av_info *av_info = video_viewport_get_system_av_info(); - - if (settings->video.aspect_ratio < 0.0f) - { - struct retro_game_geometry *geom = &av_info->geometry; - - if (!geom) - return; - - if (geom->aspect_ratio > 0.0f && settings->video.aspect_ratio_auto) - aspectratio_lut[ASPECT_RATIO_CONFIG].value = geom->aspect_ratio; - else - { - unsigned base_width = geom->base_width; - unsigned base_height = geom->base_height; - - /* Get around division by zero errors */ - if (base_width == 0) - base_width = 1; - if (base_height == 0) - base_height = 1; - aspectratio_lut[ASPECT_RATIO_CONFIG].value = - (float)base_width / base_height; /* 1:1 PAR. */ - } - } - else - aspectratio_lut[ASPECT_RATIO_CONFIG].value = - settings->video.aspect_ratio; -} - -/** - * video_viewport_get_scaled_integer: - * @vp : Viewport handle - * @width : Width. - * @height : Height. - * @aspect_ratio : Aspect ratio (in float). - * @keep_aspect : Preserve aspect ratio? - * - * Gets viewport scaling dimensions based on - * scaled integer aspect ratio. - **/ -void video_viewport_get_scaled_integer(struct video_viewport *vp, - unsigned width, unsigned height, - float aspect_ratio, bool keep_aspect) -{ - int padding_x = 0, padding_y = 0; - settings_t *settings = config_get_ptr(); - - if (!vp) - return; - - if (settings->video.aspect_ratio_idx == ASPECT_RATIO_CUSTOM) - { - struct video_viewport *custom = video_viewport_get_custom(); - - if (custom) - { - padding_x = width - custom->width; - padding_y = height - custom->height; - width = custom->width; - height = custom->height; - } - } - else - { - unsigned base_width; - /* Use system reported sizes as these define the - * geometry for the "normal" case. */ - struct retro_system_av_info *av_info = video_viewport_get_system_av_info(); - unsigned base_height = av_info ? av_info->geometry.base_height : 0; - - if (base_height == 0) - base_height = 1; - - /* Account for non-square pixels. - * This is sort of contradictory with the goal of integer scale, - * but it is desirable in some cases. - * - * If square pixels are used, base_height will be equal to - * system->av_info.base_height. */ - base_width = (unsigned)roundf(base_height * aspect_ratio); - - /* Make sure that we don't get 0x scale ... */ - if (width >= base_width && height >= base_height) - { - if (keep_aspect) - { - /* X/Y scale must be same. */ - unsigned max_scale = min(width / base_width, height / base_height); - padding_x = width - base_width * max_scale; - padding_y = height - base_height * max_scale; - } - else - { - /* X/Y can be independent, each scaled as much as possible. */ - padding_x = width % base_width; - padding_y = height % base_height; - } - } - - width -= padding_x; - height -= padding_y; - } - - vp->width = width; - vp->height = height; - vp->x = padding_x / 2; - vp->y = padding_y / 2; -} - -struct retro_system_av_info *video_viewport_get_system_av_info(void) -{ - return (struct retro_system_av_info*)&video_viewport_av_info; -} - -struct video_viewport *video_viewport_get_custom(void) -{ - settings_t *settings = config_get_ptr(); - return &settings->video_viewport_custom; -} diff --git a/gfx/video_viewport.h b/gfx/video_viewport.h deleted file mode 100644 index 8e4079ed62..0000000000 --- a/gfx/video_viewport.h +++ /dev/null @@ -1,133 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2015 - 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 . - */ - -#ifndef _VIDEO_VIEWPORT_H -#define _VIDEO_VIEWPORT_H - -#include -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct video_viewport -{ - int x; - int y; - unsigned width; - unsigned height; - unsigned full_width; - unsigned full_height; -} video_viewport_t; - -enum aspect_ratio -{ - ASPECT_RATIO_4_3 = 0, - ASPECT_RATIO_16_9, - ASPECT_RATIO_16_10, - ASPECT_RATIO_16_15, - ASPECT_RATIO_1_1, - ASPECT_RATIO_2_1, - ASPECT_RATIO_3_2, - ASPECT_RATIO_3_4, - ASPECT_RATIO_4_1, - ASPECT_RATIO_4_4, - ASPECT_RATIO_5_4, - ASPECT_RATIO_6_5, - ASPECT_RATIO_7_9, - ASPECT_RATIO_8_3, - ASPECT_RATIO_8_7, - ASPECT_RATIO_19_12, - ASPECT_RATIO_19_14, - ASPECT_RATIO_30_17, - ASPECT_RATIO_32_9, - ASPECT_RATIO_CONFIG, - ASPECT_RATIO_SQUARE, - ASPECT_RATIO_CORE, - ASPECT_RATIO_CUSTOM, - - ASPECT_RATIO_END -}; - -#define LAST_ASPECT_RATIO ASPECT_RATIO_CUSTOM - -enum rotation -{ - ORIENTATION_NORMAL = 0, - ORIENTATION_VERTICAL, - ORIENTATION_FLIPPED, - ORIENTATION_FLIPPED_ROTATED, - ORIENTATION_END -}; - -extern char rotation_lut[4][32]; - -/* ABGR color format defines */ - -#define WHITE 0xffffffffu -#define RED 0xff0000ffu -#define GREEN 0xff00ff00u -#define BLUE 0xffff0000u -#define YELLOW 0xff00ffffu -#define PURPLE 0xffff00ffu -#define CYAN 0xffffff00u -#define ORANGE 0xff0063ffu -#define SILVER 0xff8c848cu -#define LIGHTBLUE 0xFFFFE0E0U -#define LIGHTORANGE 0xFFE0EEFFu - -struct aspect_ratio_elem -{ - char name[64]; - float value; -}; - -extern struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END]; - -/** - * video_viewport_set_config: - * - * Sets viewport to config aspect ratio. - **/ -void video_viewport_set_config(void); - -/** - * video_viewport_get_scaled_integer: - * @vp : Viewport handle - * @width : Width. - * @height : Height. - * @aspect_ratio : Aspect ratio (in float). - * @keep_aspect : Preserve aspect ratio? - * - * Gets viewport scaling dimensions based on - * scaled integer aspect ratio. - **/ -void video_viewport_get_scaled_integer(struct video_viewport *vp, - unsigned width, unsigned height, - float aspect_ratio, bool keep_aspect); - -struct retro_system_av_info *video_viewport_get_system_av_info(void); - -struct video_viewport *video_viewport_get_custom(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/griffin/griffin.c b/griffin/griffin.c index 2ac75e2944..58f746bc82 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -535,7 +535,6 @@ DRIVERS #include "../gfx/video_driver.c" #include "../gfx/video_common.c" #include "../gfx/video_pixel_converter.c" -#include "../gfx/video_viewport.c" #include "../input/input_driver.c" #include "../audio/audio_driver.c" #include "../camera/camera_driver.c" diff --git a/input/drivers/x11_input.c b/input/drivers/x11_input.c index a17e7ca2ab..f719d6b8eb 100644 --- a/input/drivers/x11_input.c +++ b/input/drivers/x11_input.c @@ -27,7 +27,6 @@ #include "../input_keymaps.h" #include "../../driver.h" -#include "../../gfx/video_viewport.h" #include "../../general.h" typedef struct x11_input diff --git a/input/input_common.c b/input/input_common.c index 6e6976318a..53a0403260 100644 --- a/input/input_common.c +++ b/input/input_common.c @@ -28,8 +28,6 @@ #include "../config.h" #endif -#include "../gfx/video_viewport.h" - static const char *bind_user_prefix[MAX_USERS] = { "input_player1", "input_player2", diff --git a/screenshot.c b/screenshot.c index 67079f410a..c96f152bdf 100644 --- a/screenshot.c +++ b/screenshot.c @@ -46,7 +46,6 @@ #include "retroarch.h" #include "screenshot.h" #include "gfx/video_driver.h" -#include "gfx/video_viewport.h" #ifdef HAVE_CONFIG_H #include "config.h"