QTfrontend/hwmap.cpp
changeset 1797 fedd8649fdd9
parent 1791 7c9d645d2591
child 2948 3f21a9dc93d0
equal deleted inserted replaced
1796:4bcdf0bf58b8 1797:fedd8649fdd9
    15  * along with this program; if not, write to the Free Software
    15  * along with this program; if not, write to the Free Software
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */
    17 
    17 
    18 #include "hwconsts.h"
    18 #include "hwconsts.h"
    19 #include "hwmap.h"
    19 #include "hwmap.h"
    20 										#include <QDebug>
    20 
    21 HWMap::HWMap() :
    21 HWMap::HWMap() :
    22   TCPBase(false)
    22   TCPBase(false)
    23 {
    23 {
    24 }
    24 }
    25 
    25 
    26 HWMap::~HWMap()
    26 HWMap::~HWMap()
    27 {
    27 {
    28 }
    28 }
    29 
    29 
    30 void HWMap::getImage(std::string seed)
    30 void HWMap::getImage(std::string seed, int filter)
    31 {
    31 {
    32   m_seed=seed;
    32 	m_seed = seed;
    33   Start();
    33 	templateFilter = filter;
       
    34 	Start();
    34 }
    35 }
    35 
    36 
    36 QStringList HWMap::setArguments()
    37 QStringList HWMap::setArguments()
    37 {
    38 {
    38   QStringList arguments;
    39 	QStringList arguments;
    39   arguments << cfgdir->absolutePath();
    40 	arguments << cfgdir->absolutePath();
    40   arguments << QString("%1").arg(ipc_port);
    41 	arguments << QString("%1").arg(ipc_port);
    41   arguments << "landpreview";
    42 	arguments << "landpreview";
    42   return arguments;
    43 	return arguments;
    43 }
    44 }
    44 
    45 
    45 void HWMap::onClientDisconnect()
    46 void HWMap::onClientDisconnect()
    46 {
    47 {
    47 	if (readbuffer.size() == 128 * 32 + 1)
    48 	if (readbuffer.size() == 128 * 32 + 1)
    54 	}
    55 	}
    55 }
    56 }
    56 
    57 
    57 void HWMap::SendToClientFirst()
    58 void HWMap::SendToClientFirst()
    58 {
    59 {
    59   std::string toSend=std::string("eseed ")+m_seed;
    60 	SendIPC(QString("eseed %1").arg(m_seed.c_str()).toLatin1());
    60   SendIPC(toSend.c_str());
    61 	SendIPC(QString("e$template_filter %1").arg(templateFilter).toLatin1());
    61   SendIPC("!");
    62 	SendIPC("!");
    62 }
    63 }