Showing with 1,953 additions and 1,828 deletions.
  1. +5 −1 .gitignore
  2. +44 −0 COMPILING.md
  3. +1 −0 SIGNOFF
  4. +8 −4 astyled_whitelist
  5. +3 −22 msvc140/Cataclysm.vcxproj
  6. +10 −0 msvc140/arch.props
  7. +4 −1 msvc140/debug.props
  8. +2 −6 msvc140/optimize.props
  9. +1 −1 src/bionics_ui.cpp
  10. +5 −3 src/cata_tiles.cpp
  11. +350 −331 src/crafting.cpp
  12. +4 −3 src/explosion.cpp
  13. +10 −5 src/filesystem.cpp
  14. +448 −439 src/input.cpp
  15. +16 −5 src/melee.cpp
  16. +845 −851 src/output.cpp
  17. +155 −122 src/output.h
  18. +35 −24 src/pickup.cpp
  19. +6 −4 src/sdltiles.cpp
  20. +1 −1 src/trapfunc.cpp
  21. +0 −5 src/ui.cpp
@@ -106,4 +106,8 @@ cataclysm.a
*.core

# sublime-text workspace
*.sublime-workspace
*.sublime-workspace

# Visual Studio 2015
msvc140/*db
msvc140/ipch
@@ -367,6 +367,50 @@ Open Terminal's preferences, turn on "Use bright colors for bold text" in "Prefe

# Windows

## Visual Studio Guide

MSVC 13 and earlier versions are likely unable to build Cataclysm, so we recommend you to use Visual Studio 2015. Project files are in `msvc140/` directory.

### Dependencies

For tiles support, the following 3 libraries need to be downloaded and installed:

[http://www.libsdl.org/release/SDL2-devel-2.0.4-VC.zip](http://www.libsdl.org/release/SDL2-devel-2.0.4-VC.zip)

[http://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.14-VC.zip](http://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.14-VC.zip)

[http://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.1-VC.zip](http://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.1-VC.zip)

For localization support, pre-built binaries of `libintl` and `libiconv` can be obtained from GNOME FTP.

### Configuration

If your machine doesn't support AVX2 instruction set, edit file `msvc140/arch.props`, change

```
<ClCompile>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
```

to

```
<ClCompile>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
</ClCompile>
```

### Building

Building Cataclysm with Visual Studio is very simple. Just build it like a normal Visual C++ project. The process may takes a long period of time, so you'd better prepare a cup of coffee and some books in front of your computer :)

If you need localization support, execute the bash script `lang/compile_mo.sh` inside Git Bash GUI just like on a UNIX-like system.

### Debugging

After building Cataclysm, you may discover that after pressing the debug button in Visual Studio, Cataclysm just exits after launch with return code 1. That is because of the wrong working directory. You need to configure the working directory to `$(ProjectDir)..`. It should be the root directory of Cataclysm, not `$(ProjectDir)`( = `msvc140/`).

## 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
@@ -53,3 +53,4 @@ 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>
@@ -12,6 +12,7 @@ src/clzones.cpp
src/consumption.cpp
src/coordinate_conversions.cpp
src/craft_command.cpp
src/crafting.cpp
src/crafting_gui.cpp
src/creature_tracker.cpp
src/damage.cpp
@@ -20,10 +21,11 @@ src/dependency_tree.cpp
src/drawing_primitives.cpp
src/editmap.cpp
src/explosion.cpp
src/fault.cpp
src/gamemode.cpp
src/gates.cpp
src/gates.h
src/help.cpp
src/input.cpp
src/item_action.cpp
src/item_location.cpp
src/itype.cpp
@@ -46,6 +48,7 @@ src/morale.cpp
src/mtype.cpp
src/mutation_ui.cpp
src/name.cpp
src/overlay_ordering.cpp
src/pathfinding.cpp
src/player_activity.cpp
src/posix_time.cpp
@@ -64,6 +67,7 @@ src/trapfunc.cpp
src/tutorial.cpp
src/vehicle_selector.cpp
src/version.cpp
src/vitamin.cpp
src/weather_gen.cpp
src/wish.cpp
src/action.h
@@ -105,9 +109,9 @@ src/event.h
src/explosion.h
src/faction.h
src/fault.h
src/fault.cpp
src/filesystem.h
src/game_constants.h
src/gates.h
src/generic_factory.h
src/get_version.h
src/help.h
@@ -148,6 +152,7 @@ src/name.h
src/npc_favor.h
src/omdata.h
src/options.h
src/overlay_ordering.h
src/overmap_types.h
src/path_info.h
src/pathfinding.h
@@ -177,9 +182,8 @@ src/veh_interact.h
src/veh_type.h
src/vehicle_selector.h
src/version.h
src/vitamin.h
src/vitamin.cpp
src/visitable.h
src/vitamin.h
src/weather.h
src/weighted_list.h
src/worldfactory.h
@@ -127,6 +127,7 @@
<ImportGroup Label="PropertySheets">
<Import Project="common.props" />
<Import Project="precompile.props" />
<Import Project="arch.props" />
</ImportGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="PropertySheets">
@@ -160,28 +161,8 @@
<Message>Generate version.h</Message>
</PreBuildEvent>
<ClCompile>
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug SDL Tiles|x64'">NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<ClCompile>
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release Localized|x64'">NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<ClCompile>
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<ClCompile>
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<ClCompile>
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release SDL Tiles Localized|x64'">NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<ClCompile>
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug SDL Tiles Localized|x64'">NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<ClCompile>
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release SDL Tiles|x64'">NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<ClCompile>
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug Localized|x64'">NotSet</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
</ItemDefinitionGroup>
</Project>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
</ItemDefinitionGroup>
</Project>
@@ -10,11 +10,14 @@
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_DEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization>Full</Optimization>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
</ClCompile>
<Link>
<GenerateDebugInformation>Debug</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<BuildMacro Include="BuildConfig">
@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />

<PropertyGroup Label="UserMacros">
<BuildConfig>Release</BuildConfig>
</PropertyGroup>

<PropertyGroup />

<ItemDefinitionGroup>
<ClCompile>
<Optimization>Full</Optimization>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FloatingPointModel>Fast</FloatingPointModel>
</ClCompile>
<Link>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
@@ -21,11 +19,9 @@
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>

<ItemGroup>
<BuildMacro Include="BuildConfig">
<Value>$(BuildConfig)</Value>
</BuildMacro>
</ItemGroup>

</Project>
@@ -73,7 +73,7 @@ void draw_bionics_titlebar( WINDOW *window, player *p, bionic_menu_mode mode )

const auto separator = []( std::ostringstream &s )
{
return s.tellp() != 0 ? ", " : "";
return ( int )( s.tellp() ) != 0 ? ", " : "";
};

//builds the power usage string of a given bionic
@@ -965,11 +965,13 @@ void cata_tiles::draw( int destx, int desty, const tripoint &center, int width,

draw_points.push_back( tile_render_info( tripoint( x, y, center.z ), height_3d ) );
}
// for each of the drawing layers in order, back to front ...
for( auto f : { &cata_tiles::draw_furniture, &cata_tiles::draw_trap,
const decltype (&cata_tiles::draw_furniture) drawing_layers[]={
&cata_tiles::draw_furniture, &cata_tiles::draw_trap,
&cata_tiles::draw_field_or_item, &cata_tiles::draw_vpart,
&cata_tiles::draw_vpart_below, &cata_tiles::draw_terrain_below,
&cata_tiles::draw_critter_at } ) {
&cata_tiles::draw_critter_at };
// for each of the drawing layers in order, back to front ...
for( auto f : drawing_layers ) {
// ... draw all the points we drew terrain for, in the same order
for( auto &p : draw_points ) {
(this->*f)( p.pos, ch.visibility_cache[p.pos.x][p.pos.y], p.height_3d );