Skip to content

Commit

Permalink
Merge pull request #9 from CleverRaven/master
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
acidia committed Jun 8, 2015
2 parents f062635 + c0733e3 commit ae981ce
Show file tree
Hide file tree
Showing 194 changed files with 71,212 additions and 15,582 deletions.
56 changes: 51 additions & 5 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Rough list based on building on Arch:
* Curses: `ncurses`
* Tiles: `sdl2`, `sdl2_image`, `sdl2_ttf`, `sdl2_mixer`, `freetype2`

E.g. for curses build on Debian and derivatives you'll also need `libncurses5-dev`.
E.g. for curses build on Debian and derivatives you'll also need `libncurses5-dev` or `libncursesw5-dev`.

Note on optional dependencies:

Expand Down Expand Up @@ -92,12 +92,12 @@ Building instructions, below, always assume you are running them from the Catacl

Dependencies:

* ncurses
* ncurses or ncursesw (for multi-byte locales)
* build essentials

Install:

sudo apt-get install libncurses5-dev build-essential
sudo apt-get install libncurses5-dev libncursesw5-dev build-essential

### Building

Expand All @@ -110,11 +110,11 @@ Run:
Dependencies:

* 32-bit toolchain
* 32-bit ncurses
* 32-bit ncursesw (compatible with both multi-byte and 8-bit locales)

Install:

sudo apt-get install libc6-dev-i386 lib32stdc++-dev g++-multilib lib32ncurses5-dev
sudo apt-get install libc6-dev-i386 lib32stdc++-dev g++-multilib lib32ncursesw5-dev

### Building

Expand Down Expand Up @@ -332,3 +332,49 @@ Workaround: install XCode 3 like that article describes, or disable localization

Open Terminal's preferences, turn on "Use bright colors for bold text" in "Preferences -> Settings -> Text"


# Windows MinGW Guide
To compile under windows MinGW you first need to download mingw. An automated GUI installer assistant called mingw-get-setup.exe will make everything a lot easier. I recommend installing it to `C:\MinGW`
https://sourceforge.net/projects/mingw/files/latest/download

## MinGW setup
once installed we need to get the right packages. In "Basic Setup", mark `mingw-developer-toolkit`, `mingw32-base` and `mingw32-gcc-g++`

Then install these components using `Installation -> Apply Changes`.

### Localization
If we want to compile with localization, we will need gettext and libintl. In "All Packages -> MinGW -> MinGW Autotools" ensure that `mingw32-gettext` and `mingw32-libintl` are installed.

## Required Tiles(SDL) Libraries
If we want to compile with Tiles (SDL) we have to download a few libraries.
* `SDL2` http://www.libsdl.org/download-2.0.php chose `SDL2-devel-2.0.X-mingw.tar.gz`.
* `SDL_ttf` https://www.libsdl.org/projects/SDL_ttf/ chose `SDL2_ttf-devel-2.0.12-mingw.tar.gz`.
* `SDL_image` https://www.libsdl.org/projects/SDL_image/ chose ` SDL2_image-devel-2.0.0-mingw.tar.gz`
* `freetype` http://gnuwin32.sourceforge.net/packages/freetype.htm chose `Binaries` and `Developer files`

### Installing Tiles(SDL) libraries.
For the first 3 (`SDL2`, `SDL_ttf` and `SDL_image`) you want to extract the include and lib folders from the `i686-w64-mingw32` folders into your MinGW installtion folder. (Reccomended `C:\MinGW`). And the `SDL2_image.dll` and `SDL2_ttf.dll` into your cataclysm root folder.

For freetype you want to grab the include and lib folders from the `freetype-2.X.X-X-lib.zip` and move them into your your MinGW installation folder. Then you want to get the freetype6.dll from the `freetype-2.X.X-X-bin.zip` and move it into your cataclysm root folder.

### ISSUE - "winapifamily.h" no such file or directoyr
There seems to be at the moment of writing that a file in SDL is broken and needs to be replaced.
https://hg.libsdl.org/SDL/raw-file/e217ed463f25/include/SDL_platform.h
Replace SDL_platform.h in the MinGW/include/SDL2 folder and it should be fine.

##Makefile changes
This probably not the best way to do it. But it seems that you need to remove a few dependenceis from the makefile or it will not build.
change the line `LDFLAGS += -lfreetype -lpng -lz -ljpeg -lbz2` to `LDFLAGS += -lfreetype`

##Compiling
Navigate to `MinGW\msys\1.0` and run `msys.bat`. This will start a cmd-like shell where the following entries will be made.

Add the MinGW toolchain to your PATH with `export PATH=$PATH:/c/MinGW/bin`. Replace /c/MinGW/ with the directory into which you installed MinGW (/c/ stands for drive C:, so if it's in F:/foo/bar, you'd use /f/foo/bar).

Navigate to the CDDA source code directory.

Compile using `make TILES=1 NATIVE=win32 LOCALIZE=1` and unless there are problems, it should produce a CDDA binary for you.

If you dont want tiles you can change `TILES` to 0.

If you dont want localization you can change `LOCALIZE` to 0.
1 change: 1 addition & 0 deletions CataclysmWin.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
<Unit filename="src/messages.h" />
<Unit filename="src/mission.cpp" />
<Unit filename="src/mission.h" />
<Unit filename="src/mission_companion.cpp" />
<Unit filename="src/mission_end.cpp" />
<Unit filename="src/mission_fail.cpp" />
<Unit filename="src/mission_place.cpp" />
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ else
endif
RC = $(CROSS)windres

# We don't need scientific precision for our math functions, this lets them run much faster.
CXXFLAGS += -ffast-math
# enable optimizations. slow to build
ifdef RELEASE
ifeq ($(NATIVE), osx)
Expand Down Expand Up @@ -446,7 +448,7 @@ $(DDIR):
@mkdir $(DDIR)

$(ODIR)/%.o: $(SRC_DIR)/%.cpp
$(CXX) $(DEFINES) $(CXXFLAGS) -c $< -o $@
$(CXX) $(CPPFLAGS) $(DEFINES) $(CXXFLAGS) -c $< -o $@

$(ODIR)/%.o: $(SRC_DIR)/%.rc
$(RC) $(RFLAGS) $< -o $@
Expand Down
8 changes: 4 additions & 4 deletions data/json/bullet_pulling.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"bullet": "22_lr",
"items": [
["lead", 2],
["22_casing", 1],
["22_casing_new", 1],
["gunpowder", 2]
]
},
Expand All @@ -63,7 +63,7 @@
"bullet": "22_ratshot",
"items": [
["lead", 2],
["22_casing", 1],
["22_casing_new", 1],
["gunpowder", 2]
]
},
Expand All @@ -72,7 +72,7 @@
"bullet": "22_cb",
"items": [
["lead", 2],
["22_casing", 1],
["22_casing_new", 1],
["gunpowder", 1]
]
},
Expand All @@ -81,7 +81,7 @@
"bullet": "22_fmj",
"items": [
["lead", 2],
["22_casing", 1],
["22_casing_new", 1],
["gunpowder", 1],
["copper", 2]
]
Expand Down
45 changes: 34 additions & 11 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@
"name": ["Bounced"],
"desc": ["AI tag used for bouncing ammo targeting. This is a bug if you have it."]
},
{
"type": "effect_type",
"id": "pushed",
"name": ["Pushed"],
"desc": ["AI tag used for monsters pushing each other. This is a bug if you have it."]
},
{
"//": "ACTUAL PLAYER EFFECTS START HERE",
"type": "effect_type",
Expand Down Expand Up @@ -221,6 +227,13 @@
"remove_message": "Your sight returns!",
"rating": "bad"
},
{
"type": "effect_type",
"id": "earphones",
"name": ["Wearing earphones"],
"desc": ["You are wearing earphones and can't hear much from outside world."],
"rating": "bad"
},
{
"type": "effect_type",
"id": "deaf",
Expand Down Expand Up @@ -768,13 +781,15 @@
"thirst_chance": [2],
"pain_min": [1],
"pain_chance": [2],
"pain_max_val": [-1]
"pain_max_val": [-1],
"stamina_chance": [2]
},
"scaling_mods": {
"speed_mod": [-7],
"speed_mod": [-4],
"thirst_min": [1],
"thirst_tick": [-100],
"pain_max_val": [10]
"pain_max_val": [10],
"stamina_min": [-1]
}
},
{
Expand Down Expand Up @@ -995,7 +1010,9 @@
"str_mod": [1],
"dex_mod": [4],
"per_mod": [4],
"int_mod": [-1]
"int_mod": [-1],
"stamina_min": [4],
"stamina_max": [8]
}
},
{
Expand Down Expand Up @@ -1073,20 +1090,22 @@
"max_intensity": 2,
"int_dur_factor": 200,
"base_mods": {
"speed_mod": [-40],
"speed_mod": [-20],
"str_mod": [-3],
"dex_mod": [-2],
"int_mod": [-1],
"per_mod": [-2],
"vomit_chance": [2000]
"vomit_chance": [2000],
"stamina_min": [-4]
},
"scaling_mods": {
"speed_mod": [90],
"speed_mod": [30],
"str_mod": [4],
"dex_mod": [4],
"int_mod": [3],
"per_mod": [5],
"fatigue_min": [1]
"fatigue_min": [1],
"stamina_min": [8]
}
},
{
Expand Down Expand Up @@ -1335,11 +1354,15 @@
"type": "effect_type",
"id": "grabbed",
"name": ["Grabbed"],
"desc": ["You have been grabbed by an attack.\nYou cannot dodge and blocking is very difficult."],
"apply_message": "You have been grabbed.",
"desc": ["You have been grabbed by an attack.\nYou are being held in place and cannot dodge, and blocking is very difficult."],
"rating": "bad",
"max_duration": 2,
"max_intensity": 15,
"base_mods": {
"speed_mod": [-25]
"speed_mod": [-15]
},
"scaling_mods": {
"speed_mod": [-5]
}
},
{
Expand Down
Loading

0 comments on commit ae981ce

Please sign in to comment.