xoreos  0.0.5
util.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_AURORA_UTIL_H
26 #define ENGINES_AURORA_UTIL_H
27 
28 #include "src/common/ustring.h"
29 
30 #include "src/aurora/types.h"
31 
32 #include "src/sound/types.h"
33 
34 namespace Common {
35  class SeekableReadStream;
36 }
37 
38 namespace Aurora {
39  class GFF3File;
40 }
41 
42 namespace Engines {
43 
45 void playVideo(const Common::UString &video);
46 
49  bool loop = false, float volume = 1.0f, bool pitchVariance = false);
50 
52 void checkConfigInt (const Common::UString &key, int min, int max);
54 void checkConfigDouble(const Common::UString &key, double min, double max);
55 
57 bool longDelay(uint32 ms);
58 
61  uint32 id = 0xFFFFFFFF, bool repairNWNPremium = false);
62 
65  uint32 type = 0xFFFFFFFF);
66 
68 bool dumpResList(const Common::UString &name);
69 
71 bool dumpStream(Common::SeekableReadStream &stream, const Common::UString &fileName);
73 bool dumpResource(const Common::UString &name, Aurora::FileType type, const Common::UString &file = "");
75 bool dumpResource(const Common::UString &name, const Common::UString &file = "");
76 
78 bool dumpTGA(const Common::UString &name, const Common::UString &file = "");
79 
81 bool dump2DA(const Common::UString &name, const Common::UString &file = "");
82 
83 } // End of namespace Engines
84 
85 #endif // ENGINES_AURORA_UTIL_H
void playVideo(const Common::UString &video)
Play this video resource.
Definition: util.cpp:54
Definition: 2dafile.h:39
A class holding an UTF-8 string.
Definition: ustring.h:48
bool dumpResList(const Common::UString &name)
Debug method to quickly dump the current list of resource to disk.
Definition: util.cpp:172
Aurora::GFF4File * loadOptionalGFF4(const Common::UString &gff4, Aurora::FileType fileType, uint32 type)
Load a GFF4, but return 0 instead of throwing on error.
Definition: util.cpp:161
Basic sound types.
bool dumpStream(Common::SeekableReadStream &stream, const Common::UString &fileName)
Debug method to quickly dump a stream to disk.
Definition: util.cpp:184
bool dumpResource(const Common::UString &name, Aurora::FileType type, const Common::UString &file)
Debug method to quickly dump a resource to disk.
Definition: util.cpp:207
A GFF (generic file format) V4.0/V4.1 file, found in Dragon Age: Origins, Dragon Age 2 and Sonic Chro...
Definition: gff4file.h:93
Aurora::GFF3File * loadOptionalGFF3(const Common::UString &gff3, Aurora::FileType type, uint32 id, bool repairNWNPremium)
Load a GFF3, but return 0 instead of throwing on error.
Definition: util.cpp:150
bool longDelay(uint32 ms)
Wait for a "long" amount of time, returning prematurely with true in the case of a requested quit...
Definition: util.cpp:138
bool dumpTGA(const Common::UString &name, const Common::UString &file)
Debug method to quickly dump an image resource to disk.
Definition: util.cpp:221
A GFF (generic file format) V3.2/V3.3 file, found in all Aurora games except Sonic Chronicles: The Da...
Definition: gff3file.h:85
bool dump2DA(const Common::UString &name, const Common::UString &file)
Debug method to quickly dump a 2DA to disk.
Definition: util.cpp:232
Sound::ChannelHandle playSound(const Common::UString &sound, Sound::SoundType soundType, bool loop, float volume, bool pitchVariance)
Play this sound resource.
Definition: util.cpp:81
Unicode string handling.
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
A handle to a sound channel.
Definition: types.h:35
SoundType
The type of a sound.
Definition: types.h:43
uint32_t uint32
Definition: types.h:204
FileType
Various file types used by the Aurora engine and found in archives.
Definition: types.h:56
void checkConfigInt(const Common::UString &key, int min, int max)
Make sure that an int config value is in the right range.
Definition: util.cpp:116
void checkConfigDouble(const Common::UString &key, double min, double max)
Make sure that a double config value is in the right range.
Definition: util.cpp:127
Interface for a seekable & readable data stream.
Definition: readstream.h:265