55 if (
ConfigMan.getBool(
"skipvideos",
false)) {
82 bool loop,
float volume,
bool pitchVariance) {
94 channel =
SoundMan.playSoundFile(soundStream, soundType, loop);
99 SoundMan.setChannelGain(channel, volume);
102 const float pitch = 1.0f + ((((std::rand() % 1001) / 1000.0f) / 5.0f) - 0.1f);
104 SoundMan.setChannelPitch(channel, pitch);
117 const int def =
ConfigMan.getDefaultInt(key);
119 const int value =
ConfigMan.getInt(key, def);
120 if ((value >= min) && (value <= max))
123 warning(
"Config \"%s\" has invalid value (%d), resetting to default (%d)", key.
c_str(), value, def);
128 const double def =
ConfigMan.getDefaultDouble(key);
130 const double value =
ConfigMan.getDouble(key, def);
131 if ((value >= min) && (value <= max))
134 warning(
"Config \"%s\" has invalid value (%lf), resetting to default (%lf)", key.
c_str(), value, def);
139 while ((ms > 0) && !
EventMan.quitRequested()) {
140 uint32 delay = MIN<uint32>(ms, 10);
151 uint32 id,
bool repairNWNPremium) {
175 ResMan.dumpResourcesList(name);
186 if (!file.
open(fileName))
189 const size_t pos = stream.
pos();
225 return image->dumpTGA(file.
empty() ? (name +
".tga") : file);
Class to hold the two-dimensional array of a 2DA file.
Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
#define ResMan
Shortcut for accessing the sound manager.
Table data, 2-dimensional text array.
Generic image decoder interface.
void playVideo(const Common::UString &video)
Play this video resource.
#define TypeMan
Shortcut for accessing the file type manager.
void debugC(Common::DebugChannel channel, uint32 level, const char *s,...)
A class holding an UTF-8 string.
virtual size_t seek(ptrdiff_t offset, Origin whence=kOriginBegin)=0
Sets the stream position indicator for the stream.
Utility functions for debug output.
The global config manager.
bool dumpResList(const Common::UString &name)
Debug method to quickly dump the current list of resource to disk.
Aurora::GFF4File * loadOptionalGFF4(const Common::UString &gff4, Aurora::FileType fileType, uint32 type)
Load a GFF4, but return 0 instead of throwing on error.
Utility functions to handle files used in BioWare's Aurora engine.
bool dumpStream(Common::SeekableReadStream &stream, const Common::UString &fileName)
Debug method to quickly dump a stream to disk.
bool dumpResource(const Common::UString &name, Aurora::FileType type, const Common::UString &file)
Debug method to quickly dump a resource to disk.
A GFF (generic file format) V4.0/V4.1 file, found in Dragon Age: Origins, Dragon Age 2 and Sonic Chro...
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.
bool longDelay(uint32 ms)
Wait for a "long" amount of time, returning prematurely with true in the case of a requested quit...
A simple scoped smart pointer template.
void exceptionDispatcherWarning(const char *s,...)
Exception dispatcher that prints the exception as a warning, and adds another reason on top...
Handling version V4.0/V4.1 of BioWare's GFFs (generic file format).
Basic exceptions to throw.
const char * c_str() const
Return the (utf8 encoded) string data.
bool open(const UString &fileName)
Try to open the file with the given fileName.
#define ConfigMan
Shortcut for accessing the config manager.
static ImageDecoder * loadImage(const Common::UString &name, bool deswizzle=false)
Load an image in any of the common texture formats.
bool dumpTGA(const Common::UString &name, const Common::UString &file)
Debug method to quickly dump an image resource to disk.
Handling BioWare's 2DAs (two-dimensional array).
The global events manager.
A GFF (generic file format) V3.2/V3.3 file, found in all Aurora games except Sonic Chronicles: The Da...
void writeASCII(Common::WriteStream &out) const
Write the 2DA data into an V2.0 ASCII 2DA.
The global sound manager, handling all sound output.
bool empty() const
Is the string empty?
#define SoundMan
Shortcut for accessing the sound manager.
bool dump2DA(const Common::UString &name, const Common::UString &file)
Debug method to quickly dump a 2DA to disk.
void warning(const char *s,...)
Basic reading stream interfaces.
virtual size_t pos() const =0
Obtains the current value of the stream position indicator of the stream.
#define EventMan
Shortcut for accessing the events manager.
void flush()
Commit any buffered data to the underlying channel or storage medium; unbuffered streams can use the ...
Sound::ChannelHandle playSound(const Common::UString &sound, Sound::SoundType soundType, bool loop, float volume, bool pitchVariance)
Play this sound resource.
void close()
Close the file, if open.
A texture as used in the Aurora engines.
A handle to a sound channel.
SoundType
The type of a sound.
size_t writeStream(ReadStream &stream, size_t n)
Copy n bytes of the given stream into the stream.
FileType
Various file types used by the Aurora engine and found in archives.
void checkConfigInt(const Common::UString &key, int min, int max)
Make sure that an int config value is in the right range.
Implementing the stream writing interfaces for files.
Generic Aurora engines utility functions.
A simple streaming file writing class.
void checkConfigDouble(const Common::UString &key, double min, double max)
Make sure that a double config value is in the right range.
Interface for a seekable & readable data stream.
The global resource manager for Aurora resources.