-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
b_device.h
71 lines (60 loc) · 2.18 KB
/
b_device.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**\file
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2009-2012 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2007-2012 Daniel Swanson <danij@dengine.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
/**
* b_device.h: Control-Device Bindings
*/
#ifndef __DOOMSDAY_BIND_DEVICE_H__
#define __DOOMSDAY_BIND_DEVICE_H__
#include "b_util.h"
typedef enum cbdevtype_e {
CBD_TOGGLE,
CBD_AXIS,
CBD_ANGLE,
NUM_CBD_TYPES
} cbdevtype_t;
// Flags for control-device bindings.
#define CBDF_INVERSE 0x1
#define CBDF_TIME_STAGED 0x2
typedef struct dbinding_s {
struct dbinding_s* next;
struct dbinding_s* prev;
int bid;
uint device;
cbdevtype_t type;
int id;
float angle;
uint flags;
// Additional conditions.
int numConds;
statecondition_t* conds;
} dbinding_t;
void B_InitDeviceBindingList(dbinding_t* listRoot);
void B_DestroyDeviceBindingList(dbinding_t* listRoot);
dbinding_t* B_NewDeviceBinding(dbinding_t* listRoot, const char* deviceDesc);
void B_DestroyDeviceBinding(dbinding_t* cb);
void B_DeviceBindingToString(const dbinding_t* b, ddstring_t* str);
void B_EvaluateDeviceBindingList(int localNum, dbinding_t* listRoot,
float* pos, float* relativeOffset,
struct bcontext_s* controlClass);
#endif // __DOOMSDAY_BIND_DEVICE_H__