Skip to content

Commit

Permalink
minor fx
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuoya committed Jun 28, 2021
1 parent 43a29ee commit e684f9e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down
Expand Up @@ -62,7 +62,6 @@ public final class MainActivity extends AppCompatActivity {
private class RefreshTask extends AsyncTask<Void, GameFile, Void> {
@Override
protected Void doInBackground(Void... args) {
final String SDMC = "citra-emu/sdmc/Nintendo 3DS";
List<File> dirs = new ArrayList<>();
dirs.add(new File(DirectoryInitialization.getSystemApplicationDirectory()));
dirs.add(new File(DirectoryInitialization.getSystemAppletDirectory()));
Expand Down
38 changes: 19 additions & 19 deletions src/video_core/renderer_opengl/gl_rasterizer.cpp
Expand Up @@ -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;
}
}

Expand All @@ -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;
}
}

Expand All @@ -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;
}
}

Expand Down
7 changes: 6 additions & 1 deletion src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
Expand Up @@ -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<MatchFlags::Expand | MatchFlags::Invalid>(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<MatchFlags::Expand | MatchFlags::Invalid>(surface_cache, expand_params,
match_res_scale);
if (surface != nullptr) {
if (aligned_params.width != aligned_params.stride) {
Expand Down

0 comments on commit e684f9e

Please sign in to comment.