Commit graph

8768 commits

Author SHA1 Message Date
Kp e05603b0d7 Fold kconfig_draw gr_string label calls 2016-10-15 00:53:15 +00:00
Kp 94202ff782 Fold D1 draw_automap calls to gr_string 2016-10-15 00:53:15 +00:00
Kp 88c73c010a Preserve type information on font-scaled floats 2016-10-15 00:53:15 +00:00
Kp 5bc17b90d2 Use range_for in draw_subtitles 2016-10-15 00:53:15 +00:00
Kp 21f8aec44d Remove unnecessary gr_set_fontcolor in kmatrix_draw_coop_names 2016-10-15 00:53:15 +00:00
Kp 71b87bceee Factor out kmatrix_redraw_coop calls to gr_find_closest_color 2016-10-15 00:53:15 +00:00
Kp 5873889b8b Factor out common parts of add_points_to_score 2016-10-15 00:53:15 +00:00
Kp f84de25e6b Expand kmatrix_draw_coop_item inline
kmatrix_draw_coop_item computes various values that are always the same
for every iteration of the calling loop.  Expand it inline in its one
caller so that the caller can cache those values.
2016-10-15 00:53:14 +00:00
Kp 8327d85c76 Remove unused get_multi_endlevel_poll1
The only caller for get_multi_endlevel_poll1 was DoEndLevelScoreGlitz,
which only called it on an unreachable path.  That path is now gone, so
remove get_multi_endlevel_poll1.
2016-10-15 00:53:14 +00:00
Kp e4e1799b57 Propagate DoEndLevelScoreGlitz argument network
All callers pass 0.  Remove the argument and update the logic that
tested it.
2016-10-15 00:53:14 +00:00
Kp fa620d5011 Make DoEndLevelScoreGlitz static 2016-10-15 00:53:14 +00:00
Kp 863e545461 Fix D1 editor build
The UI_DIALOG subclass changes missed one UI_DIALOG handler.

Fixes: db665d8c33 ("Allow dcx::UI_DIALOG struct to be subclassed - step 2")
2016-10-15 00:53:14 +00:00
Kp 1d563a9e03 Fix memory corruption during tracker initialization
Commit 63ca866 reduced the number of elements in UDP_Socket[] from (2 +
tracker) to (2), but added a write to UDP_Socket[2], which is now out of
bounds.  Fortunately, UDP_Socket[2] is never read.  Remove the
initialization of it.

Fixes: 63ca86698e ("Added communication for tracker written by A Future Pilot")
2016-10-15 00:53:14 +00:00
Kp deeb7def6e Reuse zeroed *_rw structure during save 2016-10-13 03:14:11 +00:00
Kp 7a18f60a94 Replace nd_read_short casts with an overload for uint16_t
Casting the type of the input overrides useful compiler checks.  Remove
all such casts and add an overload for uint16_t.
2016-10-12 02:16:29 +00:00
Kp 675fff5fec Replace nd_read_byte casts with an overload for uint8_t
Casting the type of the input overrides useful compiler checks.  Remove
all such casts and add an overload for uint8_t.
2016-10-12 02:16:29 +00:00
zico 63ca86698e Added communication for tracker written by A Future Pilot 2016-10-10 18:19:56 +02:00
zico 407805be42 Restored proper scaling of Min_trackable_dot by adding new function get_scaled_min_trackable_dot(). This was previously a fixed defintion based on Descent 1's result of Min_trackable_dot's scaling if FrameTime < F1_0/16 which did not properly reflect the intended result of Descent 2 nor did it properly align to different FrameTime/HOMING_TURN_RATE settings. get_scaled_min_trackable_dot() will scale the result accordingly for whatever fixed or variable time setting is given and respecting each game's individual scaling. 2016-10-10 15:37:25 +02:00
zico 9cab9e58c6 Fixed regression from e0785251c4 making the homing indicator go haywire if built without NEWHOMER defined 2016-10-10 14:23:45 +02:00
kreatordxx 05a2fd691d Merge pull request #233 from dxx-rebirth/allow_dialog_subclass
Allow UI_DIALOG to be subclassed
2016-10-10 14:43:54 +08:00
Chris Taylor bc1c9ebd97 Merge branch 'unification/master' into allow_dialog_subclass
Conflicts:
	common/arch/sdl/window.cpp - Remove unused EVENT_WINDOW_CLOSED and w_callback local var
	common/ui/dialog.cpp - Remove unused EVENT_WINDOW_CLOSED
2016-10-10 14:40:11 +08:00
Kp 1af65071d7 Remove unused EVENT_WINDOW_CLOSED
Every callee that recognized EVENT_WINDOW_CLOSED did so only to
explicitly ignore it.  Remove the code to send it and all sites that
ignored it.
2016-10-10 00:25:15 +00:00
Kp 8d98eb474e Move DXX_WORDS_NEED_ALIGNMENT to user settings
Previously, raspberrypi mode forced DXX_WORDS_NEED_ALIGNMENT on and any
other mode forced it off.  Add a specific user setting for
DXX_WORDS_NEED_ALIGNMENT.  Set its default as bool(raspberrypi) to
preserve the previous special case.
2016-10-09 17:35:03 +00:00
Kp 7cf9fc6dd9 Move endian handling into SConf
This allows per-target overrides, instead of a single global override as
the older method provided.
2016-10-09 17:35:03 +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 3cc73ee69d Fix similar/3d/interp.cpp useless+old-style casts in DXX_WORDS_BIGENDIAN path 2016-10-09 17:35:02 +00:00
Kp 9dc30c6499 Fix build when poison=None
Fixes: 03dbc96103 ("Switch DXX_HAVE_POISON to 0/1 instead of undef/defined")
2016-10-09 17:35:02 +00:00
Kp 8ebe98df6b Fix test for DXX_USE_UDP, DXX_USE_TRACKER
Fixes: 435aa5a020 ("Move USE_UDP to dxxsconf.h; rename to DXX_USE_UDP")
Fixes: 7c8c2b5aa4 ("Move USE_TRACKER to dxxsconf.h; rename to DXX_USE_TRACKER")
2016-10-08 23:24:22 +00:00
Kp 2d8928958d Fix some use_udp=0 build breaks
The build is still broken for use_udp=0.
2016-10-08 23:24:22 +00:00
Kp 65de22e4be Replace Int3 with con_printf(CON_URGENT) when loading bogus trigger 2016-10-08 23:24:22 +00:00
Kp af09257e2d Blank out most of object_rw when saving OBJ_NONE objects 2016-10-08 23:24:21 +00:00
Kp 5114b8f8b6 Fix object corruption loading save game
Saved games dump robot ai_local state for all objects, regardless of
whether the object is a robot.  Loading a game restored all ai_local
values, regardless of whether the object was a robot on restore.  This
caused memory corruption in objects that were not robots when the
`ctype.`_T_ for that object was large enough to overlap
`ctype.ai_info.ail`.

Fix this by loading the ai_local into a junk buffer when the object is
not a robot.  It would be better to skip over the bogus ai_local
entirely, but the structure of ai_local_read_swap makes that difficult.
Use the easy fix for now.
2016-10-08 23:24:21 +00:00
Kp b195b3077b Switch DXX_HAVE_POISON_VALGRIND to 0/1 instead of undef/defined 2016-10-08 23:24:21 +00:00
Kp 0ad0a57fea Switch DXX_HAVE_POISON_OVERWRITE to 0/1 instead of undef/defined 2016-10-08 23:24:21 +00:00
Kp 03dbc96103 Switch DXX_HAVE_POISON to 0/1 instead of undef/defined 2016-10-08 23:24:21 +00:00
Kp 1d09ca32ad Remove spurious 'u' after DXX_PRI_size_type uses 2016-10-08 18:02:34 +00:00
Kp d6f48dbd91 Prevent crash when level specifies invalid wall number
Kreator reports that "Pyramids of Luxoran" crashes due to a valptridx
sanity check.  The level incorrectly attempts to open a wall on a
segment/side which has no wall.

Add an error check and a con_printf suggesting that the level author
needs to fix the invalid trigger.
2016-10-08 18:02:34 +00:00
Kp 15a405cd4c Pass vcsegidx_t to exists*_in_mine 2016-10-08 03:34:17 +00:00
Kp e36939a30c Pass vcsegidx_t to create_bfs_list 2016-10-08 03:34:17 +00:00
Kp 31d2b5cfb2 Use correct get_*_id function for collide_robot_and_weapon 2016-10-07 02:08:56 +00:00
Kp 635b3f54e3 Downgrade matcen diagnostic from exception to con_printf(CON_URGENT)
Kreator reports that a level from back when Descent was new fails the
test for bogus matcen triggers.  This level cannot be played when that
test throws an exception, so downgrade the exception to a CON_URGENT
message.  This will hopefully deter level authors from creating any new
levels with this problem, but will allow users to play existing levels.
2016-10-06 02:08:07 +00:00
Kp ba2b8c05ba Fix crash on object_guidebot_cannot_reach
escort_get_goal_segment expected exists_in_mine to return object_none or
a valid object.  In some mines, exists_in_mine will return
object_guidebot_cannot_reach, which is neither object_none nor a valid
object.  Exclude reading the segment of the unreachable object.
2016-10-05 03:55:19 +00:00
Chris Taylor 9631d319f6 Allow dcx::UI_DIALOG struct to be subclassed - step 3
Allow dcx::UI_DIALOG struct to be subclassed step 3. This step adds the destructor and makes sure the dialog is only deleted within the main dialog handler if the specific handler didn't return window_event_result::deleted.
2016-10-04 16:09:21 +08:00
Chris Taylor db665d8c33 Allow dcx::UI_DIALOG struct to be subclassed - step 2
Allow dcx::UI_DIALOG struct to be subclassed step 2. Make all the UI_DIALOG handlers return a window_event_result like everyone else.
2016-10-04 15:58:20 +08:00
Chris Taylor 60ac1eaad3 Replace delete dcx::window kludge with a better solution
Replace delete dcx::window kludge with a better solution: instead of requiring every handler to delete the window, add a window_event_result::deleted, which gets returned if the window was deleted by the handler, so window_close knows not to attempt to delete it again.
2016-10-04 14:05:44 +08:00
Chris Taylor 4d9eb4e743 Allow dcx::UI_DIALOG struct to be subclassed - step 1
Allow dcx::UI_DIALOG struct to be subclassed step 1. This step renames and reconfigures untyped_ui_dialog_create in dialog.cpp to be the main constructor. Also adds a template constructor that allows an event handler that takes a subclass of UI_DIALOG.
2016-10-04 11:29:19 +08:00
Chris Taylor d4b85de49b Remove redundant checks for nullptr before deleting dcx::window instances in response to feedback. 2016-10-03 11:21:11 +08:00
Chris Taylor ca35a8091f Declare dcx::window with class keyword to clarify its intended use.
Also removes the need for the private keyword in the definition.
2016-10-03 11:15:22 +08:00
Chris Taylor 708cd027f0 Use member initialisation list for dcx::window constructor in response to feedback. 2016-10-03 11:10:11 +08:00
kreatordxx b87fcad332 Merge pull request #230 from dxx-rebirth/allow_window_subclasses_2
Allow window subclasses
2016-10-03 10:36:26 +08:00