00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "config_pgraph.h"
00020
00021 #include "alphaTestAttrib.h"
00022 #include "ambientLight.h"
00023 #include "billboardEffect.h"
00024 #include "camera.h"
00025 #include "clipPlaneAttrib.h"
00026 #include "colorAttrib.h"
00027 #include "colorBlendAttrib.h"
00028 #include "colorScaleAttrib.h"
00029 #include "colorWriteAttrib.h"
00030 #include "compassEffect.h"
00031 #include "cullFaceAttrib.h"
00032 #include "cullBin.h"
00033 #include "cullBinAttrib.h"
00034 #include "cullBinBackToFront.h"
00035 #include "cullBinFixed.h"
00036 #include "cullBinFrontToBack.h"
00037 #include "cullBinUnsorted.h"
00038 #include "cullTraverser.h"
00039 #include "cullableObject.h"
00040 #include "decalEffect.h"
00041 #include "depthOffsetAttrib.h"
00042 #include "depthTestAttrib.h"
00043 #include "depthWriteAttrib.h"
00044 #include "directionalLight.h"
00045 #include "fog.h"
00046 #include "fogAttrib.h"
00047 #include "geomNode.h"
00048 #include "lensNode.h"
00049 #include "light.h"
00050 #include "lightAttrib.h"
00051 #include "lightLensNode.h"
00052 #include "lightNode.h"
00053 #include "loaderFileType.h"
00054 #include "loaderFileTypeBam.h"
00055 #include "loaderFileTypeRegistry.h"
00056 #include "lodNode.h"
00057 #include "materialAttrib.h"
00058 #include "modelNode.h"
00059 #include "modelRoot.h"
00060 #include "nodePath.h"
00061 #include "nodePathComponent.h"
00062 #include "pandaNode.h"
00063 #include "planeNode.h"
00064 #include "pointLight.h"
00065 #include "renderAttrib.h"
00066 #include "renderEffect.h"
00067 #include "renderEffects.h"
00068 #include "renderModeAttrib.h"
00069 #include "renderState.h"
00070 #include "selectiveChildNode.h"
00071 #include "sequenceNode.h"
00072 #include "showBoundsEffect.h"
00073 #include "spotlight.h"
00074 #include "switchNode.h"
00075 #include "texMatrixAttrib.h"
00076 #include "textureApplyAttrib.h"
00077 #include "textureAttrib.h"
00078 #include "transformState.h"
00079 #include "transparencyAttrib.h"
00080 #include "nodePathLerps.h"
00081 #include "get_config_path.h"
00082
00083 #include "dconfig.h"
00084
00085 ConfigureDef(config_pgraph);
00086 NotifyCategoryDef(pgraph, "");
00087 NotifyCategoryDef(loader, "");
00088
00089 ConfigureFn(config_pgraph) {
00090 init_libpgraph();
00091 }
00092
00093
00094
00095
00096 const bool fake_view_frustum_cull = config_pgraph.GetBool("fake-view-frustum-cull", false);
00097
00098
00099
00100
00101 const bool unambiguous_graph = config_pgraph.GetBool("unambiguous-graph", false);
00102
00103
00104
00105
00106 const bool paranoid_compose = config_pgraph.GetBool("paranoid-compose", false);
00107
00108
00109
00110
00111 const bool compose_componentwise = config_pgraph.GetBool("compose-componentwise", true);
00112
00113
00114
00115
00116
00117 const bool bams_componentwise = config_pgraph.GetBool("bams-componentwise", false);
00118
00119
00120
00121 const bool m_dual = config_pgraph.GetBool("m-dual", true);
00122
00123 const bool m_dual_opaque = config_pgraph.GetBool("m-dual-opaque", true);
00124
00125 const bool m_dual_transparent = config_pgraph.GetBool("m-dual-transparent", true);
00126
00127 const bool m_dual_flash = config_pgraph.GetBool("m-dual-flash", false);
00128
00129
00130
00131
00132
00133
00134 const bool asynchronous_loads = config_pgraph.GetBool("asynchronous-loads", false);
00135
00136 Config::ConfigTable::Symbol *load_file_type = (Config::ConfigTable::Symbol *)NULL;
00137
00138 const DSearchPath &
00139 get_bam_path() {
00140 static DSearchPath *bam_path = NULL;
00141 return get_config_path("bam-path", bam_path);
00142 }
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152 void
00153 init_libpgraph() {
00154 static bool initialized = false;
00155 if (initialized) {
00156 return;
00157 }
00158 initialized = true;
00159
00160 load_file_type = new Config::ConfigTable::Symbol;
00161 config_pgraph.GetAll("load-file-type", *load_file_type);
00162
00163 AlphaTestAttrib::init_type();
00164 AmbientLight::init_type();
00165 BillboardEffect::init_type();
00166 Camera::init_type();
00167 ClipPlaneAttrib::init_type();
00168 ColorAttrib::init_type();
00169 ColorBlendAttrib::init_type();
00170 ColorScaleAttrib::init_type();
00171 ColorWriteAttrib::init_type();
00172 CompassEffect::init_type();
00173 CullFaceAttrib::init_type();
00174 CullBin::init_type();
00175 CullBinAttrib::init_type();
00176 CullBinBackToFront::init_type();
00177 CullBinFixed::init_type();
00178 CullBinFrontToBack::init_type();
00179 CullBinUnsorted::init_type();
00180 CullTraverser::init_type();
00181 CullableObject::init_type();
00182 DecalEffect::init_type();
00183 DepthOffsetAttrib::init_type();
00184 DepthTestAttrib::init_type();
00185 DepthWriteAttrib::init_type();
00186 DirectionalLight::init_type();
00187 Fog::init_type();
00188 FogAttrib::init_type();
00189 GeomNode::init_type();
00190 LensNode::init_type();
00191 Light::init_type();
00192 LightAttrib::init_type();
00193 LightLensNode::init_type();
00194 LightNode::init_type();
00195 LODNode::init_type();
00196 LoaderFileType::init_type();
00197 LoaderFileTypeBam::init_type();
00198 MaterialAttrib::init_type();
00199 ModelNode::init_type();
00200 ModelRoot::init_type();
00201 NodePath::init_type();
00202 NodePathComponent::init_type();
00203 PandaNode::init_type();
00204 PlaneNode::init_type();
00205 PointLight::init_type();
00206 RenderAttrib::init_type();
00207 RenderEffect::init_type();
00208 RenderEffects::init_type();
00209 RenderModeAttrib::init_type();
00210 RenderState::init_type();
00211 SelectiveChildNode::init_type();
00212 SequenceNode::init_type();
00213 ShowBoundsEffect::init_type();
00214 Spotlight::init_type();
00215 SwitchNode::init_type();
00216 TexMatrixAttrib::init_type();
00217 TextureApplyAttrib::init_type();
00218 TextureAttrib::init_type();
00219 TransformState::init_type();
00220 TransparencyAttrib::init_type();
00221 PosLerpFunctor::init_type();
00222 HprLerpFunctor::init_type();
00223 ScaleLerpFunctor::init_type();
00224 PosHprLerpFunctor::init_type();
00225 HprScaleLerpFunctor::init_type();
00226 PosHprScaleLerpFunctor::init_type();
00227 ColorLerpFunctor::init_type();
00228 ColorScaleLerpFunctor::init_type();
00229 EventStoreTransform::init_type();
00230
00231 AlphaTestAttrib::register_with_read_factory();
00232 AmbientLight::register_with_read_factory();
00233 BillboardEffect::register_with_read_factory();
00234 Camera::register_with_read_factory();
00235 ClipPlaneAttrib::register_with_read_factory();
00236 CompassEffect::register_with_read_factory();
00237 ColorAttrib::register_with_read_factory();
00238 ColorBlendAttrib::register_with_read_factory();
00239 ColorScaleAttrib::register_with_read_factory();
00240 ColorWriteAttrib::register_with_read_factory();
00241 CullBinAttrib::register_with_read_factory();
00242 CullFaceAttrib::register_with_read_factory();
00243 DecalEffect::register_with_read_factory();
00244 DepthOffsetAttrib::register_with_read_factory();
00245 DepthTestAttrib::register_with_read_factory();
00246 DepthWriteAttrib::register_with_read_factory();
00247 DirectionalLight::register_with_read_factory();
00248 Fog::register_with_read_factory();
00249 FogAttrib::register_with_read_factory();
00250 GeomNode::register_with_read_factory();
00251 LensNode::register_with_read_factory();
00252 LightAttrib::register_with_read_factory();
00253 LODNode::register_with_read_factory();
00254 MaterialAttrib::register_with_read_factory();
00255 ModelNode::register_with_read_factory();
00256 ModelRoot::register_with_read_factory();
00257 PandaNode::register_with_read_factory();
00258 PlaneNode::register_with_read_factory();
00259 PointLight::register_with_read_factory();
00260 RenderEffects::register_with_read_factory();
00261 RenderModeAttrib::register_with_read_factory();
00262 RenderState::register_with_read_factory();
00263 SequenceNode::register_with_read_factory();
00264 ShowBoundsEffect::register_with_read_factory();
00265 Spotlight::register_with_read_factory();
00266 SwitchNode::register_with_read_factory();
00267 TexMatrixAttrib::register_with_read_factory();
00268 TextureApplyAttrib::register_with_read_factory();
00269 TextureAttrib::register_with_read_factory();
00270 TransformState::register_with_read_factory();
00271 TransparencyAttrib::register_with_read_factory();
00272
00273 LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
00274 reg->register_type(new LoaderFileTypeBam);
00275 }