mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
formatting
This commit is contained in:
parent
1cbf9ece5f
commit
f0b627a5e4
@ -17,14 +17,17 @@ class Loader:
|
||||
|
||||
# special methods
|
||||
def __init__(self, base):
|
||||
"""__init__(self)
|
||||
Loader constructor"""
|
||||
"""
|
||||
Loader constructor
|
||||
"""
|
||||
self.base = base
|
||||
self.loader = PandaLoader()
|
||||
|
||||
# model loading funcs
|
||||
def loadModel(self, modelPath, fMakeNodeNamesUnique = 0):
|
||||
"""loadModel(self, string)
|
||||
"""
|
||||
modelPath is a string.
|
||||
|
||||
Attempt to load a model from given file path, return
|
||||
a nodepath to the model if successful or None otherwise."""
|
||||
assert(Loader.notify.debug("Loading model: %s" % (modelPath) ))
|
||||
@ -40,7 +43,9 @@ class Loader:
|
||||
return nodePath
|
||||
|
||||
def loadModelOnce(self, modelPath):
|
||||
"""loadModelOnce(self, string)
|
||||
"""
|
||||
modelPath is a string.
|
||||
|
||||
Attempt to load a model from modelPool, if not present
|
||||
then attempt to load it from disk. Return a nodepath to
|
||||
the model if successful or None otherwise"""
|
||||
@ -94,7 +99,9 @@ class Loader:
|
||||
return None
|
||||
|
||||
def loadModelNode(self, modelPath):
|
||||
"""loadModelNode(self, string)
|
||||
"""
|
||||
modelPath is a string.
|
||||
|
||||
This is like loadModelOnce in that it loads a model from the
|
||||
modelPool, but it does not then instance it to hidden and it
|
||||
returns a Node instead of a NodePath. This is particularly
|
||||
@ -111,7 +118,8 @@ class Loader:
|
||||
return ModelPool.loadModel(modelPath)
|
||||
|
||||
def unloadModel(self, modelPath):
|
||||
"""unloadModel(self, string)
|
||||
"""
|
||||
modelPath is a string.
|
||||
"""
|
||||
assert(Loader.notify.debug("Unloading model: %s" % (modelPath)))
|
||||
ModelPool.releaseModel(modelPath)
|
||||
@ -124,7 +132,8 @@ class Loader:
|
||||
minFilter = None, magFilter = None,
|
||||
anisotropicDegree = None,
|
||||
lineHeight = None):
|
||||
"""loadFont(self, string)
|
||||
"""
|
||||
modelPath is a string.
|
||||
|
||||
This loads a special model as a TextFont object, for rendering
|
||||
text with a TextNode. A font file must be either a special
|
||||
@ -193,7 +202,9 @@ class Loader:
|
||||
|
||||
# texture loading funcs
|
||||
def loadTexture(self, texturePath, alphaPath = None):
|
||||
"""loadTexture(self, string)
|
||||
"""
|
||||
texturePath is a string.
|
||||
|
||||
Attempt to load a texture from the given file path using
|
||||
TexturePool class. Returns None if not found"""
|
||||
|
||||
@ -210,8 +221,6 @@ class Loader:
|
||||
return texture
|
||||
|
||||
def unloadTexture(self, texture):
|
||||
"""unloadTexture(self, texture)
|
||||
"""
|
||||
assert(Loader.notify.debug("Unloading texture: %s" % (texture) ))
|
||||
TexturePool.releaseTexture(texture)
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef CONFIGTABLE_H
|
||||
#define CONFIGTABLE_H
|
||||
|
||||
#include <dtoolbase.h>
|
||||
#include "dtoolbase.h"
|
||||
|
||||
#include "config_setup.h"
|
||||
#include "config_dconfig.h"
|
||||
@ -31,66 +31,70 @@
|
||||
namespace Config {
|
||||
|
||||
class EXPCL_DTOOLCONFIG ConfigTable {
|
||||
private:
|
||||
static ConfigTable* _instance;
|
||||
public:
|
||||
typedef SymbolEnt SymEnt;
|
||||
typedef vector_SymbolEnt Symbol;
|
||||
private:
|
||||
typedef std::map<ConfigString, Symbol> SymbolTable;
|
||||
typedef std::map<ConfigString, SymbolTable> TableMap;
|
||||
SymbolTable unqualified;
|
||||
TableMap qualified;
|
||||
bool _initializing;
|
||||
bool configdbg;
|
||||
bool readargs;
|
||||
bool readenvs;
|
||||
ConfigString pathsep;
|
||||
ConfigString filesep;
|
||||
ConfigString configname;
|
||||
ConfigString configsuffix;
|
||||
ConfigString configargs;
|
||||
ConfigString configpath;
|
||||
ConfigString configcmt;
|
||||
ConfigString argsuffix;
|
||||
ConfigString commandstub;
|
||||
private:
|
||||
static ConfigTable* _instance;
|
||||
|
||||
static void CropString(ConfigString& S);
|
||||
void DeComment(ConfigString& S);
|
||||
bool IsComment(const ConfigString&);
|
||||
static void UpCase(ConfigString&);
|
||||
ConfigString NextWord(const ConfigString& S);
|
||||
ConfigString PopNextWord(ConfigString& S);
|
||||
void ParseConfigFile(istream&, const ConfigString&);
|
||||
void ReadConfigFile();
|
||||
void ParseCommandEnv(ConfigString&, const ConfigString&);
|
||||
void ParseArgs();
|
||||
INLINE void ConfigDbgDefault();
|
||||
INLINE void ReadArgsDefault();
|
||||
INLINE void ReadEnvsDefault();
|
||||
INLINE void PathSepDefault();
|
||||
INLINE void FileSepDefault();
|
||||
INLINE void ConfigNameDefault();
|
||||
INLINE void ConfigSuffixDefault();
|
||||
INLINE void ConfigArgsDefault();
|
||||
INLINE void ConfigPathDefault();
|
||||
INLINE void ConfigCmtDefault();
|
||||
INLINE void ArgSuffixDefault();
|
||||
INLINE void CommandStubDefault();
|
||||
void MicroConfig();
|
||||
void GetData();
|
||||
protected:
|
||||
ConfigTable() : _initializing(true) {}
|
||||
public:
|
||||
static ConfigTable* Instance();
|
||||
bool AmInitializing();
|
||||
static bool TrueOrFalse(const ConfigString& in, bool def = false);
|
||||
bool Defined(const ConfigString& sym, const ConfigString qual="");
|
||||
SymEnt Get(const ConfigString& sym, const ConfigString qual = "");
|
||||
const Symbol& GetSym(const ConfigString& sym,
|
||||
const ConfigString qual = "");
|
||||
INLINE ConfigString GetConfigPath() const;
|
||||
INLINE bool IsConfigDbg() { return configdbg; };
|
||||
public:
|
||||
typedef SymbolEnt SymEnt;
|
||||
typedef vector_SymbolEnt Symbol;
|
||||
|
||||
private:
|
||||
typedef std::map<ConfigString, Symbol> SymbolTable;
|
||||
typedef std::map<ConfigString, SymbolTable> TableMap;
|
||||
SymbolTable unqualified;
|
||||
TableMap qualified;
|
||||
bool _initializing;
|
||||
bool configdbg;
|
||||
bool readargs;
|
||||
bool readenvs;
|
||||
ConfigString pathsep;
|
||||
ConfigString filesep;
|
||||
ConfigString configname;
|
||||
ConfigString configsuffix;
|
||||
ConfigString configargs;
|
||||
ConfigString configpath;
|
||||
ConfigString configcmt;
|
||||
ConfigString argsuffix;
|
||||
ConfigString commandstub;
|
||||
|
||||
static void CropString(ConfigString& S);
|
||||
void DeComment(ConfigString& S);
|
||||
bool IsComment(const ConfigString&);
|
||||
static void UpCase(ConfigString&);
|
||||
ConfigString NextWord(const ConfigString& S);
|
||||
ConfigString PopNextWord(ConfigString& S);
|
||||
void ParseConfigFile(istream&, const ConfigString&);
|
||||
void ReadConfigFile();
|
||||
void ParseCommandEnv(ConfigString&, const ConfigString&);
|
||||
void ParseArgs();
|
||||
INLINE void ConfigDbgDefault();
|
||||
INLINE void ReadArgsDefault();
|
||||
INLINE void ReadEnvsDefault();
|
||||
INLINE void PathSepDefault();
|
||||
INLINE void FileSepDefault();
|
||||
INLINE void ConfigNameDefault();
|
||||
INLINE void ConfigSuffixDefault();
|
||||
INLINE void ConfigArgsDefault();
|
||||
INLINE void ConfigPathDefault();
|
||||
INLINE void ConfigCmtDefault();
|
||||
INLINE void ArgSuffixDefault();
|
||||
INLINE void CommandStubDefault();
|
||||
void MicroConfig();
|
||||
void GetData();
|
||||
|
||||
protected:
|
||||
ConfigTable() : _initializing(true) {}
|
||||
|
||||
public:
|
||||
static ConfigTable* Instance();
|
||||
bool AmInitializing();
|
||||
static bool TrueOrFalse(const ConfigString& in, bool def = false);
|
||||
bool Defined(const ConfigString& sym, const ConfigString qual="");
|
||||
SymEnt Get(const ConfigString& sym, const ConfigString qual = "");
|
||||
const Symbol& GetSym(const ConfigString& sym,
|
||||
const ConfigString qual = "");
|
||||
INLINE ConfigString GetConfigPath() const;
|
||||
INLINE bool IsConfigDbg() { return configdbg; };
|
||||
};
|
||||
|
||||
#include "configTable.I"
|
||||
|
@ -63,27 +63,27 @@ EXPCL_DTOOLCONFIG extern int total_num_get;
|
||||
|
||||
template <class GetConfig>
|
||||
class Config {
|
||||
protected:
|
||||
static void ConfigFunc();
|
||||
static void Flag(bool);
|
||||
public:
|
||||
Config();
|
||||
~Config();
|
||||
static bool AmInitializing();
|
||||
static ConfigString Name();
|
||||
static bool Flag();
|
||||
static void Init();
|
||||
static bool Defined(const ConfigString& sym);
|
||||
static ConfigString Get(const ConfigString sym);
|
||||
static ConfigTable::Symbol& GetAll(const ConfigString,
|
||||
ConfigTable::Symbol&);
|
||||
PUBLISHED:
|
||||
static bool GetBool(const ConfigString sym, bool def = false);
|
||||
static int GetInt(const ConfigString sym, int def = 0);
|
||||
static float GetFloat(const ConfigString sym, float def = 0.);
|
||||
static double GetDouble(const ConfigString sym, double def = 0.);
|
||||
static ConfigString GetString(const ConfigString sym,
|
||||
const ConfigString def = "");
|
||||
public:
|
||||
Config();
|
||||
~Config();
|
||||
static bool AmInitializing();
|
||||
static ConfigString Name();
|
||||
static bool Flag();
|
||||
static void Init();
|
||||
static bool Defined(const ConfigString& sym);
|
||||
static ConfigString Get(const ConfigString sym);
|
||||
static ConfigTable::Symbol& GetAll(const ConfigString,
|
||||
ConfigTable::Symbol&);
|
||||
PUBLISHED:
|
||||
static bool GetBool(const ConfigString sym, bool def = false);
|
||||
static int GetInt(const ConfigString sym, int def = 0);
|
||||
static float GetFloat(const ConfigString sym, float def = 0.);
|
||||
static double GetDouble(const ConfigString sym, double def = 0.);
|
||||
static ConfigString GetString(const ConfigString sym,
|
||||
const ConfigString def = "");
|
||||
protected:
|
||||
static void ConfigFunc();
|
||||
static void Flag(bool);
|
||||
};
|
||||
|
||||
// Implementation follows
|
||||
|
@ -56,8 +56,9 @@ NotifyCategory(const string &fullname, const string &basename,
|
||||
|
||||
if (!config_name.empty()) {
|
||||
string severity_name;
|
||||
if (!config_notify.AmInitializing())
|
||||
if (!config_notify.AmInitializing()) {
|
||||
severity_name = config_notify.GetString(config_name, "");
|
||||
}
|
||||
if (!severity_name.empty()) {
|
||||
// The user specified a particular severity for this category at
|
||||
// config time. Use it.
|
||||
|
@ -16,20 +16,20 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <bamReader.h>
|
||||
#include <bamWriter.h>
|
||||
#include <boundingLine.h>
|
||||
#include <boundingSphere.h>
|
||||
#include <datagram.h>
|
||||
#include <datagramIterator.h>
|
||||
#include <geom.h>
|
||||
#include <geomLinestrip.h>
|
||||
#include <geomNode.h>
|
||||
#include <pointerToArray.h>
|
||||
#include <lens.h>
|
||||
#include <lensNode.h>
|
||||
#include <renderRelation.h>
|
||||
#include <transformTransition.h>
|
||||
#include "bamReader.h"
|
||||
#include "bamWriter.h"
|
||||
#include "boundingLine.h"
|
||||
#include "boundingSphere.h"
|
||||
#include "datagram.h"
|
||||
#include "datagramIterator.h"
|
||||
#include "geom.h"
|
||||
#include "geomLinestrip.h"
|
||||
#include "geomNode.h"
|
||||
#include "pointerToArray.h"
|
||||
#include "lens.h"
|
||||
#include "lensNode.h"
|
||||
#include "renderRelation.h"
|
||||
#include "transformTransition.h"
|
||||
|
||||
#include "collisionEntry.h"
|
||||
#include "collisionHandler.h"
|
||||
|
@ -76,7 +76,6 @@ handle_entries() {
|
||||
<< get_type() << " doesn't know about "
|
||||
<< *from_node << ", disabling.\n";
|
||||
okflag = false;
|
||||
|
||||
} else {
|
||||
ColliderDef &def = (*ci).second;
|
||||
if (!def.is_valid()) {
|
||||
@ -84,7 +83,6 @@ handle_entries() {
|
||||
<< "Removing invalid collider " << *from_node << " from "
|
||||
<< get_type() << "\n";
|
||||
_colliders.erase(ci);
|
||||
|
||||
} else {
|
||||
// Get the maximum height for all collisions with this node.
|
||||
bool got_max = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user