diff --git a/panda/src/skel/Sources.pp b/panda/src/skel/Sources.pp new file mode 100644 index 0000000000..bd209a638a --- /dev/null +++ b/panda/src/skel/Sources.pp @@ -0,0 +1,27 @@ +#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \ + dtoolutil:c dtoolbase:c dtool:m prc:c + +#define USE_PACKAGES + +#begin lib_target + #define TARGET skel + #define LOCAL_LIBS \ + display text pgraph gobj linmath putil + + #define COMBINED_SOURCES $[TARGET]_composite1.cxx + + #define SOURCES \ + config_skel.h \ + basicSkel.I basicSkel.h + + #define INCLUDED_SOURCES \ + config_skel.cxx \ + basicSkel.cxx + + #define INSTALL_HEADERS \ + basicSkel.h basicSkel.I + + #define IGATESCAN all + +#end lib_target + diff --git a/panda/src/skel/basicSkel.I b/panda/src/skel/basicSkel.I new file mode 100644 index 0000000000..2528b5d8f1 --- /dev/null +++ b/panda/src/skel/basicSkel.I @@ -0,0 +1,56 @@ +// Filename: basicSkel.I +// Created by: jyelon (31Jan07) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ . +// +// To contact the maintainers of this program write to +// panda3d-general@lists.sourceforge.net . +// +//////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////// +// Function: BasicSkel::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE BasicSkel:: +BasicSkel() { +} + +//////////////////////////////////////////////////////////////////// +// Function: BasicSkel::Destructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE BasicSkel:: +~BasicSkel() { +} + +//////////////////////////////////////////////////////////////////// +// Function: BasicSkel::set_value +// Access: Public +// Description: Stores an integer value. +//////////////////////////////////////////////////////////////////// +INLINE void BasicSkel:: +set_value(int n) { + _value = n; +} + +//////////////////////////////////////////////////////////////////// +// Function: BasicSkel::get_value +// Access: Public +// Description: Retreives a value that was previously stored. +//////////////////////////////////////////////////////////////////// +INLINE int BasicSkel:: +get_value() { + return _value; +} diff --git a/panda/src/skel/basicSkel.cxx b/panda/src/skel/basicSkel.cxx new file mode 100644 index 0000000000..eb166d7e2f --- /dev/null +++ b/panda/src/skel/basicSkel.cxx @@ -0,0 +1,43 @@ +// Filename: basicSkel.cxx +// Created by: jyelon (31Jan07) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ . +// +// To contact the maintainers of this program write to +// panda3d-general@lists.sourceforge.net . +// +//////////////////////////////////////////////////////////////////// + +#include "basicSkel.h" + +//////////////////////////////////////////////////////////////////// +// Function: BasicSkel::set_value_alt +// Access: Public +// Description: Stores an integer value. Exact same functionality +// as set_value, except that this isn't an inline +// function. +//////////////////////////////////////////////////////////////////// +void BasicSkel:: +set_value_alt(int n) { + _value = n; +} + +//////////////////////////////////////////////////////////////////// +// Function: BasicSkel::get_value +// Access: Public +// Description: Retreives a value that was previously stored. +// Exact same functionality as get_value, except +// that this isn't an inline function. +//////////////////////////////////////////////////////////////////// +int BasicSkel:: +get_value_alt() { + return _value; +} diff --git a/panda/src/skel/basicSkel.h b/panda/src/skel/basicSkel.h new file mode 100644 index 0000000000..46d87aa554 --- /dev/null +++ b/panda/src/skel/basicSkel.h @@ -0,0 +1,53 @@ +// Filename: basicSkel.h +// Created by: jyelon (31Jan07) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ . +// +// To contact the maintainers of this program write to +// panda3d-general@lists.sourceforge.net . +// +//////////////////////////////////////////////////////////////////// + +#ifndef BASICSKEL_H +#define BASICSKEL_H + +#include "pandabase.h" + +//////////////////////////////////////////////////////////////////// +// Class : BasicSkel +// Description : This is the most basic of the skeleton classes. +// It stores an integer, and will return it on request. +// +// The skeleton classes are intended to help you learn +// how to add C++ classes to panda. See also the manual, +// "Adding C++ Classes to Panda." +//////////////////////////////////////////////////////////////////// +class EXPCL_PANDASKEL BasicSkel { +PUBLISHED: + INLINE BasicSkel(); + INLINE ~BasicSkel(); + + // These inline functions allow you to get and set _value. + INLINE void set_value(int n); + INLINE int get_value(); + + // These do the same thing as the functions above. + void set_value_alt(int n); + int get_value_alt(); + +private: + int _value; +}; + +#include "basicSkel.I" + +#endif + diff --git a/panda/src/skel/config_skel.cxx b/panda/src/skel/config_skel.cxx new file mode 100644 index 0000000000..94c14a449d --- /dev/null +++ b/panda/src/skel/config_skel.cxx @@ -0,0 +1,51 @@ +// Filename: config_skel.cxx +// Created by: jyelon (09Feb07) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ . +// +// To contact the maintainers of this program write to +// panda3d-general@lists.sourceforge.net . +// +//////////////////////////////////////////////////////////////////// + +#include "config_skel.h" +#include "dconfig.h" + +Configure(config_skel); +NotifyCategoryDef(skel, ""); + +ConfigureFn(config_skel) { + init_libskel(); +} + +ConfigVariableInt skel_number_of_monkeys +("skel-sample-config-variable", 3); + +//////////////////////////////////////////////////////////////////// +// Function: init_libskel +// Description: Initializes the library. This must be called at +// least once before any of the functions or classes in +// this library can be used. Normally it will be +// called by the static initializers and need not be +// called explicitly, but special cases exist. +//////////////////////////////////////////////////////////////////// +void +init_libskel() { + static bool initialized = false; + if (initialized) { + return; + } + initialized = true; + + // There's no initialization necessary for the skel library. + // But if there were, we would put it here. +} + diff --git a/panda/src/skel/config_skel.h b/panda/src/skel/config_skel.h new file mode 100644 index 0000000000..b561f4fa30 --- /dev/null +++ b/panda/src/skel/config_skel.h @@ -0,0 +1,36 @@ +// Filename: config_skel.h +// Created by: jyelon (09Feb07) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ . +// +// To contact the maintainers of this program write to +// panda3d-general@lists.sourceforge.net . +// +//////////////////////////////////////////////////////////////////// + +#ifndef CONFIG_SKEL_H +#define CONFIG_SKEL_H + +#include "pandabase.h" +#include "notifyCategoryProxy.h" +#include "configVariableDouble.h" +#include "configVariableString.h" +#include "configVariableInt.h" + +NotifyCategoryDecl(skel, EXPCL_PANDASKEL, EXPTP_PANDASKEL); + +extern ConfigVariableInt skel_sample_config_variable; + +extern EXPCL_PANDASKEL void init_libskel(); + +#endif + + diff --git a/panda/src/skel/skel_composite.cxx b/panda/src/skel/skel_composite.cxx new file mode 100644 index 0000000000..7f6a16413b --- /dev/null +++ b/panda/src/skel/skel_composite.cxx @@ -0,0 +1 @@ +#include "skel_composite1.cxx" diff --git a/panda/src/skel/skel_composite1.cxx b/panda/src/skel/skel_composite1.cxx new file mode 100644 index 0000000000..2e5edf0f77 --- /dev/null +++ b/panda/src/skel/skel_composite1.cxx @@ -0,0 +1,2 @@ +#include "config_skel.cxx" +#include "basicSkel.cxx"