mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-04-30 09:01:41 -04:00
fixed incomplete undo after placing large tiles (#136)
This commit is contained in:
parent
db57aeb108
commit
86bbb350a4
1 changed files with 6 additions and 5 deletions
|
@ -2884,16 +2884,16 @@ void CIsoView::OnLButtonDown(UINT nFlags, CPoint point)
|
|||
|
||||
void CIsoView::PlaceTile(const int x, const int y, const UINT nMouseFlags)
|
||||
{
|
||||
Map->TakeSnapshot(TRUE, x - 6, y - 6, x + (*tiledata)[AD.type].cx * m_BrushSize_x + 7, y + (*tiledata)[AD.type].cy * m_BrushSize_y + 7);
|
||||
int i, e, f, n;
|
||||
int p = 0;
|
||||
int width = (*tiledata)[AD.type].cx;
|
||||
int height = (*tiledata)[AD.type].cy;
|
||||
const int width = (*tiledata)[AD.type].cx;
|
||||
const int height = (*tiledata)[AD.type].cy;
|
||||
int pos = x - width + 1 + (y - height + 1) * Map->GetIsoSize();
|
||||
int startheight = Map->GetHeightAt(x + y * Map->GetIsoSize()) + AD.z_data;
|
||||
int ground = Map->GetFielddataAt(x + y * Map->GetIsoSize())->wGround;
|
||||
if (ground == 0xFFFF) ground = 0;
|
||||
startheight -= (*tiledata)[ground].tiles[Map->GetFielddataAt(x + y * Map->GetIsoSize())->bSubTile].bZHeight;
|
||||
Map->TakeSnapshot(TRUE, x - width - 4, y - height - 4, x - width + m_BrushSize_x * width + 7, y - height + m_BrushSize_y * height + 7);
|
||||
for (f = 0; f < m_BrushSize_x; f++) {
|
||||
for (n = 0; n < m_BrushSize_y; n++) {
|
||||
int tile = AD.type;
|
||||
|
@ -2909,7 +2909,8 @@ void CIsoView::PlaceTile(const int x, const int y, const UINT nMouseFlags)
|
|||
if (x - width + 1 + f * width + i >= Map->GetIsoSize() ||
|
||||
y - height + 1 + n * height + e >= Map->GetIsoSize()) {
|
||||
|
||||
} else
|
||||
}
|
||||
else
|
||||
if ((*tiledata)[AD.type].tiles[p].pic != NULL) {
|
||||
Map->SetHeightAt(pos + i + f * width + (e + n * height) * Map->GetIsoSize(), startheight + (*tiledata)[AD.type].tiles[p].bZHeight);
|
||||
Map->SetTileAt(pos + i + f * width + (e + n * height) * Map->GetIsoSize(), tile, p);
|
||||
|
@ -2923,7 +2924,7 @@ void CIsoView::PlaceTile(const int x, const int y, const UINT nMouseFlags)
|
|||
}
|
||||
|
||||
if (!((nMouseFlags & MK_CONTROL) && (nMouseFlags & MK_SHIFT))) {
|
||||
if (!theApp.m_Options.bDisableAutoShore) Map->CreateShore(x - 5, y - 5, x + (*tiledata)[AD.type].cx * m_BrushSize_x + 5, y + (*tiledata)[AD.type].cy * m_BrushSize_y + 5, FALSE);
|
||||
if (!theApp.m_Options.bDisableAutoShore) Map->CreateShore(x - width - 2, y - height - 2, x - width + width * m_BrushSize_x + 5, y - height + height * m_BrushSize_y + 5, FALSE);
|
||||
//Map->CreateShore(0,0,Map->GetIsoSize(), Map->GetIsoSize());
|
||||
|
||||
for (f = 0; f < m_BrushSize_x; f++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue