Commit graph

2502 commits

Author SHA1 Message Date
Kp 4a8f836a3d Use valptr for net_udp highest_valid 2015-06-13 22:42:18 +00:00
Kp 71e7432290 Use valptr for multibot highest_valid 2015-06-13 22:42:18 +00:00
Kp 546f361c5f Use valptr for multi highest_valid 2015-06-13 22:42:18 +00:00
Kp 438a1a4bee Use valptr for medwall highest_valid 2015-06-13 22:42:18 +00:00
Kp c3ba75cd22 Use valptr for meddraw highest_valid 2015-06-13 22:42:18 +00:00
Kp 3d323dd194 Use valptr for lighting highest_valid 2015-06-13 22:42:17 +00:00
Kp adcd8d7fa7 Use valptr for ksegsize highest_valid 2015-06-13 22:42:17 +00:00
Kp fc46612114 Use valptr for kbuild highest_valid 2015-06-13 22:42:17 +00:00
Kp 41b71fd214 Use valptr for group highest_valid 2015-06-13 22:42:17 +00:00
Kp bbb0b225b4 Use valptr for gameseq highest_valid 2015-06-13 22:42:17 +00:00
Kp a8e1e504ef Use valptr for gameseg highest_valid 2015-06-13 22:42:17 +00:00
Kp 3c748c2418 Use valptr for gamesave highest_valid 2015-06-13 22:42:17 +00:00
Kp be34e5a959 Use valptr for gamemine highest_valid 2015-06-13 22:42:17 +00:00
Kp 1bbfe3e830 Use valptr for gamecntl highest_valid 2015-06-13 22:42:17 +00:00
Kp 8042d6c120 Use valptr for game highest_valid 2015-06-13 22:42:17 +00:00
Kp 9d5bc102ab Use valptr for fuelcen highest_valid 2015-06-13 22:42:17 +00:00
Kp 32f256311d Use valptr for eobject highest_valid 2015-06-13 22:42:16 +00:00
Kp b9d6c577be Use valptr for endlevel highest_valid 2015-06-13 22:42:16 +00:00
Kp 742971711f Use valptr for elight highest_valid 2015-06-13 22:42:16 +00:00
Kp c5bd78f4bc Use valptr for dumpmine highest_valid 2015-06-13 22:42:16 +00:00
Kp a53a348f09 Use valptr for cntrlcen highest_valid 2015-06-13 22:42:16 +00:00
Kp 4c5ce566ef Use valptr for automap highest_valid 2015-06-13 22:42:16 +00:00
Kp cda5cb160c Use valptr for aipath highest_valid 2015-06-13 22:42:16 +00:00
Kp 1f9650d402 Use valptr for ai highest_valid 2015-06-13 22:42:16 +00:00
Kp 9125ae32cd Make objnum unsigned 2015-06-13 22:42:15 +00:00
Kp 00c1429ebf Use enum for Escort_special_goal 2015-06-13 22:42:15 +00:00
Kp 148c0f44c8 Convert segnum_t to uint16_t 2015-06-13 22:42:15 +00:00
Kp 8358dfcd0b Support biased pointers to help memory debuggers 2015-06-13 22:42:15 +00:00
Kp 513e7c05e9 Remove force-free of "leaked" memory in mem_display_blocks
mem_display_blocks runs before global destructors, so it reports as
leaked any memory which is managed by a global scope object with a
destructor.  If mem_display_blocks calls mem_free, and the destructor
later calls mem_free, a double-free results, and usually leads to a
crash.  Even if the memory were actually leaked, freeing it does not
help because the program will exit soon anyway.

Reported-by: zico <https://github.com/dxx-rebirth/dxx-rebirth/issues/85>
2015-06-12 02:54:53 +00:00
Kp 5124c510f8 Fix serial endian_access -fno-inline build 2015-06-11 03:06:58 +00:00
Kp 75b72dc8e9 Fix hoard_resources_type -fno-inline build
Fixes: e116e894b0 ("Fix invalid free when hoard data is missing")
2015-06-11 03:06:58 +00:00
Kp 906f93ddf1 Fix has_weapon_result -fno-inline build
Fixes: 9d213b5282 ("Wrap player_has_weapon return type")
2015-06-11 03:06:58 +00:00
John Ackerman fe71a94d53 Implement Nonlinear Joystick Settings
[Kp: fix whitespace; squash fixes into main]
Requested-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/pull/84>
2015-06-11 01:41:26 +00:00
Kp f6d6f221ad Fix array underread for D1 bosses in D2 2015-06-07 16:21:37 +00:00
Kp 7e263323bc Simplify boss invulnerability lookup 2015-06-07 16:21:37 +00:00
Kp 7c436f1fbb Merge pull #39 into unification/master
Requested-by: btb <https://github.com/dxx-rebirth/dxx-rebirth/pull/39>
Acked-by: Matt1360 <https://github.com/dxx-rebirth/dxx-rebirth/pull/39#issuecomment-88712761>
Acked-by: zico <https://github.com/dxx-rebirth/dxx-rebirth/pull/39#issuecomment-88907523>
2015-06-07 16:21:37 +00:00
Kp ff452dbded Move CLI code to common
None of it depends on D1 vs D2.
2015-06-07 16:20:46 +00:00
Kp 1115114e3d Remove unnecessary old-style const stripping cast
This cast was necessary only because cvar_set_cvar was not properly
const.
2015-06-07 16:20:46 +00:00
Kp 3718678576 Reduce cvar.h includes 2015-06-07 16:20:46 +00:00
Kp e40172f21a Use RAIIdmem for console memory 2015-06-07 16:20:46 +00:00
Kp 67b684f277 Fix surface in exit video
Fixes: f3aa8e501b ("Simplify extract_vector_from_segment")
2015-06-06 18:03:45 +00:00
Kp 0141e9ed78 Remove redundant fix_sincos calls
The result is immediately overwritten.  Skip computing it.
2015-06-02 03:03:32 +00:00
Kp 53a7798d80 Simplify fix_sincos calls 2015-06-02 03:03:31 +00:00
Kp 33204bac5c Make Break_on_object static 2015-06-02 03:03:31 +00:00
Kp bb5fd12ffe Pass vcobjptr to object_intersects_wall 2015-06-02 03:03:31 +00:00
Kp 87eda88319 Skip copying vertex for boss fit check 2015-06-02 03:03:31 +00:00
Kp ed46a05296 Update control_type when ghosting reactor 2015-05-30 21:29:57 +00:00
Kp a523171748 Shorten calc_d_homer_tick
Combine redundant write to d_homer_tick_step
Combine redundant write to static timer
Only test for exceeding 3*cap if timer >= 1*cap
2015-05-30 16:53:49 +00:00
zico b09703cd3f Merge branch 'unification/master' of github.com:dxx-rebirth/dxx-rebirth into unification/master 2015-05-30 18:29:59 +02:00
zico b04282e791 Using one global yet independent timeer for homing missiles similar to d_tick instead of having one in each missile object. Also decreased HOMING_TURNING_TIME to 25 FPS base 2015-05-30 18:29:41 +02:00
Kp 27b6012e20 Fix hang in statusbar mode when energy>100
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/78>
2015-05-30 16:06:05 +00:00
Kp 3f9d110502 Reverse score order
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/74>
2015-05-29 03:15:48 +00:00
Kp 3239693c26 Fix primary/secondary select mismatch
Fixes: d161b17191 ("Factor out shareware/unusable weapon handling")
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/72>
2015-05-29 03:15:48 +00:00
zico 7414b8165d Fixed little regression from previous commit: Do not increade homing tick every frame but according to turn time - duh 2015-05-28 16:07:24 +02:00
zico 7ba3d1317b Isolated all of the homing code into time-depending condition determined by track_turn_time and added track_turn_tick to make target re-discovery dependent on the individual missile tracking instead of global d_tick_count 2015-05-28 15:22:40 +02:00
Kp 6eb724d872 Reorder flag drop
Suppress message if drop fails
2015-05-28 03:08:40 +00:00
Kp 1216c26704 Make exit nextcenter const 2015-05-28 03:08:40 +00:00
Kp 58c8b17619 Use helper for reading 16-bit segments 2015-05-28 03:08:40 +00:00
Kp bb79e50656 Fix definition of newdemo_record_effect_blowup
Fixes: 9a32e151ff ("Pass check_effect_blowup vms_vector arg by &")
2015-05-28 03:08:40 +00:00
Kp b6a9b2a853 Pass vsegptridx to wall_toggle 2015-05-28 03:08:40 +00:00
Kp c0eb67a9f1 Use vsegptr in network messages 2015-05-28 03:08:39 +00:00
Kp 850853326c Pass vsegptridx to gate_in_robot 2015-05-28 03:08:39 +00:00
Kp 1b0e3f4aa5 Pass vsegptr to multibot compute_segment_center 2015-05-28 03:08:39 +00:00
Kp ea2c2df250 Update open-coded tests for segment_none 2015-05-28 03:08:39 +00:00
Kp 4007b297ec Pass vcsegptr to aipath compute_segment_center 2015-05-28 03:08:39 +00:00
Kp 5cc38ea06c Pass vcsegptridx to digi_link_sound_to_pos 2015-05-28 03:08:39 +00:00
Kp 136e6acda9 Pass vcobjptr to object_types 2015-05-28 03:08:39 +00:00
Kp d586385bd1 Pass vcobjptr to object_ids 2015-05-28 03:08:39 +00:00
Kp babfa9d8e7 Construct d_event_mousebutton 2015-05-28 03:08:39 +00:00
Kp 692038f284 Cache modifier keys 2015-05-28 03:08:38 +00:00
Kp e98c679f06 Simplify key_flush 2015-05-28 03:08:38 +00:00
Kp a991ff0d82 Remove write-only key_data 2015-05-28 03:08:38 +00:00
Kp 34fb7bde90 Test for !=SDL_RELEASED, not ==SDL_PRESSED 2015-05-28 03:08:38 +00:00
Kp 25186ca984 Remove write-only keyd_last_released 2015-05-28 03:08:38 +00:00
Kp badad2ef33 Remove write-only keyd_last_pressed 2015-05-28 03:08:38 +00:00
Kp a66da49cb6 Factor out mouse z button 2015-05-28 03:08:38 +00:00
Kp 821fefe145 Cache locals in mouse_button_handler 2015-05-28 03:08:38 +00:00
Kp abfd8e4d83 Split mouse_toggle_cursor 2015-05-28 03:08:38 +00:00
Kp 83326e89e2 Factor out sending mouse clicks 2015-05-28 03:08:38 +00:00
zico 74b66a7f5a Fixed regression (with kp's help) in multi_do_player_deres which made conditional check for map_objnum_local_to_remote fail for the wrong reasons 2015-05-25 11:48:05 +02:00
Kp d29d52be7f Restore temporary rear view 2015-05-24 17:16:38 +00:00
Kp ec453dcb28 Merge "Clang fixes" from btb
clang whines about some innocuous constructs.  Preprocess them out to
silence it.

Requested-by: btb <https://github.com/dxx-rebirth/dxx-rebirth/pull/63>
2015-05-24 17:13:13 +00:00
Kp 7e3bec43a0 Allow object_none as killer in multi_compute_kill 2015-05-23 22:38:15 +00:00
Kp d2724ea90f Remove bogus backspace Int3
There is no reason to trap to debugger when backspace is pressed on a
window that ignores it.  Remove the bogus trap.

Reported-by: A Future Pilot <http://www.dxx-rebirth.com/frm/index.php/topic,2024.msg21713/topicseen.html#msg21713>
2015-05-23 17:25:56 +00:00
zico 1f6ae58f52 Added HANDS_OFF_PERIOD define for multibot to make sure code will not break if MAX_ROBOTS_CONTROLLED changes 2015-05-23 18:18:20 +02:00
Kp d5cf0fcd6f Store hoard goal_eclip locally 2015-05-23 04:13:29 +00:00
Kp e116e894b0 Fix invalid free when hoard data is missing
If hoard data is not initialized, hoard_resources_type::reset frees
GameBitmaps[0].data, which is bogus_data instead of nullptr or a valid
pointer.

Fixes: d422e8656a ("Simplify HoardEquipped")
2015-05-23 04:13:29 +00:00
Kp 02c6f2a9f3 Fix gcc-4.6 render range error
gcc-4.6 fails to synthesize a move constructor to initialize
reversed_render_range; later gcc accept this.

Switch to capturing the value by const auto &&, which works in both old
and new gcc.
2015-05-22 03:33:21 +00:00
Kp 6615aff8a4 Fix gcc-4.6 piggy build
gcc-4.6 warns about the transition to new for scope rules; later gcc
does not warn.

Replace the loops with range-based for.
2015-05-22 03:33:20 +00:00
Kp 3298802b3d Fix gcc-4.6 object build
gcc-4.6 chokes on implicitly converting vobjptridx_t to int/uint16_t;
later gcc accepts this.  Cast the vobjptridx_t directly to short to
force gcc-4.6 to find the correct conversion operator.
2015-05-22 03:33:20 +00:00
Kp 665a0de228 Fix gcc-4.6 multi build
gcc-4.6 chokes on implicitly converting objptridx_t to short; later gcc
accepts this.  Cast the objptridx_t directly to short to force gcc-4.6
to find the correct conversion operator.
2015-05-22 03:33:20 +00:00
Kp 76540314c1 Fix gcc-4.6 gamerend build
gcc-4.6 chokes on casting vobjptridx_t to long; later gcc accepts this.
Change the format string to short, then switch the conversion to
objnum_t, which has an exact match for the converting operator.
2015-05-22 03:33:20 +00:00
Kp 4cd329d2b4 Fix gcc-4.6 gamecntl build
gcc-4.6 chokes on constexpr operator int(); later gcc accepts this.
menu_fix_wrapper is never converted in constexpr context, so remove the
constexpr specifier.

Fixes: 12ad357b8d ("Move Wimp Menu to macro")
2015-05-22 03:33:20 +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 d422e8656a Simplify HoardEquipped 2015-05-22 03:33:19 +00:00
Kp dc4a344ec8 Use destructor for hoard resources 2015-05-22 03:33:19 +00:00
Kp cc2a5e9790 Use gr_free_bitmap_data for Orb_icons 2015-05-22 03:33:19 +00:00
Kp bc886e5ade Skip sliding invisible textures 2015-05-17 20:37:59 +00:00
Kp c53b734abb Compute slide segments early
Store slide flag in segment to save one byte per segment.
2015-05-17 20:37:59 +00:00
Kp a7f9b34aff Refactor slide_textures 2015-05-17 20:37:59 +00:00
Kp 8e49c191ce Remove unused copy_side_except_vertex_ids 2015-05-17 20:37:59 +00:00
Kp 44625e2617 Remove unnecessary Mouse::button_state 2015-05-14 02:23:13 +00:00
Kp 265ad59e9c Remove set_default_handler
standard_handler is the only handler.  Use it directly.
2015-05-14 02:23:13 +00:00
Kp 7f403bc1af Optimize clearing player animation angles 2015-05-14 02:23:13 +00:00
Kp 577321d74b Remove obsolete con_close 2015-05-14 02:23:13 +00:00
Kp 5ffbb6dd05 Enable tail call in con_add_buffer_line 2015-05-14 02:23:13 +00:00
Kp e4d7d20bd2 Factor out console color lookup 2015-05-14 02:23:13 +00:00
Kp 8ddcf7b323 Simplify console open check 2015-05-14 02:23:13 +00:00
Kp fa591d585a Shorten event_toggle_focus 2015-05-14 02:23:13 +00:00
Kp 68d35d8e05 Move negation of mouse_toggle_cursor argument into callee 2015-05-14 02:23:13 +00:00
Kp e50b0d479e Inline event_mouse_get_delta 2015-05-14 02:23:13 +00:00
Kp 2a8b79f868 Inline event_mouse_get_button 2015-05-14 02:23:13 +00:00
Kp 0ece005dfa Use screen_mode for screen resolution 2015-05-14 02:23:13 +00:00
Kp e592f3a0bb Inline call to gr_set_mode(0) 2015-05-14 02:23:13 +00:00
Kp 2d9af1e348 Propagate gr_init argument 2015-05-14 02:23:13 +00:00
Kp 739879d701 Move input config menu to macro 2015-05-14 02:23:13 +00:00
Kp cb873563c8 Move reticle menu to macro 2015-05-14 02:23:13 +00:00
Kp e64e54f521 Move input sensitivity menu to macro 2015-05-14 02:23:13 +00:00
Kp ac3b1d6aa3 Switch do_cockpit_window_view to vobjptr_t
Only the wake_up_rendered_objects hack needed a vobjptridx_t.  Switch to
vobjptr_t.
2015-05-13 03:20:28 +00:00
Kp 5810faf33d Make Ai_last_missile_camera object* 2015-05-13 03:20:28 +00:00
Bradley Bell a0fda81452 Merge branch 'unification/master' into clang-fixes 2015-05-09 15:34:30 -07:00
Kp bfeddc3501 Test for exploding wall damaging control center
apply_damage_to_controlcen requires a valid `who`, but exploding walls
have none.

Fixes: 3eb8f4813e ("Pass vcobjptr_t to apply_damage_to_controlcen")
2015-05-09 19:55:58 +00:00
Kp 38e8967fba Split event_toggle_focus 2015-05-09 17:39:03 +00:00
Kp 67240cea48 Shorten mouse_get_delta 2015-05-09 17:39:03 +00:00
Kp 9151b7f300 Remove write-only old_delta_x, old_delta_y 2015-05-09 17:39:03 +00:00
Kp fd51d9dcd5 Shorten kc_change_mouseaxis 2015-05-09 17:39:03 +00:00
Kp 7f00061f6f Shorten mouse_flush 2015-05-09 17:39:03 +00:00
Kp e111d6ec22 Shorten mouse_cursor_autohide 2015-05-09 17:39:03 +00:00
Kp f248006df5 Remove unused mouse_get_btns 2015-05-09 17:39:03 +00:00
Kp 53036c593e Use unsigned comparison in mouse_in_window 2015-05-09 17:39:03 +00:00
Kp 4ca7924907 Pass graphics_config_menuset items by userdata 2015-05-09 17:39:02 +00:00
Kp 29f239d6b1 Raise PHYSFSX_exists bool check to caller
All callers use a constant value, so raise the check into the caller to
let the optimizer delete the unnecessary branch.
2015-05-09 17:39:02 +00:00
Kp a4ba74f94a Expand void ternary operator into if/else 2015-05-09 17:39:02 +00:00
Kp e57afde68b Hoist store in gr_internal_string0_template 2015-05-09 17:39:02 +00:00
Kp 8ac92b098f Cache variables in gr_internal_string0_template 2015-05-09 17:39:02 +00:00
Kp bd5573356d Reduce gr_internal_string0_template variable scope 2015-05-09 17:39:02 +00:00
Kp 4228ed2324 Switch gr_internal_string0_template to count down loop 2015-05-09 17:39:02 +00:00
Kp 6d9de0d177 Use partial_range for font width 2015-05-09 17:39:02 +00:00
Kp d2cded3ad4 Combine gr_internal_string0{,m} 2015-05-09 17:39:01 +00:00
Kp b1ed5b86e2 Return get_char_width results by value 2015-05-09 17:39:01 +00:00
Kp 2e2c17669c Shorten timer_delay 2015-05-09 17:39:01 +00:00
Kp b1992b5e59 Shorten timer_delay2 2015-05-09 17:39:01 +00:00
Kp 9312b0b00f Remove write-only variable multi_do_guided::fun 2015-05-09 17:39:01 +00:00
Kp ed86b53395 Make Muzzle_queue_index static 2015-05-09 17:39:01 +00:00
Kp 1cdc43d71a Split object_create_egg 2015-05-09 17:39:01 +00:00
Kp f5b02ce6a0 Remove write-only ai_static D1 follow_path_start_seg 2015-05-09 17:39:01 +00:00
Kp 7dae02fbb4 Remove write-only ai_static D1 follow_path_end_seg 2015-05-09 17:39:00 +00:00
Kp 3b59a71e11 Remove unused D1 last_see_time 2015-05-09 17:39:00 +00:00
Kp 83baf4dfe8 Remove unused D1 last_attack_time 2015-05-09 17:39:00 +00:00
Kp d9c3005134 Factor out egg skip logic 2015-05-09 17:39:00 +00:00