mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[ui] Implement View_Delete
As per the pre-ECS view code, the entire sub-hierarchy of views is deleted along with the parent view.
This commit is contained in:
parent
24d8d864a2
commit
9bf506fec6
1 changed files with 12 additions and 0 deletions
|
@ -124,6 +124,7 @@ typedef void (*view_move_f) (view_t view, view_pos_t abs);
|
|||
#define VIEWINLINE GNU89INLINE inline
|
||||
|
||||
view_t View_New (ecs_registry_t *reg, view_t parent);
|
||||
VIEWINLINE void View_Delete (view_t view);
|
||||
void View_SetParent (view_t view, view_t parent);
|
||||
void View_UpdateHierarchy (view_t view);
|
||||
|
||||
|
@ -179,6 +180,17 @@ View_Valid (view_t view)
|
|||
return view.reg && ECS_EntValid (view.id, view.reg);
|
||||
}
|
||||
|
||||
VIEWINLINE
|
||||
void
|
||||
View_Delete (view_t view)
|
||||
{
|
||||
__auto_type ref = *View_GetRef (view);
|
||||
Hierarchy_RemoveHierarchy (ref.hierarchy, ref.index, 1);
|
||||
if (!ref.hierarchy->num_objects) {
|
||||
Hierarchy_Delete (ref.hierarchy);
|
||||
}
|
||||
}
|
||||
|
||||
VIEWINLINE
|
||||
view_t
|
||||
View_GetParent (view_t view)
|
||||
|
|
Loading…
Reference in a new issue