diff options
author | Stijn Buys <ingar@osirion.org> | 2008-06-17 17:22:41 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-06-17 17:22:41 +0000 |
commit | c5dddd62db3e070b89cb774abfd90cc3387a6d52 (patch) | |
tree | 4ffd089f567190aba57cdd59afa7ac8e3bde6261 /src/client | |
parent | 5438566c29ef436b32bb8722e0fa088935c59471 (diff) |
camera and cursor updates
Diffstat (limited to 'src/client')
-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); |