Commit graph

9 commits

Author SHA1 Message Date
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 fbd35de5f0 Remove bogus fvi assertion 2013-12-28 22:40:11 +00:00
Kp 6cb6faf5ce Switch fvi to use a local visited_segment_bitarray_t 2013-12-22 20:56:55 +00:00
Kp 4460b16d0e Simplify visited check in sphere_intersects_wall
Non-segments can never be visited, so check for existence first.
2013-12-22 20:56:55 +00:00
Kp a7bd19a7ca Convert fvi to use countarray for segment list
Also fixes a bug where seglist could receive wrong elements when
fvi_sub recursive call returns a type other than HIT_NONE.  Bug caused
by badly named variables:

	int ii;
	for (ii=0;i < temp_n_segs && *n_segs < MAX_FVI_SEGS-1;)
		seglist[(*n_segs)++] = temp_seglist[ii++];

The wrong counter is used for first part of the conditional, so
uninitialized elements of temp_seglist could be read back if i
(==n_segs_visited) is smaller than temp_n_segs or elements could be
skipped if i is greater than temp_n_segs.
2013-12-22 20:56:53 +00:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp 5b0c4b10ac Use accessor for most get/set object->id accesses 2013-10-20 22:49:09 +00:00
Kp 6f152aa016 Move similar/main/fvi.c -> similar/main/fvi.cpp 2013-10-05 21:35:58 +00:00
Renamed from similar/main/fvi.c (Browse further)