Codebase list gource / 4e89574
Imported Upstream version 0.16 Andrew Caudwell 14 years ago
17 changed file(s) with 311 addition(s) and 237 deletion(s). Raw diff Collapse all Expand all
5656
5757 --stop-on-idle
5858 Stop on break in activity. May be combined with --stop-position.
59
59
6060 -a, --auto-skip-seconds SECONDS
6161 Automatically skip to next entry if nothing happens for a specified number of seconds.
6262
6363 -s, --seconds-per-day SECONDS
6464 Speed of simulation in seconds per day.
6565
66 --realtime
67 Realtime playback speed.
68
6669 -i, --file-idle-time SECONDS
6770 Time in seconds files remain idle before they are removed.
6871
7578 --loop
7679 Loop back to the start of the log when the end is reached.
7780
81 --date-format FORMAT
82 Specify display date string (strftime format).
83
7884 --log-format FORMAT
7985 Specify format of the log being read (git,cvs,custom). Required when reading STDIN.
8086
129135 --user-friction SECONDS
130136 Time users come to a complete hault.
131137
138 --user-scale SCALE
139 Change scale of users.
140
132141 --hide-users
133142 Hide users.
134143
137146
138147 --hide-filenames
139148 Hide filenames.
149
150 --hide-dirnames
151 Hide directory names.
140152
141153 --hide-date
142154 Hide the date.
172184
173185 CVS Support:
174186
175 You can view CVS projects with gource using the tool cvs-exp (not provided) with the command line specified by the
176 --cvs-exp-command option:
187 You can view a CVS project with gource using the tool cvs-exp (http://www.cs.rice.edu/~ssiyer/code/cvs-exp/) with the
188 command line specified by the --cvs-exp-command option:
177189
178190 cd my-cvs-project
179191 `gource --cvs-exp-command` > my-cvs-project.log
180192 gource my-cvs-project.log
181193
182 SVN Support via Git:
183
184 SVN is not supported directly, however you could can import your project into a Git repository using the 'git svn' command.
185
186 The below insturctions will work if your SVN repository has the standard three directories - trunk, tags and branches
187 (Otherwise, see the 'git svn' documentation):
188
189 git svn init --stdlayout https://myrepo.example.org/svn my-repo.git
190 cd my-repo.git
191 git svn fetch
192
193 Note that the last command (git svn fetch) can take hours if your repository is large.
194
195 You can pull new changes into the Git copy of your SVN repository at any time using the following command:
196
197 git svn rebase
198
199 Support for Other Systems:
200
201 Please check the Gource homepage to see guides for other systems that can be used with Gource, or try using the custom log format.
194 Other Version Control Systems:
195
196 Visit the Gource homepage for guides and examples of using Gource with other version control systems:
197
198 SVN - http://code.google.com/p/gource/wiki/SVN
199 Mercurial - http://code.google.com/p/gource/wiki/Mercurial
202200
203201 Custom Log Format:
204202
213211 Recording Videos:
214212
215213 You can create a video of Gource using the --output-ppm-stream option. This creates an uncompressed sequence of
216 screenshots in PPM format which can then be processed by another program (such as ffmpeg) to produce a video file:
214 screenshots in PPM format which can then be processed by another program (such as ffmpeg) to produce a video file.
217215
218216 The below command line will create a video at 60fps in h264 format (assumes you have ffmpeg with h264 support):
219217
270268
271269 6. Changes
272270 ==========
271
272 0.16:
273 * Added --hide-dirnames option.
274 * Added --user-scale option.
275 * Added --date-format option (Pat Notz).
276 * Fix bug when encountering long log lines.
277 * Fixed incorrect parsing of trivial merges.
278 * Fixed building issues on OSX.
273279
274280 0.15:
275281 * Added PPM output support for creating videos (Johannes Schindelin).
653653 build_alias
654654 host_alias
655655 target_alias
656 build
657 build_cpu
658 build_vendor
659 build_os
660 host
661 host_cpu
662 host_vendor
663 host_os
656664 CXX
657665 CXXFLAGS
658666 LDFLAGS
667675 GREP
668676 EGREP
669677 LIBOBJS
670 build
671 build_cpu
672 build_vendor
673 build_os
674 host
675 host_cpu
676 host_vendor
677 host_os
678678 XMKMF
679679 SED
680680 acx_pthread_config
17591759
17601760
17611761
1762 ac_aux_dir=
1763 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
1764 if test -f "$ac_dir/install-sh"; then
1765 ac_aux_dir=$ac_dir
1766 ac_install_sh="$ac_aux_dir/install-sh -c"
1767 break
1768 elif test -f "$ac_dir/install.sh"; then
1769 ac_aux_dir=$ac_dir
1770 ac_install_sh="$ac_aux_dir/install.sh -c"
1771 break
1772 elif test -f "$ac_dir/shtool"; then
1773 ac_aux_dir=$ac_dir
1774 ac_install_sh="$ac_aux_dir/shtool install -c"
1775 break
1776 fi
1777 done
1778 if test -z "$ac_aux_dir"; then
1779 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
1780 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
1781 { (exit 1); exit 1; }; }
1782 fi
1783
1784 # These three variables are undocumented and unsupported,
1785 # and are intended to be withdrawn in a future Autoconf release.
1786 # They can cause serious problems if a builder's source tree is in a directory
1787 # whose full name contains unusual characters.
1788 ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
1789 ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
1790 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
1791
1792
1793 # Make sure we can run config.sub.
1794 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
1795 { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
1796 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
1797 { (exit 1); exit 1; }; }
1798
1799 { echo "$as_me:$LINENO: checking build system type" >&5
1800 echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
1801 if test "${ac_cv_build+set}" = set; then
1802 echo $ECHO_N "(cached) $ECHO_C" >&6
1803 else
1804 ac_build_alias=$build_alias
1805 test "x$ac_build_alias" = x &&
1806 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
1807 test "x$ac_build_alias" = x &&
1808 { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
1809 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1810 { (exit 1); exit 1; }; }
1811 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
1812 { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
1813 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
1814 { (exit 1); exit 1; }; }
1815
1816 fi
1817 { echo "$as_me:$LINENO: result: $ac_cv_build" >&5
1818 echo "${ECHO_T}$ac_cv_build" >&6; }
1819 case $ac_cv_build in
1820 *-*-*) ;;
1821 *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
1822 echo "$as_me: error: invalid value of canonical build" >&2;}
1823 { (exit 1); exit 1; }; };;
1824 esac
1825 build=$ac_cv_build
1826 ac_save_IFS=$IFS; IFS='-'
1827 set x $ac_cv_build
1828 shift
1829 build_cpu=$1
1830 build_vendor=$2
1831 shift; shift
1832 # Remember, the first character of IFS is used to create $*,
1833 # except with old shells:
1834 build_os=$*
1835 IFS=$ac_save_IFS
1836 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
1837
1838
1839 { echo "$as_me:$LINENO: checking host system type" >&5
1840 echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
1841 if test "${ac_cv_host+set}" = set; then
1842 echo $ECHO_N "(cached) $ECHO_C" >&6
1843 else
1844 if test "x$host_alias" = x; then
1845 ac_cv_host=$ac_cv_build
1846 else
1847 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
1848 { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
1849 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
1850 { (exit 1); exit 1; }; }
1851 fi
1852
1853 fi
1854 { echo "$as_me:$LINENO: result: $ac_cv_host" >&5
1855 echo "${ECHO_T}$ac_cv_host" >&6; }
1856 case $ac_cv_host in
1857 *-*-*) ;;
1858 *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
1859 echo "$as_me: error: invalid value of canonical host" >&2;}
1860 { (exit 1); exit 1; }; };;
1861 esac
1862 host=$ac_cv_host
1863 ac_save_IFS=$IFS; IFS='-'
1864 set x $ac_cv_host
1865 shift
1866 host_cpu=$1
1867 host_vendor=$2
1868 shift; shift
1869 # Remember, the first character of IFS is used to create $*,
1870 # except with old shells:
1871 host_os=$*
1872 IFS=$ac_save_IFS
1873 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
1874
1875
1876
17621877 # Checks for programs.
17631878 ac_ext=cpp
17641879 ac_cpp='$CXXCPP $CPPFLAGS'
57535868 done
57545869
57555870
5871 #Disable X11 on Macs unless required
5872 if test "$with_x" != yes; then
5873
5874 case "$host_os" in
5875 darwin*)
5876 with_x="no"
5877 ;;
5878 esac
5879
5880 fi
5881
5882
57565883 #GL
5757 ac_aux_dir=
5758 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
5759 if test -f "$ac_dir/install-sh"; then
5760 ac_aux_dir=$ac_dir
5761 ac_install_sh="$ac_aux_dir/install-sh -c"
5762 break
5763 elif test -f "$ac_dir/install.sh"; then
5764 ac_aux_dir=$ac_dir
5765 ac_install_sh="$ac_aux_dir/install.sh -c"
5766 break
5767 elif test -f "$ac_dir/shtool"; then
5768 ac_aux_dir=$ac_dir
5769 ac_install_sh="$ac_aux_dir/shtool install -c"
5770 break
5771 fi
5772 done
5773 if test -z "$ac_aux_dir"; then
5774 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
5775 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
5776 { (exit 1); exit 1; }; }
5777 fi
5778
5779 # These three variables are undocumented and unsupported,
5780 # and are intended to be withdrawn in a future Autoconf release.
5781 # They can cause serious problems if a builder's source tree is in a directory
5782 # whose full name contains unusual characters.
5783 ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
5784 ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
5785 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
5786
5787
5788 # Make sure we can run config.sub.
5789 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
5790 { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
5791 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
5792 { (exit 1); exit 1; }; }
5793
5794 { echo "$as_me:$LINENO: checking build system type" >&5
5795 echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
5796 if test "${ac_cv_build+set}" = set; then
5797 echo $ECHO_N "(cached) $ECHO_C" >&6
5798 else
5799 ac_build_alias=$build_alias
5800 test "x$ac_build_alias" = x &&
5801 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
5802 test "x$ac_build_alias" = x &&
5803 { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
5804 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
5805 { (exit 1); exit 1; }; }
5806 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
5807 { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
5808 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
5809 { (exit 1); exit 1; }; }
5810
5811 fi
5812 { echo "$as_me:$LINENO: result: $ac_cv_build" >&5
5813 echo "${ECHO_T}$ac_cv_build" >&6; }
5814 case $ac_cv_build in
5815 *-*-*) ;;
5816 *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
5817 echo "$as_me: error: invalid value of canonical build" >&2;}
5818 { (exit 1); exit 1; }; };;
5819 esac
5820 build=$ac_cv_build
5821 ac_save_IFS=$IFS; IFS='-'
5822 set x $ac_cv_build
5823 shift
5824 build_cpu=$1
5825 build_vendor=$2
5826 shift; shift
5827 # Remember, the first character of IFS is used to create $*,
5828 # except with old shells:
5829 build_os=$*
5830 IFS=$ac_save_IFS
5831 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
5832
5833
5834 { echo "$as_me:$LINENO: checking host system type" >&5
5835 echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
5836 if test "${ac_cv_host+set}" = set; then
5837 echo $ECHO_N "(cached) $ECHO_C" >&6
5838 else
5839 if test "x$host_alias" = x; then
5840 ac_cv_host=$ac_cv_build
5841 else
5842 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
5843 { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
5844 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
5845 { (exit 1); exit 1; }; }
5846 fi
5847
5848 fi
5849 { echo "$as_me:$LINENO: result: $ac_cv_host" >&5
5850 echo "${ECHO_T}$ac_cv_host" >&6; }
5851 case $ac_cv_host in
5852 *-*-*) ;;
5853 *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
5854 echo "$as_me: error: invalid value of canonical host" >&2;}
5855 { (exit 1); exit 1; }; };;
5856 esac
5857 host=$ac_cv_host
5858 ac_save_IFS=$IFS; IFS='-'
5859 set x $ac_cv_host
5860 shift
5861 host_cpu=$1
5862 host_vendor=$2
5863 shift; shift
5864 # Remember, the first character of IFS is used to create $*,
5865 # except with old shells:
5866 host_os=$*
5867 IFS=$ac_save_IFS
5868 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
5869
5870
58715884 { echo "$as_me:$LINENO: checking for X" >&5
58725885 echo $ECHO_N "checking for X... $ECHO_C" >&6; }
58735886
86418654
86428655
86438656 #SDL_image library with PNG support
8644
86458657 { echo "$as_me:$LINENO: checking for IMG_LoadPNG_RW in -lSDL_image" >&5
86468658 echo $ECHO_N "checking for IMG_LoadPNG_RW in -lSDL_image... $ECHO_C" >&6; }
86478659 if test "${ac_cv_lib_SDL_image_IMG_LoadPNG_RW+set}" = set; then
87048716 { echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_image_IMG_LoadPNG_RW" >&5
87058717 echo "${ECHO_T}$ac_cv_lib_SDL_image_IMG_LoadPNG_RW" >&6; }
87068718 if test $ac_cv_lib_SDL_image_IMG_LoadPNG_RW = yes; then
8707 cat >>confdefs.h <<_ACEOF
8708 #define HAVE_LIBSDL_IMAGE 1
8709 _ACEOF
8710
8711 LIBS="-lSDL_image $LIBS"
8712
8719 LIBS="$LIBS -lSDL_image"
87138720 else
87148721 { { echo "$as_me:$LINENO: error: SDL_image required. Please see README" >&5
87158722 echo "$as_me: error: SDL_image required. Please see README" >&2;}
1003110038 build_alias!$build_alias$ac_delim
1003210039 host_alias!$host_alias$ac_delim
1003310040 target_alias!$target_alias$ac_delim
10041 build!$build$ac_delim
10042 build_cpu!$build_cpu$ac_delim
10043 build_vendor!$build_vendor$ac_delim
10044 build_os!$build_os$ac_delim
10045 host!$host$ac_delim
10046 host_cpu!$host_cpu$ac_delim
10047 host_vendor!$host_vendor$ac_delim
10048 host_os!$host_os$ac_delim
1003410049 CXX!$CXX$ac_delim
1003510050 CXXFLAGS!$CXXFLAGS$ac_delim
1003610051 LDFLAGS!$LDFLAGS$ac_delim
1004510060 GREP!$GREP$ac_delim
1004610061 EGREP!$EGREP$ac_delim
1004710062 LIBOBJS!$LIBOBJS$ac_delim
10048 build!$build$ac_delim
10049 build_cpu!$build_cpu$ac_delim
10050 build_vendor!$build_vendor$ac_delim
10051 build_os!$build_os$ac_delim
10052 host!$host$ac_delim
10053 host_cpu!$host_cpu$ac_delim
10054 host_vendor!$host_vendor$ac_delim
10055 host_os!$host_os$ac_delim
1005610063 XMKMF!$XMKMF$ac_delim
1005710064 SED!$SED$ac_delim
1005810065 acx_pthread_config!$acx_pthread_config$ac_delim
44
55 AC_INIT(Gource, 0.1, [acaudwell@gmail.com])
66 AC_CONFIG_SRCDIR([src/main.h])
7
8 AC_CANONICAL_HOST
79
810 # Checks for programs.
911 AC_PROG_CXX
2729 AC_FUNC_STRFTIME
2830 AC_FUNC_VPRINTF
2931 AC_CHECK_FUNCS([atexit getcwd memset sqrt strchr])
32
33 #Disable X11 on Macs unless required
34 AS_IF([test "$with_x" != yes], [
35 case "$host_os" in
36 darwin*)
37 with_x="no"
38 ;;
39 esac
40 ], [])
3041
3142 #GL
3243 AX_CHECK_GLU
6273 AC_CHECK_LIB(jpeg, jpeg_read_header, , AC_MSG_ERROR([JPEG library required. Please see README]))
6374
6475 #SDL_image library with PNG support
65 AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, , AC_MSG_ERROR([SDL_image required. Please see README]))
76 AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, LIBS="$LIBS -lSDL_image", AC_MSG_ERROR([SDL_image required. Please see README]))
6677
6778 #PCRE
6879 AC_CHECK_LIB([pcre], [pcre_compile],, AC_MSG_ERROR(PCRE is required. Please see README))
3333 \fB\-s, \-\-seconds\-per\-day SECONDS\fR
3434 Speed of simulation in seconds per day.
3535 .TP
36 \fB\ \-\-realtime\fR
37 Realtime playback speed.
38 .TP
3639 \fB\-i, \-\-file\-idle\-time SECONDS\fR
3740 Time in seconds files remain idle before they are removed.
3841 .TP
4548 \fB\-\-loop\fR
4649 Loop back to the start of the log when the end is reached.
4750 .TP
51 \fB\-\-date\-format FORMAT\fR
52 Specify display date string (strftime format).
53 .TP
4854 \fB\-\-log\-format FORMAT\fR
4955 Specify format of the log being read (git,cvs,custom). Required when reading STDIN.
5056 .TP
99105 \fB\-\-user\-friction SECONDS\fR
100106 Time users come to a complete hault.
101107 .TP
108 \fB\-\-user\-scale SCALE\fR
109 Change scale of users.
110 .TP
102111 \fB\-\-hide\-users\fR
103112 Hide users.
104113 .TP
107116 .TP
108117 \fB\-\-hide\-filenames\fR
109118 Hide filenames.
119 .TP
120 \fB\-\-hide\-dirnames\fR
121 Hide directory names.
110122 .TP
111123 \fB\-\-hide\-date\fR
112124 Hide the date.
144156
145157 .SH CVS SUPPORT
146158
147 You can view CVS projects with gource using the tool cvs-exp (not provided) with the command line specified by the -\-cvs\-exp\-command option:
159 You can view CVS projects with gource using the tool cvs-exp (http://www.cs.rice.edu/~ssiyer/code/cvs\-exp/) with the command line specified by the -\-cvs\-exp\-command option:
148160
149161 .ti 10
150162 cd my\-cvs\-project
153165 .ti 10
154166 \fIgource\fR my\-cvs\-project.log
155167
156 .SH SVN SUPPORT VIA GIT
157
158 SVN is not supported directly, however you could can import your project into a Git repository using the 'git svn' command.
159
160 The below insturctions will work if your SVN repository has the standard three directories - trunk, tags and branches (Otherwise, see the 'git svn' documentation):
161
162 .ti 10
163 git svn init \-\-stdlayout https://myrepo.example.org/svn my\-repo.git
164 .ti 10
165 cd my\-repo.git
166 .ti 10
167 git svn fetch
168
169 Note that the last command (git svn fetch) can take hours if your repository is large.
170
171 You can pull new changes into the Git copy of your SVN repository at any time using the following command:
172
173 .ti 10
174 git svn rebase
175
176 .SH SUPPORT FOR OTHER SYSTEMS
177
178 Please check the Gource homepage to see guides for other systems that can be used with Gource, or try using the custom log format.
168 .SH OTHER VERSION CONTROL SYSTEMS
169
170 Visit the Gource homepage for guides and examples of using Gource with other version control systems:
171
172 .ti 10
173 SVN - http://code.google.com/p/gource/wiki/SVN
174 .ti 10
175 Mercurial - http://code.google.com/p/gource/wiki/Mercurial
179176
180177 .SH CUSTOM LOG FORMAT
181178
194191
195192 .SH RECORDING VIDEOS
196193 You can create a video of Gource using the \-\-output\-ppm\-stream option. This creates an uncompressed sequence of
197 screenshots in PPM format which can then be processed by another program (such as ffmpeg) to produce a video file:
194 screenshots in PPM format which can then be processed by another program (such as ffmpeg) to produce a video file.
198195
199196 The below command line will create a video at 60fps in h264 format (assumes you have ffmpeg with h264 support):
200197
8080
8181 void seekTo(float percent);
8282
83 void reset();
84
8583 bool checkFormat();
8684
8785 std::string getLogCommand();
2929
3030 #ifndef SDLAPP_SHADER_SUPPORT
3131
32 #include <SDL/SDL.h>
33 #include <SDL/SDL_opengl.h>
32 #include "SDL.h"
33 #include "SDL_opengl.h"
3434
3535 #else
3636
4141 #include <GL/glew.h>
4242
4343 #define NO_SDL_GLEXT
44 #include <SDL.h>
45 #include <SDL_opengl.h>
44 #include "SDL.h"
45 #include "SDL_opengl.h"
4646
4747 void setupARBExtensions();
4848
3030 #include "display.h"
3131 #include "logger.h"
3232
33 #include "SDL/SDL.h"
3433 #include <vector>
3534
3635 class SDLApp {
5757 line = std::string(buff);
5858
5959 if(isFinished()) {
60 //clear the failbit if only failed because the line was too long
61 if(!stream->bad() && stream->gcount() >= (1024-1)) {
62 stream->clear();
63 }
64
6065 return false;
6166 }
6267
155160 line = std::string(buff);
156161
157162 if(buffstream->fail()) {
163 //clear the failbit if only failed because the line was too long
164 if(!buffstream->bad() && buffstream->gcount() >= (1024-1)) {
165 buffstream->clear();
166 }
167
158168 return false;
159169 }
160170
2727 #ifndef TEXTURE_H
2828 #define TEXTURE_H
2929
30 #include "SDL_image.h"
31
3032 #include "resource.h"
3133 #include "display.h"
32 #include "SDL/SDL_image.h"
3334
3435 class TextureResource : public Resource {
3536 int colourFormat(SDL_Surface* surface);
131131
132132 std::string line;
133133
134 //read author name
135 if(!logf->getNextLine(line)) return false;
134 commit.username = "";
136135
137 //ensure username prefixed with user: otherwise the log is not in
138 //the expected format and we can try a different format
139 if(line.size() < 6 || line.find("user:") != 0) {
140 return false;
136 while(logf->getNextLine(line) && line.size()) {
137
138 if(line.find("user:") == 0) {
139
140 //username follows user prefix
141 commit.username = line.substr(5);
142
143 if(!logf->getNextLine(line)) return false;
144
145 commit.timestamp = atol(line.c_str());
146
147 //this isnt a commit we are parsing, abort
148 if(commit.timestamp == 0) return false;
149
150 continue;
151 }
152
153 //should see username before files
154 if(commit.username.size() == 0) return false;
155
156 size_t tab = line.find('\t');
157
158 //incorrect log format
159 if(tab == std::string::npos || tab == 0 || tab == line.size()-1) continue;
160
161 std::string status = line.substr(tab - 1, 1);
162 std::string file = line.substr(tab + 1);
163
164 commit.addFile(file, status);
141165 }
142166
143 //username follows user prefix
144 commit.username = line.substr(5);
145
146 if(!logf->getNextLine(line)) return false;
147
148 //committer time - used instead of author time (most likely cronological)
149 // NOTE: ignoring timezone ...
150 commit.timestamp = atol(line.c_str());
151
152 //this isnt a commit we are parsing, abort
153 if(commit.timestamp == 0) return false;
154
155 //read files
156 while(logf->getNextLine(line) && line.size()) {
157 size_t tab = line.find('\t');
158
159 if(tab == std::string::npos) continue;
160
161 //incorrect log format
162 if(tab == 0 || tab == line.size()-1) return false;
163
164 std::string status = line.substr(tab - 1, 1);
165 line = line.substr(tab + 1);
166 commit.addFile(line, status);
167 }
168
169 //commit.debug();
167 //check we at least got a username
168 if(commit.username.size()==0) return false;
170169
171170 return true;
172171 }
2424 bool gGourceQuadTreeDebug = false;
2525
2626 std::string gGourceLogFormat;
27 std::string gGourceDateFormat("%A, %d %B, %Y %X");
2728
2829 bool gGourceHighlightAllUsers = false;
2930
137138 printf(" -a, --auto-skip-seconds SECONDS Auto skip to next entry if nothing happens\n");
138139 printf(" for a number of seconds (default: 3)\n");
139140 printf(" -s, --seconds-per-day SECONDS Speed in seconds per day (default: 4)\n");
141 printf(" --realtime Realtime playback speed\n");
140142 printf(" -i, --file-idle-time SECONDS Time files remain idle (default: 60)\n");
141143 printf(" -e, --elasticity FLOAT Elasticity of nodes\n");
142144 printf(" -b, --background FFFFFF Background colour in hex\n\n");
145147 printf(" --default-user-image IMAGE Default user image file\n");
146148 printf(" --colour-images Colourize user images\n\n");
147149
148 printf(" --realtime Realtime playback speed\n\n");
149
150 printf(" --loop Loop when the end of the log is reached.\n\n");
150 printf(" --loop Loop when the end of the log is reached\n\n");
151
152 printf(" --date-format FORMAT Specify display date string (strftime format)\n\n");
151153
152154 printf(" --log-format FORMAT Specify format of log (git,cvs,custom)\n");
153155 printf(" --git-branch Get the git log of a particular branch\n");
163165 printf(" --hide-users Hide users\n");
164166 printf(" --hide-usernames Hide usernames\n");
165167 printf(" --hide-filenames Hide filenames\n");
168 printf(" --hide-dirnames Hide directory names\n");
166169 printf(" --hide-date Hide the date\n\n");
167170
168171 printf(" --max-files NUMBER Max number of active files (default: 1000)\n");
169172 printf(" --max-file-lag SECONDS Max time files of a commit can take to appear\n\n");
170173
171174 printf(" --max-user-speed UNITS Speed users can travel per second (default: 500)\n\n");
172 printf(" --user-friction SECONDS Time users come to a complete hault (default: 0.67)\n\n");
175 printf(" --user-friction SECONDS Time users come to a complete hault (default: 0.67)\n");
176 printf(" --user-scale SCALE Change scale of users (default: 1.0)\n\n");
173177
174178 printf(" --follow-user USER Camera will automatically follow this user\n");
175179 printf(" --highlight-user USER Highlight the names of a particular user\n");
879883
880884 RCommit commit;
881885
882 if(commitlog->nextCommit(commit)) {
886 //ignore blank commits
887 if(commitlog->nextCommit(commit) && commit.files.size() > 0) {
883888 commitqueue.push_back(commit);
884889 }
885890 }
11951200 char datestr[256];
11961201 char timestr[256];
11971202 struct tm* timeinfo = localtime ( &currtime );
1198 strftime(datestr, 256, "%A, %d %B, %Y %X", timeinfo);
1203
1204 strftime(datestr, 256, gGourceDateFormat.c_str(), timeinfo);
11991205 displaydate = datestr;
12001206
12011207 //avoid wobbling by only moving font if change is sufficient
1717 #ifndef GOURCE_H
1818 #define GOURCE_H
1919
20 #define GOURCE_VERSION "0.15"
20 #define GOURCE_VERSION "0.16"
2121
2222 #ifdef _WIN32
2323 #include "windows.h"
204204 extern int gGourceMaxFiles;
205205
206206 extern std::string gGourceLogFormat;
207 extern std::string gGourceDateFormat;
207208
208209 extern bool gGourceHighlightAllUsers;
209210
7474 }
7575 }
7676
77 if(args == "--date-format") {
78
79 if((i+1)>=arguments.size() || arguments[i+1].size() == 0) {
80 gource_help("specify a date format string");
81 }
82
83 gGourceDateFormat = arguments[++i];
84
85 continue;
86 }
87
7788 if(args == "--hide-date") {
7889 gGourceHideDate = true;
7990 continue;
101112
102113 if(args == "--hide-filenames") {
103114 gGourceHideFilenames = true;
115 continue;
116 }
117
118 if(args == "--hide-dirnames") {
119 gGourceDrawDirName = false;
104120 continue;
105121 }
106122
348364 continue;
349365 }
350366
367 if(args == "--user-scale") {
368
369 if((i+1)>=arguments.size()) {
370 gource_help("specify user-scale (scale)");
371 }
372
373 gGourceUserScale = atof(arguments[++i].c_str());
374
375 if(gGourceUserScale<=0.0 || gGourceUserScale>100.0) {
376 gource_help("invalid user-scale value");
377 }
378
379 continue;
380 }
381
382
351383 if(args == "--max-user-speed") {
352384
353385 if((i+1)>=arguments.size()) {
2929 mouseover = false;
3030
3131 shadow = false;
32
33 this->shadowOffset = vec2f(2.0, 2.0);
3234
3335 this->elapsed = 0.0;
3436 this->fadetime = 1.0;
176178
177179 float ratio = icon->h / (float) icon->w;
178180 float halfsize = size * 0.5f;
179 vec2f offsetpos = pos - vec2f(halfsize, halfsize) + vec2f(2.0, 2.0);
181 vec2f offsetpos = pos - vec2f(halfsize, halfsize) + shadowOffset;
180182
181183 float alpha = getAlpha();
182184
2727 class Pawn : public QuadItem {
2828 protected:
2929 vec2f pos;
30 vec2f shadowOffset;
3031
3132 std::string name;
3233 float namewidth;
2323 float gGourceMaxFileLagSeconds = 5.0;
2424 float gGourceMaxUserSpeed = 500.0;
2525 float gGourceUserFriction = 1.0;
26 float gGourceUserScale = 1.0;
2627
2728 bool gGourceColourUserImages = false;
2829
4041 this->name = name;
4142
4243 speed = gGourceMaxUserSpeed;
43 size = 20.0;
44 size = 20.0 * gGourceUserScale;
45
46 shadowOffset = vec2f(2.0, 2.0) * gGourceUserScale;
4447
4548 shadow = true;
4649
8888 extern float gGourceMaxFileLagSeconds;
8989 extern float gGourceMaxUserSpeed;
9090 extern float gGourceUserFriction;
91 extern float gGourceUserScale;
9192 extern bool gGourceHideUsers;
9293
9394 extern std::map<std::string, std::string> gGourceUserImageMap;