Commit graph

57 commits

Author SHA1 Message Date
Kp 0ea22e1b9e Fix -Wshadow warnings in assign_uvs_to_side 2016-05-21 17:24:51 +00:00
Kp 2fd6a425b0 Remove highest_valid 2016-02-12 04:02:28 +00:00
Kp 98f5afa9f8 Remove default argument for basic_ptr(pointer,array &) 2016-01-09 16:38:13 +00:00
Kp e8c34be843 Use v*ptr* factories with highest_valid 2015-12-22 04:18:51 +00:00
Kp d479819931 Use absolute_sibling to reduce global references for ptridx 2015-12-22 04:18:51 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp ed55763603 Remove unused symbols 2015-12-04 03:36:31 +00:00
Kp bc7c469ab2 Use array<> for more globals 2015-08-12 03:11:46 +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 fa8dcc9113 Explicitly delete basic_ptridx(pointer_type); require array
Require the array argument for basic_ptridx, which is supplied
automatically when the factory is used.
2015-07-13 01:09:37 +00:00
Kp b07704ef45 Use valptr for seguvs highest_valid 2015-06-13 22:42:19 +00:00
Kp 150e2d2686 Convert local arrays to array<> 2015-04-19 04:18:49 +00:00
Kp c3b09da175 Simplify assign_light_to_side 2015-02-27 03:30:33 +00:00
Kp 291fc95fb1 Refactor and optimize assign_uvs_to_side
Use ?: to pick Stretch_scale_* value.
Mark bogosity as unlikely.
Cache vector subtraction.
Defer constructing rotation matrix.
Move uvl assignment into reusable lambda.

This also fixes clang build.  btb reports that clang chokes on:
	extern T t;
	extern const T ct;
	[]() {
		if (a)
			return ct;
		return t;
	}
with
    error: return type 'vms_matrix' must match previous return type 'const vms_matrix' when lambda expression has unspecified explicit return type

Compiler failure report: d38dd0aeef (commitcomment-9909178)
2015-02-27 03:30:33 +00:00
Kp 315f1ce815 Use array<> for Side_to_verts 2015-02-14 22:48:27 +00:00
Kp 078d9513e0 Pass end-of-list for ignore_obj_list 2015-02-05 03:03:51 +00:00
Kp 8f5e6df9a5 Use array<> for Side_to_verts 2015-02-05 03:03:50 +00:00
Kp 99a4a0ed62 Capture range_for by-value temporaries as const
Modifying a by-value temporary does not affect the underlying container,
so modifying it is almost always a bug.  Require use of a by-reference
capture when modification is desired.

sed -i -e 's/range_for\s*(\s*\(const\s\+\)\?auto\s\+\([[:alpha:]_]\)/range_for (const auto \2/g'
2015-02-05 03:03:49 +00:00
Kp d38dd0aeef Simplify assign_uvs_to_side error paths 2015-02-03 00:37:07 +00:00
Kp c8b5fe5552 Pass find_vector_intersection arg by & 2015-01-20 02:46:42 +00:00
Kp 2c349136cc Avoid slicing into segnum_t local 2014-11-20 03:00:36 +00:00
Kp 3a24b20e15 Add vm_vector_2_matrix that returns result 2014-11-04 01:27:55 +00:00
Kp 40eb2e6b01 Add vm_vec_scale_add that returns result 2014-11-02 03:43:57 +00:00
Kp 6d61198130 Pass compute_segment_center vector by & 2014-10-30 03:32:51 +00:00
Kp 5bb9c88979 Add vm_vec_sub that returns result 2014-10-29 03:24:31 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp 7f648c0f5f Wrap segment iteration idiom 2014-10-12 23:10:05 +00:00
Kp 02fd23f6af Pass player_is_visible_from_object arg by const & 2014-10-02 03:02:37 +00:00
Kp 99f681c8ea Pass vm_vector_2_matrix arg by & 2014-10-01 02:28:42 +00:00
Kp 1fff2db9a8 Pass vm_vec_dist_quick arg by & 2014-10-01 02:28:41 +00:00
Kp ac39749382 Pass vm_vec_dist arg by & 2014-10-01 02:28:41 +00:00
Kp 4104bf4f11 Pass vm_vec_scale_add arguments by & 2014-09-28 21:43:14 +00:00
Kp 0b2636d535 Pass vm_vec_add2 arguments by & 2014-09-28 21:43:00 +00:00
Kp ba0b91554c Remove vm_vec_dotprod -> vm_vec_dot redirect 2014-09-28 21:41:59 +00:00
Kp 00b59c3058 Pass vm_vec_dot arguments by & 2014-09-28 21:11:48 +00:00
Kp 321bbe37d8 Pass vm_vec_sub arguments by & 2014-09-28 21:11:45 +00:00
Kp a620a59bda Pass vm_vec_normalize_quick v by & 2014-09-28 21:11:04 +00:00
Kp a550673639 Pass vm_vec_normalize v by & 2014-09-28 21:11:03 +00:00
Kp 1e6bf36e20 Pass vm_vec_mag v by const& 2014-09-28 21:11:03 +00:00
Kp 7ddba1d15e Pass vm_vec_negate v by reference 2014-09-28 21:09:37 +00:00
Kp d312248d45 Return int_fast32_t from find_connect_side 2014-09-06 04:06:18 +00:00
Kp 2a3176dc98 Use array<> for segment members 2014-08-16 18:14:00 +00:00
Kp 125d9257be Use special type names for segment/object numbers 2014-08-13 02:57:12 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp 9a5d0f6f09 Use symbolic values for segment/object first/none 2014-01-06 04:17:55 +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 203b85a0b1 Make Edge_between_sides static const 2013-11-28 00:27:43 +00:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp 547f5e33d2 Remove unused function compress_uv_coordinates_in_segment 2013-10-29 03:24:43 +00:00
Kp b0552d37c2 Remove unused function compress_uv_coordinates_all 2013-10-29 03:24:43 +00:00