Browse Source

formatting

Dave Schuyler 22 years ago
parent
commit
f0b627a5e4

+ 19 - 10
direct/src/showbase/Loader.py

@@ -17,14 +17,17 @@ class Loader:
     
     
     # special methods
     # special methods
     def __init__(self, base):
     def __init__(self, base):
-        """__init__(self)
-        Loader constructor"""
+        """
+        Loader constructor
+        """
         self.base = base
         self.base = base
         self.loader = PandaLoader()
         self.loader = PandaLoader()
         
         
     # model loading funcs
     # model loading funcs
     def loadModel(self, modelPath, fMakeNodeNamesUnique = 0):
     def loadModel(self, modelPath, fMakeNodeNamesUnique = 0):
-        """loadModel(self, string)
+        """
+        modelPath is a string.
+
         Attempt to load a model from given file path, return
         Attempt to load a model from given file path, return
         a nodepath to the model if successful or None otherwise."""
         a nodepath to the model if successful or None otherwise."""
         assert(Loader.notify.debug("Loading model: %s" % (modelPath) ))
         assert(Loader.notify.debug("Loading model: %s" % (modelPath) ))
@@ -40,7 +43,9 @@ class Loader:
         return nodePath
         return nodePath
 
 
     def loadModelOnce(self, modelPath):
     def loadModelOnce(self, modelPath):
-        """loadModelOnce(self, string)
+        """
+        modelPath is a string.
+
         Attempt to load a model from modelPool, if not present
         Attempt to load a model from modelPool, if not present
         then attempt to load it from disk. Return a nodepath to
         then attempt to load it from disk. Return a nodepath to
         the model if successful or None otherwise"""
         the model if successful or None otherwise"""
@@ -94,7 +99,9 @@ class Loader:
             return None
             return None
 
 
     def loadModelNode(self, modelPath):
     def loadModelNode(self, modelPath):
-        """loadModelNode(self, string)
+        """
+        modelPath is a string.
+        
         This is like loadModelOnce in that it loads a model from the
         This is like loadModelOnce in that it loads a model from the
         modelPool, but it does not then instance it to hidden and it
         modelPool, but it does not then instance it to hidden and it
         returns a Node instead of a NodePath.  This is particularly
         returns a Node instead of a NodePath.  This is particularly
@@ -111,7 +118,8 @@ class Loader:
         return ModelPool.loadModel(modelPath)
         return ModelPool.loadModel(modelPath)
 
 
     def unloadModel(self, modelPath):
     def unloadModel(self, modelPath):
-        """unloadModel(self, string)
+        """
+        modelPath is a string.
         """
         """
         assert(Loader.notify.debug("Unloading model: %s" % (modelPath)))
         assert(Loader.notify.debug("Unloading model: %s" % (modelPath)))
         ModelPool.releaseModel(modelPath)
         ModelPool.releaseModel(modelPath)
@@ -124,7 +132,8 @@ class Loader:
                  minFilter = None, magFilter = None,
                  minFilter = None, magFilter = None,
                  anisotropicDegree = None,
                  anisotropicDegree = None,
                  lineHeight = None):
                  lineHeight = None):
-        """loadFont(self, string)
+        """
+        modelPath is a string.
 
 
         This loads a special model as a TextFont object, for rendering
         This loads a special model as a TextFont object, for rendering
         text with a TextNode.  A font file must be either a special
         text with a TextNode.  A font file must be either a special
@@ -193,7 +202,9 @@ class Loader:
 
 
     # texture loading funcs
     # texture loading funcs
     def loadTexture(self, texturePath, alphaPath = None):
     def loadTexture(self, texturePath, alphaPath = None):
-        """loadTexture(self, string)
+        """
+        texturePath is a string.
+
         Attempt to load a texture from the given file path using
         Attempt to load a texture from the given file path using
         TexturePool class. Returns None if not found"""
         TexturePool class. Returns None if not found"""
 
 
@@ -210,8 +221,6 @@ class Loader:
         return texture
         return texture
 
 
     def unloadTexture(self, texture):
     def unloadTexture(self, texture):
-        """unloadTexture(self, texture)
-        """
         assert(Loader.notify.debug("Unloading texture: %s" % (texture) ))
         assert(Loader.notify.debug("Unloading texture: %s" % (texture) ))
         TexturePool.releaseTexture(texture)
         TexturePool.releaseTexture(texture)
 
 

+ 64 - 60
dtool/src/dconfig/configTable.h

@@ -19,7 +19,7 @@
 #ifndef CONFIGTABLE_H
 #ifndef CONFIGTABLE_H
 #define CONFIGTABLE_H
 #define CONFIGTABLE_H
 
 
-#include <dtoolbase.h>
+#include "dtoolbase.h"
 
 
 #include "config_setup.h"
 #include "config_setup.h"
 #include "config_dconfig.h"
 #include "config_dconfig.h"
@@ -31,66 +31,70 @@
 namespace Config {
 namespace Config {
 
 
 class EXPCL_DTOOLCONFIG ConfigTable {
 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"
 #include "configTable.I"

+ 21 - 21
dtool/src/dconfig/dconfig.h

@@ -63,27 +63,27 @@ EXPCL_DTOOLCONFIG extern int total_num_get;
 
 
 template <class GetConfig>
 template <class GetConfig>
 class Config {
 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
 // Implementation follows

+ 2 - 1
dtool/src/dconfig/notifyCategory.cxx

@@ -56,8 +56,9 @@ NotifyCategory(const string &fullname, const string &basename,
 
 
   if (!config_name.empty()) {
   if (!config_name.empty()) {
     string severity_name;
     string severity_name;
-    if (!config_notify.AmInitializing())
+    if (!config_notify.AmInitializing()) {
       severity_name = config_notify.GetString(config_name, "");
       severity_name = config_notify.GetString(config_name, "");
+    }
     if (!severity_name.empty()) {
     if (!severity_name.empty()) {
       // The user specified a particular severity for this category at
       // The user specified a particular severity for this category at
       // config time.  Use it.
       // config time.  Use it.

+ 14 - 14
panda/src/collide/collide_headers.h

@@ -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 "collisionEntry.h"
 #include "collisionHandler.h"
 #include "collisionHandler.h"

+ 0 - 2
panda/src/collide/collisionHandlerFloor.cxx

@@ -76,7 +76,6 @@ handle_entries() {
         << get_type() << " doesn't know about "
         << get_type() << " doesn't know about "
         << *from_node << ", disabling.\n";
         << *from_node << ", disabling.\n";
       okflag = false;
       okflag = false;
-
     } else {
     } else {
       ColliderDef &def = (*ci).second;
       ColliderDef &def = (*ci).second;
       if (!def.is_valid()) {
       if (!def.is_valid()) {
@@ -84,7 +83,6 @@ handle_entries() {
           << "Removing invalid collider " << *from_node << " from "
           << "Removing invalid collider " << *from_node << " from "
           << get_type() << "\n";
           << get_type() << "\n";
         _colliders.erase(ci);
         _colliders.erase(ci);
-
       } else {
       } else {
         // Get the maximum height for all collisions with this node.
         // Get the maximum height for all collisions with this node.
         bool got_max = false;
         bool got_max = false;