Commit graph

996 commits

Author SHA1 Message Date
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
Kp e9eaf53c8a Pass player powerup_flags to ai_door_is_openable 2016-10-02 00:34:42 +00:00
Kp 8cfa1508b6 Pass player powerup_flags to escort_set_goal_object 2016-10-02 00:34:41 +00:00
Kp ae74c6c43a Pass reference segment number to choose_thief_recreation_segment 2016-10-02 00:34:41 +00:00
Kp e6e00debba Pass only segidx to pick_connected_segment
A full object is not necessary.
2016-10-02 00:34:41 +00:00
Kp ce65735c04 Expand get_local_player_flags
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-10-02 00:34:40 +00:00
Kp 62b58e9890 Move OGL to dxxsconf.h; rename to DXX_USE_OGL
Rename symbol OGL to DXX_USE_OGL to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -lzw OGL -- '*.h' '*.cpp' | xargs -0 sed -i -e 's/\(\s*#\s*if\)def\s*OGL/\1 DXX_USE_OGL/' -e 's/\(\s*#\s*if\)ndef OGL/\1 !DXX_USE_OGL/' -e 's/\(\s*#\s*if !\?\)defined(OGL)/\1DXX_USE_OGL/'
2016-09-24 18:06:11 +00:00
Kp 6a3ded191f Move EDITOR to dxxsconf.h; rename to DXX_USE_EDITOR
Rename symbol EDITOR to DXX_USE_EDITOR to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
2016-09-11 18:49:16 +00:00
Kp ddf888cd72 Move USE_SDLMIXER to dxxsconf.h; rename to DXX_USE_SDLMIXER
Rename symbol USE_SDLMIXER to DXX_USE_SDLMIXER to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct and
inferno.cpp were manual.

git grep -l USE_SDLMIXER -- '*.h' '*.cpp' | xargs sed -i -e 's/^#ifdef \(USE_SDLMIXER\)$/#if DXX_\1/' -e 's/#\(el\)\?if \(.*\)defined(\(USE_SDLMIXER\))/#\1if \2DXX_\3/'
2016-09-11 18:49:15 +00:00
Kp 39285423db Switch movie.cpp to reinterpret_cast 2016-09-04 00:02:52 +00:00
Kp ea153a60fa Switch libmve to C++ casts 2016-09-04 00:02:52 +00:00
Kp 1a71e4a590 Remove unnecessary cast in compute_average_pixel 2016-09-04 00:02:52 +00:00
Kp 439d82955f Switch mveplay.cpp to reinterpret_cast 2016-09-04 00:02:52 +00:00
Kp c802f27968 Switch physfsrwops.cpp integer casts to static_cast 2016-09-04 00:02:50 +00:00
Kp 75241fbbd7 Switch physfsrwops.opp pointer casts to reinterpret_cast 2016-09-04 00:02:50 +00:00
Kp 01de8f95c1 Check segment index in ok_for_buddy_to_talk 2016-09-04 00:02:50 +00:00
Kp f5bed7b7d8 Remove unnecessary copy in ok_for_buddy_to_talk 2016-09-03 17:30:18 +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
Kp 335f24ac31 Move Primary_weapon to player_info 2016-08-28 22:41:49 +00:00
Kp b7a5f65d5b Move Secondary_weapon to player_info 2016-08-28 22:41:48 +00:00
Kp bbdecad649 Add helper macro to handle printf .* conversion for 32/64
Field width conversion `.*` always takes an `int`.

On Win32, casting `long` to `int` triggers a `-Wuseless-cast` warning.
Omitting the cast works correctly.

On Linux/amd64, casting `long` to `int` works correctly.
Omitting the cast triggers a `-Wformat` warning.

Add a macro that conditionally expands to `static_cast<int>` or to ``,
as necessary for the target platform.
2016-08-19 03:41:41 +00:00
Kp 9be68f4e99 Add SConf test for struct timespec 2016-08-19 03:41:40 +00:00
Kp cb99240c2c Remove useless casts in d2x-rebirth/libmve/decoder8.cpp 2016-08-17 04:44:22 +00:00
Kp 7f3b725c40 Use std::swap to exchange mveplay back buffer pointers 2016-08-17 04:44:22 +00:00
Kp c97e9af14c Use player object passed to maybe_steal_secondary_weapon 2016-07-25 03:48:09 +00:00
Kp c636dc4b98 Convert various static const expressions to constexpr 2016-07-16 16:52:04 +00:00
Kp ab09fa1931 Reorder Buddy_sorry_time update 2016-07-14 01:59:02 +00:00
Kp 613a7ecbbb Rewrite parenthesized uses of uint to standard unsigned 2016-07-14 01:59:02 +00:00
Kp 0b6af7fcbe Propagate MAX_OBJ_BITMAPS 2016-07-10 04:11:35 +00:00
Kp 6580c37b6e Propagate MAX_STOLEN_ITEMS 2016-07-10 04:11:34 +00:00
Kp a3766a60e3 Remove unnecessary Stolen_item_index modulo 2016-07-10 04:11:34 +00:00
Kp 3779bc25a0 Define Robot_names only if EDITOR 2016-07-09 17:58:34 +00:00
Kp fee76e6ced Define Powerup_names only if EDITOR 2016-07-09 17:58:34 +00:00
Kp b0a2205a4e Convert various pointer casts to reinterpret_cast 2016-07-06 01:54:24 +00:00
Kp 19f31eb420 Rewrite simple pointer casts from C style to reinterpret_cast<>
This pass only targets int8_t and uint8_t.

s/(\s*\(u\?int8_t\s*\*\+\)\s*)\s*(/reinterpret_cast<\1>(/g
2016-07-03 00:54:14 +00:00
Kp a7ceee3c03 Add parentheses around target of simple unsigned char casts
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of simple C casts.

s/(\s*unsigned\s\+char\s*\(\*\+\)\s*)\s*\([&+-]\?\)\([[:alnum:]_.]\+\s*->\s*\)*\([[:alnum:]_.]\+\)\(\s*\([];+>)*\/^%,|&<>]\)\|$\|\(\s*-\s*[^>]\)\)/(uint8_t \1)(\2\3\4)\5/g
2016-07-03 00:54:14 +00:00
Kp 3469ff8c34 Change (short*) to (int16_t*)
Uses of `(short*)` usually want exactly a 16-bit signed integer.  Most
platforms provide that as `short`, but that is not guaranteed.

s/(short \(*\+\)\s*)/(int16_t \1)/g
2016-06-27 04:11:13 +00:00
Kp a4967ffceb Move various robot data into namespaces 2016-06-25 23:21:36 +00:00
Kp 65f68877aa Rewrite simple integer casts from C style to static_cast<>
This pass only targets commonly used standard types.

s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\)\s*)\s*(/static_cast<\1>(/g
2016-06-16 03:56:44 +00:00
Kp 0cb099c5e4 Add parentheses around casts of simple function calls
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of simple C casts.

Exclude float|double from the second substitution.  Including it
rewrites medmisc.cpp in an incorrect way, and excluding it does not
exclude any valid rewrites.

s/(\(int\|signed\|float\|double\|long\|short\|unsigned\))\s*\(\w\+\s*(\s*\w\+\s*)\)/(\1)(\2)/
s/(\((\(int\|signed\|long\|short\|unsigned\))(\w\+\s*(\s*\w\+\s*))\))/\1/g
2016-06-16 03:56:44 +00:00
Kp 1b12a3f7ef Add parentheses around target of more complicated casts
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of some C casts.

This pass attempts to process expressions that involve parenthesized or
bracketed subexpressions, but only if those subexpressions do not
themselves contain parenthesized or bracketed subexpressions.

	(int) f(1);	// changed
	(int) f(g());	// not changed

perl -p -i -e 's/(\(\s*((?:un)?signed|int|char|short|long|float|double|s?size_t|(?:u?int[[:digit:]]+_t))\s*\**\s*\)\s*)([&+-]?)([[:alnum:]_.]+\s*->\s*)*([[:alnum:]_.]+)((?:\s*(?:\[[^][]*\])*|(?:\([^()]*\))*))(\s*([;+>*\/^%,|&<>])|$|(\s*-\s*[^>]))/\1\(\3\4\5\6\)\7/g'
2016-06-12 03:45:37 +00:00
Kp b282bea173 Rewrite simple integer casts from C style to static_cast<>
This pass only targets commonly used standard types.

s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\)\s*)\s*(/static_cast<\1>(/g
2016-06-05 01:04:26 +00:00
Kp 7fdce88558 Add parentheses around target of simple casts
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of simple C casts.

This pass does not attempt to process expressions that involve
any subexpression that can nest arbitrarily, such as parentheses or
brackets.  It also works only on commonly used standard types.

	(int) a->b;	// changed
	(int) a[b];	// not changed

s/\((\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\s*\**\s*)\s*\)\([&+-]\?\)\([[:alnum:]_.]\+\s*->\s*\)*\([[:alnum:]_.]\+\)\(\s*\([];+>)*\/^%,|&<>]\)\|$\|\(\s*-\s*[^>]\)\)/\1(\5\6\7)\8/g
2016-06-05 01:04:25 +00:00
Kp 20163c49bc Fold gr_remap_bitmap_good call in D2 ab_load 2016-05-28 17:31:27 +00:00
Kp dcc56e6b39 Propagate bm_mode::linear into iff_read_bitmap 2016-05-28 17:31:27 +00:00
Kp 398596c468 Use enum for bitmap mode 2016-05-28 17:31:26 +00:00
Kp 48431682ba Fix -Wshadow warnings in gamedata_read_tbl 2016-05-22 17:49:31 +00:00
Kp f9f7ce08db Fix -Wshadow warnings in bm_read_sound 2016-05-22 17:49:31 +00:00
Kp 0e085e4799 Pass thief ID to recreate_thief 2016-04-06 03:34:15 +00:00
Kp 5b3a36e6b8 Remove valptridx operator-(P *, A &) 2016-04-06 03:34:13 +00:00
zico 7d83eb1e62 Long overdue update for README files considering officially supported Windows versions 2016-03-30 13:30:47 +02:00
Kp 195c589e3f Move file-local classes into anonymous namespace 2016-03-04 04:12:35 +00:00
Kp cc18ad2b68 Fix some -Wshadow warnings 2016-02-12 04:02:28 +00:00
Kp f4e1ebb576 Remove unnecessary gr_setcolor calls 2016-02-12 04:02:28 +00:00
Kp 23047b1165 Pass color to gr_rect 2016-02-12 04:02:28 +00:00
Kp 553b313099 Use vwallptr 2016-02-12 04:02:28 +00:00
Kp 2fd6a425b0 Remove highest_valid 2016-02-12 04:02:28 +00:00
Kp b57f08c798 Use partial_const_range 2016-02-12 04:02:28 +00:00
Kp 6e20d86941 Move OF_PLAYER_DROPPED into drop_powerup
This fixes an issue where calling drop_powerup with num > 1 only tagged
one powerup as player-dropped.

This also changes powerups dropped by the thief to be "player-dropped",
since, aside from the initial shields/energy, they came from the player
originally.
2016-02-06 22:12:55 +00:00
Kp ec025d4e88 Pass common highest_valid to vptr factory 2016-02-06 22:12:54 +00:00
Kp 2bddeaaadf Remove sprintf from D2 bmread.cpp 2016-01-09 16:38:16 +00:00
Kp 86709f547b Fix capitalization of PHYSFS_File
Per comment in physfs.h, the spelling PHYSFS_file is deprecated.
Replace all instances with PHYSFS_File.
2016-01-09 16:38:14 +00:00
Kp a3ae630829 Remove default argument for basic_ptridx(index) 2016-01-09 16:38:14 +00:00
Kp 98f5afa9f8 Remove default argument for basic_ptr(pointer,array &) 2016-01-09 16:38:13 +00:00
Kp e8c34be843 Use v*ptr* factories with highest_valid 2015-12-22 04:18:51 +00:00
Kp d479819931 Use absolute_sibling to reduce global references for ptridx 2015-12-22 04:18:51 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp 2b51578ba6 Use enum class for Player_dead_state (formerly Player_is_dead) 2015-12-15 04:09:35 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp 8109379fdd Use inline namespace dsx for similar/misc/ 2015-12-13 18:00:48 +00:00
Kp 8a97c173a3 Remove useless gr_remap_mono_fonts
gr_remap_mono_fonts searches for fonts with !(font->ft_flags & FT_COLOR)
and calls gr_remap_font on any it finds.

gr_remap_font starts with:

	if (!(font->ft_flags & FT_COLOR))
		return;
2015-12-04 03:36:32 +00:00
Kp a9b82e3f7f Make vlighting static 2015-12-04 03:36:31 +00:00
Kp 708dc0a7e1 Use vobjptr/vcobjptr for more Objects[] access 2015-12-03 03:26:49 +00:00
Kp b683b4cc68 Scope weapon type 2015-12-03 03:26:49 +00:00
Kp 0c75aecc45 Check most uses of object id 2015-11-27 03:56:13 +00:00
Kp 7153ec69a9 Move SndNoSound to CGameArg 2015-11-24 04:05:36 +00:00
Kp a579f75d05 Move SndDisableSdlMixer to CGameArg 2015-11-24 04:05:36 +00:00
Kp 82d0c2ed96 Make some implicit uses of ptridx construction explicit 2015-11-19 03:23:34 +00:00
Kp 0ebe9e48b8 Remove buddy's useless Player_is_dead test
The headlight should be off when the player is dead.
2015-11-14 18:17:20 +00:00
Kp 6b353cb9ac Move player powerup_flags to object.ctype.player_info 2015-11-07 21:55:59 +00:00
Kp 8a81e25ab0 Move player laser_level to object.ctype.player_info 2015-11-07 21:55:59 +00:00
Kp b788d0b563 Move player primary_weapon_flags to object.ctype.player_info 2015-11-07 21:55:59 +00:00
Kp 6037372cdf Move player vulcan_ammo to object.ctype.player_info 2015-11-07 21:55:59 +00:00
Kp 6fd6436f14 Move player energy to object.ctype.player_info 2015-11-07 21:55:58 +00:00
Kp dc5dfb80e8 Use macro get_local_player_secondary_ammo for player's secondary_ammo 2015-10-30 02:52:56 +00:00
Kp 070444157e Use type safe player flags 2015-10-30 02:52:55 +00:00
Kp e130ea7b36 Remove unnecessary secondary_weapon_flags 2015-10-30 02:52:53 +00:00
Kp edea687627 Remove HAVE_STRUCT_TIMEVAL
SConstruct defines it for all platforms.  It is only false on Mac OS 9,
which is no longer supported.
2015-10-27 03:04:49 +00:00
Kp cf9f777187 Simplify select_tmap
Remove unreachable nullptr case.  Use case-sensitive comparison.  Remove
unsupported entry i386 from documentation.
2015-10-21 02:45:44 +00:00
Kp 21057db809 Move DbgSafelog, DbgVerbose to CArg 2015-10-18 21:01:21 +00:00
Kp 533f1cb3bb Qualify references to primary weapons 2015-10-18 21:01:18 +00:00
John Ackerman a606caa2b4 Improve .ini files and help message output 2015-10-11 22:21:00 +00:00
Kp 36c52f7437 Reduce pointer->int->pointer conversions for thief 2015-10-10 03:44:14 +00:00
Kp 78de0ac119 Add fwd-event.h with forward declarations of event.h 2015-10-09 02:46:10 +00:00
Kp edccaa91f6 Check return of pick_connected_segment before use 2015-09-29 02:41:22 +00:00
Kp d9cef82f81 Allow nullptr for gr_get_string_size 2015-09-29 02:41:22 +00:00
Kp bec81b2e62 Cache get_local_player in do_escort_frame 2015-09-26 21:17:13 +00:00
Kp 5d902ad361 Shorten drop_stolen_items 2015-09-26 21:17:13 +00:00
Kp b87db8d9e8 Factor out thief message call 2015-09-26 21:17:13 +00:00
Kp c4a8432081 Remove WORDS_NEED_ALIGNMENT memcpy src cast to const uint8_t*
The cast provokes a warning on systems that require alignment, so remove
it.  memcpy takes const void* input, so the cast is unnecessary.

Reported-by: MattWatt <https://github.com/dxx-rebirth/dxx-rebirth/issues/119>
2015-09-13 21:02:19 +00:00
Kp fd5d7b800d Move reactor gun loop into calc_controlcen_gun_point 2015-08-26 03:15:10 +00:00
Kp 17b1943c5e Mark various per-file structures as static 2015-08-12 03:11:46 +00:00
Kp cfd08b5d6c Suppress physfsx read/write macros in physfsrwops.cpp 2015-07-25 23:10:48 +00:00
Kp a2816617fe Pass reactor& to read_model_guns 2015-07-25 23:10:48 +00:00
Kp de06f639fd Pass grs_bitmap& to set_lighting_flag 2015-07-25 23:10:47 +00:00
Kp c942d28197 Use accessor for grs_bitmap::bm_type 2015-07-25 23:10:47 +00:00
Kp bda7fef3a0 Use get_local_player to compute reference to local player 2015-07-25 23:10:46 +00:00
Kp f38e80c053 Use get_local_plrobj to compute reference to object of local player 2015-07-25 23:10:45 +00:00
Kp 15fb75c1c7 Fix check_header_includes build 2015-07-25 23:10:45 +00:00
Kp 0fea8ec2b8 Use valptr for escort.cpp 2015-07-12 01:04:22 +00:00
Kp e3308be8b9 Cache font LINE_SPACING 2015-06-13 22:42:22 +00:00
Kp ce72014e2e Always parse WORDS_BIGENDIAN and !WORDS_BIGENDIAN 2015-06-13 22:42:21 +00:00
Kp 03921dfd83 Move d2x-rebirth/include/* -> d2x-rebirth/main/ 2015-06-13 22:42:21 +00:00
Kp 215e2dca81 Remove unused libpng support
HAVE_LIBPNG has not been set since 2004 when
3325c0b52b ("remove old OSX bundle stuff")
commented out the autoconf check to set it.
2015-06-13 22:42:21 +00:00
Kp 3980c5d472 Use valptr for escort highest_valid 2015-06-13 22:42:16 +00:00
Kp 61019b9dab Refactor escort code to make it work under strict checks 2015-06-13 22:42:15 +00:00
Kp 678f462c45 Fix buggy guidebot detection of retrieving a key 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 53a7798d80 Simplify fix_sincos calls 2015-06-02 03:03:31 +00:00
Kp 3ec6340cb4 Update open-coded tests for object_none 2015-05-28 03:08:40 +00:00
Kp 73300a285d Merge "change u_int*_t to C99 standard uint*_t"
Requested-by: btb <https://github.com/dxx-rebirth/dxx-rebirth/pull/67>
Acked-by: Matt1360 <https://github.com/dxx-rebirth/dxx-rebirth/pull/67#issuecomment-104806115>
2015-05-23 17:36:29 +00:00
Kp 7243e76c80 Fix gcc-4.6 decoder8 build
Fixes: 8a28f7e1c2 ("Use array<> for movie decoder")
2015-05-22 03:33:20 +00:00
Bradley Bell bdacd2f7d7 change u_int*_t to C99 standard uint*_t 2015-05-18 17:12:53 -07:00
Kp 0ece005dfa Use screen_mode for screen resolution 2015-05-14 02:23:13 +00:00
Kp cf87ebe54d Remove write-only grs_bitmap::bm_handle 2015-05-09 17:38:59 +00:00
Kp 0d564814f5 Convert Primary_weapon to primary_weapon_index_t 2015-04-26 20:15:57 +00:00
Kp 8d849b2b39 Wrap laser level in class
Move enum laser_level_t to weapon.h for the new class.
2015-04-26 20:15:56 +00:00
Kp 144477f92a Open movie file before changing GUI 2015-04-26 20:15:56 +00:00
Kp 6792c1bc4b Enable -Wunused-parameter 2015-04-26 20:15:56 +00:00
Kp 4d046c5336 Split auto_select_weapon 2015-04-26 20:15:51 +00:00
Kp f15ec9c86a Use enum for AIM constants 2015-04-26 20:15:51 +00:00
Kp e883d7c872 Use enum class for AIB constants 2015-04-26 20:15:51 +00:00
Kp f8ac14b737 Convert mvelib to vector<uint8_t> 2015-04-26 20:15:51 +00:00
Kp c338862ad6 Reduce gauges.h includes 2015-04-19 04:18:51 +00:00
Kp 150e2d2686 Convert local arrays to array<> 2015-04-19 04:18:49 +00:00
Kp 5ae5033fed Use enum for AIB constants 2015-04-02 02:36:57 +00:00
Kp 8a28f7e1c2 Use array<> for movie decoder 2015-04-02 02:36:56 +00:00
Kp 9157e5f970 Use enum class for player_awareness_type_t 2015-04-02 02:36:53 +00:00
Kp fca381727c Add wrappers for screen width/height 2015-03-22 18:49:21 +00:00
Kp 6e06c6893f Remove bogus assertion
Stack variables are never placed at NULL.
2015-03-22 18:49:21 +00:00
Kp 7bf49fe551 Fix clang -Wmissing-braces warnings 2015-03-22 18:49:21 +00:00
Kp 1f5190bcfd Fix resource leak closing SDL RW ops
Leak introduced in b3d134a6b7 ("merged
physfs branch"), but this fix only applies after the conversion to RAII.
An equivalent change from SDL_FreeRW->SDL_RWclose is needed for pre-RAII
code.

Fixes: d0de0cf963 ("Use unique_ptr for SDL_RWops")
2015-02-28 22:34:07 +00:00
Kp d6e029194b Fix memory leak on escort menu 2015-02-28 22:34:07 +00:00
Kp 3dfac8350e Use array<> for robot_info 2015-02-28 19:36:01 +00:00
Kp f900d4a5ee Remove RAIIdmem::operator pointer
Mac OS X defines uint_fast32_t to unsigned int, causing ambiguous
overloads between RAIIdmem::operator[](std::size_t) and
RAIIdmem::operator[](int).  Adding a disambiguating overload for OS X
breaks Windows.  Remove operator pointer and operator[].  Rely on the
inherited operator[] for indexing.  Require users to call ->get() to
convert to a simple pointer.

First btb ambiguity reported: https://github.com/dxx-rebirth/dxx-rebirth/pull/34
Second btb ambiguity reported: https://github.com/dxx-rebirth/dxx-rebirth/pull/43
2015-02-17 03:52:59 +00:00