mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
fixed crash in the map editor
This commit is contained in:
parent
822b002344
commit
82f5a56d89
|
@ -1328,24 +1328,26 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
|||
}
|
||||
|
||||
CLayerGroup *g = GetSelectedGroup();
|
||||
m_Brush.m_OffsetX += g->m_OffsetX;
|
||||
m_Brush.m_OffsetY += g->m_OffsetY;
|
||||
m_Brush.m_ParallaxX = g->m_ParallaxX;
|
||||
m_Brush.m_ParallaxY = g->m_ParallaxY;
|
||||
m_Brush.Render();
|
||||
float w, h;
|
||||
m_Brush.GetSize(&w, &h);
|
||||
|
||||
IGraphics::CLineItem Array[4] = {
|
||||
IGraphics::CLineItem(0, 0, w, 0),
|
||||
IGraphics::CLineItem(w, 0, w, h),
|
||||
IGraphics::CLineItem(w, h, 0, h),
|
||||
IGraphics::CLineItem(0, h, 0, 0)};
|
||||
Graphics()->TextureSet(-1);
|
||||
Graphics()->LinesBegin();
|
||||
Graphics()->LinesDraw(Array, 4);
|
||||
Graphics()->LinesEnd();
|
||||
if(g)
|
||||
{
|
||||
m_Brush.m_OffsetX += g->m_OffsetX;
|
||||
m_Brush.m_OffsetY += g->m_OffsetY;
|
||||
m_Brush.m_ParallaxX = g->m_ParallaxX;
|
||||
m_Brush.m_ParallaxY = g->m_ParallaxY;
|
||||
m_Brush.Render();
|
||||
float w, h;
|
||||
m_Brush.GetSize(&w, &h);
|
||||
|
||||
IGraphics::CLineItem Array[4] = {
|
||||
IGraphics::CLineItem(0, 0, w, 0),
|
||||
IGraphics::CLineItem(w, 0, w, h),
|
||||
IGraphics::CLineItem(w, h, 0, h),
|
||||
IGraphics::CLineItem(0, h, 0, 0)};
|
||||
Graphics()->TextureSet(-1);
|
||||
Graphics()->LinesBegin();
|
||||
Graphics()->LinesDraw(Array, 4);
|
||||
Graphics()->LinesEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View)
|
|||
pEditor->DoButton_Editor(&s_DeleteButton, Localize("Delete group"), 0, &Button, 0, Localize("Delete group")))
|
||||
{
|
||||
pEditor->m_Map.DeleteGroup(pEditor->m_SelectedGroup);
|
||||
pEditor->m_SelectedGroup = max(0, pEditor->m_SelectedGroup-1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue