diff --git a/.hgignore b/.hgignore index 8d030eedf2..20fdaa9a3e 100644 --- a/.hgignore +++ b/.hgignore @@ -12,6 +12,7 @@ tests/*.err *.idb *.pdb *.exp +___* .hg .hgignore .hgtags @@ -24,6 +25,7 @@ Thumbs.db *.mode1v3 *.exe *.vdi +Docs/doxygen PBProject/build Xcode/build src/build-* diff --git a/Docs/Changelog_SSCformat.txt b/Docs/Changelog_SSCformat.txt index ae2eb57362..60301667a0 100644 --- a/Docs/Changelog_SSCformat.txt +++ b/Docs/Changelog_SSCformat.txt @@ -9,6 +9,9 @@ change to JSON, but it is unsure if this will be done. Implement .ssc at your own risk. ________________________________________________________________________________ +[v0.52] - AJ +* Add CHARTSTYLE tag to NoteData section. + [v0.51] - AJ * Move VERSION tag to the first line. * Limit VERSION tag to two decimal places. diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 12e18fbbe5..25f54d49be 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -10,9 +10,57 @@ supported but exist anyways.) _____________________________________________________________________________ ================================================================================ -sm-ssc v1.2.2 | 201102?? +sm-ssc v1.2.3 | 201102?? -------------------------------------------------------------------------------- +20110222 +-------- +* [ScreenEdit] Display the Player Number for Routine mode. [Wolfman2000] +* [ScreenEdit] Add format string metrics for the right hand side of the editor. + [Wolfman2000] +* [ScreenGameplaySyncMachine] Allow themes to use either .ssc or .sm files. [AJ] + +20110221 +-------- +* Reverted ArrowSpacing back to 64 (which was the previous value). + Please re-adjust your speed mods accordingly. [AJ] +* [OptionRow] Added GetLayoutType() and GetSelectType() Lua bindings. [AJ] +* Fix .sm-style edits not being loaded. [AJ] +* [Common] Added OperatorMenuScreen metric. [AJ] + +================================================================================ +sm-ssc v1.2.2 | 20110220 +-------------------------------------------------------------------------------- + +20110219 +-------- +* [BPMDisplay] Added FormatString metric. [AJ] +* [GrooveRadar] Changed "Label#OffsetX/Y" metrics to "Label#X/Y". [AJ] +* [GrooveRadar] Fixed RadarFrame from not running commands on RadarFrame base. [AJ] +* [GrooveRadar] Removed RadarFrameTweenOnScreen and RadarFrameTweenOffScreen metrics. (Themers: Use RadarFrameOnCommand and RadarFrameOffCommand instead) [AJ] +* [GrooveRadar] Removed non-working PreDelayOnCommand, PostDelayOnCommand. (Themers: Use Label#OnCommand and Label#OffCommand instead.) [AJ] +* [ScreenOptions] Renamed "GetCurrentRow" Lua binding to "GetCurrentRowIndex". [AJ] +* [OptionRow] Added FirstItemGoesDown(), GetChoiceInRowWithFocus(PlayerNumber), + GetName(), GetNumChoices(), GetRowTitle(), HasFocus(PlayerNumber), + and OneChoiceForAllPlayers() Lua bindings. [AJ] +* [ScreenOptions] Added Change message (params: RowIndex, ChangedToExit). [AJ] +* [ScreenOptions] Added FocusedItemEndsScreen(PlayerNumber) and GetOptionRow(int) + Lua bindings. [AJ] +* [ScreenPlayerOptions] now derives from ScreenOptions, allowing it to get the + new ScreenOptions bindings. [AJ] + +20110218 +-------- +* [WheelBase] Added SetOpenSection Lua binding. [AJ] + +20110217 +-------- +* Allowed refreshing of Fonts again. [AJ] + +20110214 +-------- +* Added #CHARTSTYLE to .ssc format, mainly meant for Pad/Keyboard distinctions. [AJ] + 20110213 -------- * Life Difficulty 4 is now as difficult as Life 6 was. [AJ] diff --git a/Docs/Doxyfile b/Docs/Doxyfile new file mode 100644 index 0000000000..e2e1b5d78d --- /dev/null +++ b/Docs/Doxyfile @@ -0,0 +1,1722 @@ +# Doxyfile 1.7.3 + +# 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 = sm-ssc + +# 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 = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "StepMania Fork with more flexibility" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = ../icons/hicolor/48x48/apps/stepmania-ssc.png + +# 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 = doxygen + +# 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, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +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 = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# 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 if your file system +# 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 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 + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# 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 makes 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 + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# 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, union, or enum +# is documented as struct, union, or enum 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 in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# 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 namespaces 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 = NO + +# 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 FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# 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_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = 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 + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = 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 macro 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 macros 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 + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# 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 , where is the value of +# the FILE_VERSION_FILTER tag, and 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 = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# 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 + +# The WARN_NO_PARAMDOC option can be enabled 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 = YES + +# 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++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +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 \ + *.f90 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl + +# 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 = ../src/PitchDetectionTestUtil.cpp \ + ../src/PitchDetectionTestUtil.h \ + ../src/PitchDetectionTest.h \ + ../src/PitchDetectionTest.cpp + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system 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 , where +# is the value of the INPUT_FILTER tag, and 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 or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +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 + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# 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. + +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 +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# 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 documentation. + +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 = YES + +# 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 = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# 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 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_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# 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 compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = 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 CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# 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 + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# 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 [0,1..20]) +# that doxygen will group on one line in the generated HTML documentation. +# Note that a value of 0 will completely suppress the enum values from +# appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value 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 (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = 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 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# 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. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +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 = YES + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# 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 = YES + +# 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 = YES + +# 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 + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = 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 = YES + +# 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 = ../src/libjpeg + +# 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 that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these 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 also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# 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 + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 16 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# 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 and HAVE_DOT options 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 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 generate a 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, svg, gif or svg. +# 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 = /usr/local/graphviz-2.14/bin + +# 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 MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The 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 +# DOT_GRAPH_MAX_NODES 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, because dot on Windows does not +# seem to support this out of the box. 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 = NO + +# 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 diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml index 85cd618dd9..4f921c8a65 100644 --- a/Docs/Luadoc/Lua.xml +++ b/Docs/Luadoc/Lua.xml @@ -39,7 +39,6 @@ - @@ -775,8 +774,6 @@ - - @@ -856,6 +853,15 @@ + + + + + + + + + @@ -1074,9 +1080,11 @@ - + + + - + @@ -1236,8 +1244,8 @@ - + @@ -1348,6 +1356,7 @@ + @@ -1954,6 +1963,6 @@ - sm-ssc v1.2.1 - 2011-02-10 + sm-ssc v1.2.2 + 2011-02-21 diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index 173a5495d0..9fb419a4a8 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -2038,6 +2038,29 @@ Returns a table of noteskin names for the current gametype. + + + Returns true if the first item in the row goes down. + + + Returns an index of the choice in the row that player pn is on. + + + Returns the name of the OptionRow. + + + Returns the number of choices in this OptionRow. + + + Returns the row title string. + + + Returns true if this row is focused by player pn. + + + Returns true if this row forces one choice on all players. + + Sets the PaneDisplay from the GameState. @@ -2604,8 +2627,14 @@ Returns true if all active players are on the last options row. - - Returns the current row that player pn is on. + + Returns true if the specified player is on an items that ends the screen. + + + Returns the current row that player pn is on. (Was previously GetCurrentRow.) + + + Returns the specified OptionRow. @@ -3325,6 +3354,9 @@ Moves the wheel by n. + + Attempts to set the open section to sSection. + diff --git a/NoteSkins/dance/retrobar-splithand_whiteblue/Blue tap mine.redir b/NoteSkins/dance/retrobar-splithand_whiteblue/Blue tap mine.redir new file mode 100644 index 0000000000..34e34dbc86 --- /dev/null +++ b/NoteSkins/dance/retrobar-splithand_whiteblue/Blue tap mine.redir @@ -0,0 +1 @@ +_Tap Mine \ No newline at end of file diff --git a/NoteSkins/dance/retrobar-splithand_whiteblue/White tap mine.redir b/NoteSkins/dance/retrobar-splithand_whiteblue/White tap mine.redir new file mode 100644 index 0000000000..34e34dbc86 --- /dev/null +++ b/NoteSkins/dance/retrobar-splithand_whiteblue/White tap mine.redir @@ -0,0 +1 @@ +_Tap Mine \ No newline at end of file diff --git a/NoteSkins/pump/cmd-routine-p1/NoteSkin.lua b/NoteSkins/pump/cmd-routine-p1/NoteSkin.lua new file mode 100644 index 0000000000..1bbeae06d8 --- /dev/null +++ b/NoteSkins/pump/cmd-routine-p1/NoteSkin.lua @@ -0,0 +1,11 @@ +local Noteskin = ... or {} + +Noteskin.PartsToRotate = { + --["elemenu"] = true|false; + ["Roll Head Active"] = false; + ["Roll Head Inactive"] = false; + -- + ["Tap Note"] = false; +} + +return Noteskin \ No newline at end of file diff --git a/NoteSkins/pump/cmd-routine-p1/metrics.ini b/NoteSkins/pump/cmd-routine-p1/metrics.ini new file mode 100644 index 0000000000..9450d5ed0c --- /dev/null +++ b/NoteSkins/pump/cmd-routine-p1/metrics.ini @@ -0,0 +1,2 @@ +[Global] +FallbackNoteSkin=cmd \ No newline at end of file diff --git a/NoteSkins/pump/cmd/Center Fake Note (doubleres) 3x2.redir b/NoteSkins/pump/cmd/Center Fake Note (doubleres) 3x2.redir new file mode 100644 index 0000000000..616a4c45ef --- /dev/null +++ b/NoteSkins/pump/cmd/Center Fake Note (doubleres) 3x2.redir @@ -0,0 +1 @@ +Center Tap Note (doubleres) 3x2.png diff --git a/NoteSkins/pump/cmd/DownLeft Fake Note (doubleres) 3x2.redir b/NoteSkins/pump/cmd/DownLeft Fake Note (doubleres) 3x2.redir new file mode 100644 index 0000000000..e2420613bd --- /dev/null +++ b/NoteSkins/pump/cmd/DownLeft Fake Note (doubleres) 3x2.redir @@ -0,0 +1 @@ +DownLeft Tap Note (doubleres) 3x2.png diff --git a/NoteSkins/pump/cmd/DownRight Fake Note (doubleres) 3x2.redir b/NoteSkins/pump/cmd/DownRight Fake Note (doubleres) 3x2.redir new file mode 100644 index 0000000000..4794025bd0 --- /dev/null +++ b/NoteSkins/pump/cmd/DownRight Fake Note (doubleres) 3x2.redir @@ -0,0 +1 @@ +DownRight Tap Note (doubleres) 3x2.png diff --git a/NoteSkins/pump/cmd/UpLeft Fake Note (doubleres) 3x2.redir b/NoteSkins/pump/cmd/UpLeft Fake Note (doubleres) 3x2.redir new file mode 100644 index 0000000000..3f66d470df --- /dev/null +++ b/NoteSkins/pump/cmd/UpLeft Fake Note (doubleres) 3x2.redir @@ -0,0 +1 @@ +UpLeft Tap Note (doubleres) 3x2.png diff --git a/NoteSkins/pump/cmd/UpRight Fake Note (doubleres) 3x2.redir b/NoteSkins/pump/cmd/UpRight Fake Note (doubleres) 3x2.redir new file mode 100644 index 0000000000..ded273a4b8 --- /dev/null +++ b/NoteSkins/pump/cmd/UpRight Fake Note (doubleres) 3x2.redir @@ -0,0 +1 @@ +UpRight Tap Note (doubleres) 3x2.png diff --git a/NoteSkins/pump/complex/Center Fake Note 5x1 (doubleres).redir b/NoteSkins/pump/complex/Center Fake Note 5x1 (doubleres).redir new file mode 100644 index 0000000000..d0f3148ab0 --- /dev/null +++ b/NoteSkins/pump/complex/Center Fake Note 5x1 (doubleres).redir @@ -0,0 +1 @@ +Center Tap Note 5x1 (doubleres).png diff --git a/NoteSkins/pump/complex/DownLeft Fake Note 6x1 (doubleres).redir b/NoteSkins/pump/complex/DownLeft Fake Note 6x1 (doubleres).redir new file mode 100644 index 0000000000..0792534152 --- /dev/null +++ b/NoteSkins/pump/complex/DownLeft Fake Note 6x1 (doubleres).redir @@ -0,0 +1 @@ +DownLeft Tap Note 6x1 (doubleres).png diff --git a/NoteSkins/pump/complex/DownRight Fake Note 6x1 (doubleres).redir b/NoteSkins/pump/complex/DownRight Fake Note 6x1 (doubleres).redir new file mode 100644 index 0000000000..b277d2ba2f --- /dev/null +++ b/NoteSkins/pump/complex/DownRight Fake Note 6x1 (doubleres).redir @@ -0,0 +1 @@ +DownRight Tap Note 6x1 (doubleres).png diff --git a/NoteSkins/pump/complex/UpLeft Fake Note 6x1 (doubleres).redir b/NoteSkins/pump/complex/UpLeft Fake Note 6x1 (doubleres).redir new file mode 100644 index 0000000000..81890c8ddb --- /dev/null +++ b/NoteSkins/pump/complex/UpLeft Fake Note 6x1 (doubleres).redir @@ -0,0 +1 @@ +UpLeft Tap Note 6x1 (doubleres).png diff --git a/NoteSkins/pump/complex/UpRight Fake Note 6x1 (doubleres).redir b/NoteSkins/pump/complex/UpRight Fake Note 6x1 (doubleres).redir new file mode 100644 index 0000000000..9a82692de7 --- /dev/null +++ b/NoteSkins/pump/complex/UpRight Fake Note 6x1 (doubleres).redir @@ -0,0 +1 @@ +UpRight Tap Note 6x1 (doubleres).png diff --git a/NoteSkins/pump/default/Center Fake Note 3x2.redir b/NoteSkins/pump/default/Center Fake Note 3x2.redir new file mode 100644 index 0000000000..ae781b40a7 --- /dev/null +++ b/NoteSkins/pump/default/Center Fake Note 3x2.redir @@ -0,0 +1 @@ +Center Tap Note 3x2.png diff --git a/NoteSkins/pump/default/Center Tap Lift.lua b/NoteSkins/pump/default/Center Tap Lift.lua new file mode 100644 index 0000000000..4862995a70 --- /dev/null +++ b/NoteSkins/pump/default/Center Tap Lift.lua @@ -0,0 +1,3 @@ +return NOTESKIN:LoadActor("Center","Tap Note")..{ + InitCommand=cmd(pulse;effectclock,"beat";effecttiming,1,0.5,1,0.5;effectmagnitude,0.5,0.5,0.5); +}; \ No newline at end of file diff --git a/NoteSkins/pump/default/DownLeft Fake Note 3x2.redir b/NoteSkins/pump/default/DownLeft Fake Note 3x2.redir new file mode 100644 index 0000000000..30ea0f63da --- /dev/null +++ b/NoteSkins/pump/default/DownLeft Fake Note 3x2.redir @@ -0,0 +1 @@ +DownLeft Tap Note 3x2.png diff --git a/NoteSkins/pump/default/DownLeft Tap Lift.lua b/NoteSkins/pump/default/DownLeft Tap Lift.lua new file mode 100644 index 0000000000..ca88dfa0e9 --- /dev/null +++ b/NoteSkins/pump/default/DownLeft Tap Lift.lua @@ -0,0 +1,3 @@ +return NOTESKIN:LoadActor("DownLeft","Tap Note")..{ + InitCommand=cmd(pulse;effectclock,"beat";effecttiming,1,0.5,1,0.5;effectmagnitude,0.5,0.5,0.5) +}; \ No newline at end of file diff --git a/NoteSkins/pump/default/DownRight Fake Note 3x2.redir b/NoteSkins/pump/default/DownRight Fake Note 3x2.redir new file mode 100644 index 0000000000..f38d257377 --- /dev/null +++ b/NoteSkins/pump/default/DownRight Fake Note 3x2.redir @@ -0,0 +1 @@ +DownRight Tap Note 3x2.png diff --git a/NoteSkins/pump/default/DownRight Tap Lift.lua b/NoteSkins/pump/default/DownRight Tap Lift.lua new file mode 100644 index 0000000000..314bb97d5d --- /dev/null +++ b/NoteSkins/pump/default/DownRight Tap Lift.lua @@ -0,0 +1,3 @@ +return NOTESKIN:LoadActor("DownRight","Tap Note")..{ + InitCommand=cmd(pulse;effectclock,"beat";effecttiming,1,0.5,1,0.5;effectmagnitude,0.5,0.5,0.5) +}; \ No newline at end of file diff --git a/NoteSkins/pump/default/NoteSkin.lua b/NoteSkins/pump/default/NoteSkin.lua index a7abc397ba..6baf5572b7 100644 --- a/NoteSkins/pump/default/NoteSkin.lua +++ b/NoteSkins/pump/default/NoteSkin.lua @@ -20,6 +20,7 @@ Noteskin.ElementRedirs = { ["Roll Head Active"] = "Roll Head Active"; ["Roll Head Inactive"] = "Roll Head Active"; ["Tap Fake"] = "Tap Note"; + ["Tap Lift"] = "Tap Note"; -- ["Hold Topcap Inactive"] = "Hold Topcap Active"; ["Hold Body Inactive"] = "Hold Body Active"; @@ -94,7 +95,6 @@ local function func() end if sElement == "Explosion" - or sElement == "Tap Lift" or sElement == "Tap Mine" or sElement == "Receptor" then diff --git a/NoteSkins/pump/default/UpLeft Fake Note 3x2.redir b/NoteSkins/pump/default/UpLeft Fake Note 3x2.redir new file mode 100644 index 0000000000..b30612a556 --- /dev/null +++ b/NoteSkins/pump/default/UpLeft Fake Note 3x2.redir @@ -0,0 +1 @@ +UpLeft Tap Note 3x2.png diff --git a/NoteSkins/pump/default/UpLeft Tap Lift.lua b/NoteSkins/pump/default/UpLeft Tap Lift.lua new file mode 100644 index 0000000000..3b9f12dc29 --- /dev/null +++ b/NoteSkins/pump/default/UpLeft Tap Lift.lua @@ -0,0 +1,3 @@ +return NOTESKIN:LoadActor("UpLeft","Tap Note")..{ + InitCommand=cmd(pulse;effectclock,"beat";effecttiming,1,0.5,1,0.5;effectmagnitude,0.5,0.5,0.5) +}; \ No newline at end of file diff --git a/NoteSkins/pump/default/UpRight Fake Note 3x2.redir b/NoteSkins/pump/default/UpRight Fake Note 3x2.redir new file mode 100644 index 0000000000..de9255e5d6 --- /dev/null +++ b/NoteSkins/pump/default/UpRight Fake Note 3x2.redir @@ -0,0 +1 @@ +UpRight Tap Note 3x2.png diff --git a/NoteSkins/pump/default/UpRight Tap Lift.lua b/NoteSkins/pump/default/UpRight Tap Lift.lua new file mode 100644 index 0000000000..3653089be6 --- /dev/null +++ b/NoteSkins/pump/default/UpRight Tap Lift.lua @@ -0,0 +1,3 @@ +return NOTESKIN:LoadActor("UpRight","Tap Note")..{ + InitCommand=cmd(pulse;effectclock,"beat";effecttiming,1,0.5,1,0.5;effectmagnitude,0.5,0.5,0.5) +}; \ No newline at end of file diff --git a/NoteSkins/pump/frame5p/Center Fake Note 8x1 (doubleres).redir b/NoteSkins/pump/frame5p/Center Fake Note 8x1 (doubleres).redir new file mode 100644 index 0000000000..4ecb1daac0 --- /dev/null +++ b/NoteSkins/pump/frame5p/Center Fake Note 8x1 (doubleres).redir @@ -0,0 +1 @@ +Center Tap Note 8x1 (doubleres).png diff --git a/NoteSkins/pump/frame5p/DownLeft Fake Note 8x1 (doubleres).redir b/NoteSkins/pump/frame5p/DownLeft Fake Note 8x1 (doubleres).redir new file mode 100644 index 0000000000..fe54142c3e --- /dev/null +++ b/NoteSkins/pump/frame5p/DownLeft Fake Note 8x1 (doubleres).redir @@ -0,0 +1 @@ +DownLeft Tap Note 8x1 (doubleres).png diff --git a/NoteSkins/pump/frame5p/DownRight Fake Note 8x1 (doubleres).redir b/NoteSkins/pump/frame5p/DownRight Fake Note 8x1 (doubleres).redir new file mode 100644 index 0000000000..0a7ca4aee9 --- /dev/null +++ b/NoteSkins/pump/frame5p/DownRight Fake Note 8x1 (doubleres).redir @@ -0,0 +1 @@ +DownRight Tap Note 8x1 (doubleres).png diff --git a/NoteSkins/pump/frame5p/UpLeft Fake Note 8x1 (doubleres).redir b/NoteSkins/pump/frame5p/UpLeft Fake Note 8x1 (doubleres).redir new file mode 100644 index 0000000000..a2690031c4 --- /dev/null +++ b/NoteSkins/pump/frame5p/UpLeft Fake Note 8x1 (doubleres).redir @@ -0,0 +1 @@ +UpLeft Tap Note 8x1 (doubleres).png diff --git a/NoteSkins/pump/frame5p/UpRight Fake Note 8x1 (doubleres).redir b/NoteSkins/pump/frame5p/UpRight Fake Note 8x1 (doubleres).redir new file mode 100644 index 0000000000..19397f9cd6 --- /dev/null +++ b/NoteSkins/pump/frame5p/UpRight Fake Note 8x1 (doubleres).redir @@ -0,0 +1 @@ +UpRight Tap Note 8x1 (doubleres).png diff --git a/NoteSkins/pump/newextra/Center Fake Note 3x2.redir b/NoteSkins/pump/newextra/Center Fake Note 3x2.redir new file mode 100644 index 0000000000..ae781b40a7 --- /dev/null +++ b/NoteSkins/pump/newextra/Center Fake Note 3x2.redir @@ -0,0 +1 @@ +Center Tap Note 3x2.png diff --git a/NoteSkins/pump/newextra/DownLeft Fake Note 3x2.redir b/NoteSkins/pump/newextra/DownLeft Fake Note 3x2.redir new file mode 100644 index 0000000000..30ea0f63da --- /dev/null +++ b/NoteSkins/pump/newextra/DownLeft Fake Note 3x2.redir @@ -0,0 +1 @@ +DownLeft Tap Note 3x2.png diff --git a/NoteSkins/pump/newextra/DownRight Fake Note 3x2.redir b/NoteSkins/pump/newextra/DownRight Fake Note 3x2.redir new file mode 100644 index 0000000000..f38d257377 --- /dev/null +++ b/NoteSkins/pump/newextra/DownRight Fake Note 3x2.redir @@ -0,0 +1 @@ +DownRight Tap Note 3x2.png diff --git a/NoteSkins/pump/newextra/UpLeft Fake Note 3x2.redir b/NoteSkins/pump/newextra/UpLeft Fake Note 3x2.redir new file mode 100644 index 0000000000..b30612a556 --- /dev/null +++ b/NoteSkins/pump/newextra/UpLeft Fake Note 3x2.redir @@ -0,0 +1 @@ +UpLeft Tap Note 3x2.png diff --git a/NoteSkins/pump/newextra/UpRight Fake Note 3x2.redir b/NoteSkins/pump/newextra/UpRight Fake Note 3x2.redir new file mode 100644 index 0000000000..de9255e5d6 --- /dev/null +++ b/NoteSkins/pump/newextra/UpRight Fake Note 3x2.redir @@ -0,0 +1 @@ +UpRight Tap Note 3x2.png diff --git a/NoteSkins/pump/rhythm/_Center Fake Note 6x8.redir b/NoteSkins/pump/rhythm/_Center Fake Note 6x8.redir new file mode 100644 index 0000000000..68f151a5eb --- /dev/null +++ b/NoteSkins/pump/rhythm/_Center Fake Note 6x8.redir @@ -0,0 +1 @@ +_Center Tap Note 6x8.png diff --git a/NoteSkins/pump/rhythm/_DownLeft Fake Note 6x8.redir b/NoteSkins/pump/rhythm/_DownLeft Fake Note 6x8.redir new file mode 100644 index 0000000000..2b783801e2 --- /dev/null +++ b/NoteSkins/pump/rhythm/_DownLeft Fake Note 6x8.redir @@ -0,0 +1 @@ +_DownLeft Tap Note 6x8.png diff --git a/NoteSkins/pump/rhythm/_UpLeft Fake Note 6x8.redir b/NoteSkins/pump/rhythm/_UpLeft Fake Note 6x8.redir new file mode 100644 index 0000000000..0f333c38eb --- /dev/null +++ b/NoteSkins/pump/rhythm/_UpLeft Fake Note 6x8.redir @@ -0,0 +1 @@ +_UpLeft Tap Note 6x8.png diff --git a/NoteSkins/pump/simple/Center Fake Note 8x1.redir b/NoteSkins/pump/simple/Center Fake Note 8x1.redir new file mode 100644 index 0000000000..f606d36e06 --- /dev/null +++ b/NoteSkins/pump/simple/Center Fake Note 8x1.redir @@ -0,0 +1 @@ +Center Tap Note 8x1.png diff --git a/NoteSkins/pump/simple/DownLeft Fake Note 8x1.redir b/NoteSkins/pump/simple/DownLeft Fake Note 8x1.redir new file mode 100644 index 0000000000..2d86780dab --- /dev/null +++ b/NoteSkins/pump/simple/DownLeft Fake Note 8x1.redir @@ -0,0 +1 @@ +DownLeft Tap Note 8x1.png diff --git a/NoteSkins/pump/simple/DownRight Fake Note 8x1.redir b/NoteSkins/pump/simple/DownRight Fake Note 8x1.redir new file mode 100644 index 0000000000..a8b3a6e3ec --- /dev/null +++ b/NoteSkins/pump/simple/DownRight Fake Note 8x1.redir @@ -0,0 +1 @@ +DownRight Tap Note 8x1.png diff --git a/NoteSkins/pump/simple/UpLeft Fake Note 8x1.redir b/NoteSkins/pump/simple/UpLeft Fake Note 8x1.redir new file mode 100644 index 0000000000..bedac9a1e9 --- /dev/null +++ b/NoteSkins/pump/simple/UpLeft Fake Note 8x1.redir @@ -0,0 +1 @@ +UpLeft Tap Note 8x1.png diff --git a/NoteSkins/pump/simple/UpRight Fake Note 8x1.redir b/NoteSkins/pump/simple/UpRight Fake Note 8x1.redir new file mode 100644 index 0000000000..f5acbee926 --- /dev/null +++ b/NoteSkins/pump/simple/UpRight Fake Note 8x1.redir @@ -0,0 +1 @@ +UpRight Tap Note 8x1.png diff --git a/Themes/HelloWorld/BGAnimations/ScreenTitleMenu cancel.lua b/Themes/HelloWorld/BGAnimations/ScreenTitleMenu cancel.lua new file mode 100644 index 0000000000..8c25be1f11 --- /dev/null +++ b/Themes/HelloWorld/BGAnimations/ScreenTitleMenu cancel.lua @@ -0,0 +1,4 @@ +return Def.Quad{ + InitCommand=cmd(FullScreen;diffuse,color("#fffdf200")); + OnCommand=cmd(decelerate,1;diffusealpha,1); +}; \ No newline at end of file diff --git a/Themes/HelloWorld/BGAnimations/ScreenTitleMenu out.lua b/Themes/HelloWorld/BGAnimations/ScreenTitleMenu out.lua new file mode 100644 index 0000000000..fbcd53b75f --- /dev/null +++ b/Themes/HelloWorld/BGAnimations/ScreenTitleMenu out.lua @@ -0,0 +1,6 @@ +return Def.ActorFrame{ + Def.Quad{ + InitCommand=cmd(FullScreen;diffuse,color("#fffdf200")); + OnCommand=cmd(sleep,1.125;decelerate,0.875;diffusealpha,1); + }; +} \ No newline at end of file diff --git a/Themes/HelloWorld/BGAnimations/ScreenTitleMenu underlay.lua b/Themes/HelloWorld/BGAnimations/ScreenTitleMenu underlay.lua new file mode 100644 index 0000000000..f5e3c27de4 --- /dev/null +++ b/Themes/HelloWorld/BGAnimations/ScreenTitleMenu underlay.lua @@ -0,0 +1,72 @@ +-- This file returns an ActorFrame that holds a few objects. + +-- Since I like to collapse similar code, here is a simple example: +local lineWidth = SCREEN_WIDTH*0.9; +-- previously, I had this set to SCREEN_WIDTH*0.8 in each of the +-- Def.Quad blocks below. Now I just use lineWidth and I get two advantages: +-- 1) I can change it and it takes effect in multiple places. +-- 2) I get a human readable name out of it. +-- It makes your code easier to read and work with. + +local lineTime = 0.625; +-- same with this code. + +return Def.ActorFrame { + Def.ActorFrame{ + Name="Flourishes"; + -- it has to be 0.05 since 0.9 uses up space on both sides. + InitCommand=cmd(x,SCREEN_LEFT+(SCREEN_WIDTH*0.05);y,SCREEN_CENTER_Y;); + + Def.Quad{ + Name="Red"; + InitCommand=cmd(horizalign,left;zoomto,0,4;diffuse,color("#DA8989");diffuserightedge,color("#FFBBBB")); + OnCommand=cmd(sleep,0.1;linear,lineTime;zoomx,lineWidth); + }; + + Def.Quad{ + Name="Yellow"; + InitCommand=cmd(y,4;horizalign,left;zoomto,0,4;diffuse,color("#DAD989");diffuserightedge,color("#FFFCBB")); + OnCommand=cmd(sleep,0.05;linear,lineTime;zoomx,lineWidth); + }; + + Def.Quad{ + Name="Blue"; + InitCommand=cmd(y,8;horizalign,left;zoomto,0,4;diffuse,color("#89C6DA");diffuserightedge,color("#BBEEFF")); + OnCommand=cmd(linear,lineTime;zoomx,lineWidth); + }; + }; + + -- LoadActor() is used to automatically load objects. + -- You'll be using it a lot. + + -- THEME:GetPathG() gets a file from the Graphics folder. + -- What graphic depends on the arguments. + -- There must always be two, and there usually is a space between the + -- first and second, unless you perform a trick like this: + LoadActor( THEME:GetPathG("","_common/_logo") ) .. { + -- the InitCommand puts the logo 44 pixels above vertical center + -- and moves it 60 pixels to the left of horizontal center. + -- diffusealpha,0 makes the object invisible, + -- which is handy for transitions... + InitCommand=cmd(x,SCREEN_CENTER_X*0.8125;y,SCREEN_CENTER_Y-44;diffusealpha,0;); + -- ...as we see in the OnCommand. linear means to perform the next + -- commands over a span of time (in seconds). + -- diffusealpha,1 makes the logo fade in when applied here. + OnCommand=cmd(linear,0.5;diffusealpha,1;); + }; + + -- Creative Commons logo, using a local file in the same directory: + LoadActor( "creativecommons" )..{ + InitCommand=cmd(x,SCREEN_LEFT+64;y,SCREEN_BOTTOM-48;Real); + OnCommand=cmd(addy,32;cropbottom,1;fadebottom,1;decelerate,0.8;cropbottom,0;fadebottom,0;addy,-32); + }; + -- Making a cheap reflection effect for the sake of showing off the fov and + -- vanishpoint commands on ActorFrames. + Def.ActorFrame{ + InitCommand=cmd(fov,45;vanishpoint,SCREEN_LEFT+64,SCREEN_BOTTOM-24;); + LoadActor( "creativecommons" )..{ + InitCommand=cmd(x,SCREEN_LEFT+64;y,SCREEN_BOTTOM-24;valign,0;zoomy,-0.6;rotationx,-60;diffusealpha,0.6;Real;); + OnCommand=cmd(croptop,1;fadetop,0;decelerate,0.8;croptop,0;fadetop,1;); + }; + }; +}; \ No newline at end of file diff --git a/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements background.lua b/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements background.lua new file mode 100644 index 0000000000..ee69cb6ab6 --- /dev/null +++ b/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements background.lua @@ -0,0 +1,8 @@ +-- this file returns a single quad that represents the background of most screens in the theme. +return Def.Quad{ + -- FullScreen is defined in Themes/_fallback/Scripts/02 Actor.lua in sm-ssc. + + -- colors can either be entered as hex ("#FFFFFFFF") or 0..1 ("1.0,1.0,1.0,1.0") + -- where the values are Red, Green, Blue, and Alpha (transparency). + InitCommand=cmd(FullScreen;diffuse,color("#fffdf2")); +}; \ No newline at end of file diff --git a/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements cancel.redir b/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements cancel.redir new file mode 100644 index 0000000000..8f2a65c2ae --- /dev/null +++ b/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements cancel.redir @@ -0,0 +1 @@ +ScreenWithMenuElements out \ No newline at end of file diff --git a/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements decorations.lua b/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements decorations.lua new file mode 100644 index 0000000000..ecfb1b0a2d --- /dev/null +++ b/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements decorations.lua @@ -0,0 +1,8 @@ +-- ScreenWithMenuElements decorations is a very important file, as it will put a +-- decorations layer on pretty much every screen. +local t = Def.ActorFrame{}; + +t[#t+1] = StandardDecorationFromFileOptional("Header","Header"); +--t[#t+1] = StandardDecorationFromFileOptional("Footer","Footer"); + +return t; \ No newline at end of file diff --git a/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements in.lua b/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements in.lua new file mode 100644 index 0000000000..904860a60c --- /dev/null +++ b/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements in.lua @@ -0,0 +1,6 @@ +return Def.ActorFrame{ + Def.Quad{ + InitCommand=cmd(FullScreen;diffuse,color("#fffdf2FF")); + OnCommand=cmd(decelerate,0.75;diffusealpha,0); + }; +}; \ No newline at end of file diff --git a/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements out.lua b/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements out.lua new file mode 100644 index 0000000000..0952605a35 --- /dev/null +++ b/Themes/HelloWorld/BGAnimations/ScreenWithMenuElements out.lua @@ -0,0 +1,6 @@ +return Def.ActorFrame{ + Def.Quad{ + InitCommand=cmd(FullScreen;diffuse,color("#fffdf200")); + OnCommand=cmd(decelerate,0.875;diffusealpha,1); + }; +} \ No newline at end of file diff --git a/Themes/HelloWorld/BGAnimations/_wait.lua b/Themes/HelloWorld/BGAnimations/_wait.lua new file mode 100644 index 0000000000..1c59852cfd --- /dev/null +++ b/Themes/HelloWorld/BGAnimations/_wait.lua @@ -0,0 +1,4 @@ +local time = ... +if not time then time = 1.0 end + +return Def.Actor{ OnCommand=cmd(sleep,time); }; \ No newline at end of file diff --git a/Themes/HelloWorld/BGAnimations/creativecommons.png b/Themes/HelloWorld/BGAnimations/creativecommons.png new file mode 100644 index 0000000000..dece7939b5 Binary files /dev/null and b/Themes/HelloWorld/BGAnimations/creativecommons.png differ diff --git a/Themes/HelloWorld/Fonts/_frutiger roman 24px [alt] 12x11.png b/Themes/HelloWorld/Fonts/_frutiger roman 24px [alt] 12x11.png new file mode 100644 index 0000000000..53d4fc7464 Binary files /dev/null and b/Themes/HelloWorld/Fonts/_frutiger roman 24px [alt] 12x11.png differ diff --git a/Themes/HelloWorld/Fonts/_frutiger roman 24px [main-stroke] 16x16.png b/Themes/HelloWorld/Fonts/_frutiger roman 24px [main-stroke] 16x16.png new file mode 100644 index 0000000000..ed5d753593 Binary files /dev/null and b/Themes/HelloWorld/Fonts/_frutiger roman 24px [main-stroke] 16x16.png differ diff --git a/Themes/HelloWorld/Fonts/_frutiger roman 24px [main] 16x16.png b/Themes/HelloWorld/Fonts/_frutiger roman 24px [main] 16x16.png new file mode 100644 index 0000000000..1963076070 Binary files /dev/null and b/Themes/HelloWorld/Fonts/_frutiger roman 24px [main] 16x16.png differ diff --git a/Themes/HelloWorld/Fonts/_frutiger roman 24px.ini b/Themes/HelloWorld/Fonts/_frutiger roman 24px.ini new file mode 100644 index 0000000000..7734e7e4a8 --- /dev/null +++ b/Themes/HelloWorld/Fonts/_frutiger roman 24px.ini @@ -0,0 +1,392 @@ +[main] +Baseline=23 +Top=6 +LineSpacing=28 +DrawExtraPixelsLeft=1 +DrawExtraPixelsRight=0 +AdvanceExtraPixels=0 +0=10 +1=10 +2=10 +3=10 +4=10 +5=10 +6=10 +7=10 +8=10 +9=10 +10=10 +11=10 +12=10 +13=10 +14=10 +15=10 +16=10 +17=10 +18=10 +19=10 +20=10 +21=10 +22=10 +23=10 +24=10 +25=10 +26=10 +27=10 +28=10 +29=10 +30=10 +31=10 +32=7 +33=9 +34=13 +35=13 +36=13 +37=24 +38=17 +39=7 +40=8 +41=8 +42=13 +43=14 +44=7 +45=8 +46=7 +47=7 +48=13 +49=13 +50=13 +51=13 +52=13 +53=13 +54=13 +55=13 +56=13 +57=13 +58=7 +59=7 +60=14 +61=14 +62=14 +63=12 +64=19 +65=17 +66=15 +67=15 +68=17 +69=13 +70=12 +71=17 +72=17 +73=7 +74=9 +75=16 +76=12 +77=23 +78=17 +79=19 +80=13 +81=19 +82=15 +83=12 +84=13 +85=17 +86=16 +87=24 +88=16 +89=16 +90=13 +91=8 +92=7 +93=8 +94=14 +95=12 +96=7 +97=13 +98=15 +99=11 +100=15 +101=13 +102=9 +103=15 +104=15 +105=7 +106=7 +107=13 +108=7 +109=21 +110=15 +111=15 +112=15 +113=15 +114=9 +115=9 +116=9 +117=15 +118=12 +119=20 +120=12 +121=12 +122=12 +123=8 +124=5 +125=8 +126=14 +127=10 +128=13 +129=10 +130=7 +131=13 +132=13 +133=24 +134=13 +135=13 +136=7 +137=24 +138=12 +139=7 +140=23 +141=10 +142=13 +143=10 +144=10 +145=7 +146=7 +147=13 +148=13 +149=12 +150=12 +151=24 +152=7 +153=24 +154=9 +155=7 +156=23 +157=12 +158=10 +159=16 +160=7 +161=9 +162=13 +163=13 +164=13 +165=13 +166=5 +167=13 +168=7 +169=19 +170=9 +171=13 +172=14 +173=8 +174=19 +175=7 +176=10 +177=14 +178=9 +179=9 +180=7 +181=15 +182=14 +183=7 +184=7 +185=9 +186=10 +187=13 +188=20 +189=20 +190=20 +191=12 +192=17 +193=17 +194=17 +195=17 +196=17 +197=17 +198=23 +199=15 +200=13 +201=13 +202=13 +203=13 +204=7 +205=7 +206=7 +207=7 +208=17 +209=17 +210=19 +211=19 +212=19 +213=19 +214=19 +215=14 +216=19 +217=17 +218=17 +219=17 +220=17 +221=16 +222=13 +223=15 +224=13 +225=13 +226=13 +227=13 +228=13 +229=13 +230=21 +231=11 +232=13 +233=13 +234=13 +235=13 +236=7 +237=7 +238=7 +239=7 +240=15 +241=15 +242=15 +243=15 +244=15 +245=15 +246=15 +247=14 +248=15 +249=15 +250=15 +251=15 +252=15 +253=12 +254=15 +255=12 +[alt] +0=10 +1=10 +2=10 +3=10 +4=10 +5=10 +6=10 +7=10 +8=10 +9=10 +10=10 +11=10 +12=10 +13=10 +14=10 +15=10 +16=10 +17=10 +18=10 +19=10 +20=10 +21=10 +22=10 +23=10 +24=10 +25=10 +26=10 +27=10 +28=10 +29=10 +30=10 +31=10 +32=7 +33=12 +34=7 +35=12 +36=13 +37=10 +38=11 +39=13 +40=7 +41=12 +42=11 +43=9 +44=11 +45=8 +46=13 +47=11 +48=10 +49=11 +50=7 +51=7 +52=7 +53=7 +54=9 +55=7 +56=7 +57=9 +58=9 +59=7 +60=8 +61=7 +62=12 +63=8 +64=13 +65=17 +66=17 +67=12 +68=17 +69=10 +70=12 +71=15 +72=12 +73=13 +74=11 +75=13 +76=11 +77=7 +78=7 +79=13 +80=13 +81=13 +82=13 +83=19 +84=19 +85=13 +86=19 +87=14 +88=13 +89=12 +90=17 +91=12 +92=17 +93=16 +94=9 +95=15 +96=7 +97=13 +98=13 +99=11 +100=13 +101=5 +102=9 +103=11 +104=9 +105=13 +106=10 +107=13 +108=10 +109=7 +110=7 +111=13 +112=11 +113=11 +114=11 +115=15 +116=15 +117=11 +118=15 +119=14 +120=7 +121=11 +122=15 +123=11 +124=15 +125=12 +126=6 +127=7 diff --git a/Themes/HelloWorld/Graphics/ScreenGuideMain header.lua b/Themes/HelloWorld/Graphics/ScreenGuideMain header.lua new file mode 100644 index 0000000000..7713dc01c6 --- /dev/null +++ b/Themes/HelloWorld/Graphics/ScreenGuideMain header.lua @@ -0,0 +1,23 @@ +local t = Def.ActorFrame{ + Def.Quad{ + InitCommand=cmd(zoomto,SCREEN_WIDTH,120;diffuse,color("#EEF4FFCC")); + }; + Def.ActorFrame{ + InitCommand=cmd(y,16); + LoadFont("_frutiger roman 24px")..{ + Name="Header"; + Text=THEME:GetString("ScreenGuideMain","Header"); + InitCommand=cmd(x,-312;y,-50;halign,0;diffuse,color("#111111FF");diffusetopedge,color("#11111188");shadowlength,-1;shadowcolor,color("#FFFFFF44")); + }; + Def.Quad{ + InitCommand=cmd(zoomto,SCREEN_WIDTH*0.975,2;y,-32;diffuse,color("#111111FF");diffusetopedge,color("#11111188");shadowlength,-1;shadowcolor,color("#FFFFFF44");fadeleft,0.1;faderight,0.625); + }; + LoadFont("_frutiger roman 24px")..{ + Name="Header"; + Text=THEME:GetString("ScreenGuideMain","Explanation"); + InitCommand=cmd(x,-312;y,-24;align,0,0;diffuse,color("#111111FF");zoom,0.65;wrapwidthpixels,(SCREEN_WIDTH)*1.45); + }; + }; +}; + +return t; \ No newline at end of file diff --git a/Themes/HelloWorld/Graphics/ScreenGuideMain scroll.lua b/Themes/HelloWorld/Graphics/ScreenGuideMain scroll.lua new file mode 100644 index 0000000000..9fcef3ff79 --- /dev/null +++ b/Themes/HelloWorld/Graphics/ScreenGuideMain scroll.lua @@ -0,0 +1,40 @@ +local gc = Var("GameCommand") +local itemName = gc:GetName() + +local t = Def.ActorFrame{ + -- focused frame + LoadActor( THEME:GetPathG("SectionMenu","ItemFocused") )..{ + GainFocusCommand=cmd(decelerate,0.5;diffusealpha,1); + LoseFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,0); + }; + -- unfocused + LoadActor( THEME:GetPathG("SectionMenu","ItemUnfocused") )..{ + GainFocusCommand=cmd(decelerate,0.5;diffusealpha,0); + LoseFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1); + }; + + LoadActor( THEME:GetPathG("_section", "Guide") )..{ + InitCommand=cmd(x,-250;y,-24;Real;halign,0); + GainFocusCommand=cmd(decelerate,0.5;diffusealpha,0.9); + LoseFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,0.45); + }; + + Def.ActorFrame{ + LoadFont("_frutiger roman 24px")..{ + Name="SectionName"; + Text=THEME:GetString("ScreenGuideMain",itemName); + InitCommand=cmd(x,-250;y,-6;halign,0;diffuse,color("#222222FF")); + GainFocusCommand=cmd(decelerate,0.5;diffusealpha,1); + LoseFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,0.5); + }; + LoadFont("_frutiger roman 24px")..{ + Name="SectionDesc"; + Text=THEME:GetString("ScreenGuideMain",itemName.."Desc"); + InitCommand=cmd(x,-248;y,10;align,0,0;diffuse,color("#222222FF");zoom,0.5); + GainFocusCommand=cmd(decelerate,0.5;diffusealpha,1); + LoseFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,0.5); + }; + }; +}; + +return t; \ No newline at end of file diff --git a/Themes/HelloWorld/Graphics/ScreenReferenceMain header.lua b/Themes/HelloWorld/Graphics/ScreenReferenceMain header.lua new file mode 100644 index 0000000000..9d1ecd1068 --- /dev/null +++ b/Themes/HelloWorld/Graphics/ScreenReferenceMain header.lua @@ -0,0 +1,23 @@ +local t = Def.ActorFrame{ + Def.Quad{ + InitCommand=cmd(zoomto,SCREEN_WIDTH,96;diffuse,color("#EEF4FFCC")); + }; + Def.ActorFrame{ + InitCommand=cmd(y,12); + LoadFont("_frutiger roman 24px")..{ + Name="Header"; + Text=THEME:GetString("ScreenReferenceMain","Header"); + InitCommand=cmd(x,-312;y,-34;halign,0;diffuse,color("#111111FF");diffusetopedge,color("#11111188");shadowlength,-1;shadowcolor,color("#FFFFFF44")); + }; + Def.Quad{ + InitCommand=cmd(zoomto,SCREEN_WIDTH*0.975,2;y,-20;diffuse,color("#111111FF");diffusetopedge,color("#11111188");shadowlength,-1;shadowcolor,color("#FFFFFF44");fadeleft,0.1;faderight,0.625); + }; + LoadFont("_frutiger roman 24px")..{ + Name="Header"; + Text=THEME:GetString("ScreenReferenceMain","Explanation"); + InitCommand=cmd(x,-312;y,-14;align,0,0;diffuse,color("#111111FF");zoom,0.65;wrapwidthpixels,(SCREEN_WIDTH)*1.45); + }; + }; +}; + +return t; \ No newline at end of file diff --git a/Themes/HelloWorld/Graphics/ScreenReferenceMain scroll.lua b/Themes/HelloWorld/Graphics/ScreenReferenceMain scroll.lua new file mode 100644 index 0000000000..9da67b9f01 --- /dev/null +++ b/Themes/HelloWorld/Graphics/ScreenReferenceMain scroll.lua @@ -0,0 +1,40 @@ +local gc = Var("GameCommand") +local itemName = gc:GetName() + +local t = Def.ActorFrame{ + -- focused frame + LoadActor( THEME:GetPathG("SectionMenu","ItemFocused") )..{ + GainFocusCommand=cmd(decelerate,0.5;diffusealpha,1); + LoseFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,0); + }; + -- unfocused + LoadActor( THEME:GetPathG("SectionMenu","ItemUnfocused") )..{ + GainFocusCommand=cmd(decelerate,0.5;diffusealpha,0); + LoseFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1); + }; + + LoadActor( THEME:GetPathG("_section", "Reference") )..{ + InitCommand=cmd(x,-250;y,-24;Real;halign,0); + GainFocusCommand=cmd(decelerate,0.5;diffusealpha,0.9); + LoseFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,0.45); + }; + + Def.ActorFrame{ + LoadFont("_frutiger roman 24px")..{ + Name="SectionName"; + Text=THEME:GetString("ScreenReferenceMain",itemName); + InitCommand=cmd(x,-250;y,-6;halign,0;diffuse,color("#222222FF")); + GainFocusCommand=cmd(decelerate,0.5;diffusealpha,1); + LoseFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,0.5); + }; + LoadFont("_frutiger roman 24px")..{ + Name="SectionDesc"; + Text=THEME:GetString("ScreenReferenceMain",itemName.."Desc"); + InitCommand=cmd(x,-248;y,10;align,0,0;diffuse,color("#222222FF");zoom,0.5); + GainFocusCommand=cmd(decelerate,0.5;diffusealpha,1); + LoseFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,0.5); + }; + }; +}; + +return t; \ No newline at end of file diff --git a/Themes/HelloWorld/Graphics/ScreenTitleMenu scroll.lua b/Themes/HelloWorld/Graphics/ScreenTitleMenu scroll.lua new file mode 100644 index 0000000000..bff37dd9e8 --- /dev/null +++ b/Themes/HelloWorld/Graphics/ScreenTitleMenu scroll.lua @@ -0,0 +1,35 @@ +-- This file is used to define how the items should look on ScreenTitleMenu. +-- The syntax is different because I took this code from moonlight. :) + +--[[ +Concepts used: +* THEME:GetString(screen,string) +* zoom +* shadowlength +* diffuse +* halign (0 = left, 0.5 = middle, 1 = right) +* strokecolor +* stoptweening +* accelerate +--]] + +-- this is used as a shorthand for GameCommand. +local gc = Var("GameCommand") + +local t = Def.ActorFrame{ + LoadFont( "_frutiger roman" ) ..{ + -- This line tries to find a corresponding line in the current language + -- ini file; If it doesn't, (and you haven't disabled error messages,) + -- then an error will pop up telling you where you need to add the + -- string. + Text=THEME:GetString( 'ScreenTitleMenu', gc:GetText() ); + InitCommand=cmd(zoom,0.85;y,-1;shadowlength,0;diffuse,color("#000000");halign,1;strokecolor,color("0,0,0,0");); + DisabledCommand=cmd( diffuse,color("0.45,0,0,1") ); + GainFocusCommand=cmd(stoptweening;accelerate,0.15;diffuse,color("#000000");strokecolor,color("0.85,0.9,1,0.75");); + LoseFocusCommand=cmd(stoptweening;accelerate,0.2;diffuse,color("#888888");strokecolor,color("0,0,0,0");); + OffFocusedCommand=cmd(sleep,1;decelerate,1;addx,-32;diffuse,color("#FF0000");); + OffUnfocusedCommand=cmd(sleep,0.2*gc:GetIndex();linear,0.5;addx,SCREEN_CENTER_X;); + }; +}; + +return t; \ No newline at end of file diff --git a/Themes/HelloWorld/Graphics/ScreenWithMenuElements header.lua b/Themes/HelloWorld/Graphics/ScreenWithMenuElements header.lua new file mode 100644 index 0000000000..71b91300bd --- /dev/null +++ b/Themes/HelloWorld/Graphics/ScreenWithMenuElements header.lua @@ -0,0 +1,4 @@ +-- temporary +local t = Def.ActorFrame{}; + +return t; \ No newline at end of file diff --git a/Themes/HelloWorld/Graphics/SectionMenu ItemFocused.png b/Themes/HelloWorld/Graphics/SectionMenu ItemFocused.png new file mode 100644 index 0000000000..c2340e1f3d Binary files /dev/null and b/Themes/HelloWorld/Graphics/SectionMenu ItemFocused.png differ diff --git a/Themes/HelloWorld/Graphics/SectionMenu ItemUnfocused.png b/Themes/HelloWorld/Graphics/SectionMenu ItemUnfocused.png new file mode 100644 index 0000000000..77cd6b9733 Binary files /dev/null and b/Themes/HelloWorld/Graphics/SectionMenu ItemUnfocused.png differ diff --git a/Themes/HelloWorld/Graphics/_common/_logo.png b/Themes/HelloWorld/Graphics/_common/_logo.png new file mode 100644 index 0000000000..c025372429 Binary files /dev/null and b/Themes/HelloWorld/Graphics/_common/_logo.png differ diff --git a/Themes/HelloWorld/Graphics/_section Guide.png b/Themes/HelloWorld/Graphics/_section Guide.png new file mode 100644 index 0000000000..18cd4a69a8 Binary files /dev/null and b/Themes/HelloWorld/Graphics/_section Guide.png differ diff --git a/Themes/HelloWorld/Graphics/_section Reference.png b/Themes/HelloWorld/Graphics/_section Reference.png new file mode 100644 index 0000000000..a5d7c0b2b2 Binary files /dev/null and b/Themes/HelloWorld/Graphics/_section Reference.png differ diff --git a/Themes/HelloWorld/Graphics/_section Tutorial.png b/Themes/HelloWorld/Graphics/_section Tutorial.png new file mode 100644 index 0000000000..a0fc39758c Binary files /dev/null and b/Themes/HelloWorld/Graphics/_section Tutorial.png differ diff --git a/Themes/HelloWorld/Languages/en.ini b/Themes/HelloWorld/Languages/en.ini new file mode 100644 index 0000000000..6bce89dec7 --- /dev/null +++ b/Themes/HelloWorld/Languages/en.ini @@ -0,0 +1,43 @@ +[Common] +WindowTitle=Hello World (and other sm-ssc theming examples) + +[ScreenTitleMenu] +Guide=Guide +Reference=Reference +Tutorial=Tutorials + +[ScreenGuideMain] +Header=Guide +Explanation=The Guide section is meant for beginners who may not know the ins and outs of the StepMania theming system. It is also useful for themers coming from earlier versions of StepMania, as some things have changed in sm-ssc. + +Metrics=Metrics +MetricsDesc=Metrics and Languages (since they're similar). +Fonts=Fonts +FontsDesc=Dealing with fonts. +Graphics=Graphics +GraphicsDesc=The Graphics folder and what goes in there. +BGAnims=BGAnimations +BGAnimsDesc=Bee Gees animations +Sounds=Sounds +SoundsDesc=Music and sound effects. +Scripts=Scripts +ScriptsDesc=Lua scripting. +Other=Other +OtherDesc=Things like PreferredSort and ScreenHowToPlay/ScreenGameplaySyncMachine steps. +NoteSkins=NoteSkins +NoteSkinsDesc=NoteSkin creation involves knowing the theming system, somewhat. +Announcers=Announcers +AnnouncersDesc=The lost art of announcers, and how to “properly†make one. +Characters=Characters +CharactersDesc=Three-dimensional characters dancing in Gameplay. Modeling skills not included. + +[ScreenReferenceMain] +Header=Reference +Explanation=This section contains reference material. It is meant for themers who already somewhat know what they are looking for. + +Screens=Screens +ScreensDesc=A reference of all of sm-ssc's available screens. +Managers=Managers and Singletons +ManagersDesc=Various things that end in "Manager" (and sometimes not). +Classes=Classes +ClassesDesc=The classes that make up some of your favorite elements. \ No newline at end of file diff --git a/Themes/HelloWorld/ThemeInfo.ini b/Themes/HelloWorld/ThemeInfo.ini new file mode 100644 index 0000000000..0948fe30e1 --- /dev/null +++ b/Themes/HelloWorld/ThemeInfo.ini @@ -0,0 +1,6 @@ +# [en] ThemeInfo is used to set the theme's name (as it appears in the options +# menu), as well as the author (which shows up on ScreenInit, assuming you use it +# in your theme). +[ThemeInfo] +DisplayName=Hello World +Author=Various Contributors \ No newline at end of file diff --git a/Themes/HelloWorld/_assets/SectionMenu item.psd b/Themes/HelloWorld/_assets/SectionMenu item.psd new file mode 100644 index 0000000000..e8bcee4f06 Binary files /dev/null and b/Themes/HelloWorld/_assets/SectionMenu item.psd differ diff --git a/Themes/HelloWorld/_assets/_logo.psd b/Themes/HelloWorld/_assets/_logo.psd new file mode 100644 index 0000000000..257cc33e58 Binary files /dev/null and b/Themes/HelloWorld/_assets/_logo.psd differ diff --git a/Themes/HelloWorld/_assets/hello world.psd b/Themes/HelloWorld/_assets/hello world.psd new file mode 100644 index 0000000000..1af3758ee5 Binary files /dev/null and b/Themes/HelloWorld/_assets/hello world.psd differ diff --git a/Themes/HelloWorld/metrics.ini b/Themes/HelloWorld/metrics.ini new file mode 100644 index 0000000000..1101c2730f --- /dev/null +++ b/Themes/HelloWorld/metrics.ini @@ -0,0 +1,281 @@ +# Hello World +# (and other sm-ssc theming examples) +# A theme by various contributors. Sign your comments if you wish. + +# contributors: +# AJ Kelly of the Spinal Shark Collective (http://ssc.ajworld.net/) + +################################################################################ +# +[Common] +# InitialScreen defines the starting screen of the theme. +# It can either be a string or a Lua function that returns a string. +InitialScreen="ScreenTitleMenu" + +################################################################################ +# [base] Base Screens aren't concrete, but are referenced by concrete screens. + +# Pretty much every screen derives from this one. Adding decorations to it is +# one of the first things a themer does. +[ScreenWithMenuElements] +ShowHeader=true +HeaderX=SCREEN_CENTER_X +HeaderY=SCREEN_TOP+24 +HeaderOnCommand=draworder,100 + +ShowFooter=false +FooterX=SCREEN_CENTER_X +FooterY=SCREEN_BOTTOM-24 +FooterOnCommand=draworder,100 + +ShowCreditDisplay=false + +################################################################################ +# [overlay] Overlay screens sit on top of everything. + +################################################################################ +# [core] Core Screens; these are the concrete implementations. + +# ScreenTitleMenu is the first screen you see in this theme, thanks to the +# [Common] InitialScreen metric being changed. +[ScreenTitleMenu] +# PrevScreen is set to make sure nothing gets messed up. +PrevScreen="ScreenTitleMenu" +# These settings are used to disable the attract sequence: +IdleTimeoutSeconds=-1 +IdleTimeoutScreen="ScreenTitleMenu" + +# no header or footer here +ShowHeader=false +ShowFooter=false + +# These settings define what options appear on the menu and what commands are +# run when they are selected: +ChoiceNames="1,2,3,4,5" +Choice1="text,Guide;screen,ScreenGuideMain" +Choice2="text,Reference;screen,ScreenReferenceMain" +Choice3="text,Tutorial;" +Choice4="text,Options;screen,ScreenOptionsService;" +Choice5="text,Exit;screen,ScreenExit;" + +# These control the placement of the items, as well as the list: +ScrollerX=SCREEN_RIGHT-44 +ScrollerY=SCREEN_CENTER_Y+32 +ScrollerOnCommand=addx,SCREEN_CENTER_X;decelerate,0.8;addx,-SCREEN_CENTER_X +ScrollerTransform=function(self,offset,itemIndex,numItems) self:y(27*offset) end + +[ScreenOptionsService] +# dummying out ScreenInit +NextScreen="ScreenTitleMenu" +PrevScreen="ScreenTitleMenu" +################################################################################ +# [guide] The guide splits the elements of StepMania theming into different sections. +# It acts as an introduction to all of the concepts in modern StepMania theming. +# All guide pages aside from ScreenGuideMain MUST be prefixed with "Guide" in +# order to differentiate them from the core screens. +[ScreenGuideMain] +Class="ScreenSelectMaster" +Fallback="ScreenSelectMaster" +PrevScreen="ScreenTitleMenu" +AllowRepeatingInput=true + +# modifying header position +HeaderY=SCREEN_TOP+72 + +ChoiceNames="Metrics,Fonts,Graphics,BGAnims,Sounds,Scripts,Other,NoteSkins,Announcers,Characters" +ChoiceMetrics="name,Metrics" +ChoiceFonts="name,Fonts" +ChoiceGraphics="name,Graphics" +ChoiceBGAnims="name,BGAnims" +ChoiceSounds="name,Sounds" +ChoiceScripts="name,Scripts" +ChoiceOther="name,Other" +ChoiceNoteSkins="name,NoteSkins" +ChoiceAnnouncers="name,Announcers" +ChoiceCharacters="name,Characters" +DefaultChoice="Metrics" + +ShowScroller=true +LoopScroller=false +PerChoiceScrollElement=false + +ScrollerX=SCREEN_CENTER_X +ScrollerY=SCREEN_CENTER_Y*0.775 +ScrollerNumItemsToDraw=10 +ScrollerSecondsPerItem=0.1 +ScrollerTransform=function(self,offset,itemIndex,numItems) self:y((itemIndex-(numItems/2))+offset*64) end + +# guide base screen (sets up things I don't want to retype a lot -aj) # +[GuideBase] +Class="ScreenSelectMaster" +Fallback="ScreenSelectMaster" + +## Metrics +[GuideMetrics] +Fallback="GuideBase" + +## Fonts +[GuideFonts] +Fallback="GuideBase" + +## Graphics +[GuideGraphics] +Fallback="GuideBase" + +## BGAnimations +[GuideBGA] +Fallback="GuideBase" +### Decorations (simpler) +### Overlay/Underlay (can be more complex) + +## Sounds +[GuideSounds] +Fallback="GuideBase" + +## Scripts +[GuideScripts] +Fallback="GuideBase" + +## the Other folder +[GuideOther] +Fallback="GuideBase" +### HowToPlay steps +### PreferredSort + +# And then there are the things that are related to theming: +## NoteSkins +[GuideNoteSkins] +Fallback="GuideBase" + +## Announcers +[GuideAnnouncers] +Fallback="GuideBase" + +## Characters +[GuideCharacters] +Fallback="GuideBase" + +################################################################################ +# [ref] The reference section contains a complete listing of commands and examples of how they work. # +# All reference pages aside from ScreenReferenceMain MUST be prefixed with "Reference" +# in order to differentiate them from the core screens. +[ScreenReferenceMain] +Class="ScreenSelectMaster" +Fallback="ScreenSelectMaster" +PrevScreen="ScreenTitleMenu" +AllowRepeatingInput=true + +# modifying header position +HeaderY=SCREEN_TOP+72 + +ChoiceNames="Screens,Managers,Classes" +ChoiceScreens="name,Screens" +ChoiceManagers="name,Managers" +ChoiceClasses="name,Classes" +DefaultChoice="Screens" + +ShowScroller=true +LoopScroller=false +PerChoiceScrollElement=false + +ScrollerX=SCREEN_CENTER_X +ScrollerY=SCREEN_CENTER_Y+32 +ScrollerNumItemsToDraw=10 +ScrollerSecondsPerItem=0.1 +ScrollerTransform=function(self,offset,itemIndex,numItems) self:y((itemIndex-(numItems/2))*64) end + +# reference base screen (sets up things I don't want to retype a lot -aj) # +[ReferenceBase] +Class="ScreenSelectMaster" +Fallback="ScreenSelectMaster" + +## Screens +[ReferenceScreens] +Fallback="ReferenceBase" + +## Managers and other Singletons +[ReferenceManagers] +Fallback="ReferenceBase" + +#@# STEPMANIA ROBOT MASTERS +### ANNOUNCER [man] +[ReferenceAnnouncerMan] + +### CHARMAN +[ReferenceCharMan] + +### FILEMAN +[ReferenceFileMan] + +### GAMEMAN +[ReferenceGameMan] + +### GAMESOUNDMAN +[ReferenceGameSoundMan] + +### GAMESTATE +[ReferenceGameState] + +### MEMCARDMAN +[ReferenceMemCardMan] + +### MESSAGEMAN +[ReferenceMessageMan] + +### NOTESKIN [man] +[ReferenceNoteskinMan] + +### PREFSMAN +[ReferencePrefsMan] + +### PROFILEMAN +[ReferenceProfileMan] + +### SCREENMAN +[ReferenceScreenMan] + +### SONGMAN +[ReferenceSongMan] + +### STATSMAN +[ReferenceStatsMan] + +### THEME [man] +[ReferenceThemeMan] + +### UNLOCKMAN +[ReferenceUnlockMan] + +## Classes +[ReferenceClasses] +Fallback="ReferenceBase" + +### Actor +[ReferenceActor] +#### many sub-things + +### ActorFrame +[ReferenceActorFrame] + +### Banner +[ReferenceBanner] + +### Song +[ReferenceSong] + +### Steps +[ReferenceSteps] + +### Course +[ReferenceCourse] + +### Trail +[ReferenceTrail] + +### and a ton of missing stuff + +################################################################################ +# [tutor] Tutorials are guides to implementing specific things # +[ScreenTutorialMain] + +# todo: figure out what tutorials \ No newline at end of file diff --git a/Themes/HelloWorld/readme.txt b/Themes/HelloWorld/readme.txt new file mode 100644 index 0000000000..c72d71d7b8 --- /dev/null +++ b/Themes/HelloWorld/readme.txt @@ -0,0 +1,49 @@ +Hello World +and other sm-ssc theming examples +-------------------------------------- +A theme by various contributors. +-------------------------------------- + +This theme and its accompanying documentation are licensed under +the Creative Commons Attribution-Share Alike 3.0 license. + +The license text can be viewed at: +http://creativecommons.org/licenses/by-sa/3.0/us/ + +================================================================================ +Table of Contents + Introduction [intro] + Chapter List [chapt] + Guide [guide] + Metrics [g_met] + Fonts [g_fon] + Graphics [g_gfx] + BGAnims [g_bga] + Sounds [g_sfx] + Scripts [g_scr] + Other [g_oth] + NoteSkins [g_not] + Announcers [g_ann] + Characters [g_cha] + Reference [ref] + Screens [r_scr] + Managers [r_man] + Classes [r_cls] + Tutorials [tutor] +[others tba] + +================================================================================ +Introduction [intro] + +Hello, and welcome to Hello World (and other sm-ssc theming examples). +This theme and accompanying documentation are provided for people new to +theming for StepMania, using sm-ssc as a base. + +================================================================================ +The Chapters [chapt] + +The theme itself is split into three sections, encompassing various elements of +sm-ssc theming. + +The Guide is a general run-through of how Themes are constructed (along with +NoteSkins, Announcers, and Characters) \ No newline at end of file diff --git a/Themes/_fallback/Graphics/ScreenOptions line highlight.redir b/Themes/_fallback/Graphics/ScreenOptions LineHighlight.redir similarity index 100% rename from Themes/_fallback/Graphics/ScreenOptions line highlight.redir rename to Themes/_fallback/Graphics/ScreenOptions LineHighlight.redir diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 032631c80e..d68bff46a5 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -787,6 +787,7 @@ CelShadeModels=Cel-shaded Models Center Image=Center Image Chaos=Chaos Characters=Characters +Chart Style=Chart Style Choose=Choose Clear Bookkeeping Data=Clear Bookkeeping Data Clear Machine Edits=Clear Machine Edits @@ -1205,6 +1206,7 @@ Enter a new artist.=Enter a new artist. Enter a new genre.=Enter a new genre. Enter a new credit.=Enter a new credit. Enter a new description.=Enter a new description. +Enter a new chart style.=Enter a new chart style (e.g. "Pad", "Keyboard"). Enter the author who made this step pattern.=Enter the author who made this step pattern. Enter a new last beat hint.=Enter a new last beat hint. Enter a new main title transliteration.=Enter a new main title transliteration. @@ -1231,6 +1233,7 @@ Snap to=Snap to Selection beat=Selection beat Difficulty=Difficulty Description=Description +Chart Style=Chart Style Main title=Main title Subtitle=Subtitle Tap Steps=Tap Steps @@ -1244,6 +1247,7 @@ Preview Start=Preview Start Preview Length=Preview Length Help=Help Info=Info +Routine Player=Player [ScreenEditMenu] HeaderText=Edit Song/Steps diff --git a/Themes/_fallback/Scripts/03 ThemeAndGamePrefs.lua b/Themes/_fallback/Scripts/03 ThemeAndGamePrefs.lua index 69a2c161b7..7d20bef84f 100644 --- a/Themes/_fallback/Scripts/03 ThemeAndGamePrefs.lua +++ b/Themes/_fallback/Scripts/03 ThemeAndGamePrefs.lua @@ -6,7 +6,6 @@ function InitGamePrefs() { "NotePosition", true }, { "ComboOnRolls", false }, { "ComboUnderField", true }, - { "AdjustSpeed", false }, }; for idx,pref in ipairs(Prefs) do @@ -387,49 +386,6 @@ function GamePrefComboUnderField() return t; end -function GetDefaultArrowSpacing() - local rates = { - 64, -- Default - 80, -- Pro - 128, -- New - }; - return GetGamePrefB("AdjustSpeed") and rates[3] or rates[1]; -end; -function GamePrefAdjustSpeed() - local t = { - Name = "GamePrefAdjustSpeed"; - LayoutType = "ShowAllInRow"; - SelectType = "SelectOne"; - OneChoiceForAllPlayers = true; - ExportOnChange = false; - Choices = { 'Normal','Fast' }; - LoadSelections = function(self, list, pn) - if ReadGamePrefFromFile("AdjustSpeed") ~= nil then - if GetGamePrefB("AdjustSpeed") then - list[2] = true; - else - list[1] = true; - end; - else - WriteGamePrefToFile("AdjustSpeed",true); - list[2] = true; - end; - end; - SaveSelections = function(self, list, pn) - local val; - if list[2] then - val = true; - else - val = false; - end; - WriteGamePrefToFile("AdjustSpeed",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; -end function GamePrefAutoSetStyle() local t = { Name = "GamePrefAutoSetStyle"; diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index c93357f68f..1cc853a60a 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -22,14 +22,16 @@ IsBaseTheme=1 # for 480p, it would be enlarged for bigger screens! ScreenWidth=1 ScreenHeight=480 + # Allows you to pick all available game modes for your gametype: for example, # inserting enough coins for 1p would let you choose between solo, single # and double before each game -# AutoSetStyle=true AutoSetStyle=GetGamePrefB("AutoSetStyle") + # Default modifiers and noteskin. DefaultModifiers="default;1.5x;" DefaultNoteSkinName="default" + # Difficulties to show. Useful for custom games where you want to hide these. DifficultiesToShow="beginner,easy,medium,hard,challenge" # Same as above, but for courses. @@ -37,19 +39,27 @@ CourseDifficultiesToShow="easy,medium,hard" # Things to hide. You couldn't play cabinet anyways. StepsTypesToHide="lights-cabinet" #~ StepsTypesToHide="dance-couple,dance-solo,pump-halfdouble,lights-cabinet" -# Useless? + +# The number of entries before "Various" is shown on the BPMDisplay, etc. MaxCourseEntriesBeforeShowVarious=10 -# Legacy metric: The first screen that shows up when you take forever to press -# start. + +# The screen that appears when pressing the operator button. +OperatorMenuScreen="ScreenOptionsService" + +# The first screen in the attract cycle. FirstAttractScreen="ScreenDemonstration" + # First screen that pops up when you start the game. ScreenInit in particular # shows the theme information before going to the title screen. InitialScreen="ScreenInit" + # Music selection screen used after downloading files. SelectMusicScreen="ScreenSelectMusic" -# Screens that show over everything else. you shouldn't worry bout this, since -# it wont matter much. + +# Screens that show over everything else. +# Only mess with this if you know what you're doing. OverlayScreens="ScreenSystemLayer,ScreenSyncOverlay,ScreenStatsOverlay,ScreenDebugOverlay,ScreenConsoleOverlay,ScreenInstallOverlay" + # Legacy metric: Percentage Scoring shows this many decimals ( 00.00% ). PercentScoreDecimalPlaces=2 @@ -126,7 +136,7 @@ FrameWidthEffectsMinMultiplier=0.5 FrameWidthEffectsMaxMultiplier=1.2 FrameWidthLockEffectsToOverlapping=false FrameWidthLockEffectsTweenPixels=25 -ArrowSpacing=128 +ArrowSpacing=64 DrawHiddenNotesAfterReceptor=true BlinkModFrequency=0.3333 BoostModMinClamp=-400 @@ -218,6 +228,8 @@ QuestionMarksText="???" RandomText="!!!" # xxx: localize me -aj VariousText="000" +FormatString="%03.0f" + [CodeDetector] # Codes on the MusicWheel that change stuff! PrevSteps1="Up,Up" @@ -512,11 +524,9 @@ DisablePremiumInEventMode=false # Polar graph that shows difficulty stuff in depth # how thick the line is EdgeWidth=2 -# ? -LabelOnDelay=0 # How visible the middle is CenterAlpha=0.25 -# what to do with each players part of the graph +# what to do with each player's part of the graph RadarValueMapP1OnCommand=diffuse,PlayerColor(PLAYER_1) RadarValueMapP2OnCommand=diffuse,PlayerColor(PLAYER_2) @@ -3070,7 +3080,6 @@ Class="ScreenGameplayNormal" NextScreen=Branch.AfterGameplay() PrevScreen=Branch.BackOutOfStageInformation() # -UseAlternativeInput=false ShowLifeMeterForDisabledPlayers=false StopCourseEarly=false ShowEvaluationOnFail=true @@ -3602,6 +3611,28 @@ PlayRecordHelpX=SCREEN_LEFT+20 PlayRecordHelpY=SCREEN_BOTTOM-20 PlayRecordHelpOnCommand=halign,0;valign,0;shadowlength,1 +CurrentBeatFormat="%s:\n %.5f\n" +CurrentSecondFormat="%s:\n %.5f\n" +SnapToFormat="%s:\n %s\n" +SelectionBeatBeginFormat="%s:\n %.5f" +SelectionBeatUnfinishedFormat=" ...\n" +SelectionBeatEndFormat="-%.5f\n" +DifficultyFormat="%s:\n %s\n" +RoutinePlayerFormat="%s:\n %d\n" +DescriptionFormat="%s:\n %s\n" +ChartStyleFormat="%s:\n %s\n" +MainTitleFormat="%s:\n %s\n" +SubtitleFormat="%s:\n %s\n" +NumStepsFormat="%s: %d\n" +NumJumpsFormat="%s: %d\n" +NumHoldsFormat="%s: %d\n" +NumMinesFormat="%s: %d\n" +NumHandsFormat="%s: %d\n" +NumRollsFormat="%s: %d\n" +Beat0OffsetFormat="%s:\n %.5f secs\n" +PreviewStartFormat="%s:\n %.5f secs\n" +PreviewLengthFormat="%s:\n %.5f secs\n" + [ScreenPracticeMenu] Fallback="ScreenEditMenu" Class="ScreenEditMenu" diff --git a/Themes/default/Languages/en.ini b/Themes/default/Languages/en.ini index 1fc98403a2..6b950974ab 100644 --- a/Themes/default/Languages/en.ini +++ b/Themes/default/Languages/en.ini @@ -64,7 +64,6 @@ UserPrefSpecialScoringMode=Special Scoring Mode GamePrefNotePosition=Note Positions GamePrefComboOnRolls=Rolls Increment Combo GamePrefComboUnderField=Combo Under Field -GamePrefAdjustSpeed=Adjust Speed UserPrefGameplayShowScore=Show Score UserPrefGameplayShowStepsDisplay=Show Steps @@ -76,7 +75,6 @@ GamePrefAutoSetStyle=Allow the game to list all one player and two player modes GamePrefNotePosition=Determines where the arrow receptors are placed in gameplay. GamePrefComboOnRolls=Choose if rolls should increment the combo or not. GamePrefComboUnderField=Determine if the combo should display under the notes or not. -GamePrefAdjustSpeed=Adjust the default scale for speed modifiers. Normal corresponds to the original StepMania 3.9 speed, Fast is twice that rate. UserPrefGameplayShowScore=Show or Hide the score display in gameplay. UserPrefSpecialScoringMode=Select the scoring mode to be used if the Special scoring type is selected. diff --git a/Themes/default/Scripts/03 ThemePrefs.lua b/Themes/default/Scripts/03 ThemePrefs.lua index 526b6ca897..8d414c3ae2 100644 --- a/Themes/default/Scripts/03 ThemePrefs.lua +++ b/Themes/default/Scripts/03 ThemePrefs.lua @@ -51,9 +51,6 @@ function InitUserPrefs() if GetUserPrefB("UserPrefComboUnderField") == nil then SetUserPref("UserPrefComboUnderField", true); end; - if GetUserPrefB("UserPrefAdjustSpeed") == nil then - SetUserPref("UserPrefAdjustSpeed", false); - end; --[[ if GetUserPref("ProTimingP1") == nil then SetUserPref("ProTimingP1", false); end; @@ -500,49 +497,4 @@ function UserPrefComboUnderField() setmetatable( t, t ); return t; end - -function GetDefaultArrowSpacing() - local rates = { - 64, -- Default - 80, -- Pro - 128, -- New - }; - return GetUserPrefB("UserPrefAdjustSpeed") and rates[3] or rates[1]; -end; - -function UserPrefAdjustSpeed() - local t = { - Name = "UserPrefAdjustSpeed"; - LayoutType = "ShowAllInRow"; - SelectType = "SelectOne"; - OneChoiceForAllPlayers = true; - ExportOnChange = false; - Choices = { 'Slow','Fast' }; - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefAdjustSpeed") ~= nil then - if GetUserPrefB("UserPrefAdjustSpeed") then - list[2] = true; - else - list[1] = true; - end; - else - WritePrefToFile("UserPrefAdjustSpeed",true); - list[2] = true; - end; - end; - SaveSelections = function(self, list, pn) - local val; - if list[2] then - val = true; - else - val = false; - end; - WritePrefToFile("UserPrefAdjustSpeed",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; -end --[[ end option rows ]] diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index a55b777546..97bf7a4d3a 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -321,9 +321,6 @@ AveragePulseCommand=finishtweening;diffusealpha,1;zoom,0.75*1.25;decelerate,0.05 # ReceptorArrowsYReverse=GetTapPosition('Reverse') # RollBodyIncrementsCombo=GetUserPrefB("UserPrefComboOnRolls") -[ArrowEffects] -ArrowSpacing=GetDefaultArrowSpacing() - [ScoreDisplayNormal] FrameX= FrameY= @@ -827,7 +824,7 @@ ItemsLongRowSharedX=SCREEN_CENTER_X [ScreenOptionsTheme] Fallback="ScreenOptionsServiceChild" -LineNames="gNotePos,gAuto,gScore,gSScore,gSDisp,gOpts,gLongFail,gComboUnderField,FlashyCombo,AdjustSpeed" +LineNames="gNotePos,gAuto,gScore,gSScore,gSDisp,gOpts,gLongFail,gComboUnderField,FlashyCombo" LinegNotePos="lua,GamePrefNotePosition()" LinegScore="lua,UserPrefGameplayShowScore()" LinegSScore="lua,UserPrefSpecialScoringMode()" @@ -837,7 +834,6 @@ LinegAuto="lua,GamePrefAutoSetStyle()" LinegLongFail="lua,UserPrefLongFail()" LinegComboUnderField="lua,GamePrefComboUnderField()" LineFlashyCombo="lua,UserPrefFlashyCombo()" -LineAdjustSpeed="lua,GamePrefAdjustSpeed()" [ScreenOptionsSystemDirection] LineNames="1,2,3,4,5,6,7,8,9,FlashyCombo,RollCombo,10,11,12,13,14,15,16,LF,17,18,19,20,21,22" LineLF="lua,UserPrefLongFail()" diff --git a/src/ActiveAttackList.h b/src/ActiveAttackList.h index 169f1af1ff..38589c8840 100644 --- a/src/ActiveAttackList.h +++ b/src/ActiveAttackList.h @@ -1,29 +1,37 @@ -/* ActiveAttackList - Shows currently active player modifiers during gameplay. */ #ifndef ACTIVE_ATTACK_LIST_H #define ACTIVE_ATTACK_LIST_H #include "BitmapText.h" class PlayerState; +/** @brief Shows currently active Player modifiers during gameplay. */ class ActiveAttackList : public BitmapText { public: + /** @brief The constructor that does nothing. */ ActiveAttackList(); - + /** + * @brief Set up the PlayerState. + * @param pPlayerState the PlayerState involved with the attacks. */ void Init( const PlayerState* pPlayerState ); - + /** + * @brief Look into updating the list. + * @param fDelta the present time. */ virtual void Update( float fDelta ); - + /** @brief Refresh the list of attacks. */ void Refresh(); protected: + /** @brief the PlayerState of the Player who is dealing with the attack list. */ const PlayerState* m_pPlayerState; }; #endif -/* - * (c) 2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Actor.cpp b/src/Actor.cpp index 973a22f514..241b79dfb1 100644 --- a/src/Actor.cpp +++ b/src/Actor.cpp @@ -18,7 +18,10 @@ static Preference g_bShowMasks("ShowMasks", false); -/* It's useful to be able to construct a basic Actor in XML, in +/** + * @brief Set up a hidden Actor that won't be drawn. + * + * It's useful to be able to construct a basic Actor in XML, in * order to simply delay a Transition, or receive and send broadcasts. * Since these actors will never draw, set them hidden by default. */ class HiddenActor: public Actor @@ -27,7 +30,7 @@ public: HiddenActor() { SetVisible(false); } virtual HiddenActor *Copy() const; }; -REGISTER_ACTOR_CLASS_WITH_NAME( HiddenActor, Actor ) +REGISTER_ACTOR_CLASS_WITH_NAME( HiddenActor, Actor ); float Actor::g_fCurrentBGMTime = 0, Actor::g_fCurrentBGMBeat; float Actor::g_fCurrentBGMTimeNoOffset = 0, Actor::g_fCurrentBGMBeatNoOffset = 0; @@ -1307,6 +1310,7 @@ Actor::TweenInfo &Actor::TweenInfo::operator=( const TweenInfo &rhs ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Actor. */ class LunaActor : public Luna { public: diff --git a/src/Actor.h b/src/Actor.h index b68dde38f8..e67278602b 100644 --- a/src/Actor.h +++ b/src/Actor.h @@ -1,5 +1,3 @@ -/* Actor - Base class for all objects that appear on the screen. */ - #ifndef ACTOR_H #define ACTOR_H @@ -16,47 +14,60 @@ class LuaClass; typedef AutoPtrCopyOnWrite apActorCommands; -// background +/** @brief The background layer. */ #define DRAW_ORDER_BEFORE_EVERYTHING -200 -// underlay +/** @brief The underlay layer. */ #define DRAW_ORDER_UNDERLAY -100 -// decorations -#define DRAW_ORDER_DECORATIONS 0 -// normal screen elements go here +/** @brief The decorations layer. */ +#define DRAW_ORDER_DECORATIONS 0 +/** @brief The overlay layer. + * + * Normal screen elements go here. */ #define DRAW_ORDER_OVERLAY +100 +/** @brief The transitions layer. */ #define DRAW_ORDER_TRANSITIONS +200 +/** @brief The over everything layer. */ #define DRAW_ORDER_AFTER_EVERYTHING +300 +/** @brief The different horizontal alignments. */ enum HorizAlign { - HorizAlign_Left, - HorizAlign_Center, - HorizAlign_Right, - NUM_HorizAlign, + HorizAlign_Left, /**< Align to the left. */ + HorizAlign_Center, /**< Align to the center. */ + HorizAlign_Right, /**< Align to the right. */ + NUM_HorizAlign, /**< The number of horizontal alignments. */ HorizAlign_Invalid }; LuaDeclareType( HorizAlign ); +/** @brief The different vertical alignments. */ enum VertAlign { - VertAlign_Top, - VertAlign_Middle, - VertAlign_Bottom, - NUM_VertAlign, + VertAlign_Top, /**< Align to the top. */ + VertAlign_Middle, /**< Align to the middle. */ + VertAlign_Bottom, /**< Align to the bottom. */ + NUM_VertAlign, /**< The number of vertical alignments. */ VertAlign_Invalid }; LuaDeclareType( VertAlign ); +/** @brief The left horizontal alignment constant. */ #define align_left 0.0f +/** @brief The center horizontal alignment constant. */ #define align_center 0.5f +/** @brief The right horizontal alignment constant. */ #define align_right 1.0f +/** @brief The top vertical alignment constant. */ #define align_top 0.0f +/** @brief The middle vertical alignment constant. */ #define align_middle 0.5f +/** @brief The bottom vertical alignment constant. */ #define align_bottom 1.0f - +/** @brief Base class for all objects that appear on the screen. */ class Actor : public MessageSubscriber { public: + /** @brief Set up the Actor with its initial settings. */ Actor(); Actor( const Actor &cpy ); virtual ~Actor(); @@ -67,8 +78,11 @@ public: static void SetBGMTime( float fTime, float fBeat, float fTimeNoOffset, float fBeatNoOffset ); static void SetBGMLight( int iLightNumber, float fCabinetLights ); - // todo: split out into diffuse effects and translation effects, or - // create an effect stack instead. -aj + /** + * @brief The list of the different effects. + * + * todo: split out into diffuse effects and translation effects, or + * create an effect stack instead. -aj */ enum Effect { no_effect, // diffuse effects diffuse_blink, diffuse_shift, diffuse_ramp, @@ -99,13 +113,22 @@ public: RageVector4 quat; RageVector3 scale; float fSkewX, fSkewY; - RectF crop; // 0 = no cropping, 1 = fully cropped - RectF fade; // 0 = no fade + /** + * @brief The amount of cropping involved. + * + * If 0, there is no cropping. If 1, it's fully cropped. */ + RectF crop; + /** + * @brief The amount of fading involved. + * + * If 0, there is no fade. If 1, it's fully faded. */ + RectF fade; RageColor diffuse[4]; RageColor glow; float aux; }; + /** @brief Various values an Actor's effect can be tied to. */ enum EffectClock { CLOCK_TIMER, @@ -134,9 +157,21 @@ public: virtual void UpdateInternal( float fDeltaTime ); // override this void UpdateTweening( float fDeltaTime ); + /** + * @brief Retrieve the Actor's name. + * @return the Actor's name. */ const RString &GetName() const { return m_sName; } + /** + * @brief Set the Actor's name to a new one. + * @param sName the new name for the Actor. */ virtual void SetName( const RString &sName ) { m_sName = sName; } + /** + * @brief Give this Actor a new parent. + * @param pParent the new parent Actor. */ void SetParent( Actor *pParent ); + /** + * @brief Retrieve the Actor's parent. + * @return the Actor's parent. */ Actor *GetParent() { return m_pParent; } RString GetLineage() const; @@ -162,7 +197,7 @@ public: void SetWidth( float width ) { m_size.x = width; } void SetHeight( float height ) { m_size.y = height; } - // Base + // Base values float GetBaseZoomX() const { return m_baseScale.x; } void SetBaseZoomX( float zoom ) { m_baseScale.x = zoom; } float GetBaseZoomY() const { return m_baseScale.y; } @@ -176,7 +211,6 @@ public: void SetBaseRotation( const RageVector3 &rot ) { m_baseRotation = rot; } virtual void SetBaseAlpha( float fAlpha ) { m_fBaseAlpha = fAlpha; } - float GetZoom() const { return DestTweenState().scale.x; } // not accurate in some cases float GetZoomX() const { return DestTweenState().scale.x; } float GetZoomY() const { return DestTweenState().scale.y; } @@ -417,9 +451,12 @@ protected: TweenInfo &operator=( const TweenInfo &rhs ); ITween *m_pTween; - float m_fTimeLeftInTween; // how far into the tween are we? - float m_fTweenTime; // seconds between Start and End positions/zooms - RString m_sCommandName; // command to execute when this TweenState goes into effect + /** @brief How far into the tween are we? */ + float m_fTimeLeftInTween; + /** @brief The number of seconds between Start and End positions/zooms. */ + float m_fTweenTime; + /** @brief The command to execute when this TweenState goes into effect. */ + RString m_sCommandName; }; RageVector3 m_baseRotation; @@ -436,14 +473,20 @@ protected: }; vector m_Tweens; - // Temporary variables that are filled just before drawing + /** @brief Temporary variables that are filled just before drawing */ TweenState *m_pTempState; bool m_bFirstUpdate; // Stuff for alignment - float m_fHorizAlign; /* 0.0 left 0.5 center 1.0 right */ - float m_fVertAlign; /* 0.0 top 0.5 center 1.0 bottom */ + /** @brief The particular horizontal alignment. + * + * Use the defined constant values for best effect. */ + float m_fHorizAlign; + /** @brief The particular vertical alignment. + * + * Use the defined constant values for best effect. */ + float m_fVertAlign; // Stuff for effects @@ -480,7 +523,10 @@ protected: float m_fShadowLengthX; float m_fShadowLengthY; RageColor m_ShadowColor; - int m_iDrawOrder; // lower first + /** @brief The draw order priority. + * + * The lower this number is, the sooner it is drawn. */ + int m_iDrawOrder; // render states BlendMode m_BlendMode; @@ -490,7 +536,11 @@ protected: bool m_bTextureFiltering; bool m_bClearZBuffer; bool m_bZWrite; - float m_fZBias; // 0 = no bias; 1 = full bias + /** + * @brief The amount of bias. + * + * If 0, there is no bias. If 1, there is a full bias. */ + float m_fZBias; // global state static float g_fCurrentBGMTime, g_fCurrentBGMBeat; @@ -503,8 +553,10 @@ private: #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ActorFrame.cpp b/src/ActorFrame.cpp index 0f83865b3c..bbe12260a5 100644 --- a/src/ActorFrame.cpp +++ b/src/ActorFrame.cpp @@ -16,8 +16,8 @@ * children. The name "ActorFrame" is widely used in Lua, so we'll have * that string instead create an ActorFrameAutoDeleteChildren object. */ -//REGISTER_ACTOR_CLASS( ActorFrame ) -REGISTER_ACTOR_CLASS_WITH_NAME( ActorFrameAutoDeleteChildren, ActorFrame ) +//REGISTER_ACTOR_CLASS( ActorFrame ); +REGISTER_ACTOR_CLASS_WITH_NAME( ActorFrameAutoDeleteChildren, ActorFrame ); ActorFrame *ActorFrame::Copy() const { return new ActorFrame(*this); } @@ -451,6 +451,7 @@ void ActorFrame::SetDrawByZPosition( bool b ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ActorFrame. */ class LunaActorFrame : public Luna { public: diff --git a/src/ActorFrame.h b/src/ActorFrame.h index bd871e95a0..cba0ad677d 100644 --- a/src/ActorFrame.h +++ b/src/ActorFrame.h @@ -1,4 +1,4 @@ -/* ActorFrame - A container for other actors. */ +/** @brief ActorFrame - A container for other actors. */ #ifndef ACTORFRAME_H #define ACTORFRAME_H @@ -12,6 +12,7 @@ public: ActorFrame( const ActorFrame &cpy ); virtual ~ActorFrame(); + /** @brief Set up the initial state. */ virtual void InitState(); void LoadFromNode( const XNode* pNode ); virtual ActorFrame *Copy() const; @@ -23,8 +24,17 @@ public: vector GetChildren() { return m_SubActors; } int GetNumChildren() const { return m_SubActors.size(); } + /** @brief Remove all of the children from the frame. */ void RemoveAllChildren(); + /** + * @brief Move a particular actor to the tail. + * @param pActor the actor to go to the tail. + */ void MoveToTail( Actor* pActor ); + /** + * @brief Move a particular actor to the head. + * @param pActor the actor to go to the head. + */ void MoveToHead( Actor* pActor ); void SortByDrawOrder(); void SetDrawByZPosition( bool b ); @@ -73,7 +83,7 @@ public: virtual void SetPropagateCommands( bool b ); - // Amount of time until all tweens (and all children's tweens) have stopped: + /** @brief Amount of time until all tweens (and all children's tweens) have stopped: */ virtual float GetTweenTimeLeft() const; virtual void HandleMessage( const Message &msg ); @@ -95,7 +105,11 @@ protected: float m_fFOV; // -1 = no change float m_fVanishX; float m_fVanishY; - bool m_bOverrideLighting; // if true, set lighting to m_bLighting + /** + * @brief A flad to see if an override for the lighting is needed. + * + * If true, set lightning to m_bLightning. */ + bool m_bOverrideLighting; bool m_bLighting; // lighting variables @@ -115,8 +129,10 @@ public: #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ActorFrameTexture.cpp b/src/ActorFrameTexture.cpp index f770dc0b48..9b36b85e5e 100644 --- a/src/ActorFrameTexture.cpp +++ b/src/ActorFrameTexture.cpp @@ -4,7 +4,7 @@ #include "RageTextureManager.h" #include "ActorUtil.h" -REGISTER_ACTOR_CLASS_WITH_NAME( ActorFrameTextureAutoDeleteChildren, ActorFrameTexture ) +REGISTER_ACTOR_CLASS_WITH_NAME( ActorFrameTextureAutoDeleteChildren, ActorFrameTexture ); ActorFrameTexture *ActorFrameTexture::Copy() const { return new ActorFrameTexture(*this); } ActorFrameTexture::ActorFrameTexture() @@ -67,6 +67,7 @@ void ActorFrameTexture::DrawPrimitives() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ActorFrameTexture. */ class LunaActorFrameTexture : public Luna { public: diff --git a/src/ActorFrameTexture.h b/src/ActorFrameTexture.h index 915c9c017b..ae9c873c3d 100644 --- a/src/ActorFrameTexture.h +++ b/src/ActorFrameTexture.h @@ -12,11 +12,18 @@ public: virtual ~ActorFrameTexture(); virtual ActorFrameTexture *Copy() const; - /* Set the texture name, which can be used with RageTextureManager (and users, - * eg. Sprite) to load the texture. If no name is supplied, a unique one will - * be generated. In that case, the only way to access the texture is via - * GetTextureName. */ + /** + * @brief Set the texture name. + * + * This can be used with RageTextureManager (and users, eg. Sprite) + * to load the texture. If no name is supplied, a unique one will + * be generated. In that case, the only way to access the texture + * is via GetTextureName. + * @param sName the new name. */ void SetTextureName( const RString &sName ) { m_sTextureName = sName; } + /** + * @brief Retrieve the texture name. + * @return the texture name. */ RString GetTextureName() const { return m_sTextureName; } RageTextureRenderTarget *GetTexture() { return m_pRenderTarget; } @@ -52,8 +59,10 @@ public: #endif -/* - * (c) 2006 Glenn Maynard +/** + * @file + * @author Glenn Maynard (c) 2006 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ActorMultiTexture.cpp b/src/ActorMultiTexture.cpp index ef93b9b766..7b7fd85f21 100644 --- a/src/ActorMultiTexture.cpp +++ b/src/ActorMultiTexture.cpp @@ -13,7 +13,7 @@ #include "LuaBinding.h" #include "LuaManager.h" -REGISTER_ACTOR_CLASS( ActorMultiTexture ) +REGISTER_ACTOR_CLASS( ActorMultiTexture ); ActorMultiTexture::ActorMultiTexture() @@ -134,6 +134,7 @@ bool ActorMultiTexture::EarlyAbortDraw() const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ActorMultiTexture. */ class LunaActorMultiTexture: public Luna { public: diff --git a/src/ActorMultiTexture.h b/src/ActorMultiTexture.h index f0f0f70919..5973ab6234 100644 --- a/src/ActorMultiTexture.h +++ b/src/ActorMultiTexture.h @@ -1,4 +1,4 @@ -/* ActorMultiTexture - A texture created from multiple textures. */ +/** @brief ActorMultiTexture - A texture created from multiple textures. */ #ifndef ACTOR_MULTI_TEXTURE_H #define ACTOR_MULTI_TEXTURE_H @@ -45,8 +45,10 @@ private: #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ActorProxy.cpp b/src/ActorProxy.cpp index a977a69730..38938818d0 100644 --- a/src/ActorProxy.cpp +++ b/src/ActorProxy.cpp @@ -2,7 +2,7 @@ #include "ActorProxy.h" #include "ActorUtil.h" -REGISTER_ACTOR_CLASS( ActorProxy ) +REGISTER_ACTOR_CLASS( ActorProxy ); ActorProxy::ActorProxy() { @@ -33,6 +33,7 @@ void ActorProxy::LoadFromNode( const XNode* pNode ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ActorProxy. */ class LunaActorProxy: public Luna { public: diff --git a/src/ActorProxy.h b/src/ActorProxy.h index c30b4d5a9a..2416c6e7b5 100644 --- a/src/ActorProxy.h +++ b/src/ActorProxy.h @@ -1,12 +1,10 @@ -/* ActorProxy - renders another actor. */ - #ifndef ACTOR_PROXY_H #define ACTOR_PROXY_H #include "Actor.h" struct lua_State; - +/** @brief Rendrs another actor. */ class ActorProxy: public Actor { public: diff --git a/src/ActorScroller.cpp b/src/ActorScroller.cpp index 53a6cd19c3..91f1927a7c 100644 --- a/src/ActorScroller.cpp +++ b/src/ActorScroller.cpp @@ -12,8 +12,8 @@ * We don't want classes that derive from ActorFrame to auto delete their * children. The name "ActorFrame" is widely used in Lua, so we'll have * that string instead create an ActorFrameAutoDeleteChildren object. */ -//REGISTER_ACTOR_CLASS( ActorScroller ) -REGISTER_ACTOR_CLASS_WITH_NAME( ActorScrollerAutoDeleteChildren, ActorScroller ) +//REGISTER_ACTOR_CLASS( ActorScroller ); +REGISTER_ACTOR_CLASS_WITH_NAME( ActorScrollerAutoDeleteChildren, ActorScroller ); ActorScroller *ActorScroller::Copy() const { return new ActorScroller(*this); } @@ -309,6 +309,7 @@ void ActorScroller::PositionItemsAndDrawPrimitives( bool bDrawPrimitives ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ActorScroller. */ class LunaActorScroller: public Luna { public: diff --git a/src/ActorSound.cpp b/src/ActorSound.cpp index c750739353..054ee2c2a7 100644 --- a/src/ActorSound.cpp +++ b/src/ActorSound.cpp @@ -5,7 +5,7 @@ #include "XmlFile.h" #include "RageUtil.h" -REGISTER_ACTOR_CLASS_WITH_NAME( ActorSound, Sound ) +REGISTER_ACTOR_CLASS_WITH_NAME( ActorSound, Sound ); void ActorSound::Load( const RString &sPath ) { @@ -53,6 +53,7 @@ void ActorSound::LoadFromNode( const XNode* pNode ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ActorSound. */ class LunaActorSound: public Luna { public: diff --git a/src/ActorUtil.h b/src/ActorUtil.h index f8c2b56b41..bab0991a96 100644 --- a/src/ActorUtil.h +++ b/src/ActorUtil.h @@ -1,5 +1,3 @@ -/* ActorUtil - Utility functions for creating and manipulating Actors. */ - #ifndef ActorUtil_H #define ActorUtil_H @@ -13,14 +11,21 @@ typedef Actor* (*CreateActorFn)(); template Actor *CreateActor() { return new T; } -// Each Actor class should have a REGISTER_ACTOR_CLASS in its CPP file. +/** + * @brief Register the requested Actor with the specified external name. + * + * This should be called manually only if needed. */ #define REGISTER_ACTOR_CLASS_WITH_NAME( className, externalClassName ) \ struct Register##className { \ Register##className() { ActorUtil::Register(#externalClassName, CreateActor); } \ }; \ - static Register##className register##className; \ - className *className::Copy() const { return new className(*this); } + className *className::Copy() const { return new className(*this); } \ + static Register##className register##className +/** + * @brief Register the requested Actor so that it's more accessible. + * + * Each Actor class should have a REGISTER_ACTOR_CLASS in its CPP file. */ #define REGISTER_ACTOR_CLASS( className ) REGISTER_ACTOR_CLASS_WITH_NAME( className, className ) enum FileType @@ -36,6 +41,7 @@ enum FileType }; const RString& FileTypeToString( FileType ft ); +/** @brief Utility functions for creating and manipulating Actors. */ namespace ActorUtil { // Every screen should register its class at program initialization. diff --git a/src/AdjustSync.h b/src/AdjustSync.h index 9131992b94..3a77f35c24 100644 --- a/src/AdjustSync.h +++ b/src/AdjustSync.h @@ -1,14 +1,15 @@ -/* AdjustSync - Allows for adjusting the sync of a song. */ #ifndef AdjustSync_H #define AdjustSync_H -/* This class defines two ways of adjusting the sync of a song. +class TimingData; +/** + * @brief Allows for adjusting the sync of a song. + * + * This class defines two ways of adjusting the sync of a song. * The first adjusts only the offset, "on the fly". It can adjust either the * song itself or the machine. The other style adjusts both the BPM and the - * offset of the song, but it needs more data. */ - -class TimingData; - + * offset of the song, but it needs more data. + */ class AdjustSync { public: @@ -49,8 +50,10 @@ public: #endif -/* - * (c) 2003-2006 Chris Danford, John Bauer +/** + * @file + * @author Chris Danford, John Bauer (c) 2003-2006 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/AnnouncerManager.cpp b/src/AnnouncerManager.cpp index 888321f2d8..50759c01dd 100644 --- a/src/AnnouncerManager.cpp +++ b/src/AnnouncerManager.cpp @@ -166,6 +166,7 @@ void AnnouncerManager::NextAnnouncer() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the AnnouncerManager. */ class LunaAnnouncerManager: public Luna { public: diff --git a/src/BGAnimation.cpp b/src/BGAnimation.cpp index cac4f31866..dd93e73a8a 100644 --- a/src/BGAnimation.cpp +++ b/src/BGAnimation.cpp @@ -7,7 +7,7 @@ #include "Foreach.h" #include "LuaManager.h" -REGISTER_ACTOR_CLASS(BGAnimation) +REGISTER_ACTOR_CLASS(BGAnimation); BGAnimation::BGAnimation() { diff --git a/src/BPMDisplay.cpp b/src/BPMDisplay.cpp index b079cf9f93..5acf484d4e 100644 --- a/src/BPMDisplay.cpp +++ b/src/BPMDisplay.cpp @@ -12,7 +12,7 @@ #include -REGISTER_ACTOR_CLASS( BPMDisplay ) +REGISTER_ACTOR_CLASS( BPMDisplay ); BPMDisplay::BPMDisplay() { @@ -38,6 +38,7 @@ void BPMDisplay::Load() QUESTIONMARKS_TEXT.Load( m_sName, "QuestionMarksText" ); RANDOM_TEXT.Load( m_sName, "RandomText" ); VARIOUS_TEXT.Load( m_sName, "VariousText" ); + BPM_FORMAT_STRING.Load( m_sName, "FormatString" ); RunCommands( SET_NORMAL_COMMAND ); } @@ -76,9 +77,9 @@ void BPMDisplay::Update( float fDeltaTime ) { m_fBPMFrom = -1; if( (bool)SHOW_QMARKS ) - SetText( (RandomFloat(0,1)>0.90f) ? (RString)QUESTIONMARKS_TEXT : ssprintf("%03.0f",RandomFloat(0,999)) ); + SetText( (RandomFloat(0,1)>0.90f) ? (RString)QUESTIONMARKS_TEXT : ssprintf((RString)BPM_FORMAT_STRING,RandomFloat(0,999)) ); else - SetText( ssprintf("%03.0f",RandomFloat(0,999)) ); + SetText( ssprintf((RString)BPM_FORMAT_STRING, RandomFloat(0,999)) ); } else if(m_fBPMFrom == -1) { @@ -89,7 +90,7 @@ void BPMDisplay::Update( float fDeltaTime ) if( m_fBPMTo != -1) { const float fActualBPM = GetActiveBPM(); - SetText( ssprintf("%03.0f", fActualBPM) ); + SetText( ssprintf((RString)BPM_FORMAT_STRING, fActualBPM) ); } } @@ -286,7 +287,7 @@ void SongBPMDisplay::Update( float fDeltaTime ) BPMDisplay::Update( fDeltaTime ); } -REGISTER_ACTOR_CLASS( SongBPMDisplay ) +REGISTER_ACTOR_CLASS( SongBPMDisplay ); #include "LuaBinding.h" /** @brief Allow Lua to have access to the BPMDisplay. */ diff --git a/src/BPMDisplay.h b/src/BPMDisplay.h index d6fb4f5e71..566993a681 100644 --- a/src/BPMDisplay.h +++ b/src/BPMDisplay.h @@ -94,6 +94,8 @@ protected: ThemeMetric RANDOM_TEXT; /** @brief The text used as one possible option for random BPM. */ ThemeMetric QUESTIONMARKS_TEXT; + /** @brief The format string used for the numbers. */ + ThemeMetric BPM_FORMAT_STRING; /** @brief The lowest valued BPM. */ float m_fBPMFrom; diff --git a/src/Background.cpp b/src/Background.cpp index 624551a391..1456936d65 100644 --- a/src/Background.cpp +++ b/src/Background.cpp @@ -370,7 +370,6 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun } ASSERT( !sEffectFile.empty() ); - Actor *pActor = ActorUtil::MakeActor( sEffectFile ); ASSERT( pActor ); @@ -390,7 +389,7 @@ BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const R // Set to not show any BGChanges, whether scripted or random if( GAMESTATE->m_SongOptions.GetCurrent().m_bStaticBackground ) return BackgroundDef(); - + if( RandomBGAnimations.empty() ) return BackgroundDef(); @@ -430,7 +429,7 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac for( int i=max(iter->m_iStartRow,iStartRow); iGetNoteRowsPerMeasure() ) { - // Don't fade. It causes frame rate dip, especially on slower machines. + // Don't fade. It causes frame rate dip, especially on slower machines. BackgroundDef bd = m_Layer[0].CreateRandomBGA( m_pSong, change.m_def.m_sEffect, m_RandomBGAnimations, this ); if( !bd.IsEmpty() ) { @@ -458,12 +457,12 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac } if( !bAtBeginningOfMeasure ) - continue; // skip - + continue; // skip + // start so that we don't create a BGChange right on top of fEndBeat bool bInRange = bpmseg.m_iStartRow >= iStartRow && bpmseg.m_iStartRow < iEndRow; if( !bInRange ) - continue; // skip + continue; // skip BackgroundDef bd = m_Layer[0].CreateRandomBGA( m_pSong, change.m_def.m_sEffect, m_RandomBGAnimations, this ); if( !bd.IsEmpty() ) @@ -487,9 +486,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) if( g_fBGBrightness == 0.0f ) return; - // - // Choose a bunch of background that we'll use for the random file marker - // + // Choose a bunch of backgrounds that we'll use for the random file marker { vector vsThrowAway, vsNames; switch( g_RandomBackgroundMode ) diff --git a/src/BackgroundUtil.h b/src/BackgroundUtil.h index 855b13f349..be93fa640e 100644 --- a/src/BackgroundUtil.h +++ b/src/BackgroundUtil.h @@ -1,5 +1,3 @@ -/* BackgroundUtil - Shared background-related routines. */ - #ifndef BackgroundUtil_H #define BackgroundUtil_H @@ -61,7 +59,7 @@ struct BackgroundChange RString GetTextDescription() const; }; - +/** @brief Shared background-related routines. */ namespace BackgroundUtil { void SortBackgroundChangesArray( vector &vBackgroundChanges ); diff --git a/src/Banner.cpp b/src/Banner.cpp index c3ee65fab7..eec43af0de 100644 --- a/src/Banner.cpp +++ b/src/Banner.cpp @@ -13,7 +13,7 @@ #include "UnlockManager.h" #include "PrefsManager.h" -REGISTER_ACTOR_CLASS( Banner ) +REGISTER_ACTOR_CLASS( Banner ); ThemeMetric SCROLL_RANDOM ("Banner","ScrollRandom"); ThemeMetric SCROLL_ROULETTE ("Banner","ScrollRoulette"); @@ -232,6 +232,7 @@ void Banner::LoadFromSortOrder( SortOrder so ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Banner. */ class LunaBanner: public Luna { public: diff --git a/src/BitmapText.cpp b/src/BitmapText.cpp index 141a661c75..a67f670aa4 100644 --- a/src/BitmapText.cpp +++ b/src/BitmapText.cpp @@ -11,7 +11,7 @@ #include "LuaBinding.h" #include "Foreach.h" -REGISTER_ACTOR_CLASS( BitmapText ) +REGISTER_ACTOR_CLASS( BitmapText ); /* XXX: Changing a whole array of diffuse colors every frame (several times) is * a waste, when we're usually setting them all to the same value. Rainbow and @@ -794,6 +794,8 @@ void BitmapText::Attribute::FromStack( lua_State *L, int iPos ) // lua start #include "FontCharAliases.h" + +/** @brief Allow Lua to have access to the BitmapText. */ class LunaBitmapText: public Luna { public: diff --git a/src/Bookkeeper.h b/src/Bookkeeper.h index 24a46baed7..07272e7928 100644 --- a/src/Bookkeeper.h +++ b/src/Bookkeeper.h @@ -1,5 +1,3 @@ -/* Bookkeeper - coin tracking. */ - #ifndef Bookkeeper_H #define Bookkeeper_H @@ -7,6 +5,7 @@ #include class XNode; +/** @brief Track when coins were put into the machine. */ class Bookkeeper { public: @@ -30,12 +29,26 @@ public: void WriteToDisk(); private: + /** @brief A simple way of handling the date. */ struct Date { - int m_iHour; // 0 = midnight - int m_iDayOfYear; // 0 = Jan 1 - int m_iYear; // eg. 2005 + /** + * @brief The hour of the date. + * + * The value 0 is defined to be midnight. */ + int m_iHour; + /** + * @brief The day of the year of the date. + * + * The value 0 is defined to be January 1st. */ + int m_iDayOfYear; + /** @brief The year of the date (e.g., 2005). */ + int m_iYear; + /** @brief Set up a date with initial values. */ Date() { m_iHour = m_iDayOfYear = m_iYear = 0; } + /** + * @brief Set up a date based on the given time. + * @param time the time to turn into a Date. */ Date( tm time ) { Set(time); } void Set( time_t t ); void Set( tm pTime ); @@ -53,8 +66,10 @@ extern Bookkeeper* BOOKKEEPER; // global and accessable from anywhere in our pro #endif -/* - * (c) 2003-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2003-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Character.cpp b/src/Character.cpp index ac8a8da14d..a925c8b563 100644 --- a/src/Character.cpp +++ b/src/Character.cpp @@ -198,6 +198,7 @@ void Character::UndemandGraphics() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Character. */ class LunaCharacter: public Luna { public: diff --git a/src/CharacterManager.cpp b/src/CharacterManager.cpp index 7a0b6b6fa3..f00522ec7c 100644 --- a/src/CharacterManager.cpp +++ b/src/CharacterManager.cpp @@ -120,6 +120,7 @@ Character* CharacterManager::GetCharacterFromID( RString sCharacterID ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the CharacterManager. */ class LunaCharacterManager: public Luna { public: diff --git a/src/ComboGraph.cpp b/src/ComboGraph.cpp index bc033c296b..01f22e373a 100644 --- a/src/ComboGraph.cpp +++ b/src/ComboGraph.cpp @@ -8,7 +8,7 @@ const int MinComboSizeToShow = 5; -REGISTER_ACTOR_CLASS( ComboGraph ) +REGISTER_ACTOR_CLASS( ComboGraph ); ComboGraph::ComboGraph() { @@ -112,6 +112,7 @@ void ComboGraph::Set( const StageStats &s, const PlayerStageStats &pss ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ComboGraph. */ class LunaComboGraph: public Luna { public: diff --git a/src/CommonMetrics.cpp b/src/CommonMetrics.cpp index f7764b71ce..02629cb1eb 100644 --- a/src/CommonMetrics.cpp +++ b/src/CommonMetrics.cpp @@ -8,15 +8,16 @@ #include "ProductInfo.h" #include "LuaManager.h" -ThemeMetric CommonMetrics::FIRST_ATTRACT_SCREEN ("Common","FirstAttractScreen"); -ThemeMetric CommonMetrics::DEFAULT_MODIFIERS ("Common","DefaultModifiers" ); -LocalizedString CommonMetrics::WINDOW_TITLE ("Common","WindowTitle"); +ThemeMetric CommonMetrics::OPERATOR_MENU_SCREEN ("Common","OperatorMenuScreen"); +ThemeMetric CommonMetrics::FIRST_ATTRACT_SCREEN ("Common","FirstAttractScreen"); +ThemeMetric CommonMetrics::DEFAULT_MODIFIERS ("Common","DefaultModifiers" ); +LocalizedString CommonMetrics::WINDOW_TITLE ("Common","WindowTitle"); ThemeMetric CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS("Common","MaxCourseEntriesBeforeShowVarious"); ThemeMetric CommonMetrics::TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds"); -ThemeMetric CommonMetrics::DEFAULT_NOTESKIN_NAME ("Common","DefaultNoteSkinName"); -ThemeMetricDifficultiesToShow CommonMetrics::DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow"); +ThemeMetric CommonMetrics::DEFAULT_NOTESKIN_NAME ("Common","DefaultNoteSkinName"); +ThemeMetricDifficultiesToShow CommonMetrics::DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow"); ThemeMetricCourseDifficultiesToShow CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW ("Common","CourseDifficultiesToShow"); -ThemeMetricStepsTypesToShow CommonMetrics::STEPS_TYPES_TO_SHOW ("Common","StepsTypesToHide"); // This metric takes a list of StepsTypes to hide and returns a list of StepsTypes to show +ThemeMetricStepsTypesToShow CommonMetrics::STEPS_TYPES_TO_SHOW ("Common","StepsTypesToHide"); ThemeMetric CommonMetrics::AUTO_SET_STYLE ("Common","AutoSetStyle"); ThemeMetric CommonMetrics::PERCENT_SCORE_DECIMAL_PLACES ("Common","PercentScoreDecimalPlaces"); @@ -79,7 +80,6 @@ void ThemeMetricCourseDifficultiesToShow::Read() } const vector& ThemeMetricCourseDifficultiesToShow::GetValue() const { return m_v; } - static void RemoveStepsTypes( vector& inout, RString sStepsTypesToRemove ) { vector v; diff --git a/src/CommonMetrics.h b/src/CommonMetrics.h index 2c9db444bf..f0ca41c1cb 100644 --- a/src/CommonMetrics.h +++ b/src/CommonMetrics.h @@ -45,23 +45,34 @@ private: /** @brief The common metrics that are used throughout. */ namespace CommonMetrics { - extern ThemeMetric FIRST_ATTRACT_SCREEN; - extern ThemeMetric DEFAULT_MODIFIERS; - /** @brief the phrase that appears on the title bar. */ + /** @brief The first screen in the attract loop. */ + extern ThemeMetric FIRST_ATTRACT_SCREEN; + /** @brief The screen that appears when pressing the operator button. */ + extern ThemeMetric OPERATOR_MENU_SCREEN; + /** @brief The default modifiers to apply. */ + extern ThemeMetric DEFAULT_MODIFIERS; + /** @brief The caption on the title bar. */ extern LocalizedString WINDOW_TITLE; - extern ThemeMetric MAX_COURSE_ENTRIES_BEFORE_VARIOUS; + /** @brief How many entries should be shown before showing "Various" instead. */ + extern ThemeMetric MAX_COURSE_ENTRIES_BEFORE_VARIOUS; + /** @brief Adjusts the assist tick sound's playback time. */ extern ThemeMetric TICK_EARLY_SECONDS; /** @brief the name of the default noteskin. */ - extern ThemeMetric DEFAULT_NOTESKIN_NAME; + extern ThemeMetric DEFAULT_NOTESKIN_NAME; /** @brief Which difficulties are to be shown? */ - extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW; + extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW; /** @brief Which course difficulties are to be shown? */ extern ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW; - /** @brief Which step types are to be shown? */ - extern ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW; + /** + * @brief Which step types are to be shown? + * + * This metric (StepsTypesToHide) takes a list of StepsTypes to hide and + * returns a list of StepsTypes to show. */ + extern ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW; + /** @brief Does the player need to explicitly set a style? */ extern ThemeMetric AUTO_SET_STYLE; /** @brief How many decimal places are used? */ - extern ThemeMetric PERCENT_SCORE_DECIMAL_PLACES; + extern ThemeMetric PERCENT_SCORE_DECIMAL_PLACES; RString LocalizeOptionItem( const RString &s, bool bOptional ); }; diff --git a/src/ControllerStateDisplay.cpp b/src/ControllerStateDisplay.cpp index f8a69de06d..d97c664b64 100644 --- a/src/ControllerStateDisplay.cpp +++ b/src/ControllerStateDisplay.cpp @@ -27,7 +27,7 @@ static const GameButton ControllerStateButtonToGameButton[] = { PUMP_BUTTON_DOWNRIGHT, }; -REGISTER_ACTOR_CLASS( ControllerStateDisplay ) +REGISTER_ACTOR_CLASS( ControllerStateDisplay ); ControllerStateDisplay::ControllerStateDisplay() { @@ -95,7 +95,8 @@ void ControllerStateDisplay::Update( float fDelta ) } } -// lua start + +/** @brief Allow Lua to have access to the ControllerStateDisplay. */ class LunaControllerStateDisplay: public Luna { public: diff --git a/src/Course.cpp b/src/Course.cpp index 2833f434ed..278112f490 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -88,6 +88,7 @@ int CourseEntry::GetNumModChanges() const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the CourseEntry. */ class LunaCourseEntry: public Luna { public: @@ -1045,6 +1046,7 @@ bool Course::Matches( RString sGroup, RString sCourse ) const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Course. */ class LunaCourse: public Luna { public: diff --git a/src/Course.h b/src/Course.h index e9a83ad52b..b83b627334 100644 --- a/src/Course.h +++ b/src/Course.h @@ -1,5 +1,3 @@ -/* Course - A queue of songs and notes. */ - #ifndef COURSE_H #define COURSE_H @@ -33,6 +31,7 @@ enum SongSort SongSort_LowestGrades, NUM_SongSort, }; +/** @brief Loop through the various Song Sorts. */ #define FOREACH_SongSort( i ) FOREACH_ENUM( SongSort, i ) const RString& SongSortToString( SongSort ss ); const RString& SongSortToLocalizedString( SongSort ss ); @@ -78,7 +77,7 @@ public: void PushSelf( lua_State *L ); }; - +/** @brief A queue of songs and notes. */ class Course { public: diff --git a/src/CourseContentsList.cpp b/src/CourseContentsList.cpp index 98dfa1d61f..7b03b083c2 100644 --- a/src/CourseContentsList.cpp +++ b/src/CourseContentsList.cpp @@ -10,7 +10,7 @@ #include "RageUtil.h" #include "Steps.h" -REGISTER_ACTOR_CLASS( CourseContentsList ) +REGISTER_ACTOR_CLASS( CourseContentsList ); CourseContentsList::~CourseContentsList() { @@ -145,6 +145,7 @@ void CourseContentsList::SetItemFromGameState( Actor *pActor, int iCourseEntryIn // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the CourseContentsList. */ class LunaCourseContentsList: public Luna { public: diff --git a/src/CourseContentsList.h b/src/CourseContentsList.h index f0b38cbb04..7d11a09df4 100644 --- a/src/CourseContentsList.h +++ b/src/CourseContentsList.h @@ -1,11 +1,9 @@ -/* CourseContentsList - Holds course name and banner. */ - #ifndef COURSE_CONTENTS_LIST_H #define COURSE_CONTENTS_LIST_H #include "ActorScroller.h" class CourseEntryDisplay; - +/** @brief Holds course name and banner. */ class CourseContentsList : public ActorScroller { public: diff --git a/src/CourseUtil.h b/src/CourseUtil.h index d0c4738cef..3d707a1052 100644 --- a/src/CourseUtil.h +++ b/src/CourseUtil.h @@ -1,5 +1,3 @@ -/** @brief CourseUtil - Utility functions that deal with Course. */ - #ifndef COURSEUTIL_H #define COURSEUTIL_H @@ -13,6 +11,7 @@ class XNode; class CourseEntry; class Song; +/** @brief Utility functions that deal with Courses. */ namespace CourseUtil { void SortCoursePointerArrayByDifficulty( vector &vpCoursesInOut ); @@ -43,6 +42,7 @@ namespace CourseUtil //RString GetSectionNameFromCourseAndSort( const Course *pCourse, SortOrder so ); }; +/** @brief Utility functions that deal with Edit Courses. */ namespace EditCourseUtil { void UpdateAndSetTrail(); diff --git a/src/CryptManager.cpp b/src/CryptManager.cpp index 28c768c6a2..5841a103b3 100644 --- a/src/CryptManager.cpp +++ b/src/CryptManager.cpp @@ -430,6 +430,7 @@ RString CryptManager::GenerateRandomUUID() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the CryptManager. */ class LunaCryptManager: public Luna { public: diff --git a/src/Difficulty.h b/src/Difficulty.h index 8cf64671bb..63840eb1d9 100644 --- a/src/Difficulty.h +++ b/src/Difficulty.h @@ -26,6 +26,7 @@ Difficulty DwiCompatibleStringToDifficulty( const RString& sDC ); typedef Difficulty CourseDifficulty; const int NUM_CourseDifficulty = NUM_Difficulty; +/** @brief Loop through the shown course difficulties. */ #define FOREACH_ShownCourseDifficulty( cd ) for( Difficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=Difficulty_Invalid; cd=GetNextShownCourseDifficulty(cd) ) const RString& CourseDifficultyToLocalizedString( Difficulty dc ); diff --git a/src/DifficultyIcon.cpp b/src/DifficultyIcon.cpp index 8cde519d76..3a7439b45d 100644 --- a/src/DifficultyIcon.cpp +++ b/src/DifficultyIcon.cpp @@ -12,7 +12,7 @@ #include "XmlFile.h" #include "LuaManager.h" -REGISTER_ACTOR_CLASS(DifficultyIcon) +REGISTER_ACTOR_CLASS(DifficultyIcon); DifficultyIcon::DifficultyIcon() { @@ -95,6 +95,7 @@ void DifficultyIcon::SetFromDifficulty( Difficulty dc ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the DifficultyIcon. */ class LunaDifficultyIcon: public Luna { public: diff --git a/src/DifficultyList.cpp b/src/DifficultyList.cpp index 668061d8c8..f8dfa19440 100644 --- a/src/DifficultyList.cpp +++ b/src/DifficultyList.cpp @@ -24,7 +24,7 @@ // "magic" 6. -aj #define MAX_METERS (NUM_Difficulty * 6) + MAX_EDITS_PER_SONG -REGISTER_ACTOR_CLASS( StepsDisplayList ) +REGISTER_ACTOR_CLASS( StepsDisplayList ); StepsDisplayList::StepsDisplayList() { @@ -379,6 +379,7 @@ void StepsDisplayList::HandleMessage( const Message &msg ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the StepsDisplayList. */ class LunaStepsDisplayList: public Luna { public: diff --git a/src/DynamicActorScroller.cpp b/src/DynamicActorScroller.cpp index e79e2a4392..51f256cc6a 100644 --- a/src/DynamicActorScroller.cpp +++ b/src/DynamicActorScroller.cpp @@ -126,7 +126,7 @@ void DynamicActorScroller::ConfigureActor( Actor *pActor, int iItem ) LUA->Release(L); } -REGISTER_ACTOR_CLASS_WITH_NAME( DynamicActorScrollerAutoDeleteChildren, DynamicActorScroller ) +REGISTER_ACTOR_CLASS_WITH_NAME( DynamicActorScrollerAutoDeleteChildren, DynamicActorScroller ); /* * (c) 2005 Glenn Maynard diff --git a/src/EditMenu.h b/src/EditMenu.h index 0d03ef1e04..6d641cbdec 100644 --- a/src/EditMenu.h +++ b/src/EditMenu.h @@ -1,5 +1,3 @@ -/* EditMenu - UI on Edit Menu screen. Create Steps, delete Steps, or launch Steps in editor. */ - #ifndef EDIT_MENU_H #define EDIT_MENU_H @@ -23,6 +21,7 @@ enum EditMenuRow ROW_ACTION, NUM_EditMenuRow }; +/** @brief Loop through each EditMenuRow. */ #define FOREACH_EditMenuRow( r ) FOREACH_ENUM( EditMenuRow, r ) const RString& EditMenuRowToString( EditMenuRow r ); const RString& EditMenuRowToLocalizedString( EditMenuRow r ); @@ -42,6 +41,10 @@ const RString& EditMenuActionToLocalizedString( EditMenuAction ema ); const int NUM_ARROWS = 2; +/** + * @brief UI on Edit Menu screen. + * + * Create Steps, delete Steps, or launch Steps in editor. */ class EditMenu: public ActorFrame { public: diff --git a/src/EnumHelper.h b/src/EnumHelper.h index e7bba4e8a3..5c8b222523 100644 --- a/src/EnumHelper.h +++ b/src/EnumHelper.h @@ -10,7 +10,9 @@ extern "C" #include "lua-5.1/src/lua.h" } +/** @brief A general foreach loop for enumerators, going up to a max value. */ #define FOREACH_ENUM_N( e, max, var ) for( e var=(e)0; var( var, +1 ) ) +/** @brief A general foreach loop for enumerators. */ #define FOREACH_ENUM( e, var ) for( e var=(e)0; var( var, +1 ) ) int CheckEnum( lua_State *L, LuaReference &table, int iPos, int iInvalid, const char *szType, bool bAllowInvalid ); @@ -25,7 +27,7 @@ struct EnumTraits }; template LuaReference EnumTraits::StringToEnum; template LuaReference EnumTraits::EnumToString; - +/** @brief Lua helpers for Enumerators. */ namespace Enum { template @@ -126,8 +128,10 @@ namespace LuaHelpers { template<> void Push( lua_State *L, const X &Object ) #endif -/* - * (c) 2004-2006 Chris Danford, Glenn Maynard +/** + * @file + * @author Chris Danford, Glenn Maynard (c) 2004-2006 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/FadingBanner.cpp b/src/FadingBanner.cpp index b3bbe3e81a..cc1948ef2a 100644 --- a/src/FadingBanner.cpp +++ b/src/FadingBanner.cpp @@ -11,7 +11,7 @@ #include "ThemeMetric.h" #include "ActorUtil.h" -REGISTER_ACTOR_CLASS( FadingBanner ) +REGISTER_ACTOR_CLASS( FadingBanner ); /* Allow fading from one banner to another. We can handle two fades at once; * this is used to fade from an old banner to a low-quality banner to a high- @@ -255,6 +255,7 @@ void FadingBanner::LoadCourseFallback() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the FadingBanner. */ class LunaFadingBanner: public Luna { public: diff --git a/src/Font.cpp b/src/Font.cpp index ec00195979..ca95e58605 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -237,7 +237,7 @@ Font::~Font() void Font::Unload() { - LOG->Trace("Font:Unload '%s'",path.c_str()); + //LOG->Trace("Font:Unload '%s'",path.c_str()); for( unsigned i = 0; i < m_apPages.size(); ++i ) delete m_apPages[i]; m_apPages.clear(); @@ -655,7 +655,7 @@ void Font::Load( const RString &sIniPath, RString sChars ) { ASSERT_M( !GetExtension(sIniPath).CompareNoCase("ini"), sIniPath ); - LOG->Trace( "Font: Loading new font '%s'",sIniPath.c_str()); + //LOG->Trace( "Font: Loading new font '%s'",sIniPath.c_str()); // Check for recursion (recursive imports). for( unsigned i = 0; i < LoadStack.size(); ++i ) @@ -726,9 +726,10 @@ void Font::Load( const RString &sIniPath, RString sChars ) continue; } - Font *subfont=FONT->LoadFont(path,""); - MergeFont(*subfont); - FONT->UnloadFont(subfont); + Font subfont; + subfont.Load(path,""); + MergeFont(subfont); + //FONT->UnloadFont(subfont); } } diff --git a/src/Font.h b/src/Font.h index 3d3219c739..3582556655 100644 --- a/src/Font.h +++ b/src/Font.h @@ -1,4 +1,4 @@ -/* Font - stores a font, used by BitmapText. */ +/** @brief Font - stores a font, used by BitmapText. */ #ifndef FONT_H #define FONT_H @@ -12,13 +12,17 @@ class FontPage; class RageTexture; class IniFile; +/** @brief The textures used by the font. */ struct FontPageTextures { + /** @brief The primary texture drawn underneath Main. */ RageTexture *m_pTextureMain; - /* an optional texture drawn underneath Main that can help to acheive - * complicated layer styles. */ + /** @brief an optional texture drawn underneath Main. + * + * This can help to acheive complicated layer styles. */ RageTexture *m_pTextureStroke; + /** @brief Set up the initial textures. */ FontPageTextures() { m_pTextureMain = NULL; @@ -26,25 +30,31 @@ struct FontPageTextures } }; +/** @brief The components of a glyph (not technically a character). */ struct glyph { + /** @brief the FontPage that is needed. */ FontPage *m_pPage; + /** @brief the textures for the glyph. */ FontPageTextures m_FontPageTextures; FontPageTextures *GetFontPageTextures() const { return const_cast(&m_FontPageTextures); } - // Number of pixels to advance horizontally after drawing this character. + /** @brief Number of pixels to advance horizontally after drawing this character. */ int m_iHadvance; - // Size of the actual rendered character. - float m_fWidth, m_fHeight; + /** @brief Width of the actual rendered character. */ + float m_fWidth; + /** @brief Height of the actual rendered character. */ + float m_fHeight; - // Number of pixels to offset this character when rendering. + /** @brief Number of pixels to offset this character when rendering. */ float m_fHshift; // , m_fVshift; - // Texture coordinate rect. + /** @brief Texture coordinate rect. */ RectF m_TexRect; }; +/** @brief The settings used for the FontPage. */ struct FontPageSettings { RString m_sTexturePath; @@ -64,6 +74,7 @@ struct FontPageSettings // If a value is missing, the width of the texture frame is used. map m_mapGlyphWidths; + /** @brief The initial settings for the FontPage. */ FontPageSettings(): m_iDrawExtraPixelsLeft(0), m_iDrawExtraPixelsRight(0), m_iAddToAllWidths(0), @@ -76,8 +87,13 @@ struct FontPageSettings m_sTextureHints("default") { } - /* Map a range from a character map to glyphs. If cnt is -1, map the - * whole map. Returns "" or an error message. */ + /** + * @brief Map a range from a character map to glyphs. + * @param sMapping the intended mapping. + * @param iMapOffset the number of maps to offset. + * @param iGlyphOffset the number of glyphs to offset. + * @param iCount the range to map. If -1, the range is the entire map. + * @return the empty string on success, or an error message on failure. */ RString MapRange( RString sMapping, int iMapOffset, int iGlyphOffset, int iCount ); }; @@ -96,14 +112,15 @@ public: int GetCenter() const { return m_iHeight/2; } // Remember these only for GetLineWidthInSourcePixels. - int m_iDrawExtraPixelsLeft, m_iDrawExtraPixelsRight; + int m_iDrawExtraPixelsLeft, + m_iDrawExtraPixelsRight; FontPageTextures m_FontPageTextures; // XXX: remove? RString m_sTexturePath; - // All glyphs in this list will point to m_pTexture. + /** @brief All glyphs in this list will point to m_pTexture. */ vector m_aGlyphs; map m_iCharToGlyphNo; @@ -129,10 +146,15 @@ public: bool FontCompleteForString( const wstring &str ) const; - // Add a FontPage to this font. + /** + * @brief Add a FontPage to this font. + * @param fp the FontPage to be added. + */ void AddPage(FontPage *fp); - // Steal all of a font's pages. + /** + * @brief Steal all of a font's pages. + * @param f the font whose pages we are stealing. */ void MergeFont(Font &f); void Load(const RString &sFontOrTextureFilePath, RString sChars); @@ -152,25 +174,31 @@ public: const RageColor &GetDefaultStrokeColor() const { return m_DefaultStrokeColor; }; private: - // List of pages and fonts that we use (and are responsible for freeing). + /** @brief List of pages and fonts that we use (and are responsible for freeing). */ vector m_apPages; - /* This is the primary fontpage of this font; font-wide height, center, - * etc. is pulled from it. (This is one of pages[].) */ + /** + * @brief This is the primary fontpage of this font. + * + * The font-wide height, center, etc. is pulled from it. + * (This is one of pages[].) */ FontPage *m_pDefault; - // Map from characters to glyphs. (Each glyph* is part of one of pages[].) + /** @brief Map from characters to glyphs. */ map m_iCharToGlyph; + /** @brief Each glyph is part of one of the pages[]. */ glyph *m_iCharToGlyphCache[128]; - // True for Hebrew, Arabic, Urdu fonts. - // This will also change the way glyphs from the default FontPage are rendered. - // There may be a better way to handle this. + /** + * @brief True for Hebrew, Arabic, Urdu fonts. + * + * This will also change the way glyphs from the default FontPage are rendered. + * There may be a better way to handle this. */ bool m_bRightToLeft; RageColor m_DefaultStrokeColor; - // We keep this around only for reloading. + /** @brief We keep this around only for reloading. */ RString m_sChars; void LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RString &sTexturePath, const RString &PageName, RString sChars ); @@ -178,14 +206,17 @@ private: RString GetPageNameFromFileName( const RString &sFilename ); }; -/* Last private-use Unicode character: */ -/* This is in the header to reduce file dependencies. */ +/** + * @brief Last private-use Unicode character: + * + * This is in the header to reduce file dependencies. */ const wchar_t FONT_DEFAULT_GLYPH = 0xF8FF; #endif -/* - * (c) 2001-2004 Glenn Maynard, Chris Danford +/** + * @file + * @author Glenn Maynard, Chris Danford (c) 2001-2004 * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/FontCharAliases.h b/src/FontCharAliases.h index 299622b987..ebb694ab5c 100644 --- a/src/FontCharAliases.h +++ b/src/FontCharAliases.h @@ -1,7 +1,7 @@ -/* FontCharAliases - Provides support for nonstandard characters in text. */ #ifndef FONT_CHAR_ALIASES #define FONT_CHAR_ALIASES +/** @brief Provides support for nonstandard characters in text. */ namespace FontCharAliases { void ReplaceMarkers( RString &sText ); diff --git a/src/FontCharmaps.h b/src/FontCharmaps.h index da8cdbee85..28307dc2a8 100644 --- a/src/FontCharmaps.h +++ b/src/FontCharmaps.h @@ -1,7 +1,6 @@ -/* FontCharmaps - Defines common frame to character mappings for Fonts. */ #ifndef FONT_CHARMAPS_H #define FONT_CHARMAPS_H - +/** @brief Defines common frame to character mappings for Fonts. */ namespace FontCharmaps { extern const wchar_t M_SKIP; diff --git a/src/FontManager.cpp b/src/FontManager.cpp index 837a5d5aa1..243c06adbc 100644 --- a/src/FontManager.cpp +++ b/src/FontManager.cpp @@ -43,10 +43,10 @@ Font* FontManager::LoadFont( const RString &sFontOrTextureFilePath, RString sCha PruneFonts(); Font *pFont; - // Convert the path to lowercase so that we don't load duplicates. - // Really, this does not solve the duplicate problem. We could have two copies - // of the same bitmap if there are equivalent but different paths - // (e.g. "graphics\blah.png" and "..\stepmania\graphics\blah.png" ). + /* Convert the path to lowercase so that we don't load duplicates. Really, + * this does not solve the duplicate problem. We could have two copies of + * the same bitmap if there are equivalent but different paths + * (e.g. "graphics\blah.png" and "..\stepmania\graphics\blah.png" ). */ CHECKPOINT_M( ssprintf("FontManager::LoadFont(%s).", sFontOrTextureFilePath.c_str()) ); const FontName NewName( sFontOrTextureFilePath, sChars ); @@ -54,6 +54,7 @@ Font* FontManager::LoadFont( const RString &sFontOrTextureFilePath, RString sCha if( p != g_mapPathToFont.end() ) { pFont=p->second; + pFont->m_iRefCount++; } else { pFont= new Font; @@ -61,7 +62,6 @@ Font* FontManager::LoadFont( const RString &sFontOrTextureFilePath, RString sCha g_mapPathToFont[NewName] = pFont; } - ++pFont->m_iRefCount; return pFont; } diff --git a/src/Foreach.h b/src/Foreach.h index f4482e12a4..93ae960c66 100644 --- a/src/Foreach.h +++ b/src/Foreach.h @@ -1,38 +1,53 @@ #ifndef Foreach_H #define Foreach_H +/** @brief General foreach loop iterating over a vector. */ #define FOREACH( elemType, vect, var ) \ for( vector::iterator var = (vect).begin(); var != (vect).end(); ++var ) +/** @brief General foreach loop iterating over a vector, using a constant iterator. */ #define FOREACH_CONST( elemType, vect, var ) \ for( vector::const_iterator var = (vect).begin(); var != (vect).end(); ++var ) +/** @brief General foreach loop iterating over a deque. */ #define FOREACHD( elemType, vect, var ) \ for( deque::iterator var = (vect).begin(); var != (vect).end(); ++var ) +/** @brief General foreach loop iterating over a deque, using a constant iterator. */ #define FOREACHD_CONST( elemType, vect, var ) \ for( deque::const_iterator var = (vect).begin(); var != (vect).end(); ++var ) +/** @brief General foreach loop iterating over a set. */ #define FOREACHS( elemType, vect, var ) \ for( set::iterator var = (vect).begin(); var != (vect).end(); ++var ) +/** @brief General foreach loop iterating over a set, using a constant iterator. */ #define FOREACHS_CONST( elemType, vect, var ) \ for( set::const_iterator var = (vect).begin(); var != (vect).end(); ++var ) +/** @brief General foreach loop iterating over a list. */ #define FOREACHL( elemType, vect, var ) \ for( list::iterator var = (vect).begin(); var != (vect).end(); ++var ) +/** @brief General foreach loop iterating over a list, using a constant iterator. */ #define FOREACHL_CONST( elemType, vect, var ) \ for( list::const_iterator var = (vect).begin(); var != (vect).end(); ++var ) +/** @brief General foreach loop iterating over a map. */ #define FOREACHM( keyType, valType, vect, var ) \ for( map::iterator var = (vect).begin(); var != (vect).end(); ++var ) +/** @brief General foreach loop iterating over a map, using a constant iterator. */ #define FOREACHM_CONST( keyType, valType, vect, var ) \ for( map::const_iterator var = (vect).begin(); var != (vect).end(); ++var ) +/** @brief General foreach loop iterating over a multimap. */ #define FOREACHMM( keyType, valType, vect, var ) \ for( multimap::iterator var = (vect).begin(); var != (vect).end(); ++var ) +/* Hmm...any reason why there is no FOREACHMM_CONST? */ + #endif -/* - * (c) 2004-2005 Chris Danford +/** + * @file + * @author Chris Danford (c) 2004-2005 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Game.cpp b/src/Game.cpp index 036b3f2e1c..2e1c09511c 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -42,6 +42,7 @@ const Game::PerButtonInfo *Game::GetPerButtonInfo( GameButton gb ) const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Game. */ class LunaGame: public Luna { public: diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp index b6717b8fb6..2bd5c7051a 100644 --- a/src/GameCommand.cpp +++ b/src/GameCommand.cpp @@ -855,6 +855,7 @@ bool GameCommand::IsZero() const #include "Steps.h" #include "Character.h" +/** @brief Allow Lua to have access to the GameCommand. */ class LunaGameCommand: public Luna { public: diff --git a/src/GameConstantsAndTypes.h b/src/GameConstantsAndTypes.h index 9bd115b913..24fd0fc8f1 100644 --- a/src/GameConstantsAndTypes.h +++ b/src/GameConstantsAndTypes.h @@ -662,6 +662,7 @@ enum CourseType NUM_CourseType, CourseType_Invalid }; +/** @brief A special iterator for handling the CourseTypes. */ #define FOREACH_CourseType( i ) FOREACH_ENUM( CourseType, i ) const RString& CourseTypeToString( CourseType i ); const RString& CourseTypeToLocalizedString( CourseType i ); diff --git a/src/GameInput.h b/src/GameInput.h index 37f4a72af3..0872a04860 100644 --- a/src/GameInput.h +++ b/src/GameInput.h @@ -58,6 +58,7 @@ RString GameButtonToString( const InputScheme* pInputs, GameButton i ); RString GameButtonToLocalizedString( const InputScheme* pInputs, GameButton i ); GameButton StringToGameButton( const InputScheme* pInputs, const RString& s ); +/** @brief A special way to loop through each game button. */ #define FOREACH_GameButton_Custom( gb ) for( GameButton gb=GAME_BUTTON_CUSTOM_01; gb { public: diff --git a/src/GamePreferences.h b/src/GamePreferences.h index dc9ee840e1..28ff545170 100644 --- a/src/GamePreferences.h +++ b/src/GamePreferences.h @@ -3,7 +3,7 @@ #include "Preference.h" #include "GameConstantsAndTypes.h" - +/** @brief Quick access to other variables. */ namespace GamePreferences { extern Preference m_CoinMode; diff --git a/src/GameSoundManager.cpp b/src/GameSoundManager.cpp index 9034b86a34..e19cd42bd6 100644 --- a/src/GameSoundManager.cpp +++ b/src/GameSoundManager.cpp @@ -781,6 +781,7 @@ float GameSoundManager::GetPlayerBalance( PlayerNumber pn ) #include "LuaBinding.h" +/** @brief Allow Lua to have access to the GameSoundManager. */ class LunaGameSoundManager: public Luna { public: diff --git a/src/GameSoundManager.h b/src/GameSoundManager.h index 49d321fece..df7b801d8b 100644 --- a/src/GameSoundManager.h +++ b/src/GameSoundManager.h @@ -1,5 +1,3 @@ -/* GameSoundManager - High-level sound utilities. */ - #ifndef RAGE_SOUNDS_H #define RAGE_SOUNDS_H @@ -8,7 +6,7 @@ class TimingData; class RageSound; struct lua_State; - +/** @brief High-level sound utilities. */ class GameSoundManager { public: diff --git a/src/GameState.cpp b/src/GameState.cpp index 0a190e750e..ec68e416a0 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -1389,8 +1389,6 @@ StageResult GameState::GetStageResult( PlayerNumber pn ) const return win; } - - void GameState::GetDefaultPlayerOptions( PlayerOptions &po ) { po.Init(); @@ -1450,6 +1448,22 @@ bool GameState::CurrentOptionsDisqualifyPlayer( PlayerNumber pn ) return po.IsEasierForSongAndSteps( m_pCurSong, m_pCurSteps[pn], pn); } +/* +void GameState::LoadNoteSkinMetrics( PlayerNumber pn ) +{ + // Read metrics from current noteskin for setting row/col spacing and + // arrow size (originally from StepMania AMX) + if( !IsPlayerEnabled( pn ) ) + return; + + ASSERT( this->m_pCurSteps[pn] ); + + RString m_sNoteSkin = m_pPlayerState[pn]->m_PlayerOptions.GetStage().m_sNoteSkin; + RString sStepsType = StringConversion::ToString( this->m_pCurSteps[pn]->m_StepsType ); + LOG->Trace("Loading Row/Col/Size values for Noteskin %s | StepsType: %s",m_sNoteSkin.c_str(),sStepsType.c_str()); +} +*/ + /* reset noteskins (?) * GameState::ResetNoteSkins() * GameState::ResetNoteSkinsForPlayer( PlayerNumber pn ) @@ -2160,6 +2174,7 @@ MultiPlayer GetNextEnabledMultiPlayer( MultiPlayer mp ) #include "LuaBinding.h" #include "Game.h" +/** @brief Allow Lua to have access to the GameState. */ class LunaGameState: public Luna { public: diff --git a/src/GameState.h b/src/GameState.h index 370f789a6c..89de4c05dc 100644 --- a/src/GameState.h +++ b/src/GameState.h @@ -1,5 +1,3 @@ -/** @brief GameState - Holds game data that is not saved between sessions. */ - #ifndef GAMESTATE_H #define GAMESTATE_H @@ -33,6 +31,7 @@ class Style; class TimingData; class Trail; +/** @brief Holds game data that is not saved between sessions. */ class GameState { public: @@ -123,7 +122,6 @@ public: bool IsCpuPlayer( PlayerNumber pn ) const; bool AnyPlayersAreCpu() const; - bool IsCourseMode() const; bool IsBattleMode() const; // not Rave @@ -214,10 +212,17 @@ public: BroadcastOnChange m_bGameplayLeadIn; // Metricable noteskin things - // void LoadNoteSkinMetrics( PlayerNumber pn ); - // int m_iRowSpacing; - // int m_iColSpacing; - // int m_iArrowSize; + /* + void LoadNoteSkinMetrics( PlayerNumber pn ); + int m_iNoteSkinColSpacing[NUM_PLAYERS]; + int m_iNoteSkinArrowSize[NUM_PLAYERS]; + */ + // not sure I want to let noteskins change row spacing, as that changes how + // the speed mods work... -aj + //int m_iNoteSkinRowSpacing[NUM_PLAYERS]; + // what are these for, exactly? -aj + //bool m_bNoteSkinOverrideDim[NUM_PLAYERS]; + //bool m_bNoteSkinOverrideBright[NUM_PLAYERS]; float m_fMusicSecondsVisible; float m_fSongBeatVisible; @@ -358,16 +363,21 @@ PlayerNumber GetNextHumanPlayer( PlayerNumber pn ); PlayerNumber GetNextEnabledPlayer( PlayerNumber pn ); PlayerNumber GetNextCpuPlayer( PlayerNumber pn ); PlayerNumber GetNextPotentialCpuPlayer( PlayerNumber pn ); - -#define FOREACH_HumanPlayer( pn ) for( PlayerNumber pn=GetNextHumanPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextHumanPlayer(pn) ) -#define FOREACH_EnabledPlayer( pn ) for( PlayerNumber pn=GetNextEnabledPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextEnabledPlayer(pn) ) -#define FOREACH_CpuPlayer( pn ) for( PlayerNumber pn=GetNextCpuPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextCpuPlayer(pn) ) -#define FOREACH_PotentialCpuPlayer( pn ) for( PlayerNumber pn=GetNextPotentialCpuPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextPotentialCpuPlayer(pn) ) - - MultiPlayer GetNextEnabledMultiPlayer( MultiPlayer mp ); + +/** @brief A foreach loop to act on each human Player. */ +#define FOREACH_HumanPlayer( pn ) for( PlayerNumber pn=GetNextHumanPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextHumanPlayer(pn) ) +/** @brief A foreach loop to act on each enabled Player. */ +#define FOREACH_EnabledPlayer( pn ) for( PlayerNumber pn=GetNextEnabledPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextEnabledPlayer(pn) ) +/** @brief A foreach loop to act on each CPU Player. */ +#define FOREACH_CpuPlayer( pn ) for( PlayerNumber pn=GetNextCpuPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextCpuPlayer(pn) ) +/** @brief A foreach loop to act on each potential CPU Player. */ +#define FOREACH_PotentialCpuPlayer( pn ) for( PlayerNumber pn=GetNextPotentialCpuPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextPotentialCpuPlayer(pn) ) +/** @brief A foreach loop to act on each Player in MultiPlayer. */ #define FOREACH_EnabledMultiPlayer( mp ) for( MultiPlayer mp=GetNextEnabledMultiPlayer((MultiPlayer)-1); mp!=MultiPlayer_Invalid; mp=GetNextEnabledMultiPlayer(mp) ) + + extern GameState* GAMESTATE; // global and accessable from anywhere in our program #endif diff --git a/src/Grade.cpp b/src/Grade.cpp index 7eaa651dd5..4506b16e49 100644 --- a/src/Grade.cpp +++ b/src/Grade.cpp @@ -8,6 +8,7 @@ LuaXType( Grade ); +/** @brief The current number of grade tiers being used. */ ThemeMetric NUM_GRADE_TIERS_USED("PlayerStageStats","NumGradeTiersUsed"); Grade GetNextPossibleGrade( Grade g ) diff --git a/src/Grade.h b/src/Grade.h index c520f39c6c..f913eac8ed 100644 --- a/src/Grade.h +++ b/src/Grade.h @@ -1,5 +1,3 @@ -/** @brief Grade - Mark the player receives after clearing a song. */ - #ifndef GRADE_H #define GRADE_H @@ -7,12 +5,10 @@ #include "EnumHelper.h" #include "ThemeMetric.h" -/** - * @brief Have a specific number of passing grade tiers. +/** @brief The list of grading tiers available. * - * TODO: Look into flexible grading tiers. */ -#define NUM_Grade_TierS 20 -/** @brief The list of grading tiers available. */ + * TODO: Look into a more flexible system without a fixed number of grades. -Wolfman2000 + */ enum Grade { Grade_Tier01, /**< Usually an AAAA */ @@ -39,6 +35,7 @@ enum Grade NUM_Grade, Grade_Invalid, }; +/** @brief Have an alternative for if there is no data for grading. */ #define Grade_NoData Grade_Invalid /** @@ -61,14 +58,32 @@ static inline RString GradeToString( Grade g ) } } -RString GradeToOldString( Grade g ); // "AAA", "B", etc for backward compatibility. Used in announcer +/** + * @brief Convert to the old version styled grade strings. + * + * This is mainly for backward compatibility purposes, but the announcer + * also uses it. Think "AAA", "B", etc. + * @param g the current Grade. + * @return the old styled grade string. */ +RString GradeToOldString( Grade g ); RString GradeToLocalizedString( Grade g ); +/** + * @brief Convert the given RString into a proper Grade. + * @param s the string to convert. + * @return the expected Grade. + */ Grade StringToGrade( const RString &s ); LuaDeclareType( Grade ); extern ThemeMetric NUM_GRADE_TIERS_USED; #define NUM_POSSIBLE_GRADES (NUM_GRADE_TIERS_USED+1) +/** + * @brief Step through the enumerator one at a time to get the next Grade. + * @param g the current Grade. + * @return the next Grade. */ Grade GetNextPossibleGrade( Grade g ); -#define FOREACH_PossibleGrade( g ) for( Grade g = (Grade)(0); g != Grade_Invalid; g = GetNextPossibleGrade(g) ) +/** @brief Loop through each possible Grade. */ +#define FOREACH_PossibleGrade( g ) \ +for( Grade g = (Grade)(0); g != Grade_Invalid; g = GetNextPossibleGrade(g) ) #endif diff --git a/src/GradeDisplay.cpp b/src/GradeDisplay.cpp index 49f7ca60f1..2648f50844 100644 --- a/src/GradeDisplay.cpp +++ b/src/GradeDisplay.cpp @@ -6,7 +6,7 @@ #include "ActorUtil.h" #include "ThemeManager.h" -REGISTER_ACTOR_CLASS( GradeDisplay ) +REGISTER_ACTOR_CLASS( GradeDisplay ); void GradeDisplay::Load( RString sMetricsGroup ) { @@ -36,6 +36,7 @@ void GradeDisplay::SetGrade( Grade grade ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the GradeDisplay. */ class LunaGradeDisplay: public Luna { public: diff --git a/src/GradeDisplay.h b/src/GradeDisplay.h index 5fbff846ea..4e16bab5aa 100644 --- a/src/GradeDisplay.h +++ b/src/GradeDisplay.h @@ -1,5 +1,3 @@ -/* GradeDisplay - Grade shown on ScreenEvaluation. */ - #ifndef GRADE_DISPLAY_H #define GRADE_DISPLAY_H @@ -8,7 +6,7 @@ #include "PlayerNumber.h" #include "AutoActor.h" struct lua_State; - +/** @brief Grade shown on ScreenEvaluation. */ class GradeDisplay : public ActorFrame { public: diff --git a/src/GraphDisplay.cpp b/src/GraphDisplay.cpp index cc5e2c29ab..ced69f6e27 100644 --- a/src/GraphDisplay.cpp +++ b/src/GraphDisplay.cpp @@ -13,7 +13,7 @@ #include "XmlFile.h" //#define DIVIDE_LINE_WIDTH THEME->GetMetricI(m_sName,"TexturedBottomHalf") -REGISTER_ACTOR_CLASS( GraphDisplay ) +REGISTER_ACTOR_CLASS( GraphDisplay ); enum { VALUE_RESOLUTION=100 }; @@ -108,7 +108,7 @@ private: vector m_Quads; vector m_pCircles; }; -REGISTER_ACTOR_CLASS( GraphLine ) +REGISTER_ACTOR_CLASS( GraphLine ); class GraphBody: public Actor { @@ -275,6 +275,7 @@ void GraphDisplay::UpdateVerts() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the GraphDisplay. */ class LunaGraphDisplay: public Luna { public: diff --git a/src/GraphDisplay.h b/src/GraphDisplay.h index 6931ac5647..a17bbe108e 100644 --- a/src/GraphDisplay.h +++ b/src/GraphDisplay.h @@ -1,4 +1,3 @@ -/* GraphDisplay - A graph of the player's life over the course of Gameplay, used on Evaluation. */ #ifndef GRAPH_DISPLAY_H #define GRAPH_DISPLAY_H @@ -9,6 +8,7 @@ class StageStats; class PlayerStageStats; class GraphLine; class GraphBody; +/** @brief A graph of the player's life over the course of Gameplay, used on Evaluation. */ class GraphDisplay: public ActorFrame { public: diff --git a/src/GrooveRadar.cpp b/src/GrooveRadar.cpp index 2544efafad..978ecd6516 100644 --- a/src/GrooveRadar.cpp +++ b/src/GrooveRadar.cpp @@ -10,12 +10,11 @@ #include "ThemeMetric.h" #include "CommonMetrics.h" #include "ActorUtil.h" +// I feel weird about this coupling, but it has to be done. -aj +#include "GameState.h" -REGISTER_ACTOR_CLASS(GrooveRadar) +REGISTER_ACTOR_CLASS(GrooveRadar); -#define LABEL_OFFSET_X( i ) THEME->GetMetricF("GrooveRadar",ssprintf("Label%dOffsetX",i+1)) -#define LABEL_OFFSET_Y( i ) THEME->GetMetricF("GrooveRadar",ssprintf("Label%dOffsetY",i+1)) -static const ThemeMetric LABEL_ON_DELAY ("GrooveRadar","LabelOnDelay"); static const ThemeMetric RADAR_EDGE_WIDTH ("GrooveRadar","EdgeWidth"); static const ThemeMetric RADAR_CENTER_ALPHA ("GrooveRadar","CenterAlpha"); @@ -27,8 +26,8 @@ GrooveRadar::GrooveRadar() { m_sprRadarBase.Load( THEME->GetPathG("GrooveRadar","base") ); m_Frame.AddChild( m_sprRadarBase ); - LOAD_ALL_COMMANDS( m_Frame ); m_Frame.SetName( "RadarFrame" ); + ActorUtil::LoadAllCommands( m_Frame, "GrooveRadar" ); FOREACH_PlayerNumber( p ) { @@ -42,12 +41,11 @@ GrooveRadar::GrooveRadar() for( int c=0; cGetPathG("GrooveRadar","labels 1x5") ); m_sprRadarLabels[c].StopAnimating(); m_sprRadarLabels[c].SetState( c ); - m_sprRadarLabels[c].SetXY( LABEL_OFFSET_X(c), LABEL_OFFSET_Y(c) ); - ActorUtil::LoadAllCommands( m_sprRadarLabels[c], "GrooveRadar" ); + ActorUtil::LoadAllCommandsAndSetXY( m_sprRadarLabels[c], "GrooveRadar" ); this->AddChild( &m_sprRadarLabels[c] ); } } @@ -57,46 +55,6 @@ void GrooveRadar::LoadFromNode( const XNode* pNode ) ActorFrame::LoadFromNode( pNode ); } -void GrooveRadar::TweenOnScreen() -{ - for( int c=0; cSetTextureMode( TextureUnit_1, TextureMode_Modulate ); RageSpriteVertex v[12]; // needed to draw 5 fan primitives and 10 strip primitives + // xxx: We could either make the values invisible or draw a dot + // (simulating real DDR). TODO: Make that choice up to the themer. -aj if( !m_bValuesVisible ) return; @@ -191,7 +151,7 @@ void GrooveRadar::GrooveRadarValueMap::DrawPrimitives() const float fX = RageFastCos(fRotation) * fDistFromCenter; const float fY = -RageFastSin(fRotation) * fDistFromCenter; - v[1+i].p = RageVector3( fX, fY, 0 ); + v[1+i].p = RageVector3( fX, fY, 0 ); v[1+i].c = v[1].c; } @@ -211,8 +171,7 @@ void GrooveRadar::GrooveRadarValueMap::DrawPrimitives() v[i].c = this->m_pTempState->diffuse[0]; } - // TODO: Add this back in. -Chris - // TODO: Add this back in as a theme metric. -aj + // TODO: Add this back in -Chris // switch( PREFSMAN->m_iPolygonRadar ) // { // case 0: DISPLAY->DrawLoop_LinesAndPoints( v, NUM_SHOWN_RADAR_CATEGORIES, RADAR_EDGE_WIDTH ); break; @@ -227,6 +186,7 @@ void GrooveRadar::GrooveRadarValueMap::DrawPrimitives() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the GrooveRadar. */ class LunaGrooveRadar: public Luna { public: @@ -245,15 +205,11 @@ public: return 0; } static int SetEmpty( T* p, lua_State *L ) { p->SetEmpty( Enum::Check(L, 1) ); return 0; } - static int tweenonscreen( T* p, lua_State *L ) { p->TweenOnScreen(); return 0; } - static int tweenoffscreen( T* p, lua_State *L ) { p->TweenOffScreen(); return 0; } LunaGrooveRadar() { ADD_METHOD( SetFromRadarValues ); ADD_METHOD( SetEmpty ); - ADD_METHOD( tweenonscreen ); - ADD_METHOD( tweenoffscreen ); } }; diff --git a/src/GrooveRadar.h b/src/GrooveRadar.h index 79d1f1df28..0cd6ba3d57 100644 --- a/src/GrooveRadar.h +++ b/src/GrooveRadar.h @@ -1,5 +1,3 @@ -/* GrooveRadar - The song's GrooveRadar displayed in SelectMusic. */ - #ifndef GROOVE_RADAR_H #define GROOVE_RADAR_H @@ -10,7 +8,7 @@ #include "GameConstantsAndTypes.h" class Steps; struct RadarValues; - +/** @brief The song's GrooveRadar displayed in SelectMusic. */ class GrooveRadar : public ActorFrame { public: @@ -22,15 +20,14 @@ public: void SetFromRadarValues( PlayerNumber pn, const RadarValues &rv ); void SetFromSteps( PlayerNumber pn, Steps* pSteps ); // NULL means no Steps - void TweenOnScreen(); - void TweenOffScreen(); - // Lua void PushSelf( lua_State *L ); protected: - - // the value map must be a separate Actor so we can tween it separately from the labels + /** + * @brief The companion ValueMap to the GrooveRadar. + * + * This must be a separate Actor so that it can be tweened separately from the labels. */ class GrooveRadarValueMap : public ActorFrame { public: diff --git a/src/HelpDisplay.cpp b/src/HelpDisplay.cpp index 544d5a691f..59d464629d 100644 --- a/src/HelpDisplay.cpp +++ b/src/HelpDisplay.cpp @@ -5,7 +5,7 @@ #include "ThemeManager.h" #include "ActorUtil.h" -REGISTER_ACTOR_CLASS( HelpDisplay ) +REGISTER_ACTOR_CLASS( HelpDisplay ); HelpDisplay::HelpDisplay() { @@ -62,6 +62,8 @@ void HelpDisplay::Update( float fDeltaTime ) #include "LuaBinding.h" #include "FontCharAliases.h" + +/** @brief Allow Lua to have access to the HelpDisplay. */ class LunaHelpDisplay: public Luna { public: diff --git a/src/HelpDisplay.h b/src/HelpDisplay.h index 6a5a0f9dcf..e9d0edfe9c 100644 --- a/src/HelpDisplay.h +++ b/src/HelpDisplay.h @@ -1,12 +1,10 @@ -/* HelpDisplay - A BitmapText that cycles through messages. */ - #ifndef HELP_DISPLAY_H #define HELP_DISPLAY_H #include "BitmapText.h" struct lua_State; - +/** @brief A BitmapText that cycles through messages. */ class HelpDisplay : public BitmapText { public: diff --git a/src/HighScore.h b/src/HighScore.h index ba493e4d10..fb99deb4c0 100644 --- a/src/HighScore.h +++ b/src/HighScore.h @@ -1,5 +1,3 @@ -/** @brief HighScore - Player scoring data that persists between sessions. */ - #ifndef HIGH_SCORE_H #define HIGH_SCORE_H @@ -13,7 +11,9 @@ struct RadarValues; struct lua_State; struct HighScoreImpl; -/** @brief The high score that is earned by a player. */ +/** @brief The high score that is earned by a player. + * + * This is scoring data that is persisted between sessions. */ struct HighScore { HighScore(); diff --git a/src/HoldJudgment.cpp b/src/HoldJudgment.cpp index d6062f5550..ccef1e8b1c 100644 --- a/src/HoldJudgment.cpp +++ b/src/HoldJudgment.cpp @@ -7,7 +7,7 @@ #include "ActorUtil.h" #include "XmlFile.h" -REGISTER_ACTOR_CLASS( HoldJudgment ) +REGISTER_ACTOR_CLASS( HoldJudgment ); HoldJudgment::HoldJudgment() { @@ -95,6 +95,7 @@ void HoldJudgment::HandleMessage( const Message &msg ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the HoldJudgment. */ class LunaHoldJudgment: public Luna { public: diff --git a/src/InputFilter.cpp b/src/InputFilter.cpp index 83f9caf0b0..e919b0f390 100644 --- a/src/InputFilter.cpp +++ b/src/InputFilter.cpp @@ -6,6 +6,9 @@ #include "RageThreads.h" #include "Preference.h" #include "Foreach.h" +// for mouse stuff: -aj +#include "PrefsManager.h" +#include "ScreenDimensions.h" #include struct ButtonState @@ -23,8 +26,8 @@ struct ButtonState // The time that we actually reported the last event (used for debouncing). RageTimer m_LastReportTime; - // The timestamp of the last reported change. Unlike m_BeingHeldTime, this - // value is debounced along with the input state. (This is the same as + // The timestamp of the last reported change. Unlike m_BeingHeldTime, this + // value is debounced along with the input state. (This is the same as // m_fSecsHeld, except this isn't affected by Update scaling.) RageTimer m_LastInputTime; }; @@ -45,9 +48,9 @@ struct DeviceButtonPair namespace { /* Maintain a set of all interesting buttons: buttons which are being held - * down, or which were held down and need a RELEASE event. We use this to + * down, or which were held down and need a RELEASE event. We use this to * optimize InputFilter::Update, so we don't have to process every button - * we know about when most of them aren't in use. This set is protected + * we know about when most of them aren't in use. This set is protected * by queuemutex. */ typedef map ButtonStateMap; ButtonStateMap g_ButtonStates; @@ -64,22 +67,19 @@ namespace set g_DisableRepeat; } -/* - * Some input devices require debouncing. Do this on both press and release. After - * reporting a change in state, don't report another for the debounce period. If a - * button is reported pressed, report it. If the button is immediately reported - * released, wait a period before reporting it; if the button is repressed during - * that time, the release is never reported. - * +/* Some input devices require debouncing. Do this on both press and release. + * After reporting a change in state, don't report another for the debounce + * period. If a button is reported pressed, report it. If the button is + * immediately reported released, wait a period before reporting it; if the + * button is repressed during that time, the release is never reported. * The detail is important: if a button is pressed for 1ms and released, we must - * always report it, even if the debounce period is 10ms, since it might be a coin - * counter with a very short signal. The only time we discard events is if a button - * is pressed, released and then pressed again quickly. + * always report it, even if the debounce period is 10ms, since it might be a + * coin counter with a very short signal. The only time we discard events is if + * a button is pressed, released and then pressed again quickly. * - * This delay in events is ordinarily not noticable, because the we report initial + * This delay in events is ordinarily not noticable, because we report initial * presses and releases immediately. However, if a real press is ever delayed, - * this won't cause timing problems, because the event timestamp is preserved. - */ + * this won't cause timing problems, because the event timestamp is preserved. */ static Preference g_fInputDebounceTime( "InputDebounceTime", 0 ); InputFilter* INPUTFILTER = NULL; // global and accessable from anywhere in our program @@ -97,12 +97,26 @@ InputFilter::InputFilter() Reset(); ResetRepeatRate(); + + m_MouseCoords.fX = 0; + m_MouseCoords.fY = 0; + + // Register with Lua. + { + Lua *L = LUA->Get(); + lua_pushstring( L, "INPUTFILTER" ); + this->PushSelf( L ); + lua_settable( L, LUA_GLOBALSINDEX ); + LUA->Release( L ); + } } InputFilter::~InputFilter() { delete queuemutex; g_ButtonStates.clear(); + // Unregister with Lua. + LUA->UnsetGlobal( "INPUTFILTER" ); } void InputFilter::Reset() @@ -148,7 +162,7 @@ void InputFilter::ButtonPressed( const DeviceInput &di ) ButtonState &bs = GetButtonState( di ); - /* Flush any delayed input, like Update() (in case Update() isn't being called). */ + // Flush any delayed input, like Update() (in case Update() isn't being called). RageTimer now; CheckButtonChange( bs, di, now ); @@ -161,7 +175,7 @@ void InputFilter::ButtonPressed( const DeviceInput &di ) bs.m_BeingHeldTime = di.ts; } - /* Try to report presses immediately. */ + // Try to report presses immediately. MakeButtonStateList( g_CurrentState ); CheckButtonChange( bs, di, now ); } @@ -173,7 +187,7 @@ void InputFilter::SetButtonComment( const DeviceInput &di, const RString &sComme bs.m_sComment = sComment; } -/* Release all buttons on the given device. */ +/** @brief Release all buttons on the given device. */ void InputFilter::ResetDevice( InputDevice device ) { LockMut(*queuemutex); @@ -188,7 +202,7 @@ void InputFilter::ResetDevice( InputDevice device ) } } -/* Check for reportable presses. */ +/** @brief Check for reportable presses. */ void InputFilter::CheckButtonChange( ButtonState &bs, DeviceInput di, const RageTimer &now ) { if( bs.m_BeingHeld == bs.m_bLastReportedHeld ) @@ -222,13 +236,11 @@ void InputFilter::ReportButtonChange( const DeviceInput &di, InputEventType t ) ie.type = t; ie.di = di; - /* - * Include a list of all buttons that were pressed at the time of this event. We - * can create this efficiently using g_ButtonStates. Use a vector and not a - * map, for efficiency; most code will not use this information. Iterating over - * g_ButtonStates will be in DeviceInput order, so users can binary search this - * list (eg. std::lower_bound). - */ + /* Include a list of all buttons that were pressed at the time of this event. + * We can create this efficiently using g_ButtonStates. Use a vector and not + * a map, for efficiency; most code will not use this information. Iterating + * over g_ButtonStates will be in DeviceInput order, so users can binary + * search this list (eg. std::lower_bound). */ ie.m_ButtonState = g_CurrentState; } @@ -251,8 +263,8 @@ void InputFilter::Update( float fDeltaTime ) INPUTMAN->Update(); - /* Make sure that nothing gets inserted while we do this, to prevent - * things like "key pressed, key release, key repeat". */ + /* Make sure that nothing gets inserted while we do this, to prevent things + * like "key pressed, key release, key repeat". */ LockMut(*queuemutex); DeviceInput di( InputDevice_Invalid, DeviceButton_Invalid, 1.0f, now ); @@ -260,28 +272,28 @@ void InputFilter::Update( float fDeltaTime ) MakeButtonStateList( g_CurrentState ); vector ButtonsToErase; - + FOREACHM( DeviceButtonPair, ButtonState, g_ButtonStates, b ) { di.device = b->first.device; di.button = b->first.button; ButtonState &bs = b->second; - /* Generate IET_FIRST_PRESS and IET_RELEASE events that were delayed. */ + // Generate IET_FIRST_PRESS and IET_RELEASE events that were delayed. CheckButtonChange( bs, di, now ); - /* Generate IET_REPEAT events. */ + // Generate IET_REPEAT events. if( !bs.m_bLastReportedHeld ) { - // If the key isn't pressed, and hasn't been pressed for a while (so debouncing - // isn't interested in it), purge the entry. + // If the key isn't pressed, and hasn't been pressed for a while + // (so debouncing isn't interested in it), purge the entry. if( now - bs.m_LastReportTime > g_fInputDebounceTime && bs.m_DeviceInput.level == 0.0f ) ButtonsToErase.push_back( b ); continue; } - /* If repeats are disabled for this button, skip. */ + // If repeats are disabled for this button, skip. if( g_DisableRepeat.find(di) != g_DisableRepeat.end() ) continue; @@ -306,9 +318,9 @@ void InputFilter::Update( float fDeltaTime ) fRepeatTime = ftruncf( fNewHoldTime, g_fTimeBetweenRepeats ); } - /* Set the timestamp to the exact time of the repeat. This way, - * as long as tab/` aren't being used, the timestamp will always - * increase steadily during repeats. */ + /* Set the timestamp to the exact time of the repeat. This way, as long + * as tab/` aren't being used, the timestamp will always increase steadily + * during repeats. */ di.ts = bs.m_LastInputTime + fRepeatTime; ReportButtonChange( di, IET_REPEAT ); @@ -371,12 +383,12 @@ void InputFilter::ResetKeyRepeat( const DeviceInput &di ) GetButtonState( di ).m_fSecsHeld = 0; } -/* Stop repeating the specified key until released. */ +/** @brief Stop repeating the specified key until released. */ void InputFilter::RepeatStopKey( const DeviceInput &di ) { LockMut(*queuemutex); - /* If the button is up, do nothing. */ + // If the button is up, do nothing. ButtonState &bs = GetButtonState( di ); if( !bs.m_bLastReportedHeld ) return; @@ -397,6 +409,45 @@ void InputFilter::GetPressedButtons( vector &array ) const array = g_CurrentState; } +void InputFilter::UpdateCursorLocation(float _fX, float _fY) +{ + m_MouseCoords.fX = _fX; + m_MouseCoords.fY = _fY; +} + + +// lua start +#include "LuaBinding.h" + +/** @brief Allow Lua to have access to InputFilter. */ +class LunaInputFilter: public Luna +{ +public: + static int GetMouseX( T* p, lua_State *L ){ + float fX = p->GetCursorX(); + // scale input + fX = SCALE( fX, 0, (PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio), SCREEN_LEFT, SCREEN_RIGHT ); + lua_pushnumber( L, fX ); + return 1; + } + static int GetMouseY( T* p, lua_State *L ){ + float fY = p->GetCursorY(); + // scale input + fY = SCALE( fY, 0, PREFSMAN->m_iDisplayHeight, SCREEN_TOP, SCREEN_BOTTOM ); + lua_pushnumber( L, fY ); + return 1; + } + + LunaInputFilter() + { + ADD_METHOD( GetMouseX ); + ADD_METHOD( GetMouseY ); + } +}; + +LUA_REGISTER_CLASS( InputFilter ) +// lua end + /* * (c) 2001-2004 Chris Danford * All rights reserved. diff --git a/src/InputFilter.h b/src/InputFilter.h index b71a3b0e46..65fb47bed9 100644 --- a/src/InputFilter.h +++ b/src/InputFilter.h @@ -7,15 +7,15 @@ enum InputEventType { - /* The device was just pressed. */ + // The device was just pressed. IET_FIRST_PRESS, - /* The device is auto-repeating. This event is guaranteed to be sent only between - * IET_FIRST_PRESS and IET_RELEASE pairs. */ + /* The device is auto-repeating. This event is guaranteed to be sent only + * between IET_FIRST_PRESS and IET_RELEASE pairs. */ IET_REPEAT, - /* The device is no longer pressed. Exactly one IET_RELEASE event will be sent - * for each IET_FIRST_PRESS. */ + /* The device is no longer pressed. Exactly one IET_RELEASE event will be + * sent for each IET_FIRST_PRESS. */ IET_RELEASE, NUM_InputEventType, @@ -29,10 +29,16 @@ struct InputEvent DeviceInput di; InputEventType type; - /* A list of all buttons that were pressed at the time of this event: */ + // A list of all buttons that were pressed at the time of this event: DeviceInputList m_ButtonState; }; +struct MouseCoordinates +{ + float fX; + float fY; +}; + class RageMutex; struct ButtonState; class InputFilter @@ -62,6 +68,14 @@ public: void GetInputEvents( vector &aEventOut ); void GetPressedButtons( vector &array ) const; + // cursor + void UpdateCursorLocation(float _fX, float _fY); + float GetCursorX(){ return m_MouseCoords.fX; } + float GetCursorY(){ return m_MouseCoords.fY; } + + // Lua + void PushSelf( lua_State *L ); + private: void CheckButtonChange( ButtonState &bs, DeviceInput di, const RageTimer &now ); void ReportButtonChange( const DeviceInput &di, InputEventType t ); @@ -69,12 +83,11 @@ private: vector queue; RageMutex *queuemutex; + MouseCoordinates m_MouseCoords; }; - extern InputFilter* INPUTFILTER; // global and accessable from anywhere in our program - #endif /* diff --git a/src/InputMapper.cpp b/src/InputMapper.cpp index bc247c5552..3e495b9efc 100644 --- a/src/InputMapper.cpp +++ b/src/InputMapper.cpp @@ -34,7 +34,6 @@ InputMapper::InputMapper() m_pInputScheme = NULL; } - InputMapper::~InputMapper() { SaveMappingsToDisk(); @@ -559,9 +558,7 @@ void InputMapper::AutoMapJoysticksForCurrentGame() vector vDevices; INPUTMAN->GetDevicesAndDescriptions(vDevices); - // // fill vector with all auto mappings - // vector vAutoMappings; { // file automaps - Add these first so that they can match before the hard-coded mappings diff --git a/src/InputMapper.h b/src/InputMapper.h index 992b89b7a0..25f86c996c 100644 --- a/src/InputMapper.h +++ b/src/InputMapper.h @@ -1,5 +1,3 @@ -/* InputMapper - Holds user-chosen input preferences and saves it between sessions. */ - #ifndef INPUT_MAPPER_H #define INPUT_MAPPER_H @@ -33,14 +31,12 @@ struct AutoMappingEntry int m_iSlotIndex; DeviceButton m_deviceButton; GameButton m_gb; // GameButton_Invalid means unmap this button - /* - * If this is true, this is an auxilliary mapping assigned to the second - * player. If two of the same device are found, and the device has secondary - * entries, the later entries take precedence. This way, if a Pump pad is - * found, it'll map P1 to the primary pad and P2 to the secondary pad. - * (We can't tell if a slave pad is actually there.) Then, if a second primary - * is found (DEVICE_PUMP2), 2P will be mapped to it. - */ + /* If this is true, this is an auxilliary mapping assigned to the second + * player. If two of the same device are found, and the device has secondary + * entries, the later entries take precedence. This way, if a Pump pad is + * found, it'll map P1 to the primary pad and P2 to the secondary pad. (We + * can't tell if a slave pad is actually there.) Then, if a second primary + * is found (DEVICE_PUMP2), 2P will be mapped to it. */ bool m_bSecondController; }; @@ -100,9 +96,9 @@ struct AutoMappings #undef PUSH } - /* Strings used by automatic joystick mappings. */ - RString m_sGame; // only used - RString m_sDriverRegex; // reported by InputHandler + // Strings used by automatic joystick mappings. + RString m_sGame; // only used + RString m_sDriverRegex; // reported by InputHandler RString m_sControllerName; // the product name of the controller vector m_vMaps; @@ -118,7 +114,7 @@ public: const char *m_szName; // The name used by the button graphics system. e.g. "left", "right", "middle C", "snare" GameButton m_SecondaryMenuButton; }; - /* Data for each Game-specific GameButton. This starts at GAME_BUTTON_NEXT. */ + // Data for each Game-specific GameButton. This starts at GAME_BUTTON_NEXT. GameButtonInfo m_GameButtonInfo[NUM_GameButton]; const AutoMappings *m_pAutoMappings; @@ -129,6 +125,7 @@ public: const GameButtonInfo *GetGameButtonInfo( GameButton gb ) const; const char *GetGameButtonName( GameButton gb ) const; }; +/** @brief A special foreach loop to handle the various GameButtons. */ #define FOREACH_GameButtonInScheme( s, var ) for( GameButton var=(GameButton)0; varm_iButtonsPerController; enum_add( var, +1 ) ) class InputMappings @@ -150,7 +147,7 @@ public: void ClearFromInputMap( const DeviceInput &DeviceI ); bool ClearFromInputMap( const GameInput &GameI, int iSlotIndex ); }; - +/** @brief Holds user-chosen input preferences and saves it between sessions. */ class InputMapper { public: @@ -175,7 +172,7 @@ public: bool CheckForChangedInputDevicesAndRemap( RString &sMessageOut ); bool IsMapped( const DeviceInput &DeviceI ) const; - + bool DeviceToGame( const DeviceInput &DeviceI, GameInput& GameI ) const; // return true if there is a mapping from device to pad bool GameToDevice( const GameInput &GameI, int iSlotNum, DeviceInput& DeviceI ) const; // return true if there is a mapping from pad to device @@ -211,10 +208,8 @@ protected: const InputScheme *m_pInputScheme; }; - extern InputMapper* INPUTMAPPER; // global and accessable from anywhere in our program - #endif /* diff --git a/src/InputQueue.h b/src/InputQueue.h index 9cce2fb0ff..902eba46db 100644 --- a/src/InputQueue.h +++ b/src/InputQueue.h @@ -1,5 +1,3 @@ -/* InputQueue - Stores a list of the most recently pressed MenuInputs for each player. */ - #ifndef INPUT_QUEUE_H #define INPUT_QUEUE_H @@ -9,6 +7,7 @@ class InputEventPlus; class RageTimer; +/** @brief Stores a list of the most recently pressed MenuInputs for each player. */ class InputQueue { public: diff --git a/src/JsonUtil.h b/src/JsonUtil.h index 26ab10e6f4..c676af1ebc 100644 --- a/src/JsonUtil.h +++ b/src/JsonUtil.h @@ -1,11 +1,9 @@ -/* JsonUtil - Utilities for handling JSON data. */ - #ifndef JsonUtil_H #define JsonUtil_H class RageFileBasic; #include "jsoncpp/include/json/value.h" - +/** @brief Utilities for handling JSON data. */ namespace JsonUtil { bool LoadFromString( Json::Value &root, RString sData, RString &sErrorOut ); diff --git a/src/LifeMeter.cpp b/src/LifeMeter.cpp index e542576471..be9adee28a 100644 --- a/src/LifeMeter.cpp +++ b/src/LifeMeter.cpp @@ -19,6 +19,7 @@ LifeMeter *LifeMeter::MakeLifeMeter( SongOptions::LifeType t ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the LifeMeter. */ class LunaLifeMeter: public Luna { public: diff --git a/src/LifeMeterBattery.cpp b/src/LifeMeterBattery.cpp index ce0abf7365..207eea50a9 100644 --- a/src/LifeMeterBattery.cpp +++ b/src/LifeMeterBattery.cpp @@ -240,6 +240,7 @@ void LifeMeterBattery::Update( float fDeltaTime ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the LifeMeterBattery. */ class LunaLifeMeterBattery: public Luna { public: diff --git a/src/LifeMeterBattery.h b/src/LifeMeterBattery.h index ea5afc6fba..67a40cd99c 100644 --- a/src/LifeMeterBattery.h +++ b/src/LifeMeterBattery.h @@ -1,5 +1,3 @@ -/* LifeMeterBattery - Battery life meter used in Oni mode. */ - #ifndef LIFEMETERBATTERY_H #define LIFEMETERBATTERY_H @@ -10,7 +8,7 @@ #include "PercentageDisplay.h" #include "ThemeMetric.h" - +/** @brief Battery life meter used in Oni mode. */ class LifeMeterBattery : public LifeMeter { public: diff --git a/src/LightsManager.h b/src/LightsManager.h index 0934744ba6..1e75a683b7 100644 --- a/src/LightsManager.h +++ b/src/LightsManager.h @@ -1,5 +1,3 @@ -/* LightsManager - Control lights. */ - #ifndef LightsManager_H #define LightsManager_H @@ -23,6 +21,7 @@ enum CabinetLight NUM_CabinetLight, CabinetLight_Invalid }; +/** @brief Loop through each CabinetLight on the machine. */ #define FOREACH_CabinetLight( i ) FOREACH_ENUM( CabinetLight, i ) const RString& CabinetLightToString( CabinetLight cl ); CabinetLight StringToCabinetLight( const RString& s); @@ -55,7 +54,7 @@ struct LightsState }; class LightsDriver; - +/** @brief Control lights. */ class LightsManager { public: diff --git a/src/LuaBinding.h b/src/LuaBinding.h index 0917fa108f..a56ac901bb 100644 --- a/src/LuaBinding.h +++ b/src/LuaBinding.h @@ -32,6 +32,7 @@ protected: static int PushEqual( lua_State *L ); }; +/** @brief Allow the binding of Lua to various classes. */ template class Luna: public LuaBinding { diff --git a/src/LuaManager.cpp b/src/LuaManager.cpp index 32cef86941..b39217f3f7 100644 --- a/src/LuaManager.cpp +++ b/src/LuaManager.cpp @@ -33,6 +33,7 @@ static Impl *pImpl = NULL; #pragma warning (disable : 4611) #endif +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template<> void Push( lua_State *L, const bool &Object ); @@ -70,6 +71,7 @@ void LuaManager::UnsetGlobal( const RString &sName ) Release( L ); } +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template<> void Push( lua_State *L, const bool &Object ) { lua_pushboolean( L, Object ); } diff --git a/src/LuaManager.h b/src/LuaManager.h index 83485a526e..08beb9aa0d 100644 --- a/src/LuaManager.h +++ b/src/LuaManager.h @@ -15,9 +15,6 @@ extern "C" #include "lua-5.1/src/lauxlib.h" } -class LuaManager; -extern LuaManager *LUA; - class LuaManager { public: @@ -47,7 +44,10 @@ private: lua_State *m_pLuaMain; }; +extern LuaManager *LUA; + +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { /* Load the given script with the given name. On success, the resulting @@ -157,19 +157,21 @@ private: LuaReference *m_pOldValue; }; -/* Iterate over all elements in the table. For safety reasons, the key is pushed onto - * the stack and can be read (safely) as a string and popped or altered in any way. - * Stack management is handled automatically. That is, you need not remove all stack - * elements above the key. Once the loop exits normally, the top of the stack will be - * where it was before. If you break out of the loop early, you need to handle that - * explicitly. */ +/** + * @brief Iterate over all elements in the table. + * + * For safety reasons, the key is pushed onto the stack and can be read (safely) + * as a string and popped or altered in any way. Stack management is handled + * automatically. That is, you need not remove all stack elements above the key. + * Once the loop exits normally, the top of the stack will be where it was before. + * If you break out of the loop early, you need to handle that explicitly. */ #define FOREACH_LUATABLE(L,index) \ for( const int UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \ UNIQUE_NAME(top) = (lua_pushnil(L),lua_gettop(L)); \ lua_next(L, UNIQUE_NAME(tab)) && (lua_pushvalue(L,-2),true); \ lua_settop(L,UNIQUE_NAME(top)) ) -/* Iterate over the array elements of a table. */ +/** @brief Iterate over the array elements of a table. */ #define FOREACH_LUATABLEI(L, index, i) \ for( int UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \ UNIQUE_NAME(top) = lua_gettop(L), i = 1; \ diff --git a/src/LuaReference.cpp b/src/LuaReference.cpp index 1d819ffe0f..ec036d2911 100644 --- a/src/LuaReference.cpp +++ b/src/LuaReference.cpp @@ -158,6 +158,7 @@ RString LuaReference::Serialize() const return sRet; } +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template<> bool FromStack( lua_State *L, LuaReference &Object, int iOffset ) @@ -200,6 +201,7 @@ void LuaTable::Get( Lua *L, const RString &sKey ) lua_remove( L, -2 ); // remove self } +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template<> void Push( lua_State *L, const LuaReference &Object ) diff --git a/src/LyricDisplay.h b/src/LyricDisplay.h index a5d7baecf7..abb3baab84 100644 --- a/src/LyricDisplay.h +++ b/src/LyricDisplay.h @@ -1,11 +1,9 @@ -/* LyricDisplay - Displays lyrics along with the song on Gameplay. */ - #ifndef LYRIC_DISPLAY_H #define LYRIC_DISPLAY_H #include "ActorFrame.h" #include "BitmapText.h" - +/** @brief Displays lyrics along with the song on Gameplay. */ class LyricDisplay: public ActorFrame { public: diff --git a/src/MemoryCardDisplay.cpp b/src/MemoryCardDisplay.cpp index 9790355799..0a7ff18ab8 100644 --- a/src/MemoryCardDisplay.cpp +++ b/src/MemoryCardDisplay.cpp @@ -6,7 +6,7 @@ #include "XmlFile.h" #include "ActorUtil.h" -REGISTER_ACTOR_CLASS( MemoryCardDisplay ) +REGISTER_ACTOR_CLASS( MemoryCardDisplay ); MemoryCardDisplay::MemoryCardDisplay() { diff --git a/src/MemoryCardDisplay.h b/src/MemoryCardDisplay.h index 3021aeb765..fcf478aedd 100644 --- a/src/MemoryCardDisplay.h +++ b/src/MemoryCardDisplay.h @@ -1,5 +1,3 @@ -/* MemoryCardDisplay - A graphic displaying the state of memory cards. */ - #ifndef MEMORY_CARD_DISPLAY_H #define MEMORY_CARD_DISPLAY_H @@ -7,7 +5,7 @@ #include "PlayerNumber.h" #include "Sprite.h" #include "ActorFrame.h" - +/** @brief A graphic displaying the state of memory cards. */ class MemoryCardDisplay : public ActorFrame { public: diff --git a/src/MemoryCardManager.cpp b/src/MemoryCardManager.cpp index 4573598817..bdb5a7f7ec 100644 --- a/src/MemoryCardManager.cpp +++ b/src/MemoryCardManager.cpp @@ -713,6 +713,7 @@ void MemoryCardManager::UnPauseMountingThread() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the MemoryCardManager. */ class LunaMemoryCardManager: public Luna { public: diff --git a/src/MenuTimer.cpp b/src/MenuTimer.cpp index 0a277fa766..5cf0e63017 100644 --- a/src/MenuTimer.cpp +++ b/src/MenuTimer.cpp @@ -194,6 +194,7 @@ void MenuTimer::SetText( float fSeconds ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the MenuTimer. */ class LunaMenuTimer: public Luna { public: diff --git a/src/MessageManager.cpp b/src/MessageManager.cpp index ee4dcd6e9b..5907cb945e 100644 --- a/src/MessageManager.cpp +++ b/src/MessageManager.cpp @@ -81,6 +81,12 @@ static const char *MessageIDNames[] = { "LifeMeterChangedP1", "LifeMeterChangedP2", "UpdateScreenHeader", + // should these be here? -aj + "LeftClick", + "RightClick", + "MiddleClick", + "MouseWheelUp", + "MouseWheelDown", }; XToString( MessageID ); @@ -273,6 +279,7 @@ void MessageSubscriber::UnsubscribeAll() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the MessageManager. */ class LunaMessageManager: public Luna { public: diff --git a/src/MessageManager.h b/src/MessageManager.h index 3d424ce3aa..e00a47e378 100644 --- a/src/MessageManager.h +++ b/src/MessageManager.h @@ -78,6 +78,12 @@ enum MessageID Message_LifeMeterChangedP1, Message_LifeMeterChangedP2, Message_UpdateScreenHeader, + // should these be here? -aj + Message_LeftClick, + Message_RightClick, + Message_MiddleClick, + Message_MouseWheelUp, + Message_MouseWheelDown, NUM_MessageID, // leave this at the end MessageID_Invalid }; @@ -207,7 +213,14 @@ public: bool operator != ( const T &other ) const { return val != other; } }; -namespace LuaHelpers { template void Push( lua_State *L, const BroadcastOnChange &Object ) { LuaHelpers::Push( L, Object.Get() ); } } +/** @brief Utilities for working with Lua. */ +namespace LuaHelpers +{ + template void Push( lua_State *L, const BroadcastOnChange &Object ) + { + LuaHelpers::Push( L, Object.Get() ); + } +} template class BroadcastOnChange1D diff --git a/src/MeterDisplay.cpp b/src/MeterDisplay.cpp index e8b037bcb3..8f04782eef 100644 --- a/src/MeterDisplay.cpp +++ b/src/MeterDisplay.cpp @@ -8,8 +8,8 @@ #include "RageLog.h" #include "LuaManager.h" -REGISTER_ACTOR_CLASS(MeterDisplay) -REGISTER_ACTOR_CLASS(SongMeterDisplay) +REGISTER_ACTOR_CLASS(MeterDisplay); +REGISTER_ACTOR_CLASS(SongMeterDisplay); MeterDisplay::MeterDisplay() { diff --git a/src/ModIcon.h b/src/ModIcon.h index 34911b8935..7596cdca79 100644 --- a/src/ModIcon.h +++ b/src/ModIcon.h @@ -1,5 +1,3 @@ -/* ModIcon - Shows PlayerOptions and SongOptions in icon form. */ - #ifndef ModIcon_H #define ModIcon_H @@ -8,7 +6,7 @@ #include "BitmapText.h" #include "PlayerNumber.h" #include "ThemeMetric.h" - +/** @brief Shows PlayerOptions and SongOptions in icon form. */ class ModIcon : public ActorFrame { public: diff --git a/src/ModIconRow.cpp b/src/ModIconRow.cpp index d5cfaa2963..996b0da158 100644 --- a/src/ModIconRow.cpp +++ b/src/ModIconRow.cpp @@ -10,7 +10,7 @@ #include "LuaManager.h" #include "Foreach.h" -REGISTER_ACTOR_CLASS( ModIconRow ) +REGISTER_ACTOR_CLASS( ModIconRow ); ModIconRow::ModIconRow() { @@ -176,6 +176,7 @@ void ModIconRow::SetFromGameState() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ModIconRow. */ class LunaModIconRow: public Luna { public: diff --git a/src/Model.cpp b/src/Model.cpp index c73a573975..b285611649 100644 --- a/src/Model.cpp +++ b/src/Model.cpp @@ -14,7 +14,7 @@ #include "LuaBinding.h" #include "PrefsManager.h" -REGISTER_ACTOR_CLASS( Model ) +REGISTER_ACTOR_CLASS( Model ); static const float FRAMES_PER_SECOND = 30; static const RString DEFAULT_ANIMATION_NAME = "default"; @@ -769,6 +769,7 @@ bool Model::MaterialsNeedNormals() const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Model. */ class LunaModel: public Luna { public: diff --git a/src/MsdFile.h b/src/MsdFile.h index 0b52d639ab..229f329082 100644 --- a/src/MsdFile.h +++ b/src/MsdFile.h @@ -10,7 +10,7 @@ public: /** * @brief The list of params found in the files. * - * Note that #param:param:param:param; is one whole value. */ + * Note that #param:param:param:param; is one whole value. */ struct value_t { /** @brief The list of parameters. */ diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index ec0a1b4b7f..2c31041280 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -30,7 +30,7 @@ static Preference g_bMoveRandomToEnd( "MoveRandomToEnd", false ); static RString SECTION_COLORS_NAME( size_t i ) { return ssprintf("SectionColor%d",int(i+1)); } static RString CHOICE_NAME( RString s ) { return ssprintf("Choice%s",s.c_str()); } -AutoScreenMessage( SM_SongChanged ) // TODO: Replace this with a Message and MESSAGEMAN +AutoScreenMessage( SM_SongChanged ); // TODO: Replace this with a Message and MESSAGEMAN AutoScreenMessage( SM_SortOrderChanging ); AutoScreenMessage( SM_SortOrderChanged ); @@ -1048,11 +1048,6 @@ bool MusicWheel::Select() // return true if this selection ends the screen case TYPE_PORTAL: break; case TYPE_SORT: - /* - LOG->Trace("New sort order selected: %s - %s", - GetCurWheelItemData(m_iSelection)->m_sLabel.c_str(), - SortOrderToString(GetCurWheelItemData(m_iSelection)->m_pAction->m_SortOrder).c_str() ); - */ GetCurWheelItemData(m_iSelection)->m_pAction->ApplyToAllPlayers(); ChangeSort( GAMESTATE->m_PreferredSortOrder ); m_sLastModeMenuItem = GetCurWheelItemData(m_iSelection)->m_pAction->m_sName; diff --git a/src/NetworkSyncManager.cpp b/src/NetworkSyncManager.cpp index c762fa3239..6ef6f83c2a 100644 --- a/src/NetworkSyncManager.cpp +++ b/src/NetworkSyncManager.cpp @@ -43,7 +43,7 @@ void NetworkSyncManager::GetListOfLANServers( vector& AllServers #include "PlayerState.h" #include "CryptManager.h" -AutoScreenMessage( SM_AddToChat ) +AutoScreenMessage( SM_AddToChat ); AutoScreenMessage( SM_ChangeSong ); AutoScreenMessage( SM_GotEval ); AutoScreenMessage( SM_UsersUpdate ); diff --git a/src/NetworkSyncManager.h b/src/NetworkSyncManager.h index 382a753e1d..0c92c70d91 100644 --- a/src/NetworkSyncManager.h +++ b/src/NetworkSyncManager.h @@ -1,5 +1,3 @@ -/* NetworkSyncManager - Uses ezsockets for primitive song syncing and score reporting. */ - #ifndef NetworkSyncManager_H #define NetworkSyncManager_H @@ -74,6 +72,7 @@ enum NSScoreBoardColumn NUM_NSScoreBoardColumn, NSScoreBoardColumn_Invalid }; +/** @brief A special foreach loop going through each NSScoreBoardColumn. */ #define FOREACH_NSScoreBoardColumn( sc ) FOREACH_ENUM( NSScoreBoardColumn, sc ) struct NetServerInfo @@ -106,7 +105,7 @@ public: void ClearPacket(); }; - +/** @brief Uses ezsockets for primitive song syncing and score reporting. */ class NetworkSyncManager { public: diff --git a/src/NoteData.cpp b/src/NoteData.cpp index 414ccee44e..49449cc833 100644 --- a/src/NoteData.cpp +++ b/src/NoteData.cpp @@ -52,7 +52,7 @@ void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack ) if( rowBegin == rowEnd ) return; - iterator begin, end; + NoteData::TrackMap::iterator begin, end; GetTapNoteRangeInclusive( iTrack, rowBegin, rowEnd, begin, end ); if( begin != end && begin->first < rowBegin && begin->first + begin->second.iDuration > rowEnd ) @@ -86,7 +86,7 @@ void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack ) if( begin != end ) { - iterator prev = end; + NoteData::TrackMap::iterator prev = end; --prev; TapNote tn = begin->second; int iRow = prev->first; @@ -138,7 +138,7 @@ void NoteData::CopyRange( const NoteData& from, int rowFromBegin, int rowFromEnd for( int t=0; t= iStartRow, ssprintf("EndRow %d < StartRow %d",iEndRow,iStartRow) ); /* Include adjacent (non-overlapping) hold notes, since we need to merge with them. */ - iterator begin, end; + NoteData::TrackMap::iterator begin, end; GetTapNoteRangeInclusive( iTrack, iStartRow, iEndRow, begin, end, true ); // Look for other hold notes that overlap and merge them into add. @@ -590,7 +590,7 @@ int NoteData::GetNumHoldNotes( int iStartIndex, int iEndIndex ) const int iNumHolds = 0; for( int t=0; t #include +/** @brief Act on each non empty row in the specific track. */ #define FOREACH_NONEMPTY_ROW_IN_TRACK( nd, track, row ) \ for( int row = -1; (nd).GetNextTapNoteRowForTrack(track,row); ) +/** @brief Act on each non empty row in the specified track within the specified range. */ #define FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( nd, track, row, start, last ) \ for( int row = start-1; (nd).GetNextTapNoteRowForTrack(track,row) && row < (last); ) +/** @brief Act on each non empty row in the specified track within the specified range, + going in reverse order. */ #define FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE_REVERSE( nd, track, row, start, last ) \ for( int row = last; (nd).GetPrevTapNoteRowForTrack(track,row) && row >= (start); ) +/** @brief Act on each non empty row for all of the tracks. */ #define FOREACH_NONEMPTY_ROW_ALL_TRACKS( nd, row ) \ for( int row = -1; (nd).GetNextTapNoteRowForAllTracks(row); ) +/** @brief Act on each non empty row for all of the tracks within the specified range. */ #define FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( nd, row, start, last ) \ for( int row = start-1; (nd).GetNextTapNoteRowForAllTracks(row) && row < (last); ) +/** @brief Holds data about the notes that the player is supposed to hit. */ class NoteData { public: @@ -110,8 +115,27 @@ public: inline const_iterator FindTapNote( unsigned iTrack, int iRow ) const { return m_TapNotes[iTrack].find( iRow ); } void RemoveTapNote( unsigned iTrack, iterator it ) { m_TapNotes[iTrack].erase( it ); } - /* Return an iterator range including exactly iStartRow to iEndRow. */ - void GetTapNoteRange( int iTrack, int iStartRow, int iEndRow, const_iterator &begin, const_iterator &end ) const; + /** + * @brief Return an iterator range for [rowBegin,rowEnd). + * + * This can be used to efficiently iterate trackwise over a range of notes. + * It's like FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE, except it only requires + * two map searches (iterating is constant time), but the iterators will + * become invalid if the notes they represent disappear, so you need to + * pay attention to how you modify the data. + * @param iTrack the column to use. + * @param iStartRow the starting point. + * @param iEndRow the ending point. + * @param begin the eventual beginning point of the range. + * @param end the eventual end point of the range. */ + void GetTapNoteRange( int iTrack, int iStartRow, int iEndRow, TrackMap::const_iterator &begin, TrackMap::const_iterator &end ) const; + /** + * @brief Return a constant iterator range for [rowBegin,rowEnd). + * @param iTrack the column to use. + * @param iStartRow the starting point. + * @param iEndRow the ending point. + * @param begin the eventual beginning point of the range. + * @param end the eventual end point of the range. */ void GetTapNoteRange( int iTrack, int iStartRow, int iEndRow, TrackMap::iterator &begin, TrackMap::iterator &end ); all_tracks_iterator GetTapNoteRangeAllTracks( int iStartRow, int iEndRow, bool bInclusive = false ) { @@ -132,13 +156,13 @@ public: /* Return an iterator range include iStartRow to iEndRow. Extend the range to include * hold notes overlapping the boundary. */ - void GetTapNoteRangeInclusive( int iTrack, int iStartRow, int iEndRow, const_iterator &begin, const_iterator &end, bool bIncludeAdjacent=false ) const; - void GetTapNoteRangeInclusive( int iTrack, int iStartRow, int iEndRow, iterator &begin, iterator &end, bool bIncludeAdjacent=false ); + void GetTapNoteRangeInclusive( int iTrack, int iStartRow, int iEndRow, TrackMap::const_iterator &begin, TrackMap::const_iterator &end, bool bIncludeAdjacent=false ) const; + void GetTapNoteRangeInclusive( int iTrack, int iStartRow, int iEndRow, TrackMap::iterator &begin, TrackMap::iterator &end, bool bIncludeAdjacent=false ); /* Return an iterator range include iStartRow to iEndRow. Shrink the range to exclude * hold notes overlapping the boundary. */ - void GetTapNoteRangeExclusive( int iTrack, int iStartRow, int iEndRow, const_iterator &begin, const_iterator &end ) const; - void GetTapNoteRangeExclusive( int iTrack, int iStartRow, int iEndRow, iterator &begin, iterator &end ); + void GetTapNoteRangeExclusive( int iTrack, int iStartRow, int iEndRow, TrackMap::const_iterator &begin, TrackMap::const_iterator &end ) const; + void GetTapNoteRangeExclusive( int iTrack, int iStartRow, int iEndRow, TrackMap::iterator &begin, TrackMap::iterator &end ); /* Returns the row of the first TapNote on the track that has a row greater than rowInOut. */ @@ -218,6 +242,7 @@ public: void LoadFromNode( const XNode* pNode ); }; +/** @brief Allow a quick way to swap notedata. */ namespace std { template<> inline void swap( NoteData &nd1, NoteData &nd2 ) { nd1.swap( nd2 ); } diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index 35ed1030b0..6b7517af93 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -831,7 +831,7 @@ void NoteDataUtil::RemoveHoldNotes( NoteData &in, int iStartIndex, int iEndIndex // turn all the HoldNotes into TapNotes for( int t=0; t { public: diff --git a/src/NotesLoader.h b/src/NotesLoader.h index 3b4e6b6ca5..626f3c1979 100644 --- a/src/NotesLoader.h +++ b/src/NotesLoader.h @@ -1,5 +1,3 @@ -/* NotesLoader - Base class for step file loaders. */ - #ifndef NOTES_LOADER_H #define NOTES_LOADER_H @@ -7,16 +5,31 @@ class Song; +/** @brief Base class for step file loaders. */ namespace NotesLoader { - void GetMainAndSubTitlesFromFullTitle( const RString &sFullTitle, RString &sMainTitleOut, RString &sSubTitleOut ); + /** + * @brief Identify the main and sub titles from a full title. + * @param sFullTitle the full title. + * @param sMainTitleOut the eventual main title. + * @param sSubTitleOut the ventual sub title. */ + void GetMainAndSubTitlesFromFullTitle( const RString &sFullTitle, + RString &sMainTitleOut, RString &sSubTitleOut ); + /** + * @brief Attempt to load a Song from the given directory. + * @param sPath the path to the file. + * @param out the Song in question. + * @param BlacklistedImages images to exclude (DWI files only for some reason). + * @return its success or failure. */ bool LoadFromDir( const RString &sPath, Song &out, set &BlacklistedImages ); } #endif -/* - * (c) 2001-2003,2007 Chris Danford, Glenn Maynard, Steve Checkoway +/** + * @file + * @author Chris Danford, Glenn Maynard, Steve Checkoway (c) 2001-2003,2007 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/NotesLoaderBMS.h b/src/NotesLoaderBMS.h index bcce260b1b..74c51d9d9c 100644 --- a/src/NotesLoaderBMS.h +++ b/src/NotesLoaderBMS.h @@ -1,10 +1,8 @@ -/* BMSLoader - reads a Song from a set of .BMS files. */ - #ifndef NOTES_LOADER_BMS_H #define NOTES_LOADER_BMS_H class Song; - +/** @brief Reads a Song from a set of .BMS files. */ namespace BMSLoader { void GetApplicableFiles( const RString &sPath, vector &out ); diff --git a/src/NotesLoaderKSF.h b/src/NotesLoaderKSF.h index fcc53682de..e6bfbdd193 100644 --- a/src/NotesLoaderKSF.h +++ b/src/NotesLoaderKSF.h @@ -1,10 +1,8 @@ -/* KSFLoader - Reads a Song from a set of .KSF files. */ - #ifndef NOTES_LOADER_KSF_H #define NOTES_LOADER_KSF_H class Song; - +/** @brief Reads a Song from a set of .KSF files. */ namespace KSFLoader { void GetApplicableFiles( const RString &sPath, vector &out ); diff --git a/src/NotesLoaderMidi.cpp b/src/NotesLoaderMidi.cpp index 9fb8aff687..96f5375e1e 100644 --- a/src/NotesLoaderMidi.cpp +++ b/src/NotesLoaderMidi.cpp @@ -562,7 +562,10 @@ bool MidiFileIn :: readVariableLength( unsigned long *value ) return true; } - +/** + * @brief Utilities for working with the Guitar mode. + * + * Is this going to be kept in sm-ssc? */ namespace Guitar { enum GuitarDifficulty { easy, medium, hard, expert, NUM_GuitarDifficulty }; @@ -845,9 +848,9 @@ skip_track: // on this row, then make the sustain note shorter so that it doesn't end on // the same row as the tap note we're about to add. NoteData cannot handle a // hold note ending on the same row as a tap note. - NoteData::iterator begin, end; + NoteData::TrackMap::iterator begin, end; noteData.GetTapNoteRangeInclusive( nnt, MidiCountToNoteRow(count), MidiCountToNoteRow(count), begin, end, true ); - for( NoteData::iterator iter = begin; iter != end; iter++ ) + for( NoteData::TrackMap::iterator iter = begin; iter != end; iter++ ) { // if( gd == expert && fBeat >= 27*4-2 && nnt == green ) // LOG->Trace( "shortening hold at %f, length %d", fBeat, length ); diff --git a/src/NotesLoaderMidi.h b/src/NotesLoaderMidi.h index 09ef41a700..4b496a122b 100644 --- a/src/NotesLoaderMidi.h +++ b/src/NotesLoaderMidi.h @@ -1,10 +1,8 @@ -/* MidiLoader - Reads a Song from a .mid file. */ - #ifndef NotesLoaderMidi_H #define NotesLoaderMidi_H class Song; - +/** @brief Reads a Song from a .mid file. */ namespace MidiLoader { void GetApplicableFiles( const RString &sPath, vector &out ); diff --git a/src/NotesLoaderPMS.h b/src/NotesLoaderPMS.h index 3baa700fb9..557274875d 100644 --- a/src/NotesLoaderPMS.h +++ b/src/NotesLoaderPMS.h @@ -1,10 +1,8 @@ -/* PMSLoader - reads a Song from a set of .PMS files. */ - #ifndef NOTES_LOADER_PMS_H #define NOTES_LOADER_PMS_H class Song; - +/** @brief Reads a Song from a set of .PMS files. */ namespace PMSLoader { void GetApplicableFiles( const RString &sPath, vector &out ); @@ -13,8 +11,10 @@ namespace PMSLoader #endif -/* - * (c) 2001-2003 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2003 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/NotesLoaderSM.h b/src/NotesLoaderSM.h index f8a7e78352..4864c74411 100644 --- a/src/NotesLoaderSM.h +++ b/src/NotesLoaderSM.h @@ -1,5 +1,3 @@ -/* SMLoader - Reads a Song from an .SM file. */ - #ifndef NotesLoaderSM_H #define NotesLoaderSM_H @@ -9,7 +7,7 @@ class MsdFile; class Song; class Steps; class TimingData; - +/** @brief Reads a Song from an .SM file. */ namespace SMLoader { void LoadFromSMTokens( RString sStepsType, RString sDescription, RString sDifficulty, @@ -29,8 +27,10 @@ namespace SMLoader #endif -/* - * (c) 2001-2004 Chris Danford, Glenn Maynard +/** + * @file + * @author Chris Danford, Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index fe5e1b3102..de6b5dffb9 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -634,6 +634,11 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach pNewNotes->m_StepsType = GAMEMAN->StringToStepsType( sParams[1] ); } + else if( sValueName=="CHARTSTYLE" ) + { + pNewNotes->SetChartStyle( sParams[1] ); + } + else if( sValueName=="DESCRIPTION" ) { pNewNotes->SetDescription( sParams[1] ); @@ -946,7 +951,7 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat Song* pSong = NULL; Steps* pNewNotes; bool bSSCFormat = false; - + for( unsigned i=0; iUserLog( "Edit file", sEditFilePath, "has more than one #SONG tag." ); return false; } - + RString sSongFullTitle = sParams[1]; sSongFullTitle.Replace( '\\', '/' ); - + pSong = SONGMAN->FindSong( sSongFullTitle ); if( pSong == NULL ) { LOG->UserLog( "Edit file", sEditFilePath, "requires a song \"%s\" that isn't present.", sSongFullTitle.c_str() ); return false; } - + if( pSong->GetNumStepsLoadedFromProfile(slot) >= MAX_EDITS_PER_SONG_PER_PROFILE ) { LOG->UserLog( "Song file", sSongFullTitle, "already has the maximum number of edits allowed for ProfileSlotP%d.", slot+1 ); return false; } } + else if( sValueName=="NOTEDATA" ) { pNewNotes = new Steps; @@ -990,6 +996,12 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat bSSCFormat = true; } + else if( sValueName=="CHARTSTYLE" ) + { + pNewNotes->SetChartStyle( sParams[1] ); + bSSCFormat = true; + } + else if( sValueName=="DESCRIPTION" ) { pNewNotes->SetDescription( sParams[1] ); @@ -1096,7 +1108,7 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat SAFE_DELETE( pNewNotes ); return false; } - + pSong->AddSteps( pNewNotes ); return true; // Only allow one Steps per edit file! } @@ -1106,7 +1118,9 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat } } - return true; + //return true; + // only load a SSC edit if it passes the checks. -aj + return bSSCFormat; } void SSCLoader::TidyUpData( Song &song, bool bFromCache ) diff --git a/src/NotesWriterDWI.cpp b/src/NotesWriterDWI.cpp index 8b5f930b7e..6465efb82a 100644 --- a/src/NotesWriterDWI.cpp +++ b/src/NotesWriterDWI.cpp @@ -11,98 +11,11 @@ #include "Song.h" #include "Steps.h" -static RString OptimizeDWIString( RString holds, RString taps ); - -/* Output is an angle bracket expression without angle brackets, eg. "468". */ -static RString NotesToDWIString( const TapNote tnCols[6] ) -{ - const char dirs[] = { '4', 'C', '2', '8', 'D', '6' }; - RString taps, holds, ret; - for( int col = 0; col < 6; ++col ) - { - switch( tnCols[col].type ) - { - case TapNote::empty: - case TapNote::mine: - continue; - } - - if( tnCols[col].type == TapNote::hold_head ) - holds += dirs[col]; - else - taps += dirs[col]; - } - - if( holds.size() + taps.size() == 0 ) - return "0"; - -// RString combine = taps; -// for( unsigned i = 0; i < holds.size(); ++i ) -// combine += ssprintf("%c!%c", holds[i], holds[i]); - -// if( holds.size() + taps.size() > 1 ) -// combine = ssprintf("<%s>", combine.c_str() ); - -// return combine; - - /* More than one. */ - return OptimizeDWIString( holds, taps ); -/* struct DWICharLookup { - char c; - bool bCol[6]; - } const lookup[] = { - { '0', { 0, 0, 0, 0, 0, 0 } }, - { '1', { 1, 0, 1, 0, 0, 0 } }, - { '2', { 0, 0, 1, 0, 0, 0 } }, - { '3', { 0, 0, 1, 0, 0, 1 } }, - { '4', { 1, 0, 0, 0, 0, 0 } }, - { '6', { 0, 0, 0, 0, 0, 1 } }, - { '7', { 1, 0, 0, 1, 0, 0 } }, - { '8', { 0, 0, 0, 1, 0, 0 } }, - { '9', { 0, 0, 0, 1, 0, 1 } }, - { 'A', { 0, 0, 1, 1, 0, 0 } }, - { 'B', { 1, 0, 0, 0, 0, 1 } }, - { 'C', { 0, 1, 0, 0, 0, 0 } }, - { 'D', { 0, 0, 0, 0, 1, 0 } }, - { 'E', { 1, 1, 0, 0, 0, 0 } }, - { 'F', { 0, 1, 1, 0, 0, 0 } }, - { 'G', { 0, 1, 0, 1, 0, 0 } }, - { 'H', { 0, 1, 0, 0, 0, 1 } }, - { 'I', { 1, 0, 0, 0, 1, 0 } }, - { 'J', { 0, 0, 1, 0, 1, 0 } }, - { 'K', { 0, 0, 0, 1, 1, 0 } }, - { 'L', { 0, 0, 0, 0, 1, 1 } }, - { 'M', { 0, 1, 0, 0, 1, 0 } }, - }; - const int iNumLookups = sizeof(lookup) / sizeof(*lookup); - - for( int i=0; iWarn( "Failed to find the DWI character for the row %d %d %d %d %d %d", bCol1, bCol2, bCol3, bCol4, bCol5, bCol6 ); - return '0';*/ -} - -static RString NotesToDWIString( TapNote tnCol1, TapNote tnCol2, TapNote tnCol3, TapNote tnCol4, TapNote tnCol5, TapNote tnCol6 ) -{ - TapNote tnCols[6]; - tnCols[0] = tnCol1; - tnCols[1] = tnCol2; - tnCols[2] = tnCol3; - tnCols[3] = tnCol4; - tnCols[4] = tnCol5; - tnCols[5] = tnCol6; - return NotesToDWIString( tnCols ); -} - -static RString NotesToDWIString( TapNote tnCol1, TapNote tnCol2, TapNote tnCol3, TapNote tnCol4 ) -{ - return NotesToDWIString( tnCol1, TAP_EMPTY, tnCol2, tnCol3, TAP_EMPTY, tnCol4 ); -} - +/** + * @brief Optimize an individual pair of characters whenever possible. + * @param c1 the first character. + * @param c2 the second character. + * @return the one singular character. */ static char OptimizeDWIPair( char c1, char c2 ) { typedef pair cpair; @@ -128,16 +41,21 @@ static char OptimizeDWIPair( char c1, char c2 ) joins[ cpair('8', 'D') ] = 'K'; joins[ cpair('6', 'D') ] = 'L'; } - + if( c1 > c2 ) swap( c1, c2 ); - + map< cpair, char >::const_iterator it = joins.find( cpair(c1, c2) ); ASSERT( it != joins.end() ); - + return it->second; } +/** + * @brief Shrink the file contents as best as possible. + * @param holds the holds in the file. + * @param taps the taps in the file. + * @return the optimized string. */ RString OptimizeDWIString( RString holds, RString taps ) { /* First, sort the holds and taps in ASCII order. This puts 2468 first. @@ -145,17 +63,17 @@ RString OptimizeDWIString( RString holds, RString taps ) * do eg. 1D, not 2I. */ sort( holds.begin(), holds.end() ); sort( taps.begin(), taps.end() ); - + /* Combine characters as much as possible. */ RString comb_taps, comb_holds; - + /* 24 -> 1 */ while( taps.size() > 1 ) { comb_taps += OptimizeDWIPair( taps[0], taps[1] ); taps.erase(0, 2); } - + /* 2!24!4 -> 1!1 */ while( holds.size() > 1 ) { @@ -163,10 +81,10 @@ RString OptimizeDWIString( RString holds, RString taps ) holds.erase(0, 2); comb_holds += ssprintf( "%c!%c", to, to ); } - + ASSERT( taps.size() <= 1 ); ASSERT( holds.size() <= 1 ); - + /* 24!4 -> 1!4 */ while( holds.size() == 1 && taps.size() == 1 ) { @@ -175,7 +93,7 @@ RString OptimizeDWIString( RString holds, RString taps ) taps.erase(0, 1); holds.erase(0, 1); } - + /* Now we have at most one single tap and one hold remaining, and any * number of taps and holds in comb_taps and comb_holds. */ RString ret; @@ -184,15 +102,85 @@ RString OptimizeDWIString( RString holds, RString taps ) if( holds.size() == 1 ) ret += ssprintf( "%c!%c", holds[0], holds[0] ); ret += comb_holds; - + if( ret.size() == 1 || (ret.size() == 3 && ret[1] == '!') ) return ret; else return ssprintf( "<%s>", ret.c_str() ); } +/** + * @brief Turn the Notes into a DWI string without angle brackets whenever possible. + * @param tnCols the columns of TapNotes in question. + * @return the DWI'ed string. */ +static RString NotesToDWIString( const TapNote tnCols[6] ) +{ + const char dirs[] = { '4', 'C', '2', '8', 'D', '6' }; + RString taps, holds, ret; + for( int col = 0; col < 6; ++col ) + { + switch( tnCols[col].type ) + { + case TapNote::empty: + case TapNote::mine: + continue; + } + + if( tnCols[col].type == TapNote::hold_head ) + holds += dirs[col]; + else + taps += dirs[col]; + } + + if( holds.size() + taps.size() == 0 ) + return "0"; + + /* More than one. */ + return OptimizeDWIString( holds, taps ); +} + +/** + * @brief Turn the Notes into a DWI string without angle brackets whenever possible. + * @param tnCol1 the first column. + * @param tnCol2 the second column. + * @param tnCol3 the third column. + * @param tnCol4 the fourth column. + * @param tnCol5 the fifth column. + * @param tnCol6 the sisth column. + * @return the DWI'ed string. */ +static RString NotesToDWIString( TapNote tnCol1, TapNote tnCol2, TapNote tnCol3, + TapNote tnCol4, TapNote tnCol5, TapNote tnCol6 ) +{ + TapNote tnCols[6]; + tnCols[0] = tnCol1; + tnCols[1] = tnCol2; + tnCols[2] = tnCol3; + tnCols[3] = tnCol4; + tnCols[4] = tnCol5; + tnCols[5] = tnCol6; + return NotesToDWIString( tnCols ); +} + +/** + * @brief Turn the Notes into a DWI string without angle brackets whenever possible. + * @param tnCol1 the first column. + * @param tnCol2 the second column. + * @param tnCol3 the third column. + * @param tnCol4 the fourth column. + * @return the DWI'ed string. */ +static RString NotesToDWIString( TapNote tnCol1, TapNote tnCol2, TapNote tnCol3, TapNote tnCol4 ) +{ + return NotesToDWIString( tnCol1, TAP_EMPTY, tnCol2, tnCol3, TAP_EMPTY, tnCol4 ); +} + +/** @brief The number of beats per measure for a DWI file. */ static const int BEATS_PER_MEASURE = 4; +/** + * @brief Write out the notes for a DWI file. + * @param f the file to write out to. + * @param out the Steps in question. + * @param start the starting position. */ static void WriteDWINotesField( RageFile &f, const Steps &out, int start ) { NoteData notedata; @@ -315,6 +303,11 @@ static void WriteDWINotesField( RageFile &f, const Steps &out, int start ) } } +/** + * @brief Attempt to write a DWI's #NOTES tag. + * @param f the file to write out to. + * @param out the Steps in question. + * @return its success or failure. */ static bool WriteDWINotesTag( RageFile &f, const Steps &out ) { if( out.GetDifficulty() == Difficulty_Edit ) diff --git a/src/NotesWriterDWI.h b/src/NotesWriterDWI.h index ced57d528f..5c581139ed 100644 --- a/src/NotesWriterDWI.h +++ b/src/NotesWriterDWI.h @@ -1,18 +1,24 @@ -/* NotesWriterDWI - Writes a Song to a .DWI file. */ - #ifndef NOTES_WRITER_DWI_H #define NOTES_WRITER_DWI_H class Song; +/** @brief Writes a Song to a .DWI file. */ namespace NotesWriterDWI { + /** + * @brief Write the song out to a file. + * @param sPath the path to write the file. + * @param out the Song to be written out. + * @return its success or failure. */ bool Write( RString sPath, const Song &out ); } #endif -/* - * (c) 2001-2004 Chris Danford, Glenn Maynard +/** + * @file + * @author Chris Danford, Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/NotesWriterSM.cpp b/src/NotesWriterSM.cpp index 285fa2311b..f43643b343 100644 --- a/src/NotesWriterSM.cpp +++ b/src/NotesWriterSM.cpp @@ -16,6 +16,10 @@ #include "Song.h" #include "Steps.h" +/** + * @brief Turn the BackgroundChange into a string. + * @param bgc the BackgroundChange in question. + * @return the converted string. */ static RString BackgroundChangeToString( const BackgroundChange &bgc ) { // TODO: Technically we need to double-escape the filename (because it might @@ -37,9 +41,12 @@ static RString BackgroundChangeToString( const BackgroundChange &bgc ) return s; } +/** + * @brief Write out the common tags for .SM files. + * @param f the file in question. + * @param out the Song in question. */ static void WriteGlobalTags( RageFile &f, const Song &out ) { - //f.PutLine( ssprintf( "#SMVERSION:;", SmEscape(RString("ssc-v1.0")).c_str() ) ); f.PutLine( ssprintf( "#TITLE:%s;", SmEscape(out.m_sMainTitle).c_str() ) ); f.PutLine( ssprintf( "#SUBTITLE:%s;", SmEscape(out.m_sSubTitle).c_str() ) ); f.PutLine( ssprintf( "#ARTIST:%s;", SmEscape(out.m_sArtist).c_str() ) ); @@ -58,7 +65,8 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) vector vs; FOREACH_ENUM( InstrumentTrack, it ) if( out.HasInstrumentTrack(it) ) - vs.push_back( InstrumentTrackToString(it) + "=" + out.m_sInstrumentTrackFile[it] ); + vs.push_back( InstrumentTrackToString(it) + + "=" + out.m_sInstrumentTrackFile[it] ); if( !vs.empty() ) { RString s = join( ",", vs ); @@ -90,7 +98,8 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) if( out.m_fSpecifiedBPMMin == out.m_fSpecifiedBPMMax ) f.PutLine( ssprintf( "#DISPLAYBPM:%.6f;", out.m_fSpecifiedBPMMin ) ); else - f.PutLine( ssprintf( "#DISPLAYBPM:%.6f:%.6f;", out.m_fSpecifiedBPMMin, out.m_fSpecifiedBPMMax ) ); + f.PutLine( ssprintf( "#DISPLAYBPM:%.6f:%.6f;", + out.m_fSpecifiedBPMMin, out.m_fSpecifiedBPMMax ) ); break; case Song::DISPLAY_RANDOM: f.PutLine( ssprintf( "#DISPLAYBPM:*;" ) ); @@ -154,7 +163,8 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) f.Write( "#TIMESIGNATURES:" ); FOREACH_CONST( TimeSignatureSegment, out.m_Timing.m_vTimeSignatureSegments, iter ) { - f.PutLine( ssprintf( "%.6f=%d=%d", NoteRowToBeat(iter->m_iStartRow), iter->m_iNumerator, iter->m_iDenominator ) ); + f.PutLine( ssprintf( "%.6f=%d=%d", NoteRowToBeat(iter->m_iStartRow), + iter->m_iNumerator, iter->m_iDenominator ) ); vector::const_iterator iter2 = iter; iter2++; if( iter2 != out.m_Timing.m_vTimeSignatureSegments.end() ) @@ -226,6 +236,10 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) f.PutLine( ";" ); } +/** + * @brief Turn a vector of lines into a single line joined by newline characters. + * @param lines the list of lines to join. + * @return the joined lines. */ static RString JoinLineList( vector &lines ) { for( unsigned i = 0; i < lines.size(); ++i ) @@ -239,6 +253,11 @@ static RString JoinLineList( vector &lines ) return join( "\r\n", lines.begin()+j, lines.end() ); } +/** + * @brief Retrieve the notes from the #NOTES tag. + * @param song the Song in question. + * @param in the Steps in question. + * @return the #NOTES tag. */ static RString GetSMNotesTag( const Song &song, const Steps &in ) { vector lines; diff --git a/src/NotesWriterSM.h b/src/NotesWriterSM.h index 7427248425..c8c8f7775b 100644 --- a/src/NotesWriterSM.h +++ b/src/NotesWriterSM.h @@ -1,22 +1,45 @@ -/* NotesWriterSM - Writes a Song to an .SM file. */ - #ifndef NOTES_WRITER_SM_H #define NOTES_WRITER_SM_H class Song; class Steps; +/** @brief Writes a Song to an .SM file. */ namespace NotesWriterSM { + /** + * @brief Write the song out to a file. + * @param sPath the path to write the file. + * @param out the Song to be written out. + * @return its success or failure. */ bool Write( RString sPath, const Song &out ); + /** + * @brief Get some contents about the edit file first. + * @param pSong the Song in question. + * @param pSteps the Steps in question. + * @param sOut the start of the file contents. + */ void GetEditFileContents( const Song *pSong, const Steps *pSteps, RString &sOut ); + /** + * @brief Get the name of the edit file to use. + * @param pSong the Song in question. + * @param pSteps the Steps in question. + * @return the name of the edit file. */ RString GetEditFileName( const Song *pSong, const Steps *pSteps ); + /** + * @brief Write the edit file to the machine for future use. + * @param pSong the Song in question. + * @param pSteps the Steps in question. + * @param sErrorOut any error messages that may have occurred. + * @return its success or failure. */ bool WriteEditFileToMachine( const Song *pSong, Steps *pSteps, RString &sErrorOut ); } #endif -/* - * (c) 2001-2004 Chris Danford, Glenn Maynard +/** + * @file + * @author Chris Danford, Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index 5c7e8f3a68..0a77bae975 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -16,6 +16,10 @@ #include "Song.h" #include "Steps.h" +/** + * @brief Turn the BackgroundChange into a string. + * @param bgc the BackgroundChange in question. + * @return the converted string. */ static RString BackgroundChangeToString( const BackgroundChange &bgc ) { // TODO: Technically we need to double-escape the filename (because it might contain '=') and then @@ -37,6 +41,10 @@ static RString BackgroundChangeToString( const BackgroundChange &bgc ) return s; } +/** + * @brief Write out the common tags for .SM files. + * @param f the file in question. + * @param out the Song in question. */ static void WriteGlobalTags( RageFile &f, const Song &out ) { f.PutLine( ssprintf( "#VERSION:%.2f;", out.m_fVersion ) ); @@ -238,6 +246,10 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) f.PutLine( ";" ); } +/** + * @brief Turn a vector of lines into a single line joined by newline characters. + * @param lines the list of lines to join. + * @return the joined lines. */ static RString JoinLineList( vector &lines ) { for( unsigned i = 0; i < lines.size(); ++i ) @@ -251,7 +263,13 @@ static RString JoinLineList( vector &lines ) return join( "\r\n", lines.begin()+j, lines.end() ); } -static RString GetSSCNotesTag( const Song &song, const Steps &in, bool bSavingCache ) +/** + * @brief Retrieve the individual batches of NoteData. + * @param song the Song in question. + * @param in the Steps in question. + * @param bSavingCache a flag to see if we're saving certain cache data. + * @return the NoteData in RString form. */ +static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCache ) { vector lines; @@ -262,6 +280,7 @@ static RString GetSSCNotesTag( const Song &song, const Steps &in, bool bSavingCa lines.push_back( "#NOTEDATA:;" ); // our new separator. lines.push_back( ssprintf( "#STEPSTYPE:%s;", GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName ) ); lines.push_back( ssprintf( "#DESCRIPTION:%s;", SmEscape(in.GetDescription()).c_str() ) ); + lines.push_back( ssprintf( "#CHARTSTYLE:%s;", SmEscape(in.GetChartStyle()).c_str() ) ); lines.push_back( ssprintf( "#DIFFICULTY:%s;", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( "#METER:%d;", in.GetMeter() ) ); @@ -395,7 +414,7 @@ bool NotesWriterSSC::Write( RString sPath, const Song &out, const vector FOREACH_CONST( Steps*, vpStepsToSave, s ) { const Steps* pSteps = *s; - RString sTag = GetSSCNotesTag( out, *pSteps, bSavingCache ); + RString sTag = GetSSCNoteData( out, *pSteps, bSavingCache ); f.PutLine( sTag ); } if( f.Flush() == -1 ) @@ -415,7 +434,7 @@ void NotesWriterSSC::GetEditFileContents( const Song *pSong, const Steps *pSteps if( asParts.size() ) sDir = join( "/", asParts.begin()+1, asParts.end() ); sOut += ssprintf( "#SONG:%s;\r\n", sDir.c_str() ); - sOut += GetSSCNotesTag( *pSong, *pSteps, false ); + sOut += GetSSCNoteData( *pSong, *pSteps, false ); } RString NotesWriterSSC::GetEditFileName( const Song *pSong, const Steps *pSteps ) diff --git a/src/NotesWriterSSC.h b/src/NotesWriterSSC.h index 4819dc60d9..aaadfc2812 100644 --- a/src/NotesWriterSSC.h +++ b/src/NotesWriterSSC.h @@ -1,22 +1,47 @@ -/* NotesWriterSSC - Writes a Song to an .SSC file. */ - #ifndef NOTES_WRITER_SSC_H #define NOTES_WRITER_SSC_H class Song; class Steps; +/** @brief Writes a Song to an .SSC file. */ namespace NotesWriterSSC { + /** + * @brief Write the song out to a file. + * @param sPath the path to write the file. + * @param out the Song to be written out. + * @param vpStepsToSave the Steps to save. + * @param bSavingCache a flag to see if we're saving certain cache data. + * @return its success or failure. */ bool Write( RString sPath, const Song &out, const vector& vpStepsToSave, bool bSavingCache ); + /** + * @brief Get some contents about the edit file first. + * @param pSong the Song in question. + * @param pSteps the Steps in question. + * @param sOut the start of the file contents. + */ void GetEditFileContents( const Song *pSong, const Steps *pSteps, RString &sOut ); + /** + * @brief Get the name of the edit file to use. + * @param pSong the Song in question. + * @param pSteps the Steps in question. + * @return the name of the edit file. */ RString GetEditFileName( const Song *pSong, const Steps *pSteps ); + /** + * @brief Write the edit file to the machine for future use. + * @param pSong the Song in question. + * @param pSteps the Steps in question. + * @param sErrorOut any error messages that may have occurred. + * @return its success or failure. */ bool WriteEditFileToMachine( const Song *pSong, Steps *pSteps, RString &sErrorOut ); } #endif -/* - * (c) 2011 Jason Felds +/** + * @file + * @author Jason Felds (c) 2011 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/OptionRow.cpp b/src/OptionRow.cpp index cc37ffb4dc..f6d699af8a 100644 --- a/src/OptionRow.cpp +++ b/src/OptionRow.cpp @@ -17,7 +17,7 @@ const RString EXIT_NAME = "Exit"; RString OptionRow::GetThemedItemText( int iChoice ) const { RString s = m_pHand->GetThemedItemText( iChoice ); - + // HACK: Always theme the NEXT_ROW and EXIT items. if( m_bFirstItemGoesDown && iChoice == 0 ) s = CommonMetrics::LocalizeOptionItem( NEXT_ROW_NAME, false ); @@ -221,7 +221,7 @@ RString OptionRow::GetRowTitle() const } if( bpms.IsSecret() ) - sTitle += ssprintf( " (??" "?)" ); /* split so gcc doesn't think this is a trigraph */ + sTitle += ssprintf( " (??" "?)" ); // split so gcc doesn't think this is a trigraph else if( bpms.BpmIsConstant() ) sTitle += ssprintf( " (%.0f)", bpms.GetMin() ); else @@ -232,8 +232,8 @@ RString OptionRow::GetRowTitle() const return sTitle; } -/* Set up text, underlines and titles for options. This can be called - * as soon as m_pHand->m_Def is available. */ +/* Set up text, underlines and titles for options. This can be called as soon as + * m_pHand->m_Def is available. */ void OptionRow::InitText( RowType type ) { /* If we have elements already, we're being updated from a new set of options. @@ -278,7 +278,7 @@ void OptionRow::InitText( RowType type ) BitmapText bt( m_pParentType->m_textItem ); bt.PlayCommand( "On" ); - /* Figure out the width of the row. */ + // Figure out the width of the row. float fWidth = 0; for( unsigned c=0; cm_Def.m_vsChoices.size(); c++ ) { @@ -291,7 +291,7 @@ void OptionRow::InitText( RowType type ) fWidth += m_pParentType->ITEMS_GAP_X; } - /* Try to fit everything on one line. */ + // Try to fit everything on one line. float fTotalWidth = m_pParentType->ITEMS_END_X - m_pParentType->ITEMS_START_X; if( fWidth > fTotalWidth ) { @@ -303,9 +303,7 @@ void OptionRow::InitText( RowType type ) } } - // // load m_textItems - // switch( m_pHand->m_Def.m_layoutType ) { case LAYOUT_SHOW_ONE_IN_ROW: @@ -389,8 +387,8 @@ void OptionRow::InitText( RowType type ) for( unsigned c=0; cSetText( GetRowTitle() ); m_textTitle->PlayCommand( "On" ); @@ -403,9 +401,8 @@ void OptionRow::InitText( RowType type ) /* After importing options, choose which item is focused. */ void OptionRow::AfterImportOptions( PlayerNumber pn ) { - /* We load items for both players on start, since we don't know at that point - * which players will be joined when we're displayed. Hide items for inactive - * players. */ + /* We load items for both players on start, since we don't know which players + * will be joined when we're displayed. Hide items for inactive players. */ if( m_pHand->m_Def.m_layoutType == LAYOUT_SHOW_ONE_IN_ROW && !m_pHand->m_Def.m_bOneChoiceForAllPlayers ) m_textItems[pn]->SetVisible( GAMESTATE->IsHumanPlayer(pn) ); @@ -415,7 +412,7 @@ void OptionRow::AfterImportOptions( PlayerNumber pn ) for( unsigned c=0; cSetVisible( false ); - // Make all selections the same if bOneChoiceForAllPlayers + // Make all selections the same if bOneChoiceForAllPlayers. // Hack: we only import active players, so if only player 2 is imported, // we need to copy p2 to p1, not p1 to p2. if( m_pHand->m_Def.m_bOneChoiceForAllPlayers ) @@ -430,7 +427,7 @@ void OptionRow::AfterImportOptions( PlayerNumber pn ) switch( m_pHand->m_Def.m_selectType ) { case SELECT_ONE: - /* Make sure the row actually has a selection. */ + // Make sure the row actually has a selection. int iSelection = GetOneSelection(pn, true); if( iSelection == -1 ) { @@ -468,11 +465,11 @@ void OptionRow::PositionUnderlines( PlayerNumber pn ) { if( m_bRowHasFocus[pn] ) fAlpha = m_pParentType->COLOR_SELECTED.GetValue().a; else if( bRowEnabled ) fAlpha = m_pParentType->COLOR_NOT_SELECTED.GetValue().a; - else fAlpha = m_pParentType->COLOR_DISABLED.GetValue().a; + else fAlpha = m_pParentType->COLOR_DISABLED.GetValue().a; } } - /* Don't tween X movement and color changes. */ + // Don't tween X movement and color changes. ul.StopTweening(); int iWidth, iX, iY; @@ -501,7 +498,7 @@ void OptionRow::PositionIcons( PlayerNumber pn ) pIcon->SetX( m_pParentType->MOD_ICON_X.GetValue(pn) ); } -/* This is called when the focus changes, to update "long row" text. */ +// This is called when the focus changes, to update "long row" text. void OptionRow::UpdateText( PlayerNumber p ) { switch( m_pHand->m_Def.m_layoutType ) @@ -551,10 +548,10 @@ void OptionRow::UpdateEnabledDisabled() bool bThisRowHasFocusByAll = true; FOREACH_HumanPlayer( p ) bThisRowHasFocusByAll &= m_bRowHasFocus[p]; - + bool bRowEnabled = !m_pHand->m_Def.m_vEnabledForPlayers.empty(); - - /* Don't tween selection colors at all. */ + + // Don't tween selection colors at all. RString sCmdName; if( bThisRowHasFocusByAny ) sCmdName = "GainFocus"; else if( bRowEnabled ) sCmdName = "LoseFocus"; @@ -601,7 +598,7 @@ void OptionRow::UpdateEnabledDisabled() m_textItems[j]->BeginTweening( m_pParentType->TWEEN_SECONDS ); m_textItems[j]->SetDiffuse( color ); } - + break; case LAYOUT_SHOW_ONE_IN_ROW: FOREACH_HumanPlayer( pn ) @@ -612,7 +609,7 @@ void OptionRow::UpdateEnabledDisabled() { if( m_bRowHasFocus[pn] ) color = m_pParentType->COLOR_SELECTED; else if( bRowEnabled ) color = m_pParentType->COLOR_NOT_SELECTED; - else color = m_pParentType->COLOR_DISABLED; + else color = m_pParentType->COLOR_DISABLED; } unsigned item_no = m_pHand->m_Def.m_bOneChoiceForAllPlayers ? 0 : pn; @@ -735,7 +732,7 @@ int OptionRow::GetChoiceInRowWithFocus( PlayerNumber pn ) const if( m_pHand->m_Def.m_vsChoices.empty() ) return -1; int iChoice = m_iChoiceInRowWithFocus[pn]; - return iChoice; + return iChoice; } int OptionRow::GetChoiceInRowWithFocusShared() const @@ -939,6 +936,39 @@ int OptionRow::ExportOptions( const vector &vpns, bool bRowHasFocu return iChangeMask; } +// lua start +#include "LuaBinding.h" + +class LunaOptionRow: public Luna +{ +public: + DEFINE_METHOD( FirstItemGoesDown, GetFirstItemGoesDown() ) + static int GetChoiceInRowWithFocus( T* p, lua_State *L ) { lua_pushnumber( L, p->GetChoiceInRowWithFocus(Enum::Check(L, 1)) ); return 1; } + DEFINE_METHOD( GetLayoutType, GetHandler()->m_Def.m_layoutType ) + static int GetName( T* p, lua_State *L ) { lua_pushstring( L, p->GetHandler()->m_Def.m_sName ); return 1; } + static int GetNumChoices( T* p, lua_State *L ) { lua_pushnumber( L, p->GetHandler()->m_Def.m_vsChoices.size() ); return 1; } + DEFINE_METHOD( GetSelectType, GetHandler()->m_Def.m_selectType ) + DEFINE_METHOD( GetRowTitle, GetRowTitle() ) + static int HasFocus( T* p, lua_State *L ) { lua_pushboolean( L, p->GetRowHasFocus(Enum::Check(L, 1)) ); return 1; } + static int OneChoiceForAllPlayers( T* p, lua_State *L ) { lua_pushboolean( L, p->GetHandler()->m_Def.m_bOneChoiceForAllPlayers ); return 1; } + + LunaOptionRow() + { + ADD_METHOD( FirstItemGoesDown ); + ADD_METHOD( GetChoiceInRowWithFocus ); + ADD_METHOD( GetLayoutType ); + ADD_METHOD( GetName ); + ADD_METHOD( GetNumChoices ); + ADD_METHOD( GetRowTitle ); + ADD_METHOD( GetSelectType ); + ADD_METHOD( HasFocus ); + ADD_METHOD( OneChoiceForAllPlayers ); + } +}; + +LUA_REGISTER_DERIVED_CLASS( OptionRow, ActorFrame ) +// lua end + /* * (c) 2001-2004 Chris Danford * All rights reserved. diff --git a/src/OptionRow.h b/src/OptionRow.h index 6d05764488..d3ed70db3f 100644 --- a/src/OptionRow.h +++ b/src/OptionRow.h @@ -68,13 +68,17 @@ public: RowType_Normal, RowType_Exit }; + void InitText( RowType type ); void AfterImportOptions( PlayerNumber pn ); + RString GetRowTitle() const; + void ChoicesChanged( RowType type ); void PositionUnderlines( PlayerNumber pn ); void PositionIcons( PlayerNumber pn ); void UpdateText( PlayerNumber pn ); + bool GetRowHasFocus( PlayerNumber pn ) const { return m_bRowHasFocus[pn]; } void SetRowHasFocus( PlayerNumber pn, bool bRowHasFocus ); void UpdateEnabledDisabled(); @@ -113,24 +117,25 @@ public: // Messages virtual void HandleMessage( const Message &msg ); + // Lua + void PushSelf( lua_State *L ); + protected: - RString GetRowTitle() const; + const OptionRowType *m_pParentType; + RowType m_RowType; + OptionRowHandler* m_pHand; - const OptionRowType *m_pParentType; - RowType m_RowType; - OptionRowHandler* m_pHand; + ActorFrame m_Frame; - ActorFrame m_Frame; - - vector m_textItems; // size depends on m_bRowIsLong and which players are joined + vector m_textItems; // size depends on m_bRowIsLong and which players are joined vector m_Underline[NUM_PLAYERS]; // size depends on m_bRowIsLong and which players are joined - Actor *m_sprFrame; - BitmapText *m_textTitle; - ModIcon *m_ModIcons[NUM_PLAYERS]; + Actor *m_sprFrame; + BitmapText *m_textTitle; + ModIcon *m_ModIcons[NUM_PLAYERS]; - bool m_bFirstItemGoesDown; - bool m_bRowHasFocus[NUM_PLAYERS]; + bool m_bFirstItemGoesDown; + bool m_bRowHasFocus[NUM_PLAYERS]; int m_iChoiceInRowWithFocus[NUM_PLAYERS]; // this choice has input focus // Only one will true at a time if m_pHand->m_Def.bMultiSelect diff --git a/src/OptionRowHandler.cpp b/src/OptionRowHandler.cpp index c6b43459b6..e3206c0f0f 100644 --- a/src/OptionRowHandler.cpp +++ b/src/OptionRowHandler.cpp @@ -36,6 +36,7 @@ static const char *SelectTypeNames[] = { }; XToString( SelectType ); StringToX( SelectType ); +LuaXType( SelectType ); static const char *LayoutTypeNames[] = { "ShowAllInRow", @@ -43,6 +44,7 @@ static const char *LayoutTypeNames[] = { }; XToString( LayoutType ); StringToX( LayoutType ); +LuaXType( LayoutType ); RString OptionRowHandler::OptionTitle() const { diff --git a/src/OptionRowHandler.h b/src/OptionRowHandler.h index f2591f1873..873f8fb00e 100644 --- a/src/OptionRowHandler.h +++ b/src/OptionRowHandler.h @@ -1,5 +1,3 @@ -/* OptionRowHandler - Shows PlayerOptions and SongOptions in icon form. */ - #ifndef OptionRowHandler_H #define OptionRowHandler_H @@ -21,6 +19,7 @@ enum SelectType }; const RString& SelectTypeToString( SelectType pm ); SelectType StringToSelectType( const RString& s ); +LuaDeclareType( SelectType ); enum LayoutType { @@ -31,6 +30,7 @@ enum LayoutType }; const RString& LayoutTypeToString( LayoutType pm ); LayoutType StringToLayoutType( const RString& s ); +LuaDeclareType( LayoutType ); struct OptionRowDefinition { @@ -46,7 +46,7 @@ struct OptionRowDefinition bool m_bAllowThemeItems; // Should be true for dynamic strings. bool m_bAllowThemeTitle; // Should be true for dynamic strings. bool m_bAllowExplanation; // if false, ignores ScreenOptions::SHOW_EXPLANATIONS. Should be true for dynamic strings. - bool m_bShowChoicesListOnSelect; + bool m_bShowChoicesListOnSelect; // (currently unused) bool IsEnabledForPlayer( PlayerNumber pn ) const { @@ -84,6 +84,7 @@ struct OptionRowDefinition } }; +/** @brief Shows PlayerOptions and SongOptions in icon form. */ class OptionRowHandler { public: @@ -107,18 +108,15 @@ public: virtual void LoadInternal( const Commands &cmds ) { } - /* - * We may re-use OptionRowHandlers. This is called before each - * use. If the contents of the row are dependent on external - * state (for example, the current song), clear the row contents - * and reinitialize them. As an optimization, rows which do not - * change can be initialized just once and left alone. - * + /* We may re-use OptionRowHandlers. This is called before each use. If the + * contents of the row are dependent on external state (for example, the + * current song), clear the row contents and reinitialize them. As an + * optimization, rows which do not change can be initialized just once and + * left alone. * If the row has been reinitialized, return RELOAD_CHANGED_ALL, and the - * graphic elements will also be reinitialized. If only m_vEnabledForPlayers - * has been changed, return RELOAD_CHANGED_ENABLED. If the row is static, and - * nothing has changed, return RELOAD_CHANGED_NONE. - */ + * graphic elements will also be reinitialized. If only m_vEnabledForPlayers + * has been changed, return RELOAD_CHANGED_ENABLED. If the row is static, and + * nothing has changed, return RELOAD_CHANGED_NONE. */ enum ReloadChanged { RELOAD_CHANGED_NONE, RELOAD_CHANGED_ENABLED, RELOAD_CHANGED_ALL }; virtual ReloadChanged Reload() { return RELOAD_CHANGED_NONE; } @@ -130,7 +128,7 @@ public: virtual RString GetScreen( int iChoice ) const { return RString(); } }; - +/** @brief Utilities for the OptionRowHandlers. */ namespace OptionRowHandlerUtil { OptionRowHandler* Make( const Commands &cmds ); diff --git a/src/OptionsCursor.h b/src/OptionsCursor.h index 484372527e..a1b4da23f9 100644 --- a/src/OptionsCursor.h +++ b/src/OptionsCursor.h @@ -1,5 +1,3 @@ -/* OptionsCursor - A cursor for ScreenOptions. */ - #ifndef OPTIONS_CURSOR_H #define OPTIONS_CURSOR_H @@ -7,7 +5,7 @@ #include "ActorFrame.h" #include "PlayerNumber.h" #include "AutoActor.h" - +/** @brief A cursor for ScreenOptions. */ class OptionsCursor : public ActorFrame { public: diff --git a/src/PaneDisplay.cpp b/src/PaneDisplay.cpp index ab7097baf4..cdd89c681f 100644 --- a/src/PaneDisplay.cpp +++ b/src/PaneDisplay.cpp @@ -55,7 +55,7 @@ static const Content_t g_Contents[NUM_PaneCategory] = { NEED_NOTES|NEED_PROFILE, "score" }, // ProfileHighScore }; -REGISTER_ACTOR_CLASS( PaneDisplay ) +REGISTER_ACTOR_CLASS( PaneDisplay ); void PaneDisplay::Load( const RString &sMetricsGroup, PlayerNumber pn ) { @@ -276,6 +276,7 @@ void PaneDisplay::SetFromGameState() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the PaneDisplay. */ class LunaPaneDisplay: public Luna { public: diff --git a/src/PercentageDisplay.cpp b/src/PercentageDisplay.cpp index 6f22bffd5b..31dc11c7a0 100644 --- a/src/PercentageDisplay.cpp +++ b/src/PercentageDisplay.cpp @@ -12,7 +12,7 @@ #include "Course.h" -REGISTER_ACTOR_CLASS( PercentageDisplay ) +REGISTER_ACTOR_CLASS( PercentageDisplay ); PercentageDisplay::PercentageDisplay() { @@ -207,6 +207,7 @@ bool PercentageDisplay::ShowDancePointsNotPercentage() const #include "LuaBinding.h" +/** @brief Allow Lua to have access to the PercentageDisplay. */ class LunaPercentageDisplay: public Luna { public: diff --git a/src/PercentageDisplay.h b/src/PercentageDisplay.h index 9afcfd02bf..875b6ee664 100644 --- a/src/PercentageDisplay.h +++ b/src/PercentageDisplay.h @@ -1,5 +1,3 @@ -/* PercentageDisplay - An Actor that displays a percentage. */ - #ifndef PERCENTAGE_DISPLAY_H #define PERCENTAGE_DISPLAY_H @@ -11,6 +9,7 @@ class PlayerState; +/** @brief An Actor that displays a percentage. */ class PercentageDisplay: public ActorFrame { public: diff --git a/src/Player.cpp b/src/Player.cpp index fd3a45e715..66bdc60d44 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -42,7 +42,9 @@ #include "LocalizedString.h" #include "AdjustSync.h" -// Helper class to ensure that each row is only judged once without taking too much memory. +/** + * @brief Helper class to ensure that each row is only judged once without taking too much memory. + */ class JudgedRows { vector m_vRows; @@ -91,8 +93,10 @@ public: RString ATTACK_DISPLAY_X_NAME( size_t p, size_t both_sides ) { return "AttackDisplayXOffset" + (both_sides ? RString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); } -/* Distance to search for a note in Step(), in seconds. */ -// TODO: This should be calculated based on the max size of the current judgment windows. +/** + * @brief Distance to search for a note in Step(), in seconds. + * + * TODO: This should be calculated based on the max size of the current judgment windows. */ static const float StepSearchDistance = 1.0f; void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut ) @@ -127,14 +131,48 @@ ThemeMetric INITIAL_HOLD_LIFE ( "Player", "InitialHoldLife" ); ThemeMetric MAX_HOLD_LIFE ( "Player", "MaxHoldLife" ); // sm-ssc addition ThemeMetric PENALIZE_TAP_SCORE_NONE ( "Player", "PenalizeTapScoreNone" ); ThemeMetric JUDGE_HOLD_NOTES_ON_SAME_ROW_TOGETHER ( "Player", "JudgeHoldNotesOnSameRowTogether" ); +/** + * @brief Does StepMania use checkpoint judgments when interacting with holds? + * + * If set to true, checkpoint judgments are in use, similar to the Pump It Up + * series. If set to false, no such judgments are used. */ ThemeMetric HOLD_CHECKPOINTS ( "Player", "HoldCheckpoints" ); +/** + * @brief If using checkpoints, are the song's TickcountSegments used? + * + * If set to true, the checkpoints rely on the data found in the TickcountSegments. + * This is used via the #%TICKCOUNTS tag. */ ThemeMetric CHECKPOINTS_USE_TICKCOUNTS ( "Player", "CheckpointsUseTickcounts" ); +/** + * @brief If using checkpoints, are the song's TimeSignatureSegments used? + * + * If set to true AND CheckpointsUseTickcounts is set to false, the TimeSignatureSegments + * are used to determine how often the checkpoints are found. + * + * It should be noted that this is a deprecated metric. */ ThemeMetric CHECKPOINTS_USE_TIME_SIGNATURES ( "Player", "CheckpointsUseTimeSignatures" ); ThemeMetric CHECKPOINTS_FLASH_ON_HOLD ( "Player", "CheckpointsFlashOnHold" ); // sm-ssc addition ThemeMetric IMMEDIATE_HOLD_LET_GO ( "Player", "ImmediateHoldLetGo" ); +/** + * @brief Must a Player step on a hold head for a hold to activate? + * + * If set to true, the Player must step on a hold head in order for the hold to activate. + * If set to false, merely holding your foot down as the hold head approaches will suffice. */ ThemeMetric REQUIRE_STEP_ON_HOLD_HEADS ( "Player", "RequireStepOnHoldHeads" ); +/** + * @brief Must a Player step on a mine for it to activate? + * + * If set to true, the Player must step on a mine for it to blow up. + * If set to false, merely holding your foot down as the mine approaches will suffice. */ ThemeMetric REQUIRE_STEP_ON_MINES ( "Player", "RequireStepOnMines" ); //ThemeMetric HOLD_TRIGGERS_TAP_NOTES ( "Player", "HoldTriggersTapNotes" ); // parastar stuff; leave in though +/** + * @brief Does repeatedly stepping on a roll to keep it alive increment the combo? + * + * If set to true, repeatedly stepping on a roll will increment the combo. + * If set to false, only the roll head causes the combo to be incremented. + * + * For those wishing to make a theme very accurate to In The Groove 2, set this to false. */ ThemeMetric ROLL_BODY_INCREMENTS_COMBO ( "Player", "RollBodyIncrementsCombo" ); ThemeMetric CHECKPOINTS_TAPS_SEPARATE_JUDGMENT ( "Player", "CheckpointsTapsSeparateJudgment" ); ThemeMetric SCORE_MISSED_HOLDS_AND_ROLLS ( "Player", "ScoreMissedHoldsAndRolls" ); // sm-ssc addition @@ -401,7 +439,10 @@ void Player::Init( m_fActiveRandomAttackStart = -1.0f; } - +/** + * @brief Determine if a TapNote needs a tap note style judgment. + * @param tn the TapNote in question. + * @return true if it does, false otherwise. */ static bool NeedsTapJudging( const TapNote &tn ) { switch( tn.type ) @@ -420,6 +461,10 @@ static bool NeedsTapJudging( const TapNote &tn ) } } +/** + * @brief Determine if a TapNote needs a hold note style judgment. + * @param tn the TapNote in question. + * @return true if it does, false otherwise. */ static bool NeedsHoldJudging( const TapNote &tn ) { switch( tn.type ) @@ -752,17 +797,6 @@ void Player::Update( float fDeltaTime ) bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( GameI ); - if( m_vAlterMap.size() > 0 ) // alternate input is being used - { - for( unsigned int i=0; i < m_vAlterMap.size(); ++i ) - { - if( m_vAlterMap[i].inpMain == GameI ) - { - bIsHoldingButton = bIsHoldingButton || INPUTMAPPER->IsBeingPressed( m_vAlterMap[i].inpAlt ); - } - } - } - // TODO: Make this work for non-human-controlled players if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && m_pPlayerState->m_PlayerController==PC_HUMAN ) if( m_pNoteField ) @@ -1049,17 +1083,6 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vectorIsBeingPressed( GameI, m_pPlayerState->m_mp ); - - if( m_vAlterMap.size() > 0 ) // alternate input is being used - { - for( unsigned int i=0; i < m_vAlterMap.size(); ++i ) - { - if( m_vAlterMap[i].inpMain == GameI ) - { - bIsHoldingButton = bIsHoldingButton | INPUTMAPPER->IsBeingPressed( m_vAlterMap[i].inpAlt ); - } - } - } } } @@ -1253,13 +1276,13 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vectorTrace("initiated note and let go :("); } } - else + else if( SCORE_MISSED_HOLDS_AND_ROLLS ) { - //LOG->Trace("did not initiate note"); - if( !bInitiatedNote && !SCORE_MISSED_HOLDS_AND_ROLLS ) - hns = HNS_None; - else - hns = HNS_LetGo; + hns = HNS_LetGo; + } + else + { + hns = HNS_None; } } @@ -1666,7 +1689,7 @@ void Player::Fret( int col, int row, const RageTimer &tm, bool bHeld, bool bRele // Since this is being called every frame, let's not check the whole array every time. // Instead, only check 1 beat back. Even 1 is overkill. const int iStartCheckingAt = max( 0, iSongRow-BeatToNoteRow(1) ); - NoteData::iterator begin, end; + NoteData::TrackMap::iterator begin, end; m_NoteData.GetTapNoteRangeInclusive( iTrack, iStartCheckingAt, iSongRow+1, begin, end ); for( ; begin != end; ++begin ) { @@ -1754,7 +1777,7 @@ void Player::ScoreAllActiveHoldsLetGo() // Since this is being called every frame, let's not check the whole array every time. // Instead, only check 1 beat back. Even 1 is overkill. const int iStartCheckingAt = max( 0, iSongRow-BeatToNoteRow(1) ); - NoteData::iterator begin, end; + NoteData::TrackMap::iterator begin, end; m_NoteData.GetTapNoteRangeInclusive( iTrack, iStartCheckingAt, iSongRow+1, begin, end ); for( ; begin != end; ++begin ) { @@ -1805,7 +1828,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b // Instead, only check 1 beat back. Even 1 is overkill. // Just update the life here and let Update judge the roll. const int iStartCheckingAt = max( 0, iSongRow-BeatToNoteRow(1) ); - NoteData::iterator begin, end; + NoteData::TrackMap::iterator begin, end; m_NoteData.GetTapNoteRangeInclusive( col, iStartCheckingAt, iSongRow+1, begin, end ); for( ; begin != end; ++begin ) { @@ -2702,39 +2725,11 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI, m_pPlayerState->m_mp ); if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds ) Step( iTrack, -1, now - PREFSMAN->m_fPadStickSeconds, true, false ); - - if( m_vAlterMap.size() > 0 ) // alternate input is being used - { - for( unsigned int i=0; i < m_vAlterMap.size(); ++i ) - { - if( m_vAlterMap[i].inpMain == GameI ) - { - GameInput GameIB = m_vAlterMap[i].inpAlt; - float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameIB, m_pPlayerState->m_mp ); - if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds ) - Step( iTrack, -1, now - PREFSMAN->m_fPadStickSeconds, true, false ); - } - } - } } else if( INPUTMAPPER->IsBeingPressed(GameI, m_pPlayerState->m_mp) ) { Step( iTrack, -1, now, true, false ); } - else if( m_vAlterMap.size() > 0 ) // alternate input being used - { - for( unsigned int i=0; i < m_vAlterMap.size(); ++i ) - { - if( m_vAlterMap[i].inpMain == GameI ) - { - GameInput GameIB = m_vAlterMap[i].inpAlt; - if( INPUTMAPPER->IsBeingPressed(GameIB, m_pPlayerState->m_mp) ) - { - Step( iTrack, -1, now, true, false ); - } - } - } - } } break; case TapNote::mine: @@ -3236,6 +3231,7 @@ RString Player::ApplyRandomAttack() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Player. */ class LunaPlayer: public Luna { public: diff --git a/src/Player.h b/src/Player.h index 82118d95ce..2036b46d1e 100644 --- a/src/Player.h +++ b/src/Player.h @@ -1,5 +1,3 @@ -/* Player - Accepts input, knocks down TapNotes that were stepped on, and keeps score for the player. */ - #ifndef PLAYER_H #define PLAYER_H @@ -37,6 +35,7 @@ AutoScreenMessage( SM_1000Combo ); AutoScreenMessage( SM_ComboStopped ); AutoScreenMessage( SM_ComboContinuing ); +/** @brief Accepts input, knocks down TapNotes that were stepped on, and keeps score for the player. */ class Player: public ActorFrame { public: @@ -105,8 +104,6 @@ public: void SetSendJudgmentAndComboMessages( bool b ) { m_bSendJudgmentAndComboMessages = b; } - vector m_vAlterMap; - // Lua virtual void PushSelf( lua_State *L ); @@ -145,7 +142,9 @@ protected: bool m_bLoaded; + /** @brief The player's present state. */ PlayerState *m_pPlayerState; + /** @brief The player's present stage stats. */ PlayerStageStats *m_pPlayerStageStats; float m_fNoteFieldHeight; diff --git a/src/PlayerAI.cpp b/src/PlayerAI.cpp index 1376e0324b..48f7186ec5 100644 --- a/src/PlayerAI.cpp +++ b/src/PlayerAI.cpp @@ -18,18 +18,17 @@ struct TapScoreDistribution for( int i=0; i<=TNS_W1; i++ ) { fCumulativePercent += fPercent[i]; - if( fRand <= fCumulativePercent+1e-4 ) /* rounding error */ + if( fRand <= fCumulativePercent+1e-4 ) // rounding error return (TapNoteScore)i; } - ASSERT_M( 0, ssprintf("%f,%f",fRand,fCumulativePercent) ); // the fCumulativePercents must sum to 1.0, so we should never get here! + // the fCumulativePercents must sum to 1.0, so we should never get here! + ASSERT_M( 0, ssprintf("%f,%f",fRand,fCumulativePercent) ); return TNS_W1; } - }; static TapScoreDistribution g_Distributions[NUM_SKILL_LEVELS]; - void PlayerAI::InitFromDisk() { bool bSuccess; @@ -68,7 +67,6 @@ void PlayerAI::InitFromDisk() } } - TapNoteScore PlayerAI::GetTapNoteScore( const PlayerState* pPlayerState ) { if( pPlayerState->m_PlayerController == PC_AUTOPLAY ) @@ -84,10 +82,10 @@ TapNoteScore PlayerAI::GetTapNoteScore( const PlayerState* pPlayerState ) int iCpuSkill = pPlayerState->m_iCpuSkill; - /* If we're in battle mode, reduce the skill based on the number of modifier attacks - * against us. If we're in demonstration or jukebox mode with modifiers attached, - * don't make demonstration miss a lot. */ - // xxx: weight certain modifiers (boomerang, tornado) more? (to simulate + /* If we're in battle mode, reduce the skill based on the number of modifier + * attacks against us. If we're in demonstration or jukebox mode with + * modifiers attached, don't make demonstration miss a lot. */ + // Idea: weight certain modifiers (boomerang, tornado) more? (to simulate // readability problems) -aj if( !GAMESTATE->m_bDemonstrationOrJukebox ) { diff --git a/src/PlayerNumber.h b/src/PlayerNumber.h index 11bd42a8b1..109deea091 100644 --- a/src/PlayerNumber.h +++ b/src/PlayerNumber.h @@ -19,7 +19,7 @@ const PlayerNumber PLAYER_INVALID = PlayerNumber_Invalid; const RString& PlayerNumberToString( PlayerNumber pn ); const RString& PlayerNumberToLocalizedString( PlayerNumber pn ); LuaDeclareType( PlayerNumber ); - +/** @brief A foreach loop to handle the different players. */ #define FOREACH_PlayerNumber( pn ) FOREACH_ENUM( PlayerNumber, pn ) const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 }; @@ -65,7 +65,7 @@ enum MultiPlayer const RString& MultiPlayerToString( MultiPlayer mp ); const RString& MultiPlayerToLocalizedString( MultiPlayer mp ); LuaDeclareType( MultiPlayer ); - +/** @brief A foreach loop to handle the different Players in MultiPlayer. */ #define FOREACH_MultiPlayer( pn ) FOREACH_ENUM( MultiPlayer, pn ) #endif diff --git a/src/PlayerStageStats.cpp b/src/PlayerStageStats.cpp index 69a4dbe3b7..d1b0e08d4a 100644 --- a/src/PlayerStageStats.cpp +++ b/src/PlayerStageStats.cpp @@ -668,6 +668,7 @@ LuaFunction( FormatPercentScore, PlayerStageStats::FormatPercentScore( FArg(1) ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the PlayerStageStats. */ class LunaPlayerStageStats: public Luna { public: diff --git a/src/PlayerState.cpp b/src/PlayerState.cpp index 41ebdbc9b3..aa512ecbaf 100644 --- a/src/PlayerState.cpp +++ b/src/PlayerState.cpp @@ -192,6 +192,7 @@ int PlayerState::GetSumOfActiveAttackLevels() const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the PlayerState. */ class LunaPlayerState: public Luna { public: diff --git a/src/PlayerState.h b/src/PlayerState.h index 26559e50f8..e023bb7df0 100644 --- a/src/PlayerState.h +++ b/src/PlayerState.h @@ -46,7 +46,7 @@ public: * @brief Used to push note-changing modifiers back so that notes don't pop. * * This is used during gameplay and set by NoteField. */ - mutable float m_fLastDrawnBeat; + mutable float m_fLastDrawnBeat; /** @brief The Player's HealthState in general terms. */ HealthState m_HealthState; diff --git a/src/Preference.h b/src/Preference.h index 317936fe20..4fdcdc1346 100644 --- a/src/Preference.h +++ b/src/Preference.h @@ -121,6 +121,7 @@ private: void (*m_pfnValidate)(T& val); }; +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template void Push( lua_State *L, const Preference &Object ) { LuaHelpers::Push( L, Object.Get() ); } } template diff --git a/src/PrefsManager.cpp b/src/PrefsManager.cpp index 2ced597a9e..3d32672c58 100644 --- a/src/PrefsManager.cpp +++ b/src/PrefsManager.cpp @@ -521,6 +521,7 @@ RString PrefsManager::GetPreferencesSection() const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the PrefsManager. */ class LunaPrefsManager: public Luna { public: diff --git a/src/PrefsManager.h b/src/PrefsManager.h index f9443ac9e5..ebec3fb8f5 100644 --- a/src/PrefsManager.h +++ b/src/PrefsManager.h @@ -1,5 +1,3 @@ -/* PrefsManager - Holds user-chosen preferences that are saved between sessions. */ - #ifndef PREFSMANAGER_H #define PREFSMANAGER_H @@ -7,6 +5,9 @@ class IniFile; +/** @brief How many songs can be played during a normal game max? + * + * This assumes no extra stages, no event mode, no course modes. */ const int MAX_SONGS_PER_PLAY = 7; enum MusicWheelUsesSections @@ -125,6 +126,7 @@ enum DefaultFailType DefaultFailType_Invalid }; +/** @brief Holds user-chosen preferences that are saved between sessions. */ class PrefsManager { public: diff --git a/src/ProductInfo.h b/src/ProductInfo.h index f64d44756e..2083e30323 100644 --- a/src/ProductInfo.h +++ b/src/ProductInfo.h @@ -35,7 +35,7 @@ * */ #ifndef PRODUCT_VER_BARE -#define PRODUCT_VER_BARE v1.2.1 +#define PRODUCT_VER_BARE v1.2.2 #endif /** diff --git a/src/ProductInfo.inc b/src/ProductInfo.inc index 616754e3fa..e77a3c743b 100644 --- a/src/ProductInfo.inc +++ b/src/ProductInfo.inc @@ -5,7 +5,7 @@ ; see ProductInfo.h for use descriptions !define PRODUCT_ID "sm-ssc" -!define PRODUCT_VER "v1.2.1" +!define PRODUCT_VER "v1.2.2" !define PRODUCT_DISPLAY "${PRODUCT_ID} ${PRODUCT_VER}" !define PRODUCT_BITMAP "ssc" diff --git a/src/Profile.cpp b/src/Profile.cpp index 22b071a4d6..b3d48827d6 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -1937,6 +1937,7 @@ RString Profile::MakeFileNameNoExtension( RString sFileNameBeginning, int iIndex // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Profile. */ class LunaProfile: public Luna { public: diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 65db1110c7..81f1f40ff9 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -799,6 +799,7 @@ int ProfileManager::GetNumLocalProfiles() const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ProfileManager. */ class LunaProfileManager: public Luna { public: diff --git a/src/ProfileManager.h b/src/ProfileManager.h index 3381b9498f..2f0ca9a9b5 100644 --- a/src/ProfileManager.h +++ b/src/ProfileManager.h @@ -1,5 +1,3 @@ -/* ProfileManager - Interface to machine and memory card profiles. */ - #ifndef ProfileManager_H #define ProfileManager_H @@ -17,7 +15,7 @@ class Course; class Trail; struct HighScore; struct lua_State; - +/** @brief Interface to machine and memory card profiles. */ class ProfileManager { public: diff --git a/src/Quad.cpp b/src/Quad.cpp index 6562b2b6cc..3a9d087ede 100644 --- a/src/Quad.cpp +++ b/src/Quad.cpp @@ -3,7 +3,7 @@ #include "ActorUtil.h" #include "RageTextureManager.h" -REGISTER_ACTOR_CLASS( Quad ) +REGISTER_ACTOR_CLASS( Quad ); Quad::Quad() { diff --git a/src/RadarValues.cpp b/src/RadarValues.cpp index c87b4fe8c7..890bec2fa6 100644 --- a/src/RadarValues.cpp +++ b/src/RadarValues.cpp @@ -91,6 +91,7 @@ void RadarValues::FromString( RString sRadarValues ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the RadarValues. */ class LunaRadarValues: public Luna { public: diff --git a/src/RageDisplay.cpp b/src/RageDisplay.cpp index c622671608..14eb9a7ed5 100644 --- a/src/RageDisplay.cpp +++ b/src/RageDisplay.cpp @@ -994,6 +994,8 @@ void RageCompiledGeometry::Set( const vector &vMeshes, bool bNeedsNormal // lua start #include "LuaBinding.h" + +/** @brief Allow Lua to have access to the RageDisplay. */ class LunaRageDisplay: public Luna { public: diff --git a/src/RageDisplay_OGL_Helpers.h b/src/RageDisplay_OGL_Helpers.h index 5f232e2b74..3a59abe38e 100644 --- a/src/RageDisplay_OGL_Helpers.h +++ b/src/RageDisplay_OGL_Helpers.h @@ -30,6 +30,7 @@ /* Not in glext.h: */ typedef bool (APIENTRY * PWSWAPINTERVALEXTPROC) (int interval); +/** @brief Utilities for working with the RageDisplay. */ namespace RageDisplay_OGL_Helpers { void Init(); diff --git a/src/RageException.h b/src/RageException.h index db97dae7d3..0d87af61c4 100644 --- a/src/RageException.h +++ b/src/RageException.h @@ -1,8 +1,9 @@ -/* RageException - Class for throwing fatal errors. */ - #ifndef RAGE_EXCEPTION_H #define RAGE_EXCEPTION_H - +/** + * @brief Namespace for throwing fatal errors. + * + * The original documentation stated this was a class for some reason. */ namespace RageException { void NORETURN Throw( const char *fmt, ... ) PRINTF(1,2); diff --git a/src/RageFile.cpp b/src/RageFile.cpp index 471e39c34e..e59057a5da 100644 --- a/src/RageFile.cpp +++ b/src/RageFile.cpp @@ -316,6 +316,7 @@ int32_t FileReading::read_32_le( RageFileBasic &f, RString &sError ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the RageFile. */ class LunaRageFile: public Luna { public: @@ -424,7 +425,7 @@ public: }; LUA_REGISTER_CLASS( RageFile ) - +/** @brief Utilities for working with RageFiles. */ namespace RageFileUtil { int CreateRageFile( lua_State *L ) diff --git a/src/RageFile.h b/src/RageFile.h index 013b59eb6c..700f4de36f 100644 --- a/src/RageFile.h +++ b/src/RageFile.h @@ -83,7 +83,7 @@ private: int m_Mode; }; -/* Convenience wrappers for reading binary files. */ +/** @brief Convenience wrappers for reading binary files. */ namespace FileReading { /* On error, these set sError to the error message. If sError is already diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index deaa84bc2c..f1fad415d4 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -1036,6 +1036,7 @@ unsigned int GetHashForDirectory( const RString &sDir ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the RageFileManager. */ class LunaRageFileManager: public Luna { public: diff --git a/src/RageFileManager.h b/src/RageFileManager.h index 2013864719..a8ad652585 100644 --- a/src/RageFileManager.h +++ b/src/RageFileManager.h @@ -1,8 +1,6 @@ -/* RageFileManager - File utilities and high-level manager for RageFile objects. */ - #ifndef RAGE_FILE_MANAGER_H #define RAGE_FILE_MANAGER_H - +/** @brief Constants for working with the RageFileManager. */ namespace RageFileManagerUtil { extern RString sInitialWorkingDirectory; @@ -12,7 +10,7 @@ namespace RageFileManagerUtil class RageFileDriver; class RageFileBasic; struct lua_State; - +/** @brief File utilities and high-level manager for RageFile objects. */ class RageFileManager { public: diff --git a/src/RageFileManager_ReadAhead.h b/src/RageFileManager_ReadAhead.h index a5091ca089..7e42687cc5 100644 --- a/src/RageFileManager_ReadAhead.h +++ b/src/RageFileManager_ReadAhead.h @@ -2,7 +2,7 @@ #define RAGE_FILE_MANAGER_READAHEAD_H #include "RageFileBasic.h" - +/** @brief Utilities for reading the RageFiles. */ namespace RageFileManagerReadAhead { void Init(); diff --git a/src/RageInput.cpp b/src/RageInput.cpp index ed34519072..786cf4aca5 100644 --- a/src/RageInput.cpp +++ b/src/RageInput.cpp @@ -6,7 +6,7 @@ #include "Preference.h" #include "LuaManager.h" -RageInput* INPUTMAN = NULL; // globally accessable input device +RageInput* INPUTMAN = NULL; // globally accessable input device static Preference g_sInputDrivers( "InputDrivers", "" ); // "" == DEFAULT_INPUT_DRIVER_LIST @@ -38,7 +38,7 @@ RageInput::RageInput() RageInput::~RageInput() { - /* Delete optional devices. */ + // Delete optional devices. for( unsigned i = 0; i < m_InputHandlers.size(); ++i ) delete m_InputHandlers[i].m_pDevice; m_InputHandlers.clear(); @@ -55,28 +55,28 @@ void RageInput::LoadDrivers() m_InputHandlers.clear(); g_mapDeviceToHandler.clear(); - /* Init optional devices. */ + // Init optional devices. vector apDevices; InputHandler::Create( g_sInputDrivers, apDevices ); for( unsigned i = 0; i < apDevices.size(); ++i ) AddHandler( apDevices[i] ); - /* If no input devices are loaded, the user won't be able to input anything. */ + // If no input devices are loaded, the user won't be able to input anything. if( apDevices.size() == 0 ) LOG->Warn( "No input devices were loaded." ); } void RageInput::Update() { - /* Update optional devices. */ + // Update optional devices. for( unsigned i = 0; i < m_InputHandlers.size(); ++i ) m_InputHandlers[i].m_pDevice->Update(); } bool RageInput::DevicesChanged() { - /* Update optional devices. */ + // Update optional devices. for( unsigned i = 0; i < m_InputHandlers.size(); ++i ) { if( m_InputHandlers[i].m_pDevice->DevicesChanged() ) @@ -111,7 +111,7 @@ void RageInput::AddHandler( InputHandler *pHandler ) g_mapDeviceToHandler[idi->id] = pHandler; } -/* Return the first InputDriver for the requested InputDevice. */ +/** @brief Return the first InputDriver for the requested InputDevice. */ InputHandler *RageInput::GetHandlerForDevice( const InputDevice id ) { map::iterator it = g_mapDeviceToHandler.find(id); @@ -176,6 +176,7 @@ RString RageInput::GetDisplayDevicesString() const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to RageInput. */ class LunaRageInput: public Luna { public: diff --git a/src/RageInputDevice.cpp b/src/RageInputDevice.cpp index 457840428a..9421dc17b0 100644 --- a/src/RageInputDevice.cpp +++ b/src/RageInputDevice.cpp @@ -14,7 +14,6 @@ static const char *InputDeviceStateNames[] = { }; XToString( InputDeviceState ); - static map g_mapNamesToString; static map g_mapStringToNames; static void InitNames() @@ -127,15 +126,11 @@ static void InitNames() g_mapNamesToString[JOY_AUX_3] = "Aux3"; g_mapNamesToString[JOY_AUX_4] = "Aux4"; - /* g_mapNamesToString[MOUSE_LEFT] = "left mouse button"; g_mapNamesToString[MOUSE_RIGHT] = "right mouse button"; g_mapNamesToString[MOUSE_MIDDLE] = "middle mouse button"; - g_mapNamesToString[MOUSE_FORWARD] = "forward mouse button"; - g_mapNamesToString[MOUSE_BACK] = "back mouse button"; g_mapNamesToString[MOUSE_WHEELUP] = "mousewheel up"; g_mapNamesToString[MOUSE_WHEELDOWN] = "mousewheel down"; - */ FOREACHM( DeviceButton, RString, g_mapNamesToString, m ) g_mapStringToNames[m->second] = m->first; @@ -148,8 +143,7 @@ RString DeviceButtonToString( DeviceButton key ) InitNames(); // All printable ASCII except for uppercase alpha characters line up. - if( key >= 33 && key < 127 && - !(key >= 'A' && key <= 'Z' ) ) + if( key >= 33 && key < 127 && !(key >= 'A' && key <= 'Z' ) ) return ssprintf( "%c", key ); if( key >= KEY_OTHER_0 && key < KEY_LAST_OTHER ) @@ -161,6 +155,9 @@ RString DeviceButtonToString( DeviceButton key ) if( key >= MIDI_FIRST && key <= MIDI_LAST ) return ssprintf( "Midi %d", key-MIDI_FIRST ); + if( key >= MOUSE_LEFT && key <= MOUSE_WHEELDOWN ) + return ssprintf( "Mouse %d", key-MOUSE_LEFT ); + map::const_iterator it = g_mapNamesToString.find( key ); if( it != g_mapNamesToString.end() ) return it->second; @@ -185,6 +182,9 @@ DeviceButton StringToDeviceButton( const RString& s ) if( sscanf(s, "Midi %i", &i) == 1 ) return enum_add2( MIDI_FIRST, i ); + if( sscanf(s, "Mouse %i", &i) == 1 ) + return enum_add2( MOUSE_LEFT, i ); + map::const_iterator it = g_mapStringToNames.find( s ); if( it != g_mapStringToNames.end() ) return it->second; @@ -229,7 +229,7 @@ static const char *InputDeviceNames[] = { "Pump1", "Pump2", "Midi", - //"Mouse", + "Mouse", }; XToString( InputDevice ); StringToX( InputDevice ); diff --git a/src/RageInputDevice.h b/src/RageInputDevice.h index 58e89c2b01..d27e76134b 100644 --- a/src/RageInputDevice.h +++ b/src/RageInputDevice.h @@ -46,16 +46,17 @@ enum InputDevice DEVICE_PUMP1, DEVICE_PUMP2, DEVICE_MIDI, - //DEVICE_MOUSE, + DEVICE_MOUSE, NUM_InputDevice, // leave this at the end - InputDevice_Invalid // means this is NULL + InputDevice_Invalid // means this is NULL }; +/** @brief A special foreach loop for each input device. */ #define FOREACH_InputDevice( i ) FOREACH_ENUM( InputDevice, i ) const RString& InputDeviceToString( InputDevice i ); InputDevice StringToInputDevice( const RString& s ); inline bool IsJoystick( InputDevice id ) { return DEVICE_JOY1 <= id && id < DEVICE_JOY1+NUM_JOYSTICKS; } inline bool IsPump( InputDevice id ) { return DEVICE_PUMP1 <= id && id < DEVICE_PUMP1+NUM_PUMPS; } -//inline bool IsMouse( InputDevice id ) { return id == DEVICE_MOUSE; } +inline bool IsMouse( InputDevice id ) { return id == DEVICE_MOUSE; } struct InputDeviceInfo { @@ -289,16 +290,15 @@ enum DeviceButton MIDI_FIRST = 600, MIDI_LAST = 699, - // Mouse: - /* + // Mouse buttons MOUSE_LEFT = 700, MOUSE_RIGHT, MOUSE_MIDDLE, - // wheel mice + // axis + MOUSE_X_LEFT, MOUSE_X_RIGHT, + MOUSE_Y_UP, MOUSE_Y_DOWN, + // Mouse wheel (z axis) MOUSE_WHEELUP, MOUSE_WHEELDOWN, - // for mice with forward and backwards buttons - MOUSE_FORWARD, MOUSE_BACK, - */ NUM_DeviceButton, DeviceButton_Invalid @@ -321,12 +321,18 @@ public: * debouncing applied. */ bool bDown; + // Mouse coordinates + unsigned x; + unsigned y; + RageTimer ts; DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), bDown(false), ts(RageZeroTimer) { } DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), bDown(l > 0.5f), ts(RageZeroTimer) { } DeviceInput( InputDevice d, DeviceButton b, float l, const RageTimer &t ): device(d), button(b), level(l), bDown(level > 0.5f), ts(t) { } + DeviceInput( InputDevice d, DeviceButton b, const RageTimer &t, unsigned xPos=0, unsigned yPos=0 ): + device(d), button(b), x(xPos), y(yPos), bDown(false), ts(t) { } bool operator==( const DeviceInput &other ) const { @@ -354,7 +360,7 @@ public: void MakeInvalid() { device = InputDevice_Invalid; }; bool IsJoystick() const { return ::IsJoystick(device); } - //bool IsMouse() const { return ::IsMouse(device); } + bool IsMouse() const { return ::IsMouse(device); } }; typedef vector DeviceInputList; diff --git a/src/RageSound.cpp b/src/RageSound.cpp index 456df5275f..fa19d74b6c 100644 --- a/src/RageSound.cpp +++ b/src/RageSound.cpp @@ -647,6 +647,7 @@ void RageSound::SetStopModeFromString( const RString &sStopMode ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the RageSound. */ class LunaRageSound: public Luna { public: diff --git a/src/RageSoundReader_Resample_Good.cpp b/src/RageSoundReader_Resample_Good.cpp index fc0e7ae428..4084641bde 100644 --- a/src/RageSoundReader_Resample_Good.cpp +++ b/src/RageSoundReader_Resample_Good.cpp @@ -396,7 +396,7 @@ int PolyphaseFilter::NumInputsForOutputSamples( const State &State, int iOut, in return iIn; } - +/** @brief Utilities for working with the PolyphaseFilter cache. */ namespace PolyphaseFilterCache { /* Cache filter data, and reuse it without copying. All operations after creation diff --git a/src/RageSoundReader_Resample_Good.h b/src/RageSoundReader_Resample_Good.h index dea56c99d2..c24dc77dcf 100644 --- a/src/RageSoundReader_Resample_Good.h +++ b/src/RageSoundReader_Resample_Good.h @@ -7,7 +7,7 @@ class RageSoundResampler_Polyphase; -/* This class changes the sampling rate of a sound. */ +/** @brief This class changes the sampling rate of a sound. */ class RageSoundReader_Resample_Good: public RageSoundReader_Filter { public: @@ -22,10 +22,14 @@ public: int GetNextSourceFrame() const; float GetStreamToSourceRatio() const; - /* Change the rate of a sound without changing the sample rate. */ + /** + * @brief Change the rate of a sound without changing the sample rate. + * @param fRatio the ratio for changing. */ void SetRate( float fRatio ); - /* SetRate() will be rounded. Get the exact rate. */ + /** + * @brief Retrieve the exact rate. + * @return the exact rate. */ float GetRate() const; int GetSampleRate() const { return m_iSampleRate; } diff --git a/src/RageSoundUtil.h b/src/RageSoundUtil.h index 99153f87eb..d87ad11249 100644 --- a/src/RageSoundUtil.h +++ b/src/RageSoundUtil.h @@ -1,8 +1,6 @@ -/* RageSoundUtil - simple utilities that operate on sound buffers. */ - #ifndef RAGE_SOUND_UTIL_H #define RAGE_SOUND_UTIL_H - +/** @brief Simple utilities that operate on sound buffers. */ namespace RageSoundUtil { void Attenuate( float *pBuf, int iSamples, float fVolume ); diff --git a/src/RageSurfaceUtils.h b/src/RageSurfaceUtils.h index 1ed132c69b..8492be00dc 100644 --- a/src/RageSurfaceUtils.h +++ b/src/RageSurfaceUtils.h @@ -8,6 +8,7 @@ struct RageSurfacePalette; struct RageSurfaceFormat; struct RageSurface; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { uint32_t decodepixel( const uint8_t *p, int bpp ); diff --git a/src/RageSurfaceUtils_Dither.h b/src/RageSurfaceUtils_Dither.h index c72a5cdd29..62a67437d8 100644 --- a/src/RageSurfaceUtils_Dither.h +++ b/src/RageSurfaceUtils_Dither.h @@ -2,6 +2,7 @@ #define RAGE_SURFACE_UTILS_DITHER_H struct RageSurface; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { void OrderedDither(const RageSurface *src, RageSurface *dst); diff --git a/src/RageSurfaceUtils_Palettize.h b/src/RageSurfaceUtils_Palettize.h index 8ea56b1cf8..9a5a86b7d5 100644 --- a/src/RageSurfaceUtils_Palettize.h +++ b/src/RageSurfaceUtils_Palettize.h @@ -4,6 +4,7 @@ #define RAGE_SURFACE_UTILS_PALETTIZE struct RageSurface; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { void Palettize( RageSurface *&pImg, int iColors=256, bool bDither=true ); diff --git a/src/RageSurfaceUtils_Zoom.h b/src/RageSurfaceUtils_Zoom.h index f5378e59cd..01b56fc1f7 100644 --- a/src/RageSurfaceUtils_Zoom.h +++ b/src/RageSurfaceUtils_Zoom.h @@ -2,6 +2,7 @@ #define RAGE_SURFACE_UTILS_ZOOM_H struct RageSurface; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { void Zoom( RageSurface *&src, int width, int height ); diff --git a/src/RageSurface_Load.h b/src/RageSurface_Load.h index 9935695566..04765fccf7 100644 --- a/src/RageSurface_Load.h +++ b/src/RageSurface_Load.h @@ -2,6 +2,7 @@ #define RAGE_SURFACE_LOAD_H struct RageSurface; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { enum OpenResult diff --git a/src/RageSurface_Save_BMP.h b/src/RageSurface_Save_BMP.h index eb928a1eb8..ed5cb58c32 100644 --- a/src/RageSurface_Save_BMP.h +++ b/src/RageSurface_Save_BMP.h @@ -5,6 +5,7 @@ struct RageSurface; class RageFile; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { bool SaveBMP( RageSurface *surface, RageFile &f ); diff --git a/src/RageSurface_Save_JPEG.cpp b/src/RageSurface_Save_JPEG.cpp index 4587ec3c3d..ef1ca8faf2 100644 --- a/src/RageSurface_Save_JPEG.cpp +++ b/src/RageSurface_Save_JPEG.cpp @@ -7,6 +7,7 @@ #include "RageFile.h" #undef FAR /* fix for VC */ +/** @brief A helper to get the jpeg lib. */ namespace jpeg { extern "C" diff --git a/src/RageSurface_Save_JPEG.h b/src/RageSurface_Save_JPEG.h index ebde4ab2f8..b41fbae9ff 100644 --- a/src/RageSurface_Save_JPEG.h +++ b/src/RageSurface_Save_JPEG.h @@ -5,6 +5,7 @@ struct RageSurface; class RageFile; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { bool SaveJPEG( RageSurface *surface, RageFile &f, bool bHighQual=true ); diff --git a/src/RageSurface_Save_PNG.h b/src/RageSurface_Save_PNG.h index 2d7ba4c355..67ae9f74a9 100644 --- a/src/RageSurface_Save_PNG.h +++ b/src/RageSurface_Save_PNG.h @@ -5,6 +5,7 @@ struct RageSurface; class RageFile; +/** @brief Utility functions for the RageSurfaces. */ namespace RageSurfaceUtils { bool SavePNG( RageSurface *pImg, RageFile &f, RString &sError ); diff --git a/src/RageTexture.cpp b/src/RageTexture.cpp index 5d98403747..c1eed7d324 100644 --- a/src/RageTexture.cpp +++ b/src/RageTexture.cpp @@ -68,6 +68,7 @@ const RectF *RageTexture::GetTextureCoordRect( int iFrameNo ) const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the RageTexture. */ class LunaRageTexture: public Luna { public: diff --git a/src/RageTextureRenderTarget.cpp b/src/RageTextureRenderTarget.cpp index 188eaecbde..43881463e9 100644 --- a/src/RageTextureRenderTarget.cpp +++ b/src/RageTextureRenderTarget.cpp @@ -75,6 +75,7 @@ void RageTextureRenderTarget::FinishRenderingTo() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the RageTextureRenderTarget. */ class LunaRageTextureRenderTarget: public Luna { public: diff --git a/src/RageTypes.cpp b/src/RageTypes.cpp index 2b87f0d499..977c17f2ec 100644 --- a/src/RageTypes.cpp +++ b/src/RageTypes.cpp @@ -73,7 +73,7 @@ RString RageColor::NormalizeColorString( RString sColor ) return ""; return c.ToString(); } - +/** @brief Utilities for working with Lua. */ namespace LuaHelpers { template<> bool FromStack( lua_State *L, RageColor &Object, int iOffset ) diff --git a/src/RageUtil.h b/src/RageUtil.h index eb489e50ca..ac9c68f377 100644 --- a/src/RageUtil.h +++ b/src/RageUtil.h @@ -615,6 +615,7 @@ int GetFileSizeInBytes( const RString &sFilePath ); void FixSlashesInPlace( RString &sPath ); void CollapsePath( RString &sPath, bool bRemoveLeadingDot=false ); +/** @brief Utilities for converting the RStrings. */ namespace StringConversion { template diff --git a/src/RageUtil_CachedObject.h b/src/RageUtil_CachedObject.h index 71215d9e9d..a7b1e94180 100644 --- a/src/RageUtil_CachedObject.h +++ b/src/RageUtil_CachedObject.h @@ -1,5 +1,3 @@ -/* CachedObject - cached object pointers with automatic invalidation. */ - #ifndef RAGE_UTIL_CACHED_OBJECT_H #define RAGE_UTIL_CACHED_OBJECT_H @@ -7,13 +5,15 @@ template class CachedObjectPointer; - +/** @brief Utilities for working with the + CachedObjects. */ namespace CachedObjectHelpers { void Lock(); void Unlock(); } +/** @brief Cached object pointers with automatic invalidation. */ template class CachedObject { diff --git a/src/RollingNumbers.cpp b/src/RollingNumbers.cpp index d005b35a72..c211996c56 100644 --- a/src/RollingNumbers.cpp +++ b/src/RollingNumbers.cpp @@ -5,7 +5,7 @@ #include "ActorUtil.h" #include "LuaManager.h" #include "ThemeManager.h" -REGISTER_ACTOR_CLASS( RollingNumbers ) +REGISTER_ACTOR_CLASS( RollingNumbers ); RollingNumbers::RollingNumbers() { @@ -99,6 +99,7 @@ void RollingNumbers::UpdateText() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the RollingNumbers. */ class LunaRollingNumbers: public Luna { public: diff --git a/src/RollingNumbers.h b/src/RollingNumbers.h index 62f8c88226..954ed3cb14 100644 --- a/src/RollingNumbers.h +++ b/src/RollingNumbers.h @@ -1,4 +1,4 @@ -/* RollingNumbers - animates from one number to another by scrolling its digits. */ +/** @brief RollingNumbers - animates from one number to another by scrolling its digits. */ #ifndef RollingNumbers_H #define RollingNumbers_H @@ -17,6 +17,9 @@ public: virtual void DrawPrimitives(); virtual void Update( float fDeltaTime ); + /** + * @brief Set the new target number to be reached. + * @param fTargetNumber the new target number. */ void SetTargetNumber( float fTargetNumber ); void UpdateText(); @@ -30,15 +33,20 @@ private: ThemeMetric COMMIFY; ThemeMetric LEADING_ZERO_MULTIPLY_COLOR; - float m_fCurrentNumber; // currently showing this - float m_fTargetNumber; // approach this - float m_fScoreVelocity; // approach target at this speed + /** @brief The currently showing number. */ + float m_fCurrentNumber; + /** @brief The number we are trying to approach. */ + float m_fTargetNumber; + /** @brief The speed we are trying to reach the target number. */ + float m_fScoreVelocity; }; #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/RoomInfoDisplay.cpp b/src/RoomInfoDisplay.cpp index b86f3b33e2..0a2bc9b977 100644 --- a/src/RoomInfoDisplay.cpp +++ b/src/RoomInfoDisplay.cpp @@ -5,8 +5,8 @@ #include "NetworkSyncManager.h" #include "LocalizedString.h" -AutoScreenMessage( SM_RoomInfoRetract ) -AutoScreenMessage( SM_RoomInfoDeploy ) +AutoScreenMessage( SM_RoomInfoRetract ); +AutoScreenMessage( SM_RoomInfoDeploy ); static LocalizedString LAST_ROUND_INFO ( "RoomInfoDisplay", "Last Round Info:" ); static LocalizedString ROOM_NAME ( "RoomInfoDisplay", "Room Name:" ); diff --git a/src/RoomWheel.cpp b/src/RoomWheel.cpp index 77d9087676..9013068fbd 100644 --- a/src/RoomWheel.cpp +++ b/src/RoomWheel.cpp @@ -8,9 +8,9 @@ #include "ScreenManager.h" #include "ActorUtil.h" -AutoScreenMessage( SM_BackFromRoomName ) -AutoScreenMessage( SM_RoomInfoRetract ) -AutoScreenMessage( SM_RoomInfoDeploy ) +AutoScreenMessage( SM_BackFromRoomName ); +AutoScreenMessage( SM_RoomInfoRetract ); +AutoScreenMessage( SM_RoomInfoDeploy ); RoomWheel::~RoomWheel() { diff --git a/src/ScoreDisplayAliveTime.cpp b/src/ScoreDisplayAliveTime.cpp index 8a6b9e43ba..0f58b4b992 100644 --- a/src/ScoreDisplayAliveTime.cpp +++ b/src/ScoreDisplayAliveTime.cpp @@ -9,7 +9,7 @@ #include "LuaManager.h" #include "RageLog.h" -REGISTER_ACTOR_CLASS( ScoreDisplayAliveTime ) +REGISTER_ACTOR_CLASS( ScoreDisplayAliveTime ); ScoreDisplayAliveTime::ScoreDisplayAliveTime() @@ -68,6 +68,7 @@ void ScoreDisplayAliveTime::UpdateNumber() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScoreDisplayAliveTime. */ class LunaScoreDisplayAliveTime: public Luna { public: diff --git a/src/ScoreDisplayAliveTime.h b/src/ScoreDisplayAliveTime.h index dc3cf8e91d..554873fa4f 100644 --- a/src/ScoreDisplayAliveTime.h +++ b/src/ScoreDisplayAliveTime.h @@ -1,13 +1,14 @@ -/* ScoreDisplayAliveTime - Display a constantly updating figure of time the player is alive. */ -// TODO: Merge this with ScoreDisplayOni - #ifndef ScoreDisplayAliveTime_H #define ScoreDisplayAliveTime_H #include "BitmapText.h" #include "PlayerNumber.h" - +/** + * @brief Display a constantly updating figure of time the player is alive. + * + * TODO: Merge this with ScoreDisplayOni + */ class ScoreDisplayAliveTime : public BitmapText { public: diff --git a/src/ScoreDisplayBattle.h b/src/ScoreDisplayBattle.h index c100c93af6..2813e788bf 100644 --- a/src/ScoreDisplayBattle.h +++ b/src/ScoreDisplayBattle.h @@ -1,5 +1,3 @@ -/* ScoreDisplayRave - ScoreDisplay implementation for PLAY_MODE_BATTLE. */ - #ifndef SCORE_DISPLAY_BATTLE_H #define SCORE_DISPLAY_BATTLE_H @@ -8,7 +6,7 @@ #include "Sprite.h" #include "RageTexturePreloader.h" - +/** @brief ScoreDisplay implementation for PLAY_MODE_BATTLE. */ class ScoreDisplayBattle : public ScoreDisplay { public: diff --git a/src/ScoreDisplayCalories.cpp b/src/ScoreDisplayCalories.cpp index 0eb4681379..956e289eb9 100644 --- a/src/ScoreDisplayCalories.cpp +++ b/src/ScoreDisplayCalories.cpp @@ -10,7 +10,7 @@ #include "StatsManager.h" #include "LuaManager.h" -REGISTER_ACTOR_CLASS( ScoreDisplayCalories ) +REGISTER_ACTOR_CLASS( ScoreDisplayCalories ); ScoreDisplayCalories::ScoreDisplayCalories() { @@ -72,6 +72,7 @@ void ScoreDisplayCalories::UpdateNumber() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScoreDisplayCalories. */ class LunaScoreDisplayCalories: public Luna { public: diff --git a/src/ScoreDisplayCalories.h b/src/ScoreDisplayCalories.h index 1c5eae9c2b..938b5dddde 100644 --- a/src/ScoreDisplayCalories.h +++ b/src/ScoreDisplayCalories.h @@ -1,12 +1,10 @@ -/* ScoreDisplayCalories - Shows calorie score during gameplay and some menus. */ - #ifndef ScoreDisplayCalories_H #define ScoreDisplayCalories_H #include "RollingNumbers.h" #include "PlayerNumber.h" - +/** @brief Shows calorie score during gameplay and some menus. */ class ScoreDisplayCalories : public RollingNumbers { public: diff --git a/src/ScoreDisplayLifeTime.h b/src/ScoreDisplayLifeTime.h index e9bd02500e..15e3c228a1 100644 --- a/src/ScoreDisplayLifeTime.h +++ b/src/ScoreDisplayLifeTime.h @@ -1,5 +1,3 @@ -/* ScoreDisplayLifeTime - Display a updating count of life time remaining. */ - #ifndef ScoreDisplayLifeTime_H #define ScoreDisplayLifeTime_H @@ -7,6 +5,10 @@ #include "BitmapText.h" #include "AutoActor.h" +/** + * @brief Display a updating count of life time remaining. + * + * This is mainly used for Survival mode. */ class ScoreDisplayLifeTime : public ScoreDisplay { public: diff --git a/src/ScoreDisplayNormal.cpp b/src/ScoreDisplayNormal.cpp index a078425e7d..69c159d924 100644 --- a/src/ScoreDisplayNormal.cpp +++ b/src/ScoreDisplayNormal.cpp @@ -9,7 +9,6 @@ #include "CommonMetrics.h" #include "ActorUtil.h" - ScoreDisplayNormal::ScoreDisplayNormal() { LOG->Trace( "ScoreDisplayNormal::ScoreDisplayNormal()" ); @@ -21,7 +20,6 @@ ScoreDisplayNormal::ScoreDisplayNormal() ActorUtil::LoadAllCommandsAndSetXY( m_sprFrame, sType ); this->AddChild( m_sprFrame ); - // init the text m_text.LoadFromFont( THEME->GetPathF("ScoreDisplayNormal","Text") ); m_text.Load( "RollingNumbers" ); diff --git a/src/ScoreDisplayNormal.h b/src/ScoreDisplayNormal.h index efc2fbddf5..072557445f 100644 --- a/src/ScoreDisplayNormal.h +++ b/src/ScoreDisplayNormal.h @@ -1,5 +1,3 @@ -/* ScoreDisplayNormal - Shows point score during gameplay and some menus. */ - #ifndef SCORE_DISPLAY_NORMAL_H #define SCORE_DISPLAY_NORMAL_H @@ -7,6 +5,7 @@ #include "RollingNumbers.h" #include "AutoActor.h" +/** @brief Shows point score during gameplay and some menus. */ class ScoreDisplayNormal : public ScoreDisplay { public: diff --git a/src/ScoreDisplayOni.h b/src/ScoreDisplayOni.h index d461a4f417..5ae4c71da2 100644 --- a/src/ScoreDisplayOni.h +++ b/src/ScoreDisplayOni.h @@ -1,5 +1,3 @@ -/* ScoreDisplayOni - Shows time into course. */ - #ifndef SCORE_DISPLAY_ONI_H #define SCORE_DISPLAY_ONI_H @@ -7,6 +5,7 @@ #include "BitmapText.h" #include "Sprite.h" +/** @brief Shows time into course. */ class ScoreDisplayOni : public ScoreDisplay { public: diff --git a/src/ScoreDisplayPercentage.cpp b/src/ScoreDisplayPercentage.cpp index 4743aaf4f8..954e229950 100644 --- a/src/ScoreDisplayPercentage.cpp +++ b/src/ScoreDisplayPercentage.cpp @@ -7,6 +7,7 @@ ScoreDisplayPercentage::ScoreDisplayPercentage() { + // todo: allow ScoreDisplayPercentage to have its own frame? -aj m_sprFrame.Load( THEME->GetPathG("ScoreDisplayNormal","frame") ); this->AddChild( m_sprFrame ); @@ -18,11 +19,8 @@ void ScoreDisplayPercentage::Init( const PlayerState* pPlayerState, const Player { ScoreDisplay::Init( pPlayerState, pPlayerStageStats ); - m_Percent.Load( - pPlayerState, - pPlayerStageStats, - "ScoreDisplayPercentage Percent", - true ); + m_Percent.Load( pPlayerState, pPlayerStageStats, + "ScoreDisplayPercentage Percent", true ); } /* diff --git a/src/ScoreDisplayPercentage.h b/src/ScoreDisplayPercentage.h index d7830eb2b1..86b49180fd 100644 --- a/src/ScoreDisplayPercentage.h +++ b/src/ScoreDisplayPercentage.h @@ -1,5 +1,3 @@ -/* ScoreDisplayPercentage - ScoreDisplay implementation for a percentage display. */ - #ifndef SCORE_DISPLAY_PERCENTAGE_H #define SCORE_DISPLAY_PERCENTAGE_H @@ -7,6 +5,7 @@ #include "PercentageDisplay.h" #include "AutoActor.h" +/** @brief ScoreDisplay implementation for a percentage display. */ class ScoreDisplayPercentage: public ScoreDisplay { public: diff --git a/src/ScoreDisplayRave.h b/src/ScoreDisplayRave.h index 84577c10f5..dc0b79238e 100644 --- a/src/ScoreDisplayRave.h +++ b/src/ScoreDisplayRave.h @@ -1,5 +1,3 @@ -/* ScoreDisplayRave - ScoreDisplay implementation for PLAY_MODE_RAVE. */ - #ifndef SCORE_DISPLAY_RAVE_H #define SCORE_DISPLAY_RAVE_H @@ -9,7 +7,7 @@ #include "BitmapText.h" #include "AutoActor.h" - +/** @brief ScoreDisplay implementation for PLAY_MODE_RAVE. */ class ScoreDisplayRave : public ScoreDisplay { public: diff --git a/src/ScoreKeeper.h b/src/ScoreKeeper.h index 3accf2e6fa..2cb1804db4 100644 --- a/src/ScoreKeeper.h +++ b/src/ScoreKeeper.h @@ -1,16 +1,6 @@ -/** @brief ScoreKeeper - Abstract class to handle scorekeeping, stat-taking, etc. */ - #ifndef SCORE_KEEPER_H #define SCORE_KEEPER_H -/* - * Stat handling is in here because that can differ between games, too; for - * example, some games count double taps as a single note in scoring and - * some count per-tap. - * - * Results are injected directly into the PlayerStageStats. - */ - #include "GameConstantsAndTypes.h" class NoteData; @@ -22,6 +12,12 @@ class PlayerStageStats; struct TapNote; struct AttackArray; +/** + * @brief Abstract class to handle scorekeeping, stat-taking, etc. + * + * Stat handling is in here because that can differ between games, too; for + * example, some games count double taps as a single note in scoring and some + * count per-tap. Results are injected directly into the PlayerStageStats. */ class ScoreKeeper { public: @@ -31,7 +27,7 @@ protected: PlayerState *m_pPlayerState; PlayerStageStats *m_pPlayerStageStats; - /* Common toggles that this class handles directly: */ + // Common toggles that this class handles directly: /* If true, doubles count as 2+ in stat counts; if false, doubles count as * only one. */ /* (not yet) */ @@ -48,7 +44,7 @@ public: virtual void DrawPrimitives() { } virtual void Update( float fDelta ) { } - /* Note that pNoteData will include any transformations due to modifiers. */ + // Note that pNoteData will include any transformations due to modifiers. virtual void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData ) { }; // before a song plays (called multiple times if course) // HandleTap* is called before HandleTapRow* diff --git a/src/ScoreKeeperGuitar.h b/src/ScoreKeeperGuitar.h index 49eac216a5..0a7d4813e8 100644 --- a/src/ScoreKeeperGuitar.h +++ b/src/ScoreKeeperGuitar.h @@ -1,11 +1,9 @@ -/* ScoreKeeperGuitar - */ - #ifndef ScoreKeeperGuitar_H #define ScoreKeeperGuitar_H #include "ScoreKeeperNormal.h" - +/** @brief ScoreKeeper implementation for the guitar gametype. */ class ScoreKeeperGuitar : public ScoreKeeperNormal { public: @@ -15,7 +13,8 @@ public: void HandleHoldActiveSeconds( float fMusicSecondsHeld ); virtual void AddTapRowScore( TapNoteScore score, const NoteData &nd, int iRow ); protected: - float m_fMusicSecondsHeldRemainder; // seconds from a hold note that have not yet been counted toward CurScore + /** @brief seconds from a hold note that have not yet been counted toward CurScore. */ + float m_fMusicSecondsHeldRemainder; }; #endif diff --git a/src/ScoreKeeperNormal.h b/src/ScoreKeeperNormal.h index 32c2efa82c..902ab38f12 100644 --- a/src/ScoreKeeperNormal.h +++ b/src/ScoreKeeperNormal.h @@ -13,6 +13,7 @@ struct RadarValues; AutoScreenMessage( SM_PlayToasty ); +/** @brief The default ScoreKeeper implementation. */ class ScoreKeeperNormal: public ScoreKeeper { void AddScoreInternal( TapNoteScore score ); diff --git a/src/ScoreKeeperRave.h b/src/ScoreKeeperRave.h index 90db5ecc35..ac0f3fc5f9 100644 --- a/src/ScoreKeeperRave.h +++ b/src/ScoreKeeperRave.h @@ -1,12 +1,10 @@ -/* ScoreKeeperRave - Launches attacks in PLAY_MODE_RAVE. */ - #ifndef SCORE_KEEPER_RAVE_H #define SCORE_KEEPER_RAVE_H #include "ScoreKeeper.h" #include "GameConstantsAndTypes.h" - +/** @brief Launches attacks in PLAY_MODE_RAVE. */ class ScoreKeeperRave : public ScoreKeeper { public: diff --git a/src/ScoreKeeperShared.h b/src/ScoreKeeperShared.h index f34fb19874..6295513a0a 100644 --- a/src/ScoreKeeperShared.h +++ b/src/ScoreKeeperShared.h @@ -4,6 +4,7 @@ #include "ScoreKeeperNormal.h" #include "PlayerNumber.h" +/** @brief ScoreKeeper for Routine mode. */ class ScoreKeeperShared : public ScoreKeeperNormal { public: diff --git a/src/Screen.cpp b/src/Screen.cpp index 2993e684d0..e9d38f9efc 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -195,24 +195,37 @@ void Screen::Input( const InputEventPlus &input ) return; // don't care } + // Always broadcast clicks -aj + if( input.DeviceI == DeviceInput( DEVICE_MOUSE, MOUSE_LEFT ) ) + MESSAGEMAN->Broadcast( (MessageID)(Message_LeftClick) ); + if( input.DeviceI == DeviceInput( DEVICE_MOUSE, MOUSE_RIGHT ) ) + MESSAGEMAN->Broadcast( (MessageID)(Message_RightClick) ); + if( input.DeviceI == DeviceInput( DEVICE_MOUSE, MOUSE_MIDDLE ) ) + MESSAGEMAN->Broadcast( (MessageID)(Message_MiddleClick) ); + // Can't do MouseWheelUp and MouseWheelDown at the same time. -aj + if( input.DeviceI == DeviceInput( DEVICE_MOUSE, MOUSE_WHEELUP ) ) + MESSAGEMAN->Broadcast( (MessageID)(Message_MouseWheelUp) ); + else if( input.DeviceI == DeviceInput( DEVICE_MOUSE, MOUSE_WHEELDOWN ) ) + MESSAGEMAN->Broadcast( (MessageID)(Message_MouseWheelDown) ); + // default input handler used by most menus switch( input.MenuI ) { - case GAME_BUTTON_MENUUP: this->MenuUp ( input ); return; - case GAME_BUTTON_MENUDOWN: this->MenuDown ( input ); return; - case GAME_BUTTON_MENULEFT: this->MenuLeft ( input ); return; - case GAME_BUTTON_MENURIGHT: this->MenuRight ( input ); return; - case GAME_BUTTON_BACK: - // Don't make the user hold the back button if they're pressing escape and escape is the back button. - if( !PREFSMAN->m_bDelayedBack || input.type==IET_REPEAT || (input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_ESC) ) - { - if( HANDLE_BACK_BUTTON ) - this->MenuBack( input ); - } - return; - case GAME_BUTTON_START: this->MenuStart ( input ); return; - case GAME_BUTTON_SELECT:this->MenuSelect( input ); return; - case GAME_BUTTON_COIN: this->MenuCoin ( input ); return; + case GAME_BUTTON_MENUUP: this->MenuUp ( input ); return; + case GAME_BUTTON_MENUDOWN: this->MenuDown ( input ); return; + case GAME_BUTTON_MENULEFT: this->MenuLeft ( input ); return; + case GAME_BUTTON_MENURIGHT: this->MenuRight ( input ); return; + case GAME_BUTTON_BACK: + // Don't make the user hold the back button if they're pressing escape and escape is the back button. + if( !PREFSMAN->m_bDelayedBack || input.type==IET_REPEAT || (input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_ESC) ) + { + if( HANDLE_BACK_BUTTON ) + this->MenuBack( input ); + } + return; + case GAME_BUTTON_START: this->MenuStart ( input ); return; + case GAME_BUTTON_SELECT:this->MenuSelect( input ); return; + case GAME_BUTTON_COIN: this->MenuCoin ( input ); return; } } @@ -279,6 +292,7 @@ void Screen::ClearMessageQueue( const ScreenMessage SM ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Screen. */ class LunaScreen: public Luna { public: diff --git a/src/Screen.h b/src/Screen.h index 837d4114c5..8b87e3afe8 100644 --- a/src/Screen.h +++ b/src/Screen.h @@ -1,5 +1,3 @@ -/* Screen - Class that holds a screen-full of Actors. */ - #ifndef SCREEN_H #define SCREEN_H @@ -16,24 +14,30 @@ class InputEventPlus; class Screen; typedef Screen* (*CreateScreenFn)(const RString& sClassName); -// Each Screen class should have a REGISTER_SCREEN_CLASS in its CPP file. +/** + * @brief Allow registering the screen for easier access. + * + * Each Screen class should have a REGISTER_SCREEN_CLASS in its CPP file. + */ struct RegisterScreenClass { RegisterScreenClass( const RString &sClassName, CreateScreenFn pfn ); }; #define REGISTER_SCREEN_CLASS( className ) \ static Screen* Create##className( const RString &sName ) { LuaThreadVariable var( "LoadingScreen", sName ); Screen *pRet = new className; pRet->SetName( sName ); Screen::InitScreen( pRet ); return pRet; } \ static RegisterScreenClass register_##className( #className, Create##className ) +/** @brief The different types of screens available. */ enum ScreenType { - attract, - game_menu, - gameplay, - system_menu, - NUM_ScreenType, + attract, /**< The attract/demo mode, inviting players to play. */ + game_menu, /**< The menu screens, where options can be set before playing. */ + gameplay, /**< The gameplay screen, where the actual game takes place. */ + system_menu, /**< The system/operator menu, where special options are set. */ + NUM_ScreenType, /**< The number of screen types. */ ScreenType_Invalid }; const RString& ScreenTypeToString( ScreenType st ); LuaDeclareType( ScreenType ); +/** @brief Class that holds a screen-full of Actors. */ class Screen : public ActorFrame { public: @@ -41,14 +45,17 @@ public: virtual ~Screen(); - /* This is called immediately after construction, to allow initializing after all - * derived classes exist. (Don't call it directly; use InitScreen.) */ + /** + * @brief This is called immediately after construction, + * to allow initializing after all derived classes exist. + * + * Don't call it directly; use InitScreen instead. */ virtual void Init(); - // This is called immediately before the screen is used. + /** @brief This is called immediately before the screen is used. */ virtual void BeginScreen(); - // This is called when the screen is popped. + /** @brief This is called when the screen is popped. */ virtual void EndScreen(); virtual void Update( float fDeltaTime ); @@ -57,35 +64,54 @@ public: virtual void HandleScreenMessage( const ScreenMessage SM ); void SetLockInputSecs( float f ) { m_fLockInputSecs = f; } + /** + * @brief Put the specified message onto the screen for a specified time. + * @param SM the message to put on the screen. + * @param fDelay The length of time it stays up. */ void PostScreenMessage( const ScreenMessage SM, float fDelay ); + /** @brief Clear the entire message queue. */ void ClearMessageQueue(); - void ClearMessageQueue( const ScreenMessage SM ); // clear of a specific SM + /** + * @brief Clear the message queue of a specific ScreenMessage. + * @param SM the specific ScreenMessage to get out of the Queue. */ + void ClearMessageQueue( const ScreenMessage SM ); virtual ScreenType GetScreenType() const { return ALLOW_OPERATOR_MENU_BUTTON ? game_menu : system_menu; } bool AllowOperatorMenuButton() const { return ALLOW_OPERATOR_MENU_BUTTON; } + /** + * @brief Determine if we allow extra players to join in on this screen. + * @return false, for players should never be able to join while in progress. */ virtual bool AllowLateJoin() const { return false; } // Lua virtual void PushSelf( lua_State *L ); protected: - // structure for holding messages sent to a Screen + /** @brief Holds the messages sent to a Screen. */ struct QueuedScreenMessage { + /** @brief The message being held. */ ScreenMessage SM; + /** @brief How long the message is up. */ float fDelayRemaining; }; + /** @brief The list of messages that are sent to a Screen. */ vector m_QueuedMessages; static bool SortMessagesByDelayRemaining(const QueuedScreenMessage &m1, const QueuedScreenMessage &m2); InputQueueCodeSet m_Codes; + /** @brief Do we allow the operator menu button to be pressed here? */ ThemeMetric ALLOW_OPERATOR_MENU_BUTTON; + /** @brief Do we handle the back button being pressed here? */ ThemeMetric HANDLE_BACK_BUTTON; ThemeMetric REPEAT_RATE; ThemeMetric REPEAT_DELAY; ThemeMetric LIGHTS_MODE; - // If left blank, the NextScreen metric will be used. + /** + * @brief The next screen to go to once this screen is done. + * + * If this is blank, the NextScreen metric will be used. */ RString m_sNextScreen; RString m_sPrevScreen; ScreenMessage m_smSendOnPop; @@ -112,8 +138,10 @@ public: #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenAttract.cpp b/src/ScreenAttract.cpp index cd65b9bc3f..6cab04ab6d 100644 --- a/src/ScreenAttract.cpp +++ b/src/ScreenAttract.cpp @@ -165,6 +165,7 @@ void ScreenAttract::GoToStartScreen( RString sScreenName ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenAttract. */ class LunaScreenAttract: public Luna { public: diff --git a/src/ScreenAttract.h b/src/ScreenAttract.h index 68a2837836..a4494b3d7f 100644 --- a/src/ScreenAttract.h +++ b/src/ScreenAttract.h @@ -5,7 +5,7 @@ #include "ScreenWithMenuElements.h" -AutoScreenMessage( SM_GoToStartScreen ) +AutoScreenMessage( SM_GoToStartScreen ); class ScreenAttract : public ScreenWithMenuElements { diff --git a/src/ScreenDebugOverlay.cpp b/src/ScreenDebugOverlay.cpp index 972ff0747d..f4610870d6 100644 --- a/src/ScreenDebugOverlay.cpp +++ b/src/ScreenDebugOverlay.cpp @@ -163,7 +163,7 @@ static LocalizedString DEBUG_MENU( "ScreenDebugOverlay", "Debug Menu" ); void ScreenDebugOverlay::Init() { Screen::Init(); - + // Init debug mappings // TODO: Arch-specific? { @@ -539,7 +539,6 @@ void ChangeVisualDelay( float fDelta ) pRet->Set( fSecs ); } - // DebugLines static LocalizedString AUTO_PLAY ( "ScreenDebugOverlay", "AutoPlay" ); static LocalizedString ASSIST ( "ScreenDebugOverlay", "Assist" ); @@ -579,7 +578,6 @@ static LocalizedString SONG ( "ScreenDebugOverlay", "Song" ); static LocalizedString MACHINE ( "ScreenDebugOverlay", "Machine" ); static LocalizedString SYNC_TEMPO ( "ScreenDebugOverlay", "Tempo" ); - class DebugLineAutoplay : public IDebugLine { virtual RString GetDisplayTitle() { return AUTO_PLAY.GetValue() + " (+Shift = AI) (+Alt = hide)"; } diff --git a/src/ScreenDimensions.h b/src/ScreenDimensions.h index 5d7dcba3c9..d463acf087 100644 --- a/src/ScreenDimensions.h +++ b/src/ScreenDimensions.h @@ -1,4 +1,4 @@ -/* ScreenDimensions - defines for screen resolutions. */ +/** @brief ScreenDimensions - defines for screen resolutions. */ #ifndef SCREEN_DIMENSIONS_H #define SCREEN_DIMENSIONS_H @@ -27,12 +27,20 @@ namespace ScreenDimensions #define FullScreenRectF RectF(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) +/** + * @brief The size of the arrows. + * + * This is referenced in ArrowEffects, GameManager, NoteField, and SnapDisplay. + * XXX: doesn't always have to be 64. -aj + */ #define ARROW_SIZE (64) #endif -/* - * (c) 2001-2002 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2002 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index f2e2594e6c..2ca5d26235 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -542,6 +542,7 @@ static MenuDef g_StepsInformation( // xxx: this giant list of numbers SUUUUUUUUUUCKS -aj MenuRowDef( ScreenEdit::meter, "Meter", true, EditMode_Practice, true, false, 0, "1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25" ), MenuRowDef( ScreenEdit::description, "Description", true, EditMode_Practice, true, true, 0, NULL ), + MenuRowDef( ScreenEdit::chartstyle, "Chart Style", true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef( ScreenEdit::step_credit, "Step Author", true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef( ScreenEdit::predict_meter, "Predicted Meter", false, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::tap_notes, "Tap Steps", false, EditMode_Full, true, true, 0, NULL ), @@ -1015,7 +1016,9 @@ static LocalizedString SNAP_TO("ScreenEdit", "Snap to"); static LocalizedString NOTES("ScreenEdit", "%s notes"); static LocalizedString SELECTION_BEAT("ScreenEdit", "Selection beat"); static LocalizedString DIFFICULTY("ScreenEdit", "Difficulty"); +static LocalizedString ROUTINE_PLAYER("ScreenEdit", "Routine Player"); static LocalizedString DESCRIPTION("ScreenEdit", "Description"); +static LocalizedString CHART_STYLE("ScreenEdit", "Chart Style"); static LocalizedString MAIN_TITLE("ScreenEdit", "Main title"); static LocalizedString SUBTITLE("ScreenEdit", "Subtitle"); static LocalizedString TAP_STEPS("ScreenEdit", "Tap Steps"); @@ -1027,6 +1030,28 @@ static LocalizedString ROLLS("ScreenEdit", "Rolls"); static LocalizedString BEAT_0_OFFSET("ScreenEdit", "Beat 0 offset"); static LocalizedString PREVIEW_START("ScreenEdit", "Preview Start"); static LocalizedString PREVIEW_LENGTH("ScreenEdit", "Preview Length"); + +static ThemeMetric CURRENT_BEAT_FORMAT("ScreenEdit", "CurrentBeatFormat"); +static ThemeMetric CURRENT_SECOND_FORMAT("ScreenEdit", "CurrentSecondFormat"); +static ThemeMetric SNAP_TO_FORMAT("ScreenEdit", "SnapToFormat"); +static ThemeMetric SELECTION_BEAT_BEGIN_FORMAT("ScreenEdit", "SelectionBeatBeginFormat"); +static ThemeMetric SELECTION_BEAT_UNFINISHED_FORMAT("ScreenEdit", "SelectionBeatUnfinishedFormat"); +static ThemeMetric SELECTION_BEAT_END_FORMAT("ScreenEdit", "SelectionBeatEndFormat"); +static ThemeMetric DIFFICULTY_FORMAT("ScreenEdit", "DifficultyFormat"); +static ThemeMetric ROUTINE_PLAYER_FORMAT("ScreenEdit", "RoutinePlayerFormat"); +static ThemeMetric DESCRIPTION_FORMAT("ScreenEdit", "DescriptionFormat"); +static ThemeMetric CHART_STYLE_FORMAT("ScreenEdit", "ChartStyleFormat"); +static ThemeMetric MAIN_TITLE_FORMAT("ScreenEdit", "MainTitleFormat"); +static ThemeMetric SUBTITLE_FORMAT("ScreenEdit", "SubtitleFormat"); +static ThemeMetric NUM_STEPS_FORMAT("ScreenEdit", "NumStepsFormat"); +static ThemeMetric NUM_JUMPS_FORMAT("ScreenEdit", "NumJumpsFormat"); +static ThemeMetric NUM_HOLDS_FORMAT("ScreenEdit", "NumHoldsFormat"); +static ThemeMetric NUM_MINES_FORMAT("ScreenEdit", "NumMinesFormat"); +static ThemeMetric NUM_HANDS_FORMAT("ScreenEdit", "NumHandsFormat"); +static ThemeMetric NUM_ROLLS_FORMAT("ScreenEdit", "NumRollsFormat"); +static ThemeMetric BEAT_0_OFFSET_FORMAT("ScreenEdit", "Beat0OffsetFormat"); +static ThemeMetric PREVIEW_START_FORMAT("ScreenEdit", "PreviewStartFormat"); +static ThemeMetric PREVIEW_LENGTH_FORMAT("ScreenEdit", "PreviewLengthFormat"); void ScreenEdit::UpdateTextInfo() { if( m_pSteps == NULL ) @@ -1044,8 +1069,8 @@ void ScreenEdit::UpdateTextInfo() RString sNoteType = ssprintf( NOTES.GetValue(), NoteTypeToLocalizedString(m_SnapDisplay.GetNoteType()).c_str() ); RString sText; - sText += ssprintf( "%s:\n %.5f\n", CURRENT_BEAT.GetValue().c_str(), GAMESTATE->m_fSongBeat ); - sText += ssprintf( "%s:\n %.5f\n", CURRENT_SECOND.GetValue().c_str(), m_pSong->GetElapsedTimeFromBeat(GAMESTATE->m_fSongBeat) ); + sText += ssprintf( CURRENT_BEAT_FORMAT.GetValue(), CURRENT_BEAT.GetValue().c_str(), GAMESTATE->m_fSongBeat ); + sText += ssprintf( CURRENT_SECOND_FORMAT.GetValue(), CURRENT_SECOND.GetValue().c_str(), m_pSong->GetElapsedTimeFromBeat(GAMESTATE->m_fSongBeat) ); switch( EDIT_MODE.GetValue() ) { DEFAULT_FAIL( EDIT_MODE.GetValue() ); @@ -1054,18 +1079,18 @@ void ScreenEdit::UpdateTextInfo() case EditMode_CourseMods: case EditMode_Home: case EditMode_Full: - sText += ssprintf( "%s:\n %s\n", SNAP_TO.GetValue().c_str(), sNoteType.c_str() ); + sText += ssprintf( SNAP_TO_FORMAT.GetValue(), SNAP_TO.GetValue().c_str(), sNoteType.c_str() ); break; } if( m_NoteFieldEdit.m_iBeginMarker != -1 ) { - sText += ssprintf( "%s:\n %.5f", SELECTION_BEAT.GetValue().c_str(), NoteRowToBeat(m_NoteFieldEdit.m_iBeginMarker) ); + sText += ssprintf( SELECTION_BEAT_BEGIN_FORMAT.GetValue(), SELECTION_BEAT.GetValue().c_str(), NoteRowToBeat(m_NoteFieldEdit.m_iBeginMarker) ); if( m_NoteFieldEdit.m_iEndMarker != -1 ) - sText += ssprintf( "-%.5f\n", NoteRowToBeat(m_NoteFieldEdit.m_iEndMarker) ); + sText += ssprintf( SELECTION_BEAT_END_FORMAT.GetValue(), NoteRowToBeat(m_NoteFieldEdit.m_iEndMarker) ); else - sText += " ...\n"; + sText += SELECTION_BEAT_UNFINISHED_FORMAT; } switch( EDIT_MODE.GetValue() ) @@ -1076,19 +1101,22 @@ void ScreenEdit::UpdateTextInfo() case EditMode_Home: break; case EditMode_Full: - sText += ssprintf( "%s:\n %s\n", DIFFICULTY.GetValue().c_str(), DifficultyToString( m_pSteps->GetDifficulty() ).c_str() ); - sText += ssprintf( "%s:\n %s\n", DESCRIPTION.GetValue().c_str(), m_pSteps->GetDescription().c_str() ); - sText += ssprintf( "%s:\n %s\n", MAIN_TITLE.GetValue().c_str(), m_pSong->m_sMainTitle.c_str() ); + sText += ssprintf( DIFFICULTY_FORMAT.GetValue(), DIFFICULTY.GetValue().c_str(), DifficultyToString( m_pSteps->GetDifficulty() ).c_str() ); + if ( m_InputPlayerNumber != PLAYER_INVALID ) + sText += ssprintf( ROUTINE_PLAYER_FORMAT.GetValue(), ROUTINE_PLAYER.GetValue().c_str(), m_InputPlayerNumber + 1 ); + sText += ssprintf( DESCRIPTION_FORMAT.GetValue(), DESCRIPTION.GetValue().c_str(), m_pSteps->GetDescription().c_str() ); + sText += ssprintf( CHART_STYLE_FORMAT.GetValue(), CHART_STYLE.GetValue().c_str(), m_pSteps->GetChartStyle().c_str() ); + sText += ssprintf( MAIN_TITLE_FORMAT.GetValue(), MAIN_TITLE.GetValue().c_str(), m_pSong->m_sMainTitle.c_str() ); if( m_pSong->m_sSubTitle.size() ) - sText += ssprintf( "%s:\n %s\n", SUBTITLE.GetValue().c_str(), m_pSong->m_sSubTitle.c_str() ); + sText += ssprintf( SUBTITLE_FORMAT.GetValue(), SUBTITLE.GetValue().c_str(), m_pSong->m_sSubTitle.c_str() ); break; } - sText += ssprintf( "%s:\n %d\n", TAP_STEPS.GetValue().c_str(), m_NoteDataEdit.GetNumTapNotes() ); - sText += ssprintf( "%s:\n %d\n", JUMPS.GetValue().c_str(), m_NoteDataEdit.GetNumJumps() ); - sText += ssprintf( "%s:\n %d\n", HANDS.GetValue().c_str(), m_NoteDataEdit.GetNumHands() ); - sText += ssprintf( "%s:\n %d\n", HOLDS.GetValue().c_str(), m_NoteDataEdit.GetNumHoldNotes() ); - sText += ssprintf( "%s:\n %d\n", MINES.GetValue().c_str(), m_NoteDataEdit.GetNumMines() ); - sText += ssprintf( "%s:\n %d\n", ROLLS.GetValue().c_str(), m_NoteDataEdit.GetNumRolls() ); + sText += ssprintf( NUM_STEPS_FORMAT.GetValue(), TAP_STEPS.GetValue().c_str(), m_NoteDataEdit.GetNumTapNotes() ); + sText += ssprintf( NUM_JUMPS_FORMAT.GetValue(), JUMPS.GetValue().c_str(), m_NoteDataEdit.GetNumJumps() ); + sText += ssprintf( NUM_HANDS_FORMAT.GetValue(), HANDS.GetValue().c_str(), m_NoteDataEdit.GetNumHands() ); + sText += ssprintf( NUM_HOLDS_FORMAT.GetValue(), HOLDS.GetValue().c_str(), m_NoteDataEdit.GetNumHoldNotes() ); + sText += ssprintf( NUM_MINES_FORMAT.GetValue(), MINES.GetValue().c_str(), m_NoteDataEdit.GetNumMines() ); + sText += ssprintf( NUM_ROLLS_FORMAT.GetValue(), ROLLS.GetValue().c_str(), m_NoteDataEdit.GetNumRolls() ); switch( EDIT_MODE.GetValue() ) { DEFAULT_FAIL( EDIT_MODE.GetValue() ); @@ -1097,9 +1125,9 @@ void ScreenEdit::UpdateTextInfo() case EditMode_Home: break; case EditMode_Full: - sText += ssprintf( "%s:\n %.5f secs\n", BEAT_0_OFFSET.GetValue().c_str(), m_pSong->m_Timing.m_fBeat0OffsetInSeconds ); - sText += ssprintf( "%s:\n %.5f secs\n", PREVIEW_START.GetValue().c_str(), m_pSong->m_fMusicSampleStartSeconds ); - sText += ssprintf( "%s:\n %.5f secs\n", PREVIEW_LENGTH.GetValue().c_str(), m_pSong->m_fMusicSampleLengthSeconds ); + sText += ssprintf( BEAT_0_OFFSET_FORMAT.GetValue(), BEAT_0_OFFSET.GetValue().c_str(), m_pSong->m_Timing.m_fBeat0OffsetInSeconds ); + sText += ssprintf( PREVIEW_START_FORMAT.GetValue(), PREVIEW_START.GetValue().c_str(), m_pSong->m_fMusicSampleStartSeconds ); + sText += ssprintf( PREVIEW_LENGTH_FORMAT.GetValue(), PREVIEW_LENGTH.GetValue().c_str(), m_pSong->m_fMusicSampleLengthSeconds ); break; } @@ -2856,13 +2884,19 @@ static void ChangeDescription( const RString &sNew ) { Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; - /* Don't erase edit descriptions. */ + // Don't erase edit descriptions. if( sNew.empty() && pSteps->GetDifficulty() == Difficulty_Edit ) return; pSteps->SetDescription(sNew); } +static void ChangeChartStyle( const RString &sNew ) +{ + Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; + pSteps->SetChartStyle(sNew); +} + static void ChangeStepCredit( const RString &sNew ) { Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; @@ -3010,6 +3044,8 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns g_StepsInformation.rows[predict_meter].SetOneUnthemedChoice( ssprintf("%.2f",pSteps->PredictMeter()) ); g_StepsInformation.rows[description].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full); g_StepsInformation.rows[description].SetOneUnthemedChoice( pSteps->GetDescription() ); + g_StepsInformation.rows[chartstyle].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full); + g_StepsInformation.rows[chartstyle].SetOneUnthemedChoice( pSteps->GetChartStyle() ); g_StepsInformation.rows[step_credit].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full); g_StepsInformation.rows[step_credit].SetOneUnthemedChoice( pSteps->GetCredit() ); g_StepsInformation.rows[tap_notes].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumTapNotes()) ); @@ -3475,6 +3511,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector &iAns } static LocalizedString ENTER_NEW_DESCRIPTION( "ScreenEdit", "Enter a new description." ); +static LocalizedString ENTER_NEW_CHART_STYLE( "ScreenEdit", "Enter a new chart style." ); static LocalizedString ENTER_NEW_STEP_AUTHOR( "ScreenEdit", "Enter the author who made this step pattern." ); void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const vector &iAnswers ) { @@ -3498,6 +3535,17 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v NULL ); break; + case chartstyle: + ScreenTextEntry::TextEntry( + SM_None, + ENTER_NEW_CHART_STYLE, + m_pSteps->GetChartStyle(), + 255, + NULL, + ChangeChartStyle, + NULL + ); + break; case step_credit: ScreenTextEntry::TextEntry( SM_None, @@ -4043,6 +4091,7 @@ void ScreenEdit::DoHelp() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenEdit. */ class LunaScreenEdit: public Luna { public: diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index 4d7999b277..f4f38717f7 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -1,5 +1,3 @@ -/* ScreenEdit - Edit, record, playback, and synchronize notes. */ - #ifndef SCREEN_EDIT_H #define SCREEN_EDIT_H @@ -136,6 +134,7 @@ enum EditButton NUM_EditButton, // leave this at the end EditButton_Invalid }; +/** @brief A special foreach loop for the different edit buttons. */ #define FOREACH_EditButton( e ) FOREACH_ENUM( EditButton, e ) const int NUM_EDIT_TO_DEVICE_SLOTS = 2; const int NUM_EDIT_TO_MENU_SLOTS = 2; @@ -170,7 +169,7 @@ struct MapEditButtonToMenuButton button[e][slot] = GameButton_Invalid; } }; - +/** @brief Edit, record, playback, and synchronize notes. */ class ScreenEdit : public ScreenWithMenuElements { public: @@ -407,6 +406,7 @@ public: difficulty, meter, description, + chartstyle, step_credit, predict_meter, tap_notes, diff --git a/src/ScreenEditMenu.cpp b/src/ScreenEditMenu.cpp index 7a8e6d9e40..961e793120 100644 --- a/src/ScreenEditMenu.cpp +++ b/src/ScreenEditMenu.cpp @@ -24,8 +24,8 @@ static const RString TEMP_FILE_NAME = "--temp--"; #define EXPLANATION_TEXT( row ) THEME->GetString(m_sName,"Explanation"+EditMenuRowToString(row)) #define EDIT_MENU_TYPE THEME->GetMetric(m_sName,"EditMenuType") -AutoScreenMessage( SM_RefreshSelector ) -AutoScreenMessage( SM_BackFromEditDescription ) +AutoScreenMessage( SM_RefreshSelector ); +AutoScreenMessage( SM_BackFromEditDescription ); REGISTER_SCREEN_CLASS( ScreenEditMenu ); diff --git a/src/ScreenEvaluation.cpp b/src/ScreenEvaluation.cpp index fa28f8fb5b..55333bf14a 100644 --- a/src/ScreenEvaluation.cpp +++ b/src/ScreenEvaluation.cpp @@ -74,7 +74,7 @@ XToString( DetailLine ); static const int NUM_SHOWN_RADAR_CATEGORIES = 5; -AutoScreenMessage( SM_PlayCheer ) +AutoScreenMessage( SM_PlayCheer ); REGISTER_SCREEN_CLASS( ScreenEvaluation ); void ScreenEvaluation::Init() @@ -730,6 +730,7 @@ void ScreenEvaluation::HandleMenuStart() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenEvaluation. */ class LunaScreenEvaluation: public Luna { public: diff --git a/src/ScreenEvaluation.h b/src/ScreenEvaluation.h index 5053600aa0..3e6c3f1280 100644 --- a/src/ScreenEvaluation.h +++ b/src/ScreenEvaluation.h @@ -1,5 +1,3 @@ -/* ScreenEvaluation - Shows the player their score after gameplay has ended. */ - #ifndef SCREEN_EVALUATION_H #define SCREEN_EVALUATION_H @@ -14,31 +12,38 @@ #include "ThemeMetric.h" #include "RollingNumbers.h" -const int MAX_SONGS_TO_SHOW = 5; // In summary, we show last 3 stages, plus extra stages if passed +/** + * @brief How many songs are shown at the end? + * + * In the traditional summary, only the last three stages are shown. + * If any extra stages are passed, those get shown as well. */ +const int MAX_SONGS_TO_SHOW = 5; +/** @brief The different judgment lines shown. */ enum JudgmentLine { - JudgmentLine_W1, - JudgmentLine_W2, - JudgmentLine_W3, - JudgmentLine_W4, - JudgmentLine_W5, - JudgmentLine_Miss, - JudgmentLine_Held, - JudgmentLine_MaxCombo, - NUM_JudgmentLine, + JudgmentLine_W1, /**< The line showing absolutely perfect hits. */ + JudgmentLine_W2, /**< The line showing just-a-smidge-off perfect hits. */ + JudgmentLine_W3, /**< The line showing almost perfect hits. */ + JudgmentLine_W4, /**< The line showing hits that were not that good. */ + JudgmentLine_W5, /**< The line showing hits that were almost missed. */ + JudgmentLine_Miss, /**< The line showing missed notes. */ + JudgmentLine_Held, /**< The line showing held down notes. */ + JudgmentLine_MaxCombo, /**< The line showing the player's max combo. */ + NUM_JudgmentLine, /**< The number of judgment lines available. */ JudgmentLine_Invalid }; +/** @brief The number of details based on the radar categories. */ enum DetailLine { - DetailLine_NumSteps, - DetailLine_Jumps, - DetailLine_Holds, - DetailLine_Mines, - DetailLine_Hands, - DetailLine_Rolls, - NUM_DetailLine + DetailLine_NumSteps, /**< The number of steps hit. */ + DetailLine_Jumps, /**< The number of jumps hit together. */ + DetailLine_Holds, /**< The number of holds held. */ + DetailLine_Mines, /**< The number of mines avoided. */ + DetailLine_Hands, /**< The number of hands hit (somehow) */ + DetailLine_Rolls, /**< The number of rolls hit repeatedly. */ + NUM_DetailLine /**< The nuber of detailed lines. */ }; - +/** @brief Shows the player their score after gameplay has ended. */ class ScreenEvaluation : public ScreenWithMenuElements { public: @@ -69,7 +74,7 @@ protected: // grade area AutoActor m_sprGradeFrame[NUM_PLAYERS]; - GradeDisplay m_Grades[NUM_PLAYERS]; + GradeDisplay m_Grades[NUM_PLAYERS]; // points area bool m_bNewSongsUnlocked; @@ -91,7 +96,7 @@ protected: // judgment area AutoActor m_sprSharedJudgmentLineLabels[NUM_JudgmentLine]; - RollingNumbers m_textJudgmentLineNumber[NUM_JudgmentLine][NUM_PLAYERS]; + RollingNumbers m_textJudgmentLineNumber[NUM_JudgmentLine][NUM_PLAYERS]; // stats area AutoActor m_sprDetailFrame[NUM_PLAYERS]; @@ -99,7 +104,7 @@ protected: // score area AutoActor m_sprScoreLabel; - RollingNumbers m_textScore[NUM_PLAYERS]; + RollingNumbers m_textScore[NUM_PLAYERS]; // time area AutoActor m_sprTimeLabel; @@ -108,14 +113,16 @@ protected: RageSound m_soundStart; // sound played if the player passes or fails ThemeMetric SUMMARY; - + /** @brief Did a player save a screenshot of their score? */ bool m_bSavedScreenshot[NUM_PLAYERS]; }; #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 7978ab8b8c..251c73aa1d 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -71,19 +71,19 @@ static ThemeMetric INITIAL_BACKGROUND_BRIGHTNESS ("ScreenGameplay","Initi static ThemeMetric SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments"); static ThemeMetric SCORE_KEEPER_CLASS ("ScreenGameplay","ScoreKeeperClass"); -AutoScreenMessage( SM_PlayGo ) +AutoScreenMessage( SM_PlayGo ); // received while STATE_DANCING -AutoScreenMessage( SM_LoadNextSong ) -AutoScreenMessage( SM_StartLoadingNextSong ) +AutoScreenMessage( SM_LoadNextSong ); +AutoScreenMessage( SM_StartLoadingNextSong ); // received while STATE_OUTRO -AutoScreenMessage( SM_DoPrevScreen ) -AutoScreenMessage( SM_DoNextScreen ) +AutoScreenMessage( SM_DoPrevScreen ); +AutoScreenMessage( SM_DoNextScreen ); // received while STATE_INTRO -AutoScreenMessage( SM_StartHereWeGo ) -AutoScreenMessage( SM_StopHereWeGo ) +AutoScreenMessage( SM_StartHereWeGo ); +AutoScreenMessage( SM_StopHereWeGo ); AutoScreenMessage( SM_BattleTrickLevel1 ); AutoScreenMessage( SM_BattleTrickLevel2 ); @@ -352,7 +352,6 @@ void ScreenGameplay::Init() GIVING_UP_GOES_TO_PREV_SCREEN.Load( m_sName, "GivingUpGoesToPrevScreen" ); FAIL_ON_MISS_COMBO.Load( m_sName, "FailOnMissCombo" ); ALLOW_CENTER_1_PLAYER.Load( m_sName, "AllowCenter1Player" ); - USE_ALTERNATIVE_INPUT.Load( m_sName, "UseAlternativeInput"); // configurable: UNPAUSE_WITH_START.Load( m_sName, "UnpauseWithStart"); @@ -763,38 +762,6 @@ void ScreenGameplay::Init() LoadNextSong(); m_GiveUpTimer.SetZero(); - - if( USE_ALTERNATIVE_INPUT ) // using alternative input - { - int iNumCols = GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; - FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) - { - for( int col=0; col < iNumCols; ++col ) - { - // TODO: Remove use of PlayerNumber. - GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( col, pi->m_pn ); - - ThemeMetric tmpMetric; - tmpMetric.Load( m_sName,ssprintf( "AltInp%s%s",GAMESTATE->GetCurrentStyle()->m_szName,GameI.ToString( INPUTMAPPER->GetInputScheme() ).c_str() ) ); - - if(tmpMetric.GetValue() != "") - { - GameInput GameIAlt; - GameIAlt.FromString( INPUTMAPPER->GetInputScheme(),tmpMetric.GetValue() ); - - AlternateMapping tmpMap; - tmpMap.inpMain = GameI; - tmpMap.inpAlt = GameIAlt; - m_vAlterMap.push_back( tmpMap ); - - FOREACH( PlayerInfo, m_vPlayerInfo, pi ) - { - pi->m_pPlayer->m_vAlterMap.push_back( tmpMap ); - } - } - } - } - } } bool ScreenGameplay::Center1Player() const @@ -2253,23 +2220,12 @@ void ScreenGameplay::Input( const InputEventPlus &input ) return; } } - + bool bRelease = input.type == IET_RELEASE; if( !input.GameI.IsValid() ) return; - + int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI ); - - if( USE_ALTERNATIVE_INPUT ) // using alternative input - { - for( unsigned int i=0; i < m_vAlterMap.size(); ++i ) - { - if( m_vAlterMap[i].inpAlt == input.GameI ) - { - iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( m_vAlterMap[i].inpMain ); - } - } - } // Don't pass on any inputs to Player that aren't a press or a release. switch( input.type ) @@ -2838,6 +2794,7 @@ bool ScreenGameplay::LoadReplay() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenGameplay. */ class LunaScreenGameplay: public Luna { public: @@ -2896,6 +2853,7 @@ public: LUA_REGISTER_DERIVED_CLASS( ScreenGameplay, ScreenWithMenuElements ) +/** @brief Allow Lua to have access to the PlayerInfo. */ class LunaPlayerInfo: public Luna { public: diff --git a/src/ScreenGameplay.h b/src/ScreenGameplay.h index 84dccd5a40..f73c0236ae 100644 --- a/src/ScreenGameplay.h +++ b/src/ScreenGameplay.h @@ -1,5 +1,3 @@ -/* ScreenGameplay - The music plays, the notes scroll, and the Player is pressing buttons. */ - #ifndef SCREEN_GAMEPLAY_H #define SCREEN_GAMEPLAY_H @@ -33,9 +31,9 @@ class ScoreKeeper; class Background; class Foreground; -AutoScreenMessage( SM_NotesEnded ) -AutoScreenMessage( SM_BeginFailed ) -AutoScreenMessage( SM_LeaveGameplay ) +AutoScreenMessage( SM_NotesEnded ); +AutoScreenMessage( SM_BeginFailed ); +AutoScreenMessage( SM_LeaveGameplay ); class PlayerInfo { @@ -46,12 +44,23 @@ public: void Load( PlayerNumber pn, MultiPlayer mp, bool bShowNoteField, int iAddToDifficulty ); void LoadDummyP1( int iDummyIndex, int iAddToDifficulty ); + /** @brief The player has lost all of their lives: show the special game over. */ void ShowOniGameOver(); + /** + * @brief Retrieve the player's state and stage stats index. + * @return the player's state and stage stats index. + */ MultiPlayer GetPlayerStateAndStageStatsIndex() { return m_pn == PLAYER_INVALID ? m_mp : (MultiPlayer)m_pn; } PlayerState *GetPlayerState(); PlayerStageStats *GetPlayerStageStats(); PlayerNumber GetStepsAndTrailIndex() { return m_pn == PLAYER_INVALID ? PLAYER_1 : m_pn; } + /** + * @brief Determine if the player information is enabled. + * @return its success or failure. */ bool IsEnabled(); + /** + * @brief Determine if we're in MultiPlayer. + * @return true if it is MultiPlayer, false otherwise. */ bool IsMultiPlayer() const { return m_mp != MultiPlayer_Invalid; } RString GetName() const { @@ -66,34 +75,56 @@ public: // Lua void PushSelf( lua_State *L ); - PlayerNumber m_pn; - MultiPlayer m_mp; - bool m_bIsDummy; + /** @brief The present Player that is playing the game. */ + PlayerNumber m_pn; + MultiPlayer m_mp; + bool m_bIsDummy; int m_iDummyIndex; int m_iAddToDifficulty; // if > 0, use the Nth harder Steps - bool m_bPlayerEnabled; // IsEnabled cache for iterators - PlayerState m_PlayerStateDummy; + bool m_bPlayerEnabled; // IsEnabled cache for iterators + PlayerState m_PlayerStateDummy; PlayerStageStats m_PlayerStageStatsDummy; SoundEffectControl m_SoundEffectControl; - vector m_vpStepsQueue; // size may be >1 if playing a course - vector m_asModifiersQueue;// size may be >1 if playing a course + /** + * @brief The list of Steps a player has to go through in this set. + * + * The size may be greater than 1 if playing a course. */ + vector m_vpStepsQueue; + /** + * @brief The list of attack modifiers a player has to go through in this set. + * + * The size may be greater than 1 if playing a course. */ + vector m_asModifiersQueue; + /** @brief The LifeMeter showing a Player's health. */ LifeMeter *m_pLifeMeter; + /** @brief The current Song number in a Course. */ BitmapText *m_ptextCourseSongNumber; + /** @brief The description of the current Steps. */ BitmapText *m_ptextStepsDescription; - ScoreDisplay *m_pPrimaryScoreDisplay; - ScoreDisplay *m_pSecondaryScoreDisplay; + /** @brief The display for the primary ScoreKeeper. */ + ScoreDisplay *m_pPrimaryScoreDisplay; + /** @brief The display for the secondary ScoreKeeper. */ + ScoreDisplay *m_pSecondaryScoreDisplay; + /** @brief The primary ScoreKeeper for keeping track of the score. */ ScoreKeeper *m_pPrimaryScoreKeeper; + /** @brief The secondary ScoreKeeper. Only used in PLAY_MODE_RAVE. */ ScoreKeeper *m_pSecondaryScoreKeeper; + /** @brief The current PlayerOptions that are activated. */ BitmapText *m_ptextPlayerOptions; + /** @brief The current attack modifiers that are in play for the moment. */ ActiveAttackList *m_pActiveAttackList; + /** @brief The NoteData the Player has to get through. */ NoteData m_NoteData; Player *m_pPlayer; - // used in PLAY_MODE_BATTLE + /** + * @brief The inventory of attacks. + * + * This is mainly used in PLAY_MODE_BATTLE. */ Inventory *m_pInventory; StepsDisplay *m_pStepsDisplay; @@ -101,6 +132,7 @@ public: AutoActor m_sprOniGameOver; }; +/** @brief The music plays, the notes scroll, and the Player is pressing buttons. */ class ScreenGameplay : public ScreenWithMenuElements { public: @@ -115,8 +147,14 @@ public: virtual void HandleMessage( const Message &msg ); virtual void Cancel( ScreenMessage smSendWhenDone ); + /** + * @brief Retrieve the current ScreenType. + * @return the gameplay ScreenType. */ virtual ScreenType GetScreenType() const { return gameplay; } + /** + * @brief Determine if we are to center the columns for just one player. + * @return true if we center the solo player, false otherwise. */ bool Center1Player() const; // Lua @@ -134,6 +172,7 @@ protected: virtual bool UseSongBackgroundAndForeground() const { return true; } ThemeMetric PLAYER_TYPE; + ThemeMetric SCORE_DISPLAY_TYPE; ThemeMetric PLAYER_INIT_COMMAND; LocalizedString GIVE_UP_START_TEXT; LocalizedString GIVE_UP_BACK_TEXT; @@ -150,11 +189,8 @@ protected: ThemeMetric GIVING_UP_GOES_TO_PREV_SCREEN; ThemeMetric FAIL_ON_MISS_COMBO; ThemeMetric ALLOW_CENTER_1_PLAYER; - ThemeMetric USE_ALTERNATIVE_INPUT; ThemeMetric UNPAUSE_WITH_START; - vector m_vAlterMap; - bool IsLastSong(); void SetupSong( int iSongIndex ); void ReloadCurrentSong(); @@ -190,7 +226,11 @@ protected: bool m_bPaused; GameController m_PauseController; - vector m_apSongsQueue; // size may be >1 if playing a course + /** + * @brief The songs left to play. + * + * The size can be greater than 1 if playing a course. */ + vector m_apSongsQueue; float m_fTimeSinceLastDancingComment; // this counter is only running while STATE_DANCING @@ -199,7 +239,8 @@ protected: Background *m_pSongBackground; Foreground *m_pSongForeground; - Transition m_NextSong; // shows between songs in a course + /** @brief Used between songs in a course to show the next song. */ + Transition m_NextSong; CombinedLifeMeter* m_pCombinedLifeMeter; @@ -218,7 +259,11 @@ protected: Transition m_Failed; Transition m_Toasty; // easter egg - BitmapText m_textSurviveTime; // used in extra stage. TODO: Move this into a BGA + /** + * @brief How much time has the player survived in the extra stage? + * + * TODO: Move this into a BGA. */ + BitmapText m_textSurviveTime; AutoKeysounds m_AutoKeysounds; @@ -249,17 +294,24 @@ vector::iterator GetNextEnabledPlayerNumberInfo ( vector vector::iterator GetNextPlayerNumberInfo ( vector::iterator iter, vector &v ); vector::iterator GetNextVisiblePlayerInfo ( vector::iterator iter, vector &v ); +/** @brief Get each enabled Player's info. */ #define FOREACH_EnabledPlayerInfo( v, pi ) for( vector::iterator pi = GetNextEnabledPlayerInfo (v.begin(),v); pi != v.end(); pi = GetNextEnabledPlayerInfo(++pi,v) ) +/** @brief Get each enabled Player's info as long as it's not a dummy player. */ #define FOREACH_EnabledPlayerInfoNotDummy( v, pi ) for( vector::iterator pi = GetNextEnabledPlayerInfoNotDummy (v.begin(),v); pi != v.end(); pi = GetNextEnabledPlayerInfoNotDummy(++pi,v) ) +/** @brief Get each enabled Player Number's info. */ #define FOREACH_EnabledPlayerNumberInfo( v, pi ) for( vector::iterator pi = GetNextEnabledPlayerNumberInfo (v.begin(),v); pi != v.end(); pi = GetNextEnabledPlayerNumberInfo(++pi,v) ) +/** @brief Get each Player Number's info, regardless of whether it's enabled or not. */ #define FOREACH_PlayerNumberInfo( v, pi ) for( vector::iterator pi = GetNextPlayerNumberInfo (v.begin(),v); pi != v.end(); pi = GetNextPlayerNumberInfo(++pi,v) ) +/** @brief Get each visible Player's info. */ #define FOREACH_VisiblePlayerInfo( v, pi ) for( vector::iterator pi = GetNextVisiblePlayerInfo (v.begin(),v); pi != v.end(); pi = GetNextVisiblePlayerInfo(++pi,v) ) #endif -/* - * (c) 2001-2004 Chris Danford, Glenn Maynard +/** + * @file + * @author Chris Danford, Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenGameplayLesson.h b/src/ScreenGameplayLesson.h index fdf3fcc56d..674138bb90 100644 --- a/src/ScreenGameplayLesson.h +++ b/src/ScreenGameplayLesson.h @@ -1,11 +1,10 @@ -/* ScreenGameplayLesson - Shows some explanation pages, then allows 3 tries to pass a song. */ - #ifndef ScreenGameplayLesson_H #define ScreenGameplayLesson_H #include "ScreenGameplayNormal.h" class CourseEntry; +/** @brief Shows some explanation pages, then allows 3 tries to pass a song. */ class ScreenGameplayLesson : public ScreenGameplayNormal { public: diff --git a/src/ScreenGameplaySyncMachine.cpp b/src/ScreenGameplaySyncMachine.cpp index 62ca1d3d29..150d9c7b81 100644 --- a/src/ScreenGameplaySyncMachine.cpp +++ b/src/ScreenGameplaySyncMachine.cpp @@ -1,6 +1,7 @@ #include "global.h" #include "ScreenGameplaySyncMachine.h" #include "NotesLoaderSSC.h" +#include "NotesLoaderSM.h" #include "GameState.h" #include "GameManager.h" #include "PrefsManager.h" @@ -19,7 +20,11 @@ void ScreenGameplaySyncMachine::Init() AdjustSync::ResetOriginalSyncData(); RString sFile = THEME->GetPathO("ScreenGameplaySyncMachine","music"); - SSCLoader::LoadFromSSCFile( sFile, m_Song ); + // Allow themers to use .ssc and .sm files. -aj + bool bLoadedSSCFile = SSCLoader::LoadFromSSCFile( sFile, m_Song ); + if( !bLoadedSSCFile ) + SMLoader::LoadFromSMFile( sFile, m_Song ); + m_Song.SetSongDir( Dirname(sFile) ); m_Song.TidyUpData(); @@ -27,7 +32,7 @@ void ScreenGameplaySyncMachine::Init() // needs proper StepsType - freem vector vpSteps; SongUtil::GetPlayableSteps( &m_Song, vpSteps ); - ASSERT(vpSteps.size() > 0); + ASSERT_M(vpSteps.size() > 0, "No playable steps for ScreenGameplaySyncMachine"); Steps *pSteps = vpSteps[0]; GAMESTATE->m_pCurSteps[0].Set( pSteps ); diff --git a/src/ScreenHowToPlay.cpp b/src/ScreenHowToPlay.cpp index 16ddba07a2..44da5dd20c 100644 --- a/src/ScreenHowToPlay.cpp +++ b/src/ScreenHowToPlay.cpp @@ -169,7 +169,7 @@ void ScreenHowToPlay::Init() this->AddChild( m_Player ); ActorUtil::LoadAllCommandsAndSetXY( m_Player, m_sName ); - // Don't show judgement + // Don't show judgment PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions, ModsLevel_Stage, m_fBlind, 1.0f ); GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->m_bDemonstrationOrJukebox = true; @@ -301,6 +301,7 @@ void ScreenHowToPlay::HandleScreenMessage( const ScreenMessage SM ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenHowToPlay. */ class LunaScreenHowToPlay: public Luna { public: diff --git a/src/ScreenManager.cpp b/src/ScreenManager.cpp index b10963b20f..15dcc3bc32 100644 --- a/src/ScreenManager.cpp +++ b/src/ScreenManager.cpp @@ -81,6 +81,7 @@ static Preference g_bPruneFonts( "PruneFonts", true ); // Screen registration static map *g_pmapRegistrees = NULL; +/** @brief Utility functions for the ScreenManager. */ namespace ScreenManagerUtil { // in draw order first to last @@ -865,6 +866,7 @@ void ScreenManager::PlaySharedBackgroundOffCommand() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenManager. */ class LunaScreenManager: public Luna { public: diff --git a/src/ScreenMessage.h b/src/ScreenMessage.h index 9f92f4f8f0..5124cd52a0 100644 --- a/src/ScreenMessage.h +++ b/src/ScreenMessage.h @@ -17,16 +17,16 @@ extern const ScreenMessage SM_LoseFocus; extern const ScreenMessage SM_Pause; extern const ScreenMessage SM_Success; extern const ScreenMessage SM_Failure; - +/** @brief Helpers for the ScreenMessages. */ namespace ScreenMessageHelpers { ScreenMessage ToScreenMessage( const RString & Name ); RString ScreenMessageToString( ScreenMessage SM ); }; -// Automatically generate a unique ScreenMessage value +/** @brief Automatically generate a unique ScreenMessage value */ #define AutoScreenMessage( x ) \ - const ScreenMessage x = ScreenMessageHelpers::ToScreenMessage( #x ); + const ScreenMessage x = ScreenMessageHelpers::ToScreenMessage( #x ) #endif diff --git a/src/ScreenMiniMenu.cpp b/src/ScreenMiniMenu.cpp index b318616bbd..0139716d92 100644 --- a/src/ScreenMiniMenu.cpp +++ b/src/ScreenMiniMenu.cpp @@ -10,8 +10,8 @@ #include "OptionRowHandler.h" #include "PrefsManager.h" -AutoScreenMessage( SM_GoToOK ) -AutoScreenMessage( SM_GoToCancel ) +AutoScreenMessage( SM_GoToOK ); +AutoScreenMessage( SM_GoToCancel ); bool ScreenMiniMenu::s_bCancelled = false; int ScreenMiniMenu::s_iLastRowCode = -1; diff --git a/src/ScreenNameEntry.h b/src/ScreenNameEntry.h index cef8e00436..e785b4056e 100644 --- a/src/ScreenNameEntry.h +++ b/src/ScreenNameEntry.h @@ -1,5 +1,3 @@ -/* ScreenNameEntry - Enter a name for a new high score. */ - #ifndef SCREEN_NAME_ENTRY_H #define SCREEN_NAME_ENTRY_H @@ -7,7 +5,7 @@ #include "BitmapText.h" #include "ReceptorArrowRow.h" #include "RageSound.h" - +/** @brief Enter a name for a new high score. */ class ScreenNameEntry : public ScreenWithMenuElements { public: diff --git a/src/ScreenNameEntryTraditional.cpp b/src/ScreenNameEntryTraditional.cpp index 453d2eabac..70fdbaf493 100644 --- a/src/ScreenNameEntryTraditional.cpp +++ b/src/ScreenNameEntryTraditional.cpp @@ -238,6 +238,7 @@ bool ScreenNameEntryTraditional::Backspace( PlayerNumber pn ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenNameEntryTraditional. */ class LunaScreenNameEntryTraditional: public Luna { public: diff --git a/src/ScreenNetEvaluation.cpp b/src/ScreenNetEvaluation.cpp index 7a75a0f09a..730aaad417 100644 --- a/src/ScreenNetEvaluation.cpp +++ b/src/ScreenNetEvaluation.cpp @@ -19,7 +19,7 @@ static const int NUM_SCORE_DIGITS = 9; #define MAX_COMBO_NUM_DIGITS THEME->GetMetricI("ScreenEvaluation","MaxComboNumDigits") -static AutoScreenMessage( SM_GotEval ) +static AutoScreenMessage( SM_GotEval ); REGISTER_SCREEN_CLASS( ScreenNetEvaluation ); @@ -133,9 +133,9 @@ void ScreenNetEvaluation::HandleScreenMessage( const ScreenMessage SM ) LOG->Trace( "SMNETCheckpoint" ); for( int i=0; i= NSMAN->m_EvalPlayerData.size() ) break; @@ -152,16 +152,14 @@ void ScreenNetEvaluation::HandleScreenMessage( const ScreenMessage SM ) // Yes, hardcoded (I'd like to leave it that way) -CNLohr (in reference to Grade_Tier03) // Themes can read this differently. The correct solution depends... - // TODO: make this a server-side variable, or just find out - // the data from the theme? If we find out from the theme, people - // will be using different themes so it means nothing. -aj + // TODO: make this a server-side variable. -aj if( NSMAN->m_EvalPlayerData[i].grade < Grade_Tier03 ) m_textUsers[i].PlayCommand("Tier02OrBetter"); ON_COMMAND( m_textUsers[i] ); LOG->Trace( "SMNETCheckpoint%d", i ); } - return; //no need to let ScreenEvaluation get ahold of this. + return; // No need to let ScreenEvaluation get a hold of this. } else if( SM == SM_GoToNextScreen ) { @@ -191,13 +189,11 @@ void ScreenNetEvaluation::UpdateStats() m_textScore[m_pActivePlayer].SetTargetNumber( NSMAN->m_EvalPlayerData[m_iCurrentPlayer].score ); //Values greater than 6 will cause a crash - /* if( NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty < 6 ) { m_DifficultyIcon[m_pActivePlayer].SetPlayer( m_pActivePlayer ); m_DifficultyIcon[m_pActivePlayer].SetFromDifficulty( NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty ); } - */ for( int j=0; j { public: diff --git a/src/ScreenNetRoom.cpp b/src/ScreenNetRoom.cpp index e6d7362977..db99a368aa 100644 --- a/src/ScreenNetRoom.cpp +++ b/src/ScreenNetRoom.cpp @@ -11,13 +11,13 @@ #include "InputEventPlus.h" #include "LocalizedString.h" -AutoScreenMessage( SM_SMOnlinePack ) -AutoScreenMessage( SM_BackFromRoomName ) -AutoScreenMessage( SM_BackFromRoomDesc ) -AutoScreenMessage( SM_BackFromRoomPass ) -AutoScreenMessage( SM_BackFromReqPass ) -AutoScreenMessage( SM_RoomInfoRetract ) -AutoScreenMessage( SM_RoomInfoDeploy ) +AutoScreenMessage( SM_SMOnlinePack ); +AutoScreenMessage( SM_BackFromRoomName ); +AutoScreenMessage( SM_BackFromRoomDesc ); +AutoScreenMessage( SM_BackFromRoomPass ); +AutoScreenMessage( SM_BackFromReqPass ); +AutoScreenMessage( SM_RoomInfoRetract ); +AutoScreenMessage( SM_RoomInfoDeploy ); static LocalizedString ENTER_ROOM_DESCRIPTION ("ScreenNetRoom","Enter a description for the room:"); static LocalizedString ENTER_ROOM_PASSWORD ("ScreenNetRoom","Enter a password for the room (blank, no password):"); diff --git a/src/ScreenNetSelectBase.cpp b/src/ScreenNetSelectBase.cpp index 5d7cf813e6..8dfd75f7c3 100644 --- a/src/ScreenNetSelectBase.cpp +++ b/src/ScreenNetSelectBase.cpp @@ -26,9 +26,9 @@ #define USER_SPACING_X THEME->GetMetricF(m_sName,"UserSpacingX") #define USER_ADD_Y THEME->GetMetricF(m_sName,"UserLine2Y") -AutoScreenMessage( SM_AddToChat ) -AutoScreenMessage( SM_UsersUpdate ) -AutoScreenMessage( SM_SMOnlinePack ) +AutoScreenMessage( SM_AddToChat ); +AutoScreenMessage( SM_UsersUpdate ); +AutoScreenMessage( SM_SMOnlinePack ); REGISTER_SCREEN_CLASS( ScreenNetSelectBase ); diff --git a/src/ScreenNetSelectMusic.cpp b/src/ScreenNetSelectMusic.cpp index 4cbc1e8733..a1969836fe 100644 --- a/src/ScreenNetSelectMusic.cpp +++ b/src/ScreenNetSelectMusic.cpp @@ -26,14 +26,14 @@ #include "SongManager.h" #include "CodeDetector.h" -AutoScreenMessage( SM_NoSongs ) -AutoScreenMessage( SM_ChangeSong ) -AutoScreenMessage( SM_SMOnlinePack ) -AutoScreenMessage( SM_SetWheelSong ) -AutoScreenMessage( SM_RefreshWheelLocation ) -AutoScreenMessage( SM_SongChanged ) -AutoScreenMessage( SM_UsersUpdate ) -AutoScreenMessage( SM_BackFromPlayerOptions ) +AutoScreenMessage( SM_NoSongs ); +AutoScreenMessage( SM_ChangeSong ); +AutoScreenMessage( SM_SMOnlinePack ); +AutoScreenMessage( SM_SetWheelSong ); +AutoScreenMessage( SM_RefreshWheelLocation ); +AutoScreenMessage( SM_SongChanged ); +AutoScreenMessage( SM_UsersUpdate ); +AutoScreenMessage( SM_BackFromPlayerOptions ); REGISTER_SCREEN_CLASS( ScreenNetSelectMusic ); diff --git a/src/ScreenNetworkOptions.cpp b/src/ScreenNetworkOptions.cpp index 51d8dff800..c90545523e 100644 --- a/src/ScreenNetworkOptions.cpp +++ b/src/ScreenNetworkOptions.cpp @@ -36,7 +36,7 @@ enum DisplayScoreboard NO_SCOREBOARD_ON }; -AutoScreenMessage( SM_DoneConnecting ) +AutoScreenMessage( SM_DoneConnecting ); Preference g_sLastServer( "LastConnectedServer", "" ); diff --git a/src/ScreenOptions.cpp b/src/ScreenOptions.cpp index f3f3d71511..d23abd4ea7 100644 --- a/src/ScreenOptions.cpp +++ b/src/ScreenOptions.cpp @@ -134,7 +134,7 @@ void ScreenOptions::Init() // init line line highlights FOREACH_PlayerNumber( p ) { - m_sprLineHighlight[p].Load( THEME->GetPathG(m_sName,"line highlight") ); + m_sprLineHighlight[p].Load( THEME->GetPathG(m_sName,"LineHighlight") ); m_sprLineHighlight[p]->SetName( "LineHighlight" ); m_sprLineHighlight[p]->SetX( LINE_HIGHLIGHT_X ); LOAD_ALL_COMMANDS( m_sprLineHighlight[p] ); @@ -406,8 +406,7 @@ void ScreenOptions::RefreshIcons( int iRow, PlayerNumber pn ) } } - - /* XXX: hack to not display text in the song options menu */ + // XXX: hack to not display text in the song options menu if( def.m_bOneChoiceForAllPlayers ) sIcon = ""; @@ -462,7 +461,6 @@ void ScreenOptions::TweenCursor( PlayerNumber pn ) cursor.SetBarWidth( iWidth ); } - bool bCanGoLeft = false; bool bCanGoRight = false; switch( row.GetRowDef().m_layoutType ) @@ -476,12 +474,12 @@ void ScreenOptions::TweenCursor( PlayerNumber pn ) } cursor.SetCanGo( bCanGoLeft, bCanGoRight ); - if( GAMESTATE->IsHumanPlayer(pn) ) { COMMAND( m_sprLineHighlight[pn], "Change" ); if( row.GetRowType() == OptionRow::RowType_Exit ) COMMAND( m_sprLineHighlight[pn], "ChangeToExit" ); + m_sprLineHighlight[pn]->SetY( (float)iY ); } } @@ -530,9 +528,9 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM ) else if( SM == SM_BeginFadingOut ) { if( IsTransitioning() ) - return; /* already transitioning */ + return; // already transitioning - /* If the selected option sets a screen, honor it. */ + // If the selected option sets a screen, honor it. RString sThisScreen = GetNextScreenForFocusedItem( GAMESTATE->m_MasterPlayerNumber ); if( sThisScreen != "" ) m_sNextScreen = sThisScreen; @@ -551,7 +549,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM ) vector vpns; FOREACH_HumanPlayer( p ) vpns.push_back( p ); - for( unsigned r=0; rGetRowType() == OptionRow::RowType_Exit ) continue; @@ -572,7 +570,7 @@ void ScreenOptions::PositionRows( bool bTween ) int first_start, first_end, second_start, second_end; - /* Choices for each player. If only one player is active, it's the same for both. */ + // Choices for each player. If only one player is active, it's the same for both. int P1Choice = GAMESTATE->IsHumanPlayer(PLAYER_1)? m_iCurrentRow[PLAYER_1]: m_iCurrentRow[PLAYER_2]; int P2Choice = GAMESTATE->IsHumanPlayer(PLAYER_2)? m_iCurrentRow[PLAYER_2]: m_iCurrentRow[PLAYER_1]; @@ -583,7 +581,7 @@ void ScreenOptions::PositionRows( bool bTween ) { pSeparateExitRow = Rows.back(); - /* Remove the exit row for purposes of positioning everything else. */ + // Remove the exit row for purposes of positioning everything else. if( P1Choice == (int) Rows.size()-1 ) --P1Choice; if( P2Choice == (int) Rows.size()-1 ) @@ -595,24 +593,24 @@ void ScreenOptions::PositionRows( bool bTween ) const bool BothPlayersActivated = GAMESTATE->IsHumanPlayer(PLAYER_1) && GAMESTATE->IsHumanPlayer(PLAYER_2); if( m_InputMode == INPUTMODE_SHARE_CURSOR || !BothPlayersActivated ) { - /* Simply center the cursor. */ + // Simply center the cursor. first_start = max( P1Choice - halfsize, 0 ); first_end = first_start + total; second_start = second_end = first_end; } else { - /* First half: */ + // First half: const int earliest = min( P1Choice, P2Choice ); first_start = max( earliest - halfsize/2, 0 ); first_end = first_start + halfsize; - /* Second half: */ + // Second half: const int latest = max( P1Choice, P2Choice ); second_start = max( latest - halfsize/2, 0 ); - /* Don't overlap. */ + // Don't overlap. second_start = max( second_start, first_end ); second_end = second_start + halfsize; @@ -627,19 +625,19 @@ void ScreenOptions::PositionRows( bool bTween ) { const int sum = (first_end - first_start) + (second_end - second_start); if( sum >= (int) Rows.size() || sum >= total) - break; /* nothing more to display, or no room */ + break; // nothing more to display, or no room /* First priority: expand the top of the second half until it meets * the first half. */ if( second_start > first_end ) second_start--; - /* Otherwise, expand either end. */ + // Otherwise, expand either end. else if( first_start > 0 ) first_start--; else if( second_end < (int) Rows.size() ) second_end++; else - ASSERT(0); /* do we have room to grow or don't we? */ + ASSERT(0); // do we have room to grow or don't we? } int pos = 0; @@ -1006,12 +1004,11 @@ void ScreenOptions::ChangeValueInRowRelative( int iRow, PlayerNumber pn, int iDe if( m_OptionsNavigation == NAV_THREE_KEY_MENU && iNumChoices <= 1 ) // 1 or 0 { - /* There are no other options on the row; move up or down instead of left and right. - * This allows navigating the options menu with left/right/start. - * + /* There are no other options on the row; move up or down instead of + * left and right. This allows navigating the options menu with + * left/right/start. * XXX: Only allow repeats if the opposite key isn't pressed; otherwise, - * holding both directions will repeat in place continuously, - * which is weird. */ + * holding both directions will repeat in place continuously, which is weird. */ if( MoveRowRelative(pn, iDelta, bRepeat) ) { if( iDelta < 0 ) @@ -1022,7 +1019,7 @@ void ScreenOptions::ChangeValueInRowRelative( int iRow, PlayerNumber pn, int iDe return; } - if( iNumChoices <= 1 ) // nowhere to move + if( iNumChoices <= 1 ) // nowhere to move return; if( bRepeat && !ALLOW_REPEATING_CHANGE_VALUE_INPUT ) @@ -1083,7 +1080,7 @@ void ScreenOptions::ChangeValueInRowRelative( int iRow, PlayerNumber pn, int iDe else { if( row.GetRowDef().m_selectType == SELECT_MULTIPLE ) - ; // do nothing. User must press Start to toggle the selection. + ; // do nothing. User must press Start to toggle the selection. else row.SetOneSelection( p, iNewChoiceWithFocus ); } @@ -1196,6 +1193,13 @@ bool ScreenOptions::MoveRowAbsolute( PlayerNumber pn, int iRow ) AfterChangeRow( p ); bChanged = true; + + const OptionRow &row = *m_pRows[iRow]; + Message msg( "ChangeRow" ); + msg.SetParam( "PlayerNumber", p ); + msg.SetParam( "RowIndex", GetCurrentRow(p) ); + msg.SetParam( "ChangedToExit", row.GetRowType() == OptionRow::RowType_Exit ); + MESSAGEMAN->Broadcast( msg ); } return bChanged; @@ -1277,16 +1281,28 @@ void ScreenOptions::MenuUpDown( const InputEventPlus &input, int iDir ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to ScreenOptions. */ class LunaScreenOptions: public Luna { public: - static int GetCurrentRow( T* p, lua_State *L ) { lua_pushnumber( L, p->GetCurrentRow(Enum::Check(L, 1)) ); return 1; } static int AllAreOnLastRow( T* p, lua_State *L ) { lua_pushboolean( L, p->AllAreOnLastRow() ); return 1; } + static int FocusedItemEndsScreen( T* p, lua_State *L ) { lua_pushboolean( L, p->FocusedItemEndsScreen(Enum::Check(L, 1)) ); return 1; } + static int GetCurrentRowIndex( T* p, lua_State *L ) { lua_pushnumber( L, p->GetCurrentRow(Enum::Check(L, 1)) ); return 1; } + static int GetOptionRow( T* p, lua_State *L ) { + OptionRow* pOptRow = p->GetRow( IArg(1) ); + if( pOptRow ) + pOptRow->PushSelf(L); + else + lua_pushnil( L ); + return 1; + } LunaScreenOptions() { - ADD_METHOD( GetCurrentRow ); ADD_METHOD( AllAreOnLastRow ); + ADD_METHOD( FocusedItemEndsScreen ); + ADD_METHOD( GetCurrentRowIndex ); + ADD_METHOD( GetOptionRow ); } }; diff --git a/src/ScreenOptions.h b/src/ScreenOptions.h index e9ec4f93d7..b07f8027bb 100644 --- a/src/ScreenOptions.h +++ b/src/ScreenOptions.h @@ -1,5 +1,3 @@ -/* ScreenOptions - A grid of options; the selected option is drawn with a highlight rectangle. */ - #ifndef SCREENOPTIONS_H #define SCREENOPTIONS_H @@ -14,20 +12,23 @@ class OptionRowHandler; -AutoScreenMessage( SM_ExportOptions ) +AutoScreenMessage( SM_ExportOptions ); +/** @brief The list of input modes for the given row. */ enum InputMode { - INPUTMODE_INDIVIDUAL, // each player controls their own cursor - INPUTMODE_SHARE_CURSOR, // both players control the same cursor - NUM_InputMode, + INPUTMODE_INDIVIDUAL, /**< each player controls their own cursor */ + INPUTMODE_SHARE_CURSOR, /**< both players control the same cursor */ + NUM_InputMode, /**< The number of input modes available. */ InputMode_Invalid }; InputMode StringToInputMode( const RString& str ); +/** @brief A custom foreach loop for the player options for each player. */ #define FOREACH_OptionsPlayer( pn ) \ for( PlayerNumber pn=GetNextHumanPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID && (m_InputMode==INPUTMODE_INDIVIDUAL || pn==0); pn=GetNextHumanPlayer(pn) ) +/** @brief A grid of options; the selected option is drawn with a highlight rectangle. */ class ScreenOptions : public ScreenWithMenuElements { public: @@ -84,14 +85,16 @@ protected: int GetCurrentRow( PlayerNumber pn = PLAYER_1 ) const { return m_iCurrentRow[pn]; } bool AllAreOnLastRow() const; + OptionRow* GetRow( int iRow ) const { return m_pRows[iRow]; } protected: // derived classes need access to these enum Navigation { NAV_THREE_KEY, NAV_THREE_KEY_MENU, NAV_THREE_KEY_ALT, NAV_FIVE_KEY, NAV_TOGGLE_THREE_KEY, NAV_TOGGLE_FIVE_KEY }; void SetNavigation( Navigation nav ) { m_OptionsNavigation = nav; } void SetInputMode( InputMode im ) { m_InputMode = im; } - // Map menu lines to m_OptionRow entries. + /** @brief Map menu lines to m_OptionRow entries. */ vector m_pRows; + /** @brief The current row each player is on. */ int m_iCurrentRow[NUM_PLAYERS]; OptionRowType m_OptionRowTypeNormal; @@ -103,9 +106,10 @@ protected: // derived classes need access to these int m_iFocusX[NUM_PLAYERS]; bool m_bWasOnExit[NUM_PLAYERS]; - // TRICKY: People hold Start to get to PlayerOptions, then - // the repeat events cause them to zip to the bottom. So, ignore - // Start repeat events until we've seen one first pressed event. + /** @brief True if at least one player pressed Start after selecting the song. + * TRICKY: People hold Start to get to PlayerOptions, then the repeat events + * cause them to zip to the bottom. So, ignore Start repeat events until + * we've seen one first pressed event. */ bool m_bGotAtLeastOneStartPressed[NUM_PLAYERS]; // actors @@ -149,8 +153,10 @@ protected: // derived classes need access to these #endif -/* - * (c) 2001-2004 Chris Danford, Glenn Maynard +/** + * @file + * @author Chris Danford, Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenOptionsCourseOverview.cpp b/src/ScreenOptionsCourseOverview.cpp index 21ed2b4ca3..65219a6c53 100644 --- a/src/ScreenOptionsCourseOverview.cpp +++ b/src/ScreenOptionsCourseOverview.cpp @@ -57,9 +57,9 @@ static LocalizedString ERROR_DELETING_FILE ("ScreenOptionsCourseOverview", static LocalizedString COURSE_WILL_BE_LOST ("ScreenOptionsCourseOverview", "This course will be lost permanently."); static LocalizedString CONTINUE_WITH_DELETE ("ScreenOptionsCourseOverview", "Continue with delete?"); -AutoScreenMessage( SM_BackFromEnterName ) -AutoScreenMessage( SM_BackFromRename ) -AutoScreenMessage( SM_BackFromDelete ) +AutoScreenMessage( SM_BackFromEnterName ); +AutoScreenMessage( SM_BackFromRename ); +AutoScreenMessage( SM_BackFromDelete ); void ScreenOptionsCourseOverview::Init() { diff --git a/src/ScreenOptionsManageEditSteps.cpp b/src/ScreenOptionsManageEditSteps.cpp index 2c49ddc879..7fc0b1f7de 100644 --- a/src/ScreenOptionsManageEditSteps.cpp +++ b/src/ScreenOptionsManageEditSteps.cpp @@ -20,9 +20,9 @@ #include "SpecialFiles.h" #include "NotesWriterSM.h" -AutoScreenMessage( SM_BackFromRename ) -AutoScreenMessage( SM_BackFromDelete ) -AutoScreenMessage( SM_BackFromContextMenu ) +AutoScreenMessage( SM_BackFromRename ); +AutoScreenMessage( SM_BackFromDelete ); +AutoScreenMessage( SM_BackFromContextMenu ); enum StepsEditAction { @@ -37,6 +37,7 @@ static const char *StepsEditActionNames[] = { "Delete", }; XToString( StepsEditAction ); +/** @brief Loop through each StepsEditAction. */ #define FOREACH_StepsEditAction( i ) FOREACH_ENUM( StepsEditAction, i ) static MenuDef g_TempMenu( diff --git a/src/ScreenOptionsManageProfiles.cpp b/src/ScreenOptionsManageProfiles.cpp index f8dbca6666..272dd2d478 100644 --- a/src/ScreenOptionsManageProfiles.cpp +++ b/src/ScreenOptionsManageProfiles.cpp @@ -16,11 +16,11 @@ static LocalizedString NEW_PROFILE_DEFAULT_NAME( "ScreenOptionsManageProfiles", #define SHOW_CREATE_NEW (!PROFILEMAN->FixedProfiles()) -AutoScreenMessage( SM_BackFromEnterNameForNew ) -AutoScreenMessage( SM_BackFromRename ) -AutoScreenMessage( SM_BackFromDeleteConfirm ) -AutoScreenMessage( SM_BackFromClearConfirm ) -AutoScreenMessage( SM_BackFromContextMenu ) +AutoScreenMessage( SM_BackFromEnterNameForNew ); +AutoScreenMessage( SM_BackFromRename ); +AutoScreenMessage( SM_BackFromDeleteConfirm ); +AutoScreenMessage( SM_BackFromClearConfirm ); +AutoScreenMessage( SM_BackFromContextMenu ); enum ProfileAction { @@ -42,6 +42,7 @@ static const char *ProfileActionNames[] = { }; XToString( ProfileAction ); XToLocalizedString( ProfileAction ); +/** @brief Loop through each ProfileAction. */ #define FOREACH_ProfileAction( i ) FOREACH_ENUM( ProfileAction, i ) static MenuDef g_TempMenu( diff --git a/src/ScreenOptionsMaster.cpp b/src/ScreenOptionsMaster.cpp index 2df6b3b30a..50c7a08832 100644 --- a/src/ScreenOptionsMaster.cpp +++ b/src/ScreenOptionsMaster.cpp @@ -16,12 +16,11 @@ #include "CommonMetrics.h" #include "GameLoop.h" -#define LINE_NAMES THEME->GetMetric (m_sName,"LineNames") -#define LINE(sLineName) THEME->GetMetric (m_sName,ssprintf("Line%s",sLineName.c_str())) -#define FORCE_ALL_PLAYERS THEME->GetMetricB(m_sName,"ForceAllPlayers") -#define INPUT_MODE THEME->GetMetric (m_sName,"InputMode") -#define NAVIGATION_MODE THEME->GetMetric (m_sName,"NavigationMode") - +#define LINE_NAMES THEME->GetMetric (m_sName,"LineNames") +#define LINE(sLineName) THEME->GetMetric (m_sName,ssprintf("Line%s",sLineName.c_str())) +#define FORCE_ALL_PLAYERS THEME->GetMetricB(m_sName,"ForceAllPlayers") +#define INPUT_MODE THEME->GetMetric (m_sName,"InputMode") +#define NAVIGATION_MODE THEME->GetMetric (m_sName,"NavigationMode") REGISTER_SCREEN_CLASS( ScreenOptionsMaster ); @@ -65,7 +64,6 @@ void ScreenOptionsMaster::Init() ASSERT( OptionRowHandlers.size() == asLineNames.size() ); - InitMenu( OptionRowHandlers ); } @@ -109,9 +107,9 @@ void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM ) if( m_iChangeMask & OPT_APPLY_ASPECT_RATIO ) { - THEME->UpdateLuaGlobals(); // This needs to be done before resetting the projection matrix below + THEME->UpdateLuaGlobals(); // This needs to be done before resetting the projection matrix below THEME->ReloadSubscribers(); // SCREEN_* has changed, so re-read all subscribing ThemeMetrics - SCREENMAN->ThemeChanged(); // recreate ScreenSystemLayer and SharedBGA + SCREENMAN->ThemeChanged(); // recreate ScreenSystemLayer and SharedBGA } /* If the theme changes, we need to reset RageDisplay to apply the new window @@ -131,7 +129,7 @@ void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM ) if( m_iChangeMask & OPT_SAVE_PREFERENCES ) { - /* Save preferences. */ + // Save preferences. LOG->Trace("ROW_CONFIG used; saving ..."); PREFSMAN->SavePrefsToDisk(); } diff --git a/src/ScreenOptionsMaster.h b/src/ScreenOptionsMaster.h index e4968f48ee..e15dfc014d 100644 --- a/src/ScreenOptionsMaster.h +++ b/src/ScreenOptionsMaster.h @@ -12,7 +12,7 @@ public: private: int m_iChangeMask; - + protected: virtual void HandleScreenMessage( const ScreenMessage SM ); diff --git a/src/ScreenPackages.cpp b/src/ScreenPackages.cpp index ba115a715e..7e35aa4148 100644 --- a/src/ScreenPackages.cpp +++ b/src/ScreenPackages.cpp @@ -14,7 +14,7 @@ #include #include "LocalizedString.h" -AutoScreenMessage( SM_BackFromURL ) +AutoScreenMessage( SM_BackFromURL ); REGISTER_SCREEN_CLASS( ScreenPackages ); diff --git a/src/ScreenPlayerOptions.cpp b/src/ScreenPlayerOptions.cpp index 64fb5a52ee..d6c7f04a03 100644 --- a/src/ScreenPlayerOptions.cpp +++ b/src/ScreenPlayerOptions.cpp @@ -150,6 +150,7 @@ void ScreenPlayerOptions::UpdateDisqualified( int row, PlayerNumber pn ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenPlayerOptions. */ class LunaScreenPlayerOptions: public Luna { public: @@ -161,7 +162,7 @@ public: } }; -LUA_REGISTER_DERIVED_CLASS( ScreenPlayerOptions, ScreenWithMenuElements ) +LUA_REGISTER_DERIVED_CLASS( ScreenPlayerOptions, ScreenOptions ) // lua end /* diff --git a/src/ScreenPlayerOptions.h b/src/ScreenPlayerOptions.h index 37f322744b..e3dd5068be 100644 --- a/src/ScreenPlayerOptions.h +++ b/src/ScreenPlayerOptions.h @@ -15,9 +15,7 @@ public: virtual void HandleScreenMessage( const ScreenMessage SM ); bool GetGoToOptions() const { return m_bGoToOptions; } - // // Lua - // virtual void PushSelf( lua_State *L ); private: diff --git a/src/ScreenProfileLoad.cpp b/src/ScreenProfileLoad.cpp index 41b89f6a0d..6f1cb87cdf 100644 --- a/src/ScreenProfileLoad.cpp +++ b/src/ScreenProfileLoad.cpp @@ -37,6 +37,7 @@ void ScreenProfileLoad::Continue() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenProfileLoad. */ class LunaScreenProfileLoad: public Luna { public: diff --git a/src/ScreenProfileSave.cpp b/src/ScreenProfileSave.cpp index 821a55074d..a769f96cd1 100644 --- a/src/ScreenProfileSave.cpp +++ b/src/ScreenProfileSave.cpp @@ -25,6 +25,7 @@ void ScreenProfileSave::Continue() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenProfileSave. */ class LunaScreenProfileSave: public Luna { public: diff --git a/src/ScreenPrompt.cpp b/src/ScreenPrompt.cpp index f963c11cd8..efe9bb72e8 100644 --- a/src/ScreenPrompt.cpp +++ b/src/ScreenPrompt.cpp @@ -251,6 +251,8 @@ void ScreenPrompt::TweenOffScreen() // lua start /* #include "LuaBinding.h" + +/** @brief Allow Lua to have access to the ScreenPrompt. class LunaScreenPrompt: public Luna { public: diff --git a/src/ScreenRanking.cpp b/src/ScreenRanking.cpp index 16833db8bc..f1c2d0dbea 100644 --- a/src/ScreenRanking.cpp +++ b/src/ScreenRanking.cpp @@ -15,8 +15,8 @@ static const char *RankingTypeNames[] = { XToString( RankingType ); LuaXType( RankingType ); -AutoScreenMessage( SM_ShowNextPage ) -AutoScreenMessage( SM_HidePage ) +AutoScreenMessage( SM_ShowNextPage ); +AutoScreenMessage( SM_HidePage ); REGISTER_SCREEN_CLASS( ScreenRanking ); diff --git a/src/ScreenSMOnlineLogin.cpp b/src/ScreenSMOnlineLogin.cpp index 1ddf9b0bc6..bca827b014 100644 --- a/src/ScreenSMOnlineLogin.cpp +++ b/src/ScreenSMOnlineLogin.cpp @@ -17,9 +17,9 @@ REGISTER_SCREEN_CLASS(ScreenSMOnlineLogin); -AutoScreenMessage( SM_SMOnlinePack ) -AutoScreenMessage( SM_PasswordDone ) -AutoScreenMessage( SM_NoProfilesDefined ) +AutoScreenMessage( SM_SMOnlinePack ); +AutoScreenMessage( SM_PasswordDone ); +AutoScreenMessage( SM_NoProfilesDefined ); static LocalizedString DEFINE_A_PROFILE( "ScreenSMOnlineLogin", "You must define a Profile." ); void ScreenSMOnlineLogin::Init() diff --git a/src/ScreenSelect.h b/src/ScreenSelect.h index efdc9e92ab..af2cb62f63 100644 --- a/src/ScreenSelect.h +++ b/src/ScreenSelect.h @@ -1,4 +1,4 @@ -/* ScreenSelect - Base class for Style, Difficulty, and Mode selection screens. */ +/** @brief ScreenSelect - Base class for Style, Difficulty, and Mode selection screens. */ #ifndef SCREEN_SELECT_H #define SCREEN_SELECT_H @@ -25,12 +25,18 @@ protected: virtual int GetSelectionIndex( PlayerNumber pn ) = 0; virtual void UpdateSelectableChoices() = 0; // derived screens must handle this - vector m_aGameCommands; // derived classes should look here for what choices are available + /** + * @brief The game commands available. + * + * Derived classes should look here for the choices. */ + vector m_aGameCommands; vector m_asSubscribedMessages; - RageTimer m_timerIdleComment; // count up to time between idle comment announcer sounds - RageTimer m_timerIdleTimeout; // count up to go to the timeout screen + /** @brief Count up to the time between idle comment announcer sounds. */ + RageTimer m_timerIdleComment; + /** @brief Count up to go to the timeout screen. */ + RageTimer m_timerIdleTimeout; ThemeMetric IDLE_COMMENT_SECONDS; ThemeMetric IDLE_TIMEOUT_SECONDS; @@ -39,8 +45,10 @@ protected: #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenSelectMaster.cpp b/src/ScreenSelectMaster.cpp index 1d0b7d4343..dd363affa6 100644 --- a/src/ScreenSelectMaster.cpp +++ b/src/ScreenSelectMaster.cpp @@ -22,7 +22,7 @@ static const char *MenuDirNames[] = { }; XToString( MenuDir ); -AutoScreenMessage( SM_PlayPostSwitchPage ) +AutoScreenMessage( SM_PlayPostSwitchPage ); static RString CURSOR_OFFSET_X_FROM_ICON_NAME( size_t p ) { return ssprintf("CursorP%dOffsetXFromIcon",int(p+1)); } static RString CURSOR_OFFSET_Y_FROM_ICON_NAME( size_t p ) { return ssprintf("CursorP%dOffsetYFromIcon",int(p+1)); } @@ -942,6 +942,7 @@ float ScreenSelectMaster::GetCursorY( PlayerNumber pn ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenSelectMaster. */ class LunaScreenSelectMaster: public Luna { public: diff --git a/src/ScreenSelectMaster.h b/src/ScreenSelectMaster.h index b2f1e30cd1..838e6821d0 100644 --- a/src/ScreenSelectMaster.h +++ b/src/ScreenSelectMaster.h @@ -16,9 +16,11 @@ enum MenuDir MenuDir_Auto, // when players join and the selection becomes invalid NUM_MenuDir, }; +/** @brief A special foreach loop through the different menu directions. */ #define FOREACH_MenuDir( md ) FOREACH_ENUM( MenuDir, md ) const RString& MenuDirToString( MenuDir md ); +/** @brief The master Screen for many children Screens. */ class ScreenSelectMaster : public ScreenSelect { public: diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 7f1fe3abaa..3fbb770efb 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -38,15 +38,16 @@ static const char *SelectionStateNames[] = { }; XToString( SelectionState ); +/** @brief The maximum number of digits for the ScoreDisplay. */ const int NUM_SCORE_DIGITS = 9; #define SHOW_OPTIONS_MESSAGE_SECONDS THEME->GetMetricF( m_sName, "ShowOptionsMessageSeconds" ) -AutoScreenMessage( SM_AllowOptionsMenuRepeat ) -AutoScreenMessage( SM_SongChanged ) -AutoScreenMessage( SM_SortOrderChanging ) -AutoScreenMessage( SM_SortOrderChanged ) -AutoScreenMessage( SM_BackFromPlayerOptions ) +AutoScreenMessage( SM_AllowOptionsMenuRepeat ); +AutoScreenMessage( SM_SongChanged ); +AutoScreenMessage( SM_SortOrderChanging ); +AutoScreenMessage( SM_SortOrderChanged ); +AutoScreenMessage( SM_BackFromPlayerOptions ); static RString g_sCDTitlePath; static bool g_bWantFallbackCdTitle; @@ -419,6 +420,8 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) } } + // todo: use mousewheel to scroll MusicWheel -aj + // debugging? // I just like being able to see untransliterated titles occasionally. if( input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_F9 ) @@ -1853,6 +1856,7 @@ void ScreenSelectMusic::AfterMusicChange() // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenSelectMusic. */ class LunaScreenSelectMusic: public Luna { public: diff --git a/src/ScreenSelectProfile.cpp b/src/ScreenSelectProfile.cpp index cdf1bfd21d..db458d1b57 100644 --- a/src/ScreenSelectProfile.cpp +++ b/src/ScreenSelectProfile.cpp @@ -213,6 +213,7 @@ bool ScreenSelectProfile::Finish(){ // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the ScreenSelectProfile. */ class LunaScreenSelectProfile: public Luna { public: diff --git a/src/ScreenSetTime.cpp b/src/ScreenSetTime.cpp index 72eaea7a82..1860a316b5 100644 --- a/src/ScreenSetTime.cpp +++ b/src/ScreenSetTime.cpp @@ -18,6 +18,7 @@ static const char *SetTimeSelectionNames[] = { "Second", }; XToString( SetTimeSelection ); +/** @brief A foreach iterator through the time selections. */ #define FOREACH_SetTimeSelection( s ) FOREACH_ENUM( SetTimeSelection, s ) const float g_X[NUM_SetTimeSelection] = diff --git a/src/ScreenTestFonts.cpp b/src/ScreenTestFonts.cpp index 530a037256..9178700ace 100644 --- a/src/ScreenTestFonts.cpp +++ b/src/ScreenTestFonts.cpp @@ -11,7 +11,9 @@ static const float LineWidth = 400; static const float LineHeight = 50; +/** @brief A quick way of getting a font metric. */ #define FONT( i ) THEME->GetMetric (m_sName,ssprintf("Font%i",i)) +/** @brief A quick way of getting a particular string. */ #define TEXT( i ) THEME->GetString (m_sName,ssprintf("Text%i",i)) static RString g_sCustomText; @@ -21,7 +23,7 @@ static void ChangeText( const RString &sText ) g_sCustomText = sText; } -AutoScreenMessage( SM_ChangeText ) +AutoScreenMessage( SM_ChangeText ); void ScreenTestFonts::HandleScreenMessage( const ScreenMessage SM ) { diff --git a/src/ScreenTestSound.h b/src/ScreenTestSound.h index 46f1899f47..d9024a63b6 100644 --- a/src/ScreenTestSound.h +++ b/src/ScreenTestSound.h @@ -5,6 +5,7 @@ #include "BitmapText.h" #include "RageSound.h" +/** @brief The number of sounds allowed for testing. */ const int nsounds = 5; class ScreenTestSound : public Screen @@ -31,8 +32,10 @@ public: #endif -/* - * (c) 2003 Glenn Maynard +/** + * @file + * @author Glenn Maynard (c) 2003 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/ScreenTextEntry.cpp b/src/ScreenTextEntry.cpp index e074d4baa0..cf351429e9 100644 --- a/src/ScreenTextEntry.cpp +++ b/src/ScreenTextEntry.cpp @@ -539,7 +539,7 @@ void ScreenTextEntry::LoadFromTextEntrySettings( const TextEntrySettings &settin BeginScreen(); } -// lua start +/** @brief Allow Lua to have access to the ScreenTextEntry. */ class LunaScreenTextEntry: public Luna { public: diff --git a/src/ScreenTextEntry.h b/src/ScreenTextEntry.h index 04d2b0ffe0..0bebcee94d 100644 --- a/src/ScreenTextEntry.h +++ b/src/ScreenTextEntry.h @@ -1,5 +1,3 @@ -/* ScreenTextEntry - Displays a text entry box over the top of another screen. */ - #ifndef SCREEN_TEXT_ENTRY_H #define SCREEN_TEXT_ENTRY_H @@ -9,20 +7,34 @@ #include "ThemeMetric.h" #include "InputEventPlus.h" +/** @brief The list of possible keyboard rows. */ enum KeyboardRow { - R1, R2, R3, R4, R5, R6, R7, + R1, + R2, + R3, + R4, + R5, + R6, + R7, KEYBOARD_ROW_SPECIAL, NUM_KeyboardRow, KeyboardRow_Invalid }; +/** @brief A special foreach loop for the KeyboardRow enum. */ #define FOREACH_KeyboardRow( i ) FOREACH_ENUM( KeyboardRow, i ) +/** @brief The maximum number of keys per row. */ const int KEYS_PER_ROW = 13; +/** @brief The list of very special keys inside some rows. */ enum KeyboardRowSpecialKey { - SPACEBAR=2, BACKSPACE=5, CANCEL=8, DONE=11 + SPACEBAR=2, /**< The space bar key. */ + BACKSPACE=5, /**< The backspace key. */ + CANCEL=8, + DONE=11 }; +/** @brief Displays a text entry box over the top of another screen. */ class ScreenTextEntry : public ScreenWithMenuElements { public: @@ -64,7 +76,10 @@ public: RString sQuestion; RString sInitialAnswer; int iMaxInputLength; - bool bPassword; // (optional) + /** @brief Is there a password involved with this setting? + * + * This parameter doesn't have to be used. */ + bool bPassword; LuaReference Validate; // (RString sAnswer, RString sErrorOut; optional) LuaReference OnOK; // (RString sAnswer; optional) LuaReference OnCancel; // (optional) diff --git a/src/ScreenWithMenuElements.cpp b/src/ScreenWithMenuElements.cpp index a099df6836..cfee598c48 100644 --- a/src/ScreenWithMenuElements.cpp +++ b/src/ScreenWithMenuElements.cpp @@ -364,7 +364,7 @@ void ScreenWithMenuElementsSimple::MenuBack( const InputEventPlus &input ) // lua start #include "LuaBinding.h" - +/** @brief Allow Lua to have access to the ScreenWithMenuElements. */ class LunaScreenWithMenuElements: public Luna { public: @@ -378,6 +378,7 @@ public: LUA_REGISTER_DERIVED_CLASS( ScreenWithMenuElements, Screen ) +/** @brief Allow Lua to have access to the ScreenWithMenuElementsSimple. */ class LunaScreenWithMenuElementsSimple: public Luna { public: diff --git a/src/Song.cpp b/src/Song.cpp index b4e7fe088d..7c648aaf8c 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -36,14 +36,20 @@ #include #include -const static float VERSION_NUMBER = 0.51f; -const int FILE_CACHE_VERSION = 163; // increment this to invalidate cache +/** @brief The version of the .ssc file format. */ +const static float VERSION_NUMBER = 0.52f; +/** + * @brief The internal version of the cache for StepMania. + * + * Increment this value to invalidate the current cache. */ +const int FILE_CACHE_VERSION = 164; +/** @brief How long does a song sample last by default? */ const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; static Preference g_fLongVerSongSeconds( "LongVerSongSeconds", 60*2.5f ); static Preference g_fMarathonVerSongSeconds( "MarathonVerSongSeconds", 60*5.f ); -static Preference g_BackUpAllSongSaves( "BackUpAllSongSaves", false ); +static Preference g_BackUpAllSongSaves( "BackUpAllSongSaves", false ); static const char *InstrumentTrackNames[] = { "Guitar", @@ -1451,6 +1457,7 @@ bool Song::IsMarathon() const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Song. */ class LunaSong: public Luna { public: diff --git a/src/Song.h b/src/Song.h index 942534491c..215e583d64 100644 --- a/src/Song.h +++ b/src/Song.h @@ -1,5 +1,3 @@ -/* Song - Holds all music metadata and steps for one song. */ - #ifndef SONG_H #define SONG_H @@ -18,11 +16,14 @@ class StepsID; struct lua_State; struct BackgroundChange; +/** @brief How many edits for this song can each profile have? */ const int MAX_EDITS_PER_SONG_PER_PROFILE = 5; +/** @brief How many edits for this song can be available? */ const int MAX_EDITS_PER_SONG = 5*NUM_ProfileSlot; extern const int FILE_CACHE_VERSION; +/** @brief The different background layers available. */ enum BackgroundLayer { BACKGROUND_LAYER_1, @@ -31,8 +32,10 @@ enum BackgroundLayer NUM_BackgroundLayer, BACKGROUND_LAYER_Invalid }; +/** @brief A custom foreach loop for the different background layers. */ #define FOREACH_BackgroundLayer( bl ) FOREACH_ENUM( BackgroundLayer, bl ) +/** @brief The different instrument tracks for band type games. */ enum InstrumentTrack { InstrumentTrack_Guitar, @@ -44,24 +47,26 @@ enum InstrumentTrack const RString& InstrumentTrackToString( InstrumentTrack it ); InstrumentTrack StringToInstrumentTrack( const RString& s ); +/** @brief The collection of lyrics for the Song. */ struct LyricSegment { - float m_fStartTime; - RString m_sLyric; - RageColor m_Color; + float m_fStartTime; /** @brief When does the lyric show up? */ + RString m_sLyric; /** @brief The lyrics themselves. */ + RageColor m_Color; /** @brief The color of the lyrics. */ }; +/** @brief Holds all music metadata and steps for one song. */ class Song { RString m_sSongDir; public: void SetSongDir( const RString sDir ) { m_sSongDir = sDir; } - // Set when this song should be displayed in the music wheel: + /** @brief When should this song should be displayed in the music wheel? */ enum SelectionDisplay { - SHOW_ALWAYS, // always - SHOW_NEVER // never (unless song hiding is turned off) + SHOW_ALWAYS, /**< always show on the wheel. */ + SHOW_NEVER /**< never show on the wheel (unless song hiding is turned off). */ } m_SelectionDisplay; Song(); @@ -69,34 +74,71 @@ public: void Reset(); void DetachSteps(); - // This one assumes the song is currently empty + /** + * @brief Load a song from the chosen directory. + * + * This assumes that there is no song present right now. + * @param sDir the song directory from which to load. */ bool LoadFromSongDir( RString sDir ); // This one takes the effort to reuse Steps pointers as best as it can bool ReloadFromSongDir( RString sDir ); - void TidyUpData(); // call after loading to clean up invalid data - void ReCalculateRadarValuesAndLastBeat(); // called by TidyUpData, and after saving - void TranslateTitles(); // called by TidyUpData + /** @brief Call this after loading a song to clean up invalid data. */ + void TidyUpData(); + + /** + * @brief Get the new radar values, and determine the last beat at the same time. + * + * This is called by TidyUpData, after saving the Song. */ + void ReCalculateRadarValuesAndLastBeat(); + /** + * @brief Translate any titles that aren't in english. + * + * This is called by TidyUpData. */ + void TranslateTitles(); + /** + * @brief Save to the new SSC file format. + * @param sPath the path where we're saving the file. + * @param bSavingCache a flag to determine if we're saving cache data. + */ bool SaveToSSCFile( RString sPath, bool bSavingCache ); - void Save(); // saves SSC and SM guaranteed. + /** @brief Save to the SSC and SM files no matter what. */ + void Save(); + /** + * @brief Save the current Song to a cache file using the preferred format. + * @return its success or failure. */ bool SaveToCacheFile(); + /** + * @brief Save the current Song to a SM file. + * @return its success or failure. */ bool SaveToSMFile(); + /** + * @brief Save the current Song to a DWI file if possible. + * @return its success or failure. */ bool SaveToDWIFile(); const RString &GetSongFilePath() const; RString GetCacheFilePath() const; void AddAutoGenNotes(); - void AutoGen( StepsType ntTo, StepsType ntFrom ); // create Steps of type ntTo from Steps of type ntFrom + /** + * @brief Automatically generate steps from one type to another. + * @param ntTo the StepsType we're making. + * @param ntFrom the StepsType we're generating from. + */ + void AutoGen( StepsType ntTo, StepsType ntFrom ); void RemoveAutoGenNotes(); // Directory this song data came from: const RString &GetSongDir() const { return m_sSongDir; } - /* Filename associated with this file. This will always have a .SSC - * extension. If we loaded a .SSC, this will point to it, but if we loaded - * any other type, this will point to a generated .SSC filename. */ + /** + * @brief Filename associated with this file. + * + * This will always have a .SSC extension. If we loaded a .SSC, + * this will point to it, but if we loaded any other type, + * this will point to a generated .SSC filename. */ RString m_sSongFileName; RString m_sGroupName; @@ -123,12 +165,15 @@ public: RString GetDisplayFullTitle() const; RString GetTranslitFullTitle() const; - // allow versioning with the song. + /** @brief The version of the song/file. */ float m_fVersion; RString m_sGenre; - // This is read and saved, but never actually used. + /** + * @brief The person who worked with the song file who should be credited. + * + * This is read and saved, but never actually used. */ RString m_sCredit; RString m_sMusicFile; @@ -148,6 +193,7 @@ public: //RString m_sJacketFile; // typically square (e.g. 192x192, 256x256) //RString m_sCDFile; // square (e.g. 128x128 [DDR 1st-3rd]) //RString m_sDiscFile; // rectangular (e.g. 256x192 [Pump], 200x150 [MGD3]) + /** @brief The location of the lyrics file, if it exists. */ RString m_sLyricsFile; RString m_sBackgroundFile; RString m_sCDTitleFile; @@ -196,7 +242,11 @@ public: const vector &GetForegroundChanges() const; vector &GetForegroundChanges(); - vector m_LyricSegments; // this must be sorted before gameplay + /** + * @brief The list of LyricSegments. + * + * This must be sorted before gameplay. */ + vector m_LyricSegments; void AddBPMSegment( const BPMSegment &seg ) { m_Timing.AddBPMSegment( seg ); } void AddStopSegment( const StopSegment &seg ) { m_Timing.AddStopSegment( seg ); } @@ -232,7 +282,12 @@ public: bool NormallyDisplayed() const; bool ShowInDemonstrationAndRanking() const; - void AddSteps( Steps* pSteps ); // we are responsible for deleting the memory pointed to by pSteps! + /** + * @brief Add the chosen Steps to the Song. + * + * We are responsible for deleting the memory pointed to by pSteps! + * @param pSteps the new steps. */ + void AddSteps( Steps* pSteps ); void DeleteSteps( const Steps* pSteps, bool bReAutoGen = true ); void FreeAllLoadedFromProfile( ProfileSlot slot = ProfileSlot_Invalid, const set *setInUse = NULL ); @@ -241,11 +296,13 @@ public: int GetNumStepsLoadedFromProfile( ProfileSlot slot ) const; bool IsEditAlreadyLoaded( Steps* pSteps ) const; - // An array of keysound file names (e.g. "beep.wav"). - // The index in this array corresponds to the index in TapNote. If you - // change the index in here, you must change all NoteData too. - // Any note that doesn't have a value in the range of this array - // means "this note doesn't have a keysound". + /** + * @brief An array of keysound file names (e.g. "beep.wav"). + * + * The index in this array corresponds to the index in TapNote. If you + * change the index in here, you must change all NoteData too. + * Any note that doesn't have a value in the range of this array + * means "this note doesn't have a keysound". */ vector m_vsKeysoundFile; CachedObject m_CachedObject; @@ -260,8 +317,10 @@ private: #endif -/* - * (c) 2001-2004 Chris Danford, Glenn Maynard +/** + * @file + * @author Chris Danford, Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 7ed727cd74..5f5376b8b7 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -16,6 +16,7 @@ #include "NoteSkinManager.h" #include "NotesLoaderDWI.h" #include "NotesLoaderSSC.h" +#include "NotesLoaderSM.h" #include "PrefsManager.h" #include "Profile.h" #include "ProfileManager.h" @@ -142,7 +143,6 @@ void SongManager::InitSongsFromDisk( LoadingWindow *ld ) LOG->Trace( "Found %d songs in %f seconds.", (int)m_pSongs.size(), tm.GetDeltaTime() ); } - static LocalizedString FOLDER_CONTAINS_MUSIC_FILES( "SongManager", "The folder \"%s\" appears to be a song folder. All song folders must reside in a group folder. For example, \"Songs/Originals/My Song\"." ); void SongManager::SanityCheckGroupDir( RString sDir ) const { @@ -186,11 +186,13 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName ) if( !arrayGroupBanners.empty() ) sBannerPath = sDir+arrayGroupBanners[0]; } - - // Group backgrounds are a bit trickier, and usually don't exist. - // However, for Background wheels, we support them. -aj - // background files MUST end in "-bg".ext in order to distinguish them. - // Yes hardcoding it sucks sometimes, but this is to keep my sanity. -aj + + /* Other group graphics are a bit trickier, and usually don't exist. + * A themer has a few options, namely checking the aspect ratio and + * operating on it. -aj + * TODO: Once the files are implemented in Song, bring the extensions + * from there into here. -aj */ + // Group background /* vector arrayGroupBackgrounds; GetDirListing( sDir+sGroupDirName+"/*-bg.png", arrayGroupBanners ); @@ -212,8 +214,10 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName ) sBackgroundPath = sDir+arrayGroupBackgrounds[0]; } */ + /* LOG->Trace( "Group banner for '%s' is '%s'.", sGroupDirName.c_str(), sBannerPath != ""? sBannerPath.c_str():"(none)" ); + */ m_sSongGroupNames.push_back( sGroupDirName ); m_sSongGroupBannerPaths.push_back( sBannerPath ); //m_sSongGroupBackgroundPaths.push_back( sBackgroundPath ); @@ -295,8 +299,7 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld ) LoadEnabledSongsFromPref(); } -// Instead of "symlinks", songs should have membership in multiple groups. -// -Chris +// Instead of "symlinks", songs should have membership in multiple groups. -Chris void SongManager::LoadGroupSymLinks(RString sDir, RString sGroupFolder) { // Find all symlink files in this folder @@ -306,9 +309,9 @@ void SongManager::LoadGroupSymLinks(RString sDir, RString sGroupFolder) SongPointerVector& index_entry = m_mapSongGroupIndex[sGroupFolder]; for( unsigned s=0; s< arraySymLinks.size(); s++ ) // for each symlink in this dir, add it in as a song. { - MsdFile msdF; + MsdFile msdF; msdF.ReadFile( sDir+sGroupFolder+"/"+arraySymLinks[s].c_str(), false ); // don't unescape - RString sSymDestination = msdF.GetParam(0,1); // Should only be 1 vale¶m...period. + RString sSymDestination = msdF.GetParam(0,1); // Should only be 1 value & param...period. Song* pNewSong = new Song; if( !pNewSong->LoadFromSongDir( sSymDestination ) ) @@ -458,10 +461,8 @@ RageColor SongManager::GetSongColor( const Song* pSong ) const } else { - - /* XXX: - * Previously, this matched all notes, which set a song to "extra" if - * it had any 10-foot steps at all, even edits or doubles. + /* XXX: Previously, this matched all notes, which set a song to "extra" + * if it had any 10-foot steps at all, even edits or doubles. * * For now, only look at notes for the current note type. This means * that if a song has 10-foot steps on Doubles, it'll only show up red @@ -469,8 +470,7 @@ RageColor SongManager::GetSongColor( const Song* pSong ) const * in the song scroll, which is a little odd but harmless. * * XXX: Ack. This means this function can only be called when we have - * a style set up, which is too restrictive. How to handle this? - */ + * a style set up, which is too restrictive. How to handle this? */ //const StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; const vector& vpSteps = pSong->GetAllSteps(); for( unsigned i=0; i { public: diff --git a/src/SpecialFiles.h b/src/SpecialFiles.h index 193de622a0..b8ef3faa5b 100644 --- a/src/SpecialFiles.h +++ b/src/SpecialFiles.h @@ -3,10 +3,20 @@ #ifndef SpecialFiles_H #define SpecialFiles_H +/** @brief The listing of the special files and directories in use. */ namespace SpecialFiles { - extern const RString USER_PACKAGES_DIR; // user packages should be a separate dir from system packages so that we can write to it (installing a package) - extern const RString PACKAGES_DIR; // system packages (not user packages) + /** + * @brief The user packages directory. + * + * This should be separate from system packages so that + * we can write to it (installing a package). + */ + extern const RString USER_PACKAGES_DIR; + /** @brief The system packages directory. + * + * This is not the user packages directory. */ + extern const RString PACKAGES_DIR; extern const RString KEYMAPS_PATH; extern const RString PREFERENCES_INI_PATH; extern const RString THEMES_DIR; @@ -25,8 +35,10 @@ namespace SpecialFiles #endif -/* - * (c) 2003-2005 Chris Danford +/** + * @file + * @author Chris Danford (c) 2003-2005 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Sprite.cpp b/src/Sprite.cpp index 25a7033a1d..e91aa9bfbd 100644 --- a/src/Sprite.cpp +++ b/src/Sprite.cpp @@ -14,7 +14,7 @@ #include "LuaBinding.h" #include "LuaManager.h" -REGISTER_ACTOR_CLASS( Sprite ) +REGISTER_ACTOR_CLASS( Sprite ); Sprite::Sprite() @@ -1084,6 +1084,7 @@ void Sprite::AddImageCoords( float fX, float fY ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Sprite. */ class LunaSprite: public Luna { public: diff --git a/src/Sprite.h b/src/Sprite.h index effefd073e..756d6fe6b7 100644 --- a/src/Sprite.h +++ b/src/Sprite.h @@ -1,4 +1,4 @@ -/* Sprite - A bitmap Actor that animates and moves around. */ +/** @brief Sprite - A bitmap Actor that animates and moves around. */ #ifndef SPRITE_H #define SPRITE_H @@ -61,8 +61,12 @@ public: void SetEffectMode( EffectMode em ) { m_EffectMode = em; } void SetTexCoordVelocity(float fVelX, float fVelY); - // Scale the Sprite maintaining the aspect ratio so that it fits - // within (fWidth,fHeight) and is clipped to (fWidth,fHeight). + /** + * @brief Scale the Sprite while maintaining the aspect ratio. + * + * It has to fit within and become clipped to the given parameters. + * @param fWidth the new width. + * @param fHeight the new height. */ void ScaleToClipped( float fWidth, float fHeight ); void CropTo( float fWidth, float fHeight ); static bool IsDiagonalBanner( int iWidth, int iHeight ); @@ -82,14 +86,17 @@ private: RageTexture* m_pTexture; + /** @brief The Sprite's present state. */ struct State { RectF rect; - float fDelay; // "seconds to show" + /** @brief The number of "seconds to show". */ + float fDelay; }; vector m_States; int m_iCurState; - float m_fSecsIntoState; // number of seconds that have elapsed since we switched to this frame + /** @brief The number of seconds that have elapsed since we switched to this frame. */ + float m_fSecsIntoState; EffectMode m_EffectMode; bool m_bUsingCustomTexCoords; @@ -106,8 +113,10 @@ private: #endif -/* - * (c) 2001-2004 Chris Danford +/** + * @file + * @author Chris Danford (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/StageStats.cpp b/src/StageStats.cpp index b7c5398eb4..131847e188 100644 --- a/src/StageStats.cpp +++ b/src/StageStats.cpp @@ -331,6 +331,7 @@ int StageStats::GetMinimumMissCombo() const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the StageStats. */ class LunaStageStats: public Luna { public: diff --git a/src/StageStats.h b/src/StageStats.h index 6b4ae273a6..842c3bba54 100644 --- a/src/StageStats.h +++ b/src/StageStats.h @@ -1,5 +1,3 @@ -/* StageStats - Contains statistics for one stage of play - either one song, or a whole course. */ - #ifndef StageStats_H #define StageStats_H @@ -9,7 +7,10 @@ class Song; class Style; struct lua_State; - +/** + * @brief Contains statistics for one stage of play. + * + * This is either one song, or a whole course. */ class StageStats { public: @@ -34,13 +35,24 @@ public: vector m_vpPossibleSongs; EarnedExtraStage m_EarnedExtraStage; - bool m_bGaveUp; // exited gameplay by giving up - bool m_bUsedAutoplay; // used autoplay at any point during gameplay + /** @brief Was the gameplay exited by the Player giving up? */ + bool m_bGaveUp; + /** @brief Did the PLayer use Autoplay at any point during gameplay? */ + bool m_bUsedAutoplay; // TODO: These are updated in ScreenGameplay::Update based on fDelta. // They should be made more accurate. - float m_fGameplaySeconds; // how many seconds before gameplay ended. Updated by Gameplay, not scaled by music rate. - float m_fStepsSeconds; // this is <= fGameplaySeconds unless the song has steps past the end + /** + * @brief How many seconds were there before gameplay ended? + * + * This is updated by Gameplay, and not scaled by the music rate. */ + float m_fGameplaySeconds; + /** + * @brief How many seconds are we in a song? + * + * This is equivalent to m_fGameplaySeconds unless the song has steps past the end. */ + float m_fStepsSeconds; + /** @brief How fast was the music going compared to normal? */ float m_fMusicRate; // Total number of seconds between first beat and last beat for every song. @@ -50,6 +62,10 @@ public: PlayerStageStats m_multiPlayer[NUM_MultiPlayer]; void FinalizeScores( bool bSummary ); + /** + * @brief Determine if the PlayerNumber has a high score. + * @param pn the PlayerNumber in question. + * @return true if the PlayerNumber has a high score, false otherwise. */ bool PlayerHasHighScore( PlayerNumber pn ) const; int GetMinimumMissCombo() const; @@ -59,8 +75,10 @@ public: #endif -/* - * (c) 2001-2004 Chris Danford, Glenn Maynard +/** + * @file + * @author Chris Danford, Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/StatsManager.cpp b/src/StatsManager.cpp index 4adb292214..f3cc714ba0 100644 --- a/src/StatsManager.cpp +++ b/src/StatsManager.cpp @@ -345,6 +345,7 @@ void StatsManager::GetStepsInUse( set &apInUseOut ) const // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the StatsManager. */ class LunaStatsManager: public Luna { public: diff --git a/src/StdString.h b/src/StdString.h index f92cd07a65..cb13bbb796 100644 --- a/src/StdString.h +++ b/src/StdString.h @@ -1,5 +1,3 @@ -/** @brief StdString - std::string convenience wrapper. */ - // ============================================================================= // FILE: StdString.h // AUTHOR: Joe O'Leary (with outside help noted in comments) @@ -122,29 +120,29 @@ void MakeLower( char *p, size_t iLen ); void MakeUpper( wchar_t *p, size_t iLen ); void MakeLower( wchar_t *p, size_t iLen ); -// ============================================================================= -// INLINE FUNCTIONS ON WHICH CSTDSTRING RELIES -// -// Usually for generic text mapping, we rely on preprocessor macro definitions -// to map to string functions. However the CStdStr<> template cannot use -// macro-based generic text mappings because its character types do not get -// resolved until template processing which comes AFTER macro processing. In -// other words, UNICODE is of little help to us in the CStdStr template -// -// Therefore, to keep the CStdStr declaration simple, we have these inline -// functions. The template calls them often. Since they are inline (and NOT -// exported when this is built as a DLL), they will probably be resolved away -// to nothing. -// -// Without these functions, the CStdStr<> template would probably have to broken -// out into two, almost identical classes. Either that or it would be a huge, -// convoluted mess, with tons of "if" statements all over the place checking the -// size of template parameter CT. -// -// In several cases, you will see two versions of each function. One version is -// the more portable, standard way of doing things, while the other is the -// non-standard, but often significantly faster Visual C++ way. -// ============================================================================= +/** + * @brief Inline functions on which CStdString relies on. + * + * Usually for generic text mapping, we rely on preprocessor macro definitions + * to map to string functions. However the CStdStr<> template cannot use + * macro-based generic text mappings because its character types do not get + * resolved until template processing which comes AFTER macro processing. In + * other words, UNICODE is of little help to us in the CStdStr template. + * + * Therefore, to keep the CStdStr declaration simple, we have these inline + * functions. The template calls them often. Since they are inline (and NOT + * exported when this is built as a DLL), they will probably be resolved away + * to nothing. + * + * Without these functions, the CStdStr<> template would probably have to broken + * out into two, almost identical classes. Either that or it would be a huge, + * convoluted mess, with tons of "if" statements all over the place checking the + * size of template parameter CT. + * + * In several cases, you will see two versions of each function. One version is + * the more portable, standard way of doing things, while the other is the + * non-standard, but often significantly faster Visual C++ way. + */ namespace StdString { // ----------------------------------------------------------------------------- diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 2e8ee2af5c..8e91a5e6b6 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -1291,7 +1291,7 @@ bool HandleGlobalInputs( const InputEventPlus &input ) SCREENMAN->SystemMessage( SERVICE_SWITCH_PRESSED ); SCREENMAN->PopAllScreens(); GAMESTATE->Reset(); - SCREENMAN->SetNewScreen( "ScreenOptionsService" ); + SCREENMAN->SetNewScreen( CommonMetrics::OPERATOR_MENU_SCREEN ); } return true; @@ -1432,7 +1432,7 @@ bool HandleGlobalInputs( const InputEventPlus &input ) void HandleInputEvents(float fDeltaTime) { INPUTFILTER->Update( fDeltaTime ); - + /* Hack: If the topmost screen hasn't been updated yet, don't process input, since * we must not send inputs to a screen that hasn't at least had one update yet. (The * first Update should be the very first thing a screen gets.) We'll process it next @@ -1455,6 +1455,7 @@ void HandleInputEvents(float fDeltaTime) swap( input.InputList, ieArray[i].m_ButtonState ); // hack for testing (MultiPlayer) with only one joystick + /* if( input.DeviceI.IsJoystick() ) { if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD,KEY_LSHIFT) ) ) @@ -1468,6 +1469,7 @@ void HandleInputEvents(float fDeltaTime) if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD,KEY_RCTRL) ) ) input.DeviceI.device = (InputDevice)(input.DeviceI.device + 16); } + */ INPUTMAPPER->DeviceToGame( input.DeviceI, input.GameI ); diff --git a/src/StepMania.h b/src/StepMania.h index 04aa4754bc..d5e66b1890 100644 --- a/src/StepMania.h +++ b/src/StepMania.h @@ -7,6 +7,7 @@ class VideoModeParams; int main( int argc, char* argv[] ); +/** @brief Utility functions for controlling the whole game. */ namespace StepMania { void ApplyGraphicOptions(); diff --git a/src/Steps.cpp b/src/Steps.cpp index 852c5b0b47..ff6ef6ce04 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -319,6 +319,7 @@ void Steps::DeAutogen( bool bCopyNoteData ) Decompress(); // fills in m_pNoteData with sliding window transform m_sDescription = Real()->m_sDescription; + m_sChartStyle = Real()->m_sChartStyle; m_Difficulty = Real()->m_Difficulty; m_iMeter = Real()->m_iMeter; copy( Real()->m_CachedRadarValues, Real()->m_CachedRadarValues + NUM_PLAYERS, m_CachedRadarValues ); @@ -372,6 +373,12 @@ void Steps::SetCredit( RString sCredit ) m_sCredit = sCredit; } +void Steps::SetChartStyle( RString sChartStyle ) +{ + DeAutogen(); + m_sChartStyle = sChartStyle; +} + bool Steps::MakeValidEditDescription( RString &sPreferredDescription ) { if( int(sPreferredDescription.size()) > MAX_EDIT_STEPS_DESCRIPTION_LENGTH ) diff --git a/src/Steps.h b/src/Steps.h index 532857381a..e87dfef458 100644 --- a/src/Steps.h +++ b/src/Steps.h @@ -67,6 +67,11 @@ public: * @return the description used for this edit. */ RString GetDescription() const { return Real()->m_sDescription; } + /** + * @brief Retrieve the ChartStyle used for this chart. + * @return the description used for this chart. + */ + RString GetChartStyle() const { return Real()->m_sChartStyle; } /** * @brief Retrieve the difficulty used for this edit. * @return the difficulty used for this edit. @@ -92,6 +97,7 @@ public: void SetDescription( RString sDescription ) { SetDifficultyAndDescription( this->GetDifficulty(), sDescription ); } void SetDifficultyAndDescription( Difficulty dc, RString sDescription ); void SetCredit( RString sCredit ); + void SetChartStyle( RString sChartStyle ); static bool MakeValidEditDescription( RString &sPreferredDescription ); // return true if was modified void SetLoadedFromProfile( ProfileSlot slot ) { m_LoadedFromProfile = slot; } @@ -146,6 +152,8 @@ private: /** @brief The name of the edit, or some other useful description. This used to also contain the step author's name. */ RString m_sDescription; + /** @brief The style of the chart. (e.g. "Pad", "Keyboard") */ + RString m_sChartStyle; /** @brief The difficulty that these steps are assigned to. */ Difficulty m_Difficulty; /** @brief The numeric difficulty of the Steps, ranging from MIN_METER to MAX_METER. */ diff --git a/src/StepsDisplay.cpp b/src/StepsDisplay.cpp index 92c3639d4e..16e4d300ff 100644 --- a/src/StepsDisplay.cpp +++ b/src/StepsDisplay.cpp @@ -127,12 +127,7 @@ void StepsDisplay::SetFromGameState( PlayerNumber pn ) if( pTrail ) SetFromTrail( pTrail ); else - { - // why was it pTrail->m_CourseType as the last argument when pTrail - // can't possibly exist here? -aj - //pTrail = GAMESTATE->m_pPreferredCourse->GetTrail(GAMESTATE->m_PreferredStepsType, GAMESTATE->m_PreferredCourseDifficulty[pn]); SetFromStepsTypeAndMeterAndDifficultyAndCourseType( StepsType_Invalid, 0, GAMESTATE->m_PreferredCourseDifficulty[pn], CourseType_Invalid ); - } } else { @@ -272,6 +267,7 @@ void StepsDisplay::SetInternal( const SetParams ¶ms ) // lua start #include "LuaBinding.h" +/** @brief Allow Lua to have access to the StepsDisplay. */ class LunaStepsDisplay: public Luna { public: diff --git a/src/StepsUtil.h b/src/StepsUtil.h index f84c5b660e..628f01c6ed 100644 --- a/src/StepsUtil.h +++ b/src/StepsUtil.h @@ -11,19 +11,43 @@ class Profile; class XNode; class SongCriteria; +/** @brief the criteria for finding certain Steps. */ class StepsCriteria { public: - Difficulty m_difficulty; // don't filter if Difficulty_Invalid - int m_iLowMeter; // don't filter if -1 - int m_iHighMeter; // don't filter if -1 + /** + * @brief the Difficulty to search for. + * + * Don't filter here if the Difficulty is Difficulty_Invalid. */ + Difficulty m_difficulty; + /** + * @brief The lowest meter to search for. + * + * Don't filter here if the meter is -1. */ + int m_iLowMeter; + /** + * @brief The highest meter to search for. + * + * Don't filter here if the meter is -1. */ + int m_iHighMeter; // Currently, Songs have BPM since TimingData is by Song. These are just // here for the inevitable chart-based BPMs future. -aj // float m_fLowBPM; // don't filter if -1 // float m_fHighBPM; // don't filter if -1 - StepsType m_st; // don't filter if StepsType_Invalid - enum Locked { Locked_Locked, Locked_Unlocked, Locked_DontCare } m_Locked; + /** + * @brief the step type to search for. + * + * Don't filter here if the StepsType is StepsType_Invalid. */ + StepsType m_st; + /** @brief Check a song's locked status for searching. */ + enum Locked + { + Locked_Locked, /**< We want songs that are locked. */ + Locked_Unlocked, /**< We want songs that are unlocked. */ + Locked_DontCare /**< We don't care if the songs are locked or not. */ + } /** @brief The Song's locked status. */ m_Locked; + /** @brief Set up the initial criteria. */ StepsCriteria() { m_difficulty = Difficulty_Invalid; @@ -35,32 +59,89 @@ public: m_Locked = Locked_DontCare; } + /** + * @brief Determine if the Song and Steps match our criteria. + * @param pSong the Song to check for. + * @param pSteps the Step to check for. + * @return true if it matches, false otherwise. + */ bool Matches( const Song *pSong, const Steps *pSteps ) const; + /** + * @brief Compare two StepsCriteria to see if they are equal. + * @param other the StepsCriteria we are checking against. + * @return true if they are equal, false otherwise. */ bool operator==( const StepsCriteria &other ) const { #define X(x) (x == other.x) return X(m_difficulty) && X(m_iLowMeter) && X(m_iHighMeter) && X(m_st) && X(m_Locked); #undef X } + /** + * @brief Compare two StepsCriteria to see if they are not equal. + * @param other the StepsCriteria we are checking against. + * @return true if they are not equal, false otherwise. */ bool operator!=( const StepsCriteria &other ) const { return !operator==( other ); } }; +/** @brief A Song and one of its Steps. */ class SongAndSteps { public: + /** @brief the Song we're using. */ Song *pSong; + /** @brief the Steps we're using. */ Steps *pSteps; + /** @brief Set up a blank Song and + * Step. */ SongAndSteps() : pSong(NULL), pSteps(NULL) { } + /** + * @brief Set up the specified Song and + * Step. + * @param pSong_ the new Song. + * @param pSteps_ the new Step. */ SongAndSteps( Song *pSong_, Steps *pSteps_ ) : pSong(pSong_), pSteps(pSteps_) { } + /** + * @brief Compare two sets of Songs and Steps to see if they are equal. + * @param other the other set of SongAndSteps. + * @return true if the two sets of Songs and Steps are equal, false otherwise. */ bool operator==( const SongAndSteps& other ) const { return pSong==other.pSong && pSteps==other.pSteps; } + /** + * @brief Compare two sets of Songs and Steps to see if they are not equal. + * @param other the other set of SongAndSteps. + * @return true if the two sets of Songs and Steps are not equal, false otherwise. */ bool operator<( const SongAndSteps& other ) const { if( pSong!=other.pSong ) return pSong &out ); // look up in SONGMAN + /** + * @brief Retrieve all of the Steps that match the criteria. + * @param pSong the Song we're checking in. + * @param stc the StepsCriteria to look for. + * @param out the SongsAndSteps that match. + */ void GetAllMatching( Song *pSong, const StepsCriteria &stc, vector &out ); + /** + * @brief Is there a Step + * that matches the criteria? + * @param soc the SongCriteria to look for. + * @param stc the StepsCriteria to look for. + * @return true if we find a match, false otherwise. */ bool HasMatching( const SongCriteria &soc, const StepsCriteria &stc ); + /** + * @brief Is there a Step + * that matches the criteria? + * @param pSong the Song we're checking in. + * @param stc the StepsCriteria to look for. + * @return true if we find a match, false otherwise. */ bool HasMatching( const Song *pSong, const StepsCriteria &stc ); bool CompareNotesPointersByRadarValues(const Steps* pSteps1, const Steps* pSteps2); @@ -103,8 +184,10 @@ public: #endif -/* - * (c) 2001-2004 Chris Danford, Glenn Maynard +/** + * @file + * @author Chris Danford, Glenn Maynard (c) 2001-2004 + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Style.cpp b/src/Style.cpp index b8a41a8dbd..b6b98f6558 100644 --- a/src/Style.cpp +++ b/src/Style.cpp @@ -114,6 +114,7 @@ RString Style::ColToButtonName( int iCol ) const // Lua bindings #include "LuaBinding.h" +/** @brief Allow Lua to have access to the Style. */ class LunaStyle: public Luna