Commit graph

935 commits

Author SHA1 Message Date
zicodxx 9e9063901e reducing max buffer size of an UDP packet from 1024 to 512 bytes - should prevent possible turncating, especially when sending obejcts where max size is actually used 2010-11-23 01:26:44 +01:00
Chris Taylor a9996b9fe8 If it can't find descent.hog, still print some useful info 2010-11-22 21:18:43 +08:00
zicodxx be3b72b316 When checking for redundant messages in HUD display, compare new message to most recent one for locking and check whole list only for messages marked with HM_REDUNDANT. This will show all messages in correct order while keeping redundancy-prone messages from looping infinitely 2010-11-21 21:19:45 +01:00
zicodxx 21d93e84de For fresh configuration set Redbook music as default for Mac, Builtin music for all others 2010-11-21 13:02:45 +01:00
zicodxx 5cd011214f Created function PHYSFSX_isNewPath to check wether given path has already been added to Searchpath or not; Used PHYSFSX_isNewPath for menu browsing code instead it's own implementation; Using PHYSFSX_isNewPath for Jukebox directory, too to make sure Jukebox will not accidentially remove Game content depending on user selection; Also only keep Jukebox directory added until files are stored to prevent any other file present in this path can override or add anything to the game 2010-11-21 12:55:08 +01:00
zicodxx 88b5205135 In plyr_save_stats setting filename to size of PATH_MAX to have enough space to also hold the player directory prefix which would otherwise create a memory corruption and crash the game 2010-11-13 00:46:39 +01:00
zicodxx 19d00e9851 In multi_consistency_error check for Game_wind before trying to set it in/visible - just for safety 2010-11-09 11:53:14 +01:00
zicodxx 6e1725d4e5 Increased buffer for fname2 in load_briefing_screen, preventing buffer overflow in case replacement filenames are longer than DOS-style 2010-11-01 17:47:26 +01:00
zicodxx 950eda94ef In case listbox strings are too long for screen, fit box width to screen width, shorten strings and add a scroll effect to selected item 2010-11-01 13:42:21 +01:00
zicodxx a6312c8397 Text string for level music was made smaller some time ago so BROWSE_TXT_SHRT basically became obsolete - removed it now and show BROWSE_TXT instead 2010-10-30 01:29:44 +02:00
zicodxx 8d1317b8f8 Make songs playing at end briefings loop, like they used to in the original game 2010-10-30 01:08:52 +02:00
Chris Taylor 541e422611 Fix errors for Mac OS 9, Mac OS X 'd1x' target builds again 2010-10-16 18:53:05 +08:00
zicodxx 940eaeb3db Finished support for custom textures and robots, fixed some bugs, reformatted code and placed function calls to properly work for designated mission/level 2010-10-16 11:13:11 +02:00
zicodxx 4c7879b740 Added format arguments to all printf, sprintf and snprintf calls missing them to prevent warnings/errors with some distributions of gcc 2010-10-14 16:45:58 +02:00
zicodxx aa68347028 Fixed compilation of menu.c when USE_SDLMIXER is not defined 2010-10-14 11:49:37 +02:00
Chris Taylor 499c8e3799 Fix errors for Mac OS 9, Mac OS X 'd1x' target builds again 2010-10-10 18:42:53 +08:00
kreatordxx 704a4e7be5 Add support for M3U playlists, tweak 'Jukebox playing' message so it shows the end of the path when truncating 2010-09-26 13:15:20 +00:00
kreatordxx 403169df7e Add 'Data' subdir as a searchpath, so D2X will find descent.pig and to simplify a lot of file opening/checking/closing code 2010-09-25 03:35:23 +00:00
kreatordxx 64387a51e6 To fix Dravis's head in endgame debriefing, don't remap the colours and read compressed .bbm bitmaps properly (both my bad) 2010-09-19 13:33:22 +00:00
kreatordxx 23975df856 Pass -1 instead of 255 as the colour to ogl_ubitmapm_cs when drawing savegame previews, to make sure a black rectangle isn't drawn instead 2010-09-19 11:53:39 +00:00
kreatordxx c1a7ffa66d Put in a note that a restart is required when changing the texture filter level (remove later when it isn't) 2010-09-17 11:06:48 +00:00
kreatordxx 35a69d5a0f Link to PhysicsFS static library and use header from source for Mac OS X 2010-09-17 10:44:21 +00:00
kreatordxx 0a44a68fed Set default Jukebox music paths to original Redbook music in iTunes for Mac OS X 2010-09-17 10:14:37 +00:00
zicodxx 2b069acab4 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
zicodxx 78bbd77b35 In briefing_init() init robot angles properly because in show_spinning_robot_frame() robot_angles.h is incremented only but not initialized 2010-09-04 08:17:54 +00:00
zicodxx 34db780dbf Reset Fusion_next_sound_time in init_player_stats_level() to hopefully fix Fusion not doing damage or playing sounds 2010-09-03 21:49:39 +00:00
zicodxx 5e3be36c39 Using PHYSFSX_findFiles to make sure random demo playback will only find actual demo files and not quit autodemo; added DEMO_EXT for an universal definition of demo file extension 2010-09-02 13:58:06 +00:00
kreatordxx 8a79002f2d On Mac OS X - no longer have to copy SDL_mixer.h to SDL framework; frameworks can now be in /Library/Frameworks; fix for obscure compile error involving u_int32_t 2010-09-02 00:07:37 +00:00
zicodxx 4c5f489d07 in pdata communication swap_bytes was set for create_shortpos causing problems on PPC architecture; in multiplayer host menu set citem to START GAME by default 2010-09-01 17:01:51 +00:00
zicodxx 445fc76554 Added feature to let select_file_reursive() change drive on _WIN32 via CTRL-D; Removed second definition of MEM_K accidentially happened due to bad communication 2010-08-31 13:25:45 +00:00
kreatordxx 5f026dfb55 In select_file_recursive handle paths relative to the current write directory correctly 2010-08-28 02:46:54 +00:00
zicodxx 6d475ad6b8 In list_dir_el make sure PHYSFS_getRealDir won't give NULL to strcmp which will happen for files located in a Windows root directory 2010-08-27 21:16:43 +00:00
zicodxx 067d54f8e3 In select_file_handler properly initialize newpath preventing memory errors and crashes 2010-08-27 20:32:05 +00:00
zicodxx 887e8ed22c Moving upwards definition of MEM_K so it's not restricted to \!NDEBUG; Initialized **i in list_dir_el properly to silence gcc when compiling 2010-08-27 15:43:24 +00:00
kreatordxx 72c62df583 Add path browsing feature to make song file/directory selection easier 2010-08-27 14:09:19 +00:00
zicodxx 0bc2257b06 Made loading of Hires briefings a bit more simpler (more D2-ish) and not using a new briefing_screen structure; Also perform a check if requested image originates from descent.hog or a third-party mission and do not load a Hires version in the latter case 2010-08-25 15:14:28 +00:00
zicodxx 9eb82f312b Overhauled detection of TEX/TXB files for Briefings and Endings 2010-08-24 14:02:38 +00:00
zicodxx 010ac80344 Moved levelnum-sanity-check in game_param_handler so it will be checked when screen is changed to allow entry of secret levels (which does not work in D2X-Rebirth - it's only done for code similarity); added menu item START GAME for consistency and added proper subtitle for game setup page 2010-08-22 09:25:24 +00:00
zicodxx cafb861bc5 For each Music playback system defining own volume scaling definition which was wrong for SDL_mixer 2010-08-19 15:54:19 +00:00
zicodxx 2c3d69c82d In demo list help text changed string CTRL+C to CTRL-C for consistency 2010-08-19 13:44:31 +00:00
zicodxx ac92d9c971 Patching together editor so it compiles again (while still not running); Implemented PhysFS for file accessing for editor- and debugging-related code 2010-08-19 13:32:33 +00:00
zicodxx 745ce38a4d Renamed MUSIC TYPE options BUILT-IN MUSIC to BUILT-IN/ADDON MUSIC and CUSTOM MUSIC to JUKEBOX; Removed LEVEL-DEPENDENT play order for Jukebox as this is now mainly covered by AddOn packs and future M3U-support 2010-08-17 14:59:57 +00:00
zicodxx f7e009d1c8 Moved up PHYSFSX_addArchiveContent() a little inside main() so -debug and -verbose will show us this content which will be helpful for debugging possible problems with AddOn Zips 2010-08-16 19:59:41 +00:00
zicodxx 791851ad82 When switching from COOP to any other game mode, make sure Netgame.max_numplayers, MaxNumNetPlayers as well as the menu text showing the player limit is updated correctly 2010-08-16 11:50:37 +00:00
zicodxx 0a86348aab Added support to automatically load/mount ZIP files at startup, giving option to dynamically override or replace game content; Updated docs 2010-08-15 06:57:51 +00:00
kreatordxx 0529a5320b Tidy up for EVENT_IDLE case in game_handler, hopefully fixing obscure 'optimise threads' bug 2010-08-14 02:26:18 +00:00
zicodxx fe198ec06b When picking up laser, game would show generic weapon pickup/already-have messages instead of laser-upgrade/maxed-out messages only - fixed 2010-08-12 16:43:37 +00:00
zicodxx 2028abb6d5 The inital vector scaling to compensate previous frame-skipped tracking was not aligned to FrameTime. Removed that code and just divided homer_turn_base values to compensate this offset properly. Thanks to zif for hinting me to that; Added comment about the how and why of the homing missile scaling issue 2010-08-11 16:25:58 +00:00
zicodxx 85d4cbe3d2 When updating redundant HUD messages check the for-loop not the start with a negative number - causes too long message display and negative array index 2010-08-03 15:03:56 +00:00
zicodxx f0edc54479 Builtin music list now dynamically allocated and not limited to 30 songs; Instead of never loading new level when loading savestate ingame, only do this for Redbook and Custom Music playing order 'continously'; if no endlevel song is specified in Custom Music continue with level music 2010-08-01 17:42:38 +00:00
kreatordxx 98cf9b90ca For polling newmenus, set rval using a pointer and don't delay closing the window, hopefully fixing bad memory access when clicking in level scores screen; change newmenu_close to newmenu_free_background to avoid confusion 2010-07-31 12:09:38 +00:00
zicodxx 842af496ca 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
kreatordxx 3dd7a7a627 Tidy up use of set_screen_mode 2010-07-29 08:30:46 +00:00
zicodxx 4a0d15fbcd 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 60e93e4deb Moved digi_set_digi_volume call from config loading to designated audio subsystem init function so it will be correctly set after the sound system is auctionlly initialized 2010-07-27 20:42:54 +00:00
kreatordxx 9e4b8db5f6 Show stars background for died in mine and secret level messageboxes; equalise fuelcen.h and cntrlcen.h 2010-07-27 11:41:43 +00:00
kreatordxx ee4f37903b Fix crash caused by last commit (whoops) 2010-07-25 02:43:22 +00:00
kreatordxx 9f9e35689e For menus, only call the user function for closing immediately before closing, fixing memory errors when the user function frees memory 2010-07-25 02:30:53 +00:00
kreatordxx c7f5e7abd4 Actually commit d1x-rebirth/main/inferno.h 2010-07-25 01:25:19 +00:00
kreatordxx d1dda5386e Rewrite quit system, fixing *many* bugs with it :P 2010-07-25 01:22:44 +00:00
zicodxx b41faef1d3 Fixing crash when joinging game over UDP Netlist: when exiting the menu for any reason, return 0 instead of following the code and possibly lead to drawing text from a newly free'd pointer - D'OH 2010-07-21 16:58:38 +00:00
zicodxx 5c2fdc5063 Thanks to Marix for hinting me I should not init a pointer with quotes if I plan to allocate/free it... my stupid-level officially broke the record 2010-07-20 18:38:29 +00:00
zicodxx 1c6c1b3a9d Fixing some harmless compiler warnings caused by missing includes, missing newlines at end of file; cleaned up strutil.h 2010-07-19 18:17:08 +00:00
zicodxx 10c8ace1a2 In briefings make sure Current_color cannot exceed possible array bounds 2010-07-19 17:30:25 +00:00
zicodxx bc775b1331 Introduced state_quick_item so we can safly check if there is a valid quicksave slot wihtout messing around with state_Default_item which is supposed to always show a valid slot in the first place 2010-07-19 17:07:12 +00:00
zicodxx 23660d8040 Implenented POBOYS cheat as equivalent to D2's DELSHIFTB 2010-07-17 12:08:45 +00:00
zicodxx 4fdbda1689 Instead of screwing by possibly using negative array indicies in find_seg_side() return -1. In ordering segments make this result in unimportant order; Taking in some Asserts which were disabled years ago by me. Let's fix this for real when we get to it 2010-07-17 11:57:07 +00:00
zicodxx 81baeaeaa4 Removed OGL hack to fix overlapping room in D1 lvl19 and rather move vertex a little. Still a hack but now without messing Depth test 2010-07-17 11:19:29 +00:00
zicodxx 06cf80ab18 If newdemo_start_playback fails if random file is given set -autodemo to 0 to prevent endless loop 2010-07-16 13:03:12 +00:00
zicodxx ac840f306b 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 4b407c62b8 Fixing showing options menu in demos - was still called (or rather not) by obsolete variable 2010-07-16 06:27:49 +00:00
kreatordxx 8c23459d9e Make sure the right canvas is set for titles and briefings, fixing bug where briefing is shown in the cockpit when using 'freespace' cheat 2010-07-15 09:45:25 +00:00
zicodxx 9596e0fcf8 Scale tab stops in briefings to font-size correctly 2010-07-15 09:22:33 +00:00
zicodxx 2d739a2c46 Cleaned the variables used for newdemo code; Instead of giving both old and new values to special recording functions, added new variables to demo code serving this purpose and also checking for redundant record calls which only would waste bytes; Removed duplicated-object-id-hack which did not work as expected and caused jittering on playback; In that process, found a bug where Num_open_doors might nor be set correctly - cleaned that up a little and got also rid of one aweful goto; Made sure cloaked walls are recorded FPS-independent but rather fade-value-dependent 2010-07-15 06:09:23 +00:00
zicodxx 2cb3bac259 Cleaned the variables used for newdemo code; Instead of giving both old and new values to special recording functions, added new variables to demo code serving this purpose and also checking for redundant record calls which only would waste bytes; Removed duplicated-object-id-hack which did not work as expected and caused jittering on playback; In that process, found a bug where Num_open_doors might nor be set correctly - cleaned that up a little and got also rid of one aweful goto; Made sure cloaked walls are recorded FPS-independent but rather fade-value-dependent 2010-07-15 05:40:25 +00:00
zicodxx 280b635dbe Addition for last revision - just screwed up my working copies 2010-07-13 06:45:15 +00:00
zicodxx 9933bb81ce 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 47770df6ca Fix for last revision - did not compile correctly 2010-07-09 13:47:11 +00:00
zicodxx a8111d203d Trying to improve reliability to find appropriate homing object by using vm_vec_mag/normalize instead of their *quick equivalents; Removed code which supposedly meant to track objects near reticle - don't like that 2010-07-09 07:58:48 +00:00
zicodxx 152ed8ea60 When reading mission file, check for sanity of possible breifing or ending to make sure author did not just screw up the file; Fixed slight bug when playing ending briefings from secret levels 2010-07-08 22:20:39 +00:00
zicodxx 52b57dbd31 When reading mission file, check for sanity of possible breifing or ending to make sure author did not just screw up the file; Fixed slight bug when playing ending briefings from secret levels 2010-07-08 22:12:53 +00:00
zicodxx 9dbd8ad144 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 4c63f57aac Reworked handling of Netlist now also showing full game info; Prevent Clients from sending lite_info; Make lite_info show numconnected instead of numplayers as this would show disconnected ones as well; Removed reusing ports on different instances in Windows build - only screws up several games running on one machine 2010-07-08 06:37:23 +00:00
zicodxx ee3856285d Fixing building on Windows if SDL_Mixer is not a target 2010-07-05 12:14:49 +00:00
zicodxx c209b4c319 Reducing sending objects per frame from 20 to 1 again to reduce possibility of timeout on stressed systems 2010-07-05 12:12:12 +00:00
zicodxx d15778e03c When selecting coop game mode, make sure that besides max players menu values also actual player number is set and menu text is updated properly 2010-07-05 08:05:32 +00:00
zicodxx a7497054c3 Addition for rev1152: After setting mouse button, reset mouse state properly 2010-07-05 07:53:38 +00:00
zicodxx 8a7e7de051 Fixing issue when assigning mouse button if a citem is still pointed out; Fixing still processing key commands even if we want to assign a key 2010-07-05 07:31:03 +00:00
zicodxx d87c4ab289 Fixes for rev1148: Was too hasty with calling net_udp_close; Fixing typo in WSACleanup() 2010-07-04 13:57:21 +00:00
zicodxx 44d6e096d6 Since time is not suspended between levels in Multiplayer, call reset_time after level change. Apply this in Singleplayer, too since it should always be safe - and appropriate - to reset timer_value soon as a new level begins 2010-07-04 13:12:08 +00:00
zicodxx 7009221170 Implemented Winsock functions for UDP which I totally forgot about; Now when leaving game in any way, close sockets and Winsock stuff 2010-07-04 12:47:30 +00:00
zicodxx 47307bd25b Fixed Compiler-warning on Windows; Fixing Windows build which was not linking against SDL 2010-07-04 07:07:51 +00:00
zicodxx e62d911160 Renamed manual_join to direct_join; Aligned letlist tabs a little bit 2010-07-01 09:08:30 +00:00
zicodxx 07bdbfe610 Always try to open UDP default port when discovering Netgames and give warning if that fails; If entered IP address cannot be resoled, do not warn me twice 2010-06-30 15:57:13 +00:00
zicodxx bff24ced0d 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 e0d95f4f1c If multi_level_sync() fails, restart menu music since level music is playing already 2010-06-29 21:14:30 +00:00
zicodxx 47091a3d5e Improved handling of multi level sync and exit smoothly back to the menus; Fixed another small bug in lite_info broadcasting which was sending full info; By broadcasting full info, host could cripple Netgame so a new security measure is implemented to protect host from letting his game be overwritten from outside 2010-06-29 20:51:38 +00:00
zicodxx 97e20ee74c Added UDP Netlist to join LAN games discovered/announced via broadcast 2010-06-29 16:41:08 +00:00
zicodxx ac8e02e0ce Aligned default width for IPX-Netlist menu to fit possible items a bit better; Fixed two small bugs when sending and receiving lite_info in UDP; Allowed broadcast on UDP sockets (for later use) 2010-06-29 06:47:46 +00:00
zicodxx 4e3bf92435 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 ef4e9e1e17 Implemented kill_and_so_forth via DEL+SHIFT+B for easier debugging 2010-06-25 07:53:15 +00:00
zicodxx 4d688df531 rev1134 revisited: When inregulary exiting a level by warp cheat, suspend Game_wind and reactivate again after the switch 2010-06-24 17:17:28 +00:00
zicodxx 0fde6445d4 When inregulary exiting a level by warp cheat, set canvas to NULL so cockpit canvas will not apply furthermore 2010-06-24 14:00:01 +00:00
zicodxx 509e5be5a7 Added function to list valid resolutions and build resolutions menu dynamically with the resulting list 2010-06-24 09:29:11 +00:00
zicodxx da3ef28e60 main/newmenu.c: Fix for last rev1130 - store resolution and font-size in matching data type 2010-06-23 13:39:52 +00:00
zicodxx ffa7f639c1 If no player exists and GameCfg.LasterPlayer is unset, give user a nice default for convenience and - more important - let menu stop to nag about missing callsign and thereby showing the player creation dialogue over and over again 2010-06-23 12:57:28 +00:00
zicodxx f4d8a1e0a1 Making menus recreated on the fly in case resolution or font-size changes; Removing arguments to pass width and height to menu which was not used except on one IPX menu; Fixing measurement of menu strings of type NM_TYPE_INPUT_MENU; Fixing slight bug in freeing IPX netlist 2010-06-23 11:44:12 +00:00
zicodxx 9235a9eda4 Make sure GAME_FONT is set when reading out briefing text so char dimensions will always be stored correctly 2010-06-21 21:43:10 +00:00
zicodxx 88ebccab15 For starting demo, seperate hide_menus() and game_setup() since between this, demo must load the actual level and it's palette; Fixed small bug in interpolate_frame() causing interpolation happening in very first frame causing file read corruption 2010-06-20 20:32:30 +00:00
zicodxx 763f5f42b1 Re-balanced homing-device turn values introduced in rev1118 based on comparisons to many levels played 2010-06-19 17:03:51 +00:00
zicodxx 75169a184a For briefings, keep elementes of show_briefing_bitmap and show_animated_bitmap in correct aspect 2010-06-19 16:24:34 +00:00
zicodxx c3d91ceeca emoved PHYSFSX_getFreeDiskSpace and relying on success of buffered writing to see if demo recording must be stopped 2010-06-18 08:22:45 +00:00
zicodxx e4a0c20f76 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 8a3aeb01e8 Fixing regression from rev1038 which broke showing laser level or quadness in cockpit and statusbar 2010-06-17 09:46:45 +00:00
zicodxx e1572135a2 If picking up one missile out of a four-pack, use singular description instead of plural 2010-06-17 09:45:05 +00:00
zicodxx 5cff370262 Fixing digi_win32_ functions I broke yesterday. THANKS ZIF\! 2010-06-15 18:27:10 +00:00
zicodxx 9b2ea4680c Fixing typo in Netgame help screen 2010-06-15 17:20:37 +00:00
zicodxx 3e96a3185b Removed the previously used homers code and instead used old one to keep good ol' Gameplay; Removed FrameCount steps from track_track_goal() and scaled homing vector accordingly to this change, including properly scaling it to FrameTime; Made code more similar between D1X and D2X; Introduced different turn rates for different difficulty levels 2010-06-15 16:24:56 +00:00
zicodxx c6bb443c63 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 4678e1e815 Process -nomusic argument again 2010-06-14 17:55:25 +00:00
zicodxx 8cb8b6e653 Made reactor damage with persistent weapons FPS-independent but still a bit stronger than normal 2010-06-14 15:17:03 +00:00
zicodxx 36e20a419a Use strrchr instead of strchr for music filename extension in case there are dots in the filename 2010-06-14 10:43:30 +00:00
zicodxx f09a336184 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 5650b4ce48 Merge d_event and newmenu_event enum's, hopefully fixing compiler warnings in GCC 4.5.0 2010-05-03 08:44:46 +00:00
kreatordxx e960307bdd Properly specify number of items for do_options_menu, so the options menu actually shows 2010-05-03 08:22:50 +00:00
kreatordxx f5834db6f7 Actually fix endgame music, make briefing beep only play when flashing_cursor is on, no restarting music when reloading a saved game 2010-04-05 13:48:23 +00:00
kreatordxx 53fc092ebf Actually play endgame music when game is finished, play briefing music instead of hum if appropriate 2010-04-05 11:54:23 +00:00
kreatordxx 90e3796f97 Make menus for hosting a netgame stack, make quitting work with newmenu_do2 and simpler 2010-04-04 09:41:53 +00:00
kreatordxx 76b0fb35ef 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 643c57614b Move copyright drawing to main menu's event handler for tidiness 2010-04-03 10:16:53 +00:00
kreatordxx eb0458ba5f Remove calls to nm_draw_background1 to show newmenus stacked 2010-04-03 09:10:20 +00:00
kreatordxx 11edfb2aa6 Make main menu persist to streamline redrawing (later) 2010-04-03 08:35:56 +00:00
kreatordxx 3ba90f69e0 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 fb53348ddc Keep demo selector just after playing one, for convenience 2010-04-02 05:24:47 +00:00
kreatordxx d749889c89 Add a default event handler for screenshots, entering debugger, Redbook repeating etc 2010-04-02 05:01:08 +00:00
kreatordxx 8cf06690d7 Make game respond to EVENT_KEY_COMMAND for key commands, allowing default key handler (later) 2010-03-31 09:18:28 +00:00
kreatordxx 322db66f11 Make gamecntl.c more similar between D1X and D2X 2010-03-31 06:19:37 +00:00
kreatordxx 00d1d41439 D1X: Fix black and white swapping when viewing robots in briefings using Mac data; D2X: For Descent 1 briefings, only change the palette to groupa.256 for brief03.pcx - the robot screen. Improves palette use for sdl build 2010-03-30 03:37:29 +00:00
zicodxx ee6324b3e4 For casting light from Player-object, smooth out thrust to prevent flickering on high FPS 2010-03-28 09:53:12 +00:00
kreatordxx d45e67c242 Make sure correct palette is loaded for game, fixing swapping of black and white and cockpit/status bar not showing for ogl build, in multiplayer 2010-03-27 10:31:34 +00:00
zicodxx ced670e54a In AdvanceLevel only set Game_mode to GAME_OVER if current level is last level, fixing stupid mistake introduced in rev. 1080 2010-03-27 09:43:27 +00:00
kreatordxx c0739acdfe Check menus[0], not menus[i] in hide_menus - fixing possible crash 2010-03-27 08:00:53 +00:00
kreatordxx c8b49c8a35 Finally fix bug where if you start a single player game then a multiplayer game, time is stopped. Always start time if it's stopped and the game window is activated 2010-03-27 04:30:59 +00:00
kreatordxx 71dfec9fdb Hide mission dialog before the level intro screens are shown, make sure it doesn't try to show it again after it was closed - fixing bad memory access 2010-03-27 03:24:14 +00:00
kreatordxx 68a1458abd Initialise 'playing' to 0 for UDP kmatrix, making sure player progresses to next level; always return 1 when starting to join a UDP game so it doesn't immediately return to the main menu 2010-03-27 02:54:41 +00:00
zicodxx 1bdfcc70f1 Fixing uninitialized angles for robots in briefings 2010-03-26 21:27:55 +00:00
kreatordxx 574bc21e06 Make all windows except game and editor use EVENT_KEY_COMMAND, returning 1 if handled; pass NULL instead of userdata for the PCX filename, for newmenu_do1 2010-03-26 14:05:40 +00:00
zicodxx 69e3954d20 In Endlevel sequence, re-align big explosion to draw in front of exit model, relative to viewer; Re-organized tex files for Briefings and Endings and created more general code to play them; Re-aligned Dravis' head 2010-03-25 23:37:19 +00:00
kreatordxx 962a01cc5d Only show briefing background if we have one, fixing arithmetic crash with SDL Video build 2010-03-24 13:59:42 +00:00
kreatordxx 1ff3f56c1c Add EVENT_MOUSE_BUTTON_DOWN and EVENT_MOUSE_BUTTON_UP, use for all windows except game and editor. Fixes crash on iMac G5 when pressing keys to progress through briefing 2010-03-24 07:26:52 +00:00
kreatordxx c62d310c4c Fix error introduced with credits, make title screen a window. Only the editor left now... 2010-03-22 04:44:35 +00:00
kreatordxx db51d60490 Make credits screen a window 2010-03-22 03:31:02 +00:00
kreatordxx d83c2e27c4 Fix bug introduced in last commit - when the last level is finished, hide the game window - making sure the cockpit isn't drawn over the kmatrix screen 2010-03-21 02:20:07 +00:00
kreatordxx f5e18cb603 Hide game window between levels, fixing bug where many textures are loaded with the wrong palette when advancing to the next multiplayer level 2010-03-21 00:54:56 +00:00
kreatordxx c4171b2f06 Fix bug - make sure time isn't stopped for multiplayer when aborting, so starting a second game doesn't result in a frozen game 2010-03-20 13:53:08 +00:00
kreatordxx 9331893332 Make kmatrixs into windows, rename Fuelcen_seconds_left to Countdown_seconds_left for consistency 2010-03-20 13:21:53 +00:00
kreatordxx d98bb97c48 Make all listboxes fall back to main event loop for flexibility 2010-03-18 07:02:38 +00:00
kreatordxx 3e0c8d7f34 Make briefing into a window, allowing more flexibility with other windows and tidying code up 2010-03-18 04:31:47 +00:00
kreatordxx 5ee9ccd867 Show intro movie properly when idle in main menu, including subtitles if on 2010-03-18 02:49:02 +00:00
kreatordxx 40ecc65268 Fix memory error for listbox when clicking in the region where there are no items 2010-03-14 01:54:34 +00:00
kreatordxx f3ca7b4067 Put most local variables in show_briefing in 'briefing' struct, to make briefing a window in future 2010-03-10 08:43:47 +00:00
kreatordxx 8106bcc492 Put parameters in functions from do_briefing_screens to show_briefing in 'briefing' struct, to make briefing a window in future 2010-03-09 04:59:14 +00:00
kreatordxx 40cfd30bd7 Put briefing globals in 'briefing' struct, pass this by parameter 2010-03-09 02:41:34 +00:00
zicodxx bf23430dd7 If Shareware content is used, fallback to original Smart behaviour since Shareware content has no own definition for Bot-related Smarts 2010-03-04 22:43:37 +00:00
zicodxx bd368ef9f3 Init variables/strings at the beginning of load_mission() to prevent errors if demo content is used 2010-03-04 17:19:47 +00:00
zicodxx db1e4e226f Fixed some Piggy- and Text-loading routines for Shareware, Destination Saturn and 1.0 Registered; Full support for End-Briefing on non-registered still missing however 2010-03-04 14:53:46 +00:00
kreatordxx d7048c7664 Make titles.c more similar between D1X and D2X 2010-03-01 07:27:51 +00:00
kreatordxx 303c3d91b1 Actually change to MIDI if Jukebox was selected 2010-02-27 12:50:30 +00:00
kreatordxx 7046ea43ff Handle all user input in callback for sounds menu, being more judicious about when to restart the music. Also make the jukebox path input a NM_TYPE_INPUT_MENU, allowing the user to abort changes 2010-02-26 08:42:44 +00:00
zicodxx dab80569a6 Resetting menu->mouse_state after changing a key in kconfig so you will not accidentially activate a new field when left mouse button is assigned 2010-02-25 15:20:01 +00:00
kreatordxx c4f86ebfc8 Call game_flush_inputs for all windows' EVENT_WINDOW_ACTIVATED, so clicking on a pilot doesn't bring up the multiplayer screen for example 2010-02-25 08:00:15 +00:00
kreatordxx 700156eb36 Put fast save back, using Alt-F1 instead of F6 2010-02-25 03:08:10 +00:00
zicodxx 1300fe7ffc Due to the change of GameCfg.ControlType, Mouselook was broken - fixed 2010-02-23 23:23:21 +00:00
zicodxx 8ca0637f99 Adding a Failsafe to Songs-reading so it will not accidentially read over current Array-boundaries 2010-02-23 16:05:11 +00:00
zicodxx 72fe1664fd Add to help how to send a message to a specific player in Multiplayer; Removed NoBombs command as this is covered by the weapons selection in Multiplayer game creation 2010-02-23 15:22:28 +00:00
zicodxx e22b62eee4 Make Version-check for UDP also cover Micro-versions; Making sure versioning will act same way as conf.h for MacOS 2010-02-23 15:05:50 +00:00
zicodxx 675d6d395a Overhaul for CONTROLS menu; Cleaned kconfig-code a little and slacked out keymap arrays 2010-02-21 01:25:27 +00:00
zicodxx 4733361212 Making reading of descent.sng a bit more flexible; Not dynamically allocated, yet, since missions are not as well 2010-02-19 15:30:57 +00:00
zicodxx 26a6bf4c59 Small fix for most recent commit: Removed an obsolete d_free 2010-02-19 01:00:59 +00:00
zicodxx 19c82e97e3 The little light bulb showing homing warning in Cockpit was broken and I replaced it; Rewritten code to show weapon text in Cockpit and Statusbar slightly; Instead of using hardcoded weapon strings, use from descent.txb and fixed too long spreadfire string properly 2010-02-19 00:24:32 +00:00
zicodxx 29f475c345 Cleaning up Joystick code and on the way supporting more axes and buttons; Also fixed bug with channel_mask byte causing trouble using some axes ingame; Added argument to set environment variable which disables sticky keys (for SDL >= 1.2.14) 2010-02-14 18:48:02 +00:00
zicodxx 6c16c6174e Write gamelog.txt buffered so it will not stress the medium it's saved on 2010-02-08 14:28:12 +00:00
zicodxx 4ebc007757 Introduced hitobj_list for persistent weapon objects to keep track of multiple objects the weapon is in contect with to prevent it from doing FPS-based damage; Made persistent weapon objects not die on debris but just decrease their shields like when an ordinary player/robot is hit - makes more sense 2010-02-08 13:24:42 +00:00
kreatordxx 224f3b1b35 Don't make another Game_wind when advancing a level, fixing failed asserts / slow turning 2010-02-08 05:34:43 +00:00
kreatordxx 9acd0ba3a6 Move all globals in scores.c into struct members/local variables 2010-02-08 04:10:21 +00:00
kreatordxx 09f7bd6d57 Split select_filename into [existing] RegisterPlayer and select_demo for better clarity 2010-02-07 12:10:52 +00:00
kreatordxx d5cf0dd85b Move MAX_SUBMODELS from inferno.h to polyobj.h, fixing #include loop by removing some (mainly object.h) and instead using explicit 'struct' declarations; compile net_ipx.c for Mac SDL Video build 2010-02-07 07:28:49 +00:00
kreatordxx b85eb5b156 Make the scores menu into a window 2010-02-07 06:00:10 +00:00
kreatordxx 1f33e08116 Create the main event loop and use it for the game and main menu 2010-02-07 04:34:21 +00:00
kreatordxx 5f73aa9005 Handle player selection and demo playing in filename_menu_handler, fixing bug where it won't leave the player listbox if there's no LastPlayer; close do_options dialog when changing resolution 2010-02-06 05:21:45 +00:00
kreatordxx e5adf29b6c Set the correct scroll position for the listbox when it's shown 2010-02-06 01:41:38 +00:00
zicodxx 134f6dc388 In do_physics_sim() only set velocity from movement for certain objects which actually do collisions like Player or Robots - otherwise we might be able to shoot down projectiles or produce other unfortunate glitches 2010-02-05 18:49:24 +00:00
kreatordxx 7c083d0834 No showing the main menu background between loading a level and playing it, fixing palette issue when autoplaying a demo 2010-02-05 08:53:20 +00:00
kreatordxx b58c034350 Put the full_palette_save and palette_restore calls in the game handler for tidiness; remove leftover redundant digi_resume_digi_sounds calls 2010-02-05 02:31:36 +00:00
kreatordxx 999a1b2949 Put LeaveGame longjmp back, but in response to new EVENT_WINDOW_CLOSED, fixing demo issues; fix compiler error in last commit 2010-02-02 07:52:03 +00:00
kreatordxx 5de468326f Hide all other windows before showing error dialog, hopefully so errors don't happen while the error dialog is there 2010-02-02 05:51:32 +00:00
kreatordxx 9fd714a083 Add EVENT_WINDOW_DEACTIVATED; move many game_flush_inputs, start_time and stop_time calls to game_handler as well as digi_pause_digi_sounds and digi_resume_digi_sounds 2010-02-02 03:38:29 +00:00
kreatordxx 5c923e864d Leave kconfig_idle early if exiting kconfig to avoid erroneous memory access; initialise menu's citem properly; add EVENT_NEWMENU_CHANGED; activate USE_IPX in Xcode while I'm still changing net_ipx.c 2010-02-01 06:55:38 +00:00
zicodxx fc6d51e19e Adding a bunch of memset's to menu/automap creations so we won't run into uninitialized variables 2010-01-31 21:51:59 +00:00
kreatordxx 408f2ffd33 Fix crashing when doing menus in multiplayer, don't let player move when in automap 2010-01-31 07:45:26 +00:00
kreatordxx e05553d802 Fix memory errors, but still dynamically allocate menu and lb so it doesn't have to stay in newmenu_do4 and newmenu_listbox1 respectively 2010-01-31 04:30:48 +00:00
zicodxx d7a139207d Fixed two memory errors inside menu GUI 2010-01-30 22:49:43 +00:00
kreatordxx 21d8d86d5b Send EVENT_KEY_COMMAND from key.c; add EVENT_NEWMENU_DRAW for state restore; place newmenu and listbox calls to callback so they can override ALL newmenu behaviour 2010-01-30 03:24:19 +00:00
zicodxx 2bcf54b77a Added real Doublebuffering to SDL-build; While on the way, making Bpp selection available for SDL-build, too 2010-01-29 21:53:17 +00:00
kreatordxx 1850ac1a09 Initialise lb->first_item to 0, not -1, preventing crash if you make a listbox selection very quickly 2010-01-29 06:36:39 +00:00
kreatordxx 50afcedda5 For multiplayer, close menus from game_handler by doing frame processing in response to EVENT_WINDOW_DRAW, replacing multi_menu_poll system with single multi_menu_check call 2010-01-29 03:36:44 +00:00
zicodxx 9c4408adb2 When deleting a player also delete the Multiplayer efficiency file 2010-01-29 00:35:20 +00:00
zicodxx d17841fbc4 Improved Object signature assignment and made sure there will be no duplicates; Also used short-ranged values only so Demo system won't screw up 2010-01-28 15:26:27 +00:00
kreatordxx 1ad4448b45 Allow user to abort close, for whatever reason (helps with my next commit) 2010-01-28 04:53:56 +00:00
kreatordxx de7574451b Tidy up newmenu_show/hide_cursor calls 2010-01-28 04:24:25 +00:00
kreatordxx 9d4e69c7a9 Make response to EVENT_WINDOW_CLOSE conform to 'handling' system - returning 1 means abort closing 2010-01-28 03:27:49 +00:00
zicodxx 04316ff79b Added a new code to properly re-record view/cockpit-events at beginning and end of Demo recording so views will be fine if switched before recording started; Also added lost sequence to record Rear-view reset between levels; Last but not least, record wall tmaps in D1X-Rebirth so opened/blasted doors will be shown correctly if opened/blasted before recording; Everything done without breaking the Demo format 2010-01-28 01:08:36 +00:00
zicodxx 51c28cc8a6 Made PlayerCfg.CockpitMode an array to hold two values: 0 to store the actual cockpit, 1 to also store Letterbox, Rear, etc. Greatly helps to switch and restore views - especially in Demo playback which now properly selects modes 2010-01-28 00:04:29 +00:00
kreatordxx 00641e9aa4 Allow escape from player listbox if appropriate; call RegisterPlayer only from main menu for more flexibility; actually use file_list block so deleting players/demos doesn't crash it 2010-01-27 09:11:47 +00:00
kreatordxx c856195678 Remove all uses of LeaveGame jmpbuf to allow more changing of main loop 2010-01-27 04:30:31 +00:00
zicodxx ca2c80ce4b Once again improving Demo Interpolation code, regarding changes from rev993, reducing Viewport flicker and jitter 2010-01-26 12:04:50 +00:00
zicodxx 8c2a404085 Rewrote code for showing Cloak-effect on Cockpit and Statusbar, because it became bugged with changed order of function calls do_cloaked_stuff() and render_gauges(); Fixed cockpit switches for Guided missile when Player is in Rear-View - the original code never considered that 2010-01-24 17:38:13 +00:00
kreatordxx b6b9cc1546 Move the editor call out of the Function_mode loop, for later overhaul 2010-01-23 14:19:21 +00:00
zicodxx e3ccb8e6cf Removed the new Demo Interpolating code and added the improvements to the old one 2010-01-20 23:28:35 +00:00
kreatordxx 7e92589332 Fix major issues with last commit - tidy up window callbacks to dodge EVENT_WINDOW_ACTIVATED where it's unnecessary or erroneous to respond to, fix compiling error 2010-01-20 11:04:09 +00:00
kreatordxx 88d1b32914 Add EVENT_WINDOW_ACTIVATED, change EVENT_DRAW to EVENT_WINDOW_DRAW and EVENT_CLOSE to EVENT_WINDOW_CLOSE 2010-01-20 05:10:32 +00:00
kreatordxx fe6d09750e Make net_ipx_show_game_rules and net_udp_show_game_rules into windows 2010-01-19 14:53:06 +00:00
kreatordxx e7c04d7d90 Make kconfig menus into windows - allowing drawing of the game screen behind, changing of item to change while question mark flashing and clicking out of item change 2010-01-18 05:53:13 +00:00
kreatordxx 633b1b0804 Respond to EVENT_NEWMENU_SELECTED for options_menuset and input_menuset, so the input menu will have THE event loop for kconfig 2010-01-17 14:42:59 +00:00
kreatordxx e52f47e741 For get_filename, put mode and find variables in a structure - fixing 64-bit problem and allowing freeing of PHYSFS file list in callback in future, respectively 2010-01-15 13:02:28 +00:00
kreatordxx b3b87fc62d Make pause box a window 2010-01-09 09:19:26 +00:00
kreatordxx b97e08dfdc Add EVENT_NEWMENU_SELECTED, allowing a newmenu/listbox selection to be handled in the callback. Demonstrate with "Select Song" menu 2010-01-08 01:55:12 +00:00
kreatordxx 6b4d952ebc Change newmenu and listbox callback systems, adding use of d_event, for greater flexibility 2010-01-07 14:49:07 +00:00
zicodxx e5cc87f4a2 New Interpolation method for demos and a small hack to fix this Interpolation if duplicate object signatures appear (mostly) 2010-01-07 00:01:36 +00:00
kreatordxx 32ce77350a Put most of the remaining globals in automap.c in the 'automap' struct 2009-12-27 12:27:44 +00:00
kreatordxx d21f7e78b9 Make listboxes into windows 2009-12-27 05:00:45 +00:00
kreatordxx d450c3e6f4 Make newmenus into windows, allowing redrawing of automap and game to take place outside of newmenu.c; remove redundant keyd_repeat 2009-12-26 01:08:57 +00:00
kreatordxx dad42489f7 Make sure the Game_wind only gets freed once when escaping demo playback 2009-12-14 13:27:05 +00:00
kreatordxx 54e376ebbe Make sure the Game_wind always gets freed when exiting the game screen, fixing flashing automap and framerate reduction after playing demos 2009-12-12 11:34:32 +00:00
kreatordxx a7d99b894c Move newmenu_get_filename to menu.c, call it get_filename and have it use newmenu_listbox1; support long demo filenames 2009-12-08 11:01:36 +00:00
kreatordxx 8d653f877e Make newmenu.c nearly identical between D1X and D2X 2009-12-05 09:48:18 +00:00
kreatordxx 7ebcf32e45 Make the automap into a 'window', make kconfig.c more similar between D1X and D2X 2009-12-02 13:49:54 +00:00
zicodxx 37b4803493 Squishing string-related bugs in Bomb display and Weapon reordering 2009-12-01 14:50:09 +00:00
zicodxx 75062a8d96 Making files in 2d directory more similar and removed unused and broken code; Fixing a bunch of memory errors; Removed stack protecting flag for gcc in debug mode 2009-11-30 22:42:55 +00:00
zicodxx 86fcdc5d81 Draw Endlevel sequence with correct DepthFunc 2009-11-30 19:11:46 +00:00
zicodxx 127af323e0 Reintroduced Newdemo_game_mode to prevent demo playback from entering code parts it should not and fixing a bug with Multiplayer demos along the way, introduced in rev. 953 2009-11-30 14:59:37 +00:00
zicodxx 6a00504d89 Adding macros USE_UDP and USE_IPX for the compiler to compile with either UDP- and/or IPX-support and removed the older IPX macros 2009-11-29 16:46:13 +00:00
zicodxx e9d4eb051e Fixed building error on Windows caused by false socket variable; Fixed compiler Warnings on Mac; Updated Mac build files; Unification in version numbering 2009-11-28 20:57:57 +00:00
kreatordxx 9192b5ede6 Fix some compile errors, including for the non-NETWORK build 2009-11-28 07:51:06 +00:00
zicodxx 242b3531fa Again making the joining safer 2009-11-25 00:26:26 +00:00
zicodxx fb08673f54 Removed timer_get_approx_seconds() and replaced with timer_get_fixed seconds since it was too inaccurate and created significant offset 2009-11-24 22:43:41 +00:00
zicodxx cf3f852095 Improved Disconnect-handling between levels; Improved Kick-handling; Do not say that IPv4 and IPv6 builds are not compatible in scons -h anymore 2009-11-24 15:20:09 +00:00
zicodxx 2c2dc3fc13 Remove the IP check when processing game info or version deny as the IP might be translated (IPv6 especially) 2009-11-24 12:12:15 +00:00
zicodxx dbf4d55839 Abstracting networking protocols - Step 4: Implemented new UDP layer with Client/Server communication, Packet Loss Prevention and strict Version checking. Netgames list will follow later. 2009-11-24 09:48:53 +00:00
zicodxx 05ff20ccfb Adding cfile.h include to get CFILE definition work again 2009-11-22 11:07:25 +00:00