Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/camera.cc14
-rw-r--r--src/client/input.cc10
2 files changed, 12 insertions, 12 deletions
diff --git a/src/client/camera.cc b/src/client/camera.cc
index 03a4e1b..dcf4acf 100644
--- a/src/client/camera.cc
+++ b/src/client/camera.cc
@@ -5,7 +5,7 @@
*/
#include "math/mathlib.h"
-#include "core/player.h"
+#include "core/core.h"
#include "client/client.h"
#include "client/camera.h"
#include "render/render.h"
@@ -82,7 +82,7 @@ void set_mode(Mode newmode) {
case Track:
// switch camera to Track mode
mode = Track;
- yaw_target = core::Player::local.control->direction();
+ yaw_target = core::game()->localplayer()->control->direction();
yaw_current = yaw_target;
pitch_target = pitch_track;
pitch_current = pitch_target;
@@ -91,7 +91,7 @@ void set_mode(Mode newmode) {
case Free:
// switch camera to Free mode
mode = Free;
- yaw_target = core::Player::local.control->direction();
+ yaw_target = core::game()->localplayer()->control->direction();
yaw_current = yaw_target;
pitch_target = pitch_track;
pitch_current = pitch_target;
@@ -112,7 +112,7 @@ void set_mode(Mode newmode) {
void next_mode()
{
- if (!core::Player::local.control) {
+ if (!core::game()->localplayer()->control) {
set_mode(Overview);
return;
}
@@ -133,7 +133,7 @@ void next_mode()
void draw(float elapsed)
{
- if (!core::Player::local.control) {
+ if (!core::game()->localplayer()->control) {
// switch the camera to Overview of the player is not controling anything
if (mode != Overview) {
set_mode(Overview);
@@ -142,11 +142,11 @@ void draw(float elapsed)
if (mode == Overview)
set_mode(Track);
- camera::target = core::Player::local.control->location();
+ camera::target = core::game()->localplayer()->control->location();
}
if (mode == Track) {
- yaw_target = core::Player::local.control->direction();
+ yaw_target = core::game()->localplayer()->control->direction();
}
if ((mode == Free) || (mode == Track)) {
diff --git a/src/client/input.cc b/src/client/input.cc
index 9053725..e8dacd6 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -101,7 +101,7 @@ void frame(float seconds)
switch (event.type) {
case SDL_KEYUP:
- if (!console::visible() && core::application()->connected() && core::Player::local.control)
+ if (!console::visible() && core::application()->connected() && core::game()->localplayer()->control)
// send key events to the game world
keyreleased(event.key.keysym);
break;
@@ -111,7 +111,7 @@ void frame(float seconds)
} else if (console::visible()) {
// send key events to the console
console::keypressed(event.key.keysym);
- } else if (core::application()->connected() && core::Player::local.control) {
+ } else if (core::application()->connected() && core::game()->localplayer()->control) {
// send key events to the game world
keypressed(event.key.keysym);
}
@@ -123,9 +123,9 @@ void frame(float seconds)
}
- if (!console::visible() && core::application()->connected() && core::Player::local.control) {
- core::Player::local.control->set_thrust(local_thrust);
- core::Player::local.control->set_direction(math::degrees360f(core::Player::local.control->direction() + local_turn_offset));
+ if (!console::visible() && core::application()->connected() && core::game()->localplayer()->control) {
+ core::game()->localplayer()->control->set_thrust(local_thrust);
+ core::game()->localplayer()->control->set_direction(math::degrees360f(core::game()->localplayer()->control->direction() + local_turn_offset));
}
}