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/view.cc')
-rw-r--r--src/client/view.cc69
1 files changed, 36 insertions, 33 deletions
diff --git a/src/client/view.cc b/src/client/view.cc
index db0fa64..e2a0e88 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -173,6 +173,36 @@ void draw_cursor()
render::Textures::bind("bitmaps/pointers/aim");
} else {
+ // draw center cursor in Cockpit and Track mode
+ if (input::mouse_control &&
+ (render::Camera::mode() == render::Camera::Cockpit || render::Camera::mode() == render::Camera::Track)) {
+
+ if (ui_pointercolor) {
+ std::stringstream colorstr(ui_pointercolor->str());
+ colorstr >> color;
+ }
+
+ render::Textures::bind("bitmaps/pointers/center");
+ float cx = (video::width - pointer_size) /2;
+ float cy = (video::height - pointer_size) /2;
+
+ gl::color(color);
+ gl::begin(gl::Quads);
+
+ glTexCoord2f(0,0 );
+ gl::vertex(cx,cy,0.0f);
+
+ glTexCoord2f(1, 0);
+ gl::vertex(cx+pointer_size, cy, 0.0f);
+
+ glTexCoord2f(1, 1);
+ gl::vertex(cx+pointer_size, cy+pointer_size, 0.0f);
+
+ glTexCoord2f(0, 1);
+ gl::vertex(cx, cy+pointer_size, 0.0f);
+
+ gl::end();
+ }
if (!input::mouse_control_override && targets::hover()) {
@@ -183,49 +213,22 @@ void draw_cursor()
render::Textures::bind("bitmaps/pointers/target");
} else if (input::mouse_control) {
-
+
if (ui_pointercolor) {
std::stringstream colorstr(ui_pointercolor->str());
colorstr >> color;
}
- if (render::Camera::mode() == render::Camera::Cockpit
- || render::Camera::mode() == render::Camera::Track) {
-
- render::Textures::bind("bitmaps/pointers/center");
-
- x = (video::width - pointer_size) /2;
- y = (video::height - pointer_size) /2;
-
- gl::color(color);
- gl::begin(gl::Quads);
-
- glTexCoord2f(0,0 );
- gl::vertex(x,y,0.0f);
-
- glTexCoord2f(1, 0);
- gl::vertex(x+pointer_size, y, 0.0f);
-
- glTexCoord2f(1, 1);
- gl::vertex(x+pointer_size, y+pointer_size, 0.0f);
-
- glTexCoord2f(0, 1);
- gl::vertex(x, y+pointer_size, 0.0f);
-
- gl::end();
-
- }
-
render::Textures::bind("bitmaps/pointers/control");
-// if (!input::mouse_deadzone) {
+ if (!input::mouse_deadzone) {
x = input::mouse_x - (pointer_size /2);
y = input::mouse_y - (pointer_size /2);
-// } else {
-// x = (video::width - pointer_size) /2;
-// y = (video::height - pointer_size) /2;
-// }
+ } else {
+ x = (video::width - pointer_size) /2;
+ y = (video::height - pointer_size) /2;
+ }
} else {