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: Apply pimpl idiom and moved subcomponents into a…
…n inner namespace
- Loading branch information
1 parent
1fb936e
commit 0bd05a4
Showing
17 changed files
with
906 additions
and
821 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,2 @@ | ||
#include "map/bspbuilder/bspbuilder.h" | ||
#include "map/bspbuilder/bsphedgeinfo.h" |
88 changes: 88 additions & 0 deletions
88
doomsday/engine/portable/include/map/bspbuilder/bspbuilder.h
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,88 @@ | ||
/** | ||
* @file bspbuilder.h | ||
* BSP Builder (public interface). @ingroup map | ||
* | ||
* 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_BSPBUILDER | ||
#define LIBDENG_BSPBUILDER | ||
|
||
#include "de_play.h" | ||
|
||
struct binarytree_s; | ||
|
||
namespace de { | ||
|
||
namespace bspbuilder { struct BspBuilderImp; } | ||
|
||
/** | ||
* BSP node builder. | ||
* | ||
* BspBuilder constructs a BSP object object tree for the specified map. | ||
* | ||
* @ingroup map | ||
*/ | ||
class BspBuilder | ||
{ | ||
public: | ||
/// Default cost factor attributed to splitting an existing half-edge. | ||
static const int DEFAULT_PARTITION_COST_HEDGESPLIT = 7; | ||
|
||
/** | ||
* Create a new BspBuilder initialized for construction using the specified map. | ||
* @param map GameMap for which to construct a BSP object tree. | ||
* @param splitCostFactor Cost factor attributed to splitting an existing half-edge. | ||
*/ | ||
explicit BspBuilder(GameMap* map, int splitCostFactor = DEFAULT_PARTITION_COST_HEDGESPLIT); | ||
~BspBuilder(); | ||
|
||
/** | ||
* Set the cost factor associated with splitting an existing half-edge. | ||
* @param factor New factor value. | ||
* @return Reference to this BspBuilder. | ||
*/ | ||
BspBuilder& setSplitCostFactor(int factor); | ||
|
||
/** | ||
* Build the BSP for the given map. | ||
* @return @c true= iff completed successfully. | ||
*/ | ||
bool build(); | ||
|
||
/** | ||
* Retrieve a pointer to the root BinaryTree node for the constructed BSP. | ||
* Even if construction fails this will return a valid node. | ||
* | ||
* The only time upon which @c NULL is returned is if called prior to calling | ||
* BspBuilder::build() | ||
*/ | ||
struct binarytree_s* root() const; | ||
|
||
private: | ||
bspbuilder::BspBuilderImp* d; | ||
}; | ||
|
||
} // namespace de | ||
|
||
#endif /// LIBDENG_BSPBUILDER |
File renamed without changes.
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
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
Oops, something went wrong.