~ubuntu-branches/ubuntu/lucid/blender/lucid

« back to all changes in this revision

Viewing changes to source/gameengine/Ketsji/KX_StateActuator.h

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2009-08-06 22:32:19 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090806223219-8z4eej1u8levu4pz
Tags: 2.49a+dfsg-0ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control: Build-depend on python-2.6 rather than python-2.5.
  - debian/misc/*.desktop: Add Spanish translation to .desktop 
    files.
  - debian/pyversions: 2.6.
  - debian/rules: Clean *.o of source/blender/python/api2_2x/
* New upstream release (LP: #382153).
* Refreshed patches:
  - 01_sanitize_sys.patch
  - 02_tmp_in_HOME
  - 10_use_systemwide_ftgl
  - 70_portability_platform_detection
* Removed patches merged upstream:
  - 30_fix_python_syntax_warning
  - 90_ubuntu_ffmpeg_52_changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * $Id: KX_StateActuator.h 15444 2008-07-05 17:05:05Z lukep $
3
 
 *
4
 
 * ***** BEGIN GPL LICENSE BLOCK *****
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU General Public License
8
 
 * as published by the Free Software Foundation; either version 2
9
 
 * of the License, or (at your option) any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software Foundation,
18
 
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
 
 *
20
 
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21
 
 * All rights reserved.
22
 
 *
23
 
 * The Original Code is: all of this file.
24
 
 *
25
 
 * Contributor(s): none yet.
26
 
 *
27
 
 * ***** END GPL LICENSE BLOCK *****
28
 
 * Actuator to toggle visibility/invisibility of objects
29
 
 */
30
 
 
31
 
#ifndef __KX_STATEACTUATOR
32
 
#define __KX_STATEACTUATOR
33
 
 
34
 
#include "SCA_IActuator.h"
35
 
 
36
 
class KX_StateActuator : public SCA_IActuator
37
 
{
38
 
        Py_Header;
39
 
 
40
 
        /** Make visible? */
41
 
        enum {
42
 
                OP_CPY = 0,
43
 
                OP_SET,
44
 
                OP_CLR,
45
 
                OP_NEG
46
 
        };
47
 
        int                             m_operation;
48
 
        unsigned int    m_mask;
49
 
 
50
 
 public:
51
 
        
52
 
        KX_StateActuator(
53
 
                SCA_IObject* gameobj,
54
 
                int operation,
55
 
                unsigned int mask,
56
 
                PyTypeObject* T=&Type
57
 
                );
58
 
 
59
 
        virtual
60
 
                ~KX_StateActuator(
61
 
                        void
62
 
                        );
63
 
 
64
 
        virtual CValue*
65
 
                GetReplica(
66
 
                        void
67
 
                        );
68
 
 
69
 
        virtual bool
70
 
                Update();
71
 
 
72
 
        /* --------------------------------------------------------------------- */
73
 
        /* Python interface ---------------------------------------------------- */
74
 
        /* --------------------------------------------------------------------- */
75
 
 
76
 
        virtual PyObject* _getattr(const STR_String& attr);
77
 
        //KX_PYMETHOD_DOC
78
 
        KX_PYMETHOD_DOC(KX_StateActuator,SetOperation);
79
 
        KX_PYMETHOD_DOC(KX_StateActuator,SetMask);
80
 
};
81
 
 
82
 
#endif
83
 
 
 
1
/*
 
2
 * $Id: KX_StateActuator.h 20245 2009-05-17 21:50:31Z ben2610 $
 
3
 *
 
4
 * ***** BEGIN GPL LICENSE BLOCK *****
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software Foundation,
 
18
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 *
 
20
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 
21
 * All rights reserved.
 
22
 *
 
23
 * The Original Code is: all of this file.
 
24
 *
 
25
 * Contributor(s): none yet.
 
26
 *
 
27
 * ***** END GPL LICENSE BLOCK *****
 
28
 * Actuator to toggle visibility/invisibility of objects
 
29
 */
 
30
 
 
31
#ifndef __KX_STATEACTUATOR
 
32
#define __KX_STATEACTUATOR
 
33
 
 
34
#include "SCA_IActuator.h"
 
35
 
 
36
 
 
37
/*
 
38
 * Use of SG_DList : element of actuator being deactivated
 
39
 *                   Head: SCA_LogicManager::m_removedActuators
 
40
 * Use of SG_QList : element of global activated state actuator list 
 
41
 *                   Head: KX_StateActuator::m_stateActuatorHead
 
42
 */
 
43
class KX_StateActuator : public SCA_IActuator
 
44
{
 
45
        Py_Header;
 
46
 
 
47
        /** Make visible? */
 
48
        enum {
 
49
                OP_NOP = -1,
 
50
                OP_CPY = 0,
 
51
                OP_SET,
 
52
                OP_CLR,
 
53
                OP_NEG,
 
54
                OP_COUNT
 
55
        };
 
56
        // SG_Dlist: element of objects with active actuators, always put in front of the list
 
57
        //           Head: SCA_LogicManager::m_activeActuators
 
58
        // SG_QList: Head of active state actuators list globally
 
59
        //           Elements: KX_StateActuator
 
60
        static SG_QList m_stateActuatorHead;
 
61
        int                             m_operation;
 
62
        int                             m_mask;
 
63
 
 
64
 public:
 
65
        
 
66
        KX_StateActuator(
 
67
                SCA_IObject* gameobj,
 
68
                int operation,
 
69
                unsigned int mask,
 
70
                PyTypeObject* T=&Type
 
71
                );
 
72
 
 
73
        virtual
 
74
                ~KX_StateActuator(
 
75
                        void
 
76
                        );
 
77
 
 
78
        virtual CValue*
 
79
                GetReplica(
 
80
                        void
 
81
                        );
 
82
 
 
83
        virtual bool
 
84
                Update();
 
85
 
 
86
        virtual void Deactivate();
 
87
        virtual void Activate(SG_DList& head);
 
88
 
 
89
        /* --------------------------------------------------------------------- */
 
90
        /* Python interface ---------------------------------------------------- */
 
91
        /* --------------------------------------------------------------------- */
 
92
 
 
93
        virtual PyObject* py_getattro(PyObject *attr);
 
94
        virtual PyObject* py_getattro_dict();
 
95
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
96
        //KX_PYMETHOD_DOC
 
97
        KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetOperation);
 
98
        KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetMask);
 
99
};
 
100
 
 
101
#endif
 
102