diff --git a/gfx/d3d9/d3d.cpp b/gfx/d3d9/d3d.cpp index b71038f07d..85026447bd 100644 --- a/gfx/d3d9/d3d.cpp +++ b/gfx/d3d9/d3d.cpp @@ -1153,7 +1153,7 @@ static void d3d_show_mouse(void *data, bool state) } #ifdef HAVE_MENU -static void d3d_set_rgui_texture_frame(void *data, +static void d3d_set_menu_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha) { @@ -1218,7 +1218,7 @@ static void d3d_set_rgui_texture_frame(void *data, } } -static void d3d_set_rgui_texture_enable(void *data, bool state, bool full_screen) +static void d3d_set_menu_texture_enable(void *data, bool state, bool full_screen) { d3d_video_t *d3d = (d3d_video_t*)data; @@ -1239,8 +1239,8 @@ static const video_poke_interface_t d3d_poke_interface = { d3d_set_aspect_ratio, d3d_apply_state_changes, #ifdef HAVE_MENU - d3d_set_rgui_texture_frame, - d3d_set_rgui_texture_enable, + d3d_set_menu_texture_frame, + d3d_set_menu_texture_enable, #endif d3d_set_osd_msg, diff --git a/gfx/gl.c b/gfx/gl.c index 6440d192ab..42cafee7d8 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -1459,20 +1459,20 @@ static inline void gl_draw_texture(void *data) { gl_t *gl = (gl_t*)data; - if (!gl->rgui_texture) + if (!gl->menu_texture) return; const GLfloat color[] = { - 1.0f, 1.0f, 1.0f, gl->rgui_texture_alpha, - 1.0f, 1.0f, 1.0f, gl->rgui_texture_alpha, - 1.0f, 1.0f, 1.0f, gl->rgui_texture_alpha, - 1.0f, 1.0f, 1.0f, gl->rgui_texture_alpha, + 1.0f, 1.0f, 1.0f, gl->menu_texture_alpha, + 1.0f, 1.0f, 1.0f, gl->menu_texture_alpha, + 1.0f, 1.0f, 1.0f, gl->menu_texture_alpha, + 1.0f, 1.0f, 1.0f, gl->menu_texture_alpha, }; gl->coords.vertex = vertexes_flipped; gl->coords.tex_coord = tex_coords; gl->coords.color = color; - glBindTexture(GL_TEXTURE_2D, gl->rgui_texture); + glBindTexture(GL_TEXTURE_2D, gl->menu_texture); if (gl->shader) gl->shader->use(gl, GL_SHADER_STOCK_BLEND); @@ -1481,7 +1481,7 @@ static inline void gl_draw_texture(void *data) glEnable(GL_BLEND); - if (gl->rgui_texture_full_screen) + if (gl->menu_texture_full_screen) { glViewport(0, 0, gl->win_width, gl->win_height); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); @@ -1630,7 +1630,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei if (g_extern.lifecycle_state & (1ULL << MODE_MENU) && driver.menu_ctx && driver.menu_ctx->frame) driver.menu_ctx->frame(); - if (gl->rgui_texture_enable) + if (gl->menu_texture_enable) gl_draw_texture(gl); #endif @@ -1675,7 +1675,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei #ifdef HAVE_GL_ASYNC_READBACK #ifdef HAVE_MENU // Don't readback if we're in RGUI. - else if (gl->pbo_readback_enable && !gl->rgui_texture_enable) + else if (gl->pbo_readback_enable && !gl->menu_texture_enable) gl_pbo_async_readback(gl); #endif #endif @@ -1765,8 +1765,8 @@ static void gl_free(void *data) glDeleteTextures(gl->textures, gl->texture); #if defined(HAVE_MENU) - if (gl->rgui_texture) - glDeleteTextures(1, &gl->rgui_texture); + if (gl->menu_texture) + glDeleteTextures(1, &gl->menu_texture); #endif #ifdef HAVE_OVERLAY @@ -2885,19 +2885,19 @@ static void gl_set_texture_frame(void *data, context_bind_hw_render(gl, false); - if (!gl->rgui_texture) + if (!gl->menu_texture) { - glGenTextures(1, &gl->rgui_texture); - glBindTexture(GL_TEXTURE_2D, gl->rgui_texture); + glGenTextures(1, &gl->menu_texture); + glBindTexture(GL_TEXTURE_2D, gl->menu_texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); } else - glBindTexture(GL_TEXTURE_2D, gl->rgui_texture); + glBindTexture(GL_TEXTURE_2D, gl->menu_texture); - gl->rgui_texture_alpha = alpha; + gl->menu_texture_alpha = alpha; unsigned base_size = rgb32 ? sizeof(uint32_t) : sizeof(uint16_t); glPixelStorei(GL_UNPACK_ALIGNMENT, get_alignment(width * base_size)); @@ -2927,8 +2927,8 @@ static void gl_set_texture_enable(void *data, bool state, bool full_screen) if (gl) { - gl->rgui_texture_enable = state; - gl->rgui_texture_full_screen = full_screen; + gl->menu_texture_enable = state; + gl->menu_texture_full_screen = full_screen; } } #endif diff --git a/gfx/gl_common.h b/gfx/gl_common.h index f2ceecc94d..3bde0f2674 100644 --- a/gfx/gl_common.h +++ b/gfx/gl_common.h @@ -307,10 +307,10 @@ typedef struct gl void *readback_buffer_screenshot; #if defined(HAVE_MENU) - GLuint rgui_texture; - bool rgui_texture_enable; - bool rgui_texture_full_screen; - GLfloat rgui_texture_alpha; + GLuint menu_texture; + bool menu_texture_enable; + bool menu_texture_full_screen; + GLfloat menu_texture_alpha; #endif #ifdef HAVE_GL_SYNC diff --git a/gfx/lima_gfx.c b/gfx/lima_gfx.c index 9447d6c8e1..1eaabae2df 100644 --- a/gfx/lima_gfx.c +++ b/gfx/lima_gfx.c @@ -71,8 +71,8 @@ typedef struct limare_data { int program; - int program_rgui_rgba16; - int program_rgui_rgba32; + int program_menu_rgba16; + int program_menu_rgba32; float screen_aspect; float frame_aspect; @@ -131,7 +131,7 @@ static const char *fshader_main_src = /* Header for RGUI fragment shader. */ /* Use mediump, which makes uColor into a (single-precision) float[4]. */ -static const char *fshader_rgui_header_src = +static const char *fshader_menu_header_src = "precision mediump float;\n" "\n" "varying vec2 coord;\n" @@ -141,7 +141,7 @@ static const char *fshader_rgui_header_src = "\n"; /* Main (template) for RGUI fragment shader. */ -static const char *fshader_rgui_main_src = +static const char *fshader_menu_main_src = "void main()\n" "{\n" " vec4 pixel = texture2D(in_texture, coord)%s;\n" @@ -393,27 +393,27 @@ static int create_programs(limare_data_t *pdata) { if (limare_link(pdata->state)) goto fail; /* Create shader program for RGUI with RGBA4444 pixel data. */ - pdata->program_rgui_rgba16 = limare_program_new(pdata->state); - if (pdata->program_rgui_rgba16 < 0) goto fail; + pdata->program_menu_rgba16 = limare_program_new(pdata->state); + if (pdata->program_menu_rgba16 < 0) goto fail; - snprintf(tmpbufm, 1024, fshader_rgui_main_src, ".abgr"); - strncpy(tmpbuf, fshader_rgui_header_src, 1024); + snprintf(tmpbufm, 1024, fshader_menu_main_src, ".abgr"); + strncpy(tmpbuf, fshader_menu_header_src, 1024); strcat(tmpbuf, tmpbufm); - if (vertex_shader_attach(pdata->state, pdata->program_rgui_rgba16, vshader_src)) goto fail; - if (fragment_shader_attach(pdata->state, pdata->program_rgui_rgba16, tmpbuf)) goto fail; + if (vertex_shader_attach(pdata->state, pdata->program_menu_rgba16, vshader_src)) goto fail; + if (fragment_shader_attach(pdata->state, pdata->program_menu_rgba16, tmpbuf)) goto fail; if (limare_link(pdata->state)) goto fail; /* Create shader program for RGUI with RGBA8888 pixel data. */ - pdata->program_rgui_rgba32 = limare_program_new(pdata->state); - if (pdata->program_rgui_rgba32 < 0) goto fail; + pdata->program_menu_rgba32 = limare_program_new(pdata->state); + if (pdata->program_menu_rgba32 < 0) goto fail; - snprintf(tmpbufm, 1024, fshader_rgui_main_src, ".abgr"); - strncpy(tmpbuf, fshader_rgui_header_src, 1024); + snprintf(tmpbufm, 1024, fshader_menu_main_src, ".abgr"); + strncpy(tmpbuf, fshader_menu_header_src, 1024); strcat(tmpbuf, tmpbufm); - if (vertex_shader_attach(pdata->state, pdata->program_rgui_rgba32, vshader_src)) goto fail; - if (fragment_shader_attach(pdata->state, pdata->program_rgui_rgba32, tmpbuf)) goto fail; + if (vertex_shader_attach(pdata->state, pdata->program_menu_rgba32, vshader_src)) goto fail; + if (fragment_shader_attach(pdata->state, pdata->program_menu_rgba32, tmpbuf)) goto fail; if (limare_link(pdata->state)) goto fail; return 0; @@ -450,11 +450,11 @@ typedef struct lima_video { unsigned width; unsigned height; - /* RGUI data */ - int rgui_rotation; - float rgui_alpha; - bool rgui_active; - bool rgui_rgb32; + /* MENU data */ + int menu_rotation; + float menu_alpha; + bool menu_active; + bool menu_rgb32; bool aspect_changed; @@ -578,7 +578,7 @@ static void *lima_gfx_init(const video_info_t *video, const input_driver_t **inp vid = calloc(1, sizeof(lima_video_t)); if (!vid) return NULL; - vid->rgui_alpha = 1.0f; + vid->menu_alpha = 1.0f; lima = calloc(1, sizeof(limare_data_t)); if (!lima) goto fail; @@ -662,7 +662,7 @@ static bool lima_gfx_frame(void *data, const void *frame, vid = data; /* Check if neither RGUI nor emulator framebuffer is to be displayed. */ - if (!vid->rgui_active && frame == NULL) return true; + if (!vid->menu_active && frame == NULL) return true; lima = vid->lima; @@ -726,7 +726,7 @@ static bool lima_gfx_frame(void *data, const void *frame, limare_attribute_pointer(lima->state, "in_vertex", LIMARE_ATTRIB_FLOAT, 3, 0, 4, lima->vertices); limare_attribute_pointer(lima->state, "in_coord", LIMARE_ATTRIB_FLOAT, - 2, 0, 4, lima->coords + vid->rgui_rotation * 4); + 2, 0, 4, lima->coords + vid->menu_rotation * 4); limare_texture_attach(lima->state, "in_texture", lima->cur_texture->handle); @@ -759,12 +759,12 @@ static bool lima_gfx_frame(void *data, const void *frame, limare_texture_mipmap_upload(lima->state, lima->font_texture->handle, 0, lima->buffer); /* We re-use the RGBA16 RGUI program here. */ - limare_program_current(lima->state, lima->program_rgui_rgba16); + limare_program_current(lima->state, lima->program_menu_rgba16); limare_attribute_pointer(lima->state, "in_vertex", LIMARE_ATTRIB_FLOAT, 3, 0, 4, font_vertices); limare_attribute_pointer(lima->state, "in_coord", LIMARE_ATTRIB_FLOAT, - 2, 0, 4, lima->coords + vid->rgui_rotation * 4); + 2, 0, 4, lima->coords + vid->menu_rotation * 4); limare_texture_attach(lima->state, "in_texture", lima->font_texture->handle); limare_uniform_attach(lima->state, "uColor", 4, font_color); @@ -774,18 +774,18 @@ static bool lima_gfx_frame(void *data, const void *frame, limare_disable(lima->state, GL_BLEND); } - if (vid->rgui_active && lima->cur_texture_rgui != NULL) { - float color[4] = {1.0f, 1.0f, 1.0f, vid->rgui_alpha}; + if (vid->menu_active && lima->cur_texture_rgui != NULL) { + float color[4] = {1.0f, 1.0f, 1.0f, vid->menu_alpha}; - if (vid->rgui_rgb32) - limare_program_current(lima->state, lima->program_rgui_rgba32); + if (vid->menu_rgb32) + limare_program_current(lima->state, lima->program_menu_rgba32); else - limare_program_current(lima->state, lima->program_rgui_rgba16); + limare_program_current(lima->state, lima->program_menu_rgba16); limare_attribute_pointer(lima->state, "in_vertex", LIMARE_ATTRIB_FLOAT, 3, 0, 4, lima->vertices); limare_attribute_pointer(lima->state, "in_coord", LIMARE_ATTRIB_FLOAT, - 2, 0, 4, lima->coords + vid->rgui_rotation * 4); + 2, 0, 4, lima->coords + vid->menu_rotation * 4); limare_texture_attach(lima->state, "in_texture", lima->cur_texture_rgui->handle); limare_uniform_attach(lima->state, "uColor", 4, color); @@ -826,7 +826,7 @@ static bool lima_gfx_focus(void *data) { static void lima_gfx_set_rotation(void *data, unsigned rotation) { lima_video_t *vid = data; - vid->rgui_rotation = rotation; + vid->menu_rotation = rotation; } static void lima_gfx_viewport_info(void *data, struct rarch_viewport *vp) { @@ -872,8 +872,8 @@ static void lima_set_texture_frame(void *data, const void *frame, bool rgb32, const unsigned format = rgb32 ? LIMA_TEXEL_FORMAT_RGBA_8888 : LIMA_TEXEL_FORMAT_RGBA_4444; - vid->rgui_rgb32 = rgb32; - vid->rgui_alpha = alpha; + vid->menu_rgb32 = rgb32; + vid->menu_alpha = alpha; tex = vid->lima->cur_texture_rgui; @@ -904,7 +904,7 @@ upload: static void lima_set_texture_enable(void *data, bool state, bool full_screen) { lima_video_t *vid = data; - vid->rgui_active = state; + vid->menu_active = state; } static void lima_set_osd_msg(void *data, const char *msg, void *userdata) { diff --git a/gx/gx_video.c b/gx/gx_video.c index cf7f3f9cd6..b4b7e93401 100644 --- a/gx/gx_video.c +++ b/gx/gx_video.c @@ -350,7 +350,7 @@ static void setup_video_mode(void *data) static void init_texture(void *data, unsigned width, unsigned height) { - unsigned g_filter, rgui_w, rgui_h; + unsigned g_filter, menu_w, menu_h; struct __gx_regdef *__gx = (struct __gx_regdef*)__gxregs; gx_video_t *gx = (gx_video_t*)data; struct __gx_texobj *fb_ptr = (struct __gx_texobj*)&g_tex.obj; @@ -359,18 +359,18 @@ static void init_texture(void *data, unsigned width, unsigned height) width &= ~3; height &= ~3; g_filter = g_settings.video.smooth ? GX_LINEAR : GX_NEAR; - rgui_w = 320; - rgui_h = 240; + menu_w = 320; + menu_h = 240; if (driver.menu) { - rgui_w = driver.menu->width; - rgui_h = driver.menu->height; + menu_w = driver.menu->width; + menu_h = driver.menu->height; } - __GX_InitTexObj(fb_ptr, g_tex.data, width, height, (gx->rgb32) ? GX_TF_RGBA8 : gx->rgui_texture_enable ? GX_TF_RGB5A3 : GX_TF_RGB565, GX_CLAMP, GX_CLAMP, GX_FALSE); + __GX_InitTexObj(fb_ptr, g_tex.data, width, height, (gx->rgb32) ? GX_TF_RGBA8 : gx->menu_texture_enable ? GX_TF_RGB5A3 : GX_TF_RGB565, GX_CLAMP, GX_CLAMP, GX_FALSE); __GX_InitTexObjFilterMode(fb_ptr, g_filter, g_filter); - __GX_InitTexObj(menu_ptr, menu_tex.data, rgui_w, rgui_h, GX_TF_RGB5A3, GX_CLAMP, GX_CLAMP, GX_FALSE); + __GX_InitTexObj(menu_ptr, menu_tex.data, menu_w, menu_h, GX_TF_RGB5A3, GX_CLAMP, GX_CLAMP, GX_FALSE); __GX_InitTexObjFilterMode(menu_ptr, g_filter, g_filter); __GX_InvalidateTexAll(__gx); } @@ -892,7 +892,7 @@ static bool gx_frame(void *data, const void *frame, RARCH_PERFORMANCE_INIT(gx_frame); RARCH_PERFORMANCE_START(gx_frame); - if(!gx || (!frame && !gx->rgui_texture_enable)) + if(!gx || (!frame && !gx->menu_texture_enable)) return true; if (!frame) @@ -904,7 +904,7 @@ static bool gx_frame(void *data, const void *frame, clear_efb = GX_TRUE; } - while (((g_vsync || gx->rgui_texture_enable)) && !g_draw_done) + while (((g_vsync || gx->menu_texture_enable)) && !g_draw_done) OSSleepThread(g_video_cond); width = min(g_tex.width, width); @@ -928,7 +928,7 @@ static bool gx_frame(void *data, const void *frame, if (gx->rgb32) convert_texture32(frame, g_tex.data, width, height, pitch); - else if (gx->rgui_texture_enable) + else if (gx->menu_texture_enable) convert_texture16_conv(frame, g_tex.data, width, height, pitch); else convert_texture16(frame, g_tex.data, width, height, pitch); @@ -937,7 +937,7 @@ static bool gx_frame(void *data, const void *frame, RARCH_PERFORMANCE_STOP(gx_frame_convert); } - if (gx->rgui_texture_enable && gx->menu_data) + if (gx->menu_texture_enable && gx->menu_data) { convert_texture16(gx->menu_data, menu_tex.data, driver.menu->width, driver.menu->height, driver.menu->width * 2); DCFlushRange(menu_tex.data, driver.menu->width * driver.menu->height * 2); @@ -949,7 +949,7 @@ static bool gx_frame(void *data, const void *frame, __GX_LoadTexObj(&g_tex.obj, GX_TEXMAP0); __GX_CallDispList(__gx, display_list, display_list_size); - if (gx->rgui_texture_enable) + if (gx->menu_texture_enable) { __GX_SetCurrentMtx(__gx, GX_PNMTX1); GX_LoadTexObj(&menu_tex.obj, GX_TEXMAP0); @@ -985,7 +985,7 @@ static bool gx_frame(void *data, const void *frame, #endif } - if (msg && !gx->rgui_texture_enable) + if (msg && !gx->menu_texture_enable) { unsigned x = 7 * (gx->double_strike ? 1 : 2); unsigned y = gx->vp.full_height - (35 * (gx->double_strike ? 1 : 2)); @@ -1072,7 +1072,7 @@ static void gx_set_texture_enable(void *data, bool enable, bool full_screen) if (gx) { - gx->rgui_texture_enable = enable; + gx->menu_texture_enable = enable; // need to make sure the game texture is the right pixel format for menu overlay gx->should_resize = true; } diff --git a/gx/gx_video.h b/gx/gx_video.h index 2a7cfeb2a4..efa15ef3ab 100644 --- a/gx/gx_video.h +++ b/gx/gx_video.h @@ -33,7 +33,7 @@ typedef struct gx_video bool double_strike; bool rgb32; uint32_t *menu_data; // FIXME: Should be const uint16_t*. - bool rgui_texture_enable; + bool menu_texture_enable; rarch_viewport_t vp; unsigned scale; #ifdef HAVE_OVERLAY diff --git a/psp1/psp1_video.c b/psp1/psp1_video.c index a4ed19f0d9..089aabb968 100644 --- a/psp1/psp1_video.c +++ b/psp1/psp1_video.c @@ -74,7 +74,7 @@ typedef struct __attribute__((packed)) psp1_sprite } psp1_sprite_t; -typedef struct psp1_rgui_frame +typedef struct psp1_menu_frame { void* dList; void* frame; @@ -84,7 +84,7 @@ typedef struct psp1_rgui_frame PspGeContext context_storage; -} psp1_rgui_frame_t; +} psp1_menu_frame_t; typedef struct psp1_video { @@ -98,7 +98,7 @@ typedef struct psp1_video bool rgb32; int bpp_log2; - psp1_rgui_frame_t rgui; + psp1_menu_frame_t rgui; //not implemented unsigned rotation; diff --git a/xdk/xdk_d3d.cpp b/xdk/xdk_d3d.cpp index 69a340bc2b..a25fc7d482 100644 --- a/xdk/xdk_d3d.cpp +++ b/xdk/xdk_d3d.cpp @@ -499,7 +499,7 @@ static void d3d_draw_texture(void *data) menu_texture->x = 0; menu_texture->y = 0; - if (d3d->rgui_texture_enable) + if (d3d->menu_texture_enable) { d3d->dev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); d3d->dev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); @@ -919,7 +919,7 @@ static bool d3d_frame(void *data, const void *frame, if (g_extern.lifecycle_state & (1ULL << MODE_MENU) && driver.menu_ctx && driver.menu_ctx->frame) driver.menu_ctx->frame(); - if (d3d && d3d->rgui_texture_enable) + if (d3d && d3d->menu_texture_enable) d3d_draw_texture(d3d); #endif @@ -1019,8 +1019,8 @@ static void d3d_set_texture_frame(void *data, static void d3d_set_texture_enable(void *data, bool state, bool full_screen) { d3d_video_t *d3d = (d3d_video_t*)data; - d3d->rgui_texture_enable = state; - d3d->rgui_texture_full_screen = full_screen; + d3d->menu_texture_enable = state; + d3d->menu_texture_full_screen = full_screen; } #endif diff --git a/xdk/xdk_d3d.h b/xdk/xdk_d3d.h index 8548374fd6..69cd31303e 100644 --- a/xdk/xdk_d3d.h +++ b/xdk/xdk_d3d.h @@ -89,8 +89,8 @@ typedef struct d3d_video LPDIRECT3DTEXTURE lpTexture_ot; #endif #ifdef HAVE_MENU - bool rgui_texture_enable; - bool rgui_texture_full_screen; + bool menu_texture_enable; + bool menu_texture_full_screen; #endif D3DVIEWPORT final_viewport; video_info_t video_info;