Fix coronas duplicate-drawing sometimes
This commit is contained in:
parent
bc76545e44
commit
db8bdab669
2 changed files with 10 additions and 1 deletions
|
|
@ -664,6 +664,15 @@ public:
|
|||
Insert (SortedFind (item, std::forward<Func>(lt), false), item);
|
||||
}
|
||||
|
||||
void SortedInsertUnique(const T &item)
|
||||
{
|
||||
int foundIndex = SortedFind (item, false);
|
||||
if (foundIndex >= Count || Array[foundIndex] != item)
|
||||
{
|
||||
Insert (foundIndex, item);
|
||||
}
|
||||
}
|
||||
|
||||
void ShrinkToFit ()
|
||||
{
|
||||
if (Most > Count)
|
||||
|
|
|
|||
|
|
@ -876,7 +876,7 @@ void HWSprite::Process(HWDrawInfo *di, FRenderState& state, AActor* thing, secto
|
|||
|
||||
if (thing->IsKindOf(NAME_Corona))
|
||||
{
|
||||
Coronas.Push(thing);
|
||||
Coronas.SortedInsertUnique(thing);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue