combine loader with pgraph

This commit is contained in:
David Rose 2002-05-16 17:53:00 +00:00
parent ff5e3de5da
commit 835e22a1e2
29 changed files with 80 additions and 167 deletions

View File

@ -6,7 +6,7 @@
#begin lib_target
#define TARGET egg2pg
#define LOCAL_LIBS \
parametrics collide egg builder loader chan char
parametrics collide egg builder pgraph chan char
#define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx

View File

@ -5,7 +5,7 @@
#define TARGET framework
#define BUILDING_DLL BUILDING_FRAMEWORK
#define LOCAL_LIBS \
pgraph putil collide loader chan text chancfg \
pgraph putil collide chan text chancfg \
pnmimage pnmimagetypes event
#define SOURCES \

View File

@ -1,30 +0,0 @@
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
dtoolutil:c dtoolbase:c dtool:m
#begin lib_target
#define TARGET loader
#define LOCAL_LIBS \
event pgraph ipc putil express downloader
#define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx
#define SOURCES \
bamFile.I bamFile.h config_loader.h loader.I loader.h \
loaderFileType.h loaderFileTypeBam.h \
loaderFileTypeRegistry.h \
modelPool.I modelPool.h
#define INCLUDED_SOURCES \
bamFile.cxx config_loader.cxx loader.cxx loaderFileType.cxx \
loaderFileTypeBam.cxx loaderFileTypeRegistry.cxx \
modelPool.cxx
#define INSTALL_HEADERS \
bamFile.I bamFile.h loader.I loader.h loaderFileType.h \
loaderFileTypeBam.h loaderFileTypeRegistry.h \
modelPool.I modelPool.h
#define IGATESCAN all
#end lib_target

View File

@ -1,55 +0,0 @@
// Filename: config_loader.cxx
// Created by: drose (19Mar00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "config_loader.h"
#include "loaderFileType.h"
#include "loaderFileTypeBam.h"
#include "loaderFileTypeRegistry.h"
#include <dconfig.h>
#include <get_config_path.h>
Configure(config_loader);
NotifyCategoryDef(loader, "");
// Set this true to support actual asynchronous loads via the
// request_load()/fetch_load() interface to Loader. Set it false to
// map these to blocking, synchronous loads instead. Currently, the
// rest of Panda isn't quite ready for asynchronous loads, so leave
// this false for now.
const bool asynchronous_loads = config_loader.GetBool("asynchronous-loads", false);
Config::ConfigTable::Symbol *load_file_type = (Config::ConfigTable::Symbol *)NULL;
ConfigureFn(config_loader) {
load_file_type = new Config::ConfigTable::Symbol;
config_loader.GetAll("load-file-type", *load_file_type);
LoaderFileType::init_type();
LoaderFileTypeBam::init_type();
LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
reg->register_type(new LoaderFileTypeBam);
}
const DSearchPath &
get_bam_path() {
static DSearchPath *bam_path = NULL;
return get_config_path("bam-path", bam_path);
}

View File

@ -1,36 +0,0 @@
// Filename: config_loader.h
// Created by: drose (19Mar00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CONFIG_LOADER_H
#define CONFIG_LOADER_H
#include <pandabase.h>
#include <dconfig.h>
#include <notifyCategoryProxy.h>
class DSearchPath;
NotifyCategoryDecl(loader, EXPCL_PANDA, EXPTP_PANDA);
extern const bool asynchronous_loads;
const DSearchPath &get_bam_path();
extern Config::ConfigTable::Symbol *load_file_type;
#endif

View File

@ -1,5 +0,0 @@
#include "bamFile.cxx"
#include "config_loader.cxx"
#include "loader.cxx"

View File

@ -1,6 +0,0 @@
#include "modelPool.cxx"
#include "loaderFileType.cxx"
#include "loaderFileTypeBam.cxx"
#include "loaderFileTypeRegistry.cxx"

View File

@ -1,6 +1,8 @@
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
dtoolutil:c dtoolbase:c dtool:m
#define LOCAL_LIBS lerp event gsgbase gobj putil linmath express pandabase
#define LOCAL_LIBS \
lerp event gsgbase gobj putil linmath \
downloader express pandabase
#begin lib_target
#define TARGET pgraph
@ -8,6 +10,7 @@
#define SOURCES \
alphaTestAttrib.I alphaTestAttrib.h \
ambientLight.I ambientLight.h \
bamFile.I bamFile.h \
billboardEffect.I billboardEffect.h \
binCullHandler.I binCullHandler.h \
camera.I camera.h \
@ -45,9 +48,14 @@
lightAttrib.I lightAttrib.h \
lightLensNode.I lightLensNode.h \
lightNode.I lightNode.h \
loader.I loader.h \
loaderFileType.h \
loaderFileTypeBam.h \
loaderFileTypeRegistry.h \
lodNode.I lodNode.h \
materialAttrib.I materialAttrib.h \
modelNode.I modelNode.h \
modelPool.I modelPool.h \
modelRoot.I modelRoot.h \
nodePath.I nodePath.h nodePath.cxx \
nodePathCollection.I nodePathCollection.h \
@ -79,6 +87,7 @@
#define INCLUDED_SOURCES \
alphaTestAttrib.cxx \
ambientLight.cxx \
bamFile.cxx \
billboardEffect.cxx \
binCullHandler.cxx \
camera.cxx \
@ -116,9 +125,14 @@
lightAttrib.cxx \
lightLensNode.cxx \
lightNode.cxx \
loader.cxx \
loaderFileType.cxx \
loaderFileTypeBam.cxx \
loaderFileTypeRegistry.cxx \
lodNode.cxx \
materialAttrib.cxx \
modelNode.cxx \
modelPool.cxx \
modelRoot.cxx \
nodePath.cxx \
nodePathCollection.cxx \
@ -146,15 +160,10 @@
transparencyAttrib.cxx \
workingNodePath.cxx
#if $[DONT_COMBINE_PGRAPH]
#define SOURCES $[SOURCES] $[INCLUDED_SOURCES]
#define INCLUDED_SOURCES
#define COMBINED_SOURCES
#endif
#define INSTALL_HEADERS \
alphaTestAttrib.I alphaTestAttrib.h \
ambientLight.I ambientLight.h \
bamFile.I bamFile.h \
billboardEffect.I billboardEffect.h \
binCullHandler.I binCullHandler.h \
camera.I camera.h \
@ -189,9 +198,14 @@
lightAttrib.I lightAttrib.h \
lightLensNode.I lightLensNode.h \
lightNode.I lightNode.h \
loader.I loader.h \
loaderFileType.h \
loaderFileTypeBam.h \
loaderFileTypeRegistry.h \
lodNode.I lodNode.h \
materialAttrib.I materialAttrib.h \
modelNode.I modelNode.h \
modelPool.I modelPool.h \
modelRoot.I modelRoot.h \
nodePath.I nodePath.h \
nodePathCollection.I nodePathCollection.h \

View File

@ -17,13 +17,13 @@
////////////////////////////////////////////////////////////////////
#include "bamFile.h"
#include "config_loader.h"
#include "config_pgraph.h"
#include <bam.h>
#include <config_util.h>
#include <bamReader.h>
#include <bamWriter.h>
#include <filename.h>
#include "bam.h"
#include "config_util.h"
#include "bamReader.h"
#include "bamWriter.h"
#include "filename.h"
////////////////////////////////////////////////////////////////////
// Function: BamFile::Constructor

View File

@ -46,6 +46,9 @@
#include "lightAttrib.h"
#include "lightLensNode.h"
#include "lightNode.h"
#include "loaderFileType.h"
#include "loaderFileTypeBam.h"
#include "loaderFileTypeRegistry.h"
#include "lodNode.h"
#include "materialAttrib.h"
#include "modelNode.h"
@ -69,11 +72,13 @@
#include "transformState.h"
#include "transparencyAttrib.h"
#include "nodePathLerps.h"
#include "get_config_path.h"
#include "dconfig.h"
ConfigureDef(config_pgraph);
NotifyCategoryDef(pgraph, "");
NotifyCategoryDef(loader, "");
ConfigureFn(config_pgraph) {
init_libpgraph();
@ -99,6 +104,21 @@ const bool m_dual_transparent = config_pgraph.GetBool("m-dual-transparent", true
// Set this true to flash any objects that use M_dual, for debugging.
const bool m_dual_flash = config_pgraph.GetBool("m-dual-flash", false);
// Set this true to support actual asynchronous loads via the
// request_load()/fetch_load() interface to Loader. Set it false to
// map these to blocking, synchronous loads instead. Currently, the
// rest of Panda isn't quite ready for asynchronous loads, so leave
// this false for now.
const bool asynchronous_loads = config_pgraph.GetBool("asynchronous-loads", false);
Config::ConfigTable::Symbol *load_file_type = (Config::ConfigTable::Symbol *)NULL;
const DSearchPath &
get_bam_path() {
static DSearchPath *bam_path = NULL;
return get_config_path("bam-path", bam_path);
}
////////////////////////////////////////////////////////////////////
// Function: init_libpgraph
// Description: Initializes the library. This must be called at
@ -115,6 +135,9 @@ init_libpgraph() {
}
initialized = true;
load_file_type = new Config::ConfigTable::Symbol;
config_pgraph.GetAll("load-file-type", *load_file_type);
AlphaTestAttrib::init_type();
AmbientLight::init_type();
BillboardEffect::init_type();
@ -144,6 +167,8 @@ init_libpgraph() {
LightLensNode::init_type();
LightNode::init_type();
LODNode::init_type();
LoaderFileType::init_type();
LoaderFileTypeBam::init_type();
MaterialAttrib::init_type();
ModelNode::init_type();
ModelRoot::init_type();
@ -211,4 +236,7 @@ init_libpgraph() {
TextureAttrib::register_with_read_factory();
TransformState::register_with_read_factory();
TransparencyAttrib::register_with_read_factory();
LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
reg->register_type(new LoaderFileTypeBam);
}

View File

@ -23,8 +23,11 @@
#include "notifyCategoryProxy.h"
#include "dconfig.h"
class DSearchPath;
ConfigureDecl(config_pgraph, EXPCL_PANDA, EXPTP_PANDA);
NotifyCategoryDecl(pgraph, EXPCL_PANDA, EXPTP_PANDA);
NotifyCategoryDecl(loader, EXPCL_PANDA, EXPTP_PANDA);
extern const bool fake_view_frustum_cull;
extern const bool unambiguous_graph;
@ -34,6 +37,11 @@ extern const bool m_dual_opaque;
extern const bool m_dual_transparent;
extern const bool m_dual_flash;
extern const bool asynchronous_loads;
const DSearchPath &get_bam_path();
extern Config::ConfigTable::Symbol *load_file_type;
extern EXPCL_PANDA void init_libpgraph();
#endif

View File

@ -19,7 +19,7 @@
#include "loader.h"
#include "loaderFileType.h"
#include "loaderFileTypeRegistry.h"
#include "config_loader.h"
#include "config_pgraph.h"
#include "event.h"
#include "pt_Event.h"

View File

@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////
#include "loaderFileTypeBam.h"
#include "config_loader.h"
#include "config_pgraph.h"
#include "bamFile.h"
#include "config_util.h"
@ -31,8 +31,7 @@ TypeHandle LoaderFileTypeBam::_type_handle;
// Description:
////////////////////////////////////////////////////////////////////
LoaderFileTypeBam::
LoaderFileTypeBam()
{
LoaderFileTypeBam() {
}
////////////////////////////////////////////////////////////////////
@ -41,8 +40,7 @@ LoaderFileTypeBam()
// Description:
////////////////////////////////////////////////////////////////////
string LoaderFileTypeBam::
get_name() const
{
get_name() const {
return "Bam";
}
@ -52,8 +50,7 @@ get_name() const
// Description:
////////////////////////////////////////////////////////////////////
string LoaderFileTypeBam::
get_extension() const
{
get_extension() const {
return "bam";
}

View File

@ -18,7 +18,7 @@
#include "loaderFileTypeRegistry.h"
#include "loaderFileType.h"
#include "config_loader.h"
#include "config_pgraph.h"
#include <string_utils.h>
#include <indent.h>

View File

@ -18,7 +18,7 @@
#include "modelPool.h"
#include "loader.h"
#include "config_loader.h"
#include "config_pgraph.h"
ModelPool *ModelPool::_global_ptr = (ModelPool *)NULL;

View File

@ -46,6 +46,7 @@
#include "textureCollection.h"
#include "globPattern.h"
#include "config_gobj.h"
#include "bamFile.h"
#include "dcast.h"
// stack seems to overflow on Intel C++ at 7000. If we need more than
@ -2781,7 +2782,6 @@ bool NodePath::
write_bam_file(const string &filename) const {
nassertr_always(!is_empty(), false);
/*
BamFile bam_file;
bool okflag = false;
@ -2793,12 +2793,6 @@ write_bam_file(const string &filename) const {
bam_file.close();
}
return okflag;
*/
// At the moment, we can't do this because BamFile is defined in
// loader and loader depends on pgraph.
nassertr(false, false);
return false;
}
////////////////////////////////////////////////////////////////////

View File

@ -1,4 +1,5 @@
#include "ambientLight.cxx"
#include "bamFile.cxx"
#include "billboardEffect.cxx"
#include "binCullHandler.cxx"
#include "camera.cxx"
@ -32,5 +33,3 @@
#include "fogAttrib.cxx"
#include "geomNode.cxx"
#include "geomTransformer.cxx"

View File

@ -3,9 +3,14 @@
#include "lightAttrib.cxx"
#include "lightLensNode.cxx"
#include "lightNode.cxx"
#include "loader.cxx"
#include "loaderFileType.cxx"
#include "loaderFileTypeBam.cxx"
#include "loaderFileTypeRegistry.cxx"
#include "lodNode.cxx"
#include "materialAttrib.cxx"
#include "modelNode.cxx"
#include "modelPool.cxx"
#include "modelRoot.cxx"
#include "nodePathCollection.cxx"
#include "nodePathComponent.cxx"

View File

@ -2,7 +2,7 @@
dtoolutil:c dtoolbase:c dtool:m pystub
#define LOCAL_LIBS \
framework putil collide loader chan text chancfg \
framework putil collide pgraph chan text chancfg \
pnmimage pnmimagetypes event effects gobj display \
mathutil putil express dgraph device tform \
linmath pstatclient panda