trashpace-subversion Mailing List for trashpace
Status: Planning
Brought to you by:
davidlopez
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
|
From: <dav...@us...> - 2007-10-30 08:43:51
|
Revision: 19 http://trashpace.svn.sourceforge.net/trashpace/?rev=19&view=rev Author: davidlopez Date: 2007-10-30 01:43:55 -0700 (Tue, 30 Oct 2007) Log Message: ----------- Drawing Earth, with PovModeler Added Paths: ----------- trunk/pov/earth.kpm Removed Paths: ------------- trunk/pov/earth.pov trunk/pov/earth_map.png Added: trunk/pov/earth.kpm =================================================================== (Binary files differ) Property changes on: trunk/pov/earth.kpm ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/pov/earth.pov =================================================================== --- trunk/pov/earth.pov 2007-10-30 07:52:12 UTC (rev 18) +++ trunk/pov/earth.pov 2007-10-30 08:43:55 UTC (rev 19) @@ -1,62 +0,0 @@ - -#include "colors.inc" - -#declare earth_radius=6366; //earth sphere's radius - -#declare pigmap1= -pigment{ - average - pigment_map{ - [1 - image_map{ - png "earth_map.png" - map_type 1 - interpolate 4 - } - scale earth_radius - ] - } -} - -#declare earth=union{ - sphere{0,earth_radius - texture{ - pigment{pigmap1} - } - } - - difference{ - sphere{0,earth_radius+100} - sphere{0,earth_radius+0.01} - hollow - pigment{rgbf 1} - interior{ - media{ - scattering{2,<0.0005,0.0005,0.001>*.5} - intervals 5 - } - } - } - -} - - -camera{ -location<0,0,-40000> - -look_at 0 - -angle 30 -} - -light_source{ -<-20000,0,-10000> -color White*1.4 -} - -background{rgb .05} - -//object{earth rotate y*-130 rotate x*-20} - -object{earth rotate x*-90 rotate z* clock} - Deleted: trunk/pov/earth_map.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2007-10-30 07:47:53
|
Revision: 14 http://trashpace.svn.sourceforge.net/trashpace/?rev=14&view=rev Author: davidlopez Date: 2007-10-30 00:47:57 -0700 (Tue, 30 Oct 2007) Log Message: ----------- cleaning old stuff Modified Paths: -------------- trunk/Doxyfile trunk/Makefile.in trunk/src/Makefile.in trunk/trashpace.kdevelop Added Paths: ----------- trunk/mkinstalldirs Modified: trunk/Doxyfile =================================================================== --- trunk/Doxyfile 2007-10-30 07:39:01 UTC (rev 13) +++ trunk/Doxyfile 2007-10-30 07:47:57 UTC (rev 14) @@ -25,7 +25,7 @@ ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES -STRIP_FROM_PATH = /home/david/ +STRIP_FROM_PATH = /home/david/dvlp/trunk/ STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO Modified: trunk/Makefile.in =================================================================== --- trunk/Makefile.in 2007-10-30 07:39:01 UTC (rev 13) +++ trunk/Makefile.in 2007-10-30 07:47:57 UTC (rev 14) @@ -36,7 +36,7 @@ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ TODO config.guess config.sub depcomp install-sh ltmain.sh \ - missing + missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.in @@ -44,7 +44,7 @@ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = SOURCES = Added: trunk/mkinstalldirs =================================================================== --- trunk/mkinstalldirs (rev 0) +++ trunk/mkinstalldirs 2007-10-30 07:47:57 UTC (rev 14) @@ -0,0 +1,111 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <fri...@pr...> +# Created: 1993-05-16 +# Public domain + +errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" 1>&2 + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi + ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi + ;; +esac + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# End: +# mkinstalldirs ends here Property changes on: trunk/mkinstalldirs ___________________________________________________________________ Name: svn:executable + * Modified: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in 2007-10-30 07:39:01 UTC (rev 13) +++ trunk/src/Makefile.in 2007-10-30 07:47:57 UTC (rev 14) @@ -40,7 +40,7 @@ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" Modified: trunk/trashpace.kdevelop =================================================================== --- trunk/trashpace.kdevelop 2007-10-30 07:39:01 UTC (rev 13) +++ trunk/trashpace.kdevelop 2007-10-30 07:47:57 UTC (rev 14) @@ -21,7 +21,6 @@ <run> <mainprogram>src/trashpace</mainprogram> <terminal>true</terminal> - <directoryradio>executable</directoryradio> </run> <configurations> <optimized> @@ -45,12 +44,6 @@ <ldflags>-lSDL</ldflags> </default> </configurations> - <make> - <envvars> - <envvar value="1" name="WANT_AUTOCONF_2_5" /> - <envvar value="1" name="WANT_AUTOMAKE_1_6" /> - </envvars> - </make> </kdevautoproject> <kdevdoctreeview> <ignoretocs> @@ -121,29 +114,4 @@ <YEAR>2007</YEAR> <dest>/home/david/trashpace</dest> </substmap> - <kdevcppsupport> - <references/> - <codecompletion> - <includeGlobalFunctions>true</includeGlobalFunctions> - <includeTypes>true</includeTypes> - <includeEnums>true</includeEnums> - <includeTypedefs>false</includeTypedefs> - <automaticCodeCompletion>true</automaticCodeCompletion> - <automaticArgumentsHint>true</automaticArgumentsHint> - <automaticHeaderCompletion>true</automaticHeaderCompletion> - <codeCompletionDelay>250</codeCompletionDelay> - <argumentsHintDelay>400</argumentsHintDelay> - <headerCompletionDelay>250</headerCompletionDelay> - </codecompletion> - </kdevcppsupport> - <kdevfileview> - <groups> - <hidenonprojectfiles>false</hidenonprojectfiles> - <hidenonlocation>false</hidenonlocation> - </groups> - <tree> - <hidepatterns>*.o,*.lo,CVS</hidepatterns> - <hidenonprojectfiles>false</hidenonprojectfiles> - </tree> - </kdevfileview> </kdevelop> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2007-10-30 07:39:03
|
Revision: 13 http://trashpace.svn.sourceforge.net/trashpace/?rev=13&view=rev Author: davidlopez Date: 2007-10-30 00:39:01 -0700 (Tue, 30 Oct 2007) Log Message: ----------- cleaning old stuff Added Paths: ----------- trunk/templates/ trunk/templates/cpp trunk/templates/h Added: trunk/templates/cpp =================================================================== --- trunk/templates/cpp (rev 0) +++ trunk/templates/cpp 2007-10-30 07:39:01 UTC (rev 13) @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (C) 2007 by David Lopez Velazquez * + * dav...@fr... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ Added: trunk/templates/h =================================================================== --- trunk/templates/h (rev 0) +++ trunk/templates/h 2007-10-30 07:39:01 UTC (rev 13) @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (C) 2007 by David Lopez Velazquez * + * dav...@fr... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2007-10-07 21:23:28
|
Revision: 10 http://trashpace.svn.sourceforge.net/trashpace/?rev=10&view=rev Author: davidlopez Date: 2007-10-07 14:23:28 -0700 (Sun, 07 Oct 2007) Log Message: ----------- change global design, and begin with Kdevelop Modified Paths: -------------- trunk/COPYING trunk/ChangeLog trunk/INSTALL trunk/Makefile.am Added Paths: ----------- trunk/Doxyfile Modified: trunk/COPYING =================================================================== --- trunk/COPYING 2007-10-07 21:22:51 UTC (rev 9) +++ trunk/COPYING 2007-10-07 21:23:28 UTC (rev 10) @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -313,7 +313,7 @@ If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-10-07 21:22:51 UTC (rev 9) +++ trunk/ChangeLog 2007-10-07 21:23:28 UTC (rev 10) @@ -1,4 +0,0 @@ -2006-07-28 David Lopez Velazquez <dav...@fr...> - - * trashpace: initial version. - Added: trunk/Doxyfile =================================================================== --- trunk/Doxyfile (rev 0) +++ trunk/Doxyfile 2007-10-07 21:23:28 UTC (rev 10) @@ -0,0 +1,275 @@ +# Doxyfile 1.4.1-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = trashpace.kdevelop +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = /home/david/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = /home/david/trashpace +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = yes +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = trashpace.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2007-10-07 21:22:51 UTC (rev 9) +++ trunk/INSTALL 2007-10-07 21:23:28 UTC (rev 10) @@ -1,9 +1,3 @@ -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software -Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - Basic Installation ================== @@ -14,27 +8,20 @@ those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: @@ -44,41 +31,30 @@ `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. - Running `configure' takes awhile. While running, it prints some + Running `configure' takes a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and + 3. Type `make install' to install the programs and any data files and documentation. - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. + 4. You can remove the program binaries and object files from the + source code directory by typing `make clean'. Compilers and Options ===================== Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - Compiling For Multiple Architectures ==================================== @@ -90,11 +66,11 @@ the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. Installation Names ================== @@ -110,11 +86,6 @@ PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. @@ -137,33 +108,23 @@ Specifying the System Type ========================== - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If +See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't -need to know the machine type. +need to know the host type. - If you are _building_ compiler tools for cross-compiling, you should + If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will -produce code for. +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - Sharing Defaults ================ @@ -175,55 +136,32 @@ `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. -Defining Variables +Operation Controls ================== - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -will cause the specified gcc to be used as the C compiler (unless it is -overridden in the site shell script). - -`configure' Invocation -====================== - `configure' recognizes the following options to control how it operates. +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + `--help' -`-h' Print a summary of the options to `configure', and exit. -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - `--quiet' `--silent' `-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). + Do not print messages saying which checks are being made. `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. +`configure' also accepts some other, not widely useful, options. + Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2007-10-07 21:22:51 UTC (rev 9) +++ trunk/Makefile.am 2007-10-07 21:23:28 UTC (rev 10) @@ -1,21 +1,5 @@ -AM_CPPFLAGS=`sdl-config --cflags` -AM_LIBS=`sdl-config --libs` +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 -bin_PROGRAMS=trashpace -trashpace_SOURCES=trashpace.cc helper.cc sprites.cc sprite_base.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h - -# uncomment the following if trashpace requires the math library -trashpace_LDADD=-lm -lSDL -lpthread - -EXTRA_DIST=trashpace.lsm.in #NAME.texinfo trashpace.spec.in - -# if you write a self-test script named `chk', uncomment the -# following and add `chk' to the EXTRA_DIST list -#TESTS=chk - -# build and install the .info pages -info_TEXINFOS = trashpace.texinfo -trashpace_TEXINFOS = gpl.texinfo - -# install the man pages -man_MANS=trashpace.1 +SUBDIRS = src This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2007-10-07 21:22:49
|
Revision: 9 http://trashpace.svn.sourceforge.net/trashpace/?rev=9&view=rev Author: davidlopez Date: 2007-10-07 14:22:51 -0700 (Sun, 07 Oct 2007) Log Message: ----------- change global design, and begin with Kdevelop Added Paths: ----------- trunk/src/ trunk/src/Makefile.am trunk/src/Makefile.in trunk/src/trashpace.cpp Added: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am (rev 0) +++ trunk/src/Makefile.am 2007-10-07 21:22:51 UTC (rev 9) @@ -0,0 +1,9 @@ +bin_PROGRAMS = trashpace +trashpace_SOURCES = trashpace.cpp + +# set the include path found by configure +AM_CPPFLAGS = $(LIBSDL_CFLAGS) $(all_includes) + +# the library search path. +trashpace_LDFLAGS = $(all_libraries) $(LIBSDL_RPATH) +trashpace_LDADD = $(LIBSDL_LIBS) Added: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (rev 0) +++ trunk/src/Makefile.in 2007-10-07 21:22:51 UTC (rev 9) @@ -0,0 +1,470 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = trashpace$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_trashpace_OBJECTS = trashpace.$(OBJEXT) +trashpace_OBJECTS = $(am_trashpace_OBJECTS) +am__DEPENDENCIES_1 = +trashpace_DEPENDENCIES = $(am__DEPENDENCIES_1) +trashpace_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(trashpace_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(trashpace_SOURCES) +DIST_SOURCES = $(trashpace_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSDL_CFLAGS = @LIBSDL_CFLAGS@ +LIBSDL_LIBS = @LIBSDL_LIBS@ +LIBSDL_RPATH = @LIBSDL_RPATH@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +trashpace_SOURCES = trashpace.cpp + +# set the include path found by configure +AM_CPPFLAGS = $(LIBSDL_CFLAGS) $(all_includes) + +# the library search path. +trashpace_LDFLAGS = $(all_libraries) $(LIBSDL_RPATH) +trashpace_LDADD = $(LIBSDL_LIBS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +trashpace$(EXEEXT): $(trashpace_OBJECTS) $(trashpace_DEPENDENCIES) + @rm -f trashpace$(EXEEXT) + $(trashpace_LINK) $(trashpace_OBJECTS) $(trashpace_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trashpace.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: trunk/src/trashpace.cpp =================================================================== --- trunk/src/trashpace.cpp (rev 0) +++ trunk/src/trashpace.cpp 2007-10-07 21:22:51 UTC (rev 9) @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (C) 2007 by David Lopez Velazquez * + * dav...@fr... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <iostream> +#include <stdlib.h> +#include "SDL.h" + +using namespace std; + +int main(int argc, char *argv[]) +{ + cout <<"Initializing SDL." << endl; + /* Initializes Audio and the CDROM, add SDL_INIT_VIDEO for Video */ + if(SDL_Init(SDL_INIT_AUDIO | SDL_INIT_CDROM)< 0) { + cout <<"Could not initialize SDL:" << SDL_GetError() << endl; + SDL_Quit(); + } else { + cout << "Audio & CDROM initialized correctly" << endl;; + /* Trying to read number of CD devices on system */ + cout << "Drives available :" << SDL_CDNumDrives() << endl; + for(int i=0; i < SDL_CDNumDrives(); ++i) { + cout << "Drive " << i << "\"" << SDL_CDName(i) << "\""; + } + } + SDL_Quit(); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2006-09-25 20:33:42
|
Revision: 8 http://svn.sourceforge.net/trashpace/?rev=8&view=rev Author: davidlopez Date: 2006-09-25 13:32:05 -0700 (Mon, 25 Sep 2006) Log Message: ----------- added sprites support Modified Paths: -------------- trunk/Makefile trunk/Makefile.am trunk/Makefile.in trunk/config.log trunk/config.status trunk/trashpace.cc trunk/trashpace.h trunk/trashpace.lsm Added Paths: ----------- trunk/helper.cc trunk/helper.h trunk/sprite_base.cc trunk/sprite_base.h trunk/sprites.cc trunk/sprites.h trunk/struct.h Removed Paths: ------------- trunk/gametime.cc trunk/gametime.h trunk/planet.cc trunk/planet.h Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/Makefile 2006-09-25 20:32:05 UTC (rev 8) @@ -65,7 +65,7 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -ISODATE = 2006-09-09 +ISODATE = 2006-09-25 LDFLAGS = LIBOBJS = LIBS = @@ -124,7 +124,7 @@ AM_LIBS = `sdl-config --libs` bin_PROGRAMS = trashpace -trashpace_SOURCES = trashpace.cc gametime.cc planet.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h +trashpace_SOURCES = trashpace.cc helper.cc sprites.cc sprite_base.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h # uncomment the following if trashpace requires the math library trashpace_LDADD = -lm -lSDL -lpthread @@ -149,9 +149,9 @@ bin_PROGRAMS = trashpace$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) -am_trashpace_OBJECTS = trashpace.$(OBJEXT) gametime.$(OBJEXT) \ - planet.$(OBJEXT) xmalloc.$(OBJEXT) getopt.$(OBJEXT) \ - getopt1.$(OBJEXT) +am_trashpace_OBJECTS = trashpace.$(OBJEXT) helper.$(OBJEXT) \ + sprites.$(OBJEXT) sprite_base.$(OBJEXT) xmalloc.$(OBJEXT) \ + getopt.$(OBJEXT) getopt1.$(OBJEXT) trashpace_OBJECTS = $(am_trashpace_OBJECTS) trashpace_DEPENDENCIES = trashpace_LDFLAGS = @@ -159,9 +159,10 @@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -DEP_FILES = ./$(DEPDIR)/gametime.Po ./$(DEPDIR)/getopt.Po \ - ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/planet.Po \ - ./$(DEPDIR)/trashpace.Po ./$(DEPDIR)/xmalloc.Po +DEP_FILES = ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/getopt1.Po \ + ./$(DEPDIR)/helper.Po ./$(DEPDIR)/sprite_base.Po \ + ./$(DEPDIR)/sprites.Po ./$(DEPDIR)/trashpace.Po \ + ./$(DEPDIR)/xmalloc.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -265,10 +266,11 @@ distclean-compile: -rm -f *.tab.c -include ./$(DEPDIR)/gametime.Po include ./$(DEPDIR)/getopt.Po include ./$(DEPDIR)/getopt1.Po -include ./$(DEPDIR)/planet.Po +include ./$(DEPDIR)/helper.Po +include ./$(DEPDIR)/sprite_base.Po +include ./$(DEPDIR)/sprites.Po include ./$(DEPDIR)/trashpace.Po include ./$(DEPDIR)/xmalloc.Po Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/Makefile.am 2006-09-25 20:32:05 UTC (rev 8) @@ -2,7 +2,7 @@ AM_LIBS=`sdl-config --libs` bin_PROGRAMS=trashpace -trashpace_SOURCES=trashpace.cc gametime.cc planet.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h +trashpace_SOURCES=trashpace.cc helper.cc sprites.cc sprite_base.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h # uncomment the following if trashpace requires the math library trashpace_LDADD=-lm -lSDL -lpthread Modified: trunk/Makefile.in =================================================================== --- trunk/Makefile.in 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/Makefile.in 2006-09-25 20:32:05 UTC (rev 8) @@ -124,7 +124,7 @@ AM_LIBS = `sdl-config --libs` bin_PROGRAMS = trashpace -trashpace_SOURCES = trashpace.cc gametime.cc planet.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h +trashpace_SOURCES = trashpace.cc helper.cc sprites.cc sprite_base.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h # uncomment the following if trashpace requires the math library trashpace_LDADD = -lm -lSDL -lpthread @@ -149,9 +149,9 @@ bin_PROGRAMS = trashpace$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) -am_trashpace_OBJECTS = trashpace.$(OBJEXT) gametime.$(OBJEXT) \ - planet.$(OBJEXT) xmalloc.$(OBJEXT) getopt.$(OBJEXT) \ - getopt1.$(OBJEXT) +am_trashpace_OBJECTS = trashpace.$(OBJEXT) helper.$(OBJEXT) \ + sprites.$(OBJEXT) sprite_base.$(OBJEXT) xmalloc.$(OBJEXT) \ + getopt.$(OBJEXT) getopt1.$(OBJEXT) trashpace_OBJECTS = $(am_trashpace_OBJECTS) trashpace_DEPENDENCIES = trashpace_LDFLAGS = @@ -159,9 +159,10 @@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gametime.Po ./$(DEPDIR)/getopt.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/planet.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/trashpace.Po ./$(DEPDIR)/xmalloc.Po +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/getopt1.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/helper.Po ./$(DEPDIR)/sprite_base.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/sprites.Po ./$(DEPDIR)/trashpace.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/xmalloc.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -265,10 +266,11 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gametime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/planet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_base.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprites.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trashpace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ Modified: trunk/config.log =================================================================== --- trunk/config.log 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/config.log 2006-09-25 20:32:05 UTC (rev 8) @@ -1035,7 +1035,7 @@ INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s' -ISODATE='2006-09-09' +ISODATE='2006-09-25' LDFLAGS='' LIBOBJS='' LIBS='' Modified: trunk/config.status =================================================================== --- trunk/config.status 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/config.status 2006-09-25 20:32:05 UTC (rev 8) @@ -503,7 +503,7 @@ s,@AWK@,gawk,;t t s,@SET_MAKE@,,;t t s,@am__leading_dot@,.,;t t -s,@ISODATE@,2006-09-09,;t t +s,@ISODATE@,2006-09-25,;t t s,@build@,i686-pc-linux-gnu,;t t s,@build_cpu@,i686,;t t s,@build_vendor@,pc,;t t Deleted: trunk/gametime.cc =================================================================== --- trunk/gametime.cc 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/gametime.cc 2006-09-25 20:32:05 UTC (rev 8) @@ -1,68 +0,0 @@ -/* - trashpace - Cleaning the orbital space of Earth - - Copyright (C) 2006 david - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#include "gametime.h" - -gameTime::gameTime() -{ - startTime = 0; - baseTime = 0; - running = false; -} - -void -gameTime::start() -{ - if (!running) - { - startTime = SDL_GetTicks(); - running = true; - } -} - -void -gameTime::stop() -{ - if (running) - { - baseTime = baseTime + (SDL_GetTicks() - startTime); - running = false; - } -} - -bool -gameTime::stopped() -{ - return !running; -} - -int -gameTime::time() -{ - if (running) - { - return baseTime + (SDL_GetTicks() - startTime); - } - else - { - return baseTime; - } -} Deleted: trunk/gametime.h =================================================================== --- trunk/gametime.h 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/gametime.h 2006-09-25 20:32:05 UTC (rev 8) @@ -1,36 +0,0 @@ -/* - trashpace - Cleaning the orbital space of Earth - - Copyright (C) 2006 david - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -#include "SDL.h" - -class gameTime -{ -private: - int startTime; - int baseTime; - bool running; - -public: - gameTime(); - void start(); - void stop(); - bool stopped(); - int time(); -}; Added: trunk/helper.cc =================================================================== --- trunk/helper.cc (rev 0) +++ trunk/helper.cc 2006-09-25 20:32:05 UTC (rev 8) @@ -0,0 +1,49 @@ +#include "struct.h" + +#include "helper.h" + +SDL_Surface * ImageLoad(char *file) +{ + SDL_Surface *temp1, *temp2; + temp1 = SDL_LoadBMP(file); + temp2 = SDL_DisplayFormat(temp1); + SDL_FreeSurface(temp1); + return temp2; +} + +SDL_Surface *InitImages(char *file) +{ + return ImageLoad(file); +} + +void DrawIMG(SDL_Surface *img, int x, int y,SDL_Surface *screen) +{ + SDL_Rect dest; + dest.x = x; + dest.y = y; + SDL_BlitSurface(img, NULL, screen, &dest); +} + + +void DrawBG(SDL_Surface *surface,SDL_Surface *screen) +{ + DrawIMG(surface, 0, 0,screen); +} + +void DrawScene(SDL_Surface *screen,CSprite *planet,CSprite *satellite,CSprite *ship) +{ + planet->clearBG(); + satellite->clearBG(); + ship->clearBG(); + + + planet->updateBG(); + satellite->updateBG(); + ship->updateBG(); + + planet->draw(); + satellite->draw(); + ship->draw(); + + SDL_Flip(screen); +} Added: trunk/helper.h =================================================================== --- trunk/helper.h (rev 0) +++ trunk/helper.h 2006-09-25 20:32:05 UTC (rev 8) @@ -0,0 +1,13 @@ +#include "struct.h" +#include "sprite_base.h" +#include "sprites.h" + +SDL_Surface * ImageLoad(char *file); + +SDL_Surface *InitImages(char *file); + +void DrawIMG(SDL_Surface *img, int x, int y,SDL_Surface *screen); + +void DrawBG(SDL_Surface *surface,SDL_Surface *screen); + +void DrawScene(SDL_Surface *screen,CSprite *planet,CSprite *satellite,CSprite *ship); Deleted: trunk/planet.cc =================================================================== --- trunk/planet.cc 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/planet.cc 2006-09-25 20:32:05 UTC (rev 8) @@ -1,79 +0,0 @@ -/* - trashpace - Cleaning the orbital space of Earth - - Copyright (C) 2006 david - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#include "planet.h" - -int CPlanet::init(char *dir) -{ - char buffer[255]; - char filename[255]; - char name[255]; - char mTemplate[255]; - int r=0,g=0,b=0; - FILE *fp; - - sprintf(filename,"%s/map",dir); - fprintf(stderr,"opening %s\n",filename); - if ((fp=fopen(filename,"r"))==NULL) - { - fprintf(stderr,"ERROR opening %s\n",filename); - return -1; - } - - fgets(buffer,255,fp); - sscanf(buffer,"FILES=%d",&mNumFrames); - fprintf(stderr,"map tells about %d frames\n",mNumFrames); - - fgets(buffer,255,fp); - sscanf(buffer,"TEMPLATE=%s",&mTemplate); - fprintf(stderr,"frames are named from "); - fprintf(stderr,mTemplate,1); - fprintf(stderr," to "); - fprintf(stderr,mTemplate,mNumFrames); - - fgets(buffer,255,fp); - sscanf(buffer,"TRANSPARENT=%d,%d,%d",&r,&g,&b); - fprintf(stderr,"\nTransparent components red %d,green %d and blue %d\n",r,g,b); - - fprintf(stderr,"Loading :"); - fclose(fp); - frames=new SDL_Surface*[mNumFrames]; - int cpt=0; - for (int i=1;i<=mNumFrames;i++){ - sprintf(filename,mTemplate,i); - fprintf(stderr,"%s ",filename); - SDL_Surface *temp; - if((temp = SDL_LoadBMP(filename))== NULL) - { - fprintf(stderr,"Error from DSL : %s \n",SDL_GetError()); - return -1; - } - SDL_SetColorKey(temp,SDL_SRCCOLORKEY,SDL_MapRGB(temp->format,r,g,b)); - frames[i-1] = SDL_DisplayFormat(temp); - cpt++; - SDL_FreeSurface(temp); - if (!mW) mW=frames[i-1]->w; - if (!mH) mH=frames[i-1]->h; - fprintf(stderr,"ok %d x %d \n",frames[i-1]->w,frames[i-1]->h); - } - fprintf(stderr,"%d frames loaded\n",cpt); - return 0; -} Deleted: trunk/planet.h =================================================================== --- trunk/planet.h 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/planet.h 2006-09-25 20:32:05 UTC (rev 8) @@ -1,32 +0,0 @@ -/* - trashpace - Cleaning the orbital space of Earth - - Copyright (C) 2006 david - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#include "SDL.h" - -class CPlanet -{ - public: - int init(char *dir); - SDL_Surface **frames; - int mNumFrames; - int mW,mH; - int r,g,b; // for transparent color -}; Added: trunk/sprite_base.cc =================================================================== --- trunk/sprite_base.cc (rev 0) +++ trunk/sprite_base.cc 2006-09-25 20:32:05 UTC (rev 8) @@ -0,0 +1,57 @@ + +#include "sprite_base.h" + +#include <string.h> + + +int CSpriteBase::init(char *dir) +{ + char buffer[255]; + char filename[255]; + char name[255]; + int pause=0, r=0, g=0, b=0; + FILE *fp; + + sprintf(filename, "%s/info", dir); + + if((fp=fopen(filename, "r")) == NULL) + { + printf("ERROR opening file %s\n\n", filename); + return -1; + } + + fgets(buffer, 255, fp); + sscanf(buffer, "FILES: %d", &mNumframes); + mAnim = new CSpriteFrame[mNumframes]; + + mBuilt = 1; + int count = 0; + + while(!feof(fp) && count<mNumframes) + { + fgets(buffer, 255, fp); + if(buffer[0] != '#' && buffer[0] != '\r' && buffer[0] != '\0' + && buffer[0] != '\n' && strlen(buffer) != 0) + { + sscanf(buffer, "%s %d %d %d %d", name, &pause, &r, &g, &b); + sprintf(filename, "%s/%s", dir, name); + SDL_Surface *temp; + if((temp = SDL_LoadBMP(filename)) == NULL) return -1; + + if(r >= 0) SDL_SetColorKey(temp, SDL_SRCCOLORKEY, + SDL_MapRGB(temp->format, r, g, b)); + + mAnim[count].image = SDL_DisplayFormat(temp); + SDL_FreeSurface(temp); + + mAnim[count].pause = pause; + if(!mW) mW = mAnim[count].image->w; + if(!mH) mH = mAnim[count].image->h; + + count++; + } + } + fclose(fp); + return 0; +} + Added: trunk/sprite_base.h =================================================================== --- trunk/sprite_base.h (rev 0) +++ trunk/sprite_base.h 2006-09-25 20:32:05 UTC (rev 8) @@ -0,0 +1,15 @@ +#ifndef __SPRITE_BASE__ +#define __SPRITE_BASE__ +#include <SDL/SDL.h> +#include "struct.h" + + +class CSpriteBase +{ + public: + int init(char *dir); + + CSpriteFrame *mAnim; + int mBuilt, mNumframes, mW, mH; +}; +#endif Added: trunk/sprites.cc =================================================================== --- trunk/sprites.cc (rev 0) +++ trunk/sprites.cc 2006-09-25 20:32:05 UTC (rev 8) @@ -0,0 +1,66 @@ +#include "sprites.h" +#include <string.h> +#include <stdio.h> +#include <stdlib.h> + + +int CSprite::init(CSpriteBase *base, SDL_Surface *screen) +{ + mSpriteBase = base; + if(mSpriteBase->mBuilt) + { + if(mSpriteBase->mNumframes>1) mAnimating=1; + mBackreplacement = + SDL_DisplayFormat(mSpriteBase->mAnim[0].image); + } + mScreen = screen; + return 0; +} + + +void CSprite::clearBG() +{ + if(mDrawn==1) + { + SDL_Rect dest; + dest.x = mOldX; + dest.y = mOldY; + dest.w = mSpriteBase->mW; + dest.h = mSpriteBase->mH; + SDL_BlitSurface(mBackreplacement, NULL, mScreen, &dest); + } +} + + +void CSprite::updateBG() +{ + SDL_Rect srcrect; + srcrect.w = mSpriteBase->mW; + srcrect.h = mSpriteBase->mH; + srcrect.x = mX; + srcrect.y = mY; + mOldX=mX;mOldY=mY; + SDL_BlitSurface(mScreen, &srcrect, mBackreplacement, NULL); +} + +void CSprite::draw() +{ + if(mAnimating == 1) + { + if(mLastupdate+mSpriteBase->mAnim[mFrame].pause*mSpeed< + SDL_GetTicks()) + { + mFrame++; + if(mFrame>mSpriteBase->mNumframes-1) mFrame=0; + mLastupdate = SDL_GetTicks(); + } + } + + if(mDrawn==0) mDrawn=1; + + SDL_Rect dest; + dest.x = mX; dest.y = mY; + SDL_BlitSurface(mSpriteBase->mAnim[mFrame].image, NULL, mScreen, + &dest); +} + Added: trunk/sprites.h =================================================================== --- trunk/sprites.h (rev 0) +++ trunk/sprites.h 2006-09-25 20:32:05 UTC (rev 8) @@ -0,0 +1,45 @@ + +#ifndef ___SPRITE___ +#define ___SPRITE___ +#include "struct.h" + +#include "sprite_base.h" + + +class CSprite +{ + public: + int init(CSpriteBase *base, SDL_Surface *screen); + void draw(); + void clearBG(); + void updateBG(); + + void setFrame(int nr) { mFrame = nr; } + int getFrame() { return mFrame; } + + void setSpeed(float nr) { mSpeed = nr; } + float getSpeed() { return mSpeed; } + + void toggleAnim() { mAnimating = !mAnimating; } + void startAnim() { mAnimating = 1; } + void stopAnim() { mAnimating = 0; } + void rewind() { mFrame = 0; } + + void xadd(int nr) { mX+=nr; } + void yadd(int nr) { mY+=nr; } + void xset(int nr) { mX=nr; } + void yset(int nr) { mY=nr; } + void set(int xx, int yy) { mX=xx; mY=yy; } + + private: + int mFrame; + int mX, mY, mOldX, mOldY; + int mAnimating; + int mDrawn; + float mSpeed; + long mLastupdate; + CSpriteBase *mSpriteBase; + SDL_Surface *mBackreplacement; + SDL_Surface *mScreen; +}; +#endif Added: trunk/struct.h =================================================================== --- trunk/struct.h (rev 0) +++ trunk/struct.h 2006-09-25 20:32:05 UTC (rev 8) @@ -0,0 +1,12 @@ +#ifndef ___STRUCT___ +#define ___STRUCT___ +#include <SDL/SDL.h> + +struct CSpriteFrame // helper structure +{ + SDL_Surface *image; + int pause; +}; + +#endif + Modified: trunk/trashpace.cc =================================================================== --- trunk/trashpace.cc 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/trashpace.cc 2006-09-25 20:32:05 UTC (rev 8) @@ -20,55 +20,28 @@ */ #include <stdio.h> +#include <stdlib.h> #include <sys/types.h> #include <getopt.h> + #include "system.h" + +#include <SDL/SDL.h> +#include "sprites.h" #include "trashpace.h" -#include "gametime.h" -#include "planet.h" +#include "helper.h" -void -DrawImg(SDL_Surface *img,int x,int y,SDL_Surface *screen){ - SDL_Rect dest; - dest.x = x; - dest.y = y; - if ( SDL_BlitSurface(img,NULL,screen,&dest) != 0){ - fprintf(stderr,"Error from DSL : %s \n",SDL_GetError()); - exit(1); - } -} -void -DrawBG(SDL_Surface *screen,SDL_Surface *background){ - DrawImg(background,0,0,screen); -} -void -DrawScene(SDL_Surface *screen,SDL_Surface *background){ - DrawBG(screen,background); - if (SDL_Flip(screen) != 0){ - fprintf(stderr,"Error from DSL : %s \n",SDL_GetError()); - exit(1); - } -} - int main (int argc, char **argv) { - int i; + Uint8* keys; + + char *program_name; program_name = argv[0]; - i = decode_switches (argc, argv); - - gameTime gt; - SDL_Surface *screen = NULL; - SDL_Surface *background = NULL; - SDL_Event event; - SDL_PixelFormat *pf = NULL; - Uint32 black; - Uint32 red; - Uint32 green; - Uint32 blue; + int i = decode_switches (argc, argv); if (SDL_Init(SDL_INIT_VIDEO) < 0){ fprintf(stderr,"Unable to init SDL: %s\n",SDL_GetError()); @@ -81,76 +54,79 @@ Uint32 flags=SDL_HWSURFACE | SDL_DOUBLEBUF; if (fullscreen) flags |= SDL_FULLSCREEN; - screen = SDL_SetVideoMode(width,heigth,depth,flags); + SDL_Surface *screen = SDL_SetVideoMode(width,heigth,depth,flags); if (screen == NULL) { fprintf(stderr,"Unable to set %d x %d x %d video: %s \n",width,heigth,depth,SDL_GetError()); } SDL_WM_SetCaption("Trashpace", NULL); - background=SDL_LoadBMP("images/trashpace.bmp"); + SDL_Surface *background=SDL_LoadBMP("images/trashpace.bmp"); if (background == NULL){ - fprintf(stderr,"Error from DSL : %s \n",SDL_GetError()); + fprintf(stderr,"Error from SDL : %s \n",SDL_GetError()); exit(1); } - DrawBG(screen,background); - CPlanet planet; - int ret=planet.init("sprites"); - if (ret) exit(1); - bool done=false; - while (!done) - { - // Loop while reading all pending event. - while (!done && SDL_PollEvent(&event)) - { - switch (event.type) - { - // Here we are looking for two special keys. If we - // get an event telling us that the escape key has - // been pressed the program will quit. If we see - // the F1 key we either start or stop the - // animation by starting or stopping the clock. + CSpriteBase planet_base; + CSprite planet; + planet_base.init("images/planet"); + planet.init(&planet_base,screen); + planet.set(480,50); + planet.setSpeed(1); - case SDL_KEYDOWN: - switch(event.key.keysym.sym) - { - case SDLK_ESCAPE: - done = true; - break; + // TODO: pas un satellite_base, mais un par type de satellite (chacun a sa propre animation) + CSpriteBase satellite_base; + satellite_base.init("images/satellite"); - case SDLK_F1: - - if (gt.stopped()) - { - gt.start(); - } - else - { - gt.stop(); - } - - break; + // pas un satellite, mais un group par type. On peut prevoir une classe Satellite deriv\xE9e de Sprite, avec la logique des orbites dedans + CSprite satellite; + satellite.init(&satellite_base,screen); + satellite.set(100,50); + satellite.setSpeed(1); - default: - break; - } - break; + // Prevoir une classe Ship, deriv\xE9e de satellite, avec la gestion du clavier, moteurs ... + CSpriteBase ship_base; + CSprite ship; + ship_base.init("images/ship"); + ship.init(&ship_base,screen); + ship.set(150,50); + ship.setSpeed(1); - // The SDL_QUIT event is generated when you click - // on the close button on a window. If we see that - // event we should exit the program. So, we do. + SDL_ShowCursor(0); - case SDL_QUIT: - done = true; - break; + DrawBG(screen,background); + + + int done=0; + + while(done == 0) + { + SDL_Event event; + + while ( SDL_PollEvent(&event) ) + { + if ( event.type == SDL_QUIT ) { done = 1; } + + // dispatcher les events vers la classe Ship + if ( event.type == SDL_KEYDOWN ) + { + if ( event.key.keysym.sym == SDLK_ESCAPE ) { done = 1; } + if ( event.key.keysym.sym == SDLK_SPACE){planet.toggleAnim();} } } - DrawScene(screen,background); + keys = SDL_GetKeyState(NULL); + + if ( keys[SDLK_UP] ) { ship.yadd(-1); } + if ( keys[SDLK_DOWN] ) { ship.yadd(1); } + if ( keys[SDLK_LEFT] ) { ship.xadd(-1); } + if ( keys[SDLK_RIGHT] ) { ship.xadd(1); } + + DrawScene(screen,&planet,&satellite,&ship); } - exit (0); + return 0; } + /* Set all the option flags according to the switches specified. Return the index of the first non-option argument. */ Modified: trunk/trashpace.h =================================================================== --- trunk/trashpace.h 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/trashpace.h 2006-09-25 20:32:05 UTC (rev 8) @@ -1,38 +1,29 @@ -/* - trashpace - Cleaning the orbital space of Earth +#include "SDL/SDL.h" - Copyright (C) 2006 david +SDL_Surface * ImageLoad(char *file); - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. +int InitImages(); - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +void DrawIMG(SDL_Surface *img, int x, int y); - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +void DrawBG(); -*/ +void DrawScene(); -#include "SDL.h" +static int decode_switches(int argc,char**argv); +static void usage(int status); + #define EXIT_FAILURE 1 #define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) #define abs(a) (((a)<0) ? -(a) : (a)) #define sign(a) (((a)<0) ? -1 : (a)>0 ? 1 : 0) - extern "C" { char *xstrdup (char *p); } -/* The name the program was run with, stripped of any leading path. */ char *program_name; /* Option flags and variables */ @@ -54,12 +45,5 @@ }; -static void usage (int status); -static int decode_switches (int argc, char **argv); - -void DrawImg(SDL_Surface *img,int x,int y,SDL_Surface *screen); - -void DrawBG(SDL_Surface *screen,SDL_Surface *background); - -void DrawScene(SDL_Surface *screen,SDL_Surface *background); +int main(int argc, char *argv[]); Modified: trunk/trashpace.lsm =================================================================== --- trunk/trashpace.lsm 2006-09-09 10:02:15 UTC (rev 7) +++ trunk/trashpace.lsm 2006-09-25 20:32:05 UTC (rev 8) @@ -1,7 +1,7 @@ Begin3 Title: trashpace Version: 0.1.0 -Entered-date: 2006-09-09 +Entered-date: 2006-09-25 Description: A game to clean the orbital space of Earth trashpace.lsm. Generated from trashpace.lsm.in by configure. Please edit trashpace.lsm.in to fix the Keywords and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2006-09-09 10:03:13
|
Revision: 7 http://svn.sourceforge.net/trashpace/?rev=7&view=rev Author: davidlopez Date: 2006-09-09 03:02:15 -0700 (Sat, 09 Sep 2006) Log Message: ----------- Added first sprite code, the earth Modified Paths: -------------- trunk/Makefile trunk/Makefile.am trunk/Makefile.in trunk/config.log trunk/config.status trunk/trashpace.cc trunk/trashpace.lsm Added Paths: ----------- trunk/planet.cc trunk/planet.h trunk/sprites/ trunk/sprites/map Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2006-08-30 20:54:48 UTC (rev 6) +++ trunk/Makefile 2006-09-09 10:02:15 UTC (rev 7) @@ -65,7 +65,7 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -ISODATE = 2006-08-27 +ISODATE = 2006-09-09 LDFLAGS = LIBOBJS = LIBS = @@ -124,7 +124,7 @@ AM_LIBS = `sdl-config --libs` bin_PROGRAMS = trashpace -trashpace_SOURCES = trashpace.cc gametime.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h +trashpace_SOURCES = trashpace.cc gametime.cc planet.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h # uncomment the following if trashpace requires the math library trashpace_LDADD = -lm -lSDL -lpthread @@ -150,7 +150,8 @@ PROGRAMS = $(bin_PROGRAMS) am_trashpace_OBJECTS = trashpace.$(OBJEXT) gametime.$(OBJEXT) \ - xmalloc.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) + planet.$(OBJEXT) xmalloc.$(OBJEXT) getopt.$(OBJEXT) \ + getopt1.$(OBJEXT) trashpace_OBJECTS = $(am_trashpace_OBJECTS) trashpace_DEPENDENCIES = trashpace_LDFLAGS = @@ -159,8 +160,8 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles DEP_FILES = ./$(DEPDIR)/gametime.Po ./$(DEPDIR)/getopt.Po \ - ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/trashpace.Po \ - ./$(DEPDIR)/xmalloc.Po + ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/planet.Po \ + ./$(DEPDIR)/trashpace.Po ./$(DEPDIR)/xmalloc.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -267,6 +268,7 @@ include ./$(DEPDIR)/gametime.Po include ./$(DEPDIR)/getopt.Po include ./$(DEPDIR)/getopt1.Po +include ./$(DEPDIR)/planet.Po include ./$(DEPDIR)/trashpace.Po include ./$(DEPDIR)/xmalloc.Po Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-08-30 20:54:48 UTC (rev 6) +++ trunk/Makefile.am 2006-09-09 10:02:15 UTC (rev 7) @@ -2,7 +2,7 @@ AM_LIBS=`sdl-config --libs` bin_PROGRAMS=trashpace -trashpace_SOURCES=trashpace.cc gametime.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h +trashpace_SOURCES=trashpace.cc gametime.cc planet.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h # uncomment the following if trashpace requires the math library trashpace_LDADD=-lm -lSDL -lpthread Modified: trunk/Makefile.in =================================================================== --- trunk/Makefile.in 2006-08-30 20:54:48 UTC (rev 6) +++ trunk/Makefile.in 2006-09-09 10:02:15 UTC (rev 7) @@ -124,7 +124,7 @@ AM_LIBS = `sdl-config --libs` bin_PROGRAMS = trashpace -trashpace_SOURCES = trashpace.cc gametime.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h +trashpace_SOURCES = trashpace.cc gametime.cc planet.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h # uncomment the following if trashpace requires the math library trashpace_LDADD = -lm -lSDL -lpthread @@ -150,7 +150,8 @@ PROGRAMS = $(bin_PROGRAMS) am_trashpace_OBJECTS = trashpace.$(OBJEXT) gametime.$(OBJEXT) \ - xmalloc.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) + planet.$(OBJEXT) xmalloc.$(OBJEXT) getopt.$(OBJEXT) \ + getopt1.$(OBJEXT) trashpace_OBJECTS = $(am_trashpace_OBJECTS) trashpace_DEPENDENCIES = trashpace_LDFLAGS = @@ -159,8 +160,8 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gametime.Po ./$(DEPDIR)/getopt.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/trashpace.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/xmalloc.Po +@AMDEP_TRUE@ ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/planet.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/trashpace.Po ./$(DEPDIR)/xmalloc.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -267,6 +268,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gametime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/planet.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trashpace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ Modified: trunk/config.log =================================================================== --- trunk/config.log 2006-08-30 20:54:48 UTC (rev 6) +++ trunk/config.log 2006-09-09 10:02:15 UTC (rev 7) @@ -1035,7 +1035,7 @@ INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s' -ISODATE='2006-08-27' +ISODATE='2006-09-09' LDFLAGS='' LIBOBJS='' LIBS='' Modified: trunk/config.status =================================================================== --- trunk/config.status 2006-08-30 20:54:48 UTC (rev 6) +++ trunk/config.status 2006-09-09 10:02:15 UTC (rev 7) @@ -503,7 +503,7 @@ s,@AWK@,gawk,;t t s,@SET_MAKE@,,;t t s,@am__leading_dot@,.,;t t -s,@ISODATE@,2006-08-27,;t t +s,@ISODATE@,2006-09-09,;t t s,@build@,i686-pc-linux-gnu,;t t s,@build_cpu@,i686,;t t s,@build_vendor@,pc,;t t Added: trunk/planet.cc =================================================================== --- trunk/planet.cc (rev 0) +++ trunk/planet.cc 2006-09-09 10:02:15 UTC (rev 7) @@ -0,0 +1,79 @@ +/* + trashpace - Cleaning the orbital space of Earth + + Copyright (C) 2006 david + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "planet.h" + +int CPlanet::init(char *dir) +{ + char buffer[255]; + char filename[255]; + char name[255]; + char mTemplate[255]; + int r=0,g=0,b=0; + FILE *fp; + + sprintf(filename,"%s/map",dir); + fprintf(stderr,"opening %s\n",filename); + if ((fp=fopen(filename,"r"))==NULL) + { + fprintf(stderr,"ERROR opening %s\n",filename); + return -1; + } + + fgets(buffer,255,fp); + sscanf(buffer,"FILES=%d",&mNumFrames); + fprintf(stderr,"map tells about %d frames\n",mNumFrames); + + fgets(buffer,255,fp); + sscanf(buffer,"TEMPLATE=%s",&mTemplate); + fprintf(stderr,"frames are named from "); + fprintf(stderr,mTemplate,1); + fprintf(stderr," to "); + fprintf(stderr,mTemplate,mNumFrames); + + fgets(buffer,255,fp); + sscanf(buffer,"TRANSPARENT=%d,%d,%d",&r,&g,&b); + fprintf(stderr,"\nTransparent components red %d,green %d and blue %d\n",r,g,b); + + fprintf(stderr,"Loading :"); + fclose(fp); + frames=new SDL_Surface*[mNumFrames]; + int cpt=0; + for (int i=1;i<=mNumFrames;i++){ + sprintf(filename,mTemplate,i); + fprintf(stderr,"%s ",filename); + SDL_Surface *temp; + if((temp = SDL_LoadBMP(filename))== NULL) + { + fprintf(stderr,"Error from DSL : %s \n",SDL_GetError()); + return -1; + } + SDL_SetColorKey(temp,SDL_SRCCOLORKEY,SDL_MapRGB(temp->format,r,g,b)); + frames[i-1] = SDL_DisplayFormat(temp); + cpt++; + SDL_FreeSurface(temp); + if (!mW) mW=frames[i-1]->w; + if (!mH) mH=frames[i-1]->h; + fprintf(stderr,"ok %d x %d \n",frames[i-1]->w,frames[i-1]->h); + } + fprintf(stderr,"%d frames loaded\n",cpt); + return 0; +} Added: trunk/planet.h =================================================================== --- trunk/planet.h (rev 0) +++ trunk/planet.h 2006-09-09 10:02:15 UTC (rev 7) @@ -0,0 +1,32 @@ +/* + trashpace - Cleaning the orbital space of Earth + + Copyright (C) 2006 david + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "SDL.h" + +class CPlanet +{ + public: + int init(char *dir); + SDL_Surface **frames; + int mNumFrames; + int mW,mH; + int r,g,b; // for transparent color +}; Added: trunk/sprites/map =================================================================== --- trunk/sprites/map (rev 0) +++ trunk/sprites/map 2006-09-09 10:02:15 UTC (rev 7) @@ -0,0 +1,4 @@ +FILES=48 +TEMPLATE=sprites/earth%02d.bmp +TRANSPARENT=255,255,255 + Modified: trunk/trashpace.cc =================================================================== --- trunk/trashpace.cc 2006-08-30 20:54:48 UTC (rev 6) +++ trunk/trashpace.cc 2006-09-09 10:02:15 UTC (rev 7) @@ -25,6 +25,7 @@ #include "system.h" #include "trashpace.h" #include "gametime.h" +#include "planet.h" void DrawImg(SDL_Surface *img,int x,int y,SDL_Surface *screen){ @@ -82,7 +83,7 @@ screen = SDL_SetVideoMode(width,heigth,depth,flags); if (screen == NULL) { - fprintf(stderr,"Unable to set 640x480 video: %s \n",SDL_GetError()); + fprintf(stderr,"Unable to set %d x %d x %d video: %s \n",width,heigth,depth,SDL_GetError()); } SDL_WM_SetCaption("Trashpace", NULL); @@ -93,7 +94,9 @@ exit(1); } DrawBG(screen,background); - + CPlanet planet; + int ret=planet.init("sprites"); + if (ret) exit(1); bool done=false; while (!done) { Modified: trunk/trashpace.lsm =================================================================== --- trunk/trashpace.lsm 2006-08-30 20:54:48 UTC (rev 6) +++ trunk/trashpace.lsm 2006-09-09 10:02:15 UTC (rev 7) @@ -1,7 +1,7 @@ Begin3 Title: trashpace Version: 0.1.0 -Entered-date: 2006-08-27 +Entered-date: 2006-09-09 Description: A game to clean the orbital space of Earth trashpace.lsm. Generated from trashpace.lsm.in by configure. Please edit trashpace.lsm.in to fix the Keywords and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2006-08-28 21:41:48
|
Revision: 5 Author: davidlopez Date: 2006-08-28 14:37:33 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/trashpace/?rev=5&view=rev Log Message: ----------- End splitting files Begin of pov sources for earth animation Modified Paths: -------------- trunk/Makefile trunk/Makefile.in trunk/config.log trunk/config.status trunk/gametime.cc trunk/gametime.h trunk/trashpace.cc trunk/trashpace.lsm Added Paths: ----------- trunk/pov/ trunk/pov/Makefile trunk/pov/earth.pov trunk/pov/earth_map.png trunk/trashpace.h Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2006-08-26 22:22:14 UTC (rev 4) +++ trunk/Makefile 2006-08-28 21:37:33 UTC (rev 5) @@ -36,14 +36,14 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = i686-pc-linux-gnu -ACLOCAL = ${SHELL} /home/david/dvlp/svn/trunk/missing --run aclocal-1.7 +ACLOCAL = ${SHELL} /home/david/dvlp/SF/trunk/missing --run aclocal-1.7 ALLOCA = AMDEP_FALSE = # AMDEP_TRUE = -AMTAR = ${SHELL} /home/david/dvlp/svn/trunk/missing --run tar -AUTOCONF = ${SHELL} /home/david/dvlp/svn/trunk/missing --run autoconf -AUTOHEADER = ${SHELL} /home/david/dvlp/svn/trunk/missing --run autoheader -AUTOMAKE = ${SHELL} /home/david/dvlp/svn/trunk/missing --run automake-1.7 +AMTAR = ${SHELL} /home/david/dvlp/SF/trunk/missing --run tar +AUTOCONF = ${SHELL} /home/david/dvlp/SF/trunk/missing --run autoconf +AUTOHEADER = ${SHELL} /home/david/dvlp/SF/trunk/missing --run autoheader +AUTOMAKE = ${SHELL} /home/david/dvlp/SF/trunk/missing --run automake-1.7 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -65,12 +65,12 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -ISODATE = 2006-08-14 +ISODATE = 2006-08-27 LDFLAGS = LIBOBJS = LIBS = LTLIBOBJS = -MAKEINFO = ${SHELL} /home/david/dvlp/svn/trunk/missing --run makeinfo +MAKEINFO = ${SHELL} /home/david/dvlp/SF/trunk/missing --run makeinfo OBJEXT = o PACKAGE = trashpace PACKAGE_BUGREPORT = @@ -108,7 +108,7 @@ host_vendor = pc includedir = ${prefix}/include infodir = ${prefix}/info -install_sh = /home/david/dvlp/svn/trunk/install-sh +install_sh = /home/david/dvlp/SF/trunk/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localstatedir = ${prefix}/var @@ -124,7 +124,7 @@ AM_LIBS = `sdl-config --libs` bin_PROGRAMS = trashpace -trashpace_SOURCES = trashpace.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h +trashpace_SOURCES = trashpace.cc gametime.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h # uncomment the following if trashpace requires the math library trashpace_LDADD = -lm -lSDL -lpthread @@ -149,8 +149,8 @@ bin_PROGRAMS = trashpace$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) -am_trashpace_OBJECTS = trashpace.$(OBJEXT) xmalloc.$(OBJEXT) \ - getopt.$(OBJEXT) getopt1.$(OBJEXT) +am_trashpace_OBJECTS = trashpace.$(OBJEXT) gametime.$(OBJEXT) \ + xmalloc.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) trashpace_OBJECTS = $(am_trashpace_OBJECTS) trashpace_DEPENDENCIES = trashpace_LDFLAGS = @@ -158,8 +158,9 @@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -DEP_FILES = ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/getopt1.Po \ - ./$(DEPDIR)/trashpace.Po ./$(DEPDIR)/xmalloc.Po +DEP_FILES = ./$(DEPDIR)/gametime.Po ./$(DEPDIR)/getopt.Po \ + ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/trashpace.Po \ + ./$(DEPDIR)/xmalloc.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -263,6 +264,7 @@ distclean-compile: -rm -f *.tab.c +include ./$(DEPDIR)/gametime.Po include ./$(DEPDIR)/getopt.Po include ./$(DEPDIR)/getopt1.Po include ./$(DEPDIR)/trashpace.Po Modified: trunk/Makefile.in =================================================================== --- trunk/Makefile.in 2006-08-26 22:22:14 UTC (rev 4) +++ trunk/Makefile.in 2006-08-28 21:37:33 UTC (rev 5) @@ -124,7 +124,7 @@ AM_LIBS = `sdl-config --libs` bin_PROGRAMS = trashpace -trashpace_SOURCES = trashpace.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h +trashpace_SOURCES = trashpace.cc gametime.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h # uncomment the following if trashpace requires the math library trashpace_LDADD = -lm -lSDL -lpthread @@ -149,8 +149,8 @@ bin_PROGRAMS = trashpace$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) -am_trashpace_OBJECTS = trashpace.$(OBJEXT) xmalloc.$(OBJEXT) \ - getopt.$(OBJEXT) getopt1.$(OBJEXT) +am_trashpace_OBJECTS = trashpace.$(OBJEXT) gametime.$(OBJEXT) \ + xmalloc.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) trashpace_OBJECTS = $(am_trashpace_OBJECTS) trashpace_DEPENDENCIES = trashpace_LDFLAGS = @@ -158,8 +158,9 @@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/getopt1.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/trashpace.Po ./$(DEPDIR)/xmalloc.Po +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gametime.Po ./$(DEPDIR)/getopt.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/trashpace.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/xmalloc.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -263,6 +264,7 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gametime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trashpace.Po@am__quote@ Modified: trunk/config.log =================================================================== --- trunk/config.log 2006-08-26 22:22:14 UTC (rev 4) +++ trunk/config.log 2006-08-28 21:37:33 UTC (rev 5) @@ -1005,15 +1005,15 @@ ## Output variables. ## ## ----------------- ## -ACLOCAL='${SHELL} /home/david/dvlp/svn/trunk/missing --run aclocal-1.7' +ACLOCAL='${SHELL} /home/david/dvlp/SF/trunk/missing --run aclocal-1.7' ALLOCA='' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' -AMTAR='${SHELL} /home/david/dvlp/svn/trunk/missing --run tar' -AUTOCONF='${SHELL} /home/david/dvlp/svn/trunk/missing --run autoconf' -AUTOHEADER='${SHELL} /home/david/dvlp/svn/trunk/missing --run autoheader' -AUTOMAKE='${SHELL} /home/david/dvlp/svn/trunk/missing --run automake-1.7' +AMTAR='${SHELL} /home/david/dvlp/SF/trunk/missing --run tar' +AUTOCONF='${SHELL} /home/david/dvlp/SF/trunk/missing --run autoconf' +AUTOHEADER='${SHELL} /home/david/dvlp/SF/trunk/missing --run autoheader' +AUTOMAKE='${SHELL} /home/david/dvlp/SF/trunk/missing --run automake-1.7' AWK='gawk' CC='gcc' CCDEPMODE='depmode=gcc3' @@ -1035,12 +1035,12 @@ INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s' -ISODATE='2006-08-14' +ISODATE='2006-08-27' LDFLAGS='' LIBOBJS='' LIBS='' LTLIBOBJS='' -MAKEINFO='${SHELL} /home/david/dvlp/svn/trunk/missing --run makeinfo' +MAKEINFO='${SHELL} /home/david/dvlp/SF/trunk/missing --run makeinfo' OBJEXT='o' PACKAGE='trashpace' PACKAGE_BUGREPORT='' @@ -1078,7 +1078,7 @@ host_vendor='pc' includedir='${prefix}/include' infodir='${prefix}/info' -install_sh='/home/david/dvlp/svn/trunk/install-sh' +install_sh='/home/david/dvlp/SF/trunk/install-sh' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localstatedir='${prefix}/var' @@ -1137,21 +1137,3 @@ extern "C" void std::exit (int) throw (); using std::exit; configure: exit 0 - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by config.status, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status Makefile depfiles - -on rhianon - -config.status:743: creating Makefile -config.status:1133: executing depfiles commands Modified: trunk/config.status =================================================================== --- trunk/config.status 2006-08-26 22:22:14 UTC (rev 4) +++ trunk/config.status 2006-08-28 21:37:33 UTC (rev 5) @@ -490,20 +490,20 @@ s,@CYGPATH_W@,echo,;t t s,@PACKAGE@,trashpace,;t t s,@VERSION@,0.1.0,;t t -s,@ACLOCAL@,${SHELL} /home/david/dvlp/svn/trunk/missing --run aclocal-1.7,;t t -s,@AUTOCONF@,${SHELL} /home/david/dvlp/svn/trunk/missing --run autoconf,;t t -s,@AUTOMAKE@,${SHELL} /home/david/dvlp/svn/trunk/missing --run automake-1.7,;t t -s,@AUTOHEADER@,${SHELL} /home/david/dvlp/svn/trunk/missing --run autoheader,;t t -s,@MAKEINFO@,${SHELL} /home/david/dvlp/svn/trunk/missing --run makeinfo,;t t -s,@AMTAR@,${SHELL} /home/david/dvlp/svn/trunk/missing --run tar,;t t -s,@install_sh@,/home/david/dvlp/svn/trunk/install-sh,;t t +s,@ACLOCAL@,${SHELL} /home/david/dvlp/SF/trunk/missing --run aclocal-1.7,;t t +s,@AUTOCONF@,${SHELL} /home/david/dvlp/SF/trunk/missing --run autoconf,;t t +s,@AUTOMAKE@,${SHELL} /home/david/dvlp/SF/trunk/missing --run automake-1.7,;t t +s,@AUTOHEADER@,${SHELL} /home/david/dvlp/SF/trunk/missing --run autoheader,;t t +s,@MAKEINFO@,${SHELL} /home/david/dvlp/SF/trunk/missing --run makeinfo,;t t +s,@AMTAR@,${SHELL} /home/david/dvlp/SF/trunk/missing --run tar,;t t +s,@install_sh@,/home/david/dvlp/SF/trunk/install-sh,;t t s,@STRIP@,,;t t s,@ac_ct_STRIP@,,;t t s,@INSTALL_STRIP_PROGRAM@,${SHELL} $(install_sh) -c -s,;t t s,@AWK@,gawk,;t t s,@SET_MAKE@,,;t t s,@am__leading_dot@,.,;t t -s,@ISODATE@,2006-08-14,;t t +s,@ISODATE@,2006-08-27,;t t s,@build@,i686-pc-linux-gnu,;t t s,@build_cpu@,i686,;t t s,@build_vendor@,pc,;t t Modified: trunk/gametime.cc =================================================================== --- trunk/gametime.cc 2006-08-26 22:22:14 UTC (rev 4) +++ trunk/gametime.cc 2006-08-28 21:37:33 UTC (rev 5) @@ -1,3 +1,24 @@ +/* + trashpace - Cleaning the orbital space of Earth + + Copyright (C) 2006 david + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + #include "gametime.h" gameTime::gameTime() Modified: trunk/gametime.h =================================================================== --- trunk/gametime.h 2006-08-26 22:22:14 UTC (rev 4) +++ trunk/gametime.h 2006-08-28 21:37:33 UTC (rev 5) @@ -1,3 +1,25 @@ +/* + trashpace - Cleaning the orbital space of Earth + + Copyright (C) 2006 david + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +#include "SDL.h" + class gameTime { private: @@ -7,9 +29,8 @@ public: gameTime(); - ~gameTime(); void start(); void stop(); bool stopped(); - int time() + int time(); }; Added: trunk/pov/Makefile =================================================================== --- trunk/pov/Makefile (rev 0) +++ trunk/pov/Makefile 2006-08-28 21:37:33 UTC (rev 5) @@ -0,0 +1,2 @@ +earth.png : earth.pov + povray -SF1 -EF36 -KC earth.pov Added: trunk/pov/earth.pov =================================================================== --- trunk/pov/earth.pov (rev 0) +++ trunk/pov/earth.pov 2006-08-28 21:37:33 UTC (rev 5) @@ -0,0 +1,62 @@ + +#include "colors.inc" + +#declare earth_radius=6366; //earth sphere's radius + +#declare pigmap1= +pigment{ + average + pigment_map{ + [1 + image_map{ + png "earth_map.png" + map_type 1 + interpolate 4 + } + scale earth_radius + ] + } +} + +#declare earth=union{ + sphere{0,earth_radius + texture{ + pigment{pigmap1} + } + } + + difference{ + sphere{0,earth_radius+100} + sphere{0,earth_radius+0.01} + hollow + pigment{rgbf 1} + interior{ + media{ + scattering{2,<0.0005,0.0005,0.001>*.5} + intervals 5 + } + } + } + +} + + +camera{ +location<0,0,-40000> + +look_at 0 + +angle 30 +} + +light_source{ +<1000,100,-100000> +color White*1.4 +} + +background{rgb .05} + +//object{earth rotate y*-130 rotate x*-20} + +object{earth rotate x*-90 rotate z*10* clock} + Property changes on: trunk/pov/earth.pov ___________________________________________________________________ Name: svn:executable + * Added: trunk/pov/earth_map.png =================================================================== (Binary files differ) Property changes on: trunk/pov/earth_map.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/trashpace.cc =================================================================== --- trunk/trashpace.cc 2006-08-26 22:22:14 UTC (rev 4) +++ trunk/trashpace.cc 2006-08-28 21:37:33 UTC (rev 5) @@ -23,49 +23,11 @@ #include <sys/types.h> #include <getopt.h> #include "system.h" +#include "trashpace.h" #include "gametime.h" -#include "SDL.h" -#define EXIT_FAILURE 1 - -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#define abs(a) (((a)<0) ? -(a) : (a)) -#define sign(a) (((a)<0) ? -1 : (a)>0 ? 1 : 0) - - -extern "C" { - char *xstrdup (char *p); -} - -static void usage (int status); - -/* The name the program was run with, stripped of any leading path. */ -char *program_name; - -/* Option flags and variables */ -int width=640; -int heigth=480; -int depth=32; -int fullscreen=0; - -static struct option const long_options[] = -{ - {"help", no_argument, 0, 'h'}, - {"version", no_argument, 0, 'V'}, - {"width", required_argument , &width , 'w'}, - {"height", required_argument, &heigth , 'H'}, - {"depth", required_argument, &depth , 'd'}, - {"fullscreen", no_argument, 0, 'f'}, - {NULL, 0, NULL, 0} -}; - -static int decode_switches (int argc, char **argv); - - - - -void DrawImg(SDL_Surface *img,int x,int y,SDL_Surface *screen){ +void +DrawImg(SDL_Surface *img,int x,int y,SDL_Surface *screen){ SDL_Rect dest; dest.x = x; dest.y = y; @@ -75,11 +37,13 @@ } } -void DrawBG(SDL_Surface *screen,SDL_Surface *background){ +void +DrawBG(SDL_Surface *screen,SDL_Surface *background){ DrawImg(background,0,0,screen); } -void DrawScene(SDL_Surface *screen,SDL_Surface *background){ +void +DrawScene(SDL_Surface *screen,SDL_Surface *background){ DrawBG(screen,background); if (SDL_Flip(screen) != 0){ fprintf(stderr,"Error from DSL : %s \n",SDL_GetError()); Added: trunk/trashpace.h =================================================================== --- trunk/trashpace.h (rev 0) +++ trunk/trashpace.h 2006-08-28 21:37:33 UTC (rev 5) @@ -0,0 +1,65 @@ +/* + trashpace - Cleaning the orbital space of Earth + + Copyright (C) 2006 david + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "SDL.h" + +#define EXIT_FAILURE 1 +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#define abs(a) (((a)<0) ? -(a) : (a)) +#define sign(a) (((a)<0) ? -1 : (a)>0 ? 1 : 0) + + +extern "C" { + char *xstrdup (char *p); +} + +/* The name the program was run with, stripped of any leading path. */ +char *program_name; + +/* Option flags and variables */ +int width=640; +int heigth=480; +int depth=32; +int fullscreen=0; + + +static struct option const long_options[] = +{ + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {"width", required_argument , &width , 'w'}, + {"height", required_argument, &heigth , 'H'}, + {"depth", required_argument, &depth , 'd'}, + {"fullscreen", no_argument, 0, 'f'}, + {NULL, 0, NULL, 0} +}; + + +static void usage (int status); + +static int decode_switches (int argc, char **argv); + +void DrawImg(SDL_Surface *img,int x,int y,SDL_Surface *screen); + +void DrawBG(SDL_Surface *screen,SDL_Surface *background); + +void DrawScene(SDL_Surface *screen,SDL_Surface *background); Modified: trunk/trashpace.lsm =================================================================== --- trunk/trashpace.lsm 2006-08-26 22:22:14 UTC (rev 4) +++ trunk/trashpace.lsm 2006-08-28 21:37:33 UTC (rev 5) @@ -1,7 +1,7 @@ Begin3 Title: trashpace Version: 0.1.0 -Entered-date: 2006-08-14 +Entered-date: 2006-08-27 Description: A game to clean the orbital space of Earth trashpace.lsm. Generated from trashpace.lsm.in by configure. Please edit trashpace.lsm.in to fix the Keywords and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2006-08-26 22:23:06
|
Revision: 4 Author: davidlopez Date: 2006-08-26 15:22:14 -0700 (Sat, 26 Aug 2006) ViewCVS: http://svn.sourceforge.net/trashpace/?rev=4&view=rev Log Message: ----------- get out gametime class from trashpace file Modified Paths: -------------- trunk/Makefile.am trunk/trashpace.cc Added Paths: ----------- trunk/gametime.cc trunk/gametime.h Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-08-15 06:52:06 UTC (rev 3) +++ trunk/Makefile.am 2006-08-26 22:22:14 UTC (rev 4) @@ -2,7 +2,7 @@ AM_LIBS=`sdl-config --libs` bin_PROGRAMS=trashpace -trashpace_SOURCES=trashpace.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h +trashpace_SOURCES=trashpace.cc gametime.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h # uncomment the following if trashpace requires the math library trashpace_LDADD=-lm -lSDL -lpthread Added: trunk/gametime.cc =================================================================== --- trunk/gametime.cc (rev 0) +++ trunk/gametime.cc 2006-08-26 22:22:14 UTC (rev 4) @@ -0,0 +1,47 @@ +#include "gametime.h" + +gameTime::gameTime() +{ + startTime = 0; + baseTime = 0; + running = false; +} + +void +gameTime::start() +{ + if (!running) + { + startTime = SDL_GetTicks(); + running = true; + } +} + +void +gameTime::stop() +{ + if (running) + { + baseTime = baseTime + (SDL_GetTicks() - startTime); + running = false; + } +} + +bool +gameTime::stopped() +{ + return !running; +} + +int +gameTime::time() +{ + if (running) + { + return baseTime + (SDL_GetTicks() - startTime); + } + else + { + return baseTime; + } +} Added: trunk/gametime.h =================================================================== --- trunk/gametime.h (rev 0) +++ trunk/gametime.h 2006-08-26 22:22:14 UTC (rev 4) @@ -0,0 +1,15 @@ +class gameTime +{ +private: + int startTime; + int baseTime; + bool running; + +public: + gameTime(); + ~gameTime(); + void start(); + void stop(); + bool stopped(); + int time() +}; Modified: trunk/trashpace.cc =================================================================== --- trunk/trashpace.cc 2006-08-15 06:52:06 UTC (rev 3) +++ trunk/trashpace.cc 2006-08-26 22:22:14 UTC (rev 4) @@ -23,7 +23,7 @@ #include <sys/types.h> #include <getopt.h> #include "system.h" - +#include "gametime.h" #include "SDL.h" #define EXIT_FAILURE 1 @@ -64,73 +64,7 @@ -class gameTime -{ -private: - int startTime; // Last time the clock was - // started. - int baseTime; // How much game time passed - // before the last time the - // clock was started. - bool running; // Is the clock running or - // not? -public: - - // Initialize the class variables. At this point no game - // time has elapsed and the clock is not running. - - gameTime() - { - startTime = 0; - baseTime = 0; - running = false; - } - - // Start the clock. - - void start() - { - if (!running) - { - startTime = SDL_GetTicks(); - running = true; - } - } - - // stop the clock - - void stop() - { - if (running) - { - baseTime = baseTime + (SDL_GetTicks() - startTime); - running = false; - } - } - - // True if the clock is paused. - - bool stopped() - { - return !running; - } - - // Get this clocks current time in milliseconds. - - int time() - { - if (running) - { - return baseTime + (SDL_GetTicks() - startTime); - } - else - { - return baseTime; - } - } -}; - void DrawImg(SDL_Surface *img,int x,int y,SDL_Surface *screen){ SDL_Rect dest; dest.x = x; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2006-08-15 06:56:53
|
Revision: 3 Author: davidlopez Date: 2006-08-14 23:52:06 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/trashpace/?rev=3&view=rev Log Message: ----------- Background added switchs work and are documented (on man page also) window size (and fullscreen mode) follows command line switches Added return code for each SDl function Modified Paths: -------------- trunk/TODO trunk/trashpace.1 trunk/trashpace.cc Added Paths: ----------- trunk/images/ trunk/images/trashpace.bmp Modified: trunk/TODO =================================================================== --- trunk/TODO 2006-08-14 13:11:12 UTC (rev 2) +++ trunk/TODO 2006-08-15 06:52:06 UTC (rev 3) @@ -1,5 +1,3 @@ -Flags -w and -H does'nt work. -Build the Surface and load the background (as JPG or PNG version) Build the Earth sprite Create the Earth animation Build the rocket sprite Added: trunk/images/trashpace.bmp =================================================================== (Binary files differ) Property changes on: trunk/images/trashpace.bmp ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/trashpace.1 =================================================================== --- trunk/trashpace.1 2006-08-14 13:11:12 UTC (rev 2) +++ trunk/trashpace.1 2006-08-15 06:52:06 UTC (rev 3) @@ -13,7 +13,7 @@ .\" along with this program; see the file COPYING. If not, write to .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. .\" -.TH TRASHPACE 1 "July 28, 2006" +.TH TRASHPACE 1 "August 15, 2006" .\" Please update the above date whenever this man page is modified. .\" .\" Some roff macros, for reference: @@ -27,14 +27,14 @@ .\" .sp <n> insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME -trashpace \- A game to clean the orbital space of Earth +trashpace \- A game where you are to clean the orbital space of Earth .SH SYNOPSIS .B trashpace .RI [ options ] .SH DESCRIPTION -\fBtrashpace\fP washes your windows, mends your fences, mows your lawn... +\fBtrashpace\fP prepares you to the near future, when too many orbital trash will be a real problem .PP -It also... +It also tries to be fun, but thah depends a bit of yourself .SH OPTIONS \fBtrashpace\fP accepts the following options: .TP @@ -43,8 +43,22 @@ .TP .B \-V, \-\-version Show version of program. -.\" .SH "SEE ALSO" -.\" .BR foo (1), -.\" .BR bar (1). +.TP +.B \-w, \-\-width +Screen width, on pixels, defaults to 640. +.TP +.B \-H, \-\-heigth +Screen heigth, on pixels, defaults to 480.. +.TP +.B \-d, \-\-depth +Color depth, on bits by pixel (defaults to 32, 0 stands at current mode) +.TP +.B \-f, \-\-fullscreen +Fullscreen toggle, defaults to 0, witch means windowed screen + +.BR + +.SH "SEE ALSO" +.BR trashpace-rules (1), .SH AUTHOR david <dav...@fr...>. Modified: trunk/trashpace.cc =================================================================== --- trunk/trashpace.cc 2006-08-14 13:11:12 UTC (rev 2) +++ trunk/trashpace.cc 2006-08-15 06:52:06 UTC (rev 3) @@ -46,14 +46,17 @@ /* Option flags and variables */ int width=640; int heigth=480; +int depth=32; +int fullscreen=0; - static struct option const long_options[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, {"width", required_argument , &width , 'w'}, {"height", required_argument, &heigth , 'H'}, + {"depth", required_argument, &depth , 'd'}, + {"fullscreen", no_argument, 0, 'f'}, {NULL, 0, NULL, 0} }; @@ -128,7 +131,28 @@ } }; +void DrawImg(SDL_Surface *img,int x,int y,SDL_Surface *screen){ + SDL_Rect dest; + dest.x = x; + dest.y = y; + if ( SDL_BlitSurface(img,NULL,screen,&dest) != 0){ + fprintf(stderr,"Error from DSL : %s \n",SDL_GetError()); + exit(1); + } +} +void DrawBG(SDL_Surface *screen,SDL_Surface *background){ + DrawImg(background,0,0,screen); +} + +void DrawScene(SDL_Surface *screen,SDL_Surface *background){ + DrawBG(screen,background); + if (SDL_Flip(screen) != 0){ + fprintf(stderr,"Error from DSL : %s \n",SDL_GetError()); + exit(1); + } +} + int main (int argc, char **argv) { @@ -148,20 +172,30 @@ Uint32 blue; if (SDL_Init(SDL_INIT_VIDEO) < 0){ - printf("Unable to init SDL: %s\n",SDL_GetError()); + fprintf(stderr,"Unable to init SDL: %s\n",SDL_GetError()); exit(1); } + atexit(SDL_Quit); + + printf(" width=%d \n heigth=%d \n depth =%d \n",width,heigth,depth); - int screenWidth = width; - int screenHeight = heigth; - printf("width=%d , heigth=%d \n",width,heigth); - screen = SDL_SetVideoMode(640,480,32,SDL_HWSURFACE | SDL_DOUBLEBUF); + Uint32 flags=SDL_HWSURFACE | SDL_DOUBLEBUF; + if (fullscreen) flags |= SDL_FULLSCREEN; + + screen = SDL_SetVideoMode(width,heigth,depth,flags); if (screen == NULL) { - printf("Unable to set 640x480 video: %s \n",SDL_GetError()); + fprintf(stderr,"Unable to set 640x480 video: %s \n",SDL_GetError()); } - // background=SDL_LoadBMP("images/trashpace.jpg"); + SDL_WM_SetCaption("Trashpace", NULL); + background=SDL_LoadBMP("images/trashpace.bmp"); + if (background == NULL){ + fprintf(stderr,"Error from DSL : %s \n",SDL_GetError()); + exit(1); + } + DrawBG(screen,background); + bool done=false; while (!done) { @@ -211,6 +245,7 @@ break; } } + DrawScene(screen,background); } exit (0); } @@ -222,13 +257,14 @@ decode_switches (int argc, char **argv) { int c; - - + int ret=0; while ((c = getopt_long (argc, argv, "h" /* help */ "V" /* version */ "w:" /* screen width (defaults 640) */ - "H:", /* screen height (480) */ + "H:" /* screen height (480) */ + "d:" /* color depth (32) */ + "f", /* Fullscreen */ long_options, (int *) 0)) != EOF) { switch (c) @@ -236,18 +272,47 @@ case 'V': printf ("trashpace %s\n", VERSION); exit (0); - + break; case 'h': usage (0); - + break; case 'w': - // width = c; - + ret=sscanf(optarg,"%d",&width); + if (ret==0 || width <=0){ + fprintf(stderr,"Width must be a positive integer\n"); + exit(1); + } + break; case 'H': - // heigth = c; - + ret=sscanf(optarg,"%d",&heigth); + if (ret==0 || heigth <= 0){ + fprintf(stderr,"Heigth must be a positive integer\n"); + exit(1); + } + break; + case 'd': + ret=sscanf(optarg,"%d",&depth); + if (ret==0){ + fprintf(stderr,"Depth must be an integer\n"); + exit(1); + } + if (depth!= 0 // use current + && depth != 8 + && depth != 16 + && depth != 24 + && depth != 32 + ) + { + fprintf(stderr,"Depth's legal values are 0, 8, 16, 24 and 32 \n"); + exit(1); + } + + break; + case 'f': + fullscreen=1; + break; default: - usage (EXIT_FAILURE); + usage (EXIT_FAILURE); } } @@ -265,6 +330,8 @@ Options:\n\ -w, --width Screen width [640]\n\ -H, --height Screen height [480]\n\ + -d, --depth color depth (32)\n\ + -f, --fullscreen fullscreen (0)\n\ -h, --help display this help and exit\n\ -V, --version output version information and exit\n\ ")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2006-08-14 13:12:00
|
Revision: 2 Author: davidlopez Date: 2006-08-14 06:11:12 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/trashpace/?rev=2&view=rev Log Message: ----------- Compile properly with automake toolchain Added main sdl loop Modified Paths: -------------- trunk/Makefile trunk/Makefile.am trunk/Makefile.in trunk/TODO trunk/config.log trunk/config.status trunk/trashpace.cc trunk/trashpace.lsm Removed Paths: ------------- trunk/Makefile2 Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2006-08-13 11:49:08 UTC (rev 1) +++ trunk/Makefile 2006-08-14 13:11:12 UTC (rev 2) @@ -36,14 +36,14 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = i686-pc-linux-gnu -ACLOCAL = ${SHELL} /home/david/dvlp/trashpace/missing --run aclocal-1.7 +ACLOCAL = ${SHELL} /home/david/dvlp/svn/trunk/missing --run aclocal-1.7 ALLOCA = AMDEP_FALSE = # AMDEP_TRUE = -AMTAR = ${SHELL} /home/david/dvlp/trashpace/missing --run tar -AUTOCONF = ${SHELL} /home/david/dvlp/trashpace/missing --run autoconf -AUTOHEADER = ${SHELL} /home/david/dvlp/trashpace/missing --run autoheader -AUTOMAKE = ${SHELL} /home/david/dvlp/trashpace/missing --run automake-1.7 +AMTAR = ${SHELL} /home/david/dvlp/svn/trunk/missing --run tar +AUTOCONF = ${SHELL} /home/david/dvlp/svn/trunk/missing --run autoconf +AUTOHEADER = ${SHELL} /home/david/dvlp/svn/trunk/missing --run autoheader +AUTOMAKE = ${SHELL} /home/david/dvlp/svn/trunk/missing --run automake-1.7 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -65,12 +65,12 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -ISODATE = 2006-08-13 +ISODATE = 2006-08-14 LDFLAGS = LIBOBJS = LIBS = LTLIBOBJS = -MAKEINFO = ${SHELL} /home/david/dvlp/trashpace/missing --run makeinfo +MAKEINFO = ${SHELL} /home/david/dvlp/svn/trunk/missing --run makeinfo OBJEXT = o PACKAGE = trashpace PACKAGE_BUGREPORT = @@ -108,7 +108,7 @@ host_vendor = pc includedir = ${prefix}/include infodir = ${prefix}/info -install_sh = /home/david/dvlp/trashpace/install-sh +install_sh = /home/david/dvlp/svn/trunk/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localstatedir = ${prefix}/var @@ -126,9 +126,9 @@ bin_PROGRAMS = trashpace trashpace_SOURCES = trashpace.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h - # uncomment the following if trashpace requires the math library -#trashpace_LDADD=-lm +trashpace_LDADD = -lm -lSDL -lpthread + EXTRA_DIST = trashpace.lsm.in #NAME.texinfo trashpace.spec.in # if you write a self-test script named `chk', uncomment the @@ -152,7 +152,6 @@ am_trashpace_OBJECTS = trashpace.$(OBJEXT) xmalloc.$(OBJEXT) \ getopt.$(OBJEXT) getopt1.$(OBJEXT) trashpace_OBJECTS = $(am_trashpace_OBJECTS) -trashpace_LDADD = $(LDADD) trashpace_DEPENDENCIES = trashpace_LDFLAGS = Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-08-13 11:49:08 UTC (rev 1) +++ trunk/Makefile.am 2006-08-14 13:11:12 UTC (rev 2) @@ -5,7 +5,7 @@ trashpace_SOURCES=trashpace.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h # uncomment the following if trashpace requires the math library -#trashpace_LDADD=-lm +trashpace_LDADD=-lm -lSDL -lpthread EXTRA_DIST=trashpace.lsm.in #NAME.texinfo trashpace.spec.in Modified: trunk/Makefile.in =================================================================== --- trunk/Makefile.in 2006-08-13 11:49:08 UTC (rev 1) +++ trunk/Makefile.in 2006-08-14 13:11:12 UTC (rev 2) @@ -126,9 +126,9 @@ bin_PROGRAMS = trashpace trashpace_SOURCES = trashpace.cc trashpace.1 xmalloc.c system.h aclocal.m4 getopt.c getopt1.c getopt.h - # uncomment the following if trashpace requires the math library -#trashpace_LDADD=-lm +trashpace_LDADD = -lm -lSDL -lpthread + EXTRA_DIST = trashpace.lsm.in #NAME.texinfo trashpace.spec.in # if you write a self-test script named `chk', uncomment the @@ -152,7 +152,6 @@ am_trashpace_OBJECTS = trashpace.$(OBJEXT) xmalloc.$(OBJEXT) \ getopt.$(OBJEXT) getopt1.$(OBJEXT) trashpace_OBJECTS = $(am_trashpace_OBJECTS) -trashpace_LDADD = $(LDADD) trashpace_DEPENDENCIES = trashpace_LDFLAGS = Deleted: trunk/Makefile2 =================================================================== --- trunk/Makefile2 2006-08-13 11:49:08 UTC (rev 1) +++ trunk/Makefile2 2006-08-14 13:11:12 UTC (rev 2) @@ -1,4 +0,0 @@ -all : - g++ -DHAVE_CONFIG_H -I. `sdl-config --cflags` -g -O2 -MT trashpace.o -MD -MP -MF ".deps/trashpace.Tpo" -c trashpace.cc -o trashpace - g++ `sdl-config --libs` trashpace.o xmalloc.o getopt.o getopt1.o -o trashpace - Modified: trunk/TODO =================================================================== --- trunk/TODO 2006-08-13 11:49:08 UTC (rev 1) +++ trunk/TODO 2006-08-14 13:11:12 UTC (rev 2) @@ -1,6 +1,5 @@ Flags -w and -H does'nt work. -Don't link with SDL -Build the Surface and load the background +Build the Surface and load the background (as JPG or PNG version) Build the Earth sprite Create the Earth animation Build the rocket sprite Modified: trunk/config.log =================================================================== --- trunk/config.log 2006-08-13 11:49:08 UTC (rev 1) +++ trunk/config.log 2006-08-14 13:11:12 UTC (rev 2) @@ -1005,15 +1005,15 @@ ## Output variables. ## ## ----------------- ## -ACLOCAL='${SHELL} /home/david/dvlp/trashpace/missing --run aclocal-1.7' +ACLOCAL='${SHELL} /home/david/dvlp/svn/trunk/missing --run aclocal-1.7' ALLOCA='' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' -AMTAR='${SHELL} /home/david/dvlp/trashpace/missing --run tar' -AUTOCONF='${SHELL} /home/david/dvlp/trashpace/missing --run autoconf' -AUTOHEADER='${SHELL} /home/david/dvlp/trashpace/missing --run autoheader' -AUTOMAKE='${SHELL} /home/david/dvlp/trashpace/missing --run automake-1.7' +AMTAR='${SHELL} /home/david/dvlp/svn/trunk/missing --run tar' +AUTOCONF='${SHELL} /home/david/dvlp/svn/trunk/missing --run autoconf' +AUTOHEADER='${SHELL} /home/david/dvlp/svn/trunk/missing --run autoheader' +AUTOMAKE='${SHELL} /home/david/dvlp/svn/trunk/missing --run automake-1.7' AWK='gawk' CC='gcc' CCDEPMODE='depmode=gcc3' @@ -1035,12 +1035,12 @@ INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s' -ISODATE='2006-08-13' +ISODATE='2006-08-14' LDFLAGS='' LIBOBJS='' LIBS='' LTLIBOBJS='' -MAKEINFO='${SHELL} /home/david/dvlp/trashpace/missing --run makeinfo' +MAKEINFO='${SHELL} /home/david/dvlp/svn/trunk/missing --run makeinfo' OBJEXT='o' PACKAGE='trashpace' PACKAGE_BUGREPORT='' @@ -1078,7 +1078,7 @@ host_vendor='pc' includedir='${prefix}/include' infodir='${prefix}/info' -install_sh='/home/david/dvlp/trashpace/install-sh' +install_sh='/home/david/dvlp/svn/trunk/install-sh' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localstatedir='${prefix}/var' Modified: trunk/config.status =================================================================== --- trunk/config.status 2006-08-13 11:49:08 UTC (rev 1) +++ trunk/config.status 2006-08-14 13:11:12 UTC (rev 2) @@ -490,20 +490,20 @@ s,@CYGPATH_W@,echo,;t t s,@PACKAGE@,trashpace,;t t s,@VERSION@,0.1.0,;t t -s,@ACLOCAL@,${SHELL} /home/david/dvlp/trashpace/missing --run aclocal-1.7,;t t -s,@AUTOCONF@,${SHELL} /home/david/dvlp/trashpace/missing --run autoconf,;t t -s,@AUTOMAKE@,${SHELL} /home/david/dvlp/trashpace/missing --run automake-1.7,;t t -s,@AUTOHEADER@,${SHELL} /home/david/dvlp/trashpace/missing --run autoheader,;t t -s,@MAKEINFO@,${SHELL} /home/david/dvlp/trashpace/missing --run makeinfo,;t t -s,@AMTAR@,${SHELL} /home/david/dvlp/trashpace/missing --run tar,;t t -s,@install_sh@,/home/david/dvlp/trashpace/install-sh,;t t +s,@ACLOCAL@,${SHELL} /home/david/dvlp/svn/trunk/missing --run aclocal-1.7,;t t +s,@AUTOCONF@,${SHELL} /home/david/dvlp/svn/trunk/missing --run autoconf,;t t +s,@AUTOMAKE@,${SHELL} /home/david/dvlp/svn/trunk/missing --run automake-1.7,;t t +s,@AUTOHEADER@,${SHELL} /home/david/dvlp/svn/trunk/missing --run autoheader,;t t +s,@MAKEINFO@,${SHELL} /home/david/dvlp/svn/trunk/missing --run makeinfo,;t t +s,@AMTAR@,${SHELL} /home/david/dvlp/svn/trunk/missing --run tar,;t t +s,@install_sh@,/home/david/dvlp/svn/trunk/install-sh,;t t s,@STRIP@,,;t t s,@ac_ct_STRIP@,,;t t s,@INSTALL_STRIP_PROGRAM@,${SHELL} $(install_sh) -c -s,;t t s,@AWK@,gawk,;t t s,@SET_MAKE@,,;t t s,@am__leading_dot@,.,;t t -s,@ISODATE@,2006-08-13,;t t +s,@ISODATE@,2006-08-14,;t t s,@build@,i686-pc-linux-gnu,;t t s,@build_cpu@,i686,;t t s,@build_vendor@,pc,;t t Modified: trunk/trashpace.cc =================================================================== --- trunk/trashpace.cc 2006-08-13 11:49:08 UTC (rev 1) +++ trunk/trashpace.cc 2006-08-14 13:11:12 UTC (rev 2) @@ -59,15 +59,85 @@ static int decode_switches (int argc, char **argv); + + +class gameTime +{ +private: + int startTime; // Last time the clock was + // started. + int baseTime; // How much game time passed + // before the last time the + // clock was started. + bool running; // Is the clock running or + // not? + +public: + + // Initialize the class variables. At this point no game + // time has elapsed and the clock is not running. + + gameTime() + { + startTime = 0; + baseTime = 0; + running = false; + } + + // Start the clock. + + void start() + { + if (!running) + { + startTime = SDL_GetTicks(); + running = true; + } + } + + // stop the clock + + void stop() + { + if (running) + { + baseTime = baseTime + (SDL_GetTicks() - startTime); + running = false; + } + } + + // True if the clock is paused. + + bool stopped() + { + return !running; + } + + // Get this clocks current time in milliseconds. + + int time() + { + if (running) + { + return baseTime + (SDL_GetTicks() - startTime); + } + else + { + return baseTime; + } + } +}; + + int main (int argc, char **argv) { int i; - program_name = argv[0]; i = decode_switches (argc, argv); + gameTime gt; SDL_Surface *screen = NULL; SDL_Surface *background = NULL; SDL_Event event; @@ -92,6 +162,56 @@ // background=SDL_LoadBMP("images/trashpace.jpg"); + bool done=false; + while (!done) + { + // Loop while reading all pending event. + while (!done && SDL_PollEvent(&event)) + { + switch (event.type) + { + + // Here we are looking for two special keys. If we + // get an event telling us that the escape key has + // been pressed the program will quit. If we see + // the F1 key we either start or stop the + // animation by starting or stopping the clock. + + case SDL_KEYDOWN: + switch(event.key.keysym.sym) + { + case SDLK_ESCAPE: + done = true; + break; + + case SDLK_F1: + + if (gt.stopped()) + { + gt.start(); + } + else + { + gt.stop(); + } + + break; + + default: + break; + } + break; + + // The SDL_QUIT event is generated when you click + // on the close button on a window. If we see that + // event we should exit the program. So, we do. + + case SDL_QUIT: + done = true; + break; + } + } + } exit (0); } Modified: trunk/trashpace.lsm =================================================================== --- trunk/trashpace.lsm 2006-08-13 11:49:08 UTC (rev 1) +++ trunk/trashpace.lsm 2006-08-14 13:11:12 UTC (rev 2) @@ -1,7 +1,7 @@ Begin3 Title: trashpace Version: 0.1.0 -Entered-date: 2006-08-13 +Entered-date: 2006-08-14 Description: A game to clean the orbital space of Earth trashpace.lsm. Generated from trashpace.lsm.in by configure. Please edit trashpace.lsm.in to fix the Keywords and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |