diff --git a/Drawer.cpp b/Drawer.cpp index 0d14a10..94eb5b6 100644 --- a/Drawer.cpp +++ b/Drawer.cpp @@ -49,8 +49,8 @@ void Drawer::initScreen(const wxSize& tableSize, const TLVec& layout) { k--; if (k > -1) - if (layout[i][j][k].first == layer) { - drawTile(dc, layout[i][j][k].second, {tablePixelRect.x + tilePixelSize.x*i, tablePixelRect.y + tilePixelSize.y*j}); + if (layout[i][j][k].first == layer || layer == 0) { + drawTile(dc, layout[i][j][k].second, {tablePixelRect.x + tilePixelSize.x*i, tablePixelRect.y + tilePixelSize.y*j}, layer); cards_set++; } } @@ -60,11 +60,18 @@ void Drawer::initScreen(const wxSize& tableSize, const TLVec& layout) { } } -void Drawer::drawTile (wxDC& dc, int8_t index, const wxPoint& position) { - dc.DrawRoundedRectangle(position, tilePixelSize * 2, 10); +void Drawer::drawTile(wxDC& dc, int8_t index, const wxPoint& position, uint8_t zIndex) { + wxBrush _bgColor = dc.GetBrush(); + dc.SetBrush(wxColor(200, 200, 200)); + + dc.DrawRoundedRectangle(position.x + (tilePixelSize.GetWidth()/10 + 3) - (tilePixelSize.GetWidth()/10 + 3)*zIndex, position.y + (tilePixelSize.GetHeight()/10 + 3) - (tilePixelSize.GetHeight()/10 + 3)*zIndex, tilePixelSize.GetWidth() * 2, tilePixelSize.GetHeight() * 2, 10); + + dc.SetBrush(_bgColor); + + dc.DrawRoundedRectangle(position.x - (tilePixelSize.GetWidth()/10 + 3)*zIndex, position.y - (tilePixelSize.GetHeight()/10 + 3)*zIndex, tilePixelSize.GetWidth() * 2, tilePixelSize.GetHeight() * 2, 10); if (tileImages[index].GetWidth() != tilePixelSize.x * 2) - dc.DrawBitmap(tileImages[index].Scale(tilePixelSize.x * 2 - 20, tilePixelSize.y * 2 - 20), {position.x + 10, position.y + 10}); + dc.DrawBitmap(tileImages[index].Scale(tilePixelSize.x * 2 - 20, tilePixelSize.y * 2 - 20), {position.x + 10 - (tilePixelSize.GetWidth()/10 + 3)*zIndex, position.y + 10 - (tilePixelSize.GetHeight()/10 + 3)*zIndex}); else - dc.DrawBitmap(tileImages[index], position); + dc.DrawBitmap(tileImages[index], {position.x + 10 - (tilePixelSize.GetWidth()/10 + 3)*zIndex, position.y + 10 - (tilePixelSize.GetHeight()/10 + 3)*zIndex}); } diff --git a/Drawer.h b/Drawer.h index 49afaac..e63684b 100644 --- a/Drawer.h +++ b/Drawer.h @@ -26,7 +26,7 @@ public: private: void drawScreen(wxDC& dc); - void drawTile(wxDC& dc, int8_t index, const wxPoint& position); + void drawTile(wxDC& dc, int8_t index, const wxPoint& position, uint8_t zIndex); wxImage tileImages[40]; diff --git a/GamePanel.cpp b/GamePanel.cpp index 3dcee5b..8ee30d7 100644 --- a/GamePanel.cpp +++ b/GamePanel.cpp @@ -24,6 +24,9 @@ void GamePanel::Start(const wxString& path) { timer->Start(1000, wxTIMER_CONTINUOUS); sb->SetStatusText(LTimeToStr(controller.stopwatch)); + + + drawer.initScreen(drawer.tableSize, *controller.getTable()); } void GamePanel::OnPaint(wxPaintEvent& _) { diff --git a/MainFrame.cpp b/MainFrame.cpp index 795fe99..dc8964c 100644 --- a/MainFrame.cpp +++ b/MainFrame.cpp @@ -64,6 +64,8 @@ void MainFrame::bindMenu() { openLayout(); else panel->Start(layoutPath); + + Refresh(); }, IDM_New_Game); }