From: <spo...@us...> - 2009-01-09 22:52:38
|
Revision: 912 http://opengate.svn.sourceforge.net/opengate/?rev=912&view=rev Author: spom_spom Date: 2009-01-09 22:52:25 +0000 (Fri, 09 Jan 2009) Log Message: ----------- add doxygen template, the inheritance diagram for OpenGate::BaseObject enlighted me to make heavy reconstruction in the next time Modified Paths: -------------- trunk/src/AiManager.cpp trunk/src/BaseObject.h trunk/src/GameStateManager.cpp trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorObject.h trunk/src/UnDockedState.h trunk/src/commonWithOgre.cpp trunk/src/commonWithOgre.h trunk/src/opengateclient.cpp Added Paths: ----------- trunk/doc/ trunk/doc/Doxyfile Added: trunk/doc/Doxyfile =================================================================== --- trunk/doc/Doxyfile (rev 0) +++ trunk/doc/Doxyfile 2009-01-09 22:52:25 UTC (rev 912) @@ -0,0 +1,1310 @@ +# Doxyfile 1.5.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = OpenGate + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is +# documented as struct with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code where the coding convention is that all structs are +# typedef'ed and only the typedef is referenced never the struct's name. + +TYPEDEF_HIDES_STRUCT = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be extracted +# and appear in the documentation as a namespace called 'anonymous_namespace{file}', +# where file will be replaced with the base name of the file that contains the anonymous +# namespace. By default anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../src + +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH +# then you must also enable this option. If you don't then doxygen will produce +# a warning and turn it on anyway + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the number +# of direct children of the root node in a graph is already larger than +# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO Modified: trunk/src/AiManager.cpp =================================================================== --- trunk/src/AiManager.cpp 2008-12-12 19:21:38 UTC (rev 911) +++ trunk/src/AiManager.cpp 2009-01-09 22:52:25 UTC (rev 912) @@ -32,6 +32,7 @@ #include "Avatar.h" #include "Station.h" #include "OgreSceneNode.h" +#include "networkClient.h" #include <iostream> #include <iterator> Modified: trunk/src/BaseObject.h =================================================================== --- trunk/src/BaseObject.h 2008-12-12 19:21:38 UTC (rev 911) +++ trunk/src/BaseObject.h 2009-01-09 22:52:25 UTC (rev 912) @@ -31,6 +31,7 @@ namespace OpenGate{ +#define SECTOROBJECTENVIRONMENT_RTTI 1000010 #define PROJECTILE_RTTI 100001 #define SECTOROBJECT_RTTI 100002 #define SECTOROBJECTMOVABLE_RTTI 100003 Modified: trunk/src/GameStateManager.cpp =================================================================== --- trunk/src/GameStateManager.cpp 2008-12-12 19:21:38 UTC (rev 911) +++ trunk/src/GameStateManager.cpp 2009-01-09 22:52:25 UTC (rev 912) @@ -20,35 +20,34 @@ #include "GameStateManager.h" -#include <OgreGpuProgramManager.h> -#include <OgreRoot.h> -#include <OgreRenderWindow.h> -#include <OgreConfigFile.h> -#include <OgreEntity.h> -#include <OgreWindowEventUtilities.h> -#include <OgreRenderSystemCapabilities.h> -#include <OgreRenderSystem.h> -#include <OgreMesh.h> -#include <OgreMeshManager.h> -#include <OgreMaterialManager.h> - -#include "LogManager.h" -#include "Console.h" +#include "AiManager.h" #include "Avatar.h" -#include "Sector.h" +#include "ConfigDialog.h" +#include "Console.h" +#include "DockedState.h" +#include "EntityManager.h" #include "InputManager.h" -#include "AiManager.h" -#include "Vessel.h" -#include "OpenALSoundManager.h" +#include "networkClient.h" #include "OpcodeWrapper.h" +#include "OpenALSoundManager.h" +#include "LogManager.h" +#include "Sector.h" #include "UnDockedState.h" -#include "ConfigDialog.h" -#include "EntityManager.h" +#include "Vessel.h" -#include "DockedState.h" -#include "UnDockedState.h" - +#include <OgreConfigFile.h> +#include <OgreEntity.h> #include <OgreFrameListener.h> +#include <OgreGpuProgramManager.h> +#include <OgreMaterialManager.h> +#include <OgreMesh.h> +#include <OgreMeshManager.h> +#include <OgreRenderSystem.h> +#include <OgreRenderSystemCapabilities.h> +#include <OgreRenderWindow.h> +#include <OgreRoot.h> +#include <OgreWindowEventUtilities.h> + namespace OpenGate { class NetworkClient; Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2008-12-12 19:21:38 UTC (rev 911) +++ trunk/src/Sector.cpp 2009-01-09 22:52:25 UTC (rev 912) @@ -19,38 +19,40 @@ ***************************************************************************/ #include "Sector.h" + +#include "AiObject.h" +#include "Avatar.h" +#include "EntityManager.h" +#include "Equipment.h" #include "common.h" -#include "Avatar.h" -#include "AiObject.h" +#include "commonWithOgre.h" +#include "Missile.h" +#include "networkClient.h" #include "OpcodeWrapper.h" +#include "Planet.h" +#include "Projectile.h" #include "ResourceManager.h" -#include "Projectile.h" +#include "SectorObjectAvatar.h" +#include "SectorObjectMissile.h" +#include "SectorObjectMoveable.h" +#include "SectorObjectVessel.h" #include "Station.h" -#include "Planet.h" -#include "Equipment.h" -#include "Missile.h" #include "Vessel.h" -#include "EntityManager.h" -#include "SectorObjectMoveable.h" -#include "SectorObjectAvatar.h" -#include "SectorObjectVessel.h" -#include "SectorObjectMissile.h" #include "tinyxml/tinyxml.h" ... [truncated message content] |
From: <eg...@us...> - 2009-01-10 11:24:15
|
Revision: 919 http://opengate.svn.sourceforge.net/opengate/?rev=919&view=rev Author: egore Date: 2009-01-10 11:23:58 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Silence a warning from libtool by shipping the libtool files Modified Paths: -------------- trunk/Makefile.am trunk/configure.ac Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2009-01-10 11:23:20 UTC (rev 918) +++ trunk/Makefile.am 2009-01-10 11:23:58 UTC (rev 919) @@ -3,6 +3,11 @@ SUBDIRS = src \ data +ACLOCAL_AMFLAGS = -I m4 + +EXTRA_DIST = \ + autogen.sh + distclean: maintainer-clean rm -rf *~ rm -rf autom4te.cache Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2009-01-10 11:23:20 UTC (rev 918) +++ trunk/configure.ac 2009-01-10 11:23:58 UTC (rev 919) @@ -6,6 +6,7 @@ AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION, [dist-bzip2]) AM_CONFIG_HEADER(config.h) +AC_CONFIG_MACRO_DIR([m4]) AM_MAINTAINER_MODE AM_INIT_AUTOMAKE(opengate, 0.0.1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2009-01-10 11:28:38
|
Revision: 920 http://opengate.svn.sourceforge.net/opengate/?rev=920&view=rev Author: egore Date: 2009-01-10 11:28:31 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Silence a warning from libtool by shipping the libtool files Added Paths: ----------- trunk/m4/ trunk/m4/libtool.m4 trunk/m4/ltoptions.m4 trunk/m4/ltsugar.m4 trunk/m4/ltversion.m4 trunk/m4/lt~obsolete.m4 Added: trunk/m4/libtool.m4 =================================================================== --- trunk/m4/libtool.m4 (rev 0) +++ trunk/m4/libtool.m4 2009-01-10 11:28:31 UTC (rev 920) @@ -0,0 +1,7370 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file 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. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to <bug...@gn...>." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_D... [truncated message content] |
From: <eg...@us...> - 2009-01-10 12:18:43
|
Revision: 921 http://opengate.svn.sourceforge.net/opengate/?rev=921&view=rev Author: egore Date: 2009-01-10 11:39:53 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Make proper use of svn:ignore Modified Paths: -------------- trunk/src/.svnignore Removed Paths: ------------- trunk/.svnignore Property Changed: ---------------- trunk/ trunk/data/ trunk/src/ Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - .anjuta .tm_project* .libs .deps .libs .*swp .nautilus-metafile.xml *.autosave *.pws *.bak *~ #*# *.gladep *.la *.lo *.log *.o *.class *.pyc aclocal.m4 autom4te.cache config.h config.h.in config.log config.status configure intltool-extract* intltool-merge* intltool-modules* intltool-update* libtool prepare.sh stamp-h* ltmain.sh mkinstalldirs opengate.depend config.guess config.sub Makefile Makefile.in + .anjuta .tm_project* .libs .deps .libs .*swp .nautilus-metafile.xml *.autosave *.pws *.bak *~ #*# *.gladep *.la *.lo *.log *.o *.class *.pyc aclocal.m4 autom4te.cache config.h config.h.in config.log config.status configure intltool-extract* intltool-merge* intltool-modules* intltool-update* libtool prepare.sh stamp-h* ltmain.sh mkinstalldirs opengate.depend config.guess config.sub Makefile Makefile.in ogre.cfg Deleted: trunk/.svnignore =================================================================== --- trunk/.svnignore 2009-01-10 11:28:31 UTC (rev 920) +++ trunk/.svnignore 2009-01-10 11:39:53 UTC (rev 921) @@ -1,40 +0,0 @@ -.anjuta -.tm_project* -.libs -.deps -.libs -.*swp -.nautilus-metafile.xml -*.autosave -*.pws -*.bak -*~ -#*# -*.gladep -*.la -*.lo -*.log -*.o -*.class -*.pyc -aclocal.m4 -autom4te.cache -config.h -config.h.in -config.log -config.status -configure -intltool-extract* -intltool-merge* -intltool-modules* -intltool-update* -libtool -prepare.sh -stamp-h* -ltmain.sh -mkinstalldirs -opengate.depend -config.guess -config.sub -Makefile -Makefile.in Property changes on: trunk/data ___________________________________________________________________ Added: svn:ignore + Makefile Makefile.in Property changes on: trunk/src ___________________________________________________________________ Modified: svn:ignore - .anjuta .tm_project* .libs .deps .libs .*swp .nautilus-metafile.xml *.autosave *.pws *.bak *~ #*# *.gladep *.la *.lo *.log *.o *.class *.pyc aclocal.m4 autom4te.cache config.h config.h.in config.log config.status configure intltool-extract* intltool-merge* intltool-modules* intltool-update* libtool prepare.sh stamp-h* ltmain.sh mkinstalldirs opengate.depend config.guess config.sub Makefile Makefile.in + .anjuta .tm_project* .libs .deps .libs .*swp .nautilus-metafile.xml *.autosave *.pws *.bak *~ #*# *.gladep *.la *.lo *.log *.o *.class *.pyc aclocal.m4 autom4te.cache config.h config.h.in config.log config.status configure intltool-extract* intltool-merge* intltool-modules* intltool-update* libtool prepare.sh stamp-h* ltmain.sh mkinstalldirs opengate.depend config.guess config.sub Makefile Makefile.in opengateserver opengateclient Modified: trunk/src/.svnignore =================================================================== --- trunk/src/.svnignore 2009-01-10 11:28:31 UTC (rev 920) +++ trunk/src/.svnignore 2009-01-10 11:39:53 UTC (rev 921) @@ -1,5 +1,43 @@ -opengateserver +.anjuta +.tm_project* +.libs .deps +.libs +.*swp +.nautilus-metafile.xml +*.autosave +*.pws +*.bak +*~ +#*# +*.gladep +*.la +*.lo +*.log +*.o +*.class +*.pyc +aclocal.m4 +autom4te.cache +config.h +config.h.in +config.log +config.status +configure +intltool-extract* +intltool-merge* +intltool-modules* +intltool-update* +libtool +prepare.sh +stamp-h* +ltmain.sh +mkinstalldirs +opengate.depend +config.guess +config.sub Makefile -testopenalmanager +Makefile.in + +opengateserver opengateclient This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-01-19 23:13:46
|
Revision: 950 http://opengate.svn.sourceforge.net/opengate/?rev=950&view=rev Author: spom_spom Date: 2009-01-19 23:13:32 +0000 (Mon, 19 Jan 2009) Log Message: ----------- next steps of reorganization done. (mesh objects, collision, basic flight). Modified Paths: -------------- trunk/data/materials/simpleHUD.material trunk/data/misc/test.sector trunk/m4/libtool.m4 trunk/m4/ltoptions.m4 trunk/m4/ltsugar.m4 trunk/m4/ltversion.m4 trunk/src/Entity.cpp trunk/src/Entity.h trunk/src/Hud.cpp trunk/src/Makefile.am trunk/src/OpcodeWrapper.cpp trunk/src/OpcodeWrapper.h trunk/src/Opengate.h trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorAvatarObject.cpp trunk/src/SectorAvatarObject.h trunk/src/SectorCollisionObject.h trunk/src/SectorMeshObject.cpp trunk/src/SectorMeshObject.h trunk/src/SectorMovableObject.cpp trunk/src/SectorMovableObject.h trunk/src/SectorObjectVessel.cpp trunk/src/SectorVesselObject.cpp trunk/src/SectorVesselObject.h trunk/src/Station.cpp trunk/src/Station.h trunk/src/UnDockedState.cpp trunk/src/common.h trunk/src/commonWithOgre.cpp trunk/src/commonWithOgre.h Added Paths: ----------- trunk/src/SectorBeaconObject.cpp trunk/src/SectorBeaconObject.h trunk/src/SectorStationObject.cpp trunk/src/SectorStationObject.h Modified: trunk/data/materials/simpleHUD.material =================================================================== --- trunk/data/materials/simpleHUD.material 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/data/materials/simpleHUD.material 2009-01-19 23:13:32 UTC (rev 950) @@ -22,7 +22,9 @@ pass { depth_check off - lighting off + depth_write off + lighting on + scene_blend alpha_blend texture_unit @@ -40,6 +42,7 @@ pass { depth_check on + depth_write on lighting on } } @@ -52,6 +55,7 @@ pass { depth_check on + depth_write on lighting on } } Modified: trunk/data/misc/test.sector =================================================================== --- trunk/data/misc/test.sector 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/data/misc/test.sector 2009-01-19 23:13:32 UTC (rev 950) @@ -7,10 +7,20 @@ <position y="0" x="0" z="-1480"></position> </station> <sectorobject name="ring"> - <position y="100" x="-650" z="800"></position> + <position y="-100" x="0" z="-100"></position> <scale y="35" x="35" z="35"></scale> <entity meshFile="ring.mesh" material-0="ring/main" numSubEntities="1"></entity> </sectorobject> + <sectorobject name="ring1"> + <position y="0" x="0" z="-100"></position> + <scale y="35" x="35" z="35"></scale> + <entity meshFile="ring.mesh" material-0="ring/main" numSubEntities="1"></entity> + </sectorobject> + <sectorobject name="ring2"> + <position y="100" x="0" z="-100"></position> + <scale y="35" x="35" z="35"></scale> + <entity meshFile="ring.mesh" material-0="ring/main" numSubEntities="1"></entity> + </sectorobject> <beacon> <position y="0" x="-650" z="800"></position> </beacon> Modified: trunk/m4/libtool.m4 =================================================================== --- trunk/m4/libtool.m4 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/m4/libtool.m4 2009-01-19 23:13:32 UTC (rev 950) @@ -380,12 +380,12 @@ # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_quote(m4_if([$2], [], + m4_quote(lt_decl_tag_varnames), + m4_quote(m4_shift($@)))), + m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) +m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) @@ -945,10 +945,10 @@ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on + darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? + # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; @@ -990,11 +990,7 @@ _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then + if test "$GCC" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" @@ -1516,7 +1512,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -1684,6 +1680,10 @@ # endif #endif +#ifdef __cplusplus +extern "C" void exit (int); +#endif + void fnord() { int i=42;} int main () { @@ -1699,7 +1699,7 @@ else puts (dlerror ()); - return status; + exit (status); }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then @@ -1738,7 +1738,7 @@ lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; @@ -2035,7 +2035,6 @@ [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], @@ -2200,14 +2199,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2230,7 +2229,7 @@ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; - mingw* | cegcc*) + mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` @@ -2669,7 +2668,7 @@ version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -2693,7 +2692,7 @@ if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi - + if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi @@ -2970,7 +2969,6 @@ # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -3021,12 +3019,6 @@ fi ;; -cegcc) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; @@ -3338,7 +3330,7 @@ aix*) symcode='[[BCDT]]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) @@ -3584,7 +3576,7 @@ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -3611,11 +3603,10 @@ fi ;; hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. case $host_cpu in - hppa*64*) + hppa*64*|ia64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' @@ -3713,19 +3704,12 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. + icpc* | ecpc* ) + # Intel C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -3891,7 +3875,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -3907,11 +3891,10 @@ ;; hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. case $host_cpu in - hppa*64*) + hppa*64*|ia64*) # +Z the default ;; *) @@ -3961,7 +3944,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], @@ -3992,25 +3975,11 @@ linux* | k*bsd*-gnu) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) + icc* | ecc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -4192,7 +4161,7 @@ pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) @@ -4244,7 +4213,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -4331,7 +4300,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' @@ -4397,9 +4366,6 @@ tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; @@ -4631,7 +4597,6 @@ fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes @@ -4686,7 +4651,7 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -4790,7 +4755,7 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -5575,7 +5540,6 @@ fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. @@ -5634,7 +5598,7 @@ esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' @@ -7019,18 +6983,6 @@ ]) -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - - # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates Modified: trunk/m4/ltoptions.m4 =================================================================== --- trunk/m4/ltoptions.m4 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/m4/ltoptions.m4 2009-01-19 23:13:32 UTC (rev 950) @@ -125,7 +125,7 @@ [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) Modified: trunk/m4/ltsugar.m4 =================================================================== --- trunk/m4/ltsugar.m4 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/m4/ltsugar.m4 2009-01-19 23:13:32 UTC (rev 950) @@ -1,13 +1,13 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 # # This file 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. -# serial 6 ltsugar.m4 +# serial 5 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) @@ -63,14 +63,14 @@ # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) +[m4_if([$2], [], [], + [m4_if([$4], [], [], + [lt_join(m4_quote(m4_default([$1], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2], + [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]), + [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl +]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) Modified: trunk/m4/ltversion.m4 =================================================================== --- trunk/m4/ltversion.m4 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/m4/ltversion.m4 2009-01-19 23:13:32 UTC (rev 950) @@ -9,15 +9,15 @@ # Generated from ltversion.in. -# serial 3012 ltversion.m4 +# serial 2976 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.6]) -m4_define([LT_PACKAGE_REVISION], [1.3012]) +m4_define([LT_PACKAGE_VERSION], [2.2.4]) +m4_define([LT_PACKAGE_REVISION], [1.2976]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6' -macro_revision='1.3012' +[macro_version='2.2.4' +macro_revision='1.2976' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) Modified: trunk/src/Entity.cpp =================================================================== --- trunk/src/Entity.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Entity.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -136,9 +136,9 @@ MeshEntity::MeshEntity(): Entity(){ baseSize_ = Ogre::Vector3::ZERO; - baseYaw_ = 0; - basePitch_ = 0; - baseRoll_ = 0; + baseYaw_ = 0.0; + basePitch_ = 0.0; + baseRoll_ = 0.0; } MeshEntity::~MeshEntity(){} @@ -146,19 +146,15 @@ void MeshEntity::readPropertiesFromXML( TiXmlHandle & hRoot ){ Entity::readPropertiesFromXML( hRoot ); - readXMLNode< float >( hRoot, "baseyaw", this, &OpenGate::MeshEntity::setBaseYaw, false ); - readXMLNode< float >( hRoot, "basepitch", this, &OpenGate::MeshEntity::setBasePitch, false ); - readXMLNode< float >( hRoot, "baseroll", this, &OpenGate::MeshEntity::setBaseRoll, false ); - + readXMLNode< float >( hRoot, "base_yaw", this, &OpenGate::MeshEntity::setBaseYaw, false ); + readXMLNode< float >( hRoot, "base_pitch", this, &OpenGate::MeshEntity::setBasePitch, false ); + readXMLNode< float >( hRoot, "base_roll", this, &OpenGate::MeshEntity::setBaseRoll, false ); + readXMLNode< float >( hRoot, "base_size", this, &OpenGate::MeshEntity::setBaseSize, false ); + + // readXMLNode< float >( hRoot, "basesize", this, &OpenGate::MeshEntity::setBaseSize, false ); TiXmlElement * pElem; Ogre::Real length = 0; - pElem = hRoot.ChildElement( "size", 0 ).Element(); - if ( pElem ) { - length = toDouble( pElem->FirstChild()->Value() ); - this->setBaseSize( length ); - } - pElem = hRoot.ChildElement( "length", 0 ).Element(); if ( pElem ) length = toDouble( pElem->FirstChild()->Value() ); @@ -170,7 +166,7 @@ pElem = hRoot.ChildElement( "height", 0 ).Element(); if ( pElem ) height = toDouble( pElem->FirstChild()->Value() ); - if ( length > 0 && width > 0 && height > 0 ) this->setBaseSize( width, height, length ); + if ( length > 0 && width > 0 && height > 0 ) this->setBaseSizeVector( width, height, length ); if ( !readXMLNode< std::string >( hRoot, "mesh", this, &OpenGate::MeshEntity::setMesh, false ) ){ @@ -182,17 +178,6 @@ } } -void MeshEntity::setBaseSize( float length, float width, float height ){ - baseSize_[ 0 ] = length; - baseSize_[ 1 ] = width; - baseSize_[ 2 ] = height; -} - - /*! If size is a scalar value, the length of the entity. */ -void MeshEntity::setBaseSize( float size ){ baseSize_[ 2 ] = size; } - -Ogre::Vector3 MeshEntity::baseSize( ) const { return baseSize_; } - std::string MeshEntity::createMeshName( const std::string & meshName ){ return strReplaceBlankWithUnderscore( strCopyToLowerCase( meshName ) ); } Modified: trunk/src/Entity.h =================================================================== --- trunk/src/Entity.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Entity.h 2009-01-19 23:13:32 UTC (rev 950) @@ -78,16 +78,15 @@ virtual void readPropertiesFromXML( TiXmlHandle & hRoot ); - inline std::string factionName( ) const { return factionName_; } + inline void setName( const std::string & name ) { name_ = name; } + inline const std::string & name( ) const { return name_; } void setFactionID( int id ); inline int factionID( ) const { return factionID_; } + inline const std::string & factionName( ) const { return factionName_; } - inline void setName( const std::string & name ) { name_ = name; } - inline std::string name( ) const { return name_; } - inline void setCategoryName( const std::string & category ) { category_ = category; } - inline std::string categoryName( ) const { return category_; } + inline const std::string & categoryName( ) const { return category_; } inline void setID( int id ){ id_ = id; } inline int id( ) const { return id_; } @@ -102,10 +101,10 @@ inline int size( ) const { return size_; } inline void setDescription( const std::string & description ){ description_ = description; } - inline std::string description( ) const { return description_; } + inline const std::string & description( ) const { return description_; } inline void setImageName( const std::string & imageFileName ) { imageFileName_ = imageFileName; } - inline std::string imageName() const { return imageFileName_; } + inline const std::string & imageName() const { return imageFileName_; } inline std::string ceguiImageName() { if ( !imageInitialised_ ) loadImages_(); return ceguiImageName_; } inline std::string ceguiSmallImageName() { if ( !imageInitialised_ ) loadImages_(); return ceguiSmallImageName_; } @@ -114,11 +113,11 @@ inline void addProductionCenter( const std::string & productionCenter ) { productionCenters_.insert( productionCenter ); } - inline std::set < std::string > productionCenters( ) const { return productionCenters_; } + inline const std::set < std::string > & productionCenters( ) const { return productionCenters_; } inline void setRequieredComponents( const std::set < Entity * > & requieredComponents ) { requieredComponents_ = requieredComponents; } - inline std::set < Entity * > requieredComponents( ) const { return requieredComponents_; } + inline const std::set < Entity * > & requieredComponents( ) const { return requieredComponents_; } protected: inline void setFactionName_( const std::string & name ) { factionName_ = name; } @@ -168,11 +167,12 @@ void readPropertiesFromXML( TiXmlHandle & hRoot ); /*! Base sizes are necessary for resizing the ogremesh */ - void setBaseSize( float length, float width, float height ); - + inline void setBaseSizeVector( float length, float width, float height ){ + baseSize_[ 0 ] = length; baseSize_[ 1 ] = width; baseSize_[ 2 ] = height; } + /*! If size is a scalar value, the length of the entity.*/ - void setBaseSize( float size ); - Ogre::Vector3 baseSize( ) const; + inline void setBaseSize( float size ){ baseSize_[ 2 ] = size; } + inline const Ogre::Vector3 & baseSize( ) const { return baseSize_; } /*! Base sizes are necessary for resizing the ogremesh */ inline void setBaseYaw( Ogre::Real baseYaw ){ baseYaw_ = baseYaw; } @@ -187,7 +187,7 @@ inline Ogre::Real baseRoll( ) const { return baseRoll_; } void setMesh( const std::string & meshName ); - std::string meshName( ) const { return meshName_; } + inline const std::string & meshName( ) const { return meshName_; } virtual std::string createMeshName( const std::string & meshName ); Ogre::MeshPtr & meshPtr( ){ return pMesh_; } Modified: trunk/src/Hud.cpp =================================================================== --- trunk/src/Hud.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Hud.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -289,14 +289,15 @@ // armorProgressLeftImg_->setYPosition( CEGUI::UDim( 0.5, -armorProgressHeight_/2.0 ) ); // armorProgressRightImg_->setYPosition( CEGUI::UDim( 0.5, -armorProgressHeight_/2.0 ) ); // -// if ( avatar_->breakPressed() ){ -// velocityText_->setProperty( "TextColours", "ffff0000" ); -// } else if (avatar_->afterburnerPressed()){ -// velocityText_->setProperty( "TextColours", "ff00ff00" ); -// } else { -// velocityText_->setProperty( "TextColours", "ffffffff" ); -// } - velocityText_->setText( "V" + Ogre::StringConverter::toString( round( (Ogre::Real)avatar_->speed(), 2 ), 4 ) ); + if ( avatar_->brakePressed() ){ + velocityText_->setProperty( "TextColours", "ffff0000" ); + } else if (avatar_->afterburnerPressed()){ + velocityText_->setProperty( "TextColours", "ff00ff00" ); + } else { + velocityText_->setProperty( "TextColours", "ffffffff" ); + } + velocityText_->setText( "V" + Ogre::StringConverter::toString( round( (Ogre::Real)avatar_->speed(), 2 ), 4 ) ); + // shieldText_->setText( "S" + Ogre::StringConverter::toString( avatar_->shieldRate() * 100.0f, 4 ) ); // armorText_->setText( "A" + Ogre::StringConverter::toString( avatar_->armorRate() * 100.0f, 4 ) ); Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Makefile.am 2009-01-19 23:13:32 UTC (rev 950) @@ -82,12 +82,16 @@ SectorAvatarObject.cpp \ SectorBaseObject.h \ SectorBaseObject.cpp \ + SectorBeaconObject.h \ + SectorBeaconObject.cpp \ SectorCollisionObject.h \ SectorCollisionObject.cpp \ SectorMeshObject.h \ SectorMeshObject.cpp \ SectorMovableObject.h \ SectorMovableObject.cpp \ + SectorStationObject.h \ + SectorStationObject.cpp \ SectorVesselObject.h \ SectorVesselObject.cpp \ SectorObject.h \ Modified: trunk/src/OpcodeWrapper.cpp =================================================================== --- trunk/src/OpcodeWrapper.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/OpcodeWrapper.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -60,8 +60,7 @@ collisionManager_->addCollType( "Station", "Bullet", OgreOpcode::COLLTYPE_EXACT ); collisionManager_->addCollType( "DockPad", "SectorObject", OgreOpcode::COLLTYPE_EXACT ); - // collisionManager_->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_CONTACT ); - // collisionManager_->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_QUICK ); + //** possible contact types OgreOpcode::COLLTYPE_CONTACT || OgreOpcode::COLLTYPE_QUICK collideInSectorContext_ = collisionManager_->getDefaultContext(); } else { @@ -70,7 +69,6 @@ } void OpcodeCollisionDetection::free( ){ - if ( collisionManager_ ) delete collisionManager_; collisionManager_ = NULL; } @@ -81,22 +79,22 @@ OgreOpcode::CollisionReporter report( collideInSectorContext_->getCollisionReport() ); - int nCollids = report.getNumCollisions(); + uint nCollids = report.getNumCollisions(); if ( nCollids > 0 ){ // std::cout << "OpcodeCollisionDetection::update() " << nCollids << std::endl; OgreOpcode::CollisionPair **collisionReport; report.getAllCollisions( collisionReport ); - for ( int i = 0; i < nCollids; i ++ ){ - OgreOpcode::CollisionObject* col1 = collisionReport[ i ]->this_object; - OgreOpcode::CollisionObject* col2 = collisionReport[ i ]->other_object; + for ( uint i = 0; i < nCollids; i ++ ){ + OgreOpcode::CollisionObject * col1 = collisionReport[ i ]->this_object; + OgreOpcode::CollisionObject * col2 = collisionReport[ i ]->other_object; // std::cout << i << ": "<< col1->getName() << "<->" << col2->getName() << std::endl; - static_cast< BaseObject * >( col1->getClientData() )->collide( static_cast< BaseObject * >( + static_cast< SectorCollisionObject * >( col1->getClientData() )->collide( static_cast< SectorCollisionObject * >( col2->getClientData() ) ); - static_cast< BaseObject * >( col2->getClientData() )->collide( static_cast< BaseObject * >( + static_cast< SectorCollisionObject * >( col2->getClientData() )->collide( static_cast< SectorCollisionObject * >( col1->getClientData() ) ); } } // if ncols @@ -105,9 +103,9 @@ return true; } -void OpcodeCollisionDetection::createObject( SectorCollisionObject * obj ){ +void OpcodeCollisionDetection::create( SectorCollisionObject * obj ){ if ( obj && active_ ){ - OgreOpcode::CollisionObject * collObj = obj->pCollisionObject(); + OgreOpcode::CollisionObject * collObj = obj->collisionObject(); if ( !collObj ){ OgreOpcode::EntityCollisionShape * collShape = collisionManager_->createEntityCollisionShape( obj->name() + "/CollShape" ); @@ -129,33 +127,14 @@ } } -void OpcodeCollisionDetection::createObject( BaseObject * obj ){ - +void OpcodeCollisionDetection::destroy( SectorCollisionObject * obj ){ if ( obj && active_ ){ - OgreOpcode::CollisionObject * collObj = obj->collisionObject(); - - if ( !collObj ){ - - OgreOpcode::EntityCollisionShape * collShape = collisionManager_->createEntityCollisionShape( obj->name() + "/CollShape" ); - if ( obj->entity() ){ - collShape->load( obj->entity() ); - } else { - std::cout << "OpcodeCollisionDetection::createObject( BaseObject * obj ), no entity defined for obj: " << obj->name(); - } - - collObj = collideInSectorContext_->createObject( obj->name() + "/CollObj" ); - collObj->setCollClass( collisionManager_->queryCollClass( obj->collisionClass() ) ); - collObj->setShape( collShape ); - - collObj->setClientData( obj ); - collideInSectorContext_->addObject( collObj ); - - obj->setCollisionObject( collObj ); - } + destroy( obj->collisionObject() ); + obj->setCollisionObject( NULL ); } } -void OpcodeCollisionDetection::destroyObject( OgreOpcode::CollisionObject * obj ){ +void OpcodeCollisionDetection::destroy( OgreOpcode::CollisionObject * obj ){ if ( obj && active_ ){ OgreOpcode::ICollisionShape * shape = obj->getShape(); collideInSectorContext_->destroyObject( obj ); @@ -164,26 +143,6 @@ } } -void OpcodeCollisionDetection::destroyObject( BaseObject * obj ){ - - if ( obj && active_ ){ - destroyObject( obj->collisionObject() ); - obj->setCollisionObject( NULL ); - } -} - -void OpcodeCollisionDetection::detach( BaseObject * obj ){ - if ( obj && active_ ){ - destroyObject( obj ); - } -} - -void OpcodeCollisionDetection::attach( BaseObject * obj ){ - if ( obj && active_ ){ - createObject( obj ); - } -} - bool OpcodeCollisionDetection::checkCollideRay( SectorCollisionObject * obj, const Ogre::Ray & ray, double rayLength ){ if ( active_ ){ if ( !obj->destroyRequest() ){ @@ -222,6 +181,59 @@ return false; } + + + + + + + +void OpcodeCollisionDetection::createObject( BaseObject * obj ){ + + if ( obj && active_ ){ + OgreOpcode::CollisionObject * collObj = obj->collisionObject(); + + if ( !collObj ){ + + OgreOpcode::EntityCollisionShape * collShape = collisionManager_->createEntityCollisionShape( obj->name() + "/CollShape" ); + if ( obj->entity() ){ + collShape->load( obj->entity() ); + } else { + std::cout << "OpcodeCollisionDetection::createObject( BaseObject * obj ), no entity defined for obj: " << obj->name(); + } + + collObj = collideInSectorContext_->createObject( obj->name() + "/CollObj" ); + collObj->setCollClass( collisionManager_->queryCollClass( obj->collisionClass() ) ); + collObj->setShape( collShape ); + + collObj->setClientData( obj ); + collideInSectorContext_->addObject( collObj ); + + obj->setCollisionObject( collObj ); + } + } +} + +void OpcodeCollisionDetection::destroyObject( BaseObject * obj ){ + + if ( obj && active_ ){ + destroy( obj->collisionObject() ); + obj->setCollisionObject( NULL ); + } +} + +void OpcodeCollisionDetection::detach( BaseObject * obj ){ + if ( obj && active_ ){ + destroyObject( obj ); + } +} + +void OpcodeCollisionDetection::attach( BaseObject * obj ){ + if ( obj && active_ ){ + createObject( obj ); + } +} + bool OpcodeCollisionDetection::checkCollideRay( BaseObject * obj, const Ogre::Ray & ray, double rayLength){ if ( active_ ){ if ( !obj->isSetDestroyRequest() ){ Modified: trunk/src/OpcodeWrapper.h =================================================================== --- trunk/src/OpcodeWrapper.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/OpcodeWrapper.h 2009-01-19 23:13:32 UTC (rev 950) @@ -29,23 +29,33 @@ public: OpcodeCollisionDetection( ResourceManager * resources = NULL ); - ~OpcodeCollisionDetection(); + ~OpcodeCollisionDetection(); - void init( Ogre::SceneManager * sceneMgr ); + /*! Initialize resources for OpcodeCollisionDetection. opposite to free.*/ + void init( Ogre::SceneManager * sceneMgr ); - void free(); + /*! Free resources for OpcodeCollisionDetection. opposite to init.*/ + void free(); - bool update( Ogre::Real elapsedTime ); + /*! Update loop, check for collisions */ + bool update( Ogre::Real elapsedTime ); + + /*! Utility method to check if there is a collision of the object with a given ray */ + bool checkCollideRay( SectorCollisionObject * obj, const Ogre::Ray & ray, double rayLength ); - /*! Deregister and destroy CollisionObject */ - void destroyObject( OgreOpcode::CollisionObject * obj ); - /*! Create and register SectorCollisionObject */ - void createObject( SectorCollisionObject * obj ); - - /*! Check if there is a collision of the object with a given ray */ - bool checkCollideRay( SectorCollisionObject * obj, const Ogre::Ray & ray, double rayLength ); + void create( SectorCollisionObject * obj ); + /*! Create and register SectorCollisionObject */ + void destroy( SectorCollisionObject * obj ); + + /*! Deregister and destroy CollisionObject */ + void destroy( OgreOpcode::CollisionObject * obj ); + + /*! Write some debug infos about all collision objects to stdout*/ + void info( ); + + /*! DEPRECATED */ void createObject( BaseObject * obj ); @@ -61,14 +71,10 @@ /*! DEPRECATED */ bool checkCollideRay( BaseObject * obj, const Ogre::Ray & ray, double rayLength ); - /*! Write some debug infos about all collision objects to stdout*/ - void info( ); - protected: - OgreOpcode::CollisionContext * collideInSectorContext_; - OgreOpcode::CollisionManager * collisionManager_; - bool active_; - + OgreOpcode::CollisionContext * collideInSectorContext_; + OgreOpcode::CollisionManager * collisionManager_; + bool active_; }; Modified: trunk/src/Opengate.h =================================================================== --- trunk/src/Opengate.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Opengate.h 2009-01-19 23:13:32 UTC (rev 950) @@ -35,12 +35,14 @@ namespace OpenGate{ -#define SECTORBASEOBJECT_RTTI 1 -#define SECTORCOLLISIONOBJECT_RTTI 3 -#define SECTORMESHOBJECT_RTTI 4 -#define SECTORMOVABLEOBJECT_RTTI 5 -#define SECTORVESSELOBJECT_RTTI 6 -#define SECTORAVATAROBJECT_RTTI 7 +#define SECTOR_AVATAR_OBJECT_RTTI 1 +#define SECTOR_BASE_OBJECT_RTTI 2 +#define SECTOR_BEACON_OBJECT_RTTI 3 +#define SECTOR_COLLISION_OBJECT_RTTI 4 +#define SECTOR_MESH_OBJECT_RTTI 5 +#define SECTOR_MOVABLE_OBJECT_RTTI 6 +#define SECTOR_STATION_OBJECT_RTTI 7 +#define SECTOR_VESSEL_OBJECT_RTTI 8 #define SECTOROBJECTENVIRONMENT_RTTI 1000010 #define PROJECTILE_RTTI 100001 @@ -74,9 +76,11 @@ class Sector; class SectorAvatarObject; class SectorBaseObject; +class SectorBeaconObject; class SectorCollisionObject; class SectorMeshObject; class SectorMovableObject; +class SectorStationObject; class SectorVesselObject; class SectorObject; Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Sector.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -25,12 +25,15 @@ #include "commonWithOgre.h" #include "Avatar.h" +#include "EntityManager.h" #include "LogManager.h" #include "OpcodeWrapper.h" #include "ResourceManager.h" #include "SectorAvatarObject.h" +#include "SectorBeaconObject.h" #include "SectorCollisionObject.h" #include "SectorMeshObject.h" +#include "SectorStationObject.h" #include <OgreEntity.h> @@ -99,21 +102,23 @@ pElem = hRoot.ChildElement( "station", 0 ).Element(); if ( pElem ){ -// std::string name; readXMLAttribute < std::string >( pElem, "name", name ); -// Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); -// Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); -// SectorObject *obj = createStation( name, pos ); -// if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); + std::string name; readXMLAttribute < std::string >( pElem, "name", name ); + Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); + Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); + SectorMeshObject *obj = createStation( name ); + if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); + if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); } pElem = hRoot.ChildElement( "beacon", 0 ).Element(); if ( pElem ){ - Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); - Ogre::Vector3 dir( readXMLVec3Element( pElem, "direction" ) ); - Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); -// SectorObject * obj = createBeacon( pos ); -// obj->mainNode()->setDirection( dir ); -// if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); + Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); + Ogre::Vector3 dir( readXMLVec3Element( pElem, "direction" ) ); + Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); + SectorMeshObject * obj = createBeacon( ); + if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); + if ( dir != Ogre::Vector3::ZERO ) obj->mainNode()->setDirection( dir ); + if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); } for ( pElem = hRoot.FirstChild( "sectorobject" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement("sectorobject") ) { @@ -127,9 +132,9 @@ if ( pElemChild ){ std::string mesh; readXMLAttribute < std::string >( pElemChild, "meshFile", mesh ); SectorMeshObject * obj = createMeshObject( name, mesh ); - if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); - // if ( scale != Ogre::Vector3::ZERO ) obj->scale( scale ); - if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); + if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); + if ( scale != Ogre::Vector3::ZERO ) obj->scaleNode()->scale( scale ); + if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); int nSubEnt = 0; readXMLAttribute < int >( pElemChild, "numSubEntities", nSubEnt ); for ( int i = 0; i < nSubEnt; i ++ ){ @@ -156,6 +161,24 @@ return obj; } +SectorMeshObject * Sector::createBeacon( ){ + SectorMeshObject * obj = new SectorBeaconObject( this->name() + "/Beacon", this ); + sectorObjects_.insert( obj ); + return obj; +} + +SectorMeshObject * Sector::createStation( const Ogre::String & stationName ){ + Station * station = ResourceManager::getSingleton().entityManager->station( stationName ); + SectorMeshObject * obj = NULL; + + if ( station ){ + obj = new SectorStationObject( station, this ); + sectorObjects_.insert( obj ); + sectorStations_.insert( dynamic_cast< SectorStationObject * >( obj ) ); + } + return obj; +} + void Sector::createAvatarObject( Avatar & avatar ){ log_->info( std::string( "Sector::createAvatarObject: " ) + avatar.name() ); avatar_ = new SectorAvatarObject( avatar.name(), this, avatar.vessel() ); Modified: trunk/src/Sector.h =================================================================== --- trunk/src/Sector.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Sector.h 2009-01-19 23:13:32 UTC (rev 950) @@ -62,6 +62,12 @@ /*! Create a mesh within the sector, without any specialization */ SectorMeshObject * createMeshObject( const std::string & name, const std::string & meshname ); + /*! Create a beacon within the sector */ + SectorMeshObject * createBeacon( ); + + /*! Create a station within the sector */ + SectorMeshObject * createStation( const Ogre::String & stationName ); + /*! Return handle to the avatarObject */ inline SectorAvatarObject * avatarObject() { return avatar_; } @@ -81,6 +87,9 @@ /*! Hold all stuff that makes the sector looking nice */ //std::set< SectorEnvironmentObject * > sectorEnvironment_; + /*! Hold all stuff that makes the sector looking nice */ + std::set< SectorStationObject * > sectorStations_; + std::map< std::string, std::deque< SectorCollisionObject * > > objectHeap_; }; @@ -215,7 +224,7 @@ std::map< long, SectorObjectMovable * > movableObjects_; std::map< long, SectorObjectMissile * > localAiObjects_; - + float avatarDeathSequenceTime_; bool radar_ ; Modified: trunk/src/SectorAvatarObject.cpp =================================================================== --- trunk/src/SectorAvatarObject.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorAvatarObject.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -47,8 +47,7 @@ } void SectorAvatarObject::collide( SectorCollisionObject * object ){ - std::cout << "SectorAvatarObject: " << this->name() << " collide with " - << object->rtti() << " " << object->name() << std::endl; + SectorMovableObject::collide( object ); } bool SectorAvatarObject::update( Ogre::Real elapsedTime ){ Modified: trunk/src/SectorAvatarObject.h =================================================================== --- trunk/src/SectorAvatarObject.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorAvatarObject.h 2009-01-19 23:13:32 UTC (rev 950) @@ -36,7 +36,7 @@ virtual ~SectorAvatarObject( ); /*! Abstract method for runtime identification */ - virtual int rtti( ) const { return SECTORAVATAROBJECT_RTTI; } + virtual int rtti( ) const { return SECTOR_AVATAR_OBJECT_RTTI; } virtual bool update( Ogre::Real elapsedTime ); Added: trunk/src/SectorBeaconObject.cpp =================================================================== --- trunk/src/SectorBeaconObject.cpp (rev 0) +++ trunk/src/SectorBeaconObject.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#include "SectorBeaconObject.h" + +#include "LogManager.h" +#include "ResourceManager.h" +#include "Sector.h" + +#include <OgreEntity.h> +#include <OgreSceneManager.h> +#include <OgreSceneNode.h> +#include <OgreSubEntity.h> + +namespace OpenGate{ + +SectorBeaconObject::SectorBeaconObject( const std::string & name, Sector * sector, Ogre::SceneNode * parentNode ) + : SectorMeshObject( name, sector, parentNode ) { + this->setMesh( "beacon.mesh" ); + + entityScaleNode_->scale( 20.0, 20.0, 20.0 ); + + for ( uint i = 0; i < entity()->getNumSubEntities(); i ++ ){ + std::cout << entity()->getSubEntity( i )->getMaterialName() << " Techniques: " + << entity()->getSubEntity( i )->getMaterial()->getNumTechniques() << " used: " + << entity()->getSubEntity( i )->getTechnique()->getName() << std::endl; + + if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/bg" ){ + entity()->getSubEntity( i )->setMaterialName( "Sta/TS/Background" ); + } + + if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/pad_mount_0" ){ + entity()->getSubEntity( i )->setMaterialName( "singleColor" ); + entity()->getSubEntity( i )->setCustomParameter( 0, Ogre::Vector4( 0.5, 0.5, 0.5, 1.0 ) ); +// entryPad_ = new BeaconPad( "EntryPad", this, entity()->getSubEntity( i ) ); +// entryPad_->changeEntity( "beacon_pad.mesh" ); +// entryPad_->entity()->setMaterialName( "singleColor" ); +// entryPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); + } + if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/pad_mount_1" ){ + entity()->getSubEntity( i )->setMaterialName( "singleColor" ); + entity()->getSubEntity( i )->setCustomParameter( 0, Ogre::Vector4( 0.5, 0.5, 0.5, 1.0 ) ); +// exitPad_ = new BeaconPad( "ExitPad", this, entity()->getSubEntity( i ) ); +// exitPad_->changeEntity( "beacon_pad.mesh" ); +// exitPad_->entity()->setMaterialName( "singleColor" ); +// exitPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); + } + } +} + +SectorBeaconObject::~SectorBeaconObject( ){ + +} + +} Added: trunk/src/SectorBeaconObject.h =================================================================== --- trunk/src/SectorBeaconObject.h (rev 0) +++ trunk/src/SectorBeaconObject.h 2009-01-19 23:13:32 UTC (rev 950) @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#ifndef _OPENGATE_SECTORBEACONOBJECT__H +#define _OPENGATE_SECTORBEACONOBJECT__H + +#include "Opengate.h" + +#include "SectorMeshObject.h" + +namespace OpenGate{ + +/*! A Beacon object */ +class SectorBeaconObject : public SectorMeshObject { +public: + /*! Construct the Beacon */ + SectorBeaconObject( const std::string & name, Sector * sector, Ogre::SceneNode * parentNode = NULL ); + + /*! Default destructor */ + virtual ~SectorBeaconObject( ); + + /*! Abstract method for runtime identification */ + virtual int rtti( ) const { return SECTOR_BEACON_OBJECT_RTTI; } + + /*! Update function */ + virtual bool update( Ogre::Real elapsedTime ) { return true; } + +protected: + +}; + +} //namespace OpenGate + +#endif //_OPENGATE_SECTORBEACONOBJECT__H Modified: trunk/src/SectorCollisionObject.h =================================================================== --- trunk/src/SectorCollisionObject.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorCollisionObject.h 2009-01-19 23:13:32 UTC (rev 950) @@ -36,7 +36,7 @@ virtual ~SectorCollisionObject( ); /*! Abstract method for runtime identification */ - virtual int rtti( ) const { return SECTORCOLLISIONOBJECT_RTTI; } + virtual int rtti( ) const { return SECTOR_COLLISION_OBJECT_RTTI; } /*! Abstract update function */ virtual bool update( Ogre::Real elapsedTime ) = 0; @@ -49,7 +49,7 @@ inline void setCollisionObject( OgreOpcode::CollisionObject * obj ){ collObj_ = obj; } /*! Return a ptr to the collisionObject.*/ - inline OgreOpcode::CollisionObject * pCollisionObject( ){ return collObj_; } + inline OgreOpcode::CollisionObject * collisionObject( ){ return collObj_; } /*! Return the type of the collisionObject, That determines the kind of collision detection.*/ inline virtual std::string collisionClass() const { return "SectorObject"; } Modified: trunk/src/SectorMeshObject.cpp =================================================================== --- trunk/src/SectorMeshObject.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorMeshObject.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -41,7 +41,7 @@ SectorMeshObject::~SectorMeshObject( ){ if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->destroyObject( collObj_ ); + ResourceManager::getSingleton().collisionManager->destroy( collObj_ ); } if ( entity_ ) sector_->sceneManager()->destroyEntity( entity_ ); entityRotNode_->detachAllObjects(); @@ -70,7 +70,7 @@ entityRotNode_->attachObject( entity_ ); if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->createObject( this ); + ResourceManager::getSingleton().collisionManager->create( this ); } } Modified: trunk/src/SectorMeshObject.h =================================================================== --- trunk/src/SectorMeshObject.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorMeshObject.h 2009-01-19 23:13:32 UTC (rev 950) @@ -36,7 +36,7 @@ virtual ~SectorMeshObject( ); /*! Abstract method for runtime identification */ - virtual int rtti( ) const { return SECTORMESHOBJECT_RTTI; } + virtual int rtti( ) const { return SECTOR_MESH_OBJECT_RTTI; } /*! Update function */ virtual bool update( Ogre::Real elapsedTime ) { return true; } @@ -64,10 +64,6 @@ Ogre::SceneNode * entityRotNode_; // Main character node for base rotation }; - class SectorStationObject : public SectorMeshObject{ - }; - class SectorBeaconObject : public SectorMeshObject{ - }; class SectorAsteroidObject : public SectorMeshObject{ }; class SectorAnomalieObject : public SectorMeshObject{ Modified: trunk/src/SectorMovableObject.cpp =================================================================== --- trunk/src/SectorMovableObject.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorMovableObject.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -55,22 +55,40 @@ interpolateRot_ = Ogre::Quaternion::ZERO; interpolateVel_ = Ogre::Vector3::ZERO; - brakePressed_ = false;; + brakePressed_ = false; + afterburnerPressed_ = false; + lifeTime_ = 0.0; + speed_ = 0.0; + maxSpeed_ = movable_->maxSpeed(); + thrustRate_ = 0.0; - lifeTime_ = 0.0; - speed_ = 0.0; - maxSpeed_ = movable_->maxSpeed(); - thrustRate_ = 0.0; - - thrust_ = 0; - mass_ = movable_->mass(); - armor_ = movable_->armor(); - shield_ = 0; + thrust_ = 0; + mass_ = movable_->mass(); + armor_ = movable_->armor(); + shield_ = 0; } -void SectorMovableObject::collide( SectorCollisionObject * object ){ +void SectorMovableObject::collide( SectorCollisionObject * obj ){ std::cout << "SectorMovableObject: " << this->name() << " collide with " - << object->rtti() << " " << object->name() << std::endl; + << obj->rtti() << " " << obj->name() << std::endl; + + if ( this != obj ){ + switch( obj->rtti( ) ){ + case SECTOR_AVATAR_OBJECT_RTTI: + case SECTOR_BEACON_OBJECT_RTTI: + case SECTOR_MESH_OBJECT_RTTI: + case SECTOR_MOVABLE_OBJECT_RTTI: + case SECTOR_STATION_OBJECT_RTTI: + case SECTOR_VESSEL_OBJECT_RTTI: + vel_ *= -1.0; + mainNode_->translate( ( mainNode_->getPosition() - + obj->mainNode()->getPosition() ).normalisedCopy() * 3.0 ); + break; +// case SECTOROBJECTMISSILE_RTTI: +// hitByAmmo( dynamic_cast < SectorObjectMissile *>( obj )->missile()->damage() ); +// break; + } + } } bool SectorMovableObject::update( Ogre::Real elapsedTime ){ @@ -116,9 +134,10 @@ vel_ += acc_ * elapsedTime; speed_ = vel_.length(); - if ( speed_ > movable_->maxSpeed() ){ - vel_ *= movable_->maxSpeed() / speed_; - } else if ( speed_ < 0.01 ){ +// if ( speed_ > movable_->maxSpeed() && !afterburnerPressed_ ){ +// vel_ *= movable_->maxSpeed() / speed_; +// } else + if ( speed_ < 0.01 ){ vel_ *= 0.0; } Modified: trunk/src/SectorMovableObject.h =================================================================== --- trunk/src/SectorMovableObject.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorMovableObject.h 2009-01-19 23:13:32 UTC (rev 950) @@ -38,7 +38,7 @@ virtual ~SectorMovableObject( ); /*! Abstract method for runtime identification */ - virtual int rtti( ) const { return SECTORMOVABLEOBJECT_RTTI; } + virtual int rtti( ) const { return SECTOR_MOVABLE_OBJECT_RTTI; } virtual bool update( Ogre::Real elapsedTime ); @@ -94,11 +94,17 @@ inline Ogre::Real brakingAcc(){ return 5.0; } /*! Set the brake key top be pressed or released */ - void setBrakePressed( bool pressed ) { brakePressed_ = pressed; } + inline void setBrakePressed( bool pressed ) { if ( pressed ) thrustRate_ = 0.0; brakePressed_ = pressed; } /*! Return if brake key pressed */ - bool brakePressed( ) const { return brakePressed_; } - + inline bool brakePressed( ) const { return brakePressed_; } + + /*! Afterburner pressed */ + inline void setAfterburnerPressed( bool pressed ){ if ( pressed ) thrustRate_ = 1.0; afterburnerPressed_ = pressed; } + + /*! Return the afterburner key status */ + inline bool afterburnerPressed( ) const { return afterburnerPressed_; } + /*! Reset all values for this object. */ virtual void reset( ); @@ -122,6 +128,7 @@ Ogre::Vector3 interpolateVel_; bool brakePressed_; + bool ... [truncated message content] |
From: <spo...@us...> - 2009-01-21 18:21:07
|
Revision: 953 http://opengate.svn.sourceforge.net/opengate/?rev=953&view=rev Author: spom_spom Date: 2009-01-21 18:21:01 +0000 (Wed, 21 Jan 2009) Log Message: ----------- next steps of reorganization done. (launching and docking) Modified Paths: -------------- trunk/data/stations/tauseti_wake.xml trunk/src/Makefile.am trunk/src/OpcodeWrapper.cpp trunk/src/Opengate.h trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorBeaconObject.cpp trunk/src/SectorBeaconObject.h trunk/src/SectorCollisionObject.h trunk/src/SectorMovableObject.cpp trunk/src/SectorStationObject.cpp trunk/src/SectorStationObject.h trunk/src/UnDockedState.cpp Added Paths: ----------- trunk/src/SectorBeaconPadObject.cpp trunk/src/SectorBeaconPadObject.h trunk/src/SectorChildObject.cpp trunk/src/SectorChildObject.h trunk/src/SectorPadObject.cpp trunk/src/SectorPadObject.h trunk/src/SectorStationPadObject.cpp trunk/src/SectorStationPadObject.h Modified: trunk/data/stations/tauseti_wake.xml =================================================================== (Binary files differ) Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/Makefile.am 2009-01-21 18:21:01 UTC (rev 953) @@ -84,14 +84,22 @@ SectorBaseObject.cpp \ SectorBeaconObject.h \ SectorBeaconObject.cpp \ + SectorBeaconPadObject.h \ + SectorBeaconPadObject.cpp \ + SectorChildObject.h \ + SectorChildObject.cpp \ SectorCollisionObject.h \ SectorCollisionObject.cpp \ SectorMeshObject.h \ SectorMeshObject.cpp \ SectorMovableObject.h \ SectorMovableObject.cpp \ + SectorPadObject.h \ + SectorPadObject.cpp \ SectorStationObject.h \ SectorStationObject.cpp \ + SectorStationPadObject.h \ + SectorStationPadObject.cpp \ SectorVesselObject.h \ SectorVesselObject.cpp \ SectorObject.h \ Modified: trunk/src/OpcodeWrapper.cpp =================================================================== --- trunk/src/OpcodeWrapper.cpp 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/OpcodeWrapper.cpp 2009-01-21 18:21:01 UTC (rev 953) @@ -52,7 +52,7 @@ collisionManager_->addCollClass( "DockPad" ); collisionManager_->addCollClass( "Bullet" ); - collisionManager_->addCollType( "Bullet", "Bullet", OgreOpcode::COLLTYPE_IGNORE ); + collisionManager_->addCollType( "Bullet", "Bullet", OgreOpcode::COLLTYPE_IGNORE ); collisionManager_->addCollType( "SectorObject", "Bullet", OgreOpcode::COLLTYPE_EXACT ); collisionManager_->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_EXACT ); collisionManager_->addCollType( "Station", "SectorObject", OgreOpcode::COLLTYPE_EXACT ); Modified: trunk/src/Opengate.h =================================================================== --- trunk/src/Opengate.h 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/Opengate.h 2009-01-21 18:21:01 UTC (rev 953) @@ -35,14 +35,18 @@ namespace OpenGate{ -#define SECTOR_AVATAR_OBJECT_RTTI 1 -#define SECTOR_BASE_OBJECT_RTTI 2 -#define SECTOR_BEACON_OBJECT_RTTI 3 -#define SECTOR_COLLISION_OBJECT_RTTI 4 -#define SECTOR_MESH_OBJECT_RTTI 5 -#define SECTOR_MOVABLE_OBJECT_RTTI 6 -#define SECTOR_STATION_OBJECT_RTTI 7 -#define SECTOR_VESSEL_OBJECT_RTTI 8 +#define SECTOR_AVATAR_OBJECT_RTTI 1 +#define SECTOR_BASE_OBJECT_RTTI 2 +#define SECTOR_BEACON_OBJECT_RTTI 3 +#define SECTOR_BEACON_PAD_OBJECT_RTTI 4 +#define SECTOR_CHILD_OBJECT_RTTI 5 +#define SECTOR_COLLISION_OBJECT_RTTI 6 +#define SECTOR_MESH_OBJECT_RTTI 7 +#define SECTOR_MOVABLE_OBJECT_RTTI 8 +#define SECTOR_PAD_OBJECT_RTTI 9 +#define SECTOR_STATION_OBJECT_RTTI 10 +#define SECTOR_STATION_PAD_OBJECT_RTTI 11 +#define SECTOR_VESSEL_OBJECT_RTTI 12 #define SECTOROBJECTENVIRONMENT_RTTI 1000010 #define PROJECTILE_RTTI 100001 @@ -77,10 +81,14 @@ class SectorAvatarObject; class SectorBaseObject; class SectorBeaconObject; +class SectorBeaconPadObject; +class SectorChildObject; class SectorCollisionObject; class SectorMeshObject; class SectorMovableObject; +class SectorPadObject; class SectorStationObject; +class SectorStationPadObject; class SectorVesselObject; class SectorObject; Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/Sector.cpp 2009-01-21 18:21:01 UTC (rev 953) @@ -34,8 +34,9 @@ #include "SectorCollisionObject.h" #include "SectorMeshObject.h" #include "SectorStationObject.h" +#include "SectorStationPadObject.h" +#include "UnDockedState.h" - #include <OgreEntity.h> #include <OgreSceneManager.h> #include <OgreSubEntity.h> @@ -47,6 +48,7 @@ log_ = LogManager::getSingletonPtr(); name_ = "unknown"; + listener_ = NULL; avatar_ = NULL; } @@ -185,14 +187,38 @@ sectorObjects_.insert( avatar_ ); avatar_->reset(); - log_->info( std::string( "launch avatar from free position " ) ); - avatar_->mainNode()->setPosition( 0.0, 0.0, 0.0 ); - avatar_->mainNode()->setDirection( Ogre::Vector3( 0.0, 0.0, -1.0 ) ); - avatar_->setVelocity( Ogre::Vector3( 0.0, 0.0, 0.0 ) ); - + bool hasStation = false; + if ( !sectorStations_.empty() ){ + SectorStationObject *station = dynamic_cast< SectorStationObject* >( *sectorStations_.begin() ); + log_->info( std::string( "launch avatar from station " ) ); + if ( station->launchPad() ){ + avatar_->mainNode()->setPosition( station->launchPad()->position( true ) + station->launchPad()->direction( true ) * 5.0); + avatar_->mainNode()->setDirection( station->launchPad()->direction( true ) ); + avatar_->setVelocity( station->launchPad()->direction( true ) * 20.0 ); + hasStation = true; + } else { + log_->warn( std::string( "Station " + station->name() + " has no launch pad" ) ); + } + } + if ( !hasStation ) { + log_->info( std::string( "launch avatar from free position " ) ); + avatar_->mainNode()->setPosition( 0.0, 0.0, 0.0 ); + avatar_->mainNode()->setDirection( Ogre::Vector3( 0.0, 0.0, -1.0 ) ); + avatar_->setVelocity( Ogre::Vector3( 0.0, 0.0, 0.0 ) ); + } avatar_->mainNode()->setVisible( false ); } +void Sector::objectDocked( SectorMovableObject * obj, SectorStationObject * station ){ + std::cout << obj->name() << " docked at " << station->name() << std::endl; + switch ( obj->rtti() ){ + case SECTOR_AVATAR_OBJECT_RTTI: + if ( listener_ ) listener_->changeToDockedState(); + break; + default: break; + } +} + #else #include "Sector.h" Modified: trunk/src/Sector.h =================================================================== --- trunk/src/Sector.h 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/Sector.h 2009-01-21 18:21:01 UTC (rev 953) @@ -41,6 +41,10 @@ /*! Return a ptr to the associated Ogre::SceneManager */ inline Ogre::SceneManager * sceneManager() { return sceneMgr_; } + inline void setListener( UnDockedState * listener ){ listener_ = listener; } + + inline UnDockedState * listener( ){ return listener_; } + /*! Main update function, that will be called every frame from listener. These call update all associated objects. */ bool update( Ogre::Real elapsedTime ); @@ -71,6 +75,9 @@ /*! Return handle to the avatarObject */ inline SectorAvatarObject * avatarObject() { return avatar_; } + /*! Someone has docked */ + void objectDocked( SectorMovableObject * obj, SectorStationObject * station ); + protected: Ogre::SceneManager * sceneMgr_; NetworkClient * network_; Modified: trunk/src/SectorBeaconObject.cpp =================================================================== --- trunk/src/SectorBeaconObject.cpp 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/SectorBeaconObject.cpp 2009-01-21 18:21:01 UTC (rev 953) @@ -23,6 +23,7 @@ #include "LogManager.h" #include "ResourceManager.h" #include "Sector.h" +#include "SectorBeaconPadObject.h" #include <OgreEntity.h> #include <OgreSceneManager.h> @@ -33,8 +34,11 @@ SectorBeaconObject::SectorBeaconObject( const std::string & name, Sector * sector, Ogre::SceneNode * parentNode ) : SectorMeshObject( name, sector, parentNode ) { - this->setMesh( "beacon.mesh" ); + entryPad_ = NULL; + exitPad_ = NULL; + + setMesh( "beacon.mesh" ); entityScaleNode_->scale( 20.0, 20.0, 20.0 ); for ( uint i = 0; i < entity()->getNumSubEntities(); i ++ ){ @@ -49,24 +53,25 @@ if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/pad_mount_0" ){ entity()->getSubEntity( i )->setMaterialName( "singleColor" ); entity()->getSubEntity( i )->setCustomParameter( 0, Ogre::Vector4( 0.5, 0.5, 0.5, 1.0 ) ); -// entryPad_ = new BeaconPad( "EntryPad", this, entity()->getSubEntity( i ) ); -// entryPad_->changeEntity( "beacon_pad.mesh" ); -// entryPad_->entity()->setMaterialName( "singleColor" ); -// entryPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); + entryPad_ = new SectorBeaconPadObject( "EntryPad", this, entity()->getSubEntity( i ) ); + entryPad_->changeEntity( "beacon_pad.mesh" ); + entryPad_->entity()->setMaterialName( "singleColor" ); + entryPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); } if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/pad_mount_1" ){ entity()->getSubEntity( i )->setMaterialName( "singleColor" ); entity()->getSubEntity( i )->setCustomParameter( 0, Ogre::Vector4( 0.5, 0.5, 0.5, 1.0 ) ); -// exitPad_ = new BeaconPad( "ExitPad", this, entity()->getSubEntity( i ) ); -// exitPad_->changeEntity( "beacon_pad.mesh" ); -// exitPad_->entity()->setMaterialName( "singleColor" ); -// exitPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); + exitPad_ = new SectorBeaconPadObject( "ExitPad", this, entity()->getSubEntity( i ) ); + exitPad_->changeEntity( "beacon_pad.mesh" ); + exitPad_->entity()->setMaterialName( "singleColor" ); + exitPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); } } } SectorBeaconObject::~SectorBeaconObject( ){ - + if ( entryPad_ ) delete entryPad_; + if ( exitPad_ ) delete exitPad_; } } Modified: trunk/src/SectorBeaconObject.h =================================================================== --- trunk/src/SectorBeaconObject.h 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/SectorBeaconObject.h 2009-01-21 18:21:01 UTC (rev 953) @@ -39,11 +39,20 @@ /*! Abstract method for runtime identification */ virtual int rtti( ) const { return SECTOR_BEACON_OBJECT_RTTI; } + inline virtual std::string collisionClass() const { return "Station"; } + /*! Update function */ virtual bool update( Ogre::Real elapsedTime ) { return true; } + /*! Return ptr to the entry pad */ + SectorBeaconPadObject * entryPad() { return entryPad_; } + + /*! Return ptr to the exit pad */ + SectorBeaconPadObject * exitPad() { return exitPad_; } + protected: - + SectorBeaconPadObject * entryPad_; + SectorBeaconPadObject * exitPad_; }; } //namespace OpenGate Added: trunk/src/SectorBeaconPadObject.cpp =================================================================== --- trunk/src/SectorBeaconPadObject.cpp (rev 0) +++ trunk/src/SectorBeaconPadObject.cpp 2009-01-21 18:21:01 UTC (rev 953) @@ -0,0 +1,76 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#include "SectorBeaconPadObject.h" + +#include "OpcodeWrapper.h" +#include "ResourceManager.h" +#include "Sector.h" +#include "SectorBeaconObject.h" + +#include <OgreEntity.h> +#include <OgreSceneManager.h> +#include <OgreSceneNode.h> + +namespace OpenGate{ + +SectorBeaconPadObject::SectorBeaconPadObject( const std::string & name, SectorBeaconObject * parent, Ogre::SubEntity * parentSubEntity ) + : SectorPadObject( name, parent, parentSubEntity ){ + + if ( ResourceManager::getSingleton().collisionManager ){ + ResourceManager::getSingleton().collisionManager->create( this ); + } +} + +SectorBeaconPadObject::~SectorBeaconPadObject( ){ + if ( ResourceManager::getSingleton().collisionManager ){ + ResourceManager::getSingleton().collisionManager->destroy( this ); + } +} + +bool SectorBeaconPadObject::update( Ogre::Real elapsedTime ) { + return true; +} + +void SectorBeaconPadObject::collide( SectorCollisionObject * obj ){ + std::cout << "SectorBeaconPadObject: " << this->name() << " collide with " + << obj->rtti() << " " << obj->name() << std::endl; +} + +SectorBeaconObject * SectorBeaconPadObject::beacon() { + return dynamic_cast < SectorBeaconObject * >( parent_ ); +} + +void SectorBeaconPadObject::changeEntity( const std::string & meshname ){ + if ( ResourceManager::getSingleton().collisionManager ){ + ResourceManager::getSingleton().collisionManager->destroy( this ); + } + mainNode_->detachObject( entity_ ); + sector_->sceneManager()->destroyEntity( entity_ ); + entity_ = sector_->sceneManager()->createEntity( name_ + "/Entity", meshname ); + mainNode_->attachObject( entity_ ); + mainNode_->translate( position_ ); + + if ( ResourceManager::getSingleton().collisionManager ){ + ResourceManager::getSingleton().collisionManager->create( this ); + } +} + +} Added: trunk/src/SectorBeaconPadObject.h =================================================================== --- trunk/src/SectorBeaconPadObject.h (rev 0) +++ trunk/src/SectorBeaconPadObject.h 2009-01-21 18:21:01 UTC (rev 953) @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#ifndef _OPENGATE_SECTORBEACONPADOBJECT__H +#define _OPENGATE_SECTORBEACONPADOBJECT__H + +#include "Opengate.h" +#include "SectorPadObject.h" + +namespace OpenGate{ + +/*! Baseclass for Child SectorObjects that contains to any parent SectorCollisionObject. i.e. projectile, pads. */ +class SectorBeaconPadObject : public SectorPadObject { +public: + /*! Construct SectorPadObject */ + SectorBeaconPadObject( const std::string & name, SectorBeaconObject * parent, Ogre::SubEntity * parentSubEntity ); + + /*! Default destructor */ + virtual ~SectorBeaconPadObject( ); + + /*! Abstract method for runtime identification */ + virtual int rtti( ) const { return SECTOR_BEACON_PAD_OBJECT_RTTI; } + + /*! Update function will called from parents update loop. */ + virtual bool update( Ogre::Real elapsedTime ); + + /*! Start docking procedure */ + virtual void collide( SectorCollisionObject * object ); + + /*! Return ptr to parent SectorStationObject */ + SectorBeaconObject * beacon(); + + /*! Change the entity of this object, maybee there is a good place in any parent class */ + void changeEntity( const std::string & meshname ); + +protected: + +}; + +} //namespace OpenGate + +#endif //_OPENGATE_SECTORBEACONPADOBJECT__H + + Added: trunk/src/SectorChildObject.cpp =================================================================== --- trunk/src/SectorChildObject.cpp (rev 0) +++ trunk/src/SectorChildObject.cpp 2009-01-21 18:21:01 UTC (rev 953) @@ -0,0 +1,36 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#include "SectorChildObject.h" + +#include "Sector.h" +#include "SectorMeshObject.h" + +namespace OpenGate{ + +SectorChildObject::SectorChildObject( const std::string & name, SectorMeshObject * parent ) + : SectorCollisionObject( name, parent->sector(), parent->rotNode() ), parent_( parent ){ +} + +SectorChildObject::~SectorChildObject( ){ + +} + +} Added: trunk/src/SectorChildObject.h =================================================================== --- trunk/src/SectorChildObject.h (rev 0) +++ trunk/src/SectorChildObject.h 2009-01-21 18:21:01 UTC (rev 953) @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#ifndef _OPENGATE_SECTORCHILDOBJECT__H +#define _OPENGATE_SECTORCHILDOBJECT__H + +#include "Opengate.h" +#include "SectorCollisionObject.h" + +namespace OpenGate{ + +/*! Baseclass for Child SectorObjects that contains to any parent SectorCollisionObject. i.e. projectile, pads. */ +class SectorChildObject : public SectorCollisionObject { +public: + /*! Construct SectorObjectBase, */ + SectorChildObject( const std::string & name, SectorMeshObject * parent ); + + /*! Default destructor */ + virtual ~SectorChildObject( ); + + /*! Abstract method for runtime identification */ + virtual int rtti( ) const { return SECTOR_CHILD_OBJECT_RTTI; } + + /*! Set a new parent for this object */ + inline void setParent( SectorCollisionObject * parent ) { parent_ = parent; } + + /*! Return a ptr to the parent SectorCollisionObject */ + inline SectorCollisionObject * parent() { return parent_; } + +protected: + SectorCollisionObject * parent_; +}; + + class SectorProjectileObject : public SectorChildObject { + }; + +} //namespace OpenGate + +#endif //_OPENGATE_SECTORCHILDOBJECT__H + + Modified: trunk/src/SectorCollisionObject.h =================================================================== --- trunk/src/SectorCollisionObject.h 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/SectorCollisionObject.h 2009-01-21 18:21:01 UTC (rev 953) @@ -63,17 +63,6 @@ Ogre::Entity * entity_; }; - /*! Special child SectorObject that is assiciated to any parent SectorObject.*/ - class SectorChildObject : public SectorCollisionObject { - }; - class SectorPadObject : public SectorChildObject { - }; - class SectorProjectileObject : public SectorChildObject { - }; - class SectorStationPadObject : public SectorPadObject { - }; - class SectorBeaconPadObject : public SectorPadObject { - }; } //namespace OpenGate #endif //_OPENGATE_SECTORCOLLISIONOBJECT__H Modified: trunk/src/SectorMovableObject.cpp =================================================================== --- trunk/src/SectorMovableObject.cpp 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/SectorMovableObject.cpp 2009-01-21 18:21:01 UTC (rev 953) @@ -69,9 +69,6 @@ } void SectorMovableObject::collide( SectorCollisionObject * obj ){ - std::cout << "SectorMovableObject: " << this->name() << " collide with " - << obj->rtti() << " " << obj->name() << std::endl; - if ( this != obj ){ switch( obj->rtti( ) ){ case SECTOR_AVATAR_OBJECT_RTTI: @@ -87,6 +84,9 @@ // case SECTOROBJECTMISSILE_RTTI: // hitByAmmo( dynamic_cast < SectorObjectMissile *>( obj )->missile()->damage() ); // break; + default: + std::cout << "SectorMovableObject: " << this->name() << " collide with " + << obj->rtti() << " " << obj->name() << std::endl; } } } Added: trunk/src/SectorPadObject.cpp =================================================================== --- trunk/src/SectorPadObject.cpp (rev 0) +++ trunk/src/SectorPadObject.cpp 2009-01-21 18:21:01 UTC (rev 953) @@ -0,0 +1,105 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#include "SectorPadObject.h" + +#include "commonWithOgre.h" + +#include "Sector.h" + +#include <OgreEntity.h> +#include <OgreManualObject.h> +#include <OgreMeshManager.h> +#include <OgreSceneManager.h> +#include <OgreSceneNode.h> +#include <OgreSubEntity.h> + + +namespace OpenGate{ + +SectorPadObject::SectorPadObject( const std::string & name, SectorMeshObject * parent, Ogre::SubEntity * parentSubEntity ) + : SectorChildObject( name, parent ){ + + manualObject_ = sector_->sceneManager()->createManualObject( this->name() + "/ManualObject" ); + + std::vector < Ogre::Vector3 > verts; + std::vector < Triangle > tris; + readSubEntity( parentSubEntity, verts, tris ); + + //padManualObject_->begin( "BaseWhiteNoLighting", Ogre::RenderOperation::OT_TRIANGLE_LIST ); + manualObject_->begin( parentSubEntity->getMaterialName(), Ogre::RenderOperation::OT_TRIANGLE_LIST ); + + Ogre::Real xmin( 9e99 ), xmax( -9e99 ), ymin( 9e99 ), ymax( -9e99 ), zmin( 9e99 ), zmax( -9e99 ); + position_ = Ogre::Vector3::ZERO; + + for( uint i = 0; i < verts.size(); i++ ){ + position_ += verts[ i ]; + + xmin = min( xmin, verts[ i ][ 0 ] ); xmax = max( xmax, verts[ i ][ 0 ] ); + ymin = min( ymin, verts[ i ][ 1 ] ); ymax = max( ymax, verts[ i ][ 1 ] ); + zmin = min( zmin, verts[ i ][ 2 ] ); zmax = max( zmax, verts[ i ][ 2 ] ); + manualObject_->position( verts[ i ] ); //pReal[ 0 ], pReal[ 1 ], pReal[ 2 ] ); + } + + position_ /= verts.size(); + radius_ = max( xmax-xmin, ymax-ymin ); + radius_ = max( radius_, zmax - zmin ); + radius_ /= 2.0; + + direction_ = Ogre::Vector3::ZERO; + for ( uint i = 0; i < tris.size(); i++ ) { + manualObject_->triangle( tris[ i ].a, tris[ i ].b, tris[ i ].c ); + direction_ += ( ( verts[ tris[ i ].b ] - verts[ tris[ i ].a ] ) + .crossProduct( verts[ tris[ i ].c ] - verts[ tris[ i ].a ] ) ).normalisedCopy(); + } + + direction_ /= tris.size(); + manualObject_->end(); + + mesh_ = manualObject_->convertToMesh( manualObject_->getName() + "/Mesh" ); + + entity_ = sector_->sceneManager()->createEntity( mesh_->getName() + "/Entity", mesh_->getName() ); + + mainNode_->attachObject( entity_ ); + mainNode_->translate( direction_.normalisedCopy() * 0.1 ); +} + +SectorPadObject::~SectorPadObject( ){ + mainNode_->detachObject( entity_ ); + sector_->sceneManager()->destroyEntity( entity_ ); + Ogre::MeshManager::getSingleton().remove( mesh_->getName() ); + sector_->sceneManager()->destroyManualObject( manualObject_ ); +} + +Ogre::Vector3 SectorPadObject::position( bool world ) const { + if ( world ){ + return mainNode_->getParent()->_getFullTransform() * position_; + } + return position_; +} + +Ogre::Vector3 SectorPadObject::direction( bool world ) const { + if ( world ){ + return mainNode_->getParent()->_getDerivedOrientation() * direction_; + } + return direction_; +} + +} Added: trunk/src/SectorPadObject.h =================================================================== --- trunk/src/SectorPadObject.h (rev 0) +++ trunk/src/SectorPadObject.h 2009-01-21 18:21:01 UTC (rev 953) @@ -0,0 +1,69 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#ifndef _OPENGATE_SECTORPADOBJECT__H +#define _OPENGATE_SECTORPADOBJECT__H + +#include "Opengate.h" + +#include "SectorChildObject.h" + +#include <OgreMesh.h> + +namespace OpenGate{ + +/*! Baseclass for Pads, mainly a face that is copied from a subentity of the parents mesh */ +class SectorPadObject : public SectorChildObject { +public: + /*! Construct SectorPadObject */ + SectorPadObject( const std::string & name, SectorMeshObject * parent, Ogre::SubEntity * parentSubEntity ); + + /*! Default destructor */ + virtual ~SectorPadObject( ); + + /*! Abstract method for runtime identification */ + virtual int rtti( ) const { return SECTOR_PAD_OBJECT_RTTI; } + + inline virtual std::string collisionClass() const { return "DockPad"; } + + /*! Return position the middle position of this pad relative to the parent node or in absolute world coordinates */ + Ogre::Vector3 position( bool world = false ) const; + + /*! Return direction perpendicular to the pads face relative to the parent main node or in absolute world coordinates */ + Ogre::Vector3 direction( bool world = false ) const; + + /*! Radius of the pad */ + Ogre::Real radius() const { return radius_; } + +protected: + + Ogre::ManualObject * manualObject_; + Ogre::MeshPtr mesh_; + + Ogre::Vector3 position_; + Ogre::Vector3 direction_; + Ogre::Real radius_; +}; + +} //namespace OpenGate + +#endif //_OPENGATE_SECTORPADOBJECT__H + + Modified: trunk/src/SectorStationObject.cpp =================================================================== --- trunk/src/SectorStationObject.cpp 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/SectorStationObject.cpp 2009-01-21 18:21:01 UTC (rev 953) @@ -20,9 +20,16 @@ #include "SectorStationObject.h" +#include "commonWithOgre.h" + #include "Entity.h" +#include "Sector.h" +#include "SectorStationPadObject.h" +#include <OgreBillboard.h> +#include <OgreBillboardSet.h> #include <OgreEntity.h> +#include <OgreManualObject.h> #include <OgreSceneManager.h> #include <OgreSceneNode.h> #include <OgreSubEntity.h> @@ -34,10 +41,126 @@ setMesh( station_->meshName() ); setBaseSize( station_->baseSize() ); + + dockPad_ = NULL; + launchPad_ = NULL; + flashLights_ = NULL; + ringNode_ = NULL; + + for ( uint i = 0; i < entity()->getNumSubEntities(); i ++ ){ + std::cout << entity()->getSubEntity( i )->getMaterialName() << " Techniques: " + << entity()->getSubEntity( i )->getMaterial()->getNumTechniques() << " used: " + << entity()->getSubEntity( i )->getTechnique()->getName() << std::endl; + +// for ( uint j = 0; j < entity()->getSubEntity( i )->getMaterial()->getNumTechniques(); j ++ ){ +// std::cout << entity()->getSubEntity( i )->getMaterial()->getTechnique( j )->getName() << std::endl; +// } + + if ( entity()->getSubEntity( i )->getMaterialName() == "Flashlight/Red" ){ + createFlashLights_( entity()->getSubEntity( i ) ); + } + if ( entity()->getSubEntity( i )->getMaterialName() == "Station/DockPad" ){ + dockPad_ = new SectorStationPadObject( name_ + "DockPad", this, entity()->getSubEntity( i ), true ); + } + if ( entity()->getSubEntity( i )->getMaterialName() == "Station/LaunchPad.001" ){ + launchPad_ = new SectorStationPadObject( name_ + "LaunchPad", this, entity()->getSubEntity( i ), false ); + } + } + + if ( dockPad_ ){ + createRings( dockPad_->position(), dockPad_->radius(), dockPad_->direction() ); + ringNode_->setVisible( true ); + } } SectorStationObject::~SectorStationObject( ){ + if ( launchPad_ ) delete launchPad_; + if ( dockPad_ ) delete dockPad_; + + if ( ringNode_ ){ + ringNode_->detachObject( ringEntity_ ); + sector_->sceneManager()->destroyManualObject( ringEntity_ ); + entityRotNode_->removeAndDestroyChild( ringNode_->getName() ); + } + + if ( flashLights_ ){ + entityRotNode_->detachObject( flashLights_ ); + sector_->sceneManager()->destroyBillboardSet( flashLights_ ); + } } +void SectorStationObject::createRings( const Ogre::Vector3 & position, Ogre::Real rMin, const Ogre::Vector3 & direction ){ + Ogre::Vector3 targetDir( direction ); + if ( targetDir == Ogre::Vector3::ZERO ) targetDir = entityRotNode_->getOrientation().zAxis(); + + Ogre::String name = name_+ "/Rings"; + + ringNode_ = entityRotNode_->createChildSceneNode( name ); + ringEntity_ = sector_->sceneManager()->createManualObject( name + "shape" ); + + Ogre::Real radius = rMin; + Ogre::Real thickness = rMin / 5.0; // Of course this must be less than the radius value. + Ogre::Real nSegments = 6; + Ogre::Real dPhi = 2.0 * 3.141592 / nSegments; + Ogre::Real length = 20; + int nRings = 20; + + unsigned point_index = 0; + + for ( int i = 0; i < nRings; i ++ ){ + radius = rMin + i * 10 * rMin / nRings ; + + ringEntity_->begin( "shader/gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); + ringEntity_->getSection( i )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0-(double)i/nRings, (double)i/nRings, 0.4 ) ); + ringEntity_->getSection( i )->setCustomParameter( 1, Ogre::Vector4( radius, 0, 0, 0 ) ); + + for ( int segment = 0; segment < nSegments; segment++ ) { + Ogre::Real theta = segment * dPhi + dPhi/2.0; + + ringEntity_->position( radius * cos( theta ), i * ( length / nRings ), + radius * sin( theta ) ); + ringEntity_->position( (radius - thickness) * cos( theta ), i * ( length / nRings ), + (radius - thickness) * sin( theta ) ); + if ( segment > 0 ){ + point_index = (segment+1)*2-1; + ringEntity_->quad( point_index, point_index-1, point_index-3, point_index-2 ); + ringEntity_->quad( point_index, point_index-2, point_index-3, point_index-1 ); + } + } + ringEntity_->quad( 1, 0, (uint)nSegments*2-2, (uint)nSegments*2-1 ); + ringEntity_->quad( 1, (uint)nSegments*2-1, (uint)nSegments*2-2, 0 ); + ringEntity_->end(); + } + + Ogre::Quaternion rot = Ogre::Vector3( 0.0, 1.0, 0.0 ).getRotationTo( targetDir ); + + ringNode_->rotate( rot ); + ringNode_->translate( position ); + ringNode_->attachObject( ringEntity_ ); } + +void SectorStationObject::createFlashLights_( Ogre::SubEntity * entity ){ + + entity->setVisible( false ); + std::vector< Ogre::Vector3 > verts; + std::vector< Triangle > tris; + readSubEntity( entity, verts, tris ); + + uint nLights = tris.size() / 2; + + flashLights_ = sector_->sceneManager()->createBillboardSet( name_ + "_BBS", nLights ); + flashLights_->setMaterialName( entity->getMaterialName() ); + + Ogre::Billboard *bb; + + for ( uint i = 0; i < nLights; i ++ ){ + bb = flashLights_->createBillboard( Ogre::Vector3::ZERO, Ogre::ColourValue( 1.0f, 0.0f, 0.0f, 1.0f) ); + bb->setDimensions( (verts[ i * 4 + 1 ] - verts[ i * 4 ] ).length(), + (verts[ i * 4 + 1 ] - verts[ i * 4 ] ).length() ); + bb->setPosition( ( verts[ i * 4 ] + verts[ i * 4 + 1 ] + verts[ i * 4 + 2 ] + verts[ i * 4 + 3] ) / 4.0 ); + } + entityRotNode_->attachObject( flashLights_ ); +} + +} Modified: trunk/src/SectorStationObject.h =================================================================== --- trunk/src/SectorStationObject.h 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/SectorStationObject.h 2009-01-21 18:21:01 UTC (rev 953) @@ -39,15 +39,37 @@ /*! Abstract method for runtime identification */ virtual int rtti( ) const { return SECTOR_STATION_OBJECT_RTTI; } + inline virtual std::string collisionClass() const { return "Station"; } + /*! Update function */ virtual bool update( Ogre::Real elapsedTime ) { return true; } /*! Return ptr to station entity */ Station * station(){ return station_; } + /*! Return ptr to the docking pad */ + SectorStationPadObject * dockPad() { return dockPad_; } + + /*! Return ptr to the launching pad */ + SectorStationPadObject * launchPad() { return launchPad_; } + + /*! Create docking rings */ + void createRings( const Ogre::Vector3 & position, Ogre::Real rMin, const Ogre::Vector3 & direction ); + protected: - Station * station_; + /*! Create some fancy flash lights, based on mesh infos */ + void createFlashLights_( Ogre::SubEntity * entity ); + + Station * station_; + + Ogre::SceneNode * ringNode_; + Ogre::ManualObject * ringEntity_; + + Ogre::BillboardSet * flashLights_; + SectorStationPadObject * dockPad_; + SectorStationPadObject * launchPad_; + }; } //namespace OpenGate Added: trunk/src/SectorStationPadObject.cpp =================================================================== --- trunk/src/SectorStationPadObject.cpp (rev 0) +++ trunk/src/SectorStationPadObject.cpp 2009-01-21 18:21:01 UTC (rev 953) @@ -0,0 +1,75 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#include "SectorStationPadObject.h" + +#include "OpcodeWrapper.h" +#include "ResourceManager.h" +#include "Sector.h" +#include "SectorMovableObject.h" +#include "SectorStationObject.h" + + +#include <OgreSubEntity.h> + +namespace OpenGate{ + +SectorStationPadObject::SectorStationPadObject( const std::string & name, SectorStationObject * parent, Ogre::SubEntity * padSubEntity, bool isDockPad ) + : SectorPadObject( name, parent, padSubEntity ), isDockPad_( isDockPad ){ + + if ( isDockPad_ ){ + if ( ResourceManager::getSingleton().collisionManager ){ + ResourceManager::getSingleton().collisionManager->create( this ); + } + } +} + +SectorStationPadObject::~SectorStationPadObject( ){ + if ( ResourceManager::getSingleton().collisionManager ){ + ResourceManager::getSingleton().collisionManager->destroy( this ); + } +} + +bool SectorStationPadObject::update( Ogre::Real elapsedTime ) { + return true; +} + +void SectorStationPadObject::collide( SectorCollisionObject * obj ){ + if ( this != obj ){ + if ( isDockPad_ ) { + switch( obj->rtti( ) ){ + case SECTOR_AVATAR_OBJECT_RTTI: + case SECTOR_MOVABLE_OBJECT_RTTI: + case SECTOR_VESSEL_OBJECT_RTTI: + sector_->objectDocked( dynamic_cast< SectorMovableObject * >( obj ), this->station() ); + break; + default: + std::cout << "SectorMovableObject: " << this->name() << " collide with " + << obj->rtti() << " " << obj->name() << std::endl; + } + } + } +} + +SectorStationObject * SectorStationPadObject::station() { + return dynamic_cast < SectorStationObject * >( parent_ ); +} + +} Added: trunk/src/SectorStationPadObject.h =================================================================== --- trunk/src/SectorStationPadObject.h (rev 0) +++ trunk/src/SectorStationPadObject.h 2009-01-21 18:21:01 UTC (rev 953) @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#ifndef _OPENGATE_SECTORSTATIONPADOBJECT__H +#define _OPENGATE_SECTORSTATIONPADOBJECT__H + +#include "Opengate.h" +#include "SectorPadObject.h" + +namespace OpenGate{ + +/*! Baseclass for Child SectorObjects that contains to any parent SectorCollisionObject. i.e. projectile, pads. */ +class SectorStationPadObject : public SectorPadObject { +public: + /*! Construct SectorPadObject */ + SectorStationPadObject( const std::string & name, SectorStationObject * parent, Ogre::SubEntity * padSubEntity, bool isDockPad ); + + /*! Default destructor */ + virtual ~SectorStationPadObject( ); + + /*! Abstract method for runtime identification */ + virtual int rtti( ) const { return SECTOR_STATION_PAD_OBJECT_RTTI; } + + /*! Update function will called from parents update loop. */ + virtual bool update( Ogre::Real elapsedTime ); + + /*! Start docking procedure */ + virtual void collide( SectorCollisionObject * object ); + + /*! Return ptr to parent SectorStationObject */ + SectorStationObject * station(); + + /*! Return true if the pad is suitable for docking */ + inline bool isDockPad( ) const { return isDockPad_; } + +protected: + bool isDockPad_; + +}; + +} //namespace OpenGate + +#endif //_OPENGATE_SECTORSTATIONPADOBJECT__H + + Modified: trunk/src/UnDockedState.cpp =================================================================== --- trunk/src/UnDockedState.cpp 2009-01-19 23:53:11 UTC (rev 952) +++ trunk/src/UnDockedState.cpp 2009-01-21 18:21:01 UTC (rev 953) @@ -112,6 +112,7 @@ sector_ = new Sector( sceneMgr_, network_ ); sector_->populate( "test.sector" ); sector_->createAvatarObject( *resources_->avatar ); + sector_->setListener( this ); hud_ = new Hud( overlayRootWindow_, sector_->avatarObject() ); @@ -120,8 +121,7 @@ } catch( ... ){ LogManager::getSingleton().warn( "UnDockedState::enter() -- Unknown exception" ); } - // sector_->setListener( this ); - + // CEGUI::MouseCursor::getSingleton().hide(); windowsWidth_ = resources_->renderWindow->getWidth( ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-12-20 01:27:39
|
Revision: 1156 http://opengate.svn.sourceforge.net/opengate/?rev=1156&view=rev Author: spom_spom Date: 2009-12-20 00:18:05 +0000 (Sun, 20 Dec 2009) Log Message: ----------- changed client config window layout Modified Paths: -------------- branches/ogEditor/ogEditor/apps/opengate/opengateedit.py doc/Doxyfile doc/milestones.txt trunk/data/gui/layouts/dialogs/ConfigDialog.layout trunk/data/gui/schemes/opengate.scheme trunk/data/misc/credits.txt trunk/src/GameStateManager.cpp Added Paths: ----------- trunk/data/gui/imagesets/opengateConfigWindow.imageset Modified: branches/ogEditor/ogEditor/apps/opengate/opengateedit.py =================================================================== --- branches/ogEditor/ogEditor/apps/opengate/opengateedit.py 2009-12-19 16:17:41 UTC (rev 1155) +++ branches/ogEditor/ogEditor/apps/opengate/opengateedit.py 2009-12-20 00:18:05 UTC (rev 1156) @@ -129,6 +129,8 @@ self.childWindows = [] self.layout = None + def getToolBar( self, parent ): return self.layout.getToolBar( parent ) + def createPropertyPanel( self, parent ): if not HAVE_PROPGRID: return wx.Panel( parent ) @@ -173,7 +175,11 @@ self.window.setProperty( name, str( value ) ) #getattr( self.axes, name )( value ) if self.layout is not None: - self.layout.toolBar_.EnableTool( self.layout.tbSave.GetId(), True ) + try: + self.layout.toolBar_.EnableTool( self.layout.tbSave.GetId(), True ) + self.layout.toolBar_.Refresh() + except: + pass def onNameChanged( self, name ): print "onNameChanged:", name @@ -269,6 +275,8 @@ def onReload( self, event = None ): if self.layout is not None: CEGUI.WindowManager.getSingleton().destroyWindow( self.layout ) + #CEGUI.SchemeManager.getSingleton().unloadScheme("opengate") + #CEGUI.SchemeManager.getSingleton().loadScheme("opengate.scheme") self.load() self.guiSystem.setGUISheet( self.layout ) self.parent.statusBar.setStatusMessage( "reloaded: " + self.fullFileName ) @@ -283,6 +291,7 @@ self.window.writeXML( xml ) outfile.close() self.toolBar_.EnableTool( self.tbSave.GetId(), False ) + self.toolBar_.Refresh() print "wrote: ", self.fullFileName self.parent.statusBar.setStatusMessage( "wrote: " + self.fullFileName ) @@ -351,6 +360,26 @@ self.renderer_.addListener( wxCEGUIListener( self.GUIRenderer ) ) + ############################## + # hackish parsing CEGUI.log for reading of CEGUI Factory content until CEGUI.*.getIterator() lacks python converter + ############################## + self.ceguiWindowFactories = [] + self.ceguiWindowRendererFactories = [] + fi = open( 'CEGUI.log', 'r') + for line in fi: + if 'WindowFactory for ' in line: + f = line.split("'") + if CEGUI.WindowFactoryManager.getSingleton().isFactoryPresent( f[ 1 ] ): + self.ceguiWindowFactories.append( f[ 1 ] ) + elif 'WindowRendererFactory ' in line: + f = line.split("'") + #if CEGUI.WindowFactoryManager.getSingleton().isFactoryPresent( f[ 1 ] ): + self.ceguiWindowRendererFactories.append( f[ 1 ] ) + + print self.ceguiWindowRendererFactories + fi.close() + ############################## + #self.frameListener = GuiFrameListener( self.renderer_.renderWindow, self.renderer_.camera, self.GUIRenderer) #self.sceneManager) #self.frameListener.MenuMode = True # this stop the camera moving with the mouse cursor.. Modified: doc/Doxyfile =================================================================== --- doc/Doxyfile 2009-12-19 16:17:41 UTC (rev 1155) +++ doc/Doxyfile 2009-12-20 00:18:05 UTC (rev 1156) @@ -1,277 +1,1310 @@ -# Doxyfile 1.5.2 +# Doxyfile 1.5.4 +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = opengate -PROJECT_NUMBER = 0.0.1 -OUTPUT_DIRECTORY = ./ + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is +# documented as struct with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code where the coding convention is that all structs are +# typedef'ed and only the typedef is referenced never the struct's name. + +TYPEDEF_HIDES_STRUCT = NO + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = YES -HIDE_UNDOC_MEMBERS = YES -HIDE_UNDOC_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be extracted +# and appear in the documentation as a namespace called 'anonymous_namespace{file}', +# where file will be replaced with the base name of the file that contains the anonymous +# namespace. By default anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + FILE_VERSION_FILTER = + #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + WARN_LOGFILE = + #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = ../src/ + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../trunk/src + +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + INPUT_ENCODING = UTF-8 -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.C \ - *.CC \ - *.C++ \ - *.II \ - *.I++ \ - *.H \ - *.HH \ - *.H++ \ - *.CS \ - *.PHP \ - *.PHP3 \ - *.M \ - *.MM \ - *.PY -RECURSIVE = YES + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + EXAMPLE_PATH = -EXAMPLE_PATTERNS = * + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + FILTER_SOURCE_FILES = NO + #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH +# then you must also enable this option. If you don't then doxygen will produce +# a warning and turn it on anyway + SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = NO + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + USE_HTAGS = NO -VERBATIM_HEADERS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + IGNORE_PREFIX = + #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + GENERATE_HTMLHELP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + TREEVIEW_WIDTH = 250 + #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + LATEX_HIDE_INDICES = NO + #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + RTF_EXTENSIONS_FILE = + #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + MAN_LINKS = NO + #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + XML_PROGRAMLISTING = YES + #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + GENERATE_AUTOGEN_DEF = NO + #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + PERLMOD_MAKEVAR_PREFIX = + #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + SKIP_FUNCTION_MACROS = YES + #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + PERL_PATH = /usr/bin/perl + #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + CALL_GRAPH = NO + +# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the number +# of direct children of the root node in a graph is already larger than +# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + DOT_GRAPH_MAX_NODES = 50 -DOT_TRANSPARENT = NO + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path ... [truncated message content] |
From: <spo...@us...> - 2009-01-25 14:47:07
|
Revision: 977 http://opengate.svn.sourceforge.net/opengate/?rev=977&view=rev Author: spom_spom Date: 2009-01-25 14:46:55 +0000 (Sun, 25 Jan 2009) Log Message: ----------- next steps of reorganization done (explosion, missiles, targeting) still open: fireing stuff, radar, network Modified Paths: -------------- trunk/data/misc/test.sector trunk/data/missiles/bee.xml trunk/data/missiles/firefly.xml trunk/data/stations/tauseti_wake.xml trunk/src/DockedState.h trunk/src/Entity.cpp trunk/src/Entity.h trunk/src/EntityManager.cpp trunk/src/Hud.cpp trunk/src/Hud.h trunk/src/Makefile.am trunk/src/Missile.cpp trunk/src/OpcodeWrapper.cpp trunk/src/Opengate.h trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorAvatarObject.cpp trunk/src/SectorAvatarObject.h trunk/src/SectorCollisionObject.cpp trunk/src/SectorCollisionObject.h trunk/src/SectorMeshObject.cpp trunk/src/SectorMeshObject.h trunk/src/SectorMovableObject.cpp trunk/src/SectorMovableObject.h trunk/src/SectorStationObject.cpp trunk/src/UnDockedState.cpp trunk/src/UnDockedState.h Added Paths: ----------- trunk/src/RadarObject.cpp trunk/src/RadarObject.h trunk/src/SectorExplosionObject.cpp trunk/src/SectorExplosionObject.h trunk/src/SectorMissileObject.cpp trunk/src/SectorMissileObject.h Modified: trunk/data/misc/test.sector =================================================================== --- trunk/data/misc/test.sector 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/data/misc/test.sector 2009-01-25 14:46:55 UTC (rev 977) @@ -4,23 +4,8 @@ <ambient a="1" r="0.1" b="0.1" g="0.1"></ambient> </environment> <station name="Tauseti Wake"> - <position y="0" x="0" z="-1480"></position> + <position y="0" x="0" z="-2000"></position> </station> - <sectorobject name="ring"> - <position y="-100" x="0" z="-100"></position> - <scale y="35" x="35" z="35"></scale> - <entity meshFile="ring.mesh" material-0="ring/main" numSubEntities="1"></entity> - </sectorobject> - <sectorobject name="ring1"> - <position y="0" x="0" z="-100"></position> - <scale y="35" x="35" z="35"></scale> - <entity meshFile="ring.mesh" material-0="ring/main" numSubEntities="1"></entity> - </sectorobject> - <sectorobject name="ring2"> - <position y="100" x="0" z="-100"></position> - <scale y="35" x="35" z="35"></scale> - <entity meshFile="ring.mesh" material-0="ring/main" numSubEntities="1"></entity> - </sectorobject> <beacon> <position y="0" x="-650" z="800"></position> </beacon> Modified: trunk/data/missiles/bee.xml =================================================================== --- trunk/data/missiles/bee.xml 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/data/missiles/bee.xml 2009-01-25 14:46:55 UTC (rev 977) @@ -5,7 +5,7 @@ <name_de>bee</name_de> <name_en>bee</name_en> <mesh>firefly</mesh> - <category_id>11</category_id> + <category_id>13</category_id> <faction_id>3</faction_id> <description_en>Offense anti vessel missile for small ships</description_en> <!-- <production_center>Octavius Great Pillars</production_center> Modified: trunk/data/missiles/firefly.xml =================================================================== --- trunk/data/missiles/firefly.xml 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/data/missiles/firefly.xml 2009-01-25 14:46:55 UTC (rev 977) @@ -13,9 +13,9 @@ <required_rank>12</required_rank> <size>2</size> <mass>205</mass> - <maximum_thrust>82000</maximum_thrust> - <maximum_pitch>87</maximum_pitch> - <maximum_yaw>87</maximum_yaw> + <thrust>82000</thrust> + <pitch>87</pitch> + <yaw>87</yaw> <drag_factor>0.21</drag_factor> <damage>4250</damage> <life_time>20</life_time> @@ -25,4 +25,4 @@ <required_component>explosives</required_component> <required_component>carbon</required_component> <required_political_status>28</required_political_status> -</container> \ No newline at end of file +</container> Modified: trunk/data/stations/tauseti_wake.xml =================================================================== (Binary files differ) Modified: trunk/src/DockedState.h =================================================================== --- trunk/src/DockedState.h 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/DockedState.h 2009-01-25 14:46:55 UTC (rev 977) @@ -35,7 +35,7 @@ class MarketDialog; /*! - * \brief This class defines the gamestate the gamestate when the user is docked + * \brief This class defines the gamestate when the user is docked * * When a user is currently docked at a station, this gamestate is active. The * user is not able to move his ship or to fire weapons. But he is able to trade Modified: trunk/src/Entity.cpp =================================================================== --- trunk/src/Entity.cpp 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/Entity.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -139,6 +139,7 @@ baseYaw_ = 0.0; basePitch_ = 0.0; baseRoll_ = 0.0; + baseScale_ = 0.0; } MeshEntity::~MeshEntity(){} @@ -146,10 +147,11 @@ void MeshEntity::readPropertiesFromXML( TiXmlHandle & hRoot ){ Entity::readPropertiesFromXML( hRoot ); - readXMLNode< float >( hRoot, "base_yaw", this, &OpenGate::MeshEntity::setBaseYaw, false ); - readXMLNode< float >( hRoot, "base_pitch", this, &OpenGate::MeshEntity::setBasePitch, false ); - readXMLNode< float >( hRoot, "base_roll", this, &OpenGate::MeshEntity::setBaseRoll, false ); - readXMLNode< float >( hRoot, "base_size", this, &OpenGate::MeshEntity::setBaseSize, false ); + readXMLNode< float >( hRoot, "base_yaw baseyaw", this, &OpenGate::MeshEntity::setBaseYaw, false ); + readXMLNode< float >( hRoot, "base_pitch basepitch", this, &OpenGate::MeshEntity::setBasePitch, false ); + readXMLNode< float >( hRoot, "base_roll baseroll", this, &OpenGate::MeshEntity::setBaseRoll, false ); + readXMLNode< float >( hRoot, "base_size basesize", this, &OpenGate::MeshEntity::setBaseSize, false ); + readXMLNode< float >( hRoot, "base_scale basescale", this, &OpenGate::MeshEntity::setBaseScale, false ); // readXMLNode< float >( hRoot, "basesize", this, &OpenGate::MeshEntity::setBaseSize, false ); TiXmlElement * pElem; Modified: trunk/src/Entity.h =================================================================== --- trunk/src/Entity.h 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/Entity.h 2009-01-25 14:46:55 UTC (rev 977) @@ -173,6 +173,10 @@ /*! If size is a scalar value, the length of the entity.*/ inline void setBaseSize( float size ){ baseSize_[ 2 ] = size; } inline const Ogre::Vector3 & baseSize( ) const { return baseSize_; } + + /*! If size is a scalar value, the length of the entity.*/ + inline void setBaseScale( float scale ){ baseScale_ = scale; } + inline const Ogre::Real baseScale( ) const { return baseScale_; } /*! Base sizes are necessary for resizing the ogremesh */ inline void setBaseYaw( Ogre::Real baseYaw ){ baseYaw_ = baseYaw; } @@ -197,6 +201,7 @@ Ogre::Real baseYaw_; Ogre::Real basePitch_; Ogre::Real baseRoll_; + Ogre::Real baseScale_; Ogre::MeshPtr pMesh_; Modified: trunk/src/EntityManager.cpp =================================================================== --- trunk/src/EntityManager.cpp 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/EntityManager.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -229,7 +229,7 @@ case 8: entity = new Radar(); break; case 9: entity = new Vessel(); break; case 10: entity = new Gun(); break; - case 11: entity = new Missile(); break; + case 13: entity = new Missile(); break; default: log_->fatal( fileName + " category_id " + toStr( category ) + " unknown." ); return NULL; Modified: trunk/src/Hud.cpp =================================================================== --- trunk/src/Hud.cpp 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/Hud.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -21,6 +21,7 @@ #include "Hud.h" #include "Avatar.h" +#include "RadarObject.h" #include "ResourceManager.h" #include "Sector.h" #include "SectorAvatarObject.h" @@ -32,6 +33,7 @@ #include <OgreFontManager.h> #include <OgreRoot.h> #include <OgreRenderWindow.h> +#include <OgreOverlayContainer.h> #include <OgreOverlayManager.h> #include <OgreStringConverter.h> #include <OgreTextAreaOverlayElement.h> @@ -43,10 +45,15 @@ namespace OpenGate{ -Hud::Hud( CEGUI::Window * overlayRoot, SectorAvatarObject * avatar ) : overlayRootWindow_( overlayRoot ), avatar_( avatar ){ +Hud::Hud( CEGUI::Window * overlayRoot, SectorAvatarObject * avatar ) : overlayRootWindow_( overlayRoot ), avatar_( avatar ), target_( NULL ){ resources_ = ResourceManager::getSingletonPtr(); sceneMgr_ = avatar_->sector()->sceneManager(); + mainCamera_ = sceneMgr_->getCamera( "MainCamera" ); + + flightArrowNode_ = NULL; + targetArrowNode_ = NULL; + init(); show(); } @@ -57,6 +64,11 @@ flightArrowNode_->removeAndDestroyChild( "FlightArrow/TransNode" ); Ogre::SceneNode * par = flightArrowNode_->getParentSceneNode(); par->removeAndDestroyChild( flightArrowNode_->getName() ); + + avatar_->sector()->sceneManager()->destroyEntity( "TargetArrow/Entity" ); + targetArrowNode_->removeAndDestroyChild( "TargetArrow/TransNode" ); + par = targetArrowNode_->getParentSceneNode(); + par->removeAndDestroyChild( targetArrowNode_->getName() ); } void Hud::init( ){ @@ -68,6 +80,7 @@ //** OGRE 3D stuff in front of the camera Ogre::SceneNode * mainCameraNode = sceneMgr_->getSceneNode( "MainCamera" ); + flightArrowNode_ = mainCameraNode->createChildSceneNode( "FlightArrow/MainNode" ); Ogre::SceneNode * flightArrowTrans = flightArrowNode_->createChildSceneNode( "FlightArrow/TransNode" ); Ogre::Entity * flightArrowEntity = sceneMgr_->createEntity( "FlightArrow/Entity", "arrow.mesh" ); @@ -78,6 +91,16 @@ flightArrowTrans->scale( 0.01, 0.01, 0.01 ); flightArrowNode_->setPosition( 0.0, 0.08, -1.2 ); + targetArrowNode_ = mainCameraNode->createChildSceneNode( "TargetArrow/MainNode" ); + Ogre::SceneNode * targetArrowTrans = targetArrowNode_->createChildSceneNode( "TargetArrow/TransNode" ); + Ogre::Entity * targetArrowEntity = sceneMgr_->createEntity( "TargetArrow/Entity", "arrow.mesh" ); + targetArrowEntity->setMaterialName( "SimpleHUD/FlightArrow" ); +//flightArrowEntity->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY); + targetArrowTrans->attachObject( targetArrowEntity ); + targetArrowTrans->pitch( Ogre::Degree( -90 ) ); + targetArrowTrans->scale( 0.01, 0.01, 0.01 ); + targetArrowNode_->setPosition( 0.0, -0.08, -1.2 ); + targetArrowNode_->setVisible( false ); //** OGRE overlay based stuff overlayName_ = "SimpleHUD"; @@ -182,6 +205,16 @@ } +void Hud::setTarget( SectorMeshObject * target ){ + target_ = target; + if ( target_ ){ + targetArrowNode_->setVisible( true ); +// hudOverlay_->getChild( overlayName_ + "/TargetPointer" )->show(); + Ogre::OverlayManager::getSingleton().getOverlayElement( overlayName_ + + "/MainPanel/TextTargetName" )->setCaption( target_->name() ); + } +} + void Hud::update( Ogre::Real elapsedTime ){ @@ -200,47 +233,44 @@ if ( flightArrowNode_ ) { if ( fabs( avatar_->speed() ) > 1e-1 ){ flightArrowNode_->setVisible( true ); - //flightArrowNode_->setOrientation( flightOrient ); flightArrowNode_->setDirection( flightDir, Ogre::Node::TS_WORLD ); } else { flightArrowNode_->setVisible( false ); } } -// if ( target_ != NULL ) { -// Ogre::Vector3 distToTarget( ( target_->mainNode()->getPosition() - -// avatar_->mainNode()->getPosition() ) ); + if ( target_ != NULL ) { + Ogre::Vector3 distToTarget( ( target_->mainNode()->getPosition() - avatar_->mainNode()->getPosition() ) ); + + if ( targetArrowNode_ ) { + targetArrowNode_->setVisible( true ); + targetArrowNode_->setDirection( distToTarget.normalisedCopy(), Ogre::Node::TS_WORLD ); + } // -// // if ( avatar_->targetArrow() ) { -// // avatar_->targetArrow()->setVisible( true ); -// // avatar_->targetArrow()->setOrientation( flightOrient ); -// // avatar_->targetArrow()->setDirection( distToTarget.normalisedCopy(), Ogre::Node::TS_WORLD ); -// // } -// -// //** Start update targeting pointer and duelist pointers; -// Ogre::Vector3 targetScreenPos; + //! Start update targeting pointer and duelist pointers; + Ogre::Vector3 targetScreenPos; // target_->mainNode()->needUpdate(); // -// Ogre::Vector3 targetPos( target_->mainNode()->getPosition() ); + Ogre::Vector3 targetPos( target_->mainNode()->getPosition() ); + + bool targetVisible = projectionPos_( mainCamera_, targetPos, targetScreenPos ); + if ( targetVisible ){ + targetCursor_->show(); + targetCursor_->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.5 + targetScreenPos[ 0 ] / 2.0, + -targetCursorHalfWidth_ ), + CEGUI::UDim( 0.5 - targetScreenPos[ 1 ] / 2.0, + -targetCursorHalfHeight_ ) ) ); + } else { + targetCursor_->hide(); + } // -// bool targetVisible = projectionPos_( mainCamera_, targetPos, targetScreenPos ); -// if ( targetVisible ){ -// targetCursor_->show(); -// targetCursor_->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.5 + targetScreenPos[ 0 ] / 2.0, -// -targetCursorHalfWidth_ ), -// CEGUI::UDim( 0.5 - targetScreenPos[ 1 ] / 2.0, -// -targetCursorHalfHeight_ ) ) ); -// } else { -// targetCursor_->hide(); -// } -// // //Ogre::Real ammoTimeToTarget( distToTarget.length() / avatar_->ammoSpeed() ); + + + //! End update targeting pointer and duelist pointers; + + targetDistanceText_->setText( "D" + Ogre::StringConverter::toString( round( distToTarget.length(), 0 ) ) ); // -// -// //** End update targeting pointer and duelist pointers; -// -// targetDistanceText_->setText( "D" + Ogre::StringConverter::toString( round( distToTarget.length(), 0 ) ) ); -// // if ( target_->rtti() == SECTOROBJECTMOVABLE_RTTI || // target_->rtti() == SECTOROBJECTVESSEL_RTTI || // target_->rtti() == SECTOROBJECTMISSILE_RTTI ){ @@ -257,9 +287,9 @@ // targetShieldText_->setText( "" ); // targetArmorText_->setText( "" ); // } -// } else { -// // if ( avatar_->targetArrow() ) avatar_->targetArrow()->setVisible( false ); -// } + } else { //! else !target_ + if ( targetArrowNode_ ) targetArrowNode_->setVisible( false ); + } Ogre::Real height = avatar_->speedRate() * velocityProgressHeight_; velocityProgress_->setYPosition( CEGUI::UDim( 0.5, velocityProgressHeight_/2.0 - height ) ); Modified: trunk/src/Hud.h =================================================================== --- trunk/src/Hud.h 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/Hud.h 2009-01-25 14:46:55 UTC (rev 977) @@ -44,6 +44,8 @@ void hide(); + void setTarget( SectorMeshObject * target ); + protected: bool projectionPos_( Ogre::Camera * cam, const Ogre::Vector3 & pos, Ogre::Vector3 & screenPos ); @@ -57,9 +59,10 @@ Ogre::Camera * mainCamera_; Sector * sector_; - SectorObject * target_; + SectorMeshObject * target_; Ogre::SceneNode * flightArrowNode_; + Ogre::SceneNode * targetArrowNode_; CEGUI::Window * targetCursor_; Ogre::Real targetCursorHalfWidth_; Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/Makefile.am 2009-01-25 14:46:55 UTC (rev 977) @@ -74,6 +74,8 @@ Planet.cpp \ Projectile.h \ Projectile.cpp \ + RadarObject.h \ + RadarObject.cpp \ ResourceManager.h \ ResourceManager.cpp \ Sector.h \ @@ -90,8 +92,12 @@ SectorChildObject.cpp \ SectorCollisionObject.h \ SectorCollisionObject.cpp \ + SectorExplosionObject.h \ + SectorExplosionObject.cpp \ SectorMeshObject.h \ SectorMeshObject.cpp \ + SectorMissileObject.h \ + SectorMissileObject.cpp \ SectorMovableObject.h \ SectorMovableObject.cpp \ SectorPadObject.h \ Modified: trunk/src/Missile.cpp =================================================================== --- trunk/src/Missile.cpp 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/Missile.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -35,7 +35,7 @@ readXMLNode< int >( hRoot, "damage", this, &OpenGate::Missile::setDamage, false ); readXMLNode< int >( hRoot, "thrust", this, &OpenGate::Missile::setThrust, false ); - readXMLNode< int >( hRoot, "lifetime", this, &OpenGate::Missile::setLifeTime, false ); + readXMLNode< int >( hRoot, "lifetime life_time", this, &OpenGate::Missile::setLifeTime, false ); } } //namespace OpenGate Modified: trunk/src/OpcodeWrapper.cpp =================================================================== --- trunk/src/OpcodeWrapper.cpp 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/OpcodeWrapper.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -107,13 +107,12 @@ if ( obj && active_ ){ OgreOpcode::CollisionObject * collObj = obj->collisionObject(); - if ( !collObj ){ + if ( !collObj && obj->entity() ){ OgreOpcode::EntityCollisionShape * collShape = collisionManager_->createEntityCollisionShape( obj->name() + "/CollShape" ); - if ( obj->entity() ){ - collShape->load( obj->entity() ); - } else { - std::cout << "OpcodeCollisionDetection::createObject( BaseObject * obj ), no entity defined for obj: " << obj->name(); - } + collShape->load( obj->entity() ); +// } else { +// std::cout << "OpcodeCollisionDetection::createObject( BaseObject * obj ), no entity defined for obj: " << obj->name(); +// } collObj = collideInSectorContext_->createObject( obj->name() + "/CollObj" ); collObj->setCollClass( collisionManager_->queryCollClass( obj->collisionClass() ) ); Modified: trunk/src/Opengate.h =================================================================== --- trunk/src/Opengate.h 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/Opengate.h 2009-01-25 14:46:55 UTC (rev 977) @@ -41,12 +41,14 @@ #define SECTOR_BEACON_PAD_OBJECT_RTTI 4 #define SECTOR_CHILD_OBJECT_RTTI 5 #define SECTOR_COLLISION_OBJECT_RTTI 6 -#define SECTOR_MESH_OBJECT_RTTI 7 -#define SECTOR_MOVABLE_OBJECT_RTTI 8 -#define SECTOR_PAD_OBJECT_RTTI 9 -#define SECTOR_STATION_OBJECT_RTTI 10 -#define SECTOR_STATION_PAD_OBJECT_RTTI 11 -#define SECTOR_VESSEL_OBJECT_RTTI 12 +#define SECTOR_EXPLOSION_OBJECT_RTTI 7 +#define SECTOR_MESH_OBJECT_RTTI 8 +#define SECTOR_MISSILE_OBJECT_RTTI 9 +#define SECTOR_MOVABLE_OBJECT_RTTI 10 +#define SECTOR_PAD_OBJECT_RTTI 11 +#define SECTOR_STATION_OBJECT_RTTI 12 +#define SECTOR_STATION_PAD_OBJECT_RTTI 13 +#define SECTOR_VESSEL_OBJECT_RTTI 14 #define SECTOROBJECTENVIRONMENT_RTTI 1000010 #define PROJECTILE_RTTI 100001 @@ -74,6 +76,8 @@ class OpcodeCollisionDetection; class Planet; class Projectile; +class RadarObject; +class GunObject; class ResourceManager; @@ -84,7 +88,9 @@ class SectorBeaconPadObject; class SectorChildObject; class SectorCollisionObject; +class SectorExplosionObject; class SectorMeshObject; +class SectorMissileObject; class SectorMovableObject; class SectorPadObject; class SectorStationObject; Added: trunk/src/RadarObject.cpp =================================================================== --- trunk/src/RadarObject.cpp (rev 0) +++ trunk/src/RadarObject.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -0,0 +1,106 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#include "RadarObject.h" + +#include "Hud.h" +#include "Sector.h" +#include "SectorAvatarObject.h" +#include "SectorMeshObject.h" + +namespace OpenGate{ + +RadarObject::RadarObject( Sector * sector, Hud * hud ) + : sector_( sector ), hud_( hud ), avatar_( NULL ), target_( NULL ){ + + for ( std::set< SectorMeshObject * >::iterator it = sector->sectorMeshObjects().begin(), itmax = sector->sectorMeshObjects().end(); + it != itmax; it ++ ){ + addObject( *it ); + } + + avatar_ = sector_->avatarObject(); + +} + +RadarObject::~RadarObject( ){ + objects_.clear(); +} + +void RadarObject::update( const Ogre::Real elapsedTime ){ + +} + +void RadarObject::addObject( SectorMeshObject * obj ){ + std::cout << "RadarObject::addObject( "<< obj->name() << std::endl; + objects_.insert( obj ); +} + +void RadarObject::delObject( SectorMeshObject * obj ){ + objects_.erase( obj ); + if ( target_ == obj ) findNextTarget(); +} + +void RadarObject::findNextTarget(){ + target_ = findTarget_( false ); + if ( hud_ ) hud_->setTarget( target_ ); +} + +void RadarObject::findPrevTarget(){ + target_ = findTarget_( true ); + if ( hud_ ) hud_->setTarget( target_ ); +} + +SectorMeshObject * RadarObject::findTarget_( bool reverse, bool forbidAvatarSelection ){ + if ( objects_.size() == 1 ){ + return *objects_.begin(); + } + + if ( objects_.size() > 0 ){ + if ( !target_ ) { + return *objects_.begin(); + } else { + std::set< SectorMeshObject * >::iterator itTarget = objects_.find( target_ ); + + if ( itTarget == objects_.end() ) itTarget = objects_.begin(); + + for ( uint i = 0; i < objects_.size(); i ++ ){ + if ( reverse ){ + if ( itTarget == objects_.begin() ) itTarget = objects_.end(); + itTarget --; + } else { + itTarget ++; + if ( itTarget == objects_.end() ) itTarget = objects_.begin(); + } + +// if ( (*itTarget)->selectable() ) { + if ( forbidAvatarSelection ){ + if ( (*itTarget) != avatar_ ) return (*itTarget); + } else return (*itTarget); + } + } + } + return NULL; +} + + +} //namespace OpenGate + + + Added: trunk/src/RadarObject.h =================================================================== --- trunk/src/RadarObject.h (rev 0) +++ trunk/src/RadarObject.h 2009-01-25 14:46:55 UTC (rev 977) @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#ifndef _OPENGATE_RADAROBJECT__H +#define _OPENGATE_RADAROBJECT__H + +#include "Opengate.h" + +namespace OpenGate{ + +class RadarViewable{ +public: +protected: +}; + +class RadarObject{ +public: + RadarObject( Sector * sector, Hud * hud_ ); + + ~RadarObject( ); + + void update( const Ogre::Real elapsedTime ); + + void addObject( SectorMeshObject * obj ); + + void delObject( SectorMeshObject * obj ); + + void findNextTarget(); + + void findPrevTarget(); + + SectorMeshObject * target( ) { return target_; } + +protected: + SectorMeshObject * findTarget_( bool reverse = false, bool forbidAvatarSelection = true ); + + //Radar * radar_; + Sector * sector_; + Hud * hud_; + SectorAvatarObject * avatar_; + SectorMeshObject * target_; + + std::set < SectorMeshObject * > objects_; +}; + +} //namespace OpenGate + +#endif // _OPENGATE_RADAROBJECT__H + + Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/Sector.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -27,17 +27,22 @@ #include "Avatar.h" #include "EntityManager.h" #include "LogManager.h" +#include "Missile.h" #include "OpcodeWrapper.h" +#include "RadarObject.h" #include "ResourceManager.h" #include "SectorAvatarObject.h" #include "SectorBeaconObject.h" #include "SectorCollisionObject.h" +#include "SectorExplosionObject.h" #include "SectorMeshObject.h" +#include "SectorMissileObject.h" #include "SectorStationObject.h" #include "SectorStationPadObject.h" #include "UnDockedState.h" #include <OgreEntity.h> +#include <OgreManualObject.h> #include <OgreSceneManager.h> #include <OgreSubEntity.h> @@ -50,14 +55,26 @@ name_ = "unknown"; listener_ = NULL; avatar_ = NULL; + childIDCounter_ = 0; + + createKoordAxis( ); + } Sector::~Sector( ){ - for_each( sectorObjects_.begin(), sectorObjects_.end(), deletePtr() ); + for_each( sectorCollObjects_.begin(), sectorCollObjects_.end(), deletePtr() ); + for_each( sectorMeshObjects_.begin(), sectorMeshObjects_.end(), deletePtr() ); for ( std::map< std::string, std::deque< SectorCollisionObject * > >::iterator it = objectHeap_.begin(), itmax = objectHeap_.end(); it != itmax; it ++ ){ for_each( (*it).second.begin(), (*it).second.end(), deletePtr() ); } + + if ( koordAxisNode_ ) { + koordAxisNode_->detachObject( koordAxisMO_ ); + sceneMgr_->destroyManualObject( koordAxisMO_->getName() ); + sceneMgr_->getRootSceneNode()->removeAndDestroyChild( koordAxisNode_->getName() ); + koordAxisNode_ = NULL; + } } bool Sector::update( Ogre::Real elapsedTime ){ @@ -65,10 +82,182 @@ ResourceManager::getSingleton().collisionManager->update( elapsedTime ); } - if ( avatar_ ) avatar_->update( elapsedTime ); + for ( std::set< SectorCollisionObject * >::iterator it = sectorCollObjects_.begin(); it != sectorCollObjects_.end(); ){ + if ( !(*it)->update( elapsedTime ) ) { + destructCollObject_( (*it++) ); + } else ++it; + } + for ( std::set< SectorMeshObject * >::iterator it = sectorMeshObjects_.begin(); it != sectorMeshObjects_.end(); ){ + if ( !(*it)->update( elapsedTime ) ) { + destructMeshObject_( (*it++) ); + } else ++it; + } return true; } +void Sector::destructCollObject_( SectorCollisionObject * obj ){ + if ( obj ){ + removeCollObject_( obj ); + switch ( obj->rtti() ){ + case SECTOR_EXPLOSION_OBJECT_RTTI: + objectHeap_[ "Explosion" ].push_back( obj ); + break; + default: + delete( obj ); + obj = NULL; + } + } +} + +void Sector::destructMeshObject_( SectorMeshObject * obj ){ + if ( obj ){ + log_->debug( "Sector::destruct_ object: " + obj->name() + " " + toStr( obj->rtti() ) ); + removeMeshObject_( obj ); + switch ( obj->rtti() ){ + case SECTOR_STATION_OBJECT_RTTI: + //sectorStations_.erase( obj ) + delete( obj ); + obj = NULL; + break; + case SECTOR_MISSILE_OBJECT_RTTI: + objectHeap_[ dynamic_cast< SectorMissileObject * >( obj )->missile()->name() ].push_back( obj ); + break; + default: + delete( obj ); + obj = NULL; + } + } +} + +void Sector::insertCollObject_( SectorCollisionObject * obj ){ + sectorCollObjects_.insert( obj ); + obj->activate(); +} + +void Sector::removeCollObject_( SectorCollisionObject * obj ){ + obj->deactivate(); + sectorCollObjects_.erase( obj ); +} + +void Sector::insertMeshObject_( SectorMeshObject * obj ){ + std::cout << "Sector::insertMeshObject_( SectorMeshObject * obj )" << obj->name() << std::endl; + sectorMeshObjects_.insert( obj ); + obj->activate(); + if ( listener_ ) { + if ( listener_->radar() ){ + listener_->radar()->addObject( obj ); + } + } +} + +void Sector::removeMeshObject_( SectorMeshObject * obj ){ + if ( listener_ ) { + if ( listener_->radar() ){ + listener_->radar()->delObject( obj ); + } + } + obj->deactivate(); + sectorMeshObjects_.erase( obj ); +} + +SectorMeshObject * Sector::createMeshObject( const std::string & name, const std::string & meshname ){ + SectorMeshObject * obj = new SectorMeshObject( name, this ); + obj->setMesh( meshname ); + insertMeshObject_( obj ); + return obj; +} + +SectorBeaconObject * Sector::createBeaconObject( ){ + SectorBeaconObject * obj = new SectorBeaconObject( this->name() + "/Beacon", this ); + insertMeshObject_( obj ); + return obj; +} + +SectorStationObject * Sector::createStationObject( const Ogre::String & stationName ){ + Station * station = ResourceManager::getSingleton().entityManager->station( stationName ); + SectorStationObject * obj = NULL; + + if ( station ){ + obj = new SectorStationObject( station, this ); + insertMeshObject_( obj ); + sectorStations_.insert( dynamic_cast< SectorStationObject * >( obj ) ); + } + return obj; +} + +SectorAvatarObject * Sector::createAvatarObject( Avatar & avatar ){ + log_->info( std::string( "Sector::createAvatarObject: " ) + avatar.name() ); + avatar_ = new SectorAvatarObject( avatar.name(), this, avatar.vessel() ); + avatar_->reset(); + + bool hasStation = false; + if ( !sectorStations_.empty() ){ + SectorStationObject *station = dynamic_cast< SectorStationObject* >( *sectorStations_.begin() ); + log_->info( std::string( "launch avatar from station " ) ); + if ( station->launchPad() ){ + avatar_->mainNode()->setPosition( station->launchPad()->position( true ) + station->launchPad()->direction( true ) * 5.0); + avatar_->mainNode()->setDirection( station->launchPad()->direction( true ) ); + avatar_->setVelocity( station->launchPad()->direction( true ) * 20.0 ); + hasStation = true; + } else { + log_->warn( std::string( "Station " + station->name() + " has no launch pad" ) ); + } + } + if ( !hasStation ) { + log_->info( std::string( "launch avatar from free position " ) ); + avatar_->mainNode()->setPosition( 0.0, 0.0, 0.0 ); + avatar_->mainNode()->setDirection( Ogre::Vector3( 0.0, 0.0, -1.0 ) ); + avatar_->setVelocity( Ogre::Vector3( 0.0, 0.0, 0.0 ) ); + } + insertMeshObject_( avatar_ ); + return avatar_; +} + +SectorMissileObject * Sector::createMissileObject( Missile * missile ){ + SectorMissileObject * obj; + + if ( objectHeap_[ missile->name() ].empty() ){ + obj = new SectorMissileObject( missile->name() + "_" + toStr( childIDCounter_ ), this, missile ); + childIDCounter_++; + log_->debug( "Sector::createMissile new " + obj->name() ); + } else { + obj = dynamic_cast< SectorMissileObject * >( objectHeap_[ missile->name() ].front() ); + objectHeap_[ missile->name() ].pop_front(); + obj->reset(); + log_->debug( "Sector::createMissile reuse " + obj->name() ); + } + insertMeshObject_( obj ); + return obj; +} + +void Sector::createExplosion( SectorMeshObject * object ){ + std::cout << "Sector::createExplosion( const Ogre::Vector3 & pos )" << std::endl; + SectorExplosionObject * obj; + std::string heapName( "Explosion" ); + + if ( objectHeap_[ heapName ].empty() ){ + obj = new SectorExplosionObject( heapName + "_" + toStr( childIDCounter_ ), this ); + childIDCounter_++; + } else { + obj = dynamic_cast< SectorExplosionObject * >( objectHeap_[ heapName ].front() ); + objectHeap_[ heapName ].pop_front(); + obj->reset(); + } + obj->mainNode()->setPosition( object->mainNode()->getPosition() ); + insertCollObject_( obj ); +} + + +void Sector::objectDocked( SectorMovableObject * obj, SectorStationObject * station ){ + std::cout << obj->name() << " docked at " << station->name() << std::endl; + switch ( obj->rtti() ){ + case SECTOR_AVATAR_OBJECT_RTTI: + if ( listener_ ) listener_->changeToDockedState(); + break; + default: break; + } +} + void Sector::populate( const std::string & fileName ){ TiXmlDocument doc( ResourceManager::getSingleton().findFullFileName( fileName ) ); bool loadOkay = doc.LoadFile(); @@ -104,12 +293,12 @@ pElem = hRoot.ChildElement( "station", 0 ).Element(); if ( pElem ){ - std::string name; readXMLAttribute < std::string >( pElem, "name", name ); - Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); - Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); - SectorMeshObject *obj = createStation( name ); - if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); - if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); + std::string name; readXMLAttribute < std::string >( pElem, "name", name ); + Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); + Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); + SectorStationObject *obj = createStationObject( name ); + if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); + if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); } pElem = hRoot.ChildElement( "beacon", 0 ).Element(); @@ -117,7 +306,7 @@ Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); Ogre::Vector3 dir( readXMLVec3Element( pElem, "direction" ) ); Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); - SectorMeshObject * obj = createBeacon( ); + SectorBeaconObject * obj = createBeaconObject( ); if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); if ( dir != Ogre::Vector3::ZERO ) obj->mainNode()->setDirection( dir ); if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); @@ -156,69 +345,76 @@ sceneMgr_->setSkyBox( true, name, 10000 ); } -SectorMeshObject * Sector::createMeshObject( const std::string & name, const std::string & meshname ){ - SectorMeshObject * obj = new SectorMeshObject( name, this ); - obj->setMesh( meshname ); - sectorObjects_.insert( obj ); - return obj; +void Sector::createKoordAxis( ){ + koordAxisNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( "axisnode" ); + koordAxisMO_ = sceneMgr_->createManualObject( koordAxisNode_->getName()+ "/manualObject" ); + Ogre::Real length = 20; + + koordAxisMO_->begin( "singleColor", Ogre::RenderOperation::OT_LINE_LIST); + koordAxisMO_->getSection( 0 )->setCustomParameter( 0, Ogre::Vector4( 1.0, 0.0, 0.0, 1.0 ) ); + koordAxisMO_->position( 0.0, 0.0, 0.0 ); + koordAxisMO_->position( 1.0, 0.0, 0.0 ); + koordAxisMO_->position( 0.0, 0.0, 0.0 ); + koordAxisMO_->end(); + + koordAxisMO_->begin( "singleColor", Ogre::RenderOperation::OT_LINE_LIST); + koordAxisMO_->getSection( 1 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0, 0.0, 1.0 ) ); + koordAxisMO_->position( 0.0, 1.0, 0.0 ); + koordAxisMO_->position( 0.0, 0.0, 0.0 ); + koordAxisMO_->end(); + + koordAxisMO_->begin( "singleColor", Ogre::RenderOperation::OT_LINE_LIST); + koordAxisMO_->getSection( 2 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 0.0, 1.0, 1.0 ) ); + koordAxisMO_->position( 0.0, 0.0, 1.0 ); + koordAxisMO_->position( 0.0, 0.0, 0.0 ); + koordAxisMO_->end(); + + koordAxisMO_->begin( "BaseWhiteNoLighting", Ogre::RenderOperation::OT_LINE_LIST); + koordAxisMO_->position( -1.0, 0.0, 0.0 ); + koordAxisMO_->position( 0.0, 0.0, 0.0 ); + koordAxisMO_->position( 0.0, -1.0, 0.0 ); + koordAxisMO_->position( 0.0, 0.0, 0.0 ); + koordAxisMO_->position( 0.0, 0.0, -1.0 ); +// koordAxisMO_->line( 0, 1 ); +// koordAxisMO_->line( 0, 2 ); +// koordAxisMO_->line( 0, 3 ); + koordAxisMO_->end(); + koordAxisNode_->attachObject( koordAxisMO_ ); + koordAxisNode_->scale( length, length, length ); } -SectorMeshObject * Sector::createBeacon( ){ - SectorMeshObject * obj = new SectorBeaconObject( this->name() + "/Beacon", this ); - sectorObjects_.insert( obj ); - return obj; -} -SectorMeshObject * Sector::createStation( const Ogre::String & stationName ){ - Station * station = ResourceManager::getSingleton().entityManager->station( stationName ); - SectorMeshObject * obj = NULL; - if ( station ){ - obj = new SectorStationObject( station, this ); - sectorObjects_.insert( obj ); - sectorStations_.insert( dynamic_cast< SectorStationObject * >( obj ) ); - } - return obj; -} -void Sector::createAvatarObject( Avatar & avatar ){ - log_->info( std::string( "Sector::createAvatarObject: " ) + avatar.name() ); - avatar_ = new SectorAvatarObject( avatar.name(), this, avatar.vessel() ); - - sectorObjects_.insert( avatar_ ); - avatar_->reset(); - bool hasStation = false; - if ( !sectorStations_.empty() ){ - SectorStationObject *station = dynamic_cast< SectorStationObject* >( *sectorStations_.begin() ); - log_->info( std::string( "launch avatar from station " ) ); - if ( station->launchPad() ){ - avatar_->mainNode()->setPosition( station->launchPad()->position( true ) + station->launchPad()->direction( true ) * 5.0); - avatar_->mainNode()->setDirection( station->launchPad()->direction( true ) ); - avatar_->setVelocity( station->launchPad()->direction( true ) * 20.0 ); - hasStation = true; - } else { - log_->warn( std::string( "Station " + station->name() + " has no launch pad" ) ); - } - } - if ( !hasStation ) { - log_->info( std::string( "launch avatar from free position " ) ); - avatar_->mainNode()->setPosition( 0.0, 0.0, 0.0 ); - avatar_->mainNode()->setDirection( Ogre::Vector3( 0.0, 0.0, -1.0 ) ); - avatar_->setVelocity( Ogre::Vector3( 0.0, 0.0, 0.0 ) ); - } - avatar_->mainNode()->setVisible( false ); -} - -void Sector::objectDocked( SectorMovableObject * obj, SectorStationObject * station ){ - std::cout << obj->name() << " docked at " << station->name() << std::endl; - switch ( obj->rtti() ){ - case SECTOR_AVATAR_OBJECT_RTTI: - if ( listener_ ) listener_->changeToDockedState(); - break; - default: break; - } -} - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #else #include "Sector.h" Modified: trunk/src/Sector.h =================================================================== --- trunk/src/Sector.h 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/Sector.h 2009-01-25 14:46:55 UTC (rev 977) @@ -54,31 +54,55 @@ /*! Return the name of this sector. Set during population from xml-file */ inline const std::string & name() const { return name_; } - /*! Populate the sector with information from a xml-file, see data/misc/test.sector for an example */ - void populate( const std::string & fileName ); + const std::set< SectorMeshObject * > & sectorMeshObjects() const { return sectorMeshObjects_; } - /*! Define the skybox of the sector */ - void setSkyBox( const std::string & name ); + /*! Return handle to the avatarObject */ + inline SectorAvatarObject * avatarObject() { return avatar_; } - /*! Create a player related avatar */ - void createAvatarObject( Avatar & avatar ); - /*! Create a mesh within the sector, without any specialization */ SectorMeshObject * createMeshObject( const std::string & name, const std::string & meshname ); /*! Create a beacon within the sector */ - SectorMeshObject * createBeacon( ); + SectorBeaconObject * createBeaconObject( ); /*! Create a station within the sector */ - SectorMeshObject * createStation( const Ogre::String & stationName ); + SectorStationObject * createStationObject( const Ogre::String & stationName ); - /*! Return handle to the avatarObject */ - inline SectorAvatarObject * avatarObject() { return avatar_; } + /*! Create a player related avatar */ + SectorAvatarObject * createAvatarObject( Avatar & avatar ); + /*! Create a missle */ + SectorMissileObject * createMissileObject( Missile * misssile ); + + /*! Create an explosion related to a given SectorMeshObject */ + void createExplosion( SectorMeshObject * obj ); + /*! Someone has docked */ void objectDocked( SectorMovableObject * obj, SectorStationObject * station ); + + /*! Populate the sector with information from a xml-file, see data/misc/test.sector for an example */ + void populate( const std::string & fileName ); + + /*! Define the skybox of the sector */ + void setSkyBox( const std::string & name ); + + void createKoordAxis( ); protected: + /*! do not destruct objects manualy, let them send false during update loop */ + void destructCollObject_( SectorCollisionObject * obj ); + + void insertCollObject_( SectorCollisionObject * obj ); + + void removeCollObject_( SectorCollisionObject * obj ); + + void destructMeshObject_( SectorMeshObject * obj ); + + void insertMeshObject_( SectorMeshObject * obj ); + + void removeMeshObject_( SectorMeshObject * obj ); + + Ogre::SceneManager * sceneMgr_; NetworkClient * network_; LogManager * log_; @@ -89,8 +113,12 @@ SectorAvatarObject * avatar_; - /*! Hold all stuff you can collide with in sector */ - std::set< SectorCollisionObject * > sectorObjects_; + /*! Hold all stuff you can collide or can be seen on radar */ + std::set< SectorMeshObject * > sectorMeshObjects_; + + /*! Hold all temporary stuff like explosions or projectiles */ + std::set< SectorCollisionObject * > sectorCollObjects_; + /*! Hold all stuff that makes the sector looking nice */ //std::set< SectorEnvironmentObject * > sectorEnvironment_; @@ -98,6 +126,11 @@ std::set< SectorStationObject * > sectorStations_; std::map< std::string, std::deque< SectorCollisionObject * > > objectHeap_; + + uint childIDCounter_; + + Ogre::SceneNode * koordAxisNode_; + Ogre::ManualObject * koordAxisMO_; }; #else @@ -210,7 +243,7 @@ protected: /*! do not destruct objects manualy, let them send false during update loop */ - void destruct_( SectorObject * obj ); + void destructObject_( SectorObject * obj ); Ogre::SceneManager * sceneMgr_; NetworkClient * network_; Modified: trunk/src/SectorAvatarObject.cpp =================================================================== --- trunk/src/SectorAvatarObject.cpp 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/SectorAvatarObject.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -26,6 +26,8 @@ #include "Moveable.h" #include "OpcodeWrapper.h" #include "ResourceManager.h" +#include "Sector.h" +#include "SectorMissileObject.h" #include "Vessel.h" #include <OgreSceneNode.h> @@ -76,6 +78,18 @@ } } +void SectorAvatarObject::setFirePressed( bool pressed ){ +} + +void SectorAvatarObject::fireMissile( Missile * missile, SectorMeshObject * target ){ + + SectorMissileObject * obj = sector_->createMissileObject( missile ); + obj->setTarget( target ); + obj->mainNode()->setOrientation( mainNode_->getOrientation() ); + obj->mainNode()->setPosition( mainNode_->getPosition() - mainNode_->getOrientation().yAxis() * 3.0 ); + obj->launch(); +} + } //namespace OpenGate Modified: trunk/src/SectorAvatarObject.h =================================================================== --- trunk/src/SectorAvatarObject.h 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/SectorAvatarObject.h 2009-01-25 14:46:55 UTC (rev 977) @@ -59,7 +59,10 @@ // /*! Returns the relative shield. */ // inline Ogre::Real shieldRate() const { if ( maxShield() > 0 ) return (float)shield_ / maxShield(); else return 0.0; } + void setFirePressed( bool pressed ); + void fireMissile( Missile * missile, SectorMeshObject * target = NULL ); + protected: Ogre::Real thrustChange_; Modified: trunk/src/SectorCollisionObject.cpp =================================================================== --- trunk/src/SectorCollisionObject.cpp 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/SectorCollisionObject.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -31,11 +31,31 @@ namespace OpenGate{ SectorCollisionObject::SectorCollisionObject( const std::string & name, Sector * sector, Ogre::SceneNode * parentNode ) - : SectorBaseObject( name, sector, parentNode ), collObj_( NULL ), entity_( NULL ){ + : SectorBaseObject( name, sector, parentNode ), collObj_( NULL ), entity_( NULL ), active_( false ) { } SectorCollisionObject::~SectorCollisionObject( ){ } +void SectorCollisionObject::reset( ){ } + +void SectorCollisionObject::setActive( bool active ){ + active_ = active; + if ( active ){ + activate_(); + if ( ResourceManager::getSingleton().collisionManager ){ + ResourceManager::getSingleton().collisionManager->create( this ); + } + mainNode_->setVisible( true ); + } else { + deactivate_(); + if ( ResourceManager::getSingleton().collisionManager ){ + ResourceManager::getSingleton().collisionManager->destroy( this ); + } + mainNode_->setVisible( false ); + } +} + +} Modified: trunk/src/SectorCollisionObject.h =================================================================== --- trunk/src/SectorCollisionObject.h 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/SectorCollisionObject.h 2009-01-25 14:46:55 UTC (rev 977) @@ -58,9 +58,31 @@ virtual Ogre::Entity * entity(){ return entity_; } //** END GETer/SETer + /*! Reset all values for this object. */ + virtual void reset( ); + + /*! Change active status of this object */ + void setActive( bool active ); + + /*! Return active status of this object */ + inline bool active() const { return active_; } + + /*! Activate this object, make it visible and set collision*/ + inline void activate(){ setActive( true ); } + + /*! Deactivate this object, make it invisible and remove collision*/ + inline void deactivate(){ setActive( false ); } + protected: + + virtual void deactivate_(){} + + virtual void activate_(){} + OgreOpcode::CollisionObject * collObj_; Ogre::Entity * entity_; + + bool active_; }; } //namespace OpenGate Added: trunk/src/SectorExplosionObject.cpp =================================================================== --- trunk/src/SectorExplosionObject.cpp (rev 0) +++ trunk/src/SectorExplosionObject.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -0,0 +1,70 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#include "SectorExplosionObject.h" + +#include "Sector.h" + +#include <OgreParticleEmitter.h> +#include <OgreParticleSystem.h> +#include <OgreSceneManager.h> +#include <OgreSceneNode.h> + +namespace OpenGate{ + +SectorExplosionObject::SectorExplosionObject( const std::string & name, Sector * sector, Ogre::SceneNode * parentNode ) + : SectorCollisionObject( name, sector, parentNode ){ + + explosion_ = sector_->sceneManager()->createParticleSystem( name_ + "/ExplosionSystem", "OpenGate/Explosion" ); + //explosion_ = sceneMgr_->createParticleSystem( name_ + "/ExplosionSystem", "OpenGate/ExplosionStart" ); + mainNode_->attachObject( explosion_ ); +} + +SectorExplosionObject::~SectorExplosionObject( ){ + if ( explosion_ ){ + mainNode_->detachObject( explosion_ ); + sector_->sceneManager()->destroyParticleSystem( explosion_ ); + explosion_ = NULL; + } +} + +void SectorExplosionObject::reset(){ +} + +bool SectorExplosionObject::update( Ogre::Real elapsedTime ){ + explodeSequenceTime_ -= elapsedTime; + + if ( explodeSequenceTime_ < 0.0 ) return false; + return true; +} + +void SectorExplosionObject::activate_(){ + explosion_->getEmitter( 0 )->setEnabled( true ); + explodeSequenceTime_ = explosion_->getEmitter( 0 )->getDuration() + explosion_->getEmitter( 0 )->getMaxTimeToLive(); +} + +void SectorExplosionObject::deactivate_(){ + explosion_->getEmitter( 0 )->setEnabled( false ); +} + +} //namespace OpenGate + + + Added: trunk/src/SectorExplosionObject.h =================================================================== --- trunk/src/SectorExplosionObject.h (rev 0) +++ trunk/src/SectorExplosionObject.h 2009-01-25 14:46:55 UTC (rev 977) @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * 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. * + ***************************************************************************/ + +#ifndef _OPENGATE_SECTOREXPLOSIONOBJECT__H +#define _OPENGATE_SECTOREXPLOSIONOBJECT__H + +#include "Opengate.h" +#include "SectorCollisionObject.h" + +namespace OpenGate{ + +//! An explosion with optional collision +class SectorExplosionObject : public SectorCollisionObject { +public: + /*! Construct SectorObjectBase, */ + SectorExplosionObject( const std::string & name, Sector * sector, Ogre::SceneNode * parentNode = NULL ); + + /*! Default destructor */ + virtual ~SectorExplosionObject( ); + + /*! Abstract method for runtime identification */ + virtual int rtti( ) const { return SECTOR_EXPLOSION_OBJECT_RTTI; } + + /*! Update function */ + virtual bool update( Ogre::Real elapsedTime ); + + /*! Method for collision handling, called during a collision by opcodewrapper */ + virtual void collide( SectorCollisionObject * object ){} + + virtual void reset(); + +protected: + virtual void activate_(); + virtual void deactivate_(); + + Ogre::ParticleSystem * explosion_; + Ogre::Real explodeSequenceTime_; +}; + +} //namespace OpenGate + +#endif //_OPENGATE_SECTOREXPLOSIONOBJECT__H + + Modified: trunk/src/SectorMeshObject.cpp =================================================================== --- trunk/src/SectorMeshObject.cpp 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/SectorMeshObject.cpp 2009-01-25 14:46:55 UTC (rev 977) @@ -32,17 +32,15 @@ namespace OpenGate{ SectorMeshObject::SectorMeshObject( const std::string & name, Sector * sector, Ogre::SceneNode * parentNode ) - : SectorCollisionObject( name, sector, parentNode ) { + : SectorCollisionObject( name, sector, parentNode ), target_( NULL ){ entityScaleNode_ = mainNode_->createChildSceneNode( mainNode_->getName() + "/scale" ); entityRotNode_ = entityScaleNode_->createChildSceneNode( entityScaleNode_->getName() + "/rot" ); } SectorMeshObject::~SectorMeshObject( ){ + this->deactivate(); - if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->destroy( collObj_ ); - } if ( entity_ ) sector_->sceneManager()->destroyEntity( entity_ ); entityRotNode_->detachAllObjects(); entityScaleNode_->removeAndDestroyChild( entityRotNode_->getName() ); @@ -68,12 +66,14 @@ } entityRotNode_->attachObject( entity_ ); + this->activate(); + +} - if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->create( this ); - } +void SectorMeshObject::setBaseScale( const Ogre::Real & scale ){ + if ( scale > 1e-4 ) entityScaleNode_->scale( Ogre::Vector3( scale, scale, scale) ); } - + void SectorMeshObject::setBaseRot( const Ogre::Real & yaw, const Ogre::Real & pitch, const Ogre::Real & roll ){ if ( fabs( yaw ) >1e-4 ||fabs( pitch ) >1e-4 || fabs( roll ) >1e-4 ){ std::cout << "SectorObject::setBaseRot " << name_ << yaw @@ -132,6 +132,36 @@ // baseSize_ = size; // baseScale_ = scale; } + +void SectorMeshObject::explode() { + sector_->createExplosion( this ); + this->setDestroyRequest(); +} + +void SectorMeshObject::setTarget( SectorMeshObject * target ){ + this->looseTarget( ); + + if ( target ){ + target_ = target; + target_->addObserver( this ); + } +} + +void SectorMeshObject::looseTarget( ){ + if ( target_ ){ + target_->delObserver( this ); + target_ = NULL; + } +} +void SectorMeshObject::unsubscribeToObservers(){ + std::for_each( observers_.begin(), observers_.end(), std::mem_fun( &SectorMeshObject::looseTarget ) ); + //std::cout << "SectorObject::unsubscribeToObservers(): " << name_ << " " << observers_.size() << std::endl; +// for ( std::set < SectorObject * >::iterator it = observers_.begin(); it != observers_.end();){ +// (*it++)->looseTarget( ); +// } + + //std::cout << "SectorObject::unsubscribeToObservers(): " << observers_.size() << std::endl; +} } Modified: trunk/src/SectorMeshObject.h =================================================================== --- trunk/src/SectorMeshObject.h 2009-01-25 14:37:53 UTC (rev 976) +++ trunk/src/SectorMeshObject.h 2009-01-25 14:46:55 UTC (rev 977) @@ -26,7 +26,7 @@ namespace OpenGate{ -/*! Baseclass for SectorObjects with Ogre::Meshs. */ +/*! Baseclass for SectorObjects with Ogre::Meshs. SectorMeshObject can by selected */ class SectorMeshObject : public SectorCollisionObject {... [truncated message content] |
From: <spo...@us...> - 2009-01-25 23:35:54
|
Revision: 978 http://opengate.svn.sourceforge.net/opengate/?rev=978&view=rev Author: spom_spom Date: 2009-01-25 23:35:50 +0000 (Sun, 25 Jan 2009) Log Message: ----------- next steps of reorganization done (autodocking, radar) still open: fireing stuff, network Modified Paths: -------------- trunk/data/materials/gradientshader.material trunk/data/misc/test.sector trunk/src/AiCommands.cpp trunk/src/AiManager.cpp trunk/src/AiObject.cpp trunk/src/AiObject.h trunk/src/Hud.cpp trunk/src/OpcodeWrapper.cpp trunk/src/Opengate.h trunk/src/RadarObject.cpp trunk/src/RadarObject.h trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorBaseObject.h trunk/src/SectorMeshObject.cpp trunk/src/SectorMeshObject.h trunk/src/SectorMissileObject.cpp trunk/src/SectorMissileObject.h trunk/src/SectorMovableObject.cpp trunk/src/SectorMovableObject.h trunk/src/SectorStationObject.cpp trunk/src/SectorVesselObject.cpp trunk/src/SectorVesselObject.h trunk/src/ShipConfigDialog.cpp trunk/src/UnDockedState.cpp Modified: trunk/data/materials/gradientshader.material =================================================================== --- trunk/data/materials/gradientshader.material 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/data/materials/gradientshader.material 2009-01-25 23:35:50 UTC (rev 978) @@ -35,7 +35,7 @@ pass { scene_blend alpha_blend - depth_write off + depth_write on vertex_program_ref shader/gradientVP_Unified { param_named_auto customParamColour custom 0 @@ -46,4 +46,4 @@ } } } -} \ No newline at end of file +} Modified: trunk/data/misc/test.sector =================================================================== --- trunk/data/misc/test.sector 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/data/misc/test.sector 2009-01-25 23:35:50 UTC (rev 978) @@ -4,7 +4,7 @@ <ambient a="1" r="0.1" b="0.1" g="0.1"></ambient> </environment> <station name="Tauseti Wake"> - <position y="0" x="0" z="-2000"></position> + <position y="0" x="0" z="4000"></position> </station> <beacon> <position y="0" x="-650" z="800"></position> Modified: trunk/src/AiCommands.cpp =================================================================== --- trunk/src/AiCommands.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/AiCommands.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -22,7 +22,7 @@ #include "common.h" #include "AiObject.h" #include "AiCommands.h" -#include "SectorObjectVessel.h" +#include "SectorVesselObject.h" #include "Moveable.h" #include <OgreSceneNode.h> @@ -40,7 +40,7 @@ addCommand( new AiCommandPitch( ai_, 180.0 ) ); addCommand( new AiCommandStop( ai_ ) ); } else { - if ( ai_->vesselObject( ) ) ai_->vesselObject( )->setBreakPressed( true ); + if ( ai_->vesselObject( ) ) ai_->vesselObject( )->setBrakePressed( true ); // std::cout << "braking speed: " << ai_->vesselObject( )->speed() << std::endl; // std::cout << "braking time est: " << ai_->brakingTime( ai_->vesselObject( )->speed() ) << std::endl; // std::cout << "braking way est: " << ai_->brakingDistance( ai_->vesselObject( )->speed() ) << std::endl; @@ -56,7 +56,7 @@ void AiCommandStop::AiCommandStop::stop(){ std::cout << "AiCommandStop stop" << std::endl; if ( ai_->vesselObject( ) ) { - ai_->vesselObject( )->setBreakPressed( false ); + ai_->vesselObject( )->setBrakePressed( false ); // std::cout << "braking time real: " << runtime_ << std::endl; // std::cout << "braking way real: " // << ( ai_->vesselObject( )->mainNode()->_getDerivedPosition()- startPos_ ).length() Modified: trunk/src/AiManager.cpp =================================================================== --- trunk/src/AiManager.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/AiManager.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -19,19 +19,20 @@ ***************************************************************************/ #include "AiManager.h" + +#include "common.h" + #include "AiObject.h" +#include "Avatar.h" +#include "EntityManager.h" +#include "GameStateManager.h" -#include "common.h" #include "ResourceManager.h" -#include "EntityManager.h" -#include "Vessel.h" -#include "SectorObjectVessel.h" #include "Sector.h" +#include "SectorVesselObject.h" +#include "Station.h" #include "UnDockedState.h" -#include "GameStateManager.h" -#include "Avatar.h" -#include "Station.h" -#include "OgreSceneNode.h" +#include "Vessel.h" #include "networkClient.h" #include <iostream> @@ -40,6 +41,8 @@ #include <boost/thread.hpp> +#include <OgreSceneNode.h> + namespace OpenGate{ AiManager::AiManager( ResourceManager * resources ) : resources_( resources ){ @@ -101,27 +104,27 @@ } AiObject * AiManager::spawnAi( ){ - std::string name( "aiMan-" ); if ( resources_ ){ + if ( resources_->gameStateRoot->activeState( )->name() == "UnDockedState" ){ + + std::string name( "aiMan-" ); + if ( resources_->avatar ) name += resources_->avatar->name(); - } - AiObject * ai = createAiObject( name ); + + AiObject * ai = createAiObject( name ); - SectorObjectVessel *obj = NULL; - if ( resources_ ){ - if ( resources_->gameStateRoot->activeState( )->name() == "UnDockedState" ){ - - + SectorVesselObject * obj = dynamic_cast < UnDockedState *>(resources_->gameStateRoot->activeState() )->sector()->createVesselObject( + new Vessel( *resources_->entityManager->vessel( "apteryx" ) ) + ); + obj->vessel( )->setPowerPlant( resources_->entityManager->powerPlant( "Spud" ) ); obj->vessel( )->setEngine( resources_->entityManager->engine( "T-E-15" ) ); obj->vessel( )->setRadar( resources_->entityManager->radar( "Outlook" ) ); obj->vessel( )->setShield( resources_->entityManager->shield( "Kydango" ) ); obj->vessel( )->setCapacitor( resources_->entityManager->capacitor( "Sponge" ) ); std::cout << "AiManager::spawnAi( ): " << obj->name() << std::endl; - } else { - std::cout << "AiManager::spawnAi( ): spawn only in undockedState" << std::endl; - } - } + + //-250, 0, 500 ai->setVesselObject( obj ); Ogre::Real xmin = -150.0, xmax = -200.0; @@ -132,7 +135,7 @@ obj->mainNode()->setPosition( Ogre::Math::RangeRandom( xmin, xmax ), Ogre::Math::RangeRandom( ymin, ymax ), Ogre::Math::RangeRandom( zmin, zmax ) ); - obj->launch(); + // obj->launch(); // obj->mainNode()->setPosition( // dynamic_cast < UnDockedState *>(resources_->gameStateRoot->activeState() // )->sector()->station()->launchPadPosition() + @@ -143,12 +146,20 @@ // dynamic_cast < UnDockedState *>(resources_->gameStateRoot->activeState() // )->sector()->station()->launchPadOrientation() ); - // ai->land( dynamic_cast < UnDockedState *>(resources_->gameStateRoot->activeState() )->sector()->station() ); + SectorStationObject *station = *dynamic_cast < UnDockedState *>(resources_->gameStateRoot->activeState() )->sector()->sectorStationObjects().begin(); + ai->land( station ); } startAiObject( ai ); - return ai; + + } else { + std::cout << "AiManager::spawnAi( ): spawn only in undockedState" << std::endl; + } + } else { + std::cout << "AiManager::spawnAi( ): resources manager not defined" << std::endl; + } + return NULL; } AiObject * AiManager::createAiObject( const std::string & name ){ @@ -180,7 +191,7 @@ void AiManager::eraseAiObject_( AiObject * ai ){ boost::mutex::scoped_lock lock( eraseMutex_ ); - SectorObjectVessel *obj = ai->vesselObject( ); + SectorVesselObject *obj = ai->vesselObject( ); if ( obj ){ __D( obj->name() ) obj->setControler( NULL ); } Modified: trunk/src/AiObject.cpp =================================================================== --- trunk/src/AiObject.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/AiObject.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -18,16 +18,20 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include "AiObject.h" #include "common.h" -#include "AiObject.h" + #include "AiCommands.h" -#include "SectorObjectVessel.h" #include "Moveable.h" -#include "Vessel.h" #include "Sector.h" +#include "SectorVesselObject.h" +#include "SectorStationObject.h" +#include "SectorStationPadObject.h" #include "Station.h" +#include "Vessel.h" + #include <OgreTimer.h> #include <OgreVector3.h> @@ -73,7 +77,7 @@ for_each( cmdQueue_.begin(), cmdQueue_.end(), deletePtr() ); cmdQueue_.clear(); } -void AiObject::setVesselObject( SectorObjectVessel * obj ){ +void AiObject::setVesselObject( SectorVesselObject * obj ){ vesselObject_ = obj; if ( obj ){ vesselObject_->setControler( this ); @@ -174,19 +178,19 @@ cmdQueue_.push_back( new AiCommandLookAt( this, Ogre::Vector3( 0.0, 0.0, 1.0 ) ) ); } -void AiObject::land( StationObject * station ){ +void AiObject::land( SectorStationObject * station ){ if ( station ){ cmdQueue_.push_back( new AiCommandWait( this, 1.0 ) ); -// std::cout << "station docking pad: " << station.dockPadPosition( ) << std::endl; + std::cout << "station docking pad: " << station->dockPad()->position( true ) << std::endl; // std::cout << "station ring end:" << station.dockingRingEnd( ) << std::endl; // std::cout << "station ring start:" << station.dockingRingStart( ) << std::endl; // station->sector()->koordAxis()->setPosition( station.dockPadPosition( ) ); // std::cout << "station launch pad: " << station.launchPadPosition( ) << std::endl; - //cmdQueue_.push_back( new AiCommandApproach( this, station.dockingRingStart( ), true ) ); - cmdQueue_.push_back( new AiCommandApproach( this, station->dockingRingStart( ), true ) ); + + cmdQueue_.push_back( new AiCommandApproach( this, station->dockPad()->position( true ) + 1000.0* station->dockPad()->direction( true ), true ) ); cmdQueue_.push_back( new AiCommandWait( this, 1.0 ) ); - cmdQueue_.push_back( new AiCommandApproach( this, station->dockPadPosition( ), true ) ); + cmdQueue_.push_back( new AiCommandApproach( this, station->dockPad()->position( true ), true ) ); } else { std::cerr << "Station is not valid" << std::endl; } @@ -235,15 +239,15 @@ double AiObject::maxSpeed( double thrustRate ) const { //** vmax(th,d):=sqrt( th/d ) ** P double d = vesselObject_->movable()->dragFactor(); - double th = vesselObject_->maxThrust() * thrustRate; + double th = vesselObject_->vessel()->maxThrust() * thrustRate; return sqrt( th / d ); } double AiObject::speedAfterTime( double time, double thrustRate ) const { //** v[ t ] := vmax * tanh( th / m / vmax * t ) ** P // double d = vesselObject_->vessel()->dragFactor(); - double m = vesselObject_->mass(); - double th = vesselObject_->maxThrust() * thrustRate; + double m = vesselObject_->vessel()->mass(); + double th = vesselObject_->vessel()->maxThrust() * thrustRate; double vmax = maxSpeed( thrustRate ); double v = vmax * std::tanh( th / m / vmax * time ); // std::cout << " th: " << th << "; m: " << m << "; d: " << d << "; vmax: " << vmax << "; t: " << time @@ -256,8 +260,8 @@ //** s[t]:=integrate(v[t], t) //** s = vmax^2/a * log( cosh( a / vmax * t ) ) ** P // double d = vesselObject_->vessel()->dragFactor(); - double m = vesselObject_->mass(); - double th = vesselObject_->maxThrust() * thrustRate; + double m = vesselObject_->vessel()->mass(); + double th = vesselObject_->vessel()->maxThrust() * thrustRate; double vmax = maxSpeed( thrustRate ); double a = th / m; double s = ( vmax * vmax ) / a * std::log( std::cosh( a / vmax * time ) ); @@ -267,7 +271,7 @@ } double AiObject::brakingTime( double v ) const { double d = vesselObject_->vessel()->dragFactor(); - double m = vesselObject_->mass(); + double m = vesselObject_->vessel()->mass(); double a = vesselObject_->brakingAcc(); // double th = m * a; //std::cout << " th: " << th << "; m: " << m << "; d: " << d << "; v: " << v << "; t: " << time << std::endl; @@ -277,7 +281,7 @@ double AiObject::brakingDistance( double v ) const { double d = vesselObject_->vessel()->dragFactor(); - double m = vesselObject_->mass(); + double m = vesselObject_->vessel()->mass(); double a = vesselObject_->brakingAcc(); // double th = m * a; @@ -293,8 +297,8 @@ //** t(th,d,m,v):=( m * atanh( v / vmax ) ) / sqrt( d * th ) double d = vesselObject_->vessel()->dragFactor(); - double m = vesselObject_->mass(); - double th = vesselObject_->maxThrust() * thrustRate; + double m = vesselObject_->vessel()->mass(); + double th = vesselObject_->vessel()->maxThrust() * thrustRate; double vmax = maxSpeed( thrustRate ); v = min( v, 0.99 * vmax ); Modified: trunk/src/AiObject.h =================================================================== --- trunk/src/AiObject.h 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/AiObject.h 2009-01-25 23:35:50 UTC (rev 978) @@ -21,6 +21,8 @@ #ifndef _OPENGATE_AIOBJECT__H #define _OPENGATE_AIOBJECT__H +#include "Opengate.h" + #include <string> #include <vector> #include <set> @@ -37,13 +39,6 @@ namespace OpenGate{ -class ResourceManager; -class SectorObjectVessel; -class StationObject; -class AiManager; -class AiObject; -class AiCommand; - class AiObject{ public: AiObject( uint id ); @@ -57,10 +52,10 @@ virtual void run(); /*! Set the instance which is controled by this ai */ - void setVesselObject( SectorObjectVessel * obj ); + void setVesselObject( SectorVesselObject * obj ); /*! Get the instance which is controled by this ai */ - inline SectorObjectVessel * vesselObject( ){ return vesselObject_; } + inline SectorVesselObject * vesselObject( ){ return vesselObject_; } bool isAlive() const { return isAlive_; } @@ -78,7 +73,7 @@ void test( ); - void land( StationObject * station ); + void land( SectorStationObject * station ); /*! Idle and look every second for new orders */ //bool cmdIdle( ); @@ -121,7 +116,7 @@ uint id_; //! the graphical representation - SectorObjectVessel * vesselObject_; + SectorVesselObject * vesselObject_; std::deque< AiCommand * > cmdQueue_; Modified: trunk/src/Hud.cpp =================================================================== --- trunk/src/Hud.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/Hud.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -85,7 +85,6 @@ Ogre::SceneNode * flightArrowTrans = flightArrowNode_->createChildSceneNode( "FlightArrow/TransNode" ); Ogre::Entity * flightArrowEntity = sceneMgr_->createEntity( "FlightArrow/Entity", "arrow.mesh" ); flightArrowEntity->setMaterialName( "SimpleHUD/FlightArrow" ); -//flightArrowEntity->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY); flightArrowTrans->attachObject( flightArrowEntity ); flightArrowTrans->pitch( Ogre::Degree( -90 ) ); flightArrowTrans->scale( 0.01, 0.01, 0.01 ); @@ -95,7 +94,6 @@ Ogre::SceneNode * targetArrowTrans = targetArrowNode_->createChildSceneNode( "TargetArrow/TransNode" ); Ogre::Entity * targetArrowEntity = sceneMgr_->createEntity( "TargetArrow/Entity", "arrow.mesh" ); targetArrowEntity->setMaterialName( "SimpleHUD/FlightArrow" ); -//flightArrowEntity->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY); targetArrowTrans->attachObject( targetArrowEntity ); targetArrowTrans->pitch( Ogre::Degree( -90 ) ); targetArrowTrans->scale( 0.01, 0.01, 0.01 ); @@ -270,23 +268,21 @@ //! End update targeting pointer and duelist pointers; targetDistanceText_->setText( "D" + Ogre::StringConverter::toString( round( distToTarget.length(), 0 ) ) ); -// -// if ( target_->rtti() == SECTOROBJECTMOVABLE_RTTI || -// target_->rtti() == SECTOROBJECTVESSEL_RTTI || -// target_->rtti() == SECTOROBJECTMISSILE_RTTI ){ -// -// targetVelocity_->setText( "V" + Ogre::StringConverter::toString( round( -// dynamic_cast< SectorObjectMovable *>( target_ )->speed(), 2 ), 4 ) ); -// targetShieldText_->setText( "S" + Ogre::StringConverter::toString( round( -// dynamic_cast< SectorObjectMovable *>( target_ )->shieldRate() * 100.0f, 1), 4 ) ); -// targetArmorText_->setText( "A" + Ogre::StringConverter::toString( round( -// dynamic_cast< SectorObjectMovable *>( target_ )->armorRate() * 100.0f, 1), 4 ) ); -// -// } else{ -// targetVelocity_->setText( "" ); -// targetShieldText_->setText( "" ); -// targetArmorText_->setText( "" ); -// } + + if ( target_->rtti() == SECTOR_MOVABLE_OBJECT_RTTI || + target_->rtti() == SECTOR_VESSEL_OBJECT_RTTI || + target_->rtti() == SECTOR_MISSILE_OBJECT_RTTI ){ + + SectorMovableObject * targ = dynamic_cast< SectorMovableObject *>( target_ ); + targetVelocity_->setText( "V" + Ogre::StringConverter::toString( round((Ogre::Real)targ->speed(), 2 ), 4 ) ); + targetShieldText_->setText( "S" + Ogre::StringConverter::toString( round( (Ogre::Real)targ->shield() / targ->maxShield() * 100.0f, 1), 4 ) ); + targetArmorText_->setText( "A" + Ogre::StringConverter::toString( round( (Ogre::Real)targ->armor() / targ->maxArmor() * 100.0f, 1), 4 ) ); + + } else { + targetVelocity_->setText( "" ); + targetShieldText_->setText( "" ); + targetArmorText_->setText( "" ); + } } else { //! else !target_ if ( targetArrowNode_ ) targetArrowNode_->setVisible( false ); } Modified: trunk/src/OpcodeWrapper.cpp =================================================================== --- trunk/src/OpcodeWrapper.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/OpcodeWrapper.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -144,7 +144,7 @@ bool OpcodeCollisionDetection::checkCollideRay( SectorCollisionObject * obj, const Ogre::Ray & ray, double rayLength ){ if ( active_ ){ - if ( !obj->destroyRequest() ){ + if ( !obj->isDestroyRequest() ){ OgreOpcode::CollisionPair ** rayPickReport; uint nColl = collideInSectorContext_->rayCheck( ray, rayLength, OgreOpcode::COLLTYPE_EXACT, Modified: trunk/src/Opengate.h =================================================================== --- trunk/src/Opengate.h 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/Opengate.h 2009-01-25 23:35:50 UTC (rev 978) @@ -63,6 +63,9 @@ class AiObject; +class AiCommand; +class AiManager; + class Avatar; class BaseObject; class DockedState; Modified: trunk/src/RadarObject.cpp =================================================================== --- trunk/src/RadarObject.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/RadarObject.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -25,8 +25,37 @@ #include "SectorAvatarObject.h" #include "SectorMeshObject.h" +#include <OgreOverlayContainer.h> +#include <OgreOverlayElement.h> +#include <OgreOverlayManager.h> + namespace OpenGate{ +RadarViewable::RadarViewable( const std::string & name ) + : name_( name ){ + int dotAWidth = 10; + int dotAHeight = 4; + dotA_ = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Radar/Map/DotA_" + name_ ); + dotA_->setMaterialName( "BaseWhite" ); + dotA_->setMetricsMode( Ogre::GMM_PIXELS ); + dotA_->setWidth( dotAWidth ); + dotA_->setHeight( dotAHeight ); + dotA_->setColour( Ogre::ColourValue( 1.0f, 0.0f, 0.0f ) ); + + dotB_ = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Radar/Map/DotB_" + name_ ); + dotB_->setMaterialName( "BaseWhite" ); + dotB_->setMetricsMode( Ogre::GMM_PIXELS ); + dotB_->setWidth( 1 ); + dotB_->setHeight( 1 ); + dotB_->setColour( Ogre::ColourValue( 1.0f, 0.0f, 0.0f ) ); +} + +RadarViewable::~RadarViewable(){ + Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Radar/Map/DotA_" + name_ ); + Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Radar/Map/DotB_" + name_ ); +} + + RadarObject::RadarObject( Sector * sector, Hud * hud ) : sector_( sector ), hud_( hud ), avatar_( NULL ), target_( NULL ){ @@ -36,6 +65,13 @@ } avatar_ = sector_->avatarObject(); + + Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); + radarMap_ = radar->getChild( "Radar/Map" ); + + radarWidth_ = radarMap_->getWidth() * Ogre::OverlayManager::getSingleton().getViewportWidth(); + radarHeight_ = radarMap_->getHeight() * Ogre::OverlayManager::getSingleton().getViewportHeight(); + changeRange( 5000.0 ); } @@ -43,17 +79,67 @@ objects_.clear(); } +void RadarObject::changeRange( double range ){ + radarRange_ = range; + xScale_ = radarRange_ / ( radarWidth_ / 2.0 ); + yScale_ = radarRange_ / ( radarHeight_ / 2.0 ); +} + void RadarObject::update( const Ogre::Real elapsedTime ){ - + for ( std::map< SectorMeshObject *, RadarViewable * >::iterator it = objects_.begin(), itmax = objects_.end(); it != itmax; it ++ ){ + if ( it->first != avatar_ ){ + SectorMeshObject * rObj = it->first; + RadarViewable * rVie = it->second; + + Ogre::Vector3 relativPosition( rObj->mainNode()->getPosition( ) - avatar_->mainNode()->getPosition( ) ); + Ogre::OverlayElement * dotA = rVie->dotA(); + Ogre::OverlayElement * dotB = rVie->dotB(); + + if ( relativPosition.length() < radarRange_ ){ + + Ogre::Quaternion q; q.FromAngleAxis( -avatar_->mainNode()->getOrientation( ).getYaw(), Ogre::Vector3::UNIT_Y ); + relativPosition = q * relativPosition; + + Ogre::Plane viewPlane( avatar_->mainNode()->getOrientation().yAxis().normalisedCopy(), + avatar_->mainNode()->getPosition() ); + + float distToPlane = viewPlane.getDistance( rObj->mainNode()->getPosition( ) ) / yScale_; + + dotA->setPosition( radarWidth_ / 2.0 + relativPosition[ 0 ] / xScale_ - rVie->dotAWidth() / 2.0, + radarHeight_ / 2.0 + relativPosition[ 2 ] / yScale_ - rVie->dotAHeight() / 2.0 - distToPlane ); + + if ( distToPlane < 0 ) distToPlane = 0; + + dotB->setHeight( fabs( distToPlane ) ); + dotB->setPosition( radarWidth_ / 2.0 + relativPosition[ 0 ] / xScale_, + - distToPlane + radarHeight_ / 2.0 + relativPosition[ 2 ] / yScale_ ); + + if ( !rVie->isVisible() ){ + radarMap_->addChild( dotA ); + radarMap_->addChild( dotB ); + rVie->show(); + } + } else { //! else out of range + if ( rVie->isVisible() ){ + radarMap_->removeChild( dotA->getName() ); + radarMap_->removeChild( dotB->getName() ); + rVie->hide(); + } + } //! end else out of range + } + } } void RadarObject::addObject( SectorMeshObject * obj ){ std::cout << "RadarObject::addObject( "<< obj->name() << std::endl; - objects_.insert( obj ); + objects_.insert( std::pair< SectorMeshObject*, RadarViewable* >( obj, new RadarViewable( obj->name() ) ) ); } void RadarObject::delObject( SectorMeshObject * obj ){ + std::map< SectorMeshObject *, RadarViewable * >::iterator itTarget = objects_.find( obj ); + if ( itTarget != objects_.end() ) delete itTarget->second; objects_.erase( obj ); + if ( target_ == obj ) findNextTarget(); } @@ -69,14 +155,14 @@ SectorMeshObject * RadarObject::findTarget_( bool reverse, bool forbidAvatarSelection ){ if ( objects_.size() == 1 ){ - return *objects_.begin(); + return objects_.begin()->first; } if ( objects_.size() > 0 ){ if ( !target_ ) { - return *objects_.begin(); + return objects_.begin()->first; } else { - std::set< SectorMeshObject * >::iterator itTarget = objects_.find( target_ ); + std::map< SectorMeshObject *, RadarViewable * >::iterator itTarget = objects_.find( target_ ); if ( itTarget == objects_.end() ) itTarget = objects_.begin(); @@ -91,8 +177,8 @@ // if ( (*itTarget)->selectable() ) { if ( forbidAvatarSelection ){ - if ( (*itTarget) != avatar_ ) return (*itTarget); - } else return (*itTarget); + if ( itTarget->first != avatar_ ) return itTarget->first; + } else return itTarget->first; } } } Modified: trunk/src/RadarObject.h =================================================================== --- trunk/src/RadarObject.h 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/RadarObject.h 2009-01-25 23:35:50 UTC (rev 978) @@ -27,7 +27,33 @@ class RadarViewable{ public: + RadarViewable( const std::string & name ); + + ~RadarViewable(); + + inline int dotAWidth() const { return dotAWidth_ ; } + + inline int dotAHeight() const { return dotAHeight_ ; } + + inline Ogre::OverlayElement * dotA() const { return dotA_; } + + inline Ogre::OverlayElement * dotB() const { return dotB_; } + + inline void show() { isShown_ = true; } + + inline void hide() { isShown_ = false; } + + inline bool isVisible() const { return isShown_; } + protected: + std::string name_; + Ogre::OverlayElement * dotA_; + Ogre::OverlayElement * dotB_; + + int dotAWidth_; + int dotAHeight_; + + bool isShown_; }; class RadarObject{ @@ -48,6 +74,8 @@ SectorMeshObject * target( ) { return target_; } + void changeRange( double range ); + protected: SectorMeshObject * findTarget_( bool reverse = false, bool forbidAvatarSelection = true ); @@ -57,7 +85,14 @@ SectorAvatarObject * avatar_; SectorMeshObject * target_; - std::set < SectorMeshObject * > objects_; + std::map < SectorMeshObject *, RadarViewable * > objects_; + + Ogre::OverlayContainer * radarMap_; + double radarRange_; + float radarWidth_; + float radarHeight_; + float xScale_; + float yScale_; }; } //namespace OpenGate Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/Sector.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -40,6 +40,7 @@ #include "SectorStationObject.h" #include "SectorStationPadObject.h" #include "UnDockedState.h" +#include "Vessel.h" #include <OgreEntity.h> #include <OgreManualObject.h> @@ -185,9 +186,9 @@ return obj; } -SectorAvatarObject * Sector::createAvatarObject( Avatar & avatar ){ - log_->info( std::string( "Sector::createAvatarObject: " ) + avatar.name() ); - avatar_ = new SectorAvatarObject( avatar.name(), this, avatar.vessel() ); +SectorAvatarObject * Sector::createAvatarObject( Avatar * avatar ){ + log_->info( std::string( "Sector::createAvatarObject: " ) + avatar->name() ); + avatar_ = new SectorAvatarObject( avatar->name(), this, avatar->vessel() ); avatar_->reset(); bool hasStation = false; @@ -212,7 +213,23 @@ insertMeshObject_( avatar_ ); return avatar_; } - + +SectorVesselObject * Sector::createVesselObject( Vessel * vessel ){ + SectorVesselObject * obj; + if ( objectHeap_[ vessel->name() ].empty() ){ + obj = new SectorVesselObject( vessel->name() + "_" + toStr( childIDCounter_ ), this, vessel ); + childIDCounter_++; + log_->debug( "Sector::createVesselObject new " + obj->name() ); + } else { + obj = dynamic_cast< SectorVesselObject * >( objectHeap_[ vessel->name() ].front() ); + objectHeap_[ vessel->name() ].pop_front(); + obj->reset(); + log_->debug( "Sector::createVesselObject reuse " + obj->name() ); + } + insertMeshObject_( obj ); + return obj; +} + SectorMissileObject * Sector::createMissileObject( Missile * missile ){ SectorMissileObject * obj; @@ -247,10 +264,12 @@ insertCollObject_( obj ); } - void Sector::objectDocked( SectorMovableObject * obj, SectorStationObject * station ){ std::cout << obj->name() << " docked at " << station->name() << std::endl; switch ( obj->rtti() ){ + case SECTOR_VESSEL_OBJECT_RTTI: + obj->destroy(); + break; case SECTOR_AVATAR_OBJECT_RTTI: if ( listener_ ) listener_->changeToDockedState(); break; Modified: trunk/src/Sector.h =================================================================== --- trunk/src/Sector.h 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/Sector.h 2009-01-25 23:35:50 UTC (rev 978) @@ -56,6 +56,8 @@ const std::set< SectorMeshObject * > & sectorMeshObjects() const { return sectorMeshObjects_; } + const std::set< SectorStationObject * > & sectorStationObjects() const { return sectorStations_; } + /*! Return handle to the avatarObject */ inline SectorAvatarObject * avatarObject() { return avatar_; } @@ -68,8 +70,11 @@ /*! Create a station within the sector */ SectorStationObject * createStationObject( const Ogre::String & stationName ); + /*! Create a Vessle */ + SectorVesselObject * createVesselObject( Vessel * vessel ); + /*! Create a player related avatar */ - SectorAvatarObject * createAvatarObject( Avatar & avatar ); + SectorAvatarObject * createAvatarObject( Avatar * avatar ); /*! Create a missle */ SectorMissileObject * createMissileObject( Missile * misssile ); Modified: trunk/src/SectorBaseObject.h =================================================================== --- trunk/src/SectorBaseObject.h 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/SectorBaseObject.h 2009-01-25 23:35:50 UTC (rev 978) @@ -51,15 +51,16 @@ /*! Return a ptr to main OgreSceneNode for this SectorObject. */ inline Ogre::SceneNode * mainNode() { return mainNode_; } + inline bool isDestroyRequest() const { return destroyRequest_; } + + //** END GETer/SETer + +protected: /*! Mark the object for destruction \n To keep destruction thread safe, we just notify and let update return false, so the sector update cycle do the destruction job */ - inline void setDestroyRequest( bool dest = true ) { destroyRequest_ = dest; } - - /*! Return if the object is marked for destruction */ - inline bool destroyRequest() const { return destroyRequest_; } - //** END GETer/SETer + inline void setDestroyRequest_( bool dest = true ) { destroyRequest_ = dest; } + -protected: std::string name_; Sector * sector_; Ogre::SceneNode * mainNode_; Modified: trunk/src/SectorMeshObject.cpp =================================================================== --- trunk/src/SectorMeshObject.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/SectorMeshObject.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -71,7 +71,7 @@ } void SectorMeshObject::setBaseScale( const Ogre::Real & scale ){ - if ( scale > 1e-4 ) entityScaleNode_->scale( Ogre::Vector3( scale, scale, scale) ); + if ( scale > 1e-4 ) entityScaleNode_->scale( Ogre::Vector3( scale, scale, scale ) ); } void SectorMeshObject::setBaseRot( const Ogre::Real & yaw, const Ogre::Real & pitch, const Ogre::Real & roll ){ @@ -132,10 +132,15 @@ // baseSize_ = size; // baseScale_ = scale; } - + +void SectorMeshObject::destroy(){ + unsubscribeToObservers(); + this->setDestroyRequest_(); +} + void SectorMeshObject::explode() { sector_->createExplosion( this ); - this->setDestroyRequest(); + destroy(); } void SectorMeshObject::setTarget( SectorMeshObject * target ){ Modified: trunk/src/SectorMeshObject.h =================================================================== --- trunk/src/SectorMeshObject.h 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/SectorMeshObject.h 2009-01-25 23:35:50 UTC (rev 978) @@ -86,6 +86,9 @@ /*! Destroy the mesh object and emit explosion*/ virtual void explode(); + /*! Destroy the object without explosion */ + virtual void destroy(); + protected: Ogre::SceneNode * entityScaleNode_; // Main character node for base size Ogre::SceneNode * entityRotNode_; // Main character node for base rotation Modified: trunk/src/SectorMissileObject.cpp =================================================================== --- trunk/src/SectorMissileObject.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/SectorMissileObject.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -65,9 +65,9 @@ bool SectorMissileObject::update( Ogre::Real elapsedTime ){ maxLifetime_ -= elapsedTime; - if ( maxLifetime_ < 0.0 ) setDestroyRequest(); - - if ( target_ != NULL && elapsedTime > 1e-4 ) { + if ( maxLifetime_ < 0.0 ) { + destroy(); + } else if ( target_ != NULL && elapsedTime > 1e-4 && !isDestroyRequest() ) { Ogre::Vector3 currDir = mainNode_->getOrientation() * Ogre::Vector3::NEGATIVE_UNIT_Z; currDir.normalise(); @@ -110,7 +110,7 @@ pitchTo = rot.getPitch(); rollTo = rot.getRoll(); } - Ogre::Real rotFric = rotFriction_(); + Ogre::Real rotFric = rotFriction(); Ogre::Real scaledYaw = yawTo.valueDegrees() / ( elapsedTime * rotFric * movable_->yaw() ); Ogre::Real scaledPitch = pitchTo.valueDegrees() / ( elapsedTime * rotFric * movable_->pitch() ); // Ogre::Real scaledRoll = rollTo.valueDegrees() / ( elapsedTime * rotFric * moveable_->yaw() ); Modified: trunk/src/SectorMissileObject.h =================================================================== --- trunk/src/SectorMissileObject.h 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/SectorMissileObject.h 2009-01-25 23:35:50 UTC (rev 978) @@ -47,7 +47,7 @@ Missile * missile(); /*! Start the missile */ - void launch(); + virtual void launch(); virtual void reset(); Modified: trunk/src/SectorMovableObject.cpp =================================================================== --- trunk/src/SectorMovableObject.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/SectorMovableObject.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -21,9 +21,11 @@ #include "SectorMovableObject.h" #include "LogManager.h" +#include "Missile.h" #include "Moveable.h" #include "OpcodeWrapper.h" #include "ResourceManager.h" +#include "SectorMissileObject.h" #include <OgreRay.h> #include <OgreSceneNode.h> @@ -67,9 +69,10 @@ thrust_ = 0; mass_ = movable_->mass(); armor_ = movable_->armor(); + maxArmor_ = movable_->armor(); shield_ = 0; - setDestroyRequest( false ); + setDestroyRequest_( false ); } void SectorMovableObject::collide( SectorCollisionObject * obj ){ @@ -85,9 +88,9 @@ mainNode_->translate( ( mainNode_->getPosition() - obj->mainNode()->getPosition() ).normalisedCopy() * 3.0 ); break; -// case SECTOROBJECTMISSILE_RTTI: -// hitByAmmo( dynamic_cast < SectorObjectMissile *>( obj )->missile()->damage() ); -// break; + case SECTOR_MISSILE_OBJECT_RTTI: + hitByAmmo( dynamic_cast < SectorMissileObject *>( obj )->missile()->damage() ); + break; default: std::cout << "SectorMovableObject: " << this->name() << " collide with " << obj->rtti() << " " << obj->name() << std::endl; @@ -101,7 +104,7 @@ if ( elapsedTime < 0.001 ) return true; lifeTime_ += elapsedTime; - Ogre::Real rotFric = rotFriction_(); + Ogre::Real rotFric = rotFriction(); mainNode_->yaw( Ogre::Degree( yaw_ * ( elapsedTime * rotFric * movable_->yaw() ) ), rotRelativeTo_ ); mainNode_->pitch( Ogre::Degree( pitch_ * ( elapsedTime * rotFric * movable_->pitch() ) ), rotRelativeTo_ ); mainNode_->roll( Ogre::Degree( roll_ * ( elapsedTime * rotFric * movable_->roll() ) ), rotRelativeTo_ ); @@ -163,6 +166,8 @@ return movable_->dragFactor() * speed_ * speed_; } +void SectorMovableObject::launch(){ +} } //namespace OpenGate Modified: trunk/src/SectorMovableObject.h =================================================================== --- trunk/src/SectorMovableObject.h 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/SectorMovableObject.h 2009-01-25 23:35:50 UTC (rev 978) @@ -73,6 +73,9 @@ /*! Returns the current armor */ inline Uint32 armor() const { return armor_; } + /*! Returns the maximum armor */ + inline Uint32 maxArmor() const { return maxArmor_; } + /*! Returns the current shield */ inline Uint32 shield() const { return shield_; } @@ -91,6 +94,9 @@ inline void setScaledRoll( float rot ){ roll_ = rot; } inline Ogre::Real scaledRoll() const { return roll_; } + /*! Calculate friction factor for yaw, pitch, roll, friction increase by thrust */ + inline Ogre::Real rotFriction(){ return 0.4 + ( 0.6 * ( 1.0 - thrustRate() ) ); } + /*! Fixed braking acceleration.*/ inline Ogre::Real brakingAcc(){ return 5.0; } @@ -109,11 +115,15 @@ /*! Reset all values for this object. */ virtual void reset( ); + /*! Launch the movable*/ + virtual void launch(); + + /*! The object is hit by somewhat that makes damage, have to be specialised by derived objects*/ + virtual void hitByAmmo( Uint32 damage ){} // void setRotTransformSpace( const Ogre::TransformSpace relativRot ) { = relativRot; } protected: - /*! Calculate friction factor for yaw, pitch, roll, friction increase by thrust */ - inline Ogre::Real rotFriction_(){ return 0.4 + ( 0.6 * ( 1.0 - thrustRate() ) ); } + /*! Calculate friction factor for translate increase by speed */ Ogre::Real transFriction_(); @@ -141,10 +151,13 @@ double thrustRate_; Uint32 mass_; + Uint32 thrust_; Uint32 maxThrust_; + Uint32 armor_; Uint32 maxArmor_; + Uint32 shield_; Uint32 maxShield_; }; Modified: trunk/src/SectorStationObject.cpp =================================================================== --- trunk/src/SectorStationObject.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/SectorStationObject.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -40,6 +40,7 @@ : SectorMeshObject( station->name(), sector, parentNode ), station_( station ) { setMesh( station_->meshName() ); + setBaseRot( station_->baseYaw(), station_->basePitch(), station_->baseRoll() ); setBaseScale( station_->baseScale() ); setBaseSize( station_->baseSize() ); Modified: trunk/src/SectorVesselObject.cpp =================================================================== --- trunk/src/SectorVesselObject.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/SectorVesselObject.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -18,10 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "Opengate.h" - #include "SectorVesselObject.h" +#include "AiManager.h" #include "Equipment.h" #include "LogManager.h" #include "Moveable.h" @@ -39,6 +38,10 @@ } SectorVesselObject::~SectorVesselObject( ){ + if ( controler_ ) { + ResourceManager::getSingleton().aiManager->stopAiObject( controler_ ); + controler_ = NULL; + } } void SectorVesselObject::reset( ){ @@ -47,10 +50,12 @@ mass_ = this->vessel()->totalMass(); maxThrust_ = this->vessel()->maxThrust(); maxShield_ = this->vessel()->maxShield(); + shield_ = maxShield_; maxCapacity_ = this->vessel()->capacity(); capacity_ = maxCapacity_; controler_ = NULL; + statusChanged_ = false; } void SectorVesselObject::collide( SectorCollisionObject * object ){ @@ -58,6 +63,8 @@ } bool SectorVesselObject::update( Ogre::Real elapsedTime ){ + if ( armor_ <= 0 ) explode(); + updatePowerGrid( elapsedTime ); return SectorMovableObject::update( elapsedTime ); @@ -67,6 +74,24 @@ return dynamic_cast < Vessel * > ( movable_ ); } +void SectorVesselObject::hitByAmmo( Uint32 damage ){ + + long shield = (long)shield_ - damage; + long armor = armor_; + + + if ( shield < 0 ){ + armor += shield; + shield_ = 0; + armor_ = max( (long)0, armor ); + } else { + shield_ = shield; + } + statusChanged_ = true; + + std::cout << "hitByAmmo " << damage << " " << shield_ << " " << shield << " " << armor_ << " " << armor << std::endl; +} + bool SectorVesselObject::updatePowerGrid( Ogre::Real elapsedTime ){ Uint32 powerLine = 0; if ( this->vessel()->powerPlant() ) powerLine = this->vessel()->powerPlant()->powerOutput(); Modified: trunk/src/SectorVesselObject.h =================================================================== --- trunk/src/SectorVesselObject.h 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/SectorVesselObject.h 2009-01-25 23:35:50 UTC (rev 978) @@ -59,7 +59,7 @@ AiObject * controler( ){ return controler_; } /*! The vessel takes some damage */ - //virtual void hitByAmmo( Uint32 damage ); + virtual void hitByAmmo( Uint32 damage ); /*! Handle fire button pressed */ //void fire( Ogre::Real elapsedTime ); @@ -76,6 +76,8 @@ Uint32 capacity_; Uint32 maxCapacity_; + + bool statusChanged_; }; Modified: trunk/src/ShipConfigDialog.cpp =================================================================== --- trunk/src/ShipConfigDialog.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/ShipConfigDialog.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -214,7 +214,7 @@ void ShipConfigDialog::update( Ogre::Real timeElapsed ){ if ( visible_ ){ - rttNode_->yaw( Ogre::Degree( timeElapsed * 45 ) ); + //rttNode_->yaw( Ogre::Degree( timeElapsed * 45 ) ); } } Modified: trunk/src/UnDockedState.cpp =================================================================== --- trunk/src/UnDockedState.cpp 2009-01-25 14:46:55 UTC (rev 977) +++ trunk/src/UnDockedState.cpp 2009-01-25 23:35:50 UTC (rev 978) @@ -36,8 +36,9 @@ #include "KeyMap.h" #include "OpenALSoundManager.h" #include "RadarObject.h" -#include "SectorObjectAvatar.h" #include "SectorAvatarObject.h" +#include "SectorStationObject.h" + #include "EntityManager.h" #include "Station.h" #include "OpcodeWrapper.h" @@ -115,7 +116,7 @@ sector_ = new Sector( sceneMgr_, network_ ); sector_->setListener( this ); sector_->populate( "test.sector" ); - sector_->createAvatarObject( *resources_->avatar ); + sector_->createAvatarObject( resources_->avatar ); hud_ = new Hud( overlayRootWindow_, sector_->avatarObject() ); radar_ = new RadarObject( sector_, hud_ ); @@ -906,7 +907,8 @@ if ( !sector_->avatarObject()->controler() ){ log_->info( "Docking started." ); AiObject * ai = resources_->aiManager->createAiObject( "autodocker" ); - + ai->setVesselObject( sector_->avatarObject() ); + ai->land( dynamic_cast< SectorStationObject * >(radar_->target() ) ); resources_->aiManager->startAiObject( ai ); } else { log_->info( "Docking aborted." ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-02-07 22:37:40
|
Revision: 1019 http://opengate.svn.sourceforge.net/opengate/?rev=1019&view=rev Author: spom_spom Date: 2009-02-07 22:37:37 +0000 (Sat, 07 Feb 2009) Log Message: ----------- fixed some small isssues Modified Paths: -------------- trunk/ToDo trunk/src/GunObject.cpp trunk/src/GunObject.h trunk/src/RadarObject.cpp trunk/src/SectorMeshObject.cpp trunk/src/SectorMeshObject.h trunk/src/SectorMovableObject.cpp trunk/src/SectorVesselObject.cpp trunk/src/opengateserver.cpp Modified: trunk/ToDo =================================================================== --- trunk/ToDo 2009-02-07 20:33:19 UTC (rev 1018) +++ trunk/ToDo 2009-02-07 22:37:37 UTC (rev 1019) @@ -215,5 +215,3 @@ Possible Refaktor: (Hier steht Kram den man vielleicht mal aufr\xE4umen kann oder sollte, das ist entweder: alter schief gewachsener code, unsicherheiten, als ich das machte konnte ichs nicht besser, einfach nur Mist, etc... ) - /*! Returns the set of known resource paths, maybee this this can be saver by using ogre resource Manager directly instead of holding our own set. */ - std::set < std::string > & ResourceManager::resourcePaths(); Modified: trunk/src/GunObject.cpp =================================================================== --- trunk/src/GunObject.cpp 2009-02-07 20:33:19 UTC (rev 1018) +++ trunk/src/GunObject.cpp 2009-02-07 22:37:37 UTC (rev 1019) @@ -77,18 +77,16 @@ return false; } -EngineObject::EngineObject( Engine * engineBluePrint ) - : engineBluePrint_( engineBluePrint ), parent_( NULL ){ +EngineObject::EngineObject( Engine * engineBluePrint, const std::string & name, Ogre::SceneNode * mountNode, const Ogre::Vector3 & position ) + : engineBluePrint_( engineBluePrint ), name_( name ), mountNode_( mountNode ){ + thrustRate_ = 0.0; thrusterParticles_ = NULL; -} -EngineObject::~EngineObject(){ -} + mainNode_ = mountNode_->createChildSceneNode( name_ + "_EngineMountPoint" ); + mainNode_->setPosition( position ); -void EngineObject::mount( SectorMovableObject * parent, Ogre::SceneNode * mountPoint ){ - parent_ = parent; - thrusterParticles_ = parent->sector()->sceneManager()->createParticleSystem( mountPoint->getName() + "/Thruster" ); + thrusterParticles_ = mountNode_->getCreator()->createParticleSystem( mainNode_->getName() + "/Thruster" ); thrusterParticles_->setMaterialName( "Examples/Flare" ); thrusterParticles_->setDefaultDimensions( 2, 1 ); @@ -97,9 +95,35 @@ // pEmit->setPosition( ( mainNodeEntityRot_->getOrientation() * engineMountPoints[ i ] ) * mainNodeEntityScale_->getScale() ); pEmit_->setColour( Ogre::ColourValue::Blue, Ogre::ColourValue::Green ); - mountPoint->attachObject( thrusterParticles_ ); + mainNode_->attachObject( thrusterParticles_ ); + } + +EngineObject::~EngineObject(){ + + if ( thrusterParticles_ ){ + mainNode_->detachObject( thrusterParticles_ ); + mainNode_->getCreator()->destroyParticleSystem( thrusterParticles_ ); + mountNode_->removeAndDestroyChild( mainNode_->getName() ); + } +} + +// void EngineObject::mount( SectorMovableObject * parent, Ogre::SceneNode * mountPoint ){ +// parent_ = parent; +// mountPoint_ = mountPoint; +// thrusterParticles_ = parent->sector()->sceneManager()->createParticleSystem( mountPoint->getName() + "/Thruster" ); +// thrusterParticles_->setMaterialName( "Examples/Flare" ); +// thrusterParticles_->setDefaultDimensions( 2, 1 ); +// +// pEmit_ = thrusterParticles_->addEmitter( "Point" ); +// // pEmit->setDirection( mainNode_->getOrientation().zAxis() ); +// // pEmit->setPosition( ( mainNodeEntityRot_->getOrientation() * engineMountPoints[ i ] ) * mainNodeEntityScale_->getScale() ); +// pEmit_->setColour( Ogre::ColourValue::Blue, Ogre::ColourValue::Green ); +// +// mountPoint->attachObject( thrusterParticles_ ); +// } + void EngineObject::setThrustRate( double thrustRate ){ thrustRate_ = thrustRate; Modified: trunk/src/GunObject.h =================================================================== --- trunk/src/GunObject.h 2009-02-07 20:33:19 UTC (rev 1018) +++ trunk/src/GunObject.h 2009-02-07 22:37:37 UTC (rev 1019) @@ -62,27 +62,37 @@ }; +/*! Construct an engine with a grafical representation i.e. thruster effects. */ class EngineObject{ public: - EngineObject( Engine * engineBluePrint ); + /*! Construct an engine object, with a Blueprint, a uniqe name, the mountNode on the parent vessel and the absolute position for the emmesive parts of the engine.*/ + EngineObject( Engine * engineBluePrint, const std::string & name, Ogre::SceneNode * mountNode, const Ogre::Vector3 & position ); + /*! Destruct the engine and associated particle or grafical effects. */ ~EngineObject( ); - void mount( SectorMovableObject * parent, Ogre::SceneNode * mountPoint ); + /*! Return corresponding main Ogre::SceneNode for this engine. */ + inline Ogre::SceneNode * sceneNode() { return mainNode_; } + /*! Change the thrust rate. Causes a change of the thruster particle effect and determine the amount of power is consumed, by getting the thrust through update powerline cycle. */ void setThrustRate( double rate ); + /*! Return the preset thrustrate from 0 to 1 */ inline double thrustRate( double rate ){ return thrustRate_; } + /*! Return the amount of power that the engine provide for a given thrustRate. */ Uint32 thrust( Uint32 & powerLine ); protected: Engine * engineBluePrint_; - SectorMovableObject * parent_; - double thrustRate_; - + std::string name_; + Ogre::SceneNode * mountNode_; + Ogre::SceneNode * mainNode_; + Ogre::ParticleEmitter * pEmit_; Ogre::ParticleSystem * thrusterParticles_; + + double thrustRate_; }; } //namespace OpenGate Modified: trunk/src/RadarObject.cpp =================================================================== --- trunk/src/RadarObject.cpp 2009-02-07 20:33:19 UTC (rev 1018) +++ trunk/src/RadarObject.cpp 2009-02-07 22:37:37 UTC (rev 1019) @@ -78,6 +78,9 @@ } RadarObject::~RadarObject( ){ + for ( std::map< SectorMeshObject *, RadarViewable * >::iterator it = objects_.begin(), itmax = objects_.end(); it != itmax; ){ + delObject( (it++)->first ); + } objects_.clear(); } @@ -138,6 +141,7 @@ } void RadarObject::delObject( SectorMeshObject * obj ){ + std::cout << "RadarObject::delObject( "<< obj->name() << std::endl; std::map< SectorMeshObject *, RadarViewable * >::iterator itTarget = objects_.find( obj ); if ( itTarget != objects_.end() ) delete itTarget->second; objects_.erase( obj ); Modified: trunk/src/SectorMeshObject.cpp =================================================================== --- trunk/src/SectorMeshObject.cpp 2009-02-07 20:33:19 UTC (rev 1018) +++ trunk/src/SectorMeshObject.cpp 2009-02-07 22:37:37 UTC (rev 1019) @@ -47,6 +47,11 @@ mainNode_->removeAndDestroyChild( entityScaleNode_->getName() ); } +void SectorMeshObject::reset( ){ + target_ = NULL; + observers_.clear(); +} + void SectorMeshObject::collide( SectorCollisionObject * object ){ std::cout << "SectorMeshObject: " << this->name() << " collide with " << object->rtti() << " " << object->name() << std::endl; Modified: trunk/src/SectorMeshObject.h =================================================================== --- trunk/src/SectorMeshObject.h 2009-02-07 20:33:19 UTC (rev 1018) +++ trunk/src/SectorMeshObject.h 2009-02-07 22:37:37 UTC (rev 1019) @@ -89,6 +89,9 @@ /*! Destroy the object without explosion */ virtual void destroy(); + /*! Reset the object, clear target_ pointer and list of observers_; */ + virtual void reset( ); + protected: Ogre::SceneNode * entityScaleNode_; // Main character node for base size Ogre::SceneNode * entityRotNode_; // Main character node for base rotation Modified: trunk/src/SectorMovableObject.cpp =================================================================== --- trunk/src/SectorMovableObject.cpp 2009-02-07 20:33:19 UTC (rev 1018) +++ trunk/src/SectorMovableObject.cpp 2009-02-07 22:37:37 UTC (rev 1019) @@ -50,6 +50,7 @@ } void SectorMovableObject::reset( ){ + SectorMeshObject::reset(); yaw_ = 0.0; pitch_ = 0.0; roll_ = 0.0; Modified: trunk/src/SectorVesselObject.cpp =================================================================== --- trunk/src/SectorVesselObject.cpp 2009-02-07 20:33:19 UTC (rev 1018) +++ trunk/src/SectorVesselObject.cpp 2009-02-07 22:37:37 UTC (rev 1019) @@ -55,12 +55,8 @@ std::vector < Ogre::Vector3 > engineMountPoints( this->vessel()->engineMountPoints() ); for ( uint i = 0; i < engineMountPoints.size(); i ++ ){ - Ogre::SceneNode * mountPoint = entityRotNode_->createChildSceneNode( name_ + "_EngineMountPoint" + toStr( i ) ); - mountPoint->setPosition( engineMountPoints[ i ] ); - - EngineObject * engine = new EngineObject( this->vessel()->engine() ); + EngineObject * engine = new EngineObject( this->vessel()->engine(), name_ + "_engine_" + toStr( i ), entityRotNode_, engineMountPoints[ i ] ); engines_.push_back( engine ); - engine->mount( this, mountPoint ); } reset(); } @@ -79,6 +75,10 @@ } activeGuns_.clear(); + for ( std::list < EngineObject * >::iterator it = engines_.begin(); it != engines_.end(); it++){ + delete (*it); + } + } void SectorVesselObject::reset( ){ Modified: trunk/src/opengateserver.cpp =================================================================== --- trunk/src/opengateserver.cpp 2009-02-07 20:33:19 UTC (rev 1018) +++ trunk/src/opengateserver.cpp 2009-02-07 22:37:37 UTC (rev 1019) @@ -83,32 +83,32 @@ //** ein bissle mehr verbose output, kommt sp\xE4ter wieder weg.; //** das k\xF6nnte mal vielleicht als option rausreichen, das man wie beim clienten die Wahl hat; //** -M = (withMetaServer = true); - bool withMetaServer = true; + bool withMetaServer = false; std::string servername( "testserver Sim 1" ); - try { - boost::asio::io_service io_service; - io_servicePtr = &io_service; + try { + boost::asio::io_service io_service; + io_servicePtr = &io_service; - if ( withMetaServer ){ - metaPtr = new OpenGate::MetaConnection( io_service, *logMgr ); - int error = 0; + if ( withMetaServer ){ + metaPtr = new OpenGate::MetaConnection( io_service, *logMgr ); + int error = 0; - if ( ( error = metaPtr->add_game_server( servername ) ) < 0 ) { - logMgr->warn( std::string( "Could not add game server " + toStr ( error ) ) ); - } else { - logMgr->info( std::string( "server added to meta server " ) ); - } + if ( ( error = metaPtr->add_game_server( servername ) ) < 0 ) { + logMgr->warn( std::string( "Could not add game server " + toStr ( error ) ) ); + } else { + logMgr->info( std::string( "server added to meta server " ) ); + } - logMgr->info( std::string( "Request game servers from meta server: " ) ); - std::list< std::pair < std::string, std::string > > serverOnline( metaPtr->list_game_servers() ); - for ( std::list< std::pair < std::string, std::string > >::iterator it = serverOnline.begin(); it != serverOnline.end(); it ++ ){ - logMgr->info( it->second + ": " + it->first ); - } - } + logMgr->info( std::string( "Request game servers from meta server: " ) ); + std::list< std::pair < std::string, std::string > > serverOnline( metaPtr->list_game_servers() ); + for ( std::list< std::pair < std::string, std::string > >::iterator it = serverOnline.begin(); it != serverOnline.end(); it ++ ){ + logMgr->info( it->second + ": " + it->first ); + } + } - serverPtr = new Server( io_service, *logMgr ); - io_service.run(); -// } catch ( boost::asio::error & e ) { + serverPtr = new Server( io_service, *logMgr ); + io_service.run(); + //} catch ( boost::asio::error & e ) { // logMgr->fatal( std::string("opengateserver asio exception: " )+ e.what() ); // server_shutdown(); // return EXIT_FAILURE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-02-11 23:59:13
|
Revision: 1028 http://opengate.svn.sourceforge.net/opengate/?rev=1028&view=rev Author: spom_spom Date: 2009-02-11 23:59:10 +0000 (Wed, 11 Feb 2009) Log Message: ----------- internal entity names are now case insensitive, removed some debug msgs. Modified Paths: -------------- trunk/data/gui/config.ini trunk/data/gui/fonts/BlueHighway-12.font trunk/data/gui/fonts/BlueHighway-14.font trunk/data/gui/fonts/BlueHighway-16.font trunk/src/EntityManager.cpp trunk/src/GameStateManager.cpp trunk/src/Moveable.cpp trunk/src/Moveable.h trunk/src/OpenALSoundManager.cpp trunk/src/UnDockedState.cpp Modified: trunk/data/gui/config.ini =================================================================== --- trunk/data/gui/config.ini 2009-02-11 23:50:17 UTC (rev 1027) +++ trunk/data/gui/config.ini 2009-02-11 23:59:10 UTC (rev 1028) @@ -1,5 +1,5 @@ [user] -username: -password: +username: testuser +password: test1 [display] -show startup video: true \ No newline at end of file +show startup video: false \ No newline at end of file Modified: trunk/data/gui/fonts/BlueHighway-12.font =================================================================== --- trunk/data/gui/fonts/BlueHighway-12.font 2009-02-11 23:50:17 UTC (rev 1027) +++ trunk/data/gui/fonts/BlueHighway-12.font 2009-02-11 23:59:10 UTC (rev 1028) @@ -1,2 +1,2 @@ <?xml version="1.0" ?> -<Font Name="BlueHighway-12" Filename="BlueHighway.ttf" Type="FreeType" Size="12" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="true" /> +<Font Name="BlueHighway-12" Filename="BlueHighway.ttf" Type="FreeType" Size="12" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="false" AntiAlias="true" /> Modified: trunk/data/gui/fonts/BlueHighway-14.font =================================================================== --- trunk/data/gui/fonts/BlueHighway-14.font 2009-02-11 23:50:17 UTC (rev 1027) +++ trunk/data/gui/fonts/BlueHighway-14.font 2009-02-11 23:59:10 UTC (rev 1028) @@ -1,2 +1,2 @@ <?xml version="1.0" ?> -<Font Name="BlueHighway-14" Filename="BlueHighway.ttf" Type="FreeType" Size="14" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="true" /> +<Font Name="BlueHighway-14" Filename="BlueHighway.ttf" Type="FreeType" Size="14" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="false" AntiAlias="true" /> Modified: trunk/data/gui/fonts/BlueHighway-16.font =================================================================== --- trunk/data/gui/fonts/BlueHighway-16.font 2009-02-11 23:50:17 UTC (rev 1027) +++ trunk/data/gui/fonts/BlueHighway-16.font 2009-02-11 23:59:10 UTC (rev 1028) @@ -1,2 +1,2 @@ <?xml version="1.0" ?> -<Font Name="BlueHighway-16" Filename="BlueHighway.ttf" Type="FreeType" Size="16" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="true" /> +<Font Name="BlueHighway-16" Filename="BlueHighway.ttf" Type="FreeType" Size="16" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="false" AntiAlias="true"/> Modified: trunk/src/EntityManager.cpp =================================================================== --- trunk/src/EntityManager.cpp 2009-02-11 23:50:17 UTC (rev 1027) +++ trunk/src/EntityManager.cpp 2009-02-11 23:59:10 UTC (rev 1028) @@ -107,8 +107,8 @@ } Entity * EntityManager::entity( const std::string & name ) { - if ( templatesByName_.count( name ) ){ - return templatesByName_[ name ]; + if ( templatesByName_.count( strCopyToLowerCase( name ) ) ){ + return templatesByName_[ strCopyToLowerCase( name ) ]; } else { LogManager::getSingleton().warn( "No entity named: " + name + " registered." ); return NULL; @@ -166,8 +166,9 @@ Ogre::StringVectorPtr files = pArch->find( "*.xml", true, false); for ( unsigned int i = 0; i < (*files).size(); i ++ ){ - if ( (*files)[ i ].rfind( ".mesh.xml" ) == std::string::npos ){ - log_->fout( std::string( "Found ressource: " ) + (*files)[ i ] ); + if ( (*files)[ i ].rfind( ".mesh.xml" ) == std::string::npos && + (*files)[ i ].rfind( ".xml~" ) == std::string::npos ){ + //log_->fout( std::string( "Found ressource: " ) + (*files)[ i ] ); loadAndCreate( (*resourcePaths.begin()) + "/" + resourceName + "/" + (*files)[ i ] ); } } @@ -176,7 +177,7 @@ } Entity * EntityManager::loadAndCreate( const std::string & fileName ){ - log_->fout( "Read equipment: " + fileName ); + //log_->fout( "Read equipment: " + fileName ); TiXmlDocument doc( fileName ); bool loadOkay = doc.LoadFile(); @@ -252,8 +253,8 @@ return NULL; } - if ( templatesByName_.count( entity->name() ) == 0 ){ - templatesByName_[ entity->name() ] = entity; + if ( templatesByName_.count( strCopyToLowerCase( entity->name() ) ) == 0 ){ + templatesByName_[ strCopyToLowerCase( entity->name() ) ] = entity; templatesByID_[ entity->id() ] = entity; factions_.insert( entity->factionName() ); } else { Modified: trunk/src/GameStateManager.cpp =================================================================== --- trunk/src/GameStateManager.cpp 2009-02-11 23:50:17 UTC (rev 1027) +++ trunk/src/GameStateManager.cpp 2009-02-11 23:59:10 UTC (rev 1028) @@ -93,8 +93,8 @@ } if ( resources_.soundManager ) { log_->info( "Shutdown soundmanager." ); - delete resources_.soundManager; - resources_.soundManager = NULL; +// delete resources_.soundManager; +// resources_.soundManager = NULL; } if ( resources_.inputManager ) { log_->info( "Shutdown inputmanager." ); @@ -122,6 +122,24 @@ return true; } +bool GameStateManager::initialiseOgreEngine_( bool dialog ){ + if ( !fileExist( "ogre.cfg" ) ) { + dialog = true; + } + + if ( !dialog ){ + resources_.ogreRoot()->restoreConfig(); + resources_.renderWindow = resources_.ogreRoot()->initialise( true, "OpenGate" ); + return true; + } else { + if ( resources_.ogreRoot()->showConfigDialog() ) { + resources_.renderWindow = resources_.ogreRoot()->initialise( true, "OpenGate" ); + return true; + } + } + return false; +} + bool GameStateManager::initialiseBootstrapResources( ) { log_->info( "load bootstrap resources." ); Ogre::ConfigFile cf; cf.load( "resources.cfg" ); @@ -307,24 +325,6 @@ return true; } -bool GameStateManager::initialiseOgreEngine_( bool dialog ){ - if ( !fileExist( "ogre.cfg" ) ) { - dialog = true; - } - - if ( !dialog ){ - resources_.ogreRoot()->restoreConfig(); - resources_.renderWindow = resources_.ogreRoot()->initialise( true, "OpenGate" ); - return true; - } else { - if ( resources_.ogreRoot()->showConfigDialog() ) { - resources_.renderWindow = resources_.ogreRoot()->initialise( true, "OpenGate" ); - return true; - } - } - return false; -} - bool GameStateManager::initialiseOgreResources( ) { // Load resource paths from config file Ogre::ConfigFile cf; cf.load( "resources.cfg" ); @@ -352,12 +352,11 @@ } Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup( "Opengate" ); - std::cout << "Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup( Opengate ); " << std::endl; Ogre::ResourceGroupManager::ResourceDeclarationList li = Ogre::ResourceGroupManager::getSingleton().getResourceDeclarationList( "Opengate" ); - std::cout << li.size() << std::endl; +/* std::cout << li.size() << std::endl; for ( std::list<Ogre::ResourceGroupManager::ResourceDeclaration>::iterator it = li.begin(); it != li.end(); it ++ ){ std::cout << (*it).resourceName << std::endl; - } + }*/ return true; } Modified: trunk/src/Moveable.cpp =================================================================== --- trunk/src/Moveable.cpp 2009-02-11 23:50:17 UTC (rev 1027) +++ trunk/src/Moveable.cpp 2009-02-11 23:59:10 UTC (rev 1028) @@ -35,9 +35,9 @@ void Movable::readPropertiesFromXML( TiXmlHandle & hRoot ){ MeshEntity::readPropertiesFromXML( hRoot ); - readXMLNode< float >( hRoot, "yaw", this, &OpenGate::Movable::setYaw, false ); - readXMLNode< float >( hRoot, "pitch", this, &OpenGate::Movable::setPitch, false ); - readXMLNode< float >( hRoot, "roll", this, &OpenGate::Movable::setRoll, false ); + readXMLNode< float >( hRoot, "yaw maximum_yaw", this, &OpenGate::Movable::setYaw, false ); + readXMLNode< float >( hRoot, "pitch maximum_pitch", this, &OpenGate::Movable::setPitch, false ); + readXMLNode< float >( hRoot, "roll maximum_roll", this, &OpenGate::Movable::setRoll, false ); readXMLNode< Uint32 >( hRoot, "armor", this, &OpenGate::Movable::setArmor, false ); readXMLNode< float >( hRoot, "dragfactor drag_factor", this, &OpenGate::Movable::setDragFactor, false ); } Modified: trunk/src/Moveable.h =================================================================== --- trunk/src/Moveable.h 2009-02-11 23:50:17 UTC (rev 1027) +++ trunk/src/Moveable.h 2009-02-11 23:59:10 UTC (rev 1028) @@ -36,7 +36,7 @@ inline void setArmor( Uint32 armor ){ armor_ = armor * 1000; } inline Uint32 armor( ) const { return armor_; } - //** degree /second + /*! degree /second */ inline void setYaw( float yaw ){ yaw_ = yaw; if ( yaw_ < 1.0 ) yaw_ = 1000.0 * ( 180.0 * yaw_ ) / 3.141592; } @@ -50,6 +50,7 @@ inline void setRoll( float roll ){ roll_ = roll; if ( roll_ < 1.0 ) roll_ = 1000.0 * ( 180.0 * roll_ ) / 3.141592; } + inline float roll( ) const { return roll_; } inline void setDragFactor( float drag ){ dragFactor_ = drag; } Modified: trunk/src/OpenALSoundManager.cpp =================================================================== --- trunk/src/OpenALSoundManager.cpp 2009-02-11 23:50:17 UTC (rev 1027) +++ trunk/src/OpenALSoundManager.cpp 2009-02-11 23:59:10 UTC (rev 1028) @@ -281,7 +281,7 @@ stop(); empty_(); - alDeleteSources(1, & source_ ); +// alDeleteSources(1, & source_ ); //** valgrind says:; // Invalid read of size 4 // ==10954== at 0x6129E42: (within /usr/lib64/libopenal.so.0.0.0) Modified: trunk/src/UnDockedState.cpp =================================================================== --- trunk/src/UnDockedState.cpp 2009-02-11 23:50:17 UTC (rev 1027) +++ trunk/src/UnDockedState.cpp 2009-02-11 23:59:10 UTC (rev 1028) @@ -459,13 +459,13 @@ if ( !configMode_ ){ if ( sector_->avatarObject() != NULL ){ switch ( id ){ - case 0: + case OIS::MB_Left: sector_->avatarObject()->setFirePressed( true ); break; - case 1: + case OIS::MB_Middle: sector_->avatarObject()->fireMissile( ResourceManager::getSingleton().entityManager->missile( "Firefly" ), radar_->target() ); break; - case 2: + case OIS::MB_Right: sector_->avatarObject()->fireMissile( ResourceManager::getSingleton().entityManager->missile( "bee" ), radar_->target() ); break; default: @@ -481,7 +481,7 @@ bool UnDockedState::mouseReleased( const OIS::MouseEvent &e , OIS::MouseButtonID id ){ if ( !configMode_ ){ if ( sector_->avatarObject() != NULL ){ - if ( id == 0 ){ + if ( id == OIS::MB_Left ){ sector_->avatarObject()->setFirePressed( false); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-02-14 19:11:11
|
Revision: 1031 http://opengate.svn.sourceforge.net/opengate/?rev=1031&view=rev Author: spom_spom Date: 2009-02-14 19:11:02 +0000 (Sat, 14 Feb 2009) Log Message: ----------- fixed a couple of mem-leaks, deactivate soundmanager, add planet and ecliptic plane Modified Paths: -------------- trunk/data/materials/gradientshader.cg trunk/src/AiManager.cpp trunk/src/Entity.cpp trunk/src/Entity.h trunk/src/GameStateManager.cpp trunk/src/KeyMap.cpp trunk/src/KeyMap.h trunk/src/Makefile.am trunk/src/OpcodeWrapper.cpp trunk/src/OpenALSoundManager.cpp trunk/src/OpenALSoundManager.h trunk/src/Opengate.h trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorBaseObject.h trunk/src/UnDockedState.cpp trunk/src/UnDockedState.h trunk/src/Vessel.cpp trunk/src/Vessel.h trunk/src/opengateclient.cpp Removed Paths: ------------- trunk/src/Planet.cpp trunk/src/Planet.h Modified: trunk/data/materials/gradientshader.cg =================================================================== --- trunk/data/materials/gradientshader.cg 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/data/materials/gradientshader.cg 2009-02-14 19:11:02 UTC (rev 1031) @@ -12,6 +12,7 @@ ) { // Get the custom parameters + //float objectradius = sqrt(customParamRadius.x*customParamRadius.x*+ customParamRadius.y*customParamRadius.y+customParamRadius.z*customParamRadius.z); float objectradius = customParamRadius.x; // calculate output position Modified: trunk/src/AiManager.cpp =================================================================== --- trunk/src/AiManager.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/AiManager.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -113,6 +113,7 @@ AiObject * ai = createAiObject( name ); + //** please ensure delete of the vessel after cleaning this code SectorVesselObject * obj = dynamic_cast < UnDockedState *>(resources_->gameStateRoot->activeState() )->sector()->createVesselObject( new Vessel( *resources_->entityManager->vessel( "apteryx" ) ) ); Modified: trunk/src/Entity.cpp =================================================================== --- trunk/src/Entity.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/Entity.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -54,6 +54,10 @@ setFactionName_( ResourceManager::getSingleton().factionName( factionID_ ) ); } +Entity::~Entity(){ + +} + void Entity::readPropertiesFromXML( TiXmlHandle & hRoot ){ readXMLNode< std::string >( hRoot, "name_"+ ResourceManager::getSingleton().languageSuffix() + " name_en name", this, &OpenGate::Entity::setName, true ); @@ -142,7 +146,9 @@ baseScale_ = 0.0; } -MeshEntity::~MeshEntity(){} +MeshEntity::~MeshEntity(){ + if ( !pMesh_.isNull() ) Ogre::MeshManager::getSingleton().unload( pMesh_->getName() ); +} void MeshEntity::readPropertiesFromXML( TiXmlHandle & hRoot ){ Entity::readPropertiesFromXML( hRoot ); Modified: trunk/src/Entity.h =================================================================== --- trunk/src/Entity.h 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/Entity.h 2009-02-14 19:11:02 UTC (rev 1031) @@ -72,7 +72,7 @@ public: Entity(); - virtual ~Entity(){ } + virtual ~Entity(); virtual EntityType entityType() const { return rtti_; } Modified: trunk/src/GameStateManager.cpp =================================================================== --- trunk/src/GameStateManager.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/GameStateManager.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -63,9 +63,6 @@ } GameStateManager::~GameStateManager( ){ -// delete resources_->guiSystem; -// delete resources_->guiRenderer; - while ( !stateStack_.empty() ){ cleanup_( stateStack_.back() ); stateStack_.back()->exit(); @@ -75,51 +72,60 @@ states_.back().state->destroy(); states_.pop_back(); } - - if ( resources_.aiManager ) { - log_->info( "Shutdown ai manager." ); - delete resources_.aiManager; - resources_.aiManager = NULL; - } - if ( resources_.console ){ - log_->info( "Shutdown console." ); - delete resources_.console; - resources_.console = NULL; - } - if ( resources_.entityManager ){ - log_->info( "Shutdown entitymanager." ); - delete resources_.entityManager; - resources_.entityManager = NULL; - } - if ( resources_.soundManager ) { - log_->info( "Shutdown soundmanager." ); -// delete resources_.soundManager; -// resources_.soundManager = NULL; - } - if ( resources_.inputManager ) { - log_->info( "Shutdown inputmanager." ); - delete resources_.inputManager; - resources_.inputManager = NULL; - } - - log_->info( "Shutdown renderWindow." ); - if ( resources_.renderWindow ) delete resources_.renderWindow; - log_->info( "Shutdown ogreRoot." ); - //** segfault caused by destroying ShipConfigDialog::ceguiTex_ - // if ( resources_.ogreRoot ) delete resources_.ogreRoot; + if ( resources_.avatar ) delete resources_.avatar; + + if ( resources_.collisionManager ) delete resources_.collisionManager; + + if ( configDialog_ ) delete configDialog_; + + if ( resources_.aiManager ) { + log_->info( "Shutdown ai manager." ); + delete resources_.aiManager; + resources_.aiManager = NULL; + } + if ( resources_.console ){ + log_->info( "Shutdown console." ); + delete resources_.console; + resources_.console = NULL; + } + if ( resources_.entityManager ){ + log_->info( "Shutdown entitymanager." ); + delete resources_.entityManager; + resources_.entityManager = NULL; + } + if ( resources_.soundManager ) { + log_->info( "Shutdown soundmanager." ); + delete resources_.soundManager; + resources_.soundManager = NULL; + } + if ( resources_.guiRenderer ) { + log_->info( "Shutdown CEGUI manager." ); + delete resources_.guiSystem; + //delete resources_.guiRenderer; + } + if ( resources_.inputManager ) { + log_->info( "Shutdown inputmanager." ); + delete resources_.inputManager; + resources_.inputManager = NULL; + } + if ( resources_.ogreRoot() ) { + log_->info( "Shutdown ogreRoot." ); + Ogre::Root * root = resources_.ogreRoot(); + delete root; + } } bool GameStateManager::initialiseBootstrap( bool dialog ){ - resources_.setOgreRoot( *new Ogre::Root ); - resources_.gameStateRoot = this; + resources_.setOgreRoot( *new Ogre::Root ); + resources_.gameStateRoot = this; - if ( !initialiseOgreEngine_( dialog ) ) { - log_->fatal( "Cannot initialize ogre engine." ); - return false; - } - initialiseBootstrapResources(); - initLoadingVector(); - return true; + if ( !initialiseOgreEngine_( dialog ) ) { + log_->fatal( "Cannot initialize ogre engine." ); + return false; + } + initialiseBootstrapResources(); + initLoadingVector(); + return true; } bool GameStateManager::initialiseOgreEngine_( bool dialog ){ @@ -262,7 +268,7 @@ } bool GameStateManager::initialiseSoundManager(){ - resources_.soundManager = new OpenALSoundManager( ); + resources_.soundManager = new OpenALSoundManager( true ); resources_.soundManager->loadRessourceNames( resources_.findFullFileName( "sounds.xml" ) ); return true; } Modified: trunk/src/KeyMap.cpp =================================================================== --- trunk/src/KeyMap.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/KeyMap.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -28,6 +28,9 @@ KeyMap::KeyMap() : modifier_( KEY_NONE ){ } +KeyMap::~KeyMap(){ +} + void KeyMap::setDefaults(){ /*! Actions for undocked state */ unDockedActionMap_[ keycode( 70 ) ] = &UnDockedState::keyActionSwitchMinMaxConsole; @@ -89,6 +92,7 @@ unDockedActionMap_[ keycode( OIS::KC_F8 ) ] = &UnDockedState::keyActionAvatarSelfDestruct_DEV; unDockedActionMap_[ keycode( OIS::KC_F7 ) ] = &UnDockedState::keyActionSpawnAi_DEV; unDockedActionMap_[ keycode( OIS::KC_I, KEY_CONTROL ) ] = &UnDockedState::keyActionShowInfos_DEV; + unDockedActionMap_[ keycode( OIS::KC_E, KEY_SHIFT ) ] = &UnDockedState::keyActionShowEcliptic_DEV; } bool(UnDockedState::*KeyMap::unDockedKeyAction( const OIS::KeyEvent & e ))(bool) { Modified: trunk/src/KeyMap.h =================================================================== --- trunk/src/KeyMap.h 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/KeyMap.h 2009-02-14 19:11:02 UTC (rev 1031) @@ -21,8 +21,8 @@ #ifndef _OPENGATE_KEYMAP__H #define _OPENGATE_KEYMAP__H -#include "Opengate.h" - +#include "Opengate.h" + #include <map> #include <sys/types.h> //#include "InputManager.h" @@ -37,9 +37,10 @@ class KeyMap{ public: + KeyMap(); + + ~KeyMap(); - KeyMap(); - void setDefaults(); bool (UnDockedState::*unDockedKeyAction( const OIS::KeyEvent & e ))( bool ); Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/Makefile.am 2009-02-14 19:11:02 UTC (rev 1031) @@ -70,8 +70,6 @@ Opengate.h \ OpenALSoundManager.h \ OpenALSoundManager.cpp \ - Planet.h \ - Planet.cpp \ Projectile.h \ Projectile.cpp \ RadarObject.h \ @@ -92,6 +90,8 @@ SectorChildObject.cpp \ SectorCollisionObject.h \ SectorCollisionObject.cpp \ + SectorEnvironmentObject.h \ + SectorEnvironmentObject.cpp \ SectorExplosionObject.h \ SectorExplosionObject.cpp \ SectorMeshObject.h \ Modified: trunk/src/OpcodeWrapper.cpp =================================================================== --- trunk/src/OpcodeWrapper.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/OpcodeWrapper.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -137,7 +137,6 @@ if ( obj && active_ ){ OgreOpcode::ICollisionShape * shape = obj->getShape(); collideInSectorContext_->destroyObject( obj ); - collisionManager_->detachShape( shape ); collisionManager_->destroyShape( shape ); } } Modified: trunk/src/OpenALSoundManager.cpp =================================================================== --- trunk/src/OpenALSoundManager.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/OpenALSoundManager.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -44,6 +44,7 @@ #define STREAM_BUFFER_SIZE (4096 * 100) namespace OpenGate{ + void OpenALSoundSourceDummy::showInfos(){ LogManager::getSingleton().info( "Audio info: dummy " + name_ + " installed " ); } @@ -452,47 +453,47 @@ template<> OpenALSoundManager * Ogre::Singleton< OpenALSoundManager >::ms_Singleton = 0; -OpenALSoundManager::OpenALSoundManager( ){ - maxSources_ = 128; - listener_ = NULL; - oggVorbisExtension_ = false; - mp3Extension_ = false; +OpenALSoundManager::OpenALSoundManager( bool dummy ){ + maxSources_ = 128; + listener_ = NULL; + oggVorbisExtension_ = false; + mp3Extension_ = false; - log_ = LogManager::getSingletonPtr(); - haveSoundDevice_ = true; + log_ = LogManager::getSingletonPtr(); + haveSoundDevice_ = true; - init(); - Ogre::Root::getSingleton().addFrameListener( this ); + init( dummy ); + Ogre::Root::getSingleton().addFrameListener( this ); } OpenALSoundManager::~OpenALSoundManager(){ - Ogre::Root::getSingleton().removeFrameListener( this ); + Ogre::Root::getSingleton().removeFrameListener( this ); - for ( std::map< std::string, OpenALSoundSource * >::iterator it = mapSoundSources_.begin(); it != mapSoundSources_.end(); ){ - destroySoundSource( it++->second ); - } + for ( std::map< std::string, OpenALSoundSource * >::iterator it = mapSoundSources_.begin(); it != mapSoundSources_.end(); ){ + destroySoundSource( it++->second ); + } - if ( listener_ ) delete listener_; + if ( listener_ ) delete listener_; - if ( haveSoundDevice_ ){ - ALCcontext *context = alcGetCurrentContext(); - ALCdevice *device = alcGetContextsDevice( context ); - alcMakeContextCurrent( NULL ); - alcDestroyContext( context ); - alcCloseDevice( device ); - } + if ( haveSoundDevice_ ){ + ALCcontext *context = alcGetCurrentContext(); + ALCdevice *device = alcGetContextsDevice( context ); + alcMakeContextCurrent( NULL ); + alcDestroyContext( context ); + alcCloseDevice( device ); + } } bool OpenALSoundManager::frameStarted( const Ogre::FrameEvent & evt ){ - for ( std::map< std::string, OpenALSoundSource * >::iterator it = mapSoundSources_.begin(); - it != mapSoundSources_.end(); it++){ - it->second->update(); - } - return true; + for ( std::map< std::string, OpenALSoundSource * >::iterator it = mapSoundSources_.begin(); + it != mapSoundSources_.end(); it++){ + it->second->update(); + } + return true; } -bool OpenALSoundManager::init(){ - log_->info( "Initialize Soundmanager ..." ); +bool OpenALSoundManager::init( bool dummy ){ + log_->info( "Initialize Soundmanager ..." ); // if ( alIsExtensionPresent( "AL_EXT_vorbis" ) == AL_TRUE ){ // oggVorbisExtension_ = true; @@ -544,36 +545,36 @@ // } // deviceSpecifiers += strlen( deviceSpecifiers ) + 1; // } -bool disable_ = false; -ALCdevice * device = NULL; - if ( !disable_ ){ - device = alcOpenDevice( NULL ); - // Device = alcOpenDevice((ALubyte*)"DirectSound3D"); - } + + ALCdevice * device = NULL; + if ( !dummy ){ + device = alcOpenDevice( NULL ); + // Device = alcOpenDevice((ALubyte*)"DirectSound3D"); + } - if ( !device ){ - log_->warn( "No sound device detected." ); - haveSoundDevice_ = false; - } + if ( !device ){ + log_->warn( "No sound device detected." ); + haveSoundDevice_ = false; + } - if ( haveSoundDevice_ ){ - log_->info( "Choosing: " + Ogre::String( alcGetString( device, ALC_DEVICE_SPECIFIER) ) ); - ALCcontext * context = alcCreateContext( device, NULL ); + if ( haveSoundDevice_ ){ + log_->info( "Choosing: " + Ogre::String( alcGetString( device, ALC_DEVICE_SPECIFIER) ) ); + ALCcontext * context = alcCreateContext( device, NULL ); - if ( !context ){ - log_->warn( "Can not create sound context." ); - return false; - } + if ( !context ){ + log_->warn( "Can not create sound context." ); + return false; + } - alcMakeContextCurrent( context ); - if ( checkOpenALError( "OpenALSoundManager::init::alcMakeContextCurrent" ) ) return false; + alcMakeContextCurrent( context ); + if ( checkOpenALError( "OpenALSoundManager::init::alcMakeContextCurrent" ) ) return false; - maxSources_ = getMaxSources_(); - } + maxSources_ = getMaxSources_(); + } - listener_ = new OpenALListener( this, !haveSoundDevice_ ); + listener_ = new OpenALListener( this, !haveSoundDevice_ ); - return true; + return true; } void OpenALSoundManager::loadRessourceNames( const std::string & fileName ){ @@ -616,28 +617,28 @@ OpenALSoundSource * OpenALSoundManager::createSoundSource( const std::string & fileName, const std::string & name, bool loop, bool stream ){ - OpenALSoundSource * sound = NULL; + OpenALSoundSource * sound = NULL; - if ( mapSoundSources_.count( name ) ){ - log_->warn( "Sound with name: " + name + " allready registered." ); - mapSoundSources_[ name ]; - } + if ( mapSoundSources_.count( name ) ){ + log_->warn( "Sound with name: " + name + " allready registered." ); + mapSoundSources_[ name ]; + } - if ( haveSoundDevice_ ){ - if ( stream ){ - log_->info( "create sound stream: " + name ); - sound = new OpenALOggStreamSource( this, name ); + if ( haveSoundDevice_ ){ + if ( stream ){ + log_->info( "create sound stream: " + name ); + sound = new OpenALOggStreamSource( this, name ); + } else { + sound = new OpenALSoundSource( this, name ); + } } else { - sound = new OpenALSoundSource( this, name ); + sound = new OpenALSoundSourceDummy( this, name ); } - } else { - sound = new OpenALSoundSourceDummy( this, name ); - } - sound->open( fileName ); - sound->showInfos( ); - mapSoundSources_[ name ] = sound; - return sound; + sound->open( fileName ); + sound->showInfos( ); + mapSoundSources_[ name ] = sound; + return sound; } OpenALSoundSource * OpenALSoundManager::createSoundSourceFromRessource( const std::string & ressourceName, @@ -647,20 +648,20 @@ } void OpenALSoundManager::destroySoundSource( OpenALSoundSource * sound ){ - if ( sound ){ - if ( sound->release() ){ - mapSoundSources_.erase( sound->name() ); - delete sound; + if ( sound ){ + if ( sound->release() ){ + mapSoundSources_.erase( sound->name() ); + delete sound; + } } - } } void OpenALSoundManager::destroySoundSource( const std::string & name ){ - if ( mapSoundSources_.count( name ) ) { - destroySoundSource( mapSoundSources_[ name ] ); - } else { - log_->warn( "OpenALSoundManager::destroySoundSource: ressource with name " + name + " does not exist." ); - } + if ( mapSoundSources_.count( name ) ) { + destroySoundSource( mapSoundSources_[ name ] ); + } else { + log_->warn( "OpenALSoundManager::destroySoundSource: ressource with name " + name + " does not exist." ); + } } bool OpenALSoundManager::checkOpenAlutError( const std::string & str ){ Modified: trunk/src/OpenALSoundManager.h =================================================================== --- trunk/src/OpenALSoundManager.h 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/OpenALSoundManager.h 2009-02-14 19:11:02 UTC (rev 1031) @@ -24,9 +24,9 @@ #include <string> #include <iostream> #include <map> - -#include "Opengate.h" +#include "Opengate.h" + #include <OgreVector3.h> #include <OgreSingleton.h> #include <OgreFrameListener.h> @@ -174,28 +174,28 @@ /*! OpenALListener, there is just one. YOU! respectivly your avatar. */ class OpenALListener{ public: - OpenALListener( OpenALSoundManager * soundMgr, bool dummy = false); - ~OpenALListener(); + OpenALListener( OpenALSoundManager * soundMgr, bool dummy = false); + ~OpenALListener(); - bool setPosition( float x, float y, float z ); - bool setPosition( const Ogre::Vector3 & pos); + bool setPosition( float x, float y, float z ); + bool setPosition( const Ogre::Vector3 & pos); - bool setVelocity( float x, float y, float z ); - bool setVelocity( const Ogre::Vector3 & vel); + bool setVelocity( float x, float y, float z ); + bool setVelocity( const Ogre::Vector3 & vel); - bool setOrientation( float xf, float yf, float zf, float xu, float yu, float zu ); - bool setOrientation( const Ogre::Vector3 & front, const Ogre::Vector3 & up); + bool setOrientation( float xf, float yf, float zf, float xu, float yu, float zu ); + bool setOrientation( const Ogre::Vector3 & front, const Ogre::Vector3 & up); - void reset( ); + void reset( ); protected: - OpenALSoundManager * soundMgr_; - Ogre::Vector3 position_; - Ogre::Vector3 velocity_; - Ogre::Vector3 directionFront_; - Ogre::Vector3 directionUp_; - float orientation_[ 6 ]; - bool dummy_; + OpenALSoundManager * soundMgr_; + Ogre::Vector3 position_; + Ogre::Vector3 velocity_; + Ogre::Vector3 directionFront_; + Ogre::Vector3 directionUp_; + float orientation_[ 6 ]; + bool dummy_; }; @@ -209,13 +209,13 @@ class OpenALSoundManager : public Ogre::FrameListener, public Ogre::Singleton< OpenALSoundManager >{ public: - OpenALSoundManager( ); + OpenALSoundManager( bool dummy = false ); virtual ~OpenALSoundManager(); virtual bool frameStarted( const Ogre::FrameEvent & evt ); - bool init(); + bool init( bool dummy ); void loadRessourceNames( const std::string & fileName ); Modified: trunk/src/Opengate.h =================================================================== --- trunk/src/Opengate.h 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/Opengate.h 2009-02-14 19:11:02 UTC (rev 1031) @@ -41,15 +41,16 @@ #define SECTOR_BEACON_PAD_OBJECT_RTTI 4 #define SECTOR_CHILD_OBJECT_RTTI 5 #define SECTOR_COLLISION_OBJECT_RTTI 6 -#define SECTOR_EXPLOSION_OBJECT_RTTI 7 -#define SECTOR_MESH_OBJECT_RTTI 8 -#define SECTOR_MISSILE_OBJECT_RTTI 9 -#define SECTOR_MOVABLE_OBJECT_RTTI 10 -#define SECTOR_PAD_OBJECT_RTTI 11 -#define SECTOR_PROJECTILE_OBJECT_RTTI 12 -#define SECTOR_STATION_OBJECT_RTTI 13 -#define SECTOR_STATION_PAD_OBJECT_RTTI 14 -#define SECTOR_VESSEL_OBJECT_RTTI 15 +#define SECTOR_ENVIRONMENT_OBJECT_RTTI 7 +#define SECTOR_EXPLOSION_OBJECT_RTTI 8 +#define SECTOR_MESH_OBJECT_RTTI 9 +#define SECTOR_MISSILE_OBJECT_RTTI 10 +#define SECTOR_MOVABLE_OBJECT_RTTI 11 +#define SECTOR_PAD_OBJECT_RTTI 12 +#define SECTOR_PROJECTILE_OBJECT_RTTI 13 +#define SECTOR_STATION_OBJECT_RTTI 14 +#define SECTOR_STATION_PAD_OBJECT_RTTI 15 +#define SECTOR_VESSEL_OBJECT_RTTI 16 #define SECTOROBJECTENVIRONMENT_RTTI 1000010 #define PROJECTILE_RTTI 100001 @@ -68,9 +69,9 @@ class AiManager; class Avatar; -class BaseObject; +class BaseObject; class Console; -class DockedState; +class DockedState; class UnDockedState; class Gun; @@ -96,11 +97,14 @@ class SectorBeaconPadObject; class SectorChildObject; class SectorCollisionObject; +class SectorEclipticObject; +class SectorEnvironmentObject; class SectorExplosionObject; class SectorMeshObject; class SectorMissileObject; class SectorMovableObject; class SectorPadObject; +class SectorPlanetObject; class SectorProjectileObject; class SectorStationObject; class SectorStationPadObject; @@ -128,31 +132,31 @@ class NetworkClient; class Vessel; - -template < class Class, typename ReturnType, typename Parameter > class SingularCallBack{ -public: - typedef ReturnType ( Class::*Method )( Parameter ); - SingularCallBack( Class * class_instance, Method method ) : class_instance_( class_instance ), method_( method ) { } - - ReturnType operator()( Parameter parameter ) { return ( class_instance_->*method_ )( parameter ); } - ReturnType execute( Parameter parameter ){ return operator()( parameter ); } -private: - Class * class_instance_; - Method method_; -}; - -template < class Object, typename returnT, typename Args > class memberBind { -public: - typedef returnT( Object::*F )( Args ); - memberBind( F function, Object * object) : function_( function ), object_( object ) {} - - returnT operator()( Args args ) const { return ( object_->*function_ )( args ); } -protected: - F function_; - Object object_; -}; - +template < class Class, typename ReturnType, typename Parameter > class SingularCallBack{ +public: + typedef ReturnType ( Class::*Method )( Parameter ); + SingularCallBack( Class * class_instance, Method method ) : class_instance_( class_instance ), method_( method ) { } + + ReturnType operator()( Parameter parameter ) { return ( class_instance_->*method_ )( parameter ); } + ReturnType execute( Parameter parameter ){ return operator()( parameter ); } +private: + Class * class_instance_; + Method method_; +}; + +template < class Object, typename returnT, typename Args > class memberBind { +public: + typedef returnT( Object::*F )( Args ); + memberBind( F function, Object * object) : function_( function ), object_( object ) {} + + returnT operator()( Args args ) const { return ( object_->*function_ )( args ); } +protected: + F function_; + Object object_; +}; + + } // namespace OpenGate #endif // _OPENGATE_OPENGATE__H Deleted: trunk/src/Planet.cpp =================================================================== --- trunk/src/Planet.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/Planet.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -1,238 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#include "Planet.h" - -#include <OgreSceneManager.h> -#include <OgreEntity.h> -#include <OgreSceneNode.h> -#include <OgreMeshManager.h> -#include <OgreSubMesh.h> -#include <OgreVector3.h> -#include <OgreLight.h> - -namespace OpenGate{ - -Planet::Planet( const std::string & name, Ogre::SceneManager * SceneMgr, const Ogre::Vector3 & relPos, - Ogre::Real radius, int segments ) - : name_( name ), sceneMgr_( SceneMgr ){ - - planetNode_ = NULL; - planetCloudNode_ = NULL; - planetCloudEntity_ = NULL; - planetEntity_ = NULL; - light_ = NULL; - - createSphere_( name + "/Mesh", radius, segments, segments ); - planetNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode(name); - - planetEntity_ = sceneMgr_->createEntity( name, name + "/Mesh" ); - planetEntity_->setMaterialName( "Planet" ); - - planetNode_->attachObject( planetEntity_ ); - planetNode_->setPosition( relPos ); - //planetNode_->pitch( Ogre::Degree(30) ); - - planetCloudNode_ = planetNode_->createChildSceneNode( planetNode_->getName() + "/cloud" ); - - planetCloudEntity_ = planetEntity_->clone( planetCloudNode_->getName() ); - planetCloudEntity_->setMaterialName( "Planet/Cloud" ); - - planetCloudNode_->attachObject( planetCloudEntity_ ); - planetCloudNode_->scale(1.015, 1.015, 1.015); - - light_ = sceneMgr_->createLight( name + "-light"); - light_->setDiffuseColour( 0.1, 0.1, 0.1 ); - light_->setSpecularColour( 0.4, 0.4, 0.4 ); - planetNode_->attachObject( light_ ); - - this->lighting( false ); -} - -Planet::~Planet( ){ - if ( planetNode_ ) { - if ( light_ ){ - planetNode_->detachObject( light_ ); - sceneMgr_->destroyLight( light_->getName() ); - } - if ( planetCloudNode_ ){ - if ( planetCloudEntity_ ){ - planetCloudNode_->detachObject( planetCloudEntity_ ); - sceneMgr_->destroyEntity( planetCloudEntity_ ); - } - planetNode_->removeAndDestroyChild( planetCloudNode_->getName() ); - } - if ( planetEntity_ ){ - Ogre::MeshManager::getSingleton().remove( name_ + "/Mesh" ); - planetNode_->detachObject( planetEntity_ ); - sceneMgr_->destroyEntity( planetEntity_ ); - } - sceneMgr_->getRootSceneNode()->removeAndDestroyChild( planetNode_->getName() ); - } -} - -void Planet::update( float elapsedTime ){ - planetNode_->yaw( Ogre::Degree( 0.2 * elapsedTime ) ); - planetCloudNode_->yaw( Ogre::Degree( 0.1 * elapsedTime ) ); -} - -void Planet::lighting( bool on ){ - light_->setVisible( on ); -} - -void Planet::createSphere_( const std::string & strName, const float r, const int nRings, const int nSegments ){ - Ogre::MeshPtr pSphere = Ogre::MeshManager::getSingleton().createManual(strName, - Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); - Ogre::SubMesh *pSphereVertex = pSphere->createSubMesh(); - - pSphere->sharedVertexData = new Ogre::VertexData(); - Ogre::VertexData* vertexData = pSphere->sharedVertexData; - - // define the vertex format - Ogre::VertexDeclaration* vertexDecl = vertexData->vertexDeclaration; - size_t currOffset = 0; - // positions - vertexDecl->addElement(0, currOffset, Ogre::VET_FLOAT3, Ogre::VES_POSITION); - currOffset += Ogre::VertexElement::getTypeSize(Ogre::VET_FLOAT3); - // normals - vertexDecl->addElement(0, currOffset, Ogre::VET_FLOAT3, Ogre::VES_NORMAL); - currOffset += Ogre::VertexElement::getTypeSize(Ogre::VET_FLOAT3); - // two dimensional texture coordinates - vertexDecl->addElement(0, currOffset, Ogre::VET_FLOAT2, Ogre::VES_TEXTURE_COORDINATES, 0); - currOffset += Ogre::VertexElement::getTypeSize(Ogre::VET_FLOAT2); - - // allocate the vertex buffer - vertexData->vertexCount = (nRings + 1) * (nSegments+1); - Ogre::HardwareVertexBufferSharedPtr vBuf = Ogre::HardwareBufferManager::getSingleton().createVertexBuffer( vertexDecl->getVertexSize(0), vertexData->vertexCount, - Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, false); - Ogre::VertexBufferBinding* binding = vertexData->vertexBufferBinding; - binding->setBinding(0, vBuf); - float* pVertex = static_cast<float*>(vBuf->lock(Ogre::HardwareBuffer::HBL_DISCARD)); - - // allocate index buffer - pSphereVertex->indexData->indexCount = 6 * nRings * (nSegments + 1); - pSphereVertex->indexData->indexBuffer = Ogre::HardwareBufferManager::getSingleton().createIndexBuffer( - Ogre::HardwareIndexBuffer::IT_16BIT, pSphereVertex->indexData->indexCount, - Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, false); - Ogre::HardwareIndexBufferSharedPtr iBuf = pSphereVertex->indexData->indexBuffer; - unsigned short* pIndices = static_cast<unsigned short*>(iBuf->lock(Ogre::HardwareBuffer::HBL_DISCARD)); - - float fDeltaRingAngle = (Ogre::Math::PI / nRings); - float fDeltaSegAngle = (2.0 * Ogre::Math::PI / nSegments); - unsigned short wVerticeIndex = 0 ; - - // Generate the group of rings for the sphere - for ( int ring = 0; ring <= nRings; ring++ ) { - float r0 = r * sinf (ring * fDeltaRingAngle); - float y0 = r * cosf (ring * fDeltaRingAngle); - - // Generate the group of segments for the current ring - for (int seg = 0; seg <= nSegments; seg++) { - float x0 = r0 * sinf(seg * fDeltaSegAngle); - float z0 = r0 * cosf(seg * fDeltaSegAngle); - - // Add one vertex to the strip which makes up the sphere - *pVertex++ = x0; - *pVertex++ = y0; - *pVertex++ = z0; - - Ogre::Vector3 vNormal = Ogre::Vector3(x0, y0, z0).normalisedCopy(); - *pVertex++ = vNormal.x; - *pVertex++ = vNormal.y; - *pVertex++ = vNormal.z; - - *pVertex++ = (float) seg / (float) nSegments; - *pVertex++ = (float) ring / (float) nRings; - - if (ring != nRings) { - // each vertex (except the last) has six indices pointing to it - *pIndices++ = wVerticeIndex + nSegments + 1; - *pIndices++ = wVerticeIndex; - *pIndices++ = wVerticeIndex + nSegments; - *pIndices++ = wVerticeIndex + nSegments + 1; - *pIndices++ = wVerticeIndex + 1; - *pIndices++ = wVerticeIndex; - wVerticeIndex ++; - } - }; // end for seg - } // end for ring - - // Unlock - vBuf->unlock(); - iBuf->unlock(); - // Generate face list - pSphereVertex->useSharedVertices = true; - - // the original code was missing this line: - pSphere->_setBounds( Ogre::AxisAlignedBox( Ogre::Vector3(-r, -r, -r), Ogre::Vector3(r, r, r) ), false ); - pSphere->_setBoundingSphereRadius( r ); - // this line makes clear the mesh is loaded (avoids memory leaks) - pSphere->load(); - - Ogre::MeshPtr pMesh = Ogre::MeshManager::getSingleton().load( strName, - Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, - Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, true, true); - unsigned short src, dest; - - if ( !pMesh->suggestTangentVectorBuildParams( Ogre::VES_TANGENT, src, dest) ) { - pMesh->buildTangentVectors( Ogre::VES_TANGENT, src, dest ); - } -} - -} // namespace OpenGate - -// if ( !1 ) { -// planetNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( "PlanetNode" ); -// -// Ogre::ManualObject * planet = sceneMgr_->createManualObject( "Planet" ); -// // planet->setUseIdentityProjection( true ); -// // planet->setUseIdentityView( true ); -// -// planet->begin( "OpenGate/RedPlanet", Ogre::RenderOperation::OT_TRIANGLE_LIST); -// planet->position( Ogre::Vector3( -1.0, -1.0, 200.0 ) ); -// planet->textureCoord( 0, 0 ); -// planet->position( Ogre::Vector3( 1.0, -1.0, 200.0 ) ); -// planet->textureCoord( 1, 0 ); -// planet->position( Ogre::Vector3( 1.0, 1.0, 200.0 ) ); -// planet->textureCoord( 1, 1 ); -// planet->position( Ogre::Vector3( -1.0, 1.0, 200.0 ) ); -// planet->textureCoord( 0, 1 ); -// planet->quad( 0, 1, 2, 3 ); -// planet->end(); -// Ogre::AxisAlignedBox aabInf; aabInf.setInfinite(); -// planet->setBoundingBox( aabInf ); -// planetNode_->attachObject( planet ); -// planetNode_->scale( 20000, 20000, 1 ); -// planetNode_->setPosition( Ogre::Vector3( 20000.0, 10000.0, 50000 ) ); -// } -// if ( planetNode_ ){ // updateLoop -// Ogre::Vector3 src = planetNode_->getWorldOrientation() * Ogre::Vector3::UNIT_Z; -// src.normalise(); -// -// Ogre::Vector3 target( avatar_->mainNode()->getPosition() - planetNode_->getWorldPosition() ); -// target.normalise(); -// -// Ogre::Quaternion rot = src.getRotationTo( target ); -// rot.normalise(); -// -// planetNode_->setPosition( Ogre::Vector3( 20000.0, 10000.0, 50000 ) + avatar_->mainNode()->getPosition() ); -// planetNode_->rotate( rot, Ogre::Node::TS_PARENT ); -// } Deleted: trunk/src/Planet.h =================================================================== --- trunk/src/Planet.h 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/Planet.h 2009-02-14 19:11:02 UTC (rev 1031) @@ -1,54 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#ifndef _OPENGATE_PLANET__H -#define _OPENGATE_PLANET__H - -#include "Opengate.h" - -namespace OpenGate{ - -class Planet { -public: - - Planet( const std::string & name, Ogre::SceneManager * SceneMgr, const Ogre::Vector3 & relPos, Ogre::Real radius, int segments ); - ~Planet( ); - void lighting( bool on ); - void update( float elapsedTime ); - -protected: - - //** taken from ogre wiki: http://www.ogre3d.org/wiki/index.php/ManualSphereMeshes - void createSphere_( const std::string & strName, const float r, const int nRings, const int nSegments ); - - std::string name_; - Ogre::SceneManager * sceneMgr_; - - Ogre::SceneNode * planetNode_; - Ogre::SceneNode * planetCloudNode_; - Ogre::Entity * planetCloudEntity_; - Ogre::Entity * planetEntity_; - Ogre::Light * light_; -}; - -} // namespace OpenGate - - -#endif // _OPENGATE_SECTOR__H Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/Sector.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -36,6 +36,7 @@ #include "SectorBeaconObject.h" #include "SectorCollisionObject.h" #include "SectorExplosionObject.h" +#include "SectorEnvironmentObject.h" #include "SectorMeshObject.h" #include "SectorMissileObject.h" #include "SectorProjectileObject.h" @@ -60,11 +61,14 @@ avatar_ = NULL; childIDCounter_ = 0; + ecliptic_ = new SectorEclipticObject( this ); + sectorEnvironment_.insert( ecliptic_ ); + showEcliptic( false ); createKoordAxis( ); - } Sector::~Sector( ){ + for_each( sectorEnvironment_.begin(), sectorEnvironment_.end(), deletePtr() ); for_each( sectorCollObjects_.begin(), sectorCollObjects_.end(), deletePtr() ); for_each( sectorMeshObjects_.begin(), sectorMeshObjects_.end(), deletePtr() ); @@ -85,6 +89,9 @@ ResourceManager::getSingleton().collisionManager->update( elapsedTime ); } + for ( std::set< SectorEnvironmentObject * >::iterator it = sectorEnvironment_.begin(); it != sectorEnvironment_.end(); it++ ){ + (*it)->update( elapsedTime ); + } for ( std::set< SectorCollisionObject * >::iterator it = sectorCollObjects_.begin(); it != sectorCollObjects_.end(); ){ if ( !(*it)->update( elapsedTime ) ) { destructCollObject_( (*it++) ); @@ -122,6 +129,9 @@ delete( obj ); obj = NULL; break; + case SECTOR_VESSEL_OBJECT_RTTI: + objectHeap_[ dynamic_cast< SectorVesselObject * >( obj )->vessel()->name() ].push_back( obj ); + break; case SECTOR_MISSILE_OBJECT_RTTI: objectHeap_[ dynamic_cast< SectorMissileObject * >( obj )->missile()->name() ].push_back( obj ); break; @@ -361,8 +371,14 @@ } else{ std::cerr << "no entity found for sectorobject: " << name << std::endl; } - } + } //! for all sectorobject + //! create Planet + SectorPlanetObject *planet = new SectorPlanetObject( "planet", this ); + //, Ogre::Vector3( 0000.0, 0000.0, 50000 ), 15000.0f, 64 ); + //planet_->lighting( true ); + sectorEnvironment_.insert( planet ); + return; } @@ -370,6 +386,14 @@ sceneMgr_->setSkyBox( true, name, 10000 ); } +void Sector::showEcliptic( bool show ){ + if ( ecliptic_ ) ecliptic_->mainNode()->setVisible( show ); +} + +void Sector::flipShowEcliptic( ) { + if ( ecliptic_ ) ecliptic_->mainNode()->flipVisibility( ); +} + void Sector::createKoordAxis( ){ koordAxisNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( "axisnode" ); koordAxisMO_ = sceneMgr_->createManualObject( koordAxisNode_->getName()+ "/manualObject" ); Modified: trunk/src/Sector.h =================================================================== --- trunk/src/Sector.h 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/Sector.h 2009-02-14 19:11:02 UTC (rev 1031) @@ -95,6 +95,10 @@ void setSkyBox( const std::string & name ); void createKoordAxis( ); + + void showEcliptic( bool show ); + + void flipShowEcliptic( ); protected: /*! do not destruct objects manualy, let them send false during update loop */ @@ -128,7 +132,7 @@ std::set< SectorCollisionObject * > sectorCollObjects_; /*! Hold all stuff that makes the sector looking nice */ - //std::set< SectorEnvironmentObject * > sectorEnvironment_; + std::set< SectorEnvironmentObject * > sectorEnvironment_; /*! Hold all stuff that makes the sector looking nice */ std::set< SectorStationObject * > sectorStations_; @@ -139,6 +143,8 @@ Ogre::SceneNode * koordAxisNode_; Ogre::ManualObject * koordAxisMO_; + + SectorEclipticObject * ecliptic_; }; #else Modified: trunk/src/SectorBaseObject.h =================================================================== --- trunk/src/SectorBaseObject.h 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/SectorBaseObject.h 2009-02-14 19:11:02 UTC (rev 1031) @@ -68,22 +68,7 @@ bool destroyRequest_; }; - /*! Sectorobject that represent space environment without collision*/ - class SectorEnvironmentObject : public SectorBaseObject { - SectorEnvironmentObject( const Ogre::String & name, Sector * sector ); - }; - - - /*class SectorPlanetObject : public SectorEnvironmentObject{ - }; - class SectorStarfieldObject : public SectorEnvironmentObject{ - }; - class SectorSpaceDustObject : public SectorEnvironmentObject{ - }; - class SectorSpaceDecorationObject : public SectorEnvironmentObject{ - };*/ - } //namespace OpenGate #endif //_OPENGATE_SECTORBASEOBJECT__H Modified: trunk/src/UnDockedState.cpp =================================================================== --- trunk/src/UnDockedState.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/UnDockedState.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -890,12 +890,12 @@ } bool UnDockedState::keyActionSelectTextTarget( bool pressed ){ - // if ( pressed ) setTarget( sector_->nextTarget() ); - return true; + if ( pressed ) radar_->findNextTarget(); + return true; } bool UnDockedState::keyActionSelectPreviousTarget( bool pressed ){ - // if ( pressed ) setTarget( sector_->prevTarget() ); + if ( pressed ) radar_->findPrevTarget(); return true; } @@ -1085,6 +1085,13 @@ return true; } +bool UnDockedState::keyActionShowEcliptic_DEV( bool pressed ){ + if ( pressed ) { + sector_->flipShowEcliptic( ); + } + return true; +} + bool UnDockedState::maximiseConsole( ){ if ( overlayRootWindow_ ){ CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"UnDocked/MainWindow/ConsoleFrame")-> Modified: trunk/src/UnDockedState.h =================================================================== --- trunk/src/UnDockedState.h 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/UnDockedState.h 2009-02-14 19:11:02 UTC (rev 1031) @@ -132,6 +132,7 @@ bool keyActionAvatarSelfDestruct_DEV( bool pressed = true ); bool keyActionSpawnAi_DEV( bool pressed = true ); bool keyActionShowInfos_DEV( bool pressed = true ); + bool keyActionShowEcliptic_DEV( bool pressed = true ); protected: UnDockedState( ); Modified: trunk/src/Vessel.cpp =================================================================== --- trunk/src/Vessel.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/Vessel.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -50,6 +50,10 @@ capacitor_ = NULL; } +Vessel::~Vessel(){ + +} + std::vector < Ogre::Vector3 > findMountPoints( TiXmlHandle * hRoot, const std::string & key ){ std::vector < Ogre::Vector3 > mountPoints; TiXmlElement * pElem; @@ -75,14 +79,14 @@ readXMLNode< int >( hRoot, "ecmsize maximum_ECM_size", this, &OpenGate::Vessel::setEcmSize, false ); for ( int i = 1; i < 7; i ++ ){ - std::vector < Ogre::Vector3 > guns = findMountPoints( &hRoot, "gun_slot_size_" + toStr( i ) ); + std::vector < Ogre::Vector3 > guns = findMountPoints( &hRoot, "gun_slot_size_" + toStr( i ) ); if ( guns.size() > 0 ){ this->setGunMountPoints( i, guns ); } } for ( int i = 1; i < 7; i ++ ){ - std::vector < Ogre::Vector3 > engines = findMountPoints( &hRoot, "engine_slot_size_" + toStr( i ) ); + std::vector < Ogre::Vector3 > engines = findMountPoints( &hRoot, "engine_slot_size_" + toStr( i ) ); if ( engines.size() > 0 ){ this->setEngineMountPoints( i, engines ); break; @@ -135,12 +139,12 @@ } void Vessel::setGunMountPoints( int size, std::vector < Ogre::Vector3 > & mountPoints ){ - gunMountPoints_[ size ] = mountPoints; + gunMountPoints_[ size ] = mountPoints; } void Vessel::setEngineMountPoints( int size, std::vector < Ogre::Vector3 > & mountPoints ){ - engineSize_ = size; - engineMountPoints_ = mountPoints; + engineSize_ = size; + engineMountPoints_ = mountPoints; } bool Vessel::setPowerPlant( PowerPlant * item ){ Modified: trunk/src/Vessel.h =================================================================== --- trunk/src/Vessel.h 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/Vessel.h 2009-02-14 19:11:02 UTC (rev 1031) @@ -64,7 +64,7 @@ Vessel(); /*! Desctructor */ - virtual ~Vessel(){} + virtual ~Vessel(); virtual void readPropertiesFromXML( TiXmlHandle & hRoot ); @@ -103,10 +103,10 @@ Uint32 capacity() const; void setGunMountPoints( int size, std::vector < Ogre::Vector3 > & mountPoints ); - std::map < int, std::vector < Ogre::Vector3 > > gunMountPoints() const { return gunMountPoints_; } + const std::map < int, std::vector < Ogre::Vector3 > > & gunMountPoints() const { return gunMountPoints_; } void setEngineMountPoints( int size, std::vector < Ogre::Vector3 > & mountPoints ); - std::vector < Ogre::Vector3 > engineMountPoints() const { return engineMountPoints_; } + const std::vector < Ogre::Vector3 > & engineMountPoints() const { return engineMountPoints_; } inline int amountEngines( ) const { return engineMountPoints_.size(); } inline void setAmountModX( int amount ){ amountModX_ = amount; } Modified: trunk/src/opengateclient.cpp =================================================================== --- trunk/src/opengateclient.cpp 2009-02-12 00:47:47 UTC (rev 1030) +++ trunk/src/opengateclient.cpp 2009-02-14 19:11:02 UTC (rev 1031) @@ -188,32 +188,29 @@ log->info( "Offline mode." ); } - try { - bool withIntro = true; - OpenGate::GameStateManager gameStateMgr( nw, option_dialog ); + try { + bool withIntro = false; + OpenGate::GameStateManager gameStateMgr( nw, option_dialog ); - if ( withIntro ){ - OpenGate::InitState::create( &gameStateMgr, "InitState" ); - gameStateMgr.start( gameStateMgr.findByName( "InitState" ) ) ; - } else { - gameStateMgr.initialiseAllResources(); - //gameStateMgr.start( gameStateMgr.findByName( "DockedState" ) ) ; - gameStateMgr.start( gameStateMgr.findByName( "UnDockedState" ) ) ; - } - - } catch( Ogre::Exception& e ) { - + if ( withIntro ){ + OpenGate::InitState::create( &gameStateMgr, "InitState" ); + gameStateMgr.start( gameStateMgr.findByName( "InitState" ) ) ; + } else { + gameStateMgr.initialiseAllResources(); + gameStateMgr.start( gameStateMgr.findByName( "DockedState" ) ) ; + //gameStateMgr.start( gameStateMgr.findByName( "UnDockedState" ) ) ; + } + } catch( Ogre::Exception& e ) { #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 - MessageBox( NULL, e.getFullDescription().c_str(), + MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL); #else - log->fatal( std::string("An exception has occured: ") + e.getFullDescription().c_str() ); + log->fatal( std::string("An exception has occured: ") + e.getFullDescription().c_str() ); #endif - } + } + nw.close(); - nw.close(); + delete log; - delete log; - - return EXIT_SUCCESS; + return EXIT_SUCCESS; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2009-02-14 23:14:10
|
Revision: 1033 http://opengate.svn.sourceforge.net/opengate/?rev=1033&view=rev Author: egore Date: 2009-02-14 23:14:07 +0000 (Sat, 14 Feb 2009) Log Message: ----------- commit a bunch of autotools changes I had sitting on my harddisk Modified Paths: -------------- trunk/Makefile.am trunk/configure.ac Added Paths: ----------- trunk/m4/as-compiler-flag.m4 Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2009-02-14 19:11:43 UTC (rev 1032) +++ trunk/Makefile.am 2009-02-14 23:14:07 UTC (rev 1033) @@ -1,12 +1,13 @@ -AUTOMAKE_OPTIONS = dist-bzip2 +# Copyright 2008 Christoph Brill -SUBDIRS = src \ - data +AUTOMAKE_OPTIONS = foreign +SUBDIRS = src data ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ - autogen.sh + autogen.sh \ + m4/as-compiler-flag.m4 distclean: maintainer-clean rm -rf *~ Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2009-02-14 19:11:43 UTC (rev 1032) +++ trunk/configure.ac 2009-02-14 23:14:07 UTC (rev 1033) @@ -1,19 +1,26 @@ -dnl Process this file with autoconf to produce a configure script. -dnl Created by Anjuta application wizard. +# Copyright 2008 Christoph Brill. -AC_PREREQ(2.59) +AC_PREREQ([2.59]) AC_INIT([opengate], [0.0.1], [http://sourceforge.net/projects/opengate/]) -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION, [dist-bzip2]) -AM_CONFIG_HEADER(config.h) +AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_AUX_DIR(.) AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([dist-bzip2]) + AM_MAINTAINER_MODE -AM_INIT_AUTOMAKE(opengate, 0.0.1) +AM_CONFIG_HEADER([config.h]) + +dnl set compiler warnings based on http://blogs.gnome.org/otte/2008/12/22/warning-options/ +AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wredundant-decls -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default -Winit-self -Wmissing-include-dirs -Wundef -Waggregate-return -Wmissing-format-attribute -Wunsafe-loop-optimizations -Wpacked -Winvalid-pch -Wsync-nand") + +# Checks for programs. AC_ISC_POSIX AC_LANG_CPLUSPLUS AC_PROG_CXX AM_PROG_CC_STDC +AC_PROG_LIBTOOL AC_HEADER_STDC AM_PROG_CC_C_O AC_C_CONST @@ -39,8 +46,7 @@ # Check for defines AC_CHECK_TYPES([ptrdiff_t]) -AM_PROG_LIBTOOL - +# Checks for pkg-config packages PKG_CHECK_MODULES(OGRE, [OGRE >= 1.4.0]) AC_SUBST(OGRE_CFLAGS) AC_SUBST(OGRE_LIBS) @@ -91,15 +97,6 @@ [AC_MSG_ERROR([*** boost_system library not found!])] ) -# no more needed cause of boost-1.36 deps -# TODO: fix this part -#AC_CHECK_HEADER([asio.hpp],, -#[ -# echo "Can't find asio headers-0.3.8. Please install the asio development packages." -# echo "You can get them from http://sourceforge.net/projects/asio/" -# exit 1 -#],[]) - AC_OUTPUT([ Makefile data/Makefile Added: trunk/m4/as-compiler-flag.m4 =================================================================== --- trunk/m4/as-compiler-flag.m4 (rev 0) +++ trunk/m4/as-compiler-flag.m4 2009-02-14 23:14:07 UTC (rev 1033) @@ -0,0 +1,62 @@ +dnl as-compiler-flag.m4 0.1.0 + +dnl autostars m4 macro for detection of compiler flags + +dnl David Schleef <ds...@sc...> + +dnl $Id: as-compiler-flag.m4,v 1.1 2005/12/15 23:35:19 ds Exp $ + +dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) +dnl Tries to compile with the given CFLAGS. +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_COMPILER_FLAG], +[ + AC_MSG_CHECKING([to see if compiler understands $1]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + m4_ifvaln([$2],[$2]) + true + else + m4_ifvaln([$3],[$3]) + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + +dnl AS_COMPILER_FLAGS(VAR, FLAGS) +dnl Tries to compile with the given CFLAGS. + +AC_DEFUN([AS_COMPILER_FLAGS], +[ + list=$2 + flags_supported="" + flags_unsupported="" + AC_MSG_CHECKING([for supported compiler flags]) + for each in $list + do + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $each" + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + flags_supported="$flags_supported $each" + else + flags_unsupported="$flags_unsupported $each" + fi + done + AC_MSG_RESULT([$flags_supported]) + if test "X$flags_unsupported" != X ; then + AC_MSG_WARN([unsupported compiler flags: $flags_unsupported]) + fi + $1="$$1 $flags_supported" +]) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-02-15 15:27:13
|
Revision: 1040 http://opengate.svn.sourceforge.net/opengate/?rev=1040&view=rev Author: spom_spom Date: 2009-02-15 15:27:03 +0000 (Sun, 15 Feb 2009) Log Message: ----------- try to fix simple shader Modified Paths: -------------- trunk/data/materials/gradientshader.cg trunk/data/materials/gradientshader.material trunk/data/materials/planet.material trunk/src/AiManager.cpp trunk/src/AiObject.cpp trunk/src/Makefile.am trunk/src/ResourceManager.cpp trunk/src/Sector.cpp trunk/src/SectorBeaconObject.cpp trunk/src/SectorEnvironmentObject.cpp trunk/src/SectorMovableObject.cpp trunk/src/SectorStationObject.cpp trunk/src/UnDockedState.cpp Added Paths: ----------- trunk/data/materials/singlecolor.material Removed Paths: ------------- trunk/src/Station.cpp trunk/src/Station.h Modified: trunk/data/materials/gradientshader.cg =================================================================== --- trunk/data/materials/gradientshader.cg 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/data/materials/gradientshader.cg 2009-02-15 15:27:03 UTC (rev 1040) @@ -28,13 +28,3 @@ oColor= ratio * customParamColour; } - - -// ----------------------------------------------------------------- -// Gradient shader : fragment program -// Author : David de Lorenzo -// ----------------------------------------------------------------- -float4 main_fp(in float4 color : COLOR) : COLOR0 -{ - return (color); -} Modified: trunk/data/materials/gradientshader.material =================================================================== --- trunk/data/materials/gradientshader.material 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/data/materials/gradientshader.material 2009-02-15 15:27:03 UTC (rev 1040) @@ -1,49 +1,34 @@ -vertex_program shader/gradientVP_CG cg +vertex_program VertexPrograms/Gradient_CG cg { - source gradientshader.cg - entry_point gradient_vp - profiles vs_1_1 arbvp1 + source gradientshader.cg + entry_point gradient_vp + profiles vs_1_1 arbvp1 vp20 - default_params - { - param_named_auto worldViewProj worldviewproj_matrix - param_named_auto camera_position_object_space camera_position_object_space - } -} - -vertex_program shader/gradientVP_Unified unified -{ - delegate shader/gradientVP_CG + default_params + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto camera_position_object_space camera_position_object_space + } } -fragment_program shader/gradientFP_CG cg +vertex_program VertexPrograms/Gradient_Unified unified { - source gradientshader.cg - entry_point main_fp - profiles ps_1_1 arbfp1 + delegate VertexPrograms/Gradient_CG } -vertex_program shader/gradientFP_Unified unified -{ - delegate shader/gradientFP_CG -} - -material shader/gradient +material Shader/Gradient { - technique - { - pass - { - scene_blend alpha_blend - depth_write on - vertex_program_ref shader/gradientVP_Unified - { - param_named_auto customParamColour custom 0 - param_named_auto customParamRadius custom 1 - } - fragment_program_ref shader/gradientFP_Unified - { - } - } - } + technique + { + pass + { + scene_blend alpha_blend + depth_write on + vertex_program_ref VertexPrograms/Gradient_Unified + { + param_named_auto customParamColour custom 0 + param_named_auto customParamRadius custom 1 + } + } + } } Modified: trunk/data/materials/planet.material =================================================================== --- trunk/data/materials/planet.material 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/data/materials/planet.material 2009-02-15 15:27:03 UTC (rev 1040) @@ -2,7 +2,8 @@ { source planet.cg entry_point main_vp - profiles arbvp1 vp20 vs_1_1 + //profiles arbvp1 vp20 vs_1_1 + profiles arbvp1 vs_1_1 default_params { @@ -17,7 +18,8 @@ { source planet.cg entry_point main_fp - profiles arbfp1 fp20 ps_1_1 + //profiles arbfp1 fp20 ps_1_1 + profiles arbfp1 ps_1_1 default_params { } @@ -27,7 +29,8 @@ { source planet.cg entry_point cloud_vp - profiles arbvp1 vp20 vs_1_1 + //profiles arbvp1 vp20 vs_1_1 + profiles arbvp1 vs_1_1 default_params { @@ -42,7 +45,8 @@ { source planet.cg entry_point cloud_fp - profiles arbfp1 fp20 ps_1_1 + //profiles arbfp1 fp20 ps_1_1 + profiles arbfp1 ps_1_1 default_params { } @@ -52,7 +56,8 @@ { source planet.cg entry_point atmos_vp - profiles arbvp1 vp20 vs_1_1 + //profiles arbvp1 vp20 vs_1_1 + profiles arbvp1 vs_1_1 default_params { @@ -67,7 +72,8 @@ { source planet.cg entry_point atmos_fp - profiles arbfp1 fp20 ps_1_1 +// profiles arbfp1 fp20 ps_1_1 + profiles arbfp1 ps_1_1 default_params { } Added: trunk/data/materials/singlecolor.material =================================================================== --- trunk/data/materials/singlecolor.material (rev 0) +++ trunk/data/materials/singlecolor.material 2009-02-15 15:27:03 UTC (rev 1040) @@ -0,0 +1,32 @@ +vertex_program VertexPrograms/SingleColor_CG cg +{ + source singlecolor.cg + entry_point singlecolor_vp + profiles vs_1_1 arbvp1 vp20 + + default_params + { + param_named_auto modelViewProjection worldviewproj_matrix + } +} + +vertex_program VertexPrograms/SingleColor_Unified unified +{ + delegate VertexPrograms/SingleColor_CG +} + +material Shader/SingleColor +{ + technique + { + pass + { + scene_blend alpha_blend + depth_write on + vertex_program_ref VertexPrograms/SingleColor_Unified + { + param_named_auto customParamColor custom 0 + } + } + } +} Modified: trunk/src/AiManager.cpp =================================================================== --- trunk/src/AiManager.cpp 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/AiManager.cpp 2009-02-15 15:27:03 UTC (rev 1040) @@ -30,7 +30,6 @@ #include "ResourceManager.h" #include "Sector.h" #include "SectorVesselObject.h" -#include "Station.h" #include "UnDockedState.h" #include "Vessel.h" #include "networkClient.h" Modified: trunk/src/AiObject.cpp =================================================================== --- trunk/src/AiObject.cpp 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/AiObject.cpp 2009-02-15 15:27:03 UTC (rev 1040) @@ -28,7 +28,6 @@ #include "SectorVesselObject.h" #include "SectorStationObject.h" #include "SectorStationPadObject.h" -#include "Station.h" #include "Vessel.h" Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/Makefile.am 2009-02-15 15:27:03 UTC (rev 1040) @@ -122,8 +122,6 @@ SectorProjectileObject.cpp \ ShipConfigDialog.h \ ShipConfigDialog.cpp \ - Station.h \ - Station.cpp \ UnDockedState.cpp \ UnDockedState.h \ Vessel.h \ Modified: trunk/src/ResourceManager.cpp =================================================================== --- trunk/src/ResourceManager.cpp 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/ResourceManager.cpp 2009-02-15 15:27:03 UTC (rev 1040) @@ -20,12 +20,11 @@ #include "tinyxml/tinyxml.h" #include "ResourceManager.h" -#include "LogManager.h" -#include "Station.h" #include "Entity.h" #include "Equipment.h" #include "KeyMap.h" +#include "LogManager.h" #include <OgreArchiveManager.h> #include <OgreFileSystem.h> Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/Sector.cpp 2009-02-15 15:27:03 UTC (rev 1040) @@ -399,20 +399,20 @@ koordAxisMO_ = sceneMgr_->createManualObject( koordAxisNode_->getName()+ "/manualObject" ); Ogre::Real length = 20; - koordAxisMO_->begin( "singleColor", Ogre::RenderOperation::OT_LINE_LIST); + koordAxisMO_->begin( "Shader/SingleColor", Ogre::RenderOperation::OT_LINE_LIST); koordAxisMO_->getSection( 0 )->setCustomParameter( 0, Ogre::Vector4( 1.0, 0.0, 0.0, 1.0 ) ); koordAxisMO_->position( 0.0, 0.0, 0.0 ); koordAxisMO_->position( 1.0, 0.0, 0.0 ); koordAxisMO_->position( 0.0, 0.0, 0.0 ); koordAxisMO_->end(); - koordAxisMO_->begin( "singleColor", Ogre::RenderOperation::OT_LINE_LIST); + koordAxisMO_->begin( "Shader/SingleColor", Ogre::RenderOperation::OT_LINE_LIST); koordAxisMO_->getSection( 1 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0, 0.0, 1.0 ) ); koordAxisMO_->position( 0.0, 1.0, 0.0 ); koordAxisMO_->position( 0.0, 0.0, 0.0 ); koordAxisMO_->end(); - koordAxisMO_->begin( "singleColor", Ogre::RenderOperation::OT_LINE_LIST); + koordAxisMO_->begin( "Shader/SingleColor", Ogre::RenderOperation::OT_LINE_LIST); koordAxisMO_->getSection( 2 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 0.0, 1.0, 1.0 ) ); koordAxisMO_->position( 0.0, 0.0, 1.0 ); koordAxisMO_->position( 0.0, 0.0, 0.0 ); @@ -1068,86 +1068,7 @@ return avatar_; } -void Sector::createKoordAxis( ){ - koordAxisNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( "axisnode" ); - koordAxisMO_ = sceneMgr_->createManualObject( koordAxisNode_->getName()+ "/manualObject" ); - Ogre::Real length = 20; - - koordAxisMO_->begin( "singleColor", Ogre::RenderOperation::OT_LINE_LIST); - koordAxisMO_->getSection( 0 )->setCustomParameter( 0, Ogre::Vector4( 1.0, 0.0, 0.0, 1.0 ) ); - koordAxisMO_->position( 0.0, 0.0, 0.0 ); - koordAxisMO_->position( 1.0, 0.0, 0.0 ); - koordAxisMO_->position( 0.0, 0.0, 0.0 ); - koordAxisMO_->end(); - - koordAxisMO_->begin( "singleColor", Ogre::RenderOperation::OT_LINE_LIST); - koordAxisMO_->getSection( 1 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0, 0.0, 1.0 ) ); - koordAxisMO_->position( 0.0, 1.0, 0.0 ); - koordAxisMO_->position( 0.0, 0.0, 0.0 ); - koordAxisMO_->end(); - - koordAxisMO_->begin( "singleColor", Ogre::RenderOperation::OT_LINE_LIST); - koordAxisMO_->getSection( 2 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 0.0, 1.0, 1.0 ) ); - koordAxisMO_->position( 0.0, 0.0, 1.0 ); - koordAxisMO_->position( 0.0, 0.0, 0.0 ); - koordAxisMO_->end(); - - koordAxisMO_->begin( "BaseWhiteNoLighting", Ogre::RenderOperation::OT_LINE_LIST); - koordAxisMO_->position( -1.0, 0.0, 0.0 ); - koordAxisMO_->position( 0.0, 0.0, 0.0 ); - koordAxisMO_->position( 0.0, -1.0, 0.0 ); - koordAxisMO_->position( 0.0, 0.0, 0.0 ); - koordAxisMO_->position( 0.0, 0.0, -1.0 ); -// koordAxisMO_->line( 0, 1 ); -// koordAxisMO_->line( 0, 2 ); -// koordAxisMO_->line( 0, 3 ); - koordAxisMO_->end(); - koordAxisNode_->attachObject( koordAxisMO_ ); - koordAxisNode_->scale( length, length, length ); -} -void Sector::createCircle( ){ - Ogre::String name = "testcircle"; - - Ogre::SceneNode * object = sceneMgr_->getRootSceneNode()->createChildSceneNode( name ); - Ogre::ManualObject * circle = sceneMgr_->createManualObject( name + "shape" ); - - Ogre::Real radius = 200; - Ogre::Real thickness = 200.0; // Of course this must be less than the radius value. - Ogre::Real nSegments = 96; - Ogre::Real dPhi = 2.0 * 3.141592 / nSegments; - - circle->begin( "shader/gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); - circle->getSection( 0 )->setCustomParameter( 0, Ogre::Vector4( 23./255, 118./255, 9./255, 0.1 ) ); - circle->getSection( 0 )->setCustomParameter( 1, Ogre::Vector4( radius, 0, 0, 0 ) ); - - unsigned point_index = 0; - - for ( int segment = 0; segment < nSegments; segment++ ) { - Ogre::Real theta = segment * dPhi; - circle->position( radius * cos( theta ), - 0, - radius * sin( theta ) ); - circle->position( (radius - thickness) * cos( theta ), - 0, - (radius - thickness) * sin( theta ) ); - - if ( segment > 0 ){ - point_index = (segment+1)*2-1; - circle->quad( point_index, point_index-1, point_index-3, point_index-2 ); - circle->quad( point_index, point_index-2, point_index-3, point_index-1 ); - } - } - circle->quad( 1, 0, (uint)nSegments*2-2, (uint)nSegments*2-1 ); - circle->quad( 1, (uint)nSegments*2-1, (uint)nSegments*2-2, 0 ); - circle->end(); - - object->translate( 0, 0, 50); - object->pitch( Ogre::Degree( 10 ) ); - object->attachObject( circle ); - -} - void Sector::sendAllVesselMovements( ){ if ( avatar_ ) sendVesselMovement( avatar_ ); } Modified: trunk/src/SectorBeaconObject.cpp =================================================================== --- trunk/src/SectorBeaconObject.cpp 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/SectorBeaconObject.cpp 2009-02-15 15:27:03 UTC (rev 1040) @@ -51,19 +51,19 @@ } if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/pad_mount_0" ){ - entity()->getSubEntity( i )->setMaterialName( "singleColor" ); + entity()->getSubEntity( i )->setMaterialName( "Shader/SingleColor" ); entity()->getSubEntity( i )->setCustomParameter( 0, Ogre::Vector4( 0.5, 0.5, 0.5, 1.0 ) ); entryPad_ = new SectorBeaconPadObject( "EntryPad", this, entity()->getSubEntity( i ) ); entryPad_->changeEntity( "beacon_pad.mesh" ); - entryPad_->entity()->setMaterialName( "singleColor" ); + entryPad_->entity()->setMaterialName( "Shader/SingleColor" ); entryPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); } if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/pad_mount_1" ){ - entity()->getSubEntity( i )->setMaterialName( "singleColor" ); + entity()->getSubEntity( i )->setMaterialName( "Shader/SingleColor" ); entity()->getSubEntity( i )->setCustomParameter( 0, Ogre::Vector4( 0.5, 0.5, 0.5, 1.0 ) ); exitPad_ = new SectorBeaconPadObject( "ExitPad", this, entity()->getSubEntity( i ) ); exitPad_->changeEntity( "beacon_pad.mesh" ); - exitPad_->entity()->setMaterialName( "singleColor" ); + exitPad_->entity()->setMaterialName( "Shader/SingleColor" ); exitPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); } } Modified: trunk/src/SectorEnvironmentObject.cpp =================================================================== --- trunk/src/SectorEnvironmentObject.cpp 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/SectorEnvironmentObject.cpp 2009-02-15 15:27:03 UTC (rev 1040) @@ -63,10 +63,10 @@ mainNode_->attachObject( entity_ ); mainNode_->setPosition( Ogre::Vector3( 0000.0, 0000.0, 50000 ) ); - //planetNode_->pitch( Ogre::Degree(30) ); - + // mainNode_->setVisible( false ); + cloudNode_ = mainNode_->createChildSceneNode( mainNode_->getName() + "/cloud" ); - + // cloudNode_->setVisible( true ); cloudEntity_ = entity_->clone( cloudNode_->getName() ); cloudEntity_->setMaterialName( "Planet/Cloud" ); @@ -229,7 +229,7 @@ unsigned point_index = 0; - entity_->begin( "shader/gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); + entity_->begin( "Shader/Gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); entity_->getSection( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 0.0, 1.0, 0.2 ) ); entity_->getSection( 0 )->setCustomParameter( 1, Ogre::Vector4( nx * dx, 0.0, 0.0, 0.0 ) ); @@ -243,7 +243,7 @@ } entity_->end(); - entity_->begin( "shader/gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); + entity_->begin( "Shader/Gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); entity_->getSection( 1 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 0.0, 1.0, 0.2 ) ); entity_->getSection( 1 )->setCustomParameter( 1, Ogre::Vector4( nz * dz, 0.0, 0.0, 0.0 ) ); @@ -257,7 +257,7 @@ } entity_->end(); - entity_->begin( "shader/gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); + entity_->begin( "Shader/Gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); entity_->getSection( 2 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0, 0.0, 0.2 ) ); entity_->getSection( 2 )->setCustomParameter( 1, Ogre::Vector4( nx * dx, 0.0, 0.0, 0.0 ) ); @@ -271,7 +271,7 @@ } entity_->end(); - entity_->begin( "shader/gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); + entity_->begin( "Shader/Gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); entity_->getSection( 3 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0, 0.0, 0.2 ) ); entity_->getSection( 3 )->setCustomParameter( 1, Ogre::Vector4( nz * dz, 0.0, 0.0, 0.0 ) ); Modified: trunk/src/SectorMovableObject.cpp =================================================================== --- trunk/src/SectorMovableObject.cpp 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/SectorMovableObject.cpp 2009-02-15 15:27:03 UTC (rev 1040) @@ -74,6 +74,7 @@ mass_ = movable_->mass(); armor_ = movable_->armor(); maxArmor_ = movable_->armor(); + maxShield_ = 1; shield_ = 0; setDestroyRequest_( false ); Modified: trunk/src/SectorStationObject.cpp =================================================================== --- trunk/src/SectorStationObject.cpp 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/SectorStationObject.cpp 2009-02-15 15:27:03 UTC (rev 1040) @@ -113,7 +113,7 @@ for ( int i = 0; i < nRings; i ++ ){ radius = rMin + i * 10 * rMin / nRings ; - ringEntity_->begin( "shader/gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); + ringEntity_->begin( "Shader/Gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); ringEntity_->getSection( i )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0-(double)i/nRings, (double)i/nRings, 0.4 ) ); ringEntity_->getSection( i )->setCustomParameter( 1, Ogre::Vector4( radius, 0, 0, 0 ) ); Deleted: trunk/src/Station.cpp =================================================================== --- trunk/src/Station.cpp 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/Station.cpp 2009-02-15 15:27:03 UTC (rev 1040) @@ -1,403 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#include "Station.h" - -#include "AiObject.h" -#include "GameStateManager.h" -#include "Sector.h" -#include "SectorObjectVessel.h" -#include "OpcodeWrapper.h" -#include "UnDockedState.h" - -#include <OgreString.h> -#include <OgreMesh.h> -#include <OgreSubMesh.h> -#include <OgreEntity.h> -#include <OgreSubEntity.h> -#include <OgreMeshManager.h> -#include <OgreSceneManager.h> -#include <OgreManualObject.h> -#include <OgreBillboard.h> -#include <OgreBillboardSet.h> - -namespace OpenGate{ - -Pad::Pad( const std::string & name, SectorObject * parent, Ogre::SubEntity * padSubEntity ) - : BaseObject( name, parent->sector(), 0, 0, parent->rotNode() ), parent_( parent ){ - - padManualObject_ = sceneMgr_->createManualObject( mainNode_->getName() + "/ManualObject" ); - - std::vector < Ogre::Vector3 > verts; - std::vector < Triangle > tris; - readSubEntity( padSubEntity, verts, tris ); - - //padManualObject_->begin( "BaseWhiteNoLighting", Ogre::RenderOperation::OT_TRIANGLE_LIST ); - padManualObject_->begin( padSubEntity->getMaterialName(), Ogre::RenderOperation::OT_TRIANGLE_LIST ); - - Ogre::Real xmin( 9e99 ), xmax( -9e99 ), ymin( 9e99 ), ymax( -9e99 ), zmin( 9e99 ), zmax( -9e99 ); - position_ = Ogre::Vector3::ZERO; - - for( uint i = 0; i < verts.size(); i++ ){ - position_ += verts[ i ]; - - xmin = min( xmin, verts[ i ][ 0 ] ); xmax = max( xmax, verts[ i ][ 0 ] ); - ymin = min( ymin, verts[ i ][ 1 ] ); ymax = max( ymax, verts[ i ][ 1 ] ); - zmin = min( zmin, verts[ i ][ 2 ] ); zmax = max( zmax, verts[ i ][ 2 ] ); - padManualObject_->position( verts[ i ] ); //pReal[ 0 ], pReal[ 1 ], pReal[ 2 ] ); - } - - position_ /= verts.size(); - radius_ = max( xmax-xmin, ymax-ymin ); - radius_ = max( radius_, zmax - zmin ); - radius_ /= 2.0; - - direction_ = Ogre::Vector3::ZERO; - for ( uint i = 0; i < tris.size(); i++ ) { - padManualObject_->triangle( tris[ i ].a, tris[ i ].b, tris[ i ].c ); - direction_ += ( ( verts[ tris[ i ].b ] - verts[ tris[ i ].a ] ) - .crossProduct( verts[ tris[ i ].c ] - verts[ tris[ i ].a ] ) ).normalisedCopy(); - } - - direction_ /= tris.size(); - padManualObject_->end(); - - padMesh_ = padManualObject_->convertToMesh( padManualObject_->getName() + "/Mesh" ); - padEntity_ = sceneMgr_->createEntity( padMesh_->getName() + "/Entity", padMesh_->getName() ); - mainNode_->attachObject( padEntity_ ); - mainNode_->translate( direction_.normalisedCopy() * 0.1 ); -} - -Pad::~Pad( ){ - mainNode_->detachObject( padEntity_ ); - sceneMgr_->destroyEntity( padEntity_ ); - Ogre::MeshManager::getSingleton().remove( padMesh_->getName() ); - sceneMgr_->destroyManualObject( padManualObject_ ); -} - -StationPad::StationPad( const std::string & name, StationObject * station, Ogre::SubEntity * padSubEntity, - bool docking ) - : Pad( name, station, padSubEntity), docking_( docking ){ - - if ( docking_ ){ - if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->createObject( this ); - } - } -} - -StationPad::~StationPad( ){ - if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->destroyObject( this ); - } -} - -void StationPad::collide( BaseObject * object ){ - if ( docking_ ) { - if ( object->rtti() == AVATAR_RTTI ){ - std::cout << "StationPad::collide() docking request for " << object->name() << std::endl; - // sector_->listener()->changeToDockedState(); - } else if ( object->rtti() == SECTOROBJECTVESSEL_RTTI ){ - std::cout << "StationPad::collide() docking request for " << object->name() << std::endl; - //dynamic_cast< SectorObjectVessel * >( object )->controler()->kill(); -// ResourceManager::getSingleton().collisionManager->dettachObject( padEntity_, this, "DockPad" ); - object->destroy( ); - } - } - -} - -StationObject::StationObject( Station & station, Sector * sector ) - : SectorObject( station.name(), sector ), station_( &station ){ - - dockPad_ = NULL; - flashLights_ = NULL; - - setShape( station_->meshName() ); - - for ( uint i = 0; i < entity()->getNumSubEntities(); i ++ ){ - std::cout << entity()->getSubEntity( i )->getMaterialName() << " Techniques: " - << entity()->getSubEntity( i )->getMaterial()->getNumTechniques() << " used: " - << entity()->getSubEntity( i )->getTechnique()->getName() << std::endl; - -// for ( uint j = 0; j < entity()->getSubEntity( i )->getMaterial()->getNumTechniques(); j ++ ){ -// std::cout << entity()->getSubEntity( i )->getMaterial()->getTechnique( j )->getName() << std::endl; -// } - - if ( entity()->getSubEntity( i )->getMaterialName() == "Flashlight/Red" ){ - createFlashLights( entity()->getSubEntity( i ) ); - } - if ( entity()->getSubEntity( i )->getMaterialName() == "Station/DockPad" ){ - dockPad_ = new StationPad( name_ + "DockPad", this, entity()->getSubEntity( i ), true ); - } - if ( entity()->getSubEntity( i )->getMaterialName() == "Station/LaunchPad.001" ){ - launchPad_ = new StationPad( name_ + "LaunchPad", this, entity()->getSubEntity( i ), false ); - } - } - - setBaseRot( station_->baseYaw(), station_->basePitch(), station_->baseRoll() ); - setBaseSize( station_->baseSize() ); - - if ( dockPad_ ){ - createRings( dockPad_->position(), dockPad_->radius(), dockPad_->direction() ); - ringNode_->setVisible( false ); - } -} - -StationObject::~StationObject( ) { - if ( launchPad_ ) delete launchPad_; - - if ( dockPad_ ){ - delete dockPad_; - ringNode_->detachObject( ringEntity_ ); - sceneMgr_->destroyManualObject( ringEntity_ ); - mainNodeEntityRot_->removeAndDestroyChild( ringNode_->getName() ); - } - if ( flashLights_ ){ - mainNodeEntityRot_->detachObject( flashLights_ ); - sceneMgr_->destroyBillboardSet( flashLights_ ); - } - - Ogre::MeshManager::getSingleton().unload( station_->meshName() ); -} - -void StationObject::collide( BaseObject * object ){ - // std::cout << "Sector: " << name_ << " collide with " << object->getTypeID() << " " << object->name()<< std::endl; -} - -void StationObject::addObserver( SectorObject * obj ){ - observers_.insert( obj ); - if ( obj->rtti() == AVATAR_RTTI ){ - showRings( true ); - } -} - -void StationObject::delObserver( SectorObject * obj ){ - if ( obj->rtti() == AVATAR_RTTI ){ - showRings( false ); - } - observers_.erase( obj ); -} - -void StationObject::showRings( bool show ){ ringNode_->setVisible( show ); } - -void StationObject::createFlashLights( Ogre::SubEntity * entity ){ - - entity->setVisible( false ); - std::vector< Ogre::Vector3 > verts; - std::vector< Triangle > tris; - readSubEntity( entity, verts, tris ); - - uint nLights = tris.size() / 2; - - flashLights_ = sceneMgr_->createBillboardSet( name_ + "_BBS", nLights ); - flashLights_->setMaterialName( entity->getMaterialName() ); - - Ogre::Billboard *bb; - - for ( uint i = 0; i < nLights; i ++ ){ - bb = flashLights_->createBillboard( Ogre::Vector3::ZERO, Ogre::ColourValue( 1.0f, 0.0f, 0.0f, 1.0f) ); - bb->setDimensions( (verts[ i * 4 + 1 ] - verts[ i * 4 ] ).length(), - (verts[ i * 4 + 1 ] - verts[ i * 4 ] ).length() ); - bb->setPosition( ( verts[ i * 4 ] + verts[ i * 4 + 1 ] + verts[ i * 4 + 2 ] + verts[ i * 4 + 3] ) / 4.0 ); - } - mainNodeEntityRot_->attachObject( flashLights_ ); -} - -Ogre::Vector3 StationObject::launchPadPosition() const { -// mainNodeEntityRot_->_update(true, true); -// std::cout << "StationObject::launchPadPosition() " << mainNodeEntityRot_->_getFullTransform() * launchPad_->position() << std::endl; -// std::cout << "StationObject::launchPadPosition() " << launchPad_->position() << std::endl; - return mainNodeEntityRot_->_getFullTransform()* launchPad_->position(); -// return Ogre::Vector3( 0.0, 0.0, 0.0 ); -} - -Ogre::Vector3 StationObject::launchPadDirection() const { - // return launchPadNode_->getOrientation().zAxis() * -1.0; - // return mainNodeEntityRot_->_getDerivedOrientation() * launchPad_->direction(); -// return -launchPad_->padNode()->getOrientation().zAxis(); ; - // return launchPadNode_->getWorldOrientation(); -//return Ogre::Vector3( 1.0, 0.0, 0.0 ); - return mainNodeEntityRot_->_getDerivedOrientation() * launchPad_->direction() ; -} -Ogre::Vector3 StationObject::dockPadPosition() const { - return mainNodeEntityRot_->_getFullTransform()* dockPad_->position(); - // return dockPad_->padNode()->getWorldPosition(); -} - -Ogre::Vector3 StationObject::dockPadDirection() const { - return mainNodeEntityRot_->_getDerivedOrientation() * dockPad_->direction() ; -} - -Ogre::Vector3 StationObject::dockingRingStart( ) const { - // 400.0 == nRings * length; - return mainNodeEntityRot_->_getFullTransform()* ( dockPad_->position() + dockPad_->direction() * 20.0 ); - //return dockPadPosition() + dockPadDirection() * 800.0; - //return ringNode_->getWorldPosition() + ringNode_->getWorldOrientation().zAxis() * 400.0; -} - -Ogre::Vector3 StationObject::dockingRingEnd( ) const { - return dockPadPosition(); -} - - -void StationObject::createRings( const Ogre::Vector3 & position, Ogre::Real rMin, const Ogre::Vector3 & direction ){ - Ogre::Vector3 targetDir( direction ); - if ( targetDir == Ogre::Vector3::ZERO ) targetDir = mainNodeEntityRot_->getOrientation().zAxis(); - - Ogre::String name = name_+ "/Rings"; - - ringNode_ = mainNodeEntityRot_->createChildSceneNode( name ); - ringEntity_ = sceneMgr_->createManualObject( name + "shape" ); - - Ogre::Real radius = rMin; - Ogre::Real thickness = rMin / 5.0; // Of course this must be less than the radius value. - Ogre::Real nSegments = 6; - Ogre::Real dPhi = 2.0 * 3.141592 / nSegments; - Ogre::Real length = 20; - int nRings = 20; - - unsigned point_index = 0; - - for ( int i = 0; i < nRings; i ++ ){ - radius = rMin + i * 10 * rMin / nRings ; - - ringEntity_->begin( "shader/gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); - ringEntity_->getSection( i )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0-(double)i/nRings, (double)i/nRings, 0.4 ) ); - ringEntity_->getSection( i )->setCustomParameter( 1, Ogre::Vector4( radius, 0, 0, 0 ) ); - - for ( int segment = 0; segment < nSegments; segment++ ) { - Ogre::Real theta = segment * dPhi + dPhi/2.0; - - ringEntity_->position( radius * cos( theta ), i * ( length / nRings ), - radius * sin( theta ) ); - ringEntity_->position( (radius - thickness) * cos( theta ), i * ( length / nRings ), - (radius - thickness) * sin( theta ) ); - if ( segment > 0 ){ - point_index = (segment+1)*2-1; - ringEntity_->quad( point_index, point_index-1, point_index-3, point_index-2 ); - ringEntity_->quad( point_index, point_index-2, point_index-3, point_index-1 ); - } - } - ringEntity_->quad( 1, 0, (uint)nSegments*2-2, (uint)nSegments*2-1 ); - ringEntity_->quad( 1, (uint)nSegments*2-1, (uint)nSegments*2-2, 0 ); - ringEntity_->end(); - } - - Ogre::Quaternion rot = Ogre::Vector3( 0.0, 1.0, 0.0 ).getRotationTo( targetDir ); - - ringNode_->rotate( rot ); - ringNode_->translate( position ); - ringNode_->attachObject( ringEntity_ ); -} - -BeaconPad::BeaconPad( const std::string & name, BeaconObject * beacon, Ogre::SubEntity * padSubEntity ) - : Pad( name, beacon, padSubEntity){ - - if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->createObject( this ); - } -} - -BeaconPad::~BeaconPad( ){ - if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->destroyObject( this ); - } -} - -void BeaconPad::collide( BaseObject * object ){ - if ( object->rtti() == AVATAR_RTTI ){ - std::cout << "BeaconPad::collide() bcu for " << object->name() << std::endl; - } else if ( object->rtti() == SECTOROBJECTVESSEL_RTTI ){ - std::cout << "BeaconPad::collide() bcu for " << object->name() << std::endl; - } -} - -void BeaconPad::changeEntity( const std::string & meshname ){ - if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->detach( this ); - } - mainNode_->detachObject( padEntity_ ); - sceneMgr_->destroyEntity( padEntity_ ); - padEntity_ = sceneMgr_->createEntity( name_ + "/Entity", meshname ); - mainNode_->attachObject( padEntity_ ); - mainNode_->translate( position_ ); - if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->attach( this ); - } -} - - -BeaconObject::BeaconObject( Sector * sector ) - : SectorObject ( sector->name() + "/Beacon ", sector ), entryPad_( NULL ), exitPad_( NULL ) { - - setShape( "beacon.mesh" ); - //entity_->setMaterialName( "Sta/TS/Background" ); - - for ( uint i = 0; i < entity()->getNumSubEntities(); i ++ ){ - std::cout << entity()->getSubEntity( i )->getMaterialName() << " Techniques: " - << entity()->getSubEntity( i )->getMaterial()->getNumTechniques() << " used: " - << entity()->getSubEntity( i )->getTechnique()->getName() << std::endl; - - if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/bg" ){ - entity()->getSubEntity( i )->setMaterialName( "Sta/TS/Background" ); - } - - if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/pad_mount_0" ){ - entity()->getSubEntity( i )->setMaterialName( "singleColor" ); - entity()->getSubEntity( i )->setCustomParameter( 0, Ogre::Vector4( 0.5, 0.5, 0.5, 1.0 ) ); - entryPad_ = new BeaconPad( "EntryPad", this, entity()->getSubEntity( i ) ); - entryPad_->changeEntity( "beacon_pad.mesh" ); - entryPad_->entity()->setMaterialName( "singleColor" ); - entryPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); - } - if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/pad_mount_1" ){ - entity()->getSubEntity( i )->setMaterialName( "singleColor" ); - entity()->getSubEntity( i )->setCustomParameter( 0, Ogre::Vector4( 0.5, 0.5, 0.5, 1.0 ) ); - exitPad_ = new BeaconPad( "ExitPad", this, entity()->getSubEntity( i ) ); - exitPad_->changeEntity( "beacon_pad.mesh" ); - exitPad_->entity()->setMaterialName( "singleColor" ); - exitPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); - } - } - - -// std::vector < Ogre::Vector3 > verts; -// std::vector < Triangle > tris; -// readSubEntity( entity_, verts, tris ); - - - -} - -BeaconObject::~BeaconObject( ){ - if ( entryPad_ ) delete entryPad_; - if ( exitPad_ ) delete exitPad_; -} - -Ogre::Vector3 BeaconObject::entrancePosition() const { - return Ogre::Vector3::ZERO; -} - -Ogre::Vector3 BeaconObject::exitPosition() const { - return Ogre::Vector3::ZERO; -} - -} // namespace OpenGate Deleted: trunk/src/Station.h =================================================================== --- trunk/src/Station.h 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/Station.h 2009-02-15 15:27:03 UTC (rev 1040) @@ -1,199 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#ifndef _OPENGATE_STATION__H -#define _OPENGATE_STATION__H - -#include "Entity.h" -#include "BaseObject.h" -#include "SectorObject.h" - -#include <OgrePrerequisites.h> -#include <OgreMesh.h> - -namespace OpenGate{ - -class Station; -class Pad; -class StationPad; -class BeaconPad; -class StationObject; -class BeaconObject; - -void readSubEntity( Ogre::SubEntity * entity, std::vector< Ogre::Vector3 > & verts, std::vector< Triangle > & tris ); - -class Pad : public BaseObject { -public: - /*! Constructor, with a name, */ - Pad( const std::string & name, SectorObject * parent, Ogre::SubEntity * padSubEntity ); - /*! Destructor */ - virtual ~Pad( ); - - /*! Return runtime type information */ - virtual long rtti() const { return STATIONPAD_RTTI; } - - virtual std::string collisionClass() const { return "DockPad"; } - - /*! What happen on collision */ - virtual void collide( BaseObject * object ){} - - /*! Update the pad in each frame */ - virtual bool update( Ogre::Real elapsedTime ){ return true; } - - /*! Position for the pad center in local coordinates. */ - Ogre::Vector3 position( ) const { return position_; } - - /*! Direction for the pad in local coordinates. */ - Ogre::Vector3 direction( ) const{ return direction_; } - - /*! Radius of the pad */ - Ogre::Real radius() const { return radius_; } - - Ogre::SceneNode * padNode(){ return mainNode_; } - - virtual Ogre::Entity * entity( ) { return padEntity_; } - -protected: - SectorObject * parent_; - //Ogre::SceneNode * padNode_; - Ogre::ManualObject * padManualObject_; - Ogre::MeshPtr padMesh_; - Ogre::Entity * padEntity_; - - Ogre::Vector3 position_; - Ogre::Vector3 direction_; - Ogre::Real radius_; -}; - -/*! A station pad is a plain area where vessel dock or launch */ -class StationPad : public Pad { -public: - /*! Constructor, with a name, */ - StationPad( const std::string & name, StationObject * station, Ogre::SubEntity * padSubEntity, - bool docking = false ); - /*! Destructor */ - virtual ~StationPad( ); - - /*! What to do on collision */ - void collide( BaseObject * object ); - -protected: - bool docking_; -}; - -//** derive from dockable so sector can handle set of dockables -class StationObject : public SectorObject{ -public: - StationObject( Station & station, Sector * sector ); - - virtual ~StationObject( ); - - virtual long rtti() const { return STATION_RTTI; } - - virtual std::string collisionClass() const { return "Station"; } - - void collide( BaseObject * object ); - - //** taking default arg here, breaks pythonogre-generation, leads to TypeError: No to_python (by-value) converter found for C++ type: Ogre::Vector3 - void createRings( const Ogre::Vector3 & position, Ogre::Real rMin, const Ogre::Vector3 & direction ); - - inline void createRings( const Ogre::Vector3 & position, Ogre::Real rMin ) { return createRings( position, rMin, Ogre::Vector3::ZERO ); } - - /*! Show or hide the dockingrings */ - void showRings( bool show ); - - void createFlashLights( Ogre::SubEntity * entity ); - - /*! Add observer. Derived from SectorObject, but show docking rings if the obj is the avatar */ - virtual void addObserver( SectorObject * obj ); - - /*! Remove observer. Derived from SectorObject, but hide docking rings if the obj is the avatar */ - virtual void delObserver( SectorObject * obj ); - - Ogre::Vector3 launchPadPosition() const; - - Ogre::Vector3 launchPadDirection() const ; - - /*! Return the world coordinate of the docking pad */ - Ogre::Vector3 dockPadPosition() const; - - /*! Return the world direction of the docking pad */ - Ogre::Vector3 dockPadDirection() const; - - /*! Docking rings start position*/ - Ogre::Vector3 dockingRingStart( ) const; - - /*! Docking rings end position respectively outer position of the dockingtube*/ - Ogre::Vector3 dockingRingEnd( ) const ; - -protected: - Station * station_; - Ogre::SceneNode * ringNode_; - //Ogre::SceneNode * dockPadNode_; - //Ogre::SceneNode * launchPadNode_; - - Ogre::ManualObject * ringEntity_; - - Ogre::BillboardSet * flashLights_; - StationPad * dockPad_; - StationPad * launchPad_; - //StationDockPad * dockPad_; -}; - - -/*! A station pad is a plain area where vessel dock or launch */ -class BeaconPad : public Pad{ -public: - /*! Constructor, with a name, */ - BeaconPad( const std::string & name, BeaconObject * station, Ogre::SubEntity * padSubEntity ); - - /*! Destructor */ - virtual ~BeaconPad( ); - - /*! What happen on collision */ - void collide( BaseObject * object ); - - void changeEntity( const std::string & meshname ); - -protected: -}; - -class BeaconObject : public SectorObject { -public: - BeaconObject( Sector * sector ); - - virtual ~BeaconObject( ); - - /*! Return entrance position in world coordinates */ - Ogre::Vector3 entrancePosition() const; - - /*! Return exit position in world coordinates */ - Ogre::Vector3 exitPosition() const; - -protected: - BeaconPad * entryPad_; - BeaconPad * exitPad_; -}; - -} // namespace OpenGate - -#endif //_OPENGATE_STATION__H - - Modified: trunk/src/UnDockedState.cpp =================================================================== --- trunk/src/UnDockedState.cpp 2009-02-15 14:10:46 UTC (rev 1039) +++ trunk/src/UnDockedState.cpp 2009-02-15 15:27:03 UTC (rev 1040) @@ -23,25 +23,24 @@ #include "AiManager.h" #include "AiObject.h" #include "Avatar.h" +#include "Console.h" +#include "ConfigDialog.h" +#include "GameStateManager.h" #include "Hud.h" -#include "GameStateManager.h" -#include "Sector.h" #include "networkProtocol.h" #include "networkClient.h" #include "InputManager.h" -#include "Console.h" -#include "ConfigDialog.h" #include "KeyMap.h" #include "OpenALSoundManager.h" #include "RadarObject.h" +#include "Sector.h" #include "SectorAvatarObject.h" #include "SectorEnvironmentObject.h" #include "SectorStationObject.h" #include "EntityManager.h" -#include "Station.h" #include "OpcodeWrapper.h" #include <iostream> @@ -1110,12 +1109,12 @@ for ( ; it != itmax; it ++ ){ std::cout << " found " << (*it)->name() << std::endl; } - //std::find( se.begin(), se.end(), ( std::mem_fun( &SectorEnvironmentObject::name ) == "Planet" ) ); -// boost::bind( std::equal_to< std::string >(), -// Login->Token.c_str(), -// boost::bind( &Player::mGetToken, _1 ) ) ); +// std::find_if( c.begin(),c.end(), std::compose1( std::mem_fun( &class::meth ), std::bind2nd( std::equal_to< T>(), Tcomp ) ) ); +// std::find_if( c.begin(),c.end(), boost::bind( std::equal_to< T >(), Tcomp, boost::bind( &class::meth, _1 ) ) ); +// std::find_if( c.begin(),c.end(), boost::bind( &class::meth, _1 ) == Tcomp ); - it = std::find_if( se.begin(), se.end(), boost::bind( std::equal_to< std::string >(), "planet", boost::bind(&SectorEnvironmentObject::name,_1 ) ) ); + //it = std::find_if( se.begin(), se.end(), boost::bind( std::equal_to< std::string >(), "planet", boost::bind(&SectorEnvironmentObject::name,_1 ) ) ); + it = std::find_if( se.begin(), se.end(), boost::bind( &SectorEnvironmentObject::name, _1 ) == "planet" ); std::cout << "search planet" << std::endl; if ( it != itmax ){ std::cout << " scale cloud 1.005 " << std::endl; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-02-21 22:55:32
|
Revision: 1064 http://opengate.svn.sourceforge.net/opengate/?rev=1064&view=rev Author: spom_spom Date: 2009-02-21 22:01:23 +0000 (Sat, 21 Feb 2009) Log Message: ----------- Next steps of network reconstruction done. register/deregister/movement/ammohit Modified Paths: -------------- trunk/configure.ac trunk/src/Avatar.cpp trunk/src/Avatar.h trunk/src/GameStateManager.cpp trunk/src/GunObject.cpp trunk/src/GunObject.h trunk/src/Hud.cpp trunk/src/Makefile.am trunk/src/OpcodeWrapper.cpp trunk/src/OpcodeWrapper.h trunk/src/Opengate.h trunk/src/RadarObject.cpp trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorAvatarObject.cpp trunk/src/SectorAvatarObject.h trunk/src/SectorMovableObject.cpp trunk/src/SectorMovableObject.h trunk/src/SectorProjectileObject.cpp trunk/src/SectorProjectileObject.h trunk/src/SectorVesselObject.cpp trunk/src/SectorVesselObject.h trunk/src/UnDockedState.cpp trunk/src/UnDockedState.h trunk/src/networkClient.cpp trunk/src/networkClient.h trunk/src/networkServer.cpp trunk/src/networkServerUser.h Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/configure.ac 2009-02-21 22:01:23 UTC (rev 1064) @@ -22,7 +22,7 @@ AM_PROG_CC_STDC AC_PROG_LIBTOOL AC_HEADER_STDC -AM_PROG_CC_C_O +#AM_PROG_CC_C_O AC_C_CONST AC_C_INLINE AC_C_VOLATILE Modified: trunk/src/Avatar.cpp =================================================================== --- trunk/src/Avatar.cpp 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/Avatar.cpp 2009-02-21 22:01:23 UTC (rev 1064) @@ -25,7 +25,8 @@ namespace OpenGate{ Avatar::Avatar( const std::string & name, Uint32 ID ): name_( name ), id_( ID ) { - cargoHold_ = 0; + cargoHold_ = 0; + isRegistered_ = false; } Avatar::~Avatar( ){ Modified: trunk/src/Avatar.h =================================================================== --- trunk/src/Avatar.h 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/Avatar.h 2009-02-21 22:01:23 UTC (rev 1064) @@ -41,7 +41,7 @@ ~Avatar( ); - std::string name() const { return name_; } + const std::string & name() const { return name_; } Uint32 userID() const { return id_; } @@ -63,6 +63,10 @@ bool unLoadItem( Entity * item ); + void setRegistered( bool registered ) { isRegistered_ = registered; } + + bool isRegistered() const { return isRegistered_; } + protected: std::string name_; Uint32 id_; @@ -72,6 +76,8 @@ Uint16 maxCargoHold_; Uint16 cargoHold_; std::list< std::deque < Entity * > > floorCargo_; + + bool isRegistered_; }; } // namespace OpenGate{ Modified: trunk/src/GameStateManager.cpp =================================================================== --- trunk/src/GameStateManager.cpp 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/GameStateManager.cpp 2009-02-21 22:01:23 UTC (rev 1064) @@ -448,7 +448,7 @@ bool GameStateManager::captureNetwork(){ //** start capture network; std::vector < std::vector < char > > msgs; - std::vector < MessageBodyShipMovement > movements; + std::vector < MessageBodyShipMovement * > movements; resources_.network->pull( msgs ); Sector * sector = NULL; @@ -475,22 +475,23 @@ case PROTO_SHIP_REGISTER: if ( sector ) sector->receiveVesselRegister( &msgs[ i ][ 0 ] ); break; case PROTO_SHIP_DEREGISTER: if ( sector ) sector->receiveVesselDeRegister( &msgs[ i ][ 0 ] ); break; // case PROTO_SHIP_DIED: if ( sector ) sector->receiveVesselDied( &msgs[ i ][ 0 ] ); break; -// case PROTO_SHIP_STATUS: if ( sector ) sector->receiveVesselStatus( &msgs[ i ][ 0 ] ); break; -// case PROTO_SHIP_MOVEMENT:{ + case PROTO_SHIP_STATUS: if ( sector ) sector->receiveVesselStatus( &msgs[ i ][ 0 ] ); break; + case PROTO_SHIP_MOVEMENT:{ // //** we handle that in sum, so we can ignore dups because of packet loss -// MessageBodyShipMovement *msg = new MessageBodyShipMovement( &msgs[ i ][ 0 ] ); -// movements.push_back( MessageBodyShipMovement( &msgs[ i ][ 0 ] ) ); -// } break; -// case PROTO_SHIP_PROJECTILEFIRED: if ( sector ) sector->receiveProjectile( &msgs[ i ][ 0 ] ); break; -// case PROTO_SHIP_AMMOHIT: if ( sector ) sector->receiveVesselAmmoHit( &msgs[ i ][ 0 ] ); break; - + MessageBodyShipMovement *msg = new MessageBodyShipMovement( &msgs[ i ][ 0 ] ); + movements.push_back( msg ); + //movements.push_back( MessageBodyShipMovement( &msgs[ i ][ 0 ] ) ); + } break; + case PROTO_SHIP_PROJECTILEFIRED: if ( sector ) sector->receiveProjectile( &msgs[ i ][ 0 ] ); break; + case PROTO_SHIP_AMMOHIT: if ( sector ) sector->receiveVesselAmmoHit( &msgs[ i ][ 0 ] ); break; default: std::cerr << "PROTO type unknown: " << msgs[ i ][ 0 ] << " " << msgs[ i ].size() << std::endl; break; } } - // if ( movements.size() > 0 && sector ) sector->receiveVesselMovement( movements ); - } + if ( movements.size() > 0 && sector ) sector->receiveVesselMovement( movements ); + for ( size_t i = 0; i < movements.size(); i ++ ) delete movements[ i ]; + } return true; } Modified: trunk/src/GunObject.cpp =================================================================== --- trunk/src/GunObject.cpp 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/GunObject.cpp 2009-02-21 22:01:23 UTC (rev 1064) @@ -34,8 +34,8 @@ namespace OpenGate{ -GunObject::GunObject( Gun * gun ) - : gun_( gun ), parent_( NULL ), mountPoint_( NULL ), gunSound_( NULL ) { +GunObject::GunObject( Gun * gunBluePrint ) + : gunBluePrint_( gunBluePrint ), parent_( NULL ), mountPoint_( NULL ), gunSound_( NULL ) { delayTime_ = 0; } @@ -43,7 +43,7 @@ OpenALSoundManager::getSingleton().destroySoundSource( gunSound_ ); } -void GunObject::mount( SectorMovableObject * parent, Ogre::SceneNode * mountPoint ){ +void GunObject::mount( SectorVesselObject * parent, Ogre::SceneNode * mountPoint ){ parent_ = parent; mountPoint_ = mountPoint; gunSound_ = OpenALSoundManager::getSingleton().createSoundSourceFromRessource( "sounds/defaultLaser", @@ -53,28 +53,28 @@ } void GunObject::update( const Ogre::Real elapsedTime ){ - delayTime_ -= elapsedTime; + delayTime_ -= elapsedTime; } -Ogre::Vector3 GunObject::mountPosition() const { +const Ogre::Vector3 & GunObject::mountPosition() const { return mountPoint_->_getDerivedPosition(); } bool GunObject::fire( Uint32 & capacity ){ - if ( delayTime_ < 0 ){ - if ( capacity > gun_->powerConsumption() ){ - capacity -= gun_->powerConsumption(); - delayTime_ = gun_->fireDelay(); - if ( gunSound_ ){ - gunSound_->setPosition( mountPoint_->_getDerivedPosition() ); - //gunSound_->setVelocity( parent_->velocity() ); - // gunSound_->setDirection( parent_->mainNode()->getOrientation().zAxis() ); - gunSound_->play(); - } - return true; + if ( delayTime_ < 0 ){ + if ( capacity > gunBluePrint_->powerConsumption() ){ + capacity -= gunBluePrint_->powerConsumption(); + delayTime_ = gunBluePrint_->fireDelay(); + if ( gunSound_ ){ + gunSound_->setPosition( mountPoint_->_getDerivedPosition() ); + //gunSound_->setVelocity( parent_->velocity() ); + //gunSound_->setDirection( parent_->mainNode()->getOrientation().zAxis() ); + gunSound_->play(); + } + return true; + } } - } - return false; + return false; } EngineObject::EngineObject( Engine * engineBluePrint, const std::string & name, Ogre::SceneNode * mountNode, const Ogre::Vector3 & position ) Modified: trunk/src/GunObject.h =================================================================== --- trunk/src/GunObject.h 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/GunObject.h 2009-02-21 22:01:23 UTC (rev 1064) @@ -33,33 +33,32 @@ ~GunObject( ); - void mount( SectorMovableObject * parent, Ogre::SceneNode * mountPoint ); + void mount( SectorVesselObject * parent, Ogre::SceneNode * mountPoint ); void update( const Ogre::Real elapsedTime ); bool fire( Uint32 & capacity ); - inline Gun * gun(){ return gun_;} + inline Gun * gunBluePrint(){ return gunBluePrint_;} - inline Gun * gun() const { return gun_;} + inline Gun & gunBluePrint() const { return *gunBluePrint_;} - inline SectorMovableObject * parent() { return parent_; } + inline SectorVesselObject * parent() { return parent_; } // void setMountPosition( const Ogre::Vector3 & mountPosition ) { mountPosition_ = mountPosition; } - Ogre::Vector3 mountPosition() const; + const Ogre::Vector3 & mountPosition() const; inline Ogre::SceneNode * sceneNode() { return mountPoint_; } inline Ogre::SceneNode & sceneNode() const { return *mountPoint_; } protected: - Gun * gun_; - SectorMovableObject * parent_; + Gun * gunBluePrint_; + SectorVesselObject * parent_; Ogre::SceneNode * mountPoint_; Ogre::Real delayTime_; Ogre::Vector3 mountPosition_; OpenALSoundSource * gunSound_; - }; /*! Construct an engine with a grafical representation i.e. thruster effects. */ Modified: trunk/src/Hud.cpp =================================================================== --- trunk/src/Hud.cpp 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/Hud.cpp 2009-02-21 22:01:23 UTC (rev 1064) @@ -59,6 +59,14 @@ } Hud::~Hud(){ + //!** reset sizes + velocityProgress_->setHeight( CEGUI::UDim( 0.0, velocityProgressHeight_ ) ); + thrustProgress_->setHeight( CEGUI::UDim( 0.0, thrustProgressHeight_ ) ); + fuelProgress_->setHeight( CEGUI::UDim( 0.0, fuelProgressHeight_ ) ); + capacitorProgress_->setHeight( CEGUI::UDim( 0.0, capacitorProgressHeight_ ) ); + armorProgress_->setHeight( CEGUI::UDim( 0.0, armorProgressHeight_ ) ); + shieldProgress_->setHeight( CEGUI::UDim( 0.0, shieldProgressHeight_ ) ); + hide(); avatar_->sector()->sceneManager()->destroyEntity( "FlightArrow/Entity" ); flightArrowNode_->removeAndDestroyChild( "FlightArrow/TransNode" ); @@ -100,7 +108,7 @@ targetArrowNode_->setPosition( 0.0, -0.08, -1.2 ); targetArrowNode_->setVisible( false ); - //** OGRE overlay based stuff + //!** OGRE overlay based stuff overlayName_ = "SimpleHUD"; hudOverlay_ = Ogre::OverlayManager::getSingleton().getByName( overlayName_ ); // mousePointer_ = hudOverlay_->getChild( overlayName_ + "/FlightCursor" ); @@ -110,7 +118,7 @@ hudOverlay_->show(); - //** CEGUI based stuff + //!** CEGUI based stuff targetCursor_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDTargetCursor" ); targetCursorHalfWidth_ = targetCursor_->getWidth().asAbsolute( 0.0 ) / 2.0; targetCursorHalfHeight_ = targetCursor_->getHeight().asAbsolute( 0.0 ) / 2.0; @@ -274,9 +282,9 @@ target_->rtti() == SECTOR_MISSILE_OBJECT_RTTI ){ SectorMovableObject * targ = dynamic_cast< SectorMovableObject *>( target_ ); - targetVelocity_->setText( "V" + Ogre::StringConverter::toString( round((Ogre::Real)targ->speed(), 2 ), 4 ) ); - targetShieldText_->setText( "S" + Ogre::StringConverter::toString( round( (Ogre::Real)targ->shield() / targ->maxShield() * 100.0f, 1), 4 ) ); - targetArmorText_->setText( "A" + Ogre::StringConverter::toString( round( (Ogre::Real)targ->armor() / targ->maxArmor() * 100.0f, 1), 4 ) ); + targetVelocity_->setText( "V" + Ogre::StringConverter::toString( round((Ogre::Real)targ->speed(), 2 ), 4 ) ); + targetShieldText_->setText( "S" + Ogre::StringConverter::toString( round( targ->shieldRate() * 100.0f, 1), 4 ) ); + targetArmorText_->setText( "A" + Ogre::StringConverter::toString( round( targ->armorRate() * 100.0f, 1), 4 ) ); } else { targetVelocity_->setText( "" ); @@ -288,44 +296,43 @@ } Ogre::Real height = avatar_->speedRate() * velocityProgressHeight_; - velocityProgress_->setYPosition( CEGUI::UDim( 0.5, velocityProgressHeight_/2.0 - height ) ); + velocityProgress_->setYPosition( CEGUI::UDim( 0.5, velocityProgressHeight_ / 2.0 - height ) ); velocityProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); velocityProgressImg_->setYPosition( CEGUI::UDim( 0, -velocityProgressHeight_ + height ) ); height = avatar_->capacityRate() * capacitorProgressHeight_; - capacitorProgress_->setYPosition( CEGUI::UDim( 0.5, capacitorProgressHeight_/2.0 - height ) ); + capacitorProgress_->setYPosition( CEGUI::UDim( 0.5, capacitorProgressHeight_ / 2.0 - height ) ); capacitorProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); capacitorProgressImg_->setYPosition( CEGUI::UDim( 0, -capacitorProgressHeight_ + height ) ); height = avatar_->thrustRate() * thrustProgressHeight_; - thrustProgress_->setYPosition( CEGUI::UDim( 0.5, thrustProgressHeight_/2.0 - height ) ); + thrustProgress_->setYPosition( CEGUI::UDim( 0.5, thrustProgressHeight_ / 2.0 - height ) ); thrustProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); thrustProgressImg_->setYPosition( CEGUI::UDim( 0, -thrustProgressHeight_ + height ) ); - // -// height = avatar_->shieldRate() * shieldProgressHeight_; -// shieldProgress_->setYPosition( CEGUI::UDim( 0.5, - height + height/2.0 ) ); -// shieldProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); -// shieldProgressLeftImg_->setYPosition( CEGUI::UDim( 0.5, -shieldProgressHeight_/2.0 ) ); -// shieldProgressRightImg_->setYPosition( CEGUI::UDim( 0.5, -shieldProgressHeight_/2.0 ) ); - // -// height = avatar_->armorRate() * armorProgressHeight_; -// armorProgress_->setYPosition( CEGUI::UDim( 0.5, - height + height/2.0 ) ); -// armorProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); -// armorProgressLeftImg_->setYPosition( CEGUI::UDim( 0.5, -armorProgressHeight_/2.0 ) ); -// armorProgressRightImg_->setYPosition( CEGUI::UDim( 0.5, -armorProgressHeight_/2.0 ) ); - // - if ( avatar_->brakePressed() ){ - velocityText_->setProperty( "TextColours", "ffff0000" ); - } else if (avatar_->afterburnerPressed()){ - velocityText_->setProperty( "TextColours", "ff00ff00" ); - } else { - velocityText_->setProperty( "TextColours", "ffffffff" ); - } - velocityText_->setText( "V" + Ogre::StringConverter::toString( round( (Ogre::Real)avatar_->speed(), 2 ), 4 ) ); - -// shieldText_->setText( "S" + Ogre::StringConverter::toString( avatar_->shieldRate() * 100.0f, 4 ) ); -// armorText_->setText( "A" + Ogre::StringConverter::toString( avatar_->armorRate() * 100.0f, 4 ) ); + height = avatar_->shieldRate() * shieldProgressHeight_; + shieldProgress_->setYPosition( CEGUI::UDim( 0.5, height / 2.0 -height) ); + shieldProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); + shieldProgressLeftImg_->setYPosition( CEGUI::UDim( 0.5, -shieldProgressHeight_/2.0 ) ); + shieldProgressRightImg_->setYPosition( CEGUI::UDim( 0.5, -shieldProgressHeight_/2.0 ) ); + + height = avatar_->armorRate() * armorProgressHeight_; + armorProgress_->setYPosition( CEGUI::UDim( 0.5, height / 2.0 - height ) ); + armorProgress_->setHeight( CEGUI::UDim( 0.0, height ) ); + armorProgressLeftImg_->setYPosition( CEGUI::UDim( 0.5, -armorProgressHeight_/2.0 ) ); + armorProgressRightImg_->setYPosition( CEGUI::UDim( 0.5, -armorProgressHeight_/2.0 ) ); + + if ( avatar_->brakePressed() ){ + velocityText_->setProperty( "TextColours", "ffff0000" ); + } else if (avatar_->afterburnerPressed()){ + velocityText_->setProperty( "TextColours", "ff00ff00" ); + } else { + velocityText_->setProperty( "TextColours", "ffffffff" ); + } + + velocityText_->setText( "V" + Ogre::StringConverter::toString( round( (Ogre::Real)avatar_->speed(), 2 ), 4 ) ); + shieldText_->setText( "S" + Ogre::StringConverter::toString( round( avatar_->shieldRate() * 100.0f, 1), 4 ) ); + armorText_->setText( "A" + Ogre::StringConverter::toString( round( avatar_->armorRate() * 100.0f, 1), 4 ) ); // OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps"); Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/Makefile.am 2009-02-21 22:01:23 UTC (rev 1064) @@ -1,9 +1,10 @@ bin_PROGRAMS = \ opengateclient \ opengateserver - -opengateclient_SOURCES = \ - opengateclient.cpp \ + +lib_LIBRARIES = libopengate.a + +libopengate_a_SOURCES = \ common.h \ common.cpp \ commonWithOgre.h \ @@ -69,8 +70,6 @@ Opengate.h \ OpenALSoundManager.h \ OpenALSoundManager.cpp \ - Projectile.h \ - Projectile.cpp \ RadarObject.h \ RadarObject.cpp \ ResourceManager.h \ @@ -118,7 +117,28 @@ metaserver.h \ metaserver.cpp +libopengate_a_LDFLAGS = \ + $(OGRE_LIBS) \ + $(CEGUI_LIBS) \ + $(CEGUIOGRE_LIBS) \ + $(freealut_LIBS) \ + $(vorbisfile_LIBS) \ + $(OIS_LIBS) \ + $(ogreopcode_LIBS) + +libopengate_a_CXXFLAGS = \ + $(OGRE_CFLAGS) \ + $(CEGUI_CFLAGS) \ + $(ogreopcode_CFLAGS) + +opengateclient_SOURCES = \ + opengateclient.cpp + +opengateclient_DEPENDENCIES = \ + libopengate.a + opengateclient_LDFLAGS = \ + libopengate.a \ $(OGRE_LIBS) \ $(CEGUI_LIBS) \ $(CEGUIOGRE_LIBS) \ @@ -131,25 +151,179 @@ $(OGRE_CFLAGS) \ $(CEGUI_CFLAGS) \ $(ogreopcode_CFLAGS) - + opengateserver_SOURCES = \ opengateserver.cpp \ - common.h \ - common.cpp \ - LogManagerBase.h \ - LogManagerBase.cpp \ - networkProtocol.h \ - networkProtocol.cpp \ - networkServer.h \ - networkServer.cpp \ - networkServerUser.h \ - networkServerUser.cpp \ - metaserver.h \ - metaserver.cpp + networkServer.h \ + networkServer.cpp \ + networkServerUser.h \ + networkServerUser.cpp +opengateserver_DEPENDENCIES = \ + libopengate.a + opengateserver_LDFLAGS = \ + libopengate.a \ + $(OGRE_LIBS) \ + $(CEGUI_LIBS) \ + $(CEGUIOGRE_LIBS) \ + $(freealut_LIBS) \ + $(vorbisfile_LIBS) \ + $(OIS_LIBS) \ $(ogreopcode_LIBS) +opengateserver_CXXFLAGS = \ + $(OGRE_CFLAGS) \ + $(CEGUI_CFLAGS) \ + $(ogreopcode_CFLAGS) + + +# common.h \ +# common.cpp \ +# commonWithOgre.h \ +# commonWithOgre.cpp \ +# networkProtocol.h \ +# networkProtocol.cpp \ +# networkClient.h \ +# networkClient.cpp \ +# tinyxml/tinyxml.h \ +# tinyxml/tinyxml.cpp \ +# tinyxml/tinyxmlerror.cpp \ +# tinyxml/tinyxmlparser.cpp \ +# Avatar.h \ +# Avatar.cpp \ +# AiCommands.h \ +# AiCommands.cpp \ +# AiManager.h \ +# AiManager.cpp \ +# AiObject.h \ +# AiObject.cpp \ +# BaseDialog.h \ +# BaseDialog.cpp \ +# BaseObject.h \ +# BaseObject.cpp \ +# ConfigDialog.h \ +# ConfigDialog.cpp \ +# Console.h \ +# Console.cpp \ +# DockedState.h \ +# DockedState.cpp \ +# Entity.h \ +# Entity.cpp \ +# EntityManager.h \ +# EntityManager.cpp \ +# Equipment.h \ +# Equipment.cpp \ +# GameState.h \ +# GameState.cpp \ +# GameStateManager.h \ +# GameStateManager.cpp \ +# GunObject.h\ +# GunObject.cpp\ +# Hud.h\ +# Hud.cpp\ +# InputManager.h \ +# InputManager.cpp \ +# InitState.h \ +# InitState.cpp \ +# KeyMap.h \ +# KeyMap.cpp \ +# LogManager.h \ +# LogManager.cpp \ +# LogManagerBase.h \ +# LogManagerBase.cpp \ +# MarketDialog.h \ +# MarketDialog.cpp \ +# Missile.h \ +# Missile.cpp \ +# Moveable.h \ +# Moveable.cpp \ +# OpcodeWrapper.h \ +# OpcodeWrapper.cpp \ +# Opengate.h \ +# OpenALSoundManager.h \ +# OpenALSoundManager.cpp \ +# Projectile.h \ +# Projectile.cpp \ +# RadarObject.h \ +# RadarObject.cpp \ +# ResourceManager.h \ +# ResourceManager.cpp \ +# Sector.h \ +# Sector.cpp \ +# SectorAvatarObject.h \ +# SectorAvatarObject.cpp \ +# SectorBaseObject.h \ +# SectorBaseObject.cpp \ +# SectorBeaconObject.h \ +# SectorBeaconObject.cpp \ +# SectorBeaconPadObject.h \ +# SectorBeaconPadObject.cpp \ +# SectorChildObject.h \ +# SectorChildObject.cpp \ +# SectorCollisionObject.h \ +# SectorCollisionObject.cpp \ +# SectorEnvironmentObject.h \ +# SectorEnvironmentObject.cpp \ +# SectorExplosionObject.h \ +# SectorExplosionObject.cpp \ +# SectorMeshObject.h \ +# SectorMeshObject.cpp \ +# SectorMissileObject.h \ +# SectorMissileObject.cpp \ +# SectorMovableObject.h \ +# SectorMovableObject.cpp \ +# SectorPadObject.h \ +# SectorPadObject.cpp \ +# SectorStationObject.h \ +# SectorStationObject.cpp \ +# SectorStationPadObject.h \ +# SectorStationPadObject.cpp \ +# SectorVesselObject.h \ +# SectorVesselObject.cpp \ +# SectorProjectileObject.h \ +# SectorProjectileObject.cpp \ +# ShipConfigDialog.h \ +# ShipConfigDialog.cpp \ +# UnDockedState.cpp \ +# UnDockedState.h \ +# Vessel.h \ +# Vessel.cpp \ +# metaserver.h \ +# metaserver.cpp + +# opengateclient_LDFLAGS = \ +# $(OGRE_LIBS) \ +# $(CEGUI_LIBS) \ +# $(CEGUIOGRE_LIBS) \ +# $(freealut_LIBS) \ +# $(vorbisfile_LIBS) \ +# $(OIS_LIBS) \ +# $(ogreopcode_LIBS) +# +# opengateclient_CXXFLAGS = \ +# $(OGRE_CFLAGS) \ +# $(CEGUI_CFLAGS) \ +# $(ogreopcode_CFLAGS) + +# opengateserver_SOURCES = \ +# opengateserver.cpp \ +# common.h \ +# common.cpp \ +# LogManagerBase.h \ +# LogManagerBase.cpp \ +# networkProtocol.h \ +# networkProtocol.cpp \ +# networkServer.h \ +# networkServer.cpp \ +# networkServerUser.h \ +# networkServerUser.cpp \ +# metaserver.h \ +# metaserver.cpp +# +# opengateserver_LDFLAGS = \ +# $(ogreopcode_LIBS) + # opengateserver_CXXFLAGS = \ # $(ogreopcode_CFLAGS) Modified: trunk/src/OpcodeWrapper.cpp =================================================================== --- trunk/src/OpcodeWrapper.cpp 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/OpcodeWrapper.cpp 2009-02-21 22:01:23 UTC (rev 1064) @@ -190,90 +190,90 @@ -void OpcodeCollisionDetection::createObject( BaseObject * obj ){ - - if ( obj && active_ ){ - OgreOpcode::CollisionObject * collObj = obj->collisionObject(); +// void OpcodeCollisionDetection::createObject( BaseObject * obj ){ +// +// if ( obj && active_ ){ +// OgreOpcode::CollisionObject * collObj = obj->collisionObject(); +// +// if ( !collObj ){ +// +// OgreOpcode::EntityCollisionShape * collShape = collisionManager_->createEntityCollisionShape( obj->name() + "/CollShape" ); +// if ( obj->entity() ){ +// collShape->load( obj->entity() ); +// } else { +// std::cout << "OpcodeCollisionDetection::createObject( BaseObject * obj ), no entity defined for obj: " << obj->name(); +// } +// +// collObj = collideInSectorContext_->createObject( obj->name() + "/CollObj" ); +// collObj->setCollClass( collisionManager_->queryCollClass( obj->collisionClass() ) ); +// collObj->setShape( collShape ); +// +// collObj->setClientData( obj ); +// collideInSectorContext_->addObject( collObj ); +// +// obj->setCollisionObject( collObj ); +// } +// } +// } +// +// void OpcodeCollisionDetection::destroyObject( BaseObject * obj ){ +// +// if ( obj && active_ ){ +// destroy( obj->collisionObject() ); +// obj->setCollisionObject( NULL ); +// } +// } +// +// void OpcodeCollisionDetection::detach( BaseObject * obj ){ +// if ( obj && active_ ){ +// destroyObject( obj ); +// } +// } +// +// void OpcodeCollisionDetection::attach( BaseObject * obj ){ +// if ( obj && active_ ){ +// createObject( obj ); +// } +// } +// +// bool OpcodeCollisionDetection::checkCollideRay( BaseObject * obj, const Ogre::Ray & ray, double rayLength){ +// if ( active_ ){ +// if ( !obj->isSetDestroyRequest() ){ +// OgreOpcode::CollisionPair ** rayPickReport; +// +// uint nColl = collideInSectorContext_->rayCheck( ray, rayLength, OgreOpcode::COLLTYPE_EXACT, +// OgreOpcode::COLLTYPE_ALWAYS_EXACT, rayPickReport ); +// +// // std::cout << "OpcodeCollisionDetection::checkCollideRay()" << " " << rayLength << " " << nColl <<std::endl; +// +// for ( uint i = 0; i < nColl; i ++ ){ +// /* std::cout << "OpcodeCollisionDetection::checkCollideRay()" << " " << rayLength << " " << nColl <<std::endl;*/ +// +// OgreOpcode::CollisionObject* col1 = rayPickReport[ i ]->this_object; +// OgreOpcode::CollisionObject* col2 = rayPickReport[ i ]->other_object; +// +// // std::cout << "checkCollideRay: " << i << " " +// // << static_cast< BaseObject * >( col1->getClientData() )->name() << "<->" +// // << static_cast< BaseObject * >( col2->getClientData() )->name() << std::endl; +// +// if ( obj->rtti() == PROJECTILE_RTTI ){ +// if ( dynamic_cast< Projectile * >( obj )->parent() != +// static_cast< BaseObject * >( col1->getClientData() ) ){ +// obj->mainNode()->setPosition( rayPickReport[ i ]->contact ); +// obj->collide( static_cast< BaseObject * >( col2->getClientData() ) ); +// static_cast< BaseObject * >( col1->getClientData() )->collide( obj ); +// return true; +// } +// } else if ( obj != col1->getClientData() ){ +// obj->collide( static_cast< BaseObject * >( col2->getClientData() ) ); +// static_cast< BaseObject * >( col1->getClientData() )->collide( obj ); +// } +// } +// } +// } +// return false; +// } - if ( !collObj ){ - - OgreOpcode::EntityCollisionShape * collShape = collisionManager_->createEntityCollisionShape( obj->name() + "/CollShape" ); - if ( obj->entity() ){ - collShape->load( obj->entity() ); - } else { - std::cout << "OpcodeCollisionDetection::createObject( BaseObject * obj ), no entity defined for obj: " << obj->name(); - } - - collObj = collideInSectorContext_->createObject( obj->name() + "/CollObj" ); - collObj->setCollClass( collisionManager_->queryCollClass( obj->collisionClass() ) ); - collObj->setShape( collShape ); - - collObj->setClientData( obj ); - collideInSectorContext_->addObject( collObj ); - - obj->setCollisionObject( collObj ); - } - } -} - -void OpcodeCollisionDetection::destroyObject( BaseObject * obj ){ - - if ( obj && active_ ){ - destroy( obj->collisionObject() ); - obj->setCollisionObject( NULL ); - } -} - -void OpcodeCollisionDetection::detach( BaseObject * obj ){ - if ( obj && active_ ){ - destroyObject( obj ); - } -} - -void OpcodeCollisionDetection::attach( BaseObject * obj ){ - if ( obj && active_ ){ - createObject( obj ); - } -} - -bool OpcodeCollisionDetection::checkCollideRay( BaseObject * obj, const Ogre::Ray & ray, double rayLength){ - if ( active_ ){ - if ( !obj->isSetDestroyRequest() ){ - OgreOpcode::CollisionPair ** rayPickReport; - - uint nColl = collideInSectorContext_->rayCheck( ray, rayLength, OgreOpcode::COLLTYPE_EXACT, - OgreOpcode::COLLTYPE_ALWAYS_EXACT, rayPickReport ); - - // std::cout << "OpcodeCollisionDetection::checkCollideRay()" << " " << rayLength << " " << nColl <<std::endl; - - for ( uint i = 0; i < nColl; i ++ ){ -/* std::cout << "OpcodeCollisionDetection::checkCollideRay()" << " " << rayLength << " " << nColl <<std::endl;*/ - - OgreOpcode::CollisionObject* col1 = rayPickReport[ i ]->this_object; - OgreOpcode::CollisionObject* col2 = rayPickReport[ i ]->other_object; - - // std::cout << "checkCollideRay: " << i << " " - // << static_cast< BaseObject * >( col1->getClientData() )->name() << "<->" - // << static_cast< BaseObject * >( col2->getClientData() )->name() << std::endl; - - if ( obj->rtti() == PROJECTILE_RTTI ){ - if ( dynamic_cast< Projectile * >( obj )->parent() != - static_cast< BaseObject * >( col1->getClientData() ) ){ - obj->mainNode()->setPosition( rayPickReport[ i ]->contact ); - obj->collide( static_cast< BaseObject * >( col2->getClientData() ) ); - static_cast< BaseObject * >( col1->getClientData() )->collide( obj ); - return true; - } - } else if ( obj != col1->getClientData() ){ - obj->collide( static_cast< BaseObject * >( col2->getClientData() ) ); - static_cast< BaseObject * >( col1->getClientData() )->collide( obj ); - } - } - } - } - return false; -} - void OpcodeCollisionDetection::info( ){ std::cout << "OpcodeCollisionDetection::info( )" << std::endl; Modified: trunk/src/OpcodeWrapper.h =================================================================== --- trunk/src/OpcodeWrapper.h 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/OpcodeWrapper.h 2009-02-21 22:01:23 UTC (rev 1064) @@ -55,22 +55,6 @@ /*! Write some debug infos about all collision objects to stdout*/ void info( ); - - /*! DEPRECATED */ - void createObject( BaseObject * obj ); - - /*! DEPRECATED */ - void destroyObject( BaseObject * obj ); - - /*! DEPRECATED */ - void detach( BaseObject * obj ); - - /*! DEPRECATED */ - void attach( BaseObject * obj ); - - /*! DEPRECATED */ - bool checkCollideRay( BaseObject * obj, const Ogre::Ray & ray, double rayLength ); - protected: OgreOpcode::CollisionContext * collideInSectorContext_; OgreOpcode::CollisionManager * collisionManager_; Modified: trunk/src/Opengate.h =================================================================== --- trunk/src/Opengate.h 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/Opengate.h 2009-02-21 22:01:23 UTC (rev 1064) @@ -74,8 +74,9 @@ class AiManager; class Avatar; -class BaseObject; +class ClientUserObject; class Console; + class DockedState; class UnDockedState; @@ -104,7 +105,6 @@ class ResourceManager; - class Sector; class SectorAvatarObject; class SectorBaseObject; Modified: trunk/src/RadarObject.cpp =================================================================== --- trunk/src/RadarObject.cpp 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/RadarObject.cpp 2009-02-21 22:01:23 UTC (rev 1064) @@ -145,7 +145,6 @@ std::map< SectorMeshObject *, RadarViewable * >::iterator itTarget = objects_.find( obj ); if ( itTarget != objects_.end() ) delete itTarget->second; objects_.erase( obj ); - if ( target_ == obj ) findNextTarget(); } Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/Sector.cpp 2009-02-21 22:01:23 UTC (rev 1064) @@ -26,11 +26,13 @@ #include "Avatar.h" #include "EntityManager.h" +#include "Equipment.h" #include "GunObject.h" #include "LogManager.h" #include "Missile.h" #include "networkClient.h" #include "OpcodeWrapper.h" +#include "Projectile.h" #include "RadarObject.h" #include "ResourceManager.h" #include "SectorAvatarObject.h" @@ -59,16 +61,25 @@ log_ = LogManager::getSingletonPtr(); name_ = "unknown"; listener_ = NULL; + avatarObject_ = NULL; avatar_ = NULL; childIDCounter_ = 0; + timeSinceLastNetworkUpdate_ = 0.0; + timeSinceLastStatusUpdate_ = 0.0; ecliptic_ = new SectorEclipticObject( this ); sectorEnvironment_.insert( ecliptic_ ); showEcliptic( false ); createKoordAxis( ); + avatarDeathSequenceTime_ = 0.0; } Sector::~Sector( ){ + if ( avatar_->isRegistered() ) { + sendVesselDeRegister( avatarObject_ ); + avatar_->setRegistered( false ); + } + for_each( sectorEnvironment_.begin(), sectorEnvironment_.end(), deletePtr() ); for_each( sectorCollObjects_.begin(), sectorCollObjects_.end(), deletePtr() ); for_each( sectorMeshObjects_.begin(), sectorMeshObjects_.end(), deletePtr() ); @@ -103,6 +114,21 @@ destructMeshObject_( (*it++) ); } else ++it; } + + //** send movement data, max 10 net-updates/second + timeSinceLastNetworkUpdate_ += elapsedTime; + timeSinceLastStatusUpdate_ += elapsedTime; + + if ( timeSinceLastNetworkUpdate_ > 0.1 ){ + sendAllVesselMovements( ); + timeSinceLastNetworkUpdate_ = 0.0; + } + + if ( avatarDeathSequenceTime_ > 0.0 ){ + avatarDeathSequenceTime_ -= elapsedTime; + } else if ( avatarDeathSequenceTime_ < 0.0 ){ + listener_->avatarDeathSequence( false ); + } return true; } @@ -137,8 +163,11 @@ objectHeap_[ dynamic_cast< SectorMissileObject * >( obj )->missile()->name() ].push_back( obj ); break; case SECTOR_AVATAR_OBJECT_RTTI: - objectHeap_[ dynamic_cast< SectorMissileObject * >( obj )->missile()->name() ].push_back( obj ); - sendVesselDeRegister( dynamic_cast< SectorAvatarObject * >( obj ) ); + objectHeap_[ dynamic_cast< SectorVesselObject * >( obj )->vessel()->name() ].push_back( obj ); + if ( avatar_->isRegistered() ) sendVesselDeRegister( dynamic_cast< SectorAvatarObject * >( obj ) ); + avatar_->setRegistered( false ); + listener_->avatarDeathSequence( true ); + avatarDeathSequenceTime_ = 2.0; break; default: delete( obj ); @@ -204,18 +233,19 @@ } SectorAvatarObject * Sector::createAvatarObject( Avatar * avatar ){ + avatar_ = avatar; log_->info( std::string( "Sector::createAvatarObject: " ) + avatar->name() ); - avatar_ = new SectorAvatarObject( avatar->name(), this, avatar->vessel() ); - avatar_->reset(); + avatarObject_ = new SectorAvatarObject( avatar->name(), this, avatar->vessel() ); + avatarObject_->reset(); bool hasStation = false; if ( !sectorStations_.empty() ){ SectorStationObject *station = dynamic_cast< SectorStationObject* >( *sectorStations_.begin() ); log_->info( std::string( "launch avatar from station " ) ); if ( station->launchPad() ){ - avatar_->mainNode()->setPosition( station->launchPad()->position( true ) + station->launchPad()->direction( true ) * 5.0); - avatar_->mainNode()->setDirection( station->launchPad()->direction( true ) ); - avatar_->setVelocity( station->launchPad()->direction( true ) * 20.0 ); + avatarObject_->mainNode()->setPosition( station->launchPad()->position( true ) + station->launchPad()->direction( true ) * 5.0); + avatarObject_->mainNode()->setDirection( station->launchPad()->direction( true ) ); + avatarObject_->setVelocity( station->launchPad()->direction( true ) * 20.0 ); hasStation = true; } else { log_->warn( std::string( "Station " + station->name() + " has no launch pad" ) ); @@ -223,15 +253,16 @@ } if ( !hasStation ) { log_->info( std::string( "launch avatar from free position " ) ); - avatar_->mainNode()->setPosition( 0.0, 0.0, 0.0 ); - avatar_->mainNode()->setDirection( Ogre::Vector3( 0.0, 0.0, -1.0 ) ); - avatar_->setVelocity( Ogre::Vector3( 0.0, 0.0, 0.0 ) ); + avatarObject_->mainNode()->setPosition( 0.0, 0.0, 0.0 ); + avatarObject_->mainNode()->setDirection( Ogre::Vector3( 0.0, 0.0, -1.0 ) ); + avatarObject_->setVelocity( Ogre::Vector3( 0.0, 0.0, 0.0 ) ); } - insertMeshObject_( avatar_ ); + insertMeshObject_( avatarObject_ ); - sendVesselRegister( avatar_ ); + sendVesselRegister( avatarObject_ ); + avatar_->setRegistered( true ); - return avatar_; + return avatarObject_; } SectorVesselObject * Sector::createVesselObject( Vessel * vessel ){ @@ -283,9 +314,15 @@ insertCollObject_( obj ); } -void Sector::createProjectile( GunObject * obj, int shots ){ +SectorProjectileObject * Sector::createProjectile( GunObject * obj, int shots ){ SectorProjectileObject * ammo = new SectorProjectileObject( obj->parent()->name() + "Ammo_" + toStr( shots ), this, obj ); insertCollObject_( ammo ); + + if ( obj->parent() == avatarObject_ ){ + sendProjectile( ammo ); + } + + return ammo; } void Sector::objectDocked( SectorMovableObject * obj, SectorStationObject * station ){ @@ -440,6 +477,25 @@ koordAxisNode_->scale( length, length, length ); } +void Sector::sendAllVesselMovements( ){ + if ( avatarObject_ ) { + sendVesselMovement( avatarObject_ ); + } +} + +void Sector::sendAllVesselInfos( ){ + if ( avatarObject_ ){ + sendVesselStatus( avatarObject_ ); + } + +// for ( std::map< long, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ +// if ( it->second->target() == avatar_ ){ +// sendVesselMovement( it->second ); +// sendVesselStatus( it->second ); +// } +// } +} + void Sector::sendVesselRegister( SectorVesselObject * obj ){ if ( obj ) { log_->info( std::string( "Send register " ) + obj->name() + " id:" + toStr( obj->vessel()->id() ) ); @@ -461,12 +517,17 @@ user->setSectorObject( obj ); obj->mainNode()->setPosition( toOgreVec( msg.position() ) ); - -// obj->setMass( msg.mass() ); -// obj->setMaxShield( msg.maxShield() ); -// obj->setMaxThrust( msg.maxThrust() ); -// obj->setMaxSpeed( std::sqrt( msg.maxThrust() / obj->movable()->dragFactor() ) ); - } + + obj->setMass( msg.mass() ); + obj->setMaxShield( msg.maxShield() ); + obj->setMaxThrust( msg.maxThrust() ); + obj->setMaxSpeed( std::sqrt( msg.maxThrust() / obj->movable()->dragFactor() ) ); + } else { + log_->fatal( std::string( " no user for id: " ) + toStr( msg.senderID() ) ) ; + } + + sendAllVesselInfos( ); + // if ( !movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ // if ( msg.childID() == 0 ){ // log_->info( "Create player object " + msg.name()+ " " + toStr( msg.senderID() ) + " VesselID: " + toStr( msg.vesselID() ) ); @@ -511,30 +572,167 @@ } void Sector::receiveVesselDeRegister( const MessageBodyShipDeRegister & msg ){ -// if ( movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ -// log_->info( std::string( "Receive deregister " ) -// + movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]->name() ); -// -// SectorObjectMovable *obj = movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]; -// obj->destroy(); -// -// } else { -// log_->warn( std::string( "Deregistering request for unknown object: " ) + -// toStr( msg.senderID() ) + ": " + toStr( (int)msg.childID() ) ); -// } + log_->info( std::string( "Receive vessel deregister: " ) + toStr( msg.senderID() ) ) ; + + ClientUserObject * user( network_->user( msg.senderID() ) ); + if ( user ){ + SectorMovableObject * obj = user->sectorObject(); + if ( obj ){ + user->setSectorObject( NULL ); + destructMeshObject_( obj ); + } else { + log_->fatal( "no sectorObject for user: " + user->name() ) ; + } + } else { + log_->fatal( std::string( " no user for id: " ) + toStr( msg.senderID() ) ) ; + } } +void Sector::sendVesselMovement( SectorVesselObject * obj ){ + if ( obj ){ + MessageBodyShipMovement msg( 0, + obj->mainNode()->getPosition().ptr(), + obj->velocity().ptr(), + obj->mainNode()->getOrientation().ptr(), + obj->thrustRate(), + obj->thrust(), + obj->scaledYaw(), + obj->scaledPitch(), + obj->scaledRoll(), + 0 ); + network_->send( msg ); + } +} +void Sector::receiveVesselMovement( const std::vector < MessageBodyShipMovement * > & movements ){ + std::map < long, const MessageBodyShipMovement * > singleMsg; + //!** we sort the movement messages + for ( size_t i = 0; i < movements.size(); i ++ ){ +// LogManager::getSingleton().debug( std::string( "Movement: " ) + +// movableObjects_[ createGlobalID( movements[ i ]->senderID(), movements[ i ]->childID() )]->name() + " " + toStr( movements[ i ]->senderID() ) + " " + toStr( (int)movements[ i ]->childID() ) + +// " " + toStr( movements[ i ]->position() ) ); + if ( movements[ i ]->senderID() != network_->localUserID() ){ + //** apply only foreign movements, and take just the actual movement + singleMsg[ movements[ i ]->senderID() ] = movements[ i ]; + } else { + log_->debug( "check servercode, local movements shoulded send back" ); + } + } + for ( std::map < long, const MessageBodyShipMovement * >::iterator i = singleMsg.begin(); i != singleMsg.end(); i++ ){ + ClientUserObject * user( network_->user( i->first ) ); + if ( user ){ + SectorMovableObject * obj = user->sectorObject(); + if ( obj ){ + obj->setFlightProperties( (*i->second) ); + } else { + log_->fatal( "no sectorObject for user: " + user->name() ) ; + } + } else { + log_->fatal( std::string( " no user for id: " ) + toStr( i->second->senderID() ) ); + } + } +} +void Sector::sendVesselStatus( SectorVesselObject * obj ){ + if ( obj ){ + //!** send max 10 status per second + if ( timeSinceLastStatusUpdate_ > 0.1 ){ + std::cout << "sendVesselStatus:" << obj->name() << std::endl; + MessageBodyShipStatus msg( 0, obj->shield(), obj->armor(), 0, 0, 0 ); + network_->send( msg ); + timeSinceLastStatusUpdate_ = 0.0; + } + } +} +void Sector::receiveVesselStatus( const MessageBodyShipStatus & msg ){ + log_->info( std::string( "Receive vessel status: " ) + toStr( msg.senderID() ) ) ; + + ClientUserObject * user( network_->user( msg.senderID() ) ); + if ( user ){ + SectorMovableObject * obj = user->sectorObject(); + if ( obj ){ + obj->setStatus( msg ); + } else { + log_->fatal( "no sectorObject for user: " + user->name() ) ; + } + } else { + log_->fatal( std::string( " no user for id: " ) + toStr( msg.senderID() ) ) ; + } +} +void Sector::sendProjectile( SectorProjectileObject * ammo ){ + MessageBodyShipProjectileFired msg( 0, + ammo->gunObject()->parent()->shotsFired(), + Ogre::Vector3( ammo->mainNode()->getPosition() ).ptr(), + ammo->velocity().ptr(), + ammo->gunObject()->gunBluePrint()->id(), 0, 0.0 ); + network_->send( msg ); +} +void Sector::receiveProjectile( const MessageBodyShipProjectileFired & msg ){ + log_->info( std::string( "Receive projectile from: " ) + toStr( msg.senderID() ) ) ; + ClientUserObject * user( network_->user( msg.senderID() ) ); + if ( user ){ + SectorMovableObject * obj = user->sectorObject(); + if ( obj ){ + Gun * gun = dynamic_cast < Gun * >( ResourceManager::getSingleton().entityManager->entity( msg.gunID() ) ); + SectorProjectileObject * ammo = new SectorProjectileObject( obj->name() + "/Ammo_" + toStr( msg.shotCount() ), this, gun ); + insertCollObject_( ammo ); + ammo->mainNode()->setPosition( toOgreVec( msg.position() ) ); + ammo->setVelocity( toOgreVec( msg.velocity() ) ); + } else { + log_->fatal( "no sectorObject for user: " + user->name() ) ; + } + } else { + log_->fatal( std::string( " no user for id: " ) + toStr( msg.senderID() ) ) ; + } +} +void Sector::sendVesselAmmoHit( SectorProjectileObject * ammo, SectorMovableObject * victim ){ +// if ( projectile.parent().userID() == network_->userID() ){ + MessageBodyShipAmmoHit msg( 0, victim->user()->userID(), 0, ammo->gunObject()->gunBluePrint()->damage() ); + network_->send( msg ); +// // std::cout << " Send: " << msg << endl; +// victim->hitByAmmo( projectile.damage() ); +// } +} +void Sector::receiveVesselAmmoHit( const MessageBodyShipAmmoHit & msg ){ + log_->info( std::string( "Receive ammo hit from: " ) + toStr( msg.senderID() ) ); + if ( msg.targetID() == network_->localUserID() ){ + avatarObject_->hitByAmmo( msg.damage() ); + } else { + log_->fatal( std::string( " target is not the avatar: " ) + toStr( msg.targetID() ) ); + } + // if ( msg.senderID() != network_->userID() ){ +// +// std::map< long, SectorObjectMovable * >::iterator it; +// +// if ( ( it = movableObjects_.find( createGlobalID( msg.targetID(), msg.targetChildID() ) ) ) != movableObjects_.end() ){ +// // log_->cout( "ReceiveVesselAmmoHit for " + network_->userName( msg.targetID() ) + " " + toStr( msg.damage() ) ); +// +// it->second->hitByAmmo( msg.damage() ); +// } else { +// log_->fatal( std::string( "Requested non existant object for VesselAmmoHit " ) + +// " shooter: " + network_->userName( msg.senderID() ) + +// " shooter id: " + toStr( msg.senderID() ) + +// " gloabel id: " + toStr( createGlobalID( msg.targetID(), msg.targetChildID() ) ) + +// " victim: " + network_->userName( msg.targetID() ) + +// " child: " + toStr( (int)msg.targetChildID() ) + +// " damage: " + toStr( msg.damage() ) + " this should not happen." ) ; +// +// std::cerr << "Available objects: " << std::endl; +// for ( std::map< long, SectorObjectMovable * >::iterator i = movableObjects_.begin(); i != movableObjects_.end(); i++){ +// std::cerr << "\t" << i->first << " " << i->second->name() << " " << std::endl; +// } +// } +// } +} @@ -553,6 +751,11 @@ + + + + + #else #include "Sector.h" @@ -1228,6 +1431,7 @@ void Sector::sendVesselStatus( SectorObjectVessel * obj ){ if ( obj ){ + std::cout << "sendVesselStatus:" << obj->name() << std::endl; MessageBodyShipStatus msg( obj->childID(), obj->shield(), obj->armor(), 0, 0, 0 ); network_->send( msg ); } Modified: trunk/src/Sector.h =================================================================== --- trunk/src/Sector.h 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/Sector.h 2009-02-21 22:01:23 UTC (rev 1064) @@ -61,7 +61,7 @@ const std::set< SectorEnvironmentObject * > & sectorEnvironment() const { return sectorEnvironment_; } /*! Return handle to the avatarObject */ - inline SectorAvatarObject * avatarObject() { return avatar_; } + inline SectorAvatarObject * avatarObject() { return avatarObject_; } /*! Create a mesh within the sector, without any specialization */ SectorMeshObject * createMeshObject( const std::string & name, const std::string & meshname ); @@ -85,7 +85,7 @@ void createExplosion( SectorMeshObject * obj ); /*! Create an explosion related to a given SectorMeshObject */ - void createProjectile( GunObject * obj, int shots ); + SectorProjectileObject * createProjectile( GunObject * obj, int shots ); /*! Someone has docked */ void objectDocked( SectorMovableObject * obj, SectorStationObject * station ); @@ -102,11 +102,30 @@ void flipShowEcliptic( ); + /*!Called from Undockedstate frame event to send the movement from all local vessles */ + void sendAllVesselMovements( ); + + void sendAllVesselInfos( ); + void sendVesselRegister( SectorVesselObject * obj ); void receiveVesselRegister( const MessageBodyShipRegister & msg ); void sendVesselDeRegister( SectorVesselObject * obj ); void receiveVesselDeRegister( const MessageBodyShipDeRegister & msg ); + + void sendVesselMovement( SectorVesselObject * obj ); + void receiveVesselMovement( const std::vector < MessageBodyShipMovement * > & movements ); + + void sendVesselStatus( SectorVesselObject * obj ); + void receiveVesselStatus( const MessageBodyShipStatus & msg ); + + void sendProjectile( SectorProjectileObject * ammo ); + void receiveProjectile( const MessageBodyShipProjectileFired & msg ); + + void sendVesselAmmoHit( SectorProjectileObject * ammo, SectorMovableObject * victim ); + void receiveVesselAmmoHit( const MessageBodyShipAmmoHit & msg ); + + protected: /*! do not destruct objects manualy, let them send false during update loop */ void destructCollObject_( SectorCollisionObject * obj ); @@ -130,7 +149,8 @@ std::string name_; - SectorAvatarObject * avatar_; + Avatar * avatar_; + SectorAvatarObject * avatarObject_; /*! Hold all stuff you can collide or can be seen on radar */ std::set< SectorMeshObject * > sectorMeshObjects_; @@ -147,11 +167,14 @@ std::map< std::string, std::deque< SectorCollisionObject * > > objectHeap_; uint childIDCounter_; - + double timeSinceLastNetworkUpdate_; + double timeSinceLastStatusUpdate_; + Ogre::SceneNode * koordAxisNode_; Ogre::ManualObject * koordAxisMO_; SectorEclipticObject * ecliptic_; + double avatarDeathSequenceTime_; }; #else Modified: trunk/src/SectorAvatarObject.cpp =================================================================== --- trunk/src/SectorAvatarObject.cpp 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/SectorAvatarObject.cpp 2009-02-21 22:01:23 UTC (rev 1064) @@ -53,12 +53,13 @@ } bool SectorAvatarObject::update( Ogre::Real elapsedTime ){ - - //** just for key autorepeat - thrustRate_ += ( thrustChange_ * 0.8 * elapsedTime ); - thrustRate_ = max( thrustRate_, 0.0 ); - thrustRate_ = min( 1.0, thrustRate_ ); - setThrustRate( thrustRate_ ); + //** just for key autorepeat + if ( thrustChange_ != 0.0 ){ + thrustRate_ += ( thrustChange_ * 0.8 * elapsedTime ); + thrustRate_ = max( thrustRate_, 0.0 ); + thrustRate_ = min( 1.0, thrustRate_ ); + setThrustRate( thrustRate_ ); + } return SectorVesselObject::update( elapsedTime ); } Modified: trunk/src/SectorAvatarObject.h =================================================================== --- trunk/src/SectorAvatarObject.h 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/SectorAvatarObject.h 2009-02-21 22:01:23 UTC (rev 1064) @@ -63,7 +63,6 @@ void fireMissile( Missile * missile, SectorMeshObject * target = NULL ); protected: - Ogre::Real thrustChange_; }; Modified: trunk/src/SectorMovableObject.cpp =================================================================== --- trunk/src/SectorMovableObject.cpp 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/SectorMovableObject.cpp 2009-02-21 22:01:23 UTC (rev 1064) @@ -20,11 +20,13 @@ #include "SectorMovableObject.h" +#include "commonWithOgre.h" #include "Equipment.h" #include "GunObject.h" #include "LogManager.h" #include "Missile.h" #include "Moveable.h" +#include "networkProtocol.h" #include "OpcodeWrapper.h" #include "ResourceManager.h" #include "SectorMissileObject.h" @@ -36,9 +38,8 @@ namespace OpenGate{ SectorMovableObject::SectorMovableObject( const std::string & name, Sector * sector, Movable * movable ) - : SectorMeshObject( name, sector, NULL ), movable_( movable ){ + : SectorMeshObject( name, sector, NULL ), movable_( movable ), user_( NULL ){ - setMesh( movable_->meshPtr()->getName() ); setBaseRot( movable_->baseYaw(), movable_->basePitch(), movable_->baseRoll() ); @@ -51,6 +52,9 @@ void SectorMovableObject::reset( ){ SectorMeshObject::reset(); + + user_ = NULL; + yaw_ = 0.0; pitch_ = 0.0; roll_ = 0.0; @@ -63,6 +67,7 @@ interpolateRot_ = Ogre::Quaternion::ZERO; interpolateVel_ = Ogre::Vector3::ZERO; + forceMovement_ = true; brakePressed_ = false; afterburnerPressed_ = false; lifeTime_ = 0.0; @@ -77,6 +82,8 @@ maxShield_ = 1; shield_ = 0; + lastFrameCount_ = 0; + setDestroyRequest_( false ); } @@ -86,7 +93,6 @@ case SECTOR_AVATAR_OBJECT_RTTI: case SECTOR_BEACON_OBJECT_RTTI: case SECTOR_MESH_OBJECT_RTTI: - case SECTOR_MOVABLE_OBJECT_RTTI: case SECTOR_STATION_OBJECT_RTTI: case SECTOR_VESSEL_OBJECT_RTTI: vel_ *= -1.0; @@ -97,7 +103,9 @@ hitByAmmo( dynamic_cast < SectorMissileObject *>( obj )->missile()->damage() ); break; case SECTOR_PROJECTILE_OBJECT_RTTI: - hitByAmmo( dynamic_cast < SectorProjectileObject *>( obj )->gun()->gun()->damage() ); + if ( dynamic_cast < SectorProjectileObject *>( obj )->gunObject() ){ + hitByAmmo( dynamic_cast < SectorProjectileObject *>( obj )->gunObject()->gunBluePrint()->damage() ); + } break; default: std::cout << "SectorMovableObject: " << this->name() << " collide with " @@ -111,6 +119,7 @@ if ( elapsedTime < 0.001 ) return true; lifeTime_ += elapsedTime; + lastFrameCount_ ++; Ogre::Real rotFric = rotFriction(); mainNode_->yaw( Ogre::Degree( yaw_ * ( elapsedTime * rotFric * movable_->yaw() ) ), rotRelativeTo_ ); @@ -170,6 +179,102 @@ return true; } +void SectorMovableObject::setFlightProperties( const MessageBodyShipMovement & msg ){ + setThrustRate( msg.thrustRate() ); + thrust_ = msg.thrust(); + + // updateThruster(); + + //std::cout << name_ << " " << msg << std::endl; + if ( forceMovement_ ){ + mainNode_->setPosition( toOgreVec( msg.position() ) ); + mainNode_->setOrientation( toOgreQuat( msg.orientation() ) ); + vel_ = toOgreVec( msg.velocity() ); + setScaledYaw( msg.yaw() ); + setScaledPitch( msg.pitch() ); + setScaledRoll( msg.roll() ); + forceMovement_ = false; + } else { + +// if ( ( fabs( msg.yaw() ) -1.0f ) < 1e-4 ) { +// setScaledYaw( msg.yaw() ); +// } else { +// setScaledYaw( 0.0 ); +// } +// if ( ( fabs( msg.pitch() ) -1.0f ) < 1e-4 ) { +// setScaledPitch( msg.pitch() ); +// } else { +// setScaledPitch( 0.0 ); +// } +// if ( ( fabs( msg.roll() ) -1.0f ) < 1e-4 ) { +// setScaledRoll( msg.roll() ); +// } else { +// setScaledRoll( 0.0 ); +// } + + setScaledYaw( msg.yaw() ); + setScaledRoll( msg.roll() ); + setScaledPitch( msg.pitch() ); + + vel_ = toOgreVec( msg.velocity() ); + + Ogre::Vector3 srcP( mainNode_->getPosition( ) ); + Ogre::Quaternion srcQ( mainNode_->getOrientation( ) ); + Ogre::Vector3 destP( toOgreVec( msg.position( ) ) ); + + //** try Slerp + Ogre::Quaternion diff = Ogre::Quaternion::nlerp( 1, srcQ, toOgreQuat( msg.orientation() ) ); + interpolateRot_ = diff * srcQ.Inverse(); + + // if ( msg.childID() > 0 ){ + if ( !1 ){ + + // std::cout << std::endl; +// std::cout << msg.sequenceNr() << "LastFrameCount: " << lastFrameCount_ +// << " life: " << lifeTime_ << " last: " << lastLifeTime_ +// << " diff: "<< lifeTime_ - lastLifeTime_ << std::endl; + + // std::cout << "Ist: " << mainNode_->getOrientation( ) + // << " " << mainNode_->getOrientation( ).getYaw().valueDegrees() << std::endl; + + // std::cout << "Soll: " << msg.orientation() << " " << msg.orientation().getYaw().valueDegrees() << std::endl; + + std::cout << "Diff: send: " << msg.yaw() << " " << msg.pitch() << " " << msg.roll() << std::endl; + + std::cout << "Diff: Pos: " << (srcP-destP).length() + << " Y:" << interpolateRot_.getYaw().valueDegrees() + << " P:" << interpolateRot_.getPitch().valueDegrees() + << " R:" << interpolateRot_.getRoll().valueDegrees() << std::endl; + + } // else !forceMovement_ + + Ogre::Degree yawTo( interpolateRot_.getYaw() ); + Ogre::Degree pitchTo( interpolateRot_.getPitch() ); + Ogre::Degree rollTo( interpolateRot_.getRoll() ); + + mainNode_->yaw( yawTo / 5.0 , Ogre::Node::TS_PARENT ); + mainNode_->pitch( pitchTo / 5.0, Ogre::Node::TS_PARENT ); + mainNode_->roll( rollTo / 5.0, Ogre::Node::TS_PARENT ); + + if ( lastFrameCount_ > 0 ){ + interpolateVel_ = ( destP - srcP ) / lastFrameCount_ / 1.0; + } + + if ( ( srcP - destP ).length() > 100 ) forceMovement_ = true; + } + + lastFrameCount_ = 0; + // lastLifeTime_ = lifeTime_; +} + +void SectorMovableObject::setStatus( const MessageBodyShipStatus & msg ){ + setShield( msg.shield() ); + setArmor( msg.armor() ); +//setBreakPressed( msg.breakPressed() ); +// setAfterburnerPressed( msg.afterburnerPressed() ); + // statusChanged_ = false; +} + Ogre::Real SectorMovableObject::transFriction_(){ return movable_->dragFactor() * speed_ * speed_; } Modified: trunk/src/SectorMovableObject.h =================================================================== --- trunk/src/SectorMovableObject.h 2009-02-21 20:01:10 UTC (rev 1063) +++ trunk/src/SectorMovableObject.h 2009-02-21 22:01:23 UTC (rev 1064) @@ -41,6 +41,12 @@ /*! Abstract method for runtime identification */ virtual int rtti( ) const { return SECTOR_MOVABLE_OBJECT_RTTI; } + /*! Set ClientUserObject if this movable is controled by network. */ + void setUser( ClientUserObject * user ) { user_ = user; } + + /*! Return ClientUserObject if this movable is controled by network. */ + ClientUserObject * user() { return user_; } + virtual bool update( Ogre::Real elapsedTime ); /*! Decide what happen if this object collide with another. */ @@ -58,12 +64,17 @@ /*! Return the relative thrust values from 0 to 1*/ inline Ogre::Real thrustRate() const { return thrustRate_; } + inline void setMaxThrust( Uint32 thrust ) { maxThrust_ = thrust; } /*! Return the maximum thrust*/ inline Uint32 maxThrust() const { return maxThrust_; } + + /*! Return the actual thrust*/ + inline Uint32 thrust() const { return thrust_; } /*! Returns the speed of the object, will be recalculated in every update loop */ inline double speed() const { return speed_; } + inline void setMaxSpeed( double speed ) { maxSpeed_ = speed; } /*! Returns the maximum speed depend on vessel and mounted engine */ inline double maxSpeed() const { return maxSpeed_; } @@ -73,17 +84,26 @@ /*! Return the velocity vector */ inline Ogre::Vector3 velocity( ) const { return vel_; }... [truncated message content] |
From: <eg...@us...> - 2009-09-09 18:48:45
|
Revision: 1141 http://opengate.svn.sourceforge.net/opengate/?rev=1141&view=rev Author: egore Date: 2009-09-09 18:48:36 +0000 (Wed, 09 Sep 2009) Log Message: ----------- Add shave support This adds support for shave to reduce the output during the build process. For more details see: http://damien.lespiau.name/blog/2009/02/18/shave-making-the-autotools-output-sane/ Modified Paths: -------------- trunk/configure.ac Added Paths: ----------- trunk/acinclude.m4 trunk/shave-libtool.in trunk/shave.in Added: trunk/acinclude.m4 =================================================================== --- trunk/acinclude.m4 (rev 0) +++ trunk/acinclude.m4 2009-09-09 18:48:36 UTC (rev 1141) @@ -0,0 +1,77 @@ +dnl Make automake/libtool output more friendly to humans +dnl Damien Lespiau <dam...@gm...> +dnl +dnl SHAVE_INIT([shavedir],[default_mode]) +dnl +dnl shavedir: the directory where the shave scripts are, it defaults to +dnl $(top_builddir) +dnl default_mode: (enable|disable) default shave mode. This parameter +dnl controls shave's behaviour when no option has been +dnl given to configure. It defaults to disable. +dnl +dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just +dnl before AC_CONFIG_FILE/AC_OUTPUT is perfect. This macro rewrites CC and +dnl LIBTOOL, you don't want the configure tests to have these variables +dnl re-defined. +dnl * This macro requires GNU make's -s option. + +AC_DEFUN([_SHAVE_ARG_ENABLE], +[ + AC_ARG_ENABLE([shave], + AS_HELP_STRING( + [--enable-shave], + [use shave to make the build pretty [[default=$1]]]),, + [enable_shave=$1] + ) +]) + +AC_DEFUN([SHAVE_INIT], +[ + dnl you can tweak the default value of enable_shave + m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)]) + + if test x"$enable_shave" = xyes; then + dnl where can we find the shave scripts? + m4_if([$1],, + [shavedir="$ac_pwd"], + [shavedir="$ac_pwd/$1"]) + AC_SUBST(shavedir) + + dnl make is now quiet + AC_SUBST([MAKEFLAGS], [-s]) + AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`']) + + dnl we need sed + AC_CHECK_PROG(SED,sed,sed,false) + + dnl substitute libtool + SHAVE_SAVED_LIBTOOL=$LIBTOOL + LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'" + AC_SUBST(LIBTOOL) + + dnl substitute cc/cxx + SHAVE_SAVED_CC=$CC + SHAVE_SAVED_CXX=$CXX + SHAVE_SAVED_FC=$FC + SHAVE_SAVED_F77=$F77 + SHAVE_SAVED_OBJC=$OBJC + CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}" + CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}" + FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}" + F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}" + OBJC="${SHELL} ${shavedir}/shave objc ${SHAVE_SAVED_OBJC}" + AC_SUBST(CC) + AC_SUBST(CXX) + AC_SUBST(FC) + AC_SUBST(F77) + AC_SUBST(OBJC) + + V=@ + else + V=1 + fi + Q='$(V:1=)' + AC_SUBST(V) + AC_SUBST(Q) +]) + Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2009-05-24 08:39:15 UTC (rev 1140) +++ trunk/configure.ac 2009-09-09 18:48:36 UTC (rev 1141) @@ -10,6 +10,8 @@ AM_MAINTAINER_MODE +AC_CONFIG_FILES([shave shave-libtool]) + AM_CONFIG_HEADER([config.h]) dnl set compiler warnings based on http://blogs.gnome.org/otte/2008/12/22/warning-options/ @@ -97,6 +99,8 @@ [AC_MSG_ERROR([*** boost_system library not found!])] ) +SHAVE_INIT(.,enable) + AC_OUTPUT([ Makefile data/Makefile Added: trunk/shave-libtool.in =================================================================== --- trunk/shave-libtool.in (rev 0) +++ trunk/shave-libtool.in 2009-09-09 18:48:36 UTC (rev 1141) @@ -0,0 +1,69 @@ +#!/bin/sh + +# we need sed +SED=@SED@ +if test -z "$SED" ; then +SED=sed +fi + +lt_unmangle () +{ + last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` +} + +# the real libtool to use +LIBTOOL="$1" +shift + +# if 1, don't print anything, the underlaying wrapper will do it +pass_though=0 + +# scan the arguments, keep the right ones for libtool, and discover the mode +preserved_args= +while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --mode=*) + mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'` + preserved_args="$preserved_args $opt" + ;; + -o) + lt_output="$1" + preserved_args="$preserved_args $opt" + ;; + *) + preserved_args="$preserved_args $opt" + ;; + esac +done + +case "$mode" in +compile) + # shave will be called and print the actual CC/CXX/LINK line + preserved_args="$preserved_args --shave-mode=$mode" + pass_though=1 + ;; +link) + preserved_args="$preserved_args --shave-mode=$mode" + Q=" LINK " + ;; +*) + # let's u + # echo "*** libtool: Unimplemented mode: $mode, fill a bug report" + ;; +esac + +lt_unmangle "$lt_output" +output=$last_result + +if test -z $V; then + if test $pass_though -eq 0; then + echo "$Q$output" + fi + $LIBTOOL --silent $preserved_args +else + echo $LIBTOOL $preserved_args + $LIBTOOL $preserved_args +fi Added: trunk/shave.in =================================================================== --- trunk/shave.in (rev 0) +++ trunk/shave.in 2009-09-09 18:48:36 UTC (rev 1141) @@ -0,0 +1,79 @@ +#!/bin/sh + +# we need sed +SED=@SED@ +if test -z "$SED" ; then +SED=sed +fi + +lt_unmangle () +{ + last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` +} + +# the tool to wrap (cc, cxx, ar, ranlib, ..) +tool="$1" +shift + +# the reel tool (to call) +REEL_TOOL="$1" +shift + +pass_through=0 +preserved_args= +while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --shave-mode=*) + mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'` + ;; + -o) + lt_output="$1" + preserved_args="$preserved_args $opt" + ;; + *) + preserved_args="$preserved_args $opt" + ;; + esac +done + +# mode=link is handled in the libtool wrapper +case "$mode,$tool" in +link,*) + pass_through=1 + ;; +*,cxx) + Q=" CXX " + ;; +*,cc) + Q=" CC " + ;; +*,fc) + Q=" FC " + ;; +*,f77) + Q=" F77 " + ;; +*,objc) + Q=" OBJC " + ;; +*,*) + # should not happen + Q=" CC " + ;; +esac + +lt_unmangle "$lt_output" +output=$last_result + +if test -z $V; then + if test $pass_through -eq 0; then + echo "$Q$output" + fi + $REEL_TOOL $preserved_args +else + echo $REEL_TOOL $preserved_args + $REEL_TOOL $preserved_args +fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-12-19 16:15:18
|
Revision: 1154 http://opengate.svn.sourceforge.net/opengate/?rev=1154&view=rev Author: spom_spom Date: 2009-12-19 16:15:09 +0000 (Sat, 19 Dec 2009) Log Message: ----------- replaced hand-generate cegui-layouts by ogedit-generated Modified Paths: -------------- trunk/data/gui/layouts/dialogs/ConfigDialog.layout trunk/data/gui/layouts/dialogs/MarketDialog.layout trunk/data/gui/layouts/dialogs/MarketItemShortDialog.layout trunk/data/gui/layouts/dialogs/ShipConfigDialog.layout trunk/data/gui/layouts/dialogs/ShipConfigEquipmentButton.layout trunk/data/gui/layouts/opengateConsole.layout trunk/data/gui/layouts/opengateDocked.layout trunk/data/gui/layouts/opengateUnDocked.layout trunk/data/gui/looknfeel/opengateStatic.looknfeel trunk/data/gui/schemes/opengate.scheme trunk/src/BaseDialog.cpp trunk/src/BaseDialog.h trunk/src/GameStateManager.cpp trunk/src/Hud.cpp trunk/src/MarketDialog.cpp trunk/src/SectorMovableObject.h Modified: trunk/data/gui/layouts/dialogs/ConfigDialog.layout =================================================================== --- trunk/data/gui/layouts/dialogs/ConfigDialog.layout 2009-12-18 19:42:42 UTC (rev 1153) +++ trunk/data/gui/layouts/dialogs/ConfigDialog.layout 2009-12-19 16:15:09 UTC (rev 1154) @@ -1,83 +1,226 @@ <?xml version="1.0" encoding="UTF-8"?> -<GUILayout > - <Window Type="opengate/StaticImage" Name="Config/Main" > - <Property Name="InheritsAlpha" Value="False" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" /> - <Window Type="opengate/StaticImage" Name="Config/MainWindow" > - <Property Name="Image" Value="set:ConfigMainWindow image:full_image" /> +<Window Type="opengate/StaticImage" Name="Config/Main" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="True" /> + <Property Name="InheritsAlpha" Value="False" /> + <Property Name="BackgroundEnabled" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{1,0}}" /> + <Window Type="opengate/StaticImage" Name="Config/MainWindow" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="set:ConfigMainWindow image:full_image" /> + <Property Name="UnifiedPosition" Value="{{0.5,-202},{0,10}}" /> + <Property Name="UnifiedSize" Value="{{0,405},{0,705}}" /> + <Window Type="opengate/StaticImage" Name="Config/MainFrame" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> <Property Name="FrameEnabled" Value="False" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0.5,-202},{0,10},{0.5,203},{0,715}}" /> + <Property Name="InheritsAlpha" Value="True" /> <Property Name="BackgroundEnabled" Value="False" /> - <Window Type="opengate/StaticImage" Name="Config/MainFrame" > + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,60},{0,109}}" /> + <Property Name="UnifiedSize" Value="{{1,-98},{1,-115}}" /> + <Window Type="opengate/Button" Name="Config/ConnectButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Connect" /> + <Property Name="Disabled" Value="True" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,10},{0,10}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/GraphicButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Graphic" /> + <Property Name="Disabled" Value="True" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,10},{0,60}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/SoundButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Sound" /> + <Property Name="Disabled" Value="True" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,10},{0,110}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/ControlsButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Controls" /> + <Property Name="Disabled" Value="True" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,10},{0,160}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/CreditsButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Credits" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,10},{0,210}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/QuitButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Quit" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,10},{0,260}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/BackButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Back" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,10},{1,-40}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/StaticImage" Name="Config/SubFrame" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> <Property Name="FrameEnabled" Value="False" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,60},{0,109},{1,-38},{1,-6}}" /> + <Property Name="InheritsAlpha" Value="True" /> <Property Name="BackgroundEnabled" Value="False" /> - <Window Type="opengate/Button" Name="Config/ConnectButton" > - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Text" Value="Connect" /> - <Property Name="Disabled" Value="True" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,10},{0,10},{0,80},{0,40}}" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,90},{0,10}}" /> + <Property Name="UnifiedSize" Value="{{1,-100},{1,-20}}" /> + <Window Type="opengate/StaticLabel" Name="Config/SubFrame/Title" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-18" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{0,30}}" /> </Window> - <Window Type="opengate/Button" Name="Config/GraphicButton" > + <Window Type="opengate/ConsoleListbox" Name="Config/SubFrame/CreditsText" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Text" Value="Graphic" /> - <Property Name="Disabled" Value="True" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,10},{0,60},{0,80},{0,90}}" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,30}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{1,-30}}" /> </Window> - <Window Type="opengate/Button" Name="Config/SoundButton" > - <Property Name="Text" Value="Sound" /> - <Property Name="Disabled" Value="True" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,10},{0,110},{0,80},{0,140}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/ControlsButton" > - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Text" Value="Controls" /> - <Property Name="Disabled" Value="True" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,10},{0,160},{0,80},{0,190}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/CreditsButton" > - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Text" Value="Credits" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,10},{0,210},{0,80},{0,240}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/QuitButton" > - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Text" Value="Quit" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,10},{0,260},{0,80},{0,290}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/BackButton" > - <Property Name="Text" Value="Back" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,10},{1,-40},{0,80},{1,-10}}" /> - </Window> - <Window Type="opengate/StaticImage" Name="Config/SubFrame" > - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,90},{0,10},{1,-10},{1,-10}}" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Window Type="opengate/StaticLabel" Name="Config/SubFrame/Title" > - <Property Name="Font" Value="BlueHighway-18" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{0,30}}" /> - </Window> - <Window Type="opengate/ConsoleListbox" Name="Config/SubFrame/CreditsText" > - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> - <Property Name="UnifiedAreaRect" Value="{{0,0},{0,30},{1,0},{1,0}}" /> - </Window> - </Window> </Window> </Window> </Window> -</GUILayout> +</Window> \ No newline at end of file Modified: trunk/data/gui/layouts/dialogs/MarketDialog.layout =================================================================== --- trunk/data/gui/layouts/dialogs/MarketDialog.layout 2009-12-18 19:42:42 UTC (rev 1153) +++ trunk/data/gui/layouts/dialogs/MarketDialog.layout 2009-12-19 16:15:09 UTC (rev 1154) @@ -1,939 +1,2476 @@ -<?xml version="1.0" ?> -<GUILayout> -<!-- used ingame --> - <Window Type="opengate/StaticGreenImage" Name="MarketDialog"> - <Property Name="MousePassThroughEnabled" Value="True" /> - <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 115}}" /> - <Property Name="UnifiedSize" Value="{{1.0, -167},{1.0, -217}}" /> - <Property Name="Text" Value="Market" /> +<?xml version="1.0" encoding="UTF-8"?> -<!-- ********************* --> -<!-- Item Detailed View --> -<!-- ********************* --> - -<!-- used ingame --> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView"> - <Property Name="UnifiedPosition" Value="{{0,220},{0.0,10}}" /> - <Property Name="UnifiedSize" Value="{{1.0,-230},{1.0,-170}}" /> - <Property Name="BackgroundEnabled" Value="True" /> - <Property Name="FrameEnabled" Value="True" /> - <Property Name="Visible" Value="False" /> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TopLeft"> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 0}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 31},{0.0, 31}}" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="Image" Value="set:opengate image:StaticGreenTopLeft"/> - </Window> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Top"> - <Property Name="UnifiedPosition" Value="{{0.0, 31},{ 0.0, 0}}" /> - <Property Name="UnifiedSize" Value="{{1.0, -62},{ 0.0, 31}}" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="Image" Value="set:opengate image:StaticGreenTop"/> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/Top/Title"> - <Property Name="UnifiedPosition" Value="{{0.0, 10},{ 0.0, 10}}" /> - <Property Name="UnifiedSize" Value="{{1.0, 0},{ 0.0, 20}}" /> - <Property Name="Text" Value="Would you like to purchase this item?" /> - <Property Name="Font" Value="BlueHighway-16" /> - </Window> - </Window> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TopRight"> - <Property Name="UnifiedPosition" Value="{{1.0, -31},{ 0.0, 0}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 31},{ 0.0, 31}}" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="Image" Value="set:opengate image:StaticGreenTopRight"/> - </Window> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Image/Frame"> - <!-- Filled within game --> - <Property Name="UnifiedPosition" Value="{{0.0, 20},{0.5, -145}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 290},{0.0, 290}}" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Image"> - <!-- Filled within game --> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 0}}" /> - <Property Name="UnifiedSize" Value="{{1.0, 0},{1.0, 0}}" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - </Window> - </Window> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TextFrame"> - <Property Name="UnifiedPosition" Value="{{0.0, 330},{0.5, -145}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 250},{0.0, 290}}" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Name"> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 0}}" /> - <Property Name="UnifiedSize" Value="{{1.0, 0},{0.0, 20}}" /> - <Property Name="Text" Value="Name:" /> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Name/Text"> - <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 0}}" /> - <Property Name="UnifiedSize" Value="{{1.0, -100},{1.0, 0}}" /> - </Window> - </Window> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Size"> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 20}}" /> - <Property Name="UnifiedSize" Value="{{1.0, 0},{0.0, 20}}" /> - <Property Name="Text" Value="Size:" /> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Size/Text"> - <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 0}}" /> - <Property Name="UnifiedSize" Value="{{1.0, -100},{1.0, 0}}" /> - </Window> - </Window> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Mass"> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 40}}" /> - <Property Name="UnifiedSize" Value="{{1.0, 0},{0.0, 20}}" /> - <Property Name="Text" Value="Mass:" /> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Mass/Text"> - <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 0}}" /> - <Property Name="UnifiedSize" Value="{{1.0, -100},{1.0, 0}}" /> - </Window> - </Window> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs"> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 100}}" /> - <Property Name="UnifiedSize" Value="{{1.0, 0},{1.0, -80}}" /> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs1a"> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 0}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 100},{0.0, 20}}" /> +<Window Type="opengate/StaticGreenImage" Name="MarketDialog" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Market" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="True" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="True" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,115}}" /> + <Property Name="UnifiedSize" Value="{{1,-167},{1,-217}}" /> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="True" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,220},{0,10}}" /> + <Property Name="UnifiedSize" Value="{{1,-230},{1,-170}}" /> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TopLeft" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopLeft" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{0,31},{0,31}}" /> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Top" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTop" /> + <Property Name="UnifiedPosition" Value="{{0,31},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,-62},{0,31}}" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/Top/Title" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="Would you like to purchase this item?" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="AlwaysOnTop" Value="True" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-16" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,10},{0,10}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{0,20}}" /> </Window> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs1b"> - <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 0}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 50},{0.0, 20}}" /> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TopRight" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="set:opengate image:StaticGreenTopRight" /> + <Property Name="UnifiedPosition" Value="{{1,-31},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{0,31},{0,31}}" /> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Image/Frame" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,20},{0.5,-145}}" /> + <Property Name="UnifiedSize" Value="{{0,290},{0,290}}" /> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Image" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{1,0}}" /> </Window> - - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs2a"> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 20}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 100},{0.0, 20}}" /> + </Window> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TextFrame" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,330},{0.5,-145}}" /> + <Property Name="UnifiedSize" Value="{{0,250},{0,290}}" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Name" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="Name:" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{0,20}}" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Name/Text" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,-100},{1,0}}" /> + </Window> </Window> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs2b"> - <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 20}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 50},{0.0, 20}}" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Size" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="Size:" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,20}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{0,20}}" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Size/Text" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,-100},{1,0}}" /> + </Window> </Window> - - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs3a"> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 40}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 100},{0.0, 20}}" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Mass" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="Mass:" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,40}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{0,20}}" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/TextFrame/Mass/Text" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,-100},{1,0}}" /> + </Window> </Window> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs3b"> - <Property Name="UnifiedPosition" Value="{{0.0, 100},{0.0, 40}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 50},{0.0, 20}}" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,100}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{1,-80}}" /> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs1a" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{0,100},{0,20}}" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs1b" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{0,50},{0,20}}" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs2a" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,20}}" /> + <Property Name="UnifiedSize" Value="{{0,100},{0,20}}" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs2b" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,20}}" /> + <Property Name="UnifiedSize" Value="{{0,50},{0,20}}" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs3a" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,40}}" /> + <Property Name="UnifiedSize" Value="{{0,100},{0,20}}" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs3b" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,40}}" /> + <Property Name="UnifiedSize" Value="{{0,50},{0,20}}" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs4a" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,60}}" /> + <Property Name="UnifiedSize" Value="{{0,100},{0,20}}" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs4b" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,60}}" /> + <Property Name="UnifiedSize" Value="{{0,50},{0,20}}" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs5a" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,80}}" /> + <Property Name="UnifiedSize" Value="{{0,100},{0,20}}" /> + </Window> + <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs5b" > + <Property Name="Visible" Value="False" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="HoverTextColour" Value="00000000" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,80}}" /> + <Property Name="UnifiedSize" Value="{{0,50},{0,20}}" /> + </Window> </Window> - - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/EquipmentSpecs4a"> - <Property Name="UnifiedPosition" Value="{{0.0, 0},{0.0, 60}}" /> - <Property Name="UnifiedSize" Value="{{0.0, 100},{0.0, ... [truncated message content] |
From: <spo...@us...> - 2009-12-20 23:46:10
|
Revision: 1157 http://opengate.svn.sourceforge.net/opengate/?rev=1157&view=rev Author: spom_spom Date: 2009-12-20 23:46:01 +0000 (Sun, 20 Dec 2009) Log Message: ----------- opengate client: add gui for keymap config Modified Paths: -------------- trunk/data/gui/layouts/dialogs/ConfigDialog.layout trunk/data/gui/looknfeel/opengateStatic.looknfeel trunk/data/gui/schemes/opengate.scheme trunk/src/BaseDialog.cpp trunk/src/BaseDialog.h trunk/src/ConfigDialog.cpp trunk/src/ConfigDialog.h trunk/src/GameStateManager.cpp trunk/src/InputManager.h trunk/src/KeyMap.cpp trunk/src/KeyMap.h Added Paths: ----------- trunk/data/gui/layouts/dialogs/ConfigControlKey.layout Added: trunk/data/gui/layouts/dialogs/ConfigControlKey.layout =================================================================== --- trunk/data/gui/layouts/dialogs/ConfigControlKey.layout (rev 0) +++ trunk/data/gui/layouts/dialogs/ConfigControlKey.layout 2009-12-20 23:46:01 UTC (rev 1157) @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<Window Type="opengate/StaticFrame" Name="Config/Controls/Key" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{0,400},{0,30}}" /> + <Window Type="opengate/StaticTextLabel" Name="Config/Controls/Key/Name" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="KeyName" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-14" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="LeftAligned" /> + <Property Name="UnifiedPosition" Value="{{0,10},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,-210},{1,0}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/Controls/Key/KeyButton1" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Key 1" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{1,-205},{0,5}}" /> + <Property Name="UnifiedSize" Value="{{0,100},{1,-10}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/Controls/Key/KeyButton2" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Key 2" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="UnifiedPosition" Value="{{1,-100},{0,5}}" /> + <Property Name="UnifiedSize" Value="{{0,100},{1,-10}}" /> + </Window> +</Window> \ No newline at end of file Modified: trunk/data/gui/layouts/dialogs/ConfigDialog.layout =================================================================== --- trunk/data/gui/layouts/dialogs/ConfigDialog.layout 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/data/gui/layouts/dialogs/ConfigDialog.layout 2009-12-20 23:46:01 UTC (rev 1157) @@ -18,7 +18,7 @@ <Property Name="Visible" Value="True" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> + <Property Name="RiseOnClick" Value="False" /> <Property Name="AlwaysOnTop" Value="False" /> <Property Name="FrameEnabled" Value="False" /> <Property Name="InheritsAlpha" Value="True" /> @@ -33,7 +33,7 @@ <Property Name="Visible" Value="True" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> + <Property Name="RiseOnClick" Value="False" /> <Property Name="AlwaysOnTop" Value="False" /> <Property Name="FrameEnabled" Value="False" /> <Property Name="InheritsAlpha" Value="True" /> @@ -48,7 +48,7 @@ <Property Name="Visible" Value="True" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> + <Property Name="RiseOnClick" Value="False" /> <Property Name="AlwaysOnTop" Value="False" /> <Property Name="FrameEnabled" Value="False" /> <Property Name="InheritsAlpha" Value="True" /> @@ -142,7 +142,7 @@ <Window Type="opengate/Button" Name="Config/ControlsButton" > <Property Name="Visible" Value="True" /> <Property Name="Text" Value="Controls" /> - <Property Name="Disabled" Value="True" /> + <Property Name="Disabled" Value="False" /> <Property Name="RiseOnClick" Value="True" /> <Property Name="AlwaysOnTop" Value="False" /> <Property Name="InheritsAlpha" Value="True" /> @@ -219,7 +219,7 @@ <Property Name="UnifiedPosition" Value="{{0,100},{0,670}}" /> <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> </Window> - <Window Type="opengate/StaticImage" Name="Config/SubFrame" > + <Window Type="opengate/StaticFrame" Name="Config/Credits" > <Property Name="Visible" Value="True" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> @@ -233,7 +233,7 @@ <Property Name="Image" Value="" /> <Property Name="UnifiedPosition" Value="{{0,100},{0,200}}" /> <Property Name="UnifiedSize" Value="{{1,-180},{0,450}}" /> - <Window Type="opengate/StaticLabel" Name="Config/SubFrame/Title" > + <Window Type="opengate/StaticTextLabel" Name="Config/Credits/Header" > <Property Name="Visible" Value="True" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> @@ -243,17 +243,13 @@ <Property Name="MousePassThroughEnabled" Value="False" /> <Property Name="Font" Value="BlueHighway-18" /> <Property Name="NormalTextColour" Value="FF88D997" /> - <Property Name="HoverTextColour" Value="FF88D997" /> <Property Name="DisabledTextColour" Value="FF7F7F7F" /> <Property Name="VertLabelFormatting" Value="LeftAligned" /> <Property Name="HorzLabelFormatting" Value="TopAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> <Property Name="UnifiedSize" Value="{{1,0},{0,30}}" /> </Window> - <Window Type="opengate/ConsoleListbox" Name="Config/SubFrame/CreditsText" > + <Window Type="opengate/ConsoleListbox" Name="Config/Credits/Body" > <Property Name="Visible" Value="True" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> @@ -263,7 +259,52 @@ <Property Name="MousePassThroughEnabled" Value="False" /> <Property Name="Font" Value="BlueHighway-12" /> <Property Name="UnifiedPosition" Value="{{0,0},{0,35}}" /> - <Property Name="UnifiedSize" Value="{{1,0},{1,0}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{1,-35}}" /> </Window> </Window> + <Window Type="opengate/StaticFrame" Name="Config/Controls" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,200}}" /> + <Property Name="UnifiedSize" Value="{{1,-180},{0,450}}" /> + <Window Type="opengate/StaticFrame" Name="Config/Controls/Header" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{0,35}}" /> + </Window> + <Window Type="opengate/StaticFrame" Name="Config/Controls/Body" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,35}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{1,-35}}" /> + </Window> + </Window> </Window> \ No newline at end of file Modified: trunk/data/gui/looknfeel/opengateStatic.looknfeel =================================================================== --- trunk/data/gui/looknfeel/opengateStatic.looknfeel 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/data/gui/looknfeel/opengateStatic.looknfeel 2009-12-20 23:46:01 UTC (rev 1157) @@ -8,51 +8,120 @@ --> <WidgetLook name="opengate/StaticShared"> - <ImagerySection name="frame"> - <FrameComponent> - <Area> - <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> - <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> - <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> - <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> - </Area> - <Image type="TopLeftCorner" imageset="opengate" image="StaticTopLeft" /> - <Image type="TopRightCorner" imageset="opengate" image="StaticTopRight" /> - <Image type="BottomLeftCorner" imageset="opengate" image="StaticBottomLeft" /> - <Image type="BottomRightCorner" imageset="opengate" image="StaticBottomRight" /> - <Image type="LeftEdge" imageset="opengate" image="StaticLeft" /> - <Image type="RightEdge" imageset="opengate" image="StaticRight" /> - <Image type="TopEdge" imageset="opengate" image="StaticTop" /> - <Image type="BottomEdge" imageset="opengate" image="StaticBottom" /> - </FrameComponent> - </ImagerySection> - <ImagerySection name="background"> - <ImageryComponent> - <Area> - <Dim type="LeftEdge" ><ImageDim imageset="opengate" image="StaticLeft" dimension="Width" /></Dim> - <Dim type="TopEdge" ><ImageDim imageset="opengate" image="StaticTop" dimension="Height" /></Dim> - <Dim type="RightEdge" > - <UnifiedDim scale="1" type="RightEdge"> - <DimOperator op="Subtract"> - <ImageDim imageset="opengate" image="StaticRight" dimension="Width" /> - </DimOperator> - </UnifiedDim> - </Dim> - <Dim type="BottomEdge" > - <UnifiedDim scale="1" type="BottomEdge"> - <DimOperator op="Subtract"> - <ImageDim imageset="opengate" image="StaticBottom" dimension="Height" /> - </DimOperator> - </UnifiedDim> - </Dim> - </Area> - <Image imageset="opengate" image="StaticBackdrop" /> - <VertFormat type="Stretched" /> - <HorzFormat type="Stretched" /> - </ImageryComponent> - </ImagerySection> + <ImagerySection name="frame"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image type="TopLeftCorner" imageset="opengate" image="StaticTopLeft" /> + <Image type="TopRightCorner" imageset="opengate" image="StaticTopRight" /> + <Image type="BottomLeftCorner" imageset="opengate" image="StaticBottomLeft" /> + <Image type="BottomRightCorner" imageset="opengate" image="StaticBottomRight" /> + <Image type="LeftEdge" imageset="opengate" image="StaticLeft" /> + <Image type="RightEdge" imageset="opengate" image="StaticRight" /> + <Image type="TopEdge" imageset="opengate" image="StaticTop" /> + <Image type="BottomEdge" imageset="opengate" image="StaticBottom" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="background"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="opengate" image="StaticLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><ImageDim imageset="opengate" image="StaticTop" dimension="Height" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="opengate" image="StaticRight" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="BottomEdge" > + <UnifiedDim scale="1" type="BottomEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="opengate" image="StaticBottom" dimension="Height" /> + </DimOperator> + </UnifiedDim> + </Dim> + </Area> + <Image imageset="opengate" image="StaticBackdrop" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="background_noframe"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="opengate" image="StaticLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><ImageDim imageset="opengate" image="StaticTop" dimension="Height" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="opengate" image="StaticRight" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="BottomEdge" > + <UnifiedDim scale="1" type="BottomEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="opengate" image="StaticBottom" dimension="Height" /> + </DimOperator> + </UnifiedDim> + </Dim> + </Area> + <Image imageset="opengate" image="StaticBackdrop" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> </WidgetLook> +<WidgetLook name="opengate/StaticFrame"> + <Property name="FrameEnabled" value="True" /> + <Property name="BackgroundEnabled" value="True" /> + + <StateImagery name="Enabled" > + </StateImagery> + + <StateImagery name="Disabled" > + </StateImagery> + + <StateImagery name="EnabledFrame"> + <Layer> + <Section look="opengate/StaticShared" section="frame" /> + </Layer> + </StateImagery> + + <StateImagery name="DisabledFrame"> + </StateImagery> + + <StateImagery name="WithFrameEnabledBackground"> + <Layer> + <Section look="opengate/StaticShared" section="background" /> + </Layer> + </StateImagery> + + <StateImagery name="WithFrameDisabledBackground"> + <Layer> + <Section look="opengate/StaticShared" section="frame" /> + </Layer> + </StateImagery> + + <StateImagery name="NoFrameEnabledBackground"> + <Layer> + <Section look="opengate/StaticShared" section="background" /> + </Layer> + </StateImagery> + + <StateImagery name="NoFrameDisabledBackground"> + </StateImagery> + +</WidgetLook> + + + <!-- *************************************************** opengate/StaticImage Modified: trunk/data/gui/schemes/opengate.scheme =================================================================== --- trunk/data/gui/schemes/opengate.scheme 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/data/gui/schemes/opengate.scheme 2009-12-20 23:46:01 UTC (rev 1157) @@ -42,6 +42,11 @@ <!-- opengateStatic.looknfeel --> + <FalagardMapping + WindowType="opengate/StaticFrame" + TargetType="DefaultWindow" + Renderer="Falagard/StaticImage" + LookNFeel="opengate/StaticFrame" /> <FalagardMapping WindowType="opengate/StaticImage" TargetType="DefaultWindow" Modified: trunk/src/BaseDialog.cpp =================================================================== --- trunk/src/BaseDialog.cpp 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/src/BaseDialog.cpp 2009-12-20 23:46:01 UTC (rev 1157) @@ -32,17 +32,17 @@ void renameClonedWindows( const CEGUI::Window * parent, const CEGUI::String & namePrefix) { // std::cout << parent->getName() << ": " << parent->getChildCount() << std::endl; - for ( unsigned int i = 0; i < parent->getChildCount(); i ++ ){ + for ( unsigned int i = 0; i < parent->getChildCount(); i ++ ){ // std::cout << i << "accessing: "<< parent->getName() << std::endl; - CEGUI::Window * child = parent->getChildAtIdx( i ); - child->rename( namePrefix + child->getName() ); - renameClonedWindows( child, namePrefix ); - } + CEGUI::Window * child = parent->getChildAtIdx( i ); + child->rename( namePrefix + child->getName() ); + renameClonedWindows( child, namePrefix ); + } } -void showRecursive( CEGUI::Window * w ){ - w->show(); - for ( uint i = 0; i < w->getChildCount(); i ++ ) showRecursive( w->getChildAtIdx( i ) ); +void showRecursive( CEGUI::Window * w, bool show ){ + if ( show ) w->show(); else w->hide(); + for ( uint i = 0; i < w->getChildCount(); i ++ ) showRecursive( w->getChildAtIdx( i ), show ); } void fitWindowToImage( const std::string & name, CEGUI::Window * win ){ Modified: trunk/src/BaseDialog.h =================================================================== --- trunk/src/BaseDialog.h 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/src/BaseDialog.h 2009-12-20 23:46:01 UTC (rev 1157) @@ -28,7 +28,7 @@ namespace OpenGate{ void renameClonedWindows( const CEGUI::Window * parent, const CEGUI::String & namePrefix ); -void showRecursive( CEGUI::Window * w ); +void showRecursive( CEGUI::Window * w, bool show = true ); void fitWindowToImage( const std::string & name, CEGUI::Window * win ); float windowHeight( const CEGUI::Window * child ); float windowWidth( const CEGUI::Window * child ); Modified: trunk/src/ConfigDialog.cpp =================================================================== --- trunk/src/ConfigDialog.cpp 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/src/ConfigDialog.cpp 2009-12-20 23:46:01 UTC (rev 1157) @@ -21,6 +21,8 @@ #include "ConfigDialog.h" #include "common.h" #include "GameStateManager.h" +#include "KeyMap.h" + #include <CEGUI/CEGUIWindowManager.h> #include <CEGUI/elements/CEGUIPushButton.h> #include <CEGUI/elements/CEGUIListbox.h> @@ -34,59 +36,146 @@ namespace OpenGate{ ConfigDialog::ConfigDialog( ) - : BaseDialog( "dialogs/ConfigDialog.layout" ){ - setupEventHandlers(); + : BaseDialog( "dialogs/ConfigDialog.layout" ){ + setupEventHandlers(); - creditsListBox_ = static_cast<CEGUI::Listbox*> (CEGUI::WindowManager::getSingleton().getWindow( "Config/SubFrame/CreditsText" ) ); - - fillCreditsWindow(); - creditsListBox_->hide(); + lastActiveWindow_ = NULL; + activeWindow_ = NULL; } ConfigDialog::~ConfigDialog(){ } void ConfigDialog::setupEventHandlers(){ - CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton(); + CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton(); - BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"Config/QuitButton" ), - CEGUI::PushButton::EventClicked, ConfigDialog::handleQuitButton ); - BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"Config/CreditsButton" ), - CEGUI::PushButton::EventClicked, ConfigDialog::handleCreditsButton ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"Config/QuitButton" ), + CEGUI::PushButton::EventClicked, ConfigDialog::handleQuitButton_ ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"Config/CreditsButton" ), + CEGUI::PushButton::EventClicked, ConfigDialog::handleCreditsButton_ ); + BIND_CEGUI_EVENT( wmgr.getWindow( (CEGUI::utf8*)"Config/ControlsButton" ), + CEGUI::PushButton::EventClicked, ConfigDialog::handleControlsButton_ ); } -bool ConfigDialog::handleQuitButton( const CEGUI::EventArgs & e ){ - resources_->gameStateRoot->shutdown(); - return true; +bool ConfigDialog::handleQuitButton_( const CEGUI::EventArgs & e ){ + resources_->gameStateRoot->shutdown(); + return true; } -void ConfigDialog::fillCreditsWindow( ){ - std::string fileName = resources_->findFullFileName( "credits.txt" ); +bool ConfigDialog::handleControlsButton_( const CEGUI::EventArgs & e ){ + //std::cout << "ConfigDialog::handleConfigButton_( const CEGUI::EventArgs & e ){" << std::endl; +// CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/ControlSubFrame/Title" ) +// ->setProperty("Text", "" ); + + activeWindow_ = static_cast<CEGUI::Listbox*>( CEGUI::WindowManager::getSingleton().getWindow( "Config/Controls" ) ); + + KeyMap::KeyBindings keyBindings = resources_->keymap()->unDockedKeyBindings(); + uint count = 0; + + for ( KeyMap::KeyBindings::iterator it = keyBindings.begin(); it != keyBindings.end(); it ++ ){ + CEGUI::Window *b; + + if ( CEGUI::WindowManager::getSingleton().isWindowPresent( activeWindow_->getName() + it->first ) ){ + b = CEGUI::WindowManager::getSingleton().getWindow( activeWindow_->getName() + it->first ); + } else { + b = CEGUI::WindowManager::getSingleton().createWindow( "opengate/Button", activeWindow_->getName() + it->first ); + b->setProperty( "Text", it->first ); + b->setSize( CEGUI::UVector2( CEGUI::UDim( 0.0, 80.0 ), CEGUI::UDim( 0.0, 25.0 ) ) ); + b->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0, 85.0 * count ), CEGUI::UDim( 0.0, 0.0 ) ) ); + CEGUI::WindowManager::getSingleton().getWindow( "Config/Controls/Header" )->addChildWindow( b ); + count ++; + BIND_CEGUI_EVENT( b, CEGUI::PushButton::EventClicked, ConfigDialog::handleControlsCategoryButton_ ); + } - std::fstream file; file.open( fileName.c_str() ); + b->show(); + } + + if ( lastActiveWindow_ ) lastActiveWindow_->hide(); + activeWindow_->show(); + lastActiveWindow_ = activeWindow_; + + return true; +} - std::vector < std::string > row; - while( !file.eof() ){ - row = getRowSubstrings( file ); +bool ConfigDialog::handleControlsCategoryButton_( const CEGUI::EventArgs & e ){ + const CEGUI::WindowEventArgs & we = static_cast< const CEGUI::WindowEventArgs & >( e ); + std::string category( we.window->getText().c_str() ); + fillControlsWindow_( category ); + return true; +} - CEGUI::String str; - for ( uint i = 0; i < row.size(); i ++ ){ - str += row[ i ] + " "; - } - CEGUI::ListboxTextItem * item = new CEGUI::ListboxTextItem( str ); - creditsListBox_->addItem ( item ); - } - creditsListBox_->ensureItemIsVisible( creditsListBox_->getItemCount() ); - file.close(); +void ConfigDialog::fillControlsWindow_( const std::string & category ){ + CEGUI::Window * window = CEGUI::WindowManager::getSingleton().getWindow( "Config/Controls/Body" ); + + for ( uint i = 0; i < window->getChildCount(); i ++ ) { + CEGUI::WindowManager::getSingleton().destroyWindow( window->getChildAtIdx( i ) ); + } + //window->show(); + + std::map < std::string, std::pair< uint, uint > > keyBindings( resources_->keymap()->unDockedKeyBindings()[ category ] ); + uint count = 0; + for ( std::map < std::string, std::pair< uint, uint > >::iterator it = keyBindings.begin(); it != keyBindings.end(); it ++ ){ + std::string keyName( it->first ); + CEGUI::Window * b; + CEGUI::String keyWindowName( window->getName() + keyName ); + + if ( CEGUI::WindowManager::getSingleton().isWindowPresent( keyWindowName ) ){ + b = CEGUI::WindowManager::getSingleton().getWindow( keyWindowName ); + b->show(); + } else { + b = CEGUI::WindowManager::getSingleton().loadWindowLayout( "dialogs/ConfigControlKey.layout" ); + b->rename( keyWindowName ); + renameClonedWindows( b, keyWindowName ); + + window->addChildWindow( b ); + b->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0, 0.0 ), CEGUI::UDim( 0.0, count * 30 ) ) ); + + CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/Name" )->setProperty( "Text", keyName ); + CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton1" )->setProperty( "Text", + resources_->keymap()->keycodeName( it->second.first ) ); + CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton2" )->setProperty( "Text", + resources_->keymap()->keycodeName( it->second.second ) ); + + count ++; + + } + b->show(); + } } -bool ConfigDialog::handleCreditsButton( const CEGUI::EventArgs & e ){ - CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/SubFrame/Title" ) - ->setProperty("Text", "Credits" ); - creditsListBox_->show(); +bool ConfigDialog::handleCreditsButton_( const CEGUI::EventArgs & e ){ + //std::cout << "ConfigDialog::handleCreditsButton_( const CEGUI::EventArgs & e ){" << std::endl; + CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/Credits/Header" ) + ->setProperty("Text", "Credits" ); + + activeWindow_ = static_cast<CEGUI::Listbox*> (CEGUI::WindowManager::getSingleton().getWindow( "Config/Credits/Body" ) ); + fillCreditsWindow_( dynamic_cast<CEGUI::Listbox*>( activeWindow_ ) ); + if ( lastActiveWindow_ ) lastActiveWindow_->hide(); + activeWindow_->show(); + lastActiveWindow_ = activeWindow_; + return true; +} - return true; +void ConfigDialog::fillCreditsWindow_( CEGUI::Listbox * window ){ + window->resetList(); + std::string fileName = resources_->findFullFileName( "credits.txt" ); + + std::fstream file; file.open( fileName.c_str() ); + + std::vector < std::string > row; + while( !file.eof() ){ + row = getRowSubstrings( file ); + + CEGUI::String str; + for ( uint i = 0; i < row.size(); i ++ ){ + str += row[ i ] + " "; + } + CEGUI::ListboxTextItem * item = new CEGUI::ListboxTextItem( str ); + window->addItem ( item ); + } + window->ensureItemIsVisible( window->getItemCount() ); + file.close(); } } // namespace OpenGate Modified: trunk/src/ConfigDialog.h =================================================================== --- trunk/src/ConfigDialog.h 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/src/ConfigDialog.h 2009-12-20 23:46:01 UTC (rev 1157) @@ -28,21 +28,26 @@ class ConfigDialog : public BaseDialog{ public: - ConfigDialog( ); + ConfigDialog( ); - virtual ~ConfigDialog(); + virtual ~ConfigDialog(); - virtual void setupEventHandlers(); + virtual void setupEventHandlers(); protected: - void fillCreditsWindow(); + void fillCreditsWindow_( CEGUI::Listbox * window ); + void fillControlsWindow_( const std::string & category ); - bool handleQuitButton( const CEGUI::EventArgs & e ); - bool handleBackButton( const CEGUI::EventArgs & e ); - bool handleCreditsButton( const CEGUI::EventArgs & e ); + bool handleQuitButton_( const CEGUI::EventArgs & e ); + bool handleBackButton_( const CEGUI::EventArgs & e ); + bool handleCreditsButton_( const CEGUI::EventArgs & e ); + bool handleControlsButton_( const CEGUI::EventArgs & e ); + bool handleControlsCategoryButton_( const CEGUI::EventArgs & e ); - CEGUI::Listbox * creditsListBox_; + std::map < std::string, std::set < CEGUI::Window * > > controlKeys_; + CEGUI::Window * lastActiveWindow_; + CEGUI::Window * activeWindow_; }; } //namespace OpenGate Modified: trunk/src/GameStateManager.cpp =================================================================== --- trunk/src/GameStateManager.cpp 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/src/GameStateManager.cpp 2009-12-20 23:46:01 UTC (rev 1157) @@ -385,11 +385,8 @@ CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"opengate.scheme" ); resources_.guiSystem->setDefaultFont( (CEGUI::utf8*)"BlueHighway-12" ); - CEGUI::WindowFactoryManager::getSingleton() - - - - return true; +// CEGUI::WindowFactoryManager::getSingleton() + return true; } bool GameStateManager::initialiseInputManager( ) { Modified: trunk/src/InputManager.h =================================================================== --- trunk/src/InputManager.h 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/src/InputManager.h 2009-12-20 23:46:01 UTC (rev 1157) @@ -107,6 +107,8 @@ static InputManager & getSingleton( ); static InputManager * getSingletonPtr( ); + + inline OIS::Keyboard * keybord() { return keyboard_; } protected: Modified: trunk/src/KeyMap.cpp =================================================================== --- trunk/src/KeyMap.cpp 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/src/KeyMap.cpp 2009-12-20 23:46:01 UTC (rev 1157) @@ -32,88 +32,137 @@ } void KeyMap::setDefaults(){ - /*! Actions for undocked state */ - unDockedActionMap_[ keycode( 70 ) ] = &UnDockedState::keyActionSwitchMinMaxConsole; + registerUnDockedKeyAction_( "General", "Min/Max Console", &UnDockedState::keyActionSwitchMinMaxConsole, + keycode_( 70 ) ); - unDockedActionMap_[ keycode( OIS::KC_A ) ] = &UnDockedState::keyActionAvatarIncreaseYaw; - unDockedActionMap_[ keycode( OIS::KC_NUMPAD4 ) ] = &UnDockedState::keyActionAvatarIncreaseYaw; - unDockedActionMap_[ keycode( OIS::KC_D ) ] = &UnDockedState::keyActionAvatarDecreaseYaw; - unDockedActionMap_[ keycode( OIS::KC_NUMPAD6 ) ] = &UnDockedState::keyActionAvatarDecreaseYaw; - - unDockedActionMap_[ keycode( OIS::KC_W ) ] = &UnDockedState::keyActionAvatarIncreasePitch; - unDockedActionMap_[ keycode( OIS::KC_NUMPAD8 ) ] = &UnDockedState::keyActionAvatarIncreasePitch; - unDockedActionMap_[ keycode( OIS::KC_S ) ] = &UnDockedState::keyActionAvatarDecreasePitch; - unDockedActionMap_[ keycode( OIS::KC_NUMPAD2 ) ] = &UnDockedState::keyActionAvatarDecreasePitch; - - unDockedActionMap_[ keycode( 181 ) ] = &UnDockedState::keyActionAvatarIncreaseRoll; - unDockedActionMap_[ keycode( OIS::KC_NUMPAD0 ) ] = &UnDockedState::keyActionAvatarIncreaseRoll; - unDockedActionMap_[ keycode( 55 ) ] = &UnDockedState::keyActionAvatarDecreaseRoll; - unDockedActionMap_[ keycode( OIS::KC_NUMPADCOMMA ) ] = &UnDockedState::keyActionAvatarDecreaseRoll; - - unDockedActionMap_[ keycode( OIS::KC_NUMPAD5 ) ] = &UnDockedState::keyActionAvatarCenter; - - unDockedActionMap_[ keycode( OIS::KC_NUMPAD7 ) ] = &UnDockedState::keyActionAvatarIncrementThrust; - unDockedActionMap_[ keycode( OIS::KC_NUMPAD1 ) ] = &UnDockedState::keyActionAvatarDecrementThrust; - unDockedActionMap_[ keycode( OIS::KC_NUMPAD3 ) ] = &UnDockedState::keyActionAvatarBreakPressed; - unDockedActionMap_[ keycode( OIS::KC_NUMPAD9 ) ] = &UnDockedState::keyActionAvatarAfterburnerPressed; - - unDockedActionMap_[ keycode( OIS::KC_N ) ] = &UnDockedState::keyActionSelectTextTarget; - unDockedActionMap_[ keycode( OIS::KC_P ) ] = &UnDockedState::keyActionSelectPreviousTarget; - - unDockedActionMap_[ keycode( OIS::KC_1 ) ] = &UnDockedState::keyActionCameraNormal; - unDockedActionMap_[ keycode( OIS::KC_2 ) ] = &UnDockedState::keyActionCameraLeft; - unDockedActionMap_[ keycode( OIS::KC_3 ) ] = &UnDockedState::keyActionCameraRight; - unDockedActionMap_[ keycode( OIS::KC_4 ) ] = &UnDockedState::keyActionCameraUp; - unDockedActionMap_[ keycode( OIS::KC_5 ) ] = &UnDockedState::keyActionCameraDown; - unDockedActionMap_[ keycode( OIS::KC_6 ) ] = &UnDockedState::keyActionCameraToggle; + registerUnDockedKeyAction_( "Flight", "1 Rudder increase yaw", &UnDockedState::keyActionAvatarIncreaseYaw, + keycode_( OIS::KC_A ), keycode_( OIS::KC_NUMPAD4 ) ); + registerUnDockedKeyAction_( "Flight", "2 Rudder decrease yaw", &UnDockedState::keyActionAvatarDecreaseYaw, + keycode_( OIS::KC_D ), keycode_( OIS::KC_NUMPAD6 ) ); + registerUnDockedKeyAction_( "Flight", "3 Rudder increase pitch", &UnDockedState::keyActionAvatarIncreasePitch, + keycode_( OIS::KC_W ), keycode_( OIS::KC_NUMPAD8 ) ); + registerUnDockedKeyAction_( "Flight", "4 Rudder decrease pitch", &UnDockedState::keyActionAvatarDecreasePitch, + keycode_( OIS::KC_S ), keycode_( OIS::KC_NUMPAD2 ) ); + registerUnDockedKeyAction_( "Flight", "5 Rudder increase roll", &UnDockedState::keyActionAvatarIncreaseRoll, + keycode_( 181 ), keycode_( OIS::KC_NUMPAD0 ) ); + registerUnDockedKeyAction_( "Flight", "6 Rudder decrease roll", &UnDockedState::keyActionAvatarDecreaseRoll, + keycode_( 55 ), keycode_( OIS::KC_NUMPADCOMMA ) ); + registerUnDockedKeyAction_( "Flight", "7 Rudder center", &UnDockedState::keyActionAvatarCenter, + keycode_( OIS::KC_NUMPAD5 ) ); - unDockedActionMap_[ keycode( OIS::KC_A, KEY_SHIFT ) ] = &UnDockedState::keyActionDockAssist; + registerUnDockedKeyAction_( "Flight", "8 Increase thrust", &UnDockedState::keyActionAvatarIncrementThrust, + keycode_( OIS::KC_NUMPAD7 ) ); + registerUnDockedKeyAction_( "Flight", "9 Decrease thrust", &UnDockedState::keyActionAvatarDecrementThrust, + keycode_( OIS::KC_NUMPAD1 ) ); + registerUnDockedKeyAction_( "Flight", "Break", &UnDockedState::keyActionAvatarBreakPressed, + keycode_( OIS::KC_NUMPAD3 ) ); + registerUnDockedKeyAction_( "Flight", "Afterburner", &UnDockedState::keyActionAvatarAfterburnerPressed, + keycode_( OIS::KC_NUMPAD9 ) ); + registerUnDockedKeyAction_( "Flight", "Docking assistant", &UnDockedState::keyActionDockAssist, + keycode_( OIS::KC_A, KEY_SHIFT ) ); + + registerUnDockedKeyAction_( "Radar", "Select next target", &UnDockedState::keyActionSelectTextTarget, + keycode_( OIS::KC_N ) ); + registerUnDockedKeyAction_( "Radar", "Select previous target", &UnDockedState::keyActionSelectPreviousTarget, + keycode_( OIS::KC_P ) ); + + registerUnDockedKeyAction_( "Camera", "Normal", &UnDockedState::keyActionCameraNormal, + keycode_( OIS::KC_1 ) ); + registerUnDockedKeyAction_( "Camera", "Look left", &UnDockedState::keyActionCameraLeft, + keycode_( OIS::KC_2 ) ); + registerUnDockedKeyAction_( "Camera", "Look right", &UnDockedState::keyActionCameraRight, + keycode_( OIS::KC_3 ) ); + registerUnDockedKeyAction_( "Camera", "Look up", &UnDockedState::keyActionCameraUp, + keycode_( OIS::KC_4 ) ); + registerUnDockedKeyAction_( "Camera", "Look down", &UnDockedState::keyActionCameraDown, + keycode_( OIS::KC_5 ) ); + registerUnDockedKeyAction_( "Camera", "Toggle mode", &UnDockedState::keyActionCameraToggle, + keycode_( OIS::KC_6 ) ); + + /*! Actions for development, will removed later. */ + registerUnDockedKeyAction_( "Development", "Toggle filtering", &UnDockedState::keyActionToggleFiltering_DEV, + keycode_( OIS::KC_F ) ); + registerUnDockedKeyAction_( "Development", "Toggle polygone", &UnDockedState::keyActionTogglePolygonMode_DEV, + keycode_( OIS::KC_R, KEY_CONTROL ) ); + registerUnDockedKeyAction_( "Development", "1 Increase ambient light", &UnDockedState::keyActionIncreaseAmbientLight_DEV, + keycode_( OIS::KC_L, KEY_SHIFT ) ); + registerUnDockedKeyAction_( "Development", "2 Decrease ambient light", &UnDockedState::keyActionDecreaseAmbientLight_DEV, + keycode_( OIS::KC_L ) ); + registerUnDockedKeyAction_( "Development", "3 Increase time zoom", &UnDockedState::keyActionIncreaseTimeZoom_DEV, + keycode_( OIS::KC_T, KEY_SHIFT ) ); + registerUnDockedKeyAction_( "Development", "4 Decrease time zoom", &UnDockedState::keyActionDecreaseTimeZoom_DEV, + keycode_( OIS::KC_T ) ); + registerUnDockedKeyAction_( "Development", "5 Increase shader scheme", &UnDockedState::keyActionIncreaseShaderScheme_DEV, + keycode_( OIS::KC_O, KEY_SHIFT ) ); + registerUnDockedKeyAction_( "Development", "6 Decrease shader scheme", &UnDockedState::keyActionDecreaseShaderScheme_DEV, + keycode_( OIS::KC_O ) ); - /*! Actions for console. */ - consoleActionMap_[ keycode( OIS::KC_SYSRQ ) ] = &Console::keyActionScreenshot; - consoleActionMap_[ keycode( OIS::KC_Q, KEY_CONTROL ) ]= &Console::keyActionShutdown_DEV; - // consoleActionMap_[ keycode( OIS::KC_F4, KEY_ALT ) ] = &Console::keyActionShutdown_DEV; - - /*! Actions for development, will removed later. */ - unDockedActionMap_[ keycode( OIS::KC_F ) ] = &UnDockedState::keyActionToggleFiltering_DEV; - unDockedActionMap_[ keycode( OIS::KC_R, KEY_CONTROL ) ] = &UnDockedState::keyActionTogglePolygonMode_DEV; - - unDockedActionMap_[ keycode( OIS::KC_L, KEY_SHIFT ) ] = &UnDockedState::keyActionIncreaseAmbientLight_DEV; - unDockedActionMap_[ keycode( OIS::KC_L ) ] = &UnDockedState::keyActionDecreaseAmbientLight_DEV; - - unDockedActionMap_[ keycode( OIS::KC_T, KEY_SHIFT ) ] = &UnDockedState::keyActionIncreaseTimeZoom_DEV; - unDockedActionMap_[ keycode( OIS::KC_T ) ] = &UnDockedState::keyActionDecreaseTimeZoom_DEV; + registerUnDockedKeyAction_( "Development", "Toggle pilot duelist", &UnDockedState::keyActionAvatarSwitchDuelistPilot_DEV, + keycode_( OIS::KC_F5 ) ); + registerUnDockedKeyAction_( "Development", "Toggle pilot target", &UnDockedState::keyActionAvatarSwitchDuelistTarget_DEV, + keycode_( OIS::KC_F6 ) ); + registerUnDockedKeyAction_( "Development", "Instant dock/launch", &UnDockedState::keyActionAvatarChangeDockedState_DEV, + keycode_( OIS::KC_F4 ) ); + registerUnDockedKeyAction_( "Development", "Selfdestruct", &UnDockedState::keyActionAvatarSelfDestruct_DEV, + keycode_( OIS::KC_F8 ) ); + registerUnDockedKeyAction_( "Development", "Spawn autodocking ai", &UnDockedState::keyActionSpawnAi_DEV, + keycode_( OIS::KC_F7 ) ); + registerUnDockedKeyAction_( "Development", "Show infos", &UnDockedState::keyActionShowInfos_DEV, + keycode_( OIS::KC_I, KEY_CONTROL ) ); + registerUnDockedKeyAction_( "Development", "Show ecliptic", &UnDockedState::keyActionShowEcliptic_DEV, + keycode_( OIS::KC_E, KEY_SHIFT ) ); + registerUnDockedKeyAction_( "Development", "7 test inc", &UnDockedState::keyActionTmpUp_DEV, + keycode_( OIS::KC_G, KEY_SHIFT ) ); + registerUnDockedKeyAction_( "Development", "8 test dec", &UnDockedState::keyActionTmpDown_DEV, + keycode_( OIS::KC_G ) ); - unDockedActionMap_[ keycode( OIS::KC_O, KEY_SHIFT ) ] = &UnDockedState::keyActionIncreaseShaderScheme_DEV; - unDockedActionMap_[ keycode( OIS::KC_O ) ] = &UnDockedState::keyActionDecreaseShaderScheme_DEV; + /*! Actions for console. */ + consoleActionMap_[ keycode_( OIS::KC_SYSRQ ) ] = &Console::keyActionScreenshot; + consoleActionMap_[ keycode_( OIS::KC_Q, KEY_CONTROL ) ]= &Console::keyActionShutdown_DEV; + // consoleActionMap_[ keycode_( OIS::KC_F4, KEY_ALT ) ] = &Console::keyActionShutdown_DEV; +} - unDockedActionMap_[ keycode( OIS::KC_F5 ) ] = &UnDockedState::keyActionAvatarSwitchDuelistPilot_DEV; - unDockedActionMap_[ keycode( OIS::KC_F6 ) ] = &UnDockedState::keyActionAvatarSwitchDuelistTarget_DEV; - unDockedActionMap_[ keycode( OIS::KC_F4 ) ] = &UnDockedState::keyActionAvatarChangeDockedState_DEV; - unDockedActionMap_[ keycode( OIS::KC_F8 ) ] = &UnDockedState::keyActionAvatarSelfDestruct_DEV; - unDockedActionMap_[ keycode( OIS::KC_F7 ) ] = &UnDockedState::keyActionSpawnAi_DEV; - unDockedActionMap_[ keycode( OIS::KC_I, KEY_CONTROL ) ] = &UnDockedState::keyActionShowInfos_DEV; - unDockedActionMap_[ keycode( OIS::KC_E, KEY_SHIFT ) ] = &UnDockedState::keyActionShowEcliptic_DEV; - - unDockedActionMap_[ keycode( OIS::KC_G, KEY_SHIFT ) ] = &UnDockedState::keyActionTmpUp_DEV; - unDockedActionMap_[ keycode( OIS::KC_G ) ] = &UnDockedState::keyActionTmpDown_DEV; +void KeyMap::registerUnDockedKeyAction_( const std::string & category, const std::string & name, bool (UnDockedState::*action)( bool ), + uint key1, uint key2 ){ + unDockedKeyBindings_[ category ].insert( std::pair < std::string, std::pair < uint, uint > > ( name, std::pair< uint, uint >( key1, key2 ) ) ); + unDockedActionMap_[ key1 ] = action; + if ( key2 ) unDockedActionMap_[ key2 ] = action; } - + + bool(UnDockedState::*KeyMap::unDockedKeyAction( const OIS::KeyEvent & e ))(bool) { - uint key = keycode( e.key, modifier_ ); - if ( unDockedActionMap_.count( key ) > 0 ) return unDockedActionMap_[ key ]; - return &UnDockedState::keyActionDoNothing; + uint key = keycode_( e.key, modifier_ ); + if ( unDockedActionMap_.count( key ) > 0 ) return unDockedActionMap_[ key ]; + return &UnDockedState::keyActionDoNothing; } bool(Console::*KeyMap::consoleKeyAction( const OIS::KeyEvent & e ))(bool) { - uint key = keycode( e.key, modifier_ ); - if ( consoleActionMap_.count( key ) > 0 ) return consoleActionMap_[ key ]; - return &Console::keyActionDoNothing; + uint key = keycode_( e.key, modifier_ ); + if ( consoleActionMap_.count( key ) > 0 ) return consoleActionMap_[ key ]; + return &Console::keyActionDoNothing; } - -uint KeyMap::keycode( uint key, GlobalKeyModifier modifier ){ - return modifier * 65565 + key; + +std::string KeyMap::keycodeName( uint keycode ){ + GlobalKeyModifier modifier = (GlobalKeyModifier)( keycode / 65565 ); + uint key = keycode - modifier * 65565; + + std::string name; + switch ( modifier ){ + case KEY_CONTROL: name += "Ctrl-"; break; + case KEY_SHIFT: name += "Shift-"; break; + default: break; + } + + std::string keyname( ResourceManager::getSingletonPtr()->inputManager->keybord()->getAsString( OIS::KeyCode( key ) ) ); + if ( keyname != "Unknown" ){ + name += keyname; + } + return name; } + +uint KeyMap::keycode_( uint key, GlobalKeyModifier modifier ){ + return modifier * 65565 + key; +} } // namespace OpenGate Modified: trunk/src/KeyMap.h =================================================================== --- trunk/src/KeyMap.h 2009-12-20 00:18:05 UTC (rev 1156) +++ trunk/src/KeyMap.h 2009-12-20 23:46:01 UTC (rev 1157) @@ -37,28 +37,43 @@ class KeyMap{ public: + typedef std::map< std::string, std::map < std::string, std::pair< uint, uint > > > KeyBindings; + KeyMap(); ~KeyMap(); - void setDefaults(); + void setDefaults(); - bool (UnDockedState::*unDockedKeyAction( const OIS::KeyEvent & e ))( bool ); + bool (UnDockedState::*unDockedKeyAction( const OIS::KeyEvent & e ))( bool ); - bool (Console::*consoleKeyAction( const OIS::KeyEvent & e ))( bool ); + bool (Console::*consoleKeyAction( const OIS::KeyEvent & e ))( bool ); - void setGlobalKeyModifier( GlobalKeyModifier modifier ){ modifier_ = modifier; } + void setGlobalKeyModifier( GlobalKeyModifier modifier ){ modifier_ = modifier; } - GlobalKeyModifier globalKeyModifier( ) const { return modifier_; } - - uint keycode( uint key, GlobalKeyModifier modifier = KEY_NONE ); - + GlobalKeyModifier globalKeyModifier( ) const { return modifier_; } + + std::map< std::string, std::map < std::string, std::pair< uint, uint > > > & unDockedKeyBindings() { return unDockedKeyBindings_; } + + /*! Return literal name for the key bindings. e.g. 'Shift-A', or 'Ctrl-B' */ + std::string keycodeName( uint keycode ); + protected: + /*! Return unique key identifier. */ + uint keycode_( uint key, GlobalKeyModifier modifier = KEY_NONE ); + + void registerUnDockedKeyAction_( const std::string & category, const std::string & name, + bool (UnDockedState::*unDockedKeyAction)( bool ), + uint key1, uint key2 = 0 ); - std::map< uint, bool (UnDockedState::*)( bool ) > unDockedActionMap_; - std::map< uint, bool (Console::*)( bool ) > consoleActionMap_; + std::map< uint, bool (UnDockedState::*)( bool ) > unDockedActionMap_; + std::map< uint, bool (Console::*)( bool ) > consoleActionMap_; - GlobalKeyModifier modifier_; + GlobalKeyModifier modifier_; + + + // categorie < name, (key1, key2) > + KeyBindings unDockedKeyBindings_; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-12-21 18:33:26
|
Revision: 1158 http://opengate.svn.sourceforge.net/opengate/?rev=1158&view=rev Author: spom_spom Date: 2009-12-21 18:33:14 +0000 (Mon, 21 Dec 2009) Log Message: ----------- opengate-client: keybindings can now be altered via config-window Modified Paths: -------------- trunk/data/gui/looknfeel/opengateButtons.looknfeel trunk/data/gui/schemes/opengate.scheme trunk/src/BaseDialog.cpp trunk/src/ConfigDialog.cpp trunk/src/ConfigDialog.h trunk/src/Console.cpp trunk/src/KeyMap.cpp trunk/src/KeyMap.h trunk/src/ResourceManager.h Modified: trunk/data/gui/looknfeel/opengateButtons.looknfeel =================================================================== --- trunk/data/gui/looknfeel/opengateButtons.looknfeel 2009-12-20 23:46:01 UTC (rev 1157) +++ trunk/data/gui/looknfeel/opengateButtons.looknfeel 2009-12-21 18:33:14 UTC (rev 1158) @@ -497,95 +497,121 @@ </Layer> </StateImagery> </WidgetLook> + <!-- *************************************************** opengate/Editbox *************************************************** --> - <WidgetLook name="opengate/Editbox"> - <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> - <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" /> - <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" /> - <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" /> - <Property name="MouseCursorImage" value="set:opengate image:MouseTextBar" /> - <NamedArea name="TextArea"> - <Area> - <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim> - <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim> - <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim> - <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-3" type="BottomEdge" /></Dim> - </Area> - </NamedArea> - <ImagerySection name="container_normal"> - <FrameComponent> - <Area> - <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> - <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> - <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> - <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> - </Area> - <Image type="LeftEdge" imageset="opengate" image="EditBoxLeft" /> - <Image type="RightEdge" imageset="opengate" image="EditBoxRight" /> - <Image type="Background" imageset="opengate" image="EditBoxMiddle" /> - </FrameComponent> - </ImagerySection> - <ImagerySection name="selection"> - <ImageryComponent> - <Area> - <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> - <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> - <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim> - <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> - </Area> - <Image imageset="opengate" image="TextSelectionBrush" /> - <VertFormat type="Stretched" /> - <HorzFormat type="Stretched" /> - </ImageryComponent> - </ImagerySection> - <ImagerySection name="Carat"> - <ImageryComponent> - <Area> - <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> - <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> - <Dim type="Width" ><ImageDim imageset="opengate" image="EditBoxCarat" dimension="Width" /></Dim> - <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> - </Area> - <Image imageset="opengate" image="EditBoxCarat" /> - <VertFormat type="Stretched" /> - <HorzFormat type="Stretched" /> - </ImageryComponent> - </ImagerySection> - <StateImagery name="Enabled"> - <Layer> - <Section section="container_normal" /> - </Layer> - </StateImagery> - <StateImagery name="ReadOnly"> - <Layer> - <Section section="container_normal" /> - </Layer> - </StateImagery> - <StateImagery name="Disabled"> - <Layer> - <Section section="container_normal"> - <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> - </Section> - </Layer> - </StateImagery> - <StateImagery name="ActiveSelection"> - <Layer> - <Section section="selection"> - <ColourProperty name="ActiveSelectionColour" /> - </Section> - </Layer> - </StateImagery> - <StateImagery name="InactiveSelection"> - <Layer> - <Section section="selection"> - <ColourProperty name="InactiveSelectionColour" /> - </Section> - </Layer> - </StateImagery> +<!-- + PropertyDefinition specifications (optional, defaults will be black): + + * NormalTextColour - property that accesses a colour value to be used to render normal unselected text. + * SelectedTextColour - property that accesses a colour value to be used to render selected text. +--> + <WidgetLook name="opengate/Editbox"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" /> + <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" /> + <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" /> + <Property name="MouseCursorImage" value="set:opengate image:MouseTextBar" /> + +<!-- + NamedArea definitions: + + * TextArea - Defines the area where the text, carat, and any selection imagery will appear. +--> + <NamedArea name="TextArea"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-3" type="BottomEdge" /></Dim> + </Area> + </NamedArea> + + <ImagerySection name="container_normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="opengate" image="EditBoxLeft" /> + <Image type="RightEdge" imageset="opengate" image="EditBoxRight" /> + <Image type="Background" imageset="opengate" image="EditBoxMiddle" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="selection"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> + </Area> + <Image imageset="opengate" image="TextSelectionBrush" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="Carat"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><ImageDim imageset="opengate" image="EditBoxCarat" dimension="Width" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> + </Area> + <Image imageset="opengate" image="EditBoxCarat" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> +<!-- +StateImagery: + * Enabled - Imagery used when widget is enabled. + * Disabled - Imagery used when widget is disabled. + * ReadOnly - Imagery used when widget is in 'Read Only' state. + * ActiveSelection - Additional imagery used when a text selection is defined and the widget is active. The imagery for this state will be rendered within the selection area. + * InactiveSelection - Additional imagery used when a text selection is defined and the widget is not active. The imagery for this state will be rendered within the selection area. + --> + <StateImagery name="Enabled"> + <Layer> + <Section section="container_normal" /> + </Layer> + </StateImagery> + + <StateImagery name="Disabled"> + <Layer> + <Section section="container_normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + + <StateImagery name="ReadOnly"> + <Layer> + <Section section="container_normal" /> + </Layer> + </StateImagery> + + <StateImagery name="ActiveSelection"> + <Layer> + <Section section="selection"> + <ColourProperty name="ActiveSelectionColour" /> + </Section> + </Layer> + </StateImagery> + + <StateImagery name="InactiveSelection"> + <Layer> + <Section section="selection"> + <ColourProperty name="InactiveSelectionColour" /> + </Section> + </Layer> + </StateImagery> </WidgetLook> <!-- Modified: trunk/data/gui/schemes/opengate.scheme =================================================================== --- trunk/data/gui/schemes/opengate.scheme 2009-12-20 23:46:01 UTC (rev 1157) +++ trunk/data/gui/schemes/opengate.scheme 2009-12-21 18:33:14 UTC (rev 1158) @@ -42,12 +42,28 @@ <!-- opengateStatic.looknfeel --> + <!-- + new and renovated + --> <FalagardMapping WindowType="opengate/StaticFrame" TargetType="DefaultWindow" Renderer="Falagard/StaticImage" LookNFeel="opengate/StaticFrame" /> <FalagardMapping + WindowType="opengate/StaticTextLabel" + TargetType="DefaultWindow" + Renderer="Falagard/Default" + LookNFeel="opengate/StaticTextLabel" /> + <FalagardMapping + WindowType="opengate/Editbox" + TargetType="CEGUI/Editbox" + Renderer="Falagard/Editbox" + LookNFeel="opengate/Editbox"/> + <!-- + new and renovated + --> + <FalagardMapping WindowType="opengate/StaticImage" TargetType="DefaultWindow" Renderer="Falagard/StaticImage" @@ -72,11 +88,7 @@ TargetType="DefaultWindow" Renderer="Falagard/StaticText" LookNFeel="opengate/StaticText" /> - <FalagardMapping - WindowType="opengate/StaticTextLabel" - TargetType="DefaultWindow" - Renderer="Falagard/Default" - LookNFeel="opengate/StaticTextLabel" /> + <FalagardMapping WindowType="opengate/StaticLabel" TargetType="CEGUI/PushButton" @@ -126,11 +138,6 @@ Renderer="Falagard/SystemButton" LookNFeel="opengate/ConsoleScrollButtonDown" /> <FalagardMapping - WindowType="opengate/Editbox" - TargetType="CEGUI/Editbox" - Renderer="Falagard/Editbox" - LookNFeel="opengate/Editbox"/> - <FalagardMapping WindowType="opengate/ConsoleEditbox" TargetType="CEGUI/Editbox" Renderer="Falagard/Editbox" Modified: trunk/src/BaseDialog.cpp =================================================================== --- trunk/src/BaseDialog.cpp 2009-12-20 23:46:01 UTC (rev 1157) +++ trunk/src/BaseDialog.cpp 2009-12-21 18:33:14 UTC (rev 1158) @@ -35,7 +35,7 @@ for ( unsigned int i = 0; i < parent->getChildCount(); i ++ ){ // std::cout << i << "accessing: "<< parent->getName() << std::endl; CEGUI::Window * child = parent->getChildAtIdx( i ); - child->rename( namePrefix + child->getName() ); + CEGUI::WindowManager::getSingleton().renameWindow( child , namePrefix + child->getName() ); renameClonedWindows( child, namePrefix ); } } Modified: trunk/src/ConfigDialog.cpp =================================================================== --- trunk/src/ConfigDialog.cpp 2009-12-20 23:46:01 UTC (rev 1157) +++ trunk/src/ConfigDialog.cpp 2009-12-21 18:33:14 UTC (rev 1158) @@ -22,9 +22,11 @@ #include "common.h" #include "GameStateManager.h" #include "KeyMap.h" +#include "LogManager.h" #include <CEGUI/CEGUIWindowManager.h> #include <CEGUI/elements/CEGUIPushButton.h> +#include <CEGUI/elements/CEGUIEditbox.h> #include <CEGUI/elements/CEGUIListbox.h> #include <CEGUI/elements/CEGUIListboxTextItem.h> @@ -63,16 +65,12 @@ } bool ConfigDialog::handleControlsButton_( const CEGUI::EventArgs & e ){ - //std::cout << "ConfigDialog::handleConfigButton_( const CEGUI::EventArgs & e ){" << std::endl; -// CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/ControlSubFrame/Title" ) -// ->setProperty("Text", "" ); - activeWindow_ = static_cast<CEGUI::Listbox*>( CEGUI::WindowManager::getSingleton().getWindow( "Config/Controls" ) ); - KeyMap::KeyBindings keyBindings = resources_->keymap()->unDockedKeyBindings(); + KeyMap::KeyBindingsMap keyBindings = resources_->keymap()->unDockedKeyBindings(); uint count = 0; - for ( KeyMap::KeyBindings::iterator it = keyBindings.begin(); it != keyBindings.end(); it ++ ){ + for ( KeyMap::KeyBindingsMap::iterator it = keyBindings.begin(); it != keyBindings.end(); it ++ ){ CEGUI::Window *b; if ( CEGUI::WindowManager::getSingleton().isWindowPresent( activeWindow_->getName() + it->first ) ){ @@ -100,6 +98,7 @@ bool ConfigDialog::handleControlsCategoryButton_( const CEGUI::EventArgs & e ){ const CEGUI::WindowEventArgs & we = static_cast< const CEGUI::WindowEventArgs & >( e ); std::string category( we.window->getText().c_str() ); + fillControlsWindow_( category ); return true; } @@ -107,13 +106,18 @@ void ConfigDialog::fillControlsWindow_( const std::string & category ){ CEGUI::Window * window = CEGUI::WindowManager::getSingleton().getWindow( "Config/Controls/Body" ); + std::vector <CEGUI::Window *> removeList; for ( uint i = 0; i < window->getChildCount(); i ++ ) { - CEGUI::WindowManager::getSingleton().destroyWindow( window->getChildAtIdx( i ) ); + removeList.push_back( window->getChildAtIdx( i ) ); } + for ( uint i = 0; i < removeList.size(); i ++ ) { + CEGUI::WindowManager::getSingleton().destroyWindow( removeList[ i ] ); + } //window->show(); std::map < std::string, std::pair< uint, uint > > keyBindings( resources_->keymap()->unDockedKeyBindings()[ category ] ); uint count = 0; + double x = 0.0, y; for ( std::map < std::string, std::pair< uint, uint > >::iterator it = keyBindings.begin(); it != keyBindings.end(); it ++ ){ std::string keyName( it->first ); @@ -125,11 +129,17 @@ b->show(); } else { b = CEGUI::WindowManager::getSingleton().loadWindowLayout( "dialogs/ConfigControlKey.layout" ); - b->rename( keyWindowName ); + CEGUI::WindowManager::getSingleton().renameWindow( b, keyWindowName ); renameClonedWindows( b, keyWindowName ); window->addChildWindow( b ); - b->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0, 0.0 ), CEGUI::UDim( 0.0, count * 30 ) ) ); + + y = count * 30.0; + if ( y > window->getPixelSize().d_height - 30.0 ){ + x = b->getPixelSize().d_width + 10; y = 0.0; + count = 0; + } + b->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0, x ), CEGUI::UDim( 0.0, y ) ) ); CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/Name" )->setProperty( "Text", keyName ); CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton1" )->setProperty( "Text", @@ -137,13 +147,38 @@ CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton2" )->setProperty( "Text", resources_->keymap()->keycodeName( it->second.second ) ); - count ++; - + BIND_CEGUI_EVENT( CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton1" ), + CEGUI::PushButton::EventKeyDown, ConfigDialog::handleControlsKey1Button_ ); + BIND_CEGUI_EVENT( CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton2" ), + CEGUI::PushButton::EventKeyDown, ConfigDialog::handleControlsKey2Button_ ); } + count ++; b->show(); } } +bool ConfigDialog::handleControlsKeyButton_( const CEGUI::EventArgs & e, uint key ){ + const CEGUI::WindowEventArgs & we = static_cast< const CEGUI::WindowEventArgs & >( e ); + CEGUI::Window *b = we.window->getParent(); + + uint keycode = resources_->keymap()->lastKeycode(); + if ( resources_->keymap()->lastKeycode() == OIS::KC_ESCAPE ) return true; + + if ( !resources_->keymap()->haveKeyBinding( keycode ) ){ + CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton" + toStr( key ) )->setProperty( "Text", + resources_->keymap()->keycodeName( keycode ) ); + + + resources_->keymap()->setKeyBinding( CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/Name" )->getProperty( "Text").c_str(), keycode, key ); + } else { + resources_->log().warn( "there is allready a binding for " + resources_->keymap()->keycodeName( keycode ) ); + } + + + return true; +} + + bool ConfigDialog::handleCreditsButton_( const CEGUI::EventArgs & e ){ //std::cout << "ConfigDialog::handleCreditsButton_( const CEGUI::EventArgs & e ){" << std::endl; CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/Credits/Header" ) Modified: trunk/src/ConfigDialog.h =================================================================== --- trunk/src/ConfigDialog.h 2009-12-20 23:46:01 UTC (rev 1157) +++ trunk/src/ConfigDialog.h 2009-12-21 18:33:14 UTC (rev 1158) @@ -44,6 +44,10 @@ bool handleControlsButton_( const CEGUI::EventArgs & e ); bool handleControlsCategoryButton_( const CEGUI::EventArgs & e ); + inline bool handleControlsKey1Button_( const CEGUI::EventArgs & e ){ return handleControlsKeyButton_( e, 1 ); } + inline bool handleControlsKey2Button_( const CEGUI::EventArgs & e ){ return handleControlsKeyButton_( e, 2 ); } + bool handleControlsKeyButton_( const CEGUI::EventArgs & e, uint key ); + std::map < std::string, std::set < CEGUI::Window * > > controlKeys_; CEGUI::Window * lastActiveWindow_; Modified: trunk/src/Console.cpp =================================================================== --- trunk/src/Console.cpp 2009-12-20 23:46:01 UTC (rev 1157) +++ trunk/src/Console.cpp 2009-12-21 18:33:14 UTC (rev 1158) @@ -126,27 +126,27 @@ } bool Console::keyPressed( const OIS::KeyEvent & e ){ + if ( e.key == OIS::KC_LCONTROL) resources_->keymap()->setGlobalKeyModifier( KEY_CONTROL ); + if ( e.key == OIS::KC_RCONTROL) resources_->keymap()->setGlobalKeyModifier( KEY_CONTROL ); + if ( e.key == OIS::KC_LSHIFT) resources_->keymap()->setGlobalKeyModifier( KEY_SHIFT ); + if ( e.key == OIS::KC_RSHIFT) resources_->keymap()->setGlobalKeyModifier( KEY_SHIFT ); + resources_->keymap()->setLastKeycode( e.key ); - CEGUI::System::getSingleton().injectKeyDown( e.key ); - CEGUI::System::getSingleton().injectChar( e.text ); + CEGUI::System::getSingleton().injectKeyDown( e.key ); + CEGUI::System::getSingleton().injectChar( e.text ); - //** for testings - if ( e.key == OIS::KC_BACK && resources_->keymap()->globalKeyModifier( ) == KEY_CONTROL ){ - resources_->renderWindow->setFullscreen( true, + //** for testings + if ( e.key == OIS::KC_BACK && resources_->keymap()->globalKeyModifier( ) == KEY_CONTROL ){ + resources_->renderWindow->setFullscreen( true, resources_->renderWindow->getWidth(), resources_->renderWindow->getHeight() ); - // resources_->renderWindow->resize( 1280, 1024 ); - std::cout << "Fullscreen: " << resources_->renderWindow->isFullScreen() << std::endl; - } + // resources_->renderWindow->resize( 1280, 1024 ); + std::cout << "Fullscreen: " << resources_->renderWindow->isFullScreen() << std::endl; + } - if ( e.key == OIS::KC_LCONTROL) resources_->keymap()->setGlobalKeyModifier( KEY_CONTROL ); - if ( e.key == OIS::KC_RCONTROL) resources_->keymap()->setGlobalKeyModifier( KEY_CONTROL ); - if ( e.key == OIS::KC_LSHIFT) resources_->keymap()->setGlobalKeyModifier( KEY_SHIFT ); - if ( e.key == OIS::KC_RSHIFT) resources_->keymap()->setGlobalKeyModifier( KEY_SHIFT ); - - if ( (this->*resources_->keymap()->consoleKeyAction( e ))( true ) ) return true; + if ( (this->*resources_->keymap()->consoleKeyAction( e ))( true ) ) return true; - return true; + return true; } bool Console::keyReleased( const OIS::KeyEvent & e ){ Modified: trunk/src/KeyMap.cpp =================================================================== --- trunk/src/KeyMap.cpp 2009-12-20 23:46:01 UTC (rev 1157) +++ trunk/src/KeyMap.cpp 2009-12-21 18:33:14 UTC (rev 1158) @@ -66,17 +66,17 @@ registerUnDockedKeyAction_( "Radar", "Select previous target", &UnDockedState::keyActionSelectPreviousTarget, keycode_( OIS::KC_P ) ); - registerUnDockedKeyAction_( "Camera", "Normal", &UnDockedState::keyActionCameraNormal, + registerUnDockedKeyAction_( "Camera", "1 Normal", &UnDockedState::keyActionCameraNormal, keycode_( OIS::KC_1 ) ); - registerUnDockedKeyAction_( "Camera", "Look left", &UnDockedState::keyActionCameraLeft, + registerUnDockedKeyAction_( "Camera", "2 Look left", &UnDockedState::keyActionCameraLeft, keycode_( OIS::KC_2 ) ); - registerUnDockedKeyAction_( "Camera", "Look right", &UnDockedState::keyActionCameraRight, + registerUnDockedKeyAction_( "Camera", "3 Look right", &UnDockedState::keyActionCameraRight, keycode_( OIS::KC_3 ) ); - registerUnDockedKeyAction_( "Camera", "Look up", &UnDockedState::keyActionCameraUp, + registerUnDockedKeyAction_( "Camera", "4 Look up", &UnDockedState::keyActionCameraUp, keycode_( OIS::KC_4 ) ); - registerUnDockedKeyAction_( "Camera", "Look down", &UnDockedState::keyActionCameraDown, + registerUnDockedKeyAction_( "Camera", "5 Look down", &UnDockedState::keyActionCameraDown, keycode_( OIS::KC_5 ) ); - registerUnDockedKeyAction_( "Camera", "Toggle mode", &UnDockedState::keyActionCameraToggle, + registerUnDockedKeyAction_( "Camera", "6 Toggle mode", &UnDockedState::keyActionCameraToggle, keycode_( OIS::KC_6 ) ); /*! Actions for development, will removed later. */ @@ -125,6 +125,8 @@ void KeyMap::registerUnDockedKeyAction_( const std::string & category, const std::string & name, bool (UnDockedState::*action)( bool ), uint key1, uint key2 ){ unDockedKeyBindings_[ category ].insert( std::pair < std::string, std::pair < uint, uint > > ( name, std::pair< uint, uint >( key1, key2 ) ) ); + unDockedKeyActions_[ name ] = action; + unDockedActionMap_[ key1 ] = action; if ( key2 ) unDockedActionMap_[ key2 ] = action; } @@ -160,6 +162,39 @@ return name; } +bool KeyMap::haveKeyBinding( uint keycode ){ + if ( unDockedActionMap_.count( keycode ) || consoleActionMap_.count( keycode ) ){ + return true; + } + return false; +} + +void KeyMap::setKeyBinding( const std::string & name, uint keycode, uint key ){ + for ( KeyBindingsMap::iterator it = unDockedKeyBindings_.begin(); it != unDockedKeyBindings_.end(); it ++ ){ + std::map < std::string, std::pair< uint, uint > >::iterator keyBinding = it->second.find( name ); + if ( keyBinding != it->second.end() ){ + uint oldKeyCode = 0; + if ( key == 1 ){ + oldKeyCode = keyBinding->second.first; + keyBinding->second.first = keycode; + } else { + oldKeyCode = keyBinding->second.second; + keyBinding->second.second = keycode; + } + + if ( unDockedActionMap_.count( oldKeyCode ) ){ + unDockedActionMap_.erase( oldKeyCode ); + } + + unDockedActionMap_[ keycode ] = unDockedKeyActions_[ name ]; + std::cout << " KeyMap::setKeyBinding: " << name << "->" << keycodeName( keycode ) << std::endl; + break; + } else { + std::cerr << " KeyMap::setKeyBinding: no key action for " << name << " registered" << std::endl; + } + } +} + uint KeyMap::keycode_( uint key, GlobalKeyModifier modifier ){ return modifier * 65565 + key; } Modified: trunk/src/KeyMap.h =================================================================== --- trunk/src/KeyMap.h 2009-12-20 23:46:01 UTC (rev 1157) +++ trunk/src/KeyMap.h 2009-12-21 18:33:14 UTC (rev 1158) @@ -37,7 +37,7 @@ class KeyMap{ public: - typedef std::map< std::string, std::map < std::string, std::pair< uint, uint > > > KeyBindings; + typedef std::map< std::string, std::map < std::string, std::pair< uint, uint > > > KeyBindingsMap; KeyMap(); @@ -58,6 +58,14 @@ /*! Return literal name for the key bindings. e.g. 'Shift-A', or 'Ctrl-B' */ std::string keycodeName( uint keycode ); + void setLastKeycode( uint key ) { lastKeycode_ = keycode_( key, modifier_ ); } + + uint lastKeycode() const { return lastKeycode_; } + + void setKeyBinding( const std::string & name, uint keycode, uint key ); + + bool haveKeyBinding( uint keycode ); + protected: /*! Return unique key identifier. */ uint keycode_( uint key, GlobalKeyModifier modifier = KEY_NONE ); @@ -71,9 +79,11 @@ GlobalKeyModifier modifier_; + uint lastKeycode_; // categorie < name, (key1, key2) > - KeyBindings unDockedKeyBindings_; + KeyBindingsMap unDockedKeyBindings_; + std::map < std::string, bool (UnDockedState::*)( bool ) > unDockedKeyActions_; }; Modified: trunk/src/ResourceManager.h =================================================================== --- trunk/src/ResourceManager.h 2009-12-20 23:46:01 UTC (rev 1157) +++ trunk/src/ResourceManager.h 2009-12-21 18:33:14 UTC (rev 1158) @@ -83,6 +83,8 @@ bool mappingCapability() const { return mapping_; } KeyMap * keymap() { return keymap_; } + + inline LogManager & log() { return * log_; } protected: Ogre::Root * ogreRoot_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-12-21 22:41:52
|
Revision: 1159 http://opengate.svn.sourceforge.net/opengate/?rev=1159&view=rev Author: spom_spom Date: 2009-12-21 22:41:44 +0000 (Mon, 21 Dec 2009) Log Message: ----------- client: remove unused files Modified Paths: -------------- trunk/data/misc/common.material trunk/src/OpcodeWrapper.cpp trunk/src/SectorEnvironmentObject.cpp trunk/src/SectorEnvironmentObject.h trunk/src/networkClient.h Added Paths: ----------- trunk/data/misc/misc.material trunk/data/misc/misc.particle Removed Paths: ------------- trunk/src/SectorObject.cpp trunk/src/SectorObject.h trunk/src/SectorObjectAvatar.cpp trunk/src/SectorObjectAvatar.h trunk/src/SectorObjectMissile.cpp trunk/src/SectorObjectMissile.h trunk/src/SectorObjectMoveable.cpp trunk/src/SectorObjectMoveable.h trunk/src/SectorObjectVessel.cpp trunk/src/SectorObjectVessel.h Modified: trunk/data/misc/common.material =================================================================== --- trunk/data/misc/common.material 2009-12-21 18:33:14 UTC (rev 1158) +++ trunk/data/misc/common.material 2009-12-21 22:41:44 UTC (rev 1159) @@ -15,3 +15,4 @@ } } } + Added: trunk/data/misc/misc.material =================================================================== --- trunk/data/misc/misc.material (rev 0) +++ trunk/data/misc/misc.material 2009-12-21 22:41:44 UTC (rev 1159) @@ -0,0 +1,17 @@ +material OpenGate/Space/Dust +{ + technique + { + pass + { + lighting off + scene_blend add + depth_write off + + texture_unit + { + texture textures/flare.png + } + } + } +} \ No newline at end of file Added: trunk/data/misc/misc.particle =================================================================== --- trunk/data/misc/misc.particle (rev 0) +++ trunk/data/misc/misc.particle 2009-12-21 22:41:44 UTC (rev 1159) @@ -0,0 +1,18 @@ +OpenGate/Space/Dust +{ + material OpenGate/Space/Dust + particle_width 1 + particle_height 1 + cull_each true + quota 500 + billboard_type point + + // Area emitter + emitter Ellipsoid{ + emission_rate 50000 + velocity 0 + width 500 + height 500 + depth 500 + } +} \ No newline at end of file Modified: trunk/src/OpcodeWrapper.cpp =================================================================== --- trunk/src/OpcodeWrapper.cpp 2009-12-21 18:33:14 UTC (rev 1158) +++ trunk/src/OpcodeWrapper.cpp 2009-12-21 22:41:44 UTC (rev 1159) @@ -22,7 +22,7 @@ #include "OpcodeWrapper.h" #include "SectorCollisionObject.h" -#include "SectorObject.h" +//#include "SectorObject.h" #include "ResourceManager.h" #include <OgreOpcode.h> @@ -50,7 +50,7 @@ collisionManager_->addCollClass( "Station" ); collisionManager_->addCollClass( "DockPad" ); collisionManager_->addCollClass( "Bullet" ); - + collisionManager_->addCollType( "Bullet", "Bullet", OgreOpcode::COLLTYPE_IGNORE ); collisionManager_->addCollType( "SectorObject", "Bullet", OgreOpcode::COLLTYPE_EXACT ); collisionManager_->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_EXACT ); @@ -59,8 +59,8 @@ collisionManager_->addCollType( "Station", "Bullet", OgreOpcode::COLLTYPE_EXACT ); collisionManager_->addCollType( "DockPad", "SectorObject", OgreOpcode::COLLTYPE_EXACT ); - //** possible contact types OgreOpcode::COLLTYPE_CONTACT || OgreOpcode::COLLTYPE_QUICK - + //** possible contact types OgreOpcode::COLLTYPE_CONTACT || OgreOpcode::COLLTYPE_QUICK + collideInSectorContext_ = collisionManager_->getDefaultContext(); } else { std::cout << "OpcodeCollisionDetection deactivated" << std::endl; @@ -75,27 +75,27 @@ bool OpcodeCollisionDetection::update( Ogre::Real elapsedTime ){ if ( active_ ){ collideInSectorContext_->collide( elapsedTime ); - + OgreOpcode::CollisionReporter report( collideInSectorContext_->getCollisionReport() ); - + uint nCollids = report.getNumCollisions(); if ( nCollids > 0 ){ // std::cout << "OpcodeCollisionDetection::update() " << nCollids << std::endl; - + OgreOpcode::CollisionPair **collisionReport; report.getAllCollisions( collisionReport ); - + for ( uint i = 0; i < nCollids; i ++ ){ OgreOpcode::CollisionObject * col1 = collisionReport[ i ]->this_object; OgreOpcode::CollisionObject * col2 = collisionReport[ i ]->other_object; - + // std::cout << i << ": "<< col1->getName() << "<->" << col2->getName() << std::endl; - + static_cast< SectorCollisionObject * >( col1->getClientData() )->collide( static_cast< SectorCollisionObject * >( col2->getClientData() ) ); static_cast< SectorCollisionObject * >( col2->getClientData() )->collide( static_cast< SectorCollisionObject * >( col1->getClientData() ) ); - } + } } // if ncols } @@ -124,8 +124,8 @@ } } } - -void OpcodeCollisionDetection::destroy( SectorCollisionObject * obj ){ + +void OpcodeCollisionDetection::destroy( SectorCollisionObject * obj ){ if ( obj && active_ ){ destroy( obj->collisionObject() ); obj->setCollisionObject( NULL ); @@ -139,49 +139,48 @@ collisionManager_->destroyShape( shape ); } } - + bool OpcodeCollisionDetection::checkCollideRay( SectorCollisionObject * obj, const Ogre::Ray & ray, double rayLength ){ if ( active_ ){ if ( !obj->isDestroyRequest() ){ OgreOpcode::CollisionPair ** rayPickReport; - + uint nColl = collideInSectorContext_->rayCheck( ray, rayLength, OgreOpcode::COLLTYPE_EXACT, OgreOpcode::COLLTYPE_ALWAYS_EXACT, rayPickReport ); - + // std::cout << "OpcodeCollisionDetection::checkCollideRay()" << " " << rayLength << " " << nColl <<std::endl; - + for ( uint i = 0; i < nColl; i ++ ){ /* std::cout << "OpcodeCollisionDetection::checkCollideRay()" << " " << rayLength << " " << nColl <<std::endl;*/ - + OgreOpcode::CollisionObject * col1 = rayPickReport[ i ]->this_object; OgreOpcode::CollisionObject * col2 = rayPickReport[ i ]->other_object; - + if ( col1->getClientData() == col2->getClientData() ){ obj->collide( static_cast< SectorCollisionObject * >( col1->getClientData() ) ); static_cast< SectorCollisionObject * >( col1->getClientData() )->collide( obj ); } else { std::cout << "checkCollideRay: " << i << " " - << static_cast< SectorCollisionObject * >( col1->getClientData() )->name() << "<->" + << static_cast< SectorCollisionObject * >( col1->getClientData() )->name() << "<->" << static_cast< SectorCollisionObject * >( col2->getClientData() )->name() << std::endl; } - + // if ( obj->rtti() == SECTOR_PROJECTILE_OBJECT_RTTI ){ // if ( dynamic_cast< Projectile * >( obj )->parent() != static_cast< BaseObject * >( col1->getClientData() ) ){ // obj->mainNode()->setPosition( rayPickReport[ i ]->contact ); // obj->collide( static_cast< BaseObject * >( col2->getClientData() ) ); // static_cast< BaseObject * >( col1->getClientData() )->collide( obj ); // return true; -// } +// } // } else if ( obj != col1->getClientData() ){ // obj->collide( static_cast< BaseObject * >( col2->getClientData() ) ); // static_cast< BaseObject * >( col1->getClientData() )->collide( obj ); -// } - } - } +// } + } + } } return false; } - @@ -189,106 +188,107 @@ + // void OpcodeCollisionDetection::createObject( BaseObject * obj ){ -// +// // if ( obj && active_ ){ // OgreOpcode::CollisionObject * collObj = obj->collisionObject(); -// +// // if ( !collObj ){ -// +// // OgreOpcode::EntityCollisionShape * collShape = collisionManager_->createEntityCollisionShape( obj->name() + "/CollShape" ); // if ( obj->entity() ){ // collShape->load( obj->entity() ); // } else { // std::cout << "OpcodeCollisionDetection::createObject( BaseObject * obj ), no entity defined for obj: " << obj->name(); // } -// +// // collObj = collideInSectorContext_->createObject( obj->name() + "/CollObj" ); // collObj->setCollClass( collisionManager_->queryCollClass( obj->collisionClass() ) ); // collObj->setShape( collShape ); -// +// // collObj->setClientData( obj ); // collideInSectorContext_->addObject( collObj ); -// +// // obj->setCollisionObject( collObj ); -// } +// } // } // } -// -// void OpcodeCollisionDetection::destroyObject( BaseObject * obj ){ -// +// +// void OpcodeCollisionDetection::destroyObject( BaseObject * obj ){ +// // if ( obj && active_ ){ // destroy( obj->collisionObject() ); // obj->setCollisionObject( NULL ); // } // } -// -// void OpcodeCollisionDetection::detach( BaseObject * obj ){ +// +// void OpcodeCollisionDetection::detach( BaseObject * obj ){ // if ( obj && active_ ){ // destroyObject( obj ); // } // } -// -// void OpcodeCollisionDetection::attach( BaseObject * obj ){ -// if ( obj && active_ ){ +// +// void OpcodeCollisionDetection::attach( BaseObject * obj ){ +// if ( obj && active_ ){ // createObject( obj ); // } // } -// +// // bool OpcodeCollisionDetection::checkCollideRay( BaseObject * obj, const Ogre::Ray & ray, double rayLength){ // if ( active_ ){ // if ( !obj->isSetDestroyRequest() ){ // OgreOpcode::CollisionPair ** rayPickReport; -// +// // uint nColl = collideInSectorContext_->rayCheck( ray, rayLength, OgreOpcode::COLLTYPE_EXACT, // OgreOpcode::COLLTYPE_ALWAYS_EXACT, rayPickReport ); -// +// // // std::cout << "OpcodeCollisionDetection::checkCollideRay()" << " " << rayLength << " " << nColl <<std::endl; -// +// // for ( uint i = 0; i < nColl; i ++ ){ // /* std::cout << "OpcodeCollisionDetection::checkCollideRay()" << " " << rayLength << " " << nColl <<std::endl;*/ -// +// // OgreOpcode::CollisionObject* col1 = rayPickReport[ i ]->this_object; // OgreOpcode::CollisionObject* col2 = rayPickReport[ i ]->other_object; -// +// // // std::cout << "checkCollideRay: " << i << " " -// // << static_cast< BaseObject * >( col1->getClientData() )->name() << "<->" +// // << static_cast< BaseObject * >( col1->getClientData() )->name() << "<->" // // << static_cast< BaseObject * >( col2->getClientData() )->name() << std::endl; -// +// // if ( obj->rtti() == PROJECTILE_RTTI ){ -// if ( dynamic_cast< Projectile * >( obj )->parent() != +// if ( dynamic_cast< Projectile * >( obj )->parent() != // static_cast< BaseObject * >( col1->getClientData() ) ){ // obj->mainNode()->setPosition( rayPickReport[ i ]->contact ); // obj->collide( static_cast< BaseObject * >( col2->getClientData() ) ); // static_cast< BaseObject * >( col1->getClientData() )->collide( obj ); // return true; -// } +// } // } else if ( obj != col1->getClientData() ){ // obj->collide( static_cast< BaseObject * >( col2->getClientData() ) ); // static_cast< BaseObject * >( col1->getClientData() )->collide( obj ); -// } -// } -// } +// } +// } +// } // } // return false; // } void OpcodeCollisionDetection::info( ){ std::cout << "OpcodeCollisionDetection::info( )" << std::endl; - + std::vector< OgreOpcode::CollisionObject * > activeObjects( collideInSectorContext_->getAttachedObjects() ); std::cout << "CollisionContext attached objects: " + Ogre::StringConverter::toString(collideInSectorContext_->getAttachedObjectCount()) << std::endl; for ( uint i = 0; i < activeObjects.size(); i ++ ){ std::cout << i << ": " << activeObjects[ i ]->getName() << std::endl; } - + std::vector< OgreOpcode::CollisionObject * > ownedObjects( collideInSectorContext_->getOwnedObjects() ); std::cout << "CollisionContext owned objects: " + Ogre::StringConverter::toString(collideInSectorContext_->getOwnedObjectCount()) << std::endl; for ( uint i = 0; i < ownedObjects.size(); i ++ ){ std::cout << i << ": " << ownedObjects[ i ]->getName() << std::endl; } std::cout << "CollisionManager shapes: " + Ogre::StringConverter::toString(collisionManager_->getShapeCount())<< std::endl; - + } } // namespace OpenGate{ Modified: trunk/src/SectorEnvironmentObject.cpp =================================================================== --- trunk/src/SectorEnvironmentObject.cpp 2009-12-21 18:33:14 UTC (rev 1158) +++ trunk/src/SectorEnvironmentObject.cpp 2009-12-21 22:41:44 UTC (rev 1159) @@ -44,17 +44,17 @@ } -bool SectorEnvironmentObject::update( Ogre::Real elapsedTime ){ - return true; +bool SectorEnvironmentObject::update( Ogre::Real elapsedTime ){ + return true; } SectorPlanetObject::SectorPlanetObject( const std::string & name, Sector * sector, Ogre::SceneNode * parentNode ) : SectorEnvironmentObject( name, sector, parentNode ){ - + cloudNode_ = NULL; cloudEntity_ = NULL; - + //planet_->lighting( true ); createSphere_( name + "/Mesh", 15000.0f, 64, 64 ); @@ -64,27 +64,27 @@ mainNode_->attachObject( entity_ ); mainNode_->setPosition( Ogre::Vector3( 0000.0, 0000.0, 50000 ) ); // mainNode_->setVisible( false ); - + cloudNode_ = mainNode_->createChildSceneNode( mainNode_->getName() + "/cloud" ); // cloudNode_->setVisible( true ); - cloudEntity_ = entity_->clone( cloudNode_->getName() ); - cloudEntity_->setMaterialName( "Planet/Cloud" ); + cloudEntity_ = entity_->clone( cloudNode_->getName() ); + cloudEntity_->setMaterialName( "Planet/Cloud" ); cloudNode_->attachObject( cloudEntity_ ); cloudNode_->scale(1.015, 1.015, 1.015); - + light_ = sector_->sceneManager()->createLight( name + "-light"); light_->setDiffuseColour( 0.1, 0.1, 0.1 ); light_->setSpecularColour( 0.4, 0.4, 0.4 ); mainNode_->attachObject( light_ ); - light_->setVisible( true ); + light_->setVisible( true ); } SectorPlanetObject::~SectorPlanetObject( ){ mainNode_->detachObject( light_ ); sector_->sceneManager()->destroyLight( light_->getName() ); - + if ( cloudNode_ ){ if ( cloudEntity_ ){ cloudNode_->detachObject( cloudEntity_ ); @@ -92,7 +92,7 @@ } mainNode_->removeAndDestroyChild( cloudNode_->getName() ); } - + Ogre::MeshManager::getSingleton().remove( name_ + "/Mesh" ); mainNode_->detachObject( entity_ ); sector_->sceneManager()->destroyEntity( entity_ ); @@ -108,10 +108,10 @@ void SectorPlanetObject::createSphere_( const std::string & name, const float r, const int nRings, const int nSegments ){ Ogre::MeshPtr pSphere = Ogre::MeshManager::getSingleton().createManual( name, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME ); Ogre::SubMesh *pSphereVertex = pSphere->createSubMesh(); - + pSphere->sharedVertexData = new Ogre::VertexData(); Ogre::VertexData* vertexData = pSphere->sharedVertexData; - + // define the vertex format Ogre::VertexDeclaration * vertexDecl = vertexData->vertexDeclaration; size_t currOffset = 0; @@ -124,55 +124,55 @@ // two dimensional texture coordinates vertexDecl->addElement(0, currOffset, Ogre::VET_FLOAT2, Ogre::VES_TEXTURE_COORDINATES, 0); currOffset += Ogre::VertexElement::getTypeSize(Ogre::VET_FLOAT2); - + // allocate the vertex buffer vertexData->vertexCount = (nRings + 1) * (nSegments+1); Ogre::HardwareVertexBufferSharedPtr vBuf = Ogre::HardwareBufferManager::getSingleton().createVertexBuffer( - vertexDecl->getVertexSize(0), vertexData->vertexCount, + vertexDecl->getVertexSize(0), vertexData->vertexCount, Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, false); Ogre::VertexBufferBinding* binding = vertexData->vertexBufferBinding; binding->setBinding(0, vBuf); float * pVertex = static_cast<float*>(vBuf->lock(Ogre::HardwareBuffer::HBL_DISCARD)); - + // allocate index buffer pSphereVertex->indexData->indexCount = 6 * nRings * (nSegments + 1); pSphereVertex->indexData->indexBuffer = Ogre::HardwareBufferManager::getSingleton().createIndexBuffer( - Ogre::HardwareIndexBuffer::IT_16BIT, pSphereVertex->indexData->indexCount, + Ogre::HardwareIndexBuffer::IT_16BIT, pSphereVertex->indexData->indexCount, Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, false); Ogre::HardwareIndexBufferSharedPtr iBuf = pSphereVertex->indexData->indexBuffer; unsigned short* pIndices = static_cast<unsigned short*>(iBuf->lock(Ogre::HardwareBuffer::HBL_DISCARD)); - + float fDeltaRingAngle = (Ogre::Math::PI / nRings); float fDeltaSegAngle = (2.0 * Ogre::Math::PI / nSegments); unsigned short wVerticeIndex = 0 ; - + //! Generate the group of rings for the sphere for ( int ring = 0; ring <= nRings; ring++ ) { float r0 = r * sinf (ring * fDeltaRingAngle); float y0 = r * cosf (ring * fDeltaRingAngle); - + //! Generate the group of segments for the current ring for (int seg = 0; seg <= nSegments; seg++) { float x0 = r0 * sinf(seg * fDeltaSegAngle); float z0 = r0 * cosf(seg * fDeltaSegAngle); - + //! Add one vertex to the strip which makes up the sphere *pVertex++ = x0; *pVertex++ = y0; *pVertex++ = z0; - + Ogre::Vector3 vNormal = Ogre::Vector3(x0, y0, z0).normalisedCopy(); *pVertex++ = vNormal.x; *pVertex++ = vNormal.y; *pVertex++ = vNormal.z; - + *pVertex++ = (float) seg / (float) nSegments; *pVertex++ = (float) ring / (float) nRings; - + if (ring != nRings) { //! each vertex (except the last) has six indices pointing to it *pIndices++ = wVerticeIndex + nSegments + 1; - *pIndices++ = wVerticeIndex; + *pIndices++ = wVerticeIndex; *pIndices++ = wVerticeIndex + nSegments; *pIndices++ = wVerticeIndex + nSegments + 1; *pIndices++ = wVerticeIndex + 1; @@ -181,26 +181,26 @@ } } //! end for seg } //! end for ring - + vBuf->unlock(); iBuf->unlock(); - + //! Generate face list pSphereVertex->useSharedVertices = true; - + //! the original code was missing this line: pSphere->_setBounds( Ogre::AxisAlignedBox( Ogre::Vector3(-r, -r, -r), Ogre::Vector3(r, r, r) ), false ); pSphere->_setBoundingSphereRadius( r ); //! this line makes clear the mesh is loaded (avoids memory leaks) pSphere->load(); - + Ogre::MeshPtr pMesh = Ogre::MeshManager::getSingleton().load( name, - Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, - Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, + Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, + Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, + Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, true, true); unsigned short src, dest; - + if ( !pMesh->suggestTangentVectorBuildParams( Ogre::VES_TANGENT, src, dest) ) { pMesh->buildTangentVectors( Ogre::VES_TANGENT, src, dest ); } @@ -208,17 +208,17 @@ SectorEclipticObject::SectorEclipticObject( Sector * sector, Ogre::SceneNode * parentNode ) : SectorEnvironmentObject( "Ecliptic", sector, parentNode ){ - + createGrid_(); } SectorEclipticObject::~SectorEclipticObject(){ mainNode_->detachObject( entity_ ); sector_->sceneManager()->destroyManualObject( entity_ ); -} +} -bool SectorEclipticObject::update( Ogre::Real elapsedTime ){ - return true; +bool SectorEclipticObject::update( Ogre::Real elapsedTime ){ + return true; } void SectorEclipticObject::createGrid_(){ @@ -226,13 +226,13 @@ Ogre::Real thickness = 15.0; // Of course this must be less than the radius value. Ogre::Real nx = 20, nz = 20; Ogre::Real dx = 1000, dz = 1000; - + unsigned point_index = 0; entity_->begin( "Shader/Gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); entity_->getSection( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 0.0, 1.0, 0.2 ) ); entity_->getSection( 0 )->setCustomParameter( 1, Ogre::Vector4( nx * dx, 0.0, 0.0, 0.0 ) ); - + for ( int i = 0; i < nx+1; i ++ ){ entity_->position( -nx * dx / 2, 0.0, -nx * dx / 2 + i * dx - thickness ); entity_->position( nx * dx / 2, 0.0, -nx * dx / 2 + i * dx - thickness ); @@ -242,11 +242,11 @@ entity_->quad( point_index + 0, point_index + 1, point_index + 2, point_index + 3 ); } entity_->end(); - + entity_->begin( "Shader/Gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); entity_->getSection( 1 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 0.0, 1.0, 0.2 ) ); entity_->getSection( 1 )->setCustomParameter( 1, Ogre::Vector4( nz * dz, 0.0, 0.0, 0.0 ) ); - + for ( int i = 0; i < nz+1; i ++ ){ entity_->position( -nz * dz / 2 + i * dx + thickness, 0.0, -nz * dz / 2 ); entity_->position( -nz * dz / 2 + i * dx + thickness, 0.0, nz * dz / 2 ); @@ -256,11 +256,11 @@ entity_->quad( point_index + 0, point_index + 1, point_index + 2, point_index + 3 ); } entity_->end(); - + entity_->begin( "Shader/Gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); entity_->getSection( 2 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0, 0.0, 0.2 ) ); entity_->getSection( 2 )->setCustomParameter( 1, Ogre::Vector4( nx * dx, 0.0, 0.0, 0.0 ) ); - + for ( int i = 0; i < nx+1; i ++ ){ entity_->position( -nx * dx / 2, 0.0, -nx * dx / 2 + i * dx - thickness ); entity_->position( nx * dx / 2, 0.0, -nx * dx / 2 + i * dx - thickness ); @@ -270,11 +270,11 @@ entity_->quad( point_index + 3, point_index + 2, point_index + 1, point_index + 0 ); } entity_->end(); - + entity_->begin( "Shader/Gradient", Ogre::RenderOperation::OT_TRIANGLE_LIST); entity_->getSection( 3 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0, 0.0, 0.2 ) ); entity_->getSection( 3 )->setCustomParameter( 1, Ogre::Vector4( nz * dz, 0.0, 0.0, 0.0 ) ); - + for ( int i = 0; i < nz+1; i ++ ){ entity_->position( -nz * dz / 2 + i * dx + thickness, 0.0, -nz * dz / 2 ); entity_->position( -nz * dz / 2 + i * dx + thickness, 0.0, nz * dz / 2 ); @@ -284,18 +284,72 @@ entity_->quad( point_index + 3, point_index + 2, point_index + 1, point_index + 0 ); } entity_->end(); - + mainNode_->attachObject( entity_ ); } - +SectorSpaceDustObject::SectorSpaceDustObject( Sector * sector, Ogre::SceneNode * parentNode ) + : SectorEnvironmentObject( "SpaceDust", sector, parentNode ){ + ps_ = sector_->sceneManager()->createParticleSystem("Dust PS", "OpenGate/Space/Dust"); + mainNode_ = parentNode->createChildSceneNode( "DustParticles", parentNode->getPosition() ); +// mainNode_->attachObject( ps_ ); +} + +SectorSpaceDustObject::~SectorSpaceDustObject( ){ +} + +bool SectorSpaceDustObject::update( Ogre::Real elapsedTime ){ +// const float maxDist = 250.0; +// const float mirrorDist = maxDist*0.99; +// const float dimFactor = 0.8*0.005*0.005; +// const float maxDist2 = maxDist*maxDist; +// Camera* cam = mCamera->getCamera(); +// const Vector3& camPos = cam->getWorldPosition(); +// +// const float twiceMaxDist = 2 * maxDist; +// +// ParticleIterator pit = mParticleSystem->_getIterator(); +// +// while (!pit.end()) +// { +// Particle* particle = pit.getNext(); +// Vector3& pos = particle->position; +// particle->timeToLive = 999999.0f; +// +// // position particles near camera +// // (keep moving them toward camera until within range) +// while (pos.x - camPos.x > maxDist) +// pos.x -= twiceMaxDist; +// while (pos.x - camPos.x < -maxDist) +// pos.x += twiceMaxDist; +// while (pos.y - camPos.y > maxDist) +// pos.y -= twiceMaxDist; +// while (pos.y - camPos.y < -maxDist) +// pos.y += twiceMaxDist; +// while (pos.z - camPos.z > maxDist) +// pos.z -= twiceMaxDist; +// while (pos.z - camPos.z < -maxDist) +// pos.z += twiceMaxDist; +// +// Vector3 pDir = pos-camPos; +// float dist = pDir.squaredLength(); +// float dim = dist*dimFactor; +// particle->setDimensions(dim, dim); +// +// } +// +// return true; +// } + return true; +} + // if ( !1 ) { // planetNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( "PlanetNode" ); -// +// // Ogre::ManualObject * planet = sceneMgr_->createManualObject( "Planet" ); // // planet->setUseIdentityProjection( true ); // // planet->setUseIdentityView( true ); -// +// // planet->begin( "OpenGate/RedPlanet", Ogre::RenderOperation::OT_TRIANGLE_LIST); // planet->position( Ogre::Vector3( -1.0, -1.0, 200.0 ) ); // planet->textureCoord( 0, 0 ); @@ -316,13 +370,13 @@ // if ( planetNode_ ){ // updateLoop // Ogre::Vector3 src = planetNode_->getWorldOrientation() * Ogre::Vector3::UNIT_Z; // src.normalise(); -// +// // Ogre::Vector3 target( avatar_->mainNode()->getPosition() - planetNode_->getWorldPosition() ); // target.normalise(); -// +// // Ogre::Quaternion rot = src.getRotationTo( target ); // rot.normalise(); -// +// // planetNode_->setPosition( Ogre::Vector3( 20000.0, 10000.0, 50000 ) + avatar_->mainNode()->getPosition() ); // planetNode_->rotate( rot, Ogre::Node::TS_PARENT ); // } Modified: trunk/src/SectorEnvironmentObject.h =================================================================== --- trunk/src/SectorEnvironmentObject.h 2009-12-21 18:33:14 UTC (rev 1158) +++ trunk/src/SectorEnvironmentObject.h 2009-12-21 22:41:44 UTC (rev 1159) @@ -30,29 +30,29 @@ class SectorEnvironmentObject : public SectorBaseObject { public: SectorEnvironmentObject( const Ogre::String & name, Sector * sector, Ogre::SceneNode * parentNode = NULL ); - + virtual ~SectorEnvironmentObject( ); - + virtual int rtti( ) const { return SECTOR_ENVIRONMENT_OBJECT_RTTI; } - + /*! Update loop for the environment */ virtual bool update( Ogre::Real elapsedTime ); - + protected: - + }; class SectorPlanetObject : public SectorEnvironmentObject{ public: SectorPlanetObject( const Ogre::String & name, Sector * sector, Ogre::SceneNode * parentNode = NULL ); - + virtual ~SectorPlanetObject(); - + /*! Update loop for the environment */ virtual bool update( Ogre::Real elapsedTime ); - + inline Ogre::SceneNode * cloudNode() { return cloudNode_; } - + protected: //** taken from ogre wiki: http://www.ogre3d.org/wiki/index.php/ManualSphereMeshes void createSphere_( const std::string & name, const float r, const int nRings, const int nSegments ); @@ -73,19 +73,31 @@ protected: void createGrid_(); - + Ogre::ManualObject * entity_; }; + +class SectorSpaceDustObject : public SectorEnvironmentObject{ +public: + SectorSpaceDustObject( Sector * sector, Ogre::SceneNode * parentNode ); + + ~SectorSpaceDustObject( ); + + virtual bool update( Ogre::Real elapsedTime ); + +protected: + Ogre::ParticleSystem * ps_; +}; + + // class SectorStarfieldObject : public SectorEnvironmentObject{ // }; -// class SectorSpaceDustObject : public SectorEnvironmentObject{ -// }; // class SectorSpaceDecorationObject : public SectorEnvironmentObject{ // }; - + } //namespace OpenGate #endif //_OPENGATE_SECTORENVIRONMENT__H Deleted: trunk/src/SectorObject.cpp =================================================================== --- trunk/src/SectorObject.cpp 2009-12-21 18:33:14 UTC (rev 1158) +++ trunk/src/SectorObject.cpp 2009-12-21 22:41:44 UTC (rev 1159) @@ -1,203 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#include "SectorObject.h" - -#include "LogManager.h" -#include "OpcodeWrapper.h" -#include "ResourceManager.h" -#include "Sector.h" - -#include <OgreEntity.h> -#include <OgreMeshManager.h> -#include <OgreOverlayManager.h> -#include <OgreOverlayElement.h> -#include <OgreSceneManager.h> - -#include <string> - -namespace OpenGate{ - -SectorObject::SectorObject( const Ogre::String & name, Sector * sector, Uint32 userID, Uint8 childID ) - : BaseObject( name, sector, userID, childID ), target_( NULL ), entity_( NULL ) { __D( name ) - isOnRadar_ = false; - - mainNodeEntityScale_ = mainNode_->createChildSceneNode( mainNode_->getName() + "/basescale" ); - mainNodeEntityRot_ = mainNodeEntityScale_->createChildSceneNode( mainNodeEntityScale_->getName() + "/baserot" ); -// mainShapeNode_ = mainNodeEntityRot_->createChildSceneNode( name_ + "_shapeNode" ); - baseSize_ = Ogre::Vector3::ZERO; - - int dotAWidth = 4; - int dotAHeight = 2; - dotA_ = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Radar/Map/DotA_" + name_ ); - dotA_->setMaterialName( "BaseWhite" ); - dotA_->setMetricsMode( Ogre::GMM_PIXELS ); - dotA_->setWidth( dotAWidth ); - dotA_->setHeight( dotAHeight ); - dotA_->setColour( Ogre::ColourValue( 1.0f, 0.0f, 0.0f ) ); - - dotB_ = Ogre::OverlayManager::getSingleton().createOverlayElement( "Panel", "Radar/Map/DotB_" + name_ ); - dotB_->setMaterialName( "BaseWhite" ); - dotB_->setMetricsMode( Ogre::GMM_PIXELS ); - dotB_->setWidth( 1 ); - dotB_->setHeight( 1 ); - dotB_->setColour( Ogre::ColourValue( 1.0f, 0.0f, 0.0f ) ); - - inititialize_(); -} - -SectorObject::~SectorObject(){ __D( name_ ) - - Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Radar/Map/DotA_" + name_ ); - Ogre::OverlayManager::getSingleton().destroyOverlayElement( "Radar/Map/DotB_" + name_ ); - if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->destroyObject( this ); - } - - if ( entity_ ){ - mainNodeEntityRot_->detachObject( entity_ ); - sceneMgr_->destroyEntity( entity_ ); - } - - mainNodeEntityScale_->removeAndDestroyChild( mainNodeEntityRot_->getName() ); - mainNode_->removeAndDestroyChild( mainNodeEntityScale_->getName() ); -} - -void SectorObject::inititialize_(){ - isOnRadar_ = false; - selectable_ = true; - if ( target_ ){ - std::cerr << WHERE_AM_I << "*************** this should not happen" << " " << target_->name() << std::endl; - } else { - target_ = NULL; - } -} - -void SectorObject::setShape( const Ogre::String & meshname ){ - try { - entity_ = sceneMgr_->createEntity( name_, meshname ); - } catch( Ogre::Exception & e ){ - LogManager::getSingleton().warn( e.what() ); - entity_ = NULL; - return ; - } catch( ... ){ - LogManager::getSingleton().warn( "Unknown exception" ); - entity_ = NULL; - return ; - } - - mainNodeEntityRot_->attachObject( entity_ ); - if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->createObject( this ); - } -} - -void SectorObject::setBaseRot( const Ogre::Real & yaw, const Ogre::Real & pitch, const Ogre::Real & roll ){ - if ( fabs( yaw ) >1e-4 ||fabs( pitch ) >1e-4 || fabs( roll ) >1e-4 ){ - std::cout << "SectorObject::setBaseRot " << name_ << yaw - << " " << pitch << " " << roll << std::endl; - - mainNodeEntityRot_->yaw( Ogre::Degree( yaw ) ); - mainNodeEntityRot_->pitch( Ogre::Degree( pitch ) ); - mainNodeEntityRot_->roll( Ogre::Degree( roll ) ); - } -} - -void SectorObject::scale( const Ogre::Vector3 & scale ){ - std::cout << "SectorObject::scale " << name_ << scale << std::endl; - mainNodeEntityScale_->scale( scale ); - baseSize_ = scale * ( entity_->getBoundingBox().getMaximum() - entity_->getBoundingBox().getMinimum() ); -} - -void SectorObject::setBaseSize( const Ogre::Vector3 & size ){ - if ( size == Ogre::Vector3::ZERO ) return; - - /* Ogre::Vector3 oldSize( mainNodeEntityRot_->getOrientation() * ( - mainNodeEntityRot_->_getWorldAABB().getMaximum()- - mainNodeEntityRot_->_getWorldAABB().getMinimum() ) ); - */ - Ogre::Vector3 oldSize( entity_->getBoundingBox().getMaximum()- entity_->getBoundingBox().getMinimum() ); - - Ogre::Vector3 scale( size / oldSize ); - - scale[ 0 ] = fabs( scale[ 0 ] ); - scale[ 1 ] = fabs( scale[ 1 ] ); - scale[ 2 ] = fabs( scale[ 2 ] ); - - if ( scale[ 0 ] == 0.0 && scale[ 1 ] == 0.0 && scale[ 2 ] != 0.0) { - scale[ 0 ] = scale[ 2 ]; scale[ 1 ] = scale[ 2 ]; - } - if ( scale[ 0 ] == 0.0 && scale[ 1 ] != 0.0 && scale[ 2 ] == 0.0) { - scale[ 0 ] = scale[ 1 ]; scale[ 2 ] = scale[ 1 ]; - } - if ( scale[ 0 ] != 0.0 && scale[ 1 ] == 0.0 && scale[ 2 ] == 0.0) { - scale[ 2 ] = scale[ 0 ]; scale[ 1 ] = scale[ 0 ]; - } - - std::cout << name_ << std::endl; - std::cout << "sol: " << size << std::endl; - std::cout << "ist: " << oldSize << std::endl; - std::cout << scale << std::endl; - - std::cout << mainNodeEntityRot_->_getWorldAABB().getMaximum() << " " << - mainNodeEntityRot_->_getWorldAABB().getMinimum() << " " << - mainNodeEntityRot_->_getWorldAABB().getMaximum()-mainNodeEntityRot_->_getWorldAABB().getMinimum() - << std::endl; - - std::cout << entity_->getBoundingBox().getMaximum()- entity_->getBoundingBox().getMinimum() << std::endl; - - std::cout << mainNodeEntityRot_->getOrientation() * ( entity_->getBoundingBox().getMaximum()- - entity_->getBoundingBox().getMinimum() ) << std::endl; - - std::cout << mainNode_->_getWorldAABB().getMaximum() - mainNode_->_getWorldAABB().getMinimum() << std::endl; - std::cout << mainNode_->_getDerivedScale() << std::endl; - - mainNodeEntityScale_->scale( scale ); - baseSize_ = size; - baseScale_ = scale; -} - -void SectorObject::setTarget( SectorObject * target ){ - if ( target_ ) this->looseTarget( ); - - if ( target ){ - target_ = target; - target_->addObserver( this ); - } -} - -void SectorObject::looseTarget( ){ - if ( target_ ){ - target_->delObserver( this ); - target_ = NULL; - } -} - -void SectorObject::unsubscribeToObservers(){ - //std::cout << "SectorObject::unsubscribeToObservers(): " << name_ << " " << observers_.size() << std::endl; - for ( std::set < SectorObject * >::iterator it = observers_.begin(); it != observers_.end();){ - (*it++)->looseTarget( ); - } - - //std::cout << "SectorObject::unsubscribeToObservers(): " << observers_.size() << std::endl; -} - - -} // namespace OpenGate Deleted: trunk/src/SectorObject.h =================================================================== --- trunk/src/SectorObject.h 2009-12-21 18:33:14 UTC (rev 1158) +++ trunk/src/SectorObject.h 2009-12-21 22:41:44 UTC (rev 1159) @@ -1,120 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#ifndef _OPENGATE_SECTOROBJECT__H -#define _OPENGATE_SECTOROBJECT__H - -#include "Opengate.h" - -#include "BaseObject.h" -#include <OgreVector3.h> - -namespace OpenGate{ - -class SectorObject : public BaseObject { -public: - /*! Constructor for the base class. The Object need an unique name and ptr to the sector */ - SectorObject( const Ogre::String & name, Sector * sector, Uint32 userID = 0, Uint8 childID = 0 ); - - /*! Default destructor */ - virtual ~SectorObject(); - - /*! Runtime identification */ - inline virtual long rtti() const { return SECTOROBJECT_RTTI; } - - /*! */ - virtual bool update( Ogre::Real elapsedTime ){ return true; } - - /*! */ - virtual void collide( BaseObject * object ){ - // std::cout << "SectorObject " << name_ << " collide with " << object->rtti() << " " << object->name()<< std::endl; - } - - /*! Returns a pointer to the active sector*/ - Sector * sector() { return sector_; } - - Ogre::SceneNode * rotNode() { return mainNodeEntityRot_;} - - Ogre::SceneNode * scaleNode() { return mainNodeEntityScale_;} - - void setShape( const Ogre::String & meshname ); - - virtual Ogre::Entity * entity(){ return entity_; } - - void scale( const Ogre::Vector3 & scale ); - - void setBaseSize( const Ogre::Vector3 & targetSize ); - void setBaseRot( const Ogre::Real & yaw, const Ogre::Real & pitch = 0, const Ogre::Real & roll = 0 ); - - Ogre::Vector3 baseSize( ) const { return baseSize_; } - Ogre::Real maxBaseSize( ) const { return max( max( baseSize_[0], baseSize_[1] ), baseSize_[2] ); } - - bool isOnRadar() const { return isOnRadar_; } - void onRadar( bool onradar ) { isOnRadar_ = onradar; } - - virtual Ogre::Vector3 velocity() const { return Ogre::Vector3(0.0, 0.0, 0.0 ); } - - Ogre::OverlayElement * dotA() { return dotA_; } - Ogre::OverlayElement * dotB() { return dotB_; } - - /*! Add an object to the set of observers e.g. selected as target, dot on radar. - When this object dies the observers have to informed. */ - inline virtual void addObserver( SectorObject * obj ){ observers_.insert( obj ); } - - /*! Remove observer from, e.g. lost on radar, deselect as target */ - inline virtual void delObserver( SectorObject * obj ){ observers_.erase( obj ); } - - /*! Set Object as target, used for missiles, and avatar. This object becomes an observer for the target. */ - virtual void setTarget( SectorObject * target ); - - /*! The Object is not longer a target */ - virtual void looseTarget( ); - - /*! Return the current target. */ - virtual SectorObject * target( ){ return target_; } - - /*! unsubscribe this object from all objects that observe this object */ - void unsubscribeToObservers(); - -protected: - - virtual void inititialize_(); - - SectorObject * target_; - Ogre::Entity * entity_; - - Ogre::SceneNode * mainNodeEntityScale_; // Main character node for base size - Ogre::SceneNode * mainNodeEntityRot_; // Main character node for base rotation - - Ogre::OverlayElement * dotA_; - Ogre::OverlayElement * dotB_; - - bool isOnRadar_; - Ogre::Vector3 baseSize_; - Ogre::Vector3 baseScale_; - - std::set < SectorObject * > observers_; // better listener / e.g. radar -}; - -} //namespace OpenGate - -#endif - - Deleted: trunk/src/SectorObjectAvatar.cpp =================================================================== --- trunk/src/SectorObjectAvatar.cpp 2009-12-21 18:33:14 UTC (rev 1158) +++ trunk/src/SectorObjectAvatar.cpp 2009-12-21 22:41:44 UTC (rev 1159) @@ -1,166 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#include "SectorObjectAvatar.h" - -#include "GunObject.h" -#include "Equipment.h" -#include "Sector.h" -#include "Vessel.h" - -#include <OgreSceneManager.h> -#include <OgreEntity.h> -#include <OpenALSoundManager.h> - -namespace OpenGate{ - -SectorObjectAvatar::SectorObjectAvatar( const Ogre::String & name, Sector * sector, Uint32 userID, Vessel * vessel ) - : SectorObjectVessel( name, sector, userID, 0, vessel ) { - - thrustRate_ = 0; - - maxCapacity_ = 0; - if ( this->vessel()->capacitor() ) maxCapacity_ = this->vessel()->capacitor()->capacity(); - capacity_ = maxCapacity_; - - targetArrowNode_ = NULL; - flightArrowNode_ = NULL; - forceMovement_ = false; - thrustChange_ = 0.0; - - targetArrowNode_ = mainNode_->createChildSceneNode( name_ + "_TargetArrow" ); - Ogre::SceneNode * targetArrowTrans = targetArrowNode_->createChildSceneNode( name_ + "_TargetArrow_trans" ); - Ogre::Entity *targetArrowEntity = sceneMgr_->createEntity( name_ + "_TargetArrow_entity", "arrow.mesh" ); - targetArrowEntity->setMaterialName( "SimpleHUD/TargetArrow" ); - targetArrowTrans->attachObject( targetArrowEntity ); - targetArrowTrans->pitch( Ogre::Degree( -90 ) ); - targetArrowTrans->scale( 0.01, 0.01, 0.01 ); - targetArrowNode_->setPosition( 0.0, -0.1, -1.2 ); - targetArrowNode_->setOrientation( mainNode_->getOrientation() ); - - flightArrowNode_ = mainNode_->createChildSceneNode( name_ + "_FlightArrow" ); - Ogre::SceneNode * flightArrowTrans = flightArrowNode_->createChildSceneNode( name_ + "_FlightArrow_trans" ); - Ogre::Entity *flightArrowEntity = sceneMgr_->createEntity( name_ + "_FlightArrow_entity", "arrow.mesh" ); - flightArrowEntity->setMaterialName( "SimpleHUD/FlightArrow" ); - flightArrowTrans->attachObject( flightArrowEntity ); - flightArrowTrans->pitch( Ogre::Degree( -90 ) ); - flightArrowTrans->scale( 0.01, 0.01, 0.01 ); - flightArrowNode_->setPosition( 0.0, 0.1, -1.2 ); - flightArrowNode_->setOrientation( mainNode_->getOrientation() ); - - Ogre::Light * l = sceneMgr_->createLight("AvatarLight" ); - l->setDiffuseColour( Ogre::ColourValue(1.0, 1.0, 1.0) ); - l->setSpecularColour( Ogre::ColourValue(1.0, 1.0, 1.0) ); - l->setVisible( false ); - lightNode_ = mainNode_->createChildSceneNode( "AvatarLightNode" ); - lightNode_->translate(50,0,10); - lightNode_->attachObject( l ); - - if ( OpenALSoundManager::getSingleton().listener() ){ - soundListener_ = OpenALSoundManager::getSingleton().listener(); - } -} - -SectorObjectAvatar::~SectorObjectAvatar(){ - if ( flightArrowNode_ ){ - sceneMgr_->destroyEntity( name_ + "_FlightArrow_entity" ); - flightArrowNode_->removeAndDestroyChild( name_ + "_FlightArrow_trans" ); - mainNode_->removeAndDestroyChild( flightArrowNode_->getName() ); - } - if ( targetArrowNode_ ){ - sceneMgr_->destroyEntity( name_ + "_TargetArrow_entity" ); - targetArrowNode_->removeAndDestroyChild( name_ + "_TargetArrow_trans" ); - mainNode_->removeAndDestroyChild( targetArrowNode_->getName() ); - } - - sceneMgr_->destroyLight( "AvatarLight" ); - - if ( lightNode_ ){ - mainNode_->removeAndDestroyChild( lightNode_->getName() ); - } -} - -void SectorObjectAvatar::collide( BaseObject * object ){ - if ( name_ != object->name() ){ - SectorObjectMovable::collide( object ); - // if ( object->getTypeID( ) == PROJECTILE_RTTI ){ - // hitByProjectile( dynamic_cast< Projectile* >( object ) ); - // return; - // } - // std::cout << "Avatar " << name_ << " collide with " << object->getTypeID() << " " << object->name() << std::endl; - } -} - -void SectorObjectAvatar::decrementThrust( bool pressed ){ - if ( pressed ){ - thrustChange_ = -1.0; - } else { - thrustChange_ = 0.0; - } -} - -void SectorObjectAvatar::incrementThrust( bool pressed ){ - if ( pressed ){ - thrustChange_ = 1.0; - } else { - thrustChange_ = 0.0; - } -} - -bool SectorObjectAvatar::update( Ogre::Real elapsedTime ){ - - //** just for key autorepeat - thrustRate_ += (thrustChange_ * 0.5f * elapsedTime); - thrustRate_ = max( thrustRate_, 0.0f ); - thrustRate_ = min( 1.0f, thrustRate_ ); - if ( thrustChange_ != 0.0 ) updateThruster(); - - if ( soundListener_ ){ - soundListener_->setPosition( mainNode_->_getDerivedPosition() ); - soundListener_->setVelocity( vel_ ); - soundListener_->setOrientation( mainNode_->_getDerivedOrientation().zAxis(), - mainNode_->_getDerivedOrientation().yAxis() ); - } - return SectorObjectVessel::update( elapsedTime ); -} - -void SectorObjectAvatar::reset( ){ - deathSequence_ = false; - mainNode_->showBoundingBox( false ); - setShield( maxShield() ); - setArmor( this->vessel()->armor() ); - setThrustRate( 0.0 ); -} - -void SectorObjectAvatar::setVisible( bool visible ){ - mainNodeEntityScale_->setVisible( visible ); -} - -bool SectorObjectAvatar::deathSequence( Ogre::Real elapsedTime ){ - // if ( !deathSequence_ ){ sector_->avatarDied( ); } - return SectorObjectMovable::deathSequence( elapsedTime ); -} - -Ogre::Real SectorObjectAvatar::ammoSpeed() const { - if ( activeGuns_.size() > 0) return (*activeGuns_.begin() )->gun()->speed(); - return 0.0; -} - -} // namespace OpenGate{ Deleted: trunk/src/SectorObjectAvatar.h =================================================================== --- trunk/src/SectorObjectAvatar.h 2009-12-21 18:33:14 UTC (rev 1158) +++ trunk/src/SectorObjectAvatar.h 2009-12-21 22:41:44 UTC (rev 1159) @@ -1,93 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#ifndef _OPENGATE_SECTOROBJECTAVATAR__H -#define _OPENGATE_SECTOROBJECTAVATAR__H - -#include "SectorObjectVessel.h" - -#include <OgreSceneNode.h> - -namespace OpenGate{ - -class OpenALListener; - -class SectorObjectAvatar : public SectorObjectVessel { -public: - SectorObjectAvatar( const Ogre::String & name, Sector * sector, Uint32 userID, Vessel * vessel ); - - virtual ~SectorObjectAvatar(); - - inline virtual long rtti() const { return AVATAR_RTTI; } - - virtual bool update( Ogre::Real elapsedTime ); - - virtual void collide( BaseObject * object ); - - virtual void reset( ); - - virtual void setVisible( bool visible ); - - inline void setFirePressed( bool fireStatus ){ - if ( fireStatus != firePressed_ ) statusChanged_ = true; - firePressed_ = fireStatus; - } - - inline bool firePressed( ) const { return firePressed_; } - - Ogre::Real ammoSpeed() const; - - virtual bool deathSequence( Ogre::Real elapsedTime ); - - Ogre::SceneNode * targetArrow() { return targetArrowNode_; } - - Ogre::SceneNode * flightArrow() { return flightArrowNode_; } - - void decrementThrust( bool pressed ); - - void incrementThrust( bool pressed ); - - virtual Uint32 thrust() const { - double thrust = thrust_; - if ( afterburnerPressed_ ) thrust *= 1.3; - if ( flashfire_ ) thrust *= 10; - return (Uint32)rint( thrust ); - } - - virtual bool isChild() const { return false; } - - inline Ogre::Real capacityRate() const { - if ( maxCapacity_ > 0 ) return (float)capacity_ / maxCapacity_; else return 0; - } - -protected: - Ogre::Real thrustChange_; - Ogre::SceneNode * targetArrowNode_; - Ogre::SceneNode * flightArrowNode_; - Ogre::SceneNode * lightNode_; - - OpenALListener * soundListener_; -}; - -} //namespace OpenGate - -#endif - - Deleted: trunk/src/SectorObjectMissile.cpp =================================================================== --- trunk/src/SectorObjectMissile.cpp 2009-12-21 18:33:14 UTC (rev 1158) +++ trunk/src/SectorObjectMissile.cpp 2009-12-21 22:41:44 UTC (rev 1159) @@ -1,174 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#include "SectorObjectMissile.h" -#include "OpcodeWrapper.h" -#include "Missile.h" -#include "Vessel.h" -#include "ResourceManager.h" - -#include <OgreParticleSystem.h> -#include <OgreParticleEmitter.h> -#include <OgreSceneManager.h> -#include <OgreRibbonTrail.h> - -namespace OpenGate{ - -SectorObjectMissile::SectorObjectMissile( const Ogre::String & name, Sector * sector, - Uint32 userID, Uint8 childID, Missile * missle ) - : SectorObjectMovable( name, sector, userID, childID, missle ), launched_( false ), thrustTrailNode_( NULL ){ - - Ogre::ParticleEmitter *pEmit = thrusterParticles_->addEmitter( "Point" ); - pEmit->setDirection( mainNode_->getOrientation().zAxis() ); - //engineMountPoints[ i ] - pEmit->setPosition( mainNodeEntityRot_->getOrientation() * Ogre::Vector3( 0.0, 0.0, 0.5 ) ); - pEmit->setColour( Ogre::ColourValue::Blue, Ogre::ColourValue::Green ); - - inititialize_(); -} - -SectorObjectMissile::~SectorObjectMissile(){ - // std::cout << "SectorObjectMissile::~SectorObjectMissile() " << name_ << " " << target_ << " " <<observers_.size() << std::endl; - thrustTrailNode_->detachObject( thrustTrail_ ); - sceneMgr_->getRootSceneNode()->removeAndDestroyChild( thrustTrailNode_->getName() ); - sceneMgr_->destroyRibbonTrail( thrustTrail_ ); - thrustTrailNode_ = NULL; - thrustTrail_ = NULL; - -} - -Missile * SectorObjectMissile::missile(){ return dynamic_cast < Missile * > ( movable_ ); } - -void SectorObjectMissile::inititialize_(){ - maxThrust_ = this->missile()->thrust(); - maxSpeed_ = movable_->maxSpeed(); - setThrustRate( 0.0 ); - setMass( movable_->mass() ); -} - -bool SectorObjectMissile::update( Ogre::Real elapsedTime ){ - if ( launched_ && !destroyRequest_) { - if ( target_ != NULL && elapsedTime > 1e-4 ) { - - Ogre::Vector3 currDir = mainNode_->_getDerivedOrientation() * Ogre::Vector3::NEGATIVE_UNIT_Z; - currDir.normalise(); - Ogre::Vector3 targetPos( target_->mainNode()->_getDerivedPosition() ); - - double timeToTarget= (targetPos - mainNode_->_getDerivedPosition() ).length() / speed(); - - if ( target_->rtti() == SECTOROBJECTMOVABLE_RTTI || - target_->rtti() == SECTOROBJECTVESSEL_RTTI || - target_->rtti() == SECTOROBJECTMISSILE_RTTI ){ - targetPos += dynamic_cast< SectorObjectMovable *>( target_ )->velocity() * timeToTarget; - } - - Ogre::Vector3 targetDir( targetPos - mainNode_->_getDerivedPosition() ); - targetDir.normalise(); - - Ogre::Degree yawTo; - Ogre::Degree pitchTo; - Ogre::Degree rollTo; - - if ( ( currDir + targetDir ).squaredLength() < 0.00005f ){ - //** fix gimbal look - yawTo = 180; - } else { - - Ogre::Quaternion rot = currDir.getRotationTo( targetDir ); - rot.normalise(); - - Ogre::Vector3 srcUp = mainNode_->_getDerivedOrientation() * Ogre::Vector3::NEGATIVE_UNIT_Y; - srcUp.normalise(); - - Ogre::Vector3 targetUp = target_->mainNode()->getOrientation() * Ogre::Vector3::NEGATIVE_UNIT_Y; - targetUp.normalise(); - - Ogre::Quaternion rotUp = srcUp.getRotationTo( targetUp ); - - // rot = rot * rotUp; - - yawTo = rot.getYaw(); - pitchTo = rot.getPitch(); - rollTo = rot.getRoll(); - } - Ogre::Real rotFric = 1.0; - - Ogre::Real scaledYaw = yawTo.valueDegrees() / ( elapsedTime * rotFric * movable_->yaw() ); - Ogre::Real scaledPitch = pitchTo.valueDegrees() / ( elapsedTime * rotFric * movable_->pitch() ); - // Ogre::Real scaledRoll = rollTo.valueDegrees() / ( elapsedTime * rotFric * moveable_->yaw() ); - - yaw_ = max( -1.0f, scaledYaw ); yaw_ = min( yaw_, 1.0f ); - pitch_ = max( -1.0f, scaledPitch ); pitch_ = min( pitch_, 1.0f ); - // roll_ = max( -1.0f, scaledRoll ); roll_ = min( roll_, 1.0f ); - } - missileLifetime_ -= elapsedTime; - } - - if (... [truncated message content] |
From: <spo...@us...> - 2009-12-22 22:02:21
|
Revision: 1160 http://opengate.svn.sourceforge.net/opengate/?rev=1160&view=rev Author: spom_spom Date: 2009-12-22 22:02:14 +0000 (Tue, 22 Dec 2009) Log Message: ----------- client: add experimental space dust (not yet perfect) Modified Paths: -------------- trunk/data/misc/misc.particle trunk/src/GunObject.cpp trunk/src/Sector.cpp trunk/src/SectorEnvironmentObject.cpp trunk/src/SectorEnvironmentObject.h trunk/src/SectorMovableObject.cpp trunk/src/SectorVesselObject.cpp Modified: trunk/data/misc/misc.particle =================================================================== --- trunk/data/misc/misc.particle 2009-12-21 22:41:44 UTC (rev 1159) +++ trunk/data/misc/misc.particle 2009-12-22 22:02:14 UTC (rev 1160) @@ -1,18 +1,35 @@ -OpenGate/Space/Dust +particle_system OpenGate/Space/Dust { material OpenGate/Space/Dust particle_width 1 particle_height 1 - cull_each true - quota 500 + cull_each false + quota 25000 billboard_type point // Area emitter emitter Ellipsoid{ - emission_rate 50000 + time_to_live 5 + colour 1.0 1.0 1.0 + //colour_range_start 0.0 0.0 0.0 + //colour_range_end 1 1 1 + emission_rate 500 velocity 0 - width 500 - height 500 - depth 500 + width 2000 + height 2000 + depth 2000 } + // Fader + + //affector ColourFader2 + //{ + // red1 0.4 + // green1 0.4 + // blue1 0.4 + // state_change 2.5 + // red2 -0.4 + // green2 -0.4 + // blue2 -0.4 + // } + } \ No newline at end of file Modified: trunk/src/GunObject.cpp =================================================================== --- trunk/src/GunObject.cpp 2009-12-21 22:41:44 UTC (rev 1159) +++ trunk/src/GunObject.cpp 2009-12-22 22:02:14 UTC (rev 1160) @@ -34,7 +34,7 @@ namespace OpenGate{ -GunObject::GunObject( Gun * gunBluePrint ) +GunObject::GunObject( Gun * gunBluePrint ) : gunBluePrint_( gunBluePrint ), parent_( NULL ), mountPoint_( NULL ), gunSound_( NULL ) { delayTime_ = 0; } @@ -46,9 +46,9 @@ void GunObject::mount( SectorVesselObject * parent, Ogre::SceneNode * mountPoint ){ parent_ = parent; mountPoint_ = mountPoint; - gunSound_ = OpenALSoundManager::getSingleton().createSoundSourceFromRessource( "sounds/defaultLaser", + gunSound_ = OpenALSoundManager::getSingleton().createSoundSourceFromRessource( "sounds/defaultLaser", mountPoint->getName() + "/Sound" ); - + if ( gunSound_ ) gunSound_->setRolloff( 0.04 ); } @@ -56,10 +56,10 @@ delayTime_ -= elapsedTime; } -const Ogre::Vector3 & GunObject::mountPosition() const { - return mountPoint_->_getDerivedPosition(); +const Ogre::Vector3 & GunObject::mountPosition() const { + return mountPoint_->_getDerivedPosition(); } - + bool GunObject::fire( Uint32 & capacity ){ if ( delayTime_ < 0 ){ if ( capacity > gunBluePrint_->powerConsumption() ){ @@ -76,57 +76,56 @@ } return false; } - + EngineObject::EngineObject( Engine * engineBluePrint, const std::string & name, Ogre::SceneNode * mountNode, const Ogre::Vector3 & position ) : engineBluePrint_( engineBluePrint ), name_( name ), mountNode_( mountNode ){ - + thrustRate_ = 0.0; thrusterParticles_ = NULL; - + mainNode_ = mountNode_->createChildSceneNode( name_ + "_EngineMountPoint" ); mainNode_->setPosition( position ); - + thrusterParticles_ = mountNode_->getCreator()->createParticleSystem( mainNode_->getName() + "/Thruster" ); thrusterParticles_->setMaterialName( "Examples/Flare" ); thrusterParticles_->setDefaultDimensions( 2, 1 ); - + pEmit_ = thrusterParticles_->addEmitter( "Point" ); // pEmit->setDirection( mainNode_->getOrientation().zAxis() ); // pEmit->setPosition( ( mainNodeEntityRot_->getOrientation() * engineMountPoints[ i ] ) * mainNodeEntityScale_->getScale() ); pEmit_->setColour( Ogre::ColourValue::Blue, Ogre::ColourValue::Green ); - + mainNode_->attachObject( thrusterParticles_ ); - } - + EngineObject::~EngineObject(){ - + if ( thrusterParticles_ ){ mainNode_->detachObject( thrusterParticles_ ); mainNode_->getCreator()->destroyParticleSystem( thrusterParticles_ ); mountNode_->removeAndDestroyChild( mainNode_->getName() ); } } - + // void EngineObject::mount( SectorMovableObject * parent, Ogre::SceneNode * mountPoint ){ // parent_ = parent; // mountPoint_ = mountPoint; // thrusterParticles_ = parent->sector()->sceneManager()->createParticleSystem( mountPoint->getName() + "/Thruster" ); // thrusterParticles_->setMaterialName( "Examples/Flare" ); // thrusterParticles_->setDefaultDimensions( 2, 1 ); -// +// // pEmit_ = thrusterParticles_->addEmitter( "Point" ); // // pEmit->setDirection( mainNode_->getOrientation().zAxis() ); // // pEmit->setPosition( ( mainNodeEntityRot_->getOrientation() * engineMountPoints[ i ] ) * mainNodeEntityScale_->getScale() ); // pEmit_->setColour( Ogre::ColourValue::Blue, Ogre::ColourValue::Green ); -// +// // mountPoint->attachObject( thrusterParticles_ ); // } void EngineObject::setThrustRate( double thrustRate ){ thrustRate_ = thrustRate; - + if ( thrusterParticles_ ){ pEmit_->setTimeToLive( thrustRate_ / 3000.0 * 100.0 ); pEmit_->setEmissionRate( thrustRate_ * 10.0 * 100.0 ); @@ -139,6 +138,6 @@ powerLine -= engineIn; return (Uint32)rint( engineBluePrint_->efficiency() * engineIn ); } - + } // namespace OpenGate Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-12-21 22:41:44 UTC (rev 1159) +++ trunk/src/Sector.cpp 2009-12-22 22:02:14 UTC (rev 1160) @@ -19,9 +19,6 @@ ***************************************************************************/ #include "Sector.h" - -#ifdef NEWSECTOR - #include "commonWithOgre.h" #include "Avatar.h" @@ -53,7 +50,7 @@ #include <OgreSubEntity.h> namespace OpenGate{ - + Sector::Sector( Ogre::SceneManager * sceneMgr, NetworkClient * network ) : sceneMgr_( sceneMgr ), network_( network ) { @@ -65,7 +62,7 @@ childIDCounter_ = 0; timeSinceLastNetworkUpdate_ = 0.0; timeSinceLastStatusUpdate_ = 0.0; - + ecliptic_ = new SectorEclipticObject( this ); sectorEnvironment_.insert( ecliptic_ ); showEcliptic( false ); @@ -78,7 +75,7 @@ sendVesselDeRegister( avatarObject_ ); avatar_->setRegistered( false ); } - + for_each( sectorEnvironment_.begin(), sectorEnvironment_.end(), deletePtr() ); for_each( sectorCollObjects_.begin(), sectorCollObjects_.end(), deletePtr() ); for_each( sectorMeshObjects_.begin(), sectorMeshObjects_.end(), deletePtr() ); @@ -86,38 +83,38 @@ for ( std::map< std::string, std::deque< SectorCollisionObject * > >::iterator it = objectHeap_.begin(), itmax = objectHeap_.end(); it != itmax; it ++ ){ for_each( (*it).second.begin(), (*it).second.end(), deletePtr() ); } - + if ( koordAxisNode_ ) { koordAxisNode_->detachObject( koordAxisMO_ ); sceneMgr_->destroyManualObject( koordAxisMO_->getName() ); sceneMgr_->getRootSceneNode()->removeAndDestroyChild( koordAxisNode_->getName() ); koordAxisNode_ = NULL; - } + } } bool Sector::update( Ogre::Real elapsedTime ){ if ( ResourceManager::getSingleton().collisionManager ){ ResourceManager::getSingleton().collisionManager->update( elapsedTime ); } - + for ( std::set< SectorEnvironmentObject * >::iterator it = sectorEnvironment_.begin(); it != sectorEnvironment_.end(); it++ ){ (*it)->update( elapsedTime ); } for ( std::set< SectorCollisionObject * >::iterator it = sectorCollObjects_.begin(); it != sectorCollObjects_.end(); ){ - if ( !(*it)->update( elapsedTime ) ) { + if ( !(*it)->update( elapsedTime ) ) { destructCollObject_( (*it++) ); } else ++it; } for ( std::set< SectorMeshObject * >::iterator it = sectorMeshObjects_.begin(); it != sectorMeshObjects_.end(); ){ - if ( !(*it)->update( elapsedTime ) ) { + if ( !(*it)->update( elapsedTime ) ) { destructMeshObject_( (*it++) ); } else ++it; } - + //** send movement data, max 10 net-updates/second timeSinceLastNetworkUpdate_ += elapsedTime; timeSinceLastStatusUpdate_ += elapsedTime; - + if ( timeSinceLastNetworkUpdate_ > 0.1 ){ sendAllVesselMovements( ); timeSinceLastNetworkUpdate_ = 0.0; @@ -144,7 +141,7 @@ } } } - + void Sector::destructMeshObject_( SectorMeshObject * obj ){ if ( obj ){ log_->debug( "Sector::destruct_ object: " + obj->name() + " " + toStr( obj->rtti() ) ); @@ -173,7 +170,7 @@ } } } - + void Sector::insertCollObject_( SectorCollisionObject * obj ){ sectorCollObjects_.insert( obj ); obj->activate(); @@ -183,7 +180,7 @@ obj->deactivate(); sectorCollObjects_.erase( obj ); } - + void Sector::insertMeshObject_( SectorMeshObject * obj ){ std::cout << "Sector::insertMeshObject_( SectorMeshObject * obj )" << obj->name() << std::endl; sectorMeshObjects_.insert( obj ); @@ -194,13 +191,13 @@ } } } - + void Sector::removeMeshObject_( SectorMeshObject * obj ){ if ( listener_ ) { if ( listener_->radar() ){ listener_->radar()->delObject( obj ); } - } + } obj->deactivate(); sectorMeshObjects_.erase( obj ); } @@ -235,7 +232,7 @@ log_->info( std::string( "Sector::createAvatarObject: " ) + avatar->name() ); avatarObject_ = new SectorAvatarObject( avatar->name(), this, avatar->vessel() ); avatarObject_->reset(); - + bool hasStation = false; if ( !sectorStations_.empty() ){ SectorStationObject *station = dynamic_cast< SectorStationObject* >( *sectorStations_.begin() ); @@ -256,13 +253,13 @@ avatarObject_->setVelocity( Ogre::Vector3( 0.0, 0.0, 0.0 ) ); } insertMeshObject_( avatarObject_ ); - + sendVesselRegister( avatarObject_ ); avatar_->setRegistered( true ); - + return avatarObject_; } - + SectorVesselObject * Sector::createVesselObject( Vessel * vessel ){ SectorVesselObject * obj; if ( objectHeap_[ vessel->name() ].empty() ){ @@ -278,10 +275,10 @@ insertMeshObject_( obj ); return obj; } - + SectorMissileObject * Sector::createMissileObject( Missile * missile ){ SectorMissileObject * obj; - + if ( objectHeap_[ missile->name() ].empty() ){ obj = new SectorMissileObject( missile->name() + "_" + toStr( childIDCounter_ ), this, missile ); childIDCounter_++; @@ -295,11 +292,11 @@ insertMeshObject_( obj ); return obj; } - + void Sector::createExplosion( SectorMeshObject * object ){ SectorExplosionObject * obj; std::string heapName( "Explosion" ); - + if ( objectHeap_[ heapName ].empty() ){ obj = new SectorExplosionObject( heapName + "_" + toStr( childIDCounter_ ), this ); childIDCounter_++; @@ -315,11 +312,11 @@ SectorProjectileObject * Sector::createProjectile( GunObject * obj, int shots ){ SectorProjectileObject * ammo = new SectorProjectileObject( obj->parent()->name() + "Ammo_" + toStr( shots ), this, obj ); insertCollObject_( ammo ); - + if ( obj->parent() == avatarObject_ ){ sendProjectile( ammo ); } - + return ammo; } @@ -362,13 +359,13 @@ return; } readXMLAttribute< std::string >( pElem, "name_en name", this, &OpenGate::Sector::setName, false ); - + pElem = hRoot.ChildElement( "environment", 0 ).Element(); if ( pElem ){ readXMLAttribute< std::string >( pElem, "skybox", this, &OpenGate::Sector::setSkyBox, false ); readXMLColourElement( pElem, "ambient", sceneMgr_, &Ogre::SceneManager::setAmbientLight, false ); - } - + } + pElem = hRoot.ChildElement( "station", 0 ).Element(); if ( pElem ){ std::string name; readXMLAttribute < std::string >( pElem, "name", name ); @@ -378,7 +375,7 @@ if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); } - + pElem = hRoot.ChildElement( "beacon", 0 ).Element(); if ( pElem ){ Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); @@ -405,7 +402,7 @@ if ( scale != Ogre::Vector3::ZERO ) obj->scaleNode()->scale( scale ); if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); int nSubEnt = 0; readXMLAttribute < int >( pElemChild, "numSubEntities", nSubEnt ); - + for ( int i = 0; i < nSubEnt; i ++ ){ std::string matName; readXMLAttribute < std::string >( pElemChild, "material-"+toStr( i ), matName ); obj->entity()->getSubEntity( i )->setMaterialName( matName ); @@ -415,13 +412,15 @@ std::cerr << "no entity found for sectorobject: " << name << std::endl; } } //! for all sectorobject - + //! create Planet SectorPlanetObject *planet = new SectorPlanetObject( "planet", this ); - //, Ogre::Vector3( 0000.0, 0000.0, 50000 ), 15000.0f, 64 ); + //, Ogre::Vector3( 0000.0, 0000.0, 50000 ), 15000.0f, 64 ); //planet_->lighting( true ); sectorEnvironment_.insert( planet ); - + + SectorSpaceDustObject *spaceDust = new SectorSpaceDustObject( this ); + sectorEnvironment_.insert( spaceDust ); return; } @@ -436,31 +435,31 @@ void Sector::flipShowEcliptic( ) { if ( ecliptic_ ) ecliptic_->mainNode()->flipVisibility( ); } - + void Sector::createKoordAxis( ){ koordAxisNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( "axisnode" ); koordAxisMO_ = sceneMgr_->createManualObject( koordAxisNode_->getName()+ "/manualObject" ); Ogre::Real length = 20; - + koordAxisMO_->begin( "Shader/SingleColor", Ogre::RenderOperation::OT_LINE_LIST); koordAxisMO_->getSection( 0 )->setCustomParameter( 0, Ogre::Vector4( 1.0, 0.0, 0.0, 1.0 ) ); koordAxisMO_->position( 0.0, 0.0, 0.0 ); koordAxisMO_->position( 1.0, 0.0, 0.0 ); koordAxisMO_->position( 0.0, 0.0, 0.0 ); koordAxisMO_->end(); - + koordAxisMO_->begin( "Shader/SingleColor", Ogre::RenderOperation::OT_LINE_LIST); koordAxisMO_->getSection( 1 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 1.0, 0.0, 1.0 ) ); koordAxisMO_->position( 0.0, 1.0, 0.0 ); koordAxisMO_->position( 0.0, 0.0, 0.0 ); koordAxisMO_->end(); - + koordAxisMO_->begin( "Shader/SingleColor", Ogre::RenderOperation::OT_LINE_LIST); koordAxisMO_->getSection( 2 )->setCustomParameter( 0, Ogre::Vector4( 0.0, 0.0, 1.0, 1.0 ) ); koordAxisMO_->position( 0.0, 0.0, 1.0 ); koordAxisMO_->position( 0.0, 0.0, 0.0 ); koordAxisMO_->end(); - + koordAxisMO_->begin( "BaseWhiteNoLighting", Ogre::RenderOperation::OT_LINE_LIST); koordAxisMO_->position( -1.0, 0.0, 0.0 ); koordAxisMO_->position( 0.0, 0.0, 0.0 ); @@ -505,7 +504,7 @@ void Sector::receiveVesselRegister( const MessageBodyShipRegister & msg ){ log_->info( std::string( "Receive vessel register: " ) + toStr( msg.senderID() ) + " id:" + toStr( msg.vesselID() ) ) ; - + ClientUserObject * user( network_->user( msg.senderID() ) ); if ( user ){ SectorMovableObject * obj; @@ -513,7 +512,7 @@ log_->debug( "Sector::createMovableObject new " + obj->name() ); insertMeshObject_( obj ); user->setSectorObject( obj ); - + obj->mainNode()->setPosition( toOgreVec( msg.position() ) ); obj->setMass( msg.mass() ); @@ -523,9 +522,9 @@ } else { log_->fatal( std::string( " no user for id: " ) + toStr( msg.senderID() ) ) ; } - + sendAllVesselInfos( ); - + // if ( !movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ // if ( msg.childID() == 0 ){ // log_->info( "Create player object " + msg.name()+ " " + toStr( msg.senderID() ) + " VesselID: " + toStr( msg.vesselID() ) ); @@ -537,23 +536,23 @@ // obj->setMaxThrust( msg.maxThrust() ); // obj->setMaxSpeed( std::sqrt( msg.maxThrust() / obj->movable()->dragFactor() ) ); // std::cout << msg << std::endl; -// +// // } else { // log_->info( "Create ai object " + msg.name()+ " " + toStr( msg.senderID() ) + " " + // toStr( (int)msg.childID() ) + " " + toStr( msg.vesselID() ) ); -// +// // // SectorObjectMoveableAi * obj = createAiMoveableObject( msg.name(), msg.senderID(), msg.childID(), // // *VesselManager::getSingleton().vessel( msg.vesselID() ) ); // // obj->mainNode()->setPosition( toOgreVec( msg.position() ) ); -// // +// // // // if ( movableObjects_.count( createGlobalID( msg.senderID(), 0 ) ) ){ // // log_->info( "ai object target: " + movableObjects_[ createGlobalID( msg.senderID(), 0 ) ]->name() ); // // obj->setTarget( movableObjects_[ createGlobalID( msg.senderID(), 0 ) ] ); // // } // } -// +// // sendAllVesselInfos( ); -// +// // } else { // log_->warn( std::string( "Registering: object allready exist: " ) + // movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]->name() ); @@ -571,7 +570,7 @@ void Sector::receiveVesselDeRegister( const MessageBodyShipDeRegister & msg ){ log_->info( std::string( "Receive vessel deregister: " ) + toStr( msg.senderID() ) ) ; - + ClientUserObject * user( network_->user( msg.senderID() ) ); if ( user ){ SectorMovableObject * obj = user->sectorObject(); @@ -593,7 +592,7 @@ void Sector::receiveVesselDied( const MessageBodyShipDied & msg ){ log_->info( std::string( "Receive vessel died: " ) + toStr( msg.senderID() ) ) ; - + ClientUserObject * user( network_->user( msg.senderID() ) ); if ( user ){ SectorMovableObject * obj = user->sectorObject(); @@ -607,7 +606,7 @@ log_->fatal( std::string( " no user for id: " ) + toStr( msg.senderID() ) ) ; } } - + void Sector::sendVesselMovement( SectorVesselObject * obj ){ if ( obj ){ MessageBodyShipMovement msg( 0, @@ -671,7 +670,7 @@ void Sector::receiveVesselStatus( const MessageBodyShipStatus & msg ){ log_->info( std::string( "Receive vessel status: " ) + toStr( msg.senderID() ) ) ; - + ClientUserObject * user( network_->user( msg.senderID() ) ); if ( user ){ SectorMovableObject * obj = user->sectorObject(); @@ -686,9 +685,9 @@ } void Sector::sendProjectile( SectorProjectileObject * ammo ){ - MessageBodyShipProjectileFired msg( 0, + MessageBodyShipProjectileFired msg( 0, ammo->gunObject()->parent()->shotsFired(), - Ogre::Vector3( ammo->mainNode()->getPosition() ).ptr(), + Ogre::Vector3( ammo->mainNode()->getPosition() ).ptr(), ammo->velocity().ptr(), ammo->gunObject()->gunBluePrint()->id(), 0, 0.0 ); network_->send( msg ); @@ -730,22 +729,22 @@ log_->fatal( std::string( " target is not the avatar: " ) + toStr( msg.targetID() ) ); } // if ( msg.senderID() != network_->userID() ){ -// +// // std::map< long, SectorObjectMovable * >::iterator it; -// +// // if ( ( it = movableObjects_.find( createGlobalID( msg.targetID(), msg.targetChildID() ) ) ) != movableObjects_.end() ){ // // log_->cout( "ReceiveVesselAmmoHit for " + network_->userName( msg.targetID() ) + " " + toStr( msg.damage() ) ); -// +// // it->second->hitByAmmo( msg.damage() ); // } else { // log_->fatal( std::string( "Requested non existant object for VesselAmmoHit " ) + -// " shooter: " + network_->userName( msg.senderID() ) + -// " shooter id: " + toStr( msg.senderID() ) + +// " shooter: " + network_->userName( msg.senderID() ) + +// " shooter id: " + toStr( msg.senderID() ) + // " gloabel id: " + toStr( createGlobalID( msg.targetID(), msg.targetChildID() ) ) + // " victim: " + network_->userName( msg.targetID() ) + // " child: " + toStr( (int)msg.targetChildID() ) + // " damage: " + toStr( msg.damage() ) + " this should not happen." ) ; -// +// // std::cerr << "Available objects: " << std::endl; // for ( std::map< long, SectorObjectMovable * >::iterator i = movableObjects_.begin(); i != movableObjects_.end(); i++){ // std::cerr << "\t" << i->first << " " << i->second->name() << " " << std::endl; @@ -754,875 +753,4 @@ // } } - - - - - - - - - - - - - - - - - - - - - - -#else - -#include "Sector.h" -#include "commonWithOgre.h" - -#include "AiObject.h" -#include "Avatar.h" -#include "EntityManager.h" -#include "Equipment.h" -#include "Missile.h" -#include "networkClient.h" -#include "OpcodeWrapper.h" -#include "Planet.h" -#include "Projectile.h" -#include "ResourceManager.h" -#include "SectorObjectAvatar.h" -#include "SectorObjectMissile.h" -#include "SectorObjectMoveable.h" -#include "SectorObjectVessel.h" -#include "Station.h" -#include "UnDockedState.h" -#include "Vessel.h" - -#include "tinyxml/tinyxml.h" - -#include <OgreEntity.h> -#include <OgreManualObject.h> -#include <OgreMaterialManager.h> -#include <OgreMeshManager.h> -#include <OgreOverlayContainer.h> -#include <OgreOverlayManager.h> -#include <OgreRenderSystem.h> -#include <OgreRenderSystemCapabilities.h> -#include <OgreRoot.h> -#include <OgreSceneNode.h> -#include <OgreSubEntity.h> - - -namespace OpenGate{ - - // class StarField : public Ogre::SimpleRenderable { -// public: -// StarField(){ -// setMaterial("BaseWhiteNoLighting"); - - -// begin(); -// end(); -// } -// ~StarField(){ -// delete mRenderOp.vertexData; mRenderOp.vertexData = NULL; -// // delete mRenderOp.indexData; mRenderOp.indexData = NULL; -// } -// begin(){ -// if ( !mpRenderOp.vertexData ) mpRenderOp.vertexData = new VertexData(); -// // if ( !mpRenderOp.indexData && mpRenderOp.useIndexes ) mpRenderOp.indexData = new IndexData(); -// } -// end(){} -// protectd: - -// }; - -Sector::Sector( Ogre::SceneManager * sceneMgr, NetworkClient * network ) - : sceneMgr_( sceneMgr ), network_( network ) { - - radar_ = true; - planet_ = NULL; - koordAxisNode_ = NULL; - starsNode_ = NULL; - avatar_ = NULL; - station_ = NULL; - name_ = "unknown"; - childIDCounter_ = 0; - log_ = LogManager::getSingletonPtr(); - - avatarDeathSequenceTime_ = 0.0; - - //*** starfield test 1 -// Ogre::ManualObject* myManualObject = sceneMgr_->createManualObject("manual1"); -// Ogre::SceneNode* myManualObjectNode = sceneMgr_->getRootSceneNode()->createChildSceneNode("manual1_node"); - -// Ogre::MaterialPtr myManualObjectMaterial = Ogre::MaterialManager::getSingleton().create("manual1Material","debugger"); -// myManualObjectMaterial->setReceiveShadows( false ); -// myManualObjectMaterial->getTechnique(0)->setLightingEnabled( true ); -// myManualObjectMaterial->getTechnique(0)->getPass(0)->setDiffuse(1.0, 1.0, 1.0, 1.0); -// myManualObjectMaterial->getTechnique(0)->getPass(0)->setAmbient(1.0, 1.0, 1.0); -// myManualObjectMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(1.0, 1.0, 1.0); -// myManualObject->begin("manual1Material", Ogre::RenderOperation::OT_POINT_LIST); -// for ( int i = 0; i < 3000; i ++ ){ -// myManualObject->position(Ogre::Vector3(Ogre::Math::RangeRandom(-1,1), -// Ogre::Math::RangeRandom(-1,1), -// Ogre::Math::RangeRandom(-1,1)).normalisedCopy() * -// Ogre::Math::RangeRandom(100000,400000) ); -// } -// myManualObject->end(); -// myManualObjectNode->attachObject(myManualObject); - //*** end starfield test 1 - - - //*** starfield test 2 -// starsNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode("StarfieldNode"); -// Ogre::BillboardSet* mySet = sceneMgr_->createBillboardSet("StarfieldNode"); -// mySet->setMaterialName( "OpenGate/Star"); -// for ( int i = 0; i < 1000; i ++ ){ -// Ogre::Billboard* myBillboard = mySet->createBillboard(Ogre::Vector3(Ogre::Math::RangeRandom(-1,1), -// Ogre::Math::RangeRandom(-1,1), -// Ogre::Math::RangeRandom(-1,1)).normalisedCopy()* Ogre::Math::RangeRandom( 1000, 3000 ) ); -// myBillboard->setDimensions( 10, 10 ); -// } -// starsNode_->attachObject(mySet); - //*** end starfield test 2; - - -// Ogre::Light * mainLight = sceneMgr_->createLight("MainLight" ); -// mainLight->setDiffuseColour( 0.1, 0.1, 0.1 ); -// mainLight->setSpecularColour( 0.4, 0.4, 0.4 ); -// mainLight->setPosition(-50000, 0, -40000 ); - - // sceneMgr_->setAmbientLight( Ogre::ColourValue( 0.1, 0.1, 0.1 ) ); - - if ( 1 ) { - // planet_ = new Planet( "planet", sceneMgr_, Ogre::Vector3( 20000.0, 10000.0, 40000 ), 15000.0f, 32 ); - planet_ = new Planet( "planet", sceneMgr_, Ogre::Vector3( 0000.0, 0000.0, 50000 ), 15000.0f, 64 ); - planet_->lighting( true ); - } - - populate( "test.sector" ); - - createKoordAxis( ); -} - -Sector::~Sector( ){ - - for ( std::set< SectorObject * >::iterator it = sectorObjects_.begin(); it != sectorObjects_.end(); it ++){ - // log_->info( "Sector::~Sector( ) deleting sector object: " + (*it)->name() ); - - if ( radar_ && (*it)->isOnRadar() ){ - Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); - Ogre::OverlayContainer * radarMap = radar->getChild( "Radar/Map" ); - radarMap->removeChild( (*it)->dotA()->getName() ); - radarMap->removeChild( (*it)->dotB()->getName() ); - } - - delete *it; - } - - sceneMgr_->destroyLight("MainLight" ); - - if ( planet_ ) { delete planet_; } - - if ( koordAxisNode_ ) { - koordAxisNode_->detachObject( koordAxisMO_ ); - sceneMgr_->destroyManualObject( koordAxisMO_->getName() ); - sceneMgr_->getRootSceneNode()->removeAndDestroyChild( koordAxisNode_->getName() ); - koordAxisNode_ = NULL; - } - - for ( std::map< std::string, std::deque< SectorObject * > >::iterator it = objectHeap_.begin(); it != objectHeap_.end(); it ++ ){ - for_each( (*it).second.begin(), (*it).second.end(), deletePtr() ); -// std::cout << (*it).first << std::endl; -// for ( int i = 0; i < (*it).second.size(); i ++ ){ -// std::cout << (*it).second[ i ]->name() << std::endl; -// delete (*it).second[ i ]; -// } - } -} - -void Sector::populate( const std::string & fileName ){ - TiXmlDocument doc( ResourceManager::getSingleton().findFullFileName( fileName ) ); - bool loadOkay = doc.LoadFile(); - - if ( !loadOkay ) { - log_->fatal( std::string( "Failed to load sector file: " + fileName ) ); - return; - } - - TiXmlHandle docHandle( &doc ); - TiXmlElement *pElem;//, *pSubElem; - TiXmlHandle hRoot( 0 ); - - pElem = docHandle.FirstChildElement().Element(); - hRoot = TiXmlHandle( pElem ); - - if ( !pElem ) { - log_->fatal( fileName + " cannot read first node." ); - return; - } - - if ( strcmp( "sector", pElem->Value() ) != 0 ) { - log_->fatal( fileName + " is no sector description" ); - return; - } - readXMLAttribute< std::string >( pElem, "name_en name", this, &OpenGate::Sector::setName, false ); - - pElem = hRoot.ChildElement( "environment", 0 ).Element(); - if ( pElem ){ - readXMLAttribute< std::string >( pElem, "skybox", this, &OpenGate::Sector::setSkyBox, false ); - readXMLColourElement( pElem, "ambient", sceneMgr_, &Ogre::SceneManager::setAmbientLight, false ); - } - - pElem = hRoot.ChildElement( "station", 0 ).Element(); - if ( pElem ){ - std::string name; readXMLAttribute < std::string >( pElem, "name", name ); - Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); - Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); - SectorObject *obj = createStation( name, pos ); - if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); - } - - pElem = hRoot.ChildElement( "beacon", 0 ).Element(); - if ( pElem ){ - Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); - Ogre::Vector3 dir( readXMLVec3Element( pElem, "direction" ) ); - Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); - SectorObject * obj = createBeacon( pos ); - obj->mainNode()->setDirection( dir ); - if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); - } - - for ( pElem = hRoot.FirstChild( "sectorobject" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement("sectorobject") ) { - std::string name; readXMLAttribute < std::string >( pElem, "name", name ); - Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); - Ogre::Vector3 scale( readXMLVec3Element( pElem, "scale" ) ); - Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); - - TiXmlElement * pElemChild = pElem->FirstChildElement( "entity" ); - - if ( pElemChild ){ - std::string mesh; readXMLAttribute < std::string >( pElemChild, "meshFile", mesh ); - SectorObject * obj = createStaticObject( mesh, name, pos ); - if ( scale != Ogre::Vector3::ZERO ) obj->scale( scale ); - if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); - int nSubEnt = 0; readXMLAttribute < int >( pElemChild, "numSubEntities", nSubEnt ); - - for ( int i = 0; i < nSubEnt; i ++ ){ - std::string matName; readXMLAttribute < std::string >( pElemChild, "material-"+toStr( i ), matName ); - obj->entity()->getSubEntity( i )->setMaterialName( matName ); - } - - } else{ - std::cerr << "no entity found for sectorobject: " << name << std::endl; - } - } - - return; -} - -void Sector::setSkyBox( const std::string & name ){ - sceneMgr_->setSkyBox( true, name, 10000 ); -} - -bool Sector::update( Ogre::Real elapsedTime ){ - if ( ResourceManager::getSingleton().collisionManager ) - ResourceManager::getSingleton().collisionManager->update( elapsedTime ); - - if ( avatar_ ) { - if ( planet_ ){ - planet_->update( elapsedTime ); - } - - if ( starsNode_ ) starsNode_->setPosition( avatar_->mainNode()->getPosition() ); - - if ( radar_ ){ - Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); - Ogre::OverlayContainer * radarMap = radar->getChild( "Radar/Map" ); - - int dotAWidth = 4; - int dotAHeight = 2; - float radarRange = 5000; - float radarWidth = radarMap->getWidth() * Ogre::OverlayManager::getSingleton().getViewportWidth(); - float radarHeight = radarMap->getHeight() * Ogre::OverlayManager::getSingleton().getViewportHeight(); - float xScale = radarRange / ( radarWidth / 2.0 ); - float yScale = radarRange / ( radarHeight / 2.0 ); - - for ( std::set< SectorObject * >::iterator it = sectorObjects_.begin(); it != sectorObjects_.end(); it++){ - - if ( (*it) != avatar_ ){ - Ogre::Vector3 relativPosition( (*it)->mainNode()->getPosition( ) - avatar_->mainNode()->getPosition( ) ); - Ogre::OverlayElement * dotA = (*it)->dotA(); - Ogre::OverlayElement * dotB = (*it)->dotB(); - - if ( relativPosition.length() < radarRange ){ - - Ogre::Quaternion q; - q.FromAngleAxis( -avatar_->mainNode()->getOrientation( ).getYaw(), Ogre::Vector3::UNIT_Y); - relativPosition = q * relativPosition; - -// Ogre::Quaternion r( Ogre::Degree(20), Ogre::Vector3::UNIT_Z); -// relativPosition = r * relativPosition; - // std::cout << relativPosition << std::endl; - - Ogre::Plane viewPlane( avatar_->mainNode()->getOrientation().yAxis().normalisedCopy(), - avatar_->mainNode()->getPosition() ); - - float distToPlane = viewPlane.getDistance( (*it)->mainNode()->getPosition( ) ) / yScale; - - dotA->setPosition( radarWidth / 2.0 + relativPosition[ 0 ] / xScale - dotAWidth / 2, - radarHeight / 2.0 + relativPosition[ 2 ] / yScale - dotAHeight / 2 - distToPlane ); - - if ( distToPlane < 0 ) distToPlane = 0; - - dotB->setHeight( fabs( distToPlane ) ); - dotB->setPosition( radarWidth / 2.0 + relativPosition[ 0 ] / xScale, - - distToPlane + radarHeight / 2.0 + relativPosition[ 2 ] / yScale ); - - if ( (*it)->isOnRadar() == false ){ - radarMap->addChild( dotA ); - radarMap->addChild( dotB ); - (*it)->onRadar( true ); - } - } else { // if not in radarrange - if ( (*it)->isOnRadar() == true ){ - radarMap->removeChild( dotA->getName() ); - radarMap->removeChild( dotB->getName() ); - (*it)->onRadar( false ); - } - } - } // if it != avatar - } // for each object - } // if radar - } // if avatar - - for ( std::map< long, SectorObjectMovable * >::iterator it = movableObjects_.begin(); it != movableObjects_.end(); ){ - - if ( !it->second ){ - log_->info( "Sector::update request for invalid object id: " + toStr( it->first ) ); - } else { - if ( !it->second->update( elapsedTime ) ) { //** object died; - if ( it->second == avatar_ ) { - if ( avatarDeathSequenceTime_ == 0.0 ){ - avatarDeathSequenceTime_ = 1.0; - } else { - avatarDeathSequenceTime_ -= elapsedTime; - if ( avatarDeathSequenceTime_ < 0 ){ - avatarDeathSequenceTime_ = 0.0; - listener_->avatarDeathSequence( false ); - } - } - it++; - } else { //** died object is not avatar; - destruct_( (it++)->second ); - } - } else ++it; - } - } - return true; -} - -void Sector::avatarDied( ){ - if ( avatar_ ){ - sendVesselDied( avatar_ ); - listener_->avatarDeathSequence( true ); - } -} - -SectorObject * Sector::createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, - const Ogre::Vector3 & pos ){ - SectorObject * obj = new SectorObject( objectname, this ); - - obj->setShape( meshname ); - - obj->mainNode()->setPosition( pos ); - sectorObjects_.insert( obj ); - return obj; -} - -SectorObject * Sector::createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, - const Ogre::Vector3 & pos, const Ogre::Vector3 & targetSize, Ogre::Degree yaw ){ - - SectorObject * obj = new SectorObject( objectname, this ); - - obj->mainNode()->yaw( yaw ); - obj->setShape( meshname ); - obj->setBaseSize( targetSize ); - obj->mainNode()->setPosition( pos ); - - sectorObjects_.insert( obj ); - return obj; -} - -SectorObject * Sector::createStation( const Ogre::String & stationName, Ogre::Vector3 & pos ){ - Station * station = ResourceManager::getSingleton().entityManager->station( stationName ); - SectorObject * obj = NULL; - - if ( station ){ - obj = new StationObject( *station, this ); - obj->mainNode()->setPosition( pos ); - sectorObjects_.insert( obj ); - station_ = dynamic_cast< StationObject * >( obj ); - } - return obj; -} - -SectorObject * Sector::createBeacon( const Ogre::Vector3 & pos ){ - SectorObject * obj = new BeaconObject( this ); - obj->mainNode()->setPosition( pos ); - obj->scale( Ogre::Vector3( 20.0, 20.0, 20.0 ) ); - sectorObjects_.insert( obj ); - return obj; -} - -SectorObjectMovable * Sector::createMovable( const Ogre::String & name, - Uint32 userID, Uint8 childID, Movable & movable ){ - SectorObjectMovable * obj = new SectorObjectMovable( name, this, userID, childID, - new Movable( movable ) ); - sectorObjects_.insert( obj ); - movableObjects_[ obj->globalID() ] = obj; - - return obj; -} - -SectorObjectVessel * Sector::createVessel( const Ogre::String & name, - Uint32 userID, Uint8 childID, Vessel & vessel ){ - - SectorObjectVessel * obj; - - if ( objectHeap_[ vessel.name() ].empty() ){ - childIDCounter_++; - obj = new SectorObjectVessel( name + "_" + toStr( childIDCounter_ ), - this, userID, childIDCounter_, new Vessel( vessel ) ); - log_->debug( "Sector::createVessel new " + obj->name() ); - } else { - obj = dynamic_cast< SectorObjectVessel * >( objectHeap_[ vessel.name() ].front() ); - objectHeap_[ vessel.name() ].pop_front(); - obj->reset(); - log_->debug( "Sector::createVessel reuse " + obj->name() ); - } - - sectorObjects_.insert( obj ); - if ( !movableObjects_.count( obj->globalID() ) ){ - movableObjects_[ obj->globalID() ] = obj; - } else { - std::cout << "Sector::createVessel: globalID allready exist:" << name << std::endl; - } - obj->setActive( true ); - return obj; -} - -SectorObjectMissile * Sector::createMissile( const Ogre::String & name, Uint32 userID, Uint8 childID, - Missile & missile ){ - SectorObjectMissile * obj; - - //if ( objectHeap_.count( missile.name() ) == 0 ){ - if ( objectHeap_[ missile.name() ].empty() ){ - childIDCounter_++; - obj = new SectorObjectMissile( name + "_" + toStr( childIDCounter_ ), - this, userID, childIDCounter_, new Missile( missile ) ); - //log_->debug( "Sector::createMissile new " + obj->name() ); - } else { - obj = dynamic_cast< SectorObjectMissile * >( objectHeap_[ missile.name() ].front() ); - objectHeap_[ missile.name() ].pop_front(); - obj->reset(); - //log_->debug( "Sector::createMissile reuse " + obj->name() ); - } - - sectorObjects_.insert( obj ); - - if ( !movableObjects_.count( obj->globalID() ) ){ - movableObjects_[ obj->globalID() ] = obj; - } else { - log_->fatal( "Sector::createMissile: globalID allready exist:" + name ); - } - obj->setActive( true ); - return obj; -} - -void Sector::createAvatarObject( Avatar & avatar ){ - log_->info( std::string( "Sector::createAvatarObject: " ) + avatar.name() ); - avatar_ = new SectorObjectAvatar( avatar.name(), this, avatar.userID(), avatar.vessel() ); - sectorObjects_.insert( avatar_ ); - movableObjects_[ avatar_->userID() ] = avatar_; - - avatar_->reset(); - if ( station_ ){ - log_->info( std::string( "launch avatar from station " ) ); - avatar_->mainNode()->setPosition( station_->launchPadPosition() + station_->launchPadDirection() * 5.0); - avatar_->mainNode()->setDirection( station_->launchPadDirection() ); - avatar_->setVelocity( station_->launchPadDirection() * 20.0 ); - } else{ - log_->info( std::string( "launch avatar from free position " ) ); - avatar_->mainNode()->setPosition( 0.0, 0.0, 100.0 ); - avatar_->mainNode()->setDirection( Ogre::Vector3( 0.0, 0.0, -1.0 ) ); - avatar_->setVelocity( Ogre::Vector3( 0.0, 0.0, -50.0 ) ); - } - - avatar_->setVisible( false ); - sendVesselRegister( avatar_ ); -} - -void Sector::destruct_( SectorObject * obj ){ - if ( obj ){ -// log_->debug( "Sector::destruct_ object: " + obj->name() + " " + toStr( obj->rtti() ) ); - sectorObjects_.erase( obj ); - if ( listener_->target() == obj ) selectNextTarget( ); - - if ( obj->isOnRadar() && radar_ ){ - Ogre::Overlay * radar = Ogre::OverlayManager::getSingleton().getByName( "Radar" ); - Ogre::OverlayContainer * radarMap = radar->getChild( "Radar/Map" ); - Ogre::OverlayElement * dotA = obj->dotA(); - Ogre::OverlayElement * dotB = obj->dotB(); - radarMap->removeChild( dotA->getName() ); - radarMap->removeChild( dotB->getName() ); - obj->onRadar( false ); - } - -// for ( std::map< long, SectorObjectMissile * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ -// if ( it->second->target() == obj ){ -// log_->warn( std::string( "ai object target: " ) + it->second->name() + " loose target." ); -// it->second->setTarget( NULL ); -// } -// } - obj->setActive( false ); - - switch ( obj->rtti() ){ - case SECTOROBJECTMOVABLE_RTTI: - movableObjects_.erase( obj->globalID() ); - delete obj; - obj = NULL; - break; - case SECTOROBJECTVESSEL_RTTI: - if ( dynamic_cast< SectorObjectVessel *>( obj )->controler() ) { - dynamic_cast< SectorObjectVessel *>( obj )->controler()->setVesselObject( NULL ); - } - movableObjects_.erase( obj->globalID() ); - objectHeap_[ dynamic_cast< SectorObjectVessel *>( obj )->movable()->name() ].push_back( obj ); - break; - case SECTOROBJECTMISSILE_RTTI: { -// if ( dynamic_cast< SectorObjectMissile *>( obj )->target() == avatar_ ) { -// //sendVesselDeRegister( dynamic_cast< SectorObjectMoveable *>( obj ) ); -// log_->fatal( "void Sector::destruct_( SectorObject * obj )" ); -// //sendVesselDeRegister( obj ); -// } - movableObjects_.erase( obj->globalID() ); - objectHeap_[ dynamic_cast< SectorObjectMissile *>( obj )->movable()->name() ].push_back( obj ); - - //localAiObjects_.erase( dynamic_cast< SectorObjectMissile *>(obj)->globalID() ); -// delete obj; -// obj = NULL; - } break; - default: - log_->fatal( "Sector::destruct moveableObject: object type unknown. this should not happen: " + toStr( obj->rtti() ) ); - } - } else { - log_->fatal( "Sector::destruct moveableObject: object is no valid: " ); - } -} - -void Sector::destructAvatarObject( ){ - for ( std::map< long, SectorObjectMissile * >::iterator it = localAiObjects_.begin(); - it != localAiObjects_.end(); it ++ ){ - - if ( it->second->target() == avatar_ ){ - log_->warn( std::string( "ai object target: " ) + it->second->name() + " loose target." ); - it->second->setTarget( NULL ); - } - } - - if ( avatar_ ){ - sendVesselDeRegister( avatar_ ); - movableObjects_.erase( avatar_->userID() ); - sectorObjects_.erase( avatar_ ); - delete avatar_; - } - - avatar_ = NULL; -} - -void Sector::selectNextTarget( ){ - listener_->setTarget( nextTarget( true, false ) ); -} - -void Sector::selectPrevTarget( ){ - listener_->setTarget( nextTarget( true, true ) ); -} - -SectorObject * Sector::prevTarget( bool forbidAvatarSelection ){ - return nextTarget( forbidAvatarSelection, true ); -} - -SectorObject * Sector::nextTarget( bool forbidAvatarSelection, bool reverse ){ - if ( sectorObjects_.size() == 1 ){ - return *sectorObjects_.begin(); - } - std::set< SectorObject * >::iterator itTarget = sectorObjects_.find( listener_->target() ); - if ( itTarget == sectorObjects_.end() ) itTarget = sectorObjects_.begin(); - - for ( uint i = 0; i < sectorObjects_.size(); i ++ ){ - if ( reverse ){ - if ( itTarget == sectorObjects_.begin() ) itTarget = sectorObjects_.end(); - itTarget --; - } else { - itTarget ++; - if ( itTarget == sectorObjects_.end() ) itTarget = sectorObjects_.begin(); - } - - if ( (*itTarget)->selectable() ) { - if ( forbidAvatarSelection ){ - if ( (*itTarget) != avatar_ ) return (*itTarget); - } else return (*itTarget); - } - } - return avatar_; -} - - -void Sector::sendAllVesselMovements( ){ - if ( avatar_ ) sendVesselMovement( avatar_ ); -} - -void Sector::sendAllVesselInfos( ){ - if ( avatar_ ){ - sendVesselStatus( avatar_ ); - -// for ( std::map< long, SectorObjectMoveableAi * >::iterator it = localAiObjects_.begin(); it != localAiObjects_.end(); it ++ ){ -// if ( it->second->target() == avatar_ ){ -// sendVesselMovement( it->second ); -// sendVesselStatus( it->second ); -// } -// } - } -} - -void Sector::sendVesselMovement( SectorObjectVessel * obj ){ - if ( obj ){ - MessageBodyShipMovement msg( obj->childID(), - obj->mainNode()->getPosition().ptr(), - obj->velocity().ptr(), - obj->mainNode()->getOrientation().ptr(), - obj->thrustRate(), - obj->thrust(), - obj->scaledYaw(), - obj->scaledPitch(), - obj->scaledRoll(), - 0 ); - - network_->send( msg ); - } -} - -void Sector::receiveVesselMovement( const std::vector < MessageBodyShipMovement * > & movements ){ - - std::map < long, const MessageBodyShipMovement * > singleMsg; - - //** we sort the movement messaged - for ( size_t i = 0; i < movements.size(); i ++ ){ -// LogManager::getSingleton().debug( std::string( "Movement: " ) + -// movableObjects_[ createGlobalID( movements[ i ]->senderID(), movements[ i ]->childID() )]->name() + " " + toStr( movements[ i ]->senderID() ) + " " + toStr( (int)movements[ i ]->childID() ) + -// " " + toStr( movements[ i ]->position() ) ); - - if ( movements[ i ]->senderID() != network_->userID() ){ - //** apply only foreign movements, and take just the actual movement - singleMsg[ createGlobalID( movements[ i ]->senderID(), movements[ i ]->childID() ) ] = movements[ i ]; - } - } - - std::map< long, SectorObjectMovable * >::iterator it; - - for ( std::map < long, const MessageBodyShipMovement * >::iterator i = singleMsg.begin(); i != singleMsg.end(); i++ ){ - if ( ( it = movableObjects_.find( i->first ) ) != movableObjects_.end() ){ - it->second->setFlightProperties( (*i->second) ); - } else { - log_->fatal( "Requested non existant object for shipmovement: " + - toStr( network_->userName( i->second->senderID() ) ) + - " child: " + toStr( (int)i->second->childID() ) + - " this should not happen." ); - } - } - for ( size_t i = 0; i < movements.size(); i ++ ){ - delete movements[ i ]; - } - -} - -void Sector::sendVesselStatus( SectorObjectVessel * obj ){ - if ( obj ){ - std::cout << "sendVesselStatus:" << obj->name() << std::endl; - MessageBodyShipStatus msg( obj->childID(), obj->shield(), obj->armor(), 0, 0, 0 ); - network_->send( msg ); - } -} - -void Sector::receiveVesselStatus( const MessageBodyShipStatus & msg ){ - if ( msg.senderID() != network_->userID() ){ - - std::map< long, SectorObjectMovable * >::iterator it; - - if ( ( it = movableObjects_.find( createGlobalID( msg.senderID(), msg.childID() ) ) ) != movableObjects_.end() ){ - // log_->debug( "ReceiveVesselStatus for " + it->second->name( ) ); - it->second->setStatus( msg ); - } else { - log_->fatal( "Requested non existant object for shipstatus: " + - network_->userName( msg.senderID() ) + " this should not happen." ); - } - } -} - -void Sector::sendVesselRegister( SectorObjectVessel * obj ){ - if ( obj ) { - log_->info( std::string( "Send register " ) + obj->name() + " id:" + toStr( obj->vessel()->id() ) ); - MessageBodyShipRegister msg( obj->userID(), obj->childID(), obj->name(), obj->mainNode()->getPosition().ptr(), - obj->vessel()->id(), obj->mass(), obj->maxShield(), obj->maxThrust() ); - network_->send( msg ); - } - -} - -void Sector::receiveVesselRegister( const MessageBodyShipRegister & msg ){ - - if ( !movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ - if ( msg.childID() == 0 ){ - log_->info( "Create player object " + msg.name()+ " " + toStr( msg.senderID() ) + " VesselID: " + toStr( msg.vesselID() ) ); - SectorObjectMovable * obj = createMovable( msg.name(), msg.senderID(), msg.childID(), - *ResourceManager::getSingleton().entityManager->vessel( msg.vesselID() ) ); - obj->mainNode()->setPosition( toOgreVec( msg.position() ) ); - obj->setMass( msg.mass() ); - obj->setMaxShield( msg.maxShield() ); - obj->setMaxThrust( msg.maxThrust() ); - obj->setMaxSpeed( std::sqrt( msg.maxThrust() / obj->movable()->dragFactor() ) ); - std::cout << msg << std::endl; - - } else { - log_->info( "Create ai object " + msg.name()+ " " + toStr( msg.senderID() ) + " " + - toStr( (int)msg.childID() ) + " " + toStr( msg.vesselID() ) ); - -// SectorObjectMoveableAi * obj = createAiMoveableObject( msg.name(), msg.senderID(), msg.childID(), -// *VesselManager::getSingleton().vessel( msg.vesselID() ) ); -// obj->mainNode()->setPosition( toOgreVec( msg.position() ) ); -// -// if ( movableObjects_.count( createGlobalID( msg.senderID(), 0 ) ) ){ -// log_->info( "ai object target: " + movableObjects_[ createGlobalID( msg.senderID(), 0 ) ]->name() ); -// obj->setTarget( movableObjects_[ createGlobalID( msg.senderID(), 0 ) ] ); -// } - } - - sendAllVesselInfos( ); - - } else { - log_->warn( std::string( "Registering: object allready exist: " ) + - movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]->name() ); - } - -} - -void Sector::sendVesselDeRegister( SectorObjectVessel * obj ){ - if ( obj ) { - log_->info( std::string( "Send deregister " ) + obj->name() ); - MessageBodyShipDeRegister msg( 0, obj->childID() ); - network_->send( msg ); - } -} - -void Sector::receiveVesselDeRegister( const MessageBodyShipDeRegister & msg ){ - if ( movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ - log_->info( std::string( "Receive deregister " ) - + movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]->name() ); - - SectorObjectMovable *obj = movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]; - obj->destroy(); - - } else { - log_->warn( std::string( "Deregistering request for unknown object: " ) + - toStr( msg.senderID() ) + ": " + toStr( (int)msg.childID() ) ); - } -} - -void Sector::sendVesselDied( SectorObjectVessel * obj ){ - MessageBodyShipDied msg( 0, obj->childID() ); - network_->send( msg ); -} - -void Sector::receiveVesselDied( const MessageBodyShipDied & msg ){ - if ( movableObjects_.count( createGlobalID( msg.senderID(), msg.childID() ) ) ){ - log_->info( std::string( "Receive vessel died " ) - + movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]->name() ); - - SectorObjectMovable *obj = movableObjects_[ createGlobalID( msg.senderID(), msg.childID() ) ]; - obj->deathSequence( 0.0 ); - } else { - log_->warn( std::string( "Died vessel request for unknown object: " ) + - toStr( msg.senderID() ) + ": " + toStr( (int)msg.childID() ) ); - } -} - -void Sector::sendVesselAmmoHit( const Projectile & projectile, BaseObject * victim ){ - - if ( projectile.parent().userID() == network_->userID() ){ - MessageBodyShipAmmoHit msg( projectile.parent().childID(), victim->userID(), victim->childID(), projectile.damage() ); - network_->send( msg ); - // std::cout << " Send: " << msg << endl; - victim->hitByAmmo( projectile.damage() ); - } -} - -void Sector::receiveVesselAmmoHit( const MessageBodyShipAmmoHit & msg ){ - if ( msg.senderID() != network_->userID() ){ - - std::map< long, SectorObjectMovable * >::iterator it; - - if ( ( it = movableObjects_.find( createGlobalID( msg.targetID(), msg.targetChildID() ) ) ) != movableObjects_.end() ){ - // log_->cout( "ReceiveVesselAmmoHit for " + network_->userName( msg.targetID() ) + " " + toStr( msg.damage() ) ); - - it->second->hitByAmmo( msg.damage() ); - } else { - log_->fatal( std::string( "Requested non existant object for VesselAmmoHit " ) + - " shooter: " + network_->userName( msg.senderID() ) + - " shooter id: " + toStr( msg.senderID() ) + - " gloabel id: " + toStr( createGlobalID( msg.targetID(), msg.targetChildID() ) ) + - " victim: " + network_->userName( msg.targetID() ) + - " child: " + toStr( (int)msg.targetChildID() ) + - " damage: " + toStr( msg.damage() ) + " this should not happen." ) ; - - std::cerr << "Available objects: " << std::endl; - for ( std::map< long, SectorObjectMovable * >::iterator i = movableObjects_.begin(); i != movableObjects_.end(); i++){ - std::cerr << "\t" << i->first << " " << i->second->name() << " " << std::endl; - } - } - } -} - -void Sector::sendProjectile( const Projectile & projectile ){ - MessageBodyShipProjectileFired msg( projectile.parent().childID(), projectile.shotCount(), - Ogre::Vector3( projectile.mainNode()->getPosition() ).ptr(), - projectile.velocity().ptr(), - projectile.gun()->id(), projectile.damage(), projectile.lifeTime() ); - network_->send( msg ); -} - -void Sector::receiveProjectile( const MessageBodyShipProjectileFired & msg ){ - if ( msg.senderID() != network_->userID() ){ - - std::map< long, SectorObjectMovable * >::iterator it; - if ( ( it = movableObjects_.find( createGlobalID( msg.senderID(), msg.childID() ) ) ) != movableObjects_.end() ){ - Gun * gun = dynamic_cast < Gun * >( ResourceManager::getSingleton().entityManager->entity( msg.gunID() ) ); - if ( gun->entityType() == GUN ){ - Projectile * pro = new Projectile( it->second, msg.shotCount(), *gun, - toOgreVec( msg.position() ), - toOgreVec( msg.velocity() ) ); - - it->second->addProjectile( pro ); - } else { - log_->warn( "Unknown projectile type: " + toStr( msg.gunID() ) ); - } - } else { - log_->warn( "Unknown shooter" ); - } - } -} -#endif - } // namespace OpenGate Modified: trunk/src/SectorEnvironmentObject.cpp =================================================================== --- trunk/src/SectorEnvironmentObject.cpp 2009-12-21 22:41:44 UTC (rev 1159) +++ trunk/src/SectorEnvironmentObject.cpp 2009-12-22 22:02:14 UTC (rev 1160) @@ -22,11 +22,14 @@ #include "LogManager.h" #include "Sector.h" +#include "SectorAvatarObject.h" #include <OgreEntity.h> #include <OgreLight.h> #include <OgreManualObject.h> #include <OgreMeshManager.h> +#include <OgreParticleEmitter.h> +#include <OgreParticleSystem.h> #include <OgreSceneManager.h> #include <OgreSceneNode.h> #include <OgreSubMesh.h> @@ -291,14 +294,28 @@ SectorSpaceDustObject::SectorSpaceDustObject( Sector * sector, Ogre::SceneNode * parentNode ) : SectorEnvironmentObject( "SpaceDust", sector, parentNode ){ ps_ = sector_->sceneManager()->createParticleSystem("Dust PS", "OpenGate/Space/Dust"); - mainNode_ = parentNode->createChildSceneNode( "DustParticles", parentNode->getPosition() ); -// mainNode_->attachObject( ps_ ); + mainNode_->createChildSceneNode( "DustParticles" ); + mainNode_->attachObject( ps_ ); + Ogre::ParticleEmitter *emitter = ps_->getEmitter( 0 ); + liveRange_ = toDouble( emitter->getParameter( "width") ); } SectorSpaceDustObject::~SectorSpaceDustObject( ){ + mainNode_->detachObject( ps_ ); + mainNode_->getCreator()->destroyParticleSystem( ps_ ); } bool SectorSpaceDustObject::update( Ogre::Real elapsedTime ){ + //ps_->_update( elapsedTime ); + mainNode_->setPosition( sector_->avatarObject()->mainNode()->getPosition() ); + sector_->avatarObject()->speedRate(); + Ogre::ParticleEmitter *emitter = ps_->getEmitter( 0 ); + double liveTime = liveRange_ / max( 10.0, sector_->avatarObject()->speedRate() * sector_->avatarObject()->speed() ) * 2.0; + std::cout << liveTime << " " << liveRange_ << " " << ps_->getParticleQuota() / liveTime << std::endl; + emitter->setTimeToLive( liveTime ); + emitter->setEmissionRate( ps_->getParticleQuota() / liveTime ); + + // const float maxDist = 250.0; // const float mirrorDist = maxDist*0.99; // const float dimFactor = 0.8*0.005*0.005; @@ -381,4 +398,4 @@ // planetNode_->rotate( rot, Ogre::Node::TS_PARENT ); // } -} +} // namespace OpenGate Modified: trunk/src/SectorEnvironmentObject.h =================================================================== --- trunk/src/SectorEnvironmentObject.h 2009-12-21 22:41:44 UTC (rev 1159) +++ trunk/src/SectorEnvironmentObject.h 2009-12-22 22:02:14 UTC (rev 1160) @@ -79,7 +79,7 @@ class SectorSpaceDustObject : public SectorEnvironmentObject{ public: - SectorSpaceDustObject( Sector * sector, Ogre::SceneNode * parentNode ); + SectorSpaceDustObject( Sector * sector, Ogre::SceneNode * parentNode = NULL ); ~SectorSpaceDustObject( ); @@ -87,6 +87,7 @@ protected: Ogre::ParticleSystem * ps_; + double liveRange_; }; Modified: trunk/src/SectorMovableObject.cpp =================================================================== --- trunk/src/SectorMovableObject.cpp 2009-12-21 22:41:44 UTC (rev 1159) +++ trunk/src/SectorMovableObject.cpp 2009-12-22 22:02:14 UTC (rev 1160) @@ -36,12 +36,12 @@ #include <OgreSceneNode.h> namespace OpenGate{ - + SectorMovableObject::SectorMovableObject( const std::string & name, Sector * sector, Movable * movable ) : SectorMeshObject( name, sector, NULL ), movable_( movable ), user_( NULL ){ - + setMesh( movable_->meshPtr()->getName() ); - + setBaseRot( movable_->baseYaw(), movable_->basePitch(), movable_->baseRoll() ); setBaseSize( movable_->baseSize() ); reset(); @@ -49,18 +49,18 @@ SectorMovableObject::~SectorMovableObject( ){ } - + void SectorMovableObject::reset( ){ SectorMeshObject::reset(); - + user_ = NULL; - + yaw_ = 0.0; pitch_ = 0.0; roll_ = 0.0; rotRelativeTo_ = Ogre::Node::TS_LOCAL; - + acc_ = Ogre::Vector3::ZERO; vel_ = Ogre::Vector3::ZERO; @@ -81,9 +81,9 @@ maxArmor_ = movable_->armor(); maxShield_ = 1; shield_ = 0; - + lastFrameCount_ = 0; - + setDestroyRequest_( false ); } @@ -108,12 +108,12 @@ } break; default: - std::cout << "SectorMovableObject: " << this->name() << " collide with " - << obj->rtti() << " " << obj->name() << std::endl; + std::cout << "SectorMovableObject: " << this->name() << " collide with " + << obj->rtti() << " " << obj->name() << std::endl; } } } - + bool SectorMovableObject::update( Ogre::Real elapsedTime ){ if ( destroyRequest_ ) return false; @@ -128,10 +128,10 @@ Ogre::Vector3 thrustDir( mainNode_->getOrientation().zAxis().normalisedCopy() ); Ogre::Vector3 flightDir( vel_.normalisedCopy() ); - + thrustDir.x = round( thrustDir.x, 7 ); thrustDir.y = round( thrustDir.y, 7 ); thrustDir.z = round( thrustDir.z, 7 ); flightDir.x = round( flightDir.x, 7 ); flightDir.y = round( flightDir.y, 7 ); flightDir.z = round( flightDir.z, 7 ); - + //** thrust = mass * a; if ( mass_ > 0 ){ acc_ = ( - thrustDir * (double)thrust_ - flightDir * transFriction_() ) / (double)mass_; @@ -146,45 +146,45 @@ // std::cout << yaw_ << " " << pitch_ << " " << roll... [truncated message content] |
From: <spo...@us...> - 2009-12-23 19:54:23
|
Revision: 1161 http://opengate.svn.sourceforge.net/opengate/?rev=1161&view=rev Author: spom_spom Date: 2009-12-23 19:54:13 +0000 (Wed, 23 Dec 2009) Log Message: ----------- client add some stars Modified Paths: -------------- trunk/data/misc/misc.material trunk/data/misc/misc.particle trunk/data/skybox/skybox.material trunk/src/Sector.cpp trunk/src/SectorEnvironmentObject.cpp trunk/src/SectorEnvironmentObject.h trunk/src/UnDockedState.h Modified: trunk/data/misc/misc.material =================================================================== --- trunk/data/misc/misc.material 2009-12-22 22:02:14 UTC (rev 1160) +++ trunk/data/misc/misc.material 2009-12-23 19:54:13 UTC (rev 1161) @@ -14,4 +14,23 @@ } } } +} + +material OpenGate/Star +{ + technique + { + pass + { + scene_blend add + lighting off + depth_check off + depth_write off + + texture_unit + { + texture textures/flare.png + } + } + } } \ No newline at end of file Modified: trunk/data/misc/misc.particle =================================================================== --- trunk/data/misc/misc.particle 2009-12-22 22:02:14 UTC (rev 1160) +++ trunk/data/misc/misc.particle 2009-12-23 19:54:13 UTC (rev 1161) @@ -1,35 +1,41 @@ particle_system OpenGate/Space/Dust { - material OpenGate/Space/Dust - particle_width 1 - particle_height 1 - cull_each false - quota 25000 - billboard_type point + material OpenGate/Space/Dust + particle_width 1 + particle_height 1 + cull_each true + quota 5000 + //billboard_type oriented_self + //billboard_rotation_type vertex - // Area emitter - emitter Ellipsoid{ - time_to_live 5 - colour 1.0 1.0 1.0 - //colour_range_start 0.0 0.0 0.0 - //colour_range_end 1 1 1 - emission_rate 500 - velocity 0 - width 2000 - height 2000 - depth 2000 + //billboard_type perpendicular_common + //billboard_type perpendicular_self + //common_direction 0 0 -1 + //self_direction 0 0 -1 + //self_up_vector 0 0 1 + + // Area emitter + emitter Ellipsoid{ + + time_to_live 10 + colour 0.0 0.0 0.0 + emission_rate 500 + velocity 0.1 + width 2000 + height 2000 + depth 2000 } - // Fader - //affector ColourFader2 - //{ - // red1 0.4 - // green1 0.4 - // blue1 0.4 - // state_change 2.5 - // red2 -0.4 - // green2 -0.4 - // blue2 -0.4 - // } + // Fader + affector ColourFader2 + { + red1 0.2 + green1 0.2 + blue1 0.2 + state_change 5 + red2 -0.2 + green2 -0.2 + blue2 -0.2 + } +} -} \ No newline at end of file Modified: trunk/data/skybox/skybox.material =================================================================== --- trunk/data/skybox/skybox.material 2009-12-22 22:02:14 UTC (rev 1160) +++ trunk/data/skybox/skybox.material 2009-12-23 19:54:13 UTC (rev 1161) @@ -6,7 +6,7 @@ { lighting off depth_write off -// scene_blend add + scene_blend add texture_unit { @@ -46,7 +46,12 @@ pass { lighting off - depth_write off + depth_check off + depth_write off + //scene_blend dest_colour one_minus_src_colour + //scene_blend alpha_blend //same like scene_blend src_alpha one_minus_src_alpha + scene_blend add + //scene_blend colour_blend texture_unit { Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-12-22 22:02:14 UTC (rev 1160) +++ trunk/src/Sector.cpp 2009-12-23 19:54:13 UTC (rev 1161) @@ -419,8 +419,11 @@ //planet_->lighting( true ); sectorEnvironment_.insert( planet ); - SectorSpaceDustObject *spaceDust = new SectorSpaceDustObject( this ); + SectorSpaceDustObject *spaceDust = new SectorSpaceDustObject( this, listener()->mainCameraNode() ); sectorEnvironment_.insert( spaceDust ); + + SectorStarfieldObject *starfield = new SectorStarfieldObject( this ); + sectorEnvironment_.insert( starfield ); return; } Modified: trunk/src/SectorEnvironmentObject.cpp =================================================================== --- trunk/src/SectorEnvironmentObject.cpp 2009-12-22 22:02:14 UTC (rev 1160) +++ trunk/src/SectorEnvironmentObject.cpp 2009-12-23 19:54:13 UTC (rev 1161) @@ -24,10 +24,13 @@ #include "Sector.h" #include "SectorAvatarObject.h" +#include <OgreBillboard.h> +#include <OgreBillboardSet.h> #include <OgreEntity.h> #include <OgreLight.h> #include <OgreManualObject.h> #include <OgreMeshManager.h> +#include <OgreParticle.h> #include <OgreParticleEmitter.h> #include <OgreParticleSystem.h> #include <OgreSceneManager.h> @@ -291,10 +294,46 @@ mainNode_->attachObject( entity_ ); } +SectorStarfieldObject::SectorStarfieldObject( Sector * sector, Ogre::SceneNode * parentNode ) + : SectorEnvironmentObject( "Starfield", sector, parentNode ){ + bs_ = sector_->sceneManager()->createBillboardSet( "Starfield" ); + bs_->setMaterialName( "OpenGate/Star" ); + bs_->setRenderQueueGroup( Ogre::RENDER_QUEUE_BACKGROUND ); + //bs_->setRenderQueueGroup( Ogre::RENDER_QUEUE_SKIES_EARLY ); + Ogre::Billboard *bb; + + for ( int i = 0; i < 25000; i ++ ){ + bb = bs_->createBillboard( Ogre::Vector3::ZERO, Ogre::ColourValue( 1.0f, 1.0f, 1.0f) ); + double dim = Ogre::Math::RangeRandom( 50.0, 100.0 ); + bb->setDimensions( dim, dim ); + double r = 10000.0; + double d = Ogre::Math::RangeRandom( 0.0, 2.0 * Ogre::Math::PI ); + double p = Ogre::Math::RangeRandom( 0.0, 2.0 * Ogre::Math::PI ); + double x = r * Ogre::Math::Cos( d ) * Ogre::Math::Cos( p ); + double y = r * Ogre::Math::Cos( d ) * Ogre::Math::Sin( p ); + double z = r * Ogre::Math::Sin( d ); + bb->setPosition( x, y, z ); + + } + mainNode_->attachObject( bs_ ); + +} + +SectorStarfieldObject::~SectorStarfieldObject(){ + mainNode_->detachObject( bs_ ); + mainNode_->getCreator()->destroyBillboardSet( bs_ ); +} + +bool SectorStarfieldObject::update( Ogre::Real elapsedTime ){ + mainNode_->setPosition( sector_->avatarObject()->mainNode()->getPosition() ); + return true; +} + + + SectorSpaceDustObject::SectorSpaceDustObject( Sector * sector, Ogre::SceneNode * parentNode ) : SectorEnvironmentObject( "SpaceDust", sector, parentNode ){ ps_ = sector_->sceneManager()->createParticleSystem("Dust PS", "OpenGate/Space/Dust"); - mainNode_->createChildSceneNode( "DustParticles" ); mainNode_->attachObject( ps_ ); Ogre::ParticleEmitter *emitter = ps_->getEmitter( 0 ); liveRange_ = toDouble( emitter->getParameter( "width") ); @@ -306,57 +345,28 @@ } bool SectorSpaceDustObject::update( Ogre::Real elapsedTime ){ - //ps_->_update( elapsedTime ); - mainNode_->setPosition( sector_->avatarObject()->mainNode()->getPosition() ); - sector_->avatarObject()->speedRate(); - Ogre::ParticleEmitter *emitter = ps_->getEmitter( 0 ); - double liveTime = liveRange_ / max( 10.0, sector_->avatarObject()->speedRate() * sector_->avatarObject()->speed() ) * 2.0; - std::cout << liveTime << " " << liveRange_ << " " << ps_->getParticleQuota() / liveTime << std::endl; - emitter->setTimeToLive( liveTime ); - emitter->setEmissionRate( ps_->getParticleQuota() / liveTime ); + Ogre::ParticleIterator pit = ps_->_getIterator(); + //particle->setDimensions( max( particle->getOwnWidth(), 50.0f ), particle->getOwnHeight() );//* sector_->avatarObject()->speedRate() ); + //ps_->setParameter("particle_height", toStr( max( 1.0f, 15.0f * sector_->avatarObject()->speedRate() ) ) ); + //ps_->setParameter("particle_height","1"); +// ps_->setParameter("self_direction", toStr( sector_->avatarObject()->velocity().x +0.01) + " " + +// toStr( sector_->avatarObject()->velocity().y +0.01) + " " + +// toStr( sector_->avatarObject()->velocity().z + 0.01) ); -// const float maxDist = 250.0; -// const float mirrorDist = maxDist*0.99; -// const float dimFactor = 0.8*0.005*0.005; -// const float maxDist2 = maxDist*maxDist; -// Camera* cam = mCamera->getCamera(); -// const Vector3& camPos = cam->getWorldPosition(); -// -// const float twiceMaxDist = 2 * maxDist; -// -// ParticleIterator pit = mParticleSystem->_getIterator(); -// -// while (!pit.end()) -// { -// Particle* particle = pit.getNext(); -// Vector3& pos = particle->position; -// particle->timeToLive = 999999.0f; -// -// // position particles near camera -// // (keep moving them toward camera until within range) -// while (pos.x - camPos.x > maxDist) -// pos.x -= twiceMaxDist; -// while (pos.x - camPos.x < -maxDist) -// pos.x += twiceMaxDist; -// while (pos.y - camPos.y > maxDist) -// pos.y -= twiceMaxDist; -// while (pos.y - camPos.y < -maxDist) -// pos.y += twiceMaxDist; -// while (pos.z - camPos.z > maxDist) -// pos.z -= twiceMaxDist; -// while (pos.z - camPos.z < -maxDist) -// pos.z += twiceMaxDist; -// -// Vector3 pDir = pos-camPos; -// float dist = pDir.squaredLength(); -// float dim = dist*dimFactor; -// particle->setDimensions(dim, dim); -// -// } -// -// return true; -// } +// ps_->setParameter("common_direction", toStr( sector_->avatarObject()->velocity().x ) + " " + +// toStr( sector_->avatarObject()->velocity().y ) + " " + +// toStr( sector_->avatarObject()->velocity().z ) ); + while ( !pit.end() ) { + Ogre::Particle* particle = pit.getNext(); + + Ogre::Vector3 pDir( ( sector_->avatarObject()->mainNode()->getPosition() - particle->position ) ); + if ( pDir.squaredLength() > ( liveRange_ * liveRange_ ) / 4.0 ){ + particle->position = sector_->avatarObject()->mainNode()->getPosition() + pDir; + //particle->rotation = 1.0; + } + + } return true; } Modified: trunk/src/SectorEnvironmentObject.h =================================================================== --- trunk/src/SectorEnvironmentObject.h 2009-12-22 22:02:14 UTC (rev 1160) +++ trunk/src/SectorEnvironmentObject.h 2009-12-23 19:54:13 UTC (rev 1161) @@ -90,9 +90,18 @@ double liveRange_; }; +class SectorStarfieldObject : public SectorEnvironmentObject{ +public: + SectorStarfieldObject( Sector * sector, Ogre::SceneNode * parentNode = NULL ); -// class SectorStarfieldObject : public SectorEnvironmentObject{ -// }; + ~SectorStarfieldObject( ); + + virtual bool update( Ogre::Real elapsedTime ); + +protected: + Ogre::BillboardSet * bs_; +}; + // class SectorSpaceDecorationObject : public SectorEnvironmentObject{ // }; Modified: trunk/src/UnDockedState.h =================================================================== --- trunk/src/UnDockedState.h 2009-12-22 22:02:14 UTC (rev 1160) +++ trunk/src/UnDockedState.h 2009-12-23 19:54:13 UTC (rev 1161) @@ -74,12 +74,14 @@ bool minimiseConsole( ); inline RadarObject * radar() { return radar_; } - + inline Sector * sector( ) { return sector_; } void showHud(); void hideHud(); + Ogre::SceneNode * mainCameraNode() { return mainCameraNode_; } + bool keyActionDoNothing( bool pressed = true ) { return false; } bool keyActionSwitchMinMaxConsole( bool pressed = true ); @@ -115,7 +117,7 @@ bool keyActionAvatarBreakPressed( bool pressed = true ); bool keyActionAvatarAfterburnerPressed( bool pressed = true ); - /*! Actions for development, will removed later. */ + /*! Actions for development, will removed later. */ bool keyActionTogglePolygonMode_DEV( bool pressed = true ); bool keyActionToggleFiltering_DEV( bool pressed = true ); @@ -124,10 +126,10 @@ bool keyActionIncreaseShaderScheme_DEV( bool pressed = true ); bool keyActionDecreaseShaderScheme_DEV( bool pressed = true ); - + bool keyActionIncreaseTimeZoom_DEV( bool pressed = true ); bool keyActionDecreaseTimeZoom_DEV( bool pressed = true ); - + bool keyActionAvatarSwitchDuelistPilot_DEV( bool pressed = true ); bool keyActionAvatarSwitchDuelistTarget_DEV( bool pressed = true ); bool keyActionAvatarChangeDockedState_DEV( bool pressed = true ); @@ -150,21 +152,21 @@ void setScheme_(); void toggleNextCamera_( int mode = -1 ); void updateCamera_( Ogre::Real elapsedTime ); - + Ogre::Root * root_; Ogre::RenderWindow * window_; Ogre::SceneManager * sceneMgr_; - + Hud * hud_; - + Ogre::SceneNode * mainCameraNode_; Ogre::Camera * mainCamera_; Ogre::Camera * secondCamera_; Sector * sector_; NetworkClient * network_; RadarObject * radar_; - + Ogre::Vector2 flightCursorPos_; CEGUI::Window * flightCursor_; Ogre::Real flightCursorHalfWidth_; @@ -174,7 +176,7 @@ double timeSinceLastSectorUpdate_; double timeSinceLastHudUpdate_; - + int cameraMode_; int cameraViewKey_; Ogre::Real cameraZoom_; @@ -197,10 +199,10 @@ int ambientLight_; int schemeIdx_; double timeZoom_; - + // Ogre::TextureFilterOptions filtering_; int aniso_; - + OpenALSoundSource * soundBackround_; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-12-28 21:29:53
|
Revision: 1164 http://opengate.svn.sourceforge.net/opengate/?rev=1164&view=rev Author: spom_spom Date: 2009-12-28 21:29:43 +0000 (Mon, 28 Dec 2009) Log Message: ----------- add global light source (Sun) and fixed planet rendering Modified Paths: -------------- branches/ogEditor/ogEditor/apps/opengate/opengateedit.py branches/ogEditor/ogEditor/wxOgre/OgreWindowWx.py branches/ogEditor/ogEditor/wxpg/wxPropGridWrapper.py trunk/data/materials/advancedMaterials.material trunk/data/materials/planet.material trunk/data/materials/planets.material trunk/data/materials/station.material trunk/data/misc/misc.material trunk/src/AiObject.h trunk/src/Sector.cpp trunk/src/SectorEnvironmentObject.cpp trunk/src/SectorEnvironmentObject.h trunk/src/UnDockedState.cpp trunk/src/common.cpp trunk/src/common.h trunk/src/commonWithOgre.cpp trunk/src/networkClient.cpp trunk/src/networkClient.h Added Paths: ----------- branches/ogEditor/ogEditor/resources/icons/arrow-right.png branches/ogEditor/ogEditor/resources/icons/process-stop.png Removed Paths: ------------- trunk/src/Projectile.cpp trunk/src/Projectile.h Modified: branches/ogEditor/ogEditor/apps/opengate/opengateedit.py =================================================================== --- branches/ogEditor/ogEditor/apps/opengate/opengateedit.py 2009-12-26 20:44:55 UTC (rev 1163) +++ branches/ogEditor/ogEditor/apps/opengate/opengateedit.py 2009-12-28 21:29:43 UTC (rev 1164) @@ -32,6 +32,10 @@ print "no python bindung for opengate lib found" +def toOgreColour( colour ): return ogre.ColourValue( colour[0]/255.0, colour[1]/255.0, colour[2]/255.0) + +def toWxColour( colour ): print colour; return wx.Colour( int( colour[0]*255.0 ), int( colour[1]*255.0 ), int( colour[2]*255.0) ) + class OgreMoveableItem( AppResource ): def __init__( self, parent, rendererSlot, propertyInspectorSlot ): AppResource.__init__( self, parent, rendererSlot, propertyInspectorSlot ) @@ -79,10 +83,34 @@ panel.append( prop, None ) for j in range( tech.getNumPasses() ): pas = tech.getPass( j ) + prop = wxpg.StringProperty( name = mat.getName() + "Technique"+str(i)+"Pass"+str( j ) , label = "Pass", value = pas.getName() ) panel.append( prop, None ) + prop = wxpg.ColourProperty( name = mat.getName() + "Tech"+str(i)+"P"+str( j )+"setAmbient" + , label = "setAmbient", value = toWxColour( pas.getAmbient() ) ) + panel.append( prop, cback = [self.setColour, pas.setAmbient ] + , toolTip = "Sets the ambient colour reflectance properties for every Pass in every Technique.") + prop = wxpg.ColourProperty( name = mat.getName() + "Tech"+str(i)+"P"+str( j )+"setDiffuse" + , label = "setDiffuse", value = toWxColour( pas.getDiffuse() ) ) + panel.append( prop, cback = [self.setColour, pas.setDiffuse ] + , toolTip = "Sets the diffuse colour reflectance properties of every Pass in every Technique.") + + prop = wxpg.ColourProperty( name = mat.getName() + "Tech"+str(i)+"P"+str( j )+"setSpecular" + , label = "setSpecular", value = toWxColour( pas.getSpecular() ) ) + panel.append( prop, cback = [self.setColour, pas.setSpecular ] + , toolTip = "Sets the specular colour reflectance properties of every Pass in every Technique." ) + + prop = wxpg.ColourProperty( name = mat.getName() + "Tech"+str(i)+"P"+str( j )+"setSelfIllumination" + , label = "setSelfIllumination", value = toWxColour( pas.getSelfIllumination() ) ) + panel.append( prop, cback = [self.setColour, pas.setSelfIllumination ] + , toolTip = "Sets the amount of self-illumination an object has." ) + + def setColour( self, name, value, string, args ): + print "setColour", name, value, string, args + args[ 1 ]( toOgreColour( value ) ) + def setMovable( self, obj ): self.obj_ = obj if hasattr( obj, 'getMovableType' ): @@ -134,9 +162,22 @@ self.camera_ = None def activate( self, active ): - print "activate( self, active ):", self - self.camera_.lookAt( self.obj_.mainNode().getPosition() ) + if active: + #currPos = self.camera_.getParentSceneNode().getPosition() + #currDir = self.camera_.getParentSceneNode().getOrientation() * ogre.Vector3( 0.0, 0.0, -1.0 ) + #currDir.normalise(); + #targetPos = self.obj_.mainNode().getPosition(); + #targetDir = targetPos - currPos; + #targetDir.normalise(); + + #rot = currDir.getRotationTo( targetDir ); + #rot.normalise(); + + #self.camera_.getParentSceneNode().rotate( rot ) + self.camera_.lookAt( self.obj_.mainNode().getPosition() ) + #self.camera_.getParentSceneNode().lookAt( self.obj_.mainNode().getPosition(), ogre.Node.TS_LOCAL ) + def setObject( self, obj, camera ): self.obj_ = obj self.camera_ = camera @@ -157,13 +198,60 @@ self.resourceManager_.ogreRoot = OgreWindow.ogreRoot self.resourceManager_.renderWindow = OgreWindow.renderWindow self.sceneManager_ = OgreWindow.sceneManager - self.camera_ = OgreWindow.camera + self.camera_ = OgreWindow.camera + self.toolBar_ = None + self.sectorUpdateTimer = wx.Timer() + self.updateTime_ = 33; + + self.sectorUpdateTimer.Bind( wx.EVT_TIMER, self.sectorUpdate ) #Bind the timer events to Ogre rendering + for res in OgreWindow.resourceLocations: self.resourceManager_.addResourceLocation( res[0], res[1] ) self.initOpenGateResources_() + def getToolBar( self, parent ): + if self.toolBar_ is None: + self.toolBar_ = aui.AuiToolBar( parent, -1, wx.DefaultPosition, wx.DefaultSize, + aui.AUI_TB_DEFAULT_STYLE | aui.AUI_TB_PLAIN_BACKGROUND ) + + self.toolBar_.SetName( "Opengate Toolbar" ) + + self.toolBar_.SetToolBitmapSize( wx.Size( 22, 22 ) ) + + self.tbStart = self.toolBar_.AddSimpleTool( wx.NewId(), "Start", loadIcon( "arrow-right.png" ) + , "Start sector update cycle" + ) + self.tbStart.SetDisabledBitmap( MakeDisabledBitmap( loadIcon( "arrow-right.png" ) ) ) + + self.tbStop = self.toolBar_.AddSimpleTool( wx.NewId(), "Stop", loadIcon( "process-stop.png" ) + , "Stop sector update cycle" + ) + self.tbStop.SetDisabledBitmap( MakeDisabledBitmap( loadIcon( "process-stop.png" ) ) ) + + self.toolBar_.EnableTool( self.tbStop.GetId(), False ) + + wx.EVT_TOOL( self.toolBar_, self.tbStart.GetId(), self.onSectorUpdateStart ) + wx.EVT_TOOL( self.toolBar_, self.tbStop.GetId(), self.onSectorUpdateStop ) + + return self.toolBar_ + + def onSectorUpdateStart( self, event = None ): + self.sectorUpdateTimer.Start( self.updateTime_ ) + self.toolBar_.EnableTool( self.tbStart.GetId(), False ) + self.toolBar_.EnableTool( self.tbStop.GetId(), True ) + self.toolBar_.Refresh() + + def onSectorUpdateStop( self, event = None ): + self.sectorUpdateTimer.Stop( ) + self.toolBar_.EnableTool( self.tbStart.GetId(), True ) + self.toolBar_.EnableTool( self.tbStop.GetId(), False ) + self.toolBar_.Refresh() + + def sectorUpdate( self, event = None ): + self.sector_.update( self.updateTime_ / 50.0 ) + def createPropertyPanel( self, parent ): if not HAVE_PROPGRID: return wx.Panel( parent ) @@ -178,8 +266,7 @@ prop = wxpg.EnumProperty( "Shader scheme", labels = ( "Default", "vpfp" ), values = [1,2,3], value = 3 ) panel.append( prop, self.onShaderChange ) - self.sceneManager_.setAmbientLight( ogre.ColourValue( 10.0/256.0, 10.0/256.0, 10.0/256.0) ) - prop = wxpg.ColourProperty( "Ambient light", value = wx.Colour( 10, 10, 10 ) ) + prop = wxpg.ColourProperty( "Ambient light", value = toWxColour( self.sceneManager_.getAmbientLight() ) ) panel.append( prop, self.onAmbientLightChange ) return panel @@ -190,7 +277,7 @@ def onAmbientLightChange( self, name, value, string ): print "onAmbientLightChange( self, name, value, string ):", name, value, string - self.sceneManager_.setAmbientLight( ogre.ColourValue( value[0]/256.0, value[1]/256.0, value[2]/256.0) ) + self.sceneManager_.setAmbientLight( toOgreColour( value ) ) def initOpenGateResources_( self ): self.resourceManager_.loadGlobalIDs( "ids.xml" ) @@ -219,6 +306,10 @@ for category in categories: categoryNode = tree.AppendItem( ogEntityManagerNode, category ) + self.parent.resourceTree.Expand( self.treeItem ) + + self.parent.resourceTree.Expand( self.sectorTreeNode_ ) + def showSector( self, name ): self.sector_ = og.Sector( self.sceneManager_, None ) self.sector_.populate( name ) @@ -362,6 +453,7 @@ it.fullFileName = l[1] it.guiSystem = self.GUISystem + self.parent.resourceTree.Expand( root ) def findResources( self, filesystem, pattern ): for res in self.renderer_.resourceLocations: Added: branches/ogEditor/ogEditor/resources/icons/arrow-right.png =================================================================== (Binary files differ) Property changes on: branches/ogEditor/ogEditor/resources/icons/arrow-right.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/ogEditor/ogEditor/resources/icons/process-stop.png =================================================================== (Binary files differ) Property changes on: branches/ogEditor/ogEditor/resources/icons/process-stop.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/ogEditor/ogEditor/wxOgre/OgreWindowWx.py =================================================================== --- branches/ogEditor/ogEditor/wxOgre/OgreWindowWx.py 2009-12-26 20:44:55 UTC (rev 1163) +++ branches/ogEditor/ogEditor/wxOgre/OgreWindowWx.py 2009-12-28 21:29:43 UTC (rev 1164) @@ -312,6 +312,7 @@ validMove = self.moveKeyDict.get( event.m_keyCode, False ) if validMove: self.sceneEntities.cameraNode.translate( validMove, self.sceneEntities.cameraNode.TS_LOCAL ) + #self.sceneEntities.camera.translate( validMove ) #print ( "cam position %s, direction: %s" % ( toStr( self.sceneEntities.cameraNode.getPosition() ), #toStr( self.sceneEntities.camera.getDirection() ) ) ) @@ -333,8 +334,10 @@ dy = self.StartDragY -y self.StartDragX, self.StartDragY = x, y - self.sceneEntities.cameraNode.yaw( ogre.Degree( dx / 5.0 ), ogre.Node.TS_LOCAL ) - self.sceneEntities.cameraNode.pitch( ogre.Degree( dy / 5.0 ), ogre.Node.TS_LOCAL ) + #self.sceneEntities.cameraNode.yaw( ogre.Degree( dx / 5.0 ), ogre.Node.TS_LOCAL ) + #self.sceneEntities.cameraNode.pitch( ogre.Degree( dy / 5.0 ), ogre.Node.TS_LOCAL ) + self.sceneEntities.camera.yaw( ogre.Degree( dx / 5.0 ) ) + self.sceneEntities.camera.pitch( ogre.Degree( dy / 5.0 ) ) for l in self.listener: l.onMouseEvent( event ) Modified: branches/ogEditor/ogEditor/wxpg/wxPropGridWrapper.py =================================================================== --- branches/ogEditor/ogEditor/wxpg/wxPropGridWrapper.py 2009-12-26 20:44:55 UTC (rev 1163) +++ branches/ogEditor/ogEditor/wxpg/wxPropGridWrapper.py 2009-12-28 21:29:43 UTC (rev 1164) @@ -25,6 +25,7 @@ self.Append( prop ) else: self.AppendIn( parent, prop ) + return prop def onPropGridChange(self, event): @@ -34,7 +35,11 @@ print "GetValue", p.GetValue() #print "GetValueRef", p.GetValueRef() if p.GetClientData(): - try: - p.GetClientData()( name = p.GetName(), value = p.GetValue(), string = p.GetValueAsString() ) - except: - p.GetClientData()( name = p.GetName(), value = p.GetValue() ) \ No newline at end of file + if type( p.GetClientData() ) == list: + p.GetClientData()[0]( name = p.GetName(), value = p.GetValue(), string = p.GetValueAsString() + , args = p.GetClientData() ) + else: + try: + p.GetClientData()( name = p.GetName(), value = p.GetValue(), string = p.GetValueAsString() ) + except: + p.GetClientData()( name = p.GetName(), value = p.GetValue() ) \ No newline at end of file Modified: trunk/data/materials/advancedMaterials.material =================================================================== --- trunk/data/materials/advancedMaterials.material 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/data/materials/advancedMaterials.material 2009-12-28 21:29:43 UTC (rev 1164) @@ -1,5 +1,5 @@ material OpenGate/BumpMapping -{ +{ // This is the preferred technique which uses both vertex and // fragment programs, supports coloured lights @@ -12,9 +12,9 @@ // base colours, not needed for rendering, but as information // to lighting pass categorisation routine // ambient 1 1 1 -// diffuse 0 0 9 -// specular 0 0 1 1 -// emissive 0 0 1 1 +// diffuse 0 0 9 +// specular 0 0 1 1 +// emissive 0 0 1 1 // Really basic vertex program // NB we don't use fixed function here because GL does not like // mixing fixed function and vertex programs, depth fighting can @@ -23,7 +23,7 @@ { param_named_auto ambient ambient_light_colour } - + } // Now do the lighting pass // NB we don't do decal texture here because this is repeated per light @@ -31,8 +31,8 @@ { // base colours, not needed for rendering, but as information // to lighting pass categorisation routine - ambient 0 0 1 - + ambient 0 0 1 + // do this for each light iteration once_per_light @@ -47,9 +47,9 @@ // Fragment program fragment_program_ref BumpMapFP { - param_named_auto lightDiffuse light_diffuse_colour 0 + param_named_auto lightDiffuse light_diffuse_colour 0 } - + // Base bump map texture_unit { @@ -64,7 +64,7 @@ tex_address_mode clamp } } - + // Decal pass pass { @@ -84,7 +84,7 @@ { texture_alias Image } - + } } @@ -99,7 +99,7 @@ // base colours, not needed for rendering, but as information // to lighting pass categorisation routine ambient 1 1 1 - diffuse 0 0 0 + diffuse 0 0 0 specular 0 0 0 0 // Really basic vertex program // NB we don't use fixed function here because GL does not like @@ -109,7 +109,7 @@ { param_named_auto ambient ambient_light_colour } - + } // Now do the lighting pass // NB we don't do decal texture here because this is repeated per light @@ -117,11 +117,11 @@ { // base colours, not needed for rendering, but as information // to lighting pass categorisation routine - ambient 0 0 0 + ambient 0 0 0 // do this for each light iteration once_per_light - + scene_blend add // Vertex program reference @@ -129,7 +129,7 @@ { param_named_auto lightPosition light_position_object_space 0 } - + // Base bump map texture_unit { @@ -146,7 +146,7 @@ colour_op_multipass_fallback dest_colour zero } } - + // Decal pass pass { @@ -162,11 +162,11 @@ scene_blend dest_colour zero texture_unit { - texture_alias Image + texture_alias Image } - + } - } + } // This is the fallback which cards which don't have fragment program and vertex program support technique fallback { @@ -178,16 +178,9 @@ emissive 0.500000 0.500000 0.500000 1.000000 texture_unit { - texture_alias ImageFallback + texture_alias ImageFallback } } } } -//material Sta/TS/Background : OpenGate/BumpMapping -//{ -// set_texture_alias Image TausetiStationBackgroundPlain.png -// set_texture_alias ImageBumpMap TausetiStationBackgroundBM.png -// set_texture_alias ImageFallback TausetiStationBackground.png -//} - Modified: trunk/data/materials/planet.material =================================================================== --- trunk/data/materials/planet.material 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/data/materials/planet.material 2009-12-28 21:29:43 UTC (rev 1164) @@ -2,16 +2,16 @@ { source planet.cg entry_point main_vp - //profiles arbvp1 vp20 vs_1_1 - profiles arbvp1 vs_1_1 + //profiles arbvp1 vp20 vs_1_1 + profiles arbvp1 vs_1_1 default_params { param_named_auto modelViewProjection worldviewproj_matrix - param_named lightPos float3 -50000.0 0.0 -40000.0 -// param_named_auto lightPos light_position_object_space 0 - param_named_auto camPos camera_position_object_space - } +// param_named lightPos float3 -50000.0 0.0 -40000.0 + param_named_auto lightPos light_position_object_space 0 + param_named_auto camPos camera_position_object_space + } } fragment_program FragmentPrograms/PlanetNormSpec cg @@ -22,23 +22,23 @@ profiles arbfp1 ps_1_1 default_params { - } + } } vertex_program VertexPrograms/PlanetCloud cg { source planet.cg entry_point cloud_vp - //profiles arbvp1 vp20 vs_1_1 - profiles arbvp1 vs_1_1 + //profiles arbvp1 vp20 vs_1_1 + profiles arbvp1 vs_1_1 default_params { param_named_auto modelViewProjection worldviewproj_matrix - param_named lightPos float4 -50000.0 0.0 -40000.0 0.0 -// param_named_auto lightPos light_position_object_space 0 +// param_named lightPos float4 -50000.0 0.0 -40000.0 0.0 + param_named_auto lightPos light_position_object_space 0 param_named_auto camPos camera_position_object_space - } + } } fragment_program FragmentPrograms/PlanetCloud cg @@ -49,23 +49,23 @@ profiles arbfp1 ps_1_1 default_params { - } + } } vertex_program VertexPrograms/PlanetAtmosphere cg { source planet.cg entry_point atmos_vp - //profiles arbvp1 vp20 vs_1_1 - profiles arbvp1 vs_1_1 + //profiles arbvp1 vp20 vs_1_1 + profiles arbvp1 vs_1_1 default_params { param_named_auto modelViewProjection worldviewproj_matrix - param_named lightPos float4 -50000.0 0.0 -40000.0 0.0 -// param_named_auto lightPos light_position_object_space 0 +// param_named lightPos float4 -50000.0 0.0 -40000.0 0.0 + param_named_auto lightPos light_position_object_space 0 param_named_auto camPos camera_position_object_space - } + } } fragment_program FragmentPrograms/PlanetAtmosphere cg @@ -76,11 +76,11 @@ profiles arbfp1 ps_1_1 default_params { - } + } } material PlanetNormSpec -{ +{ technique vpfp { scheme vpfp @@ -91,7 +91,7 @@ } fragment_program_ref FragmentPrograms/PlanetNormSpec { - param_named_auto lightDiffuse light_diffuse_colour 0 + param_named_auto lightDiffuse light_diffuse_colour 0 param_named_auto lightSpecular light_specular_colour 0 param_named lightAmbient float4 0.05 0.05 0.05 0.1 param_named exponent float 10 @@ -100,17 +100,17 @@ texture_unit { texture_alias Image - tex_coord_set 0 + tex_coord_set 0 } texture_unit { texture_alias ImageNormMap - tex_coord_set 1 + tex_coord_set 1 } texture_unit { texture_alias ImageSpecMap - tex_coord_set 2 + tex_coord_set 2 } texture_unit { @@ -139,7 +139,7 @@ { scheme Default pass - { + { ambient 0.500000 0.500000 0.500000 1.000000 diffuse 0.900000 0.900000 0.900000 1.000000 specular 0.900000 0.900000 0.900000 1.000000 @@ -147,7 +147,7 @@ texture_unit { texture_alias ImageFallback - tex_coord_set 0 + tex_coord_set 0 } } } @@ -180,7 +180,7 @@ { scheme Default pass - { + { specular 0.500000 0.500000 0.500000 0.5000000 emissive 1.000000 1.000000 1.000000 1.000000 depth_check on Modified: trunk/data/materials/planets.material =================================================================== --- trunk/data/materials/planets.material 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/data/materials/planets.material 2009-12-28 21:29:43 UTC (rev 1164) @@ -1,21 +1,3 @@ -material OpenGate/Star -{ - technique - { - pass - { - lighting on - scene_blend add - depth_write off - - texture_unit - { - texture textures/star.png - } - } - } -} - material OpenGate/RedPlanet { technique Modified: trunk/data/materials/station.material =================================================================== --- trunk/data/materials/station.material 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/data/materials/station.material 2009-12-28 21:29:43 UTC (rev 1164) @@ -2,13 +2,13 @@ { source station.cg entry_point main_vp - profiles arbvp1 vp20 vs_1_1 + profiles arbvp1 vp20 vs_1_1 default_params { param_named_auto modelViewProjection worldviewproj_matrix param_named_auto camPos camera_position_object_space - } + } } fragment_program FragmentPrograms/StationNormSpec cg @@ -18,11 +18,11 @@ profiles arbfp1 fp20 ps_1_1 default_params { - } + } } material StationNormSpec -{ +{ technique vpfp { scheme vpfp @@ -45,7 +45,7 @@ } fragment_program_ref FragmentPrograms/StationNormSpec { - param_named_auto lightDiffuse light_diffuse_colour 0 + param_named_auto lightDiffuse light_diffuse_colour 0 param_named_auto lightSpecular light_specular_colour 0 // param_named lightDiffuse float4 0.6 0.6 0.6 1.0 // param_named lightSpecular float4 0.2 0.2 0.2 1.0 @@ -56,17 +56,17 @@ texture_unit { texture_alias Image - tex_coord_set 0 + tex_coord_set 0 } texture_unit { texture_alias ImageNormMap - tex_coord_set 1 + tex_coord_set 1 } texture_unit { texture_alias ImageSpecMap - tex_coord_set 2 + tex_coord_set 2 } texture_unit { @@ -82,7 +82,7 @@ { scheme Default pass - { + { ambient 0.500000 0.500000 0.500000 1.000000 diffuse 0.900000 0.900000 0.900000 1.000000 specular 0.900000 0.900000 0.900000 1.000000 @@ -90,7 +90,7 @@ texture_unit { texture_alias ImageFallback - tex_coord_set 0 + tex_coord_set 0 } } } @@ -169,7 +169,7 @@ material OpenGate/SingleTexture { receive_shadows on - technique + technique { pass { @@ -178,7 +178,7 @@ emissive 0.500000 0.500000 0.500000 1.000000 texture_unit { - texture_alias Image + texture_alias Image } } } @@ -208,7 +208,7 @@ material Flashlight/Red { technique - { + { pass { lighting off @@ -218,7 +218,7 @@ emissive 1.000000 0.000000 0.000000 1.000000 texture_unit { - texture flare.png + texture flare.png } } } Modified: trunk/data/misc/misc.material =================================================================== --- trunk/data/misc/misc.material 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/data/misc/misc.material 2009-12-28 21:29:43 UTC (rev 1164) @@ -22,13 +22,38 @@ { pass { + emissive 0.6 0.6 0.6 1.0 + scene_blend add - lighting off + lighting on depth_check off depth_write off texture_unit { + texture textures/star.png + } + } + } +} + +material OpenGate/Sun +{ + technique + { + + + pass + { + emissive 1.0 0.95 0.90 1.0 + + scene_blend add + lighting on + depth_check off + depth_write on + + texture_unit + { texture textures/flare.png } } Modified: trunk/src/AiObject.h =================================================================== --- trunk/src/AiObject.h 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/src/AiObject.h 2009-12-28 21:29:43 UTC (rev 1164) @@ -29,8 +29,6 @@ #include <queue> #include <iostream> -#include <boost/thread.hpp> - namespace Ogre{ class Timer; class Vector3; @@ -65,7 +63,7 @@ void setName ( const std::string & name ){ name_ = name; } - std::string name() const { return name_; } + inline const std::string & name() const { return name_; } uint id() const { return id_;} Deleted: trunk/src/Projectile.cpp =================================================================== --- trunk/src/Projectile.cpp 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/src/Projectile.cpp 2009-12-28 21:29:43 UTC (rev 1164) @@ -1,240 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#include "Projectile.h" - -#include "Equipment.h" -#include "GunObject.h" -#include "LogManager.h" -#include "OpcodeWrapper.h" -#include "ResourceManager.h" -#include "Sector.h" - -#include <OgreBillboard.h> -#include <OgreBillboardSet.h> -#include <OgreManualObject.h> -#include <OgreRibbonTrail.h> -#include <OgreSceneManager.h> -#include <OgreVector3.h> - -namespace OpenGate{ - -Projectile::Projectile( BaseObject * parent, long shotCount, Gun & gun, const Ogre::Vector3 & pos, const Ogre::Vector3 & vel ) - : BaseObject( parent->name() + "_" + toStr( shotCount ), parent->sector() ), parent_( parent ), - shotCount_( shotCount ), gun_( &gun ), damage_( gun.damage() ), maxLifeTime_( gun.lifeTime() ), vel_( vel ){ - - selectable_ = false; - beam_ = NULL; - bullet_ = NULL; - shape_ = NULL; - trail_ = NULL; - - maxRange_ = gun.speed() * maxLifeTime_; - - fire( pos ); -} - -Projectile::Projectile( BaseObject * parent, long shotCounter, const GunObject & gun, const Ogre::Vector3 & mountPoint ) - : BaseObject( parent->name() + "_" + toStr( shotCounter ), parent->sector() ), - parent_( parent ), shotCount_( shotCounter), gun_( gun.gun() ), - damage_( gun.gun()->damage() ), maxLifeTime_( gun.gun()->lifeTime() ){ - selectable_ = false; - - beam_ = NULL; - bullet_ = NULL; - shape_ = NULL; - trail_ = NULL; - - maxRange_ = gun.gun()->speed() * maxLifeTime_; - - Ogre::Quaternion direction( parent_->mainNode()->getOrientation() ); - - vel_ = gun.gun()->speed() * -direction.zAxis().normalisedCopy() + parent->velocity(); - - Ogre::Vector3 relGunPos( ( gun.sceneNode().getParentSceneNode()->getOrientation() * gun.sceneNode().getPosition() ) * - gun.sceneNode().getParentSceneNode()->getParentSceneNode()->getScale() ); - - Ogre::Vector3 pos( gun.sceneNode()._getDerivedPosition() - direction.zAxis() * relGunPos[ 2 ] ); - -// std::cout << parent_->name() << std::endl; -// std::cout << pos << " " << relGunPos << std::endl; - fire( pos, relGunPos ); -} - -Projectile::~Projectile() { - if ( bullet_ ){ - mainNode_->detachObject( bullet_ ); - sceneMgr_->destroyBillboardSet( bullet_ ); - } - - if ( beam_ ){ - if ( shape_ ) { - shape_->detachObject( beam_ ); - mainNode_->removeAndDestroyChild( shape_->getName() ); - // sceneMgr_->destroySceneNode( shape_ ); - } - sceneMgr_->destroyManualObject( beam_ ); - } - if ( trail_ ) { - if ( shape_ ) { - trailNode_->detachObject( trail_ ); - sceneMgr_->getRootSceneNode()->removeAndDestroyChild( trailNode_->getName() ); - mainNode_->removeAndDestroyChild( shape_->getName() ); - } - sceneMgr_->destroyRibbonTrail( trail_ ); - } - - // mainNode_->detachObject( chain_ ); - // sceneMgr_->destroyBillboardChain( chain_ ); -} - -void Projectile::fire( const Ogre::Vector3 & pos, const Ogre::Vector3 & relGunPos ){ - Ogre::String bulletName( name_ + "_" + toStr( shotCount_ ) ); - - Ogre::Quaternion direction( parent_->mainNode()->getOrientation() ); - mainNode_->setOrientation( direction ); - mainNode_->setPosition( pos ); - //mainNode_->_update( true, true ); - - lifeTime_ = 0.0; - oldTime_ = 0.0; - ammoHit_ = false; - - switch ( gun_->type() ){ - case BULLET:{ - int maxBB = 20; - bullet_ = sceneMgr_->createBillboardSet( bulletName + "_BBS", maxBB ); - bullet_->setMaterialName("Bullet"); - - Ogre::Billboard *bb; - // bb = bullet_->createBillboard( Ogre::Vector3::ZERO, Ogre::ColourValue( 1.0f, 1.0f, 1.0f) ); - // bb->setDimensions( 1.0, 0.2 ); - // bb->setRotation ( Ogre::Radian( 0 ) ); - - for ( int i = 0; i < maxBB; i ++ ){ - bb = bullet_->createBillboard( Ogre::Vector3::ZERO, Ogre::ColourValue( 0.5f, 0.5f, 0.5f) ); - bb->setDimensions( 1.0 - i * 1.0/maxBB* 0.5 , 1.0 - i * 1.0/maxBB * 0.5 ); - bb->setRotation ( Ogre::Radian( i*10.0 ) ); - bb->setPosition( direction.zAxis().normalisedCopy() * i * 0.5 ); - } - mainNode_->attachObject( bullet_ ); - } break; - case LASER:{ - bool manuObject = false; - shape_ = mainNode_->createChildSceneNode( bulletName + "_transform" ); - if ( fabs( relGunPos[ 0 ] ) > 1e-3 ){ - shape_->roll( Ogre::Degree( 0.0 ) ); - } else { - shape_->roll( Ogre::Radian( atan( relGunPos[ 1 ] / relGunPos[ 0 ] ) ) ); - } - - if ( manuObject ){ -// std::cout << "createManualObject" << std::endl; - beam_ = sceneMgr_->createManualObject( bulletName + "_ManualObj" ); - Ogre::Real width = 0.25; - beam_->begin( "BeamGreen", Ogre::RenderOperation::OT_TRIANGLE_LIST); - beam_->position( 0.0, -width, 0.0 ); beam_->textureCoord( 0, 0 ); - beam_->position( 0.0, width, 0.0 ); beam_->textureCoord( 1, 0 ); - beam_->position( 0.0, width, 1.0 ); beam_->textureCoord( 1, 1 ); - beam_->position( 0.0, -width, 1.0 ); beam_->textureCoord( 0, 1 ); - beam_->quad( 0, 1, 2, 3 ); - beam_->quad( 0, 3, 2, 1 ); - beam_->end(); - shape_->attachObject( beam_ ); - } else { -// std::cout << "createRibbonTrail" << std::endl; - trail_ = sceneMgr_->createRibbonTrail( bulletName + "_RibbonTrail"); - trail_->setMaterialName( "BeamGreen" ); - trail_->setTrailLength( maxRange_ ); - trail_->setWidthChange( 0, 2.0 ); - trail_->setMaxChainElements( 1000 ); - trail_->setInitialWidth( 0, 1.0 ); - trail_->addNode( mainNode_ ); - trailNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode(); - trailNode_->attachObject( trail_ ); - } - } break; - case MININGLASER: { - } break; - case UNKNOWN: { - LogManager::getSingleton().warn( "guntype unknown: " + toStr( gun_->type() ) + " Forced bullet." ); - } break; - - } //switch gun_->type -} - -void Projectile::collide( BaseObject * object ){ - if ( name_ != object->name() ){ - - //** show us a small visible feedback; - if ( bullet_ ){ - vel_ *= 0.0; - bullet_->getBillboard( 0 )->setColour( Ogre::ColourValue(0.0, 1.0, 0.0) ); - bullet_->getBillboard( 0 )->setDimensions( 5, 5 ); - lifeTime_ = max( lifeTime_, maxLifeTime_ - 0.1f ); - } - } - ammoHit_ = true; - // sector_->sendVesselAmmoHit( *this, object ); -} - -bool Projectile::update( Ogre::Real elapsedTime ){ - if ( elapsedTime < 0.001 ) return true; - - lifeTime_ += elapsedTime; - if ( lifeTime_ >= maxLifeTime_ ) return false; - - if ( vel_.length() > 0.1 ){ - - if ( !ammoHit_ ){ - - Ogre::Ray bulletRay( mainNode_->getPosition(), vel_.normalisedCopy() ); - - if ( !ResourceManager::getSingleton().collisionManager->checkCollideRay( this, bulletRay, (vel_ * elapsedTime).length() ) ){ - mainNode_->translate( vel_ * elapsedTime ); - Ogre::Real beamLength = min( (vel_ * lifeTime_).length(), maxRange_ / 2.0f ); - Ogre::Real beamWidthScale = 1.0; - - if ( beam_ ){ -// if ( beamLength > 299.0f ) beamWidthScale = 1; - shape_->scale( 1.0, beamWidthScale, beamLength / shape_->getScale()[2] ); - } - if ( trail_ ){ - // trail_->setTrailLength( beamLength ); - } - } - } else { // if not ammoHit_ - Ogre::Real beamLength = min( (vel_ * lifeTime_).length(), maxRange_ / 2.0f ); - beamLength -= ( parent_->mainNode()->_getDerivedPosition() + ( vel_ * lifeTime_ ) - - mainNode_->_getDerivedPosition() ).length(); - - if ( beam_ ){ - if ( beamLength > 0 ){ - shape_->scale( 1.0, 1.0, beamLength / shape_->getScale()[ 2 ] ); - } - } else if ( trail_ ){ - trail_->setTrailLength( beamLength ); - } - } - } - return true; -} - -} //namespace OpenGate{ Deleted: trunk/src/Projectile.h =================================================================== --- trunk/src/Projectile.h 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/src/Projectile.h 2009-12-28 21:29:43 UTC (rev 1164) @@ -1,91 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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. * - ***************************************************************************/ - -#ifndef _OPENGATE_PROJECTILE__H -#define _OPENGATE_PROJECTILE__H - -#include "SectorObject.h" -#include <OgrePrerequisites.h> - -namespace OpenGate{ - -class GunObject; - -class Projectile : public BaseObject { -public: - Projectile( BaseObject * parent, long shotCount, Gun & gun, const Ogre::Vector3 & pos, const Ogre::Vector3 & vel ); - - Projectile( BaseObject * parent, long shotCount, const GunObject & gun, const Ogre::Vector3 & mountPoint ); - - virtual ~Projectile(); - - inline virtual long rtti() const { return PROJECTILE_RTTI; } - - //** taking default arg here, breaks pythonogre-generation, leads to TypeError: No to_python (by-value) converter found for C++ type: Ogre::Vector3 - void fire( const Ogre::Vector3 & pos, const Ogre::Vector3 & relGunPos ); - - void fire( const Ogre::Vector3 & pos ){ return fire( pos, Ogre::Vector3::ZERO ); } - - virtual void collide( BaseObject * object ); - - inline Uint32 damage( ) const { return damage_; } - - virtual bool update( Ogre::Real elapsedTime ); - - BaseObject * parent( ) { return parent_; } - - BaseObject & parent( ) const { return *parent_; } - - Ogre::Vector3 velocity() const { return vel_; } - - Ogre::Real lifeTime() const { return maxLifeTime_; } - - Uint16 shotCount() const { return shotCount_; } - - Gun * gun() const { return gun_; } - -protected: - - BaseObject * parent_; - Uint16 shotCount_; - Gun * gun_; - - Uint32 damage_; - Ogre::Real maxLifeTime_; - Ogre::Vector3 vel_; - - // Ogre::BillboardChain * chain_; - Ogre::BillboardSet * bullet_; - Ogre::ManualObject * beam_; - Ogre::RibbonTrail * trail_; - Ogre::SceneNode * trailNode_; - - Ogre::SceneNode * shape_; - - Ogre::Real oldTime_; - Ogre::Real maxRange_; - bool ammoHit_; -}; - - -} // namespace OpenGate - - -#endif // _OPENGATE_PROJECTILE__H Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/src/Sector.cpp 2009-12-28 21:29:43 UTC (rev 1164) @@ -415,15 +415,21 @@ //! create Planet SectorPlanetObject *planet = new SectorPlanetObject( "planet", this ); - //, Ogre::Vector3( 0000.0, 0000.0, 50000 ), 15000.0f, 64 ); - //planet_->lighting( true ); sectorEnvironment_.insert( planet ); - SectorSpaceDustObject *spaceDust = new SectorSpaceDustObject( this, listener()->mainCameraNode() ); - sectorEnvironment_.insert( spaceDust ); + //planet_->lighting( true ); + if ( listener_ ) { + SectorSpaceDustObject *spaceDust = new SectorSpaceDustObject( this, listener_->mainCameraNode() ); + sectorEnvironment_.insert( spaceDust ); + } + SectorStarfieldObject *starfield = new SectorStarfieldObject( this ); sectorEnvironment_.insert( starfield ); + + SectorSunObject *sun = new SectorSunObject( this ); + sectorEnvironment_.insert( sun ); + return; } Modified: trunk/src/SectorEnvironmentObject.cpp =================================================================== --- trunk/src/SectorEnvironmentObject.cpp 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/src/SectorEnvironmentObject.cpp 2009-12-28 21:29:43 UTC (rev 1164) @@ -79,18 +79,10 @@ cloudNode_->attachObject( cloudEntity_ ); cloudNode_->scale(1.015, 1.015, 1.015); - light_ = sector_->sceneManager()->createLight( name + "-light"); - light_->setDiffuseColour( 0.1, 0.1, 0.1 ); - light_->setSpecularColour( 0.4, 0.4, 0.4 ); - mainNode_->attachObject( light_ ); - light_->setVisible( true ); } SectorPlanetObject::~SectorPlanetObject( ){ - mainNode_->detachObject( light_ ); - sector_->sceneManager()->destroyLight( light_->getName() ); - if ( cloudNode_ ){ if ( cloudEntity_ ){ cloudNode_->detachObject( cloudEntity_ ); @@ -325,7 +317,9 @@ } bool SectorStarfieldObject::update( Ogre::Real elapsedTime ){ - mainNode_->setPosition( sector_->avatarObject()->mainNode()->getPosition() ); + if ( sector_->avatarObject() ){ + mainNode_->setPosition( sector_->avatarObject()->mainNode()->getPosition() ); + } return true; } @@ -370,6 +364,43 @@ return true; } +SectorSunObject::SectorSunObject( Sector * sector, Ogre::SceneNode * parentNode ) + : SectorEnvironmentObject( "Sun", sector, parentNode ){ + + lightNode_ = mainNode_->createChildSceneNode( "Sun/LightNode" ); + bs_ = sector_->sceneManager()->createBillboardSet( "Sun" ); + bs_->setMaterialName( "OpenGate/Sun" ); + //bs_->setRenderQueueGroup( Ogre::RENDER_QUEUE_BACKGROUND ); + bs_->setRenderQueueGroup( Ogre::RENDER_QUEUE_SKIES_EARLY ); + Ogre::Billboard *bb = bs_->createBillboard( Ogre::Vector3::ZERO, Ogre::ColourValue( 1.0f, 1.0f, 1.0f) ); + bb->setDimensions( 10000.0, 10000.0 ); + + light_ = sector_->sceneManager()->createLight( "Sun-light"); + light_->setDiffuseColour( 0.1, 0.1, 0.1 ); + light_->setSpecularColour( 0.4, 0.4, 0.4 ); + light_->setVisible( true ); + + lightNode_->attachObject( bs_ ); + lightNode_->attachObject( light_ ); + + lightNode_->setPosition( 50000.0, 0.0, 0.0 ); + //bs_->setPosition( 5000.0, 0.0, 0.0 ); +} + +SectorSunObject::~SectorSunObject( ){ + lightNode_->detachObject( light_ ); + lightNode_->getCreator()->destroyLight( light_->getName() ); + lightNode_->detachObject( bs_ ); + lightNode_->getCreator()->destroyBillboardSet( bs_ ); + mainNode_->removeAndDestroyChild( lightNode_->getName() ); +} + +bool SectorSunObject::update( Ogre::Real elapsedTime ){ + mainNode_->roll( Ogre::Degree( 0.2 * elapsedTime ) ); + return true; +} + + // if ( !1 ) { // planetNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( "PlanetNode" ); // Modified: trunk/src/SectorEnvironmentObject.h =================================================================== --- trunk/src/SectorEnvironmentObject.h 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/src/SectorEnvironmentObject.h 2009-12-28 21:29:43 UTC (rev 1164) @@ -60,7 +60,6 @@ Ogre::SceneNode * cloudNode_; Ogre::Entity * cloudEntity_; Ogre::Entity * entity_; - Ogre::Light * light_; }; class SectorEclipticObject : public SectorEnvironmentObject{ @@ -102,6 +101,24 @@ Ogre::BillboardSet * bs_; }; + +class SectorSunObject : public SectorEnvironmentObject{ +public: + SectorSunObject( Sector * sector, Ogre::SceneNode * parentNode = NULL ); + + ~SectorSunObject( ); + + virtual bool update( Ogre::Real elapsedTime ); + + Ogre::Light * light( ) { return light_; } + +protected: + Ogre::SceneNode * lightNode_; + Ogre::BillboardSet * bs_; + Ogre::Light * light_; +}; + + // class SectorSpaceDecorationObject : public SectorEnvironmentObject{ // }; Modified: trunk/src/UnDockedState.cpp =================================================================== --- trunk/src/UnDockedState.cpp 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/src/UnDockedState.cpp 2009-12-28 21:29:43 UTC (rev 1164) @@ -81,10 +81,10 @@ //** create Ogre sceneManager sceneMgr_ = root_->createSceneManager( Ogre::ST_GENERIC, "UnDockedSceneManagerInstance" ); - + //** initialise collosion Manager resources_->collisionManager->init( sceneMgr_ ); - + //** create cameras mainCamera_ = sceneMgr_->createCamera( "MainCamera" ); mainCamera_->setNearClipDistance( 1 ); @@ -93,8 +93,8 @@ secondCamera_ = sceneMgr_->createCamera( "SecondCamera" ); secondCamera_->setNearClipDistance( 1 ); - overlayRootWindow_ = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"opengateUnDocked.layout"); - + overlayRootWindow_ = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"opengateUnDocked.layout"); + //** this should be directly associated to the sector, MOVE this soundBackround_ = OpenALSoundManager::getSingleton().createSoundSourceFromRessource( "sounds/undocked/defaultMusic", "sectorBackground", true, true ); @@ -113,35 +113,35 @@ log_->info( "Entering " + this->name() ); try { //** load CEGUI-HUD layout - + resources_->guiRenderer->setTargetSceneManager( sceneMgr_ ); if ( overlayRootWindow_ ){ resources_->guiSystem->setGUISheet( overlayRootWindow_ ); overlayRootWindow_->show(); } - + sector_ = new Sector( sceneMgr_, network_ ); sector_->setListener( this ); sector_->populate( "test.sector" ); sector_->createAvatarObject( resources_->avatar ); - + hud_ = new Hud( overlayRootWindow_, sector_->avatarObject() ); radar_ = new RadarObject( sector_, hud_ ); - - + + } catch( Ogre::Exception& e ) { log_->fatal( e.getFullDescription().c_str() ); } catch( ... ){ - LogManager::getSingleton().warn( "UnDockedState::enter() -- Unknown exception" ); + LogManager::getSingleton().warn( "UnDockedState::enter() -- Unknown exception" ); } - - + + // CEGUI::MouseCursor::getSingleton().hide(); windowsWidth_ = resources_->renderWindow->getWidth( ); windowsHeight_ = resources_->renderWindow->getHeight( ); windowsHalfWidth_ = (int)( windowsWidth_ * 0.5 ); - windowsHalfHeight_ = (int)( windowsHeight_ * 0.5 ); - + windowsHalfHeight_ = (int)( windowsHeight_ * 0.5 ); + flightCursor_ = CEGUI::WindowManager::getSingleton().getWindow( "HUDFlightCursor" ); flightCursorHalfWidth_ = 10; flightCursorHalfHeight_ = 10; @@ -176,34 +176,34 @@ cameraRotateY_ = 0.0; cameraZoom_ = 75.0; cameraViewKey_ = 1; - - ambientLight_ = 2; + + ambientLight_ = 0; setAmbientLight_(); - schemeIdx_ = 0; + schemeIdx_ = 1; setScheme_(); aniso_ = 1; // filtering_ = Ogre::TFO_BILINEAR; - + if ( resources_->console ){ CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"ConsoleList__auto_vscrollbar__")->hide(); } setupEventHandlers(); - + if ( soundBackround_ ) soundBackround_->play(); minimiseConsole( ); toggleNextCamera_( 0 ); enterDockedState_ = false; - + this->showHud(); - + //** start update SceneManager, if not set this leeds to strange behaviour by switching states //** opengateclient: OgreRenderQueueSortingGrouping.cpp:355: void Ogre::QueuedRenderableCollection::addRenderable(Ogre::Pass*, Ogre::Renderable*): Assertion `retPair.second && "Error inserting new pass entry into PassGroupRenderableMap"' failed. - if ( resources_->ogreRoot() && - ( Ogre::Pass::getDirtyHashList().size() != 0 || + if ( resources_->ogreRoot() && + ( Ogre::Pass::getDirtyHashList().size() != 0 || Ogre::Pass::getPassGraveyard().size() != 0 ) ) { Ogre::SceneManagerEnumerator::SceneManagerIterator scenesIter = resources_->ogreRoot()->getSceneManagerIterator(); @@ -234,22 +234,21 @@ CEGUI::PushButton::EventClicked ) ; hideHud(); - + if ( resources_->console ) resources_->console->stop(); CEGUI::MouseCursor::getSingleton().show(); - + resources_->renderWindow->removeAllViewports(); - + resources_->inputManager->removeKeyListener( "SectorClientKeyListener" ); resources_->inputManager->removeMouseListener( "SectorClientMouseListener" ); resources_->inputManager->removeJoystickListener( "SectorClientJoystickListener" ); - + if ( radar_ ) { delete radar_; radar_ = NULL; } if ( hud_ ) { delete hud_; hud_ = NULL; } if ( sector_ ) { delete sector_; sector_ = NULL; } - - + overlayRootWindow_->hide(); resources_->guiRenderer->setTargetSceneManager( NULL ); // resources_->guiRenderer->setTargetSceneManager( sceneMgr_ ); @@ -265,7 +264,7 @@ if ( window_->isClosed() ) return false; timeSinceLastSectorUpdate_ += evt.timeSinceLastFrame; - + // max 1000 sector-updates/second if ( timeSinceLastSectorUpdate_ > 0.001 ){ sector_->update( timeSinceLastSectorUpdate_ * timeZoom_ ); @@ -274,9 +273,9 @@ //** update my camera; updateCamera_( evt.timeSinceLastFrame ); - + if ( radar_ ) radar_->update( evt.timeSinceLastFrame ); - + if ( hud_ ) hud_->update( evt.timeSinceLastFrame ); return true; @@ -297,7 +296,7 @@ configMode_ = resources_->gameStateRoot->configDialog()->isVisible(); if ( configMode_ ){ - + this->hideHud(); overlayRootWindow_->show(); CEGUI::MouseCursor::getSingleton().show(); @@ -328,8 +327,8 @@ } if ( !chatMode_ && !configMode_ ){ - if ( (this->*resources_->keymap()->unDockedKeyAction( e ))( true ) ) return true; - + if ( (this->*resources_->keymap()->unDockedKeyAction( e ))( true ) ) return true; + if ( e.key == OIS::KC_RETURN ) { CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"ConsoleEdit")->activate(); // hudOverlay_->getChild( overlayName_ + "/ChatIn" )->show( ); @@ -357,7 +356,7 @@ bool UnDockedState::keyReleased( const OIS::KeyEvent & e ){ if ( !configMode_ ){ if ( sector_->avatarObject() != NULL ){ - if ( ( this->*resources_->keymap()->unDockedKeyAction( e ) )( false ) ) return true; + if ( ( this->*resources_->keymap()->unDockedKeyAction( e ) )( false ) ) return true; } } return true; @@ -365,8 +364,11 @@ bool UnDockedState::mouseMoved( const OIS::MouseEvent & e ){ if ( !configMode_ ){ - - + + if ( fabs( e.state.X.rel > 10 ) || fabs( e.state.Y.rel > 10 ) ) { + timeZoom_ = 1.0; + } + flightCursorPos_[ 0 ] += e.state.X.rel; flightCursorPos_[ 1 ] += e.state.Y.rel; @@ -377,7 +379,7 @@ flightCursorPos_[ 1 ] = max ( flightCursorPos_[ 1 ], -flightCursorHalfHeight_ ); flightCursor_->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0, flightCursorPos_[ 0 ] ), - CEGUI::UDim( 0.0, flightCursorPos_[ 1 ] ) ) ); + CEGUI::UDim( 0.0, flightCursorPos_[ 1 ] ) ) ); // mousePointer_->setLeft( mousePointer_->getLeft( ) + e.state.X.rel ); // mousePointer_->setTop( mousePointer_->getTop( ) + e.state.Y.rel ); @@ -395,7 +397,7 @@ if ( sector_->avatarObject() != NULL ){ // std::cout << "X" << e.state.X.abs << " " << e.state.X.rel << std::endl; // std::cout << "Y" << e.state.Y.abs << " " << e.state.Y.rel << std::endl; - + // std::cout << "X" << e.state.X.abs << " " << e.state.X.rel << " " << mousePointer_->getLeft( ) << std::endl; // std::cout << "Y" << e.state.Y.abs << " " << e.state.Y.rel << " " << mousePointer_->getTop( ) << std::endl; // std::cout << "Z" << e.state.Z.abs << " " << e.state.Z.rel<< std::endl; @@ -413,22 +415,23 @@ double minRadius = ( windowsHeight_ / 2.0 ) * minActiveZonePercent / 100; double maxRadius = ( windowsHeight_ / 2.0 ) * maxActiveZonePercent / 100; - Ogre::Real yaw = 0, pitch = 0; - if ( relativToMidPointX < 0 ) { - yaw = (relativToMidPointX+minRadius) / (maxRadius - minRadius); - } else { - yaw = (relativToMidPointX-minRadius) / (maxRadius - minRadius); - } - if ( relativToMidPointY < 0 ) { - pitch = (relativToMidPointY + minRadius) / (maxRadius - minRadius); - } else { - pitch = (relativToMidPointY - minRadius) / (maxRadius - minRadius); - } + Ogre::Real yaw = 0, pitch = 0; + if ( relativToMidPointX < 0 ) { + yaw = (relativToMidPointX+minRadius) / (maxRadius - minRadius); + } else { + yaw = (relativToMidPointX-minRadius) / (maxRadius - minRadius); + } - if ( fabs( relativToMidPointX ) < minRadius ) yaw = 0.0; - if ( fabs( relativToMidPointY ) < minRadius ) pitch = 0.0; + if ( relativToMidPointY < 0 ) { + pitch = (relativToMidPointY + minRadius) / (maxRadius - minRadius); + } else { + pitch = (relativToMidPointY - minRadius) / (maxRadius - minRadius); + } - yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); + if ( fabs( relativToMidPointX ) < minRadius ) yaw = 0.0; + if ( fabs( relativToMidPointY ) < minRadius ) pitch = 0.0; + + yaw = min( yaw, 1.0f ); yaw = max( yaw, -1.0f ); pitch = min( pitch, 1.0f ); pitch = max( pitch, -1.0f ); // std::cout << ( String("Mouse rel: ") + StringConverter::toString( e.state.X.rel ) + @@ -462,12 +465,12 @@ if ( sector_->avatarObject() != NULL ){ switch ( id ){ case OIS::MB_Left: - sector_->avatarObject()->setFirePressed( true ); + sector_->avatarObject()->setFirePressed( true ); break; - case OIS::MB_Middle: + case OIS::MB_Middle: sector_->avatarObject()->fireMissile( ResourceManager::getSingleton().entityManager->missile( "Firefly" ), radar_->target() ); break; - case OIS::MB_Right: + case OIS::MB_Right: sector_->avatarObject()->fireMissile( ResourceManager::getSingleton().entityManager->missile( "bee" ), radar_->target() ); break; default: @@ -614,7 +617,7 @@ if ( sector_->avatarObject() != NULL ){ Ogre::Vector3 avatarPos( sector_->avatarObject()->mainNode()->getPosition() ); Ogre::Quaternion avatarOrient( sector_->avatarObject()->mainNode()->getOrientation() ); - + Ogre::Vector3 targetPos( 0.0, 0.0, 0.0 ); if ( radar_->target() != NULL ){ targetPos = radar_->target()->mainNode()->getPosition() ; @@ -703,7 +706,7 @@ // if ( sector_->avatarObject() ) sector_->avatarObject()->setTarget( target_ ); //if ( oldTarget ) sector_->avatarObject()->looseTarget( oldTarget ); - + // if ( hudTarget_->numChildren() > 0 ){ // hudTarget_->removeAllChildren( );// hudTarget_->getChild( "TargetTrans" ) ); // mainCamera_->getSceneManager()->destroyEntity( "TargetShape" ); @@ -795,7 +798,7 @@ minimiseConsole(); } } - return true; + return true; } bool UnDockedState::keyActionAvatarIncreaseYaw( bool pressed ){ @@ -868,14 +871,14 @@ bool UnDockedState::keyActionAvatarBreakPressed( bool pressed ){ if ( sector_->avatarObject() != NULL ){ - sector_->avatarObject()->setBrakePressed( pressed ); + sector_->avatarObject()->setBrakePressed( pressed ); } return true; } bool UnDockedState::keyActionAvatarAfterburnerPressed( bool pressed ){ if ( sector_->avatarObject() != NULL ){ - sector_->avatarObject()->setAfterburnerPressed( pressed ); + sector_->avatarObject()->setAfterburnerPressed( pressed ); } return true; } @@ -931,40 +934,40 @@ bool UnDockedState::keyActionCameraNormal( bool pressed ){ if ( pressed ){ - if ( cameraMode_ == 0 ) showHud(); - cameraViewKey_ = 1; + if ( cameraMode_ == 0 ) showHud(); + cameraViewKey_ = 1; } return true; } bool UnDockedState::keyActionCameraLeft( bool pressed ){ if ( pressed ){ - hideHud(); - cameraViewKey_ = 2; + hideHud(); + cameraViewKey_ = 2; } return true; } bool UnDockedState::keyActionCameraRight( bool pressed ){ if ( pressed ){ - hideHud(); - cameraViewKey_ = 3; + hideHud(); + cameraViewKey_ = 3; } return true; } bool UnDockedState::keyActionCameraUp( bool pressed ){ if ( pressed ){ - hideHud(); - cameraViewKey_ = 4; + hideHud(); + cameraViewKey_ = 4; } return true; } bool UnDockedState::keyActionCameraDown( bool pressed ){ if ( pressed ){ - hideHud(); - cameraViewKey_ = 5; + hideHud(); + cameraViewKey_ = 5; } return true; } @@ -1064,7 +1067,7 @@ } bool UnDockedState::keyActionAvatarChangeDockedState_DEV( bool pressed ){ - if ( pressed ) changeToDockedState(); + if ( pressed ) changeToDockedState(); return true; } @@ -1104,7 +1107,7 @@ // std::find_if( c.begin(),c.end(), std::compose1( std::mem_fun( &class::meth ), std::bind2nd( std::equal_to< T>(), Tcomp ) ) ); // std::find_if( c.begin(),c.end(), boost::bind( std::equal_to< T >(), Tcomp, boost::bind( &class::meth, _1 ) ) ); // std::find_if( c.begin(),c.end(), boost::bind( &class::meth, _1 ) == Tcomp ); - + //it = std::find_if( se.begin(), se.end(), boost::bind( std::equal_to< std::string >(), "planet", boost::bind(&SectorEnvironmentObject::name,_1 ) ) ); it = std::find_if( se.begin(), se.end(), boost::bind( &SectorEnvironmentObject::name, _1 ) == "planet" ); std::cout << "search planet" << std::endl; @@ -1132,11 +1135,11 @@ std::cout << " scale cloud 1/1.005 " << std::endl; dynamic_cast< SectorPlanetObject * >(*it)->cloudNode()->scale( 1./ 1.005, 1./1.005, 1./1.005 ) ; } - + } return true; } - + bool UnDockedState::maximiseConsole( ){ if ( overlayRootWindow_ ){ CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"UnDocked/MainWindow/ConsoleFrame")-> @@ -1168,8 +1171,7 @@ Ogre::Viewport * vp = window_->getViewport( i ); switch ( schemeIdx_ ){ case 0: vp->setMaterialScheme( "Default" ); break; - case 1: vp->setMaterialScheme( "vpOnly" ); break; - case 2: vp->setMaterialScheme( "vpfp" ); break; + case 1: vp->setMaterialScheme( "vpfp" ); break; } } Modified: trunk/src/common.cpp =================================================================== --- trunk/src/common.cpp 2009-12-26 20:44:55 UTC (rev 1163) +++ trunk/src/common.cpp 2009-12-28 21:29:43 UTC (rev 1164) @@ -21,7 +21,7 @@ #include "common.h" namespace OpenGate{ - + void myMSleep( int ms ) { #ifdef WIN32 Sleep( ms ); @@ -31,39 +31,39 @@ } std::vector < std::string > getSubstrings( const std::string & str ){ - std::vector < std::string > subStrings; - std::istringstream is( str ); - std::string tmp; - while ( is >> tmp ) subStrings.push_back( tmp ); - return subStrings; + std::vector < std::string > subStrings; + std::istringstream is( str ); + std::string tmp; + while ( is >> tmp ) subStrings.push_back( tmp ); + return subStrings; } std::vector < std::string > getRowSubstrings( std::fstream & file, char comment ){ - std::vector < std::string > subStrings; - std::string str, tmp; - getline( file, str ); + std::vector < std::string > subStrings; + std::string str, tmp; + getline( file, str ); - std::istringstream is( str.substr( 0, str.find( comment ) ) ); - while ( is >> tmp ) subStrings.push_back( tmp ); - return subStrings; + std::istringstream is( str.substr( 0, str.find( comment ) ) ); + while ( is >> tmp ) subStrings.push_back( tmp ); + return subStrings; } std::vector < float > toVector3( const std::string & vecStr, const char delimiter ){ std::vector < float > vect( 3, 0.0 ); int pos = 0, nextPos = 0, count = 0; - std::string str; + std::string str; while ( ( nextPos = vecStr.find( delimiter, pos ) ) != (int)std::string::npos ){ str = vecStr.substr( pos, nextPos-pos ); if ( str.size() > 0 ){ - vect[ co... [truncated message content] |
From: <spo...@us...> - 2009-12-31 12:43:21
|
Revision: 1165 http://opengate.svn.sourceforge.net/opengate/?rev=1165&view=rev Author: spom_spom Date: 2009-12-31 12:20:57 +0000 (Thu, 31 Dec 2009) Log Message: ----------- Add missing xml-key for cegui-layout files Modified Paths: -------------- branches/ogEditor/ogEditor/apps/opengate/ceguiLayoutApp.py branches/ogEditor/ogEditor/apps/opengate/opengateedit.py branches/ogEditor/ogEditor/apps/opengate/test/testOpengate.py branches/ogEditor/ogEditor/wxpg/wxPropGridWrapper.py trunk/data/gui/layouts/dialogs/ConfigControlKey.layout trunk/data/gui/layouts/dialogs/ConfigDialog.layout trunk/data/gui/layouts/dialogs/MarketDialog.layout trunk/data/gui/layouts/dialogs/MarketItemShortDialog.layout trunk/data/gui/layouts/dialogs/ShipConfigDialog.layout trunk/data/gui/layouts/dialogs/ShipConfigEquipmentButton.layout trunk/data/gui/layouts/opengateConsole.layout trunk/data/gui/layouts/opengateDocked.layout trunk/data/gui/layouts/opengateUnDocked.layout trunk/data/materials/planet.cg trunk/data/materials/planet.material trunk/data/materials/station.material trunk/data/misc/test.sector trunk/data/ships/octavius/apteryx/apteryx.material trunk/data/skybox/skybox.material trunk/src/SectorEnvironmentObject.cpp trunk/src/SectorStationObject.cpp Modified: branches/ogEditor/ogEditor/apps/opengate/ceguiLayoutApp.py =================================================================== --- branches/ogEditor/ogEditor/apps/opengate/ceguiLayoutApp.py 2009-12-28 21:29:43 UTC (rev 1164) +++ branches/ogEditor/ogEditor/apps/opengate/ceguiLayoutApp.py 2009-12-31 12:20:57 UTC (rev 1165) @@ -291,7 +291,9 @@ outfile = open( self.fullFileName, "w" ) xml = XMLSerializer( outfile ) + xml.openTag( 'GUILayout' ) self.window.writeXML( xml ) + xml.closeTag( ) outfile.close() self.toolBar_.EnableTool( self.tbSave.GetId(), False ) self.toolBar_.Refresh() Modified: branches/ogEditor/ogEditor/apps/opengate/opengateedit.py =================================================================== --- branches/ogEditor/ogEditor/apps/opengate/opengateedit.py 2009-12-28 21:29:43 UTC (rev 1164) +++ branches/ogEditor/ogEditor/apps/opengate/opengateedit.py 2009-12-31 12:20:57 UTC (rev 1165) @@ -33,9 +33,10 @@ def toOgreColour( colour ): return ogre.ColourValue( colour[0]/255.0, colour[1]/255.0, colour[2]/255.0) +def toWxColour( colour ): return wx.Colour( int( colour[0]*255.0 ), int( colour[1]*255.0 ), int( colour[2]*255.0) ) +def toList( vec ): return [vec[0], vec[1], vec[2] ]; +def toOgreVector3( string ): v = string[1:-1].split(','); return ogre.Vector3( float( v[ 0 ] ), float( v[ 1 ] ), float( v[2] ) ) -def toWxColour( colour ): print colour; return wx.Colour( int( colour[0]*255.0 ), int( colour[1]*255.0 ), int( colour[2]*255.0) ) - class OgreMoveableItem( AppResource ): def __init__( self, parent, rendererSlot, propertyInspectorSlot ): AppResource.__init__( self, parent, rendererSlot, propertyInspectorSlot ) @@ -89,28 +90,24 @@ panel.append( prop, None ) prop = wxpg.ColourProperty( name = mat.getName() + "Tech"+str(i)+"P"+str( j )+"setAmbient" , label = "setAmbient", value = toWxColour( pas.getAmbient() ) ) - panel.append( prop, cback = [self.setColour, pas.setAmbient ] + panel.append( prop, cback = ( pas.setAmbient, toOgreColour ) , toolTip = "Sets the ambient colour reflectance properties for every Pass in every Technique.") prop = wxpg.ColourProperty( name = mat.getName() + "Tech"+str(i)+"P"+str( j )+"setDiffuse" , label = "setDiffuse", value = toWxColour( pas.getDiffuse() ) ) - panel.append( prop, cback = [self.setColour, pas.setDiffuse ] + panel.append( prop, cback = ( pas.setDiffuse, toOgreColour ) , toolTip = "Sets the diffuse colour reflectance properties of every Pass in every Technique.") prop = wxpg.ColourProperty( name = mat.getName() + "Tech"+str(i)+"P"+str( j )+"setSpecular" , label = "setSpecular", value = toWxColour( pas.getSpecular() ) ) - panel.append( prop, cback = [self.setColour, pas.setSpecular ] + panel.append( prop, cback = ( pas.setSpecular, toOgreColour ) , toolTip = "Sets the specular colour reflectance properties of every Pass in every Technique." ) prop = wxpg.ColourProperty( name = mat.getName() + "Tech"+str(i)+"P"+str( j )+"setSelfIllumination" , label = "setSelfIllumination", value = toWxColour( pas.getSelfIllumination() ) ) - panel.append( prop, cback = [self.setColour, pas.setSelfIllumination ] + panel.append( prop, cback = ( pas.setSelfIllumination, toOgreColour ) , toolTip = "Sets the amount of self-illumination an object has." ) - def setColour( self, name, value, string, args ): - print "setColour", name, value, string, args - args[ 1 ]( toOgreColour( value ) ) - def setMovable( self, obj ): self.obj_ = obj if hasattr( obj, 'getMovableType' ): @@ -134,6 +131,46 @@ self.node_ = node self.dumpSceneNode_( node ) + def createPropertyPanel( self, parent ): + if not HAVE_PROPGRID: + return wx.Panel( parent ) + + panel = wxPropGridWrapper( parent ) + panel.Append( wxpg.PropertyCategory( "Ogre.SceneNode" ) ) + + node = self.node_ + prop = wxpg.StringProperty( name = node.getName() + "Name" + , label = "Name", value = node.getName() ) + panel.append( prop, None, toolTip = "Name of the node" ) + + prop = wxpg.BoolProperty( name = node.getName() + "Visibility", label = "Visibile" ) + prop.DoSetAttribute( 'UseCheckbox', 1 ) + prop.DoSetAttribute( 'UseDClickCycling', 1 ) + panel.append( prop, node.setVisible, toolTip = "Make all objects attached to this node become visible / invisible." ) + + prop = wxpg.BoolProperty( name = node.getName() + "ShowBoundingbox", label = "BoundingBox" + , value = node.getShowBoundingBox() ) + prop.DoSetAttribute( 'UseCheckbox', 1 ) + prop.DoSetAttribute( 'UseDClickCycling', 1 ) + panel.append( prop, node.showBoundingBox, toolTip = "Allows the showing of the node's bounding box" ) + + prop = wxpg.StringProperty( name = node.getName() + "Position" + , label = "Position", value = str( toList( node.getPosition() ) ) ) + panel.append( prop, cback = ( node.setPosition, toOgreVector3 ), toolTip = "Sets the position of the node relative to it's parent." ) + + prop = wxpg.StringProperty( name = node.getName() + "Scale" + , label = "Scale", value = str( toList( node.getScale() ) ) ) + panel.append( prop, cback = ( node.setScale, toOgreVector3 ), toolTip = "Sets the scaling factor applied to this node." ) + + #node.setPosition( [2000.0, 0.0, 4000.0 ]) + #setScale (const Vector3 &scale) + + #yaw (const Radian &angle, TransformSpace relativeTo=TS_LOCAL) + #roll (const Radian &angle, TransformSpace relativeTo=TS_LOCAL) + #pitch (const Radian &angle, TransformSpace relativeTo=TS_LOCAL) + return panel + + def dumpSceneNode_( self, scenenode ): tree = self.parent.resourceTree; if scenenode is None: Modified: branches/ogEditor/ogEditor/apps/opengate/test/testOpengate.py =================================================================== --- branches/ogEditor/ogEditor/apps/opengate/test/testOpengate.py 2009-12-28 21:29:43 UTC (rev 1164) +++ branches/ogEditor/ogEditor/apps/opengate/test/testOpengate.py 2009-12-31 12:20:57 UTC (rev 1165) @@ -17,4 +17,5 @@ print foo.vec() foo.setNode( node ) print foo.node().getName() -print dir(og) \ No newline at end of file +print dir(og) + Modified: branches/ogEditor/ogEditor/wxpg/wxPropGridWrapper.py =================================================================== --- branches/ogEditor/ogEditor/wxpg/wxPropGridWrapper.py 2009-12-28 21:29:43 UTC (rev 1164) +++ branches/ogEditor/ogEditor/wxpg/wxPropGridWrapper.py 2009-12-31 12:20:57 UTC (rev 1165) @@ -35,11 +35,16 @@ print "GetValue", p.GetValue() #print "GetValueRef", p.GetValueRef() if p.GetClientData(): - if type( p.GetClientData() ) == list: + if type( p.GetClientData() ) == tuple: + p.GetClientData()[0]( p.GetClientData()[1]( p.GetValue() ) ) + elif type( p.GetClientData() ) == list: p.GetClientData()[0]( name = p.GetName(), value = p.GetValue(), string = p.GetValueAsString() , args = p.GetClientData() ) else: try: - p.GetClientData()( name = p.GetName(), value = p.GetValue(), string = p.GetValueAsString() ) + p.GetClientData()( p.GetValue() ) except: - p.GetClientData()( name = p.GetName(), value = p.GetValue() ) \ No newline at end of file + try: + p.GetClientData()( name = p.GetName(), value = p.GetValue(), string = p.GetValueAsString() ) + except: + p.GetClientData()( name = p.GetName(), value = p.GetValue() ) \ No newline at end of file Modified: trunk/data/gui/layouts/dialogs/ConfigControlKey.layout =================================================================== --- trunk/data/gui/layouts/dialogs/ConfigControlKey.layout 2009-12-28 21:29:43 UTC (rev 1164) +++ trunk/data/gui/layouts/dialogs/ConfigControlKey.layout 2009-12-31 12:20:57 UTC (rev 1165) @@ -1,73 +1,79 @@ <?xml version="1.0" encoding="UTF-8"?> -<Window Type="opengate/StaticFrame" Name="Config/Controls/Key" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Image" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> - <Property Name="UnifiedSize" Value="{{0,400},{0,30}}" /> - <Window Type="opengate/StaticTextLabel" Name="Config/Controls/Key/Name" > +<GUILayout > + <Window Type="opengate/StaticFrame" Name="Config/Controls/Key" > <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="KeyName" /> + <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> <Property Name="RiseOnClick" Value="True" /> <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-14" /> - <Property Name="NormalTextColour" Value="FF88D997" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="LeftAligned" /> - <Property Name="UnifiedPosition" Value="{{0,10},{0,0}}" /> - <Property Name="UnifiedSize" Value="{{1,-210},{1,0}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/Controls/Key/KeyButton1" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Key 1" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="NormalTextColour" Value="FFFFFFFF" /> - <Property Name="HoverTextColour" Value="FFFFFFFF" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="CentreAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{1,-205},{0,5}}" /> - <Property Name="UnifiedSize" Value="{{0,100},{1,-10}}" /> + <Property Name="Image" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{0,400},{0,30}}" /> + <Window Type="opengate/StaticTextLabel" Name="Config/Controls/Key/Name" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="KeyName" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-14" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="LeftAligned" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,10},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,-210},{1,0}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/Controls/Key/KeyButton1" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Key 1" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{1,-205},{0,5}}" /> + <Property Name="UnifiedSize" Value="{{0,100},{1,-10}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/Controls/Key/KeyButton2" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Key 2" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{1,-100},{0,5}}" /> + <Property Name="UnifiedSize" Value="{{0,100},{1,-10}}" /> + </Window> </Window> - <Window Type="opengate/Button" Name="Config/Controls/Key/KeyButton2" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Key 2" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="NormalTextColour" Value="FFFFFFFF" /> - <Property Name="HoverTextColour" Value="FFFFFFFF" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="CentreAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{1,-100},{0,5}}" /> - <Property Name="UnifiedSize" Value="{{0,100},{1,-10}}" /> - </Window> -</Window> \ No newline at end of file +</GUILayout> \ No newline at end of file Modified: trunk/data/gui/layouts/dialogs/ConfigDialog.layout =================================================================== --- trunk/data/gui/layouts/dialogs/ConfigDialog.layout 2009-12-28 21:29:43 UTC (rev 1164) +++ trunk/data/gui/layouts/dialogs/ConfigDialog.layout 2009-12-31 12:20:57 UTC (rev 1165) @@ -1,283 +1,239 @@ <?xml version="1.0" encoding="UTF-8"?> -<Window Type="opengate/StaticImage" Name="Config/Main" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="InheritsAlpha" Value="False" /> - <Property Name="BackgroundEnabled" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Image" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> - <Property Name="UnifiedSize" Value="{{1,0},{1,0}}" /> - <Window Type="opengate/StaticImage" Name="Config/WindowFrameLeft" > +<GUILayout > + <Window Type="opengate/StaticImage" Name="Config/Main" > <Property Name="Visible" Value="True" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="False" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Image" Value="set:opengateConfigWindow image:ConfigWindowFrameLeft" /> - <Property Name="UnifiedPosition" Value="{{0,20},{0,20}}" /> - <Property Name="UnifiedSize" Value="{{0,122},{0,705}}" /> - </Window> - <Window Type="opengate/StaticImage" Name="Config/WindowFrameMiddle" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="False" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Image" Value="set:opengateConfigWindow image:ConfigWindowFrameMiddle" /> - <Property Name="UnifiedPosition" Value="{{0,142},{0,20}}" /> - <Property Name="UnifiedSize" Value="{{1,-417},{0,705}}" /> - </Window> - <Window Type="opengate/StaticImage" Name="Config/WindowFrameRight" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="False" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Image" Value="set:opengateConfigWindow image:ConfigWindowFrameRight" /> - <Property Name="UnifiedPosition" Value="{{1,-275},{0,20}}" /> - <Property Name="UnifiedSize" Value="{{0,255},{0,705}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/ConnectButton" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Connection" /> - <Property Name="Disabled" Value="True" /> <Property Name="RiseOnClick" Value="True" /> <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="NormalTextColour" Value="FFFFFFFF" /> - <Property Name="HoverTextColour" Value="FFFFFFFF" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="CentreAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,100},{0,150}}" /> - <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/VideoButton" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Video" /> - <Property Name="Disabled" Value="True" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="NormalTextColour" Value="FFFFFFFF" /> - <Property Name="HoverTextColour" Value="FFFFFFFF" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="CentreAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,190},{0,150}}" /> - <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/GraphicButton" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Graphics" /> - <Property Name="Disabled" Value="True" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="NormalTextColour" Value="FFFFFFFF" /> - <Property Name="HoverTextColour" Value="FFFFFFFF" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="CentreAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,280},{0,150}}" /> - <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/SoundButton" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Sound" /> - <Property Name="Disabled" Value="True" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="NormalTextColour" Value="FFFFFFFF" /> - <Property Name="HoverTextColour" Value="FFFFFFFF" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="CentreAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,460},{0,150}}" /> - <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/ControlsButton" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Controls" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="NormalTextColour" Value="FFFFFFFF" /> - <Property Name="HoverTextColour" Value="FFFFFFFF" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="CentreAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,370},{0,150}}" /> - <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/CreditsButton" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Credits" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="True" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="NormalTextColour" Value="FFFFFFFF" /> - <Property Name="HoverTextColour" Value="FFFFFFFF" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="CentreAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{1,-150},{0,150}}" /> - <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/QuitButton" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Quit" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="True" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="NormalTextColour" Value="FFFFFFFF" /> - <Property Name="HoverTextColour" Value="FFFFFFFF" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="CentreAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{1,-150},{0,670}}" /> - <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> - </Window> - <Window Type="opengate/Button" Name="Config/BackButton" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Back" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="True" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="NormalTextColour" Value="FFFFFFFF" /> - <Property Name="HoverTextColour" Value="FFFFFFFF" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="CentreAligned" /> - <Property Name="HorzLabelFormatting" Value="CentreAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,100},{0,670}}" /> - <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> - </Window> - <Window Type="opengate/StaticFrame" Name="Config/Credits" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> <Property Name="FrameEnabled" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="False" /> + <Property Name="BackgroundEnabled" Value="True" /> <Property Name="MousePassThroughEnabled" Value="False" /> <Property Name="Font" Value="BlueHighway-12" /> <Property Name="Image" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,100},{0,200}}" /> - <Property Name="UnifiedSize" Value="{{1,-180},{0,450}}" /> - <Window Type="opengate/StaticTextLabel" Name="Config/Credits/Header" > + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{1,0}}" /> + <Window Type="opengate/StaticImage" Name="Config/WindowFrameLeft" > <Property Name="Visible" Value="True" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="set:opengateConfigWindow image:ConfigWindowFrameLeft" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,20},{0,20}}" /> + <Property Name="UnifiedSize" Value="{{0,122},{0,705}}" /> + </Window> + <Window Type="opengate/StaticImage" Name="Config/WindowFrameMiddle" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="set:opengateConfigWindow image:ConfigWindowFrameMiddle" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,142},{0,20}}" /> + <Property Name="UnifiedSize" Value="{{1,-417},{0,705}}" /> + </Window> + <Window Type="opengate/StaticImage" Name="Config/WindowFrameRight" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="False" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="set:opengateConfigWindow image:ConfigWindowFrameRight" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{1,-275},{0,20}}" /> + <Property Name="UnifiedSize" Value="{{0,255},{0,705}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/ConnectButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Connection" /> + <Property Name="Disabled" Value="True" /> <Property Name="RiseOnClick" Value="True" /> <Property Name="AlwaysOnTop" Value="False" /> <Property Name="InheritsAlpha" Value="True" /> <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-18" /> - <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="LeftAligned" /> - <Property Name="HorzLabelFormatting" Value="TopAligned" /> - <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> - <Property Name="UnifiedSize" Value="{{1,0},{0,30}}" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,150}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> </Window> - <Window Type="opengate/ConsoleListbox" Name="Config/Credits/Body" > + <Window Type="opengate/Button" Name="Config/VideoButton" > <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="" /> + <Property Name="Text" Value="Video" /> + <Property Name="Disabled" Value="True" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,190},{0,150}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/GraphicButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Graphics" /> + <Property Name="Disabled" Value="True" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,280},{0,150}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/SoundButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Sound" /> + <Property Name="Disabled" Value="True" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,460},{0,150}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/ControlsButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Controls" /> <Property Name="Disabled" Value="False" /> <Property Name="RiseOnClick" Value="True" /> <Property Name="AlwaysOnTop" Value="False" /> <Property Name="InheritsAlpha" Value="True" /> <Property Name="MousePassThroughEnabled" Value="False" /> <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="UnifiedPosition" Value="{{0,0},{0,35}}" /> - <Property Name="UnifiedSize" Value="{{1,0},{1,-35}}" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,370},{0,150}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> </Window> - </Window> - <Window Type="opengate/StaticFrame" Name="Config/Controls" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Image" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,100},{0,200}}" /> - <Property Name="UnifiedSize" Value="{{1,-180},{0,450}}" /> - <Window Type="opengate/StaticFrame" Name="Config/Controls/Header" > + <Window Type="opengate/Button" Name="Config/CreditsButton" > <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Credits" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="True" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{1,-150},{0,150}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/QuitButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Quit" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="True" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{1,-150},{0,670}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/Button" Name="Config/BackButton" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Back" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="True" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="NormalTextColour" Value="FFFFFFFF" /> + <Property Name="HoverTextColour" Value="FFFFFFFF" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="CentreAligned" /> + <Property Name="HorzLabelFormatting" Value="CentreAligned" /> + <Property Name="HoverImage" Value="" /> + <Property Name="NormalImage" Value="" /> + <Property Name="PushedImage" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,670}}" /> + <Property Name="UnifiedSize" Value="{{0,70},{0,30}}" /> + </Window> + <Window Type="opengate/StaticFrame" Name="Config/Credits" > + <Property Name="Visible" Value="True" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> <Property Name="RiseOnClick" Value="True" /> @@ -288,10 +244,41 @@ <Property Name="MousePassThroughEnabled" Value="False" /> <Property Name="Font" Value="BlueHighway-12" /> <Property Name="Image" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> - <Property Name="UnifiedSize" Value="{{1,0},{0,35}}" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,200}}" /> + <Property Name="UnifiedSize" Value="{{1,-180},{0,450}}" /> + <Window Type="opengate/StaticTextLabel" Name="Config/Credits/Header" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-18" /> + <Property Name="NormalTextColour" Value="FF88D997" /> + <Property Name="DisabledTextColour" Value="FF7F7F7F" /> + <Property Name="VertLabelFormatting" Value="LeftAligned" /> + <Property Name="HorzLabelFormatting" Value="TopAligned" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{0,30}}" /> + </Window> + <Window Type="opengate/ConsoleListbox" Name="Config/Credits/Body" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,35}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{1,-35}}" /> + </Window> </Window> - <Window Type="opengate/StaticFrame" Name="Config/Controls/Body" > + <Window Type="opengate/StaticFrame" Name="Config/Controls" > <Property Name="Visible" Value="True" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> @@ -303,8 +290,41 @@ <Property Name="MousePassThroughEnabled" Value="False" /> <Property Name="Font" Value="BlueHighway-12" /> <Property Name="Image" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,0},{0,35}}" /> - <Property Name="UnifiedSize" Value="{{1,0},{1,-35}}" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,200}}" /> + <Property Name="UnifiedSize" Value="{{1,-180},{0,450}}" /> + <Window Type="opengate/StaticFrame" Name="Config/Controls/Header" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{0,35}}" /> + </Window> + <Window Type="opengate/StaticFrame" Name="Config/Controls/Body" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="" /> + <Property Name="Disabled" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> + <Property Name="AlwaysOnTop" Value="False" /> + <Property Name="FrameEnabled" Value="False" /> + <Property Name="InheritsAlpha" Value="True" /> + <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="Font" Value="BlueHighway-12" /> + <Property Name="Image" Value="" /> + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,0},{0,35}}" /> + <Property Name="UnifiedSize" Value="{{1,0},{1,-35}}" /> + </Window> </Window> </Window> -</Window> \ No newline at end of file +</GUILayout> \ No newline at end of file Modified: trunk/data/gui/layouts/dialogs/MarketDialog.layout =================================================================== --- trunk/data/gui/layouts/dialogs/MarketDialog.layout 2009-12-28 21:29:43 UTC (rev 1164) +++ trunk/data/gui/layouts/dialogs/MarketDialog.layout 2009-12-31 12:20:57 UTC (rev 1165) @@ -1,113 +1,37 @@ <?xml version="1.0" encoding="UTF-8"?> -<Window Type="opengate/StaticGreenImage" Name="MarketDialog" > - <Property Name="Visible" Value="True" /> - <Property Name="Text" Value="Market" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="FrameEnabled" Value="True" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="BackgroundEnabled" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="True" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Image" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,100},{0,115}}" /> - <Property Name="UnifiedSize" Value="{{1,-167},{1,-217}}" /> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView" > - <Property Name="Visible" Value="False" /> - <Property Name="Text" Value="" /> +<GUILayout > + <Window Type="opengate/StaticGreenImage" Name="MarketDialog" > + <Property Name="Visible" Value="True" /> + <Property Name="Text" Value="Market" /> <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="False" /> + <Property Name="RiseOnClick" Value="True" /> <Property Name="AlwaysOnTop" Value="False" /> <Property Name="FrameEnabled" Value="True" /> <Property Name="InheritsAlpha" Value="True" /> <Property Name="BackgroundEnabled" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> + <Property Name="MousePassThroughEnabled" Value="True" /> <Property Name="Font" Value="BlueHighway-12" /> <Property Name="Image" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,220},{0,10}}" /> - <Property Name="UnifiedSize" Value="{{1,-230},{1,-170}}" /> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TopLeft" > + <Property Name="MouseCursorImage" Value="set:opengateCursor image:Cursor1" /> + <Property Name="UnifiedPosition" Value="{{0,100},{0,115}}" /> + <Property Name="UnifiedSize" Value="{{1,-167},{1,-217}}" /> + <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView" > <Property Name="Visible" Value="False" /> <Property Name="Text" Value="" /> <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> + <Property Name="RiseOnClick" Value="False" /> <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> + <Property Name="FrameEnabled" Value="True" /> <Property Name="InheritsAlpha" Value="True" /> - <Property Name="BackgroundEnabled" Value="False" /> + <Property Name="BackgroundEnabled" Value="True" /> <Property Name="MousePassThroughEnabled" Value="False" /> <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Image" Value="set:opengate image:StaticGreenTopLeft" /> - <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" /> - <Property Name="UnifiedSize" Value="{{0,31},{0,31}}" /> - </Window> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Top" > - <Property Name="Visible" Value="False" /> - <Property Name="Text" Value="" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Image" Value="set:opengate image:StaticGreenTop" /> - <Property Name="UnifiedPosition" Value="{{0,31},{0,0}}" /> - <Property Name="UnifiedSize" Value="{{1,-62},{0,31}}" /> - <Window Type="opengate/StaticLabel" Name="MarketItemDetailedView/Top/Title" > - <Property Name="Visible" Value="False" /> - <Property Name="Text" Value="Would you like to purchase this item?" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="False" /> - <Property Name="AlwaysOnTop" Value="True" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-16" /> - <Property Name="NormalTextColour" Value="FF88D997" /> - <Property Name="HoverTextColour" Value="00000000" /> - <Property Name="DisabledTextColour" Value="FF7F7F7F" /> - <Property Name="VertLabelFormatting" Value="LeftAligned" /> - <Property Name="HorzLabelFormatting" Value="TopAligned" /> - <Property Name="HoverImage" Value="" /> - <Property Name="NormalImage" Value="" /> - <Property Name="PushedImage" Value="" /> - <Property Name="UnifiedPosition" Value="{{0,10},{0,10}}" /> - <Property Name="UnifiedSize" Value="{{1,0},{0,20}}" /> - </Window> - </Window> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/TopRight" > - <Property Name="Visible" Value="False" /> - <Property Name="Text" Value="" /> - <Property Name="Disabled" Value="False" /> - <Property Name="RiseOnClick" Value="True" /> - <Property Name="AlwaysOnTop" Value="False" /> - <Property Name="FrameEnabled" Value="False" /> - <Property Name="InheritsAlpha" Value="True" /> - <Property Name="BackgroundEnabled" Value="False" /> - <Property Name="MousePassThroughEnabled" Value="False" /> - <Property Name="Font" Value="BlueHighway-12" /> - <Property Name="Image" Value="set:opengate image:StaticGreenTopRight" /> - <Property Name="UnifiedPosition" Value="{{1,-31},{0,0}}" /> - <Property Name="UnifiedSize" Value="{{0,31},{0,31}}" /> - </Window> - <Window Type="opengate/StaticGreenImage" Name="MarketItemDetailedView/Image/Frame" > - <Property Name="Visible" Value="False" /> - <Property Name="Text" Value="" /> - <Property Name="Disable... [truncated message content] |
From: <spo...@us...> - 2010-01-02 15:11:02
|
Revision: 1171 http://opengate.svn.sourceforge.net/opengate/?rev=1171&view=rev Author: spom_spom Date: 2010-01-02 15:10:50 +0000 (Sat, 02 Jan 2010) Log Message: ----------- Add truster-trail Modified Paths: -------------- trunk/data/asteroids/asteroid.material trunk/data/materials/advancedMaterials.material trunk/data/misc/misc.particle trunk/data/misc/test.sector trunk/src/ConfigDialog.cpp trunk/src/Console.cpp trunk/src/GameStateManager.cpp trunk/src/GameStateManager.h trunk/src/GunObject.cpp trunk/src/GunObject.h trunk/src/KeyMap.cpp trunk/src/KeyMap.h trunk/src/MarketDialog.cpp trunk/src/ResourceManager.cpp trunk/src/ResourceManager.h trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorAvatarObject.cpp trunk/src/SectorMissileObject.cpp trunk/src/SectorMissileObject.h trunk/src/UnDockedState.cpp Modified: trunk/data/asteroids/asteroid.material =================================================================== --- trunk/data/asteroids/asteroid.material 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/data/asteroids/asteroid.material 2010-01-02 15:10:50 UTC (rev 1171) @@ -1,5 +1,179 @@ -material Asteroid/BumpMapping : OpenGate/BumpMapping +material OpenGate/NormalMapping { + + // This is the preferred technique which uses both vertex and + // fragment programs, supports coloured lights + technique vpfp + { + scheme vpfp + pass + { + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named_auto ambient ambient_light_colour + } + + } + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 1 1 1 1 + + // do this for each light + iteration once_per_light + + scene_blend add + + // Vertex program reference + vertex_program_ref BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + } + + // Fragment program + fragment_program_ref BumpMapFP + { + param_named_auto lightDiffuse light_diffuse_colour 0 + } + + // Base bump map + texture_unit + { + texture_alias ImageBumpMap + colour_op replace + } + // Normalisation cube map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + } + } + + // Decal pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + lighting off + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named ambient float4 1 1 1 1 + } + scene_blend dest_colour zero + texture_unit + { + texture_alias Image + } + + } + } + + // This is the fallback which cards which don't have fragment program support will use + // Note that it still requires vertex program support + technique vp + { + scheme vpOnly + // Base ambient pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 1 1 1 + diffuse 0 0 0 + specular 0 0 0 0 + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named_auto ambient ambient_light_colour + } + + } + // Now do the lighting pass + // NB we don't do decal texture here because this is repeated per light + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + // do this for each light + iteration once_per_light + + + scene_blend add + + // Vertex program reference + vertex_program_ref BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + } + + // Base bump map + texture_unit + { + texture_alias ImageBumpMap + colour_op replace + } + // Normalisation cube map, with dot product on bump map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + colour_op_ex dotproduct src_texture src_current + colour_op_multipass_fallback dest_colour zero + } + } + + // Decal pass + pass + { + lighting off + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named ambient float4 1 1 1 1 + } + scene_blend dest_colour zero + texture_unit + { + texture_alias Image + } + + } + } + // This is the fallback which cards which don't have fragment program and vertex program support + technique fallback + { + scheme Default + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.900000 0.900000 0.900000 1.000000 + emissive 0.500000 0.500000 0.500000 1.000000 + texture_unit + { + texture_alias ImageFallback + } + } + } +} + + +material Asteroid/NormalMapping : OpenGate/NormalMapping +{ set_texture_alias Image asteroid.png set_texture_alias ImageBumpMap asteroidBump.png set_texture_alias ImageFallback asteroid.png @@ -15,7 +189,7 @@ { // ambient 0.500000 0.500000 0.500000 1.000000 // diffuse 0.900000 0.900000 0.900000 1.000000 - emissive 0.500000 0.500000 0.500000 1.000000 + emissive 1.000000 1.000000 1.00000 1.000000 texture_unit { texture asteroid.png Modified: trunk/data/materials/advancedMaterials.material =================================================================== --- trunk/data/materials/advancedMaterials.material 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/data/materials/advancedMaterials.material 2010-01-02 15:10:50 UTC (rev 1171) @@ -1,186 +0,0 @@ -material OpenGate/BumpMapping -{ - - // This is the preferred technique which uses both vertex and - // fragment programs, supports coloured lights - technique vpfp - { - scheme vpfp - // Base ambient pass - pass - { - // base colours, not needed for rendering, but as information - // to lighting pass categorisation routine -// ambient 1 1 1 -// diffuse 0 0 9 -// specular 0 0 1 1 -// emissive 0 0 1 1 - // Really basic vertex program - // NB we don't use fixed function here because GL does not like - // mixing fixed function and vertex programs, depth fighting can - // be an issue - vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified - { - param_named_auto ambient ambient_light_colour - } - - } - // Now do the lighting pass - // NB we don't do decal texture here because this is repeated per light - pass - { - // base colours, not needed for rendering, but as information - // to lighting pass categorisation routine - ambient 0 0 1 - - // do this for each light - iteration once_per_light - - scene_blend add - - // Vertex program reference - vertex_program_ref BumpMapVP - { - param_named_auto lightPosition light_position_object_space 0 - } - - // Fragment program - fragment_program_ref BumpMapFP - { - param_named_auto lightDiffuse light_diffuse_colour 0 - } - - // Base bump map - texture_unit - { - texture_alias ImageBumpMap - colour_op replace - } - // Normalisation cube map - texture_unit - { - cubic_texture nm.png combinedUVW - tex_coord_set 1 - tex_address_mode clamp - } - } - - // Decal pass - pass - { - // base colours, not needed for rendering, but as information - // to lighting pass categorisation routine - lighting off - // Really basic vertex program - // NB we don't use fixed function here because GL does not like - // mixing fixed function and vertex programs, depth fighting can - // be an issue - vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified - { - param_named ambient float4 1 1 1 1 - } - scene_blend dest_colour zero - texture_unit - { - texture_alias Image - } - - } - } - - // This is the fallback which cards which don't have fragment program support will use - // Note that it still requires vertex program support - technique vp - { - scheme vpOnly - // Base ambient pass - pass - { - // base colours, not needed for rendering, but as information - // to lighting pass categorisation routine - ambient 1 1 1 - diffuse 0 0 0 - specular 0 0 0 0 - // Really basic vertex program - // NB we don't use fixed function here because GL does not like - // mixing fixed function and vertex programs, depth fighting can - // be an issue - vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified - { - param_named_auto ambient ambient_light_colour - } - - } - // Now do the lighting pass - // NB we don't do decal texture here because this is repeated per light - pass - { - // base colours, not needed for rendering, but as information - // to lighting pass categorisation routine - ambient 0 0 0 - // do this for each light - iteration once_per_light - - - scene_blend add - - // Vertex program reference - vertex_program_ref BumpMapVP - { - param_named_auto lightPosition light_position_object_space 0 - } - - // Base bump map - texture_unit - { - texture_alias ImageBumpMap - colour_op replace - } - // Normalisation cube map, with dot product on bump map - texture_unit - { - cubic_texture nm.png combinedUVW - tex_coord_set 1 - tex_address_mode clamp - colour_op_ex dotproduct src_texture src_current - colour_op_multipass_fallback dest_colour zero - } - } - - // Decal pass - pass - { - lighting off - // Really basic vertex program - // NB we don't use fixed function here because GL does not like - // mixing fixed function and vertex programs, depth fighting can - // be an issue - vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified - { - param_named ambient float4 1 1 1 1 - } - scene_blend dest_colour zero - texture_unit - { - texture_alias Image - } - - } - } - // This is the fallback which cards which don't have fragment program and vertex program support - technique fallback - { - scheme Default - pass - { - ambient 0.500000 0.500000 0.500000 1.000000 - diffuse 0.900000 0.900000 0.900000 1.000000 - emissive 0.500000 0.500000 0.500000 1.000000 - texture_unit - { - texture_alias ImageFallback - } - } - } -} - Modified: trunk/data/misc/misc.particle =================================================================== --- trunk/data/misc/misc.particle 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/data/misc/misc.particle 2010-01-02 15:10:50 UTC (rev 1171) @@ -39,3 +39,39 @@ } } +particle_system OpenGate/ThrustTrail +{ + material OpenGate/Space/Dust + particle_width 0.5 + particle_height 0.5 + cull_each true + quota 1000 + billboard_type oriented_self + //billboard_rotation_type vertex + + //billboard_type perpendicular_common + //billboard_type perpendicular_self + //common_direction 0 0 -1 + //self_direction 0 0 -1 + //self_up_vector 0 0 1 + + // Area emitter + emitter Ellipsoid{ + + time_to_live 3 + colour 1.0 1.0 1.0 + emission_rate 333 + velocity 0.001 + width 1 + height 1 + depth 5 + } + + // Fader + affector ColourFader + { + red -0.333 + green -0.333 + blue -0.333 + } +} Modified: trunk/data/misc/test.sector =================================================================== --- trunk/data/misc/test.sector 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/data/misc/test.sector 2010-01-02 15:10:50 UTC (rev 1171) @@ -13,10 +13,10 @@ <sectorobject name="astro with bump"> <position y="0" x="-250" z="440"></position> <scale y="20" x="20" z="20"></scale> - <entity meshFile="asteroid01.mesh" material-0="Asteroid/BumpMapping" numSubEntities="1"></entity> + <entity meshFile="asteroid01.mesh" material-0="Asteroid/NormalMapping" numSubEntities="1"></entity> </sectorobject> <sectorobject name="astro without bump"> - <position y="0" x="-250" z="500"></position> + <position y="100" x="-250" z="500"></position> <scale y="20" x="20" z="20"></scale> <entity meshFile="asteroid01.mesh" material-0="Asteroid" numSubEntities="1"></entity> </sectorobject> Modified: trunk/src/ConfigDialog.cpp =================================================================== --- trunk/src/ConfigDialog.cpp 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/src/ConfigDialog.cpp 2010-01-02 15:10:50 UTC (rev 1171) @@ -66,13 +66,13 @@ bool ConfigDialog::handleControlsButton_( const CEGUI::EventArgs & e ){ activeWindow_ = static_cast<CEGUI::Listbox*>( CEGUI::WindowManager::getSingleton().getWindow( "Config/Controls" ) ); - - KeyMap::KeyBindingsMap keyBindings = resources_->keymap()->unDockedKeyBindings(); + + KeyMap::KeyBindingsMap keyBindings = resources_->keyMap()->unDockedKeyBindings(); uint count = 0; - + for ( KeyMap::KeyBindingsMap::iterator it = keyBindings.begin(); it != keyBindings.end(); it ++ ){ CEGUI::Window *b; - + if ( CEGUI::WindowManager::getSingleton().isWindowPresent( activeWindow_->getName() + it->first ) ){ b = CEGUI::WindowManager::getSingleton().getWindow( activeWindow_->getName() + it->first ); } else { @@ -87,25 +87,25 @@ b->show(); } - + if ( lastActiveWindow_ ) lastActiveWindow_->hide(); activeWindow_->show(); lastActiveWindow_ = activeWindow_; - + return true; } bool ConfigDialog::handleControlsCategoryButton_( const CEGUI::EventArgs & e ){ const CEGUI::WindowEventArgs & we = static_cast< const CEGUI::WindowEventArgs & >( e ); std::string category( we.window->getText().c_str() ); - + fillControlsWindow_( category ); return true; } void ConfigDialog::fillControlsWindow_( const std::string & category ){ CEGUI::Window * window = CEGUI::WindowManager::getSingleton().getWindow( "Config/Controls/Body" ); - + std::vector <CEGUI::Window *> removeList; for ( uint i = 0; i < window->getChildCount(); i ++ ) { removeList.push_back( window->getChildAtIdx( i ) ); @@ -114,8 +114,8 @@ CEGUI::WindowManager::getSingleton().destroyWindow( removeList[ i ] ); } //window->show(); - - std::map < std::string, std::pair< uint, uint > > keyBindings( resources_->keymap()->unDockedKeyBindings()[ category ] ); + + std::map < std::string, std::pair< uint, uint > > keyBindings( resources_->keyMap()->unDockedKeyBindings()[ category ] ); uint count = 0; double x = 0.0, y; for ( std::map < std::string, std::pair< uint, uint > >::iterator it = keyBindings.begin(); it != keyBindings.end(); it ++ ){ @@ -133,7 +133,7 @@ renameClonedWindows( b, keyWindowName ); window->addChildWindow( b ); - + y = count * 30.0; if ( y > window->getPixelSize().d_height - 30.0 ){ x = b->getPixelSize().d_width + 10; y = 0.0; @@ -142,14 +142,14 @@ b->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0, x ), CEGUI::UDim( 0.0, y ) ) ); CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/Name" )->setProperty( "Text", keyName ); - CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton1" )->setProperty( "Text", - resources_->keymap()->keycodeName( it->second.first ) ); - CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton2" )->setProperty( "Text", - resources_->keymap()->keycodeName( it->second.second ) ); + CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton1" )->setProperty( "Text", + resources_->keyMap()->keycodeName( it->second.first ) ); + CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton2" )->setProperty( "Text", + resources_->keyMap()->keycodeName( it->second.second ) ); - BIND_CEGUI_EVENT( CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton1" ), + BIND_CEGUI_EVENT( CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton1" ), CEGUI::PushButton::EventKeyDown, ConfigDialog::handleControlsKey1Button_ ); - BIND_CEGUI_EVENT( CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton2" ), + BIND_CEGUI_EVENT( CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton2" ), CEGUI::PushButton::EventKeyDown, ConfigDialog::handleControlsKey2Button_ ); } count ++; @@ -160,21 +160,21 @@ bool ConfigDialog::handleControlsKeyButton_( const CEGUI::EventArgs & e, uint key ){ const CEGUI::WindowEventArgs & we = static_cast< const CEGUI::WindowEventArgs & >( e ); CEGUI::Window *b = we.window->getParent(); - - uint keycode = resources_->keymap()->lastKeycode(); - if ( resources_->keymap()->lastKeycode() == OIS::KC_ESCAPE ) return true; - - if ( !resources_->keymap()->haveKeyBinding( keycode ) ){ - CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton" + toStr( key ) )->setProperty( "Text", - resources_->keymap()->keycodeName( keycode ) ); - - - resources_->keymap()->setKeyBinding( CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/Name" )->getProperty( "Text").c_str(), keycode, key ); + + uint keycode = resources_->keyMap()->lastKeycode(); + if ( resources_->keyMap()->lastKeycode() == OIS::KC_ESCAPE ) return true; + + if ( !resources_->keyMap()->haveKeyBinding( keycode ) ){ + CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/KeyButton" + toStr( key ) )->setProperty( "Text", + resources_->keyMap()->keycodeName( keycode ) ); + + + resources_->keyMap()->setKeyBinding( CEGUI::WindowManager::getSingleton().getWindow( b->getName() + "Config/Controls/Key/Name" )->getProperty( "Text").c_str(), keycode, key ); } else { - resources_->log().warn( "there is allready a binding for " + resources_->keymap()->keycodeName( keycode ) ); + resources_->log().warn( "there is allready a binding for " + resources_->keyMap()->keycodeName( keycode ) ); } - - + + return true; } @@ -183,7 +183,7 @@ //std::cout << "ConfigDialog::handleCreditsButton_( const CEGUI::EventArgs & e ){" << std::endl; CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"Config/Credits/Header" ) ->setProperty("Text", "Credits" ); - + activeWindow_ = static_cast<CEGUI::Listbox*> (CEGUI::WindowManager::getSingleton().getWindow( "Config/Credits/Body" ) ); fillCreditsWindow_( dynamic_cast<CEGUI::Listbox*>( activeWindow_ ) ); if ( lastActiveWindow_ ) lastActiveWindow_->hide(); @@ -206,7 +206,7 @@ for ( uint i = 0; i < row.size(); i ++ ){ str += row[ i ] + " "; } - CEGUI::ListboxTextItem * item = new CEGUI::ListboxTextItem( str ); + CEGUI::ListboxTextItem * item = new CEGUI::ListboxTextItem( str ); window->addItem ( item ); } window->ensureItemIsVisible( window->getItemCount() ); Modified: trunk/src/Console.cpp =================================================================== --- trunk/src/Console.cpp 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/src/Console.cpp 2010-01-02 15:10:50 UTC (rev 1171) @@ -18,15 +18,15 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "Console.h" +#include "Console.h" -#include "common.h" +#include "common.h" -#include "ResourceManager.h" -// #include "GameState.h" -#include "GameStateManager.h" +#include "ResourceManager.h" +// #include "GameState.h" +#include "GameStateManager.h" -#include "LogManager.h" +#include "LogManager.h" #include "networkClient.h" #include "KeyMap.h" @@ -38,7 +38,7 @@ namespace OpenGate{ -Console::Console( ) +Console::Console( ) : rootWindow_( CEGUI::WindowManager::getSingleton().loadWindowLayout( "opengateConsole.layout" ) ), resources_( ResourceManager::getSingletonPtr() ) { @@ -48,13 +48,13 @@ listBox_ = static_cast<CEGUI::Listbox*> (CEGUI::WindowManager::getSingleton().getWindow( "ConsoleList" ) ); BIND_CEGUI_EVENT( editBox_, CEGUI::Editbox::EventTextAccepted, Console::handleEditTextAccepted ); -} +} -Console::~Console(){ +Console::~Console(){ LogManager::getSingleton().setConsole( NULL ); InputManager::getSingleton().removeKeyListener( "ConsoleKeyListener" ); CEGUI::WindowManager::getSingleton().destroyWindow( rootWindow_ ); -} +} void Console::show( ){ visible_ = true; @@ -67,7 +67,7 @@ rootWindow_->hide(); } -void Console::start( ){ +void Console::start( ){ if ( resources_->guiSystem ){ if ( resources_->guiSystem->getGUISheet() ){ resources_->guiSystem->getGUISheet()->addChildWindow( rootWindow_ ); @@ -78,7 +78,7 @@ show(); } -void Console::stop( ){ +void Console::stop( ){ if ( resources_->guiSystem ){ if ( resources_->guiSystem->getGUISheet() ){ resources_->guiSystem->getGUISheet()->removeChildWindow( rootWindow_ ); @@ -87,13 +87,13 @@ InputManager::getSingleton().removeKeyListener( "ConsoleKeyListener" ); } -bool Console::frameStarted( const Ogre::FrameEvent & evt ){ +bool Console::frameStarted( const Ogre::FrameEvent & evt ){ return true; } -bool Console::frameEnded( const Ogre::FrameEvent & evt ){ - return true; -} +bool Console::frameEnded( const Ogre::FrameEvent & evt ){ + return true; +} bool Console::handleResize( const CEGUI::EventArgs & e ){ @@ -125,42 +125,42 @@ return true; } -bool Console::keyPressed( const OIS::KeyEvent & e ){ - if ( e.key == OIS::KC_LCONTROL) resources_->keymap()->setGlobalKeyModifier( KEY_CONTROL ); - if ( e.key == OIS::KC_RCONTROL) resources_->keymap()->setGlobalKeyModifier( KEY_CONTROL ); - if ( e.key == OIS::KC_LSHIFT) resources_->keymap()->setGlobalKeyModifier( KEY_SHIFT ); - if ( e.key == OIS::KC_RSHIFT) resources_->keymap()->setGlobalKeyModifier( KEY_SHIFT ); - resources_->keymap()->setLastKeycode( e.key ); - +bool Console::keyPressed( const OIS::KeyEvent & e ){ + if ( e.key == OIS::KC_LCONTROL) resources_->keyMap()->setGlobalKeyModifier( KEY_CONTROL ); + if ( e.key == OIS::KC_RCONTROL) resources_->keyMap()->setGlobalKeyModifier( KEY_CONTROL ); + if ( e.key == OIS::KC_LSHIFT) resources_->keyMap()->setGlobalKeyModifier( KEY_SHIFT ); + if ( e.key == OIS::KC_RSHIFT) resources_->keyMap()->setGlobalKeyModifier( KEY_SHIFT ); + resources_->keyMap()->setLastKeycode( e.key ); + CEGUI::System::getSingleton().injectKeyDown( e.key ); CEGUI::System::getSingleton().injectChar( e.text ); //** for testings - if ( e.key == OIS::KC_BACK && resources_->keymap()->globalKeyModifier( ) == KEY_CONTROL ){ - resources_->renderWindow->setFullscreen( true, - resources_->renderWindow->getWidth(), + if ( e.key == OIS::KC_BACK && resources_->keyMap()->globalKeyModifier( ) == KEY_CONTROL ){ + resources_->renderWindow->setFullscreen( true, + resources_->renderWindow->getWidth(), resources_->renderWindow->getHeight() ); // resources_->renderWindow->resize( 1280, 1024 ); std::cout << "Fullscreen: " << resources_->renderWindow->isFullScreen() << std::endl; } - if ( (this->*resources_->keymap()->consoleKeyAction( e ))( true ) ) return true; + if ( (this->*resources_->keyMap()->consoleKeyAction( e ))( true ) ) return true; - return true; + return true; } -bool Console::keyReleased( const OIS::KeyEvent & e ){ +bool Console::keyReleased( const OIS::KeyEvent & e ){ CEGUI::System::getSingleton().injectKeyUp( e.key ); - if ( e.key == OIS::KC_LCONTROL ) resources_->keymap()->setGlobalKeyModifier( KEY_NONE ); - if ( e.key == OIS::KC_RCONTROL ) resources_->keymap()->setGlobalKeyModifier( KEY_NONE ); - if ( e.key == OIS::KC_LSHIFT ) resources_->keymap()->setGlobalKeyModifier( KEY_NONE ); - if ( e.key == OIS::KC_RSHIFT ) resources_->keymap()->setGlobalKeyModifier( KEY_NONE ); - + if ( e.key == OIS::KC_LCONTROL ) resources_->keyMap()->setGlobalKeyModifier( KEY_NONE ); + if ( e.key == OIS::KC_RCONTROL ) resources_->keyMap()->setGlobalKeyModifier( KEY_NONE ); + if ( e.key == OIS::KC_LSHIFT ) resources_->keyMap()->setGlobalKeyModifier( KEY_NONE ); + if ( e.key == OIS::KC_RSHIFT ) resources_->keyMap()->setGlobalKeyModifier( KEY_NONE ); + return true; } -bool Console::keyActionScreenshot( bool pressed ){ +bool Console::keyActionScreenshot( bool pressed ){ if ( pressed ){ std::string tmp( "screenshot" + LogManager::getSingleton().timeStamp() + ".png" ); ResourceManager::getSingleton().renderWindow->writeContentsToFile( tmp.c_str() ); @@ -172,7 +172,7 @@ return true; } -void Console::print( const std::string & t ){ +void Console::print( const std::string & t ){ CEGUI::colour col(1.0, 1.0, 1.0, 1.0); if ( t.find( "INFO:" ) == 0 ){ col = CEGUI::colour( 1.0, 1.0, 0.0, 1.0 ); @@ -192,27 +192,27 @@ if ( i * consoleLineLength_ + count > (int)t.size() ){ count = -1; } CEGUI::String text( t, i*consoleLineLength_, count ); - CEGUI::ListboxTextItem * item = new CEGUI::ListboxTextItem( text ); + CEGUI::ListboxTextItem * item = new CEGUI::ListboxTextItem( text ); item->setTextColours( col ); listBox_->addItem ( item ); listBox_->ensureItemIsVisible( listBox_->getItemCount() ); } -} +} - -void Console::addCommand( const std::string & command, void (GameStateManager::*ptr) ( const std::vector< std::string > & ), + +void Console::addCommand( const std::string & command, void (GameStateManager::*ptr) ( const std::vector< std::string > & ), const std::string & help ){ - commands_[ command ] = ptr; + commands_[ command ] = ptr; help_[ command ] = help; } -void Console::removeCommand( const std::string & command ){ +void Console::removeCommand( const std::string & command ){ if ( commands_.find( command ) != commands_.end() ){ - commands_.erase( commands_.find( command ) ); - help_.erase( help_.find( command ) ); + commands_.erase( commands_.find( command ) ); + help_.erase( help_.find( command ) ); } } - + void Console::printHelp( ){ LogManager::getSingleton().info( ("printHelp:") ); Modified: trunk/src/GameStateManager.cpp =================================================================== --- trunk/src/GameStateManager.cpp 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/src/GameStateManager.cpp 2010-01-02 15:10:50 UTC (rev 1171) @@ -27,6 +27,7 @@ #include "DockedState.h" #include "EntityManager.h" #include "InputManager.h" +#include "KeyMap.h" #include "networkClient.h" #include "OpcodeWrapper.h" #include "OpenALSoundManager.h" @@ -76,11 +77,11 @@ states_.pop_back(); } if ( resources_.avatar ) delete resources_.avatar; - + if ( resources_.collisionManager ) delete resources_.collisionManager; - + if ( configDialog_ ) delete configDialog_; - + if ( resources_.aiManager ) { log_->info( "Shutdown ai manager." ); delete resources_.aiManager; @@ -101,7 +102,7 @@ delete resources_.soundManager; resources_.soundManager = NULL; } - + if ( resources_.guiRenderer ) { log_->info( "Shutdown CEGUI manager." ); delete resources_.guiSystem; @@ -165,7 +166,7 @@ Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext(); std::cout << "Ressource: " << secName << std::endl; - + if ( secName == "Bootstrap" ){ for ( Ogre::ConfigFile::SettingsMultiMap::iterator i = settings->begin(); i != settings->end(); ++i ){ typeName = i->first; @@ -181,48 +182,51 @@ void GameStateManager::initLoadingVector(){ - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), - std::string >( &GameStateManager::initialiseOgreResources, - "initialise Ogre resources" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + std::string >( &GameStateManager::initialiseOgreResources, + "initialise Ogre resources" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::checkRenderSystemCapabilities, - "check render system capabilities" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "check render system capabilities" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::initialiseCEGUIEngine, - "initialise CEGUI engine" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "initialise CEGUI engine" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::initialiseInputManager, - "initialise input system" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "initialise input system" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::initialiseConsole, - "initialise console" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "initialise console" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::initialiseMiscResources, - "initialise opengate miscellaneous resources" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "initialise opengate miscellaneous resources" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::initialiseSoundManager, - "initialise sound manager" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "initialise sound manager" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::initialiseEntityManager, "initialise entity manager" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::initialiseAiManager, - "initialise ai manager" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "initialise ai manager" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::createAvatar, - "create avatar" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "create avatar" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::createConfigDialog, - "create configuration dialog" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "create configuration dialog" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::createDockedState, - "create station" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "create station" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::initialiseCollisionManager, - "create collision manager" ) ); - loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + "create collision manager" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), std::string >( &GameStateManager::createUnDockedState, - "create sector" ) ); + "create sector" ) ); + loadResourcesVector_.push_back( std::pair< bool (GameStateManager::*)( ), + std::string >( &GameStateManager::initialiseKeyMap, + "init keymap" ) ); } bool GameStateManager::initialiseAllResources( ){ @@ -260,7 +264,7 @@ resources_.console->addCommand( "/q", &GameStateManager::CMD_shutdown, "Shutting down the client. Shortcut for /quit" ); resources_.console->addCommand( "/quit", &GameStateManager::CMD_shutdown, "Shutting down the client" ); - resources_.console->addCommand( "/help", &GameStateManager::CMD_printHelp,"Show this help" ); + resources_.console->addCommand( "/help", &GameStateManager::CMD_printHelp,"Show this help" ); resources_.console->addCommand( "/time", &GameStateManager::CMD_printTime,"Show current system time" ); resources_.console->addCommand( "/spawn", &GameStateManager::CMD_spawnAi, "[name] Spawn ai subject. /spawn help show all available ships." ); resources_.console->addCommand( "/ai", &GameStateManager::CMD_ai, " [command] interact with aimanager. /ai help show all commands." ); @@ -287,7 +291,7 @@ resources_.collisionManager = new OpcodeCollisionDetection( &resources_ ); return true; } - + // bool GameStateManager::initialiseVesselManager(){ // vesselManager_ = new VesselManager( ); // vesselManager_->load( resources_.resourcePaths(), "ships" ); @@ -368,7 +372,7 @@ for ( std::list<Ogre::ResourceGroupManager::ResourceDeclaration>::iterator it = li.begin(); it != li.end(); it ++ ){ std::cout << (*it).resourceName << std::endl; }*/ - + return true; } @@ -384,7 +388,7 @@ // CEGUI::Scheme::setDefaultResourceGroup("schemes"); CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"opengate.scheme" ); resources_.guiSystem->setDefaultFont( (CEGUI::utf8*)"BlueHighway-12" ); - + // CEGUI::WindowFactoryManager::getSingleton() return true; } @@ -395,11 +399,16 @@ resources_.renderWindow->getCustomAttribute( "WINDOW", &hWnd ); resources_.inputManager->init( hWnd ); - resources_.inputManager->setWindowExtents( resources_.renderWindow->getWidth( ), + resources_.inputManager->setWindowExtents( resources_.renderWindow->getWidth( ), resources_.renderWindow->getHeight( ) ); return true; } +bool GameStateManager::initialiseKeyMap(){ + resources_.keyMap()->setDefaults( resources_.network->online() ); + return true; +} + void GameStateManager::switchConfigDialog( ){ if ( configDialog_->isVisible() ) { configDialog_->hide(); @@ -441,7 +450,7 @@ } } } -#endif +#endif resources_.ogreRoot()->renderOneFrame( ); } } @@ -548,8 +557,8 @@ shutdown(); } -void GameStateManager::CMD_printHelp( const std::vector < std::string > & argv ){ - resources_.console->printHelp(); +void GameStateManager::CMD_printHelp( const std::vector < std::string > & argv ){ + resources_.console->printHelp(); } void GameStateManager::CMD_printTime( const std::vector < std::string > & argv ){ @@ -561,7 +570,7 @@ void GameStateManager::CMD_ai( const std::vector < std::string > & argv ){ resources_.aiManager->cmd( argv ); } - + void GameStateManager::CMD_spawnAi( const std::vector < std::string > & argv ){ std::string aiName = "Squid"; if ( argv.size() > 1 ){ Modified: trunk/src/GameStateManager.h =================================================================== --- trunk/src/GameStateManager.h 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/src/GameStateManager.h 2010-01-02 15:10:50 UTC (rev 1171) @@ -59,10 +59,10 @@ /*! Init ogre root and call initialiseOgreEngine_. */ bool initialiseBootstrap( bool dialog ); - + /*! Init ogre bootstrap resoucees for the init state. */ bool initialiseBootstrapResources( ); - + /*! Init the callback list for loading the game resouces. */ void initLoadingVector(); @@ -71,7 +71,10 @@ bool initialiseOgreResources( ); bool initialiseCEGUIEngine( ); bool initialiseInputManager( ); - + + /*! Initialise Keymap, depending the online status. */ + bool initialiseKeyMap(); + bool initialiseConsole(); //** load id, rank matrix etc. @@ -106,7 +109,7 @@ /*! Get the active gamestate. */ GameState * activeState( ) { return stateStack_.back(); } - + /*! Change to a game state. This replaces the current game state with a new game state. The current game state ends before the new begins. */ void changeGameState( GameState * state ); @@ -115,7 +118,7 @@ /*! Pop a game state off the stack. This destroys the current game state and returns control to the previous game state. */ // void popGameState( ); - + void CMD_shutdown( const std::vector < std::string > & argv ); void CMD_printHelp( const std::vector < std::string > & argv ); void CMD_printTime( const std::vector < std::string > & argv ); @@ -125,7 +128,7 @@ /*! This is a special case function to cause a shutdown. */ void shutdown( ); - std::vector< std::pair< bool (GameStateManager::*)( ), std::string > > * pLoadResourcesVector(){ + std::vector< std::pair< bool (GameStateManager::*)( ), std::string > > * pLoadResourcesVector(){ return &loadResourcesVector_; } protected: @@ -151,7 +154,7 @@ ConfigDialog * configDialog_; - std::vector< std::pair< bool (GameStateManager::*)( ), std::string > > loadResourcesVector_; + std::vector< std::pair< bool (GameStateManager::*)( ), std::string > > loadResourcesVector_; }; Modified: trunk/src/GunObject.cpp =================================================================== --- trunk/src/GunObject.cpp 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/src/GunObject.cpp 2010-01-02 15:10:50 UTC (rev 1171) @@ -96,15 +96,28 @@ pEmit_->setColour( Ogre::ColourValue::Blue, Ogre::ColourValue::Green ); mainNode_->attachObject( thrusterParticles_ ); + + + thrusterTrail_ = mountNode_->getCreator()->createParticleSystem( mainNode_->getName() + "/ThrusterTrail", "OpenGate/ThrustTrail" ); +// thrusterTrail_->setMaterialName( "Examples/Flare" ); +// thrusterTrail_->setDefaultDimensions( 1, 1 ); + pEmitTrail_ = thrusterTrail_->getEmitter( 0 ); + maxTrailEmission_ = pEmitTrail_->getEmissionRate(); + mainNode_->attachObject( thrusterTrail_ ); + mainNode_->setVisible( true ); } EngineObject::~EngineObject(){ + if ( thrusterTrail_ ){ + mainNode_->detachObject( thrusterTrail_ ); + mainNode_->getCreator()->destroyParticleSystem( thrusterTrail_ ); + } if ( thrusterParticles_ ){ mainNode_->detachObject( thrusterParticles_ ); mainNode_->getCreator()->destroyParticleSystem( thrusterParticles_ ); - mountNode_->removeAndDestroyChild( mainNode_->getName() ); } + mountNode_->removeAndDestroyChild( mainNode_->getName() ); } // void EngineObject::mount( SectorMovableObject * parent, Ogre::SceneNode * mountPoint ){ @@ -131,6 +144,12 @@ pEmit_->setEmissionRate( thrustRate_ * 10.0 * 100.0 ); pEmit_->setParticleVelocity( thrustRate_ * 5.0 * 100.0 ); } + + if ( thrusterTrail_ ){ +// pEmitTrail_->setTimeToLive( 2.0 ); + pEmitTrail_->setEmissionRate( thrustRate_ * 333.0 ); +// pEmitTrail_->setParticleVelocity( 0.0 ); + } } Uint32 EngineObject::thrust( Uint32 & powerLine ){ Modified: trunk/src/GunObject.h =================================================================== --- trunk/src/GunObject.h 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/src/GunObject.h 2010-01-02 15:10:50 UTC (rev 1171) @@ -34,7 +34,7 @@ ~GunObject( ); void mount( SectorVesselObject * parent, Ogre::SceneNode * mountPoint ); - + void update( const Ogre::Real elapsedTime ); bool fire( Uint32 & capacity ); @@ -42,7 +42,7 @@ inline Gun * gunBluePrint(){ return gunBluePrint_;} inline Gun & gunBluePrint() const { return *gunBluePrint_;} - + inline SectorVesselObject * parent() { return parent_; } // void setMountPosition( const Ogre::Vector3 & mountPosition ) { mountPosition_ = mountPosition; } @@ -61,41 +61,48 @@ OpenALSoundSource * gunSound_; }; -/*! Construct an engine with a grafical representation i.e. thruster effects. */ +/*! Construct an engine based on a blueprint, with a grafical representation i.e. thruster effects. */ class EngineObject{ public: /*! Construct an engine object, with a Blueprint, a uniqe name, the mountNode on the parent vessel and the absolute position for the emmesive parts of the engine.*/ EngineObject( Engine * engineBluePrint, const std::string & name, Ogre::SceneNode * mountNode, const Ogre::Vector3 & position ); - + /*! Destruct the engine and associated particle or grafical effects. */ ~EngineObject( ); - + /*! Return corresponding main Ogre::SceneNode for this engine. */ inline Ogre::SceneNode * sceneNode() { return mainNode_; } - + /*! Change the thrust rate. Causes a change of the thruster particle effect and determine the amount of power is consumed, by getting the thrust through update powerline cycle. */ void setThrustRate( double rate ); - + /*! Return the preset thrustrate from 0 to 1 */ inline double thrustRate( double rate ){ return thrustRate_; } - + /*! Return the amount of power that the engine provide for a given thrustRate. */ Uint32 thrust( Uint32 & powerLine ); - + protected: Engine * engineBluePrint_; std::string name_; Ogre::SceneNode * mountNode_; Ogre::SceneNode * mainNode_; - + Ogre::ParticleEmitter * pEmit_; Ogre::ParticleSystem * thrusterParticles_; - - double thrustRate_; + + Ogre::ParticleSystem * thrusterTrail_; + Ogre::ParticleEmitter * pEmitTrail_; + + double maxTrailEmission_; + double thrustRate_; }; +class ShieldObject{ +}; + } //namespace OpenGate -#endif +#endif Modified: trunk/src/KeyMap.cpp =================================================================== --- trunk/src/KeyMap.cpp 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/src/KeyMap.cpp 2010-01-02 15:10:50 UTC (rev 1171) @@ -31,8 +31,8 @@ KeyMap::~KeyMap(){ } -void KeyMap::setDefaults(){ - registerUnDockedKeyAction_( "General", "Min/Max Console", &UnDockedState::keyActionSwitchMinMaxConsole, +void KeyMap::setDefaults( bool online ){ + registerUnDockedKeyAction_( "General", "Min/Max Console", &UnDockedState::keyActionSwitchMinMaxConsole, keycode_( 70 ) ); registerUnDockedKeyAction_( "Flight", "1 Rudder increase yaw", &UnDockedState::keyActionAvatarIncreaseYaw, @@ -44,12 +44,12 @@ registerUnDockedKeyAction_( "Flight", "4 Rudder decrease pitch", &UnDockedState::keyActionAvatarDecreasePitch, keycode_( OIS::KC_S ), keycode_( OIS::KC_NUMPAD2 ) ); registerUnDockedKeyAction_( "Flight", "5 Rudder increase roll", &UnDockedState::keyActionAvatarIncreaseRoll, - keycode_( 181 ), keycode_( OIS::KC_NUMPAD0 ) ); + keycode_( OIS::KC_NUMPAD0 ) ); registerUnDockedKeyAction_( "Flight", "6 Rudder decrease roll", &UnDockedState::keyActionAvatarDecreaseRoll, - keycode_( 55 ), keycode_( OIS::KC_NUMPADCOMMA ) ); + keycode_( OIS::KC_DECIMAL ) ); registerUnDockedKeyAction_( "Flight", "7 Rudder center", &UnDockedState::keyActionAvatarCenter, keycode_( OIS::KC_NUMPAD5 ) ); - + registerUnDockedKeyAction_( "Flight", "8 Increase thrust", &UnDockedState::keyActionAvatarIncrementThrust, keycode_( OIS::KC_NUMPAD7 ) ); registerUnDockedKeyAction_( "Flight", "9 Decrease thrust", &UnDockedState::keyActionAvatarDecrementThrust, @@ -60,12 +60,12 @@ keycode_( OIS::KC_NUMPAD9 ) ); registerUnDockedKeyAction_( "Flight", "Docking assistant", &UnDockedState::keyActionDockAssist, keycode_( OIS::KC_A, KEY_SHIFT ) ); - + registerUnDockedKeyAction_( "Radar", "Select next target", &UnDockedState::keyActionSelectTextTarget, keycode_( OIS::KC_N ) ); registerUnDockedKeyAction_( "Radar", "Select previous target", &UnDockedState::keyActionSelectPreviousTarget, keycode_( OIS::KC_P ) ); - + registerUnDockedKeyAction_( "Camera", "1 Normal", &UnDockedState::keyActionCameraNormal, keycode_( OIS::KC_1 ) ); registerUnDockedKeyAction_( "Camera", "2 Look left", &UnDockedState::keyActionCameraLeft, @@ -78,8 +78,8 @@ keycode_( OIS::KC_5 ) ); registerUnDockedKeyAction_( "Camera", "6 Toggle mode", &UnDockedState::keyActionCameraToggle, keycode_( OIS::KC_6 ) ); - - /*! Actions for development, will removed later. */ + + /*! Actions for development, will removed later. */ registerUnDockedKeyAction_( "Development", "Toggle filtering", &UnDockedState::keyActionToggleFiltering_DEV, keycode_( OIS::KC_F ) ); registerUnDockedKeyAction_( "Development", "Toggle polygone", &UnDockedState::keyActionTogglePolygonMode_DEV, @@ -88,10 +88,15 @@ keycode_( OIS::KC_L, KEY_SHIFT ) ); registerUnDockedKeyAction_( "Development", "2 Decrease ambient light", &UnDockedState::keyActionDecreaseAmbientLight_DEV, keycode_( OIS::KC_L ) ); - registerUnDockedKeyAction_( "Development", "3 Increase time zoom", &UnDockedState::keyActionIncreaseTimeZoom_DEV, + + if ( !online ){ + registerUnDockedKeyAction_( "Development", "3 Increase time zoom", &UnDockedState::keyActionIncreaseTimeZoom_DEV, keycode_( OIS::KC_T, KEY_SHIFT ) ); - registerUnDockedKeyAction_( "Development", "4 Decrease time zoom", &UnDockedState::keyActionDecreaseTimeZoom_DEV, + registerUnDockedKeyAction_( "Development", "4 Decrease time zoom", &UnDockedState::keyActionDecreaseTimeZoom_DEV, keycode_( OIS::KC_T ) ); + registerUnDockedKeyAction_( "Development", "Spawn autodocking ai", &UnDockedState::keyActionSpawnAi_DEV, + keycode_( OIS::KC_F7 ) ); + } registerUnDockedKeyAction_( "Development", "5 Increase shader scheme", &UnDockedState::keyActionIncreaseShaderScheme_DEV, keycode_( OIS::KC_O, KEY_SHIFT ) ); registerUnDockedKeyAction_( "Development", "6 Decrease shader scheme", &UnDockedState::keyActionDecreaseShaderScheme_DEV, @@ -105,8 +110,7 @@ keycode_( OIS::KC_F4 ) ); registerUnDockedKeyAction_( "Development", "Selfdestruct", &UnDockedState::keyActionAvatarSelfDestruct_DEV, keycode_( OIS::KC_F8 ) ); - registerUnDockedKeyAction_( "Development", "Spawn autodocking ai", &UnDockedState::keyActionSpawnAi_DEV, - keycode_( OIS::KC_F7 ) ); + registerUnDockedKeyAction_( "Development", "Show infos", &UnDockedState::keyActionShowInfos_DEV, keycode_( OIS::KC_I, KEY_CONTROL ) ); registerUnDockedKeyAction_( "Development", "Show ecliptic", &UnDockedState::keyActionShowEcliptic_DEV, @@ -115,23 +119,23 @@ keycode_( OIS::KC_G, KEY_SHIFT ) ); registerUnDockedKeyAction_( "Development", "8 test dec", &UnDockedState::keyActionTmpDown_DEV, keycode_( OIS::KC_G ) ); - - /*! Actions for console. */ + + /*! Actions for console. */ consoleActionMap_[ keycode_( OIS::KC_SYSRQ ) ] = &Console::keyActionScreenshot; consoleActionMap_[ keycode_( OIS::KC_Q, KEY_CONTROL ) ]= &Console::keyActionShutdown_DEV; // consoleActionMap_[ keycode_( OIS::KC_F4, KEY_ALT ) ] = &Console::keyActionShutdown_DEV; } -void KeyMap::registerUnDockedKeyAction_( const std::string & category, const std::string & name, bool (UnDockedState::*action)( bool ), +void KeyMap::registerUnDockedKeyAction_( const std::string & category, const std::string & name, bool (UnDockedState::*action)( bool ), uint key1, uint key2 ){ unDockedKeyBindings_[ category ].insert( std::pair < std::string, std::pair < uint, uint > > ( name, std::pair< uint, uint >( key1, key2 ) ) ); unDockedKeyActions_[ name ] = action; - + unDockedActionMap_[ key1 ] = action; if ( key2 ) unDockedActionMap_[ key2 ] = action; } - - + + bool(UnDockedState::*KeyMap::unDockedKeyAction( const OIS::KeyEvent & e ))(bool) { uint key = keycode_( e.key, modifier_ ); if ( unDockedActionMap_.count( key ) > 0 ) return unDockedActionMap_[ key ]; @@ -143,25 +147,25 @@ if ( consoleActionMap_.count( key ) > 0 ) return consoleActionMap_[ key ]; return &Console::keyActionDoNothing; } - + std::string KeyMap::keycodeName( uint keycode ){ GlobalKeyModifier modifier = (GlobalKeyModifier)( keycode / 65565 ); uint key = keycode - modifier * 65565; - + std::string name; switch ( modifier ){ case KEY_CONTROL: name += "Ctrl-"; break; case KEY_SHIFT: name += "Shift-"; break; default: break; } - + std::string keyname( ResourceManager::getSingletonPtr()->inputManager->keybord()->getAsString( OIS::KeyCode( key ) ) ); if ( keyname != "Unknown" ){ name += keyname; } return name; } - + bool KeyMap::haveKeyBinding( uint keycode ){ if ( unDockedActionMap_.count( keycode ) || consoleActionMap_.count( keycode ) ){ return true; @@ -181,11 +185,11 @@ oldKeyCode = keyBinding->second.second; keyBinding->second.second = keycode; } - + if ( unDockedActionMap_.count( oldKeyCode ) ){ unDockedActionMap_.erase( oldKeyCode ); } - + unDockedActionMap_[ keycode ] = unDockedKeyActions_[ name ]; std::cout << " KeyMap::setKeyBinding: " << name << "->" << keycodeName( keycode ) << std::endl; break; @@ -194,7 +198,7 @@ } } } - + uint KeyMap::keycode_( uint key, GlobalKeyModifier modifier ){ return modifier * 65565 + key; } Modified: trunk/src/KeyMap.h =================================================================== --- trunk/src/KeyMap.h 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/src/KeyMap.h 2010-01-02 15:10:50 UTC (rev 1171) @@ -40,10 +40,10 @@ typedef std::map< std::string, std::map < std::string, std::pair< uint, uint > > > KeyBindingsMap; KeyMap(); - + ~KeyMap(); - void setDefaults(); + void setDefaults( bool online ); bool (UnDockedState::*unDockedKeyAction( const OIS::KeyEvent & e ))( bool ); @@ -52,36 +52,36 @@ void setGlobalKeyModifier( GlobalKeyModifier modifier ){ modifier_ = modifier; } GlobalKeyModifier globalKeyModifier( ) const { return modifier_; } - + std::map< std::string, std::map < std::string, std::pair< uint, uint > > > & unDockedKeyBindings() { return unDockedKeyBindings_; } - + /*! Return literal name for the key bindings. e.g. 'Shift-A', or 'Ctrl-B' */ std::string keycodeName( uint keycode ); - + void setLastKeycode( uint key ) { lastKeycode_ = keycode_( key, modifier_ ); } - + uint lastKeycode() const { return lastKeycode_; } - + void setKeyBinding( const std::string & name, uint keycode, uint key ); - + bool haveKeyBinding( uint keycode ); - + protected: - /*! Return unique key identifier. */ + /*! Return unique key identifier. */ uint keycode_( uint key, GlobalKeyModifier modifier = KEY_NONE ); - - void registerUnDockedKeyAction_( const std::string & category, const std::string & name, - bool (UnDockedState::*unDockedKeyAction)( bool ), + + void registerUnDockedKeyAction_( const std::string & category, const std::string & name, + bool (UnDockedState::*unDockedKeyAction)( bool ), uint key1, uint key2 = 0 ); std::map< uint, bool (UnDockedState::*)( bool ) > unDockedActionMap_; std::map< uint, bool (Console::*)( bool ) > consoleActionMap_; GlobalKeyModifier modifier_; - + uint lastKeycode_; - - // categorie < name, (key1, key2) > + + // categorie < name, (key1, key2) > KeyBindingsMap unDockedKeyBindings_; std::map < std::string, bool (UnDockedState::*)( bool ) > unDockedKeyActions_; Modified: trunk/src/MarketDialog.cpp =================================================================== --- trunk/src/MarketDialog.cpp 2010-01-02 15:03:47 UTC (rev 1170) +++ trunk/src/MarketDialog.cpp 2010-01-02 15:10:50 UTC (rev 1171) @@ -37,9 +37,9 @@ MarketDialog::MarketDialog( ) : BaseDialog( "dialogs/MarketDialog.layout" ){ - populateItemWidget( CEGUI::WindowManager::getSingleton().getWindow( "MarketWindow/ItemFrame" ), + populateItemWidget( CEGUI::WindowManager::getSingleton().getWindow( "MarketWindow/ItemFrame" ), marketItems_, marketItemWindowCol_, marketItemWindowRow_ ); - populateItemWidget( CEGUI::WindowManager::getSingleton().getWindow( "InventoryWindow/ItemFrame" ), + populateItemWidget( CEGUI::WindowManager::getSingleton().getWindow( "InventoryWindow/ItemFrame" ), inventItems_, inventItemWindowCol_, inventItemWindowRow_ ); setupEventHandlers(); @@ -156,9 +156,9 @@ bool lesserMass( const Entity * l, const Entity * r ) { return ( l->mass() < r->mass() ); } bool greaterMass( const Entity * l, const Entity * r ) { return ( l->mass() > r->mass() ); } -bool lesserName( const Entity * l, const Entity * r ) { return ( strCopyToLowerCase( l->name() ) < +bool lesserName( const Entity * l, const Entity * r ) { return ( strCopyToLowerCase( l->name() ) < strCopyToLowerCase( r->name() ) ); } -bool greaterName( const Entity * l, const Entity * r ) { return ( strCopyToLowerCase( l->name() ) > +bool greaterName( const Entity * l, const Entity * r ) { return ( strCopyToLowerCase( l->name() ) > strCopyToLowerCase( r->name() ) ); } bool lesserSize( const Entity * l, const Entity * r ) { return ( l->size() < r->size() ); } @@ -175,11 +175,11 @@ } else { CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"MarketWindow/UpButton")->show(); } - - std::vector < Entity * > items; - + + std::vector < Entity * > items; + items = ResourceManager::getSingleton().entityManager->allByCategory( selectedCategory_ ); - + switch ( sortBy_ ){ case Alphanumeric: if ( sortAscending_ ) sort( items.begin(), items.end(), &OpenGate::lesserName ); @@ -198,10 +198,10 @@ case Amount: break; } - + int maxRow = (int)ceil( (double)items.size() / marketItemWindowRow_ ); marketOffsetRow_ = min( marketOffsetRow_, maxRow ); - + if ( ( maxRow - marketOffsetRow_ ) > marketItemWindowRow_ ){ CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"MarketWindow/DownButton")->show(); } else { @@ -212,7 +212,7 @@ for ( int j = 0; j < marketItemWindowCol_; j ++ ){ unsigned int widgetCount = i * marketItemWindowCol_ + j; unsigned int itemCount = ( i + marketOffsetRow_ ) * marketItemWindowCol_ + j; - + if ( itemCount >= items.size() ) { fillShortItemWindow( marketItems_[ widgetCount ] ); } else { @@ -250,7 +250,7 @@ } int count = 0; - int startItemCount = inventOffsetRow_ * inventItemWindowCol_; + int startItemCount = inventOffsetRow_ * inventItemWindowCol_; int endItemCount = startItemCount + inventItemWindowRow_ * inventItemWindowCol_; int widgetCount = 0; @@ -297,10 +297,10 @@ textPrice = CEGUI::String( "c" + toStr( price ) ); image = item->ceguiSmallImageName(); icon = CEGUI::String("set:opengate image:IconSize" + toStr( item->size() ) ); - categoryIcon = CEGUI::String("set:opengate image:Icon" + - ResourceManager::getSingleton().entityManager->categoryName( item->entityType() ) + + categoryIcon = CEGUI::String("set:opengate image:Icon" + + ResourceManager::getSingleton().entityManager->categoryName( item->entityType() ) + toStr( item->factionID() ) ); - } + } win->setUserData( item ); win->setProperty( "Text", name ); CEGUI::WindowManager::getSingleton().getWindow( win->getName() + "MarketShortItemAmount" ) @@ -338,7 +338,7 @@ } else { CEGUI::WindowManager::getSingleton().getWindow( "MarketWindow/Sort/OrderHighlightImage" ) ->setPosition( CEGUI::WindowManager::getSingleton().getWindow( "MarketWindow/Sort/DescendOrderButton" )->getPosition() ); - + CEGUI::WindowManager::getSingleton().getWindow( "MarketWindow/Sort/AlphaAscendButton" )->hide(); CEGUI::WindowManager::getSingleton().getWindow( "MarketWindow/Sort/AlphaDescendButton" )->show(); CEGUI::WindowManager::getSingleton().getWindow( "MarketWindow/Sort/SizeAscendButton" )->hide(); @@ -393,7 +393,7 @@ renameClonedWindows( item, basename ); window->addChildWindow( item ); - item->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0, ( xBound + itemWidth ) * j ), + item->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0, ( xBound + itemWidth ) * j ), CEGUI::UDim( 0.0, yBound + ( yBound + itemHe... [truncated message content] |