# HG changeset patch # User unc0rr # Date 1164396823 0 # Node ID f2f9a3d5b4418a39d8d5c9f0cb38821f5cb264df # Parent bb56f0682655b18f229be97085a409e3c76f578e Protocol version sets in CMake diff -r bb56f0682655 -r f2f9a3d5b441 CMakeLists.txt --- a/CMakeLists.txt Thu Nov 23 22:27:47 2006 +0000 +++ b/CMakeLists.txt Fri Nov 24 19:33:43 2006 +0000 @@ -9,6 +9,8 @@ endif(DEFINED DATA_INSTALL_DIR) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) +set(HEDGEWARS_PROTO_VER 3) + add_subdirectory(bin) add_subdirectory(QTfrontend) add_subdirectory(hedgewars) diff -r bb56f0682655 -r f2f9a3d5b441 QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Thu Nov 23 22:27:47 2006 +0000 +++ b/QTfrontend/CMakeLists.txt Fri Nov 24 19:33:43 2006 +0000 @@ -18,6 +18,8 @@ configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/main.cpp.in ${hedgewars_SOURCE_DIR}/QTfrontend/main.cpp) +configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.h.in + ${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.h) set(hwfr_src game.cpp diff -r bb56f0682655 -r f2f9a3d5b441 QTfrontend/game.cpp --- a/QTfrontend/game.cpp Thu Nov 23 22:27:47 2006 +0000 +++ b/QTfrontend/game.cpp Fri Nov 24 19:33:43 2006 +0000 @@ -43,7 +43,7 @@ void HWGame::onClientDisconnect() { - SaveDemo(cfgdir->absolutePath() + "/Demos/LastRound.hwd_1"); + SaveDemo(cfgdir->absolutePath() + "/Demos/LastRound.hwd_" + cProtoVer); } void HWGame::SendTeamConfig(int index) diff -r bb56f0682655 -r f2f9a3d5b441 QTfrontend/hwconsts.h --- a/QTfrontend/hwconsts.h Thu Nov 23 22:27:47 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* - * Hedgewars, a worms-like game - * Copyright (c) 2005, 2006 Andrey Korotaev - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#include - -const char resolutions[2][4][5] = -{ - {"640", "800", "1024", "1280"}, - {"480", "600", "768", "1024"} -}; - -extern QDir * cfgdir; -extern QDir * datadir; -extern QDir * bindir; diff -r bb56f0682655 -r f2f9a3d5b441 QTfrontend/hwconsts.h.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/hwconsts.h.in Fri Nov 24 19:33:43 2006 +0000 @@ -0,0 +1,32 @@ +/* + * Hedgewars, a worms-like game + * Copyright (c) 2005, 2006 Andrey Korotaev + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#include +#include + +const char resolutions[2][4][5] = +{ + {"640", "800", "1024", "1280"}, + {"480", "600", "768", "1024"} +}; + +extern QDir * cfgdir; +extern QDir * datadir; +extern QDir * bindir; + +const QString cProtoVer("${HEDGEWARS_PROTO_VER}"); diff -r bb56f0682655 -r f2f9a3d5b441 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Thu Nov 23 22:27:47 2006 +0000 +++ b/QTfrontend/hwform.cpp Fri Nov 24 19:33:43 2006 +0000 @@ -140,7 +140,8 @@ tmpdir.cd("Demos"); tmpdir.setFilter(QDir::Files); ui.pagePlayDemo->DemosList->clear(); - ui.pagePlayDemo->DemosList->addItems(tmpdir.entryList(QStringList("*.hwd_1")).replaceInStrings(QRegExp("^(.*).hwd_1"), "\\1")); + ui.pagePlayDemo->DemosList->addItems(tmpdir.entryList(QStringList("*.hwd_" + cProtoVer)) + .replaceInStrings(QRegExp("^(.*).hwd_" + cProtoVer), "\\1")); ui.Pages->setCurrentIndex(ID_PAGE_DEMOS); } @@ -202,7 +203,7 @@ return ; } game = new HWGame(config, 0); - game->PlayDemo(cfgdir->absolutePath() + "/Demos/" + curritem->text() + ".hwd_1"); + game->PlayDemo(cfgdir->absolutePath() + "/Demos/" + curritem->text() + ".hwd_" + cProtoVer); } void HWForm::NetConnect() diff -r bb56f0682655 -r f2f9a3d5b441 hedgewars/CMakeLists.txt --- a/hedgewars/CMakeLists.txt Thu Nov 23 22:27:47 2006 +0000 +++ b/hedgewars/CMakeLists.txt Fri Nov 24 19:33:43 2006 +0000 @@ -1,3 +1,6 @@ +configure_file(${hedgewars_SOURCE_DIR}/hedgewars/proto.inc.in + ${hedgewars_SOURCE_DIR}/hedgewars/proto.inc) + set(dcc32_tryexe dcc32.exe) set(fpc_tryexe fpc) set(hwengine_project "hwengine.dpr") @@ -32,6 +35,7 @@ GSHandlers.inc HHHandlers.inc options.inc + proto.inc tunsetborder.inc ) diff -r bb56f0682655 -r f2f9a3d5b441 hedgewars/hwengine.dpr --- a/hedgewars/hwengine.dpr Thu Nov 23 22:27:47 2006 +0000 +++ b/hedgewars/hwengine.dpr Fri Nov 24 19:33:43 2006 +0000 @@ -48,6 +48,7 @@ // also: GSHandlers.inc // CCHandlers.inc // HHHandlers.inc +// proto.inc procedure OnDestroy; forward; diff -r bb56f0682655 -r f2f9a3d5b441 hedgewars/proto.inc.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hedgewars/proto.inc.in Fri Nov 24 19:33:43 2006 +0000 @@ -0,0 +1,19 @@ +(* + * Hedgewars, a worms-like game + * Copyright (c) 2006 Andrey Korotaev + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + *) + +const cNetProtoVersion = ${HEDGEWARS_PROTO_VER}; diff -r bb56f0682655 -r f2f9a3d5b441 hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Thu Nov 23 22:27:47 2006 +0000 +++ b/hedgewars/uConsts.pas Fri Nov 24 19:33:43 2006 +0000 @@ -20,6 +20,7 @@ interface uses SDLh, uLocale; {$INCLUDE options.inc} +{$INCLUDE proto.inc} type TStuff = (sConsoleBG, sPowerBar, sQuestion, sWindBar, sWindL, sWindR, sRopeNode); TGameState = (gsLandGen, gsStart, gsGame, gsConsole, gsExit); @@ -77,8 +78,6 @@ msgGettingConfig = 'Getting game config...'; const - cNetProtoVersion = 2; - MAXNAMELEN = 32; COLOR_LAND = $00FFFFFF;