Commit graph

111 commits

Author SHA1 Message Date
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 88430e8946 Require vms_angvec &for g3_start_instance_angles
Only one caller exists, and that caller alway passes a non-nullptr
value.  Switch to a reference and remove the unused special case to
handle a nullptr input.
2017-08-26 19:47:51 +00:00
Kp 79e4e0a628 Raise MAX_POINTS_PER_POLY to 64
Past releases had a debug-only assertion that 25 was sufficient, but
then dynamically allocated enough storage for larger models as needed.
Commit 22a34809ee ("Move interpreter g3s_lrgb onto stack") added a
hard limit of 25, but did not detect attempts to exceed this.  Custom
models that exceeded 25 would cause a stack buffer overwrite and likely
crash.  Raise the limit to 64 and add sanity checking to refuse to
render models that exceed MAX_POINTS_PER_POLY.

Fixes: 22a34809ee ("Move interpreter g3s_lrgb onto stack")
2017-06-07 02:44:55 +00:00
Kp 262d6c6c27 Pass canvas to g3_draw_morphing_model 2017-03-11 19:56:27 +00:00
Kp 0d5d2e77a8 Pass canvas to g3_check_and_draw_poly 2017-02-11 21:42:42 +00:00
Kp c732c35916 Pass canvas to g3_draw_poly 2017-02-11 21:42:41 +00:00
Kp 85da2c0013 Pass canvas to g3_draw_polygon_model 2017-02-11 21:42:40 +00:00
Kp 0c0026ef1b Pass canvas to g3 interpreters 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 394d9e1b80 Pass canvas to g3_draw_rod_tmap 2017-02-11 21:42:40 +00:00
Kp 6a2f3c1321 Pass canvas to g3_draw_tmap 2017-02-11 21:42:39 +00:00
Kp fe50c0a20a Factor out point_list setup 2017-01-01 00:45:45 +00:00
zico daad12106d Fixed texture malformations of op_tmappoly in g3_draw_morphing_model_state(). 2016-12-30 14:49:40 +01:00
zico 34b24c0d69 Fixed regression from d1x-rebirth 0.57.3: Properly read out flat poly color for morph models from model data 2016-12-04 21:21:49 +01: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 3cc73ee69d Fix similar/3d/interp.cpp useless+old-style casts in DXX_WORDS_BIGENDIAN path 2016-10-09 17:35:02 +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 56e4f6b6f7 Factor out set_color_by_model_light color
Optimizing compilers tend to factor out color automatically.  Move it up
to the caller to ensure that it is computed once even if the compiler
does not optimize aggressively.
2016-09-26 00:50:09 +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 0e5e1a68a9 Switch interp.cpp to static_cast 2016-09-04 00:02:52 +00:00
Kp c636dc4b98 Convert various static const expressions to constexpr 2016-07-16 16:52:04 +00:00
Kp b282bea173 Rewrite simple integer casts from C style to static_cast<>
This pass only targets commonly used standard types.

s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\)\s*)\s*(/static_cast<\1>(/g
2016-06-05 01:04:26 +00:00
Kp 7fdce88558 Add parentheses around target of simple casts
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of simple C casts.

This pass does not attempt to process expressions that involve
any subexpression that can nest arbitrarily, such as parentheses or
brackets.  It also works only on commonly used standard types.

	(int) a->b;	// changed
	(int) a[b];	// not changed

s/\((\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\s*\**\s*)\s*\)\([&+-]\?\)\([[:alnum:]_.]\+\s*->\s*\)*\([[:alnum:]_.]\+\)\(\s*\([];+>)*\/^%,|&<>]\)\|$\|\(\s*-\s*[^>]\)\)/\1(\5\6\7)\8/g
2016-06-05 01:04:25 +00:00
Kp 604778248d Fix -Wshadow warning in get_chunks_state
get_chunks_state has a member named `data` and its constructor took a
parameter named `data`.  This is unambiguous in the language, but causes
a warning from gcc's -Wshadow when building with WORDS_NEED_ALIGNMENT.
Rename the parameter to eliminate the warning.

Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/pull/196>
2016-05-29 17:46:32 +00:00
Kp daaad3b049 Factor out 3d interpreter functions 2016-03-19 19:08:10 +00:00
Kp 27cef20eb3 Move namespace dsx handling to dsx-ns.h 2016-03-19 19:08:10 +00:00
Kp 4a5b2c0999 Remove morphing model stub glow_num support
Simplify the code by removing the dead path.
2016-03-04 04:12:35 +00:00
Kp f4e1ebb576 Remove unnecessary gr_setcolor calls 2016-02-12 04:02:28 +00:00
Kp 1b4b6673ee Pass color to g3_draw_poly 2016-02-12 04:02:28 +00:00
Kp d2d9d2bf5a Unify op_flatpoly color setup 2016-02-12 04:02:28 +00:00
Kp 70ffee39cd Use namespace dcx for WORDS_BIGENDIAN/WORDS_NEED_ALIGNMENT functions
Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/pull/171>
Fixes: 32051298ae ("Use inline namespace dcx/dsx for more symbols")
2015-12-23 03:28:17 +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 d4857f4257 Use inline namespace dsx for similar/3d 2015-12-13 18:00:48 +00:00
derhass 85691b3784 Restore inclusion of byteutil.h in similiar/3d/interp.cpp
4a84320817b9e02f86f3ec2dd2678e3367cddcc removed lots of inclusions of
byteutil.h in various source files. However, when building with
WORDS_NEED_ALIGNMENT, interp.cpp makes use of the INTEL_SHORT and
GET_INTEL_SHORT macros defined there.

Fixes: c4a8432081  ("Remove WORDS_NEED_ALIGNMENT memcpy src cast to const uint8_t*")
2015-09-29 18:36:01 +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 c4a8432081 Remove WORDS_NEED_ALIGNMENT memcpy src cast to const uint8_t*
The cast provokes a warning on systems that require alignment, so remove
it.  memcpy takes const void* input, so the cast is unnecessary.

Reported-by: MattWatt <https://github.com/dxx-rebirth/dxx-rebirth/issues/119>
2015-09-13 21:02:19 +00:00
Kp 3905f1a668 Enable -Wcast-qual 2015-06-13 22:42:21 +00:00
Kp ae604225c8 Fix gcc-4.6 interpreter build
gcc-4.6 chokes on `static constexpr type value{};`, but accepts
`static constexpr auto value = type{};`

Fixes: 77ec36b9c3 ("Convert g3_draw_morphing_model to class")
2015-05-22 03:33:19 +00:00
Kp 6792c1bc4b Enable -Wunused-parameter 2015-04-26 20:15:56 +00:00
Kp 3da71f79cc Move WORDS_BIGENDIAN functions into #ifdef guard 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 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 cb83156132 Fix -O0 build
btb reports that clang fails to link
<77ec36b9c3 (commitcomment-9992820)>.
When building at -O0, static member glow_num has its address referenced
because the compiler does not inline non-static method
glow_num_stub::operator=.  Add a definition of this symbol.

Fixes: 77ec36b9c3 ("Convert g3_draw_morphing_model to class")
2015-03-03 04:36:16 +00:00
Kp 14530d43ea Guard g3d_interp_outline by defined(EDITOR) 2015-02-28 22:34:07 +00:00
Kp 2397bc9a02 Cache &Polygon_models[N_polygon_models] 2015-02-28 22:34:07 +00:00
Kp 86800b1515 Simplify op_sortnorm 2015-02-28 22:34:06 +00:00
Kp 68be3baeca Track highest_texture_num locally 2015-02-28 22:34:06 +00:00
Kp 87516a5b1b Always update glow_num
If !glow_values, the update will be ignored later.
2015-02-28 22:34:06 +00:00