Пример #1
0
void Config_ApplyDlgConfig( HWND hWndDlg )
{
	char text[256];
	int i;

	SendDlgItemMessage( hWndDlg, IDC_CACHEMEGS, WM_GETTEXT, 4, (LPARAM)text );
	cache.maxBytes = atol( text ) * 1048576;

	OGL.forceBilinear = (SendDlgItemMessage( hWndDlg, IDC_FORCEBILINEAR, BM_GETCHECK, NULL, NULL ) == BST_CHECKED);
	OGL.enable2xSaI = (SendDlgItemMessage( hWndDlg, IDC_ENABLE2XSAI, BM_GETCHECK, NULL, NULL ) == BST_CHECKED);
	OGL.fog = (SendDlgItemMessage( hWndDlg, IDC_FOG, BM_GETCHECK, NULL, NULL ) == BST_CHECKED);
	OGL.originAdjust = (OGL.enable2xSaI ? 0.25 : 0.50);

	OGL.fullscreenBits = fullscreen.bitDepth[SendDlgItemMessage( hWndDlg, IDC_FULLSCREENBITDEPTH, CB_GETCURSEL, 0, 0 )];
	i = SendDlgItemMessage( hWndDlg, IDC_FULLSCREENRES, CB_GETCURSEL, 0, 0 );
	OGL.fullscreenWidth = fullscreen.resolution[i].width;
	OGL.fullscreenHeight = fullscreen.resolution[i].height;
	OGL.fullscreenRefresh = fullscreen.refreshRate[SendDlgItemMessage( hWndDlg, IDC_FULLSCREENREFRESH, CB_GETCURSEL, 0, 0 )];

	i = SendDlgItemMessage( hWndDlg, IDC_TEXTUREBPP, CB_GETCURSEL, 0, 0 );
	OGL.textureBitDepth = i;

	i = SendDlgItemMessage( hWndDlg, IDC_WINDOWEDRES, CB_GETCURSEL, 0, 0 );
	OGL.windowedWidth = windowedModes[i].width;
	OGL.windowedHeight = windowedModes[i].height;

	OGL.frameBufferTextures = (SendDlgItemMessage( hWndDlg, IDC_FRAMEBUFFER, BM_GETCHECK, NULL, NULL ) == BST_CHECKED);
	OGL.usePolygonStipple = (SendDlgItemMessage( hWndDlg, IDC_DITHEREDALPHATEST, BM_GETCHECK, NULL, NULL ) == BST_CHECKED);

	if (!OGL.fullscreen)
		OGL_ResizeWindow();

	Config_SaveConfig();
}
Пример #2
0
EXPORT void CALL ResizeGL(int width, int height)
{
    const float ratio = (config.romPAL ? 9.0f/11.0f : 0.75f);
    int videoWidth = width;
    int videoHeight = height;

    if (!config.stretchVideo) {
        videoWidth = (int) (height / ratio);
        if (videoWidth > width) {
            videoWidth = width;
            videoHeight = (int) (width * ratio);
        }
    }
    int x = (width - videoWidth) / 2;
    int y = (height - videoHeight) / 2;

    OGL_ResizeWindow(x, y, videoWidth, videoHeight);
}