Commit graph

3318 commits

Author SHA1 Message Date
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 ed9fe62d85 Expand GHEIGHT
As a macro, it always refers to the global grd_curcanv.  This interferes
with converting canvas handling to be an argument.  Expand GHEIGHT so
that uses of grd_curcanv can be changed individually.
2017-02-11 21:42:42 +00:00
Kp 03c43b1d7f Expand GWIDTH
As a macro, it always refers to the global grd_curcanv.  This interferes
with converting canvas handling to be an argument.  Expand GWIDTH so
that uses of grd_curcanv can be changed individually.
2017-02-11 21:42:42 +00:00
Kp 48bf96fe6a Pass canvas to g3_draw_bitmap 2017-02-11 21:42:42 +00:00
Kp e2ed41a90e Pass canvas to render_face 2017-02-11 21:42:42 +00:00
Kp 761c926604 Pass canvas to g3_draw_tmap_2 2017-02-11 21:42:41 +00:00
Kp f8c2c4958e Pass canvas to draw_outline 2017-02-11 21:42:41 +00:00
Kp c732c35916 Pass canvas to g3_draw_poly 2017-02-11 21:42:41 +00:00
Kp 85da2c0013 Pass canvas to g3_draw_polygon_model 2017-02-11 21:42:40 +00:00
Kp 59b57bd7dc Pass canvas to g3_check_and_draw_tmap 2017-02-11 21:42:40 +00:00
Kp cd8f408269 Pass canvas to draw_object_tmap_rod 2017-02-11 21:42:40 +00:00
Kp 394d9e1b80 Pass canvas to g3_draw_rod_tmap 2017-02-11 21:42:40 +00:00
Kp 6a2f3c1321 Pass canvas to g3_draw_tmap 2017-02-11 21:42:39 +00:00
Kp 5a86bcaeb6 Cache canvas in draw_copyright 2017-02-11 21:42:38 +00:00
Kp 6f81d13c41 Pass canvas to gr_set_curfont 2017-02-11 21:42:38 +00:00
Kp 7ce7ef0ccc Pass canvas to redraw_messagestream 2017-02-11 21:42:38 +00:00
Kp a67e32d9bd Pass canvas to flash_cursor 2017-02-11 21:42:38 +00:00
Kp f88cfd9901 Cache canvas in newmenu_mouse MBTN_LEFT 2017-02-11 21:42:38 +00:00
Kp df538f1e01 Cache canvas in scores_handler EVENT_WINDOW_DRAW 2017-02-11 21:42:37 +00:00
Kp 103ed33aad Fold calls to scores_draw_item 2017-02-11 21:42:37 +00:00
Kp cbf791608d Pass canvas to scores_draw_item 2017-02-11 21:42:37 +00:00
Kp 2df20e0823 Pass canvas to scores_rprintf 2017-02-11 21:42:37 +00:00
Kp 5e2f2c0b1c Pass canvas to scores_rputs 2017-02-11 21:42:37 +00:00
Kp 3becce8cb1 Pass canvas to nm_rstring 2017-02-11 21:42:36 +00:00
Kp fbc16efa0f Pass canvas to nm_string 2017-02-11 21:42:36 +00:00
Kp 725ec77006 Avoid unnecessary allocations in nm_string
Only allocate a temporary string if a tab exists to be overwritten.
2017-02-11 21:42:36 +00:00
Kp 2c6e8fd446 Simplify nm_string 2017-02-11 21:42:36 +00:00
Kp d65ad71099 Cache newmenu_mouse LINE_SPACING 2017-02-11 21:42:35 +00:00
Kp c24ea5ae1f Fold kmatrix_status_msg format string 2017-02-11 21:42:35 +00:00
Kp beaa49a7ba Pass destination bitmap to scale_bitmap 2017-02-11 21:42:34 +00:00
Kp 590a025a89 Pass canvas to g3_start_frame 2017-02-11 21:42:34 +00:00
Kp 740b3a9649 Pass canvas to ogl_start_frame 2017-02-11 21:42:33 +00:00
Kp 80e7ade6a1 Pass canvas to g3_draw_sphere 2017-02-11 21:42:33 +00:00
Kp 513e7ceceb Pass canvas to g3_draw_line 2017-02-11 21:42:33 +00:00
Kp ae33aaafc1 Pass canvas to gr_set_fontcolor 2017-02-11 21:42:32 +00:00
Kp 0dcae721d9 Make canvas an explicit argument to gr_printf
Previously, a macro implied *grd_curcanv as the canvas.  Pass the canvas
explicitly so that callers can choose the canvas to use.
2017-02-11 21:42:32 +00:00
Kp 227eb98c3e Pass player_info to do_cockpit_window_view 2017-02-11 21:42:31 +00:00
Kp 43a700a200 Prefer grs_main_bitmap::reset() to direct reinitialization
This ensures that any allocated resources are always freed.
2017-02-11 21:42:31 +00:00
Kp 96eb8b824a Fold briefing::guy_bitmap_show into briefing::guy_bitmap 2017-02-11 21:42:31 +00:00
Kp c1440ff995 Factor out RLE expansion
Many sites open-coded walking a bitmap and handling whether it was
RLE_BIG.  Factor that out into a helper class and redirect those sites
to use it.
2017-02-11 21:42:30 +00:00
Kp 7df99350dd Pass player to do_laser_firing_player 2017-02-08 23:34:41 +00:00
Kp 82d10b910c Pass player_info to allowed_to_fire_laser 2017-02-08 23:34:41 +00:00
Chris Taylor f7471af2d6 In ReadControls, continue executing code even if HandleDeathInput handled a key event
This allows the player to press a movement key to respawn after death, and the same keypress will cause the ship to move. Now this works with the option 'when dead, respawn by pressing any key' as well as 'when dead, respawn by pressing the Fire key'.
2017-02-08 12:17:51 +08:00
Chris Taylor 88b5e616a9 Replace calls to window_set_visible in DoPlayerDead() with stop/start_time()
This is so game_flush_inputs() isn't called - part of change allowing player to respawn and begin moving with the same keypress. With this commit, you can use this feature with the 'when dead, respawn by pressing the Fire key' option - i.e. hold down movement key, then press fire key to respawn.
2017-02-08 12:17:51 +08:00
Chris Taylor 7ab97744c4 Remove call to game_flush_common_inputs() in game_flush_respawn_inputs()
Later commits will enable the player to press a movement key to respawn on death, then move with the same keypress. This commit makes sure the player stops moving when the key is released.
2017-02-08 12:17:51 +08:00
Kp d4f58d7bd3 Reload player object number after loading objects 2017-02-06 02:00:49 +00:00
Kp 98c9374a12 Simplify powerup_grab_cheat_all path
Movement handling has an ugly hack that tries to grab powerups near the
console player, but it reuses general collision handling and fails to
check whether the player is alive.

Add a liveness check.  Place the check so that it happens once, before
the objects are scanned, rather than being needlessly repeated for every
object.

Refactor the collision code to let the movement hack skip the parts it
does not need.

Reported-by: ryusei117 <https://github.com/dxx-rebirth/dxx-rebirth/issues/302#issuecomment-275816259>
2017-02-04 23:10:29 +00:00
Kp d5634f4406 Add hack for old savegames on boss levels
Reported-by: vLKp <https://github.com/dxx-rebirth/dxx-rebirth/issues/291#issuecomment-271118416>
Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/291#issuecomment-275896181>
Fixes: df5d4196e7 ("When converting object_rw to object, recompute gun points for CT_CNTRLCEN as they are now part of object and not globals anymore")
2017-02-04 23:10:29 +00:00
Kp 62778327a7 Pass cobjptridx to apply_light 2017-01-31 04:25:06 +00:00
Kp cdfe7cc308 Merge branch cheats2 into master 2017-01-31 03:57:59 +00:00