[go: up one dir, main page]

Menu

[904618]: / src / d_prof.h  Maximize  Restore  History

Download this file

299 lines (252 with data), 9.4 kB

  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
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
// -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
// ----------------------------------------------------------------------------
// :oCCCCOCoc.
// .cCO8OOOOOOOOO8Oo:
// .oOO8OOOOOOOOOOOOOOOCc
// cO8888: .:oOOOOC. TM
// :888888: :CCCc .oOOOOC. ### ### #########
// C888888: .ooo: .C######## ##### ##### ###### ###### ##########
// O888888: .oO### ### ##### ##### ######## ######## #### ###
// C888888: :8O. .C########## ### #### ### ## ## ## ## #### ###
// :8@@@@8: :888c o### ### #### ### ######## ######## ##########
// :8@@@@C C@@@@ oo######## ### ## ### ###### ###### #########
// cO@@@@@@@@@@@@@@@@@Oc0
// :oO8@@@@@@@@@@Oo.
// .oCOOOOOCc. http://remood.org/
// ----------------------------------------------------------------------------
// Copyright (C) 2008-2013 GhostlyDeath <ghostlydeath@remood.org>
// <ghostlydeath@gmail.com>
// ----------------------------------------------------------------------------
// 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 3
// 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.
// ----------------------------------------------------------------------------
// DESCRIPTION: Profiles
#ifndef __D_PROF_H__
#define __D_PROF_H__
#include "doomtype.h"
/************************
*** EXTENDED PROFILES ***
************************/
/*** CONSTANTS ***/
#define MAXPROFCONST 12 // Max quick access profiles
/* D_ProfileExFlags_t -- Extended profile flags */
typedef enum D_ProfileExFlags_e
{
DPEXF_GOTMOUSE = 0x00000001, // Has control of the mouse
DPEXF_GOTJOY = 0x00000002, // Controls a joystick
DPEXF_PLAYING = 0x00000004, // Is playing the game
DPEXF_DONTSAVE = 0x00000010, // Don't save in configs
DPEXF_DEFAULTKEYS = 0x00000020, // Default Keys here!
DPEXF_DUMPALL = 0x00000040, // Dump everything
} D_ProfileExFlags_t;
/* D_ProfileExBotFlags_t -- Bot Flags */
typedef enum D_ProfileExBotFlags_e
{
DPEXBOTF_MOUSE = 0x00000001, // Bot "uses" a mouse
DPEXBOTF_TURNAROUND = 0x00000002, // Bot can do 180 degree turns
} D_ProfileExBotFlags_t;
/* D_ProfileExInputCtrl_t -- Input control */
typedef enum D_ProfileExInputCtrl_e
{
DPEXIC_NULL,
/* Modifiers */
DPEXIC_SPEED,
DPEXIC_MOVEMENT,
DPEXIC_LOOKING,
/* Movement */
DPEXIC_FORWARDS,
DPEXIC_BACKWARDS,
DPEXIC_STRAFELEFT,
DPEXIC_STRAFERIGHT,
DPEXIC_FLYUP,
DPEXIC_FLYDOWN,
DPEXIC_LAND,
DPEXIC_JUMP,
/* Looking */
DPEXIC_TURNLEFT,
DPEXIC_TURNRIGHT,
DPEXIC_TURNSEMICIRCLE,
DPEXIC_LOOKUP,
DPEXIC_LOOKDOWN,
DPEXIC_LOOKCENTER,
/* Actions */
DPEXIC_USE,
DPEXIC_SUICIDE,
DPEXIC_TAUNT,
DPEXIC_CHAT,
DPEXIC_TEAMCHAT,
/* Weapons */
DPEXIC_ATTACK,
DPEXIC_ALTATTACK,
DPEXIC_RELOAD,
DPEXIC_SWITCHFIREMODE,
DPEXIC_SLOT1,
DPEXIC_SLOT2,
DPEXIC_SLOT3,
DPEXIC_SLOT4,
DPEXIC_SLOT5,
DPEXIC_SLOT6,
DPEXIC_SLOT7,
DPEXIC_SLOT8,
DPEXIC_SLOT9,
DPEXIC_SLOT10,
DPEXIC_NEXTWEAPON,
DPEXIC_PREVWEAPON,
DPEXIC_BESTWEAPON,
DPEXIC_WORSTWEAPON,
/* Inventory */
DPEXIC_NEXTINVENTORY,
DPEXIC_PREVINVENTORY,
DPEXIC_USEINVENTORY,
DPEXIC_CANCELINVENTORY,
/* General */
DPEXIC_TOPSCORES, // Show the best players
DPEXIC_BOTTOMSCORES, // Show the worst players
DPEXIC_COOPSPY, // Coop Spy
DPEXIC_AUTOMAP, // Toggle Automap
DPEXIC_CHATMODE, // Chat Mode
DPEXIC_POPUPMENU, // Popup the menu
DPEXIC_MORESTUFF, // Access to more stuff
DPEXIC_QUICKMENU, // Perfect Dark-like Quick Menu
DPEXIC_MOREMORESTUFF, // Access to even more stuff
NUMDPROFILEEXINPUTCTRLS
} D_ProfileExInputCtrl_t;
/* D_ProfileExCtrlMA_t -- Controlled mouse axis */
typedef enum D_ProfileExCtrlMA_e
{
DPEXCMA_NULL, // Do Nothing
DPEXCMA_MOVEX, // Move on axis
DPEXCMA_MOVEY,
DPEXCMA_LOOKX, // Look on axis
DPEXCMA_LOOKY,
DPEXCMA_NEGMOVEX, // Negative Move on axis
DPEXCMA_NEGMOVEY,
DPEXCMA_NEGLOOKX, // Negative Look on axis
DPEXCMA_NEGLOOKY,
DPEXCMA_PANY, // Pan on Y Axis (joys only)
DPEXCMA_NEGPANY,
DPEXCMA_ANGPANY, // Log Pan on Y Axis (joys only)
DPEXCMA_NEGANGPANY,
NUMDPROFILEEXCTRLMAS
} D_ProfileExCtrlMA_t;
/* D_ProfAutoMapColors_t -- Automap colors */
typedef enum D_ProfAutoMapColors_e
{
DPAMC_BACKGROUND, // Background Color
DPAMC_YOURPLAYER, // Your Color
DPAMC_THING, // Thing Color
DPAMC_ALLYTHING, // Ally Thing Color
DPAMC_ENEMYTHING, // Enemy Thing Color
DPAMC_PICKUP, // Pickup Item
DPAMC_SOLIDWALL, // Wall
DPAMC_FLOORSTEP, // Floor Step
DPAMC_CEILSTEP, // Ceiling Step
DPAMC_TRIGGER, // Trigger line
DPAMC_UNMAPPED, // Unmapped line
DPAMC_GRID, // Blockmap grid color
DPAMC_DEFAULT, // Default Color
DPAMC_INVISODWALL, // Invisible double wall
NUMPROFAUTOMAPCOLORS
} D_ProfAutoMapColors_t;
/* D_ProfBarType_t -- Status bar type */
typedef enum D_ProfBarType_e
{
DPBT_DOOM,
DPBT_REMOOD,
NUMPROFBARS,
DPBT_DEFAULT = DPBT_REMOOD,
} D_ProfBarType_t;
#define MAXALTAXIS 3
#define MAXMOUSEAXIS 2
#define MAXJOYAXIS 8
#if !defined(MAXUUIDLENGTH)
#define MAXUUIDLENGTH (MAXPLAYERNAME * 2) // Length of UUIDs
#endif
/* Key bits for profiles */
// This gives extra keys and such for each action performed
#define PRFKBIT_MASK UINT32_C(0xFFFFF000)
#define PRFKBIT_VMASK UINT32_C(0x00000FFF)
#define PRFKBIT_KEY UINT32_C(0x00000000)
#define PRFKBIT_JOY UINT32_C(0x00001000)
#define PRFKBIT_MOUSE UINT32_C(0x00002000)
#define PRFKBIT_DMOUSE UINT32_C(0x00003000)
#define PRFKBIT_JOYP UINT32_C(0x00004000)
#define PRFKBIT_MOUSEP UINT32_C(0x00005000)
#define PRFKBIT_DMOUSEP UINT32_C(0x00006000)
#define PRFKBIT_KEYP UINT32_C(0x00007000)
#define PRFKBIT_JOYX UINT32_C(0x00008000)
#define PRFKBIT_MOUSEX UINT32_C(0x00009000)
#define PRFKBIT_DMOUSEX UINT32_C(0x0000A000)
#define PRFKBIT_KEYX UINT32_C(0x0000B000)
/*** STRUCTURES ***/
struct mobj_s;
/* Define D_Prof_t */
#if !defined(__REMOOD_DPROFTDEFINED)
#define __REMOOD_DPROFTDEFINED
typedef struct D_Prof_s D_Prof_t;
#endif
/* D_Prof_t -- Extended Profile */
struct D_Prof_s
{
/* Profile Related */
uint32_t Flags; // Flags for profile controller
char DisplayName[MAXPLAYERNAME]; // Name to show in network games
char AccountName[MAXPLAYERNAME]; // Local account name (selection limited)
uint8_t Color; // Color
uint8_t JoyControl; // Which joystick player controls
char UUID[MAXUUIDLENGTH + 1]; // Player Unique ID
tic_t SlowTurnTime; // Time to slow turn
uint32_t InstanceID; // Instance ID
/* Controls For Player */
uint32_t Ctrls[NUMDPROFILEEXINPUTCTRLS][4]; // Player Controls
D_ProfileExCtrlMA_t MouseAxis[MAXALTAXIS][MAXMOUSEAXIS]; // Mouse Axis Movement
D_ProfileExCtrlMA_t JoyAxis[MAXALTAXIS][MAXJOYAXIS]; // Joy Axis Movement
int32_t MouseSens[2]; // Mouse Sensitivity
int32_t JoySens[2]; // Joystick Sensitivity
int32_t LookUpDownSpeed; // Looking Up/Down Speed
int32_t AutoGrabJoy; // Auto-Grab Joystick
/* Profile Chains */
D_Prof_t* Prev; // Previous link
D_Prof_t* Next; // Next link
/* Other stuff */
uint8_t ColorPickup; // Color for pickups
uint8_t ColorSecret; // Secret Found Color
char SoundSecret[MAXPLAYERNAME]; // Sound to play when Secret Found
bool_t DrawPSprites; // Draw Player Sprites
int8_t BobMode; // Bobbing Mode (Doom, Mid, Effort)
fixed_t ViewHeight; // View Height
fixed_t CamDist, CamHeight, CamSpeed; // Camera Properties
bool_t ChaseCam; // Enable chase camera
bool_t TransSBar; // Transparent Status Bar
bool_t ScaledSBar; // Scaled Status Bar
char HexenClass[MAXPLAYERNAME]; // Hexen Class
bool_t AutoRun; // Autorun
bool_t SlowTurn; // Perform slow turning
bool_t LookSpring; // Spring back to center on move
bool_t JoyAutoRun; // Joystick auto-run
uint8_t ColorLock[4]; // Door Lock Colors
uint8_t VTeam; // Virtual Team
bool_t CounterOp; // CounterOp player
char* AccountRef, *DisplayRef; // References to own name
uint8_t BarType; // Type of status bar
};
/*** GLOBALS ***/
extern D_Prof_t* g_KeyDefaultProfile;
extern D_Prof_t* g_ProfList[MAXPROFCONST];
/*** FUNCTIONS ***/
void D_ProfFixAccountName(char* const a_Buffer);
D_Prof_t* D_ProfFirst(void);
bool_t D_ProfRename(D_Prof_t* a_Prof, const char* const a_NewName);
D_Prof_t* D_CreateProfileEx(const char* const a_Name);
D_Prof_t* D_FindProfileEx(const char* const a_Name);
D_Prof_t* D_FindProfileExByInstance(const uint32_t a_ID);
void D_SaveProfileData(void (*a_WriteBack)(const char* const a_Buf, void* const a_Data), void* const a_Data);
int CLC_Profile(const uint32_t a_ArgC, const char** const a_ArgV);
#endif /* __D_PROF_H__ */