Merge from default 0.9.18
authorunc0rr
Wed, 31 Oct 2012 12:52:53 +0400
branch0.9.18
changeset 7899 468a44b74a3f
parent 7895 ac1610a7b7fa (current diff)
parent 7897 5e7c0810f365 (diff)
child 7900 e5e7678e4b2f
Merge from default
CMakeLists.txt
QTfrontend/util/libav_iteraction.cpp
QTfrontend/util/libav_iteraction.h
--- a/QTfrontend/CMakeLists.txt	Tue Oct 30 18:01:11 2012 -0400
+++ b/QTfrontend/CMakeLists.txt	Wed Oct 31 12:52:53 2012 +0400
@@ -131,7 +131,7 @@
     hwform.h
     team.h
     util/DataManager.h
-    util/libav_iteraction.h
+    util/LibavInteraction.h
     )
 
 set(hwfr_hdrs
--- a/QTfrontend/net/recorder.cpp	Tue Oct 30 18:01:11 2012 -0400
+++ b/QTfrontend/net/recorder.cpp	Wed Oct 31 12:52:53 2012 +0400
@@ -23,7 +23,7 @@
 #include "gameuiconfig.h"
 #include "hwconsts.h"
 #include "game.h"
-#include "libav_iteraction.h"
+#include "LibavInteraction.h"
 
 // Encoding is memory expensive process, so we need to limit maximum number
 // of simultaneous encoders.
@@ -38,7 +38,7 @@
     this->config = config;
     this->prefix = prefix;
     finished = false;
-    name = prefix + "." + LibavIteraction::instance().getExtension(config->AVFormat());
+    name = prefix + "." + LibavInteraction::instance().getExtension(config->AVFormat());
 }
 
 HWRecorder::~HWRecorder()
--- a/QTfrontend/ui/page/pagevideos.cpp	Tue Oct 30 18:01:11 2012 -0400
+++ b/QTfrontend/ui/page/pagevideos.cpp	Wed Oct 31 12:52:53 2012 +0400
@@ -47,7 +47,7 @@
 #include "hwconsts.h"
 #include "pagevideos.h"
 #include "igbox.h"
-#include "libav_iteraction.h"
+#include "LibavInteraction.h"
 #include "gameuiconfig.h"
 #include "recorder.h"
 #include "ask_quit.h"
@@ -128,7 +128,7 @@
         // list of supported formats
         comboAVFormats = new QComboBox(pOptionsGroup);
         pOptLayout->addWidget(comboAVFormats, 0, 1, 1, 4);
-        LibavIteraction::instance().fillFormats(comboAVFormats);
+        LibavInteraction::instance().fillFormats(comboAVFormats);
 
         // separator
         QFrame * hr = new QFrame(pOptionsGroup);
@@ -374,7 +374,7 @@
     comboAudioCodecs->clear();
 
     // get list of codecs for specified format
-    LibavIteraction::instance().fillCodecs(comboAVFormats->itemData(index).toString(), comboVideoCodecs, comboAudioCodecs);
+    LibavInteraction::instance().fillCodecs(comboAVFormats->itemData(index).toString(), comboVideoCodecs, comboAudioCodecs);
 
     // disable audio if there is no audio codec
     if (comboAudioCodecs->count() == 0)
@@ -651,7 +651,7 @@
     }
 #ifdef Q_WS_WIN
     // there is a bug in qt, QDir::rename() doesn't fail on such names but damages files
-    if (newName.contains(QRegExp("[\"*:<>?\/|]")))
+    if (newName.contains(QRegExp("[\"*:<>?\\/|]")))
     {
         setName(item, oldName);
         return;
@@ -749,7 +749,7 @@
         {
             // Extract description from file;
             // It will contain duration, resolution, etc and also comment added by hwengine.
-            item->desc = LibavIteraction::instance().getFileInfo(path);
+            item->desc = LibavInteraction::instance().getFileInfo(path);
 
             // extract prefix (original name) from description (it is enclosed in prefix[???]prefix)
             int prefixBegin = item->desc.indexOf("prefix[");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/util/LibavInteraction.cpp	Wed Oct 31 12:52:53 2012 +0400
@@ -0,0 +1,356 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
+ *
+ * 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 "LibavInteraction.h"
+
+#if VIDEOREC
+extern "C"
+{
+#include "libavformat/avformat.h"
+}
+
+#include <QVector>
+#include <QList>
+#include <QComboBox>
+
+#include "HWApplication.h"
+
+struct Codec
+{
+    CodecID id;
+    bool isAudio;
+    QString shortName; // used for identification
+    QString longName; // used for displaying to user
+    bool isRecomended;
+};
+
+struct Format
+{
+    QString shortName;
+    QString longName;
+    bool isRecomended;
+    QString extension;
+    QVector<Codec*> codecs;
+};
+
+QList<Codec> codecs;
+QMap<QString,Format> formats;
+
+// test if given format supports given codec
+bool FormatQueryCodec(AVOutputFormat *ofmt, enum CodecID codec_id)
+{
+#if LIBAVFORMAT_VERSION_MAJOR >= 54
+    return avformat_query_codec(ofmt, codec_id, FF_COMPLIANCE_NORMAL) == 1;
+#else
+    if (ofmt->codec_tag)
+        return !!av_codec_get_tag(ofmt->codec_tag, codec_id);
+    return codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec;
+#endif
+}
+
+LibavInteraction::LibavInteraction() : QObject()
+{
+    // initialize libav and register all codecs and formats
+    av_register_all();
+
+    // get list of all codecs
+    AVCodec* pCodec = NULL;
+    while (pCodec = av_codec_next(pCodec))
+    {
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+        if (!av_codec_is_encoder(pCodec))
+#else
+        if (!pCodec->encode)
+#endif
+            continue;
+
+        if (pCodec->type != AVMEDIA_TYPE_VIDEO && pCodec->type != AVMEDIA_TYPE_AUDIO)
+            continue;
+
+        // this encoders seems to be buggy
+        if (strcmp(pCodec->name, "rv10") == 0 || strcmp(pCodec->name, "rv20") == 0)
+            continue;
+
+        // doesn't support stereo sound
+        if (strcmp(pCodec->name, "real_144") == 0)
+            continue;
+
+        if (!pCodec->long_name || strlen(pCodec->long_name) == 0)
+            continue;
+
+        if (pCodec->type == AVMEDIA_TYPE_VIDEO)
+        {
+            if (pCodec->supported_framerates != NULL)
+                continue;
+
+            // check if codec supports yuv 4:2:0 format
+            if (!pCodec->pix_fmts)
+                continue;
+            bool yuv420Supported = false;
+            for (const PixelFormat* pfmt = pCodec->pix_fmts; *pfmt != -1; pfmt++)
+                if (*pfmt == PIX_FMT_YUV420P)
+                {
+                    yuv420Supported = true;
+                    break;
+                }
+            if (!yuv420Supported)
+                continue;
+        }
+        if (pCodec->type == AVMEDIA_TYPE_AUDIO)
+        {
+            // check if codec supports signed 16-bit format
+            if (!pCodec->sample_fmts)
+                continue;
+            bool s16Supported = false;
+            for (const AVSampleFormat* pfmt = pCodec->sample_fmts; *pfmt != -1; pfmt++)
+                if (*pfmt == AV_SAMPLE_FMT_S16)
+                {
+                    s16Supported = true;
+                    break;
+                }
+            if (!s16Supported)
+                continue;
+        }
+        // add codec to list of codecs
+        codecs.push_back(Codec());
+        Codec & codec = codecs.back();
+        codec.id = pCodec->id;
+        codec.isAudio = pCodec->type == AVMEDIA_TYPE_AUDIO;
+        codec.shortName = pCodec->name;
+        codec.longName = pCodec->long_name;
+
+        codec.isRecomended = false;
+        if (strcmp(pCodec->name, "libx264") == 0)
+        {
+            codec.longName = "H.264/MPEG-4 Part 10 AVC (x264)";
+            codec.isRecomended = true;
+        }
+        else if (strcmp(pCodec->name, "libxvid") == 0)
+        {
+            codec.longName = "MPEG-4 Part 2 (Xvid)";
+            codec.isRecomended = true;
+        }
+        else if (strcmp(pCodec->name, "libmp3lame") == 0)
+        {
+            codec.longName = "MP3 (MPEG audio layer 3) (LAME)";
+            codec.isRecomended = true;
+        }
+        else
+            codec.longName = pCodec->long_name;
+
+        if (strcmp(pCodec->name, "mpeg4") == 0 || strcmp(pCodec->name, "ac3_fixed") == 0)
+            codec.isRecomended = true;
+
+        // FIXME: remove next line
+        //codec.longName += QString(" (%1)").arg(codec.shortName);
+    }
+
+    // get list of all formats
+    AVOutputFormat* pFormat = NULL;
+    while (pFormat = av_oformat_next(pFormat))
+    {
+        if (!pFormat->extensions)
+            continue;
+
+        // skip some strange formats to not confuse users
+        if (strstr(pFormat->long_name, "raw"))
+            continue;
+
+        Format format;
+        bool hasVideoCodec = false;
+        for (QList<Codec>::iterator codec = codecs.begin(); codec != codecs.end(); ++codec)
+        {
+            if (!FormatQueryCodec(pFormat, codec->id))
+                continue;
+            format.codecs.push_back(&*codec);
+            if (!codec->isAudio)
+                hasVideoCodec = true;
+        }
+        if (!hasVideoCodec)
+            continue;
+
+        QString ext(pFormat->extensions);
+        ext.truncate(strcspn(pFormat->extensions, ","));
+        format.extension = ext;
+        format.shortName = pFormat->name;
+        format.longName = QString("%1 (*.%2)").arg(pFormat->long_name).arg(ext);
+
+        // FIXME: remove next line
+        //format.longName += QString(" (%1)").arg(format.shortName);
+
+        format.isRecomended = strcmp(pFormat->name, "mp4") == 0 || strcmp(pFormat->name, "avi") == 0;
+
+        formats[pFormat->name] = format;
+    }
+}
+
+void LibavInteraction::fillFormats(QComboBox * pFormats)
+{
+    // first insert recomended formats
+    foreach(const Format & format, formats)
+        if (format.isRecomended)
+            pFormats->addItem(format.longName, format.shortName);
+
+    // remember where to place separator between recomended and other formats
+    int sep = pFormats->count();
+
+    // insert remaining formats
+    foreach(const Format & format, formats)
+        if (!format.isRecomended)
+            pFormats->addItem(format.longName, format.shortName);
+
+    // insert separator if necessary
+    if (sep != 0 && sep != pFormats->count())
+        pFormats->insertSeparator(sep);
+}
+
+void LibavInteraction::fillCodecs(const QString & fmt, QComboBox * pVCodecs, QComboBox * pACodecs)
+{
+    Format & format = formats[fmt];
+
+    // first insert recomended codecs
+    foreach(Codec * codec, format.codecs)
+    {
+        if (codec->isRecomended)
+        {
+            if (codec->isAudio)
+                pACodecs->addItem(codec->longName, codec->shortName);
+            else
+                pVCodecs->addItem(codec->longName, codec->shortName);
+        }
+    }
+
+    // remember where to place separators between recomended and other codecs
+    int vsep = pVCodecs->count();
+    int asep = pACodecs->count();
+
+    // insert remaining codecs
+    foreach(Codec * codec, format.codecs)
+    {
+        if (!codec->isRecomended)
+        {
+            if (codec->isAudio)
+                pACodecs->addItem(codec->longName, codec->shortName);
+            else
+                pVCodecs->addItem(codec->longName, codec->shortName);
+        }
+    }
+
+    // insert separators if necessary
+    if (vsep != 0 && vsep != pVCodecs->count())
+        pVCodecs->insertSeparator(vsep);
+    if (asep != 0 && asep != pACodecs->count())
+        pACodecs->insertSeparator(asep);
+}
+
+QString LibavInteraction::getExtension(const QString & format)
+{
+    return formats[format].extension;
+}
+
+// get information abaout file (duration, resolution etc) in multiline string
+QString LibavInteraction::getFileInfo(const QString & filepath)
+{
+    AVFormatContext* pContext = NULL;
+    QByteArray utf8path = filepath.toUtf8();
+    if (avformat_open_input(&pContext, utf8path.data(), NULL, NULL) < 0)
+        return "";
+#if LIBAVFORMAT_VERSION_MAJOR < 54
+    if (av_find_stream_info(pContext) < 0)
+#else
+    if (avformat_find_stream_info(pContext, NULL) < 0)
+#endif
+        return "";
+
+    int s = float(pContext->duration)/AV_TIME_BASE;
+    QString desc = QString(tr("Duration: %1m %2s\n")).arg(s/60).arg(s%60);
+    for (int i = 0; i < (int)pContext->nb_streams; i++)
+    {
+        AVStream* pStream = pContext->streams[i];
+        if (!pStream)
+            continue;
+        AVCodecContext* pCodec = pContext->streams[i]->codec;
+        if (!pCodec)
+            continue;
+
+        if (pCodec->codec_type == AVMEDIA_TYPE_VIDEO)
+        {
+            desc += QString(tr("Video: %1x%2, ")).arg(pCodec->width).arg(pCodec->height);
+            if (pStream->avg_frame_rate.den)
+            {
+                float fps = float(pStream->avg_frame_rate.num)/pStream->avg_frame_rate.den;
+                desc += QString(tr("%1 fps, ")).arg(fps, 0, 'f', 2);
+            }
+        }
+        else if (pCodec->codec_type == AVMEDIA_TYPE_AUDIO)
+            desc += tr("Audio: ");
+        else
+            continue;
+        AVCodec* pDecoder = avcodec_find_decoder(pCodec->codec_id);
+        desc += pDecoder? pDecoder->name : "unknown";
+        desc += "\n";
+    }
+    AVDictionaryEntry* pComment = av_dict_get(pContext->metadata, "comment", NULL, 0);
+    if (pComment)
+        desc += QString("\n") + pComment->value;
+#if LIBAVFORMAT_VERSION_MAJOR < 54
+    av_close_input_file(pContext);
+#else
+    avformat_close_input(&pContext);
+#endif
+    return desc;
+}
+
+#else
+LibavInteraction::LibavInteraction() : QObject()
+{
+
+}
+
+void LibavInteraction::fillFormats(QComboBox * pFormats)
+{
+    Q_UNUSED(pFormats);
+}
+
+void LibavInteraction::fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs)
+{
+    Q_UNUSED(format);
+    Q_UNUSED(pVCodecs);
+    Q_UNUSED(pACodecs);
+}
+
+QString LibavInteraction::getExtension(const QString & format)
+{
+    Q_UNUSED(format);
+
+    return QString();
+}
+
+QString LibavInteraction::getFileInfo(const QString & filepath)
+{
+    Q_UNUSED(filepath);
+
+    return QString();
+}
+#endif
+
+LibavInteraction & LibavInteraction::instance()
+{
+    static LibavInteraction instance;
+    return instance;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/util/LibavInteraction.h	Wed Oct 31 12:52:53 2012 +0400
@@ -0,0 +1,51 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
+ *
+ * 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
+ */
+
+#ifndef LIBAV_ITERACTION
+#define LIBAV_ITERACTION
+
+#include <QComboBox>
+
+/**
+ * @brief Class for interacting with ffmpeg/libav libraries
+ *
+ * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+ */
+class LibavInteraction : public QObject
+{
+    Q_OBJECT;
+
+    LibavInteraction();
+
+public:
+
+    static LibavInteraction & instance();
+
+    // fill combo box with known file formats
+    void fillFormats(QComboBox * pFormats);
+
+    // fill combo boxes with known codecs for given formats
+    void fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs);
+
+    QString getExtension(const QString & format);
+
+    // get information about file (duration, resolution etc) in multiline string
+    QString getFileInfo(const QString & filepath);
+};
+
+#endif // LIBAV_ITERACTION
--- a/QTfrontend/util/libav_iteraction.cpp	Tue Oct 30 18:01:11 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,356 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
- *
- * 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 "libav_iteraction.h"
-
-#if VIDEOREC
-extern "C"
-{
-#include "libavformat/avformat.h"
-}
-
-#include <QVector>
-#include <QList>
-#include <QComboBox>
-
-#include "HWApplication.h"
-
-struct Codec
-{
-    CodecID id;
-    bool isAudio;
-    QString shortName; // used for identification
-    QString longName; // used for displaying to user
-    bool isRecomended;
-};
-
-struct Format
-{
-    QString shortName;
-    QString longName;
-    bool isRecomended;
-    QString extension;
-    QVector<Codec*> codecs;
-};
-
-QList<Codec> codecs;
-QMap<QString,Format> formats;
-
-// test if given format supports given codec
-bool FormatQueryCodec(AVOutputFormat *ofmt, enum CodecID codec_id)
-{
-#if LIBAVFORMAT_VERSION_MAJOR >= 54
-    return avformat_query_codec(ofmt, codec_id, FF_COMPLIANCE_NORMAL) == 1;
-#else
-    if (ofmt->codec_tag)
-        return !!av_codec_get_tag(ofmt->codec_tag, codec_id);
-    return codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec;
-#endif
-}
-
-LibavIteraction::LibavIteraction() : QObject()
-{
-    // initialize libav and register all codecs and formats
-    av_register_all();
-
-    // get list of all codecs
-    AVCodec* pCodec = NULL;
-    while (pCodec = av_codec_next(pCodec))
-    {
-#if LIBAVCODEC_VERSION_MAJOR >= 54
-        if (!av_codec_is_encoder(pCodec))
-#else
-        if (!pCodec->encode)
-#endif
-            continue;
-
-        if (pCodec->type != AVMEDIA_TYPE_VIDEO && pCodec->type != AVMEDIA_TYPE_AUDIO)
-            continue;
-
-        // this encoders seems to be buggy
-        if (strcmp(pCodec->name, "rv10") == 0 || strcmp(pCodec->name, "rv20") == 0)
-            continue;
-
-        // doesn't support stereo sound
-        if (strcmp(pCodec->name, "real_144") == 0)
-            continue;
-
-        if (!pCodec->long_name || strlen(pCodec->long_name) == 0)
-            continue;
-
-        if (pCodec->type == AVMEDIA_TYPE_VIDEO)
-        {
-            if (pCodec->supported_framerates != NULL)
-                continue;
-
-            // check if codec supports yuv 4:2:0 format
-            if (!pCodec->pix_fmts)
-                continue;
-            bool yuv420Supported = false;
-            for (const PixelFormat* pfmt = pCodec->pix_fmts; *pfmt != -1; pfmt++)
-                if (*pfmt == PIX_FMT_YUV420P)
-                {
-                    yuv420Supported = true;
-                    break;
-                }
-            if (!yuv420Supported)
-                continue;
-        }
-        if (pCodec->type == AVMEDIA_TYPE_AUDIO)
-        {
-            // check if codec supports signed 16-bit format
-            if (!pCodec->sample_fmts)
-                continue;
-            bool s16Supported = false;
-            for (const AVSampleFormat* pfmt = pCodec->sample_fmts; *pfmt != -1; pfmt++)
-                if (*pfmt == AV_SAMPLE_FMT_S16)
-                {
-                    s16Supported = true;
-                    break;
-                }
-            if (!s16Supported)
-                continue;
-        }
-        // add codec to list of codecs
-        codecs.push_back(Codec());
-        Codec & codec = codecs.back();
-        codec.id = pCodec->id;
-        codec.isAudio = pCodec->type == AVMEDIA_TYPE_AUDIO;
-        codec.shortName = pCodec->name;
-        codec.longName = pCodec->long_name;
-
-        codec.isRecomended = false;
-        if (strcmp(pCodec->name, "libx264") == 0)
-        {
-            codec.longName = "H.264/MPEG-4 Part 10 AVC (x264)";
-            codec.isRecomended = true;
-        }
-        else if (strcmp(pCodec->name, "libxvid") == 0)
-        {
-            codec.longName = "MPEG-4 Part 2 (Xvid)";
-            codec.isRecomended = true;
-        }
-        else if (strcmp(pCodec->name, "libmp3lame") == 0)
-        {
-            codec.longName = "MP3 (MPEG audio layer 3) (LAME)";
-            codec.isRecomended = true;
-        }
-        else
-            codec.longName = pCodec->long_name;
-
-        if (strcmp(pCodec->name, "mpeg4") == 0 || strcmp(pCodec->name, "ac3_fixed") == 0)
-            codec.isRecomended = true;
-
-        // FIXME: remove next line
-        //codec.longName += QString(" (%1)").arg(codec.shortName);
-    }
-
-    // get list of all formats
-    AVOutputFormat* pFormat = NULL;
-    while (pFormat = av_oformat_next(pFormat))
-    {
-        if (!pFormat->extensions)
-            continue;
-
-        // skip some strange formats to not confuse users
-        if (strstr(pFormat->long_name, "raw"))
-            continue;
-
-        Format format;
-        bool hasVideoCodec = false;
-        for (QList<Codec>::iterator codec = codecs.begin(); codec != codecs.end(); ++codec)
-        {
-            if (!FormatQueryCodec(pFormat, codec->id))
-                continue;
-            format.codecs.push_back(&*codec);
-            if (!codec->isAudio)
-                hasVideoCodec = true;
-        }
-        if (!hasVideoCodec)
-            continue;
-
-        QString ext(pFormat->extensions);
-        ext.truncate(strcspn(pFormat->extensions, ","));
-        format.extension = ext;
-        format.shortName = pFormat->name;
-        format.longName = QString("%1 (*.%2)").arg(pFormat->long_name).arg(ext);
-
-        // FIXME: remove next line
-        //format.longName += QString(" (%1)").arg(format.shortName);
-
-        format.isRecomended = strcmp(pFormat->name, "mp4") == 0 || strcmp(pFormat->name, "avi") == 0;
-
-        formats[pFormat->name] = format;
-    }
-}
-
-void LibavIteraction::fillFormats(QComboBox * pFormats)
-{
-    // first insert recomended formats
-    foreach(const Format & format, formats)
-        if (format.isRecomended)
-            pFormats->addItem(format.longName, format.shortName);
-
-    // remember where to place separator between recomended and other formats
-    int sep = pFormats->count();
-
-    // insert remaining formats
-    foreach(const Format & format, formats)
-        if (!format.isRecomended)
-            pFormats->addItem(format.longName, format.shortName);
-
-    // insert separator if necessary
-    if (sep != 0 && sep != pFormats->count())
-        pFormats->insertSeparator(sep);
-}
-
-void LibavIteraction::fillCodecs(const QString & fmt, QComboBox * pVCodecs, QComboBox * pACodecs)
-{
-    Format & format = formats[fmt];
-
-    // first insert recomended codecs
-    foreach(Codec * codec, format.codecs)
-    {
-        if (codec->isRecomended)
-        {
-            if (codec->isAudio)
-                pACodecs->addItem(codec->longName, codec->shortName);
-            else
-                pVCodecs->addItem(codec->longName, codec->shortName);
-        }
-    }
-
-    // remember where to place separators between recomended and other codecs
-    int vsep = pVCodecs->count();
-    int asep = pACodecs->count();
-
-    // insert remaining codecs
-    foreach(Codec * codec, format.codecs)
-    {
-        if (!codec->isRecomended)
-        {
-            if (codec->isAudio)
-                pACodecs->addItem(codec->longName, codec->shortName);
-            else
-                pVCodecs->addItem(codec->longName, codec->shortName);
-        }
-    }
-
-    // insert separators if necessary
-    if (vsep != 0 && vsep != pVCodecs->count())
-        pVCodecs->insertSeparator(vsep);
-    if (asep != 0 && asep != pACodecs->count())
-        pACodecs->insertSeparator(asep);
-}
-
-QString LibavIteraction::getExtension(const QString & format)
-{
-    return formats[format].extension;
-}
-
-// get information abaout file (duration, resolution etc) in multiline string
-QString LibavIteraction::getFileInfo(const QString & filepath)
-{
-    AVFormatContext* pContext = NULL;
-    QByteArray utf8path = filepath.toUtf8();
-    if (avformat_open_input(&pContext, utf8path.data(), NULL, NULL) < 0)
-        return "";
-#if LIBAVFORMAT_VERSION_MAJOR < 54
-    if (av_find_stream_info(pContext) < 0)
-#else
-    if (avformat_find_stream_info(pContext, NULL) < 0)
-#endif
-        return "";
-
-    int s = float(pContext->duration)/AV_TIME_BASE;
-    QString desc = QString(tr("Duration: %1m %2s\n")).arg(s/60).arg(s%60);
-    for (int i = 0; i < (int)pContext->nb_streams; i++)
-    {
-        AVStream* pStream = pContext->streams[i];
-        if (!pStream)
-            continue;
-        AVCodecContext* pCodec = pContext->streams[i]->codec;
-        if (!pCodec)
-            continue;
-
-        if (pCodec->codec_type == AVMEDIA_TYPE_VIDEO)
-        {
-            desc += QString(tr("Video: %1x%2, ")).arg(pCodec->width).arg(pCodec->height);
-            if (pStream->avg_frame_rate.den)
-            {
-                float fps = float(pStream->avg_frame_rate.num)/pStream->avg_frame_rate.den;
-                desc += QString(tr("%1 fps, ")).arg(fps, 0, 'f', 2);
-            }
-        }
-        else if (pCodec->codec_type == AVMEDIA_TYPE_AUDIO)
-            desc += tr("Audio: ");
-        else
-            continue;
-        AVCodec* pDecoder = avcodec_find_decoder(pCodec->codec_id);
-        desc += pDecoder? pDecoder->name : "unknown";
-        desc += "\n";
-    }
-    AVDictionaryEntry* pComment = av_dict_get(pContext->metadata, "comment", NULL, 0);
-    if (pComment)
-        desc += QString("\n") + pComment->value;
-#if LIBAVFORMAT_VERSION_MAJOR < 54
-    av_close_input_file(pContext);
-#else
-    avformat_close_input(&pContext);
-#endif
-    return desc;
-}
-
-#else
-LibavIteraction::LibavIteraction() : QObject()
-{
-
-}
-
-void LibavIteraction::fillFormats(QComboBox * pFormats)
-{
-    Q_UNUSED(pFormats);
-}
-
-void LibavIteraction::fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs)
-{
-    Q_UNUSED(format);
-    Q_UNUSED(pVCodecs);
-    Q_UNUSED(pACodecs);
-}
-
-QString LibavIteraction::getExtension(const QString & format)
-{
-    Q_UNUSED(format);
-
-    return QString();
-}
-
-QString LibavIteraction::getFileInfo(const QString & filepath)
-{
-    Q_UNUSED(filepath);
-
-    return QString();
-}
-#endif
-
-LibavIteraction & LibavIteraction::instance()
-{
-    static LibavIteraction instance;
-    return instance;
-}
--- a/QTfrontend/util/libav_iteraction.h	Tue Oct 30 18:01:11 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
- *
- * 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
- */
-
-#ifndef LIBAV_ITERACTION
-#define LIBAV_ITERACTION
-
-#include <QComboBox>
-
-/**
- * @brief Class for interacting with ffmpeg/libav libraries
- *
- * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
- */
-class LibavIteraction : public QObject
-{
-    Q_OBJECT;
-
-    LibavIteraction();
-
-public:
-
-    static LibavIteraction & instance();
-
-    // fill combo box with known file formats
-    void fillFormats(QComboBox * pFormats);
-
-    // fill combo boxes with known codecs for given formats
-    void fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs);
-
-    QString getExtension(const QString & format);
-
-    // get information about file (duration, resolution etc) in multiline string
-    QString getFileInfo(const QString & filepath);
-};
-
-#endif // LIBAV_ITERACTION
--- a/hedgewars/hwengine.pas	Tue Oct 30 18:01:11 2012 -0400
+++ b/hedgewars/hwengine.pas	Wed Oct 31 12:52:53 2012 +0400
@@ -39,6 +39,7 @@
 
 
 {$IFDEF HWLIBRARY}
+procedure preInitEverything();
 procedure initEverything(complete:boolean);
 procedure freeEverything(complete:boolean);
 procedure Game(gameArgs: PPChar); cdecl; export;
@@ -46,11 +47,12 @@
 
 implementation
 {$ELSE}
+procedure preInitEverything(); forward;
 procedure initEverything(complete:boolean); forward;
 procedure freeEverything(complete:boolean); forward;
 {$ENDIF}
 
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 function DoTimer(Lag: LongInt): boolean;
 var s: shortstring;
 begin
@@ -138,7 +140,7 @@
         end;
 end;
 
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 procedure MainLoop;
 var event: TSDL_Event;
     PrevTime, CurrTime: Longword;
@@ -310,28 +312,20 @@
 end;
 {$ENDIF}
 
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 procedure Game{$IFDEF HWLIBRARY}(gameArgs: PPChar); cdecl; export{$ENDIF};
 var p: TPathType;
     s: shortstring;
     i: LongInt;
 begin
 {$IFDEF HWLIBRARY}
-    initEverything(true);
+    preInitEverything();
     cShowFPS:= {$IFDEF DEBUGFILE}true{$ELSE}false{$ENDIF};
     ipcPort:= StrToInt(gameArgs[0]);
     cScreenWidth:= StrToInt(gameArgs[1]);
     cScreenHeight:= StrToInt(gameArgs[2]);
     cReducedQuality:= StrToInt(gameArgs[3]);
     cLocaleFName:= gameArgs[4];
-    // cFullScreen functionality is platform dependent, ifdef it if you need to modify it
-    cFullScreen:= false;
-    
-    if (Length(cLocaleFName) > 6) then
-        cLocale := Copy(cLocaleFName,1,5)
-    else
-        cLocale := Copy(cLocaleFName,1,2);
-        
     UserNick:= gameArgs[5];
     SetSound(gameArgs[6] = '1');
     SetMusic(gameArgs[7] = '1');
@@ -339,12 +333,8 @@
     PathPrefix:= gameArgs[9];
     UserPathPrefix:= '../Documents';
     recordFileName:= gameArgs[10];
-    cStereoMode:= smNone;
 {$ENDIF}
-    cMinScreenWidth:= min(cScreenWidth, cMinScreenWidth);
-    cMinScreenHeight:= min(cScreenHeight, cMinScreenHeight);
-    cOrigScreenWidth:= cScreenWidth;
-    cOrigScreenHeight:= cScreenHeight;
+    initEverything(true);
 
     WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (network protocol: ' + inttostr(cNetProtoVersion) + ')');
     AddFileLog('Prefix: "' + PathPrefix +'"');
@@ -443,15 +433,20 @@
     freeEverything(true);
 end;
 
-////////////////////////////////////////////////////////////////////////////////
-// As a rule of thumb, every module that is listed in either initEverything or 
-// freeEverything should come in pair, even if they are stubs. Only use this 
-// section for inialising variables and remeber that game args overwrite these,
-// so handle this section with care. Pay attention to the init/free order too! 
-procedure initEverything (complete:boolean);
+///////////////////////////////////////////////////////////////////////////////
+// preInitEverything - init variables that are going to be ovewritten by arguments
+// initEverything - init variables only. Should be coupled by below
+// freeEverything - free above. Pay attention to the init/free order!
+procedure preInitEverything;
 begin
     Randomize();
 
+    uVariables.preInitModule;
+    uSound.preInitModule;
+end;
+
+procedure initEverything (complete:boolean);
+begin
     uUtils.initModule(complete);    // opens the debug file, must be the first
     uVariables.initModule;          // inits all global variables
     uConsole.initModule;            // opens stdout
@@ -528,12 +523,12 @@
     uUtils.freeModule;              // closes debug file
 end;
 
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 procedure GenLandPreview{$IFDEF HWLIBRARY}(port: LongInt); cdecl; export{$ENDIF};
 var Preview: TPreview;
 begin
+    initEverything(false);
 {$IFDEF HWLIBRARY}
-    initEverything(false);
     WriteLnToConsole('Preview connecting on port ' + inttostr(port));
     ipcPort:= port;
     InitStepsFlags:= cifRandomize;
@@ -551,7 +546,7 @@
 end;
 
 {$IFNDEF HWLIBRARY}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 procedure DisplayUsage;
 var i: LongInt;
 begin
@@ -577,7 +572,7 @@
     WriteLn(stdout, '');
 end;
 
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 {$INCLUDE "ArgParsers.inc"}
 
 procedure GetParams;
@@ -587,14 +582,11 @@
     else
         if (ParamCount = 3) and (ParamStr(3) = 'landpreview') then
             begin
-            initEverything(false);
             ipcPort:= StrToInt(ParamStr(2));
             GameType:= gmtLandPreview;
-            exit;
             end
         else
             begin
-            initEverything(true);
             if (ParamCount = 3) and (ParamStr(3) = '--stats-only') then
                 playReplayFileWithParameters()
             else
@@ -609,15 +601,12 @@
             end
 end;
 
-////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////// m a i n ////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////// m a i n ///////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 begin
+    preInitEverything();
     GetParams();
-    if (Length(cLocaleFName) > 6) then
-        cLocale := Copy(cLocaleFName,1,5)
-    else
-        cLocale := Copy(cLocaleFName,1,2);
 
     if GameType = gmtLandPreview then
         GenLandPreview()
--- a/hedgewars/uSound.pas	Tue Oct 30 18:01:11 2012 -0400
+++ b/hedgewars/uSound.pas	Wed Oct 31 12:52:53 2012 +0400
@@ -35,6 +35,7 @@
 interface
 uses SDLh, uConsts, uTypes, SysUtils;
 
+procedure preInitModule;
 procedure initModule;
 procedure freeModule;
 
@@ -577,6 +578,13 @@
     MuteAudio;
 end;
 
+procedure preInitModule;
+begin
+    isMusicEnabled:= true;
+    isSoundEnabled:= true;
+    cInitVolume:= 100;
+end;
+
 procedure initModule;
 var t: LongInt;
     i: TSound;
@@ -586,12 +594,9 @@
 
     MusicFN:='';
     Mus:= nil;
-    isMusicEnabled:= true;
-    isSoundEnabled:= true;
     isAudioMuted:= false;
     isSEBackup:= isSoundEnabled;
     Volume:= 0;
-    cInitVolume:= 100;
     defVoicepack:= AskForVoicepack('Default');
 
     for i:= Low(TSound) to High(TSound) do
--- a/hedgewars/uUtils.pas	Tue Oct 30 18:01:11 2012 -0400
+++ b/hedgewars/uUtils.pas	Wed Oct 31 12:52:53 2012 +0400
@@ -73,7 +73,7 @@
 procedure WriteLn(var f: textfile; s: shortstring);
 {$ENDIF}
 
-procedure initModule(isGame: boolean);
+procedure initModule(isNotPreview: boolean);
 procedure freeModule;
 
 
@@ -401,14 +401,14 @@
 end;
 {$ENDIF}
 
-procedure initModule(isGame: boolean);
+procedure initModule(isNotPreview: boolean);
 {$IFDEF DEBUGFILE}
 var logfileBase: shortstring;
 {$IFNDEF MOBILE}var i: LongInt;{$ENDIF}
 {$ENDIF}
 begin
 {$IFDEF DEBUGFILE}
-    if isGame then
+    if isNotPreview then
     begin
         if GameType = gmtRecord then
             logfileBase:= 'rec'
@@ -422,7 +422,7 @@
 {$ENDIF}
 {$I-}
 {$IFDEF MOBILE}
-    {$IFDEF IPHONEOS} Assign(f,'../Documents/hw-' + logfileBase + '.log'); {$ENDIF}
+    {$IFDEF IPHONEOS} Assign(f, UserPathPrefix + '/hw-' + logfileBase + '.log'); {$ENDIF}
     {$IFDEF ANDROID} Assign(f,pathPrefix + '/' + logfileBase + '.log'); {$ENDIF}
     Rewrite(f);
 {$ELSE}
@@ -450,8 +450,6 @@
 
 procedure freeModule;
 begin
-recordFileName:= '';
-
 {$IFDEF DEBUGFILE}
     writeln(f, 'halt at ' + inttostr(GameTicks) + ' ticks. TurnTimeLeft = ' + inttostr(TurnTimeLeft));
     flush(f);
--- a/hedgewars/uVariables.pas	Tue Oct 30 18:01:11 2012 -0400
+++ b/hedgewars/uVariables.pas	Wed Oct 31 12:52:53 2012 +0400
@@ -2532,44 +2532,63 @@
     trmsg:   array[TMsgStrId]  of ansistring;   // message of the event
     trgoal:  array[TGoalStrId] of ansistring;   // message of the goal
 
+procedure preInitModule;
 procedure initModule;
 procedure freeModule;
 
 implementation
 
 
-procedure initModule;
+procedure preInitModule;
 begin
-    // initialisation flags - they are going to be overwritten by args or by msgs
+    // initialisation flags - they are going to be overwritten by program args
+
     cScreenWidth    := 1024;
     cScreenHeight   := 768;
     cBits           := 32;
-    ipcPort         := 0;
-    cFullScreen     := false;
-    cLocaleFName    := 'en.txt';
-    cLocale         := 'en';
+    cShowFPS        := false;
+    cAltDamage      := true;
     cTimerInterval  := 8;
-    PathPrefix      := './';
-    UserPathPrefix  := './';
-    cShowFPS        := false;
-    cFlattenFlakes  := false;
-    cFlattenClouds  := false;
-    cAltDamage      := true;
     cReducedQuality := rqNone;
+    cLocaleFName    := 'en.txt';
+    cFullScreen     := false;
+
+    UserPathPrefix  := '';
+    ipcPort         := 0;
     UserNick        := '';
-    recordFileName  := '';
-    cScriptName     := '';
-    cReadyDelay     := 5000;
     cStereoMode     := smNone;
     GrayScale       := false;
+    PathPrefix      := './';
+    GameType        := gmtLocal;
 
-    cFlattenFlakes  := false;
-    cFlattenClouds  := false;
-    cOnlyStats      := False;
-    lastVisualGearByUID:= nil;
-    lastGearByUID:= nil;
-    
-    Pathz:= cPathz;
+{$IFDEF USE_VIDEO_RECORDING}
+    RecPrefix          := '';
+    cAVFormat          := '';
+    cVideoCodec        := '';
+    cVideoFramerateNum := 0;
+    cVideoFramerateDen := 0;
+    cVideoQuality      := 0;
+    cAudioCodec        := '';
+{$ENDIF}
+end;
+
+procedure initModule;
+begin
+
+    if (Length(cLocaleFName) > 6) then
+        cLocale := Copy(cLocaleFName,1,5)
+    else
+        cLocale := Copy(cLocaleFName,1,2);
+
+    cFlattenFlakes      := false;
+    cFlattenClouds      := false;
+    cOnlyStats          := False;
+    lastVisualGearByUID := nil;
+    lastGearByUID       := nil;
+    recordFileName      := '';
+    cReadyDelay         := 5000;
+    Pathz               := cPathz;
+
         {*  REFERENCE
       4096 -> $FFFFF000
       2048 -> $FFFFF800
@@ -2679,7 +2698,6 @@
     ReadyTimeLeft   := 0;
     
     disableLandBack := false;
-
     ScreenFade      := sfNone;
 
     // those values still are not perfect
@@ -2699,14 +2717,13 @@
     vobSDVelocity:= 15;
     vobSDFallSpeed:= 250;
 
-    cMinScreenWidth    := 640;
-    cMinScreenHeight   := 480;
-    cScreenWidth       := 1024;
-    cScreenHeight      := 768;
-    cOrigScreenWidth   := 1024;
-    cOrigScreenHeight  := 768;
-    cNewScreenWidth    := 1024;
-    cNewScreenHeight   := 768;
+    cMinScreenWidth:= min(cScreenWidth, 640);
+    cMinScreenHeight:= min(cScreenHeight, 480);
+    cOrigScreenWidth:= cScreenWidth;
+    cOrigScreenHeight:= cScreenHeight;
+
+    cNewScreenWidth    := cScreenWidth;
+    cNewScreenHeight   := cScreenHeight;
     cScreenResizeDelay := 0;
 
     LuaGoals:= '';
--- a/project_files/hedgewars.pro	Tue Oct 30 18:01:11 2012 -0400
+++ b/project_files/hedgewars.pro	Wed Oct 31 12:52:53 2012 +0400
@@ -1,261 +1,261 @@
-TEMPLATE = app
-TARGET = hedgewars
-DEPENDPATH += ../QTfrontend/
-INCLUDEPATH += ../QTfrontend/
-INCLUDEPATH += ../QTfrontend/model
-INCLUDEPATH += ../QTfrontend/ui
-INCLUDEPATH += ../QTfrontend/ui/widget
-INCLUDEPATH += ../QTfrontend/ui/page
-INCLUDEPATH += ../QTfrontend/ui/dialog
-INCLUDEPATH += ../QTfrontend/net
-INCLUDEPATH += ../QTfrontend/util
-INCLUDEPATH += ../misc/quazip/
-
-DESTDIR = ../bin
-
-QT += network
-QT += webkit
-
-HEADERS += ../QTfrontend/model/ThemeModel.h \
-    ../QTfrontend/model/MapModel.h \
-    ../QTfrontend/model/ammoSchemeModel.h \
-    ../QTfrontend/model/netserverslist.h \
-    ../QTfrontend/ui/page/pagedrawmap.h \
-    ../QTfrontend/ui/page/pagedata.h \
-    ../QTfrontend/ui/page/pagetraining.h \
-    ../QTfrontend/ui/page/pageselectweapon.h \
-    ../QTfrontend/ui/page/pagesingleplayer.h \
-    ../QTfrontend/ui/page/pagenettype.h \
-    ../QTfrontend/ui/page/pageingame.h \
-    ../QTfrontend/ui/page/pageadmin.h \
-    ../QTfrontend/ui/page/pagescheme.h \
-    ../QTfrontend/ui/page/pagemultiplayer.h \
-    ../QTfrontend/ui/page/pageplayrecord.h \
-    ../QTfrontend/ui/page/pagemain.h \
-    ../QTfrontend/ui/page/pageoptions.h \
-    ../QTfrontend/ui/page/pagenetgame.h \
-    ../QTfrontend/ui/page/pageeditteam.h \
-    ../QTfrontend/ui/page/pageconnecting.h \
-    ../QTfrontend/ui/page/pageroomslist.h \
-    ../QTfrontend/ui/page/pagenet.h \
-    ../QTfrontend/ui/page/pagecampaign.h \
-    ../QTfrontend/ui/page/pageinfo.h \
-    ../QTfrontend/ui/page/pagenetserver.h \
-    ../QTfrontend/ui/page/pagegamestats.h \
-    ../QTfrontend/ui/dialog/input_ip.h \
-    ../QTfrontend/ui/qaspectratiolayout.h \
-    ../QTfrontend/ui/widget/bgwidget.h \
-    ../QTfrontend/ui/widget/fpsedit.h \
-    ../QTfrontend/ui/widget/FreqSpinBox.h \
-    ../QTfrontend/ui/widget/igbox.h \
-    ../QTfrontend/ui/widget/chatwidget.h \
-    ../QTfrontend/ui/widget/togglebutton.h \
-    ../QTfrontend/ui/widget/SquareLabel.h \
-    ../QTfrontend/ui/widget/itemNum.h \
-    ../QTfrontend/ui/widget/frameTeam.h \
-    ../QTfrontend/ui/widget/teamselect.h \
-    ../QTfrontend/ui/widget/vertScrollArea.h \
-    ../QTfrontend/ui/widget/about.h \
-    ../QTfrontend/ui/widget/teamselhelper.h \
-    ../QTfrontend/ui/widget/drawmapwidget.h \
-    ../QTfrontend/ui/widget/databrowser.h \
-    ../QTfrontend/ui/widget/hedgehogerWidget.h \
-    ../QTfrontend/ui/widget/selectWeapon.h \
-    ../QTfrontend/ui/widget/weaponItem.h \
-    ../QTfrontend/ui/widget/gamecfgwidget.h \
-    ../QTfrontend/ui/widget/mapContainer.h \
-    ../QTfrontend/ui/widget/HistoryLineEdit.h \
-    ../QTfrontend/ui/widget/SmartLineEdit.h \
-    ../QTfrontend/util/DataManager.h \
-    ../QTfrontend/net/netregister.h \
-    ../QTfrontend/net/netserver.h \
-    ../QTfrontend/net/netudpwidget.h \
-    ../QTfrontend/net/tcpBase.h \
-    ../QTfrontend/net/proto.h \
-    ../QTfrontend/net/newnetclient.h \
-    ../QTfrontend/net/netudpserver.h \
-    ../QTfrontend/net/hwmap.h \
-    ../QTfrontend/util/namegen.h \
-    ../QTfrontend/ui/page/AbstractPage.h \
-    ../QTfrontend/drawmapscene.h \
-    ../QTfrontend/game.h \
-    ../QTfrontend/gameuiconfig.h \
-    ../QTfrontend/HWApplication.h \
-    ../QTfrontend/hwform.h \
-    ../QTfrontend/util/SDLInteraction.h \
-    ../QTfrontend/team.h \
-    ../QTfrontend/achievements.h \
-    ../QTfrontend/binds.h \
-    ../QTfrontend/ui_hwform.h \
-    ../QTfrontend/KB.h \
-    ../QTfrontend/hwconsts.h \
-    ../QTfrontend/sdlkeys.h \
-    ../QTfrontend/ui/mouseoverfilter.h \
-    ../QTfrontend/ui/qpushbuttonwithsound.h \
-    ../QTfrontend/ui/widget/qpushbuttonwithsound.h \
-    ../QTfrontend/ui/page/pagefeedback.h \
-    ../QTfrontend/model/roomslistmodel.h \
-    ../QTfrontend/ui/dialog/input_password.h \
-    ../QTfrontend/ui/widget/colorwidget.h \
-    ../QTfrontend/model/HatModel.h \
-    ../QTfrontend/model/GameStyleModel.h \
-    ../QTfrontend/util/libav_iteraction.h \
-    ../QTfrontend/ui/page/pagevideos.h \
-    ../QTfrontend/net/recorder.h \
-    ../QTfrontend/ui/dialog/ask_quit.h \
-    ../QTfrontend/ui/dialog/upload_video.h \
-    ../QTfrontend/campaign.h \
-    ../QTfrontend/model/playerslistmodel.h
-
-SOURCES += ../QTfrontend/model/ammoSchemeModel.cpp \
-    ../QTfrontend/model/MapModel.cpp \
-    ../QTfrontend/model/ThemeModel.cpp \
-    ../QTfrontend/model/netserverslist.cpp \
-    ../QTfrontend/ui/qaspectratiolayout.cpp \
-    ../QTfrontend/ui/page/pagemain.cpp \
-    ../QTfrontend/ui/page/pagetraining.cpp \
-    ../QTfrontend/ui/page/pageroomslist.cpp \
-    ../QTfrontend/ui/page/pagemultiplayer.cpp \
-    ../QTfrontend/ui/page/pagegamestats.cpp \
-    ../QTfrontend/ui/page/pagenettype.cpp \
-    ../QTfrontend/ui/page/pageeditteam.cpp \
-    ../QTfrontend/ui/page/pagenetgame.cpp \
-    ../QTfrontend/ui/page/pagedata.cpp \
-    ../QTfrontend/ui/page/pagedrawmap.cpp \
-    ../QTfrontend/ui/page/pageplayrecord.cpp \
-    ../QTfrontend/ui/page/pageselectweapon.cpp \
-    ../QTfrontend/ui/page/pageingame.cpp \
-    ../QTfrontend/ui/page/pagenetserver.cpp \
-    ../QTfrontend/ui/page/pagecampaign.cpp \
-    ../QTfrontend/ui/page/pageadmin.cpp \
-    ../QTfrontend/ui/page/pageinfo.cpp \
-    ../QTfrontend/ui/page/pageconnecting.cpp \
-    ../QTfrontend/ui/page/pagesingleplayer.cpp \
-    ../QTfrontend/ui/page/pagenet.cpp \
-    ../QTfrontend/ui/page/pagescheme.cpp \
-    ../QTfrontend/ui/page/pageoptions.cpp \
-    ../QTfrontend/ui/dialog/input_ip.cpp \
-    ../QTfrontend/ui/widget/igbox.cpp \
-    ../QTfrontend/ui/widget/selectWeapon.cpp \
-    ../QTfrontend/ui/widget/FreqSpinBox.cpp \
-    ../QTfrontend/ui/widget/SquareLabel.cpp \
-    ../QTfrontend/ui/widget/frameTeam.cpp \
-    ../QTfrontend/ui/widget/fpsedit.cpp \
-    ../QTfrontend/ui/widget/databrowser.cpp \
-    ../QTfrontend/ui/widget/teamselect.cpp \
-    ../QTfrontend/ui/widget/gamecfgwidget.cpp \
-    ../QTfrontend/ui/widget/chatwidget.cpp \
-    ../QTfrontend/ui/widget/itemNum.cpp \
-    ../QTfrontend/ui/widget/bgwidget.cpp \
-    ../QTfrontend/ui/widget/about.cpp \
-    ../QTfrontend/ui/widget/togglebutton.cpp \
-    ../QTfrontend/ui/widget/vertScrollArea.cpp \
-    ../QTfrontend/ui/widget/hedgehogerWidget.cpp \
-    ../QTfrontend/ui/widget/teamselhelper.cpp \
-    ../QTfrontend/ui/widget/drawmapwidget.cpp \
-    ../QTfrontend/ui/widget/weaponItem.cpp \
-    ../QTfrontend/ui/widget/mapContainer.cpp \
-    ../QTfrontend/ui/widget/HistoryLineEdit.cpp \
-    ../QTfrontend/ui/widget/SmartLineEdit.cpp \
-    ../QTfrontend/util/DataManager.cpp \
-    ../QTfrontend/net/tcpBase.cpp \
-    ../QTfrontend/net/netregister.cpp \
-    ../QTfrontend/net/proto.cpp \
-    ../QTfrontend/net/hwmap.cpp \
-    ../QTfrontend/net/netudpserver.cpp \
-    ../QTfrontend/net/newnetclient.cpp \
-    ../QTfrontend/net/netudpwidget.cpp \
-    ../QTfrontend/net/netserver.cpp \
-    ../QTfrontend/util/namegen.cpp \
-    ../QTfrontend/ui/page/AbstractPage.cpp \
-    ../QTfrontend/achievements.cpp \
-    ../QTfrontend/binds.cpp \
-    ../QTfrontend/drawmapscene.cpp \
-    ../QTfrontend/game.cpp \
-    ../QTfrontend/gameuiconfig.cpp \
-    ../QTfrontend/HWApplication.cpp \
-    ../QTfrontend/hwform.cpp \
-    ../QTfrontend/main.cpp \
-    ../QTfrontend/util/SDLInteraction.cpp \
-    ../QTfrontend/team.cpp \
-    ../QTfrontend/ui_hwform.cpp \
-    ../QTfrontend/hwconsts.cpp \
-    ../QTfrontend/ui/mouseoverfilter.cpp \
-    ../QTfrontend/ui/widget/qpushbuttonwithsound.cpp \
-    ../QTfrontend/ui/page/pagefeedback.cpp \
-    ../QTfrontend/model/roomslistmodel.cpp \
-    ../QTfrontend/ui/dialog/input_password.cpp \
-    ../QTfrontend/ui/widget/colorwidget.cpp \
-    ../QTfrontend/model/HatModel.cpp \
-    ../QTfrontend/model/GameStyleModel.cpp \
-    ../QTfrontend/util/libav_iteraction.cpp \
-    ../QTfrontend/ui/page/pagevideos.cpp \
-    ../QTfrontend/net/recorder.cpp \
-    ../QTfrontend/ui/dialog/ask_quit.cpp \
-    ../QTfrontend/ui/dialog/upload_video.cpp \
-    ../QTfrontend/campaign.cpp \
-    ../QTfrontend/model/playerslistmodel.cpp
-
-
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_ar.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_bg.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_cs.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_de.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_en.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_es.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_fi.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_fr.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_hu.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_it.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_ja.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_ko.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_lt.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_nl.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_pl.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_pt_BR.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_pt_PT.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_ru.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_sk.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_sv.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_tr_TR.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_uk.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_zh_CN.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_zh_TW.ts
-
-RESOURCES += ../QTfrontend/hedgewars.qrc
-
-LIBS += -L../bin -lquazip
-
-macx {
-    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
-    QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.6.sdk
-
-    OBJECTIVE_SOURCES += ../QTfrontend/*.m ../QTfrontend/*.mm
-    SOURCES += ../QTfrontend/AutoUpdater.cpp ../QTfrontend/InstallController.cpp \
-               ../../build/QTfrontend/hwconsts.cpp
-    HEADERS += ../QTfrontend/M3InstallController.h ../QTfrontend/M3Panel.h \
-               ../QTfrontend/NSWorkspace_RBAdditions.h ../QTfrontend/AutoUpdater.h \
-               ../QTfrontend/CocoaInitializer.h ../QTfrontend/InstallController.h \
-               ../QTfrontend/SparkleAutoUpdater.h
-
-    LIBS += -lobjc -framework AppKit -framework IOKit -framework Foundation -framework SDL -framework SDL_Mixer -framework Sparkle -DSPARKLE_ENABLED
-    INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers /Library/Frameworks/SDL_Mixer.framework/Headers
-    CONFIG += warn_on x86
-    #CONFIG += x86 ppc x86_64 ppc64
-}
-
-win32 {
-    RC_FILE = ../QTfrontend/hedgewars.rc
-    SOURCES += ../QTfrontend/xfire.cpp
-    INCLUDEPATH += ../misc/winutils/include
-    LIBS += -L../misc/winutils/lib
-}
-
-!macx {
-    LIBS += -lSDL -lSDL_mixer
-    !win32 {
-        INCLUDEPATH += /usr/local/include/SDL /usr/include/SDL
-    }
-}
-
-FORMS +=
+TEMPLATE = app
+TARGET = hedgewars
+DEPENDPATH += ../QTfrontend/
+INCLUDEPATH += ../QTfrontend/
+INCLUDEPATH += ../QTfrontend/model
+INCLUDEPATH += ../QTfrontend/ui
+INCLUDEPATH += ../QTfrontend/ui/widget
+INCLUDEPATH += ../QTfrontend/ui/page
+INCLUDEPATH += ../QTfrontend/ui/dialog
+INCLUDEPATH += ../QTfrontend/net
+INCLUDEPATH += ../QTfrontend/util
+INCLUDEPATH += ../misc/quazip/
+
+DESTDIR = ../bin
+
+QT += network
+QT += webkit
+
+HEADERS += ../QTfrontend/model/ThemeModel.h \
+    ../QTfrontend/model/MapModel.h \
+    ../QTfrontend/model/ammoSchemeModel.h \
+    ../QTfrontend/model/netserverslist.h \
+    ../QTfrontend/ui/page/pagedrawmap.h \
+    ../QTfrontend/ui/page/pagedata.h \
+    ../QTfrontend/ui/page/pagetraining.h \
+    ../QTfrontend/ui/page/pageselectweapon.h \
+    ../QTfrontend/ui/page/pagesingleplayer.h \
+    ../QTfrontend/ui/page/pagenettype.h \
+    ../QTfrontend/ui/page/pageingame.h \
+    ../QTfrontend/ui/page/pageadmin.h \
+    ../QTfrontend/ui/page/pagescheme.h \
+    ../QTfrontend/ui/page/pagemultiplayer.h \
+    ../QTfrontend/ui/page/pageplayrecord.h \
+    ../QTfrontend/ui/page/pagemain.h \
+    ../QTfrontend/ui/page/pageoptions.h \
+    ../QTfrontend/ui/page/pagenetgame.h \
+    ../QTfrontend/ui/page/pageeditteam.h \
+    ../QTfrontend/ui/page/pageconnecting.h \
+    ../QTfrontend/ui/page/pageroomslist.h \
+    ../QTfrontend/ui/page/pagenet.h \
+    ../QTfrontend/ui/page/pagecampaign.h \
+    ../QTfrontend/ui/page/pageinfo.h \
+    ../QTfrontend/ui/page/pagenetserver.h \
+    ../QTfrontend/ui/page/pagegamestats.h \
+    ../QTfrontend/ui/dialog/input_ip.h \
+    ../QTfrontend/ui/qaspectratiolayout.h \
+    ../QTfrontend/ui/widget/bgwidget.h \
+    ../QTfrontend/ui/widget/fpsedit.h \
+    ../QTfrontend/ui/widget/FreqSpinBox.h \
+    ../QTfrontend/ui/widget/igbox.h \
+    ../QTfrontend/ui/widget/chatwidget.h \
+    ../QTfrontend/ui/widget/togglebutton.h \
+    ../QTfrontend/ui/widget/SquareLabel.h \
+    ../QTfrontend/ui/widget/itemNum.h \
+    ../QTfrontend/ui/widget/frameTeam.h \
+    ../QTfrontend/ui/widget/teamselect.h \
+    ../QTfrontend/ui/widget/vertScrollArea.h \
+    ../QTfrontend/ui/widget/about.h \
+    ../QTfrontend/ui/widget/teamselhelper.h \
+    ../QTfrontend/ui/widget/drawmapwidget.h \
+    ../QTfrontend/ui/widget/databrowser.h \
+    ../QTfrontend/ui/widget/hedgehogerWidget.h \
+    ../QTfrontend/ui/widget/selectWeapon.h \
+    ../QTfrontend/ui/widget/weaponItem.h \
+    ../QTfrontend/ui/widget/gamecfgwidget.h \
+    ../QTfrontend/ui/widget/mapContainer.h \
+    ../QTfrontend/ui/widget/HistoryLineEdit.h \
+    ../QTfrontend/ui/widget/SmartLineEdit.h \
+    ../QTfrontend/util/DataManager.h \
+    ../QTfrontend/net/netregister.h \
+    ../QTfrontend/net/netserver.h \
+    ../QTfrontend/net/netudpwidget.h \
+    ../QTfrontend/net/tcpBase.h \
+    ../QTfrontend/net/proto.h \
+    ../QTfrontend/net/newnetclient.h \
+    ../QTfrontend/net/netudpserver.h \
+    ../QTfrontend/net/hwmap.h \
+    ../QTfrontend/util/namegen.h \
+    ../QTfrontend/ui/page/AbstractPage.h \
+    ../QTfrontend/drawmapscene.h \
+    ../QTfrontend/game.h \
+    ../QTfrontend/gameuiconfig.h \
+    ../QTfrontend/HWApplication.h \
+    ../QTfrontend/hwform.h \
+    ../QTfrontend/util/SDLInteraction.h \
+    ../QTfrontend/team.h \
+    ../QTfrontend/achievements.h \
+    ../QTfrontend/binds.h \
+    ../QTfrontend/ui_hwform.h \
+    ../QTfrontend/KB.h \
+    ../QTfrontend/hwconsts.h \
+    ../QTfrontend/sdlkeys.h \
+    ../QTfrontend/ui/mouseoverfilter.h \
+    ../QTfrontend/ui/qpushbuttonwithsound.h \
+    ../QTfrontend/ui/widget/qpushbuttonwithsound.h \
+    ../QTfrontend/ui/page/pagefeedback.h \
+    ../QTfrontend/model/roomslistmodel.h \
+    ../QTfrontend/ui/dialog/input_password.h \
+    ../QTfrontend/ui/widget/colorwidget.h \
+    ../QTfrontend/model/HatModel.h \
+    ../QTfrontend/model/GameStyleModel.h \
+    ../QTfrontend/ui/page/pagevideos.h \
+    ../QTfrontend/net/recorder.h \
+    ../QTfrontend/ui/dialog/ask_quit.h \
+    ../QTfrontend/ui/dialog/upload_video.h \
+    ../QTfrontend/campaign.h \
+    ../QTfrontend/model/playerslistmodel.h \
+    ../QTfrontend/util/LibavInteraction.h
+
+SOURCES += ../QTfrontend/model/ammoSchemeModel.cpp \
+    ../QTfrontend/model/MapModel.cpp \
+    ../QTfrontend/model/ThemeModel.cpp \
+    ../QTfrontend/model/netserverslist.cpp \
+    ../QTfrontend/ui/qaspectratiolayout.cpp \
+    ../QTfrontend/ui/page/pagemain.cpp \
+    ../QTfrontend/ui/page/pagetraining.cpp \
+    ../QTfrontend/ui/page/pageroomslist.cpp \
+    ../QTfrontend/ui/page/pagemultiplayer.cpp \
+    ../QTfrontend/ui/page/pagegamestats.cpp \
+    ../QTfrontend/ui/page/pagenettype.cpp \
+    ../QTfrontend/ui/page/pageeditteam.cpp \
+    ../QTfrontend/ui/page/pagenetgame.cpp \
+    ../QTfrontend/ui/page/pagedata.cpp \
+    ../QTfrontend/ui/page/pagedrawmap.cpp \
+    ../QTfrontend/ui/page/pageplayrecord.cpp \
+    ../QTfrontend/ui/page/pageselectweapon.cpp \
+    ../QTfrontend/ui/page/pageingame.cpp \
+    ../QTfrontend/ui/page/pagenetserver.cpp \
+    ../QTfrontend/ui/page/pagecampaign.cpp \
+    ../QTfrontend/ui/page/pageadmin.cpp \
+    ../QTfrontend/ui/page/pageinfo.cpp \
+    ../QTfrontend/ui/page/pageconnecting.cpp \
+    ../QTfrontend/ui/page/pagesingleplayer.cpp \
+    ../QTfrontend/ui/page/pagenet.cpp \
+    ../QTfrontend/ui/page/pagescheme.cpp \
+    ../QTfrontend/ui/page/pageoptions.cpp \
+    ../QTfrontend/ui/dialog/input_ip.cpp \
+    ../QTfrontend/ui/widget/igbox.cpp \
+    ../QTfrontend/ui/widget/selectWeapon.cpp \
+    ../QTfrontend/ui/widget/FreqSpinBox.cpp \
+    ../QTfrontend/ui/widget/SquareLabel.cpp \
+    ../QTfrontend/ui/widget/frameTeam.cpp \
+    ../QTfrontend/ui/widget/fpsedit.cpp \
+    ../QTfrontend/ui/widget/databrowser.cpp \
+    ../QTfrontend/ui/widget/teamselect.cpp \
+    ../QTfrontend/ui/widget/gamecfgwidget.cpp \
+    ../QTfrontend/ui/widget/chatwidget.cpp \
+    ../QTfrontend/ui/widget/itemNum.cpp \
+    ../QTfrontend/ui/widget/bgwidget.cpp \
+    ../QTfrontend/ui/widget/about.cpp \
+    ../QTfrontend/ui/widget/togglebutton.cpp \
+    ../QTfrontend/ui/widget/vertScrollArea.cpp \
+    ../QTfrontend/ui/widget/hedgehogerWidget.cpp \
+    ../QTfrontend/ui/widget/teamselhelper.cpp \
+    ../QTfrontend/ui/widget/drawmapwidget.cpp \
+    ../QTfrontend/ui/widget/weaponItem.cpp \
+    ../QTfrontend/ui/widget/mapContainer.cpp \
+    ../QTfrontend/ui/widget/HistoryLineEdit.cpp \
+    ../QTfrontend/ui/widget/SmartLineEdit.cpp \
+    ../QTfrontend/util/DataManager.cpp \
+    ../QTfrontend/net/tcpBase.cpp \
+    ../QTfrontend/net/netregister.cpp \
+    ../QTfrontend/net/proto.cpp \
+    ../QTfrontend/net/hwmap.cpp \
+    ../QTfrontend/net/netudpserver.cpp \
+    ../QTfrontend/net/newnetclient.cpp \
+    ../QTfrontend/net/netudpwidget.cpp \
+    ../QTfrontend/net/netserver.cpp \
+    ../QTfrontend/util/namegen.cpp \
+    ../QTfrontend/ui/page/AbstractPage.cpp \
+    ../QTfrontend/achievements.cpp \
+    ../QTfrontend/binds.cpp \
+    ../QTfrontend/drawmapscene.cpp \
+    ../QTfrontend/game.cpp \
+    ../QTfrontend/gameuiconfig.cpp \
+    ../QTfrontend/HWApplication.cpp \
+    ../QTfrontend/hwform.cpp \
+    ../QTfrontend/main.cpp \
+    ../QTfrontend/util/SDLInteraction.cpp \
+    ../QTfrontend/team.cpp \
+    ../QTfrontend/ui_hwform.cpp \
+    ../QTfrontend/hwconsts.cpp \
+    ../QTfrontend/ui/mouseoverfilter.cpp \
+    ../QTfrontend/ui/widget/qpushbuttonwithsound.cpp \
+    ../QTfrontend/ui/page/pagefeedback.cpp \
+    ../QTfrontend/model/roomslistmodel.cpp \
+    ../QTfrontend/ui/dialog/input_password.cpp \
+    ../QTfrontend/ui/widget/colorwidget.cpp \
+    ../QTfrontend/model/HatModel.cpp \
+    ../QTfrontend/model/GameStyleModel.cpp \
+    ../QTfrontend/ui/page/pagevideos.cpp \
+    ../QTfrontend/net/recorder.cpp \
+    ../QTfrontend/ui/dialog/ask_quit.cpp \
+    ../QTfrontend/ui/dialog/upload_video.cpp \
+    ../QTfrontend/campaign.cpp \
+    ../QTfrontend/model/playerslistmodel.cpp \
+    ../QTfrontend/util/LibavInteraction.cpp
+
+
+TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_ar.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_bg.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_cs.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_de.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_en.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_es.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_fi.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_fr.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_hu.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_it.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_ja.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_ko.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_lt.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_nl.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_pl.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_pt_BR.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_pt_PT.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_ru.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_sk.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_sv.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_tr_TR.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_uk.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_zh_CN.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_zh_TW.ts
+
+RESOURCES += ../QTfrontend/hedgewars.qrc
+
+LIBS += -L../bin -lquazip
+
+macx {
+    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
+    QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.6.sdk
+
+    OBJECTIVE_SOURCES += ../QTfrontend/*.m ../QTfrontend/*.mm
+    SOURCES += ../QTfrontend/AutoUpdater.cpp ../QTfrontend/InstallController.cpp \
+               ../../build/QTfrontend/hwconsts.cpp
+    HEADERS += ../QTfrontend/M3InstallController.h ../QTfrontend/M3Panel.h \
+               ../QTfrontend/NSWorkspace_RBAdditions.h ../QTfrontend/AutoUpdater.h \
+               ../QTfrontend/CocoaInitializer.h ../QTfrontend/InstallController.h \
+               ../QTfrontend/SparkleAutoUpdater.h
+
+    LIBS += -lobjc -framework AppKit -framework IOKit -framework Foundation -framework SDL -framework SDL_Mixer -framework Sparkle -DSPARKLE_ENABLED
+    INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers /Library/Frameworks/SDL_Mixer.framework/Headers
+    CONFIG += warn_on x86
+    #CONFIG += x86 ppc x86_64 ppc64
+}
+
+win32 {
+    RC_FILE = ../QTfrontend/hedgewars.rc
+    SOURCES += ../QTfrontend/xfire.cpp
+    INCLUDEPATH += ../misc/winutils/include
+    LIBS += -L../misc/winutils/lib
+}
+
+!macx {
+    LIBS += -lSDL -lSDL_mixer
+    !win32 {
+        INCLUDEPATH += /usr/local/include/SDL /usr/include/SDL
+    }
+}
+
+FORMS +=
--- a/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Tue Oct 30 18:01:11 2012 -0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Wed Oct 31 12:52:53 2012 +0400
@@ -116,7 +116,8 @@
         if cnthhs > 1 then
             hogLimitHit = true
             SetEffect(gear, heResurrectable, false)
-            SetHealth(gear, 0)
+            --SetHealth(gear, 0)
+            SetGearPosition(gear, -100,LAND_HEIGHT)
         end
 end
 
@@ -414,7 +415,7 @@
 
     if gear~= mutant and gear~= nil then
         SetHogName(gear,"BOTTOM FEEDER")
-        SetHogHat(gear, 'Poke_Slowpoke')
+        SetHogHat(gear, 'poke_slowpoke')
         setGearValue(gear,"Feeder", true)
     end
 end
@@ -423,7 +424,7 @@
     mutant = gear
 
     SetHogName(gear,"MUTANT")
-    SetHogHat(gear,'whysoserious')
+    SetHogHat(gear,'WhySoSerious')
     SetHealth(gear, ( mutant_base_health + numhhs*25) )
     SetEffect(gear, hePoisoned, 1)
     setGearValue(mutant,"SelfDestruct",false)