Skip to content

Commit

Permalink
update master
Browse files Browse the repository at this point in the history
update master
  • Loading branch information
I-am-Erk authored May 21, 2019
2 parents 5b4dcc2 + dec03b2 commit a7b7600
Show file tree
Hide file tree
Showing 658 changed files with 100,168 additions and 116,995 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Checks: 'clang-diagnostic-*,-clang-analyzer-deadcode.DeadStores,-clang-analyzer-security.FloatLoopCounter,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-core.uninitialized.Assign,-clang-analyzer-cplusplus.NewDelete,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-core.CallAndMessage,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-core.DivideZero,-clang-diagnostic-defaulted-function-deleted,-clang-analyzer-optin.cplusplus.VirtualCall,-clang-analyzer-core.uninitialized.UndefReturn'
Checks: 'clang-diagnostic-*,-clang-analyzer-security.FloatLoopCounter,-clang-analyzer-core.UndefinedBinaryOperatorResult'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
FormatStyle: none
Expand Down
47 changes: 37 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,56 @@ name: Bug report
about: Create a report to help us improve

---
<!-- Please follow the template below -->

# Describe the bug

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**

# Steps To Reproduce

Steps to reproduce the behavior:
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.

**Expected behavior**
A clear and concise description of what you expected to happen.

# Expected behavior

A clear and concise description of what you expected to happen.
Ideally also describe *why* you expect it to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Versions and configuration(please complete the following information):**
# Screenshots

**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" -->

# Versions and configuration

<!-- Please complete the following information; you can now go to:
- "Main menu (ESC) > Debug Menu > Info > Generate game report" to generate this report.
- Please update your OS version with a more precise version. -->

- OS: [e.g. iOS 8 or Windows 10 or Ubuntu 18.04]
- Game Version: [from the main menu, e.g. 0.C-29938-g90f5268437]
- Graphics version: [Tiles or Terminal]
- Mods loaded: [e.g.dda, boats, hacktheplanet, StatsThroughSkills]

**Additional context**
Add any other context about the problem here.
E.g. A link to a savegame that allows the issue to be reproduced.

# Additional context

Add any other context about the problem here.

<!-- 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. -->
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ logg.txt
*.ilk
*.opensdf
*.pdb
*.lib
*.sdf
*.suo
*.user
Expand Down Expand Up @@ -170,3 +171,8 @@ Xcode/

# gdb
.gdb_history

# Flatpak build artifacts
/.flatpak-builder/
/repo/
/build-dir/
34 changes: 14 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
include:
# Initial test stage, if this fails everything else is cancelled.
- stage: test
# GCC 5 is the pre-installed compiler on Xenial
# GCC 5.4 is the pre-installed compiler on Xenial
env: COMPILER=g++ MODS=--mods=RL_Classes TEST_STAGE=1

# Then build different configurations and targets in parallel.
Expand Down Expand Up @@ -78,34 +78,25 @@ jobs:
osx_image: xcode10.1
compiler: clang

# Finally check the compiler variants
- stage: compilers

# CMake Clang 8.0 Tiles with CMAKE and clang-tidy
# (analysis only; no build or tests)
env: CLANG=clang++-8 TILES=1 SOUND=1 CXXFLAGS=-Wno-unused-command-line-argument CMAKE=1 CATA_CLANG_TIDY=1
dist: trusty
- env: CLANG=clang++-8 TILES=1 SOUND=1 CXXFLAGS=-Wno-unused-command-line-argument CMAKE=1 CATA_CLANG_TIDY=clang-tidy-8
compiler: clang
addons: &clang80
apt:
packages: ["clang-8", "libc6-dbg", "libc6-dbg:i386", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
sources: [*apt_sources, llvm-toolchain-trusty-8]
packages: ["clang-8", "clang-tidy-8", "libc6-dbg", "libc6-dbg:i386", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
sources: [*apt_sources, llvm-toolchain-xenial-8]

- env: COMPILER=g++-4.8
compiler: gcc
addons: &gcc48
apt:
packages: ["g++-4.8", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"]
sources: *apt_sources

# GCC 4.9
- env: COMPILER=g++-4.9
# Finally check the compiler variants
- stage: compilers
env: COMPILER=g++ 5.3
if: type != pull_request
compiler: gcc
addons: &gcc49
addons: &gcc53
apt:
packages: ["g++-4.9", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"]
sources: *apt_sources
packages: ["g++-5=5.3.1-14ubuntu2", "libstdc++-5-dev=5.3.1-14ubuntu2", "gcc-5=5.3.1-14ubuntu2", "gcc-5-base=5.3.1-14ubuntu2", "cpp-5=5.3.1-14ubuntu2", "libgcc-5-dev=5.3.1-14ubuntu2", "libasan2=5.3.1-14ubuntu2", "libmpx0=5.3.1-14ubuntu2"]
sources: [*apt_sources]

# GCC 6
- env: COMPILER=g++-6
Expand All @@ -127,8 +118,10 @@ jobs:
sources: *apt_sources

# GCC 8
- env: COMPILER=g++-8 CXXFLAGS='-Wno-implicit-fallthrough'
# Also, adding _GLIBCXX_DEBUG so that one build can test with that
- env: COMPILER=g++-8 CXXFLAGS='-Wno-implicit-fallthrough -D_GLIBCXX_DEBUG'
compiler: gcc
if: type != pull_request
addons: &gcc8
apt:
packages: ["g++-8", "g++-8-multilib", "libc6-dbg", "libc6-dbg:i386"]
Expand All @@ -137,6 +130,7 @@ jobs:
# Clang 3.8
- env: CLANG=clang++-3.8 CXXFLAGS='-Wno-error=unused-command-line-argument -D__extern_always_inline="extern __always_inline"'
compiler: clang
if: type != pull_request
addons: &clang38
apt:
packages: ["clang-3.8", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ IF(MSVC)
add_definitions(-D_X86_)
endif()
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wall -std=c++11")
SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g -D_GLIBCXX_DEBUG")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Woverloaded-virtual -Wpedantic -std=c++14")
SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
ENDIF()

# Force out-of-source build
Expand Down
34 changes: 34 additions & 0 deletions COMPILING-FLATPAK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Compiling Guide for Linux (Flatpak)

## Prerequisites

- Install `flatpak` and `flatpak-builder` from your distribution's package manager.
- Install `freedesktop-platform` & `freedesktop-sdk` using `flatpak install flathub org.freedesktop.Platform//18.08 org.freedesktop.Sdk//18.08`

## Build

Clone the source code and run `flatpak-builder --repo=repo --ccache --force-clean build-dir org.Cataclysm.DDA.json` or `flatpak-builder --repo=repo --ccache --force-clean build-dir org.Cataclysm.DDA.Tiles.json` to build the ncurses or tiles version of the application.

## Installation

Run `flatpak --user install test-repo org.Cataclysm.DDA` (or) `flatpak --user install test-repo org.Cataclysm.DDA.Tiles` to install the game.
Note: If you are installing the game for first time you will have to set up local repo. Run this `flatpak --user remote-add --no-gpg-verify test-repo repo`

## Starting the game

`flatpak run org.Cataclysm.DDA` (or) `flatpak run org.Cataclysm.DDA.Tiles`
**or**
Launch the Game from Applications -> Games -> Cataclysm: Dark Days Ahead (or) Cataclysm: Dark Days Ahead - Tiles.
**Note**: For the ncurses version, terminal will just show a blank screen on launch. Just press any button to start the game.

## Permissions

- **Ncurses version**
- Home Directory
- **Tiles Version**
- Home Directory
- Wayland
- Fallback-X11 - (incase Wayland doesn't work)
- IPC - (Required for X11)
- PulseAudio
- DRI
10 changes: 5 additions & 5 deletions COMPILING-VS-VCPKG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@ vcpkg integrate install
#### install 64 bit dependencies:

```cmd
vcpkg --triplet x64-windows install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext
vcpkg --triplet x64-windows install sdl2 sdl2-image sdl2-mixer[libflac,mpg123,libmodplug,libvorbis] sdl2-ttf gettext
```

or (if you want to build statically linked executable)

```cmd
vcpkg --triplet x64-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext
vcpkg --triplet x64-windows-static install sdl2 sdl2-image sdl2-mixer[libflac,mpg123,libmodplug,libvorbis] sdl2-ttf gettext
```


#### install32 bit dependencies:
#### install 32 bit dependencies:

```cmd
vcpkg --triplet x86-windows install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext
vcpkg --triplet x86-windows install sdl2 sdl2-image sdl2-mixer[libflac,mpg123,libmodplug,libvorbis] sdl2-ttf gettext
```

or (if you want to build statically linked executable)

```cmd
vcpkg --triplet x86-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext
vcpkg --triplet x86-windows-static install sdl2 sdl2-image sdl2-mixer[libflac,mpg123,libmodplug,libvorbis] sdl2-ttf gettext
```

#### upgrade all dependencies:
Expand Down
17 changes: 12 additions & 5 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ Run:
The procedure is very much similar to cross-compilation to Windows from Linux.
Tested on ubuntu 14.04 LTS but should work on other distros as well.

Please note that due to historical difficulties with cross-compilation errors, run-time optimizations are disabled for cross-compilation to Mac OS X targets. (`-O0` is specified as a compilation flag.) See [Pull Request #26564](https://github.com/CleverRaven/Cataclysm-DDA/pull/26564) for details.
### Dependencies

* OSX cross-compiling toolchain [osxcross](https://github.com/tpoechtrager/osxcross)
Expand Down Expand Up @@ -472,7 +473,7 @@ The Cataclysm source is compiled using `make`.
### Make options

* `NATIVE=osx` build for OS X. Required for all Mac builds.
* `OSX_MIN=version` sets `-mmacosx-version-min=` (for OS X > 10.5 set it to 10.6 or higher); omit for 10.5.
* `OSX_MIN=version` sets `-mmacosx-version-min=` (for OS X > 10.5 set it to 10.6 or higher); omit for 10.5. 10.12 or higher is highly recommended (see ISSUES below).
* `TILES=1` build the SDL version with graphical tiles (and graphical ASCII); omit to build with `ncurses`.
* `SOUND=1` - if you want sound; this requires `TILES=1` and the additional dependencies mentioned above.
* `FRAMEWORK=1` (tiles only) link to SDL libraries under the OS X Frameworks folders; omit to use SDL shared libraries from Homebrew or Macports.
Expand All @@ -492,15 +493,15 @@ For more info, see the comments in the `Makefile`.

Build a release SDL version using Clang without gettext:

make NATIVE=osx OSX_MIN=10.7 RELEASE=1 TILES=1 LOCALIZE=0 CLANG=1
make NATIVE=osx OSX_MIN=10.12 RELEASE=1 TILES=1 LOCALIZE=0 CLANG=1

Build a release SDL version using Clang, link to libraries in the OS X Frameworks folders, don't use `gettext`, and package it into `Cataclysm.app`:

make app NATIVE=osx OSX_MIN=10.7 RELEASE=1 TILES=1 FRAMEWORK=1 LOCALIZE=0 CLANG=1
make app NATIVE=osx OSX_MIN=10.12 RELEASE=1 TILES=1 FRAMEWORK=1 LOCALIZE=0 CLANG=1

Build a release curses version with gettext supplied by Macports:

make NATIVE=osx OSX_MIN=10.7 RELEASE=1 LOCALIZE=1 MACPORTS=1 CLANG=1
make NATIVE=osx OSX_MIN=10.12 RELEASE=1 LOCALIZE=1 MACPORTS=1 CLANG=1

### Compiling localization files

Expand Down Expand Up @@ -539,12 +540,18 @@ You can build a nice dmg distribution file with the `dmgdist` target. You will n

Once `dmgbuild` is installed, you will be able to use the `dmgdist` target like this. The use of `USE_HOME_DIR=1` is important here because it will allow for an easy upgrade of the game while keeping the user config and his saves in his home directory.

make dmgdist NATIVE=osx OSX_MIN=10.7 RELEASE=1 TILES=1 FRAMEWORK=1 LOCALIZE=0 CLANG=1 USE_HOME_DIR=1
make dmgdist NATIVE=osx OSX_MIN=10.12 RELEASE=1 TILES=1 FRAMEWORK=1 LOCALIZE=0 CLANG=1 USE_HOME_DIR=1

You should see a `Cataclysm.dmg` file.

## Troubleshooting

### ISSUE: Game runs very slowly when built for Mac OS X 10.11 or earlier

For versions of OS X 10.11 and earlier, run-time optimizations are disabled for native builds (`-O0` is specified as a compilation flag) due to errors that can occur in compilation. See [Pull Request #26564](https://github.com/CleverRaven/Cataclysm-DDA/pull/26564) for details.

If you're on a newer version of OS X, please use an appropriate value for the `OSX_MIN=` option, i.e. `OSX_MIN=10.14` if you are on Mojave.

### ISSUE: crash on startup due to libint.8.dylib aborting

If you're compiling on Mountain Lion or above, it won't be possible to run successfully on older OS X versions due to libint.8 / pthreads version issue.
Expand Down
41 changes: 23 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
# Win32 (non-Cygwin)
# Run: make NATIVE=win32
# OS X
# Run: make NATIVE=osx
# Run: make NATIVE=osx OSX_MIN=10.12
# It is highly recommended to supply OSX_MIN > 10.11
# otherwise optimizations are automatically disabled with -O0

# Build types:
# Debug (no optimizations)
Expand Down Expand Up @@ -78,20 +80,13 @@

# comment these to toggle them as one sees fit.
# DEBUG is best turned on if you plan to debug in gdb -- please do!
# PROFILE is for use with gprof or a similar program -- don't bother generally
# RELEASE is flags for release builds, this disables some debugging flags and
# enforces build failure when warnings are encountered.
# We want to error on everything to make sure we don't check in code with new warnings.
RELEASE_FLAGS = -Werror
WARNINGS = -Wall -Wextra
# PROFILE is for use with gprof or a similar program -- don't bother generally.
# RELEASE_FLAGS is flags for release builds.
RELEASE_FLAGS =
WARNINGS = -Werror -Wall -Wextra -Woverloaded-virtual -Wpedantic
# Uncomment below to disable warnings
#WARNINGS = -w
DEBUGSYMS = -g
ifeq ($(shell sh -c 'uname -o 2>/dev/null || echo not'),Cygwin)
DEBUG =
else
DEBUG = -D_GLIBCXX_DEBUG
endif
#PROFILE = -pg
#OTHERS = -O3
#DEFINES = -DNDEBUG
Expand Down Expand Up @@ -150,6 +145,11 @@ ifndef RUNTESTS
RUNTESTS = 1
endif

# Auto-detect MSYS2
ifdef MSYSTEM
MSYS2 = 1
endif

# Enable backtrace by default
ifndef BACKTRACE
# ...except not on native Windows builds, because the relevant headers are
Expand Down Expand Up @@ -307,9 +307,9 @@ ifndef RELEASE
endif

ifeq ($(shell sh -c 'uname -o 2>/dev/null || echo not'),Cygwin)
OTHERS += -std=gnu++11
OTHERS += -std=gnu++14
else
OTHERS += -std=c++11
OTHERS += -std=c++14
endif

CXXFLAGS += $(WARNINGS) $(DEBUG) $(DEBUGSYMS) $(PROFILE) $(OTHERS) -MMD -MP
Expand Down Expand Up @@ -997,23 +997,28 @@ else
@echo Cannot run an astyle check, your system either does not have astyle, or it is too old.
endif

JSON_FILES = $(shell find data -name *.json | sed "s|^\./||")
JSON_FILES = $(shell find data -name "*.json" | sed "s|^\./||")
JSON_WHITELIST = $(filter-out $(shell cat json_blacklist), $(JSON_FILES))
ifeq ($(MSYS2), 1)
JSON_FORMATTER_BIN=tools/format/json_formatter.exe
else
JSON_FORMATTER_BIN=tools/format/json_formatter.cgi
endif

style-json: $(JSON_WHITELIST)

$(JSON_WHITELIST): json_blacklist json_formatter
ifndef CROSS
@tools/format/json_formatter.cgi $@
@$(JSON_FORMATTER_BIN) $@
else
@echo Cannot run json formatter in cross compiles.
endif

style-all-json: json_formatter
find data -name "*.json" -print0 | xargs -0 -L 1 tools/format/json_formatter.cgi
find data -name "*.json" -print0 | xargs -0 -L 1 $(JSON_FORMATTER_BIN)

json_formatter: tools/format/format.cpp src/json.cpp
$(CXX) $(CXXFLAGS) -Itools/format -Isrc tools/format/format.cpp src/json.cpp -o tools/format/json_formatter.cgi
$(CXX) $(CXXFLAGS) -Itools/format -Isrc tools/format/format.cpp src/json.cpp -o $(JSON_FORMATTER_BIN)

tests: version $(BUILD_PREFIX)cataclysm.a
$(MAKE) -C tests
Expand Down
2 changes: 2 additions & 0 deletions SIGNOFF
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ 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>
Loading

0 comments on commit a7b7600

Please sign in to comment.