diff options
Diffstat (limited to 'src/client/view.cc')
-rw-r--r-- | src/client/view.cc | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/src/client/view.cc b/src/client/view.cc index d796655..c74c83e 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -193,8 +193,6 @@ void draw_cursor() using namespace render; - - math::Color color; color.a = 0.5f; @@ -204,12 +202,50 @@ void draw_cursor() } else { if (input::mouse_control) { - render::Textures::bind("bitmaps/crosshairs/control"); - - if (cl_crosshaircolor && cl_crosshaircolor->value()) { + + if (cl_crosshaircolor) { std::stringstream colorstr(cl_crosshaircolor->str()); colorstr >> color; } + + if (render::Camera::mode() == render::Camera::Cockpit + || render::Camera::mode() == render::Camera::Track) { + + render::Textures::bind("bitmaps/crosshairs/center"); + + x = (video::width - crosshair_size) /2; + y = (video::height - crosshair_size) /2; + + gl::color(color); + gl::begin(gl::Quads); + + glTexCoord2f(0,0 ); + gl::vertex(x,y,0.0f); + + glTexCoord2f(1, 0); + gl::vertex(x+crosshair_size, y, 0.0f); + + glTexCoord2f(1, 1); + gl::vertex(x+crosshair_size, y+crosshair_size, 0.0f); + + glTexCoord2f(0, 1); + gl::vertex(x, y+crosshair_size, 0.0f); + + gl::end(); + + } + + render::Textures::bind("bitmaps/crosshairs/control"); + + if (!input::mouse_deadzone) { + x = input::mouse_x - (crosshair_size /2); + y = input::mouse_y - (crosshair_size /2); + + } else { + x = (video::width - crosshair_size) /2; + y = (video::height - crosshair_size) /2; + } + } else { render::Textures::bind("bitmaps/crosshairs/aim"); @@ -217,6 +253,8 @@ void draw_cursor() } + + gl::color(color); gl::begin(gl::Quads); |