Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replaced --disable-progress and --disable-bloom with arguments to --h…

…ide.

Added --hide mouse option.
  • Loading branch information...
commit 2f5ae32e90a00824fbfd4415621542aeea4a3693 1 parent 6ce1524
@acaudwell authored
View
3  ChangeLog
@@ -1,9 +1,12 @@
0.27:
* Added ini style config file support.
+ * Added demo mode for showing multiple projects in a loop.
* Added --logo and --background-image options.
* Added --dont-stop and --stop-at-time options.
* Added --log-command option to use instead of multiple --log-command-VCS options.
* Allow --file-idle-time 0 (files will never expire).
+ * Added --hide mouse option.
+ * Replaced --disable-progress and --disable-bloom with arguments to --hide.
0.26:
* Improved mouse dragging.
View
9 README
@@ -140,12 +140,6 @@ options:
--bloom-intensity FLOAT
Adjust the intensity of the bloom.
- --disable-progress
- Disable progress bar.
-
- --disable-bloom
- Disable bloom effect.
-
--max-files
Set the maximum number of files. Excess files will be discarded.
@@ -165,7 +159,8 @@ options:
Camera mode (overview,track).
--hide DISPLAY_ELEMENT
- Hide display element (date,users,files,tree,usernames,filenames,dirnames).
+ Hide display element (bloom,date,dirnames,files,filenames,mouse,progress,tree,
+ users,usernames).
Separate multiple elements with commas.
View
8 data/gource.1
@@ -112,12 +112,6 @@ Adjust the amount of bloom.
\fB\-\-bloom\-intensity FLOAT\fR
Adjust the intensity of the bloom.
.TP
-\fB\-\-disable\-progress\fR
-Disable progress bar.
-.TP
-\fB\-\-disable\-bloom\fR
-Disable bloom effect.
-.TP
\fB\-\-max\-files\fR
Set the maximum number of files. Excess files will be discarded.
.TP
@@ -137,7 +131,7 @@ Change scale of users.
Camera mode (overview,track).
.TP
\fB\-\-hide DISPLAY_ELEMENT\fR
-Hide display element (date,users,files,tree,usernames,filenames,dirnames).
+Hide display element (bloom,date,dirnames,files,filenames,mouse,progress,tree,users,usernames).
Separate multiple elements with commas.
.TP
View
14 src/gource.cpp
@@ -67,6 +67,10 @@ Gource::Gource(FrameExporter* exporter) {
mousedragged = false;
mouseclicked = false;
+ if(gGourceSettings.hide_mouse) {
+ SDL_ShowCursor(false);
+ }
+
splash = -1.0;
debug = false;
@@ -275,6 +279,7 @@ std::string Gource::dateAtPosition(float percent) {
void Gource::mouseMove(SDL_MouseMotionEvent *e) {
if(commitlog==0) return;
+ if(gGourceSettings.hide_mouse) return;
Uint8 ms = SDL_GetMouseState(0,0);
bool rightmouse = ms & SDL_BUTTON(SDL_BUTTON_RIGHT);
@@ -304,7 +309,7 @@ void Gource::mouseMove(SDL_MouseMotionEvent *e) {
float pos;
- if(!gGourceSettings.disable_progress && slider.mouseOver(mousepos, &pos)) {
+ if(!gGourceSettings.hide_progress && slider.mouseOver(mousepos, &pos)) {
std::string date = dateAtPosition(pos);
slider.setCaption(date);
}
@@ -335,6 +340,7 @@ void Gource::zoom(bool zoomin) {
void Gource::mouseClick(SDL_MouseButtonEvent *e) {
if(commitlog==0) return;
+ if(gGourceSettings.hide_mouse) return;
if(e->type == SDL_MOUSEBUTTONUP) {
@@ -583,8 +589,10 @@ void Gource::keyPress(SDL_KeyboardEvent *e) {
if(!(mousedragged || mouseclicked || ms & SDL_BUTTON(SDL_BUTTON_LEFT))) {
if(SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE) {
SDL_ShowCursor(false);
+ gGourceSettings.hide_mouse = true;
} else {
SDL_ShowCursor(true);
+ gGourceSettings.hide_mouse = false;
}
}
}
@@ -821,7 +829,7 @@ void Gource::deleteUser(RUser* user) {
}
bool Gource::canSeek() {
- if(gGourceSettings.disable_progress || commitlog == 0 || !commitlog->isSeekable()) return false;
+ if(gGourceSettings.hide_progress || commitlog == 0 || !commitlog->isSeekable()) return false;
return true;
}
@@ -1610,7 +1618,7 @@ void Gource::drawActions(float dt) {
}
void Gource::drawBloom(Frustum &frustum, float dt) {
- if(gGourceSettings.disable_bloom) return;
+ if(gGourceSettings.hide_bloom) return;
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
View
42 src/gource_settings.cpp
@@ -49,6 +49,7 @@ void GourceSettings::help() {
printf(" -a, --auto-skip-seconds SECONDS Auto skip to next entry if nothing happens\n");
printf(" for a number of seconds (default: 3)\n");
+ printf(" --disable-auto-skip Disable auto skip\n");
printf(" -s, --seconds-per-day SECONDS Speed in seconds per day (default: 10)\n");
printf(" --realtime Realtime playback speed\n");
printf(" -i, --file-idle-time SECONDS Time files remain idle (default: 60)\n");
@@ -75,11 +76,8 @@ void GourceSettings::help() {
printf(" --bloom-multiplier Adjust the amount of bloom (default: 1.0)\n");
printf(" --bloom-intensity Adjust the intensity of the bloom (default: 0.75)\n\n");
- printf(" --disable-auto-skip Disable auto skipping\n");
- printf(" --disable-progress Disable the progress bar\n");
- printf(" --disable-bloom Disable bloom effect\n\n");
-
- printf(" --hide DISPLAY_ELEMENT date,users,files,tree,usernames,filenames,dirnames\n\n");
+ printf(" --hide DISPLAY_ELEMENT bloom,date,dirnames,files,filenames,mouse,progress,tree,\n");
+ printf(" users,usernames\n\n");
printf(" --max-files NUMBER Max number of active files (default: 1000)\n");
printf(" --max-file-lag SECONDS Max time files of a commit can take to appear\n\n");
@@ -131,6 +129,8 @@ GourceSettings::GourceSettings() {
arg_aliases["?"] = "help";
arg_aliases["b"] = "background-colour";
arg_aliases["background"] = "background-colour";
+ arg_aliases["disable-bloom"] = "hide-bloom";
+ arg_aliases["disable-progress"] = "hide-progress";
//command line only options
conf_sections["help"] = "command-line";
@@ -162,11 +162,12 @@ GourceSettings::GourceSettings() {
arg_types["hide-usernames"] = "bool";
arg_types["hide-filenames"] = "bool";
arg_types["hide-dirnames"] = "bool";
+ arg_types["hide-progress"] = "bool";
+ arg_types["hide-bloom"] = "bool";
+ arg_types["hide-mouse"] = "bool";
arg_types["disable-auto-skip"] = "bool";
- arg_types["disable-progress"] = "bool";
- arg_types["disable-bloom"] = "bool";
-
+
arg_types["git-log-command"]= "bool";
arg_types["cvs-exp-command"]= "bool";
arg_types["hg-log-command"] = "bool";
@@ -220,6 +221,9 @@ void GourceSettings::setGourceDefaults() {
hide_usernames = false;
hide_filenames = false;
hide_dirnames = false;
+ hide_progress = false;
+ hide_bloom = false;
+ hide_mouse = false;
start_position = 0.0;
stop_position = 0.0;
@@ -241,9 +245,6 @@ void GourceSettings::setGourceDefaults() {
default_user_image = "";
user_image_dir = "";
- disable_progress = false;
- disable_bloom = false;
-
camera_mode = "overview";
crop_vertical = false;
@@ -381,7 +382,10 @@ void GourceSettings::importGourceSettings(ConfFile& conffile, ConfSection* gourc
&& hide_field != "files"
&& hide_field != "usernames"
&& hide_field != "filenames"
- && hide_field != "dirnames") {
+ && hide_field != "dirnames"
+ && hide_field != "bloom"
+ && hide_field != "progress"
+ && hide_field != "mouse") {
std::string unknown_hide_option = std::string("unknown option hide ") + hide_field;
conffile.entryException(entry, unknown_hide_option);
}
@@ -411,6 +415,12 @@ void GourceSettings::importGourceSettings(ConfFile& conffile, ConfSection* gourc
else if(hidestr == "usernames") hide_usernames = true;
else if(hidestr == "filenames") hide_filenames = true;
else if(hidestr == "dirnames") hide_dirnames = true;
+ else if(hidestr == "bloom") hide_bloom = true;
+ else if(hidestr == "progress") hide_progress = true;
+ else if(hidestr == "mouse") {
+ hide_mouse = true;
+ hide_progress = true;
+ }
}
}
@@ -425,14 +435,6 @@ void GourceSettings::importGourceSettings(ConfFile& conffile, ConfSection* gourc
auto_skip_seconds = -1.0;
}
- if(gource_settings->getBool("disable-progress")) {
- disable_progress = true;
- }
-
- if(gource_settings->getBool("disable-bloom")) {
- disable_bloom = true;
- }
-
if(gource_settings->getBool("loop")) {
loop = true;
}
View
6 src/gource_settings.h
@@ -41,6 +41,9 @@ class GourceSettings : public SDLAppSettings {
bool hide_usernames;
bool hide_filenames;
bool hide_dirnames;
+ bool hide_progress;
+ bool hide_bloom;
+ bool hide_mouse;
std::string load_config;
std::string save_config;
@@ -67,9 +70,6 @@ class GourceSettings : public SDLAppSettings {
std::string default_user_image;
std::string user_image_dir;
- bool disable_progress;
- bool disable_bloom;
-
std::string camera_mode;
bool crop_vertical;
Please sign in to comment.
Something went wrong with that request. Please try again.