Panda3D
 All Classes Functions Variables Enumerations
config_physics.h
1 // Filename: config_physics.h
2 // Created by: charles (17Jul00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef CONFIG_PHYSICS_H
16 #define CONFIG_PHYSICS_H
17 
18 #include "pandabase.h"
19 #include "notifyCategoryProxy.h"
20 #include "dconfig.h"
21 
22 ConfigureDecl(config_physics, EXPCL_PANDAPHYSICS, EXPTP_PANDAPHYSICS);
23 NotifyCategoryDecl(physics, EXPCL_PANDAPHYSICS, EXPTP_PANDAPHYSICS);
24 
25 extern EXPCL_PANDAPHYSICS void init_libphysics();
26 
27 // These macros get stripped out in a non-debug build (like asserts).
28 // Use them like cout but with paranthesis aroud the cout input.
29 // e.g. foo_debug("The value of bar is " << bar);
30 #ifndef NDEBUG //[
31  // Non-release build:
32  #define PHYSICS_DEBUG
33 
34  #define physics_spam(msg) \
35  if (physics_cat.is_spam()) { \
36  physics_cat->spam() << msg << endl; \
37  } else {}
38 
39  #define physics_debug(msg) \
40  if (physics_cat.is_debug()) { \
41  physics_cat->debug() << msg << endl; \
42  } else {}
43 
44  #define physics_info(msg) \
45  physics_cat->info() << msg << endl
46 
47  #define physics_warning(msg) \
48  physics_cat->warning() << msg << endl
49 
50  #define physics_error(msg) \
51  physics_cat->error() << msg << endl
52 #else //][
53  // Release build:
54  #undef PHYSICS_DEBUG
55 
56  #define physics_spam(msg) ((void)0)
57  #define physics_debug(msg) ((void)0)
58  #define physics_info(msg) ((void)0)
59  #define physics_warning(msg) ((void)0)
60  #define physics_error(msg) ((void)0)
61 #endif //]
62 
63 #define audio_error(msg) \
64  audio_cat->error() << msg << endl
65 
66 #endif // CONFIG_PHYSICS_H