Commit graph

1042 commits

Author SHA1 Message Date
Kp af166735cc Use enum class for player visibility 2019-06-20 04:02:27 +00:00
Kp 6772bac84e Remove per-game README files; prefer the unified README 2019-05-26 22:07:45 +00:00
Kp bfcff2cefe Fix crash loading guidebot with unreachable goal
Remove use of object_guidebot_cannot_reach and instead track the
reachability of the object as a separate flag.  This allows the game to
remember when an object was found, but unreachable.  Previously, it
would store only that some unreachable object was found.  Now, it stores
the index of the unreachable object.  This extra information is not used
yet.

Reported-by: Dainslaif <https://github.com/dxx-rebirth/dxx-rebirth/issues/421>
Fixes: c3cead4319 ("Move Escort_goal_index to d_unique_buddy_state")
2019-05-26 00:44:37 +00:00
Chris 44212ed77b Changed default tracker host address from dxxtracker.hopto.org to tracker.dxx-rebirth.com as requested by A Future Pilot 2019-05-17 15:36:58 +02:00
Kp 175fc1f650 Fix gcc-9 -Wstringop-truncation in gamepal.cpp 2019-05-11 20:18:29 +00:00
Kp 2243cd7f58 Use xrange for loops with zero start and constant numerical end
s/for\s*(\s*\(\w\+\)\s\+\(\w\+\)\s*=\s*0\+u\?\s*;\s*\2\s*\(!=\|<\)\s*\([0-9]\+\)u\?\s*;\s*\(++\s*\2\|\2\s*++\s*\))/range_for (const \1 \2, xrange(\4u))/
2019-05-04 18:27:36 +00:00
Kp 15ac8a5ac6 Add utility xrange for range-based loops with precomputed bounds
Utility xrange, inspired by the Python2 feature of the same name,
provides an object that returns successive values from [start, end).  It
is useful when the end index is known in advance, and is particularly
helpful when that index is expensive to recompute.
2019-05-04 18:27:36 +00:00
Kp 4d8d244bb9 Move spreadfire,helix orientation to player_info 2019-05-04 18:27:36 +00:00
Kp 3e25804026 Use NSDMI wherever possible 2019-04-28 00:53:40 +00:00
Kp 063bf29225 Enable -Wimplicit-fallthrough=5; fix resulting breaks
This enables using -Wimplicit-fallthrough with ccache+distcc, which
strip the fallthrough comments, but do not strip the attribute
annotationns.
2019-04-04 04:29:03 +00:00
Kp 5dc630b58f Move Last_buddy_message_time to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp 5da35845d9 Move Buddy_last_player_path_created to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp 5b503c22a6 Move Escort_last_path_created to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp bc62ae694b Move Last_come_back_message_time to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp 7e61451792 Move Last_time_buddy_gave_hint to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp 7577a3e408 Move Escort_special_goal to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp d46fd99425 Move Buddy_last_missile_time to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp b1e19ac667 Move Buddy_last_seen_player to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp bd1cce0cc3 Move Buddy_sorry_time to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp 9e3c5ec272 Move Last_buddy_key to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp b34e7bae24 Move Buddy_gave_hint_count to d_unique_buddy_state
Fix original bug that buddy was limited to 5 hints per program run, not
5 per boss as it probably should have been.

Due to savegame format limitations, this still is not right.  Reloading
the game should restore Buddy_gave_hint_count to its value at save time,
but will not.
2019-03-03 00:31:08 +00:00
Kp 58d59da9d2 Move Escort_goal_object to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp 926afe73d5 Move Looking_for_marker to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp ace3313dc3 Move Buddy_messages_suppressed to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp c3cead4319 Move Escort_goal_index to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp c02bee26d6 Move Buddy_allowed_to_talk to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp 420464549b Move Buddy_objnum to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp 1008ab397e Move Objects to d_level_unique_object_state 2019-03-03 00:31:08 +00:00
Kp a36eb1d52c Only use update_laser_weapon_info for quad laser change
Regular laser level changes are already tracked and handled separately.
2019-03-03 00:31:08 +00:00
Kp d7e85e0cff Move Boss_gate_segs, Boss_teleport_segs to d_level_shared_boss_state 2019-02-02 18:36:39 +00:00
Kp e84a65edc6 Move Robot_info into LevelSharedRobotInfoState 2018-12-30 00:43:59 +00:00
Kp 9be3c8e2e8 Move Walls into d_level_unique_wall_state 2018-12-30 00:43:58 +00:00
Kp 40adccd56b Move subtitles into movie 2018-12-30 00:43:58 +00:00
Kp 1a5844e218 Move Vertices out of global scope 2018-12-30 00:43:57 +00:00
Kp 045afc2c56 Prefer const shared_segment & over vcsegptr_t 2018-12-30 00:43:57 +00:00
Kp 8db88cb2b5 Fix off-by-one in mvelib processing
When exactly four bytes remain, mvelib will attempt to compute a
past-the-end pointer.  Some handlers will dereference this pointer
without rechecking the length.  Adjust the header check to require a
non-empty body.

Reported-by: jwrdegoede <https://github.com/dxx-rebirth/dxx-rebirth/issues/413>
2018-12-18 03:36:34 +00:00
Kp 706a704c6d Move unique_side to unique_segment 2018-12-13 02:31:38 +00:00
Kp 5a64ee5132 Add experimental support for larger cooperative games
- Raise the player limit to 8.
- Remove the logic that forces player counts up/down when switching
  between cooperative and deathmatch game modes.
- Add heuristics to add start positions for the extra players, since
  standard maps will not have the required number of starts.
2018-12-03 04:25:11 +00:00
Kp f6352e7957 Pass correct object to check_effect_blowup
`check_effect_blowup` should receive the `laser_info` of the weapon that
caused the blast.  Previously, it was given the `laser_info` of the
parent of that weapon.  The parent was not of type `OBJ_WEAPON`, so
passing its `laser_info` is meaningless.

Fixes: 9bd1ba7c47
2018-11-01 02:41:30 +00:00
Kp a0ed5cb283 Pass Vclip as context 2018-10-21 00:24:07 +00:00
Kp d1092f3ea2 Adjust release note about ADL MIDI support
"adlmidi"[1] and "libADLMIDI"[2] are different projects.  Only the latter is
targeted by the contributed feature.  Adjust the release note to use the
name of the latter instead of letting readers guess which project is
intended.

[1]: https://github.com/bisqwit/adlmidi
[2]: https://github.com/Wohlstand/libADLMIDI

Reported-by: Wohlstand <https://github.com/dxx-rebirth/dxx-rebirth/issues/407#issuecomment-430997300>
Fixes: a76487405c ("Make ADL MIDI runtime configurable")
2018-10-21 00:24:07 +00:00
Kp 931ea05f41 Merge branch experimental/adlmidi into master
Add experimental support for using ADL MIDI instead of SDL for music
playback.  Support for ADL MIDI contributed by Github user jpcima.  This
feature is minimally supported by the core Rebirth team, but is included
as a courtesy so that users need not patch in support separately.

Suggested-by: jpcima <https://github.com/dxx-rebirth/dxx-rebirth/pull/408>
2018-10-18 02:19:15 +00:00
Kp a76487405c Make ADL MIDI runtime configurable
Add configuration file entries for number of chips, bank index, and
whether to use ADL MIDI.  Currently, there is no GUI for this.
Interested users must enable it via direct configuration file editing.
A menu interface will come later.
2018-10-18 02:18:56 +00:00
Kp 787d95241c Fix crash after pausing movie
The movie code assumes that when the topmost window is closed, that
window must have been the movie window, and that the movie data can now
be freed.  However, if the movie is paused, a new topmost window is
created to tell the user that the movie is paused.  When that topmost
pause window is deleted, the movie code frees the movie data, even
though the movie is not done.  Corruption ensues, ultimately leading to
a crash.

Reported-by: Jayman2000 <https://github.com/dxx-rebirth/dxx-rebirth/issues/410>
2018-10-10 02:01:12 +00:00
Kp fe77949a82 Vary marker spin 2018-10-08 03:58:48 +00:00
Kp 75fd917980 Fix truecolor handling in mve playback
This has been broken for more than 5 years and no one reported it.
Perhaps truecolor movies are not used.

Fixes: acb664ae40 ("Use proper type for mve backbuffers")
2018-10-01 03:52:05 +00:00
Kp 82a2fa525c Pass Robot_info, valptridx factories to more methods 2018-09-19 02:13:29 +00:00
Kp 12b57e84e6 Switch most in-tree http:// links to https://
For each link given as http://, verify that the site is accessible over
https:// and, if so, switch to it.  These domains were converted:

* llvm.org
* clang.llvm.org
* en.cppreference.com
* www.dxx-rebirth.com
* www.libsdl.org
* www.scons.org
2018-09-02 00:57:29 +00:00
Kp ec1cf005b6 Enable -Wformat-truncation
Add macro cf_assert ("control flow" assert) to hint to gcc that certain
conditions are impossible.  Use it to avoid generating range checks for
situations that never happen.  If the event did happen, the only
consequence would be truncated UI text, rather than a correctness
problem.
2018-08-26 18:10:36 +00:00
Kp bba8a327a0 Remove use of -Wno-implicit-fallthrough 2018-08-24 02:58:21 +00:00
Kp 524f042659 SDL2: MVE: fix noise from reading undefined sound data
Commit 07245a0bc2 added the SDL_mixer backend for MVE audio.  That
commit set the length of the converted sound equal to the size of the
buffer that SDL requested as a work area.  No one ever touched that
logic, until now.  In SDL1, that choice worked fine.  In SDL2, this
causes garbage to play after the sound, because SDL2 considers the
buffer to be defined only up to the length returned in
`SDL_AudioCVT::cvt_len`.  Bytes beyond that length are undefined[1], and
in practice contain garbage.  Fix the noise by setting the sound length
equal to the length returned by SDL2, so that the undefined bytes are
not treated as sound.  SDL1 also maintains this length value, so no
version-specific logic is required.

[1]: https://wiki.libsdl.org/SDL_ConvertAudio

Reported-by: andrew-strong <https://github.com/dxx-rebirth/dxx-rebirth/issues/398>
2018-08-01 01:18:11 +00:00
Kp 19699037ce Move d2x-rebirth/main/bmread.cpp -> similar/main/bmread.cpp 2018-07-18 04:39:28 +00:00
Kp d20901edba Adjust physfsrwops.cpp for SDL2
References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/82>
2018-06-27 03:34:34 +00:00
Kp 20caecfa0e Eliminate most uses of segment * 2018-06-24 05:06:15 +00:00
Kp 2de3a1dd06 Pass unique_segment to objects_in 2018-06-24 05:06:14 +00:00
Kp a0fd264133 Tighten checks on create_path_points parameters 2018-06-20 04:16:06 +00:00
Kp d355ef4030 Pass font to various drawing functions 2018-05-19 23:21:42 +00:00
Kp fda1eb851e Pass fonts to LINE_SPACING 2018-05-19 23:21:42 +00:00
Kp 08446f0ab6 Pass font to gr_string,gr_printf 2018-05-19 23:21:42 +00:00
Kp f2f41cd60e Fix capitalization of MVE entries
Reported-by: ryusei117 <https://github.com/dxx-rebirth/dxx-rebirth/issues/379#issuecomment-390058146>
Fixes: 6e439e17fd ("Match case for MVE files in MVL archives")
2018-05-18 02:47:32 +00:00
Kp 8f1a8c9cb8 Use menu macros for change_guidebot_name 2018-05-12 18:24:19 +00:00
Kp fca9750105 Add utility script for converting HAM to/from json
This script was written years ago and has sat unused since then.
Recently, someone asked for a copy, so I may as well publish it.  The
HXM support may not have been tested, but the base HAM support can
successfully deconstruct Vertigo and reassemble a bit-wise identical
copy.
2018-04-15 21:48:32 +00:00
Kp 8096af91da Add support for shuffling powerups in anarchy games 2018-04-12 04:19:35 +00:00
Kp 25d623fac5 Mark buddy_message_* functions as printf format
clang issues -Wformat-nonliteral when `vsnprintf` is passed the format
string from its caller.  This is generally not useful.  Fortunately, the
warning can be suppressed by annotating the function as format(printf).
Presumably, this is because clang now trusts that the caller would have
been warned for a bad format string.

Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/369>
Fixes: dc79bb8e4a ("Remove hack for bypassing buddy time restriction")
2018-04-03 03:20:08 +00:00
Kp 9b028f26f2 Make eclip_num unsigned 2018-03-31 21:53:01 +00:00
Kp a3871cfefd Tighten eclip::dest_bm_num handling
Instead of testing for -1, test for any out-of-range value.
2018-03-31 21:53:01 +00:00
Kp dc79bb8e4a Remove hack for bypassing buddy time restriction 2018-03-27 03:49:34 +00:00
Kp 53a1d5f9ce Pass vertex factory to compute_segment_center 2018-03-12 03:43:47 +00:00
Kp 2cac55d6c7 Raise max marker limit to 4 for cooperative games 2018-03-10 22:45:04 +00:00
Kp 7dee4ca49f Move MarkerMessage[] into wrapper d_marker_state
Also, fix an ancient bug with the automap handling of markers caused by
WET anti-pattern.
2018-03-10 18:32:02 +00:00
Kp 553c9d4ab6 Add #if test to support SDL2 RWops prototypes 2018-03-02 03:19:02 +00:00
Kp 131c1b9f4d Add support for PNG screenshots 2018-02-18 00:42:42 +00:00
Kp 01e1b28d71 Replace useless printf with puts 2017-12-05 05:29:55 +00:00
Kp 479ac8761f Add experimental D2 support for D1 style robot briefings 2017-11-13 01:59:49 +00:00
Kp 49c0cdae2e Simplify calls to gr_set_default_canvas
Rather than use an inline wrapper and rely on the compiler optimizer to
redirect gr_set_current_canvas(nullptr) to gr_set_default_canvas,
rewrite all relevant calls directly in the source.

git grep -l 'gr_set_current_canvas' | xargs sed -i -e 's:gr_set_current_canvas(\s*NULL\|nullptr\s*);:gr_set_default_canvas();:'
2017-11-05 20:49:08 +00:00
Kp 3fbc710ec5 Move various SDL-only scanline functions to !DXX_USE_OGL
The OGL build compiles, but does not use, various scanline functions.
Move these to be built only for the SDL build.
2017-11-01 02:01:20 +00:00
Kp 3276590084 Merge branch 'psyke83/rpi' into master
psyke83 reports that Debian distributions for Raspberry Pi now require a
different name for some video libraries.  Merge psyke83's SCons
enhancements to add support for the new names while retaining support
for the old names.
2017-10-26 02:02:50 +00:00
Conn O'Griofa 166b1ecd4d RPI: update vendor library names & add Mesa VC4 build support
Vendor library has new names to avoid conflicts with Mesa. Update
raspberrypi argument to use new libraries and support Mesa VC4 driver.

* raspberrypi=1 will build against the (newly named) vendor libraries
* raspberrypi=mesa will target building against the VC4 driver.

Both will select GLES by default, but you can target GL for the VC4 driver
via "raspberrypi=mesa opengles=0"
2017-10-22 02:50:13 +00:00
Kp e035fb215a Cache width in libmve decoder 2017-10-14 17:10:31 +00:00
Kp 22b22a4a70 Use enumerate for verifying Effects 2017-10-14 17:10:31 +00:00
Kp 88832e3679 Use constexpr integral_constant for various magic numbers 2017-10-14 17:10:30 +00:00
Kp d4e8a92932 Apply SoundFx control to in-game movies
lukeman3000 asked how to control the volume of the in-game movies.
Prior to this commit, there was no in-game solution to this.  This
change scales movie audio by the SoundFx slider.

Thanks to lukeman3000 for inspiring this change.  Thanks to Ryusei117
for explaining what videos needed to be affected, and for testing an
earlier iteration of the change.

Requested-by: lukeman3000 <https://forum.dxx-rebirth.com/showthread.php?tid=986>
2017-10-01 20:31:34 +00:00
Kp f60c783ef5 Move marker preservation into object lifeleft update 2017-09-30 18:00:15 +00:00
Kp d7e97ca299 Remove write-only Escort_kill_object
Parallax never implemented Escort_kill_object because it was considered
too much work.  Remove the write-only vestiges of that feature.
2017-09-26 04:15:50 +00:00
Kp a24490033f Allow players to remove thief at level start
Commit f4b21088a0 ("Track vulcan ammo explicitly") fixed an original
retail bug that prevented the thief from stealing energy weapons,
because the thief could only steal weapons for which the player had ammo
and energy weapons never have ammo.  This went unremarked for several
years, until a recent report of the new semantics as a game-breaking
regression because the thief is now "ridiculously potent".

Address this report, as well as an intermittently raised issue from
various users over time, by adding two new knobs to both the single
player "Gameplay" menu and the multiplayer setup screen: "Remove Thief
at level start" and "Prevent Thief Stealing Energy Weapons".

"Remove Thief" deletes the thief object during level load.  It has no
impact on save games, and changing it after entering a level has no
effect on any thief already in the level.

"Prevent Thief Stealing" is checked at the moment of theft and, when
enabled, prevents stealing primary weapons other than Vulcan/Gauss.
This can be changed at will in single player and is immediately
effective.  In multiplayer, this option can only be changed by the game
host in the pre-game setup.

For both knobs, there is one pair of checkboxes to control this as a
player preference, which applies in single player games.  There is a
second pair of checkboxes in the multiplayer setup, which applies only
to multiplayer games.  Therefore, in multiplayer, the host chooses thief
settings and all clients use the host's choice.  The host may configure
the thief differently in multiplayer from how the host plays in single
player.

For users who wanted to remove the thief, no specific tally has been
kept for who requested it or when.  Now that the code is being updated,
this is thrown in as an easy addition.

Reported-by: MegaDescent <http://forum.dxx-rebirth.com/showthread.php?tid=980> (for the thief stealing energy weapons as a game-breaking regression)
2017-08-26 19:47:52 +00:00
Kp 4ea9ef5b0c Use reference for robot_info 2017-08-26 19:47:51 +00:00
Kp aa56477742 Propagate objects_in arguments 2017-08-13 20:38:31 +00:00
Kp 8c350ed5a5 Split drop_powerup path for dropping robots 2017-08-11 23:43:53 +00:00
Kp 92d6234c6f Factor out thief steal sound 2017-08-06 17:25:46 +00:00
Kp 0a08c4fa06 Simplify thief primary weapon steal logic 2017-08-06 17:25:46 +00:00
Kp 7b12619c3a Unify resource file compilation 2017-08-02 02:49:12 +00:00
Kp 73d92bb509 Make wclip::num_frames uint16_t 2017-06-17 23:05:16 +00:00
Kp 7b16571cb2 Rename countarray method count -> size 2017-06-10 03:31:03 +00:00
Kp 430f7832aa Move valptridx factories into array_managed_type 2017-06-10 03:31:03 +00:00
Kp 599ac9dee0 Always qualify valptridx type/factory
Previously, valptridx used PREFIX for allow-invalid+mutable, c#PREFIX
for allow-invalid+const, v#PREFIX for require-valid+mutable, vc#PREFIX
for require-valid+const.  Convert the types, factories, and all usage
sites to specify a qualifier for all four combinations:

	im#PREFIX -> allow-invalid+mutable
	ic#PREFIX -> allow-invalid+const
	vm#PREFIX -> require-valid+mutable
	vc#PREFIX -> require-valid+const

Changes to common/include/valptridx.h and common/include/fwd-valptridx.h
are manual.  All other changes are generated by:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\(v\?\)\(\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/\1m\2/g'

for the 'm' prefix and:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\([cm]\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/i&/g'

for the 'i' prefix.
2017-06-10 03:31:02 +00:00
Kp 170d0ac777 Pass canvas &to nm_draw_background 2017-04-08 16:48:20 +00:00
Kp d5ed019014 Add experimental MP-aware mouselook 2017-03-25 19:34:02 +00:00
Kp 829e95b6f8 Separate hoard/proximity tracking 2017-03-18 18:07:36 +00:00
Kp 34b603ad71 Expand bomb spin variance
Let D1 proximity bombs spin.  Let D2 smart mines and pre-placed mines
spin.
2017-03-11 19:56:26 +00:00
Kp f080508d6c Cache canvas in movie.cpp 2017-03-10 01:22:25 +00:00
Kp ba914fea81 Pass up various return values 2017-02-26 00:00:02 +00:00
Kp 9dbc7c5cfe Pass up return value of ok_for_buddy_to_talk 2017-02-26 00:00:02 +00:00
Kp c14002f10a Pass up return value of maybe_steal_primary_weapon 2017-02-26 00:00:02 +00:00
Kp 06e6a800db Pass up return value of maybe_steal_secondary_weapon 2017-02-26 00:00:01 +00:00
Kp c7d53e9401 Pass up return value of maybe_steal_flag_item 2017-02-26 00:00:01 +00:00
Kp 6cd6189681 Never pass nullptr to ai_door_is_openable
When objp is nullptr, ai_door_is_openable assumes Buddy_objnum is a
valid object number, but this assumption is not guaranteed to be true.
When it is false, the game crashes.  This crash can be triggered by a
brain robot trying to make nearby robots snipe.

Fix the crash by passing the robot of interest.

Reported-by: Yarn <http://www.dxx-rebirth.com/frm/index.php/topic,2165.0.html>
2017-02-19 19:33:45 +00:00
Kp 6b8f08142f Pass canvas to LINE_SPACING
Macro LINE_SPACING previously used global grd_curcanv implicitly.
Change it to take a canvas argument.  Change all callers to pass
grd_curcanv, so that usage is explicit.
2017-02-11 21:42:42 +00:00
Kp 6f81d13c41 Pass canvas to gr_set_curfont 2017-02-11 21:42:38 +00:00
Kp b2b19446de Cache canvas in show_escort_menu 2017-02-11 21:42:37 +00:00
Kp f8b057d43d Pass canvas to gr_bm_ubitbltm 2017-02-11 21:42:32 +00:00
Kp ae33aaafc1 Pass canvas to gr_set_fontcolor 2017-02-11 21:42:32 +00:00
Kp 9c330da29f Prevent guidebot crash on unattainable goal
Yarn reported that Descent 2: Counterstrike level 9 can place the
guidebot in a situation where

    (Escort_goal_index == object_guidebot_cannot_reach &&
    Escort_special_goal != ESCORT_GOAL_UNSPECIFIED)

If this happens and the player grabs a powerup, then the game crashes
trying to check if the grabbed powerup was of the type that the guidebot
sought.  Since the guidebot was not seeking any object, the answer is
that this is not the sought object.

The design ought not set Escort_goal_index to an invalid object index,
but it does.  Fixing that is too invasive for now.  Add a special case
to prevent this crash.

Reported-by: Yarn <http://www.dxx-rebirth.com/frm/index.php/topic,2158.0.html>
2017-01-29 18:54:52 +00:00
Chris Taylor 30b5ef7c73 Create robot_create function and use it 4x
Contains 2 calls - to obj_create and init_ai_object. For safety reasons and tidiness compared to using obj_create directly. The call to init_ai_object in recreate_thief was already redundant.
2017-01-22 17:56:50 +08:00
Kp 764d20d4e1 Make grs_bitmap::bm_flags private 2017-01-15 00:03:13 +00:00
Kp 5da784dbed Pass canvas to gr_{,u}string 2017-01-08 22:32:00 +00:00
Kp 1ef6b9d5bc Pass font to gr_get_string_size 2017-01-08 22:31:59 +00:00
Kp 0905aefa0a Pass canvas to gr_rect 2017-01-01 00:45:45 +00:00
Kp b3809266a3 Use enumerate in more loops 2016-12-11 01:56:44 +00:00
Kp 2f179b1f48 Simplify compute_average_pixel loop 2016-12-11 01:56:44 +00:00
Kp f3ebdca557 Return segidx from escort_get_goal_segment 2016-12-05 00:26:10 +00:00
zico ad5a5047d4 Improved handling for Guidebot goals that are not objects: Set object_none to Escort_goal_index for ESCORT_GOAL_EXIT, ESCORT_GOAL_ENERGYCEN and ESCORT_GOAL_SCRAM. Changed handling for ESCORT_GOAL_EXIT to work like ESCORT_GOALFUELCEN (without needing Escort_goal_index). Let detect_escort_goal_accomplished() bail if Escort_goal_index == object_none (replacing case ahndling for ESCORT_GOAL_SCRAM). Minor formatting improvements of detect_escort_goal_accomplished() and removal of stub case of ESCORT_GOAL_FUELCEN. 2016-11-29 19:30:16 +01:00
Kp f4b7b958cb Revert "Fold escort_set_goal_object calls to exists_in_mine"
This reverts commit 03b0222896.

Commit 03b0222 caused the guidebot to skip over later key goals if an
earlier key goal was unnecessary.  This is incorrect.  Revert it.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/271>
2016-11-21 01:57:08 +00:00
Kp dc881ec12d Merge pull #266 into master 2016-11-19 18:09:26 +00:00
Kp 223a9dfd56 Pass grs_bitmap &to piggy_register_bitmap 2016-11-19 17:24:53 +00:00
Chris Taylor cc3f35649f Change all occurrences of "Couldn't" to "Could not" for consistency ("Could not" is more common and wins).
Not touching TXT_COULDNT because it's stored separately in hog file.
2016-11-13 13:27:18 +08:00
Chris Taylor 143ed30fee Merging in unification/master, resolving conflict in similar/main/kmatrix.cpp 2016-11-06 14:20:18 +08:00
Kp 99114e643b Move escort_menu_handler into escort_menu 2016-10-29 23:16:15 +00:00
Chris Taylor 7ac820248c Use new event_process_all() for event loops that check for window_event_result::deleted (which is most of them) 2016-10-29 20:06:01 +08:00
Chris Taylor abd6d4a052 Check for window_event_result::deleted for RunMovie polling loop
This is instead of using window_exists, which could give a false positive if a new window was allocated with the same pointer value as a deleted one.
2016-10-28 15:37:38 +08:00
Kp b787a641e1 Pass player_info to escort_create_path_to_goal 2016-10-28 03:39:41 +00:00
Kp b362d67d84 Fold bm_load_sub call to gr_remap_bitmap_good 2016-10-28 03:39:40 +00:00
Chris Taylor 2d587de8dc Make call_default_handler return a window_event_result
Make call_default_handler return a window_event_result to inform the event system in future, particularly if a window was closed.
2016-10-27 16:36:24 +08:00
Kp 01f2932824 Pass grs_canvas &to window_create 2016-10-15 00:53:20 +00:00
Kp d903a5db3b Pass powerup_flags to exists_fuelcen_in_mine 2016-10-15 00:53:20 +00:00
Kp a1b5d93740 Pass powerup_flags to escort_get_goal_segment 2016-10-15 00:53:20 +00:00
Kp e5cd034f74 Pass powerup_flags to exists_in_mine 2016-10-15 00:53:20 +00:00
Kp 03b0222896 Fold escort_set_goal_object calls to exists_in_mine 2016-10-15 00:53:20 +00:00
Kp 5bc17b90d2 Use range_for in draw_subtitles 2016-10-15 00:53:15 +00:00
zico 63ca86698e Added communication for tracker written by A Future Pilot 2016-10-10 18:19:56 +02: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 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 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 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
kreatordxx b87fcad332 Merge pull request #230 from dxx-rebirth/allow_window_subclasses_2
Allow window subclasses
2016-10-03 10:36:26 +08:00
Chris Taylor 87617e8ac9 Allow dcx::window struct to be subclassed - step 3
Allow dcx::window struct to be subclassed step 3. This step adds the window destructor and both requires and implements the window to be deleted by the event handler/client in all cases.
2016-10-02 17:49:19 +08:00
Kp dc7c718b66 Pass player powerup_flags to create_bfs_list 2016-10-02 00:34:47 +00:00
Kp 022aaebe41 Pass player powerup_flags to segment_is_reachable 2016-10-02 00:34:44 +00:00
Kp ab89513454 Pass player_info to auto_select_primary_weapon 2016-10-02 00:34:43 +00:00
Kp 1be7344d56 Pass player_info to auto_select_secondary_weapon 2016-10-02 00:34:43 +00:00