OpenGL: Fixed initial framebuffer so it's not too small
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3381 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
085fa5f526
commit
63ae48d9f9
|
@ -485,9 +485,11 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
|
||||||
break;
|
break;
|
||||||
case ID_NATIVERESOLUTION:
|
case ID_NATIVERESOLUTION:
|
||||||
g_Config.bNativeResolution = m_NativeResolution->IsChecked();
|
g_Config.bNativeResolution = m_NativeResolution->IsChecked();
|
||||||
|
if (g_Config.bNativeResolution) g_Config.b2xResolution = false;
|
||||||
break;
|
break;
|
||||||
case ID_2X_RESOLUTION:
|
case ID_2X_RESOLUTION:
|
||||||
g_Config.b2xResolution = m_2xResolution->IsChecked();
|
g_Config.b2xResolution = m_2xResolution->IsChecked();
|
||||||
|
if (g_Config.b2xResolution) g_Config.bNativeResolution = false;
|
||||||
break;
|
break;
|
||||||
case ID_VSYNC:
|
case ID_VSYNC:
|
||||||
g_Config.bVSync = m_VSync->IsChecked();
|
g_Config.bVSync = m_VSync->IsChecked();
|
||||||
|
|
|
@ -306,9 +306,11 @@ bool Renderer::Init()
|
||||||
// The EFB is larger than 640x480 - in fact, it's 640x528, give or take a couple of lines.
|
// The EFB is larger than 640x480 - in fact, it's 640x528, give or take a couple of lines.
|
||||||
// So the below is wrong.
|
// So the below is wrong.
|
||||||
// This should really be grabbed from config rather than from OpenGL.
|
// This should really be grabbed from config rather than from OpenGL.
|
||||||
// JP: Set these big enough to accomodate any potential 2x mode
|
// JP: Set these to the biggest of the 2x mode and the custom resolution so that the framebuffer
|
||||||
s_targetwidth = 1280;
|
// does not get to be too small
|
||||||
s_targetheight = 960;
|
int W = (int)OpenGL_GetBackbufferWidth(), H = (int)OpenGL_GetBackbufferHeight();
|
||||||
|
s_targetwidth = (1280 >= W) ? 1280 : W;
|
||||||
|
s_targetheight = (960 >= H) ? 960 : H;
|
||||||
|
|
||||||
// Compensate height of render target for scaling, so that we get something close to the correct number of
|
// Compensate height of render target for scaling, so that we get something close to the correct number of
|
||||||
// vertical pixels.
|
// vertical pixels.
|
||||||
|
@ -1098,7 +1100,7 @@ void Renderer::Swap(const TRectangle& rc)
|
||||||
|
|
||||||
// Place messages on the picture, then copy it to the screen
|
// Place messages on the picture, then copy it to the screen
|
||||||
SwapBuffers();
|
SwapBuffers();
|
||||||
// Why save this as s_bNativeResolution if we updated it all the time?
|
// Why save this as s_bNativeResolution if we updated it every frame?
|
||||||
s_bNativeResolution = g_Config.bNativeResolution;
|
s_bNativeResolution = g_Config.bNativeResolution;
|
||||||
|
|
||||||
RestoreGLState();
|
RestoreGLState();
|
||||||
|
@ -1156,10 +1158,8 @@ void Renderer::SwapBuffers()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Copy the rendered frame to the real window
|
// Copy the rendered frame to the real window
|
||||||
|
|
||||||
OpenGL_SwapBuffers();
|
OpenGL_SwapBuffers();
|
||||||
|
// Clear framebuffer
|
||||||
|
|
||||||
glClearColor(0, 0, 0, 0);
|
glClearColor(0, 0, 0, 0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
|
@ -1340,7 +1340,7 @@ void Renderer::DrawDebugText()
|
||||||
std::string OSDM31 =
|
std::string OSDM31 =
|
||||||
g_Config.bCopyEFBToRAM ? "RAM" : "Texture";
|
g_Config.bCopyEFBToRAM ? "RAM" : "Texture";
|
||||||
std::string OSDM32 =
|
std::string OSDM32 =
|
||||||
g_Config.bEFBCopyDisable ? "Yes" : "No";
|
g_Config.bEFBCopyDisable ? "No" : "Yes";
|
||||||
|
|
||||||
// If there is more text than this we will have a collission
|
// If there is more text than this we will have a collission
|
||||||
if (g_Config.bShowFPS)
|
if (g_Config.bShowFPS)
|
||||||
|
@ -1398,6 +1398,7 @@ bool Renderer::SaveRenderTarget(const char *filename, int W, int H, int YOffset)
|
||||||
if (!(g_Config.bNativeResolution || g_Config.b2xResolution))
|
if (!(g_Config.bNativeResolution || g_Config.b2xResolution))
|
||||||
sscanf(g_Config.iInternalRes, "%dx%d", &W, &H);
|
sscanf(g_Config.iInternalRes, "%dx%d", &W, &H);
|
||||||
|
|
||||||
|
|
||||||
u8 *data = (u8 *)malloc(3 * W * H);
|
u8 *data = (u8 *)malloc(3 * W * H);
|
||||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||||
glReadPixels(0, YOffset, W, H, GL_RGB, GL_UNSIGNED_BYTE, data);
|
glReadPixels(0, YOffset, W, H, GL_RGB, GL_UNSIGNED_BYTE, data);
|
||||||
|
@ -1424,8 +1425,8 @@ bool Renderer::SaveRenderTarget(const char *filename, int W, int H, int YOffset)
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
// We don't adjust non-native resolutions to avoid blurring the picture.
|
// We don't adjust non-native resolutions to avoid blurring the picture.
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
float Ratio = (float)W / (float)(H), TargetRatio, TargetRatio1;
|
float Ratio = (float)W / (float)(H), TargetRatio;
|
||||||
if (g_Config.bNativeResolution && (g_Config.bKeepAR169 || g_Config.bKeepAR43)
|
if ((g_Config.bNativeResolution || g_Config.b2xResolution) && (g_Config.bKeepAR169 || g_Config.bKeepAR43)
|
||||||
&& Ratio != 4.0/3.0 && Ratio != 16.0/9.0)
|
&& Ratio != 4.0/3.0 && Ratio != 16.0/9.0)
|
||||||
{
|
{
|
||||||
if (g_Config.bKeepAR43)
|
if (g_Config.bKeepAR43)
|
||||||
|
|
|
@ -27,8 +27,9 @@ Internal and fullscreen resolution: Since the only internal resolutions allowed
|
||||||
fullscreen resolution allowed by the system there is only need for one resolution setting
|
fullscreen resolution allowed by the system there is only need for one resolution setting
|
||||||
that applies to both the internal resolution and the fullscreen resolution.
|
that applies to both the internal resolution and the fullscreen resolution.
|
||||||
|
|
||||||
Todo: Make the internal resolution option apply instantly, currently only the native or not option
|
Todo: Make the internal resolution option apply instantly, currently only the native and 2x option
|
||||||
applies instantly
|
applies instantly. To do this we need to enumerate all avaliable display resolutions before
|
||||||
|
Renderer:Init().
|
||||||
|
|
||||||
1.2 Screenshots
|
1.2 Screenshots
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
|
|
Loading…
Reference in New Issue