QTfrontend/hwmap.cpp
changeset 1790 c84223511ca8
parent 1066 1f1b3686a2b0
child 1791 7c9d645d2591
equal deleted inserted replaced
1789:5e7d66230067 1790:c84223511ca8
    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 
    20 										#include <QDebug>
    21 HWMap::HWMap() :
    21 HWMap::HWMap() :
    22   TCPBase(false)
    22   TCPBase(false)
    23 {
    23 {
    24 }
    24 }
    25 
    25 
    42   return arguments;
    42   return arguments;
    43 }
    43 }
    44 
    44 
    45 void HWMap::onClientDisconnect()
    45 void HWMap::onClientDisconnect()
    46 {
    46 {
    47   QImage im((uchar*)(readbuffer.constData()), 256, 128, QImage::Format_Mono);
    47 	if (readbuffer.size() == 128 * 32 + 1)
    48   im.setNumColors(2);
    48 	{
    49   emit ImageReceived(im);
    49 		quint8 *buf = (quint8*) readbuffer.constData();
       
    50 		QImage im(buf, 256, 128, QImage::Format_Mono);
       
    51 		im.setNumColors(2);
       
    52 		emit HHLimitReceived(buf[128 * 32 + 1]);
       
    53 		emit ImageReceived(im);
       
    54 	}
    50 }
    55 }
    51 
    56 
    52 void HWMap::SendToClientFirst()
    57 void HWMap::SendToClientFirst()
    53 {
    58 {
    54   std::string toSend=std::string("eseed ")+m_seed;
    59   std::string toSend=std::string("eseed ")+m_seed;