Re-enable graphical settings on PSVita (#2175)

This commit is contained in:
Epifanov Ivan 2021-06-15 21:11:09 +03:00 committed by GitHub
commit b16d3e8b54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 15 deletions

View file

@ -2,6 +2,4 @@ set(ASAN OFF)
set(UBSAN OFF)
set(NONET ON)
set(PREFILL_PLAYER_NAME ON)
set(DEFAULT_WIDTH 960)
set(DEFAULT_HEIGHT 544)

View file

@ -507,12 +507,12 @@ static void SaveOptions()
setIniInt("Audio", "Channels", sgOptions.Audio.nChannels);
setIniInt("Audio", "Buffer Size", sgOptions.Audio.nBufferSize);
setIniInt("Audio", "Resampling Quality", sgOptions.Audio.nResamplingQuality);
#ifndef __vita__
setIniInt("Graphics", "Width", sgOptions.Graphics.nWidth);
setIniInt("Graphics", "Height", sgOptions.Graphics.nHeight);
#endif
setIniInt("Graphics", "Fullscreen", sgOptions.Graphics.bFullscreen);
#ifndef __vita__
setIniInt("Graphics", "Fullscreen", sgOptions.Graphics.bFullscreen);
#endif
#if !defined(USE_SDL1)
setIniInt("Graphics", "Upscale", sgOptions.Graphics.bUpscale);
#endif
setIniInt("Graphics", "Fit to Screen", sgOptions.Graphics.bFitToScreen);
@ -587,15 +587,14 @@ static void LoadOptions()
sgOptions.Audio.nBufferSize = getIniInt("Audio", "Buffer Size", DEFAULT_AUDIO_BUFFER_SIZE);
sgOptions.Audio.nResamplingQuality = getIniInt("Audio", "Resampling Quality", DEFAULT_AUDIO_RESAMPLING_QUALITY);
#ifndef __vita__
sgOptions.Graphics.nWidth = getIniInt("Graphics", "Width", DEFAULT_WIDTH);
sgOptions.Graphics.nHeight = getIniInt("Graphics", "Height", DEFAULT_HEIGHT);
#else
sgOptions.Graphics.nWidth = DEFAULT_WIDTH;
sgOptions.Graphics.nHeight = DEFAULT_HEIGHT;
#endif
#ifndef __vita__
sgOptions.Graphics.bFullscreen = getIniBool("Graphics", "Fullscreen", true);
#if !defined(USE_SDL1) && !defined(__vita__)
#else
sgOptions.Graphics.bFullscreen = true;
#endif
#if !defined(USE_SDL1)
sgOptions.Graphics.bUpscale = getIniBool("Graphics", "Upscale", true);
#else
sgOptions.Graphics.bUpscale = false;

View file

@ -319,9 +319,6 @@ void RenderPresent()
}
// Clear buffer to avoid artifacts in case the window was resized
#ifndef __vita__
// There's no window resizing on vita, so texture always properly overwrites display area.
// Thus, there's no need to clear the screen and unnecessarily modify sdl render context state.
if (SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255) <= -1) { // TODO only do this if window was resized
ErrSdl();
}
@ -329,7 +326,6 @@ void RenderPresent()
if (SDL_RenderClear(renderer) <= -1) {
ErrSdl();
}
#endif
if (SDL_RenderCopy(renderer, texture, nullptr, nullptr) <= -1) {
ErrSdl();
}