126 e.
add(
"Can't load module \"%s\"", module.
c_str());
177 float entryX, entryY, entryZ, entryAngle;
187 CameraMan.setPosition(entryX, entryY, entryZ + 1.8f);
188 CameraMan.setOrientation(90.0f, 0.0f, entryAngle);
199 if (!startMovie.
empty())
205 CameraMan.setPosition(entryX, entryY, entryZ + 1.8f);
206 CameraMan.setOrientation(90.0f, 0.0f, entryAngle);
214 float &x,
float &y,
float &z,
float &angle) {
222 while (!witcherObject && search->
get()) {
243 float &entryX,
float &entryY,
float &entryZ,
float &entryAngle) {
249 float &entryX,
float &entryY,
float &entryZ,
float &entryAngle) {
255 float entryDirX, entryDirY;
306 if (area ==
_areas.end() || !area->second) {
342 if (now < action->timestamp)
347 action->owner, action->triggerer);
380 status(
"Loading areas...");
382 const std::vector<Common::UString> &areas =
_ifo.
getAreas();
383 for (
size_t i = 0; i < areas.size(); i++) {
384 status(
"Loading area \"%s\" (%d / %d)", areas[i].c_str(), (
int)i, (
int)areas.size() - 1);
386 std::pair<AreaMap::iterator, bool> result;
388 result =
_areas.insert(std::make_pair(areas[i], (
Area *) 0));
393 result.first->second =
new Area(*
this, areas[i].c_str());
395 e.
add(
"Can't load area \"%s\"", areas[i].c_str());
441 AreaMap::iterator a =
_areas.find(area);
460 float x, y, z, angle;
469 load(module,
object);
501 for (AreaMap::iterator a =
_areas.begin(); a !=
_areas.end(); ++a)
502 a->second->refreshLocalized();
513 action.
state = state;
514 action.
owner = owner;
void replaceModule()
Actually replace the currently running module.
Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
#define ResMan
Shortcut for accessing the sound manager.
ObjectType getType() const
Return the exact type of the object.
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
bool isSave() const
Is the module a save file?
uint32 findResource(uint64 hash) const
Return the index of the resource matching the hash, or 0xFFFFFFFF if not found.
void playVideo(const Common::UString &video)
Play this video resource.
Generic Aurora engines resource utility functions.
void loadAreas()
Load the areas.
Area * getArea() const
Return the area this object is currently in.
void add(const char *s,...) GCC_PRINTF(2
bool _exit
Should we exit the module?
void addObject(Witcher::Object &object)
Add an object to this container.
An area in The Witcher, holding all objects and area geometry within, as well as general area propert...
virtual void setPosition(float x, float y, float z)
Set the object's position within its area.
Common::UString _entryLocation
The tag of the object in the start location for this module.
Fake value for a module object.
virtual Object * next()=0
Move to the next object in the search context and return the previous one.
Common::ChangeID _resModule
Resources added by the module.
A class holding an UTF-8 string.
const Aurora::LocString & getDescription() const
Return the module's description.
An object within a Witcher area.
The global config manager.
void unload()
Unload a currently loaded IFO.
void addEvent(const Events::Event &event)
Add a single event for consideration into the event queue.
bool operator<(const Action &s) const
void setArea(Area *)
Set the area this object is currently in.
void enterArea()
Enter a new area.
Area * getCurrentArea()
Return the area the PC is currently in.
bool equalsIgnoreCase(const UString &str) const
virtual void hide()
Hide the object's model(s).
A simple streaming file reading class.
bool isLoaded() const
Is a module currently loaded and ready to run?
void readScripts(const Aurora::GFF3Struct &gff)
std::list< UString >::const_iterator const_iterator
const GFF3Struct & getTopLevel() const
Returns the top-level struct.
void getEntryDirection(float &x, float &y) const
Return the entry direction.
void unloadPC()
Unload the PC.
const Common::UString & getResRef() const
Return the area's resref (resource ID).
void loadModule(const Common::UString &module, const Common::UString &entryLocation)
Load the actual module.
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
const Common::UString & getString(Language language, LanguageGender gender=kLanguageGenderCurrent) const
Get the string of that language.
void processEventQueue()
Process the current event queue.
Exception that provides a stack of explanations.
bool _running
Are we currently running a module?
A simple scoped smart pointer template.
void hide()
Hide the area.
void deindexResources(Common::ChangeID &changeID)
Remove previously added resources from the ResourceManager.
bool isRunning() const
Is a module currently running?
Aurora::IFOFile _ifo
The module's IFO.
bool runScript(Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
void processEventQueue()
Process the current event queue.
Aurora::NWScript::ObjectReference triggerer
Basic exceptions to throw.
void removeObject(Witcher::Object &object)
Remove an object from this container.
void load(Common::SeekableReadStream *stream, bool repairNWNPremium=false)
Take over this stream and load an IFO out of it.
A creature in a The Witcher area.
void indexMandatoryArchive(const Common::UString &file, uint32 priority, const std::vector< byte > &password, Common::ChangeID *changeID)
const char * c_str() const
Return the (utf8 encoded) string data.
Common::UString _newArea
The new area to enter.
void unload()
Unload the whole shebang.
#define ConfigMan
Shortcut for accessing the config manager.
Common::SeekableReadStream * getResource(uint32 index, bool tryNoCopy=false) const
Return a stream of the resource's contents.
Utility templates and functions.
An IFO (module information) file, describing global module properties in many Aurora games...
virtual void show()
Show the object's model(s).
void show()
Show the area.
The global events manager.
AreaMap _areas
The areas in the current module.
const Aurora::IFOFile & getIFO() const
Return the IFO of the currently loaded module.
A GFF (generic file format) V3.2/V3.3 file, found in all Aurora games except Sonic Chronicles: The Da...
void unloadAreas()
Unload the areas.
const Aurora::LocString & getName() const
Return the object's name.
Handling BioWare's ERFs (encapsulated resource file).
Aurora::NWScript::ObjectReference owner
const std::vector< Common::UString > & getAreas() const
Return the list of areas in the module.
bool getEntryObjectLocation(Common::UString &area, float &entryX, float &entryY, float &entryZ, float &entryAngle)
ObjectSearch * findObjectsByTag(const Common::UString &tag) const
Return a search context to iterate over all objects with this tag.
bool getObjectLocation(const Common::UString &object, Common::UString &area, float &x, float &y, float &z, float &angle)
bool empty() const
Is the string empty?
Generic Aurora engines (debug) console.
Module(::Engines::Console &console)
Area * _currentArea
The current area.
void refreshLocalized()
Refresh all localized strings.
A scoped plain pointer, allowing pointer-y access and normal deletion.
Aurora::NWScript::ScriptState state
void leave()
Leave the running module, quitting it.
void warning(const char *s,...)
void unloadModule()
Unload the module.
#define EventMan
Shortcut for accessing the events manager.
void getEntryIFOLocation(Common::UString &area, float &entryX, float &entryY, float &entryZ, float &entryAngle)
Common::UString _newModule
The module we should change to.
Implementing the stream reading interfaces for files.
void movedPC()
Notify the module that the PC was moved.
virtual void enter()
The cursor entered the object.
virtual void setOrientation(float x, float y, float z, float angle)
Set the object's orientation.
void changeModule(const Common::UString &module, const Common::UString &entryLocation)
Schedule a change to a new module.
::Engines::Console * _console
bool _hasModule
Do we have a module?
ActionQueue _delayedActions
Class to hold resource data of an ERF archive file.
const GFF3Struct * getGFF() const
Return the IFO's GFF struct.
static UString relativize(const UString &basePath, const UString &path)
Return the path relative to the base path.
const Aurora::LocString & getName() const
Return the module's name.
void load(const Common::UString &module, const Common::UString &entryLocation="")
Load a module.
The context needed to run a The Witcher module.
const LocString & getName() const
Return the name of the module.
The context holding a The Witcher area.
void status(const char *s,...)
void printf(const char *s,...) GCC_PRINTF(2
void clear()
Clear the whole context.
void addEvent(const Events::Event &event)
Add a single event for consideration into the area event queue.
#define CameraMan
Shortcut for accessing the camera manager.
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
static float rad2deg(float rad)
Aurora::LocString _name
The object's name.
Generic Aurora engines utility functions.
void delayScript(const Common::UString &script, const Aurora::NWScript::ScriptState &state, Aurora::NWScript::Object *owner, Aurora::NWScript::Object *triggerer, uint32 delay)
const Aurora::LocString & getName() const
Return the area's name.
const Common::UString & getTag() const
Return the module's tag.
virtual void loadModel()
Load the object's model(s).
void getEntryPosition(float &x, float &y, float &z) const
Return the entry position.
const Common::UString & getEntryArea() const
Return the entry area.
virtual Object * get()=0
Return the current object in the search context.
void clear()
Clear the string's contents.
static UString getFile(const UString &p)
Return a file name without its path.
const Common::UString & getStartMovie() const
Return the starting movie.
Creature * getPC()
Return the currently playing PC.
static Common::UString findModule(const Common::UString &module, bool relative)
The global resource manager for Aurora resources.
Utility class for manipulating file paths.
static Witcher::Object * toObject(::Aurora::NWScript::Object *object)
Creature * _pc
The player character we use.
Common::UString _module
The current module's name.
void movePC(const Common::UString &area)
Move the player character to this area.
const Aurora::LocString & getDescription() const
Return the object's description.