Commit graph

201 commits

Author SHA1 Message Date
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 d34936d775 Added own channel management to SDL_mixer sound interface since the builtin channel management of this lib cannot handle our needs; Little code cleanup 2011-05-30 02:17:45 +02:00
zicodxx 52a4c9ff59 In event_process() if a window closes while being drawn and there isn't a previous window we can get the next from just finish processing for this frame 2011-05-26 09:41:28 +02:00
zicodxx 4e21bb9cd2 When reading ingame controls only flush mouse delta timer-based since reading is event-based already, allowing high precision no matter the game speed; Removed Mouse smoothing/filtering as it's now unnecessary due to event-based motion handling 2011-04-22 13:01:38 +02:00
zicodxx 89ef310ec6 Added SDLK_WORLD_** symbols to keyboard array to enable layout specific keys and make the game more flexible 2011-04-21 21:22:46 +02:00
Chris Taylor cc5a7d1359 Fix broken m3u playlist support (in jukebox_play() path resolving); point to default descent.m3u playlist for Mac OS X (will be included in bundle); better error reporting in mix_play_file(); only make relative Jukebox path in the menu absolute after browsing it - relative paths are more flexible; allow select_file_recursive() to figure out PhysicsFS relative paths passed to it; stop the music if Jukebox is chosen and unavailable (used to just keep playing the last song) 2011-04-18 20:32:36 +08:00
zicodxx c960d5505a Added cv_fade_level to canvas structure to replace Gr_scanline_darkening_level; Added cv_blend_func to canvas structure to set blending; Introduced gr_settransblend to set cv_fade_level and cv_blend_func; Added function to set normal blending, additive alpha blending and additive color blending; Moved Special transparency effects from g3_draw_bitmap to render_object to set individual transparency and/or blending for each object outside of OpenGL-specific code; Added special blending for fuelcenter and force field effects as well; Removed unused LASER_HACK code; Renamed OglAlphaEffects variable of PalyerCfg to AlphaEffects as I plan to implement this kind of effects for Software renderer, too 2011-02-23 17:46:39 +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 031420cf74 Simplified ogl version of gr.c in terms of SDL video flags and fullscreen toggle; Added command-line/INI option to remove borders from windowed program 2011-02-10 15:30:08 +01:00
zicodxx c7a65c9313 Included new window structure flag w_closing_state and let window_close() set this flag - after drawing all windows, check them again and call window_do_close() which then actually closes the window(s) marked to. Solving all sorts of problems when windows close while being drawn (network error messageboxes, game_leave_menus(), etc.) 2011-02-03 11:48:27 +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 518e01fbe8 In event_process() check for wind->next before sending EVENT_WINDOW_DRAW in case drawing will free wind 2011-01-26 11:55:47 +01:00
zicodxx 33d3b1c6a8 Added a simple random function for the Jukebox; Removed one small printf I once added for debugging 2011-01-20 12:17:30 +01:00
zicodxx 9f6cbc8c6c Retired most of the Assembler code except the generic i386 scanline renderer; Removed all leftovers of Direct3D implementation; On the way make a some code more similar between D1X-Rebirth and D2X-Rebirth 2011-01-19 21:35:14 +01:00
Chris Taylor b64794e1b4 Still send idle events when receiving SDL joystick events, fixing possible joystick issues 2011-01-17 12:17:21 +08:00
Chris Taylor 030aef43e3 For editor, replace use of ui_mega_process() with event_process(), with the editor's own default event handler; add EVENT_MOUSE_MOVED event with event_mouse_get_delta() accessor; add event_key_get() to replace ugly casting; rename mouse_get_button() with event_mouse_get_button() to keep with name convention; only send idle events when there are no input events so editor still works properly (or the same anyway); add and use event_send() function for input events (including idle) 2011-01-14 17:51:13 +08:00
zicodxx 02c5c1bda9 Reverted most of the last commit - didn't work well when timer was updated too frequently 2011-01-11 00:37:45 +01:00
zicodxx 4026c8a73a In timer_update() use i2f and fixdiv for SDL_GetTicks() to get more accurate values to F64_RunTime; Added rollover check for SDL_GetTicks() to timer_delay2() 2011-01-10 22:59:00 +01:00
zicodxx adad856f38 Improvement on the HMP track loop feature by TURRICAN; Added small template fix for descent.hmp which is supposed to be activated soon as we have some kind or Checksum function 2011-01-09 17:51:48 +01:00
zicodxx 3adc5fe77a Saving weapon keys in PLX like in D1X-Rebirth; Added Cycle Primary/Secondary for Mouse which makes wheel axis cycling unnecessary and also let Weapon Keys be assigned to a Mouse button; If GameArg.NoStickyKeys do flush these keys so they can be used as normal game keys - otherwise ban them; Fixed crash when reassigning mouse button greater than 3; Joystick/Mouse function taking button as argument now check for sanity of this value so they can safely be used in kconfig code and deal with unassigned key values 2011-01-03 01:09:09 +01:00
zicodxx 8dcbb3bd81 Introduced function key_ismodlck to get the status of modifier keys or sticky keys; Let sticky keys survive flush so we can accurately use their real states; Added key repeating via SDL; Depending on status of KEY_NUMLOCK keypad will either be used as numerical or arrow input in menus; Fixed small typo for mouse.h include in credits.c 2011-01-02 18:07:44 +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
zicodxx 70e43722e1 In window_close() prev window did not get EVENT_WINDOW_ACTIVATED but the recent closed window got it causing previous window not being activated anymore and a bunch of memory errors 2010-12-22 01:11:14 +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 3ef5dff1a6 Add CON_DEBUG level con_printf's for basic events (not EVENT_IDLE or EVENT_DRAW though) 2010-12-05 21:51:34 +08:00
zicodxx acac225493 Large improvement for _WIN32 native MIDI code by TURRICAN0: supprt for HMP track loop, seamless song looping, GS reset, pausing/resuming midi, volume control for each MIDI channel; Set GameArg.SndDisableSdlMixer automatically if compiled without SDL_mixer support; On _WIN32 play HMP natively again 2010-11-28 16:49:40 +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 dc85211d37 Make sure read_m3u won't read past the end of the buffer, causing a crash 2010-11-22 20:49:44 +08:00
zicodxx 1482048152 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:35 +01:00
Chris Taylor 53eef82836 Make sure read_m3u won't read past the end of the buffer, causing a crash 2010-11-13 13:11:25 +08:00
zicodxx ae22f8e037 Instead of writing converted MIDI to file, write to buffer so it can be played directly 2010-10-29 17:40:42 +02:00
Chris Taylor e57ffac570 Fix errors for Mac OS 9, Mac OS X 'd2x' target builds again 2010-10-16 18:57:50 +08:00
zicodxx 283172aff6 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:46:20 +02: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
kreatordxx ba7d0513c3 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
zicodxx 5923bce64d When opening music file via filehandle, made sure buffer is freed after playing to prevent major memory leakage 2010-09-02 14:00:26 +00:00
kreatordxx 466f51e8f5 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
kreatordxx 55871bba3e Add path browsing feature to make song file/directory selection easier 2010-08-27 14:09:19 +00:00
kreatordxx 39fd679cb9 Use more reliable Mix_LoadMUS for music in directory searchpaths, so WAVE's and MP3's are correctly loaded (probably others) 2010-08-22 13:27:47 +00:00
zicodxx 6c61d30ffa Added res-file to be linked in Windows build to show icon in Filemanager; converted icon file to be smaller 2010-08-21 17:08:53 +00:00
zicodxx 9a42f9ca8b Bind WM-Icon to application 2010-08-21 06:51:13 +00:00
zicodxx 47255f4e31 For each Music playback system defining own volume scaling definition which was wrong for SDL_mixer 2010-08-19 15:54:19 +00:00
kreatordxx afb0c08a1e Between event sending, exit event_process if front window is different, fixing netgame joining problem introduced with commit on 20100731 2010-08-06 06:49:45 +00:00
zicodxx e8c22880b9 If mouse_toggle_cursor is set to activate, do not toggle ursor visibility as mouse_update_cursor_and_grab might decide it should be hidden 2010-08-01 17:46:13 +00:00
zicodxx fd32ea98c4 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
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 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 9f5860a54a 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
zicodxx 0e0b04c138 Fixing automatic mouse release function - still this does not seem to work in every case 2010-07-27 19:42:28 +00:00
zicodxx 3a67eed1a8 Overhauling showing/grabbing cursor and also taking care of case if program looses focus; store old_delta_x/y in mouse info structure 2010-07-26 18:10:21 +00:00