2020-07-03

请问这个源代码哪里错了!大神们帮我指点一下错误❌❌❌❌❌

#include “cminemap.h”
#include “ui_cminemap.h”
#include <qpainter.h>
#include <qpixmap.h>
#include
CMineMap::CMineMap(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::CMineMap)
{
ui->setupUi(this);
}

CMineMap::~CMineMap()
{
delete ui;
}

bool CMineMap::Onlbtup(int m, int n)
{
if (Map[m][n] >= 101 && Map[m][n] <= 108)
{
Map[m][n] -= 100;
first = 0;
iswin();
return true;
}
if (Map[m][n] == 100)
{
Map[m][n] -= 100;
Onlbtup(m - 1, n);
Onlbtup(m + 1, n);
Onlbtup(m, n - 1);
Onlbtup(m, n + 1);
Onlbtup(m - 1, n - 1);
Onlbtup(m + 1, n - 1);
Onlbtup(m - 1, n + 1);
Onlbtup(m + 1, n + 1);
}
if (Map[m][n] == 99)
{
for (int i = 0; i < mx; i++)
for (int j = 0; j < my; j++)
{
if (Map[i][j] == 99)
Map[i][j] = -1;
if (Map[i][j]>49 && Map[i][j] < 60)
Map[i][j] = -2;
}
}
return true;
}
void MainWindowpaintEvent(QPaintEvent *)
{
QPixmap bmpmap(":new/prefix1/res/item2.bmp");
QPixmap bmpnub(":new/prefix1/res/item1.bmp");
QPixmap bmpfame(":new/prefix1/res/item3.bmp");
QPixmap bmpface(":new/prefix1/res/item4.bmp");

QPainter painter(this);

for(int i=0;i<mineMap.mx;i++)
{
    for(int j=0;j<mineMap.my;j++)
    {
        if (mineMap.Map[i][j] >= 0 && mineMap.Map[i][j] < 9)
        {
            painter.drawPixmap( i * 20+offsetx, j * 20 + 40+offsety,  bmpmap, mineMap.Map[i][j] * 20, 0,20,20);
        }
        if (mineMap.Map[i][j]>90)
            painter.drawPixmap(i * 20+offsetx, j * 20 + 40+offsety,bmpmap, 10 * 20, 0,20,20);
        if (mineMap.Map[i][j] == -1)
            painter.drawPixmap(i * 20+offsetx, j * 20 + 40+offsety,bmpmap, 9 * 20, 0,20,20);
        if (mineMap.Map[i][j] == -2)
            painter.drawPixmap(i * 20+offsetx, j * 20 + 40+offsety,  bmpmap, 12 * 20, 0,20,20);
        if (mineMap.Map[i][j] > 40 && mineMap.Map[i][j] < 60)
            painter.drawPixmap(i * 20+offsetx, j * 20 + 40+offsety,  bmpmap, 11 * 20, 0,20,20);

    }
}
void    drawPixmap(int x, int y, const QPixmap & pixmap, int sx, int sy, int sw, int sh);

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值