QTfrontend/gameuiconfig.cpp
changeset 603 d7877468653b
parent 578 6b0af3860192
child 646 ed610c2cd0a4
--- a/QTfrontend/gameuiconfig.cpp	Fri Sep 21 18:55:44 2007 +0000
+++ b/QTfrontend/gameuiconfig.cpp	Fri Sep 21 19:18:06 2007 +0000
@@ -19,6 +19,7 @@
 #include <QMessageBox>
 #include <QCheckBox>
 #include <QLineEdit>
+#include <QDesktopWidget>
 
 #include "gameuiconfig.h"
 #include "hwform.h"
@@ -44,6 +45,11 @@
 	Form->ui.pageOptions->fpsedit->setValue(value("fps/interval", 27).toUInt());
 
 	Form->ui.pageOptions->CBAltDamage->setChecked(value("misc/altdamage", false).toBool());
+
+	QDesktopWidget desktop;
+	depth = desktop.depth();
+	if (depth < 16) depth = 16;
+	else if (depth > 16) depth = 32;
 }
 
 QStringList GameUIConfig::GetTeamsList()
@@ -51,7 +57,7 @@
 	QStringList teamslist = cfgdir->entryList(QStringList("*.cfg"));
 	QStringList cleanedList;
 	for (QStringList::Iterator it = teamslist.begin(); it != teamslist.end(); ++it ) {
-	  QString tmpTeamStr=(*it).replace(QRegExp("^(.*).cfg$"), "\\1");
+	  QString tmpTeamStr=(*it).replace(QRegExp("^(.*)\\.cfg$"), "\\1");
 	  cleanedList.push_back(tmpTeamStr);
 	}
 	return cleanedList;
@@ -109,3 +115,8 @@
 {
 	return 35 - Form->ui.pageOptions->fpsedit->value();
 }
+
+quint8 GameUIConfig::bitDepth()
+{
+	return depth;
+}