From 91640f2f35d703898edb14abaae7dd63f5346027 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 15 Mar 2015 17:20:42 -0400 Subject: Added file management to map editor (only edits environment at current time) --- tools/mapedit/src/widget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/mapedit/src/widget.cpp') diff --git a/tools/mapedit/src/widget.cpp b/tools/mapedit/src/widget.cpp index 53249c7..9c8dae3 100644 --- a/tools/mapedit/src/widget.cpp +++ b/tools/mapedit/src/widget.cpp @@ -48,7 +48,7 @@ void MapeditWidget::OnPaint(wxPaintEvent& event) { for (int x=0; xmapdata[x+y*MAP_WIDTH]; + int tile = map->getTileAt(x, y); 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); } } @@ -76,7 +76,7 @@ void MapeditWidget::SetTile(wxPoint pos) int x = (pos.x + vX) / (TILE_WIDTH * scale); int y = (pos.y + vY) / (TILE_HEIGHT * scale); - map->mapdata[x+y*MAP_WIDTH] = tileWidget->getSelected(); + map->setTileAt(x, y, tileWidget->getSelected()); Refresh(); } -- cgit 1.4.1