Subversion Repositories eduke32

Rev

Rev 8105 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8105 Rev 8776
1
//-------------------------------------------------------------------------
1
//-------------------------------------------------------------------------
2
/*
2
/*
3
Copyright (C) 1996, 2003 - 3D Realms Entertainment
3
Copyright (C) 1996, 2003 - 3D Realms Entertainment
4

4

5
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
5
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
6

6

7
Duke Nukem 3D is free software; you can redistribute it and/or
7
Duke Nukem 3D is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License
8
modify it under the terms of the GNU General Public License
9
as published by the Free Software Foundation; either version 2
9
as published by the Free Software Foundation; either version 2
10
of the License, or (at your option) any later version.
10
of the License, or (at your option) any later version.
11

11

12
This program is distributed in the hope that it will be useful,
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15

15

16
See the GNU General Public License for more details.
16
See the GNU General Public License for more details.
17

17

18
You should have received a copy of the GNU General Public License
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21

21

22
Original Source: 1996 - Todd Replogle
22
Original Source: 1996 - Todd Replogle
23
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
23
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
24
Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
24
Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
25
*/
25
*/
26
//-------------------------------------------------------------------------
26
//-------------------------------------------------------------------------
27
27
28
#pragma once
28
#pragma once
29
29
30
#ifndef mouse_h_
30
#ifndef mouse_h_
31
#define mouse_h_
31
#define mouse_h_
32
32
33
#include "baselayer.h"
33
#include "baselayer.h"
34
34
35
#ifdef __cplusplus
35
#ifdef __cplusplus
36
extern "C" {
36
extern "C" {
37
#endif
37
#endif
38
38
39
#define LEFT_MOUSE      1
39
#define LEFT_MOUSE      1
40
#define RIGHT_MOUSE     2
40
#define RIGHT_MOUSE     2
41
#define MIDDLE_MOUSE    4
41
#define MIDDLE_MOUSE    4
42
#define THUMB_MOUSE     8
42
#define THUMB_MOUSE     8
43
#define WHEELUP_MOUSE   16
43
#define WHEELUP_MOUSE   16
44
#define WHEELDOWN_MOUSE 32
44
#define WHEELDOWN_MOUSE 32
45
45
46
#define LEFT_MOUSE_PRESSED(button)      (((button)&LEFT_MOUSE) != 0)
46
#define LEFT_MOUSE_PRESSED(button)      (((button)&LEFT_MOUSE) != 0)
47
#define RIGHT_MOUSE_PRESSED(button)     (((button)&RIGHT_MOUSE) != 0)
47
#define RIGHT_MOUSE_PRESSED(button)     (((button)&RIGHT_MOUSE) != 0)
48
#define MIDDLE_MOUSE_PRESSED(button)    (((button)&MIDDLE_MOUSE) != 0)
48
#define MIDDLE_MOUSE_PRESSED(button)    (((button)&MIDDLE_MOUSE) != 0)
49
49
-
 
50
extern int32_t CONTROL_MouseAxesScale[2];
-
 
51
extern float   CONTROL_MouseSensitivity;
50
52
51
static inline bool Mouse_Init(void)
53
static inline bool Mouse_Init(void)
52
{
54
{
53
    mouseInit();
55
    mouseInit();
54
    return ((inputdevices & 2) == 2);
56
    return ((inputdevices & 2) == 2);
55
}
57
}
56
58
57
static inline void MOUSE_Shutdown(void) { mouseUninit(); }
59
static inline void MOUSE_Shutdown(void) { mouseUninit(); }
58
static inline int32_t MOUSE_GetButtons(void) { return mouseReadButtons(); }
60
static inline int32_t MOUSE_GetButtons(void) { return mouseReadButtons(); }
59
static inline void MOUSE_ClearButton(int32_t b) { g_mouseBits &= ~b; }
61
static inline void MOUSE_ClearButton(int32_t b) { g_mouseBits &= ~b; }
60
static inline void MOUSE_ClearAllButtons(void) { g_mouseBits = 0; }
62
static inline void MOUSE_ClearAllButtons(void) { g_mouseBits = 0; }
61
63
62
#ifdef __cplusplus
64
#ifdef __cplusplus
63
}
65
}
64
#endif
66
#endif
65
#endif /* __mouse_h */
67
#endif /* __mouse_h */
66
 
68