merge flibqtfrontend
authorunc0rr
Fri, 30 Nov 2012 18:19:52 +0400
branchflibqtfrontend
changeset 8141 6482875b0d97
parent 8139 5c38fe3afce4 (diff)
parent 8135 0401d7c216e0 (current diff)
child 8208 171da01bd04d
merge
--- a/QTfrontend/game.cpp	Fri Nov 30 15:16:14 2012 +0100
+++ b/QTfrontend/game.cpp	Fri Nov 30 18:19:52 2012 +0400
@@ -59,7 +59,7 @@
     switch (gameType)
     {
         case gtDemo:
-            // for video recording we need demo anyway 
+            // for video recording we need demo anyway
             emit HaveRecord(rtNeither, demo);
             break;
         case gtNet:
@@ -343,7 +343,7 @@
     gameSetup.style = NULL;
     gameSetup.gamescheme = flib_scheme_create("Default");
     gameSetup.map = flib_map_create_regular(
-                QUuid::createUuid().toByteArray().constData()
+                QUuid::createUuid().toString().toAscii().constData()
                 , themeModel->rowCount() > 0 ? themeModel->index(rand() % themeModel->rowCount()).data().toString().toUtf8().constData() : "Sheep"
                 , 2);
     gameSetup.teamlist = flib_teamlist_create();
--- a/QTfrontend/hwconsts.cpp.in	Fri Nov 30 15:16:14 2012 +0100
+++ b/QTfrontend/hwconsts.cpp.in	Fri Nov 30 18:19:52 2012 +0400
@@ -19,6 +19,7 @@
 #include <QStandardItemModel>
 
 #include "hwconsts.h"
+#include "frontlib.h"
 
 QString * cProtoVer = new QString("${HEDGEWARS_PROTO_VER}");
 QString * cDataDir = new QString("${HEDGEWARS_DATADIR}");
@@ -62,7 +63,11 @@
             AMMOLINE_PORTALS_DELAY AMMOLINE_PORTALS_CRATE ))
         ;
 
-unsigned int colors[] = HW_TEAMCOLOR_ARRAY;
+#ifndef UINT32_C
+#define UINT32_C
+#endif
+
+quint32 colors[] = HW_TEAMCOLOR_ARRAY;
 
 QString * netHost = new QString();
 quint16 netPort = NETGAME_DEFAULT_PORT;
--- a/QTfrontend/hwconsts.h	Fri Nov 30 15:16:14 2012 +0100
+++ b/QTfrontend/hwconsts.h	Fri Nov 30 18:19:52 2012 +0400
@@ -44,7 +44,7 @@
 extern int cAmmoNumber;
 extern QList< QPair<QString, QString> > cDefaultAmmos;
 
-extern unsigned int colors[];
+extern quint32 colors[];
 
 extern QString * netHost;
 extern quint16 netPort;
@@ -105,40 +105,3 @@
 #define SEASON_EASTER 8
 
 #define NETGAME_DEFAULT_PORT 46631
-
-
-// see http://en.wikipedia.org/wiki/List_of_colors
-/*define HW_TEAMCOLOR_ARRAY  {0xff007fff, /. azure          ./ \
-                              0xffdd0000, /. classic red    ./ \
-                              0xff3e9321, /. classic green  ./ \
-                              0xffa23dbb, /. classic purple ./ \
-                              0xffffb347, /. pastel orange  ./ \
-                              0xffcfcfc4, /. pastel gray    ./ \
-                              0xffbff000, /. lime           ./ \
-                              0xffffef00, /. yellow         ./ \
-                              // add new colors here
-                              0 }*/
-/*
-#define HW_TEAMCOLOR_ARRAY  { 0xffd12b42, /. red    ./ \
-                              0xff4980c1, /. blue   ./ \
-                              0xff6ab530, /. green  ./ \
-                              0xffbc64c4, /. purple ./ \
-                              0xffe76d14, /. orange ./ \
-                              0xff3fb6e6, /. cyan   ./ \
-                              0xffe3e90c, /. yellow ./ \
-                              0xff61d4ac, /. mint   ./ \
-                              0xfff1c3e1, /. pink   ./ \
-                              // add new colors here
-                              0 }*/
-/* another set. this one is a merge of mikade/bugq colours w/ a bit of channel feedback */
-#define HW_TEAMCOLOR_ARRAY  { 0xffff0204, /* red    */ \
-                              0xff4980c1, /* blue   */ \
-                              0xff1de6ba, /* teal   */ \
-                              0xffb541ef, /* purple */ \
-                              0xffe55bb0, /* pink   */ \
-                              0xff20bf00, /* green  */ \
-                              0xfffe8b0e, /* orange */ \
-                              0xff5f3605, /* brown  */ \
-                              0xffffff01, /* yellow */ \
-                              /* add new colors here */ \
-                              0 }
--- a/QTfrontend/team.cpp	Fri Nov 30 15:16:14 2012 +0100
+++ b/QTfrontend/team.cpp	Fri Nov 30 18:19:52 2012 +0400
@@ -35,19 +35,19 @@
     QList<QByteArray> baList;
 
     flib_team team;
-    bzero(&team, sizeof(team));
+    memset(&team, 0, sizeof(team));
     baList << teamname.toUtf8();
     team.name = baList.last().data();
-    team.grave = "Statue";
-    team.fort = "Plane";
-    team.voicepack = "Default";
-    team.flag = "hedgewars";
+    team.grave = const_cast<char *>("Statue");
+    team.fort = const_cast<char *>("Plane");
+    team.voicepack = const_cast<char *>("Default");
+    team.flag = const_cast<char *>("hedgewars");
 
     for (int i = 0; i < HEDGEHOGS_PER_TEAM; i++)
     {
         baList << QLineEdit::tr("hedgehog %1").arg(i+1).toUtf8();
         team.hogs[i].name = baList.last().data();
-        team.hogs[i].hat = "NoHat";
+        team.hogs[i].hat = const_cast<char *>("NoHat");
     }
 
     m_oldTeamName = teamname;
@@ -74,7 +74,7 @@
     // net teams are configured from QStringList
     if(strLst.size() != 23) throw HWTeamConstructException();
     flib_team team;
-    bzero(&team, sizeof(team));
+    memset(&team, 0, sizeof(team));
 
     for(int i = 0; i < 6; ++i)
         baList << strLst[i].toUtf8();
@@ -94,7 +94,7 @@
 
         QString hat = strLst[i * 2 + 8];
         if (hat.isEmpty())
-            team.hogs[i].hat = "NoHat";
+            team.hogs[i].hat = const_cast<char *>("NoHat");
         else
         {
             baList << hat.toUtf8();