aboutsummaryrefslogtreecommitdiff
path: root/src/m_misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/m_misc.h')
-rw-r--r--src/m_misc.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/src/m_misc.h b/src/m_misc.h
new file mode 100644
index 0000000..2e4d545
--- /dev/null
+++ b/src/m_misc.h
@@ -0,0 +1,111 @@
1/* Emacs style mode select -*- C++ -*-
2 *-----------------------------------------------------------------------------
3 *
4 *
5 * PrBoom: a Doom port merged with LxDoom and LSDLDoom
6 * based on BOOM, a modified and improved DOOM engine
7 * Copyright (C) 1999 by
8 * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
9 * Copyright (C) 1999-2000 by
10 * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
11 * Copyright 2005, 2006 by
12 * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 * 02111-1307, USA.
28 *
29 * DESCRIPTION:
30 * External non-system-specific stuff, like storing config settings,
31 * simple file handling, and saving screnshots.
32 *
33 *-----------------------------------------------------------------------------*/
34
35
36#ifndef __M_MISC__
37#define __M_MISC__
38
39
40#include "doomtype.h"
41//
42// MISC
43//
44
45boolean M_WriteFile (char const* name,void* source,int length);
46
47int M_ReadFile (char const* name,byte** buffer);
48
49void M_ScreenShot (void);
50void M_DoScreenShot (const char*); // cph
51
52void M_LoadDefaults (void);
53
54void M_SaveDefaults (void);
55
56struct default_s *M_LookupDefault(const char *name); /* killough 11/98 */
57
58// phares 4/21/98:
59// Moved from m_misc.c so m_menu.c could see it.
60
61// CPhipps - struct to hold a value in a config file
62// Cannot be a union, as it must be initialised
63typedef struct default_s
64{
65 const char* name;
66 /* cph -
67 * The location struct holds the pointer to the variable holding the
68 * setting. For int's we do nothing special.
69 * For strings, the string is actually stored on our heap with Z_Strdup()
70 * BUT we don't want the rest of the program to be able to modify them,
71 * so we declare it const. It's not really const though, and m_misc.c and
72 * m_menu.c cast it back when they need to change it. Possibly this is
73 * more trouble than it's worth.
74 */
75 struct {
76 int* pi;
77 const char** ppsz;
78 } location;
79 struct {
80 int i;
81 const char* psz;
82 } defaultvalue; // CPhipps - default value
83 // Limits (for an int)
84 int minvalue; // jff 3/3/98 minimum allowed value
85 int maxvalue; // jff 3/3/98 maximum allowed value
86 enum {
87 def_none, // Dummy entry
88 def_str, // A string
89 def_int, // Integer
90 def_hex, // Integer (write in hex)
91 def_bool = def_int, // Boolean
92 def_key = def_hex, // Key code (byte)
93 def_mouseb = def_int,// Mouse button
94 def_colour = def_hex // Colour (256 colour palette entry)
95 } type; // CPhipps - type of entry
96 int setupscreen; // phares 4/19/98: setup screen where this appears
97 int *current; /* cph - MBF-like pointer to current value */
98 // cph - removed the help strings from the config file
99 // const char* help; // jff 3/3/98 description of parameter
100 // CPhipps - remove unused "lousy hack" code
101 struct setup_menu_s *setup_menu; /* Xref to setup menu item, if any */
102} default_t;
103
104#define IS_STRING(dv) ((dv).type == def_str)
105// CPhipps - What is the max. key code that X will send us?
106#define MAX_KEY 65536
107#define MAX_MOUSEB 2
108
109#define UL (-123456789) /* magic number for no min or max for parameter */
110
111#endif