Commit Graph

23705 Commits

Author SHA1 Message Date
Jonathan G Rennison
ea2b04a6be Add C++11 container utility functions. 2016-09-10 00:55:13 +01:00
Jonathan G Rennison
778d3f1352 Configure: Default to trying clang then gcc on OSX, gcc then clang elsewhere. 2016-09-08 23:14:02 +01:00
Jonathan G Rennison
db026ec8b0 No longer truncate savegame version in gamelog.
Add an extended feature for changed savegame format.
2016-09-08 21:22:39 +01:00
Jonathan G Rennison
5672b6c2c8 Enable custom allocator use on clang. 2016-09-08 20:09:42 +01:00
Jonathan G Rennison
a8e0862500 Enable prefetch and bswap buitins for clang. 2016-09-08 20:00:56 +01:00
Jonathan G Rennison
34040b694c Make use of override unconditional. 2016-09-08 19:47:59 +01:00
Jonathan G Rennison
8ad53acfef Merge branch 'crashlog_improvements' into jgrpp 2016-09-08 19:41:53 +01:00
Jonathan G Rennison
c2825c12ea Add clang version support to crashlog output. 2016-09-08 19:40:15 +01:00
Jonathan G Rennison
c59509c2aa Use -gline-tables-only instead of -g1 on clang. 2016-09-08 19:38:13 +01:00
Jonathan G Rennison
f7774415f2 Merge branch 'cpp-11' into crashlog_improvements
# Conflicts:
#	src/stdafx.h
2016-09-08 19:36:00 +01:00
Jonathan G Rennison
8a2f9311a9 Include -01 in CFLAGS_BUILD when using clang. 2016-09-08 19:31:40 +01:00
Jonathan G Rennison
b8a89437a1 Enable use of atomic store/load on clang. 2016-09-08 18:40:08 +01:00
Jonathan G Rennison
390a22f864 Enable FINAL, (un)linkely, __attribute__ for clang. 2016-09-08 18:38:53 +01:00
Jonathan G Rennison
9a7c1911fc Fix narrowing conversion errors with clang. 2016-09-08 18:17:55 +01:00
Jonathan G Rennison
9ea018abc5 Merge branch 'cargo_type_order' into jgrpp
# Conflicts:
#	src/order_base.h
#	src/order_gui.cpp
#	src/order_type.h
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/extended_ver_sl.h
#	src/vehicle_base.h
2016-09-08 00:12:48 +01:00
Jonathan G Rennison
bc04b07f2b Fix double-use of bits 3 and 7 in Order::flags.
Use a different encoding for the cargo type load/unload bit in flags.
2016-09-08 00:12:27 +01:00
Jonathan G Rennison
153a0536df Merge branch 'tracerestrict-sx' into jgrpp
# Conflicts:
#	src/rail_gui.cpp
#	src/saveload/extended_ver_sl.cpp
2016-09-07 22:06:06 +01:00
Jonathan G Rennison
88156ee570 Merge branch 'day_length' into jgrpp 2016-09-07 22:04:10 +01:00
Jonathan G Rennison
5e67582a64 Merge branch 'save_ext' into jgrpp
# Conflicts:
#	config.lib
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/saveload.cpp
2016-09-07 22:02:57 +01:00
Jonathan G Rennison
c8942219bd Merge branch 'save_ext' into day_length
# Conflicts:
#	src/saveload/saveload.cpp
2016-09-07 21:49:28 +01:00
cirdan
315db4874a Remove unused global struct RefitDesc
Global struct RefitDesc was defined but never used.

(cherry picked from commit 6826240f8170a93720a0f856f1a10d6dda1926c7)
2016-09-07 21:35:27 +01:00
cirdan
ca98e78c69 Remove unused Vehicle capacity methods
Remove unused methods Vehicle::GetConsistFreeCapacities and
Vehicle::GetConsistTotalCapacity.

(cherry picked from commit d97442878f9856c253a3bf976b6a3e114faebefe)
2016-09-07 21:32:27 +01:00
cirdan
25bd3ed6f4 Fix map borders when switching freeform edges
When disabling freeform edges after they were enabled, the tiles
at the northern borders of the map were turned from void to water
by simply setting their type to MP_WATER, which is wrong, because
they were left as owned by player 0, since their owner information
was not updated. Use MakeSea instead, which gets it right.

(cherry picked from commit 39408d6cc4080760f5a58d60cbed9f2ea584496f)
2016-09-07 19:17:44 +01:00
cirdan
c5e30b8f04 Fix file descriptor leak in LoadOldSaveGame
LoadOldSaveGame was leaking a file descriptor when it
successfully loaded a savegame.

(cherry picked from commit f47cfbbba0b182f116109e02445bb419fab1a157)
2016-09-07 19:15:04 +01:00
cirdan
293ce8b4ab Remove impossible conditional in RealSave_Town
Saving always uses the current savegame version SAVEGAME_VERSION,
which is non-decreasing and already greater than 166.

(cherry picked from commit 6b79497d380b3ae865ddf4d3efb71c319a2bb579)
2016-09-07 18:47:47 +01:00
cirdan
4a19babf9e Remove unused ChunkType flag CH_AUTO_LENGTH
CH_AUTO_LENGTH is no longer used anywhere, so remove all code
that depends on it.

(cherry picked from commit 9c620d9de5d45b78f7d992d6b3897009fe988d86)
2016-09-07 18:47:39 +01:00
cirdan
ec157b4a66 Remove save-only autolength flag from economy chunk handlers
CH_AUTO_LENGTH is only used when saving chunks; it makes no sense
to set it for chunks without a save handler.

(cherry picked from commit 8b2fe11d8491fb5f3b9bd7dd5344a0956817e41c)
2016-09-07 18:47:32 +01:00
Jonathan G Rennison
6031cca2d7 Refactor Link Refresher cargo mask handling.
Add some separate helper functions.
Move cargo checks out of LinkRefresher::Run.
2016-09-06 22:16:29 +01:00
Jonathan G Rennison
f8f8e642dc Use unique_ptr and initialiser init for OrderExtraInfo. 2016-09-06 22:10:18 +01:00
Jonathan G Rennison
e90b266af1 De-duplicate cargo masking boilerplate using C++11. 2016-09-06 22:10:18 +01:00
Jonathan G Rennison
72a386abe5 Merge branch 'save_ext' into cargo_type_order 2016-09-06 22:09:50 +01:00
translators
737897653a (svn r27655) -Update from Eints:
romanian: 2 changes by kkmic
2016-09-06 17:45:36 +00:00
Jonathan G Rennison
162e495cc9 Merge branch 'save_ext' into tracerestrict-sx
# Conflicts:
#	src/rail_gui.cpp
#	src/saveload/extended_ver_sl.cpp
2016-09-05 23:33:33 +01:00
Jonathan G Rennison
a3d0fc5817 Remove an unused extern declaration, update comment. 2016-09-05 23:31:34 +01:00
Jonathan G Rennison
8e8d7e93d5 Tidy up legacy-compatibility code in PATX/PLYX handlers.
Use lambdas instead of manual emulation.
Move an inner struct back into its owner function.
2016-09-05 23:31:26 +01:00
Jonathan G Rennison
a6e0b1ac7d Merge branch 'cpp-11' into save_ext 2016-09-05 23:17:02 +01:00
Jonathan G Rennison
f7af8b8bdc Silence -Wunused-variable warnings in src/table/townname.h 2016-09-05 23:16:47 +01:00
Jonathan G Rennison
6e9ea59ab5 Add a simple scope guard include file. 2016-09-05 23:16:47 +01:00
Jonathan G Rennison
bb6ea150a3 Use likely/__builtin_expect for assertion macros.
(cherry picked from commit f82002cda2)
2016-09-05 22:46:01 +01:00
Jonathan G Rennison
0b7d68a6d1 Add support for verbose asserts.
(cherry picked from commit 48e4c35fdc)
2016-09-05 22:46:01 +01:00
Jonathan G Rennison
51099c3572 Unconditionally use static_assert. 2016-09-05 22:46:01 +01:00
Jonathan G Rennison
2fe7571034 Require C++11 support.
Set minimum compiler versions to:
GCC 4.7
clang 3.3
ICC 14.0
2016-09-05 22:45:57 +01:00
cirdan
e6122f5ce4 Remove ZeroedMemoryAllocator from ScriptText
Have ScriptText initialise all of its members on construction and
not derive from ZeroedMemoryAllocator.

(cherry picked from commit 3240126202d3437396004f2d5b0371783effb1ea)

Reorder ScriptText constructor initialisers.
2016-09-05 22:41:36 +01:00
cirdan
80fd6a2783 Drop memory allocator from ClientNetworkGameSocketHandler
Have ClientNetworkGameSocketHandler initialise all of its members
on construction and not derive from ZeroedMemoryAllocator.

(cherry picked from commit dddda4f0b7ba0bd6f310f924d3b85cadbc81dc99)
2016-09-05 22:35:15 +01:00
cirdan
33e3956b13 Remove ZeroedMemoryAllocator from WindowDesc
All fields are initialised in the constructor, plus no WindowDesc
is ever constructed via operator new.

(cherry picked from commit 94750756bfbf8ab5ca36e6a38f6f7b556ca31b32)
2016-09-05 22:34:48 +01:00
frosch
533cb7c156 (svn r27654) -Change: Enable C++11 for clang 3.3 (LordAro) 2016-09-05 19:11:01 +00:00
Jonathan G Rennison
871d26098e Move Order::cargo_type_flags into a separately allocated object.
Change savegame format, add a new chunk for cargo_type_flags.
2016-09-05 00:12:48 +01:00
Jonathan G Rennison
3507b51d9e Initial LinkRefresher support for cargo-specific links. 2016-09-05 00:12:48 +01:00
Jonathan G Rennison
a670966acf Change GetNextStoppingStation to return per-cargo result(s). 2016-09-05 00:12:48 +01:00
Jonathan G Rennison
ed99dd2583 Change name of Order cargo-typed get load/unload type accessors.
Move helper functions to get cargo-specific type in cargo-specific
mode, into Order class.
2016-09-05 00:12:48 +01:00