Panda3D
config_softegg.cxx
1 // Filename: config_softegg.cxx
2 // Created by: masad (25Sep03)
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 #include "config_softegg.h"
16 #include "softEggGroupUserData.h"
17 #include "softNodeDesc.h"
18 
19 #include "dconfig.h"
20 
21 Configure(config_softegg);
22 NotifyCategoryDef(softegg, ":soft");
23 
24 ConfigureFn(config_softegg) {
25  init_libsoftegg();
26 }
27 
28 // These control the default behavior of the softegg converter, but
29 // not necessarily the default behavior of the soft2egg command-line
30 // tool (which has its own defaults).
31 
32 // Should we respect the Soft? double-sided flag (true) or ignore it
33 // and assume everything is single-sided (false)?
34 ConfigVariableBool soft_default_double_sided("soft-default-double-sided", false);
35 
36 // Should we apply vertex color even when a texture is applied (true)
37 // or only when no texture is applied or the vertex-color egg flag is
38 // set (false)?
39 ConfigVariableBool soft_default_vertex_color("soft-default-vertex-color", true);
40 
41 ////////////////////////////////////////////////////////////////////
42 // Function: init_libsoftegg
43 // Description: Initializes the library. This must be called at
44 // least once before any of the functions or classes in
45 // this library can be used. Normally it will be
46 // called by the static initializers and need not be
47 // called explicitly, but special cases exist.
48 ////////////////////////////////////////////////////////////////////
49 void
50 init_libsoftegg() {
51  static bool initialized = false;
52  if (initialized) {
53  return;
54  }
55  initialized = true;
56 
57  SoftEggGroupUserData::init_type();
58  SoftNodeDesc::init_type();
59 }
60 
This is a convenience class to specialize ConfigVariable as a boolean type.