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