Commit graph

35 commits

Author SHA1 Message Date
Kp 88832e3679 Use constexpr integral_constant for various magic numbers 2017-10-14 17:10:30 +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 f0707cb9bd Pass canvas to draw_powerup 2017-03-11 19:56:26 +00:00
Kp 6a3ded191f Move EDITOR to dxxsconf.h; rename to DXX_USE_EDITOR
Rename symbol EDITOR to DXX_USE_EDITOR to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
2016-09-11 18:49:16 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp fee76e6ced Define Powerup_names only if EDITOR 2016-07-09 17:58:34 +00:00
Kp a4967ffceb Move various robot data into namespaces 2016-06-25 23:21:36 +00:00
Kp 89eb173013 Move draw_object_blob to namespace dcx 2016-04-06 03:34:14 +00:00
Kp c3003fbb22 Fix vulcan ammo display
Do not abuse `f2i` to shift an unsigned quantity.  `f2i` is defined to
work on `fix`, which is `int`.
2016-02-20 17:28:11 +00:00
Kp 86709f547b Fix capitalization of PHYSFS_File
Per comment in physfs.h, the spelling PHYSFS_file is deprecated.
Replace all instances with PHYSFS_File.
2016-01-09 16:38:14 +00:00
Kp bb41075adb Add preprocessor guards around types that vary by game 2015-11-26 02:56:55 +00:00
Kp 2196008178 Move fwdobject.h -> fwd-object.h for consistency 2015-10-10 03:44:14 +00:00
Kp d971cf7702 Wrap game-specific types in game-specific preprocessor guards
These types are not used in common code, and in some cases would provoke
a -Wodr warning if they were used.
2015-09-26 21:17:12 +00:00
Kp 946048c54b Move valptridx subtypes to individual fwd headers 2015-08-22 20:43:04 +00:00
Kp b88c232f9f Use powerup_type_t for *_weapon_to_powerup 2015-04-19 04:18:53 +00:00
Kp c20cfc02cb Remove unused D1 definition of POW_FULL_MAP 2015-04-19 04:18:52 +00:00
Kp 4240017193 Remove unused D1 definition of POW_HEADLIGHT 2015-04-19 04:18:49 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp b95759aecc Propagate use of objptridx 2014-08-23 23:53:56 +00:00
Kp 66cb80c343 Propagate use of objptridx 2014-08-17 20:31:18 +00:00
Kp f6631ce742 Unpack various structures
Prohibit conversion to void* to avoid accidental use with memcpy
2014-06-21 23:56:27 +00:00
Kp 93ec327a10 Write powerup_type_info structures carefully 2014-06-14 23:13:37 +00:00
Kp 7c62bf98ef Use array<> for Powerup_info 2014-06-14 01:15:33 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp a2427f58b5 Use special type to reduce pointer/index conversions 2014-01-12 19:32:12 +00:00
Kp e402b0ee51 Pass objptridx_t to draw_powerup 2014-01-12 00:33:33 +00: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 038bbad26a Rearrange headers to build under all test modes 2013-12-22 20:56:35 +00:00
Kp c28d0c984c Combine nearby d1/d2 guard in powerup.h 2013-12-22 20:56:35 +00:00
Kp be742f8848 Use powerup_basic_str instead of powerup_basic where possible 2013-12-17 04:03:34 +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 06c83c9393 Move similar/main/gamecntl.c -> similar/main/gamecntl.cpp 2013-10-05 21:35:58 +00:00
Kp ff90315978 Use SConscript configure support to probe for format(printf) attribute 2013-07-27 22:17:13 +00:00
Kp b87e7c2325 Merge branch 'd2x-rebirth/master' into unification/master 2013-06-02 20:14:42 +00:00
Kp 0866e9c7fd Move */main/powerup.h -> common/main/powerup.h 2013-03-03 01:03:33 +00:00
Renamed from d2x-rebirth/main/powerup.h (Browse further)