main window and many fixes
This commit is contained in:
1 parent
80c329a697
commit
69700f8b65
18 files changed
+3280
-95
No files matched your search
@@ -45,6 +45,7 @@
|
||||
#include "Cevo/CevoGraphicSet.h"
|
||||
#include "Cevo/CevoScreenTools.h"
|
||||
#include "Cevo/CevoTexture.h"
|
||||
#include "Cevo/Music.h"
|
||||
#include "Global.h"
|
||||
|
||||
#include <QApplication>
|
||||
@@ -249,7 +250,10 @@ void MainScreen::closeEvent(QCloseEvent *event)
|
||||
DrawDlg::closeEvent(event);
|
||||
if (!event->isAccepted())
|
||||
return;
|
||||
termBounds = fullScreen ? m_restoredBounds : geometry();
|
||||
m_timer->stop();
|
||||
if (musicPlayer.playing())
|
||||
musicPlayer.stop();
|
||||
}
|
||||
|
||||
// ---- painting ----
|
||||
@@ -310,6 +314,8 @@ void MainScreen::paintEvent(QPaintEvent *)
|
||||
blit(m_mapOffset, TopBarHeight, m_offscreen, 0, 0, m_mapWidth, m_mapHeight);
|
||||
if (m_blinkTileValid)
|
||||
painter.drawImage(m_blinkTilePos + QPoint(m_mapOffset, TopBarHeight), m_blinkTile.image());
|
||||
if (m_moveTileValid)
|
||||
painter.drawImage(m_moveTilePos + QPoint(m_mapOffset, TopBarHeight), m_moveTile.image());
|
||||
painter.restore();
|
||||
|
||||
blit(0, 0, m_topBar, 0, 0, cw, TopBarHeight);
|
||||
@@ -390,7 +396,11 @@ void MainScreen::copyMiniToPanel()
|
||||
bitBltBitmap(m_panel, m_xMini + 2, m_yMini + 2, lx * 2, ly, m_miniMap->bitmap, 0, 0);
|
||||
Dpi::Canvas &canvas = m_panel.canvas();
|
||||
if (m_markCityLoc >= 0) {
|
||||
// TODO: the city mark sprite (InitCityMark/CityMark2) is not ported yet.
|
||||
if (const GraphicSetItem *mark = HGrSystem->searchByName(QStringLiteral("CityMark2")))
|
||||
sprite(canvas, *HGrSystem,
|
||||
m_xMini - 2 + (4 * lx + 2 * (m_markCityLoc % lx) + (lx - m_mapWidth / (xxt * 2)) - 2 * m_xwd) % (2 * lx)
|
||||
+ ((m_markCityLoc / lx) & 1),
|
||||
m_yMini - 3 + m_markCityLoc / lx, mark->width, mark->height, mark->left, mark->top);
|
||||
} else if (m_ywmax <= 0) {
|
||||
frame(canvas, m_xMini + 2 + lx - m_mapWidth / (xxt * 2), m_yMini + 2, m_xMini + 1 + lx + m_mapWidth / (xxt * 2),
|
||||
m_yMini + 2 + ly - 1, MainTexture->colorMark, MainTexture->colorMark);
|
||||
|
||||
Reference in new issue
Block a user