diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-15 17:20:42 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-15 17:20:42 -0400 |
commit | 91640f2f35d703898edb14abaae7dd63f5346027 (patch) | |
tree | 35bdcfd4a61fa54f70c5b44d567a0fdd665e0129 /tools/mapedit/src/widget.cpp | |
parent | 3d24adb1162c4ce1b5030b73ea72873a2b14f6f9 (diff) | |
download | therapy-91640f2f35d703898edb14abaae7dd63f5346027.tar.gz therapy-91640f2f35d703898edb14abaae7dd63f5346027.tar.bz2 therapy-91640f2f35d703898edb14abaae7dd63f5346027.zip |
Added file management to map editor (only edits environment at current time)
Diffstat (limited to 'tools/mapedit/src/widget.cpp')
-rw-r--r-- | tools/mapedit/src/widget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
48 | { | 48 | { |
49 | for (int x=0; x<MAP_WIDTH; x++) | 49 | for (int x=0; x<MAP_WIDTH; x++) |
50 | { | 50 | { |
51 | int tile = map->mapdata[x+y*MAP_WIDTH]; | 51 | int tile = map->getTileAt(x, y); |
52 | 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); | 52 | 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); |
53 | } | 53 | } |
54 | } | 54 | } |
@@ -76,7 +76,7 @@ void MapeditWidget::SetTile(wxPoint pos) | |||
76 | int x = (pos.x + vX) / (TILE_WIDTH * scale); | 76 | int x = (pos.x + vX) / (TILE_WIDTH * scale); |
77 | int y = (pos.y + vY) / (TILE_HEIGHT * scale); | 77 | int y = (pos.y + vY) / (TILE_HEIGHT * scale); |
78 | 78 | ||
79 | map->mapdata[x+y*MAP_WIDTH] = tileWidget->getSelected(); | 79 | map->setTileAt(x, y, tileWidget->getSelected()); |
80 | Refresh(); | 80 | Refresh(); |
81 | } | 81 | } |
82 | 82 | ||