Commit graph

160 commits

Author SHA1 Message Date
zicodxx 13cd7d8837 cleanup for netgame help menu and incremented multi proto vwersion due to recent code changes (d1x mostly however) 2012-06-18 01:43:46 +02:00
zicodxx 6ee7c2f092 Removed remnants of the old and obsolete VR implementation 2012-05-27 00:24:57 +02:00
zicodxx 1431d3bc35 Cancel out do_controlcen_dead_frame() when not playing and only check triggers for playing players for further host-authority stuff; Made GameProcessFrame not cause endless loop by closing kmatrix over and over again due to game_leave_menus(); Also only close menus when level ends and when we die only the automap will close - otherwise menus can stay (user request) 2012-05-25 12:14:28 +02:00
zicodxx 8699ae6b63 In Multiplayer when taking damage, the game will only leave menus when shield drop below 5 2012-05-16 01:06:16 +02:00
zicodxx d3fb313fd9 Renamed FixedStepCalc() to cald_d_tick() and FixedStep became d_tick_step; Also ther eonly is a 50ms-timer used to d_tick_step as it was the only one used so far; Replaced FrameCount with d_tick_count which only increments by 50ms-timer used in calc_d_tick() - that now scales timed actions for certain functions properly and makes AI work FPS-independent without any hacks in that regard 2012-05-14 19:06:28 +02:00
Chris Taylor e55406d1ee Make sure Cursegp is initialised if using it to set an object when loading a game (EDITOR build). Thought I already committed this 2012-04-17 14:28:50 +08:00
Chris Taylor 1fd979a76b Avoid crashes when clicking on close box with a center, switch, object or wall editing dialog open; also when playing a level, going to the editor, going back to the game then dying 2012-04-16 14:42:34 +08:00
zicodxx 3a96935748 Further Multiplayer cleanup: moved gobal variable resets from multi_new_game() to proper function calls; added pnum variable to init_player_stats_game() and init_player_stats_new_ship() so these can be set for each player when starting match; added multi_new_level() calls when setting up game as well when trying to join game; cleaned multi_reset_stuff() from variable resetting that happen in general game code; when being dumped from game, made sure no packets are sent during messagebox dispaly; replaced MAX_NUM_NET_PLAYERS by MAX_PLAYERS as it's the same definition 2012-04-15 15:32:48 +02:00
Chris Taylor 2ca5303028 Delete-E while playing a level now works properly - it closes Game_wind and sets Cursegp if necessary when going to the editor 2012-04-14 15:09:21 +08:00
Chris Taylor cb0f7a4b04 Do a bit of a tidy up for the editor, dump code from editor() within the loop into new editor_handler() 2012-03-18 12:13:12 +08:00
zicodxx 7eff144bbe Smoothed disabling of friendly fire to re-enable splash damage possible when friendly fire is disabled 2011-11-24 11:04:45 +01:00
zicodxx d444c571f5 Fixed misuse of gr_bitblt_find_transparent_area() caused rear view to be shifted on some cockpits 2011-09-25 01:01:53 +02:00
zicodxx 8b5b6b822d Fixed overuse of multi_send_sound_function when handling afterburner in case player is dead or escaped 2011-09-21 19:49:29 +02:00
zicodxx dc0400205b Only call show_netplayerinfo() if GM_MULTI is set and reset netplayerinfo_on in game_setup() 2011-07-04 11:23:53 +02:00
zicodxx dd455389cd Executing timer_update() at the beginning of calc_frame_time in case event_process() taking a significant amount of time to reach the game window and therefor could make FrameTime be inaccurate 2011-06-01 15:06:16 +02:00
zicodxx dd991fbf6b Got rid of cfile code: Renamed cfile-functions to use PHYSFSX-naming convention, Replaced cfile-macros with proper PHYSFS(X) calls; Introduced PHYSFSX_exists() which can check case-sensitive or case-insensitive to give more flexibility with game content 2011-06-01 09:59:55 +02:00
zicodxx 23197f52e5 Like in BigEndian builds do netmisc_calc_checksum() only with expected items of segment/side struct to prevent different checksums in case these structs change; Fixed several issues when building with editor; Fixed compiler warning regarding set but unused variable 2011-05-22 19:54:47 +02:00
zicodxx 2a60b32da2 Removed key_flush() call from save_screen_shot() - not needed anymore due to new input reading and only screws up ingame controls 2011-05-19 23:49:04 +02:00
zicodxx baeca7ebfa Little fix for typing-indicator in multiplayer - was showing comma even if no player name was displayed; Removed team_vector from UDP lite_info structure - it's not needed; Removed ShowAllNames from Netgame structure as I see no reason why names display should be host-controlled; Increased UDP_NETGAMES_PAGES to actually show 3000 possible games 2011-04-12 00:45:21 +02:00
zicodxx 74c7bdd7c5 Improved syntax for Multi messages/commands: Commands starting with '/' and those accepting arguments as well as Player/Team messages require space after ':' ; Added indicator on HUD to show if a player is typing a message to prevent accidential kills 2011-04-11 17:47:16 +02:00
zicodxx d6fbef4e43 Moved all these unsorted global cheat variables to a handy structure; Simplified reading of the cheats without trying to make it complicated so no one finds them (everyone can get the source); Removed one or two cheats which carry more garbage than they are worth; Added replacement for the bittersweet cheat; Made FPS Counter an option of Graphics menu 2011-02-14 22:27:07 +01:00
zicodxx 097dd32c5a New approach to handle a bunch of closing windows - removed window_do_close() again, reworked game_leave_menus by checking window_get_front() and closing this window until it's Game_wind, while event_process checking if window still exists after drawing and if not, take next window from previous which should be updated by then 2011-02-12 23:58:41 +01:00
zicodxx 753178a30f Reintroduced Savegames for Coop games using the original Descent2 implementation but correctly handling player slots in their pre-loading state preventing accidential player shifting which never really worked in the original game and we do not want with UDP anyways - was all tested but still might need a fix or two; Added some missing initializations for saving players and AI stuff; Completely ripped out remnants of saving between levels code 2011-02-09 12:58:32 +01:00
zicodxx 96782e092a Added event types for all input actions; Rewrote kconfig code to work with events; static defined inputs will not trigger kconfig-mapped inputs anymore; Simplified keyboard, mouse and joystick code a lot due to event-based handling; Added function to toggle SDL key repeats on and off; Put timer_update() to event_process; Removed return when event_poll() is idle to get cursor hiding to work again; Added a small delay between cursoe hiding and re-enabling to cursor will not accidentially enable by SDL event centering cursor while hiding 2011-02-02 01:36:49 +01:00
zicodxx 5eb05548c3 Added timer_update() to stop/start/reset_time() functions so resumed last_timer_value will be precise; Added new FPS counter which actually does count the frames rendered per second and is less irritating; Added timer_dleay2 call to console to not stress CPU too much; Imporoved placement for show_time(), multi messages, marker messages and orb counts 2011-01-22 13:30:20 +01:00
zicodxx 5b899ad0fd main/game.c: Due to recent changes in event_poll() game_handler() must call ReadControls() for EVENT_MOUSE_MOVED, too; Little fix for FixedStepCalc() 2011-01-15 13:51:21 +01:00
zicodxx 6e81498a86 Added Sensitivity/Deadzone menu with sliders for each movement based action seperated for joystick and mouse to support all kinds of configuration - regardless the amount of joystick axes and whatnot; SDL_WM_GrabInput does not only capture mouse but also focus keyboard input - changed code to respect this fact and made grabbing a menu option which is enabled by default 2010-12-28 19:11:10 +01:00
Chris Taylor 22102a3c23 Activate EDITOR for Mac OS X in Xcode, d2x target; fix some warnings and errors 2010-12-22 10:56:28 +08:00
zicodxx fe84fa3a9a Made GameTime to GameTime64 using fix64; Changed all structures saving GameTime64 for internal timer purposes to store fix64 and added converting functions to save such times in fix; For Savegames/Demos always reset GameTime64 to 0 while saving and putting all timer values to safe limits, Multiplayer objects are sent in similar fashion 2010-12-22 01:17:59 +01:00
zicodxx 3bcb0ecdde Introduced new data type fix64 to be used for new timers which can last 4462756 years instead of 9 hours; Introduced new timer functions to update and query program time; Used new timer all over the program except GameTime (which comes next) 2010-12-11 00:18:17 +01:00
Chris Taylor 4fa20a3d9f Add support for OS native error/warning boxes, only implemented for Mac for now 2010-11-28 20:08:29 +08:00
Chris Taylor 846699a2e6 Fix errors for Mac OS 9, Mac OS X 'd2x' target builds again 2010-10-10 18:48:24 +08:00
zicodxx 155c378c80 Removed Fusion_last_sound_time and made Fusion_next_sound_time static inside FireLaser() with it's own fallback function for bogus timer values - should make this code insusceptible against errors - last but not least: minus two globals 2010-09-04 09:22:07 +00:00
kreatordxx b55a717112 Tidy up for EVENT_IDLE case in game_handler, hopefully fixing obscure 'optimise threads' bug 2010-08-14 02:26:18 +00:00
zicodxx c50081f72c Added event_flush to take place in game_flush_inputs which will clean SDL events which may be buffered while event_process was suspended; suspend Game_Wind while loading restoring save state while playing a level to properly flush controls and reset timer; when toggeling cursor, also directly modify the mouse to wanted behaviour instead of waiting for mouse_update_cursor_and_grab 2010-07-30 17:59:21 +00:00
zicodxx 7b1bfbbf2c Removed leftover of mouse grabbing from set_screen_mode - forgot to do this in rev1192 2010-07-29 21:28:53 +00:00
kreatordxx db15309f5f Tidy up use of set_screen_mode 2010-07-29 08:30:46 +00:00
zicodxx 100cbe51cb One more take on Mouse cursor friendliness: Merged mouse_toggle_cursor and mouse_toggle_grab; instead of trying to use SDL_GetAppState (which does not work as expected on Windows) to release mouse, use strict calls of mouse_toggle_cursor so we at least have a free mouse outside of Game_wind and Automap; decreased time to automatically hide cursor; added mouse_close to release mouse in case of emergency 2010-07-28 17:27:35 +00:00
zicodxx f2df60a12d Only use one single call of timer_get_fixed_seconds() for whole SDL event loop; Abstracted grabbing mouse and mouse cursor toogle to mouse functions instead of calling SDL functions inside of non-arch code; Automatically hide mouse cursor if it's not used for more than 3 seconds; Reworked placement of mouse grabbing toggle; Do not read any mouse input if -nomouse is given 2010-07-16 11:07:42 +00:00
zicodxx 0ce37b89bb Added expandable classes for HUD messages (like D1X but slacked) to better handle Multi messages or redundant messages; Rewrote HUD code completely; Changes -playermessages to -multimessages since this is more appropriate; Removed remnants of -mprofile 2010-07-13 06:35:25 +00:00
zicodxx 1093aa0d07 Improved hanlding for closing sockets - doing via closing of Game_wind when available or in specific multi menus; Also handling GM_GAME_OVER setting over Game_wind closing as well if apprpriate - cleaner and helps to cleanup multi when mission is over 2010-07-08 09:35:59 +00:00
zicodxx f81a5d8601 Removed SurfingNet global and made tabs a parameter of newmenu_dotiny; Same procedure with MenuReordering which is replaced with newmenu_doreorder to set reordering flag specifically 2010-06-30 15:26:27 +00:00
zicodxx 7849947519 When starting, leaving or changing a level in any way, use more ordered approach to set Game_wind visible or invisible. Fixing timer-issues after level-change and makes hiding of Game_wind obsolete for certain messageboxes; Moved GameTime and weapon timer variables out of reset_time since this function is not appropriate for this and is not needed between levels anymore due to window management handling start/stop_time properly 2010-06-27 11:28:26 +00:00
zicodxx 221076a3f5 Introducing gr_bitblt_find_transparent_area to dynamically detect boundaries of sub cancas used for CM_REAR_VIEW; On the way also allowing to create weapon box sub bitmaps from uncompressed cockpit bitmaps 2010-06-18 07:31:06 +00:00
zicodxx 2ba931acca Fixing typo in Netgame help screen 2010-06-15 17:20:37 +00:00
zicodxx cac223991f Resetting GameTime, Next/Last_flare/laser/missile_time in reset_time() together so GameTime-rollover-fallbacks will not create a massive delay when starting a new level 2010-06-14 21:59:41 +00:00
zicodxx cc12616895 Increased SDL_mixer music abilities to play non-hmp from HOGs, having Level-music path to play, options to specify non-level tracks and added various playing order methods; Abstracted SDL_mixer- and Redbook-interfaces; Simplified program flow through all music functions 2010-06-14 08:13:16 +00:00
kreatordxx 493b07e3da Get rid of a heap of uses of Function_mode, quit properly (freeing all windows and asking for confirmation for game) when clicking close box 2010-04-04 01:31:48 +00:00
kreatordxx 0c8c99fd13 Make newmenu_do3 and newmenu_dotiny return as soon as the newmenu is created, which will allow the main menu (and others) to persist 2010-04-03 07:24:50 +00:00
kreatordxx dae5968170 Add a default event handler for screenshots, entering debugger, Redbook repeating etc 2010-04-02 05:01:08 +00:00