Compare commits

..

13 Commits

Author SHA1 Message Date
Kevin Granade ebd2393682 Workaround for #4497 sigsegv in vehicles on fire
Basically skips all code where the game attempts to act on invalid vector
elements, eg myVector[randomNumber(0, size)] when size==0.

Conflicts:

	vehicle.cpp
2013-11-19 20:35:30 -06:00
Thomas Kirsten ad36ed99bc add check for swimmable terrain instead of only impassable 2013-11-19 20:29:03 -06:00
Kevin Granade 52de32f389 Merge bounds fix when creating portals. 2013-11-17 17:22:58 -06:00
Tommy 6f1e06c346 Update .pot header for compatibility with old msgfmt. 2013-11-17 16:43:21 -06:00
Tommy df9771bc72 Only eat .pot header if header exists. 2013-11-17 16:43:21 -06:00
Vlasov Vitaly a09a6a73a3 fix msgfmt errors and warnings 2013-11-17 16:43:21 -06:00
Vlasov Vitaly a002748ce3 xgettext call indentation 2013-11-17 16:43:21 -06:00
Tommy a1d54dd4bb Merge loading fix for old save files. 2013-11-17 16:05:16 +13:00
Rivet-the-Zombie 1dabedc650 Fixes typo in the MOTD. 2013-11-16 12:43:17 +00:00
Kevin Granade c9b6fe0543 Checking in latest TsuTiles on the behalf of Tsu. 2013-11-16 00:20:21 -06:00
Kevin Granade c0d0e01fd5 Handle loading old version of disease saves. 2013-11-15 23:50:30 -06:00
Kevin Granade da6f01f693 Save and restore save file version to preserve it across map loading. 2013-11-15 23:49:36 -06:00
Kevin Granade 1d2420c24f Initialize some variables to avoid infinite loops when processing some faction files. 2013-11-15 23:48:46 -06:00
8035 changed files with 1105340 additions and 15309862 deletions
-56
View File
@@ -1,56 +0,0 @@
# These options are mirrored in .astylerc and doc/CODE_STYLE.txt
# "One True Brace Style"
--style=1tbs
# Attach brackets to class and struct inline function definitions.
--attach-inlines
# 4 spaces per indentation level and per tab stop
--indent=spaces=4
# 'char *foo' instead of 'char* foo'
--align-pointer=name
# maximum length for a single unbroken line
--max-code-length=100
# 'foo ||\nbar' instead of 'foo\n|| bar'
--break-after-logical
# indent 'public:' 'protected:' 'private:' deeper than 'class' or 'struct'
--indent-classes
# indent 'case' lines deeper than 'switch'
--indent-switches
# indent later lines of multi-line preprocessor directives
# to be deprecated by --indent-preproc-define
--indent-preprocessor
# indent comments on column 1 to match the code block they are in
--indent-col1-comments
# indent multi-line control block headers like 'if (foo\nbar)'
--min-conditional-indent=0
# add space around operators with two operands
--pad-oper
# add brackets to unbracketed one line conditional statements
--add-brackets
# replaces tabs with spaces in non-indent sections, except in strings
--convert-tabs
# remove extra space padding around parentheses
--unpad-paren
# insert space padding around parentheses on the inside only
--pad-paren-in
# exclude src/third-party
--exclude=src/third-party
# but don't be sad about no tests/src/third-party
--ignore-exclude-errors-x
-77
View File
@@ -1,77 +0,0 @@
# Enable some categories of checks and then disable individual ones.
# The disabled checks that appear as part of the initial alphabetical section
# enabling categories (e.g. cert-err58-cpp) are ones that do not make sense for
# this codebase and we do not intend to fix. The disabled checks appearing
# thereafter in a separate alphabetical list have yet to be triaged. We may
# fix their errors or recategorise them as checks we don't care about.
#
# Comments on the checks we have decided are not worthwhile:
#
# * cert-dcl21-cpp (postfix operator++ and operator-- should return const objects)
# This is an unconventional code style, and conflicts with
# readability-const-return-type.
#
# * cert-env33-c (calls to system, popen)
# Unlikely to catch bugs, and using system is convenient for portability.
#
# * cert-err58-cpp (exceptions from static variable declarations)
# We have lots of memory allocations in static variable declarations, and
# that's fine.
#
# * modernize-use-auto
# We prefer an almost-always-avoid-auto style.
#
# * modernize-use-trailing-return-type
# An arbitrary style convention we haven't adopted.
#
# * readability-braces-around-statements
# Covered by astyle and buggy in clang-tidy 8. Can enable once we have a newer
# clang-tidy.
Checks: "\
bugprone-*,\
cata-*,\
cert-*,\
-cert-dcl21-cpp,\
-cert-env33-c,\
-cert-err58-cpp,\
clang-diagnostic-*,\
cppcoreguidelines-slicing,\
google-explicit-constructor,\
llvm-namespace-comment,\
misc-*,\
modernize-*,\
-modernize-use-auto,\
-modernize-use-trailing-return-type,\
performance-*,\
readability-*,\
-readability-braces-around-statements,\
-bugprone-narrowing-conversions,\
-misc-no-recursion,\
-misc-non-private-member-variables-in-classes,\
-modernize-pass-by-value,\
-modernize-return-braced-init-list,\
-modernize-use-default-member-init,\
-modernize-use-nodiscard,\
-readability-convert-member-functions-to-static,\
-readability-else-after-return,\
-readability-function-cognitive-complexity,\
-readability-implicit-bool-conversion,\
-readability-magic-numbers,\
-readability-named-parameter,\
-readability-use-anyofallof,\
"
WarningsAsErrors: '*'
HeaderFilterRegex: '(src|test|tools).*'
FormatStyle: none
CheckOptions:
- key: cata-large-inline-function.MaxStatements
value: 5
- key: cata-text-style.EscapeUnicode
value: 0
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: true
- key: readability-uppercase-literal-suffix.NewSuffixes
value: 'L;UL;LL;ULL'
# vim:tw=0
-43
View File
@@ -1,43 +0,0 @@
# options affecting formatting
format:
# how wide to allow formatted cmake files
line_width: 100
# how many spaces to tab for indent
tab_size: 4
# if true, separate flow control names from their parentheses
separate_ctrl_name_with_space: true # currently ignored by cmake-lint
# if true, separate function names from parentheses with a
separate_fn_name_with_space: false # currently ignored by cmake-lint
# if a statement is wrapped to more than one line, than dangle
# the closing parenthesis on its own line.
dangle_parens: false # currently ignored by cmake-lint
# Format command names consistently as 'lower' or 'upper' case
# 'canonical': like in official documentation
command_case: 'canonical' # currently ignored by cmake-lint
# Format keywords consistently as 'lower' or 'upper' case
keyword_case: 'upper' # currently ignored by cmake-lint
# options affecting comment reflow and formatting
markup:
# enable comment markup parsing and reflow
enable_markup: false
# options affecting linter
lint:
# list of lint codes to disable
# C0113: Missing COMMENT in statement which allows it
disabled_codes: ['C0113']
# regular expression pattern describing valid function names
function_pattern: '[a-z_]+'
# regular expression pattern describing valid names for private variables
# WEIRD: strangely named "directory variable name" in lint output
private_var_pattern: '_[0-9A-Z_]+'
# regular expression pattern describing valid names for public variables (strangely named "directories"?)
# WEIRD: strangely named "directory variable name" in lint output
public_var_pattern: '[0-9A-Z]+'
# regular expression pattern describing valid macro names
macro_pattern: '[a-z_]+'
# regular expression pattern describing valid names for function/macro
# arguments and loop variables
argument_var_pattern: '[A-Z][A-Z0-9_]+'
# require no more than this many newlines between statements
max_statement_spacing: 2
-18
View File
@@ -1,18 +0,0 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
[*.json]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8
-11
View File
@@ -1,11 +0,0 @@
[flake8]
exclude = .git,__pycache__,lang/json
ignore =
# E265 forces comments to have a space after the '#'. We have a bunch of
# optional debugging code commented out this way, and not having a space is
# a convenient way to distinguish it from proper comments. Maybe we should
# delete that code, but unless that happens leaving E265 disabled.
E265,
# W503 and W504 require line breaks after or before binary operators; you
# can only have one enabled
W504
-39
View File
@@ -1,39 +0,0 @@
# Automatically normalize line endings for all files
# detected as text (Convert CRLF => LF).
* text=auto
# Explicitly normalize files with these extensions in
# case Git doesn't detect them as text for some reason.
*.c text
*.cbp text
*.cpp text
*.h text
*.json text
*.md text
*.py text
*.rc text
*.sh text
*.txt text
*.yml text
# Visual Studio project files, leave them alone.
*.cmd -text
*.filters -text
*.sln -text
*.user -text
*.vcxproj -text
# Generated translation text, don't mess with them.
*.mo -text
*.po -text
*.pot -text
# Treat images, archives, and font files as binary.
# (binary is a macro for -text -diff)
*.db binary
*.fon binary
*.gz binary
*.ico binary
*.png binary
*.ttf binary
-31
View File
@@ -1,31 +0,0 @@
#Note that despite github calling these "owners", a better term would be "alerts"
#Everything in the cataclysm repository remains under a creative commons license, nobody owns the mods.
#In fact, the code "owners" designation is meant to encourage third party
#individuals to contribute to the mod, with the curators notified for reviews.
/data/mods/Aftershock/ @Maleclypse @John-Candlebury @Mom-Bun
/data/mods/DinoMod/ @ephemeralstoryteller @damien @LyleSY
/data/mods/Graphical_Overmap/ @Kilvoctu @Larwck
/data/mods/MMA/ @Hymore246
/data/mods/blazemod/ @SouP
/data/mods/classic_zombies/ @I-am-Erk
/data/mods/crt_expansion/ @Soupster89
/data/mods/desertpack/ @davidpwbrown
/data/mods/generic_guns/ @tenmillimaster
/data/mods/Magiclysm/ @KorGgenT
/data/mods/My_Sweet_Cataclysm/ @Fris0uman
/data/mods/ruralbiome/ @I-am-Erk
/data/mods/speedydex/ @KorGgenT
/data/mods/stats_through_kills/ @KorGgenT
/data/mods/Xedra_Evolved/ @Maleclypse
/data/mods/Dark-Skies-Above/ @ephemeralstoryteller
/data/mods/No_Hope/ @Night-Pryanik
/data/mods/innawood/ @Light-Wave
/data/mods/MA/ @ZhilkinSerg
magic*.cpp @KorGgenT
magic*.h @KorGgenT
/tools/ @int-ua
/lang/ @BrettDong
widget.cpp @wapcaplet @dseguin
widget.h @wapcaplet @dseguin
-100
View File
@@ -1,100 +0,0 @@
name: Bug Report 🐛
description: Create a report to help us improve
labels: ["(S1 - Need confirmation)"]
body:
- type: markdown
attributes:
value: |
Please take the time to fill out all the fields below.
- type: textarea
id: description-of-bug
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
placeholder: There is no way for aim level to increase.
validations:
required: true
- type: textarea
id: save-file
attributes:
label: Attach save file
description: |
`ESC`Main Menu -> `b`Debug Menu -> `i`Info -> `!`Generate minimized save archive
placeholder: |
Write N/A if not applicable.
- this bug report is unlikely to get resolved without a save file, unless it's trivially
reproducible or the reproduction steps are complete.
validations:
required: true
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. Make a player with a gun, magazine, and some ammo.
2. Try to aim at a wall.
3. There's no way to increase aim level.
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: |
A clear and concise description of what you expected to happen.
Ideally also describe *why* you expect it to happen.
placeholder: I expected that aim level would increase, because all other skills can increase in level.
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: |
**If applicable**, add screenshots to help explain your problem.
Do not take a screenshot of the crashing window. Please provide the crash logs in the "Additional context"
validations:
required: false
- type: textarea
id: versions-and-config
attributes:
label: Versions and configuration
description: |
`ESC`Main Menu -> `b`Debug Menu -> `i`Info -> `r`Generate game report
placeholder: |
- OS: [e.g. iOS 8 or Windows 10 or Ubuntu 18.04]
- Game Version: [e.g. 0.C-29938-g90f5268437]
- Graphics version: [Tiles or Terminal]
- Ingame language: [Arabic or Bulgarian or Chinese (Simplified) or Chinese (Traditional) or Dutch or Esperanto or French or German or Italian (Italy) or Japanese or Korean or Polish or Portuguese (Brazil) or Russian or Serbian or Spanish (Argentina) or Spanish (Spain) or Turkish]
- Mods loaded: [e.g. dda, boats, hacktheplanet, StatsThroughSkills]
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the problem here.
placeholder: |
Crash: if your problem refers to a crash, please add the following files to the "Additional Context" paragraph:
- From the /config folder (you can zip them both together):
- crash.log file.
- debug.log file.
- Your save file (zipped)
- note #1: you can drag and drop files in this issue post!
- note #2: it is very important for us that you provide a save file in case of a crash. It really helps the developers
to reproduce the bug and fix it. If possible, try to provide a save file that occurs in the right conditions, just
before the crash happens.
validations:
required: false
-11
View File
@@ -1,11 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Tileset Issues
url: https://github.com/I-am-Erk/CDDA-Tilesets/issues
about: For issues concerning the built-in tilesets.
- name: Github Discussion
url: https://github.com/CleverRaven/Cataclysm-DDA/discussions
about: For nonspecific feature requests, balance concerns, and questions about the game, prefer opening a discussion to an issue.
- name: Project Forums
url: https://discourse.cataclysmdda.org/
about: For even more general discussion with the community, consider posting on the forums.
@@ -1,45 +0,0 @@
name: Feature Request ✨
description: Suggest an idea for this project
labels: ["<Suggestion / Discussion>"]
body:
- type: markdown
attributes:
value: |
Please take the time to fill out all the fields below.
- type: textarea
id: description-of-bug
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is that made you submit this report.
placeholder: I am always frustrated, when...
validations:
required: true
- type: textarea
id: description-of-solution
attributes:
label: Solution you would like.
description: A clear and concise description of what you want to happen.
placeholder: Instead of behaving like this, there should be...
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you have considered.
description: A clear and concise description of any alternative solutions or features you have considered.
placeholder: Another workaround that would work, is...
validations:
required: false
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature request here.
validations:
required: false
-40
View File
@@ -1,40 +0,0 @@
# https://github.com/rytswd/comvent
trigger: specific
# list of users allowed to use these commands, from labeling an issue in
# a specific way to mark as duplicate, closing issues, the sky is the limit
# TODO implement more commands, add more users
users:
active:
- casswedson
- Maleclypse
- Termineitor244
- Faalagorn
- Ilysen
- Aerin-of-the-Toast
- anoobindisguise
- PatrikLundell
- TheShadowFerret
- Jan-Blasiak
- MNG-cataclysm
- mqrause
- andrei8l
- haveric
- MylieDaniels
- nopenoperson
- Inglonias
- GuardianDll
- hexagonrecursion
- ANickelN
- a-chancey
- Cimanyd0
- LyranRenegade
- Stadler76
- sonphantrung
- sadenar
- RenechCDDA
- irwiss
keywords:
- name: confirm-bug
value: '\/(C|c)onfirm.*'
-273
View File
@@ -1,273 +0,0 @@
"[C++]":
- "**/*.cpp"
- "**/*.h"
"[JSON]":
- "**/*.json"
"[Markdown]":
- "**/*.md"
"Game: Achievements / Conducts / Scores":
- "**/scores**"
- "**/**statistics**"
- "**/statistics**"
- "**/**achievement**"
- "**/achievement**"
- "**/**conducts**"
- "**/conducts**"
"[Python]":
- "**/*.py"
"<Documentation>":
- "**/*.md"
- "doc/**"
- "doxygen_doc/**"
"Code: Tooling":
- ".github/**"
- "utilities/**"
- any: ['tools/**', '!tools/spell_checker/dictionary.txt']
"Code: Tests":
- "tests/**"
- "data/mods/TEST_DATA/**"
"Character / World Generation":
- "**/newcharacter**"
- "**/worldfactory**"
"Code: Build":
- "build-data/**"
- "build-scripts/**"
- "**/Makefile"
- "**/CMakeLists.txt"
- "**/*.cmake"
"Code: Infrastructure / Style / Static Analysis":
- .astylerc
- .clang-tidy
- .editorconfig
- .lgtm.yml
"Crafting / Construction / Recipes":
- "**/**crafting**"
- "**/crafting**"
- "**/**recipe**"
- "**/recipe**"
- "**/**construction**"
- "**/construction**"
"EOC: Effects On Condition":
- "**/**effect_on_condition**"
- "**/effect_on_condition**"
- "**/**eocs**"
- "**/eocs**"
- "**/condition**"
"Fields / Furniture / Terrain / Traps":
- "**/**furniture**"
- "**/furniture**"
- "**/**field**"
- "**/field**"
- "**/**terrain**"
- "**/terrain**"
- "**/**trap**"
- "**/trap**"
"Items: Food / Vitamins":
- "**/**food**"
- "**/food**"
- "**/**comestible**"
- "**/comestible**"
"NPC / Factions":
- "**/**npc**"
- "**/npc**"
- "**/**NPC**"
- "**/NPC**"
"Melee":
- "**/**melee**"
- "**/melee**"
- "**/**techniques**"
- "**/techniques**"
"Missions":
- "**/**mission**"
- "**/mission**"
"Info / User Interface":
- "src/**ui**"
- "**/ui/**"
- "**/**widget**"
- "**/widget**"
- "**/**view**"
- "**/view**"
"Items: Archery":
- "**/archery**"
- "**/crossbow**"
"Items: Armor / Clothing":
- "**/**armor**"
- "**/armor**"
- "**/armor/**"
"Items: Battery / UPS":
- "**/**battery**"
- "**/battery**"
"Items: Containers":
- "**/container**"
- "**/**pocket**"
- "**/pocket**"
- "**/**contents**"
- "**/contents**"
"Items: Magazines":
- "**/**magazine**"
- "**/magazine**"
"Appliance/Power Grid":
- "**/**appliance**"
- "**/appliance**"
"Monsters":
- "**/**monsters**"
- "**/monsters**"
"Mutations / Traits / Professions/ Hobbies":
- "**/**profession**"
- "**/profession**"
- "**/**mutations**"
- "**/mutation**"
- "**/hobbies**"
"Lore":
- data/json/npcs/BG_trait_groups.json
- data/json/npcs/Personality_trait_groups.json
- data/json/npcs/personality_traits.json
- "**/**Backgrounds**"
- "**/Backgrounds**"
- "**/**snippets**"
- "**/snippets**"
"Limbs":
- "**/**bodypart**"
- "**/bodypart**"
- "data/json/limb_scores.json"
"Spawn":
- "**/**itemgroup**"
- "**/itemgroup**"
- "**/itemgroups/**"
- "**/**monstergroup**"
- "**/monstergroup**"
- "**/monstergroups/**"
"Bionics":
- "**/bionic**"
- "**/**bionic**"
"Map / Mapgen":
- "**/**mapgen**"
- "**/mapgen**"
- "**/**overmap**"
- "**/overmap**"
"Martial Arts":
- "**/martialart**"
"Player Faction Base / Camp":
- "**/basecamp**"
- "**/faction_camp**"
"Items: Ammo / Guns":
- "**/**gun**"
- "**/gun**"
- "**/**ammo**"
- "**/ammo**"
"Items: Gunmod / Toolmod":
- "**/**gunmod**"
- "**/gunmod**"
- "**/**toolmod**"
- "**/toolmod**"
"SDL: Tiles / Sound":
- "gfx/**"
- "sound/**"
"Scenarios":
- "**/scenario**"
- "**/start_location**"
"Translation":
- "lang/**"
- "**/**translation**"
- "**/translation**"
"Mods: Aftershock":
- data/mods/Aftershock/**/*
- data/mods/aftershock_exoplanet/**/*
"Mods: Dark Days of the Dead":
- data/mods/classic_zombies/**/*
"Mods: Dark Skies":
- data/mods/Dark-Skies-Above/**/*
"Mods: Desert Region":
- data/mods/desert_region/**/*
"Mods: DinoMod":
- data/mods/DinoMod/**/*
"Mods: Generic Guns":
- data/mods/Generic_Guns/**/*
"Mods: MA":
- data/mods/MA/**/*
"Mods: MMA":
- data/mods/MMA/**/*
"Mods: Magiclysm":
- data/mods/Magiclysm/**/*
"Mods: Innawood 🌲":
- data/mods/innawood/**/*
"Mods: No Hope":
- data/mods/No_Hope/**/*
"Mods: TropiCataclysm 🌴":
- data/mods/TropiCataclysm/**/*
"Mods: Tamable Wildlife":
- data/mods/Tamable_Wildlife/**/*
"Mods: Xedra Evolved":
- data/mods/Xedra_Evolved/**/*
"Mods":
- any: [ 'data/mods/**' ]
all: [ '!data/mods/TEST_DATA/**' ]
"Mechanics: Enchantments / Spells":
- "**/**enchantment**"
- "**/enchantment**"
- "**/**spells**"
- "**/spells**"
- "**/Spells/**"
- any: ['**/**spell**', '!tools/**']
"Mechanics: Weather":
- "**/weather**"
"Vehicles":
- "**/**vehicle**"
- "**/vehicle**"
- "src/veh_**"
-46
View File
@@ -1,46 +0,0 @@
<!-- HOW TO USE: Under each "#### Heading" below, enter information relevant to your pull request.
Leave the headings unless they don't apply to your PR.
Please read carefully and don't delete the comments delimited by "< !--" and "-- >"
Once a pull request is submitted, automatic stylistic and consistency checks will be performed on the PR's changes.
The results of these can be either seen under the "Files changed" section of a PR or in the check's details.
NOTE: Please grant permission for repository maintainers to edit your PR. It is EXTREMELY common for PRs to be held up due to trivial changes being requested and the author being unavailable to make them. -->
#### Summary
Category "Brief description"
<!-- This section should consist of exactly one line, edit the one above.
1. Replace the word "Category" with one of these words: Features, Content, Interface, Mods, Balance, Bugfixes, Performance, Infrastructure, Build, I18N.
2. Replace the text inside the quotes with a brief description of your changes.
Or if you don't want a changelog entry, replace the whole line with just the word "None" (with no quotes).
For more on the meaning of each category, see:
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/CHANGELOG_GUIDELINES.md
If approved and merged, your summary will be added to the project changelog:
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/changelog.txt -->
#### Purpose of change
<!-- With a few sentences, describe your reasons for making this change. If it relates to an existing issue, you can link it with a # followed by the GitHub issue number, like #1234. If your pull request *fully* resolves an issue, include the word "Fix" or "Fixes" before the issue number, like: Fixes #xxxx
If there is no related issue, explain here what issue, feature, or other concern you are addressing. If this is a bugfix, include steps to reproduce the original bug, so your fix can be verified. -->
#### Describe the solution
<!-- How does the feature work, or how does this fix a bug? The easier you make your solution to understand, the faster it can get merged. -->
#### Describe alternatives you've considered
<!-- Explain any alternative solutions, different approaches, or possibilities you've considered using to solve the same problem. -->
#### Testing
<!-- Describe what steps you took to test that this PR resolved the bug or added the feature, and what tests you performed to make sure it didn't cause any regressions. Also include testing suggestions for reviewers and maintainers. -->
#### Additional context
<!-- Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature or bugfix here. -->
<!--README: Cataclysm: Dark Days Ahead is released under the Creative Commons Attribution ShareAlike 3.0 license.
The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever.
By contributing to the project you agree to the term of the license and that any contribution you make will also be covered by the same license.
See http://creativecommons.org/licenses/by-sa/3.0/ for details. -->
-42
View File
@@ -1,42 +0,0 @@
version: v1
labels:
- label: "<Enhancement / Feature>"
matcher:
body: "(\\s|^)#### Summary\\s*Features +\".+\"\\s*(\n|$)"
- label: "Info / User Interface"
matcher:
body: "(\\s|^)#### Summary\\s*Interface +\".+\"\\s*(\n|$)"
- label: "Mods"
matcher:
body: "(\\s|^)#### Summary\\s*Mods +\".+\"\\s*(\n|$)"
- label: "Game: Balance"
matcher:
body: "(\\s|^)#### Summary\\s*Balance +\".+\"\\s*(\n|$)"
- label: "<Bugfix>"
matcher:
body: "(\\s|^)#### Summary\\s*Bugfixes +\".+\"\\s*(\n|$)"
- label: "<Bugfix>"
matcher:
body: ".*((C|c)lose(s|d)?|(F|f)ix(es|ed)?|(R|r)esolve(s|d)?):? #([1-9][0-9]{3,6})(\\s*|$)"
- label: "Code: Performance"
matcher:
body: "(\\s|^)#### Summary\\s*Performance +\".+\"\\s*(\n|$)"
- label: "Code: Infrastructure / Style / Static Analysis"
matcher:
body: "(\\s|^)#### Summary\\s*Infrastructure +\".+\"\\s*(\n|$)"
- label: "Code: Build"
matcher:
body: "(\\s|^)#### Summary\\s*Build +\".+\"\\s*(\n|$)"
- label: "Translation"
matcher:
body: "(\\s|^)#### Summary\\s*I18N +\".+\"\\s*(\n|$)"
-13
View File
@@ -1,13 +0,0 @@
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 65a98efbe..2f99f28f1 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -352,7 +352,7 @@ endmacro()
# - HAVE_SDL_LOADSO opt
macro(CheckLibSampleRate)
if(SDL_LIBSAMPLERATE)
- find_package(SampleRate QUIET)
+ find_package(SampleRate CONFIG REQUIRED)
if(SampleRate_FOUND AND TARGET SampleRate::samplerate)
set(HAVE_LIBSAMPLERATE TRUE)
set(HAVE_LIBSAMPLERATE_H TRUE)
-130
View File
@@ -1,130 +0,0 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO akrieger/SDL
REF release-2.26.4_qrox_math
SHA512 aa8c0552ac92bbf85dd3f9339088ebd41e0d09b1d46492462b47b632bab5d850c62b7938950accbfb51798b9f5664c1896fc75bdb8dd42b2c1cee84eebd59e13
HEAD_REF main
PATCHES
deps.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SDL_SHARED)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" FORCE_STATIC_VCRT)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
vulkan SDL_VULKAN
x11 SDL_X11
wayland SDL_WAYLAND
samplerate SDL_LIBSAMPLERATE
ibus SDL_IBUS
)
if ("x11" IN_LIST FEATURES)
message(WARNING "You will need to install Xorg dependencies to use feature x11:\nsudo apt install libx11-dev libxft-dev libxext-dev\n")
endif()
if ("wayland" IN_LIST FEATURES)
message(WARNING "You will need to install Wayland dependencies to use feature wayland:\nsudo apt install libwayland-dev libxkbcommon-dev libegl1-mesa-dev\n")
endif()
if ("ibus" IN_LIST FEATURES)
message(WARNING "You will need to install ibus dependencies to use feature ibus:\nsudo apt install libibus-1.0-dev\n")
endif()
if(VCPKG_TARGET_IS_UWP)
set(configure_opts WINDOWS_USE_MSBUILD)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
${configure_opts}
OPTIONS ${FEATURE_OPTIONS}
-DSDL_STATIC=${SDL_STATIC}
-DSDL_SHARED=${SDL_SHARED}
-DSDL_FORCE_STATIC_VCRT=${FORCE_STATIC_VCRT}
-DSDL_LIBC=ON
-DSDL_TEST=OFF
-DSDL_INSTALL_CMAKEDIR="cmake"
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
-DSDL_LIBSAMPLERATE_SHARED=OFF
MAYBE_UNUSED_VARIABLES
SDL_FORCE_STATIC_VCRT
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/bin/sdl2-config"
"${CURRENT_PACKAGES_DIR}/debug/bin/sdl2-config"
"${CURRENT_PACKAGES_DIR}/SDL2.framework"
"${CURRENT_PACKAGES_DIR}/debug/SDL2.framework"
"${CURRENT_PACKAGES_DIR}/share/licenses"
"${CURRENT_PACKAGES_DIR}/share/aclocal"
)
file(GLOB BINS "${CURRENT_PACKAGES_DIR}/debug/bin/*" "${CURRENT_PACKAGES_DIR}/bin/*")
if(NOT BINS)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/bin"
"${CURRENT_PACKAGES_DIR}/debug/bin"
)
endif()
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP AND NOT VCPKG_TARGET_IS_MINGW)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/SDL2main.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/SDL2main.lib")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/SDL2maind.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/SDL2maind.lib")
endif()
file(GLOB SHARE_FILES "${CURRENT_PACKAGES_DIR}/share/sdl2/*.cmake")
foreach(SHARE_FILE ${SHARE_FILES})
vcpkg_replace_string("${SHARE_FILE}" "lib/SDL2main" "lib/manual-link/SDL2main")
endforeach()
endif()
vcpkg_copy_pdbs()
set(DYLIB_COMPATIBILITY_VERSION_REGEX "set\\(DYLIB_COMPATIBILITY_VERSION (.+)\\)")
set(DYLIB_CURRENT_VERSION_REGEX "set\\(DYLIB_CURRENT_VERSION (.+)\\)")
file(STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_COMPATIBILITY_VERSION REGEX ${DYLIB_COMPATIBILITY_VERSION_REGEX})
file(STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_CURRENT_VERSION REGEX ${DYLIB_CURRENT_VERSION_REGEX})
string(REGEX REPLACE ${DYLIB_COMPATIBILITY_VERSION_REGEX} "\\1" DYLIB_COMPATIBILITY_VERSION "${DYLIB_COMPATIBILITY_VERSION}")
string(REGEX REPLACE ${DYLIB_CURRENT_VERSION_REGEX} "\\1" DYLIB_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}")
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2main" "-lSDL2maind")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2 " "-lSDL2d ")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2-static " "-lSDL2-staticd ")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "-lSDL2-static " " ")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2-staticd " " ")
endif()
endif()
if(VCPKG_TARGET_IS_UWP)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "$<$<CONFIG:Debug>:d>.lib" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "-l-nodefaultlib:" "-nodefaultlib:")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "$<$<CONFIG:Debug>:d>.lib" "d")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-l-nodefaultlib:" "-nodefaultlib:")
endif()
endif()
vcpkg_fixup_pkgconfig()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
-8
View File
@@ -1,8 +0,0 @@
sdl2 provides CMake targets:
find_package(SDL2 CONFIG REQUIRED)
target_link_libraries(main
PRIVATE
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
)
-58
View File
@@ -1,58 +0,0 @@
{
"name": "sdl2",
"version": "2.26.4",
"description": "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.",
"homepage": "https://www.libsdl.org/download-2.0.php",
"license": "Zlib",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
"base"
],
"features": {
"base": {
"description": "Base functionality for SDL",
"dependencies": [
{
"name": "sdl2",
"default-features": false,
"features": [
"ibus",
"wayland",
"x11"
],
"platform": "linux"
}
]
},
"ibus": {
"description": "Build with ibus IME support",
"supports": "linux"
},
"samplerate": {
"description": "Use libsamplerate for audio rate conversion",
"dependencies": [
"libsamplerate"
]
},
"vulkan": {
"description": "Vulkan functionality for SDL"
},
"wayland": {
"description": "Build with Wayland support",
"supports": "linux"
},
"x11": {
"description": "Build with X11 support",
"supports": "!windows"
}
}
}
@@ -1,5 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_BUILD_TYPE release)
-5
View File
@@ -1,5 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_BUILD_TYPE release)
@@ -1,5 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_BUILD_TYPE release)
-5
View File
@@ -1,5 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_BUILD_TYPE release)
-43
View File
@@ -1,43 +0,0 @@
name: Clang Build Analyzer
on:
push:
branches:
- master
workflow_dispatch:
# Mixing in event_name so that a master push and a workflow dispatch can run at the same time.
concurrency: clang_build_analyzer-${{ github.event_name }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install dependencies
run: sudo apt-get install libncursesw5-dev gettext
- name: Prepare Build Analyzer
run: |
cd
git clone --recursive https://github.com/aras-p/ClangBuildAnalyzer.git buildAnalyzer
cd buildAnalyzer
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE ..
cmake --build . -- -j3
echo "${PWD}" >> $GITHUB_PATH
- uses: ammaraskar/gcc-problem-matcher@master
- name: make
run: |
ClangBuildAnalyzer --start .
CLANG=clang++-14 CXXFLAGS=-ftime-trace make
ClangBuildAnalyzer --stop . buildAnalysis
- name: Analyze
run: ClangBuildAnalyzer --analyze buildAnalysis
- uses: actions/upload-artifact@v2
with:
name: ClangBuildAnalyzer-traces
path: "**/obj/*.json"
@@ -1,16 +0,0 @@
name: Detect missions that are missing .start.assign_mission_target.om_special
on:
pull_request:
paths:
- '**.json'
permissions:
contents: read
jobs:
run-the-tool:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: ./tools/json_tools/assign_mission_target_needs_om_special.bash 2>&1
-45
View File
@@ -1,45 +0,0 @@
name: astyle
on: pull_request
jobs:
skip-duplicates:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
paths: '[".github/workflows/astyle.yml", "Makefile", ".astylerc", "**.cpp", "**.h", "**.c"]'
- run: echo ${{ github.event.number }} > pull_request_id
- uses: actions/upload-artifact@v2
with:
name: pull_request_id
path: pull_request_id
astyle-code:
name: astyle check
needs: skip-duplicates
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: sudo apt-get install astyle
- name: astyle check
run: make astyle-check
- name: Format
if: failure()
run: make astyle-fast
- name: Display Corrections
if: failure()
run: git diff --color
-24
View File
@@ -1,24 +0,0 @@
name: Check pull request head branch name
on:
pull_request_target:
types:
- opened
jobs:
check_branch_name:
runs-on: ubuntu-latest
if: github.head_ref == 'master' && github.repository == 'CleverRaven/Cataclysm-DDA'
steps:
- name: Post warning
uses: actions/github-script@v6.3.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: "You are creating a pull request with the master branch as the head branch. This is likely a mistake unless you really know what you are doing. You may read https://docs.github.com/en/get-started/quickstart/contributing-to-projects#creating-a-branch-to-work-on for a typical workflow of contributing to a project on GitHub."
});
-24
View File
@@ -1,24 +0,0 @@
name: Check printf format string in translations
on:
pull_request:
paths:
- 'lang/po/*.po'
- 'tools/check_po_printf_format.py'
permissions:
contents: read
jobs:
check-po-printf:
runs-on: ubuntu-20.04
steps:
- name: "Install dependencies"
run: |
sudo apt-get update
sudo apt-get install python3-pip
sudo pip3 install polib
- name: "Checkout"
uses: actions/checkout@v2
- name: "Check printf format string in translations"
run: ./tools/check_po_printf_format.py
-77
View File
@@ -1,77 +0,0 @@
name: Clang-tidy (clang-12, tiles)
on:
push:
branches:
- master
pull_request:
branches:
- master
# We only care about the latest revision of a PR, so cancel all previous instances.
concurrency:
group: clang-tidy-build-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
jobs:
skip-duplicates:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
paths: '[ "**.cpp", "**.h", "**.c", "**/CMakeLists.txt", "**/Makefile", "**.hpp", "**.cmake", ".github/workflows/clang-tidy.yml" ]'
build:
needs: skip-duplicates
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' }}
runs-on: ubuntu-20.04
env:
CMAKE: 1
CLANG: clang++-12
COMPILER: clang++-12
CATA_CLANG_TIDY: plugin
TILES: 1
SOUND: 1
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install dependencies
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main"
sudo apt-get update
sudo apt-get install libncursesw5-dev clang-12 libclang-12-dev llvm-12-dev llvm-12-tools \
libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libpulse-dev ccache \
gettext jq
- name: prepare
run: bash ./build-scripts/requirements.sh
- name: determine changed files
if: ${{ github.event_name == 'pull_request' }}
uses: actions/github-script@v5
with:
script: |
var fs = require('fs');
const response = await github.paginate(github.rest.pulls.listFiles,
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
}
);
const files = response.map(x => x.filename);
for (const path of files) {
console.log(path);
}
fs.writeFileSync("files_changed", files.join('\n'));
- uses: ammaraskar/gcc-problem-matcher@master
- name: run clang-tidy
run: bash ./build-scripts/clang-tidy.sh
-34
View File
@@ -1,34 +0,0 @@
name: cmake-format linting
on:
push:
branches:
- master
paths:
- '**/CMakeLists.txt'
- '**.cmake'
- '**.cmake.in'
pull_request:
branches:
- master
paths:
- '**/CMakeLists.txt'
- '**.cmake'
- '**.cmake.in'
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install cmakelang
run: python3 -m pip install -U cmakelang
- name: run cmake-lint
run: python3 -m cmakelang.lint CMakeLists.txt src/CMakeLists.txt data/CMakeLists.txt lang/CMakeLists.txt src/chkjson/CMakeLists.txt tools/format/CMakeLists.txt tools/clang-tidy-plugin/CMakeLists.txt cmake_uninstall.cmake.in -c .cmake-format.yml
-70
View File
@@ -1,70 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ master, 0.8-branch, 0.9-branch, 0.A-branch, 0.B-branch, 0.C-branch, 0.D-branch, 0.E-branch, gh-pages ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '31 12 * * 6'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
#- name: Autobuild
# uses: github/codeql-action/autobuild@v1
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
- run: |
make RELEASE=1 RUNTESTS=0
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
-31
View File
@@ -1,31 +0,0 @@
name: "Comment Commands"
on:
issue_comment:
types:
- created
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
jobs:
confirm-bug:
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set-up Comvent
uses: rytswd/comvent@v0.3
id: comvent
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-path: .github/comment-commands.yml
- if: steps.comvent.outputs.confirm-bug != ''
name: Handle confirmation command - Label
run: |
gh issue edit "$ISSUE_NUMBER" --remove-label "(S1 - Need Confirmation)"
gh issue edit "$ISSUE_NUMBER" --add-label "(S2 - Confirmed)"
@@ -1,59 +0,0 @@
name: Detect translation file changes
on:
pull_request_target:
paths:
- lang/po/*.po
- lang/po/*.pot
jobs:
detect-translation-file-changes:
runs-on: ubuntu-latest
steps:
- name: "Detect translation file changes"
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const skip_phrase = 'Translation file changes are intended';
if (context.payload.pull_request.body.includes(skip_phrase)) {
console.log('PR body contains skip phrase. Exiting.');
return;
}
core.setFailed('Translation file changes detected, but a skip phrase is not found in the PR body.')
console.log(
'Fetching comments of pull request %d of repository %s/%s.',
context.issue.number, context.repo.owner, context.repo.repo
);
const comments = await github.paginate(
github.rest.issues.listComments,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
}
);
const body = 'It appears you modified a `.po` or `.pot` file. '
+ 'These translation files are automatically generated, '
+ 'pushed to, and pulled from Transifex, and should not be '
+ 'modified otherwise. If these changes are intended, please '
+ 'add `' + skip_phrase + '` to the '
+ 'PR body.';
const bot_comments = comments.filter(
comment => comment.user.type === 'Bot'
&& comment.user.login === 'github-actions[bot]'
&& comment.body === body
);
if (bot_comments.length > 0) {
console.log('Comment already exists. Exiting.');
return;
}
console.log('Posting comment.');
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
-32
View File
@@ -1,32 +0,0 @@
name: Flake8 Python linting
on:
push:
branches:
- master
paths:
- '**.py'
pull_request:
branches:
- master
paths:
- '**.py'
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install dependencies
run: sudo apt-get install flake8
- name: Enable flake8 problem matcher
run: echo "::add-matcher::build-scripts/problem-matchers/flake8.json"
- name: run Flake8
run: make python-check
-36
View File
@@ -1,36 +0,0 @@
name: JSON Validation
on: pull_request
jobs:
skip-duplicates:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
paths: '["**.json", ".github/workflows/json.yml"]'
- run: echo ${{ github.event.number }} > pull_request_id
- uses: actions/upload-artifact@v2
with:
name: pull_request_id
path: pull_request_id
style-json:
name: JSON style check
runs-on: ubuntu-latest
needs: skip-duplicates
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' }}
steps:
- uses: actions/checkout@v3
- name: JSON style check
run: make style-all-json-parallel RELEASE=1
- name: Display Corrections
if: failure()
run: git diff --color
-19
View File
@@ -1,19 +0,0 @@
name: "Pull Request Labeler"
on:
- pull_request_target
permissions:
contents: read
jobs:
triage:
permissions:
contents: read # for actions/labeler to determine modified files
pull-requests: write # for actions/labeler to add labels to PRs
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
# I don't want no bot removing stuff for me
sync-labels: ""
-41
View File
@@ -1,41 +0,0 @@
name: Code Style Reviewer
on:
pull_request_target:
paths:
- '**.json'
- '**.cpp'
- '**.h'
- '**.c'
pull_request:
paths:
- '**.json'
- '**.cpp'
- '**.h'
- '**.c'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.run_id }}
cancel-in-progress: true
jobs:
style-code:
if: ${{ github.event_name == 'pull_request_target' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: '${{ github.event.pull_request.head.sha }}'
- run: sudo apt-get install astyle
- run: make astyle-fast
- run: make style-all-json-parallel
- name: 'suggester / JSON & C++'
uses: reviewdog/action-suggester@v1
if: ${{ always() }}
with:
tool_name: 'JSON & C++ formatters'
-343
View File
@@ -1,343 +0,0 @@
name: General build matrix
on:
push:
branches:
- master
pull_request:
branches:
- master
# We only care about the latest revision of a PR, so cancel all previous instances.
# Allow running master builds to complete to help with ccache refreshes.
concurrency:
group: general-build-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# Overall strategy for what sorts of builds to include:
# We want a build for the newest and oldest supported version of each compiler.
# We want a build for each platform.
# We also want to ensure that each of the following tweaks are covered in at
# least one PR build:
# - TILES=1
# - SOUND=1
# - RELEASE=1
# - CMAKE=1
# - LOCALIZE=0
# - LTO=1
# - LIBBACKTRACE=1 (on Linux and Windows)
# - Tests with important mods enabled (Magiclysm)
# - A clang-tidy run
# - SANITIZE=address,undefined
# We try to minimize the number of builds subject to those constraints.
#
# To see what toolchains are available, the following may be useful:
# https://launchpad.net/%7Eubuntu-toolchain-r/+archive/ubuntu/test/+index
# https://apt.llvm.org/
jobs:
skip-duplicates-code:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip_code: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths_ignore: '["android/**", "build-data/osx/**", "doc/**", "doxygen_doc/**", "lgtm/**", "msvc-**", "object_creator/**", "tools/**", "utilities/**", "data/**", "lang/**"]'
skip-duplicates-data:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip_data: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths_ignore: '["android/**", "build-data/osx/**", "doc/**", "doxygen_doc/**", "lgtm/**", "msvc-**", "object_creator/**", "tools/**", "utilities/**"]'
matrix-variables:
permissions:
contents: none
continue-on-error: true
runs-on: ubuntu-latest
outputs:
fail_fast: ${{ steps.matrix_vars.outputs.fail_fast }}
skip_tests: ${{ steps.matrix_vars.outputs.skip_tests }}
max_parallel: ${{ steps.matrix_vars.outputs.max_parallel }}
steps:
- id: matrix_vars
run: |
echo "fail_fast=$([ "$GITHUB_REF_NAME" = "master" ] && echo false || echo true)" >> $GITHUB_OUTPUT
echo "skip_tests=$([ "$GITHUB_REF_NAME" = "master" ] && echo true || echo false)" >> $GITHUB_OUTPUT
echo "max_parallel=$([ "$GITHUB_REF_NAME" = "master" ] && echo 20 || echo 1)" >> $GITHUB_OUTPUT
varied_builds:
needs: [ skip-duplicates-code, skip-duplicates-data, matrix-variables ]
strategy:
fail-fast: ${{ fromJSON(needs.matrix-variables.outputs.fail_fast) }}
max-parallel: ${{ fromJSON(needs.matrix-variables.outputs.max_parallel) }}
matrix:
include:
- compiler: clang++-10
os: ubuntu-20.04
tiles: 0
sound: 0
release: 1
cmake: 0
localize: 1
test-stage: 1
native: linux64
archive-success: basic-build
dont_skip_data_only_changes: 1
title: Basic Build and Test (Clang 10, Ubuntu, Curses)
# ~190MB in a clean build
# ~30MB compressed
# observed usage: 3.0GB -> 300MB
ccache_limit: 2G
ccache_key: linux-llvm-10
- compiler: g++-9
os: ubuntu-latest
release: 1
cmake: 0
tiles: 0
sound: 0
localize: 1
gold: 1
lto: 1
libbacktrace: 1
native: linux64
title: GCC 9, Curses, LTO
# ~850MB in a clean build
# ~370MB compressed
# observed usage: 4.0GB -> 1.5GB
ccache_limit: 3G
ccache_key: linux-gcc-9-lto
- compiler: clang++-12
os: ubuntu-22.04
release: 0
cmake: 0
tiles: 1
sound: 0
localize: 1
native: linux64
sanitize: address
cxxflags: --gcc-toolchain=/opt/mock-gcc-11
mods: --mods=magiclysm
dont_skip_data_only_changes: 1
title: Clang 12, Ubuntu, Tiles, ASan
# ~390MB in a clean build
# ~50MB compressed
# observed usage: 4.0GB -> 400MB
ccache_limit: 3G
ccache_key: linux-llvm-12-asan
- compiler: g++-11
os: ubuntu-latest
release: 0
cmake: 0
tiles: 0
sound: 0
localize: 1
native: linux64
sanitize: address
title: GCC 11, Ubuntu, Curses, ASan
# ~480MB in a clean build
# ~50MB compressed
# observed usage: 4.4GB -> 400MB
ccache_limit: 4G
ccache_key: linux-gcc-11-asan
- compiler: clang++
os: macos-12
release: 0
cmake: 0
native: osx
sanitize: undefined
tiles: 1
sound: 1
localize: 1
title: Clang 14, macOS 12, Tiles, Sound, UBSan
# ~880MB ccache-compressed in a clean build
# ~100 compressed
# observed usage: 3.85GB -> 500MB
ccache_limit: 4G
ccache_key: macos-llvm-14
- compiler: g++
os: ubuntu-latest
release: 0
cmake: 0
native:
tiles: 1
sound: 1
localize: 1
libbacktrace: 1
title: GCC 12, Ubuntu cross-compile to MinGW-Win64, Tiles, Sound
ldflags: -static-libgcc -static-libstdc++
mxe_target: x86_64-w64-mingw32.static.gcc12
wine: wine
# ~285MB in a clean build
# ~36MB compressed
# observed usage: 3.0GB -> 350MB
ccache_limit: 2G
ccache_key: mingw-gcc-12
- compiler: g++-9
os: ubuntu-latest
release: 1
cmake: 1
tiles: 1
sound: 1
localize: 0
native: linux64
title: GCC 9, Ubuntu, Tiles, Sound, CMake
# ~180MB in a clean build
# ~25MB compressed
# observed usage: 3.0GB -> 300MB
ccache_limit: 2G
ccache_key: linux-gcc-9-cmake
# Reserving space for msvc ccache & vcpkg cache
# observed usage:
# vcpkg: ??? -> 500MB
# ccache: 8GB -> 1.0GB
name: ${{ matrix.title }}
runs-on: ${{ matrix.os }}
env:
ZSTD_CLEVEL: 17
CMAKE: ${{ matrix.cmake }}
COMPILER: ${{ matrix.compiler }}
MXE_TARGET: ${{ matrix.mxe_target }}
WINE: ${{ matrix.wine }}
OS: ${{ matrix.os }}
TILES: ${{ matrix.tiles }}
SOUND: ${{ matrix.sound }}
LOCALIZE: ${{ matrix.localize }}
MODS: ${{ matrix.mods }}
SANITIZE: ${{ matrix.sanitize }}
TEST_STAGE: ${{ matrix.test-stage }}
CXXFLAGS: ${{ matrix.cxxflags }}
LDFLAGS: ${{ matrix.ldflags }}
EXTRA_TEST_OPTS: --error-format=github-action
NUM_TEST_JOBS: ${{ matrix.num_test_jobs }}
NATIVE: ${{ matrix.native }}
GOLD: ${{ matrix.gold }}
LTO: ${{ matrix.lto }}
LIBBACKTRACE: ${{ matrix.libbacktrace }}
RELEASE: ${{ matrix.release }}
ARCHIVE_SUCCESS: ${{ matrix.archive-success }}
CCACHE_LIMIT: ${{ matrix.ccache_limit }}
CCACHE_FILECLONE: true
CCACHE_HARDLINK: true
CCACHE_NOCOMPRESS: true
SKIP: ${{ ( github.event.pull_request.draft == true && matrix.title != 'Basic Build and Test (Clang 10, Ubuntu, Curses)' ) || ( matrix.dont_skip_data_only_changes == 0 && needs.skip-duplicates.outputs.should_skip_code == 'true' ) || ( matrix.dont_skip_data_only_changes != 0 && needs.skip-duplicates-mods.outputs.should_skip_data == 'true' ) }}
SKIP_TESTS: ${{ needs.matrix-variables.outputs.skip_tests }}
steps:
- name: checkout repository
if: ${{ env.SKIP == 'false' }}
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install dependencies (ubuntu)
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install libncursesw5-dev ccache gettext parallel
- name: install SDL2 dependencies (ubuntu)
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' && matrix.tiles == 1 }}
run: |
sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libpulse-dev
- name: install recent ccache on ubuntu 20.04
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' && matrix.os == 'ubuntu-20.04' }}
run: |
sudo apt-get remove --purge -y ccache
curl -sL https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz | sudo tar Jxvf - --strip-components 1 -C /usr/bin ccache-4.8-linux-x86_64/ccache
ccache --version
- name: set up a mock GCC toolchain root for Clang (Ubuntu)
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' && (matrix.compiler == 'clang++-12') }}
run: |
sudo mkdir /opt/mock-gcc-11
sudo ln -s /usr/include /opt/mock-gcc-11/include
sudo ln -s /usr/bin /opt/mock-gcc-11/bin
sudo mkdir -p /opt/mock-gcc-11/lib/gcc/x86_64-linux-gnu
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/11 /opt/mock-gcc-11/lib/gcc/x86_64-linux-gnu/11
- name: install runtime dependencies (mac)
if: ${{ env.SKIP == 'false' && runner.os == 'macOS' }}
uses: BrettDong/setup-sdl2-frameworks@v1
with:
sdl2: latest
sdl2-ttf: latest
sdl2-image: latest
sdl2-mixer: latest
- name: install build dependencies (mac)
if: ${{ env.SKIP == 'false' && runner.os == 'macOS' }}
run: |
HOMEBREW_NO_AUTO_UPDATE=yes HOMEBREW_NO_INSTALL_CLEANUP=yes brew install gettext ccache parallel
- name: prepare
if: ${{ env.SKIP == 'false' }}
run: bash ./build-scripts/requirements.sh
- name: Get ccache vars
id: get-vars
if: ${{ env.SKIP == 'false' }}
run: |
echo "datetime=$(/bin/date -u "+%Y%m%d%H%M")" >> $GITHUB_OUTPUT
echo "ccache-path=$([ "$RUNNER_OS" = "macOS" ] && echo '/Users/runner/Library/Caches/ccache' || echo '~/.cache/ccache')" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
if: ${{ env.SKIP == 'false' && ( runner.os == 'Linux' || runner.os == 'macOS' ) }}
uses: actions/cache@v2
with:
path: ${{ steps.get-vars.outputs.ccache-path }}
# double-dash after compiler is not a typo, it is to disambiguate between g++-<date> and g++-11-<date> for restore key prefix matching
key: ccache-${{ github.ref_name }}-${{ matrix.ccache_key }}--${{ steps.get-vars.outputs.datetime }}
restore-keys: |
ccache-master-${{ matrix.ccache_key }}--
- uses: ammaraskar/gcc-problem-matcher@master
- name: build
if: ${{ env.SKIP == 'false' }}
run: bash ./build-scripts/gha_compile_only.sh
- name: post-build ccache manipulation
if: ${{ env.SKIP == 'false' && !failure() && (runner.os == 'Linux' || runner.os == 'macOS') }}
run: |
ccache --show-stats --verbose
ccache -M ${{ env.CCACHE_LIMIT }}
ccache -c
ccache --show-stats --verbose
- name: clear ccache on PRs
if: ${{ github.ref_name != 'master' && env.SKIP == 'false' && !failure() && (runner.os == 'Linux' || runner.os == 'macOS') }}
run: |
ccache -C
# TODO: post ccache here, however actions/cache@v2 does not support manual upload step
- name: run tests
if: ${{ env.SKIP == 'false' && env.SKIP_TESTS == 'false' }}
run: bash ./build-scripts/gha_test_only.sh
- run: |
echo ${{ github.event.number }} > pull_request_id
echo "true" > ${{ env.ARCHIVE_SUCCESS }}
if: ${{ env.ARCHIVE_SUCCESS && success() }}
- run: |
echo ${{ github.event.number }} > pull_request_id
echo "false" > ${{ env.ARCHIVE_SUCCESS }}
if: ${{ env.ARCHIVE_SUCCESS && failure() }}
- uses: actions/upload-artifact@v2
if: ${{ always() && env.ARCHIVE_SUCCESS }}
with:
name: pull_request_id
path: pull_request_id
- uses: actions/upload-artifact@v2
if: ${{ always() && env.ARCHIVE_SUCCESS }}
with:
name: ${{ env.ARCHIVE_SUCCESS }}
path: ${{ env.ARCHIVE_SUCCESS }}
- name: upload artifacts if failed
uses: actions/upload-artifact@v2
if: failure()
with:
name: cata_test
path: tests/cata_test*
if-no-files-found: ignore
-211
View File
@@ -1,211 +0,0 @@
name: Cataclysm Windows build
on:
push:
branches:
- master
paths-ignore:
- 'android/**'
- 'build-data/osx/**'
- 'doc/**'
- 'doxygen_doc/**'
- 'gfx/**'
- 'lang/**'
- 'lgtm/**'
- 'tools/**'
- '!tools/format/**'
- 'utilities/**'
pull_request:
branches:
- master
paths-ignore:
- 'android/**'
- 'build-data/osx/**'
- 'doc/**'
- 'doxygen_doc/**'
- 'gfx/**'
- 'lang/**'
- 'lgtm/**'
- 'tools/**'
- '!tools/format/**'
- 'utilities/**'
# We only care about the latest revision of a PR, so cancel previous instances.
concurrency:
group: msvc-build-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
env:
# Enable pretty backtraces
BACKTRACE: 1
# Compressed size ~1GB based on observations
CCACHE_LIMIT: 8GB
CDDA_CCACHE_PATH: ${{ github.workspace }}\ccache\
CDDA_USE_CCACHE: true
# There's not enough disk space to build both release and debug versions of
# our dependencies, so we hack the triplet file to build only release versions
# Have to use github.workspace because runner namespace isn't available yet.
VCPKG_OVERLAY_TRIPLETS: ${{ github.workspace }}\.github\vcpkg_triplets
# Also conveniently disable ccache internal compression
CCACHE_HARDLINK: true
# vcpkg with object_creator deps totals ~500MB at this compression level
ZSTD_CLEVEL: 17
jobs:
build_catatclysm:
name: Build
runs-on: windows-2019
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Use GNU tar to enable zstd for actions/cache
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
shell: cmd
- name: Restore artifacts, or run vcpkg, build and cache artifacts
uses: lukka/run-vcpkg@v10
id: runvcpkg
with:
# run-vcpkg tries to hash vcpkg.json but complans if it finds more than one.
# That said, we also have our custom vcpkg_triplets to hash, so we keep everything the same.
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', 'msvc-object_creator/vcpkg.json', '.github/vcpkg_triplets/**', '.github/vckg_ports/**' ) }}
# Rev this value to drop cache without changing vcpkg commit
prependedCacheKey: v1-x64-full
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# We have to use at least this version of vcpkg to include fixes for yasm-tool's
# availability only as an x86 host tool. Keep it in sync with the builtin-baseline
# field in vcpkg.json. Caching happens as a post-action which runs at the end of
# the whole workflow, after vcpkg install happens during msbuild run.
vcpkgGitCommitId: 'd08e708c2111893da3cc7e49b597ee4654c8076e'
- name: Integrate vcpkg
run: |
vcpkg integrate install --vcpkg-root '${{ runner.workspace }}\b\vcpkg'
- name: Download ccache
uses: robinraju/release-downloader@v1.4
with:
repository: 'ccache/ccache'
tag: 'v4.6.1'
fileName: 'ccache-4.6.1-windows-x86_64.zip'
- name: Install ccache
id: install-ccache
run: |
unzip ccache-4.6.1-windows-x86_64.zip
cp ccache-4.6.1-windows-x86_64/ccache.exe ccache-4.6.1-windows-x86_64/cl.exe
cp ccache-4.6.1-windows-x86_64/ccache.exe ccache-4.6.1-windows-x86_64/clang-cl.exe
mv ccache-4.6.1-windows-x86_64 ${{ env.CDDA_CCACHE_PATH }}
- name: Get ccache vars
id: get-vars
run: |
echo "datetime=$(/bin/date -u "+%Y%m%d%H%M")" >> $GITHUB_OUTPUT
echo "ccache-path=$(echo "$APPDATA\\ccache")" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
uses: actions/cache@v3
with:
path: ${{ steps.get-vars.outputs.ccache-path }}
# double-dash after compiler is not a typo, it is to disambiguate between g++-<date> and g++-11-<date> for restore key prefix matching
key: ccache-${{ github.ref_name }}-${{ runner.os }}-msvc--${{ steps.get-vars.outputs.datetime }}
restore-keys: |
ccache-master-${{ runner.os }}-msvc--
- name: Configure ccache
run: |
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -M 10G
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -s -v
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -z
- name: Symlink intermediates to C
run: |
mkdir -p "$env:TEMP\objwin"
New-Item -ItemType SymbolicLink -Target "$env:TEMP\objwin" objwin
- name: Build
run: |
msbuild -m -p:Configuration=Release -p:Platform=x64 "-target:Cataclysm-vcpkg-static;Cataclysm-test-vcpkg-static;JsonFormatter-vcpkg-static" msvc-full-features/Cataclysm-vcpkg-static.sln
msbuild -m -p:Configuration=Release -p:Platform=x64 "-target:ObjectCreator-vcpkg-static" msvc-object_creator/ObjectCreator-vcpkg-static.sln
- name: Post-build ccache manipulation
if: ${{ !failure() }}
run: |
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -s -v
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -M ${{ env.CCACHE_LIMIT }}
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -c
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -s -v
- name: clear ccache on PRs
if: ${{ github.ref_name != 'master' }}
run: |
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -C
- name: Dump vcpkg logs if build failed
if: failure()
run: |
echo =================================================
Get-ChildItem "${{ runner.workspace }}/Cataclysm-DDA/msvc-full-features/vcpkg_installed" -Recurse
echo =================================================
Get-ChildItem "${{ runner.workspace }}/Cataclysm-DDA/msvc-object_creator/vcpkg_installed" -Recurse
echo =================================================
Get-ChildItem "${{ runner.workspace }}/b/vcpkg/buildtrees" |
Foreach-Object {
Get-ChildItem $_.FullName -Filter *.log |
Foreach-Object {
echo =================================================
echo $_.FullName
echo =================================================
type $_.FullName
}
}
- name: Compile .mo files for localization
if: ${{ github.ref_name != 'master' }}
run: |
& "C:\msys64\mingw64\bin\mingw32-make" -C lang -j2
mkdir -p ./data/mods/TEST_DATA/lang/mo/ru/LC_MESSAGES -ErrorAction SilentlyContinue
msgfmt -f -o ./data/mods/TEST_DATA/lang/mo/ru/LC_MESSAGES/TEST_DATA.mo ./data/mods/TEST_DATA/lang/po/ru.po
- name: Enable GitHub Actions problem matchers
if: ${{ github.ref_name != 'master' }}
run: |
Write-Output "::add-matcher::build-scripts/problem-matchers/catch2.json"
Write-Output "::add-matcher::build-scripts/problem-matchers/debugmsg.json"
- name: Run tests
if: ${{ github.ref_name != 'master' }}
run: |
.\Cataclysm-test-vcpkg-static-Release-x64.exe --min-duration 0.2 --rng-seed time
- name: Dump disk usage logs if job failed
if: failure()
run: |
echo =================================================
df
echo =================================================
du -sh *
echo =================================================
du -sh msvc-full-features/*
echo =================================================
du -sh msvc-object_creator/*
echo =================================================
du -sh tools/*
echo =================================================
shell: bash
- name: Don't upload vcpkg cache on failure or PRs
if: ${{ failure() || cancelled() || github.ref_name != 'master' }}
run: |
echo "RUNVCPKG_NO_CACHE=1" >> $GITHUB_ENV
shell: bash
@@ -1,78 +0,0 @@
name: Post Spell Check Result
on:
workflow_run:
workflows: ["Text Changes Analyzer"]
types:
- completed
jobs:
post-spell-check-result:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download pr id artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: pull_request_id
- name: Download spell check retcode artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: spell_check_retcode
- name: set-spell-check-retcode
id: set-spell-check-retcode
run: echo "spell-check-retcode=$( cat spell_check_retcode )" >> $GITHUB_OUTPUT
- name: Download spell check output artifact
if: steps.set-spell-check-retcode.outputs.spell-check-retcode >= 1
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: spell_check_output
- name: 'Comment on PR'
if: steps.set-spell-check-retcode.outputs.spell-check-retcode >= 1
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./pull_request_id'));
var body = fs.readFileSync('./spell_check_output', 'utf8');
console.log("Fetching comments of pull request %d of repository %s/%s.", issue_number, context.repo.owner, context.repo.repo);
const comments = await github.paginate(github.rest.issues.listComments,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number
}
);
const prev_spell_checks = comments.slice(0).reverse()
.filter(comment => comment.user.type === 'Bot' && comment.user.login === 'github-actions[bot]')
.filter(comment => comment.body.startsWith("Spell checker"));
if (prev_spell_checks.some(comment => comment.body === body)) {
console.log("The exact same spell checker comment already exists. Exiting.");
return;
}
for (const comment of prev_spell_checks) {
console.log("Deleting previous spell checker comment (comment id: %i)", comment.id);
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
});
}
console.log("Posting comment.");
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: body
});
-16
View File
@@ -1,16 +0,0 @@
name: PR Validator
on:
pull_request:
branches:
- master
types: [opened, edited, synchronize]
jobs:
validate:
name: Validate PR
runs-on: ubuntu-latest
steps:
- name: "Validate SUMMARY"
uses: CleverRaven/pr-validator@master
with:
description-regex: '(\n|^)#### Summary\s+`{0,3}(SUMMARY:\s+)?(None|((Features|Content|Interface|Mods|Balance|Bugfixes|Performance|Infrastructure|Build|I18N) +".+"))`{0,3}\s*(\n|$)'
description-regex-flags: 'i'
-49
View File
@@ -1,49 +0,0 @@
name: "Pull translations from Transifex"
on:
schedule:
- cron: "42 1 * * 6"
jobs:
pull-translations:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
runs-on: ubuntu-22.04
steps:
- name: "Install Transifex CLI"
run: |
curl -sL https://github.com/transifex/cli/releases/download/v1.6.4/tx-linux-amd64.tar.gz | sudo tar zxvf - -C /usr/bin tx
- name: "Delete existing i18n branch"
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TX_PR_CREATOR }}
script: |
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "i18n"
})
} catch (error) {
console.log(error)
}
- name: "Checkout"
uses: actions/checkout@v3
- name: "Get current date"
uses: josStorer/get-current-time@v2.0.2
id: current-date
with:
format: 'DD MMMM YYYY'
- name: "Pull translations"
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
run: tx pull --force
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: Routine i18n updates on ${{ steps.current-date.outputs.formattedTime }}
token: ${{ secrets.TX_PR_CREATOR }}
branch: i18n
base: master
title: Routine i18n updates on ${{ steps.current-date.outputs.formattedTime }}
body: "#### Summary\nNone\n\n#### Additional context\n`Translation file changes are intended`"
labels: Translation
@@ -1,41 +0,0 @@
name: "Push translation template"
concurrency: push_transifex
on:
workflow_run:
workflows: ["Experimental Release"]
types:
- completed
permissions:
contents: read
jobs:
push-template:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'push' &&
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.status == 'success' &&
github.repository == 'CleverRaven/Cataclysm-DDA' }}
steps:
- name: "Install gettext tools"
run: sudo apt install gettext
- name: "Install Transifex CLI"
run: |
curl -sL https://github.com/transifex/cli/releases/download/v1.6.4/tx-linux-amd64.tar.gz | sudo tar zxvf - -C /usr/bin tx
- name: "Install Python3"
run: |
sudo apt install python3-pip
sudo pip3 install polib
- name: "Checkout"
uses: actions/checkout@v2
- name: "Generate translation template"
run: |
lang/update_pot.sh
- name: "Push translation template to Transifex server"
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
run: tx push -s
-342
View File
@@ -1,342 +0,0 @@
name: "Experimental Release"
concurrency: release
on:
push:
branches:
- master
paths:
- '.github/workflows/release.yml'
- 'android/**'
- 'build-data/**'
- 'cataclysm-launcher'
- 'data/**'
- 'doc/**'
- 'gfx/**'
- 'lang/po/*.po'
- 'LICENSE*'
- 'Makefile'
- 'README*'
- 'src/**'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
timestamp: ${{ steps.get-timestamp.outputs.time }}
release_already_exists: ${{ steps.tag_check.outputs.exists }}
steps:
- name: Get build timestamp
id: get-timestamp
uses: nanzm/get-time-action@v1.1
with:
timeZone: 0
format: 'YYYY-MM-DD-HHmm'
- name: Generate environmental variables
id: generate_env_vars
run: |
echo "tag_name=cdda-experimental-${{ steps.get-timestamp.outputs.time }}" >> $GITHUB_OUTPUT
echo "release_name=Cataclysm-DDA experimental build ${{ steps.get-timestamp.outputs.time }}" >> $GITHUB_OUTPUT
- name: Check if there is existing git tag
id: tag_check
uses: mukunku/tag-exists-action@v1.0.0
with:
tag: ${{ steps.generate_env_vars.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- name: Push tag
id: tag_version
uses: mathieudutour/github-tag-action@v5.5
if: ${{ steps.tag_check.outputs.exists == 'false' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.generate_env_vars.outputs.tag_name }}
tag_prefix: ""
- name: "Generate release notes"
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/CleverRaven/Cataclysm-DDA/releases/generate-notes \
-f tag_name='${{ steps.generate_env_vars.outputs.tag_name }}' \
-f target_commitish='master' \
-q .body > CHANGELOG.md
- name: Create release
id: create_release
uses: actions/create-release@v1
if: ${{ steps.tag_check.outputs.exists == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.generate_env_vars.outputs.tag_name }}
release_name: ${{ steps.generate_env_vars.outputs.release_name }}
body_path: ./CHANGELOG.md
draft: false
prerelease: true
builds:
needs: release
if: ${{ needs.release.outputs.release_already_exists == 'false' }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows Tiles x64 MSVC
artifact: windows-tiles-x64-msvc
arch: x64
os: windows-2019
mxe: none
ext: zip
content: application/zip
sound: 0
- name: Windows Tiles Sounds x64 MSVC
artifact: windows-tiles-sounds-x64-msvc
arch: x64
os: windows-2019
mxe: none
ext: zip
content: application/zip
sound: 1
- name: Windows Tiles x64
mxe: x86_64
artifact: windows-tiles-x64
os: ubuntu-latest
ext: zip
content: application/zip
sound: 0
- name: Windows Tiles Sounds x64
mxe: x86_64
artifact: windows-tiles-sounds-x64
os: ubuntu-latest
ext: zip
content: application/zip
sound: 1
- name: Linux Tiles x64
os: ubuntu-20.04
mxe: none
android: none
tiles: 1
sound: 0
artifact: linux-tiles-x64
ext: tar.gz
content: application/gzip
- name: Linux Tiles Sounds x64
os: ubuntu-20.04
mxe: none
android: none
tiles: 1
sound: 1
artifact: linux-tiles-sounds-x64
ext: tar.gz
content: application/gzip
- name: Linux Curses x64
os: ubuntu-20.04
mxe: none
android: none
tiles: 0
sound: 0
artifact: linux-curses-x64
ext: tar.gz
content: application/gzip
- name: OSX Curses x64
os: macos-12
mxe: none
tiles: 0
sound: 0
artifact: osx-curses-x64
ext: dmg
content: application/x-apple-diskimage
- name: OSX Tiles x64
os: macos-12
mxe: none
tiles: 1
sound: 0
artifact: osx-tiles-x64
ext: dmg
content: application/x-apple-diskimage
- name: Android x64
os: ubuntu-latest
mxe: none
android: arm64
artifact: android-x64
ext: apk
content: application/apk
- name: Android x32
os: ubuntu-latest
mxe: none
android: arm32
artifact: android-x32
ext: apk
content: application/apk
- name: Android Bundle
os: ubuntu-latest
mxe: none
android: bundle
artifact: android-bundle
ext: aab
content: application/aap
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
ZSTD_CLEVEL: 17
steps:
- uses: actions/checkout@v2
- name: Get soundpack
if: matrix.sound == 1
run: |
git clone --depth=1 --shallow-submodules --recurse-submodules https://github.com/Fris0uman/CDDA-Soundpacks '${{ github.workspace }}/CDDA-Soundpacks'
mv '${{ github.workspace }}/CDDA-Soundpacks/sound/CC-Sounds' '${{ github.workspace }}/data/sound'
- name: Install dependencies (windows msvc) (1/3)
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v1.0.2
- name: Install dependencies (windows msvc) (2/3)
if: runner.os == 'Windows'
uses: lukka/run-vcpkg@v10
id: runvcpkg
with:
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', '.github/vcpkg_triplets/**', '.github/vckg_ports/**' ) }}
# Rev this value to drop cache without changing vcpkg commit
prependedCacheKey: v1-${{ matrix.arch }}
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# We have to use at least this version of vcpkg to include fixes for yasm-tool's
# availability only as an x86 host tool. Keep it in sync with the builtin-baseline
# field in vcpkg.json. Caching happens as a post-action which runs at the end of
# the whole workflow, after vcpkg install happens during msbuild run.
vcpkgGitCommitId: 'd08e708c2111893da3cc7e49b597ee4654c8076e'
- name: Install dependencies (windows msvc) (3/3)
if: runner.os == 'Windows'
run: |
vcpkg integrate install --vcpkg-root '${{ runner.workspace }}\b\vcpkg'
- name: Install dependencies (windows mxe)
if: matrix.mxe != 'none'
run: |
sudo apt install gettext
- name: Install MXE
if: matrix.mxe != 'none'
run: |
curl -L -o mxe-${{ matrix.mxe }}.tar.xz https://github.com/BrettDong/MXE-GCC/releases/download/mxe-sdl-2-0-20/mxe-${{ matrix.mxe }}.tar.xz
curl -L -o mxe-${{ matrix.mxe }}.tar.xz.sha256 https://github.com/BrettDong/MXE-GCC/releases/download/mxe-sdl-2-0-20/mxe-${{ matrix.mxe }}.tar.xz.sha256
shasum -a 256 -c ./mxe-${{ matrix.mxe }}.tar.xz.sha256
sudo tar xJf mxe-${{ matrix.mxe }}.tar.xz -C /opt
curl -L -o SDL2-devel-2.26.2-mingw.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.26.2/SDL2-devel-2.26.2-mingw.tar.gz
shasum -a 256 -c ./build-scripts/SDL2-devel-2.26.2-mingw.tar.gz.sha256
sudo tar -xzf SDL2-devel-2.26.2-mingw.tar.gz -C /opt/mxe/usr/${{ matrix.mxe }}-w64-mingw32.static.gcc12 --strip-components=2 SDL2-2.26.2/${{ matrix.mxe }}-w64-mingw32
curl -L -o libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz https://github.com/Qrox/libbacktrace/releases/download/2020-01-03/libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz
shasum -a 256 -c ./build-scripts/libbacktrace-${{ matrix.mxe }}-w64-mingw32-sha256
sudo tar -xzf libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz --exclude=LICENSE -C /opt/mxe/usr/${{ matrix.mxe }}-w64-mingw32.static.gcc12
- name: Install dependencies (Linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none'
run: |
sudo apt-get update
sudo apt-get install libncursesw5-dev libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev \
libsdl2-mixer-dev libpulse-dev ccache gettext parallel
- name: Install runtime dependencies (mac)
if: runner.os == 'macOS'
uses: BrettDong/setup-sdl2-frameworks@v1
with:
sdl2: latest
sdl2-ttf: latest
sdl2-image: latest
sdl2-mixer: latest
- name: Install build dependencies (mac)
if: runner.os == 'macOS'
run: |
HOMEBREW_NO_AUTO_UPDATE=yes HOMEBREW_NO_INSTALL_CLEANUP=yes brew install gettext ccache parallel
pip3 install mac_alias==2.2.0 dmgbuild==1.4.2 biplist
- name: Create VERSION.TXT
shell: bash
run: |
cat >VERSION.txt <<EOL
build type: ${{ matrix.artifact }}
build number: ${{ needs.release.outputs.timestamp }}
commit sha: ${{ github.sha }}
commit url: https://github.com/${{ github.repository }}/commit/${{ github.sha }}
EOL
- name: Compile translations (windows)
if: runner.os == 'Windows'
shell: bash
run: |
lang/compile_mo.sh all
- name: Build CDDA (linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none'
run: |
make -j$((`nproc`+0)) TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=0 PCH=0 bindist
mv cataclysmdda-0.F.tar.gz cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.tar.gz
- name: Build CDDA (windows mxe)
if: matrix.mxe != 'none'
env:
PLATFORM: /opt/mxe/usr/bin/${{ matrix.mxe }}-w64-mingw32.static.gcc12-
run: |
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 PCH=0 bindist
mv cataclysmdda-0.F.zip cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.zip
- name: Build CDDA (windows msvc)
if: runner.os == 'Windows'
env:
# Enable pretty backtraces
BACKTRACE: 1
CDDA_STRIPPED_PDB: 1
VCPKG_OVERLAY_TRIPLETS: ${{ github.workspace }}\.github\vcpkg_triplets
run: |
msbuild -m -p:Configuration=Release -p:Platform=${{ matrix.arch }} "-target:Cataclysm-vcpkg-static;JsonFormatter-vcpkg-static" msvc-full-features\Cataclysm-vcpkg-static.sln
.\build-scripts\windist.ps1
mv cataclysmdda-0.F.zip cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.zip
- name: Build CDDA (osx)
if: runner.os == 'macOS'
run: |
make -j3 TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=0 PCH=0 USE_HOME_DIR=1 OSX_MIN=10.13 FRAMEWORK=1 dmgdist
mv Cataclysm.dmg cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.dmg
- name: Set up JDK 8 (android)
if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none'
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Setup Build and Dependencies (android)
if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none'
run: |
sudo apt-get update
sudo apt-get install gettext
- name: Build CDDA (android)
if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none'
working-directory: ./android
run: |
echo "${{ secrets.KEYSTORE }}" > release.keystore.asc
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSWORD }}" --batch release.keystore.asc > app/release.keystore
echo "${{ secrets.KEYSTORE_PROPERTIES }}" > keystore.properties.asc
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSWORD }}" --batch keystore.properties.asc > keystore.properties
export UPSTREAM_BUILD_NUMBER="$((11581 + ${{ github.run_number }}))"
chmod +x gradlew
if [ ${{ matrix.android }} = arm64 ]
then
./gradlew -Pj=$((`nproc`+0)) -Pabi_arm_32=false assembleExperimentalRelease
mv ./app/build/outputs/apk/experimental/release/*.apk ../cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.apk
elif [ ${{ matrix.android }} = arm32 ]
then
./gradlew -Pj=$((`nproc`+0)) -Pabi_arm_64=false assembleExperimentalRelease
mv ./app/build/outputs/apk/experimental/release/*.apk ../cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.apk
elif [ ${{ matrix.android }} = bundle ]
then
./gradlew -Pj=$((`nproc`+0)) bundleExperimentalRelease
mv ./app/build/outputs/bundle/experimentalRelease/*.aab ../cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.aab
fi
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.${{ matrix.ext }}
asset_name: cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.${{ matrix.ext }}
asset_content_type: ${{ matrix.content }}
- name: Trigger GitHub pages rebuild
shell: bash
run: |
curl --fail --request POST \
--url https://api.github.com/repos/${{ github.repository }}/pages/builds \
--header "Authorization: Bearer ${{ secrets.USER_TOKEN }}" \
--header "Accept: application/vnd.github.v3+json"
-33
View File
@@ -1,33 +0,0 @@
name: 'Stale issue handler'
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'
permissions:
issues: write
pull-requests: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- name: get-time
run: |
echo "time=$(date +%I)" >> $GITHUB_ENV
- uses: actions/stale@main
id: stale
with:
stale-issue-label: stale
stale-pr-label: stale
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.'
stale-pr-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.'
days-before-stale: 30
days-before-close: 30
start-date: '2020-05-07'
ascending: ${{ contains(fromJson('["01", "03", "05", "07", "09", "11"]'), env.time) }}
operations-per-run: 250
exempt-issue-labels: '<Bug>,<Bugfix>,<Crash / Freeze>,Organization: Bounty,Good First Issue,(P1 - Critical),(P2 - High),(P3 - Medium),(P4 - Low),(P5 - Long-term),(S2 - Confirmed),0.G String Freeze,0.G Feature Freeze,0.G Content Freeze'
exempt-pr-labels: '<Bug>,<Bugfix>,<Crash / Freeze>,Organization: Bounty,Good First Issue,(P1 - Critical),(P2 - High),(P3 - Medium),(P4 - Low),(P5 - Long-term),(S2 - Confirmed),0.G String Freeze,0.G Feature Freeze,0.G Content Freeze'
exempt-all-milestones: true
exempt-all-assignees: true
- name: Print outputs
run: echo ${{ join(steps.stale.outputs.*, ',') }}
-15
View File
@@ -1,15 +0,0 @@
name: Summary Labeler
on:
- pull_request_target
jobs:
uses:
name: labeler
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: fuxingloh/multi-labeler@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
config-path: '.github/summary-labels.yml'
-78
View File
@@ -1,78 +0,0 @@
name: Apply Test Labels
on:
workflow_run:
workflows: ["astyle", "JSON Validation", "General build matrix"]
types: [completed]
jobs:
labeling:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
runs-on: ubuntu-latest
steps:
- name: setLabel
id: setLabel
run: |
if [[ "${{ github.event.workflow_run.name }}" == "astyle" ]]; then
echo "label=astyled" >> $GITHUB_OUTPUT
fi
if [[ "${{ github.event.workflow_run.name }}" == "JSON Validation" ]]; then
echo "label=json-styled" >> $GITHUB_OUTPUT
fi
if [[ "${{ github.event.workflow_run.name }}" == "General build matrix" ]]; then
echo "label=BasicBuildPassed" >> $GITHUB_OUTPUT
fi
- name: Download success artifact from basic build
if: ${{ github.event.workflow_run.name == 'General build matrix' }}
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: basic-build
- name: set-basic-build-success
id: set-basic-build-success
run: echo "basic-build-success=$( cat basic-build )" >> $GITHUB_OUTPUT
- name: Download pr id artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: pull_request_id
- name: set-pr-id
id: set-pr-id
run: echo "pr-id=$( cat pull_request_id )" >> $GITHUB_OUTPUT
- name: set-label
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.conclusion != 'skipped' || steps.set-basic-build-success.outputs.basic-build-success == 'true' }}
uses: actions/github-script@v5
with:
script: |
if ('${{ steps.set-pr-id.outputs.pr-id }}'.trim().length == 0) {
console.log("The PR ID artifact does not contain a pull request number.")
} else {
github.rest.issues.addLabels({
issue_number: ${{ steps.set-pr-id.outputs.pr-id }},
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['${{ steps.setLabel.outputs.label }}']
})
}
- name: remove-label
if: ${{ github.event.workflow_run.conclusion == 'failure' && steps.set-basic-build-success.outputs.basic-build-success != 'true' }}
uses: actions/github-script@v5
with:
script: |
if ('${{ steps.set-pr-id.outputs.pr-id }}'.trim().length == 0) {
console.log("The PR ID artifact does not contain a pull request number.")
} else {
try {
github.rest.issues.removeLabel({
issue_number: ${{ steps.set-pr-id.outputs.pr-id }},
owner: context.repo.owner,
repo: context.repo.repo,
name: '${{ steps.setLabel.outputs.label }}'
})
} catch (e) {
console.log(e)
}
}
@@ -1,83 +0,0 @@
name: Text Changes Analyzer
on:
pull_request:
branches:
- master
paths:
- '.github/workflows/text-changes-analyzer.yml'
- 'tools/pot_diff.py'
- 'lang/extract_json_strings.py'
- 'lang/string_extractor/**'
- 'src/*.h'
- 'src/*.cpp'
- '**.json'
permissions:
contents: read
jobs:
analyze-text-changes:
runs-on: ubuntu-20.04
steps:
- name: "Install dependencies"
run: |
sudo apt-get update
sudo apt-get install python3-pip gettext
sudo pip3 install polib pyspellchecker
- name: "Checkout test merge commit"
uses: actions/checkout@v2
- name: "Compute base commit and test merge commit"
id: get-commit-hash
run: |
echo "test_merge_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "head_commit=$(git log -1 --format='%B' | grep -o -E -e 'Merge\s([0-9a-f]{40})\sinto' | grep -o -E -e '[0-9a-f]{40}')" >> $GITHUB_OUTPUT
echo "base_commit=$(git log -1 --format='%B' | grep -o -E -e 'into\s([0-9a-f]{40})$' | grep -o -E -e '[0-9a-f]{40}')" >> $GITHUB_OUTPUT
- name: "Generate translation template on test merge commit"
run: |
rm -f lang/po/cataclysm-dda.pot
./lang/update_pot.sh
cp lang/po/cataclysm-dda.pot ~/merge.pot
- name: "Checkout base commit"
uses: actions/checkout@v2
with:
ref: ${{ steps.get-commit-hash.outputs.base_commit }}
- name: "Generate translation template on base commit"
run: |
rm -f lang/po/cataclysm-dda.pot
./lang/update_pot.sh
cp lang/po/cataclysm-dda.pot ~/base.pot
- name: "Checkout test merge commit"
uses: actions/checkout@v2
with:
ref: ${{ steps.get-commit-hash.outputs.test_merge_commit }}
- name: "List text changes"
run: |
python3 ./tools/pot_diff.py ~/base.pot ~/merge.pot
- name: "Write text changes"
run: |
python3 ./tools/pot_diff.py ~/base.pot ~/merge.pot -j ~/pot_diff.json
- name: "Spell check on text changes"
run: |
python3 ./tools/spell_check_pr.py -i ~/pot_diff.json > spell_check_output
- name: "Get length of spell check output"
id: get_length
run: |
wc -c spell_check_output | grep -o '[0-9]*' > spell_check_retcode
echo "length=$(cat spell_check_retcode)" >> $GITHUB_OUTPUT
- run: echo ${{ github.event.number }} > pull_request_id
- uses: actions/upload-artifact@v2
with:
name: pull_request_id
path: pull_request_id
- uses: actions/upload-artifact@v2
with:
name: spell_check_retcode
path: spell_check_retcode
- uses: actions/upload-artifact@v2
if: steps.get_length.outputs.length >= 1
with:
name: spell_check_output
path: spell_check_output
-31
View File
@@ -1,31 +0,0 @@
on:
push:
branches:
- master
paths:
- 'doc/JSON_INFO.md'
name: TOC Generator
permissions:
contents: read
jobs:
generateTOC:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
name: Update the table of contents
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npx doctoc doc/JSON_INFO.md --github
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update the table of contents
branch: update-toc
token: ${{ secrets.TX_PR_CREATOR }}
title: Update the table of contents in doc/JSON_INFO.md
body: |
```sh
#### Summary
None
npx doctoc doc/JSON_INFO.md --github
```
-48
View File
@@ -1,48 +0,0 @@
# This workflow runs at 23:00 UTC sundays
name: "Pull Tileset Updates"
on:
schedule:
- cron: "0 23 * * sun"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TX_TOKEN: ${{ secrets.TX_TOKEN }}
jobs:
pull-updates:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Get current date"
uses: 1466587594/get-current-time@v2
id: current-date
with:
format: 'DD MMMM YYYY'
- name: "Update Tilesets"
shell: bash
run: |
gh release download -D gfx/ -p '*.zip' -R I-am-Erk/CDDA-Tilesets
gh release download -D gfx/ -p '*.zip' -R pixel-32/CDDA-tileset
find gfx/ -name "*.zip" | xargs -I{} unzip -o {} -d gfx/
rm -fr gfx/*.zip
# make sure all files are linted just in case
# FIXME: make json test check gfx folder instead of using this
make tools/format/json_formatter.cgi
find gfx/ -name "*.json" -print0 | xargs -0 -L 1 -P $(nproc) tools/format/json_formatter.cgi || exit 0
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: |
Routine tileset updates on ${{ steps.current-date.outputs.formattedTime }}
committer: casswedson <casswedson@users.noreply.github.com>
author: casswedson <casswedson@users.noreply.github.com>
token: ${{ secrets.TX_PR_CREATOR }}
branch: tileset-updates
delete-branch: true
base: master
title: Routine tileset updates on ${{ steps.current-date.outputs.formattedTime }}
body: "#### Summary\nNone\nAutomatic tileset updates from:\n\n**https://github.com/I-am-Erk/CDDA-Tilesets/releases**\nAltica, BrownLikeBears, ChibiUltica, HollowMoon, Larwick_Overmap, MshockXotto+, NeoDaysTileset, RetroDaysTileset, SmashButton_iso, SurveyorsMap\n\n---\n\n**https://github.com/pixel-32/CDDA-tileset/releases**\nCuteclysm"
-50
View File
@@ -1,50 +0,0 @@
name: "Weekly changelog update"
on:
schedule:
- cron: "45 0 * * 1"
push:
branches:
- master
paths:
- '.github/workflows/weekly-changelog.yml'
jobs:
weekly-changelog:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Get current date"
uses: 1466587594/get-current-time@v2
id: current-date
with:
format: 'YYYYMMDD'
- name: "Get changes since last week"
id: getting-changes
env:
CURR_DATE: ${{ steps.current-date.outputs.formattedTime }}
run: |
LAST_WEEK="$(date -d "@$(( $(date +%s -d $CURR_DATE) - (60*60*24*7) ))" +"%Y-%m-%d")"
tools/generate_changelog.py -f --by-date /tmp/changelog.txt -T "${{ secrets.GITHUB_TOKEN }}" "$LAST_WEEK"
tac /tmp/changelog.txt > /tmp/changelog_rev.txt
tools/merge_summaries.sh /tmp/changelog_rev.txt data/changelog.txt
echo "date=$( date +"%Y-%m-%d" -d $CURR_DATE )" >> $GITHUB_OUTPUT
echo "old_date=$LAST_WEEK" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3.10.0
with:
commit-message: Weekly Changelog ${{ steps.getting-changes.outputs.old_date }} to ${{ steps.getting-changes.outputs.date }}
committer: David Seguin <davidseguin@live.ca>
author: David Seguin <davidseguin@live.ca>
token: ${{ secrets.TX_PR_CREATOR }}
branch: changelog-weekly
delete-branch: true
base: master
title: Weekly Changelog ${{ steps.getting-changes.outputs.old_date }} to ${{ steps.getting-changes.outputs.date }}
body: "#### Summary\nNone\n\n#### Additional context\n`Automatically generated as a draft. Please copy-edit before merging.`"
labels: Organization,<Documentation>
# create as a draft to allow maintainers to cull the changes before merging
draft: true
+26 -218
View File
@@ -1,234 +1,42 @@
!src/chkjson
*.7z
*.a
*.d
*.dll
*.exe
*.o
*.tmp
*.zip
*.apk
*.log
/WinDepend/
/bindist/
/build/
/build-start-time
/cache/
/cmake-build-debug/
/config/
/data/*.template
/data/cache/
/data/mods/user-default-mods.json
/dep/
/doxygen_doc/html/*
/doxygen_doc/latex/*
/font/
/graveyard/
/memorial/
/mods/
/obj/
/objwin/
/save/
/src/version.h
/src/prefix.h
/sound/
/templates/
/tools/format/json_formatter.cgi
cataclysm
cataclysm-tiles
data/*.template
save/
graveyard/
memorial/
obj/
debug.log
logg.txt
bindist/
cataclysmdda-*
objwin/
version.h
CataclysmWin.cscope_file_list
CataclysmWin.depend
CataclysmWin.layout
cata_test
cata_test-tiles
cataclysm
*cataclysm-tiles
cataclysm-vcpkg
cataclysmdda-*
chkjson*
debug.log
logg.txt
json_formatter
*.exe
*.dll
# Visual Studio files
*.code-workspace
*.exp
*.ilk
*.opensdf
*.pdb
*.lib
*.manifest
*.sdf
*.suo
*.user
*.vcxproj.filters
*.lastbuildstate
.vs/
.vscode/
Directory.Build.props
Directory.Build.targets
# Visual Studio project files
/msvc-full-features/**/
# Temporary CMakeFiles
CMakeUserPresets.json
out/
# Visual Studio 2015
/msvc-full-features/*db
/msvc-full-features/ipch
lnk*.tmp
Cataclysm.exe.lastcodeanalysissucceeded
#Visual Studio 2017
/msvc-full-features/PredictedInputCache_Debug_x64.dat
# Visual Studio 2019
**/enc_temp_folder/*
#vcpkg
/msvc-object_creator/vcpkg_installed
# PVS Studio
/msvc-full-features/*PVS-Studio*
*.sdf
*.pdb
*.ilk
Release*/
Debug*/
*.opensdf
# Temporary and backup files
*~
\#*
*.bak
*.cbTemp
*.sw?
*~
\#*
gmon.out
# System Files
.DS_Store
._.DS_Store
Thumbs.db
cscope.*
.DS_Store
core
tags
# Generated translation source
/lang/po/*.pot
# Compiled binary translations
/lang/mo/
# Stampfile for binary translations
/lang/mo_built.stamp
# Directory for translatable strings
/lang/json/*
!/lang/json/README
# Netbeans IDE folders
nbproject/
# Python runtime files
__pycache__
*.pyc
# vim files
*.vim
*.session
.ycm_extra_conf.py
.vimrc
# taskwarrior files
*.task*
# GitEye files
*.project
# vimdiff backup
*.orig
# OSX
Cataclysm.app
build-data/osx/AppIcon.icns
Cataclysm.dmg
# Jetbrains CLion
.idea/
# test executables and generated data
/tests/obj
/tests/cata_test
/tests/line_test
/tests/map_iterator_test
/tests/shadowcasting_test
/tests/data/jsionized_overmap.sav
/test_user_dir
monfactions.txt
# temporary files generated by tools/reduce_tests.sh
/list_of_tests
/list_of_tests.ok
/log
/multidelta.log
# static library used to link the test executable
cataclysm.a
# coredumps
*.core
# sublime-text workspace
*.sublime-workspace
# cppcheck
*cppcheck.xml
*.cppcheck
# clang tooling
compile_commands.json
.clangd
# IDA database
Cataclysm.i64
Cataclysm.id*
Cataclysm.til
Cataclysm.nam
# Snapcraft build directories
prime
snap
stage
# Snapcraft build file
*.snap
# Eclipse IDE
.cproject
.settings/
# Apple Xcode IDE
Xcode/
# gdb
.gdb_history
# Flatpak build artifacts
/.flatpak-builder/
/repo/
/build-dir/
# precompiled headers
/pch/pch.hpp.pch
/pch/main-pch.hpp.gch
/pch/main-pch.hpp.pch
/tests/pch/pch.hpp.pch
/tests/pch/tests-pch.hpp.gch
/tests/pch/tests-pch.hpp.pch
/tests/catch/catch.hpp.gch
/tests/catch/catch.hpp.pch
weather.output
# bundler local directories and files for jekyll site
/.bundle/
/_site/
/vendor/
.sass-cache
.jekyll-metadata
Gemfile.lock
# VERSION.txt generated by our CMakeLists.txt
VERSION.txt
cscope.*
-8
View File
@@ -1,8 +0,0 @@
# If this commit is applied, it will ....
# |<-- Using around 50, Maximum 72 Characters -->|
# Explain why this change is being made
# |<---- Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: fixes #1234, closes #2345, resolves #3456, references #4567
-12
View File
@@ -1,12 +0,0 @@
extraction:
cpp:
prepare:
packages:
- "libncurses-dev"
index:
build_command: "make RELEASE=1 cataclysm -j2"
# Disable FIXME query, in DDA it is as likely to be a future feature as a bug.
queries:
- exclude: cpp/fixme-comment
- exclude: cpp/non-constant-format
+11
View File
@@ -0,0 +1,11 @@
language: cpp
compiler:
- gcc
script: make
notifications:
irc: "irc.newnet.net#Cataclysm-DDA"
irc: "irc.freenode.org#Cataclysm-DDA"
use_notice: true
skip_join: true
-24
View File
@@ -1,24 +0,0 @@
[main]
host = https://www.transifex.com
[o:cataclysm-dda-translators:p:cataclysm-dda:r:master-cataclysm-dda]
file_filter = lang/po/<lang>.po
source_file = lang/po/cataclysm-dda.pot
source_lang = en
type = PO
minimum_perc = 0
[o:cataclysm-dda-translators:p:cataclysm-dda:r:credits-master]
file_filter = data/credits/<lang>.credits
source_file = data/credits/en.credits
source_lang = en
type = TXT
minimum_perc = 20
[o:cataclysm-dda-translators:p:cataclysm-dda:r:motd-master]
file_filter = data/motd/<lang>.motd
source_file = data/motd/en.motd
source_lang = en
type = TXT
minimum_perc = 20
+77 -452
View File
@@ -1,464 +1,89 @@
cmake_minimum_required(VERSION 3.21)
# WARNING: Only linux is currently supported by this cmake build file.
project(CataclysmDDA)
# This file is used to build cataclysm with CMake.
#
# To use it, install cmake, then:
#
# cd cataclysm
# mkdir build
# cd build
# cmake -G "Unix Makefiles" -DLOCALIZE=ON -DSDL=OFF ..
# make
#
# This will build and install cataclysm into the build directory.
#
# "Unix Makefiles" is a generator, you can get a list of supported generators
# on your system by running "cmake" without any arguments.
#
# -DOPTION_NAME=ON/OFF enables/disables OPTION_NAME
list(APPEND CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMakeModules)
if (NOT VCPKG_MANIFEST_MODE)
list(APPEND CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMakeModules/Find)
endif()
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
set(CMAKE_TLS_VERIFY ON)
PROJECT(CataclysmDDA)
# Build options
option(TILES "Build graphical tileset version." "OFF")
option(CURSES "Build curses version." "ON")
option(SOUND "Support for in-game sounds & music." "OFF")
option(BACKTRACE "Support for printing stack backtraces on crash" "ON")
option(LIBBACKTRACE "Print backtrace with libbacktrace." "OFF")
option(USE_HOME_DIR "Use user's home directory for save files." "ON")
option(USE_PREFIX_DATA_DIR "Use UNIX system directories for game data in release build." "ON")
option(LOCALIZE "Support for language localizations. Also enable UTF support." "ON")
option(LANGUAGES "Compile localization files for specified languages." "")
option(DYNAMIC_LINKING
"Use dynamic linking. Or use static to remove MinGW dependency instead." "ON")
option(JSON_FORMAT "Build JSON formatter" "OFF")
option(CATA_CCACHE "Try to find and build with ccache" "ON")
option(CATA_CLANG_TIDY_PLUGIN "Build Cata's custom clang-tidy checks as a plugin" "OFF")
option(CATA_CLANG_TIDY_EXECUTABLE "Build Cata's custom clang-tidy checks as an executable" "OFF")
option(TESTS "Compile Cata's tests" "ON")
set(CATA_CLANG_TIDY_INCLUDE_DIR "" CACHE STRING
"Path to internal clang-tidy headers required for plugin (e.g. ClangTidy.h)")
set(CATA_CHECK_CLANG_TIDY "" CACHE STRING "Path to check_clang_tidy.py for plugin tests")
set(GIT_BINARY "" CACHE STRING "Git binary name or path.")
set(GETTEXT_MSGFMT_BINARY "" CACHE FILEPATH "msgfmt binary name or path.")
OPTION(LOCALIZE "Toggle gettext localization/translation." ON)
OPTION(SDL "Use SDL curses emulation instead of terminal support." OFF)
OPTION(TILES "Enable tileset support." OFF)
if (TESTS)
include(CTest)
endif()
# Note: The CMake documentation says it's better to list the actual source
# files here, as otherwise cmake won't know to rerun when a new file
# is added. However, currently the Makefile also just scans for source
# files, so this approach should be "good enough".
FILE(GLOB CataclysmDDA_SRCS *.cpp)
FILE(GLOB CataclysmDDA_HDRS *.h)
message(STATUS "${PROJECT} build environment --")
message(STATUS "Build realm is: ${CMAKE_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_PROCESSOR}")
ADD_EXECUTABLE(cataclysm ${CataclysmDDA_SRCS} ${CataclysmDDA_HDRS})
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif ()
add_definitions(-DCMAKE)
include(GetGitRevisionDescription)
git_describe(GIT_VERSION --tags --always --match "[0-9A-Z]*.[0-9A-Z]*")
if (NOT "${GIT_VERSION}" MATCHES "GIT-NOTFOUND")
string(REPLACE "-NOTFOUND" "" GIT_VERSION ${GIT_VERSION})
file(WRITE ${CMAKE_SOURCE_DIR}/src/version.h
"// NOLINT(cata-header-guard)\n\#define VERSION \"${GIT_VERSION}\"\n")
message(STATUS "${PROJECT_NAME} build version is: ${GIT_VERSION}")
add_definitions(-DGIT_VERSION)
# get_git_head_revision() does not work with worktrees in Windows
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE _sha1
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(TIMESTAMP _timestamp %Y-%m-%d-%H%M)
file(WRITE VERSION.txt "\
build type: ${BUILD_PRESET_NAME}\n\
build number: ${_timestamp}\n\
commit sha: ${_sha1}\n\
commit url: https://github.com/CleverRaven/Cataclysm-DDA/commit/${_sha1}"
)
endif ()
#OS Check Placeholders. Will be used for BINDIST
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set(_OS_LINUX_ 1)
endif ()
if ("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
set(_OS_FREEBSD_ 1)
endif ()
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
set(_OS_DARWIN_ 1)
add_definitions(-DMACOSX)
if (TILES)
add_definitions(-DOSX_SDL2_LIBS)
endif ()
endif ()
include(CheckCXXCompilerFlag)
#FIXME: Add dest build choice: m32 for 32 bit or m64 for 64 bit version
#add_definitions("-m32")
#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
#SET(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -m32")
#SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -m32")
if (NOT DYNAMIC_LINKING)
if(NOT MSVC)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.dll.a")
endif()
set(BUILD_SHARED_LIBRARIES OFF)
check_cxx_compiler_flag (-static HAVE_STATIC_FLAG)
if (HAVE_STATIC_FLAG)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif ()
# Workaround for cmake link library guesser
set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic
set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
set(CMAKE_SHARED_LIBRARY_C_FLAGS) # remove -fPIC
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # remove -rdynamic
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
else ()
if (MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# Avoid depending on MinGW runtime DLLs
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
endif ()
endif ()
# System specific actions
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Linux|FreeBSD|Darwin)")
if (NOT DATA_PREFIX)
set(DATA_PREFIX ${CMAKE_INSTALL_PREFIX}/share/cataclysm-dda)
endif ()
if (NOT README_DIR)
set(README_DIR ${DATA_PREFIX})
endif ()
if (NOT LOCALE_DIR)
set(LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/share/locale)
endif ()
if (NOT BIN_PREFIX)
set(BIN_PREFIX ${CMAKE_INSTALL_PREFIX}/bin)
endif ()
if (NOT DESKTOP_ENTRY_PATH)
set(DESKTOP_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/applications)
endif ()
if (NOT PIXMAPS_ENTRY_PATH)
set(PIXMAPS_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)
endif ()
if (NOT PIXMAPS_UNITY_ENTRY_PATH)
set(PIXMAPS_UNITY_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/icons/ubuntu-mono-dark)
endif ()
if (NOT MANPAGE_ENTRY_PATH)
set(MANPAGE_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/man)
endif ()
endif ()
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Windows|MSYS)")
if (NOT DATA_PREFIX)
set(DATA_PREFIX ${CMAKE_INSTALL_PREFIX}/data)
endif ()
if (NOT README_DIR)
set(README_DIR ${CMAKE_INSTALL_PREFIX})
endif ()
if (NOT LOCALE_DIR)
set(LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/lang)
endif ()
if (NOT BIN_PREFIX)
set(BIN_PREFIX ${CMAKE_INSTALL_PREFIX})
endif ()
endif ()
message(STATUS "${PROJECT_NAME} build options --")
# Preset variables
if (NOT LANGUAGES)
set(LANGUAGES ar cs da de el es_AR es_ES fil_PH fr ga_IE hu id is it_IT ja ko nb nl pl pt_BR ro
ru sr tr uk_UA zh_CN zh_TW)
endif ()
if (GIT_BINARY)
set(GIT_EXECUTABLE ${GIT_BINARY})
else ()
find_package(Git)
if (NOT GIT_FOUND)
message(WARNING
"Git binary not found. Build version will be set to NULL. \
Install Git package or use -DGIT_BINARY to set path to git binary.")
endif ()
endif ()
# Can't compile curses and tiles build's at same time
if (TILES)
set(CURSES OFF)
endif ()
# Set build types and display info
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(RELEASE 0)
message(STATUS "Build ${PROJECT} in development mode --")
message(STATUS "Binaries will be located in: " ${CMAKE_SOURCE_DIR})
set(CMAKE_VERBOSE_MAKEFILE ON)
# Since CataclysmDDA does not respect PREFIX for development builds
# and has funny path handlers, we should create resulting Binaries
# in the source directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR} CACHE PATH
"Single Directory for all Executables.")
set(BIN_PREFIX ${CMAKE_SOURCE_DIR})
else ()
set(RELEASE 1)
message(STATUS "CMAKE_INSTALL_PREFIX : ${CMAKE_INSTALL_PREFIX}")
message(STATUS "BIN_PREFIX : ${BIN_PREFIX}")
message(STATUS "DATA_PREFIX : ${DATA_PREFIX}")
if (LOCALIZE)
message(STATUS "LOCALE_PATH : ${LOCALE_DIR}")
endif ()
message(STATUS "DESKTOP_ENTRY_PATH : ${DESKTOP_ENTRY_PATH}")
message(STATUS "PIXMAPS_ENTRY_PATH : ${PIXMAPS_ENTRY_PATH}")
message(STATUS "PIXMAPS_UNITY_ENTRY_PATH : ${PIXMAPS_UNITY_ENTRY_PATH}")
message(STATUS "MANPAGE_ENTRY_PATH : ${MANPAGE_ENTRY_PATH}")
add_definitions(-DRELEASE)
# Use CMAKE_INSTALL_PREFIX as storage of data,gfx, etc.. Useful only on *nix OS.
if (CMAKE_INSTALL_PREFIX AND NOT WIN32 AND USE_PREFIX_DATA_DIR)
add_definitions(-DPREFIX=${CMAKE_INSTALL_PREFIX})
configure_file(
"${CMAKE_SOURCE_DIR}/src/prefix.h.in"
"${CMAKE_SOURCE_DIR}/src/prefix.h"
@ONLY)
add_definitions(-DDATA_DIR_PREFIX)
endif ()
endif ()
message(STATUS "GIT_BINARY : ${GIT_EXECUTABLE}")
message(STATUS "DYNAMIC_LINKING : ${DYNAMIC_LINKING}")
message(STATUS "TILES : ${TILES}")
message(STATUS "CURSES : ${CURSES}")
message(STATUS "SOUND : ${SOUND}")
message(STATUS "BACKTRACE : ${BACKTRACE}")
message(STATUS "LOCALIZE : ${LOCALIZE}")
message(STATUS "USE_HOME_DIR : ${USE_HOME_DIR}")
message(STATUS "LANGUAGES : ${LANGUAGES}")
message(STATUS "See doc/COMPILING/COMPILING-CMAKE.md for details and more info --")
if (NOT MSVC)
set(CATA_WARNINGS
"-Werror -Wall -Wextra \
-Wformat-signedness \
-Wlogical-op \
-Wmissing-declarations \
-Wmissing-noreturn \
-Wnon-virtual-dtor \
-Wold-style-cast \
-Woverloaded-virtual \
-Wpedantic \
-Wsuggest-override \
-Wunused-macros \
-Wzero-as-null-pointer-constant")
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CATA_WARNINGS "${CATA_WARNINGS} -Wno-unknown-warning-option")
else()
set(CATA_WARNINGS "${CATA_WARNINGS} -Wno-unknown-warning")
endif()
if (NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
set(CATA_WARNINGS "${CATA_WARNINGS} -Wredundant-decls")
endif ()
set(CATA_OTHER_FLAGS "${CATA_OTHER_FLAGS} -fsigned-char")
# Compact the whitespace in the warning string
string(REGEX REPLACE "[\t ]+" " " CATA_WARNINGS "${CATA_WARNINGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CATA_WARNINGS} ${CATA_OTHER_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
endif ()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Force out-of-source build
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR
"This project requires an out of source build. \
Remove the file 'CMakeCache.txt' found in this directory before continuing; \
create a separate build directory and run 'cmake [options] <srcs>' from there. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif ()
#set(THREADS_USE_PTHREADS_WIN32 True)
set(CMAKE_THREAD_PREFER_PTHREAD True)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
# Check for build types and libraries
if (TILES)
# Find SDL, SDL_ttf & SDL_image for graphical install
message(STATUS "Searching for SDL2 library --")
find_package(SDL2)
if (NOT (SDL2_FOUND OR TARGET SDL2::SDL2))
message(FATAL_ERROR
"This project requires SDL2 to be installed to compile in graphical mode. \
Please install the SDL2 development libraries, \
or try compiling without -DTILES=1 for a text-only compilation. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif ()
if (NOT DYNAMIC_LINKING)
# SDL, SDL_Image, SDL_ttf deps are required for static build
message(STATUS "Searching for SDL deps libraries --")
find_package(Freetype REQUIRED)
find_package(PNG REQUIRED)
find_package(JPEG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
endif ()
message(STATUS "Searching for SDL2_TTF library --")
if (NOT VCPKG_MANIFEST_MODE)
find_package(SDL2_ttf)
else()
find_package(sdl2-ttf)
endif()
if (NOT (SDL2_TTF_FOUND OR TARGET SDL2::SDL2_ttf OR TARGET SDL2::SDL2_ttf-static))
message(FATAL_ERROR
"This project requires SDL2_ttf to be installed to compile in graphical mode. \
Please install the SDL2_ttf development libraries, \
or try compiling without -DTILES=1 for a text-only compilation. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif ()
message(STATUS "Searching for SDL2_image library --")
if(VCPKG_MANIFEST_MODE)
find_package(sdl2-image)
else()
find_package(SDL2_image)
endif()
if (NOT (SDL2_IMAGE_FOUND OR TARGET SDL2::SDL2_image))
message(FATAL_ERROR
"This project requires SDL2_image to be installed to compile in graphical mode. \
Please install the SDL2_image development libraries, \
or try compiling without -DTILES=1 for a text-only compilation. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif ()
add_definitions(-DTILES)
endif ()
if (CURSES)
# Find the ncurses library for a text based compile
message(STATUS "Searching for Curses library --")
set(CURSES_NEED_NCURSES TRUE)
set(CURSES_NEED_WIDE TRUE)
find_package(Curses)
if (NOT CURSES_FOUND)
message(FATAL_ERROR
"This project requires ncurses to be installed to be compiled in text-only mode. \
Please install the ncurses development libraries, \
or try compiling with -DTILES=1 for a graphical compilation. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info")
endif ()
if (NOT DYNAMIC_LINKING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNCURSES_STATIC")
endif ()
endif ()
if (SOUND)
# You need TILES to be able to use SOUND
if (NOT TILES)
message(FATAL_ERROR
"You must enable graphical support with -DTILES=1 \
to be able to enable sound support. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif ()
# Sound requires SDL_mixer library
if(VCPKG_MANIFEST_MODE)
message(STATUS "Searching for sdl2-mixer library --")
find_package(sdl2-mixer)
if (NOT TARGET SDL2::SDL2_mixer)
message(FATAL_ERROR
"You need the sdl2-mixer development library \
to be able to compile with sound enabled. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif()
else()
message(STATUS "Searching for SDL2_mixer library --")
find_package(SDL2_mixer)
# if (NOT TARGET SDL2_mixer::SDL2_mixer-static) # TODO x64-mingw-static ?
if (NOT SDL2_MIXER_FOUND)
message(FATAL_ERROR
"You need the SDL2_mixer development library \
to be able to compile with sound enabled. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif()
endif()
endif ()
if (BACKTRACE)
add_definitions(-DBACKTRACE)
if (LIBBACKTRACE)
add_definitions(-DLIBBACKTRACE)
endif ()
endif ()
if ((LOCALIZE OR BUILD_TESTING) AND "${GETTEXT_MSGFMT_BINARY}" STREQUAL "")
if(MSVC)
list(APPEND Gettext_ROOT C:\\msys64\\usr)
list(APPEND Gettext_ROOT C:\\Program\ Files\\Git\\usr)
endif(MSVC)
find_package(Gettext)
endif ()
if (NOT GETTEXT_MSGFMT_EXECUTABLE )
set(GETTEXT_MSGFMT_EXECUTABLE "${GETTEXT_MSGFMT_BINARY}")
endif()
# Ok. Now create build and install recipes
if (LOCALIZE)
add_subdirectory(lang)
add_definitions(-DLOCALIZE)
endif ()
if (USE_HOME_DIR)
add_definitions(-DUSE_HOME_DIR)
endif ()
find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND AND CATA_CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ccache)
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
set(CMAKE_C_LINKER_LAUNCHER ccache)
set(CMAKE_CXX_LINKER_LAUNCHER ccache)
endif ()
add_subdirectory(src)
add_subdirectory(data)
if (NOT MSVC)
add_subdirectory(src/chkjson)
endif()
if(TESTS)
add_subdirectory(tests)
endif()
if (JSON_FORMAT)
add_subdirectory(tools/format)
endif()
if (CATA_CLANG_TIDY_PLUGIN OR CATA_CLANG_TIDY_EXECUTABLE)
add_subdirectory(tools/clang-tidy-plugin)
endif()
install(DIRECTORY doc gfx
DESTINATION ${DATA_PREFIX}
# Custom command that will be executed whenever the "cataclysm" target is built.
# Copy all the relevant game data into the build directory.
ADD_CUSTOM_COMMAND(
TARGET cataclysm PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/data $<TARGET_FILE_DIR:cataclysm>/data
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/LICENSE.txt $<TARGET_FILE_DIR:cataclysm> # Don't forget the license :)
)
if (RELEASE)
install(FILES
${CMAKE_SOURCE_DIR}/README.md
${CMAKE_SOURCE_DIR}/LICENSE.txt
${CMAKE_SOURCE_DIR}/LICENSE-OFL-Terminus-Font.txt
${CMAKE_SOURCE_DIR}/VERSION.txt
DESTINATION ${README_DIR})
if (TILES)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/gfx DESTINATION ${DATA_PREFIX})
endif()
endif()
IF(MINGW)
add_definitions("-D_WINDOWS -D_MINGW -D_WIN32 -DWIN32 -D__MINGW__")
ENDIF()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
IF(LOCALIZE)
add_definitions(-DLOCALIZE)
#TARGET_LINK_LIBRARIES(cataclysm
# intl
#)
ENDIF()
add_custom_target(uninstall
"${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
# TODO: windows rc stuff
IF(SDL OR TILES)
# CMake ships with a few helpful include's to find common libraries
# like SDL
Include(FindSDL)
Include(FindSDL_ttf)
Find_Package(SDL REQUIRED)
Find_Package(SDL_ttf REQUIRED)
TARGET_LINK_LIBRARIES(cataclysm ${SDL_LIBRARY} ${SDLTTF_LIBRARY})
IF(TILES)
# Install GFX directory
ADD_CUSTOM_COMMAND(
TARGET cataclysm PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/gfx $<TARGET_FILE_DIR:cataclysm>/gfx
)
Include(FindSDL_image)
TARGET_LINK_LIBRARIES(cataclysm ${SDLIMAGE_LIBRARY})
ADD_DEFINITIONS(-DSDLTILES -DTILES)
ELSE()
ADD_DEFINITIONS(-DTILES)
ENDIF()
ELSEIF(MSVC OR MINGW)
# On windows our default isn't curses, but rather GDI
TARGET_LINK_LIBRARIES(cataclysm gdi32 intl iconv winmm)
add_definitions(-Wl,-stack,12000000,-subsystem,windows)
ELSE()
TARGET_LINK_LIBRARIES(cataclysm curses)
ENDIF()
-53
View File
@@ -1,53 +0,0 @@
# - Try to find Iconv
# Once done this will define
#
# ICONV_FOUND - system has Iconv
# ICONV_INCLUDE_DIR - the Iconv include directory
# ICONV_LIBRARIES - Link these to use Iconv
# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
#
include(CheckCXXSourceCompiles)
IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
# Already in cache, be silent
SET(ICONV_FIND_QUIETLY TRUE)
ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
SET(ICONV_FOUND TRUE)
ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
IF(ICONV_FOUND)
check_cxx_source_compiles("
#include <iconv.h>
int main(){
iconv_t conv = 0;
const char* in = 0;
size_t ilen = 0;
char* out = 0;
size_t olen = 0;
iconv(conv, &in, &ilen, &out, &olen);
return 0;
}
" ICONV_SECOND_ARGUMENT_IS_CONST )
ENDIF(ICONV_FOUND)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Iconv DEFAULT_MSG
ICONV_LIBRARIES ICONV_INCLUDE_DIR)
MARK_AS_ADVANCED(
ICONV_INCLUDE_DIR
ICONV_LIBRARIES
ICONV_SECOND_ARGUMENT_IS_CONST
)
-45
View File
@@ -1,45 +0,0 @@
# Try to find Libintl functionality
# Once done this will define
#
# LIBINTL_FOUND - system has Libintl
# LIBINTL_INCLUDE_DIR - Libintl include directory
# LIBINTL_LIBRARIES - Libraries needed to use Libintl
#
# TODO: This will enable translations only if Gettext functionality is
# present in libc. Must have more robust system for release, where Gettext
# functionality can also reside in standalone Gettext library, or the one
# embedded within kdelibs (cf. gettext.m4 from Gettext source).
# Copyright (c) 2006, Chusslove Illich, <caslav.ilic@gmx.net>
# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND)
set(Libintl_FIND_QUIETLY TRUE)
endif(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND)
find_path(LIBINTL_INCLUDE_DIR libintl.h)
set(LIBINTL_LIB_FOUND FALSE)
if(LIBINTL_INCLUDE_DIR)
include(CheckFunctionExists)
check_function_exists(dgettext LIBINTL_LIBC_HAS_DGETTEXT)
if (LIBINTL_LIBC_HAS_DGETTEXT)
set(LIBINTL_LIBRARIES)
set(LIBINTL_LIB_FOUND TRUE)
else (LIBINTL_LIBC_HAS_DGETTEXT)
find_library(LIBINTL_LIBRARIES intl libintl libintl-8)
if(LIBINTL_LIBRARIES)
set(LIBINTL_LIB_FOUND TRUE)
endif(LIBINTL_LIBRARIES)
endif (LIBINTL_LIBC_HAS_DGETTEXT)
endif(LIBINTL_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libintl DEFAULT_MSG LIBINTL_LIBRARIES LIBINTL_INCLUDE_DIR)
mark_as_advanced(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARIES LIBINTL_LIBC_HAS_DGETTEXT LIBINTL_LIB_FOUND)
-186
View File
@@ -1,186 +0,0 @@
#.rst:
# FindSDL2
# -------
#
# Locate SDL2 library
#
# This module defines
#
# ::
#
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL
# SDL2_INCLUDE_DIR, where to find SDL.h
# SDL2_VERSION_STRING, human-readable string containing the version of SDL
#
#
#
# This module responds to the flag:
#
# ::
#
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2_main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the proper link flags
# as part of the returned SDL2_LIBRARY variable.
#
#
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
#
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your
# configuration and no SDL2_LIBRARY, it means CMake did not find your SDL
# library (SDL.dll, libsdl.so, SDL.framework, etc). Set
# SDL2_LIBRARY_TEMP to point to your SDL library, and configure again.
# Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this
# value as appropriate. These values are used to generate the final
# SDL2_LIBRARY variable, but when these values are unset, SDL2_LIBRARY
# does not get created.
#
#
#
# $SDLDIR is an environment variable that would correspond to the
# ./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02
#
# Modified by Eric Wing. Added code to assist with automated building
# by using environmental variables and providing a more
# controlled/consistent search behavior. Added new modifications to
# recognize OS X frameworks and additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL
# guidelines. Added a search for SDLmain which is needed by some
# platforms. Added a search for threads which is needed by some
# platforms. Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of SDL2_LIBRARY to
# override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention is #include
# "SDL.h", not <SDL/SDL.h>. This is done for portability reasons
# because not all systems place things in SDL/ (see FreeBSD).
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_path(SDL2_INCLUDE_DIR SDL.h
HINTS
ENV SDL2DIR
${CMAKE_SOURCE_DIR}/dep/
PATH_SUFFIXES SDL2
# path suffixes to search inside ENV{SDLDIR}
include/SDL2 include
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(VC_LIB_PATH_SUFFIX lib/x64)
else()
set(VC_LIB_PATH_SUFFIX lib/x86)
endif()
find_library(SDL2_LIBRARY_TEMP
NAMES SDL2
HINTS
ENV SDL2DIR
${CMAKE_SOURCE_DIR}/dep/
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
if(NOT SDL2_BUILDING_LIBRARY)
if(NOT SDL2_INCLUDE_DIR MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
find_library(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
ENV SDL2DIR
${CMAKE_SOURCE_DIR}/dep/
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
PATHS
/sw
/opt/local
/opt/csw
/opt
)
endif()
endif()
# SDL may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
if(NOT APPLE)
find_package(Threads)
endif()
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
if(MINGW)
set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
endif()
if(SDL2_LIBRARY_TEMP)
# For SDLmain
if(SDL2MAIN_LIBRARY AND NOT SDL2_BUILDING_LIBRARY)
list(FIND SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" _SDL2_MAIN_INDEX)
if(_SDL2_MAIN_INDEX EQUAL -1)
set(SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" ${SDL2_LIBRARY_TEMP})
endif()
unset(_SDL2_MAIN_INDEX)
endif()
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
if(APPLE)
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
endif()
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
if(NOT APPLE)
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
endif()
# For MinGW library
if(MINGW)
set(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
endif()
# Set the final string here so the GUI reflects the final state.
set(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
set(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
VERSION_VAR SDL2_VERSION_STRING)
-97
View File
@@ -1,97 +0,0 @@
#.rst:
# FindSDL2_image
# -------------
#
# Locate SDL2_image library
#
# This module defines:
#
# ::
#
# SDL2_IMAGE_LIBRARIES, the name of the library to link against
# SDL2_IMAGE_INCLUDE_DIRS, where to find the headers
# SDL2_IMAGE_FOUND, if false, do not try to link against
# SDL2_IMAGE_VERSION_STRING - human-readable string containing the
# version of SDL2_image
#
#
#
# For backward compatibility the following variables are also set:
#
# ::
#
# SDL2IMAGE_LIBRARY (same value as SDL2_IMAGE_LIBRARIES)
# SDL2IMAGE_INCLUDE_DIR (same value as SDL2_IMAGE_INCLUDE_DIRS)
# SDL2IMAGE_FOUND (same value as SDL2_IMAGE_FOUND)
#
#
#
# $SDL2DIR is an environment variable that would correspond to the
# ./configure --prefix=$SDL2DIR used in building SDL2.
#
# Created by Eric Wing. This was influenced by the FindSDL2.cmake
# module, but with modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if(NOT SDL2_IMAGE_INCLUDE_DIR AND SDL2IMAGE_INCLUDE_DIR)
set(SDL2_IMAGE_INCLUDE_DIR ${SDL2IMAGE_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
endif()
find_path(SDL2_IMAGE_INCLUDE_DIR SDL_image.h
HINTS
ENV SDL2IMAGEDIR
ENV SDL2DIR
${CMAKE_SOURCE_DIR}/dep/
PATH_SUFFIXES SDL2
# path suffixes to search inside ENV{SDL2DIR}
include/SDL2 include
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(VC_LIB_PATH_SUFFIX lib/x64)
else()
set(VC_LIB_PATH_SUFFIX lib/x86)
endif()
if(NOT SDL2_IMAGE_LIBRARY AND SDL2IMAGE_LIBRARY)
set(SDL2_IMAGE_LIBRARY ${SDL2IMAGE_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
endif()
find_library(SDL2_IMAGE_LIBRARY
NAMES SDL2_image
HINTS
ENV SDL2IMAGEDIR
ENV SDL2DIR
${CMAKE_SOURCE_DIR}/dep/
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
set(SDL2_IMAGE_LIBRARIES ${SDL2_IMAGE_LIBRARY})
set(SDL2_IMAGE_INCLUDE_DIRS ${SDL2_IMAGE_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_image
REQUIRED_VARS SDL2_IMAGE_LIBRARIES SDL2_IMAGE_INCLUDE_DIRS
VERSION_VAR SDL2_IMAGE_VERSION_STRING)
# for backward compatibility
set(SDL2IMAGE_LIBRARY ${SDL2_IMAGE_LIBRARIES})
set(SDL2IMAGE_INCLUDE_DIR ${SDL2_IMAGE_INCLUDE_DIRS})
set(SDL2IMAGE_FOUND ${SDL2_IMAGE_FOUND})
mark_as_advanced(SDL2_IMAGE_LIBRARY SDL2_IMAGE_INCLUDE_DIR)
-97
View File
@@ -1,97 +0,0 @@
#.rst:
# FindSDL2_mixer
# -------------
#
# Locate SDL2_mixer library
#
# This module defines:
#
# ::
#
# SDL2_MIXER_LIBRARIES, the name of the library to link against
# SDL2_MIXER_INCLUDE_DIRS, where to find the headers
# SDL2_MIXER_FOUND, if false, do not try to link against
# SDL2_MIXER_VERSION_STRING - human-readable string containing the
# version of SDL2_mixer
#
#
#
# For backward compatibility the following variables are also set:
#
# ::
#
# SDL2MIXER_LIBRARY (same value as SDL2_MIXER_LIBRARIES)
# SDL2MIXER_INCLUDE_DIR (same value as SDL2_MIXER_INCLUDE_DIRS)
# SDL2MIXER_FOUND (same value as SDL2_MIXER_FOUND)
#
#
#
# $SDL2DIR is an environment variable that would correspond to the
# ./configure --prefix=$SDL2DIR used in building SDL2.
#
# Created by Eric Wing. This was influenced by the FindSDL2.cmake
# module, but with modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if(NOT SDL2_MIXER_INCLUDE_DIR AND SDL2MIXER_INCLUDE_DIR)
set(SDL2_MIXER_INCLUDE_DIR ${SDL2MIXER_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
endif()
find_path(SDL2_MIXER_INCLUDE_DIR SDL_mixer.h
HINTS
ENV SDL2MIXERDIR
ENV SDL2DIR
${CMAKE_SOURCE_DIR}/dep/
PATH_SUFFIXES SDL2
# path suffixes to search inside ENV{SDL2DIR}
include/SDL2 include
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(VC_LIB_PATH_SUFFIX lib/x64)
else()
set(VC_LIB_PATH_SUFFIX lib/x86)
endif()
if(NOT SDL2_MIXER_LIBRARY AND SDL2MIXER_LIBRARY)
set(SDL2_MIXER_LIBRARY ${SDL2MIXER_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
endif()
find_library(SDL2_MIXER_LIBRARY
NAMES SDL2_mixer
HINTS
ENV SDL2MIXERDIR
ENV SDL2DIR
${CMAKE_SOURCE_DIR}/dep/
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
set(SDL2_MIXER_LIBRARIES ${SDL2_MIXER_LIBRARY})
set(SDL2_MIXER_INCLUDE_DIRS ${SDL2_MIXER_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_mixer
REQUIRED_VARS SDL2_MIXER_LIBRARIES SDL2_MIXER_INCLUDE_DIRS
VERSION_VAR SDL2_MIXER_VERSION_STRING)
# for backward compatibility
set(SDL2MIXER_LIBRARY ${SDL2_MIXER_LIBRARIES})
set(SDL2MIXER_INCLUDE_DIR ${SDL2_MIXER_INCLUDE_DIRS})
set(SDL2MIXER_FOUND ${SDL2_MIXER_FOUND})
mark_as_advanced(SDL2_MIXER_LIBRARY SDL2_MIXER_INCLUDE_DIR)
-96
View File
@@ -1,96 +0,0 @@
#.rst:
# FindSDL2_ttf
# -----------
#
# Locate SDL2_ttf library
#
# This module defines:
#
# ::
#
# SDL2_TTF_LIBRARIES, the name of the library to link against
# SDL2_TTF_INCLUDE_DIRS, where to find the headers
# SDL2_TTF_FOUND, if false, do not try to link against
# SDL2_TTF_VERSION_STRING - human-readable string containing the version of SDL2_ttf
#
#
#
# For backward compatibility the following variables are also set:
#
# ::
#
# SDL2TTF_LIBRARY (same value as SDL2_TTF_LIBRARIES)
# SDL2TTF_INCLUDE_DIR (same value as SDL2_TTF_INCLUDE_DIRS)
# SDL2TTF_FOUND (same value as SDL2_TTF_FOUND)
#
#
#
# $SDL2DIR is an environment variable that would correspond to the
# ./configure --prefix=$SDL2DIR used in building SDL2.
#
# Created by Eric Wing. This was influenced by the FindSDL2.cmake
# module, but with modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if(NOT SDL2_TTF_INCLUDE_DIR AND SDL2TTF_INCLUDE_DIR)
set(SDL2_TTF_INCLUDE_DIR ${SDL2TTF_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
endif()
find_path(SDL2_TTF_INCLUDE_DIR SDL_ttf.h
HINTS
ENV SDL2TTFDIR
ENV SDL2DIR
${CMAKE_SOURCE_DIR}/dep/
PATH_SUFFIXES SDL2
# path suffixes to search inside ENV{SDL2DIR}
include/SDL2 include
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(VC_LIB_PATH_SUFFIX lib/x64)
else()
set(VC_LIB_PATH_SUFFIX lib/x86)
endif()
if(NOT SDL2_TTF_LIBRARY AND SDL2TTF_LIBRARY)
set(SDL2_TTF_LIBRARY ${SDL2TTF_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
endif()
find_library(SDL2_TTF_LIBRARY
NAMES SDL2_ttf
HINTS
ENV SDL2TTFDIR
ENV SDL2DIR
${CMAKE_SOURCE_DIR}/dep/
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
set(SDL2_TTF_LIBRARIES ${SDL2_TTF_LIBRARY})
set(SDL2_TTF_INCLUDE_DIRS ${SDL2_TTF_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_ttf
REQUIRED_VARS SDL2_TTF_LIBRARIES SDL2_TTF_INCLUDE_DIRS
VERSION_VAR SDL2_TTF_VERSION_STRING)
# for backward compatibility
set(SDL2TTF_LIBRARY ${SDL2_TTF_LIBRARIES})
set(SDL2TTF_INCLUDE_DIR ${SDL2_TTF_INCLUDE_DIRS})
set(SDL2TTF_FOUND ${SDL2_TTF_FOUND})
mark_as_advanced(SDL2_TTF_LIBRARY SDL2_TTF_INCLUDE_DIR)
@@ -1,130 +0,0 @@
# - Returns a version string from Git
#
# These functions force a re-configure on each git commit so that you can
# trust the values of the variables in your build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the source tree, and adjusting
# the output so that it tests false if an error occurs.
#
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree,
# and adjusting the output so that it tests false if there was no exact
# matching tag.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__get_git_revision_description)
return()
endif()
set(__get_git_revision_description YES)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
function(get_git_head_revision _refspecvar _hashvar)
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
# We have reached the root directory, we are not in git
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
return()
endif()
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
endwhile()
# check if this is a submodule
if(NOT IS_DIRECTORY ${GIT_DIR})
file(READ ${GIT_DIR} submodule)
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
endif()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()
if(NOT EXISTS "${GIT_DIR}/HEAD")
return()
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
"${GIT_DATA}/grabRef.cmake"
@ONLY)
include("${GIT_DATA}/grabRef.cmake")
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
endfunction()
function(git_describe _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
return()
endif()
# TODO sanitize
#if((${ARGN}" MATCHES "&&") OR
# (ARGN MATCHES "||") OR
# (ARGN MATCHES "\\;"))
# message("Please report the following error to the project!")
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
#endif()
#message(STATUS "Arguments to execute_process: ${ARGN}")
execute_process(COMMAND
"${GIT_EXECUTABLE}"
describe
${hash}
${ARGN}
WORKING_DIRECTORY
"${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
@@ -1,41 +0,0 @@
#
# Internal file for GetGitRevisionDescription.cmake
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(HEAD_HASH)
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()
-71
View File
@@ -1,71 +0,0 @@
{
"version": 3,
"configurePresets": [
{
"name": "base",
"description": "Base Build Configuration",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"hidden": true
},
{
"name": "windows",
"description": "Windows Build Configuration",
"condition": {
"type": "allOf",
"conditions": [
{
"type": "equals",
"lhs": "$env{MSYSTEM}",
"rhs": ""
},
{
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
]
},
"cacheVariables": {
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/build-scripts"
},
"hidden": true
},
{
"name": "MSVC",
"inherits": [ "windows" ],
"description": "Visual C++ Configuration",
"toolchainFile": "${sourceDir}/build-scripts/MSVC.cmake",
"cacheVariables": {
"VCPKG_ROOT": "C:/vcpkg"
},
"hidden": true
},
{
"name": "x64-windows-static",
"inherits": [ "base", "MSVC" ],
"description": "Link Statically",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
"DYNAMIC_LINKING": "False"
},
"hidden": true
},
{
"name": "windows-tiles-sounds-x64-msvc",
"inherits": [ "x64-windows-static" ],
"displayName": "Windows Tiles Sounds x64 MSVC",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (RelWithDebInfo)",
"cacheVariables": {
"CMAKE_PROJECT_INCLUDE_BEFORE": "${sourceDir}/build-scripts/windows-tiles-sounds-x64-msvc.cmake",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"RELEASE": "True",
"CURSES": "False",
"LOCALIZE": "True",
"TILES": "True",
"SOUND": "True",
"TESTS": "False"
}
}
]
}
-25
View File
@@ -1,25 +0,0 @@
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
1. Assume other participants are posting in good faith, even if you disagree with what they say.
2. Make an effort to treat other participants with respect.
1. Do not take a harsh tone towards other participants, and especially don't make personal attacks against them.
2. Recognize that criticism of your statements is not a personal attack on you.
3. Avoid statements about the presumed typical desires, capabilities or actions of some demographic group.
3. Be especially kind to other contributors when saying they made a mistake.
4. Don't argue unceasingly for your preferred course of action when a decision for some other course has already been made.
5. If other participants complain about the way you express your ideas, please make an effort to cater to them.
6. Don't raise unrelated political issues.
7. If you feel these standards are being violated, please alert the project lead Kevin Granade at kevin.granade@gmail.com
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][CoC homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][CoC version] and the [GNU Kind Communications Guidelines][GKCG homepage].
[CoC homepage]: http://contributor-covenant.org
[CoC version]: http://contributor-covenant.org/version/1/4/
[GKCG homepage]: https://www.gnu.org/philosophy/kind-communication.html
+84
View File
@@ -0,0 +1,84 @@
Instructions for compiling on a Debian-based system. The package names here are
valid for Ubuntu 12.10 and may or may not work on your system.
Building instructions, below, always assume you are running them from the
Cataclysm:DDA source directory.
## Linux (native) ncurses builds ##
Dependencies:
* ncurses
* build essentials
```
sudo apt-get install libncurses5-dev build-essential
```
### Building ###
```
make
```
## Cross-compiling to linux 32-bit from linux 64-bit ##
Dependencies:
* 32-bit toolchain
* 32-bit ncurses
```
sudo apt-get install libc6-dev-i386 lib32stdc++-dev g++-multilib lib32ncurses5-dev
```
### Building ###
```
make NATIVE=linux32
```
## Cross-compile to Windows from Linux ##
Dependencies:
* [mxe](http://mxe.cc)
```
sudo apt-get install autoconf bison flex cmake git automake intltool libtool scons yasm
mkdir -p ~/src/mxe
git clone -b stable https://github.com/mxe/mxe.git ~/src/mxe
cd ~/src/mxe
make gcc glib
```
### Building ###
```
PATH="${PATH}:~/src/mxe/usr/bin"
make CROSS=i686-pc-mingw32-
```
## Linux (native) SDL builds ##
Dependencies:
* SDL
* SDL_ttf
* build essentials
```
sudo apt-get install libsdl1.2-dev libsdl-ttf2.0-dev build-essential
```
### Building ###
```
make TILES=1
```
## Cross-compile to Windows SDL from Linux ##
Dependencies:
* [mxe](http://mxe.cc)
```
sudo apt-get install autoconf bison flex cmake git automake intltool libtool scons yasm
mkdir -p ~/src/mxe
git clone -b stable https://github.com/mxe/mxe.git ~/src/mxe
cd ~/src/mxe
make sdl sdl_ttf
```
### Building ###
```
PATH="${PATH}:~/src/mxe/usr/bin"
make TILES=1 CROSS=i686-pc-mingw32-
```
+83
View File
@@ -0,0 +1,83 @@
# Building Cataclysm-DDA on Mac OS X
Tested with OS X 10.8.4, Xcode 4.6.2.
I haven't played it extensively but it builds and runs.
Not sure if it compiles with older OS/XCode versions.
This worked for me, your mileage may vary.
### SDL
SDL, SDL\_image, and SDL\_ttf are needed for the tiles build.
[**SDL framework**](http://www.libsdl.org/download-1.2.php)
http://www.libsdl.org/release/SDL-1.2.15.dmg
[**SDL\_image framework**](http://www.libsdl.org/projects/SDL_image/)
http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.dmg
[**SDL\_ttf framework**](http://www.libsdl.org/projects/SDL_ttf/)
http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.dmg
Copy `SDL.framework`, `SDL_image.framework`, and `SDL_ttf.framework`
to `/Library/Frameworks` or `/Users/name/Library/Frameworks`.
Alternately, shared libraries (libsdl, libsdl\_image, libsdl\_ttf) can be used
instead of frameworks. Install with a package manager (Fink, MacPorts,
Homebrew, pkgsrc) or build and install from source.
### ncurses, gettext
ncurses and gettext are needed for localization.
Install with a package manager, or build from source and install.
* ncurses needs wide character support enabled.
## Build
From the Cataclysm-DDA source folder:
The easiest way to try it out is the console version without localization:
$ make NATIVE=osx LOCALIZED=0 OSX_MIN=10.6
For localization support and/or to use libsdl (not frameworks):
$ export CXXFLAGS="-I/path/to/include" LDFLAGS="-L/path/to/lib"
This adds paths to find shared libraries outside of /usr and /usr/local.
Multiple `-I/...` or `-L/...` paths can be specified.
### Example builds:
Build a release version with SDL graphical tiles:
$ make FRAMEWORK=1 NATIVE=osx OSX_MIN=10.6 RELEASE=1 TILES=1 LOCALIZE=0
Build a debug version with SDL ASCII:
$ make FRAMEWORK=1 NATIVE=osx OSX_MIN=10.6 SDL=1 LOCALIZE=0
## Run
$ ./cataclysm
or
$ ./cataclysm-tiles
### Make Options
`FRAMEWORK=1` use frameworks; omit to use libsdl, libsdl\_image, libsdl\_ttf.
`LOCALIZED=0` disable localization; enabled by default (requires gettext and ncurses with wide character support).
`NATIVE=osx` build for OS X.
`OSX_MIN=version` set `-mmacosx-version-min=` (for OS X > 10.5 set it to 10.6 or higher); omit for 10.5.
`RELEASE=1` build an optimized 'release' version.
`SDL=1` build the SDL version with ASCII characters.
`TILES=1` build the SDL version with graphical tiles.
+197
View File
@@ -0,0 +1,197 @@
# Contribute
Contributing to Cataclysm: Dark Days Ahead is easy - simply fork the repository here on GitHub, make your changes, and then send us a pull request.
## Guidelines
There are a couple of guidelines we suggest sticking to:
* Add this repository as an `upstream` remote.
* Keep your `master` branch clean. This means you can easily pull changes made to this repository into yours.
* Create a new branch for each new feature or set of related bug fixes.
* Never merge from your local branches into your `master` branch. Only update that by pulling from `upstream/master`.
## Code Style
Current policy is to only update code to the standard style when changing a substantial portion of it, but **please** do this in a seperate commit. Blocks of code can be passed through astyle
to ensure that their formatting is correct:
astyle --style=1tbs --indent=spaces=4 --align-pointer=name --max-code-length=100 --break-after-logical --indent-classes --indent-switches --indent-preprocessor --indent-col1-comments --min-conditional-indent=0 --pad-oper --add-brackets --convert-tabs
For example, from vi, set marks a and b around the block, then:
:'a,'b ! astyle --style=1tbs --indent-spaces=4 --align-pointer=name --max-code-length=100 --break-after-logical --indent-classes --indent-switches --indent-preprocessor --indent-col1-comments --min-conditional-indent=0 --pad-oper --add-brackets --convert-tabs
## Doxygen Comments
Extensive documentation of classes and class members will make the code more readable to new contributors. New doxygen comments for existing classes are a welcomed contribution.
Use the following template for commenting classes:
```c++
/**
* Brief description
*
* Lengthy description with many words. (optional)
*/
class foo {
```
Use the following template for commenting functions:
```c++
/**
* Brief description
*
* Lengthy description with many words. (optional)
* @param param1 Description of param1 (optional)
* @return Description of return (optional)
*/
int foo(int param1);
```
Use the following template for commenting member variables:
```c++
/** Brief description **/
int foo;
```
Helpful pages:
http://www.stack.nl/~dimitri/doxygen/manual/commands.html
http://www.stack.nl/~dimitri/doxygen/manual/markdown.html#markdown_std
http://www.stack.nl/~dimitri/doxygen/manual/faq.html
### Guidelines for adding documentation
* Doxygen comments should describe behavior towards the outside, not implementation, but since many classes in Cataclysm are intertwined, it's often necessary to describe implementation.
* Describe things that aren't obvious to newcomers just from the name.
* Don't describe redundantly, `/** Map **/; map* map;` is not a helpful comment.
* When documenting X, describe how X interacts with other components, not just what X itself does.
### Building the documentation for viewing it locally
* Install doxygen
* `doxygen doxygen_doc/doxygen_conf.txt `
* `firefox doxygen_doc/html/index.html` (replace firefox with your browser of choice)
## Example Workflow
#### Setup your environment
*(This only needs to be done once.)*
1. Fork this repository here on GitHub.
2. Clone your fork locally.
$ git clone https://github.com/YOUR_USERNAME/Cataclysm-DDA.git
# Clones your fork of the repository into the current directory in terminal
3. Add this repository as a remote.
$ cd Cataclysm-DDA
# Changes the active directory in the prompt to the newly cloned "Cataclysm-DDA" directory
$ git remote add -f upstream https://github.com/CleverRaven/Cataclysm-DDA.git
# Assigns the original repository to a remote called "upstream"
#### Update your `master` branch
1. Make sure you have your `master` branch checked out.
$ git checkout master
2. Pull the changes from the `upstream/master` branch.
$ git pull --ff-only upstream master
# gets changes from "master" branch on the "upstream" remote
* Note: If this gives you an error, it means you have committed directly to your local `master` branch. [Click here for instructions on how to fix this issue](#why-does-git-pull---ff-only-result-in-an-error).
#### Make your changes
0. Update your `master` branch, if you haven't already.
1. For each new feature or bug fix, create a new branch.
$ git branch new_feature
# Creates a new branch called "new_feature"
$ git checkout new_feature
# Makes "new_feature" the active branch
2. Once you've committed some changes locally, you need to push them to your fork here on GitHub.
$ git push origin new_feature
# origin was automatically set to point to your fork when you cloned it
3. Once you're finished working on your branch, and have committed and pushed all your changes, submit a pull request from your `new_feature` branch to this repository's `master` branch.
* Note: any new commits to the `new_feature` branch on GitHub will automatically be included in the pull request, so make sure to only commit related changes to the same branch.
## Pull Request Notes
* Mark pull requests that are still being worked on with [WIP] at the end of the title
* When a pull request is ready to be reviewed remove the [WIP]
* Mark pull requests that need commenting/testing by others with [CR]
## Advanced Techniques
These guidelines aren't essential, but they can make keeping things in order much easier.
#### Using remote tracking branches
Remote tracking branches allow you to easily stay in touch with this repository's `master` branch, as they automatically know which remote branch to get changes from.
$ git branch -vv
* master xxxx [origin/master] ....
new_feature xxxx ....
Here you can see we have two branches; `master` which is tracking `origin/master`, and `new_feature` which isn't tracking any branch. In practice, what this means is that git won't know where to get changes from.
$ git checkout new_feature
Switched to branch 'new_feature'
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
In order to easily pull changes from `upstream/master` into the `new_feature` branch, we can tell git which branch it should track. (You can even do this for your local master branch.)
$ git branch -u upstream/master new_feature
Branch new_feature set up to track remote branch master from upstream.
$ git pull
Updating xxxx..xxxx
....
You can also set the tracking information at the same time as creating the branch.
$ git branch new_feature_2 --track upstream/master
Branch new_feature_2 set up to track remote branch master from upstream.
* Note: Although this makes it easier to pull from `upstream/master`, it doesn't change anything with regards to pushing. `git push` fails because you don't have permission to push to `upstream/master`.
$ git push
error: The requested URL returned error: 403 while accessing https://github.com/CleverRaven/Cataclysm-DDA.git
fatal: HTTP request failed
$ git push origin
....
To https://github.com/YOUR_USERNAME/Cataclysm-DDA.git
xxxx..xxxx new_feature -> new_feature
## Frequently Asked Questions
####Why does `git pull --ff-only` result in an error?
If `git pull --ff-only` shows an error, it means that you've committed directly to your local `master` branch. To fix this, we create a new branch with these commits, find the point at which we diverged from `upstream/master`, and then reset `master` to that point.
$ git pull --ff-only upstream master
From https://github.com/CleverRaven/Cataclysm-DDA
* branch master -> FETCH_HEAD
fatal: Not possible to fast-forward, aborting.
$ git branch new_branch master # mark the current commit with a tmp branch
$ git merge-base master upstream/master
cc31d0... # the last commit before we committed directly to master
$ git reset --hard cc31d0....
HEAD is now at cc31d0... ...
Now that `master` has been cleaned up, we can easily pull from `upstream/master`, and then continue working on `new_branch`.
$ git pull --ff-only upstream master
# gets changes from the "upstream" remote for the matching branch, in this case "master"
$ git checkout new_branch
-84
View File
@@ -1,84 +0,0 @@
{
"build_systems":
[
{
"cmd":
[
"make",
"USE_HOME_DIR=1",
"CLANG=1",
"CCACHE=1",
"RELEASE=1"
],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "make RELEASE",
"working_dir": "${folder:${project_path:${file_path}}}"
},
{
"cmd":
[
"make",
"USE_HOME_DIR=1",
"CLANG=1",
"CCACHE=1"
],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "make",
"working_dir": "${folder:${project_path:${file_path}}}"
},
{
"cmd":
[
"make",
"USE_HOME_DIR=1",
"CLANG=1",
"CCACHE=1",
"TILES=1"
],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "make TILES",
"working_dir": "${folder:${project_path:${file_path}}}"
},
{
"cmd":
[
"make",
"USE_HOME_DIR=1",
"CLANG=1",
"CCACHE=1",
"TILES=1",
"RELEASE=1"
],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"name": "make RELEASE TILES",
"working_dir": "${folder:${project_path:${file_path}}}"
}
],
"folders":
[
{
"folder_exclude_patterns":
[
"Cataclysm.app"
],
"path": "."
},
{
"path": "~/.cataclysm-dda"
},
{
"path": "~/Library/Application Support/Cataclysm"
}
],
"settings":
{
"AStyleFormatter":
{
"options_c++":
{
"additional_options_file": ".astylerc",
"use_only_additional_options": true
}
}
}
}
+418
View File
@@ -0,0 +1,418 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Cataclysm" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Release">
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os" />
<Add option="-O2" />
<Add option="-DRELEASE=1" />
</Compiler>
</Target>
<Target title="Release - Localized">
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os" />
<Add option="-O2" />
<Add option="-DLOCALIZE" />
<Add option="-DRELEASE=1" />
</Compiler>
<Linker>
<Add library="intl" />
<Add library="iconv" />
</Linker>
</Target>
<Target title="Release -SDL">
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os" />
<Add option="-O2" />
<Add option="-DTILES" />
<Add option="-DRELEASE=1" />
<Add directory="WinDepend\SDLttf\SDL_ttf-2.0.11\include" />
<Add directory="WinDepend\SDL-1.2.15\include\SDL" />
<Add directory="WinDepend\SDLImg_binVC\SDL_image-1.2.12\include" />
</Compiler>
<Linker>
<Add library="libSDL.dll" />
<Add library="SDL_ttf" />
<Add library="WinDepend\SDLttf\SDL_ttf-2.0.11\lib\x86\SDL_ttf.lib" />
<Add library="WinDepend\SDL-1.2.15\lib\libSDL.dll.a" />
<Add library="WinDepend\SDL-1.2.15\lib\libSDLmain.a" />
<Add library="WinDepend\SDLImg_binVC\SDL_image-1.2.12\lib\x86\SDL_image.lib" />
<Add directory="WinDepend\SDL-1.2.15\lib" />
<Add directory="WinDepend\SDLttf\SDL_ttf-2.0.11\lib\x86" />
<Add directory="WinDepend\libiconv\lib" />
<Add directory="WinDepend\SDLImg_binVC\SDL_image-1.2.12\lib\x86" />
</Linker>
</Target>
<Target title="Release -SDL -Localized">
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os" />
<Add option="-O2" />
<Add option="-DLOCALIZE" />
<Add option="-DTILES" />
<Add option="-DSDLTILES" />
<Add option="-DRELEASE=1" />
<Add directory="WinDepend\SDLttf\SDL_ttf-2.0.11\include" />
<Add directory="WinDepend\SDL-1.2.15\include\SDL" />
<Add directory="WinDepend\SDLImg_binVC\SDL_image-1.2.12\include" />
</Compiler>
<Linker>
<Add library="intl" />
<Add library="iconv" />
<Add library="WinDepend\SDLttf\SDL_ttf-2.0.11\lib\x86\SDL_ttf.lib" />
<Add library="WinDepend\SDL-1.2.15\lib\libSDL.dll.a" />
<Add library="WinDepend\SDL-1.2.15\lib\libSDLmain.a" />
<Add library="WinDepend\SDLImg_binVC\SDL_image-1.2.12\lib\x86\SDL_image.lib" />
<Add directory="WinDepend\SDL-1.2.15\lib" />
<Add directory="WinDepend\SDLttf\SDL_ttf-2.0.11\lib\x86" />
<Add directory="WinDepend\libiconv\lib" />
<Add directory="WinDepend\SDLImg_binVC\SDL_image-1.2.12\lib\x86" />
</Linker>
</Target>
<Target title="Debug">
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-pg" />
<Add option="-g" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
</Linker>
</Target>
<Target title="Debug - Localized">
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-pg" />
<Add option="-g" />
<Add option="-DLOCALIZE" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
<Add library="intl" />
<Add library="iconv" />
</Linker>
</Target>
<Target title="Release - Tile Support">
<Option output="Cataclysm-Tiles" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\TilesRelease\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os" />
<Add option="-O2" />
<Add option="-pg" />
<Add option="-DSDLTILES" />
<Add option="-DTILES" />
<Add directory="3rdparty/include/SDL" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
<Add library="3rdparty\lib\libSDL.dll.a" />
<Add library="3rdparty\lib\libSDLmain.a" />
<Add library="3rdparty\lib\x86\SDL_image.lib" />
<Add library="3rdparty\lib\x86\SDL_ttf.lib" />
<Add directory="3rdparty\lib" />
<Add directory="3rdparty\lib\x86" />
</Linker>
</Target>
<Target title="Debug - Tile Support">
<Option output="Cataclysm-Tiles" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\TilesRelease\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os" />
<Add option="-O2" />
<Add option="-pg" />
<Add option="-g" />
<Add option="-DSDLTILES" />
<Add option="-DTILES" />
<Add directory="3rdparty/include/SDL" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
<Add library="3rdparty\lib\libSDL.dll.a" />
<Add library="3rdparty\lib\libSDLmain.a" />
<Add library="3rdparty\lib\x86\SDL_image.lib" />
<Add library="3rdparty\lib\x86\SDL_ttf.lib" />
<Add directory="3rdparty\lib" />
<Add directory="3rdparty\lib\x86" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wextra" />
<Add option="-Wall" />
<Add option="-Wno-switch -Wno-sign-compare -Wno-missing-braces -Wno-unused-parameter" />
</Compiler>
<Linker>
<Add option="-Wl,-stack,12000000,-subsystem,windows" />
<Add option="-static" />
<Add library="gdi32" />
<Add library="winmm" />
</Linker>
<Unit filename="SDLMain.h" />
<Unit filename="action.cpp" />
<Unit filename="action.h" />
<Unit filename="addiction.cpp" />
<Unit filename="addiction.h" />
<Unit filename="advanced_inv.cpp" />
<Unit filename="advanced_inv.h" />
<Unit filename="animation_curses.cpp" />
<Unit filename="animation_tiles.cpp" />
<Unit filename="artifact.cpp" />
<Unit filename="artifact.h" />
<Unit filename="artifactdata.h" />
<Unit filename="auto_pickup.cpp" />
<Unit filename="auto_pickup.h" />
<Unit filename="basecamp.cpp" />
<Unit filename="basecamp.h" />
<Unit filename="bionics.cpp" />
<Unit filename="bionics.h" />
<Unit filename="bodypart.cpp" />
<Unit filename="bodypart.h" />
<Unit filename="building_generation.cpp" />
<Unit filename="building_generation.h" />
<Unit filename="calendar.cpp" />
<Unit filename="calendar.h" />
<Unit filename="cata_tiles.cpp" />
<Unit filename="cata_tiles.h" />
<Unit filename="catacharset.cpp" />
<Unit filename="catacharset.h" />
<Unit filename="catacurse.h" />
<Unit filename="char_validity_check.cpp" />
<Unit filename="char_validity_check.h" />
<Unit filename="color.cpp" />
<Unit filename="color.h" />
<Unit filename="computer.cpp" />
<Unit filename="computer.h" />
<Unit filename="construction.cpp" />
<Unit filename="construction.h" />
<Unit filename="coordinates.h" />
<Unit filename="crafting.cpp" />
<Unit filename="crafting.h" />
<Unit filename="cursesdef.h" />
<Unit filename="cursesport.cpp" />
<Unit filename="debug.cpp" />
<Unit filename="debug.h" />
<Unit filename="defense.cpp" />
<Unit filename="dialogue.h" />
<Unit filename="disease.cpp" />
<Unit filename="disease.h" />
<Unit filename="editmap.cpp" />
<Unit filename="editmap.h" />
<Unit filename="enums.h" />
<Unit filename="event.cpp" />
<Unit filename="event.h" />
<Unit filename="faction.cpp" />
<Unit filename="faction.h" />
<Unit filename="field.cpp" />
<Unit filename="field.h" />
<Unit filename="file_finder.cpp" />
<Unit filename="file_finder.h" />
<Unit filename="game.cpp" />
<Unit filename="game.h" />
<Unit filename="gamemode.cpp" />
<Unit filename="gamemode.h" />
<Unit filename="gamesave.cpp" />
<Unit filename="get_version.h" />
<Unit filename="graffiti.cpp" />
<Unit filename="graffiti.h" />
<Unit filename="help.cpp" />
<Unit filename="helper.cpp" />
<Unit filename="helper.h" />
<Unit filename="iexamine.cpp" />
<Unit filename="iexamine.h" />
<Unit filename="init.cpp" />
<Unit filename="init.h" />
<Unit filename="input.cpp" />
<Unit filename="input.h" />
<Unit filename="inventory.cpp" />
<Unit filename="inventory.h" />
<Unit filename="inventory_ui.cpp" />
<Unit filename="item.cpp" />
<Unit filename="item.h" />
<Unit filename="item_factory.cpp" />
<Unit filename="item_factory.h" />
<Unit filename="item_group.cpp" />
<Unit filename="item_group.h" />
<Unit filename="itype.h" />
<Unit filename="itypedef.cpp" />
<Unit filename="iuse.cpp" />
<Unit filename="iuse.h" />
<Unit filename="iuse_software.cpp" />
<Unit filename="iuse_software.h" />
<Unit filename="iuse_software_kitten.cpp" />
<Unit filename="iuse_software_kitten.h" />
<Unit filename="iuse_software_snake.cpp" />
<Unit filename="iuse_software_snake.h" />
<Unit filename="iuse_software_sokoban.cpp" />
<Unit filename="iuse_software_sokoban.h" />
<Unit filename="json.cpp" />
<Unit filename="json.h" />
<Unit filename="keypress.cpp" />
<Unit filename="keypress.h" />
<Unit filename="lightmap.cpp" />
<Unit filename="lightmap.h" />
<Unit filename="line.cpp" />
<Unit filename="line.h" />
<Unit filename="main.cpp" />
<Unit filename="main_menu.cpp" />
<Unit filename="map.cpp" />
<Unit filename="map.h" />
<Unit filename="mapbuffer.cpp" />
<Unit filename="mapbuffer.h" />
<Unit filename="mapdata.cpp" />
<Unit filename="mapdata.h" />
<Unit filename="mapgen.cpp" />
<Unit filename="mapgenformat.cpp" />
<Unit filename="mapgenformat.h" />
<Unit filename="mapitems.h" />
<Unit filename="martialarts.cpp" />
<Unit filename="martialarts.h" />
<Unit filename="material.cpp" />
<Unit filename="material.h" />
<Unit filename="melee.cpp" />
<Unit filename="mission.cpp" />
<Unit filename="mission.h" />
<Unit filename="mission_end.cpp" />
<Unit filename="mission_fail.cpp" />
<Unit filename="mission_place.cpp" />
<Unit filename="mission_start.cpp" />
<Unit filename="missiondef.cpp" />
<Unit filename="mod_factory.h" />
<Unit filename="monattack.cpp" />
<Unit filename="monattack.h" />
<Unit filename="mondeath.cpp" />
<Unit filename="mondeath.h" />
<Unit filename="mongroup.h" />
<Unit filename="mongroupdef.cpp" />
<Unit filename="monitemsdef.cpp" />
<Unit filename="monmove.cpp" />
<Unit filename="monster.cpp" />
<Unit filename="monster.h" />
<Unit filename="monstergenerator.cpp" />
<Unit filename="monstergenerator.h" />
<Unit filename="morale.h" />
<Unit filename="moraledata.h" />
<Unit filename="mtype.h" />
<Unit filename="mtypedef.cpp" />
<Unit filename="mutation.cpp" />
<Unit filename="mutation.h" />
<Unit filename="mutation_data.cpp" />
<Unit filename="name.cpp" />
<Unit filename="name.h" />
<Unit filename="newcharacter.cpp" />
<Unit filename="npc.cpp" />
<Unit filename="npc.h" />
<Unit filename="npcmove.cpp" />
<Unit filename="npctalk.cpp" />
<Unit filename="omdata.h" />
<Unit filename="options.cpp" />
<Unit filename="options.h" />
<Unit filename="output.cpp" />
<Unit filename="output.h" />
<Unit filename="overmap.cpp" />
<Unit filename="overmap.h" />
<Unit filename="overmapbuffer.cpp" />
<Unit filename="overmapbuffer.h" />
<Unit filename="picofunc.cpp" />
<Unit filename="picofunc.h" />
<Unit filename="picojson.h" />
<Unit filename="player.cpp" />
<Unit filename="player.h" />
<Unit filename="pldata.h" />
<Unit filename="posix_time.cpp" />
<Unit filename="posix_time.h" />
<Unit filename="profession.cpp" />
<Unit filename="profession.h" />
<Unit filename="ranged.cpp" />
<Unit filename="resource.rc">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="rng.cpp" />
<Unit filename="rng.h" />
<Unit filename="savegame_json.cpp" />
<Unit filename="savegame_legacy.cpp" />
<Unit filename="sdltiles.cpp" />
<Unit filename="settlement.cpp" />
<Unit filename="settlement.h" />
<Unit filename="setvector.cpp" />
<Unit filename="setvector.h" />
<Unit filename="skill.cpp" />
<Unit filename="skill.h" />
<Unit filename="text_snippets.cpp" />
<Unit filename="text_snippets.h" />
<Unit filename="tile_id_data.h" />
<Unit filename="tileray.cpp" />
<Unit filename="tileray.h" />
<Unit filename="translations.cpp" />
<Unit filename="translations.h" />
<Unit filename="trap.h" />
<Unit filename="trapdef.cpp" />
<Unit filename="trapfunc.cpp" />
<Unit filename="tutorial.cpp" />
<Unit filename="tutorial.h" />
<Unit filename="ui.cpp" />
<Unit filename="ui.h" />
<Unit filename="uistate.h" />
<Unit filename="veh_interact.cpp" />
<Unit filename="veh_interact.h" />
<Unit filename="veh_type.h" />
<Unit filename="veh_typedef.cpp" />
<Unit filename="vehicle.cpp" />
<Unit filename="vehicle.h" />
<Unit filename="version.cpp" />
<Unit filename="wcwidth.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="wdirent.h" />
<Unit filename="weather.cpp" />
<Unit filename="weather.h" />
<Unit filename="weather_data.cpp" />
<Unit filename="wincurse.cpp" />
<Unit filename="wish.cpp" />
<Unit filename="worldfactory.cpp" />
<Unit filename="worldfactory.h" />
<Extensions>
<code_completion />
<debugger />
<envvars />
<DoxyBlocks>
<comment_style block="0" line="0" />
<doxyfile_project />
<doxyfile_build />
<doxyfile_warnings />
<doxyfile_output />
<doxyfile_dot />
<general />
</DoxyBlocks>
</Extensions>
</Project>
</CodeBlocks_project_file>
-55
View File
@@ -1,55 +0,0 @@
# Issues
## How to create new issues properly
GitHub issues are used for everything from bug reporting to suggesting long-term ideas. You can make everything run much smoother by following some simple rules.
### Rule zero
Always give your issue a meaningful title as this is the first thing anyone will see.
Note: `[CR]` and `[WIP]` "tags" are meaningful only for PRs. All open issues by definition are request for comments and work in progress.
### Bug reports
Before you submit a bug always search the current list of issues to see if it has been reported already.
Your bug report has to include:
- On what OS did you experience the problem (Windows, Linux, OS X etc.)
- What version were you playing:
- Tiles or Curses (text-based)
- Version string (preferably full version e.g. "0.C-4547-g3f1c109", or Jenkins build number e.g. 3245)
- Description of the problem written in a way that enables anyone to try and recreate it
Your bug report may include:
- Screenshot(s) as some things are best explained visually
- Save file (e.g. link to a dropbox upload)
Bonus points for:
- Checking if the bug exists under latest experimental build
- Checking if it is OS specific
The OS and CDDA version are very important - with the pace of changes here it is possible the bug you have encountered has already been fixed. After that reproducibility is the key, so write your report with all the necessary details.
### Enhancements and addition ideas
We have hundreds of issues open - most of them are ideas and suggestions. If you have a general idea or anything that can't be easily described in terms of *current* code changes you'd be better off suggesting it in the appropriate section of [the forum](https://discourse.cataclysmdda.org/). You'll also get much broader exposure for your idea there. After developing a polished idea on the forum, it should be easy to make a GitHub issue for it.
Please first search if something like what you have on mind has been already proposed. If so, feel free to join the discussion! If your idea is related but sufficiently different, open a new issue and refer to the older discussion (use GitHub's `#issue_number` reference system).
Remember to take part in the discussion of your suggestions.
### Questions
You should direct your questions to the forum or ask on IRC. You should also read the included documentation and additional text files, e.g. [COMPILING.md](doc/COMPILING/COMPILING.md) if you have problems building.
## Bounties
Placing a bounty *does not* necessarily mean that change will be incorporated into the main game. Please coordinate in the issue you intend to place a bounty on to determine if it is a change the project will accept, and keep in mind that placing a bounty will not confer special status on the issue. A good way of thinking about bounties is as encouragement for contributors to work on a particular issue, and certainly not as "paying for features".
## Issue resolution
We do not assign people to issues. If you plan to work on a bug fix or a validated idea feel free to just comment about that. Actual PRs are of much greater value than any assignments. In general the first correct PR about something will be the PR that will get merged, but remember: we are using Git - you can collaborate with someone else easily by sending them patches or PRs against their PR branch.
-100
View File
@@ -1,100 +0,0 @@
Copyright (c) 2019 Dimitar Toshkov Zhekov,
with Reserved Font Name "Terminus Font".
Copyright (c) 2017 tisimst
with Reserved Font Name "Vecterminus"
Copyright (c) 2011 Tilman Blumenbach,
with Reserved Font Name "Terminus (TTF)".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
-46
View File
@@ -1,47 +1 @@
Cataclysm is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
GNU Unifont (data/font/unifont.ttf) is licensed under GNU General Public License v2+ with the GNU font embedding exception. Visit http://unifoundry.com/LICENSE.txt for details.
Terminus Font (data/font/terminus.ttf) is licensed under the SIL Open Font License (see LICENSE-OFL-Terminus-Font.txt).
Vecterminus Font (data/font/VecTerminus12Medium.otf) is licensed under the SIL Open Font License (see LICENSE-OFL-Terminus-Font.txt).
CATCH unit-test framework (tests/catch/catch.hpp) is licensed under the Boost Software License. Visit https://github.com/philsquared/Catch/blob/master/LICENSE.txt to read the license.
PLF List and PLF Colony (src/list.h, src/colony.h) are licensed under the zLib license (https://www.zlib.net/zlib_license.html).
getpost (tools/json_tools/format/getpost.h) is licensed under the MIT license, see file for text of license.
gulrak filesystem (src/third-party/ghc/*) is licensed under the MIT license, see file for text of license.
libbacktrace is licensed under a BSD license (https://github.com/ianlancetaylor/libbacktrace/blob/master/LICENSE). The full license text is as follows:
# Copyright (C) 2012-2016 Free Software Foundation, Inc.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# (1) Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# (2) Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# (3) The name of the author may not be used to
# endorse or promote products derived from this software without
# specific prior written permission.
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+145 -1091
View File
File diff suppressed because it is too large Load Diff
+10 -79
View File
@@ -1,95 +1,30 @@
# Cataclysm: Dark Days Ahead
Cataclysm: Dark Days Ahead is a turn-based survival game set in a post-apocalyptic world. While some have described it as a "zombie game", there is far more to Cataclysm than that. Struggle to survive in a harsh, persistent, procedurally generated world. Scavenge the remnants of a dead civilization for food, equipment, or, if you are lucky, a vehicle with a full tank of gas to get you the hell out of Dodge. Fight to defeat or escape from a wide variety of powerful monstrosities, from zombies to giant insects to killer robots and things far stranger and deadlier, and against the others like yourself, who want what you have...
Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world. While some have described it as a "zombie game", there's far more to Cataclysm than that. Struggle to survive in a harsh, persistent, procedurally generated world. Scavenge the remnants of a dead civilization for for food, equipment, or, if you're lucky, a vehicle with a full tank of gas to get you the hell out of Dodge. Fight to defeat or escape from a wide variety of powerful monstrosities, from zombies to giant insects to killer robots and things far stranger and deadlier, and against the others like yourself, that want what you have...
<p align="center">
<img src="./data/screenshots/ultica-showcase-sep-2021.png" alt="Tileset: Ultica">
</p>
## Downloads
## Download
**Releases** - [Stable](https://cataclysmdda.org/releases/) | [Experimental](https://cataclysmdda.org/experimental/)
Visit [our website](http://en.cataclysmdda.com/) for download links to all stable and experimental releases
**Source** - The source can be downloaded as a [.zip archive](https://github.com/CleverRaven/Cataclysm-DDA/archive/master.zip), or cloned from our [GitHub repo](https://github.com/CleverRaven/Cataclysm-DDA/).
The source can either be downloaded as [an archive](https://github.com/CleverRaven/Cataclysm-DDA/archive/master.zip), or you can clone it from [our GitHub repository](https://github.com/CleverRaven/Cataclysm-DDA/).
<a href="https://repology.org/project/cataclysm-dda/versions">
<img src="https://repology.org/badge/vertical-allrepos/cataclysm-dda.svg" alt="Packaging Status" align="right">
</a>
[![General build matrix](https://github.com/CleverRaven/Cataclysm-DDA/actions/workflows/matrix.yml/badge.svg)](https://github.com/CleverRaven/Cataclysm-DDA/actions/workflows/matrix.yml)
[![Coverage Status](https://coveralls.io/repos/github/CleverRaven/Cataclysm-DDA/badge.svg?branch=master)](https://coveralls.io/github/CleverRaven/Cataclysm-DDA?branch=master)
[![Open Source Helpers](https://www.codetriage.com/cleverraven/cataclysm-dda/badges/users.svg)](https://www.codetriage.com/cleverraven/cataclysm-dda)
[![Commit Activity](https://img.shields.io/github/commit-activity/m/CleverRaven/Cataclysm-DDA)](https://github.com/CleverRaven/Cataclysm-DDA/graphs/contributors)
[![Lines of Code](https://tokei.rs/b1/github/CleverRaven/Cataclysm-DDA?category=code)](https://github.com/XAMPPRocky/tokei)
[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/CleverRaven/Cataclysm-DDA)](https://www.tickgit.com/browse?repo=github.com/CleverRaven/Cataclysm-DDA)
### Packaging status
#### Arch Linux
Ncurses and tiles versions are available in the [community repo](https://www.archlinux.org/packages/?q=cataclysm-dda).
`sudo pacman -S cataclysm-dda`
#### Fedora
Ncurses and tiles versions are available in the [official repos](https://src.fedoraproject.org/rpms/cataclysm-dda).
`sudo dnf install cataclysm-dda`
#### Debian / Ubuntu
Ncurses and tiles versions are available in the [official repos](https://tracker.debian.org/pkg/cataclysm-dda).
`sudo apt install cataclysm-dda-curses cataclysm-dda-sdl`
## Compile
Please read [COMPILING.md](doc/COMPILING/COMPILING.md) - it covers general information and more specific recipes for Linux, OS X, Windows and BSD. See [COMPILER_SUPPORT.md](doc/COMPILING/COMPILER_SUPPORT.md) for details on which compilers we support. And you can always dig for more information in [doc/](https://github.com/CleverRaven/Cataclysm-DDA/tree/master/doc).
The latest instructions on how to compile can be found on [our wiki](http://www.wiki.cataclysmdda.com/index.php?title=How_to_compile).
We also have the following build guides:
* Building on Windows with `MSYS2` at [COMPILING-MSYS.md](doc/COMPILING/COMPILING-MSYS.md)
* Building on Windows with `vcpkg` at [COMPILING-VS-VCPKG.md](doc/COMPILING/COMPILING-VS-VCPKG.md)
* Building with `cmake` at [COMPILING-CMAKE.md](doc/COMPILING/COMPILING-CMAKE.md) (*unofficial guide*)
## Contribute
Cataclysm: Dark Days Ahead is the result of contributions from over 1000 volunteers under the Creative Commons Attribution ShareAlike 3.0 license. The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever. See https://creativecommons.org/licenses/by-sa/3.0/ for details.
Some code distributed with the project is not part of the project and is released under different software licenses; the files covered by different software licenses have their own license notices.
Please see [CONTRIBUTING.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/CONTRIBUTING.md) for details.
[<img src="https://www.bountysource.com/badge/tracker?tracker_id=146201" alt="Bountysource" align="right">](https://www.bountysource.com/trackers/146201-clever-raven-cataclysm-dda?utm_source=146201&utm_medium=shield&utm_campaign=TRACKER_BADGE)
Please see [CONTRIBUTING.md](doc/CONTRIBUTING.md) for details.
Special thanks to the contributors, including but not limited to, people below:
<a href="https://github.com/cleverraven/cataclysm-dda/graphs/contributors">
<img src="https://contrib.rocks/image?repo=cleverraven/cataclysm-dda" />
</a>
Made with [contrib.rocks](https://contrib.rocks).
## Community
Forums:
https://discourse.cataclysmdda.org
Wiki:
https://cddawiki.chezzo.com/cdda_wiki/index.php
GitHub repo:
https://github.com/CleverRaven/Cataclysm-DDA
IRC:
`#CataclysmDDA` on [Libera Chat](https://libera.chat), https://web.libera.chat/#CataclysmDDA
Official Discord:
https://discord.gg/jFEc7Yp
## Frequently Asked Questions
#### Is there a tutorial?
Yes, you can find the tutorial in the **Special** menu at the main menu (be aware that due to many code changes the tutorial may not function). You can also access documentation in-game via the `?` key.
Yes, you can find the tutorial in the **Special** menu at the main menu. You can also access documentation in-game via the **?** key.
#### How can I change the key bindings?
@@ -97,12 +32,8 @@ Press the `?` key, followed by the `1` key to see the full list of key commands.
#### How can I start a new world?
**World** on the main menu will generate a fresh world for you. Select **Create World**.
**Reset** on the main menu will generate a fresh world for you.
#### I've found a bug. What should I do?
#### I've found a bug / I would like to make a suggestion. What should I do?
Please submit an issue on [our GitHub page](https://github.com/CleverRaven/Cataclysm-DDA/issues/) using [bug report template](https://github.com/CleverRaven/Cataclysm-DDA/issues/new?template=bug_report.md). If you're not able to, send an email to `kevin.granade@gmail.com`.
#### I would like to make a suggestion. What should I do?
Please submit an issue on [our GitHub page](https://github.com/CleverRaven/Cataclysm-DDA/issues/) using [feature request template](https://github.com/CleverRaven/Cataclysm-DDA/issues/new?template=feature_request.md).
Please submit an issue on [our GitHub page](https://github.com/CleverRaven/Cataclysm-DDA/issues/). If you're not able to, send an email to `kevin.granade@gmail.com`.
+35
View File
@@ -0,0 +1,35 @@
Cataclysm: Dark Days Ahead
Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world. While some have described
it as a "zombie game", there's far more to Cataclysm than that. Struggle to survive in a harsh, persistent,
procedurally generated world. Scavenge the remnants of a dead civilization for for food, equipment,
or, if you're lucky, a vehicle with a full tank of gas to get you the hell out of Dodge. Fight to defeat
or escape from a wide variety of powerful monstrosities, from zombies to giant insects to killer robots
and things far stranger and deadlier, and against the others like yourself, that want what you have...
Download
Visit http://en.cataclysmdda.com/ for download links to all stable and experimental releases
Compile
The latest instructions on how to compile can be found on our wiki at http://www.wiki.cataclysmdda.com/index.php?title=How_to_compile.
Contribute
Please see CONTRIBUTING.md for details.
Contributing is much easier with an advanced text editor, for windows a good program is Notepad++, available at http://notepad-plus-plus.org/.
Frequently Asked Questions
1)Is there a tutorial?
Yes, you can find the tutorial in the Special menu at the main menu. You can also access
documentation in-game via the ? key.
2)How can I change the key bindings?
Press the `?` key, followed by the `1` key to see the full list of key commands. Press the `+` key
to add a key binding, select which action with the corresponding letter key `a-w`, and then the key
you wish to assign to that action.
3)How can I start a new world?
Reset on the main menu will generate a fresh world for you.
4)I've found a bug / I would like to make a suggestion. What should I do?
Please submit an issue on our GitHub page at https://github.com/CleverRaven/Cataclysm-DDA/issues/.
If you're not able to, send an email to `kevin.granade@gmail.com`.
+16
View File
@@ -0,0 +1,16 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#ifndef _SDLMain_h_
#define _SDLMain_h_
#import <Cocoa/Cocoa.h>
@interface SDLMain : NSObject
@end
#endif /* _SDLMain_h_ */
+385
View File
@@ -0,0 +1,385 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#if (defined OSX_SDL_FW)
#include "SDL.h"
#else
#include "SDL/SDL.h"
#endif
#include "SDLMain.h"
#include <sys/param.h> /* for MAXPATHLEN */
#include <unistd.h>
/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
but the method still is there and works. To avoid warnings, we declare
it ourselves here. */
@interface NSApplication(SDL_Missing_Methods)
- (void)setAppleMenu:(NSMenu *)menu;
@end
/* Use this flag to determine whether we use SDLMain.nib or not */
#define SDL_USE_NIB_FILE 0
/* Use this flag to determine whether we use CPS (docking) or not */
#define SDL_USE_CPS 1
#ifdef SDL_USE_CPS
/* Portions of CPS.h */
typedef struct CPSProcessSerNum
{
UInt32 lo;
UInt32 hi;
} CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
#endif /* SDL_USE_CPS */
static int gArgc;
static char **gArgv;
static BOOL gFinderLaunch;
static BOOL gCalledAppMainline = FALSE;
static NSString *getApplicationName(void)
{
const NSDictionary *dict;
NSString *appName = 0;
/* Determine the application name */
dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
if (dict)
appName = [dict objectForKey: @"CFBundleName"];
if (![appName length])
appName = [[NSProcessInfo processInfo] processName];
return appName;
}
#if SDL_USE_NIB_FILE
/* A helper category for NSString */
@interface NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
@end
#endif
@interface NSApplication (SDLApplication)
@end
@implementation NSApplication (SDLApplication)
/* Invoked from the Quit menu item */
- (void)terminate:(id)sender
{
/* Post a SDL_QUIT event */
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
@end
/* The main class of the application, the application's delegate */
@implementation SDLMain
/* Set the working directory to the .app's parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir
{
if (shouldChdir)
{
char parentdir[MAXPATHLEN];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
chdir(parentdir); /* chdir to the binary app's parent */
}
CFRelease(url);
CFRelease(url2);
}
}
#if SDL_USE_NIB_FILE
/* Fix menu to contain the real app name instead of "SDL App" */
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
{
NSRange aRange;
NSEnumerator *enumerator;
NSMenuItem *menuItem;
aRange = [[aMenu title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
enumerator = [[aMenu itemArray] objectEnumerator];
while ((menuItem = [enumerator nextObject]))
{
aRange = [[menuItem title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
if ([menuItem hasSubmenu])
[self fixMenu:[menuItem submenu] withAppName:appName];
}
}
#else
static void setApplicationMenu(void)
{
/* warning: this code is very odd */
NSMenu *appleMenu;
NSMenuItem *menuItem;
NSString *title;
NSString *appName;
appName = getApplicationName();
appleMenu = [[NSMenu alloc] initWithTitle:@""];
/* Add menu items */
title = [@"About " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
[appleMenu addItem:[NSMenuItem separatorItem]];
title = [@"Hide " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
[appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
[appleMenu addItem:[NSMenuItem separatorItem]];
title = [@"Quit " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
/* Put menu into the menubar */
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
[menuItem setSubmenu:appleMenu];
[[NSApp mainMenu] addItem:menuItem];
/* Tell the application object that this is now the application menu */
[NSApp setAppleMenu:appleMenu];
/* Finally give up our references to the objects */
[appleMenu release];
[menuItem release];
}
/* Create a window menu */
static void setupWindowMenu(void)
{
NSMenu *windowMenu;
NSMenuItem *windowMenuItem;
NSMenuItem *menuItem;
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
/* "Minimize" item */
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
[windowMenu addItem:menuItem];
[menuItem release];
/* Put menu into the menubar */
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
[windowMenuItem setSubmenu:windowMenu];
[[NSApp mainMenu] addItem:windowMenuItem];
/* Tell the application object that this is now the window menu */
[NSApp setWindowsMenu:windowMenu];
/* Finally give up our references to the objects */
[windowMenu release];
[windowMenuItem release];
}
/* Replacement for NSApplicationMain */
static void CustomApplicationMain (int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SDLMain *sdlMain;
/* Ensure the application object is initialised */
[NSApplication sharedApplication];
#ifdef SDL_USE_CPS
{
CPSProcessSerNum PSN;
/* Tell the dock about us */
if (!CPSGetCurrentProcess(&PSN))
if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
if (!CPSSetFrontProcess(&PSN))
[NSApplication sharedApplication];
}
#endif /* SDL_USE_CPS */
/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
setApplicationMenu();
setupWindowMenu();
/* Create SDLMain and make it the app delegate */
sdlMain = [[SDLMain alloc] init];
[NSApp setDelegate:sdlMain];
/* Start the main event loop */
[NSApp run];
[sdlMain release];
[pool release];
}
#endif
/*
* Catch document open requests...this lets us notice files when the app
* was launched by double-clicking a document, or when a document was
* dragged/dropped on the app's icon. You need to have a
* CFBundleDocumentsType section in your Info.plist to get this message,
* apparently.
*
* Files are added to gArgv, so to the app, they'll look like command line
* arguments. Previously, apps launched from the finder had nothing but
* an argv[0].
*
* This message may be received multiple times to open several docs on launch.
*
* This message is ignored once the app's mainline has been called.
*/
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
const char *temparg;
size_t arglen;
char *arg;
char **newargv;
if (!gFinderLaunch) /* MacOS is passing command line args. */
return FALSE;
if (gCalledAppMainline) /* app has started, ignore this document. */
return FALSE;
temparg = [filename UTF8String];
arglen = SDL_strlen(temparg) + 1;
arg = (char *) SDL_malloc(arglen);
if (arg == NULL)
return FALSE;
newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
if (newargv == NULL)
{
SDL_free(arg);
return FALSE;
}
gArgv = newargv;
SDL_strlcpy(arg, temparg, arglen);
gArgv[gArgc++] = arg;
gArgv[gArgc] = NULL;
return TRUE;
}
/* Called when the internal event loop has just started running */
- (void) applicationDidFinishLaunching: (NSNotification *) note
{
int status;
/* Set the working directory to the .app's parent directory */
[self setupWorkingDirectory:gFinderLaunch];
#if SDL_USE_NIB_FILE
/* Set the main menu to contain the real app name instead of "SDL App" */
[self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
#endif
/* Hand off to main application code */
gCalledAppMainline = TRUE;
status = SDL_main (gArgc, gArgv);
/* We're done, thank you for playing */
exit(status);
}
@end
@implementation NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
{
unsigned int bufferSize;
unsigned int selfLen = [self length];
unsigned int aStringLen = [aString length];
unichar *buffer;
NSRange localRange;
NSString *result;
bufferSize = selfLen + aStringLen - aRange.length;
buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
/* Get first part into buffer */
localRange.location = 0;
localRange.length = aRange.location;
[self getCharacters:buffer range:localRange];
/* Get middle part into buffer */
localRange.location = 0;
localRange.length = aStringLen;
[aString getCharacters:(buffer+aRange.location) range:localRange];
/* Get last part into buffer */
localRange.location = aRange.location + aRange.length;
localRange.length = selfLen - localRange.location;
[self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
/* Build output string */
result = [NSString stringWithCharacters:buffer length:bufferSize];
NSDeallocateMemoryPages(buffer, bufferSize);
return result;
}
@end
#ifdef main
# undef main
#endif
/* Main entry point to executable - should *not* be SDL_main! */
int main (int argc, char **argv)
{
/* Copy the arguments into a global variable */
/* This is passed if we are launched by double-clicking */
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
gArgv[0] = argv[0];
gArgv[1] = NULL;
gArgc = 1;
gFinderLaunch = YES;
} else {
int i;
gArgc = argc;
gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
for (i = 0; i <= argc; i++)
gArgv[i] = argv[i];
gFinderLaunch = NO;
}
#if SDL_USE_NIB_FILE
NSApplicationMain (argc, argv);
#else
CustomApplicationMain (argc, argv);
#endif
return 0;
}
-30
View File
@@ -34,33 +34,3 @@ Ian Strachan <ian_e_strachan@hotmail.com>
Greg McNew <gmcnew@gmail.com>
NaturesWitness <natureswitness@gmail.com>
CodeHero <codehero@nerdpol.ch>
tasetase "Tase" <tase on irc.freenode.net>
Barry Peddycord III <ishara@isharacomix.org>
Vidar Engh Skaugen <vidarsk@gmail.com>
Brandon Bergren (Bdragon) <bdragon@rtk0.net> / <git@bdragon.rtk0.net>
Henrik "Tivec" Bergvin <henrik@bergvin.com>
FryCarson <frycarson@gmail.com>
TranquilMarmot (Nate Moore) <nate272@gmail.com>
Stéphane Travostino <stephane.travostino@gmail.com>
Jeremy Osborne <jeremywosborne@gmail.com>
David "Davek" Keaton <keaton.david@gmail.com>
Piotr S. Staszewski (drbig) <p.staszewski@gmail.com>
Donnie "Desrik" McNabb <koderkore@gmail.com>
Christian R. Byrne <christianbyrne2012@gmail.com>
Dmitry "illi-kun" Serov <D.E.Serov@gmail.com>
Karl Parakenings (karlnp) <karl.parakenings@gmail.com>
Rob Palkowski <dopeghoti@gmail.com>
Zaweri Runewright <mrampuja@gmail.com>
Cliffs Dover <cliffs@dancingbottle.com>
Sven-Hendrik "svenstaro" Haase <svenstaro@gmail.com>
Nick Owens <mischief@offblast.org>
Brett Dong <brett.browning.dong@gmail.com>
Barry Gackle <bdgackle@gmail.com>
BorkBorkGoesTheCode <imreallytoolazy@protonmail.com>
Patrik Stridvall <patrik@stridvall.se>
Ryan Schneider (RadHazard) <rslego@gmail.com>
Paul Bransford (draeath) <draeath@gmail.com>
Mark Langsdorf (mlangsdorf) <mark.langsdorf@gmail.com> / <mlangsdo@redhat.com>
Ratul Saha (sahaRatul) <ratul.saha@arrakis.in> / <50.ratulsaha@gmail.com>
Davis Bray (Kaltag1925) <pdavisbray@gmail.com>
Nicolas Appriou <nicolas.appriou@gmail.com>
+760
View File
@@ -0,0 +1,760 @@
#include "action.h"
#include "keypress.h"
#include "output.h"
#include <istream>
#include <sstream>
#include <fstream>
std::map<char, action_id> keymap;
std::map<char, action_id> default_keymap;
void parse_keymap(std::istream &keymap_txt, std::map<char, action_id> &kmap);
void load_keyboard_settings()
{
// Load the default keymap
std::istringstream sin;
sin.str(default_keymap_txt());
parse_keymap(sin, default_keymap);
// Load the player's actual keymap
std::ifstream fin;
fin.open("data/keymap.txt");
if (!fin) { // It doesn't exist
std::ofstream fout;
fout.open("data/keymap.txt");
fout << default_keymap_txt();
fout.close();
fin.open("data/keymap.txt");
}
if (!fin) { // Still can't open it--probably bad permissions
debugmsg("Can't open data/keymap.txt. This may be a permissions issue.");
keymap = default_keymap;
return;
} else {
parse_keymap(fin, keymap);
}
// Check for new defaults, and automatically bind them if possible
std::map<char, action_id>::iterator d_it;
for (d_it = default_keymap.begin(); d_it != default_keymap.end(); ++d_it) {
bool found = false;
std::map<char, action_id>::iterator k_it;
for (k_it = keymap.begin(); k_it != keymap.end(); ++k_it) {
if (d_it->second == k_it->second) {
found = true;
break;
}
}
if (!found && !keymap.count(d_it->first)) {
keymap[d_it->first] = d_it->second;
}
}
}
void parse_keymap(std::istream &keymap_txt, std::map<char, action_id> &kmap)
{
while (!keymap_txt.eof()) {
std::string id;
keymap_txt >> id;
if (id == "")
getline(keymap_txt, id); // Empty line, chomp it
else if (id[0] != '#') {
action_id act = look_up_action(id);
if (act == ACTION_NULL)
debugmsg("\
Warning! data/keymap.txt contains an unknown action, \"%s\"\n\
Fix data/keymap.txt at your next chance!", id.c_str());
else {
while (!keymap_txt.eof()) {
char ch;
keymap_txt >> std::noskipws >> ch >> std::skipws;
if (ch == '\n') {
break;
} else if (ch != ' ' || keymap_txt.peek() == '\n') {
if (kmap.find(ch) != kmap.end()) {
debugmsg("\
Warning! '%c' assigned twice in the keymap!\n\
%s is being ignored.\n\
Fix data/keymap.txt at your next chance!", ch, id.c_str());
} else {
kmap[ ch ] = act;
}
}
}
}
} else {
getline(keymap_txt, id); // Clear the whole line
}
}
}
void save_keymap()
{
std::ofstream fout;
fout.open("data/keymap.txt");
if (!fout) { // It doesn't exist
debugmsg("Can't open data/keymap.txt.");
fout.close();
return;
}
std::map<char, action_id>::iterator it;
for (it = keymap.begin(); it != keymap.end(); ++it)
fout << action_ident( (*it).second ) << " " << (*it).first << std::endl;
fout.close();
}
std::vector<char> keys_bound_to(action_id act)
{
std::vector<char> ret;
std::map<char, action_id>::iterator it;
for (it = keymap.begin(); it != keymap.end(); ++it) {
if ( (*it).second == act )
ret.push_back( (*it).first );
}
return ret;
}
void clear_bindings(action_id act)
{
std::map<char, action_id>::iterator it;
for (it = keymap.begin(); it != keymap.end(); ++it) {
if ( (*it).second == act ) {
keymap.erase(it);
it = keymap.begin();
}
}
}
std::string action_ident(action_id act)
{
switch (act) {
case ACTION_PAUSE:
return "pause";
case ACTION_MOVE_N:
return "move_n";
case ACTION_MOVE_NE:
return "move_ne";
case ACTION_MOVE_E:
return "move_e";
case ACTION_MOVE_SE:
return "move_se";
case ACTION_MOVE_S:
return "move_s";
case ACTION_MOVE_SW:
return "move_sw";
case ACTION_MOVE_W:
return "move_w";
case ACTION_MOVE_NW:
return "move_nw";
case ACTION_MOVE_DOWN:
return "move_down";
case ACTION_MOVE_UP:
return "move_up";
case ACTION_CENTER:
return "center";
case ACTION_SHIFT_N:
return "shift_n";
case ACTION_SHIFT_NE:
return "shift_ne";
case ACTION_SHIFT_E:
return "shift_e";
case ACTION_SHIFT_SE:
return "shift_se";
case ACTION_SHIFT_S:
return "shift_s";
case ACTION_SHIFT_SW:
return "shift_sw";
case ACTION_SHIFT_W:
return "shift_w";
case ACTION_SHIFT_NW:
return "shift_nw";
case ACTION_OPEN:
return "open";
case ACTION_CLOSE:
return "close";
case ACTION_SMASH:
return "smash";
case ACTION_EXAMINE:
return "examine";
case ACTION_ADVANCEDINV:
return "advinv";
case ACTION_PICKUP:
return "pickup";
case ACTION_GRAB:
return "grab";
case ACTION_BUTCHER:
return "butcher";
case ACTION_CHAT:
return "chat";
case ACTION_LOOK:
return "look";
case ACTION_PEEK:
return "peek";
case ACTION_LIST_ITEMS:
return "listitems";
case ACTION_INVENTORY:
return "inventory";
case ACTION_COMPARE:
return "compare";
case ACTION_ORGANIZE:
return "organize";
case ACTION_USE:
return "apply";
case ACTION_USE_WIELDED:
return "apply_wielded";
case ACTION_WEAR:
return "wear";
case ACTION_TAKE_OFF:
return "take_off";
case ACTION_EAT:
return "eat";
case ACTION_READ:
return "read";
case ACTION_WIELD:
return "wield";
case ACTION_PICK_STYLE:
return "pick_style";
case ACTION_RELOAD:
return "reload";
case ACTION_UNLOAD:
return "unload";
case ACTION_THROW:
return "throw";
case ACTION_FIRE:
return "fire";
case ACTION_FIRE_BURST:
return "fire_burst";
case ACTION_SELECT_FIRE_MODE:
return "select_fire_mode";
case ACTION_DROP:
return "drop";
case ACTION_DIR_DROP:
return "drop_adj";
case ACTION_BIONICS:
return "bionics";
case ACTION_SORT_ARMOR:
return "sort_armor";
case ACTION_WAIT:
return "wait";
case ACTION_CRAFT:
return "craft";
case ACTION_RECRAFT:
return "recraft";
case ACTION_LONGCRAFT:
return "long_craft";
case ACTION_CONSTRUCT:
return "construct";
case ACTION_DISASSEMBLE:
return "disassemble";
case ACTION_SLEEP:
return "sleep";
case ACTION_CONTROL_VEHICLE:
return "control_vehicle";
case ACTION_TOGGLE_SAFEMODE:
return "safemode";
case ACTION_TOGGLE_AUTOSAFE:
return "autosafe";
case ACTION_IGNORE_ENEMY:
return "ignore_enemy";
case ACTION_SAVE:
return "save";
case ACTION_QUICKSAVE:
return "quicksave";
case ACTION_QUIT:
return "quit";
case ACTION_PL_INFO:
return "player_data";
case ACTION_MAP:
return "map";
case ACTION_MISSIONS:
return "missions";
case ACTION_FACTIONS:
return "factions";
case ACTION_KILLS:
return "kills";
case ACTION_MORALE:
return "morale";
case ACTION_MESSAGES:
return "messages";
case ACTION_HELP:
return "help";
case ACTION_DEBUG:
return "debug";
case ACTION_DISPLAY_SCENT:
return "debug_scent";
case ACTION_TOGGLE_DEBUGMON:
return "debug_mode";
case ACTION_NULL:
return "null";
default:
return "unkown";
}
}
action_id look_up_action(std::string ident)
{
for (int i = 0; i < NUM_ACTIONS; i++)
{
if (action_ident( action_id(i) ) == ident)
{
return action_id(i);
}
}
return ACTION_NULL;
}
std::string action_name(action_id act)
{
switch (act)
{
case ACTION_PAUSE:
return _("Pause");
case ACTION_MOVE_N:
return _("Move North");
case ACTION_MOVE_NE:
return _("Move Northeast");
case ACTION_MOVE_E:
return _("Move East");
case ACTION_MOVE_SE:
return _("Move Southeast");
case ACTION_MOVE_S:
return _("Move South");
case ACTION_MOVE_SW:
return _("Move Southwest");
case ACTION_MOVE_W:
return _("Move West");
case ACTION_MOVE_NW:
return _("Move Northwest");
case ACTION_MOVE_DOWN:
return _("Descend Stairs");
case ACTION_MOVE_UP:
return _("Ascend Stairs");
case ACTION_CENTER:
return _("Center View");
case ACTION_SHIFT_N:
return _("Move View North");
case ACTION_SHIFT_NE:
return _("Move View Northeast");
case ACTION_SHIFT_E:
return _("Move View East");
case ACTION_SHIFT_SE:
return _("Move View Southeast");
case ACTION_SHIFT_S:
return _("Move View South");
case ACTION_SHIFT_SW:
return _("Move View Southwest");
case ACTION_SHIFT_W:
return _("Move View West");
case ACTION_SHIFT_NW:
return _("Move View Northwest");
case ACTION_OPEN:
return _("Open Door");
case ACTION_CLOSE:
return _("Close Door");
case ACTION_SMASH:
return _("Smash Nearby Terrain");
case ACTION_EXAMINE:
return _("Examine Nearby Terrain");
case ACTION_PICKUP:
return _("Pick Item(s) Up");
case ACTION_GRAB:
return _("Grab a nearby vehicle");
case ACTION_BUTCHER:
return _("Butcher");
case ACTION_CHAT:
return _("Chat with NPC");
case ACTION_LOOK:
return _("Look Around");
case ACTION_PEEK:
return _("Peek Around Corners");
case ACTION_LIST_ITEMS:
return _("List all items around the player");
case ACTION_INVENTORY:
return _("Open Inventory");
case ACTION_ADVANCEDINV:
return _("Advanced Inventory management");
case ACTION_COMPARE:
return _("Compare two Items");
case ACTION_ORGANIZE:
return _("Swap Inventory Letters");
case ACTION_USE:
return _("Apply or Use Item");
case ACTION_USE_WIELDED:
return _("Apply or Use Wielded Item");
case ACTION_WEAR:
return _("Wear Item");
case ACTION_TAKE_OFF:
return _("Take Off Worn Item");
case ACTION_EAT:
return _("Eat");
case ACTION_READ:
return _("Read");
case ACTION_WIELD:
return _("Wield");
case ACTION_PICK_STYLE:
return _("Select Unarmed Style");
case ACTION_RELOAD:
return _("Reload Wielded Item");
case ACTION_UNLOAD:
return _("Unload or Empty Wielded Item");
case ACTION_THROW:
return _("Throw Item");
case ACTION_FIRE:
return _("Fire Wielded Item");
case ACTION_FIRE_BURST:
return _("Burst-Fire Wielded Item");
case ACTION_SELECT_FIRE_MODE:
return _("Toggle attack mode of Wielded Item");
case ACTION_DROP:
return _("Drop Item");
case ACTION_DIR_DROP:
return _("Drop Item to Adjacent Tile");
case ACTION_BIONICS:
return _("View/Activate Bionics");
case ACTION_SORT_ARMOR:
return _("Re-layer armour/clothing");
case ACTION_WAIT:
return _("Wait for Several Minutes");
case ACTION_CRAFT:
return _("Craft Items");
case ACTION_RECRAFT:
return _("Recraft last recipe");
case ACTION_LONGCRAFT:
return _("Craft as long as possible");
case ACTION_CONSTRUCT:
return _("Construct Terrain");
case ACTION_DISASSEMBLE:
return _("Disassemble items");
case ACTION_SLEEP:
return _("Sleep");
case ACTION_CONTROL_VEHICLE:
return _("Control Vehicle");
case ACTION_TOGGLE_SAFEMODE:
return _("Toggle Safemode");
case ACTION_TOGGLE_AUTOSAFE:
return _("Toggle Auto-Safemode");
case ACTION_IGNORE_ENEMY:
return _("Ignore Nearby Enemy");
case ACTION_SAVE:
return _("Save and Quit");
case ACTION_QUICKSAVE:
return _("Quicksave");
case ACTION_QUIT:
return _("Commit Suicide");
case ACTION_PL_INFO:
return _("View Player Info");
case ACTION_MAP:
return _("View Map");
case ACTION_MISSIONS:
return _("View Missions");
case ACTION_FACTIONS:
return _("View Factions");
case ACTION_KILLS:
return _("View Kills");
case ACTION_MORALE:
return _("View Morale");
case ACTION_MESSAGES:
return _("View Message Log");
case ACTION_HELP:
return _("View Help");
case ACTION_DEBUG:
return _("Debug Menu");
case ACTION_DISPLAY_SCENT:
return _("View Scentmap");
case ACTION_TOGGLE_DEBUGMON:
return _("Toggle Debug Messages");
case ACTION_NULL:
return _("No Action");
default:
return "Someone forgot to name an action.";
}
}
void get_direction(int &x, int &y, char ch)
{
x = 0;
y = 0;
action_id act;
if (keymap.find(ch) == keymap.end()) {
act = ACTION_NULL;
} else {
act = keymap[ch];
}
switch (act) {
case ACTION_MOVE_NW:
x = -1;
y = -1;
return;
case ACTION_MOVE_NE:
x = 1;
y = -1;
return;
case ACTION_MOVE_W:
x = -1;
return;
case ACTION_MOVE_S:
y = 1;
return;
case ACTION_MOVE_N:
y = -1;
return;
case ACTION_MOVE_E:
x = 1;
return;
case ACTION_MOVE_SW:
x = -1;
y = 1;
return;
case ACTION_MOVE_SE:
x = 1;
y = 1;
return;
case ACTION_PAUSE:
case ACTION_PICKUP:
x = 0;
y = 0;
return;
default:
x = -2;
y = -2;
}
}
std::string default_keymap_txt()
{
return "\
# This is the keymapping for Cataclysm.\n\
# You can start a line with # to make it a comment--it will be ignored.\n\
# Blank lines are ignored too.\n\
# Extra whitespace, including tab, is ignored, so format things how you like.\n\
# If you wish to restore defaults, simply remove this file.\n\
\n\
# The format for each line is an action identifier, followed by several\n\
# keys. Any action may have an unlimited number of keys bound to it.\n\
# If you bind the same key to multiple actions, the second and subsequent\n\
# bindings will be ignored--and you'll get a warning when the game starts.\n\
# Keys are case-sensitive, of course; c and C are different.\n\
\n\
# WARNING: If you skip an action identifier, there will be no key bound to\n\
# that action! You will be NOT be warned of this when the game starts.\n\
# If you're going to mess with stuff, maybe you should back this file up?\n\
\n\
# It is okay to split commands across lines.\n\
# pause . 5 is equivalent to:\n\
# pause .\n\
# pause 5\n\
\n\
# Note that movement keybindings ONLY apply to movement (for now).\n\
# That is, binding w to move_n will let you use w to move north, but you\n\
# cannot use w to smash north, examine to the north, etc.\n\
# For now, you must use vikeys, the numpad, or arrow keys for those actions.\n\
# This is planned to change in the future.\n\
\n\
# Finally, there is no support for special keys, like spacebar, Home, and\n\
# so on. This is not a planned feature, but if it's important to you, please\n\
# let me know.\n\
\n\
# MOVEMENT:\n\
pause . 5\n\
move_n k 8\n\
move_ne u 9\n\
move_e l 6\n\
move_se n 3\n\
move_s j 2\n\
move_sw b 1\n\
move_w h 4\n\
move_nw y 7\n\
move_down >\n\
move_up <\n\
\n\
# MOVEMENT:\n\
center :\n\
shift_n K\n\
shift_e L\n\
shift_s J\n\
shift_w H\n\
\n\
# ENVIRONMENT INTERACTION\n\
open o\n\
close c\n\
smash s\n\
examine e\n\
advinv /\n\
pickup , g\n\
grab G\n\
butcher B\n\
chat C\n\
look ; x\n\
peek X\n\
listitems V\n\
\n\
# INVENTORY & QUASI-INVENTORY INTERACTION\n\
inventory i\n\
compare I\n\
organize =\n\
apply a\n\
apply_wielded A\n\
wear W\n\
take_off T\n\
eat E\n\
read R\n\
wield w\n\
pick_style _\n\
reload r\n\
unload U\n\
throw t\n\
fire f\n\
#fire_burst F\n\
select_fire_mode F\n\
drop d\n\
drop_adj D\n\
bionics p\n\
sort_armor +\n\
\n\
# LONG TERM & SPECIAL ACTIONS\n\
wait |\n\
craft &\n\
recraft -\n\
construct *\n\
disassemble (\n\
sleep $\n\
control_vehicle ^\n\
safemode !\n\
autosafe \"\n\
ignore_enemy '\n\
save S\n\
quit Q\n\
\n\
# INFO SCREENS\n\
player_data @\n\
map m\n\
missions M\n\
factions #\n\
kills )\n\
morale v\n\
messages P\n\
help ?\n\
\n\
# DEBUG FUNCTIONS\n\
debug_mode ~\n\
# debug Z\n\
# debug_scent -\n\
";
}
// (Press X (or Y)|Try) to Z
std::string press_x(action_id act)
{
return press_x(act,_("Press "),"",_("Try"));
}
std::string press_x(action_id act, std::string key_bound, std::string key_unbound)
{
return press_x(act,key_bound,"",key_unbound);
}
std::string press_x(action_id act, std::string key_bound_pre, std::string key_bound_suf, std::string key_unbound)
{
std::vector<char> keys = keys_bound_to( action_id(act) );
if (keys.empty()) {
return key_unbound;
} else {
std::string keyed = key_bound_pre.append("");
for (int j = 0; j < keys.size(); j++) {
if (keys[j] == '\'' || keys[j] == '"'){
if (j < keys.size() - 1) {
keyed += keys[j]; keyed += _(" or ");
} else {
keyed += keys[j];
}
} else {
if (j < keys.size() - 1) {
keyed += "'"; keyed += keys[j]; keyed += _("' or ");
} else {
if (keys[j] == '_') {
keyed += _("'_' (underscore)");
} else {
keyed += "'"; keyed += keys[j]; keyed += "'";
}
}
}
}
return keyed.append(key_bound_suf.c_str());
}
}
// ('Z'ing|zing) (\(X( or Y))\))
std::string press_x(action_id act, std::string act_desc)
{
bool key_after=false;
bool z_ing=false;
char zing = tolower(act_desc.at(0));
std::vector<char> keys = keys_bound_to( action_id(act) );
if (keys.empty()) {
return act_desc;
} else {
std::string keyed = ("");
for (int j = 0; j < keys.size(); j++) {
if (tolower(keys[j])==zing) {
if (z_ing) {
keyed.replace(1,1,1,act_desc.at(0));
if (key_after) {
keyed += _(" or '");
keyed += (islower(act_desc.at(0)) ? toupper(act_desc.at(0))
: tolower(act_desc.at(0)));
keyed += "'";
} else {
keyed +=" ('";
keyed += (islower(act_desc.at(0)) ? toupper(act_desc.at(0))
: tolower(act_desc.at(0)));
keyed += "'";
key_after=true;
}
} else {
std::string uhh="";
if (keys[j] == '\'' || keys[j] == '"'){
uhh+="("; uhh+=keys[j]; uhh+=")";
} else {
uhh+="'"; uhh+=keys[j]; uhh+="'";
}
if(act_desc.length()>1) {
uhh+=act_desc.substr(1);
}
if (keys[j] == '_') {
uhh += _(" (underscore)");
}
keyed.insert(0,uhh);
z_ing=true;
}
} else {
if (key_after) {
if (keys[j] == '\'' || keys[j] == '"'){
keyed += _(" or "); keyed += keys[j];
} else if (keys[j] == '_') {
keyed += _("or '_' (underscore)");
} else {
keyed+=_(" or '"); keyed+=keys[j]; keyed+="'";
}
} else {
if (keys[j] == '\'' || keys[j] == '"'){
keyed += " ("; keyed += keys[j];
} else if (keys[j] == '_') {
keyed += _(" ('_' (underscore)");
} else {
keyed += " ('"; keyed+=keys[j]; keyed+="'";
}
key_after=true;
}
}
}
if (!z_ing) {
keyed.insert(0,act_desc);
}
if (key_after) {
keyed+=")";
}
return keyed;
}
}
+124
View File
@@ -0,0 +1,124 @@
#ifndef _ACTION_H_
#define _ACTION_H_
#include <vector>
#include <map>
#include <string>
enum action_id {
ACTION_NULL = 0,
// Movement
ACTION_PAUSE,
ACTION_MOVE_N,
ACTION_MOVE_NE,
ACTION_MOVE_E,
ACTION_MOVE_SE,
ACTION_MOVE_S,
ACTION_MOVE_SW,
ACTION_MOVE_W,
ACTION_MOVE_NW,
ACTION_MOVE_DOWN,
ACTION_MOVE_UP,
// Shift view
ACTION_CENTER,
ACTION_SHIFT_N,
ACTION_SHIFT_NE,
ACTION_SHIFT_E,
ACTION_SHIFT_SE,
ACTION_SHIFT_S,
ACTION_SHIFT_SW,
ACTION_SHIFT_W,
ACTION_SHIFT_NW,
// Environment Interaction
ACTION_OPEN,
ACTION_CLOSE,
ACTION_SMASH,
ACTION_EXAMINE,
ACTION_PICKUP,
ACTION_GRAB,
ACTION_BUTCHER,
ACTION_CHAT,
ACTION_LOOK,
ACTION_PEEK,
ACTION_LIST_ITEMS,
// Inventory Interaction (including quasi-inventories like bionics)
ACTION_INVENTORY,
ACTION_ADVANCEDINV,
ACTION_COMPARE,
ACTION_ORGANIZE,
ACTION_USE,
ACTION_USE_WIELDED,
ACTION_WEAR,
ACTION_TAKE_OFF,
ACTION_EAT,
ACTION_READ,
ACTION_WIELD,
ACTION_PICK_STYLE,
ACTION_RELOAD,
ACTION_UNLOAD,
ACTION_THROW,
ACTION_FIRE,
ACTION_FIRE_BURST,
ACTION_SELECT_FIRE_MODE,
ACTION_DROP,
ACTION_DIR_DROP,
ACTION_BIONICS,
ACTION_SORT_ARMOR,
// Long-term / special actions
ACTION_WAIT,
ACTION_CRAFT,
ACTION_RECRAFT,
ACTION_LONGCRAFT,
ACTION_CONSTRUCT,
ACTION_DISASSEMBLE,
ACTION_SLEEP,
ACTION_CONTROL_VEHICLE,
ACTION_TOGGLE_SAFEMODE,
ACTION_TOGGLE_AUTOSAFE,
ACTION_IGNORE_ENEMY,
ACTION_SAVE,
ACTION_QUICKSAVE,
ACTION_QUIT,
// Info Screens
ACTION_PL_INFO,
ACTION_MAP,
ACTION_MISSIONS,
ACTION_KILLS,
ACTION_FACTIONS,
ACTION_MORALE,
ACTION_MESSAGES,
ACTION_HELP,
// Debug Functions
ACTION_DEBUG,
ACTION_DISPLAY_SCENT,
ACTION_TOGGLE_DEBUGMON,
NUM_ACTIONS
};
extern std::map<char, action_id> keymap;
// Load keybindings from disk
void load_keyboard_settings();
std::string default_keymap_txt();
// Save keybindings to disk
void save_keymap();
// All keys bound to act
std::vector<char> keys_bound_to(action_id act);
// Delete all keys bound to act
void clear_bindings(action_id act);
action_id look_up_action(std::string ident);
std::string action_ident(action_id);
std::string action_name(action_id);
// Use the keymap to figure out direction properly
void get_direction(int &x, int &y, char ch);
// (Press X (or Y)|Try) to Z
std::string press_x(action_id act);
std::string press_x(action_id act, std::string key_bound,
std::string key_unbound);
std::string press_x(action_id act, std::string key_bound_pre,
std::string key_bound_suf, std::string key_unbound);
// ('Z'ing|zing) (X( or Y)))
std::string press_x(action_id act, std::string act_desc);
#endif
+264
View File
@@ -0,0 +1,264 @@
#include "addiction.h"
void addict_effect(game *g, addiction &add)
{
int in = add.intensity;
switch (add.type) {
case ADD_CIG:
if (in > 20 || one_in((500 - 20 * in))) {
g->add_msg(rng(0, 6) < in ? _("You need a cigarette.") : _("You could use a cigarette."));
g->u.add_morale(MORALE_CRAVING_NICOTINE, -15, -50);
if (one_in(800 - 50 * in)) {
g->u.fatigue++;
}
if (g->u.stim > -50 && one_in(400 - 20 * in)) {
g->u.stim--;
}
}
break;
case ADD_CAFFEINE:
g->u.moves -= 2;
if (in > 20 || one_in((500 - 20 * in))) {
g->add_msg(_("You want some caffeine."));
g->u.add_morale(MORALE_CRAVING_CAFFEINE, -5, -30);
if (g->u.stim > -150 && rng(0, 10) < in) {
g->u.stim--;
}
if (rng(8, 400) < in) {
g->add_msg(_("Your hands start shaking... you need it bad!"));
g->u.add_disease("shakes", 20);
}
}
break;
case ADD_ALCOHOL:
g->u.per_cur--;
g->u.int_cur--;
if (rng(40, 1200) <= in * 10 && g->u.health > -100) {
g->u.health--;
}
if (one_in(20) && rng(0, 20) < in) {
g->add_msg(_("You could use a drink."));
g->u.add_morale(MORALE_CRAVING_ALCOHOL, -35, -120);
} else if (rng(8, 300) < in) {
g->add_msg(_("Your hands start shaking... you need a drink bad!"));
g->u.add_morale(MORALE_CRAVING_ALCOHOL, -35, -120);
g->u.add_disease("shakes", 50);
} else if (!g->u.has_disease("hallu") && rng(10, 1600) < in) {
g->u.add_disease("hallu", 3600);
}
break;
case ADD_SLEEP:
// No effects here--just in player::can_sleep()
// EXCEPT! Prolong this addiction longer than usual.
if (one_in(2) && add.sated < 0) {
add.sated++;
}
break;
case ADD_PKILLER:
if ((in >= 25 || int(g->turn) % (100 - in * 4) == 0) && g->u.pkill > 0) {
g->u.pkill--; // Tolerance increases!
}
if (g->u.pkill >= 35) { // No further effects if we're doped up.
add.sated = 0;
} else {
g->u.str_cur -= 1 + int(in / 7);
g->u.per_cur--;
g->u.dex_cur--;
if (g->u.pain < in * 3) {
g->u.pain++;
}
if ((in >= 40 || one_in(1200 - 30 * in)) && g->u.health > -100) {
g->u.health--;
}
if (one_in(20) && dice(2, 20) < in) {
g->add_msg(_("Your hands start shaking... you need some painkillers."));
g->u.add_morale(MORALE_CRAVING_OPIATE, -40, -200);
g->u.add_disease("shakes", 20 + in * 5);
} else if (one_in(20) && dice(2, 30) < in) {
g->add_msg(_("You feel anxious. You need your painkillers!"));
g->u.add_morale(MORALE_CRAVING_OPIATE, -30, -200);
} else if (one_in(50) && dice(3, 50) < in) {
g->add_msg(_("You throw up heavily!"));
g->cancel_activity_query(_("Throwing up."));
g->u.vomit(g);
}
}
break;
case ADD_SPEED: {
int move_pen = in * 5;
if (move_pen > 30) {
move_pen = 30;
}
g->u.moves -= move_pen;
g->u.int_cur--;
g->u.str_cur--;
if (g->u.stim > -100 && (in >= 20 || int(g->turn) % (100 - in * 5) == 0)) {
g->u.stim--;
}
if (rng(0, 150) <= in && g->u.health > -100) {
g->u.health--;
}
if (dice(2, 100) < in) {
g->add_msg(_("You feel depressed. Speed would help."));
g->u.add_morale(MORALE_CRAVING_SPEED, -25, -200);
} else if (one_in(10) && dice(2, 80) < in) {
g->add_msg(_("Your hands start shaking... you need a pick-me-up."));
g->u.add_morale(MORALE_CRAVING_SPEED, -25, -200);
g->u.add_disease("shakes", in * 20);
} else if (one_in(50) && dice(2, 100) < in) {
g->add_msg(_("You stop suddenly, feeling bewildered."));
g->cancel_activity();
g->u.moves -= 300;
} else if (!g->u.has_disease("hallu") && one_in(20) && 8 + dice(2, 80) < in)
g->u.add_disease("hallu", 3600);
}
break;
case ADD_COKE:
g->u.int_cur--;
g->u.per_cur--;
if (in >= 30 || one_in((900 - 30 * in))) {
g->add_msg(_("You feel like you need a bump."));
g->u.add_morale(MORALE_CRAVING_COCAINE, -20, -250);
}
if (dice(2, 80) <= in) {
g->add_msg(_("You feel like you need a bump."));
g->u.add_morale(MORALE_CRAVING_COCAINE, -20, -250);
if (g->u.stim > -150) {
g->u.stim -= 3;
}
}
break;
case ADD_CRACK:
g->u.int_cur--;
g->u.per_cur--;
if (in >= 30 || one_in((900 - 30 * in))) {
g->add_msg(_("You're shivering, you need some crack."));
g->u.add_morale(MORALE_CRAVING_CRACK, -80, -250);
}
if (dice(2, 80) <= in) {
g->add_msg(_("You're shivering, you need some crack."));
g->u.add_morale(MORALE_CRAVING_CRACK, -80, -250);
if (g->u.stim > -150) {
g->u.stim -= 3;
}
}
break;
}
}
/**
* Returns the name of an addiction. It should be able to finish the sentence
* "Became addicted to ______".
*/
std::string addiction_type_name(add_type cur)
{
switch(cur) {
case ADD_CIG: return _("nicotine");
case ADD_CAFFEINE: return _("caffeine");
case ADD_ALCOHOL: return _("alcohol");
case ADD_SLEEP: return _("sleeping pills");
case ADD_PKILLER: return _("opiates");
case ADD_SPEED: return _("amphetamine");
case ADD_COKE: return _("cocaine");
case ADD_CRACK: return _("crack cocaine");
default: return "bugs in addiction.cpp";
}
}
std::string addiction_name(addiction cur)
{
switch (cur.type) {
case ADD_CIG: return _("Nicotine Withdrawal");
case ADD_CAFFEINE: return _("Caffeine Withdrawal");
case ADD_ALCOHOL: return _("Alcohol Withdrawal");
case ADD_SLEEP: return _("Sleeping Pill Dependance");
case ADD_PKILLER: return _("Opiate Withdrawal");
case ADD_SPEED: return _("Amphetamine Withdrawal");
case ADD_COKE: return _("Cocaine Withdrawal");
case ADD_CRACK: return _("Crack Cocaine Withdrawal");
default: return "Erroneous addiction";
}
}
morale_type addiction_craving(add_type cur)
{
switch (cur) {
case ADD_CIG: return MORALE_CRAVING_NICOTINE;
case ADD_CAFFEINE: return MORALE_CRAVING_CAFFEINE;
case ADD_ALCOHOL: return MORALE_CRAVING_ALCOHOL;
case ADD_PKILLER: return MORALE_CRAVING_OPIATE;
case ADD_SPEED: return MORALE_CRAVING_SPEED;
case ADD_COKE: return MORALE_CRAVING_COCAINE;
case ADD_CRACK: return MORALE_CRAVING_CRACK;
default: return MORALE_NULL;
}
}
add_type addiction_type(std::string name)
{
if (name == "nicotine")
return ADD_CIG;
else if (name == "caffeine")
return ADD_CAFFEINE;
else if (name == "alcohol")
return ADD_ALCOHOL;
else if (name == "sleeping pill")
return ADD_SLEEP;
else if (name == "opiate")
return ADD_PKILLER;
else if (name == "amphetamine")
return ADD_SPEED;
else if (name == "cocaine")
return ADD_COKE;
else if (name == "crack")
return ADD_CRACK;
else
return ADD_NULL;
}
std::string addiction_text(addiction cur)
{
int strpen = 1 + int(cur.intensity / 7);
switch (cur.type) {
case ADD_CIG:
return _("Intelligence - 1; Occasional cravings");
case ADD_CAFFEINE:
return _("Strength - 1; Slight sluggishness; Occasional cravings");
case ADD_ALCOHOL:
return _("\
Perception - 1; Intelligence - 1; Occasional Cravings;\n\
Risk of delirium tremens");
case ADD_SLEEP:
return _("You may find it difficult to sleep without medication.");
case ADD_PKILLER:
{
return string_format(_(
"Strength - %d; Perception - 1; Dexterity - 1;\n"
"Depression and physical pain to some degree. Frequent cravings. Vomiting."), strpen);
}
case ADD_SPEED:
return _("Strength - 1; Intelligence - 1;\n\
Movement rate reduction. Depression. Weak immune system. Frequent cravings.");
case ADD_COKE:
return _("Perception - 1; Intelligence - 1; Frequent cravings.");
case ADD_CRACK:
return _("Perception - 2; Intelligence - 2; Frequent cravings.");
default:
return "";
}
}
+23
View File
@@ -0,0 +1,23 @@
#ifndef _ADDICTION_H_
#define _ADDICTION_H_
#include "rng.h"
#include "game.h"
#include "morale.h"
#include <sstream>
#define MIN_ADDICTION_LEVEL 3 // Minimum intensity before effects are seen
void addict_effect(game *g, addiction &add);
std::string addiction_type_name(add_type cur);
std::string addiction_name(addiction cur);
morale_type addiction_craving(add_type cur);
add_type addiction_type(std::string name);
std::string addiction_text(addiction cur);
#endif
+1307
View File
File diff suppressed because it is too large Load Diff
+124
View File
@@ -0,0 +1,124 @@
#ifndef _ADVANCED_INV_H_
#define _ADVANCED_INV_H_
#include "output.h"
#include "game.h"
#include <string>
struct advanced_inv_area {
int id;
int hscreenx;
int hscreeny;
int offx;
int offy;
int x;
int y;
std::string name;
std::string shortname;
bool canputitems;
vehicle *veh;
int vstor;
int size;
std::string desc;
int volume, weight;
int max_size, max_volume;
};
// for printing items in environment
struct advanced_inv_listitem {
int idx;
int area;
item *it;
std::string name;
bool autopickup;
int stacks;
int volume;
int weight;
int cat;
};
class advanced_inventory_pane {
public:
int pos;
int area, offx, offy, size, vstor; // quick lookup later
int index, max_page, max_index, page;
std::string area_string;
int sortby;
int issrc;
vehicle *veh;
WINDOW *window;
std::vector<advanced_inv_listitem> items;
int numcats;
std::string filter;
bool recalc;
bool redraw;
std::map<std::string, bool> filtercache;
advanced_inventory_pane() {
offx = 0; offy = 0; size = 0; vstor = -1;
index = 0; max_page = 0; max_index = 0; page = 0;
area_string = _("Initializing...");
sortby = 1; issrc = 0; veh = NULL; window = NULL;
items.clear();
numcats = 0; filter="";
filtercache.clear();
}
};
class advanced_inventory
{
public:
game * g;
player * p;
const int head_height;
const int min_w_height;
const int min_w_width;
const int max_w_width;
const int left;
const int right;
const int isinventory;
const int isall;
bool checkshowmsg;
bool showmsg;
int itemsPerPage;
int w_height;
int w_width;
int headstart;
int colstart;
// itemsPerPage=getmaxy(left_window)-ADVINVOFS;
// todo: awaiting ui::menu // last_tmpdest=-1;
bool exit;// = false;
bool redraw;// = true;
bool recalc;// = true;
int lastCh;// = 0;
int src;// = left; // the active screen , 0 for left , 1 for right.
int dest;// = right;
int max_inv;// = inv_chars.size() - u.worn.size() - ( u.is_armed() ? 1 : 0 );
bool examineScroll;// = false;
bool filter_edit;
advanced_inventory_pane panes[2];
advanced_inv_area squares[11];
advanced_inventory() :
head_height(5),
min_w_height(10),
min_w_width(FULL_SCREEN_WIDTH),
max_w_width(120),
left(0),
right(1),
isinventory(0),
isall(10) {
}
void display(game *gp, player *pp);
void print_items(advanced_inventory_pane &pane, bool active);
void recalc_pane(int i);
void redraw_pane(int i);
void init(game *gp, player *pp);
private:
};
#endif
-21
View File
@@ -1,21 +0,0 @@
!config/
!deps*.zip
*.iml
.cxx
.DS_Store
.externalNativeBuild
.gradle
/.idea/libraries
/.idea/workspace.xml
/app/jni/SDL2
/app/jni/SDL2_image
/app/jni/SDL2_mixer
/app/jni/SDL2_ttf
/app/jni/libhidapi
/app/jni/lua
/app/jni/mpg-123
/app/build
/app/src/main/assetsWinHost
/build
/captures
/local.properties
-414
View File
@@ -1,414 +0,0 @@
import org.gradle.internal.os.OperatingSystem;
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
//options.compilerArgs << "-Xlint:deprecation"
}
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
def buildAsApplication = !buildAsLibrary
if (buildAsApplication) {
apply plugin: 'com.android.application'
} else {
apply plugin: 'com.android.library'
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def keystorePropertiesFilename = 'keystore.properties'
if (localProperties.getProperty('keystorePropertiesFilename') != null) {
keystorePropertiesFilename = localProperties.getProperty("keystorePropertiesFilename")
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file(keystorePropertiesFilename)
if (keystorePropertiesFile.exists()) {
keystorePropertiesFile.withReader('UTF-8') { reader ->
keystoreProperties.load(reader)
}
}
def njobs = getProperty("j")
if (localProperties.getProperty('j') != null) {
njobs = localProperties.getProperty("j")
}
def localize = getProperty("localize").toBoolean()
if (localProperties.getProperty('localize') != null) {
localize = localProperties.getProperty("localize").toBoolean()
}
def abi_arm_32 = getProperty("abi_arm_32").toBoolean()
if (localProperties.getProperty('abi_arm_32') != null) {
abi_arm_32 = localProperties.getProperty("abi_arm_32").toBoolean()
}
def abi_arm_64 = getProperty("abi_arm_64").toBoolean()
if (localProperties.getProperty('abi_arm_64') != null) {
abi_arm_64 = localProperties.getProperty("abi_arm_64").toBoolean()
}
def abi_x86_32 = getProperty("abi_x86_32").toBoolean()
if (localProperties.getProperty('abi_x86_32') != null) {
abi_x86_32 = localProperties.getProperty("abi_x86_32").toBoolean()
}
def abi_x86_64 = getProperty("abi_x86_64").toBoolean()
if (localProperties.getProperty('abi_x86_64') != null) {
abi_x86_64 = localProperties.getProperty("abi_x86_64").toBoolean()
}
def deps = getProperty("deps")
if (localProperties.getProperty('deps') != null) {
deps = localProperties.getProperty("deps")
}
def override_version = getProperty("override_version")
if (localProperties.getProperty('override_version') != null) {
override_version = localProperties.getProperty("override_version")
}
def version_header_path = getProperty("version_header_path")
if (localProperties.getProperty('version_header_path') != null) {
version_header_path = localProperties.getProperty("version_header_path")
}
def override_compileSdkVersion = getProperty("override_compileSdkVersion").toInteger()
if (localProperties.getProperty('override_compileSdkVersion') != null) {
override_compileSdkVersion = localProperties.getProperty("override_compileSdkVersion").toInteger()
}
def override_minSdkVersion = getProperty("override_minSdkVersion").toInteger()
if (localProperties.getProperty('override_minSdkVersion') != null) {
override_minSdkVersion = localProperties.getProperty("override_minSdkVersion").toInteger()
}
def override_targetSdkVersion = getProperty("override_targetSdkVersion").toInteger()
if (localProperties.getProperty('override_targetSdkVersion') != null) {
override_targetSdkVersion = localProperties.getProperty("override_targetSdkVersion").toInteger()
}
def override_ndkBuildAppPlatform = getProperty("override_ndkBuildAppPlatform")
if (localProperties.getProperty('override_ndkBuildAppPlatform') != null) {
override_ndkBuildAppPlatform = localProperties.getProperty("override_ndkBuildAppPlatform")
}
def override_ndkVersion = getProperty("override_ndkVersion")
if (localProperties.getProperty('override_ndkVersion') != null) {
override_ndkVersion = localProperties.getProperty('override_ndkVersion')
}
println("Using [ njobs]: $njobs")
println("Using [ localize]: $localize")
println("Using [ deps]: $deps")
println("Using [ override_version]: $override_version")
println("Using [version_header_path]: $version_header_path")
println("Using [ compileSdkVersion]: $override_compileSdkVersion")
println("Using [ minSdkVersion]: $override_minSdkVersion")
println("Using [ targetSdkVersion]: $override_targetSdkVersion")
println("Using [ndkBuildAppPlatform]: $override_ndkBuildAppPlatform")
println("Using [ ndkVersion]: $override_ndkVersion")
println("Using [ abi_arm_32]: $abi_arm_32")
println("Using [ abi_arm_64]: $abi_arm_64")
println("Using [ abi_x86_32]: $abi_x86_32")
println("Using [ abi_x86_64]: $abi_x86_64")
if (!abi_arm_32 && !abi_arm_64 && !abi_x86_32 && !abi_x86_64) {
throw new GradleException("All supported ABI properties are set to false!")
}
if (!file(deps).exists()) {
throw new GradleException("Dependencies file does not exist:" + deps)
}
if (!override_version.isEmpty()) {
if (version_header_path.isEmpty()) {
throw new GradleException("`version_header_path` cannot be empty when `override_version` is not empty")
} else {
println("Overriding version number to $override_version using path $version_header_path")
}
}
def projectRoot = './../..'
def assetsDir = 'src/main/assets'
def assetsDirWindows = 'src/main/assetsWinHost'
task unzipDeps(type: Copy) {
println("Using dependencies file: $deps")
def zipFile = new File("$deps")
def outputDir = new File('.')
from zipTree(zipFile)
into outputDir
}
task makeLocalization(type: Exec) {
def args = []
if (localize) {
println("Building with localization")
switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
args = ['make', 'localization', 'LANGUAGES=all']
break
case OperatingSystem.WINDOWS:
args = ['sh.exe', 'lang/compile_mo.sh']
break
default:
args = ['echo', 'Building without localization']
break
}
} else {
args = ['echo', 'Building without localization']
if (OperatingSystem.current() == OperatingSystem.WINDOWS) {
args = ['cmd.exe', '/k'] + args
}
}
workingDir projectRoot
commandLine args
}
task generateVersionHeader() {
// this taks imitates `make version` while respecting version_header_path
if (override_version.isEmpty()) {
println("Generating version number to $version_header_path")
def output = new ByteArrayOutputStream()
exec {
workingDir projectRoot
commandLine 'git', 'describe', '--tags', '--always', '--dirty', '--match', '"[0-9A-Z]*.[0-9A-Z]*"'
standardOutput output
}
override_version = output.toString()
override_version = override_version.split()[0] // strip whitespaces
} else {
println("Overriding version number to $override_version")
}
def define = "// NOLINT(cata-header-guard)\n#define VERSION \"$override_version\"\n"
def versionHeader = new File("$version_header_path")
if (!versionHeader.exists() || versionHeader.text != define) {
versionHeader.text = define
}
}
task createWindowsJunctionLinks() {
onlyIf {
OperatingSystem.current() == OperatingSystem.WINDOWS
}
doLast {
def mkJunction = { to, from ->
def errOut = new ByteArrayOutputStream()
exec {
commandLine 'cmd', '/k', "mklink /J $to $from"
errorOutput errOut
standardOutput new ByteArrayOutputStream() // don't print the output
}
def errString = errOut.toString()
if (!errString.isEmpty() && !errString.endsWith('already exists.\r\n')) {
// we have an error that is not 'file already exists'
errString = errString.substring(0, errString.size() - 2) // discard \r\n
throw new GradleException("$errString")
}
}
println("Creating junctions for the assets")
mkdir assetsDirWindows
mkdir "$assetsDirWindows/lang"
def rootDir = projectRoot.replace('/', '\\')
def unixAssetsDir = assetsDir.replace('/', '\\')
def winAssetsDir = assetsDirWindows.replace('/', '\\')
mkJunction("$winAssetsDir\\android", "$unixAssetsDir\\android")
for (dir in ['data', 'gfx', 'lang\\mo']) {
mkJunction("$winAssetsDir\\$dir", "$rootDir\\$dir")
}
}
}
preBuild.dependsOn unzipDeps
preBuild.dependsOn makeLocalization
preBuild.dependsOn generateVersionHeader
preBuild.dependsOn createWindowsJunctionLinks
createWindowsJunctionLinks.dependsOn makeLocalization
android {
namespace "com.cleverraven.cataclysmdda"
compileSdkVersion override_compileSdkVersion
ndkVersion override_ndkVersion
defaultConfig {
minSdkVersion override_minSdkVersion
targetSdkVersion override_targetSdkVersion
versionCode Integer.valueOf(System.env.UPSTREAM_BUILD_NUMBER ?: 1)
versionName new File("$version_header_path").text.split('\"')[1]
if (buildAsApplication) {
applicationId "com.cleverraven.cataclysmdda"
setProperty("archivesBaseName", "cataclysmdda-" + versionName)
}
resValue "string", "app_name", "Cataclysm DDA"
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
if (abi_arm_32) {
include "armeabi-v7a"
}
if (abi_arm_64) {
include "arm64-v8a"
}
if (abi_x86_32) {
include "x86"
}
if (abi_x86_64) {
include "x86_64"
}
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false
}
}
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=$override_ndkBuildAppPlatform", "-j$njobs"
}
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
flavorDimensions "version"
productFlavors {
stable {
dimension "version"
resValue "string", "app_name", "Cataclysm DDA"
}
experimental {
dimension "version"
applicationIdSuffix ".experimental"
resValue "string", "app_name", "Cataclysm DDA (experimental)"
}
}
signingConfigs {
if (keystoreProperties.getProperty('storeFile') != null) {
if (file(keystoreProperties.getProperty('storeFile')).exists()) {
release {
storeFile file(keystoreProperties.getProperty("storeFile"))
storePassword keystoreProperties.getProperty("storePassword")
keyAlias keystoreProperties.getProperty("keyAlias")
keyPassword keystoreProperties.getProperty("keyPassword")
}
} else {
throw new GradleException("Keystore file " + keystoreProperties.getProperty("storeFile") + " was not found.\n")
}
}
if (keystoreProperties.getProperty('debug_storeFile') != null) {
if (file(keystoreProperties.getProperty('debug_storeFile')).exists()) {
debug {
storeFile file(keystoreProperties.getProperty("debug_storeFile"))
storePassword keystoreProperties.getProperty("debug_storePassword")
keyAlias keystoreProperties.getProperty("debug_keyAlias")
keyPassword keystoreProperties.getProperty("debug_keyPassword")
}
} else {
throw new GradleException("Keystore file " + keystoreProperties.getProperty("debug_storeFile") + " was not found.\n")
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (signingConfigs.hasProperty("release")) {
signingConfig signingConfigs.release
}
externalNativeBuild {
ndkBuild {
cFlags "-DNDEBUG", "-DRELEASE", "-Os", "-g"
}
}
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
}
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (signingConfigs.hasProperty("debug")) {
signingConfig signingConfigs.debug
}
externalNativeBuild {
ndkBuild {
cFlags "-g"
}
}
ndk {
debugSymbolLevel 'FULL'
}
}
}
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
sourceSets.main {
jniLibs.srcDir 'libs'
}
externalNativeBuild {
ndkBuild {
path 'jni/Android.mk'
}
}
}
lintOptions {
abortOnError false
}
if (OperatingSystem.current() == OperatingSystem.WINDOWS) {
sourceSets.main.assets.srcDirs = ['src/main/assetsWinHost']
}
if (buildAsLibrary) {
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith(".aar")) {
def fileName = "$applicationId.aar";
output.outputFile = new File(outputFile.parent, fileName);
}
}
}
}
}
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
resources {
srcDirs = ['src/main/res']
}
}
stable {
}
experimental {
resources {
srcDirs = ['src/experimental/res']
}
}
}
dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
}
Binary file not shown.
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
# Reference: https://developer.android.com/ndk/guides/android_mk.html
include $(call all-subdir-makefiles)
-17
View File
@@ -1,17 +0,0 @@
# Reference: https://developer.android.com/ndk/guides/application_mk.html
# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
APP_STL := c++_shared
APP_CPPFLAGS += -std=c++17
ifneq ($(OS),Windows_NT)
APP_LDFLAGS += -fuse-ld=lld
endif
# Do not specify APP_OPTIM here, it is done through ndk-build NDK_DEBUG=0/1 setting instead
# See https://developer.android.com/ndk/guides/ndk-build.html#dvr
#APP_OPTIM := debug
#APP_OPTIM := release
# Min SDK level
APP_PLATFORM=android-16
-30
View File
@@ -1,30 +0,0 @@
LOCAL_PATH := $(call my-dir)/../../../../src
include $(CLEAR_VARS)
LOCAL_MODULE := main
LOCAL_CPP_FEATURES := exceptions rtti
# Add your application source files here...
CATA_SRCS := $(sort $(wildcard $(LOCAL_PATH)/*.cpp))
LOCAL_SRC_FILES := $(sort $(CATA_SRCS:$(LOCAL_PATH)/%=%))
LOCAL_STATIC_LIBRARIES := third-party
LOCAL_SHARED_LIBRARIES := libhidapi SDL2 SDL2_mixer SDL2_image SDL2_ttf mpg123
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog -lz
LOCAL_CFLAGS += -DTILES=1 -DSDL_SOUND=1 -DBACKTRACE=1 -DLOCALIZE=1 -Wextra -Wall -fsigned-char
LOCAL_LDFLAGS += $(LOCAL_CFLAGS)
ifeq ($(OS),Windows_NT)
# needed to bypass 8191 character limit on Windows command line
LOCAL_SHORT_COMMANDS := true
endif
include $(BUILD_SHARED_LIBRARY)
include $(LOCAL_PATH)/../android/app/jni/src/third-party/Android.mk
-24
View File
@@ -1,24 +0,0 @@
LOCAL_PATH := $(call my-dir)/../../../../../src/third-party
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/..
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_MODULE := third-party
LOCAL_CPP_FEATURES := exceptions rtti
# Add your application source files here...
FLATBUFFERS_SRCS := $(sort $(wildcard $(LOCAL_PATH)/flatbuffers/*.cpp))
LOCAL_SRC_FILES := $(sort $(FLATBUFFERS_SRCS:$(LOCAL_PATH)/%=%))
LOCAL_CFLAGS += -DBACKTRACE=1 -DLOCALIZE=1 -Wextra -Wall -fsigned-char
ifeq ($(OS),Windows_NT)
# needed to bypass 8191 character limit on Windows command line
LOCAL_SHORT_COMMANDS := true
endif
include $(BUILD_STATIC_LIBRARY)
-17
View File
@@ -1,17 +0,0 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in [sdk]/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Some files were not shown because too many files have changed in this diff Show More