~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/gameengine/GameLogic/Joystick/SCA_Joystick.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
 
1
/*
2
2
 * ***** BEGIN GPL LICENSE BLOCK *****
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or
25
25
 * ***** END GPL LICENSE BLOCK *****
26
26
 */
27
27
 
28
 
#ifndef _SCA_JOYSTICK_H_
29
 
#define _SCA_JOYSTICK_H_
 
28
/** \file SCA_Joystick.h
 
29
 *  \ingroup gamelogic
 
30
 */
 
31
 
 
32
#ifndef __SCA_JOYSTICK_H__
 
33
#define __SCA_JOYSTICK_H__
30
34
 
31
35
#include "SCA_JoystickDefines.h"
32
 
#ifndef DISABLE_SDL
33
 
#include "SDL.h"
 
36
#ifdef WITH_SDL
 
37
#  include "SDL.h"
34
38
#endif
35
39
 
36
 
/*
 
40
/**
37
41
 * Basic Joystick class
38
42
 * I will make this class a singleton because there should be only one joystick
39
43
 * even if there are more than one scene using it and count how many scene are using it.
48
52
        static int m_refCount;
49
53
 
50
54
        class PrivateData;
51
 
#ifndef DISABLE_SDL
 
55
#ifdef WITH_SDL
52
56
        PrivateData             *m_private;
53
57
#endif
54
58
        int                             m_joyindex;
55
59
 
56
 
        /* 
 
60
        /** 
57
61
         *support for JOYAXIS_MAX axes (in pairs)
58
62
         */
59
63
        int m_axis_array[JOYAXIS_MAX];
60
64
 
61
 
        /* 
 
65
        /** 
62
66
         *support for JOYHAT_MAX hats (each is a direction)
63
67
         */
64
68
        int m_hat_array[JOYHAT_MAX];    
65
69
        
66
 
        /*
 
70
        /**
67
71
         * Precision or range of the axes
68
72
         */
69
73
        int                     m_prec;
70
74
 
71
 
        /*
 
75
        /**
72
76
         * max # of buttons avail
73
 
        */
 
77
         */
74
78
        
75
79
        int                     m_axismax;
76
80
        int                     m_buttonmax;
77
81
        int                     m_hatmax;
78
82
        
79
 
        /* is the joystick initialized ?*/
 
83
        /** is the joystick initialized ?*/
80
84
        bool                    m_isinit;
81
85
 
82
86
        
83
 
        /* is triggered for each event type */
 
87
        /** is triggered for each event type */
84
88
        bool                    m_istrig_axis;
85
89
        bool                    m_istrig_button;
86
90
        bool                    m_istrig_hat;
87
91
 
88
 
#ifndef DISABLE_SDL
89
 
        /*
 
92
#ifdef WITH_SDL
 
93
        /**
90
94
         * event callbacks
91
95
         */
92
96
        void OnAxisMotion(SDL_Event *sdl_event);
98
102
        void OnBallMotion(SDL_Event *sdl_event){}
99
103
#endif
100
104
                
101
 
#endif
102
 
        /*
 
105
#endif /* WITH_SDL */
 
106
        /**
103
107
         * Open the joystick
104
108
         */
105
109
        bool CreateJoystickDevice(void);
106
110
 
107
 
        /*
 
111
        /**
108
112
         * Close the joystick
109
113
         */
110
114
        void DestroyJoystickDevice(void);
111
115
 
112
 
        /*
113
 
         * fills the axis mnember values 
 
116
        /**
 
117
         * fills the axis member values
114
118
         */
115
119
        void pFillButtons(void);
116
120
 
117
 
        /*
 
121
        /**
118
122
         * returns m_axis_array
119
123
         */
120
124
 
121
125
        int pAxisTest(int axisnum);
122
 
        /*
 
126
        /**
123
127
         * returns m_axis_array
124
128
         */
125
129
        int pGetAxis(int axisnum, int udlr);
130
134
        
131
135
public:
132
136
 
133
 
        static SCA_Joystick *GetInstance( short int joyindex );
134
 
        static void HandleEvents( void );
 
137
        static SCA_Joystick *GetInstance(short int joyindex);
 
138
        static void HandleEvents(void);
135
139
        void ReleaseInstance();
136
140
        
137
141
 
146
150
        bool aButtonReleaseIsPositive(int button);
147
151
        bool aHatIsPositive(int hatnum, int dir);
148
152
 
149
 
        /*
 
153
        /**
150
154
         * precision is default '3200' which is overridden by input
151
155
         */
152
156
 
176
180
                return m_istrig_hat;
177
181
        }
178
182
 
179
 
        /*
 
183
        /**
180
184
         * returns the # of...
181
185
         */
182
186
 
184
188
        int GetNumberOfButtons(void);
185
189
        int GetNumberOfHats(void);
186
190
        
187
 
        /*
 
191
        /**
188
192
         * Test if the joystick is connected
189
193
         */
190
194
        int Connected(void);
191
195
};
192
 
#ifndef DISABLE_SDL
193
 
void Joystick_HandleEvents( void );
194
 
#endif
195
196
 
196
197
#endif
197
198