Commit graph

204 commits

Author SHA1 Message Date
Chris Taylor 4cc801f42f Remove calls to window_close(Game_wind) when game finished or over
Replace calls to window_close(Game_wind) with returning window_event_result::close to game handler. Applies to when DoEndGame() is called, DoGameOver() is called, aborting in the kmatrix screen (multiplayer game) during AdvanceLevel() and playing one demo frame causes playback to stop in GameProcessFrame(). Closing a window within its handler is problematic - it can result in an unstable state.
2017-01-08 21:08:50 +08:00
Kp 22e364e030 Pass canvas to gr_clear_canvas 2017-01-01 00:45:45 +00:00
Kp 0905aefa0a Pass canvas to gr_rect 2017-01-01 00:45:45 +00:00
Kp 6ab3b18657 Pass canvas to gr_ubitmap 2016-12-29 03:27:12 +00:00
Kp 442af298cb Pass player_info to allowed_to_fire_missile 2016-12-10 17:51:10 +00:00
Kp 7e6c9fb172 Pass player_info to allowed_to_fire_flare 2016-12-10 17:51:10 +00:00
Kp c7634a1923 Move Auto_fire_fusion_cannon_time to player_info 2016-12-10 17:51:09 +00:00
Kp 51b06f6cdc Move Fusion_charge to player_info
This eliminates some ugly hacks regarding remotely generated fusion
shots.
2016-12-10 17:51:09 +00:00
Kp 2646bfe005 Fold Fusion_charge PALETTE_FLASH_ADD calls 2016-12-10 17:51:08 +00:00
Chris Taylor 17ca665ed5 Only return window_event_result::deleted from game_handler when Game_wind was deleted in that call of game_handler
Fixes freeze when aborting game while demo is recording
2016-12-07 09:38:03 +08:00
Kp 3fc128607c Pass vsegidx_t to disable_flicker 2016-12-05 00:26:09 +00:00
Chris Taylor 2995cb628c Never set Current_level_num to 0
This will be required when proper game state editing is implemented. Also remove hacks that check Current_level_num == 0.
2016-11-21 15:22:11 +08:00
Kp a70d1ac646 Pass player_info &to omega_charge_frame 2016-11-19 18:09:26 +00:00
Kp dc881ec12d Merge pull #266 into master 2016-11-19 18:09:26 +00:00
Kp 716b320c34 Use utility d_enumerate for do_cloak_stuff 2016-11-19 17:24:52 +00:00
Chris Taylor 46abf5f31f Set Game_wind to nullptr at the start of responding to EVENT_WINDOW_CLOSE in game_handler
This prevents newdemo_stop_playback from attempting to close Game_wind, which results in it being freed twice - in particular when switching to the editor (via delete-E) when playing a demo.
2016-11-11 16:09:57 +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 c31424dd3b Pass player_info to do_invulnerable_stuff 2016-10-28 03:39:41 +00:00
Chris Taylor 2613545712 Return window_event_result::deleted if Game_wind closed
Return window_event_result::deleted if Game_wind was closed somewhere in response to an event handled by game_handler, so in future the event code can use that instead of window_exists to avoid tripping up.
2016-10-27 12:24:02 +08:00
Kp 01f2932824 Pass grs_canvas &to window_create 2016-10-15 00:53:20 +00:00
zico 9cab9e58c6 Fixed regression from e0785251c4 making the homing indicator go haywire if built without NEWHOMER defined 2016-10-10 14:23:45 +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 1af65071d7 Remove unused EVENT_WINDOW_CLOSED
Every callee that recognized EVENT_WINDOW_CLOSED did so only to
explicitly ignore it.  Remove the code to send it and all sites that
ignored it.
2016-10-10 00:25:15 +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
Kp 3024bb8bbe Pass object_base &to create_player_appearance_effect 2016-10-02 19:35:34 +00: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 b8f58309f0 Reuse computed filename for screenshot 2016-10-02 00:34:49 +00:00
Kp 67e10d532b Pass player powerup_flags to init_ai_frame 2016-10-02 00:34:48 +00:00
Kp e6b44ffef1 Pass player_info to delayed_autoselect 2016-10-02 00:34:43 +00:00
Kp a62cc369ab Expand get_local_player_shields
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 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 7a13d3f228 Include dxxsconf.h explicitly and earlier 2016-09-24 18:06:10 +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 4864f533cf Pass object_base &to fly_init 2016-09-11 18:49:13 +00:00
Kp 198b068da6 Expand get_local_player_energy
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-09-11 18:49:13 +00:00
Kp a61370ddca Check segment index in do_ambient_sounds 2016-09-04 00:02:50 +00:00
Kp ec27044f3a Check segment index in game_setup recovery code 2016-09-04 00:02:50 +00: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 335f24ac31 Move Primary_weapon to player_info 2016-08-28 22:41:49 +00:00
Kp ee1003f29f Move conditionally compiled code 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
zico dad3e953e9 Retored historically accurate versions of homing tracking and lifeleft calculations for D1X and D2X based on their original source code releases instead of mixing them together. Further encabsuled NEWHOMER code to disable unused functions and variables if NEWHOMER is disabled. 2016-08-17 13:43:01 +02:00
Kp f671e6781d Narrow scope of random vectors 2016-07-24 04:04:25 +00:00
Kp 9128ff7c35 Move Next_laser_fire_time to player_info 2016-07-06 01:54:26 +00:00
Kp bd3db75108 Move Next_missile_fire_time to player_info 2016-07-06 01:54:26 +00:00
Kp a554d7e2c4 Move Next_flare_fire_time into player_info 2016-07-06 01:54:25 +00:00
Kp 3272caed7d Cache reference to local player energy 2016-07-03 00:54:16 +00:00