Commit graph

57 commits

Author SHA1 Message Date
Kp e3553586c1 Use enum class for bitmap_index 2022-12-31 16:21:47 +00:00
Kp e3faab0899 Use alias template per_player_array for arrays that are MAX_PLAYERS long
This removes the need to repeat MAX_PLAYERS in every usage, and prepares
for a future change to use enumerated_array instead of std::array.
2022-09-24 17:47:53 +00:00
Kp 6215ef8e06 Pass LevelSharedRobotInfoState to various functions that need it 2022-07-09 13:39:29 +00:00
Kp 6b8a0a74c6 Fix some check_header_includes=1 failures 2022-02-12 18:57:12 +00:00
Kp 2fef4cddec Pass canvas to do_cockpit_window_view 2021-09-12 16:20:52 +00:00
Kp bd6612a86b Pass canvas to render_gauges 2021-09-12 16:20:52 +00:00
Kp 98f2578293 Pass Game_mode as a parameter to gauges functions
Avoid reloading it from the global.
2021-09-12 16:20:52 +00:00
Kp 77acae6510 Use enum class for weapon_box_user 2021-01-17 22:23:23 +00:00
Kp ffb653c0b8 Pass control_info & to various functions
Switch from a direct global reference to passing control_info& as a
parameter.
2020-10-12 03:28:26 +00:00
Kp 637efae03a Use enum class for gauges window indexing 2020-08-10 03:45:13 +00:00
Kp 3170b11997 Modernize typedefs for std::array types
Use `using x = y;` instead of `typedef y x;`.
2020-05-02 21:18:42 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp a36eb1d52c Only use update_laser_weapon_info for quad laser change
Regular laser level changes are already tracked and handled separately.
2019-03-03 00:31:08 +00:00
Kp 3b168b38fd Make Viewer const object *
Viewing should not change anything.
2018-09-25 03:44:09 +00:00
Kp 599ac9dee0 Always qualify valptridx type/factory
Previously, valptridx used PREFIX for allow-invalid+mutable, c#PREFIX
for allow-invalid+const, v#PREFIX for require-valid+mutable, vc#PREFIX
for require-valid+const.  Convert the types, factories, and all usage
sites to specify a qualifier for all four combinations:

	im#PREFIX -> allow-invalid+mutable
	ic#PREFIX -> allow-invalid+const
	vm#PREFIX -> require-valid+mutable
	vc#PREFIX -> require-valid+const

Changes to common/include/valptridx.h and common/include/fwd-valptridx.h
are manual.  All other changes are generated by:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\(v\?\)\(\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/\1m\2/g'

for the 'm' prefix and:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\([cm]\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/i&/g'

for the 'i' prefix.
2017-06-10 03:31:02 +00:00
Kp afb52a5a3e Pass canvas to draw_hud 2017-03-11 19:56:22 +00:00
Kp a19286437a Pass canvas to show_mousefs_indicator 2017-03-11 19:56:22 +00:00
Kp 4b6f42a962 Pass canvas to show_reticle 2017-03-11 19:56:22 +00:00
Kp f5a17abbe8 Pass canvas to show_HUD_names 2017-03-10 01:22:28 +00:00
Kp fb53bc9257 Pass canvas to player_dead_message 2017-02-11 21:42:46 +00:00
Kp 227eb98c3e Pass player_info to do_cockpit_window_view 2017-02-11 21:42:31 +00:00
Kp 17a50272f0 Pass player_info to more gauges functions 2016-12-11 01:56:43 +00:00
Kp 6fbcef75b1 Pass player object to draw_hud 2016-12-10 17:51:10 +00:00
Kp 0fb59c225c Move add_points_to_score into namespace dsx 2016-12-05 00:26:10 +00:00
Kp ad35460eb0 Pass player_info to add_bonus_points_to_score 2016-10-15 00:53:20 +00:00
Kp 25f5fc231a Pass player_info to add_points_to_score 2016-10-15 00:53:19 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 198540d080 Use range_for in bm.cpp 2016-02-06 22:12:54 +00:00
Kp 2196008178 Move fwdobject.h -> fwd-object.h for consistency 2015-10-10 03:44:14 +00:00
Kp 946048c54b Move valptridx subtypes to individual fwd headers 2015-08-22 20:43:04 +00:00
Kp f00725f740 Use forward-declaration header for player.h 2015-07-25 23:10:45 +00:00
Kp ac3b1d6aa3 Switch do_cockpit_window_view to vobjptr_t
Only the wake_up_rendered_objects hack needed a vobjptridx_t.  Switch to
vobjptr_t.
2015-05-13 03:20:28 +00:00
Kp c338862ad6 Reduce gauges.h includes 2015-04-19 04:18:51 +00:00
Kp 2f86499144 Remove do_cockpit_window_view unused parameters 2015-04-02 02:36:57 +00:00
Kp 3da8a85ec3 Remove constexpr on rgb_array_wrapper::operator[]
OS X clang (but not Linux clang) rejects constexpr
on rgb_array_wrapper::operator[].

Reported-by: btb <b414758505 (commitcomment-10330686)>
Fixes: b414758505 ("Add stub for player color remapping")
2015-03-21 21:11:12 +00:00
Kp b414758505 Add stub for player color remapping 2015-03-09 03:33:07 +00:00
Kp 68e2168377 Use array<> for bitmap_index arrays 2015-02-14 22:48:30 +00:00
Kp 004e1371d6 Split valid/nonvalid cases of do_cockpit_window_view 2015-02-14 22:48:28 +00:00
Kp 6b767c3a03 Remove various #include "gr.h" 2015-01-29 04:27:36 +00:00
Kp e30df66462 Remove gauges.h #include "piggy.h" 2015-01-29 04:27:35 +00:00
Kp bc3a76c673 Hoist gauge loop iterations 2014-11-01 15:28:07 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp 703f60ac3f Fix -Wtype-limits warnings 2014-09-21 21:41:55 +00:00
Kp 743cb49ed8 Make cockpit_decode_alpha static 2014-06-08 00:05:33 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp 073f00974a Eliminate uses of the typedef struct X { ... } X; pattern
C++ does not require this pattern.

import re, fileinput
to = re.compile(r'^typedef struct ([a-z_A-Z]+)\s*{')
tc = re.compile(r'^}(.*?)\s*([a-z_A-Z]+);$')
osn = None
for line in fileinput.input(inplace=True):
	m = to.match(line)
	if m:
		osn = m.group(1)
		print 'struct %s\n{' % osn
		continue
	if osn:
		m = tc.match(line)
		if m:
			csn = m.group(2)
			if osn == csn:
				print '}%s;' % m.group(1)
				osn = None
				continue
			else:
				osn = None
	print line,
2013-12-28 22:48:07 +00:00
Kp 9de54cfa74 Switch to C++ linkage
import fileinput
guard = 0
cxxguard = '#ifdef __cplusplus\n'
for line in fileinput.input(inplace=True):
	if line == cxxguard:
		guard = 1
		continue
	if guard:
		if line == 'extern "C" {\n':
			guard = 2
			continue
		if line == '}\n':
			guard = 0
			continue
		if guard == 2:
			assert(line == '#endif\n')
			guard = 0
			print cxxguard,
			continue
	print line,
2013-12-06 03:35:32 +00:00
Kp aa7f36e3b7 Provide HUD prototypes in Descent 1 2013-10-29 03:24:42 +00:00
Kp 9c65aa3cc5 Move similar/main/gauges.c -> similar/main/gauges.cpp 2013-10-05 21:35:58 +00:00
Kp 584fc93f34 Move similar/main/automap.c -> similar/main/automap.cpp 2013-10-05 21:35:58 +00:00