Commit graph

119 commits

Author SHA1 Message Date
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 beb39df2d4 Keep demo selector just after playing one, for convenience 2010-04-02 05:24:47 +00:00
kreatordxx dae5968170 Add a default event handler for screenshots, entering debugger, Redbook repeating etc 2010-04-02 05:01:08 +00:00
kreatordxx 95d7c4491d 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
kreatordxx 037bbd8786 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 7b478e9853 Make all listboxes fall back to main event loop for flexibility 2010-03-18 07:02:38 +00:00
kreatordxx 59a10f14d6 Fix memory error for listbox when clicking in the region where there are no items 2010-03-14 01:54:34 +00:00
kreatordxx 746832e8ab 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
kreatordxx 1f479a756c 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 55a6e7f97e Set the correct scroll position for the listbox when it's shown 2010-02-06 01:41:38 +00:00
kreatordxx f730b25932 Reset last_palette_loaded in nm_draw_background1 as before, it's needed for using the right palette when advancing a level 2010-02-06 01:19:40 +00:00
kreatordxx 35f0aa14f7 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 9d7bce257c 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 98d5b76928 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 eb92f445ca 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 35584d725b 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 90e4b4ed95 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 ff04fd682e Fix crashing when doing menus in multiplayer, don't let player move when in automap 2010-01-31 07:45:26 +00:00
kreatordxx dab9a9f5a6 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 6cbf0ca110 Fixed two memory errors inside menu GUI 2010-01-30 22:49:43 +00:00
kreatordxx 5ac8cf2b2d 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 e46606821f 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 b2db38be4c 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 f83741d89f 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
kreatordxx 5d3ea4051f Allow user to abort close, for whatever reason (helps with my next commit) 2010-01-28 04:53:56 +00:00
kreatordxx f6c32d7518 Tidy up newmenu_show/hide_cursor calls 2010-01-28 04:24:25 +00:00
kreatordxx 3f90a9cb41 Make response to EVENT_WINDOW_CLOSE conform to 'handling' system - returning 1 means abort closing 2010-01-28 03:27:49 +00:00
kreatordxx 71c656200b 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 62a9214bc3 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 c50b954c00 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 624ae0b6d0 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 b6452e75b7 Change newmenu and listbox callback systems, adding use of d_event, for greater flexibility 2010-01-07 14:49:07 +00:00
kreatordxx f0fa1c81d9 Make listboxes into windows 2009-12-27 05:00:45 +00:00
kreatordxx b835361586 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 19806aa7ec 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 992648620c Make newmenu.c nearly identical between D1X and D2X 2009-12-05 09:48:18 +00:00
zicodxx f782692332 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 53c19912fa 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
kreatordxx 00347f0bcb Add endian converter for demos, read shareware demos, various bugfixes to demo system 2009-11-15 08:22:08 +00:00
kreatordxx dd8f679724 Make game.c more similar between D1X and D2X, making related changes to other files (\!) 2009-07-01 11:35:33 +00:00
kreatordxx bf512bb9ec Remove redundant conf.h directives 2009-04-30 13:01:31 +00:00
zicodxx b3bf4813df Abstracting networking protocols - Step 2: Introducing new structure to hold protocol-dependend and -independend information about Netgame and it's Players; Further isolation of the IPX code and renaming the netdrv_* code to ipxdrv_* as this is now actually IPX-only; Next up: Renaming network_* functions to net_ipx_*, writing wrappers for protocol dependend functions in multi.c, Implementing protocol selection and Cleanup 2009-03-20 12:10:38 +00:00
zicodxx 8da36f8873 Abstracting networking protocols - Step 1: Renaming network-related files; Removing net_ipx.h (former network.h) includes from as much files as possible to make isolation of IPX-related functions easier in Step 2; Version defines Cleanup - needed later for good Version-Checking 2009-03-04 21:04:43 +00:00
kreatordxx b537639fac Associate the jukebox with Redbook Audio via new 'extmusic' layer - separating from MIDI and making it handle ALL music (not just game music) 2009-03-03 12:55:27 +00:00
zicodxx 4bf841f3c9 Seperated help screens for game, netgame and demo; Also show them in Controls menu; Small Menu UI fix for ScrollOffset when calling menus in a scrolled area of a menu 2008-12-13 12:58:57 +00:00
kreatordxx 777f76aedf Get Mac command keys working, MACINTOSH code cleanup, update Xcode project 2008-12-07 12:26:43 +00:00
zicodxx 02b1872aa9 Yet another UNICODE overhaul - Using seperate buffer for UNICODE chars and only use it in key_ascii() while still using keysyms for the rest of the program so we do not screw up readings by key values altered by modifers - possibly still room to optimize 2008-11-17 23:38:43 +00:00
zicodxx 7d96dea2a5 Small Cleanup: Using timer_delay for credits timer as timer_delay2 would respect VSync and change speed of the Credits scrolling; Cleaned that Start/Join Netgame cases up a bit; Removed the excessive use of atexit in newmenu... more to come 2008-11-09 23:51:19 +00:00
zicodxx b174709a1b Fixed possible overflows in Jukebox Path; Menu GUI improvements: Correct inputbox scaling for font widths, a little performance boost when determinating string-part to show in inputbox, make it possible to flip over from first/last menu entry to last/first even if it's a ScrollBox, Scrolling via Maousebutton now works with delay; Made reading for Piggy data always break up in loops when reached end of file instead of provoking possible error if *data-count < max-data-count* 2008-11-01 01:19:52 +00:00
zicodxx 9cc62df60d Always use printable UNICODE characters for the key_handler and included routine to assign key symbols to UNICODE so we get an equivalent of a Key-Released state which we need for the Keyboard buffer; Removed the shifted_ascii_value field from key_props and stored all usable characters in seperate rows; Improves Text input and makes keyboard mapping independent from keyboard layout without breaking any compability 2008-10-31 16:57:36 +00:00