ScummVM API documentation
env.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef MADS_CORE_ENV_H
23#define MADS_CORE_ENV_H
24
25#include "common/stream.h"
26#include "mads/core/general.h"
27
28namespace MADS {
29
31public:
32 virtual ~EnvResourceProvider() {}
33
34 virtual Common::SeekableReadStream *open(const char *filename) = 0;
35 virtual bool exists(const char *filename) = 0;
36 virtual bool allowsFallback(const char *) const { return true; }
37 virtual Common::SeekableReadStream *openText(int32, uint16 &) {
38 return nullptr;
39 }
40 virtual int getCursorCount() const { return 0; }
41 virtual bool setCursor(int) { return false; }
42 virtual void updateCursor() {}
43};
44
45#define MADS_ENV "MADS"
46#define MADS_PRIV_ENV "MADSPRIV"
47#define MADS_SOUND_ENV "MADSOUND"
48
49#define MADS_PRIV_ARTIST 0x01
50#define MADS_PRIV_DESIGNER 0x02
51#define MADS_PRIV_PROGRAM 0x04
52#define MADS_PRIV_SYSTEM 0x08
53
54#define ENV_CONFIGNAME "*options.cfg"
55
56#define ENV_SEARCH_MADS_PATH 0
57#define ENV_SEARCH_CONCAT_FILES 1
58
59#define ENV_OBJECTS 16
60#define ENV_INTERFACE 17
61#define ENV_TEXT 18
62#define ENV_QUOTES 19
63#define ENV_FONT 20
64#define ENV_ART 21
65#define ENV_SOUND 22
66#define ENV_CONV 23
67#define ENV_SPEECH 24
68
69
71{
72 int linemode; /* 50/25/0=auto */
73 int compile_final; /* TRUE if compilation is to final set */
74 int compile_debug; /* TRUE for debugging mode */
75 int current_room; /* User's current room */
76 long game_revision; /* Version of game */
77 char game_name[25]; /* Game's working title */
78 int mono_on_right; /* Is monochrome monitor on right? */
79};
80
81
82extern int env_search_mode;
83extern int env_search_cd;
84extern char env_cd_drive;
85extern int env_privileges;
86extern int env_sound_override;
87extern long env_concat_file_size; /* Size of last concat file opened */
88extern char env_null[7];
89
90extern void env_set_resource_provider(EnvResourceProvider *provider);
91extern Common::SeekableReadStream *env_open_text(int32 id, uint16 &unpacked_size);
92extern int env_get_cursor_count();
93extern bool env_set_cursor(int id);
94extern void env_update_cursor();
95
96extern int env_verify();
97extern Common::SeekableReadStream *env_open(const char *file_path, const char *options = "rb");
98extern int env_exist(const char *file_name);
99extern long env_get_file_size(Common::SeekableReadStream *handle);
100extern char *env_get_path(char *madspath, const char *infile);
101extern char *env_catint(char *out, int value, int digits);
102extern char *env_fill_path(char *path, int env_mode, int env_room);
103extern char *env_get_level_path(char *out, int item_type, const char *file_spec,
104 int first_level, int second_level);
105extern Common::SeekableReadStream *env_open_level(int item_type, const char *file_spec,
106 int level_one, int level_two, const char *options);
107extern char *env_get(char *target, const char *env);
108
114extern char *env_next(char *variable);
115
120extern char *env_find_end(char *environment);
121
126extern int env_size(char *environment);
127
128extern int env_free(char *environment);
129
135extern char *env_find(char *environment, const char *variable);
136
141extern void env_delete(char *environment, const char *variable);
142
148extern int env_insert(char *environment, const char *variable, const char *value);
149
150} // namespace MADS
151
152#endif
Definition: stream.h:745
Definition: env.h:30
Definition: env.h:71