- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
authorunc0rr
Fri, 22 Feb 2008 16:07:16 +0000
changeset 788 00720357601f
parent 787 5064d72fa0e2
child 789 3d976d2579eb
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round - Small fixes everywhere
QTfrontend/game.cpp
QTfrontend/game.h
QTfrontend/hwform.cpp
QTfrontend/hwform.h
QTfrontend/mapContainer.cpp
QTfrontend/pages.cpp
QTfrontend/pages.h
QTfrontend/ui_hwform.cpp
QTfrontend/ui_hwform.h
hedgewars/uMisc.pas
share/hedgewars/Data/Trainings/002_Bazooka.txt
--- a/QTfrontend/game.cpp	Thu Feb 21 19:31:53 2008 +0000
+++ b/QTfrontend/game.cpp	Fri Feb 22 16:07:16 2008 +0000
@@ -18,6 +18,7 @@
 
 #include <QString>
 #include <QByteArray>
+#include <QUuid>
 
 #include "game.h"
 #include "hwconsts.h"
@@ -37,7 +38,6 @@
 	this->config = config;
 	this->gamecfg = gamecfg;
 	TeamCount = 0;
-	seed = "";
 }
 
 HWGame::~HWGame()
@@ -73,6 +73,7 @@
 			gt = "TL";
 	}
 	HWProto::addStringToBuffer(buf, gt);
+
 	HWProto::addStringListToBuffer(buf, gamecfg->getFullConfig());
 
 	if (m_pTeamSelWidget)
@@ -95,22 +96,26 @@
 
 void HWGame::SendQuickConfig()
 {
-	commonConfig();
+	QByteArray teamscfg;
 
-	QByteArray teamscfg;
+	HWProto::addStringToBuffer(teamscfg, "TL");
+	HWProto::addStringToBuffer(teamscfg, QString("etheme %1")
+			.arg((Themes->size() > 0) ? Themes->at(rand() % Themes->size()) : "steel"));
+	HWProto::addStringToBuffer(teamscfg, "eseed " + QUuid::createUuid().toString());
+
 	HWTeam team1(0);
 	team1.difficulty = 0;
 	team1.teamColor = *color1;
 	team1.numHedgehogs = 4;
 	HWProto::addStringListToBuffer(teamscfg,
-			team1.TeamGameConfig(gamecfg->getInitHealth()));
+			team1.TeamGameConfig(100));
 
 	HWTeam team2(2);
 	team2.difficulty = 4;
 	team2.teamColor = *color2;
 	team2.numHedgehogs = 4;
 	HWProto::addStringListToBuffer(teamscfg,
-			team2.TeamGameConfig(gamecfg->getInitHealth()));
+			team2.TeamGameConfig(100));
 
 	HWProto::addStringToBuffer(teamscfg, *cDefaultAmmoStore);
 	HWProto::addStringToBuffer(teamscfg, *cDefaultAmmoStore);
@@ -119,14 +124,14 @@
 
 void HWGame::SendTrainingConfig()
 {
-	QByteArray teamscfg;
-	HWProto::addStringToBuffer(teamscfg, "TL");
+	QByteArray traincfg;
+	HWProto::addStringToBuffer(traincfg, "TL");
 
 	HWTeam team1(0);
 	team1.difficulty = 0;
 	team1.teamColor = *color1;
 	team1.numHedgehogs = 1;
-	HWProto::addStringListToBuffer(teamscfg,
+	HWProto::addStringListToBuffer(traincfg,
 			team1.TeamGameConfig(100));
 
 	QFile file(datadir->absolutePath() + "/Trainings/001_Shotgun.txt");
@@ -139,10 +144,10 @@
 	QTextStream stream(&file);
 	while(!stream.atEnd())
 	{
-		HWProto::addStringToBuffer(teamscfg, "e" + stream.readLine());
+		HWProto::addStringToBuffer(traincfg, "e" + stream.readLine());
 	}
 
-	RawSendIPC(teamscfg);
+	RawSendIPC(traincfg);
 }
 
 void HWGame::SendNetConfig()
@@ -301,7 +306,6 @@
 void HWGame::StartLocal()
 {
 	gameType = gtLocal;
-	seed = gamecfg->getCurrentSeed();
 	demo.clear();
 	Start();
 	SetGameState(gsStarted);
@@ -310,7 +314,6 @@
 void HWGame::StartQuick()
 {
 	gameType = gtQLocal;
-	seed = gamecfg->getCurrentSeed();
 	demo.clear();
 	Start();
 	SetGameState(gsStarted);
@@ -319,7 +322,6 @@
 void HWGame::StartTraining()
 {
 	gameType = gtTraining;
-	seed = "training";
 	demo.clear();
 	Start();
 	SetGameState(gsStarted);
--- a/QTfrontend/game.h	Thu Feb 21 19:31:53 2008 +0000
+++ b/QTfrontend/game.h	Fri Feb 22 16:07:16 2008 +0000
@@ -76,7 +76,6 @@
     };
 	char msgbuf[MAXMSGCHARS];
 	QString teams[5];
-	QString seed;
 	QString ammostr;
 	int TeamCount;
 	GameUIConfig * config;
--- a/QTfrontend/hwform.cpp	Thu Feb 21 19:31:53 2008 +0000
+++ b/QTfrontend/hwform.cpp	Fri Feb 22 16:07:16 2008 +0000
@@ -64,9 +64,6 @@
 	connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed()));
 	connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked()));
 
-	connect(ui.pageSimpleGame->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
-	connect(ui.pageSimpleGame->BtnSimpleGame,	SIGNAL(clicked()),	this, SLOT(SimpleGame()));
-
 	connect(ui.pageEditTeam->BtnTeamSave,	SIGNAL(clicked()),	this, SLOT(TeamSave()));
 	connect(ui.pageEditTeam->BtnTeamDiscard,	SIGNAL(clicked()),	this, SLOT(TeamDiscard()));
 
@@ -109,7 +106,7 @@
 
 	connect(ui.pageGameStats->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
 
-	connect(ui.pageSinglePlayer->BtnSimpleGamePage,	SIGNAL(clicked()),	this, SLOT(GoToSimpleGame()));
+	connect(ui.pageSinglePlayer->BtnSimpleGamePage,	SIGNAL(clicked()),	this, SLOT(SimpleGame()));
 	connect(ui.pageSinglePlayer->BtnTrainPage,	SIGNAL(clicked()),	this, SLOT(GoToTraining()));
 	connect(ui.pageSinglePlayer->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
 
@@ -135,7 +132,6 @@
   // FIXME: rewrite this with boost (or TR1/0x)
   QVector<QComboBox*> combos;
   combos.push_back(ui.pageOptions->WeaponsName);
-  combos.push_back(ui.pageSimpleGame->gameCFG->WeaponsName);
   combos.push_back(ui.pageMultiplayer->gameCFG->WeaponsName);
   combos.push_back(ui.pageNetGame->pGameCFG->WeaponsName);
 
@@ -184,11 +180,6 @@
 	GoToPage(ID_PAGE_SINGLEPLAYER);
 }
 
-void HWForm::GoToSimpleGame()
-{
-	GoToPage(ID_PAGE_SIMPLEGAME);
-}
-
 void HWForm::GoToTraining()
 {
 	GoToPage(ID_PAGE_TRAINING);
@@ -363,7 +354,7 @@
 
 void HWForm::SimpleGame()
 {
-	CreateGame(ui.pageSimpleGame->gameCFG, 0, cDefaultAmmoStore->mid(10));
+	CreateGame(0, 0, cDefaultAmmoStore->mid(10));
 	game->StartQuick();
 }
 
--- a/QTfrontend/hwform.h	Thu Feb 21 19:31:53 2008 +0000
+++ b/QTfrontend/hwform.h	Fri Feb 22 16:07:16 2008 +0000
@@ -51,7 +51,6 @@
 	void GoToDemos();
 	void GoToNet();
 	void GoToInfo();
-	void GoToSimpleGame();
 	void GoToTraining();
 	void GoToSelectWeapon();
 	void GoToSelectNewWeapon();
@@ -91,21 +90,20 @@
 	void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget, QString ammo);
 	void closeEvent(QCloseEvent *event);
 	enum PageIDs {
-		ID_PAGE_SIMPLEGAME      =  0,
-		ID_PAGE_SETUP_TEAM      =  1,
-		ID_PAGE_SETUP           =  2,
-		ID_PAGE_MULTIPLAYER     =  3,
-		ID_PAGE_DEMOS           =  4,
-		ID_PAGE_NET             =  5,
-		ID_PAGE_NETCFG          =  6,
-		ID_PAGE_INFO            =  7,
-		ID_PAGE_MAIN            =  8,
-		ID_PAGE_GAMESTATS       =  9,
-		ID_PAGE_SINGLEPLAYER    = 10,
-		ID_PAGE_TRAINING        = 11,
-		ID_PAGE_SELECTWEAPON    = 12,
-		ID_PAGE_NETSERVER       = 13,
-		ID_PAGE_INGAME          = 14
+		ID_PAGE_SETUP_TEAM      =  0,
+		ID_PAGE_SETUP           =  1,
+		ID_PAGE_MULTIPLAYER     =  2,
+		ID_PAGE_DEMOS           =  3,
+		ID_PAGE_NET             =  4,
+		ID_PAGE_NETCFG          =  5,
+		ID_PAGE_INFO            =  6,
+		ID_PAGE_MAIN            =  7,
+		ID_PAGE_GAMESTATS       =  8,
+		ID_PAGE_SINGLEPLAYER    =  9,
+		ID_PAGE_TRAINING        = 10,
+		ID_PAGE_SELECTWEAPON    = 11,
+		ID_PAGE_NETSERVER       = 12,
+		ID_PAGE_INGAME          = 13
 		};
 	HWGame * game;
 	HWTeam * editedTeam;
--- a/QTfrontend/mapContainer.cpp	Thu Feb 21 19:31:53 2008 +0000
+++ b/QTfrontend/mapContainer.cpp	Fri Feb 22 16:07:16 2008 +0000
@@ -16,8 +16,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
-#include "mapContainer.h"
-
 #include <QPushButton>
 #include <QBuffer>
 #include <QUuid>
@@ -29,6 +27,7 @@
 #include <QApplication>
 
 #include "hwconsts.h"
+#include "mapContainer.h"
 
 HWMapContainer::HWMapContainer(QWidget * parent) :
   QWidget(parent), mainLayout(this)
--- a/QTfrontend/pages.cpp	Thu Feb 21 19:31:53 2008 +0000
+++ b/QTfrontend/pages.cpp	Fri Feb 22 16:07:16 2008 +0000
@@ -85,27 +85,7 @@
 	BtnExit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
 }
 
-PageSimpleGame::PageSimpleGame(QWidget* parent) : 
-  AbstractPage(parent)
-{
-	QVBoxLayout * pageLayout = new QVBoxLayout(this);
-	QHBoxLayout * topLayout = new QHBoxLayout();
-	QHBoxLayout * bottomLayout = new QHBoxLayout();
-	pageLayout->addLayout(topLayout, 100);
-	pageLayout->addLayout(bottomLayout, 0);
-
-	BtnBack = addButton(tr("Back"), bottomLayout, 100);
-	bottomLayout->addStretch(100);
-
-	BtnSimpleGame = addButton(tr("Simple Game"), bottomLayout, 100);
-
-	gameCFG = new GameCFGWidget(this);
-	topLayout->addStretch(100);
-	topLayout->addWidget(gameCFG);
-	topLayout->addStretch(100);
-}
-
-PageEditTeam::PageEditTeam(QWidget* parent) : 
+PageEditTeam::PageEditTeam(QWidget* parent) :
   AbstractPage(parent)
 {
 	QGridLayout * pageLayout = new QGridLayout(this);
--- a/QTfrontend/pages.h	Thu Feb 21 19:31:53 2008 +0000
+++ b/QTfrontend/pages.h	Fri Feb 22 16:07:16 2008 +0000
@@ -103,18 +103,6 @@
 	QPushButton *BtnExit;
 };
 
-class PageSimpleGame : public AbstractPage
-{
-	Q_OBJECT
-
-public:
-	PageSimpleGame(QWidget* parent = 0);
-
-	QPushButton *BtnSimpleGame;
-	QPushButton *BtnBack;
-	GameCFGWidget *gameCFG;
-};
-
 class PageEditTeam : public AbstractPage
 {
 	Q_OBJECT
--- a/QTfrontend/ui_hwform.cpp	Thu Feb 21 19:31:53 2008 +0000
+++ b/QTfrontend/ui_hwform.cpp	Fri Feb 22 16:07:16 2008 +0000
@@ -54,9 +54,6 @@
 {
 	Pages = new QStackedLayout(Parent);
 
-	pageSimpleGame = new PageSimpleGame();
-	Pages->addWidget(pageSimpleGame);
-
 	pageEditTeam = new PageEditTeam();
 	Pages->addWidget(pageEditTeam);
 
--- a/QTfrontend/ui_hwform.h	Thu Feb 21 19:31:53 2008 +0000
+++ b/QTfrontend/ui_hwform.h	Fri Feb 22 16:07:16 2008 +0000
@@ -20,7 +20,6 @@
 #define UI_HWFORM_H
 
 class PageMain;
-class PageSimpleGame;
 class PageEditTeam;
 class PageMultiplayer;
 class PagePlayDemo;
@@ -46,7 +45,6 @@
 	QWidget *centralWidget;
 
 	PageMain *pageMain;
-	PageSimpleGame *pageSimpleGame;
 	PageEditTeam *pageEditTeam;
 	PageMultiplayer *pageMultiplayer;
 	PagePlayDemo *pagePlayDemo;
--- a/hedgewars/uMisc.pas	Thu Feb 21 19:31:53 2008 +0000
+++ b/hedgewars/uMisc.pas	Fri Feb 22 16:07:16 2008 +0000
@@ -323,8 +323,8 @@
 if SDL_MustLock(surf) then
    SDL_UnlockSurface(surf);
 
-glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
+glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
 end;
 
 procedure FreeTexture(tex: PTexture);
--- a/share/hedgewars/Data/Trainings/002_Bazooka.txt	Thu Feb 21 19:31:53 2008 +0000
+++ b/share/hedgewars/Data/Trainings/002_Bazooka.txt	Fri Feb 22 16:07:16 2008 +0000
@@ -5,7 +5,7 @@
 $landadds 0
 $delay 0
 map Volcano
-theme avematan
+theme Volcano
 ammstore 00900000000000000000
 hhcoords 1710 765
 addtrig s2147483649 1 1 33 1150 650 1