Skip to content

Commit

Permalink
Merge pull request #2 from CleverRaven/master
Browse files Browse the repository at this point in the history
Bring up to date
  • Loading branch information
Inglonias authored Sep 12, 2018
2 parents dafc91d + 57f7aee commit cbcdb3f
Show file tree
Hide file tree
Showing 695 changed files with 239,447 additions and 413,411 deletions.
9 changes: 7 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# These files are text and should be normalized (convert crlf => lf)
# Automatically normalise line endings for all files
# detected as text (Convert CRLF => LF).
* text=auto

# Explicitly normalise files with these extensions in
# case Git doesn't detect them as text for some reason.
*.c text
*.cbp text
*.cpp text
Expand All @@ -8,7 +13,7 @@
*.md text
*.py text
*.rc text
*.sh text eol=lf
*.sh text
*.txt text
*.yml text

Expand Down
28 changes: 27 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,22 @@ http://www.stack.nl/~dimitri/doxygen/manual/faq.html
$ 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.
3. Set commit message template.

$ git config --local commit.template .gitmessage

4. 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"

For further details about commit message guidelines please visit:
- [codeinthehole.com](https://codeinthehole.com/tips/a-useful-template-for-commit-messages/)
- [chris.beams.io](https://chris.beams.io/posts/git-commit/)
- [help.github.com](https://help.github.com/articles/closing-issues-using-keywords/)

#### Update your `master` branch

1. Make sure you have your `master` branch checked out.
Expand Down Expand Up @@ -140,6 +149,21 @@ If you are also looking for suggestions then mark it with [CR] — "comments req

This can help speed up our review process by allowing us to only review the things that are ready for it, and will prevent anything that isn't completely ready from being merged in.

### All PRs should have a "Summary" line
Summary is a one-line description of your change that will be extracted and added to the project changelog at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/changelog.txt

The format is: ```SUMMARY: Category "description"```

The categories to choose from are: Features, Content, Interface, Mods, Balance, Bugfixes, Performance, Infrastructure, Build, I18N.

Example: ```SUMMARY: Content "Adds new mutation category 'Mouse'"```
Or, if you want it treated as a minor tweak that doesn't appear in the changelog:
```SUMMARY: None```

See the Changelog Guidelines at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/CHANGELOG_GUIDELINES.md for explanations of the categories.

### Closing issues using keywords

One more thing: when marking your PR as closing, fixing, or resolving issues, please include "XXXX #???" somewhere in the description, where XXX is on this list:
* close
* closes
Expand All @@ -153,6 +177,8 @@ One more thing: when marking your PR as closing, fixing, or resolving issues, pl

The "???" is the issue number. This automatically closes the issue when the PR is pulled in, and allows merges to work slightly faster. To close multiple issues format it as "XXXX #???, XXXX#???".

See https://help.github.com/articles/closing-issues-using-keywords/ for more.

## Advanced Techniques

These guidelines aren't essential, but they can make keeping things in order much easier.
Expand Down
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve

---

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

**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.
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):**
- 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.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature request here.
38 changes: 38 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!--
### How to use
Leave the headings unless they don't apply to your PR, replace commented out text ( surrounded with <!-- and -​-> ) with text describing your PR.
-->

#### Summary
<!--
A one-line description of your change that will be extracted and added to the project changelog at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/changelog.txt
The format is: ```SUMMARY: Category "description"```
The categories to choose from are: Features, Content, Interface, Mods, Balance, Bugfixes, Performance, Infrastructure, Build, I18N
Example: ```SUMMARY: Content "Adds new mutation category 'Mouse'"```
See the Changelog Guidelines at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/CHANGELOG_GUIDELINES.md for explanations of the categories.
-->

#### Purpose of change
<!--
If there's an existing issue describing the problem this PR addresses or the feature it adds, please link it like: ```#1234```
If it *fully* resolves an issue, link it like: ```Fixes #1234```
Even if the issue describes the problem, please provide a few-sentence summary here.
Example: ```Fixes #1234 - XL mutants cannot wear arm/leg splints due to missing OVERSIZE flag.```
If there is no related issue, please describe the issue you are addressing, including how to trigger a bug if this is a bugfix.
-->

#### 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
<!--
A clear and concise description of any alternative solutions or features you've considered.
-->

#### Additional context
<!--
Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature or bugfix here.
-->
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ build/
dep/
*.o
*.d
*.a
cmake-build-debug/

data/font/
Expand Down
8 changes: 8 additions & 0 deletions .gitmessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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
89 changes: 88 additions & 1 deletion COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [Cross-compiling to linux 32-bit from linux 64-bit](#cross-compiling-to-linux-32-bit-from-linux-64-bit)
* [Cross-compile to Windows from Linux](#cross-compile-to-windows-from-linux)
* [Cross-compile to Mac OS X from Linux](#cross-compile-to-mac-os-x-from-linux)
* [Cross-compile to Android from Linux](#cross-compile-to-android-from-linux)
* [Mac OS X](#mac-os-x)
* [Simple build using Homebrew](#simple-build-using-homebrew)
* [Advanced info for Developers](#advanced-info-for-developers)
Expand Down Expand Up @@ -282,6 +283,92 @@ To build full curses version with localizations and lua enabled:

Make sure that `x86_64-apple-darwin15-clang++` is in `PATH` environment variable.

## Cross-compile to Android from Linux

The Android build uses [Gradle](https://gradle.org/) to compile the java and native C++ code, and is based heavily off SDL's [Android project template](https://hg.libsdl.org/SDL/file/f1084c419f33/android-project). See the official SDL documentation [README-android.md](https://hg.libsdl.org/SDL/file/f1084c419f33/docs/README-android.md) for further information.

The Gradle project lives in the repository under `android/`. You can build it via the command line or open it in [Android Studio](https://developer.android.com/studio/). For simplicity, it only builds the SDL version with all features enabled, including tiles, sound, localization and lua.

### Dependencies

* Java JDK 8
* SDL2 (tested with 2.0.8, though a custom fork is recommended with project-specific bugfixes)
* SDL2_ttf (tested with 2.0.14)
* SDL2_mixer (tested with 2.0.2)
* SDL2_image (tested with 2.0.3)
* libintl-lite (tested with a custom fork of libintl-lite 0.5)
* lua (tested with lua 5.1.5)

Some dependencies need their entire source code copied under the Android project folder so they can be built for Android - see below.

### Setup

Install Linux dependencies. For a desktop Ubuntu installation:

sudo apt-get install lua5.2 openjdk-8-jdk-headless

Install Android SDK and NDK:

wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d ~/android-sdk
rm sdk-tools-linux-4333796.zip
~/android-sdk/tools/bin/sdkmanager --update
~/android-sdk/tools/bin/sdkmanager "tools" "platform-tools" "ndk-bundle"
~/android-sdk/tools/bin/sdkmanager --licenses

Export Android environment variables (you can add these to the end of `~/.bashrc`):

export ANDROID_SDK_ROOT=~/android-sdk
export ANDROID_HOME=~/android-sdk
export ANDROID_NDK_ROOT=~/android-sdk/ndk-bundle
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/tools
export PATH=$PATH:$ANDROID_NDK_ROOT

Install custom Android dependencies. Change directory to `Cataclysm-DDA` (the root folder of this repository) and run:

git clone https://github.com/a1studmuffin/SDL2 ./android/app/jni/SDL2
git clone https://github.com/a1studmuffin/lua ./android/app/jni/lua
git clone https://github.com/a1studmuffin/libintl-lite ./android/app/jni/libintl-lite

Install other Android dependencies SDL2_ttf, SDL2_mixer and SDL2_image. You may download the release ZIPs from from https://hg.libsdl.org/ and install them manually under `./android/app/jni/SDL2_xxx`, or clone latest dev with hg:

hg clone http://hg.libsdl.org/SDL_ttf ./android/app/jni/SDL2_ttf
hg clone http://hg.libsdl.org/SDL_mixer ./android/app/jni/SDL2_mixer
hg clone http://hg.libsdl.org/SDL_image ./android/app/jni/SDL2_image

Manually generate version and lua bindings:

make version
cd src/lua && lua generate_bindings.lua

### Android device setup

Enable [Developer options on your Android device](https://developer.android.com/studio/debug/dev-options). Connect your device to your PC via USB cable and run:

adb devices
adb connect <devicename>

### Building

To build an APK, use the Gradle wrapper command line tool (gradlew). The Android Studio documentation provides a good summary of how to [build your app from the command line](https://developer.android.com/studio/build/building-cmdline).

To build a debug APK, from the `android/` subfolder of the repository run:

./gradlew assembleDebug

This creates a debug APK in `./android/app/build/outputs/apk/` ready to be installed on your device.

To build a debug APK and immediately deploy to your connected device over adb run:

./gradlew installDebug

To build a signed release APK (ie. one that can be installed on a device), [build an unsigned release APK and sign it manually](https://developer.android.com/studio/publish/app-signing#signing-manually).

### Additional notes

The app stores data files on the device in `/sdcard/Android/data/com.cleverraven/cataclysmdda/files`. The data is backwards compatible with the desktop version.

# Mac OS X

To build Cataclysm on Mac you'll need [Command Line Tools for Xcode](https://developer.apple.com/downloads/) and the [Homebrew](http://brew.sh) package manager. With Homebrew, you can easily install or build Cataclysm using the [Cataclysm](https://formulae.brew.sh/formula/cataclysm) forumla.
Expand Down Expand Up @@ -498,7 +585,7 @@ Extract the 'WinDepend' folder and put it in the root folder of Cataclysm projec

### Lua

The next thing you need to do is to install lua. Download the appropriate x86 or x64 lua from [http://lua-users.org/wiki/LuaBinaries](http://lua-users.org/wiki/LuaBinaries), and extract it to `C:\Windows\System32` or somewhere else on your path.
The next thing you need to do is to install lua. Download the appropriate x86 or x64 lua from [http://lua-users.org/wiki/LuaBinaries](http://lua-users.org/wiki/LuaBinaries) or [http://dev.narc.ro/cataclysm/WinDepend-lua.zip](http://dev.narc.ro/cataclysm/WinDepend-lua.zip), and extract it to `C:\Windows\System32` or somewhere else on your path.

Once you have it installed, go to the project directory, then go to `src/lua`, and run `lua53 generate_bindings.lua catabindings.cpp`. This will generate the `catabindings.cpp` file which is necessary for compilation.

Expand Down
3 changes: 3 additions & 0 deletions Cataclysm-DDA.sublime-project
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
},
{
"path": "~/.cataclysm-dda"
},
{
"path": "~/Library/Application Support/Cataclysm"
}
],
"settings":
Expand Down
Loading

0 comments on commit cbcdb3f

Please sign in to comment.