xoreos  0.0.5
dialog.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 
26 #include "src/aurora/dlgfile.cpp"
27 
28 #include "src/common/maths.h"
29 
30 #include "src/sound/sound.h"
31 
33 
37 
39 
40 namespace Engines {
41 
42 namespace KotOR2 {
43 
45  : KotOR::DialogGUIBase(true),
46  _module(module) {
47 }
48 
50  Creature *pc = _module.getPC();
51  if (!pc)
52  return;
53 
55  if (!o)
56  return;
57 
58  o->makeLookAt(pc);
59  pc->makeLookAt(o);
60 
61  float x, y, z, a;
62  pc->getOrientation(x, y, z, a);
63  SatelliteCam.setYaw(Common::deg2rad(a - 15.0f));
64 }
65 
68  if (!o)
69  return;
70 
72  if (!creature)
73  return;
74 
75  creature->playDefaultHeadAnimation();
76  creature->playDefaultAnimation();
77 }
78 
81  if (!o)
82  return;
83 
85  if (!creature)
86  return;
87 
88  creature->playAnimation("tlknorm", true, -1.0f);
89  creature->playHeadAnimation("talk", true, -1.0f, 0.25f);
90 }
91 
92 } // End of namespace KotOR2
93 
94 } // End of namespace Engines
KotOR2::Object * getObjectByTag(const Common::UString &tag)
Definition: area.cpp:676
A creature in a Star Wars: Knights of the Old Republic II - The Sith Lords area.
A class holding an UTF-8 string.
Definition: ustring.h:48
Area * getCurrentArea()
Return the area the PC is currently in.
Definition: module.cpp:643
Mathematical helpers.
void playDefaultAnimations(const Common::UString &tag)
Definition: dialog.cpp:66
Engine utility class for camera handling where camera rotates around PC.
void playAnimation(const Common::UString &anim, bool restart=true, float length=0.0f, float speed=1.0f)
Definition: creature.cpp:349
Conversation/cutscene GUI for Star Wars: Knights of the Old Republic II: The Sith Lords...
virtual void getOrientation(float &x, float &y, float &z, float &angle) const
Return the object&#39;s orientation.
Definition: object.cpp:113
The context holding a Star Wars: Knights of the Old Republic II - The Sith Lords area.
void playHeadAnimation(const Common::UString &anim, bool restart=true, float length=0.0f, float speed=1.0f)
Definition: creature.cpp:354
Creature * getPC()
Return the currently playing PC.
Definition: module.cpp:147
The global sound manager, handling all sound output.
The context needed to run a Star Wars: Knights of the Old Republic II - The Sith Lords module...
Handling BioWare&#39;s DLGs (dialog / conversation files).
DialogGUI(Module &module)
Definition: dialog.cpp:44
void playTalkAnimations(const Common::UString &tag)
Definition: dialog.cpp:79
void makeLookAt(float x, float y)
Definition: object.cpp:134
static float deg2rad(float deg)
Definition: maths.h:97
#define SatelliteCam
void makeLookAtPC(const Common::UString &tag)
Definition: dialog.cpp:49
static Creature * toCreature(Aurora::NWScript::Object *object)