Commit graph

873 commits

Author SHA1 Message Date
Kp 8582907b91 Reduce ai.h includes 2015-04-19 04:18:51 +00:00
Kp 4e937ae239 Reduce playsave.h includes
Move non-common includes into defined(D1||D2)
2015-04-19 04:18:50 +00:00
Kp 9d213b5282 Wrap player_has_weapon return type 2015-04-19 04:18:50 +00:00
Kp 9751022b1b Use static_assert for player_rw size check 2015-04-19 04:18:50 +00:00
Kp 4240017193 Remove unused D1 definition of POW_HEADLIGHT 2015-04-19 04:18:49 +00:00
Kp 150e2d2686 Convert local arrays to array<> 2015-04-19 04:18:49 +00:00
Kp 32b4b8f0bb Use enum class for level save/load 2015-04-19 04:18:49 +00:00
Kp e99a9236cf Avoid redundant vsegptridx calculation in object_move_one 2015-04-11 04:01:29 +00:00
Kp efc5b071de Remove object_rw::pad, pad2
The presence of these fields breaks network compatibility between
aligned and unaligned users.  Removing these fields breaks the ability
to use aligned savegames.  Per discussion in
<fdaa09d7f9>,
this is acceptable to clean up the code.

Reported-by: derhass <http://www.dxx-rebirth.com/frm/index.php/topic,1986.msg21232.html>
Approved-by: zico <fdaa09d7f9 (commitcomment-10575014)>
2015-04-04 23:20:12 +00:00
Kp a9c81c5614 Move Weapon_is_energy to collide.cpp 2015-04-02 02:36:57 +00:00
Kp 5ae5033fed Use enum for AIB constants 2015-04-02 02:36:57 +00:00
Kp 6b6eaef226 Include polyobj.h from robot.h
Swap the inclusion order since all robots are polyobjects, but not all
polyobjects are robots.
2015-04-02 02:36:57 +00:00
Kp 2f86499144 Remove do_cockpit_window_view unused parameters 2015-04-02 02:36:57 +00:00
Kp b0ec49f8e5 Remove unused file+line from get_seg_masks 2015-04-02 02:36:56 +00:00
Kp aa75a398d9 Move Wall_names to dumpmine.cpp 2015-04-02 02:36:56 +00:00
Kp ae8b99ae7d Use RAIIdigi_sound for briefing printing_channel 2015-04-02 02:36:55 +00:00
Kp 6a4c7ed78e Inline away D1 secret_restore values 2015-04-02 02:36:53 +00:00
Kp face692126 Narrow D2 previous_visibility to uint8_t 2015-04-02 02:36:53 +00:00
Kp 6757b2178b Narrow D2 rapidfire_count to uint8_t 2015-04-02 02:36:53 +00:00
Kp bb10d350f4 Narrow D2 consecutive_retries to uint8_t 2015-04-02 02:36:53 +00:00
Kp a36603826a Narrow D2 retry_count to uint8_t 2015-04-02 02:36:53 +00:00
Kp 9157e5f970 Use enum class for player_awareness_type_t 2015-04-02 02:36:53 +00:00
Kp 90fbebf8fd Convert most global arrays to array<> 2015-04-02 02:36:52 +00:00
Kp 66a70fd373 Prepare for global arrays to be array<> 2015-04-02 02:36:52 +00:00
Kp 6e96ff3e00 Fix ambiguous use of INTEL_SHORT/INTEL_INT 2015-04-02 02:36:52 +00:00
Kp 598a5e42a2 Allow granting items at player spawn 2015-03-28 17:18:02 +00:00
Kp da3cb31a0e Refactor powerup allow code 2015-03-28 17:18:02 +00:00
Kp b32d1c76c9 Move powerup size reset into set_powerup_id 2015-03-28 17:18:02 +00:00
Kp 12ad357b8d Move Wimp Menu to macro 2015-03-28 17:18:02 +00:00
Kp 0707664ae1 Use enum for kmatrix_view result 2015-03-24 02:07:42 +00:00
zico 8d686ab23b implemented return value for kmatrix_view() so we can properly bail out of the game loop in AdvanceLevel() 2015-03-23 03:03:22 +01:00
Kp d63be36fb3 Fix bogus trap on remote_owner check
Some call sites pass a uint8_t to objnum_remote_to_local, which is
zero-extended up to an int.  The check for owner==-1 then fails, causing
the sanity check to trap to the debugger, even though the situation is
normal and harmless.  Switch the type to int8_t to ensure that the value
is not sign/zero-extended.
2015-03-22 22:48:47 +00:00
Kp 91d31b1952 Wrap object signature in subtype 2015-03-22 18:49:21 +00:00
Kp ce028fc843 Move Object_type_names to dumpmine 2015-03-22 18:49:21 +00:00
Kp 7840885473 Fix clang -Wparentheses-equality warnings 2015-03-22 18:49:21 +00:00
Kp 65ff319ebb Use ntstring for LastMission 2015-03-22 18:49:20 +00:00
Kp af7b08abac Convert some GameCfg flags to bool 2015-03-22 18:49:20 +00:00
Kp 3da8a85ec3 Remove constexpr on rgb_array_wrapper::operator[]
OS X clang (but not Linux clang) rejects constexpr
on rgb_array_wrapper::operator[].

Reported-by: btb <b414758505 (commitcomment-10330686)>
Fixes: b414758505 ("Add stub for player color remapping")
2015-03-21 21:11:12 +00:00
Matt Vandermeulen a59daa64c6 ಠ_ಠ 2015-03-20 17:31:22 -04:00
Kp e1ff8afc88 Use ntstring for newmenu_item saved_text 2015-03-12 02:21:21 +00:00
Kp d1b60c2324 Pass uint_fast32_t for newmenu_* items 2015-03-12 02:21:21 +00:00
Kp 2c09f9fa90 Propagate special types for distance/magnitude 2015-03-12 02:21:19 +00:00
Kp b414758505 Add stub for player color remapping 2015-03-09 03:33:07 +00:00
Kp 72a01bf56c Add indirection for player color lookup 2015-03-09 03:33:07 +00:00
Kp a84a05c701 Move graphics menu to macro 2015-03-07 17:20:41 +00:00
Kp 7349a90cc8 Remove unused multi_send_message_dialog 2015-03-03 04:36:16 +00:00
Kp 335780758b Remove unused DXX_*_INPUT argument MAX_TEXT_LEN 2015-02-28 19:36:02 +00:00
Kp 3dfac8350e Use array<> for robot_info 2015-02-28 19:36:01 +00:00
Kp a9a330bf3f Use array<> for expl_wall_list
Fixes: 125d9257be ("Use special type names for segment/object numbers")
2015-02-28 19:36:01 +00:00
Kp b940ca0510 Use array<> for bogus_data 2015-02-28 19:36:01 +00:00
Kp 8ad180c0a2 Use array<> for Reactors 2015-02-28 19:36:01 +00:00
Kp 1580a274f2 Use array<> for net_udp buffers 2015-02-28 19:36:01 +00:00
Kp a65533d477 Remove unused delta_light dummy 2015-02-28 19:36:01 +00:00
Kp 0ad02ad975 Remove unused piggy_game_bitmap_name 2015-02-28 19:36:01 +00:00
Bradley Bell 1c2746ae45 Make constructor and overloads for cvar_t 2015-02-23 23:31:41 -08:00
Bradley Bell 44dace6a49 Make cvar names const 2015-02-23 23:31:40 -08:00
Bradley Bell eaf11884e2 simplify struct declaration 2015-02-23 23:31:40 -08:00
Bradley Bell 45d31b6d57 Replace cvar.archive with flags.
Add cheat flag.
2015-02-23 20:44:20 -08:00
Bradley Bell df3ce9953f Merge branch 'unification/master' into command-line 2015-02-22 19:25:04 -08:00
Bradley Bell a838e08431 use hash for cvar list 2015-02-22 13:29:07 -08:00
zico afd70564e5 Gave client address as player_address for all UPID_SYNC packets so clients can properly discover their player number when (re)joining running games. Defined 0xcc as MULTI_PNUM_UNDEF for purpose of uninitialized Multiplayer client slots. 2015-02-22 01:41:02 +01:00
zico eef3dc03a7 Due to flexible size of game/lite info packets only check for maximum size of these packets 2015-02-21 18:21:34 +01:00
Kp f2fb31a120 Merge 'D1 emulation issues' into unification/master
Requested by btb: https://github.com/dxx-rebirth/dxx-rebirth/pull/38
2015-02-20 03:00:46 +00:00
Bradley Bell 0191bf451f miscellaneous fixes 2015-02-17 02:27:15 -08:00
Bradley Bell b14f6031f5 simplify help system 2015-02-16 13:34:13 -08:00
Kp 2c63744fd3 Use array<> for jointlist 2015-02-14 22:48:30 +00:00
Kp 68e2168377 Use array<> for bitmap_index arrays 2015-02-14 22:48:30 +00:00
Kp 40b8bc1a06 Remove unused flag ammo
spit_powerup never sets ammo
2015-02-14 22:48:30 +00:00
Kp 93e01f71fd Remove unused Player_num from MULTI_DROP_FLAG 2015-02-14 22:48:29 +00:00
Kp 5212daa4ad Fix seismic duration sync 2015-02-14 22:48:29 +00:00
Kp 29236f8668 Use array<> for multi_player_textures 2015-02-14 22:48:29 +00:00
Kp bbb9a23697 Convert {GET,PUT}_INTEL_{SHORT,INT} to C++ casts 2015-02-14 22:48:29 +00:00
Kp 0b3bb6397e Make DXX_VERSION_*i be uint16_t 2015-02-14 22:48:29 +00:00
Kp 8ddab68448 Remove unused MULTI_DROP_WEAPON field player 2015-02-14 22:48:29 +00:00
Kp 7bf56a7d69 Add compile-time check on multi message sizes 2015-02-14 22:48:28 +00:00
Kp 004e1371d6 Split valid/nonvalid cases of do_cockpit_window_view 2015-02-14 22:48:28 +00:00
Kp d1f45f85b2 Wrap submodel angles 2015-02-14 22:48:28 +00:00
Kp 03576a28c2 Pass PHYSFSX_* file extensions as counted array 2015-02-14 22:48:28 +00:00
Kp 661e676688 Combine object_intersects_wall_d outputs
Drop unused face.
2015-02-14 22:48:27 +00:00
Kp dc8b88eed4 Convert various loops to range_for 2015-02-14 22:48:27 +00:00
Bradley Bell bbb32d0175 added cmd and cvar modules from d2x 2015-02-10 23:35:44 -08:00
Bradley Bell 0db11cc139 add d2x command-line interface to console 2015-02-10 17:01:00 -08:00
Bradley Bell 28bd4c1650 Enable D1 boss behavior in d2x build.
So we get correct boss behavior when emulating D1, and 3rd party mn2s can include D1 bosses.
2015-02-08 12:26:36 -08:00
Kp 7f2974ea69 Make default ports uint16_t
Fixes a clang warning formatting %hu with the result of
(condition ? short : int).
2015-02-08 17:43:29 +00:00
Bradley Bell 5a9b2497b1 remove #ifdef USE_UDP
even when compiling without USE_UDP, almost everything in this file is needed
2015-02-05 17:15:52 -08:00
Kp 078d9513e0 Pass end-of-list for ignore_obj_list 2015-02-05 03:03:51 +00:00
Kp 2daaacaa26 Move robot_points onto stack 2015-02-05 03:03:50 +00:00
Kp 8f5e6df9a5 Use array<> for Side_to_verts 2015-02-05 03:03:50 +00:00
Kp 4c8f3a47b5 Convert frequently used casts to C++ casts 2015-02-05 03:03:49 +00:00
Kp c1c028362e Fix clang build of fwdwall.h
Make WALL_IS_DOORWAY_FLAG::operator| const for C++14 conformance.  C++11
makes operator| implicitly const.  C++14 does not.
2015-01-29 04:27:36 +00:00
Kp d4117871a1 Use range_for for intro movies 2015-01-29 04:27:36 +00:00
Kp cd76870ecc Return find_hitpoint_uv u,v by value 2015-01-29 04:27:36 +00:00
Kp f4517dc0bd Reduce inclusion of segment.h 2015-01-29 04:27:36 +00:00
Kp 6b767c3a03 Remove various #include "gr.h" 2015-01-29 04:27:36 +00:00
Kp e30df66462 Remove gauges.h #include "piggy.h" 2015-01-29 04:27:35 +00:00
Kp f31e9f76e0 Remove textures.h #include "piggy.h" 2015-01-29 04:27:35 +00:00
Kp 6baa2411a1 Remove polyobj.h #include "piggy.h" 2015-01-29 04:27:35 +00:00
Kp 46b6519890 Remove bm.h #include "piggy.h" 2015-01-29 04:27:35 +00:00
Kp b031e449de Make equal_space a preprocessor constant 2015-01-29 04:27:35 +00:00
Kp c2aa2c2e4b Rename space to space_tab
Name space is too simple and causes conflicts elsewhere.
2015-01-29 04:27:35 +00:00
Kp 0ea95e87e7 Pass array<> to create_bfs_list 2015-01-28 03:42:52 +00:00
Kp bb60f64001 Undefine object instances at construction 2015-01-28 03:42:52 +00:00
Kp a6884e77db Unpack robot_info 2015-01-23 03:55:04 +00:00
Kp c8b5fe5552 Pass find_vector_intersection arg by & 2015-01-20 02:46:42 +00:00
Kp 6f15e46512 Use separate type for general purpose sockaddr 2015-01-18 01:58:34 +00:00
Kp 84e3a03451 Remove unused parameters 2015-01-18 01:58:33 +00:00
Kp c6664a45a6 Add newmenu_do helper for array<newmenu_item, N> 2015-01-18 01:58:32 +00:00
Kp 6e0464a58c Pass nm_set_item_slider arg by & 2015-01-18 01:58:32 +00:00
Kp 54ab069bb8 Pass nm_set_item_number arg by & 2015-01-18 01:58:32 +00:00
Kp 426fb16654 Pass nm_set_item_radio arg by & 2015-01-18 01:58:31 +00:00
Kp fa10e51999 Add helper nm_item_text 2015-01-18 01:58:31 +00:00
Kp 4705c3f2d8 Pass nm_set_item_checkbox arg by & 2015-01-18 01:58:31 +00:00
Kp f8163957ef Add helper nm_item_input 2015-01-18 01:58:31 +00:00
Kp 67e503b9b7 Add helper nm_item_menu 2015-01-18 01:58:31 +00:00
Kp 547193c591 Compile out unused bm_write_all
Unused since e2a2cc579a deleted caller
piggy_dump_all.
2015-01-17 18:31:43 +00:00
Kp bca8889695 Simplify Primary_ammo_max 2015-01-17 18:31:42 +00:00
Kp eb09eb4396 Refactor newmenu reordering 2015-01-17 18:31:41 +00:00
Kp d443e28147 Reuse mle_path as Mission_path 2015-01-15 04:30:03 +00:00
Kp 61ba3d1ba2 Centralize buddy search 2015-01-12 00:26:04 +00:00
Kp fd01d4c673 Reorder wall_is_doorway to favor likely results 2015-01-12 00:26:03 +00:00
Kp fc30cdcc9b Use ntstring for NetworkMessageMacro name 2015-01-12 00:26:02 +00:00
Kp 12770802ab Use ntstring for guidebot name 2015-01-12 00:26:02 +00:00
Kp 44d5ae69c6 Pack wall 2015-01-12 00:26:02 +00:00
Kp d7d6e5728d Use array<> for ReticleRGBA 2015-01-12 00:26:02 +00:00
Kp 3ad422a4be Include <vector> in render.h
Some systems include <vector> as a side effect from other headers.  OS X
Yosemite is not such a system.

Reported by kreatordxx: https://github.com/dxx-rebirth/dxx-rebirth/issues/29
2015-01-11 18:10:40 +00:00
Kp d5d416c62c Use ntstring for Netgame.mission_name 2015-01-03 23:44:32 +00:00
Kp 030a811661 Pass nullptr for Descent 1 state_save_all filename_override 2014-12-30 02:09:23 +00:00
Kp fbac119095 Propagate use of objptridx_t 2014-12-23 04:20:27 +00:00
Kp 499b1d3b66 Use range_for for NumNetPlayerPositions 2014-12-23 04:20:27 +00:00
Kp b96b6eb4cb Make do_ai_robot_hit_attack player vobjptridx_t 2014-12-23 04:20:27 +00:00
Kp 702ea40ade Move segment declarations to fwdsegment.h 2014-12-22 04:35:49 +00:00
Kp 2d8f8b5d4a Reduce inclusion of wall.h 2014-12-22 04:35:49 +00:00
Kp 754c5342f9 Move wall declarations to fwdwall.h 2014-12-22 04:35:48 +00:00
Kp 03370ed3e5 Use ntstring for Netgame.mission_name 2014-12-22 04:35:48 +00:00
Kp e166846dd1 Use ntstring for Netgame.game_name 2014-12-22 04:35:48 +00:00
Kp bf97634b27 Hide marker _ when buffer full 2014-12-22 04:35:48 +00:00
Kp 628156dbf7 Use array<ntstring> for CMMiscMusic 2014-12-22 04:35:48 +00:00
Kp c7ae54c62a Use ntstring for CMLevelMusicPath 2014-12-22 04:35:47 +00:00
Kp 1344fb2779 Fix crash choosing jukebox directory
newmenu_listbox1 returns immediately
2014-12-22 04:35:47 +00:00
Kp 681a6b3a9d Fix crash loading descent.cfg with bare equal
Remove obsolete check for trailing newlines in strings.  Fix failure to
null terminate strings.  Refuse overlong strings.  Refuse integers with
trailing garbage.  Refuse integers out of range.
2014-12-22 04:35:47 +00:00
Kp 45af2bb137 Move d_fname helper methods to base class ntstring 2014-12-22 04:35:47 +00:00
Kp b68a403e41 Use partial_range to load textures 2014-12-20 04:36:11 +00:00
Kp 2766114959 Make PHYSFSX_gets_line_t::line_t be array<> 2014-12-20 04:36:10 +00:00
Kp 80a21ab7d6 Remove obsolete hostage message support
This was never included in the game.  Editor support for it is
incomplete and does not allow text entry.  Remove it.
2014-12-20 04:36:09 +00:00
Kp 0f30d4eb72 Use PHYSFSX_gets_line_t for Current_level_palette 2014-12-20 04:36:08 +00:00
Kp 90666ba19b Use PHYSFSX_gets_line_t for Current_level_name 2014-12-20 04:36:07 +00:00
Kp c1dc352a16 Pack Mission 2014-12-18 04:12:39 +00:00
Kp da6632a917 Use array<> for Robot_joints 2014-12-18 04:12:38 +00:00
Kp 9ffd958d3d Create window_rendered_data locally 2014-12-18 04:12:38 +00:00
Kp 9916406d8f Fix debug-build abort on matcen triggers 2014-12-14 21:02:40 +00:00
Kp e42b1f5b71 Return vertex_array_list_t from create_all_vertnum_lists 2014-12-14 05:23:00 +00:00
Kp 1960a2ebad Return vertex_array_list_t from create_abs_vertex_lists 2014-12-14 05:23:00 +00:00
Kp 601290e674 Return vertex_array_list_t from create_all_vertex_lists 2014-12-14 05:23:00 +00:00
Kp 51b6fb1c95 Return get_side_verts by value 2014-12-14 05:23:00 +00:00
Kp e54c2c79df Use array<> for Sounds 2014-12-14 05:22:59 +00:00
Kp 80aa48efb4 Pass digi_*_start_sound soundobj as sound_object* 2014-12-14 05:22:59 +00:00
Kp 9ea8c8d7f1 Mark digi variables static 2014-12-13 17:47:10 +00:00
Kp a622aecd58 Pass vcobjptridx_t to digi_ functions 2014-12-13 17:47:06 +00:00
Kp adbff232c5 Split seg/obj vars of find_seg_side_face 2014-12-13 17:47:01 +00:00
Kp 0b086b1b0d Optimize rendering
- Make Max_linear_depth_objects const
- Skip setup of object rendering if no objects to render
- Defer setting globals until after conditional confirms a segment will
  render
2014-12-13 17:18:07 +00:00
Kp 69bc81681a Move render_windows to per_segment_state_t::render_window 2014-12-13 16:54:16 +00:00
Kp 7c98dea8be Pass render_frame arg by & 2014-12-13 04:11:21 +00:00
Kp b79e432a3e Pass render_mine arg by & 2014-12-13 04:11:16 +00:00
Kp 4bcf451745 Pass wake_up_rendered_objects arg by & 2014-12-13 04:11:07 +00:00
Kp e027c821c9 Pass update_rendered_data arg by & 2014-12-13 04:11:04 +00:00
Kp 307ad30433 Remove unused digi_*_is_sound_playing 2014-12-11 02:34:54 +00:00
Kp 53366488ac Remove unused digi_set_volume 2014-12-11 02:34:38 +00:00
Kp 6d2b707c3e Move debug-only digi functions into !RELEASE 2014-12-11 02:34:32 +00:00
Kp 84011e55d2 Use partial_range when searching HighestLevels 2014-12-08 04:49:20 +00:00
Kp 6798c8410b Refactor callsign_t constants 2014-12-07 00:53:15 +00:00
Kp a0727f4f84 Throw on net_udp_read_sync_packet failure
Callers expect sane Player_num, but on failure, it is invalid.
Returning a failure status causes net_udp_level_sync to fault using
Players[Player_num].connected, so throw an exception instead.
2014-12-07 00:00:22 +00:00
Kp 9d700aab08 Make kill_matrix uint16_t, not short 2014-12-06 23:30:55 +00:00
Kp cfe0f89dae Use array<> for team_kills 2014-12-06 04:52:53 +00:00
Kp e90549d9a8 Use range_for on Orb_icons 2014-12-02 03:23:21 +00:00
Kp cf31cc4a5d Switch Laser_render to vobjptr_t 2014-11-30 22:09:23 +00:00
Kp 9aa539c062 Return texmerge_get_cached_bitmap result by & 2014-11-30 22:09:19 +00:00
Kp f9a339dfc8 Pass bash_to_shield arg as vobjptr_t 2014-11-26 04:02:08 +00:00
Kp 2ddbdd6f11 Move processed into render_seg_map 2014-11-23 21:53:45 +00:00
Kp c495f48ccd Move Seg_depth into render_seg_map 2014-11-23 21:53:45 +00:00
Kp d63be88eb0 Propagate use of vsegptridx_t 2014-11-23 04:58:45 +00:00
Kp 80f3f83577 Use range_for for Delta_lights 2014-11-23 04:36:59 +00:00
Kp 80bbc9c69c Use range_for on Dl_indices 2014-11-23 04:36:58 +00:00
Kp 1649fc791c Use partial_range on Flickering_lights 2014-11-23 04:36:58 +00:00
Kp f206b3b127 Reduce inclusion of object.h 2014-11-23 04:36:58 +00:00
Kp 88101f8f57 Move object declarations to fwdobject.h 2014-11-23 04:36:58 +00:00
Kp 1d0ba034a5 Store rendered objects in vector 2014-11-21 03:16:00 +00:00
Kp 317fffe5da Move #endif to cover functions that need trigger 2014-11-17 04:02:26 +00:00
Kp 57ed5c24fd Add developer option to test header completeness 2014-11-17 04:02:25 +00:00
Kp d5d958af96 Add make_random_vector that returns result 2014-11-04 01:33:45 +00:00
Kp cf4d216c41 Pass check_and_fix_matrix vms_matrix by & 2014-11-04 01:30:49 +00:00
Kp 164ea2dc10 Pass calc_gun_point vector by & 2014-11-02 03:41:01 +00:00
Kp bc3a76c673 Hoist gauge loop iterations 2014-11-01 15:28:07 +00:00
Kp ff877834cb Pass render_terrain vector by & 2014-11-01 03:12:57 +00:00
Kp 9aa0cf0b89 Pass read_model_guns vector as array & 2014-11-01 03:08:27 +00:00
Kp 7e3c7a413a Pass obj_create_copy vector by const & 2014-11-01 03:06:04 +00:00
Kp 5f9b06cce9 Pass multi_send_robot_fire vector by const & 2014-10-30 03:37:22 +00:00
Kp 6024bf0369 Pass multi_send_controlcen_fire vector by & 2014-10-30 03:37:13 +00:00
Kp 8276bbc36a Pass compute_object_light vector as const * 2014-10-30 03:36:22 +00:00
Kp 6d61198130 Pass compute_segment_center vector by & 2014-10-30 03:32:51 +00:00
Kp c0004cf4bd Pass pick_random_point_in_seg vector by & 2014-10-30 03:32:38 +00:00