mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-31 04:50:48 +00:00
- Performance optimization for FBlockThingsIterator::Next(): Actors that
exist in only one block don't need to be added to the CheckArray or scanned for in it. SVN r1532 (trunk)
This commit is contained in:
parent
3dc01e77f7
commit
a54367a3c0
2 changed files with 12 additions and 2 deletions
|
@ -1,4 +1,9 @@
|
||||||
April 7, 2009 (Changes by Graf Zahl)
|
April 8, 2009
|
||||||
|
- Performance optimization for FBlockThingsIterator::Next(): Actors that
|
||||||
|
exist in only one block don't need to be added to the CheckArray or
|
||||||
|
scanned for in it.
|
||||||
|
|
||||||
|
April 7, 2009 (Changes by Graf Zahl)
|
||||||
- added some default definitions for constants that may miss in some headers.
|
- added some default definitions for constants that may miss in some headers.
|
||||||
- replaced __va_copy with va_copy per Chris's suggestion.
|
- replaced __va_copy with va_copy per Chris's suggestion.
|
||||||
- replaced #include <malloc.h> with #include <stdlib.h> where possible.
|
- replaced #include <malloc.h> with #include <stdlib.h> where possible.
|
||||||
|
|
|
@ -830,15 +830,20 @@ void FBlockThingsIterator::StartBlock(int x, int y)
|
||||||
|
|
||||||
AActor *FBlockThingsIterator::Next()
|
AActor *FBlockThingsIterator::Next()
|
||||||
{
|
{
|
||||||
while (true)
|
for (;;)
|
||||||
{
|
{
|
||||||
while (block != NULL)
|
while (block != NULL)
|
||||||
{
|
{
|
||||||
AActor *me = block->Me;
|
AActor *me = block->Me;
|
||||||
|
FBlockNode *mynode = block;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
block = block->NextActor;
|
block = block->NextActor;
|
||||||
// Don't recheck things that were already checked
|
// Don't recheck things that were already checked
|
||||||
|
if (mynode->NextBlock == NULL && mynode->PrevBlock == &me->BlockNode)
|
||||||
|
{ // This actor doesn't span blocks, so we know it can only ever be checked once.
|
||||||
|
return me;
|
||||||
|
}
|
||||||
for (i = (int)CheckArray.Size() - 1; i >= checkindex; --i)
|
for (i = (int)CheckArray.Size() - 1; i >= checkindex; --i)
|
||||||
{
|
{
|
||||||
if (CheckArray[i] == me)
|
if (CheckArray[i] == me)
|
||||||
|
|
Loading…
Reference in a new issue