Merging (all) the recent changes into /0.9.8.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/0.9.8@4557 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2011-04-09 01:46:07 +00:00
commit 6b8e8845fd
9 changed files with 135 additions and 31 deletions

View File

@ -27,13 +27,12 @@
; (Binaries, shared DLLs, null plugins, game database, languages, etc)
; Note that v3 pthreads is compatible with v4 pthreads, so we just copy v4 over both
; filenames. This allows many older plugin versions to continue to work. (note that
; v3 will be removed for 0.9.8).
; filenames. This allows many older plugin versions to continue to work.
File ..\bin\w32pthreads.v4.dll
File ..\bin\SDL.dll
; See above comment.
; File /oname=w32pthreads.v3.dll ..\bin\w32pthreads.v4.dll
File /oname=w32pthreads.v3.dll ..\bin\w32pthreads.v4.dll
File ..\bin\GameIndex.dbf
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
@ -62,9 +61,6 @@
File ..\bin\Plugins\CDVDnull.dll
!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
; In 0.9.7 there is only English, so including the other mo files (for now) is pointless.
; This code will be re-enabled when the new GUI is translated.
!if ${INC_LANGS} > 0
SetOutPath $INSTDIR\Langs
!insertmacro UNINSTALL.LOG_OPEN_INSTALL

View File

@ -74,8 +74,8 @@ InstallDir "$PROGRAMFILES\PCSX2 ${APP_VERSION}"
!define APP_EXE "$INSTDIR\${APP_FILENAME}.exe"
!define INSTDIR_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_FILENAME}"
!define PCSX2_README "pcsx2 readme ${APP_VERSION}.doc"
!define PCSX2_FAQ "pcsx2 FAQ ${APP_VERSION}.pdf"
!define PCSX2_README "PCSX2_Readme_${APP_VERSION}.pdf"
!define PCSX2_FAQ "PCSX2_FAQ_${APP_VERSION}.pdf"
Var DirectXSetupError

View File

@ -713,6 +713,9 @@ AppConfig::GSWindowOptions::GSWindowOptions()
AspectRatio = AspectRatio_4_3;
Zoom = 100;
StretchY = 100;
OffsetX = 0;
OffsetY = 0;
WindowSize = wxSize( 640, 480 );
WindowPos = wxDefaultPosition;

View File

@ -190,6 +190,10 @@ public:
AspectRatioType AspectRatio;
Fixed100 Zoom;
Fixed100 StretchY;
Fixed100 OffsetX;
Fixed100 OffsetY;
wxSize WindowSize;
wxPoint WindowPos;

View File

@ -51,6 +51,16 @@ void GSPanel::InitDefaultAccelerators()
m_Accels->Map( AAC( WXK_NUMPAD_SUBTRACT ).Cmd(), "GSwindow_ZoomOut" );
m_Accels->Map( AAC( WXK_NUMPAD_MULTIPLY ).Cmd(), "GSwindow_ZoomToggle" );
m_Accels->Map( AAC( WXK_NUMPAD_ADD ).Cmd().Alt(), "GSwindow_ZoomInY" ); //CTRL on Windows (probably linux too), CMD on OSX
m_Accels->Map( AAC( WXK_NUMPAD_SUBTRACT ).Cmd().Alt(), "GSwindow_ZoomOutY" );
m_Accels->Map( AAC( WXK_NUMPAD_MULTIPLY ).Cmd().Alt(), "GSwindow_ZoomResetY" );
m_Accels->Map( AAC( WXK_UP ).Cmd().Alt(), "GSwindow_OffsetYminus" );
m_Accels->Map( AAC( WXK_DOWN ).Cmd().Alt(), "GSwindow_OffsetYplus" );
m_Accels->Map( AAC( WXK_LEFT ).Cmd().Alt(), "GSwindow_OffsetXminus" );
m_Accels->Map( AAC( WXK_RIGHT ).Cmd().Alt(), "GSwindow_OffsetXplus" );
m_Accels->Map( AAC( WXK_NUMPAD_DIVIDE ).Cmd().Alt(), "GSwindow_OffsetReset" );
m_Accels->Map( AAC( WXK_ESCAPE ), "Sys_Suspend" );
m_Accels->Map( AAC( WXK_F8 ), "Sys_TakeSnapshot" );
m_Accels->Map( AAC( WXK_F8 ).Shift(), "Sys_TakeSnapshot");
@ -131,6 +141,9 @@ void GSPanel::DoResize()
wxSize client = GetParent()->GetClientSize();
wxSize viewport = client;
if ( !client.GetHeight() || !client.GetWidth() )
return;
double clientAr = (double)client.GetWidth()/(double)client.GetHeight();
double targetAr = clientAr;
@ -150,9 +163,14 @@ void GSPanel::DoResize()
if( zoom == 0 )//auto zoom in untill black-bars are gone (while keeping the aspect ratio).
zoom = max( (float)arr, (float)(1.0/arr) );
viewport.Scale(zoom, zoom);
viewport.Scale(zoom, zoom*g_Conf->GSWindow.StretchY.ToFloat()/100.0 );
SetSize( viewport );
CenterOnParent();
int cx, cy;
GetPosition(&cx, &cy);
float unit = .01*(float)min(viewport.x, viewport.y);
SetPosition( wxPoint( cx + unit*g_Conf->GSWindow.OffsetX.ToFloat(), cy + unit*g_Conf->GSWindow.OffsetY.ToFloat() ) );
}
void GSPanel::OnResize(wxSizeEvent& event)

View File

@ -176,13 +176,8 @@ namespace Implementations
AppApplySettings();
}
void SetZoom(float zoom)
void UpdateImagePosition()
{
if( zoom < 0 )
return;
g_Conf->GSWindow.Zoom = zoom;
Console.WriteLn(L"GSwindow: set zoom: %f", zoom);
//AppApplySettings() would have been nicer, since it also immidiately affects the GUI (if open).
//However, the events sequence it generates also "depresses" Shift/CTRL/etc, so consecutive zoom with CTRL down breaks.
//Since zoom only affects the window viewport anyway, we can live with directly calling it.
@ -191,6 +186,69 @@ namespace Implementations
woot->DoResize();
}
void SetOffset(float x, float y)
{
g_Conf->GSWindow.OffsetX = x;
g_Conf->GSWindow.OffsetY = y;
Console.WriteLn(L"(GSwindow) Offset: x=%f, y=%f", x,y);
UpdateImagePosition();
}
void GSwindow_OffsetYplus(){
SetOffset(g_Conf->GSWindow.OffsetX.ToFloat(), g_Conf->GSWindow.OffsetY.ToFloat()+1);
}
void GSwindow_OffsetYminus(){
SetOffset(g_Conf->GSWindow.OffsetX.ToFloat(), g_Conf->GSWindow.OffsetY.ToFloat()-1);
}
void GSwindow_OffsetXplus(){
SetOffset(g_Conf->GSWindow.OffsetX.ToFloat()+1, g_Conf->GSWindow.OffsetY.ToFloat());
}
void GSwindow_OffsetXminus(){
SetOffset(g_Conf->GSWindow.OffsetX.ToFloat()-1, g_Conf->GSWindow.OffsetY.ToFloat());
}
void GSwindow_OffsetReset(){
SetOffset(0,0);
}
void SetZoomY(float zoom)
{
if( zoom <= 0 )
return;
g_Conf->GSWindow.StretchY = zoom;
Console.WriteLn(L"(GSwindow) Vertical stretch: %f", zoom);
UpdateImagePosition();
}
void GSwindow_ZoomInY()
{
SetZoomY( g_Conf->GSWindow.StretchY.ToFloat()+1 );
}
void GSwindow_ZoomOutY()
{
SetZoomY( g_Conf->GSWindow.StretchY.ToFloat()-1 );
}
void GSwindow_ZoomResetY()
{
SetZoomY( 100 );
}
void SetZoom(float zoom)
{
if( zoom < 0 )
return;
g_Conf->GSWindow.Zoom = zoom;
Console.WriteLn(L"(GSwindow) Zoom: %f", zoom);
UpdateImagePosition();
}
void GSwindow_ZoomIn()
{
@ -215,6 +273,7 @@ namespace Implementations
SetZoom( z );
}
void Sys_Suspend()
{
CoreThread.Suspend();
@ -395,6 +454,16 @@ static const GlobalCommandDescriptor CommandDeclarations[] =
NULL,
},
{ "GSwindow_ZoomInY", Implementations::GSwindow_ZoomInY, NULL, NULL, },
{ "GSwindow_ZoomOutY", Implementations::GSwindow_ZoomOutY, NULL, NULL, },
{ "GSwindow_ZoomResetY", Implementations::GSwindow_ZoomResetY, NULL, NULL, },
{ "GSwindow_OffsetYminus", Implementations::GSwindow_OffsetYminus, NULL, NULL, },
{ "GSwindow_OffsetYplus", Implementations::GSwindow_OffsetYplus, NULL, NULL, },
{ "GSwindow_OffsetXminus", Implementations::GSwindow_OffsetXminus, NULL, NULL, },
{ "GSwindow_OffsetXplus", Implementations::GSwindow_OffsetXplus, NULL, NULL, },
{ "GSwindow_OffsetReset", Implementations::GSwindow_OffsetReset, NULL, NULL, },
{ "Sys_Suspend",
Implementations::Sys_Suspend,
NULL,

View File

@ -75,8 +75,17 @@ bool RunLinuxDialog()
gtk_combo_box_append_text(GTK_COMBO_BOX(res_combo_box), "1280x960@60");
gtk_combo_box_append_text(GTK_COMBO_BOX(res_combo_box), "And a few other values like that.");
// Or whatever the default value is.
gtk_combo_box_set_active(GTK_COMBO_BOX(res_combo_box), 2);
// A little hackish but enough for the moment.
// Better drop this setting and lets the user resize the windows like any applications
// You need only to constrain it with the aspect ratio -- greg
int width = theApp.GetConfig("ModeWidth", 640);
switch(width) {
case 1280: gtk_combo_box_set_active(GTK_COMBO_BOX(res_combo_box), 3); break;
case 1024: gtk_combo_box_set_active(GTK_COMBO_BOX(res_combo_box), 2); break;
case 800: gtk_combo_box_set_active(GTK_COMBO_BOX(res_combo_box), 1); break;
case 640: gtk_combo_box_set_active(GTK_COMBO_BOX(res_combo_box), 0); break;
default: gtk_combo_box_set_active(GTK_COMBO_BOX(res_combo_box), 0); break;
}
gtk_container_add(GTK_CONTAINER(main_box), res_label);
gtk_container_add(GTK_CONTAINER(main_box), res_combo_box);
@ -196,11 +205,11 @@ bool RunLinuxDialog()
if (gtk_combo_box_get_active(GTK_COMBO_BOX(res_combo_box)) != -1) {
int resolution = gtk_combo_box_get_active(GTK_COMBO_BOX(res_combo_box));
switch (resolution) {
case 0: theApp.SetConfig("w", 640); theApp.SetConfig("h", 480); break;
case 1: theApp.SetConfig("w", 800); theApp.SetConfig("h", 600); break;
case 2: theApp.SetConfig("w", 1024); theApp.SetConfig("h", 768); break;
case 3: theApp.SetConfig("w", 1280); theApp.SetConfig("h", 960); break;
default: theApp.SetConfig("w", 640); theApp.SetConfig("h", 480);
case 0: theApp.SetConfig("ModeWidth", 640); theApp.SetConfig("ModeHeight", 480); break;
case 1: theApp.SetConfig("ModeWidth", 800); theApp.SetConfig("ModeHeight", 600); break;
case 2: theApp.SetConfig("ModeWidth", 1024); theApp.SetConfig("ModeHeight", 768); break;
case 3: theApp.SetConfig("ModeWidth", 1280); theApp.SetConfig("ModeHeight", 960); break;
default: theApp.SetConfig("ModeWidth", 640); theApp.SetConfig("ModeHeight", 480);
}
}

View File

@ -341,8 +341,8 @@ bool GSWnd::Create(const string& title, int w, int h)
if(m_window != NULL) return false;
if(w <= 0 || h <= 0) {
w = theApp.GetConfig("w", 640);
h = theApp.GetConfig("h", 480);
w = theApp.GetConfig("ModeWidth", 640);
h = theApp.GetConfig("ModeHeight", 480);
}
m_window = SDL_CreateWindow(title.c_str(), 100, 100, w, h, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
@ -368,8 +368,8 @@ GSVector4i GSWnd::GetClientRect()
{
// TODO
int h, w;
w = theApp.GetConfig("w", 640);
h = theApp.GetConfig("h", 480);
w = theApp.GetConfig("ModeWidth", 640);
h = theApp.GetConfig("ModeHeight", 480);
return GSVector4i(0, 0, w, h);
}

View File

@ -49,9 +49,11 @@ size_t GSdxApp::GetPrivateProfileString(const char* lpAppName, const char* lpKey
std::string key(lpKeyName);
std::string value = m_configuration_map[key];
if (value.empty())
if (value.empty()) {
// save the value for futur call
m_configuration_map[key] = std::string(lpDefault);
strcpy(lpReturnedString, lpDefault);
else
} else
strcpy(lpReturnedString, value.c_str());
return 0;
@ -75,7 +77,8 @@ bool GSdxApp::WritePrivateProfileString(const char* lpAppName, const char* lpKey
// Do not save the inifile key which is not an option
if (it->first.compare("inifile") == 0) continue;
fprintf(f, "%s = %s\n", it->first.c_str(), it->second.c_str());
if (!it->second.empty())
fprintf(f, "%s = %s\n", it->first.c_str(), it->second.c_str());
}
fclose(f);
@ -87,9 +90,11 @@ int GSdxApp::GetPrivateProfileInt(const char* lpAppName, const char* lpKeyName,
BuildConfigurationMap(lpFileName);
std::string value = m_configuration_map[std::string(lpKeyName)];
if (value.empty())
if (value.empty()) {
// save the value for futur call
SetConfig(lpKeyName, nDefault);
return nDefault;
else
} else
return atoi(value.c_str());
}
#endif