Commit graph

49 commits

Author SHA1 Message Date
Kp 7e36beb30c Move polymodel alignment code to interp.cpp
This makes the alignment data structure `chunk` private to interp.cpp,
and allows most files to ignore whether DXX_WORDS_NEED_ALIGNMENT is
enabled, thus improving the ccache hit rate.
2020-07-05 23:34:33 +00:00
Kp e5cae0f699 Remove unused g3_uninit_polygon_model 2020-06-22 00:36:45 +00:00
Kp 8839f538e0 Refer to <array> directly, not through "compiler-array.h" 2020-05-02 21:18:42 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 87125c5053 Fix Descent 1 laser color
Descent 1 mangles colors during `g3_init_polygon_model`, so this must
not be called on polygons not designed for mangling.  Rearrange the
logic to allow Descent 1 to verify that polygon models are well-formed
without using the functions that mangle the colors.

Fixes: 42a2e3ab0b ("Avoid crash loading polymodels with invalid subcalls")
Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/416>
2019-03-20 03:57:15 +00:00
Kp 42a2e3ab0b Avoid crash loading polymodels with invalid subcalls
Truncate the model at the first error.  This allows the level to load,
but makes some or all of the model invisible.
2019-03-06 05:03:48 +00:00
Kp 12b57e84e6 Switch most in-tree http:// links to https://
For each link given as http://, verify that the site is accessible over
https:// and, if so, switch to it.  These domains were converted:

* llvm.org
* clang.llvm.org
* en.cppreference.com
* www.dxx-rebirth.com
* www.libsdl.org
* www.scons.org
2018-09-02 00:57:29 +00:00
Kp 88832e3679 Use constexpr integral_constant for various magic numbers 2017-10-14 17:10:30 +00:00
Kp 262d6c6c27 Pass canvas to g3_draw_morphing_model 2017-03-11 19:56:27 +00:00
Kp 85da2c0013 Pass canvas to g3_draw_polygon_model 2017-02-11 21:42:40 +00:00
Kp b7bbe21e4d Add const to interpreter model_bitmaps 2017-02-11 21:42:40 +00:00
Kp b02375bfbd Rename WORDS_NEED_ALIGNMENT to DXX_WORDS_NEED_ALIGNMENT
Rename symbol WORDS_NEED_ALIGNMENT to DXX_WORDS_NEED_ALIGNMENT to show that it is a DXX
symbol, not one inherited from a library.

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

git grep -wl WORDS_NEED_ALIGNMENT -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(WORDS_NEED_ALIGNMENT\)\>/#if DXX_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(WORDS_NEED_ALIGNMENT\))/#\1if \2DXX_\3/' -e 's/^\s*#ifndef \(WORDS_NEED_ALIGNMENT\)\>/#if !DXX_\1/'
2016-10-09 17:35:03 +00:00
Kp cd4e5441ba Rename WORDS_BIGENDIAN to DXX_WORDS_BIGENDIAN
Rename symbol WORDS_BIGENDIAN to DXX_WORDS_BIGENDIAN to show that it is a DXX
symbol, not one inherited from a library.

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

git grep -wl WORDS_BIGENDIAN -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(WORDS_BIGENDIAN\)\>/#if DXX_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(WORDS_BIGENDIAN\))/#\1if \2DXX_\3/' -e 's/^\s*#ifndef \(WORDS_BIGENDIAN\)\>/#if !DXX_\1/'
2016-09-30 01:49:57 +00:00
Kp 99bbd0cf26 Mark global constants as constexpr
s/^const \([^*]*=.*;\)/constexpr \1/
2016-07-23 04:10:42 +00:00
Kp c636dc4b98 Convert various static const expressions to constexpr 2016-07-16 16:52:04 +00:00
Kp 59750d3c29 Rewrite declarations of ubyte * to standard uint8_t * 2016-07-14 01:59:02 +00:00
Kp 27cef20eb3 Move namespace dsx handling to dsx-ns.h 2016-03-19 19:08:10 +00:00
Kp 8e86a3586d Use #ifdef dsx to guard dsx namespace 2016-01-09 16:38:15 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp dc8c0323d8 Uninline namespace dcx 2015-12-13 18:00:49 +00:00
Kp 32051298ae Use inline namespace dcx/dsx for more symbols 2015-12-13 18:00:48 +00:00
Kp d4857f4257 Use inline namespace dsx for similar/3d 2015-12-13 18:00:48 +00:00
Kp fcab519693 Remove extern for vms_vector_swap
It is only used in the interpreter.
2015-09-19 23:04:36 +00:00
Kp b626ca67e7 Combine game-specific preprocessor blocks
Change:

	#ifdef D1
	x;
	#endif

	...

	#ifdef D1
	y;
	#endif

to:

	#ifdef D1
	x;
	y;
	#endif
	...
2015-09-19 23:04:35 +00:00
Kp ce72014e2e Always parse WORDS_BIGENDIAN and !WORDS_BIGENDIAN 2015-06-13 22:42:21 +00:00
Kp 3a37b41192 Fix startup trap with D1 shareware data
D1 shareware models handle textures in a way that requires starting
highest_texture_num at -1.

Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/46>
Fixes: 68be3baeca ("Track highest_texture_num locally")
2015-03-20 03:30:20 +00:00
Kp 68be3baeca Track highest_texture_num locally 2015-02-28 22:34:06 +00:00
Kp 77ec36b9c3 Convert g3_draw_morphing_model to class 2015-02-28 22:34:05 +00:00
Kp c080f65e81 Convert g3_draw_polygon_model to class 2015-02-28 22:34:05 +00:00
Kp 0ec4a876c5 Convert g3_poly_get_color to class 2015-02-28 22:34:05 +00:00
Kp 2fa2e17a82 Make chunk.old_base const 2015-02-22 01:29:43 +00:00
Kp d1f45f85b2 Wrap submodel angles 2015-02-14 22:48:28 +00:00
Kp 2daaacaa26 Move robot_points onto stack 2015-02-05 03:03:50 +00:00
Kp 6b767c3a03 Remove various #include "gr.h" 2015-01-29 04:27:36 +00:00
Kp 9f44ccbbf3 Fix WORDS_NEED_ALIGNMENT build of interp.cpp 2014-12-19 02:19:29 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp 69c052ccf6 Pass vms_vector_swap arg by & 2014-10-26 22:08:58 +00:00
Kp a42a403198 Remove unused return value of g3_draw_morphing_model 2014-08-16 17:35:44 +00:00
Kp 0228b067c1 Remove unused return value of g3_draw_polygon_model 2014-08-16 17:35:44 +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 038bbad26a Rearrange headers to build under all test modes 2013-12-22 20:56:35 +00:00
Kp 1e8036bd24 Split compiler.h for PCH compatibility 2013-12-21 05:12:38 +00:00
Kp aba6c2dfee Pass glow_values as array<> to retain size information 2013-12-19 03:31:24 +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 4863c42c9d Move similar/3d/interp.c -> similar/3d/interp.cpp 2013-10-01 02:53:09 +00:00
Kp a881ee455e Remove fix.h 2013-08-08 03:01:48 +00:00
Kp 4577dd3977 Merge branch 'd2x-rebirth/master' into unification/master 2013-07-21 21:34:46 +00:00
Kp 30c7274c17 Move d2x-rebirth/include/interp.h -> common/include/interp.h
Prior to the Bazaar import, an unidentified committer moved some
function declarations from 3d.h to interp.h, but only for Descent II.
Replicate those changes in Descent I, and move the Descent II header
interp.h to become common.
2013-03-03 01:03:33 +00:00
Renamed from d2x-rebirth/include/interp.h (Browse further)