Commit graph

10752 commits

Author SHA1 Message Date
Martin Fiedler 60edaa7dce fix invalid polymodels if words_need_alignment=1
If compiled with words_need_alignment=1, the
model data was correctly converted and expanded,
but the old size was still used for validating
and initializing the model.

This caused funky effects on affected platforms,
e.g. some robots missing their heads on Raspberry Pi.
2020-07-02 21:56:11 +02:00
Kp 1ce5054fc0 Merge 'refs/pull/517/head' into master 2020-07-02 03:07:17 +00:00
AlumiuN 4425f07e9d Prevent the destruction of one-sided prison doors from causing a crash 2020-06-30 21:40:09 +12:00
Kp 321c272920 Update snapshot ebuild 2020-06-27 17:37:50 +00:00
Kp aba40babb4 Switch pkg_postinst to call xdg_pkg_postinst
EAPI=7 disallows use of `default`.  According to chewi[1], an explicit
call of xdg_pkg_postinst is important.  Add that in place of default.

[1]: https://github.com/dxx-rebirth/dxx-rebirth/issues/502#issuecomment-644112338
2020-06-27 17:37:50 +00:00
Kp e5cae0f699 Remove unused g3_uninit_polygon_model 2020-06-22 00:36:45 +00:00
Kp 096a678ff7 Ignore effects with frame_time=0
If the effect is not ignored, then the game enters an infinite loop
because ec.time_left never increases.

Reported-by: murphy83 <https://github.com/dxx-rebirth/dxx-rebirth/issues/513>
2020-06-19 01:46:54 +00:00
Kp 6ffd62ff7c Update snapshot ebuild 2020-06-15 00:21:35 +00:00
Kp 0c2fcf691f Fix redundancy in package name
${SDL_version} already starts with the string "sdl", so specifying it
again in the package name is incorrect.

Reported-by: dr-diem <https://github.com/dxx-rebirth/dxx-rebirth/issues/502#issuecomment-643828214>
2020-06-15 00:21:35 +00:00
Kp 3a9bdbfa6e Use __slots__ for cached_property
Remove the redundant storage of the method's name, since it is only read
once in the getter.
2020-06-15 00:21:35 +00:00
Kp 8814776780 Use stack arrays for polygon texture mapping temporaries
Similar to 09eff19a66, _g3_draw_poly can
store the control information on the stack to avoid an allocation, since
the total size is bounded and relatively small.
2020-06-10 02:25:33 +00:00
Kp e25ecbb10c Increase multiplayer protocol version number
Cross-play between development builds from different commits is never
guaranteed.  Increase the protocol version number to force everyone to
sync up.  Github user D2Lovin reported that mixing users from two
snapshot builds behaved poorly, but went silent when prompted for more
information.  This bump will force users to synchronize, which is a good
idea on principle.

Related: https://github.com/dxx-rebirth/dxx-rebirth/issues/509
2020-06-10 02:25:33 +00:00
Kp c9508f3dda Use stack arrays for texture mapping temporaries #2
Similar to 09eff19a66, _g3_draw_tmap_2 can
store the control information on the stack to avoid an allocation, since
the total size is bounded and relatively small.
2020-06-10 02:25:33 +00:00
Kp 79e7143254 Reset autosave timer on game load 2020-06-10 02:25:33 +00:00
Kp 46d72a29c0 Retire compiler-begin.h
This was once a compatibility shim, but compiler support for std::begin
has been required since 5e434cbe95 and no
issues have been reported.  Flatten the include tree by removing this
header and using the STL names directly.
2020-06-10 02:25:32 +00:00
Kp 665713f315 Remove static inline declarations from fwd-partial_range.h
A declaration is useful if it declares an external function.  A static
inline declaration, if not followed by the definition later in the same
translation unit, will not be useful.  Remove such declarations, and
rely on using the definition as a declaration for those files that
actually call partial_range() or similar functions.
2020-06-10 02:25:32 +00:00
Kp fa7d8e2dea Use enum sound_effect for hardcoded sound index numbers 2020-06-10 02:25:32 +00:00
Kp 81819c5183 Check range for digi_mixer_find_channel
Avoid walking off the end if digi_mixer_max_channels is too large.
2020-06-10 02:25:32 +00:00
Andreas Müller c8ad243ec3 clipper.cpp: Fix build with gcc10
| common/3d/clipper.cpp:29:14: error: 'out_of_range' is not a member of 'std'

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
2020-06-09 22:23:48 +02:00
Kp 6212b914cb Adjust freedata ebuild to block pre-unification ebuilds 2020-06-02 03:14:30 +00:00
Kp 91a5956b11 Update snapshot ebuild 2020-05-31 23:04:25 +00:00
Kp 3b964351d9 Update ebuild for scons-utils PYTHON_COMPAT requirement 2020-05-31 23:04:25 +00:00
Kp 1ac12b9ead Update ebuild to EAPI=7 2020-05-31 23:04:25 +00:00
Kp 17b9edcd47 Enable -Wredundant-decls when possible
Add an inclusion of <SDL.h> since, for Windows targets, this triggers a
chain of includes that leads to <intrin.h>, which causes
-Wredundant-decls to print a diagnostic.  This allows Windows targets to
declare -Wredundant-decls as unusable, while enabling it for non-Windows
targets.
2020-05-31 23:04:25 +00:00
Kp 68b47307b4 Remove useless SDL_RWops precision test in SDL2
SDL2 increased the range of the seek type, so truncation is no longer a
concern.
2020-05-31 23:04:25 +00:00
Kp 5c30b467bb Move jukebox_load, jukebox_hook_next to dcx 2020-05-31 23:04:25 +00:00
Kp 81119f0445 Use enum class for LevelMusicPlayOrder 2020-05-31 23:04:25 +00:00
Kp 2e1e142767 Factor out sound_function_table_t where possible
Move it to namespace dcx when this does not cause a dcx->dsx dependency.
2020-05-31 23:04:25 +00:00
Kp d06ad449b8 Always ignore from_hog_only
This fixes PCX loading in the non-editor build.  PCX loading broke in
3114874713 because it switched from PHYSFSX_openReadBuffered to a call
which did not handle the presence of the marker byte in the filename.

The from_hog_only flag has not been properly supported since the
introduction of PHYSFSX_openReadBuffered in
8b323e7214.  Editor builds ignored it on
purpose, and non-editor builds pretended to respect it, only to then
ignore it down inside PHYSFSX_openReadBuffered.  For consistency with
code paths that do not use PHYSFSX_openReadBuffered, disable the bypass
in PHYSFSX_openReadBuffered and remove the code in show_title_screen
that applied the flag.

Reported-by: Jayman2000 <https://github.com/dxx-rebirth/dxx-rebirth/issues/510>
Fixes: 3114874713 ("Delegate PCX loading to SDL_image")
2020-05-28 03:21:22 +00:00
Kp b08620292d Fix input handling in automap
The automap code keeps a mostly-private secondary copy of control_info.
The change to reset control_info before the event loop reset the main
copy of control_info for the automap, not the copy that the automap
actually used.  Fix this by passing the desired control_info to relevant
functions instead of always using the global variable Controls.

Fixes: c621a970c6 ("Reset kconfig counters once, before the event loop")
2020-05-28 03:21:22 +00:00
Kp 511a3d6b9c Pump SDL events in batches 2020-05-27 03:07:17 +00:00
Kp ff50824418 Pass SDL events as const T *, not T * 2020-05-27 03:07:17 +00:00
Kp c621a970c6 Reset kconfig counters once, before the event loop 2020-05-27 03:07:17 +00:00
Kp 954a235d13 Discard decoded cockpit buffer when no longer needed 2020-05-27 03:07:17 +00:00
Kp 84fb6d499b Update snapshot ebuild 2020-05-23 00:31:37 +00:00
Kp 5a73a680f8 Change SRC_URI to download .tar.gz snapshots
Requested-by: dr-diem <https://github.com/dxx-rebirth/dxx-rebirth/issues/502#issuecomment-632475853>
2020-05-23 00:31:37 +00:00
Kp c8b44e2a2b Add convenience options to mk-ebuild-snapshot.bash
- -a: run `git add` on the new snapshot ebuild
- -n: only print the new ebuild, do not write it to disk
- -r: delete older snapshot ebuilds
2020-05-23 00:31:37 +00:00
Kp 5dbdc65ee6 Fix D2 crash on blank line in bitmaps.tbl
Reported-by: InsanityBringer <https://github.com/dxx-rebirth/dxx-rebirth/issues/464#issuecomment-632443732>
2020-05-22 02:40:26 +00:00
Kp c4c09963ae Use constexpr uint8_t for TRANSPARENCY_COLOR
This encourages std::fill_n to become memset.  When TRANSPARENCY_COLOR
is `#define`'d to 255, it is an integer literal of type `int`.
2020-05-22 02:40:26 +00:00
Kp 7b52b1fe1d Move grs_bitmap::avg_color into #if !DXX_USE_OGL
This field is used in the SDL build for rendering.  In the GL build, its
only purpose is for the editor to write it to a PIG file.  Change that
one use to compute the value as needed.  Move all other references
behind a preprocessor test for !DXX_USE_OGL.  This shrinks the size of
grs_bitmap by 1 pointer, since the compiler added padding after
avg_color up to the size of the next aligned pointer.
2020-05-22 02:40:26 +00:00
Kp 09eff19a66 Use stack arrays for texture mapping temporaries
The maximum length is small enough that stack arrays can easily handle
the largest values, and this avoids several heap allocations on a hot
path.
2020-05-22 02:40:26 +00:00
Kp 3d0f333b34 Unify object texture setup
Move the load of &GameBitmaps to the common loop used for paging in.
Add range checks on the loops.
2020-05-22 02:40:26 +00:00
Kp c1181b7be5 Move texture_list out of global scope 2020-05-22 02:40:26 +00:00
Kp 3d3db16c6f Move Canvas_width,Canvas_height to local scope 2020-05-22 02:40:26 +00:00
Kp 0b35d8e2ce Factor out std::max in event dispatching 2020-05-22 02:40:26 +00:00
Kp 727bc4b663 Flush events in bulk 2020-05-22 02:40:26 +00:00
Kp fe792055d6 Simplify current_music_t
Inherit unique_ptr instead of embedding it, so that its members can be
exposed via a `using` directive.
2020-05-22 02:40:26 +00:00
Kp b46ed29e82 Add PROPERTIES=live to 9999 ebuild
In issue #502, dr-diem mentioned adding PROPERTIES=live to the ebuild
that he planned to submit to Gentoo.  This looks like a good idea to
have in the ebuild tracked in the Rebirth source tree, so add it here
too.

Motivated-by: dr-diem <https://github.com/dxx-rebirth/dxx-rebirth/issues/502#issuecomment-629880896>
2020-05-18 00:08:16 +00:00
Kp bd3883ad73 Update snapshot ebuild 2020-05-17 23:35:26 +00:00
Kp 5c88587c01 Encourage std::fill to become memset
gcc has a special case to devolve to memset if both the pointed-at data
and the value to fill are considered a byte.  All uses of
DXX_POISON_MEMORY pass a value that fits in a byte, so change the
signature to be a byte, to encourage gcc to activate the special case.
2020-05-17 23:35:26 +00:00