[Scummvm-cvs-logs] scummvm master -> 59200bf426cc85b9ec49865010a035ce214bb2bd

lordhoto lordhoto at gmail.com
Sat Aug 20 19:42:43 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
59200bf426 SCUMM: Fix compilation when translation support is disabled.


Commit: 59200bf426cc85b9ec49865010a035ce214bb2bd
    https://github.com/scummvm/scummvm/commit/59200bf426cc85b9ec49865010a035ce214bb2bd
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-08-20T10:36:54-07:00

Commit Message:
SCUMM: Fix compilation when translation support is disabled.

For this I added a convenience version of getLanguageYesNo, which works on the
currently setup GUI translation language. All other code which requires this
acan also use it instead of having to worry about the USE_TRANSLATION and thus
having two code paths.

Changed paths:
    common/localization.cpp
    common/localization.h
    engines/scumm/dialogs.cpp



diff --git a/common/localization.cpp b/common/localization.cpp
index c4c76c3..afd31b8 100644
--- a/common/localization.cpp
+++ b/common/localization.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "common/localization.h"
+#include "common/translation.h"
 
 namespace Common {
 
@@ -54,4 +55,12 @@ void getLanguageYesNo(Language id, KeyCode &keyYes, KeyCode &keyNo) {
 	}
 }
 
+void getLanguageYesNo(KeyCode &keyYes, KeyCode &keyNo) {
+#ifdef USE_TRANSLATION
+	getLanguageYesNo(Common::parseLanguageFromLocale(TransMan.getCurrentLanguage().c_str()), keyYes, keyNo);
+#else
+	getLanguageYesNo(Common::EN_ANY, keyYes, keyNo);
+#endif
+}
+
 } // End of namespace Common
diff --git a/common/localization.h b/common/localization.h
index 879c31c..3945cf5 100644
--- a/common/localization.h
+++ b/common/localization.h
@@ -27,9 +27,26 @@
 
 namespace Common {
 
-/** Get localized equivalents for Y/N buttons */
+/**
+ * Get localized equivalents for Y/N buttons of the specified language. In
+ * case there is no specialized keys for the given language it will fall back
+ * to the English keys.
+ *
+ * @param id Language id
+ * @param keyYes Key code for yes
+ * @param keyYes Key code for no
+ */
 void getLanguageYesNo(Language id, KeyCode &keyYes, KeyCode &keyNo);
 
-}	// End of namespace Common
+/**
+ * Get localized equivalents for Y/N buttons of the current translation
+ * language of the ScummVM GUI.
+ *
+ * @param keyYes Key code for yes
+ * @param keyYes Key code for no
+ */
+void getLanguageYesNo(KeyCode &keyYes, KeyCode &keyNo);
+
+} // End of namespace Common
 
 #endif
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 0b98ac2..74a92f2 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -491,7 +491,7 @@ ConfirmDialog::ConfirmDialog(ScummEngine *scumm, int res)
 void ConfirmDialog::handleKeyDown(Common::KeyState state) {
 	Common::KeyCode keyYes, keyNo;
 
-	Common::getLanguageYesNo(Common::parseLanguageFromLocale(TransMan.getCurrentLanguage().c_str()), keyYes, keyNo);
+	Common::getLanguageYesNo(keyYes, keyNo);
 
 	if (state.keycode == Common::KEYCODE_n || state.ascii == _noKey || state.ascii == keyNo) {
 		setResult(0);






More information about the Scummvm-git-logs mailing list