Commit graph

8538 commits

Author SHA1 Message Date
Kp 25a1dbe70c Cache temporaries in check_segment_connections type rewrite 2016-09-03 17:30:18 +00:00
Kp 2df93a7e88 Use range_for to iterate choose_drop_segment controlcen check 2016-09-03 17:30:18 +00:00
Kp 0104f4f938 Fix invalid access on very short exit tunnels 2016-09-03 17:30:18 +00:00
Kp 8d019a63fb Fold glTexParameteri calls 2016-09-03 17:30:18 +00:00
Kp 9d2fd0ebfa Fold glScalef calls 2016-09-03 17:30:17 +00:00
zico 8907a2bee4 Updated INSTALL.txt, README.txt, RELEASE-NOTES.txt, d1x.ini, d2x.ini for upcoming release. Updated Debian build to not include obsolete patch (it may still be broken, needs to be verified). Fixed small parsing typo in inferno.cpp help output. 2016-08-30 13:15:55 +02:00
zico b2cad09c26 Added new texture filtering options based on patch of user 'beware' 2016-08-29 20:53:10 +02:00
zico 6c6a32ba92 Added patch by user 'beware' to remove dark edges around textures and added command-line/INI option to disable this patch if desired (nostalgia). Fixed misleading indentation in ogl.cpp along the way. 2016-08-29 17:07:30 +02:00
zico ff331732ba Re-enabled timer_delay2 for general menu handlers and adjusted them to sleep according to set FPS and not sleep at all for Multiplayer since calc_frame_time() is active in that case. Modified sleeping towards 1ms in calc_frame_time() to allow for more precise target FPS and be able to relay packets in multiplayer with less delay. 2016-08-29 16:04:46 +02:00
Kp 1402a21946 Reintroduce D1 title song bug
In past releases, D1X-Rebirth played the title song even when the user
specified `-notitles`.  Commit 29f79f0a6b
("Enable -notitles for Descent 2") fixed this.  Unfortunately, despite
being called SONG_TITLE, users believe this to be main menu music, not
title screen music.  This belief is reinforced by other code sites that
play the title song on returning to the main menu.  Reintroduce the bug
by moving the call above the test for `-notitles`.  This restores the
semantics that users expect.
2016-08-28 22:41:49 +00:00
Kp c484c55153 Expand get_local_player_invulnerable_time
It was a convenient transition macro, but its presence was always
intended to be temporary.  Expand it to ease the conversion of usage
sites that already have access to local player data through a local
variable.
2016-08-28 22:41:49 +00:00
Kp 4e556efa1b Extend newdemo cloak_time hack to cover invulnerable_time
Descent demos do not record the time remaining on cloak/invulnerability,
so the demo system tries to fake it by forcing any cloaked player to
have a time remaining of 50%.  Extend that hack to do the same for
invulnerability.  The local player needs that hack.  Remote players do
not need it, but the logic is simpler with it in the loop than with a
special case for just the local player.
2016-08-28 22:41:49 +00:00
Kp 335f24ac31 Move Primary_weapon to player_info 2016-08-28 22:41:49 +00:00
Kp bfcf851f5f Remove default argument for get_mapped_weapon_index
Pass the weapon explicitly.
2016-08-28 22:41:48 +00:00
Kp 4af4f00d4b Fix weapon_id_type mismatch in do_laser_firing_player
Per comment, MK meant for this test to match the Helix cannon, but the
implementation was wrong.  Primary weapon indexes cannot be compared to
weapon ID types.  The two use different number spaces.  Using proper
enum types for each causes the compiler to report this mistake.  Fix the
test.
2016-08-28 22:41:48 +00:00
Kp 10ff2b9ea2 Change Primary_weapon_to_weapon_info key to weapon_id_type
Fix incorrect ID in D1 Primary_weapon_to_weapon_info.  Testing suggests
that both the correct and incorrect ID produce the same results.
2016-08-28 22:41:48 +00:00
Kp b7a5f65d5b Move Secondary_weapon to player_info 2016-08-28 22:41:48 +00:00
Kp 4ebf66ae7f Avoid recomputing object* in say_totals 2016-08-28 22:41:48 +00:00
Kp e7b881e5e6 Move Secondary_last_was_super into player_info 2016-08-28 22:41:48 +00:00
Kp adf5e57b47 Move Primary_last_was_super into player_info 2016-08-28 22:41:47 +00:00
Kp 8248438ffa Move Omega_charge to player_info 2016-08-28 22:41:47 +00:00
Kp dc8608cc3c Factor out player-hit-powerup logic 2016-08-28 22:41:47 +00:00
Kp 007963faad Factor out player-hit-flag handling 2016-08-28 22:41:47 +00:00
Kp 1b2052e2bc Fold do_end_briefing_screens calls to songs_play_song 2016-08-28 22:41:47 +00:00
Kp 198cb4e449 Allow rvalue references for some serial.h process_buffer overloads 2016-08-28 22:41:47 +00:00
Kp 4ed57bf70b Simplify multiplayer_command_t truncation check 2016-08-28 22:41:47 +00:00
Kp 0a2676315d Flatten serial.h type constructor pad() 2016-08-28 22:41:46 +00:00
Kp f8568d1d5f Fold proximity mine calls to multi_send_robot_fire 2016-08-25 23:31:37 +00:00
Kp 0b781e021d Use ={} to clear robot velocity 2016-08-25 23:31:37 +00:00
Kp 35928f942c Unify robot-next-gun logic
Old code:

if (condition) {
	x;
	y;
} else {
	y;
}

Change it to be:

if (condition) {
	x;
}
y;
2016-08-25 23:31:37 +00:00
Kp d75de6e705 Reduce scope of object_create_explosion_sub vforce2
Define it where it is first used.

Skip adjusting damage in cases where it will not be used.

Fix obvious copy&paste error from Parallax.

    if (condition)
        statement; statement; statement;

is parsed as:

    if (condition)
    {
        statement;
    }
    statement;
    statement;

In context, all three statements were supposed to be guarded by the
condition.  Add braces accordingly.
2016-08-25 23:31:37 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp c8ffe5d1ce Move various trigger functions into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 7c348056c1 Inline triggers_frame_process 2016-08-25 04:05:32 +00:00
Kp 8409e2735c Clean whitespace in net_udp_get_new_player_num
net_udp_get_new_player_num used a strange indent convention.
Normalize the whitespace to make parsing easier.
2016-08-25 04:05:32 +00:00
Kp 3693b2317d Move HUD_render_message_frame into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 6d311a97e9 Move hud weapon functions into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 854907aa1b Move find_hitpoint_uv into namespace dsx 2016-08-25 04:05:32 +00:00
Kp dca790584f Remove non-ASCII characters in newmenu.h
Some parsing scripts react badly to finding byte sequences that are not
valid UTF8 characters.
2016-08-25 04:05:31 +00:00
Kp 38b8a34d19 Normalize function return type placement
Using "type\nfunction(args)" confuses some parsing scripts.  Switch to
the standard "type function(args)" style.  Fix sites where keyword
"static" was used after the return type.
2016-08-25 04:05:31 +00:00
Kp 18a479a308 Change multi_send_macro to handle invalid inputs
No caller passes a key value other than [KEY_F9, KEY_F12].  If one did,
an invalid array reference would occur.  Restructure the code to return
on invalid inputs.  This fixes a flow control analysis warning.
2016-08-25 04:05:31 +00:00
zico 89a2df0e18 Restored object_is_trackable to its original version for D2X. Restored conditions in track_track_goal to their original version. Scale homing_missile_turn_towards_velocity by HOMING_TURN_TIME if NEWHOMER since it may not be called in every frame. 2016-08-22 13:55:09 +02:00
Kp 16318e7c9e Remove empty #if/#endif in loadgl.h
Prior rewrites left empty conditionals.  Remove those conditionals.
2016-08-22 00:31:15 +00:00
Kp 655d0e6714 Remove unused loadgl typedefs
Per request from Mako88, remove unused loadgl typedefs.  loadgl.h
was imported from elsewhere and defines typedefs for many functions
that Descent does not use.  Some of these are guarded by WINVER
conditionals and, in Mako88's unspecified environment, defining WINVER
to expose these results in a build failure because the guarded typedef
requires a type that is not defined by the environment.

Compensate for that by removing all unused gl typedefs.

    # Save the results to a file, then run the file separately.  This
    # avoids any chance that sed might try to edit the file while later
    # searches are still running.
    git grep 'typedef .*OGLFUNCCALL \*' common/include/loadgl.h | sed -e 's/^.*OGLFUNCCALL \*//' -e 's/).*$//' | while read f; do
        if ! git grep -q 'DEFVAR\s'"$f"'\>' -- common/include/loadgl.h; then
            echo "/\\<$f\\>/d"
        fi
    done > unused.sed
    sed -i common/include/loadgl.h -f unused.sed
2016-08-22 00:31:15 +00:00
Kp d851ee988d Fix wording of linker diagnostic report 2016-08-22 00:31:15 +00:00
Kp f50aef0241 Remove unused loadgl indirections
Per request from Mako88, remove unused loadgl indirections.  loadgl.h
was imported from elsewhere and defines indirections for many functions
that Descent does not use.  Some of these are guarded by WINVER
conditionals and, in Mako88's unspecified environment, defining WINVER
to expose these results in a build failure because the guarded typedef
requires a type that is not defined by the environment.

Compensate for that, and likely improve the generated code, by removing
all unused gl symbols.

    # Save the results to a file, then run the file separately.  This
    # avoids any chance that sed might try to edit the file while later
    # searches are still running.
    s=( `git ls-files '*.h' '*.cpp' | grep -v -F common/include/loadgl.h` )
    git grep '#define w\?gl[A-Z]\w\+ dw\?gl' common/include/loadgl.h |
	    gawk '{print $2;}' | while read f; do
	    if ! git grep -q -l '\<d\?'"$f"'\>' -- "${s[@]}"; then
		    echo "/\\<d\?$f\\>/d"
	    fi
    done > unused.sed
    sed -i common/include/loadgl.h -f unused.sed
2016-08-20 22:28:44 +00:00
Kp 3d6108ae09 Include inttypes.h in playsave.cpp
Mako88 reports that an unspecified environment fails to build
playsave.cpp.  The failure is because PRIuFAST32 is undefined.  In most
environments, SDL automatically includes inttypes.h, which provides
PRIuFAST32.  In this unspecified environment, SDL does not include
inttypes.h.  Include it explicitly to ensure the definition is
available.
2016-08-20 22:28:43 +00:00
Kp 63c5b5f9ea Clean up SConstruct global namespace 2016-08-20 22:28:43 +00:00
Kp 7bb3a5605b Remove useless cast in similar/editor/info.cpp 2016-08-20 22:28:43 +00:00
Kp b7b37bc056 Switch valptridx error reporting size to DXX_PRI_size_type 2016-08-20 22:28:43 +00:00