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-07-22 11:56:33 +0000
committerStijn Buys <ingar@osirion.org>2008-07-22 11:56:33 +0000
commitbe7bb48ecb252cd098f6cae7c72b6645c2be4609 (patch)
tree140df8508478b6007895dc53dbe8ea0daa14a10e /src/client
parent45e19fb82dbf49280c09574447b65520445be308 (diff)
rotating hover cursor
Diffstat (limited to 'src/client')
-rw-r--r--src/client/view.cc18
1 files changed, 18 insertions, 0 deletions
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()