diff options
Diffstat (limited to 'tools/mapedit/src/widget.cpp')
-rw-r--r-- | tools/mapedit/src/widget.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/mapedit/src/widget.cpp b/tools/mapedit/src/widget.cpp index 9c8dae3..d7f1a51 100644 --- a/tools/mapedit/src/widget.cpp +++ b/tools/mapedit/src/widget.cpp | |||
@@ -53,12 +53,24 @@ void MapeditWidget::OnPaint(wxPaintEvent& event) | |||
53 | } | 53 | } |
54 | } | 54 | } |
55 | 55 | ||
56 | for (auto object : map->getObjects()) | ||
57 | { | ||
58 | tiles_dc.SelectObject(wxNullBitmap); | ||
59 | |||
60 | wxBitmap sprite = object.object->getSprite(); | ||
61 | tiles_dc.SelectObject(sprite); | ||
62 | |||
63 | dc.StretchBlit(object.position.first*scale-vX, object.position.second*scale-vY, object.object->getWidth()*scale, object.object->getHeight()*scale, &tiles_dc, 0, 0, object.object->getWidth(), object.object->getHeight()); | ||
64 | } | ||
65 | |||
56 | if (mouseIsIn) | 66 | if (mouseIsIn) |
57 | { | 67 | { |
58 | int tile = tileWidget->getSelected(); | 68 | int tile = tileWidget->getSelected(); |
59 | int x = (mousePos.x + vX) / (TILE_WIDTH * scale); | 69 | int x = (mousePos.x + vX) / (TILE_WIDTH * scale); |
60 | int y = (mousePos.y + vY) / (TILE_HEIGHT * scale); | 70 | int y = (mousePos.y + vY) / (TILE_HEIGHT * scale); |
61 | 71 | ||
72 | tiles_dc.SelectObject(wxNullBitmap); | ||
73 | tiles_dc.SelectObject(tiles); | ||
62 | dc.StretchBlit(x*TILE_WIDTH*scale-vX, y*TILE_HEIGHT*scale-vY, TILE_WIDTH*scale, TILE_HEIGHT*scale, &tiles_dc, tile%8*TILE_WIDTH, tile/8*TILE_HEIGHT, TILE_WIDTH, TILE_HEIGHT); | 74 | dc.StretchBlit(x*TILE_WIDTH*scale-vX, y*TILE_HEIGHT*scale-vY, TILE_WIDTH*scale, TILE_HEIGHT*scale, &tiles_dc, tile%8*TILE_WIDTH, tile/8*TILE_HEIGHT, TILE_WIDTH, TILE_HEIGHT); |
63 | 75 | ||
64 | wxPen pen(*wxGREEN, 2); | 76 | wxPen pen(*wxGREEN, 2); |