Commit graph

34 commits

Author SHA1 Message Date
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 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 8eab601e44 Make digi_sync_sounds objp const 2015-07-10 03:22:26 +00:00
Kp 5cc38ea06c Pass vcsegptridx to digi_link_sound_to_pos 2015-05-28 03:08:39 +00:00
Kp ae8b99ae7d Use RAIIdigi_sound for briefing printing_channel 2015-04-02 02:36:55 +00:00
Kp 91d31b1952 Wrap object signature in subtype 2015-03-22 18:49:21 +00:00
Kp c5f6a115ec Add <stdexcept> for files that throw std::runtime_error 2015-03-22 04:16:49 +00:00
Kp 2458078987 Skip digi_sync_sounds loop if !Viewer
If a sound is used, it may dereference Viewer.  If Viewer is null, this
will crash.  In 630f11945e,
digi_sync_sounds changed to assume Viewer is valid.  This crashes during
early startup when not using the SDL_mixer backend, even though no
sounds are in use.

Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/45>
Fixes: 630f11945e ("Cache Viewer in digiobj")
2015-03-15 18:52:52 +00:00
Kp 2c09f9fa90 Propagate special types for distance/magnitude 2015-03-12 02:21:19 +00:00
Kp 4f11c2516f Add convenience methods fix_sin, fix_cos 2015-02-05 03:03:50 +00:00
Kp 630f11945e Cache Viewer in digiobj 2014-12-18 04:12:38 +00:00
Kp 1a96bf7f2f Use range_for for SoundObjects 2014-12-14 05:22:59 +00:00
Kp cf97b028b7 Pass digi_start_sound_object arg by & 2014-12-14 05:22:59 +00:00
Kp 80aa48efb4 Pass digi_*_start_sound soundobj as sound_object* 2014-12-14 05:22:59 +00:00
Kp 9ea8c8d7f1 Mark digi variables static 2014-12-13 17:47:10 +00:00
Kp a622aecd58 Pass vcobjptridx_t to digi_ functions 2014-12-13 17:47:06 +00:00
Kp 53366488ac Remove unused digi_set_volume 2014-12-11 02:34:38 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp 9dea4b4d88 Pass sound vms_vector arg by & 2014-10-26 21:33:50 +00:00
Kp a32547af16 Pass position-related vms_vector arg by & 2014-10-22 02:46:03 +00:00
Kp b26f385b0e Pass vm_vec_delta_ang_norm arg by & 2014-10-01 02:28:42 +00:00
Kp 73545f1dab Pass vm_vec_normalized_dir_quick arg by & 2014-10-01 02:28:41 +00:00
Kp 02e2e77ee6 Tighten processing of WALL_IS_DOORWAY flags 2014-09-06 22:26:11 +00:00
Kp 125d9257be Use special type names for segment/object numbers 2014-08-13 02:57:12 +00:00
Kp 5a90ab4197 Reduce reindexing of SoundObjects 2014-07-14 02:17:40 +00:00
Kp cb1337f8ae Switch digi_unxlat_sound to throw on error 2014-07-14 02:17:40 +00:00
Kp 08d72ae525 Mark find_connected_distance vms_vector const 2014-07-13 22:57:45 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp 094dfbf3d4 Reduce header inclusions 2013-12-31 03:22:03 +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 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp 02bba815ee Remove unused digi_sound_debug 2013-10-29 03:24:42 +00:00
Kp c7e34f5330 Move similar/main/digiobj.c -> similar/main/digiobj.cpp 2013-10-05 21:35:58 +00:00
Renamed from similar/main/digiobj.c (Browse further)