Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-11-11 19:11:57 +0000
committerStijn Buys <ingar@osirion.org>2008-11-11 19:11:57 +0000
commit773c1bafe0f1d8b706e0f72e235f8466e7a9ccf5 (patch)
treeab4b3058f436a4e4c54618f132a9179ee40e330c /src/client/input.cc
parent3082cb197fb6af7d069f9ad211ff6ea5657d924a (diff)
cleanups
Diffstat (limited to 'src/client/input.cc')
-rw-r--r--src/client/input.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/client/input.cc b/src/client/input.cc
index f8c756f..8236b9b 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -17,9 +17,11 @@
#include "core/core.h"
#include "math/functions.h"
#include "render/camera.h"
+#include "render/state.h"
#include "render/draw.h"
#include "render/dust.h"
#include "render/text.h"
+#include "render/screenshot.h"
#include "ui/ui.h"
namespace client
@@ -106,7 +108,7 @@ float joystick_lastmoved_time()
void func_screenshot(std::string const & args)
{
- render::screenshot();
+ render::Screenshot::save();
}
void func_ui_control(std::string const &args)
@@ -634,8 +636,8 @@ void reset()
}
mouse_pitch = 0.0f;
mouse_direction = 0.0f;
- mouse_x = render::Camera::width() / 2;
- mouse_y = render::Camera::height() / 2;
+ mouse_x = render::State::width() / 2;
+ mouse_y = render::State::height() / 2;
render::Camera::reset();
render::Dust::reset();
mouse_control_override = false;
@@ -802,26 +804,26 @@ void frame()
mouse_deadzone = true;
// direction
- int l = mouse_x - (render::Camera::width() >> 1);
+ int l = mouse_x - (render::State::width() >> 1);
if (abs(l) < ( deadzone_size >> 1 )) {
// dead zone
mouse_direction = 0;
} else {
- l = (mouse_x - deadzone_size) - ((render::Camera::width() - deadzone_size) >> 1);
- mouse_direction = float (-l) / (float) ((render::Camera::width() - deadzone_size) >> 1);
+ l = (mouse_x - deadzone_size) - ((render::State::width() - deadzone_size) >> 1);
+ mouse_direction = float (-l) / (float) ((render::State::width() - deadzone_size) >> 1);
mouse_deadzone = false;
}
// pitch
- int h = mouse_y - (render::Camera::height() >> 1);
+ int h = mouse_y - (render::State::height() >> 1);
if (abs(h) < ( deadzone_size >> 1 )) {
// dead zone
mouse_pitch = 0;
} else {
- h = (mouse_y - deadzone_size) - ((render::Camera::height() - deadzone_size) >> 1);
- mouse_pitch = float (-h) / (float) ((render::Camera::height() - deadzone_size) >> 1);
+ h = (mouse_y - deadzone_size) - ((render::State::height() - deadzone_size) >> 1);
+ mouse_pitch = float (-h) / (float) ((render::State::height() - deadzone_size) >> 1);
mouse_deadzone = false;
}
@@ -852,7 +854,7 @@ void frame()
core::localcontrol()->set_thrust(local_thrust);
core::localcontrol()->set_direction(local_direction);
- core::localcontrol()->set_pitch(local_pitch / render::Camera::aspect() );
+ core::localcontrol()->set_pitch(local_pitch / render::State::aspect() );
core::localcontrol()->set_roll(local_roll);
core::localcontrol()->set_strafe(local_strafe);
core::localcontrol()->set_afterburner(local_afterburner);