Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

M key now toggles mouse visibility.

Simulation time no longer incremented while paused, counting towards file time lag.
  • Loading branch information...
commit 9b4ee0b5d81426f0a050499c48e36c244312cc5a 1 parent 6300bbe
@acaudwell authored
View
4 ChangeLog
@@ -1,6 +1,8 @@
0.26:
* Improved mouse dragging.
-
+ * Simulation time no longer incremented while paused, counting towards file time lag.
+ * M key now toggles mouse visibility.
+
0.25:
* Bazaar support (John Arbash Meinel).
* Dragging the mouse on the background moves the camera.
View
1  README
@@ -254,6 +254,7 @@ Interactive keyboard commands:
(V) Toggle camera mode
(C) Displays Gource logo
+ (M) Toggle mouse visibility
(N) Jump forward in time to next log entry.
(+-) Adjust simulation speed.
(<>) Adjust time scale.
View
2  configure.ac
@@ -3,7 +3,7 @@
AC_PREREQ(2.61)
-AC_INIT(Gource, 0.25, [acaudwell@gmail.com])
+AC_INIT(Gource, 0.26, [acaudwell@gmail.com])
AC_CONFIG_SRCDIR([src/main.h])
AM_INIT_AUTOMAKE([dist-bzip2 foreign subdir-objects])
View
2  data/gource.1
@@ -229,6 +229,8 @@ Interactive keyboard commands:
.ti 10
(C) Displays Gource logo
.ti 10
+(M) Toggle mouse visibility.
+.ti 10
(N) Jump forward in time to next log entry.
.ti 10
(+-) Adjust simulation speed.
View
16 src/gource.cpp
@@ -336,7 +336,7 @@ void Gource::update(float t, float dt) {
dt *= time_scale;
//have to manage runtime internally as we're messing with dt
- runtime += dt;
+ if(!paused) runtime += dt;
logic_time = SDL_GetTicks();
@@ -650,6 +650,20 @@ void Gource::keyPress(SDL_KeyboardEvent *e) {
trace_debug = !trace_debug;
}
+ if (e->keysym.sym == SDLK_m) {
+
+ Uint8 ms = SDL_GetMouseState(0,0);
+
+ //toggle mouse visiblity unless mouse clicked/pressed/dragged
+ if(!(mousedragged || mouseclicked || ms & SDL_BUTTON(SDL_BUTTON_LEFT))) {
+ if(SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE) {
+ SDL_ShowCursor(false);
+ } else {
+ SDL_ShowCursor(true);
+ }
+ }
+ }
+
if (e->keysym.sym == SDLK_n) {
idle_time = gGourceAutoSkipSeconds;
}
View
2  src/gource.h
@@ -18,7 +18,7 @@
#ifndef GOURCE_H
#define GOURCE_H
-#define GOURCE_VERSION "0.25"
+#define GOURCE_VERSION "0.26"
#ifdef _WIN32
#include "windows.h"
Please sign in to comment.
Something went wrong with that request. Please try again.