QTfrontend/net/hwmap.cpp
changeset 10472 8d04cebedb16
parent 10391 ce3ccc45d790
child 10959 1225f42f61e2
equal deleted inserted replaced
10471:d968b1ac130c 10472:8d04cebedb16
    28     TCPBase(false, parent)
    28     TCPBase(false, parent)
    29 {
    29 {
    30     templateFilter = 0;
    30     templateFilter = 0;
    31     m_mapgen = MAPGEN_REGULAR;
    31     m_mapgen = MAPGEN_REGULAR;
    32     m_maze_size = 0;
    32     m_maze_size = 0;
       
    33     m_feature_size = 50;
    33 }
    34 }
    34 
    35 
    35 HWMap::~HWMap()
    36 HWMap::~HWMap()
    36 {
    37 {
    37 }
    38 }
    39 bool HWMap::couldBeRemoved()
    40 bool HWMap::couldBeRemoved()
    40 {
    41 {
    41     return !m_hasStarted;
    42     return !m_hasStarted;
    42 }
    43 }
    43 
    44 
    44 void HWMap::getImage(const QString & seed, int filter, MapGenerator mapgen, int maze_size, const QByteArray & drawMapData, QString & script)
    45 void HWMap::getImage(const QString & seed, int filter, MapGenerator mapgen, int maze_size, const QByteArray & drawMapData, QString & script, int feature_size)
    45 {
    46 {
    46     m_seed = seed;
    47     m_seed = seed;
    47     m_script = script;
    48     m_script = script;
    48     templateFilter = filter;
    49     templateFilter = filter;
    49     m_mapgen = mapgen;
    50     m_mapgen = mapgen;
    50     m_maze_size = maze_size;
    51     m_maze_size = maze_size; // TODO replace with feature_size
       
    52     m_feature_size = feature_size;
    51     if(mapgen == MAPGEN_DRAWN) m_drawMapData = drawMapData;
    53     if(mapgen == MAPGEN_DRAWN) m_drawMapData = drawMapData;
    52     Start(true);
    54     Start(true);
    53 }
    55 }
    54 
    56 
    55 QStringList HWMap::getArguments()
    57 QStringList HWMap::getArguments()
   117 void HWMap::SendToClientFirst()
   119 void HWMap::SendToClientFirst()
   118 {
   120 {
   119     SendIPC(QString("eseed %1").arg(m_seed).toUtf8());
   121     SendIPC(QString("eseed %1").arg(m_seed).toUtf8());
   120     SendIPC(QString("e$template_filter %1").arg(templateFilter).toUtf8());
   122     SendIPC(QString("e$template_filter %1").arg(templateFilter).toUtf8());
   121     SendIPC(QString("e$mapgen %1").arg(m_mapgen).toUtf8());
   123     SendIPC(QString("e$mapgen %1").arg(m_mapgen).toUtf8());
       
   124     SendIPC(QString("e$feature_size %1").arg(m_feature_size).toUtf8());
   122     if (!m_script.isEmpty())
   125     if (!m_script.isEmpty())
   123     {
   126     {
   124         SendIPC(QString("escript Scripts/Multiplayer/%1.lua").arg(m_script).toUtf8());
   127         SendIPC(QString("escript Scripts/Multiplayer/%1.lua").arg(m_script).toUtf8());
   125     }
   128     }
   126 
   129