xoreos  0.0.5
module.cpp
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 #include "src/common/scopedptr.h"
26 #include "src/common/util.h"
27 #include "src/common/maths.h"
28 #include "src/common/error.h"
29 #include "src/common/configman.h"
30 #include "src/common/readfile.h"
31 #include "src/common/filepath.h"
32 #include "src/common/filelist.h"
33 
34 #include "src/aurora/resman.h"
35 #include "src/aurora/erffile.h"
36 #include "src/aurora/gff3file.h"
37 
38 #include "src/graphics/camera.h"
39 
40 #include "src/events/events.h"
41 
45 
49 
50 namespace Engines {
51 
52 namespace Witcher {
53 
54 bool Module::Action::operator<(const Action &s) const {
55  return timestamp < s.timestamp;
56 }
57 
58 
60  _hasModule(false), _running(false), _exit(false), _pc(0), _currentArea(0) {
61 
62 }
63 
65  try {
66  clear();
67  } catch (...) {
68  }
69 }
70 
71 void Module::clear() {
72  unload();
73 }
74 
76  return _currentArea;
77 }
78 
80  return _pc;
81 }
82 
83 bool Module::isLoaded() const {
84  return _hasModule;
85 }
86 
87 bool Module::isRunning() const {
88  return !EventMan.quitRequested() && _running && !_exit && !_newArea.empty();
89 }
90 
91 void Module::load(const Common::UString &module, const Common::UString &entryLocation) {
92  if (isRunning()) {
93  // We are currently running a module. Schedule a safe change instead
94 
95  changeModule(module, entryLocation);
96  return;
97  }
98 
99  // We are not currently running a module. Directly load the new module
100  loadModule(module, entryLocation);
101 }
102 
103 void Module::loadModule(const Common::UString &module, const Common::UString &entryLocation) {
104  unload();
105 
106  if (module.empty())
107  throw Common::Exception("Tried to load an empty module");
108 
109  _module = module;
110  _entryLocation = entryLocation;
111 
112  try {
113  indexMandatoryArchive(module, 1001, &_resModule);
114 
115  _ifo.load();
116 
117  if (_ifo.isSave())
118  throw Common::Exception("This is a save");
119 
120  _tag = _ifo.getTag();
121  _name = _ifo.getName();
122 
123  readScripts(*_ifo.getGFF());
124 
125  } catch (Common::Exception &e) {
126  e.add("Can't load module \"%s\"", module.c_str());
127  throw e;
128  }
129 
130  _newModule.clear();
131 
132  _hasModule = true;
133 }
134 
135 void Module::changeModule(const Common::UString &module, const Common::UString &entryLocation) {
136  _newModule = module;
137  _entryLocation = entryLocation;
138 }
139 
141  if (_newModule.empty())
142  return;
143 
144  _console->hide();
145 
146  assert(_pc);
147 
148  const Common::UString newModule = _newModule;
149  const Common::UString entryLocation = _entryLocation;
150 
151  Creature *pc = _pc;
152 
153  unload();
154 
155  _exit = true;
156 
157  loadModule(newModule, entryLocation);
158  enter(*pc);
159 }
160 
162  if (!isLoaded())
163  throw Common::Exception("Module::enter(): Lacking a module?!?");
164 
165  try {
166 
167  loadAreas();
168 
169  } catch (Common::Exception &e) {
170  e.add("Can't initialize module \"%s\"", _name.getString().c_str());
171  throw e;
172  }
173 
174  _pc = &pc;
175  addObject(*_pc);
176 
177  float entryX, entryY, entryZ, entryAngle;
178  if (!getEntryObjectLocation(_newArea, entryX, entryY, entryZ, entryAngle))
179  getEntryIFOLocation(_newArea, entryX, entryY, entryZ, entryAngle);
180 
181  _pc->setPosition(entryX, entryY, entryZ);
182  _pc->setOrientation(0.0f, 0.0f, 1.0f, entryAngle);
183 
184  _pc->loadModel();
185 
186  // Roughly head position
187  CameraMan.setPosition(entryX, entryY, entryZ + 1.8f);
188  CameraMan.setOrientation(90.0f, 0.0f, entryAngle);
189  CameraMan.update();
190 
191  _console->printf("Entering module \"%s\" with character \"%s\"",
193 
196  runScript(kScriptEnter , this, _pc);
197 
198  Common::UString startMovie = _ifo.getStartMovie();
199  if (!startMovie.empty())
200  playVideo(startMovie);
201 
202  CameraMan.reset();
203 
204  // Roughly head position
205  CameraMan.setPosition(entryX, entryY, entryZ + 1.8f);
206  CameraMan.setOrientation(90.0f, 0.0f, entryAngle);
207  CameraMan.update();
208 
209  _running = true;
210  _exit = false;
211 }
212 
214  float &x, float &y, float &z, float &angle) {
215 
216  if (object.empty())
217  return false;
218 
220 
221  Witcher::Object *witcherObject = 0;
222  while (!witcherObject && search->get()) {
223  witcherObject = Witcher::ObjectContainer::toObject(search->next());
224  if (!witcherObject || (witcherObject->getType() != kObjectTypeWaypoint))
225  witcherObject = 0;
226  }
227 
228  if (!witcherObject)
229  return false;
230 
231  // TODO: Entry orientation
232 
233  if (witcherObject->getArea())
234  area = witcherObject->getArea()->getResRef();
235 
236  witcherObject->getPosition(x, y, z);
237  angle = 0.0f;
238 
239  return true;
240 }
241 
243  float &entryX, float &entryY, float &entryZ, float &entryAngle) {
244 
245  return getObjectLocation(_entryLocation, entryArea, entryX, entryY, entryZ, entryAngle);
246 }
247 
249  float &entryX, float &entryY, float &entryZ, float &entryAngle) {
250 
251  entryArea = _ifo.getEntryArea();
252 
253  _ifo.getEntryPosition(entryX, entryY, entryZ);
254 
255  float entryDirX, entryDirY;
256  _ifo.getEntryDirection(entryDirX, entryDirY);
257 
258  entryAngle = -Common::rad2deg(atan2(entryDirX, entryDirY));
259 }
260 
262  runScript(kScriptExit, this, _pc);
263 
264  _running = false;
265  _exit = true;
266 }
267 
268 void Module::addEvent(const Events::Event &event) {
269  _eventQueue.push_back(event);
270 }
271 
273  if (!isRunning())
274  return;
275 
276  replaceModule();
277  enterArea();
278 
279  if (!isRunning())
280  return;
281 
282  handleEvents();
283 }
284 
287  return;
288 
289  if (_currentArea) {
291  _pc->setArea(0);
292 
293  _pc->hide();
294 
295  _currentArea->hide();
296 
297  _currentArea = 0;
298  }
299 
300  if (_newArea.empty()) {
301  _exit = true;
302  return;
303  }
304 
305  AreaMap::iterator area = _areas.find(_newArea);
306  if (area == _areas.end() || !area->second) {
307  warning("Failed entering area \"%s\": No such area", _newArea.c_str());
308  _exit = true;
309  return;
310  }
311 
312  _currentArea = area->second;
313 
314  _currentArea->show();
315  _pc->show();
316 
318 
320 
321  EventMan.flushEvents();
322 
323  _console->printf("Entering area \"%s\" (\"%s\")", _currentArea->getResRef().c_str(),
325 }
326 
328  for (EventQueue::const_iterator event = _eventQueue.begin(); event != _eventQueue.end(); ++event)
329  _currentArea->addEvent(*event);
330 
331  _eventQueue.clear();
332 
334 }
335 
337  uint32 now = EventMan.getTimestamp();
338 
339  while (!_delayedActions.empty()) {
340  ActionQueue::iterator action = _delayedActions.begin();
341 
342  if (now < action->timestamp)
343  break;
344 
345  if (action->type == kActionScript)
346  ScriptContainer::runScript(action->script, action->state,
347  action->owner, action->triggerer);
348 
349  _delayedActions.erase(action);
350  }
351 }
352 
354  unloadPC();
355  unloadAreas();
356  unloadModule();
357 }
358 
360  _tag.clear();
361 
362  _ifo.unload();
363 
365 
366  _module.clear();
367  _newModule.clear();
368 
370 
371  _eventQueue.clear();
372  _delayedActions.clear();
373 
374  _hasModule = false;
375  _running = false;
376  _exit = true;
377 }
378 
380  status("Loading areas...");
381 
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);
385 
386  std::pair<AreaMap::iterator, bool> result;
387 
388  result = _areas.insert(std::make_pair(areas[i], (Area *) 0));
389  if (!result.second)
390  throw Common::Exception("Area tag collision: \"%s\"", areas[i].c_str());
391 
392  try {
393  result.first->second = new Area(*this, areas[i].c_str());
394  } catch (Common::Exception &e) {
395  e.add("Can't load area \"%s\"", areas[i].c_str());
396  throw;
397  }
398  }
399 }
400 
402  _areas.clear();
403  _newArea.clear();
404 
405  _currentArea = 0;
406 }
407 
409  if (!_pc)
410  return;
411 
412  removeObject(*_pc);
413 
414  _pc->hide();
415  _pc = 0;
416 }
417 
418 void Module::movePC(const Common::UString &area) {
419  if (!_pc)
420  return;
421 
422  float x, y, z;
423  _pc->getPosition(x, y, z);
424 
425  movePC(area, x, y, z);
426 }
427 
428 void Module::movePC(float x, float y, float z) {
429  if (!_pc)
430  return;
431 
432  movePC(_currentArea, x, y, z);
433 }
434 
435 void Module::movePC(const Common::UString &area, float x, float y, float z) {
436  if (!_pc)
437  return;
438 
439  Area *pcArea = 0;
440 
441  AreaMap::iterator a = _areas.find(area);
442  if (a != _areas.end())
443  pcArea = a->second;
444 
445  movePC(pcArea, x, y, z);
446 }
447 
448 void Module::movePC(Area *area, float x, float y, float z) {
449  if (!_pc)
450  return;
451 
452  _pc->setArea(area);
453  _pc->setPosition(x, y, z);
454 
455  movedPC();
456 }
457 
458 void Module::movePC(const Common::UString &module, const Common::UString &object) {
459  if (module.empty() || (module == _module)) {
460  float x, y, z, angle;
461  Common::UString area;
462 
463  if (getObjectLocation(object, area, x, y, z, angle))
464  movePC(area, x, y, z);
465 
466  return;
467  }
468 
469  load(module, object);
470 }
471 
473  if (!_pc)
474  return;
475 
476  float x, y, z;
477  _pc->getPosition(x, y, z);
478 
479  // Roughly head position
480  CameraMan.setPosition(x, y, z + 1.8f);
481  CameraMan.update();
482 
483  _newArea.clear();
484  if (_pc->getArea())
485  _newArea = _pc->getArea()->getResRef();
486 }
487 
489  return _ifo;
490 }
491 
493  return Witcher::Object::getName();
494 }
495 
498 }
499 
501  for (AreaMap::iterator a = _areas.begin(); a != _areas.end(); ++a)
502  a->second->refreshLocalized();
503 }
504 
506  const Aurora::NWScript::ScriptState &state,
508  Aurora::NWScript::Object *triggerer, uint32 delay) {
509  Action action;
510 
511  action.type = kActionScript;
512  action.script = script;
513  action.state = state;
514  action.owner = owner;
515  action.triggerer = triggerer;
516  action.timestamp = EventMan.getTimestamp() + delay;
517 
518  _delayedActions.insert(action);
519 }
520 
522  try {
523  const Aurora::ERFFile mod(new Common::ReadFile(findModule(module, false)));
524  const uint32 ifoIndex = mod.findResource("module", Aurora::kFileTypeIFO);
525 
526  const Aurora::GFF3File ifo(mod.getResource(ifoIndex), MKTAG('I', 'F', 'O', ' '));
527 
528  return ifo.getTopLevel().getString("Mod_Name");
529 
530  } catch (...) {
531  }
532 
533  return "";
534 }
535 
537  try {
538  const Aurora::ERFFile mod(new Common::ReadFile(findModule(module, false)));
539  const uint32 ifoIndex = mod.findResource("module", Aurora::kFileTypeIFO);
540 
541  const Aurora::GFF3File ifo(mod.getResource(ifoIndex), MKTAG('I', 'F', 'O', ' '));
542 
543  return ifo.getTopLevel().getString("Mod_Description");
544 
545  } catch (...) {
546  }
547 
548  return "";
549 }
550 
551 Common::UString Module::findModule(const Common::UString &module, bool relative) {
552  const Common::FileList modFiles(ConfigMan.getString("WITCHER_moduleDir"), -1);
553 
554  for (Common::FileList::const_iterator m = modFiles.begin(); m != modFiles.end(); ++m) {
555  if (!Common::FilePath::getFile(*m).equalsIgnoreCase(module + ".mod") &&
556  !Common::FilePath::getFile(*m).equalsIgnoreCase(module + ".adv"))
557  continue;
558 
559  if (!relative)
560  return *m;
561 
562  return Common::FilePath::relativize(ResMan.getDataBase(), *m);
563  }
564 
565  return "";
566 }
567 
568 } // End of namespace Witcher
569 
570 } // End of namespace Engines
void replaceModule()
Actually replace the currently running module.
Definition: module.cpp:140
Handling version V3.2/V3.3 of BioWare&#39;s GFFs (generic file format).
#define ResMan
Shortcut for accessing the sound manager.
Definition: resman.h:557
ObjectType getType() const
Return the exact type of the object.
Definition: object.cpp:61
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like &#39;DATA&#39;, to ensure portability.
Definition: endianness.h:140
bool isSave() const
Is the module a save file?
Definition: ifofile.cpp:259
uint32 findResource(uint64 hash) const
Return the index of the resource matching the hash, or 0xFFFFFFFF if not found.
Definition: archive.cpp:48
void playVideo(const Common::UString &video)
Play this video resource.
Definition: util.cpp:54
Generic Aurora engines resource utility functions.
void loadAreas()
Load the areas.
Definition: module.cpp:379
Area * getArea() const
Return the area this object is currently in.
Definition: object.cpp:112
void add(const char *s,...) GCC_PRINTF(2
Definition: error.cpp:58
bool _exit
Should we exit the module?
Definition: module.h:165
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...
Definition: area.h:63
virtual void setPosition(float x, float y, float z)
Set the object&#39;s position within its area.
Definition: object.cpp:146
Common::UString _entryLocation
The tag of the object in the start location for this module.
Definition: module.h:183
Fake value for a module object.
Definition: types.h:53
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.
Definition: module.h:168
A class holding an UTF-8 string.
Definition: ustring.h:48
const Aurora::LocString & getDescription() const
Return the module&#39;s description.
Definition: module.cpp:496
An object within a Witcher area.
Definition: object.h:51
A localized string.
Definition: locstring.h:43
The global config manager.
void unload()
Unload a currently loaded IFO.
Definition: ifofile.cpp:97
void addEvent(const Events::Event &event)
Add a single event for consideration into the event queue.
Definition: module.cpp:268
bool operator<(const Action &s) const
Definition: module.cpp:54
void setArea(Area *)
Set the area this object is currently in.
Definition: object.cpp:116
void enterArea()
Enter a new area.
Definition: module.cpp:285
Mathematical helpers.
Camera management.
Area * getCurrentArea()
Return the area the PC is currently in.
Definition: module.cpp:75
bool equalsIgnoreCase(const UString &str) const
Definition: ustring.cpp:218
virtual void hide()
Hide the object&#39;s model(s).
Definition: object.cpp:74
A simple streaming file reading class.
Definition: readfile.h:40
bool isLoaded() const
Is a module currently loaded and ready to run?
Definition: module.cpp:83
void readScripts(const Aurora::GFF3Struct &gff)
Definition: container.cpp:129
std::list< UString >::const_iterator const_iterator
Definition: filelist.h:37
const GFF3Struct & getTopLevel() const
Returns the top-level struct.
Definition: gff3file.cpp:91
void getEntryDirection(float &x, float &y) const
Return the entry direction.
Definition: ifofile.cpp:302
void unloadPC()
Unload the PC.
Definition: module.cpp:408
const Common::UString & getResRef() const
Return the area&#39;s resref (resource ID).
Definition: area.cpp:111
void loadModule(const Common::UString &module, const Common::UString &entryLocation)
Load the actual module.
Definition: module.cpp:103
virtual void getPosition(float &x, float &y, float &z) const
Return the object&#39;s position within its area.
Definition: object.cpp:132
const Common::UString & getString(Language language, LanguageGender gender=kLanguageGenderCurrent) const
Get the string of that language.
Definition: locstring.cpp:82
void processEventQueue()
Process the current event queue.
Definition: module.cpp:272
Exception that provides a stack of explanations.
Definition: error.h:36
bool _running
Are we currently running a module?
Definition: module.h:164
A simple scoped smart pointer template.
void hide()
Hide the area.
Definition: area.cpp:191
SDL_Event Event
Definition: types.h:42
void deindexResources(Common::ChangeID &changeID)
Remove previously added resources from the ResourceManager.
Definition: resources.cpp:164
bool isRunning() const
Is a module currently running?
Definition: module.cpp:87
Aurora::IFOFile _ifo
The module&#39;s IFO.
Definition: module.h:170
bool runScript(Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
Definition: container.cpp:145
void processEventQueue()
Process the current event queue.
Definition: area.cpp:335
Aurora::NWScript::ObjectReference triggerer
Definition: module.h:148
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.
Definition: ifofile.cpp:101
A creature in a The Witcher area.
void indexMandatoryArchive(const Common::UString &file, uint32 priority, const std::vector< byte > &password, Common::ChangeID *changeID)
Definition: resources.cpp:36
const char * c_str() const
Return the (utf8 encoded) string data.
Definition: ustring.cpp:249
Common::UString _newArea
The new area to enter.
Definition: module.h:176
void unload()
Unload the whole shebang.
Definition: module.cpp:353
#define ConfigMan
Shortcut for accessing the config manager.
Definition: configman.h:176
Common::SeekableReadStream * getResource(uint32 index, bool tryNoCopy=false) const
Return a stream of the resource&#39;s contents.
Definition: erffile.cpp:712
Utility templates and functions.
An IFO (module information) file, describing global module properties in many Aurora games...
Definition: ifofile.h:69
virtual void show()
Show the object&#39;s model(s).
Definition: object.cpp:71
void show()
Show the area.
Definition: area.cpp:168
void clear()
Definition: ptrmap.h:48
The global events manager.
AreaMap _areas
The areas in the current module.
Definition: module.h:175
const Aurora::IFOFile & getIFO() const
Return the IFO of the currently loaded module.
Definition: module.cpp:488
A GFF (generic file format) V3.2/V3.3 file, found in all Aurora games except Sonic Chronicles: The Da...
Definition: gff3file.h:85
void unloadAreas()
Unload the areas.
Definition: module.cpp:401
const Aurora::LocString & getName() const
Return the object&#39;s name.
Definition: object.cpp:81
Handling BioWare&#39;s ERFs (encapsulated resource file).
Aurora::NWScript::ObjectReference owner
Definition: module.h:147
const std::vector< Common::UString > & getAreas() const
Return the list of areas in the module.
Definition: ifofile.cpp:311
bool getEntryObjectLocation(Common::UString &area, float &entryX, float &entryY, float &entryZ, float &entryAngle)
Definition: module.cpp:242
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)
Definition: module.cpp:213
bool empty() const
Is the string empty?
Definition: ustring.cpp:245
Generic Aurora engines (debug) console.
Module(::Engines::Console &console)
Definition: module.cpp:59
StackException Exception
Definition: error.h:59
Area * _currentArea
The current area.
Definition: module.h:177
void refreshLocalized()
Refresh all localized strings.
Definition: module.cpp:500
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
Aurora::NWScript::ScriptState state
Definition: module.h:146
void leave()
Leave the running module, quitting it.
Definition: module.cpp:261
void warning(const char *s,...)
Definition: util.cpp:33
Module information, GFF.
Definition: types.h:83
void unloadModule()
Unload the module.
Definition: module.cpp:359
#define EventMan
Shortcut for accessing the events manager.
Definition: events.h:210
void getEntryIFOLocation(Common::UString &area, float &entryX, float &entryY, float &entryZ, float &entryAngle)
Definition: module.cpp:248
Common::UString _newModule
The module we should change to.
Definition: module.h:180
Implementing the stream reading interfaces for files.
void movedPC()
Notify the module that the PC was moved.
Definition: module.cpp:472
virtual void enter()
The cursor entered the object.
Definition: object.cpp:159
virtual void setOrientation(float x, float y, float z, float angle)
Set the object&#39;s orientation.
Definition: object.cpp:152
void changeModule(const Common::UString &module, const Common::UString &entryLocation)
Schedule a change to a new module.
Definition: module.cpp:135
::Engines::Console * _console
Definition: module.h:161
bool _hasModule
Do we have a module?
Definition: module.h:163
ActionQueue _delayedActions
Definition: module.h:186
Class to hold resource data of an ERF archive file.
Definition: erffile.h:105
const GFF3Struct * getGFF() const
Return the IFO&#39;s GFF struct.
Definition: ifofile.cpp:244
static UString relativize(const UString &basePath, const UString &path)
Return the path relative to the base path.
Definition: filepath.cpp:142
const Aurora::LocString & getName() const
Return the module&#39;s name.
Definition: module.cpp:492
uint32_t uint32
Definition: types.h:204
void load(const Common::UString &module, const Common::UString &entryLocation="")
Load a module.
Definition: module.cpp:91
A list of files.
Definition: filelist.h:35
The context needed to run a The Witcher module.
const LocString & getName() const
Return the name of the module.
Definition: ifofile.cpp:267
Common::UString _tag
Definition: object.h:56
The context holding a The Witcher area.
void status(const char *s,...)
Definition: util.cpp:52
void printf(const char *s,...) GCC_PRINTF(2
Definition: console.cpp:1093
void clear()
Clear the whole context.
Definition: module.cpp:71
void addEvent(const Events::Event &event)
Add a single event for consideration into the area event queue.
Definition: area.cpp:331
#define CameraMan
Shortcut for accessing the camera manager.
Definition: camera.h:83
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
Definition: gff3file.cpp:527
static float rad2deg(float rad)
Definition: maths.h:93
Aurora::LocString _name
The object&#39;s name.
Definition: object.h:146
Generic Aurora engines utility functions.
A list of files.
void delayScript(const Common::UString &script, const Aurora::NWScript::ScriptState &state, Aurora::NWScript::Object *owner, Aurora::NWScript::Object *triggerer, uint32 delay)
Definition: module.cpp:505
const Aurora::LocString & getName() const
Return the area&#39;s name.
Definition: area.cpp:115
const Common::UString & getTag() const
Return the module&#39;s tag.
Definition: ifofile.cpp:263
virtual void loadModel()
Load the object&#39;s model(s).
Definition: object.cpp:65
void getEntryPosition(float &x, float &y, float &z) const
Return the entry position.
Definition: ifofile.cpp:296
const Common::UString & getEntryArea() const
Return the entry area.
Definition: ifofile.cpp:292
virtual Object * get()=0
Return the current object in the search context.
void clear()
Clear the string&#39;s contents.
Definition: ustring.cpp:236
static UString getFile(const UString &p)
Return a file name without its path.
Definition: filepath.cpp:81
const Common::UString & getStartMovie() const
Return the starting movie.
Definition: ifofile.cpp:288
Creature * getPC()
Return the currently playing PC.
Definition: module.cpp:79
static Common::UString findModule(const Common::UString &module, bool relative)
Definition: module.cpp:551
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.
Definition: module.h:173
Common::UString _module
The current module&#39;s name.
Definition: module.h:179
EventQueue _eventQueue
Definition: module.h:185
void movePC(const Common::UString &area)
Move the player character to this area.
Definition: module.cpp:418
const Aurora::LocString & getDescription() const
Return the object&#39;s description.
Definition: object.cpp:85