Prepare new maemo release
[maemo-rb.git] / apps / plugins / doom / m_misc.h
blob3ea6af987f13108e67983e65ee3925d9ff9b6f33
1 /* Emacs style mode select -*- C++ -*-
2 *-----------------------------------------------------------------------------
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
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.
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.
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.
27 * DESCRIPTION:
28 * External non-system-specific stuff, like storing config settings,
29 * simple file handling, and saving screnshots.
31 *-----------------------------------------------------------------------------*/
34 #ifndef __M_MISC__
35 #define __M_MISC__
38 #include "doomtype.h"
40 // MISC
43 boolean M_WriteFile (char const* name,void* source,int length);
45 int M_ReadFile (char const* name,byte** buffer);
47 void M_ScreenShot (void);
48 void M_DoScreenShot (const char*); // cph
50 void M_LoadDefaults (void);
52 void M_SaveDefaults (void);
55 int M_DrawText (int x,int y,boolean direct,char* string);
57 struct default_s *M_LookupDefault(const char *name); /* killough 11/98 */
59 // phares 4/21/98:
60 // Moved from m_misc.c so m_menu.c could see it.
62 // CPhipps - struct to hold a value in a config file
63 // Cannot be a union, as it must be initialised
64 enum {
65 def_none, // Dummy entry
66 def_str, // A string
67 def_int, // Integer
68 def_hex, // Integer (write in hex)
69 def_bool = def_int, // Boolean
70 def_key = def_hex, // Key code (byte)
71 def_mouseb = def_int,// Mouse button
72 def_colour = def_hex // Colour (256 colour palette entry)
73 }; /* type */
75 typedef struct default_s
77 const char* name;
78 /* cph -
79 * The location struct holds the pointer to the variable holding the
80 * setting. For int's we do nothing special.
81 * For strings, the string is actually stored on our heap with Z_Strdup()
82 * BUT we don't want the rest of the program to be able to modify them,
83 * so we declare it const. It's not really const though, and m_misc.c and
84 * m_menu.c cast it back when they need to change it. Possibly this is
85 * more trouble than it's worth.
87 struct {
88 int* pi;
89 const char** ppsz;
90 } location;
91 struct {
92 int i;
93 const char* psz;
94 } defaultvalue; // CPhipps - default value
95 // Limits (for an int)
96 int minvalue; // jff 3/3/98 minimum allowed value
97 int maxvalue; // jff 3/3/98 maximum allowed value
98 unsigned type; // CPhipps - type of entry
99 int setupscreen; // phares 4/19/98: setup screen where this appears
100 int *current; /* cph - MBF-like pointer to current value */
101 // cph - removed the help strings from the config file
102 // const char* help; // jff 3/3/98 description of parameter
103 // CPhipps - remove unused "lousy hack" code
104 struct setup_menu_s *setup_menu; /* Xref to setup menu item, if any */
105 } default_t;
107 #define IS_STRING(dv) ((dv).type == def_str)
108 // CPhipps - What is the max. key code that X will send us?
109 #define MAX_KEY 65536
110 #define MAX_MOUSEB 2
112 #define UL (-123456789) /* magic number for no min or max for parameter */
114 #endif