From be7bb48ecb252cd098f6cae7c72b6645c2be4609 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 22 Jul 2008 11:56:33 +0000 Subject: rotating hover cursor --- src/client/view.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/client') diff --git a/src/client/view.cc b/src/client/view.cc index e2a0e88..dc17cce 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -169,6 +169,8 @@ void draw_cursor() math::Color color; color.a = 0.5f; + bool cursor_animated = false; + if (render::Camera::mode() == render::Camera::Overview) { render::Textures::bind("bitmaps/pointers/aim"); @@ -212,6 +214,8 @@ void draw_cursor() } render::Textures::bind("bitmaps/pointers/target"); + cursor_animated = true; + } else if (input::mouse_control) { if (ui_pointercolor) { @@ -237,6 +241,16 @@ void draw_cursor() } + if (cursor_animated) { + gl::push(); + gl::translate(x+pointer_size/2, y+pointer_size/2, 0.0f); + + float angle = core::application()->time()* 0.75f - floorf(core::application()->time() * 0.75f); + angle *= 360.0f; + gl::rotate(angle, math::Vector3f(0, 0, 1.0f)); + gl::translate(-x-pointer_size/2, -y-pointer_size/2, 0.0f); + } + gl::color(color); gl::begin(gl::Quads); @@ -253,6 +267,10 @@ void draw_cursor() gl::vertex(x, y+pointer_size, 0.0f); gl::end(); + + if (cursor_animated) { + gl::pop(); + } } void reset() -- cgit v1.2.3