speedtree refinements

This commit is contained in:
David Rose 2010-10-07 23:17:28 +00:00
parent d0db1d1f07
commit 48c6a8756a
9 changed files with 28 additions and 18 deletions

View File

@ -132,4 +132,10 @@ egg-object-type-glow <Scalar> blend { add }
# maya2egg itself. So if it appears in an egg file, it means nothing.
egg-object-type-keep-all-uvsets
#if $[HAVE_SPEEDTREE]
# If we have the SpeedTree library available, we'll want to use it
# for loading compiled SpeedTree tree objects.
load-file-type srt pandaspeedtree
#endif
#end 20_panda.prc

View File

@ -192,12 +192,12 @@
#define EXPTP_PANDAPHYSX extern
#endif
#ifdef BUILDING_PANDARIB
#define EXPCL_PANDARIB __declspec(dllexport)
#define EXPTP_PANDARIB
#ifdef BUILDING_PANDASPEEDTREE
#define EXPCL_PANDASPEEDTREE __declspec(dllexport)
#define EXPTP_PANDASPEEDTREE
#else
#define EXPCL_PANDARIB __declspec(dllimport)
#define EXPTP_PANDARIB extern
#define EXPCL_PANDASPEEDTREE __declspec(dllimport)
#define EXPTP_PANDASPEEDTREE extern
#endif
#ifdef BUILDING_PANDASKEL

View File

@ -3,8 +3,8 @@
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
dtoolutil:c dtoolbase:c dtool:m prc:c
#define USE_PACKAGES speedtree $[if $[eq $[SPEEDTREE_API],opengl],gl cg cggl] $[if $[eq $[SPEEDTREE_API],directx9],dx9 cg cgdx9]
#define BUILDING_DLL BUILDING_PANDASKEL
#define USE_PACKAGES speedtree $[if $[eq $[SPEEDTREE_API],OpenGL],gl cg cggl] $[if $[eq $[SPEEDTREE_API],DirectX9],dx9 cg cgdx9]
#define BUILDING_DLL BUILDING_PANDASPEEDTREE
#begin lib_target
#define TARGET pandaspeedtree

View File

@ -23,7 +23,7 @@
#include "configVariableInt.h"
#include "configVariableFilename.h"
NotifyCategoryDecl(speedtree, EXPCL_PANDASKEL, EXPTP_PANDASKEL);
NotifyCategoryDecl(speedtree, EXPCL_PANDASPEEDTREE, EXPTP_PANDASPEEDTREE);
extern ConfigVariableString speedtree_license;
extern ConfigVariableFilename speedtree_shaders_dir;
@ -32,7 +32,7 @@ extern ConfigVariableInt speedtree_max_num_visible_cells;
extern ConfigVariableInt speedtree_max_billboard_images_by_base;
extern ConfigVariableDouble speedtree_cull_cell_size;
extern EXPCL_PANDASKEL void init_libspeedtree();
extern EXPCL_PANDASPEEDTREE void init_libspeedtree();
#endif

View File

@ -26,7 +26,7 @@
// returns a SpeedTreeNode with just a single tree
// within it.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDASKEL LoaderFileTypeSrt : public LoaderFileType {
class EXPCL_PANDASPEEDTREE LoaderFileTypeSrt : public LoaderFileType {
public:
LoaderFileTypeSrt();

View File

@ -388,10 +388,14 @@ safe_to_combine() const {
////////////////////////////////////////////////////////////////////
bool SpeedTreeNode::
cull_callback(CullTraverser *trav, CullTraverserData &data) {
if (!_is_valid) {
return false;
}
GraphicsStateGuardian *gsg = DCAST(GraphicsStateGuardian, trav->get_gsg());
nassertr(gsg != (GraphicsStateGuardian *)NULL, true);
if (!validate_api(gsg)) {
return true;
return false;
}
ClockObject *clock = ClockObject::get_global_clock();
@ -713,11 +717,11 @@ validate_api(GraphicsStateGuardian *gsg) {
#endif
if (pipe->get_interface_name() != compiled_api) {
ostringstream stream;
stream
speedtree_cat.error()
<< "SpeedTree is compiled for " << compiled_api
<< ", cannot render with " << pipe->get_interface_name();
nassert_raise(stream.str());
<< ", cannot render with " << pipe->get_interface_name()
<< "\n";
_is_valid = false;
return false;
}

View File

@ -30,7 +30,7 @@
// SpeedTree objects like a collection of trees,
// terrain, or grass within the Panda3D scene graph.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDASKEL SpeedTreeNode : public PandaNode {
class EXPCL_PANDASPEEDTREE SpeedTreeNode : public PandaNode {
private:
// This definition is required by InstanceList, below.
typedef pvector<SpeedTree::CInstance> STInstances;

View File

@ -26,7 +26,7 @@
// particular instance of a tree when added to the
// SpeedTreeNode.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDASKEL STTransform {
class EXPCL_PANDASPEEDTREE STTransform {
PUBLISHED:
INLINE STTransform();
STTransform(const TransformState *trans);

View File

@ -27,7 +27,7 @@ class SpeedTreeNode;
// Description : Encapsulates a single tree model in the SpeedTree
// library, as loaded from an SRT file.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDASKEL STTree : public TypedReferenceCount, public Namable {
class EXPCL_PANDASPEEDTREE STTree : public TypedReferenceCount, public Namable {
PUBLISHED:
STTree(const Filename &fullpath, const Filename &filename = Filename());
private: