From e684f9e6cceaa535077468afd3fd780d460e274b Mon Sep 17 00:00:00 2001 From: weihuoya Date: Mon, 28 Jun 2021 20:15:39 +0800 Subject: [PATCH] minor fx --- .../citra/emu/settings/SettingsActivity.java | 5 ++- .../java/org/citra/emu/ui/MainActivity.java | 1 - .../renderer_opengl/gl_rasterizer.cpp | 38 +++++++++---------- .../renderer_opengl/gl_rasterizer_cache.cpp | 7 +++- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/android/app/src/main/java/org/citra/emu/settings/SettingsActivity.java b/src/android/app/src/main/java/org/citra/emu/settings/SettingsActivity.java index 37bf0565a61..2bb9d89f015 100644 --- a/src/android/app/src/main/java/org/citra/emu/settings/SettingsActivity.java +++ b/src/android/app/src/main/java/org/citra/emu/settings/SettingsActivity.java @@ -34,7 +34,7 @@ public final class SettingsActivity extends AppCompatActivity { public static void launch(Context context, MenuTag menuTag, String gameId) { Intent settings = new Intent(context, SettingsActivity.class); - settings.putExtra(ARG_MENU_TAG, menuTag); + settings.putExtra(ARG_MENU_TAG, menuTag.toString()); settings.putExtra(ARG_GAME_ID, gameId); context.startActivity(settings); } @@ -46,7 +46,8 @@ protected void onCreate(Bundle savedInstanceState) { if (savedInstanceState == null) { Intent intent = getIntent(); - mMenuTag = (MenuTag)intent.getSerializableExtra(ARG_MENU_TAG); + String menuTagStr = intent.getStringExtra(ARG_MENU_TAG); + mMenuTag = MenuTag.getMenuTag(menuTagStr); mGameId = intent.getStringExtra(ARG_GAME_ID); } else { String menuTagStr = savedInstanceState.getString(KEY_MENU_TAG); diff --git a/src/android/app/src/main/java/org/citra/emu/ui/MainActivity.java b/src/android/app/src/main/java/org/citra/emu/ui/MainActivity.java index 2fa1b1954e8..5937047aa6c 100644 --- a/src/android/app/src/main/java/org/citra/emu/ui/MainActivity.java +++ b/src/android/app/src/main/java/org/citra/emu/ui/MainActivity.java @@ -62,7 +62,6 @@ public final class MainActivity extends AppCompatActivity { private class RefreshTask extends AsyncTask { @Override protected Void doInBackground(Void... args) { - final String SDMC = "citra-emu/sdmc/Nintendo 3DS"; List dirs = new ArrayList<>(); dirs.add(new File(DirectoryInitialization.getSystemApplicationDirectory())); dirs.add(new File(DirectoryInitialization.getSystemAppletDirectory())); diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 8c4c28cb710..ecd479f4ab5 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -525,14 +525,14 @@ void RasterizerOpenGL::BindFramebufferColor(OpenGLState& state, const Surface& s framebuffer_info.color_attachment = surface->texture.handle; framebuffer_info.color_width = surface->width; framebuffer_info.color_height = surface->height; + } - if (framebuffer_info.depth_attachment && - (framebuffer_info.color_width > framebuffer_info.depth_width || - framebuffer_info.color_height > framebuffer_info.depth_height)) { - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, - 0); - framebuffer_info.depth_attachment = 0; - } + if (framebuffer_info.depth_attachment && + (framebuffer_info.color_width > framebuffer_info.depth_width || + framebuffer_info.color_height > framebuffer_info.depth_height)) { + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, + 0); + framebuffer_info.depth_attachment = 0; } } @@ -545,13 +545,13 @@ void RasterizerOpenGL::BindFramebufferDepthStencil(OpenGLState& state, const Sur framebuffer_info.depth_attachment = surface->texture.handle; framebuffer_info.depth_width = surface->width; framebuffer_info.depth_height = surface->height; + } - if (framebuffer_info.color_attachment && - (framebuffer_info.depth_width > framebuffer_info.color_width || - framebuffer_info.depth_height > framebuffer_info.color_height)) { - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); - framebuffer_info.color_attachment = 0; - } + if (framebuffer_info.color_attachment && + (framebuffer_info.depth_width > framebuffer_info.color_width || + framebuffer_info.depth_height > framebuffer_info.color_height)) { + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); + framebuffer_info.color_attachment = 0; } } @@ -565,13 +565,13 @@ void RasterizerOpenGL::BindFramebufferDepth(OpenGLState& state, const Surface& s framebuffer_info.depth_attachment = surface->texture.handle; framebuffer_info.depth_width = surface->width; framebuffer_info.depth_height = surface->height; + } - if (framebuffer_info.color_attachment && - (framebuffer_info.depth_width > framebuffer_info.color_width || - framebuffer_info.depth_height > framebuffer_info.color_height)) { - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); - framebuffer_info.color_attachment = 0; - } + if (framebuffer_info.color_attachment && + (framebuffer_info.depth_width > framebuffer_info.color_width || + framebuffer_info.depth_height > framebuffer_info.color_height)) { + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); + framebuffer_info.color_attachment = 0; } } diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 6791201cfc4..b02b76005a0 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -994,7 +994,12 @@ SurfaceRect_Tuple RasterizerCacheOpenGL::GetSurfaceSubRect(const SurfaceParams& // Check for a surface we can expand before creating a new one if (surface == nullptr) { - surface = FindMatch(surface_cache, aligned_params, + SurfaceParams expand_params = aligned_params; + if (aligned_params.height < 512) { + expand_params.addr -= expand_params.size; + expand_params.end += expand_params.size; + } + surface = FindMatch(surface_cache, expand_params, match_res_scale); if (surface != nullptr) { if (aligned_params.width != aligned_params.stride) {