Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BSP Builder|Cleanup: Added a private Instance to Partitioner
Also moved the definition of PartitionCost into bsp/partitioncost.h
- Loading branch information
1 parent
32d3c74
commit 3f93bd6
Showing
4 changed files
with
1,990 additions
and
2,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/** | ||
* @file partitioncost.h | ||
* BSP builder partition cost evaluation. @ingroup bsp | ||
* | ||
* Based on glBSP 2.24 (in turn, based on BSP 2.3), which is hosted on | ||
* SourceForge: http://sourceforge.net/projects/glbsp/ | ||
* | ||
* @authors Copyright © 2007-2012 Daniel Swanson <danij@dengine.net> | ||
* @authors Copyright © 2000-2007 Andrew Apted <ajapted@gmail.com> | ||
* @authors Copyright © 1998-2000 Colin Reed <cph@moria.org.uk> | ||
* @authors Copyright © 1998-2000 Lee Killough <killough@rsn.hp.com> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. This program is distributed in the hope that it | ||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. You should have received a copy of the GNU | ||
* General Public License along with this program; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA</small> | ||
*/ | ||
|
||
#ifndef LIBDENG_BSP_PARTITIONCOST | ||
#define LIBDENG_BSP_PARTITIONCOST | ||
|
||
namespace de { | ||
namespace bsp { | ||
|
||
struct PartitionCost | ||
{ | ||
int total; | ||
int splits; | ||
int iffy; | ||
int nearMiss; | ||
int realRight; | ||
int realLeft; | ||
int miniRight; | ||
int miniLeft; | ||
|
||
PartitionCost::PartitionCost() : | ||
total(0), splits(0), iffy(0), nearMiss(0), realRight(0), | ||
realLeft(0), miniRight(0), miniLeft(0) | ||
{} | ||
|
||
PartitionCost& operator += (const PartitionCost& other) | ||
{ | ||
total += other.total; | ||
splits += other.splits; | ||
iffy += other.iffy; | ||
nearMiss += other.nearMiss; | ||
realLeft += other.realLeft; | ||
realRight += other.realRight; | ||
miniLeft += other.miniLeft; | ||
miniRight += other.miniRight; | ||
return *this; | ||
} | ||
|
||
PartitionCost& operator = (const PartitionCost& other) | ||
{ | ||
total = other.total; | ||
splits = other.splits; | ||
iffy = other.iffy; | ||
nearMiss = other.nearMiss; | ||
realLeft = other.realLeft; | ||
realRight = other.realRight; | ||
miniLeft = other.miniLeft; | ||
miniRight = other.miniRight; | ||
return *this; | ||
} | ||
|
||
bool operator < (const PartitionCost& rhs) const | ||
{ | ||
return total < rhs.total; | ||
} | ||
}; | ||
|
||
} // namespace bsp | ||
} // namespace de | ||
|
||
#endif /// LIBDENG_BSP_PARTITIONCOST |
Oops, something went wrong.