Got rid of the extra "Zoom" translation string.
Merged the recent changes, except the GS window "full control" (r4537 and r4538) as those may need some testing.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/0.9.8@4544 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2011-04-07 13:59:43 +00:00
parent e6d1fdc0f6
commit f1fe785ff4
6 changed files with 110 additions and 13 deletions

View File

@ -56,7 +56,7 @@ Dialogs::AboutBoxDialog::AboutBoxDialog( wxWindow* parent )
wxString LabelGreets = wxsFormat(
L"Hiryu and Sjeep (libcdvd / iso filesystem), nneeve (fpu and vu), n1ckname (compilation guides)"
L"Hiryu and Sjeep (libcdvd / iso filesystem), nneeve (fpu and vu), n1ckname (compilation guides), Shadow Lady"
L"\n\n"
L"%s: ChickenLiver (Lilypad), Efp (efp), "
L"Gabest (Gsdx, Cdvdolio, Xpad), Zeydlitz (ZZogl)"

View File

@ -58,7 +58,7 @@ Panels::GSWindowSettingsPanel::GSWindowSettingsPanel( wxWindow* parent )
L"Above/Below 100: Zoom In/Out\n"
L"0: Automatic-Zoom-In untill the black-bars are gone (Aspect ratio is kept, some of the image goes out of screen).\n"
L" NOTE: Some games draw their own black-bars, which will not be removed with '0'.\n\n"
L"Keyboard: NUMPAD-PLUS: Zoom-In, NUMPAD-MINUS: Zoom-Out, NUMPAD-*: Toggle 100/0"
L"Keyboard: CTRL + NUMPAD-PLUS: Zoom-In, CTRL + NUMPAD-MINUS: Zoom-Out, CTRL + NUMPAD-*: Toggle 100/0"
) );*/
m_check_VsyncEnable->SetToolTip( pxEt( "!ContextTip:Window:Vsync",
@ -113,7 +113,9 @@ Panels::GSWindowSettingsPanel::GSWindowSettingsPanel( wxWindow* parent )
s_AspectRatio += Label(_("Custom Window Size:"))| pxMiddle;
s_AspectRatio += s_customsize | pxAlignRight;
s_AspectRatio += Label(_("Zoom:")) | StdExpand();
// 0.9.8: This new text came after the string freeze.
//s_AspectRatio += Label(_("Zoom:")) | StdExpand();
s_AspectRatio += Label( L"Zoom:" ) | StdExpand();
s_AspectRatio += m_text_Zoom;

View File

@ -48,6 +48,7 @@ bool RunLinuxDialog()
GtkWidget *render_label, *render_combo_box;
GtkWidget *interlace_label, *interlace_combo_box;
GtkWidget *aspect_label, *aspect_combo_box;
GtkWidget *swthreads_label, *swthreads_text;
GtkWidget *filter_check, *logz_check, *paltex_check, *fba_check, *aa_check, *win_check;
int return_value;
@ -71,6 +72,7 @@ bool RunLinuxDialog()
gtk_combo_box_append_text(GTK_COMBO_BOX(res_combo_box), "640x480@60");
gtk_combo_box_append_text(GTK_COMBO_BOX(res_combo_box), "800x600@60");
gtk_combo_box_append_text(GTK_COMBO_BOX(res_combo_box), "1024x768@60");
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.
@ -131,10 +133,21 @@ bool RunLinuxDialog()
gtk_combo_box_append_text(GTK_COMBO_BOX(aspect_combo_box), label.c_str());
}
gtk_combo_box_set_active(GTK_COMBO_BOX(aspect_combo_box), 0);
gtk_container_add(GTK_CONTAINER(main_box), aspect_label);
gtk_container_add(GTK_CONTAINER(main_box), aspect_combo_box);
swthreads_label = gtk_label_new("Software renderer threads:");
swthreads_text = gtk_entry_new();
char buf[5];
sprintf(buf, "%d", theApp.GetConfig("swthreads", 1));
gtk_entry_set_text(GTK_ENTRY(swthreads_text), buf);
gtk_container_add(GTK_CONTAINER(main_box), swthreads_label);
gtk_container_add(GTK_CONTAINER(main_box), swthreads_text);
filter_check = gtk_check_button_new_with_label("Texture Filtering");
logz_check = gtk_check_button_new_with_label("Logarithmic Z");
@ -180,6 +193,19 @@ bool RunLinuxDialog()
if (gtk_combo_box_get_active(GTK_COMBO_BOX(aspect_combo_box)) != -1)
aspect = gtk_combo_box_get_active(GTK_COMBO_BOX(aspect_combo_box));
#endif
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);
}
}
theApp.SetConfig("swthreads", atoi((char*)gtk_entry_get_text(GTK_ENTRY(swthreads_text))) );
theApp.SetConfig("filter", (int)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filter_check)));
theApp.SetConfig("logz", (int)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(logz_check)));

View File

@ -340,7 +340,10 @@ bool GSWnd::Create(const string& title, int w, int h)
{
if(m_window != NULL) return false;
if(w <= 0 || h <= 0) {w = 640; h = 480;}
if(w <= 0 || h <= 0) {
w = theApp.GetConfig("w", 640);
h = theApp.GetConfig("h", 480);
}
m_window = SDL_CreateWindow(title.c_str(), 100, 100, w, h, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
@ -364,8 +367,11 @@ Display* GSWnd::GetDisplay()
GSVector4i GSWnd::GetClientRect()
{
// TODO
int h, w;
w = theApp.GetConfig("w", 640);
h = theApp.GetConfig("h", 480);
return GSVector4i(0, 0, 640, 480);
return GSVector4i(0, 0, w, h);
}
// Returns FALSE if the window has no title, or if th window title is under the strict

View File

@ -43,25 +43,54 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
#else
size_t GetPrivateProfileString(const char* lpAppName, const char* lpKeyName, const char* lpDefault, char* lpReturnedString, size_t nSize, const char* lpFileName)
size_t GSdxApp::GetPrivateProfileString(const char* lpAppName, const char* lpKeyName, const char* lpDefault, char* lpReturnedString, size_t nSize, const char* lpFileName)
{
// TODO: linux
BuildConfigurationMap(lpFileName);
std::string key(lpKeyName);
std::string value = m_configuration_map[key];
if (value.empty())
strcpy(lpReturnedString, lpDefault);
else
strcpy(lpReturnedString, value.c_str());
return 0;
}
bool WritePrivateProfileString(const char* lpAppName, const char* lpKeyName, const char* pString, const char* lpFileName)
bool GSdxApp::WritePrivateProfileString(const char* lpAppName, const char* lpKeyName, const char* pString, const char* lpFileName)
{
// TODO: linux
BuildConfigurationMap(lpFileName);
return false;
std::string key(lpKeyName);
std::string value(pString);
m_configuration_map[key] = value;
// Save config to a file
FILE* f = fopen(lpFileName, "w");
if (f == NULL) return false; // FIXME print a nice message
map<std::string,std::string>::iterator it;
for (it = m_configuration_map.begin(); it != m_configuration_map.end(); ++it) {
// 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());
}
fclose(f);
return false;
}
int GetPrivateProfileInt(const char* lpAppName, const char* lpKeyName, int nDefault, const char* lpFileName)
int GSdxApp::GetPrivateProfileInt(const char* lpAppName, const char* lpKeyName, int nDefault, const char* lpFileName)
{
// TODO: linux
BuildConfigurationMap(lpFileName);
return nDefault;
std::string value = m_configuration_map[std::string(lpKeyName)];
if (value.empty())
return nDefault;
else
return atoi(value.c_str());
}
#endif
@ -128,6 +157,31 @@ GSdxApp::GSdxApp()
m_gpu_scale.push_back(GSSetting(2 | (2 << 2), "H x 4 - V x 4", ""));
}
#ifdef _LINUX
void GSdxApp::BuildConfigurationMap(const char* lpFileName)
{
// Check if the map was already built
std::string inifile_value(lpFileName);
if ( inifile_value.compare(m_configuration_map["inifile"]) == 0 ) return;
m_configuration_map["inifile"] = inifile_value;
// Load config from file
char value[255];
char key[255];
FILE* f = fopen(lpFileName, "r");
if (f == NULL) return; // FIXME print a nice message
while( fscanf(f, "%s = %s\n", key, value) != EOF ) {
std::string key_s(key);
std::string value_s(value);
m_configuration_map[key_s] = value_s;
}
fclose(f);
}
#endif
void* GSdxApp::GetModuleHandlePtr()
{
return s_hModule;

View File

@ -27,6 +27,9 @@ class GSdxApp
{
std::string m_ini;
std::string m_section;
#ifdef _LINUX
std::map< std::string, std::string > m_configuration_map;
#endif
public:
GSdxApp();
@ -36,6 +39,12 @@ public:
#ifdef _WINDOWS
HMODULE GetModuleHandle() {return (HMODULE)GetModuleHandlePtr();}
#endif
#ifdef _LINUX
void BuildConfigurationMap(const char* lpFileName);
size_t GetPrivateProfileString(const char* lpAppName, const char* lpKeyName, const char* lpDefault, char* lpReturnedString, size_t nSize, const char* lpFileName);
bool WritePrivateProfileString(const char* lpAppName, const char* lpKeyName, const char* pString, const char* lpFileName);
int GetPrivateProfileInt(const char* lpAppName, const char* lpKeyName, int nDefault, const char* lpFileName);
#endif
string GetConfig(const char* entry, const char* value);
void SetConfig(const char* entry, const char* value);