Commit graph

7318 commits

Author SHA1 Message Date
Kp 423c1c3f10 Use range_for for fuelcen.cpp 2015-08-22 20:43:03 +00:00
Kp b8baddb5a2 Use uint8_t for player_awareness_type_t
Fixes: 9157e5f970 ("Use enum class for player_awareness_type_t")
2015-08-22 20:43:02 +00:00
Kp 64ff1cda89 Only restore non-alpha when alpha was used 2015-08-21 03:12:35 +00:00
Kp fcfd3d7e54 Cast valptridx size_t to unsigned long for Windows
Windows has `typedef unsigned size_t`, so %lu triggers a format warning
for Windows targets.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/116>
2015-08-19 02:42:49 +00:00
zico 30e909226f Fixed Primary weapon info position in HiRes cockpit mode; Removed redundant vulcan ammo display in Fullscreen Alt HUD #1 2015-08-18 19:17:24 +02:00
Kp 66da9c136e Cache do_explosion_sequence Robot_info lookups 2015-08-17 02:44:56 +00:00
Kp 080e052d65 Reorder fvi_sub object tests
Change to individual continue statements to reduce number of negations.
2015-08-17 02:44:56 +00:00
Kp 2eeca09ae1 Improve create_smart_children
Use accurate squared distance instead of quick non-squared distance.
Simplify target choice loop.
2015-08-17 02:44:56 +00:00
Kp 947145a194 Simplify player-got-hit sound check 2015-08-17 02:44:56 +00:00
zico fb6ea072e4 Repositioned (non Release) HUD level time output and FPS counter to fixed positions across all cockpit modes; Slight reformat for FPS counter and added FrameTime display (in ms) if -verbose is given 2015-08-16 15:37:30 +02:00
zico 57b4bd0281 Community wish: If friendly fire is disabled, also protect players from explosion damage caused by friendly players. This also protects against splash damage caused by oneself. 2015-08-16 13:25:07 +02:00
Kp be3ab3bd81 Use range_for in PHYSFSX_checkMatchingExtension 2015-08-14 03:02:04 +00:00
Kp 389cd42f47 Default verbosebuild on for non-tty outputs 2015-08-14 03:02:04 +00:00
Kp 655e7b6f72 Optimize clearing ConsoleObject anim_angles 2015-08-14 03:02:04 +00:00
Kp e5683593ef Expand ZERO_VECTOR inline 2015-08-13 03:15:53 +00:00
Kp 4f871c43fe Add compile-time check for non-overlapping vm_matrix_x_matrix 2015-08-13 03:15:52 +00:00
Kp 5922d3cf9e Update endlevel !SHORT_SEQUENCE code
This rotted long ago, but the fixes are easy.  Clean it up in case
someone wants to activate it.
2015-08-13 03:15:52 +00:00
Kp c4118ee014 Improve caching when duplicating items 2015-08-13 03:15:52 +00:00
Kp 17b1943c5e Mark various per-file structures as static 2015-08-12 03:11:46 +00:00
Kp bc7c469ab2 Use array<> for more globals 2015-08-12 03:11:46 +00:00
Kp 41ecab004f Skip message for unknown variables when there is nothing to do
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/115>
Fixes: 870ed653b5 ("Warn about unknown scons variables")
2015-08-11 03:05:55 +00:00
Kp fa9f2e626d Move DbgShowMemInfo to CArg
Members of Arg are not visible to common code, so common/mem/mem.cpp
broke during the -Wodr cleanup.

Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/114>
Fixes: 6bd93e466f ("Guard args.h for LTO -Wodr")
2015-08-11 03:05:55 +00:00
Kp 0a3de25d7a Flatten valptridx ptr/idx further
Use a dummy template parameter to prevent slicing, instead of an extra
class in the inheritance chain.  This improves the generated code
slightly.
2015-08-07 03:13:51 +00:00
Kp 3458454f7e Flatten valptridx hierarchy 2015-08-06 02:57:59 +00:00
Kp b3d1c6efaa Use helper for valptridx array size checks 2015-08-06 02:57:58 +00:00
Kp 001fdfff37 Add workaround for gcc-4.8 ref qualifier quirk
In gcc-4.8, a member method with const lvalue and const rvalue methods
is ambiguous.

	$ cat t.cpp
	class A
	{
	public:
	    void a() const &;
	    void a() const &&;
	};

	A b();
	void c()
	{
	    b().a();	// fails in gcc-4.8, works in later
	}
	$ gcc-4.8 -Wall -Wextra -std=gnu++0x -O2 -c t.cpp
	t.cpp: In function 'void c()':
	t.cpp:11:8: error: call of overloaded 'a()' is ambiguous
	  b().a();
		^
	t.cpp:11:8: note: candidates are:
	t.cpp:4:7: note: void A::a() const &
	  void a() const &;
	       ^
	t.cpp:5:7: note: void A::a() const &&
	  void a() const &&;
	       ^
	$ gcc-4.9 -Wall -Wextra -std=gnu++0x -O2 -c t.cpp
	$

Fixes: bda7fef3a0 ("Use get_local_player to compute reference to local player")
2015-08-05 02:59:03 +00:00
Kp e3dbe7a07c Add workaround for gcc-4.7 type inheritance quirk
In gcc-4.7, a type inherited via using is distinct from a type defined
by using.

	$ cat t.cpp
	template <typename>
	class A
	{
	public:
	    typedef void a;
	    typedef void b;
	};

	template <typename T>
	class B : protected A<T>
	{
	protected:
	    using typename A<T>::a;
	    using b = typename A<T>::b;
	public:
	    static inline a f1();
	    static inline b f2();
	};

	template <typename T>
	typename B<T>::a B<T>::f1() {}	// fails for gcc-4.7, works in later

	template <typename T>
	typename B<T>::b B<T>::f2() {}	// works in both

	$ gcc-4.7 -Wall -Wextra -std=gnu++0x -O2 -c t.cpp
	t.cpp:21:18: error: prototype for 'typename B<T>::a B<T>::f1()' does not match any in class 'B<T>'
	t.cpp:16:18: error: candidate is: static typename A<T>::a B<T>::f1()
	t.cpp:16:18: warning: inline function 'static typename A<T>::a B<T>::f1() [with T = int; typename A<T>::a = void]' used but never defined [enabled by default]

	$ gcc-4.8 -Wall -Wextra -std=gnu++0x -O2 -c t.cpp
	$

Fixes: 8b7c5c3e2b ("Rewrite valptridx")
2015-08-05 02:59:03 +00:00
Kp f15116f2cb Simplify multiplayer sound handling 2015-08-05 02:59:02 +00:00
Kp 6870b48710 Remove unused return value of digi_link_sound_to_object* 2015-08-05 02:59:02 +00:00
Kp 9fb9aef509 Remove unused return value of digi_link_sound_to_pos 2015-08-05 02:59:02 +00:00
Kp b979f52ebf Centralize required C++11 features 2015-08-03 03:11:25 +00:00
Kp c47b7e383f Make template alias support mandatory 2015-08-03 03:11:25 +00:00
Kp c80d12319a Use unqualified begin/end
Most call sites use unqualified begin/end and rely on using declarations
to pick an appropriate implementation.  Fix the sites that explicitly
requested std::begin/std::end.
2015-08-03 03:11:25 +00:00
Kp 20b1db3483 Expand dxx_explicit_operator_bool to "explicit"
Many files now use "explicit", so compilers which reject
explicit operator bool() will not work.  Remove the macro.
2015-08-03 03:11:25 +00:00
Kp 49b0868230 Fix ambiguous return when constructor inheritance is missing
gcc-4.7 (and, if constructor inheritance is suppressed, later versions)
reject

	return objnum == object_none ? vcobjptr(static_cast<objnum_t>(object_first)) : objnum;

where objnum is a cobjptridx:

similar/main/digiobj.cpp: In lambda function:
similar/main/digiobj.cpp:564:85: error: operands to ?: have different types 'valptridx<object>::vcptr' and 'valptridx<object>::cptridx'
similar/main/digiobj.cpp:564:85: error: inconsistent types '<type error>' and 'valptridx<object>::vcptr' deduced for lambda return type

Fix it by removing the ternary operator and adding an appropriate
conversion cast.
2015-08-03 03:11:25 +00:00
Kp 555ff20ae9 Move render_state.h up for gcc-4.7 static_assert
In gcc-4.7, <bits/hashtable.h> uses static_assert in a way that the
preprocessor considers to have 3 arguments.  Move render_state.h up to
ensure that <bits/hashtable.h> is included before
"compiler-static_assert.h" converts static_assert into a 2 argument
macro.
2015-08-03 03:11:25 +00:00
Kp 2fb03da475 Inline multi_send_endlevel_start secret for D2 2015-08-03 03:11:25 +00:00
Kp 978cf91a96 Reduce partial_range error argument shuffling 2015-08-03 03:11:24 +00:00
Kp 7086bbae14 Simplify automatic compiler test 2015-08-03 03:11:24 +00:00
Kp eb5fcb34e6 Remove default argument for basic_ptr(reference,array) 2015-07-29 03:05:28 +00:00
Kp e0e1b28c72 Remove default argument for basic_ptr(reference,index,array) 2015-07-29 03:05:28 +00:00
Kp 84bd64a14c Remove default argument for basic_ptridx(magic,array) 2015-07-29 03:05:28 +00:00
Kp ba38214bab Remove default argument for basic_ptridx(pointer,index,array) 2015-07-29 03:05:28 +00:00
Kp 4d8ae44794 Add helper macro DXX_CONSTANT_TRUE 2015-07-29 03:05:28 +00:00
Kp cfd08b5d6c Suppress physfsx read/write macros in physfsrwops.cpp 2015-07-25 23:10:48 +00:00
Kp 4a6ae13367 Centralize PCH object hook 2015-07-25 23:10:48 +00:00
Kp a2816617fe Pass reactor& to read_model_guns 2015-07-25 23:10:48 +00:00
Kp d4dc3df3de Support PCH+LTO 2015-07-25 23:10:48 +00:00
Kp c9dff229f1 Remove dead AI fire leading code 2015-07-25 23:10:47 +00:00
Kp 822f8ad5c0 Use __builtin_object_size to check some unchecked ranges 2015-07-25 23:10:47 +00:00