Commit graph

1062 commits

Author SHA1 Message Date
Chris Taylor 50070ba165 No calling piggy_dump_all() when EDITOR is defined, it causes a failed Assert and causes it to exit when the PC Shareware descent.pig is used 2012-07-24 16:23:43 +08:00
zicodxx 33bf139002 Redefined lotsa variables, functions and parameters as const and/or static - patch by Kp 2012-07-23 01:17:52 +02:00
zicodxx 63fe8ddc37 Introduced INITIAL_ENERGY and INITIAL_SHIELDS defines from d2x and on that way added handicap feature for multiplayer as well; incremented multi proto version 2012-06-18 01:45:17 +02:00
zicodxx effc8c3fc4 removed temp_string buffer for ingame message inputs preventing the string from being messed up if containing special characters 2012-06-18 01:26:49 +02:00
zicodxx c8d428913e added songs_play_file() to play any song depending on filename-extension as a more streamlined approach to handle all different kinds of formats; also used for jukebox to make it independent from SDL_mixer; cleaned up supported filename extenstions 2012-06-10 14:02:40 +02:00
zicodxx d44af70b28 in vms_matrix_from_quaternion put the definition of tmp1 and tmp2 variables at the beginning of the functions because i was a baaaad boy 2012-06-08 15:54:11 +02:00
zicodxx decbf0cdbd Switching keyboard sensitivity function from variable increase to variable offset, making the ship more responsive in higher settings 2012-06-08 12:22:42 +02:00
zicodxx 81afcf4718 renamed forgotten stricmp to d_stricmp to make editor compile again 2012-06-01 13:05:44 +02:00
zicodxx f7565217fe changed extension for archive (addon) content from zip to dxa - still a zip-file but renamed to not accidentially add user generated backups and possibly mess things up 2012-06-01 13:04:25 +02:00
zicodxx fc421b290a use size of output buffer for snprintf; on the way changed rebirth-specific song file to dxx-r.sng to respect hog 8+3 file convention 2012-06-01 12:46:00 +02:00
zicodxx 091623d196 Introduced sensitivity sliders for keyboard which cause movement increase the longer the designated key is pressed 2012-06-01 11:53:53 +02:00
zicodxx 147f34dddb Removed Laser_offset hack 2012-05-28 00:14:49 +02:00
zicodxx fc10a7e65b removed weapon_rate_scale() which should be obsolete due to other optimizations in network code 2012-05-27 15:04:42 +02:00
zicodxx c23e75a79d Removed remnants of the old and obsolete VR implementation 2012-05-27 00:24:55 +02:00
zicodxx 847d1515cc fixed possible buffer overflow in load_screen_text() 2012-05-26 19:39:10 +02:00
zicodxx 1d68e2d3ba Optimization for quaternion structure: Stuffed orientation in shorts and removed figure out segnum by position - saving 10 bytes for each positional update in Multiplayer; Also removed render_type from pdata to save yet another byte 2012-05-26 17:53:05 +02:00
zicodxx 46f4a9e285 Fixed one more copy/paste issue causeing positional updates relayed to possibly disconnected players 2012-05-26 14:09:00 +02:00
zicodxx 98f6ac2204 Fit player/player collisions to not take damage from bump while remote player has possibly not aligned to the collision, yet; Added FORCE_DAMAGE_THRESHOLD for minimum force damage to receive from object bumps to not simply take damage from touching objects 2012-05-26 13:28:43 +02:00
zicodxx 4cfc516d56 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:22 +02:00
zicodxx a9c07f81e7 in StartLevel() only call disable_matcens() and clear_transient_objects() in Singleplayer to keep consistency with remote clients 2012-05-24 12:46:33 +02:00
zicodxx d4dfd1fb40 Introduced quaternion functions to replace vector matrix where size matters - created by Florian Feucht; Added option for pdata packets based on quaternion in Multiplayer game; Removed PF_LEVELLING from new player objects to prevent jittering in player banking 2012-05-21 17:06:47 +02:00
zicodxx 5d6f4222d7 now properly initialize all other parts of the new/old player object when restoring a coop savestate 2012-05-21 10:32:33 +02:00
zicodxx d58e6fc38f using our own functions for strdup and _splitpath with the d_ prefix for all platforms for consistency 2012-05-19 02:16:40 +02:00
zicodxx 2c9ee20981 using our own functions for stricmp, strnicmp, strlwr, strupr, strrev with a d_ prefix for all platforms for consistency 2012-05-19 01:36:41 +02:00
zicodxx 3b8175c3ba fixed incorrect canvase for opengl-scaled savestate thumbnail; rebuild free objects after restoring and remapping the coop players 2012-05-18 10:54:36 +02:00
zicodxx e7c86fd11d allow PAUSE key during death sequence to pause or view multiplayer game stats; Also reset hostages_on_board when ship blows up so pause menu during death sequence will show 0 hostages soon as the ship explodes; fixed crash for slew_init by removing old numlock hack 2012-05-16 14:39:29 +02:00
zicodxx a7420efb13 when updating game info also check for player connected status in case we send to everyone 2012-05-16 10:41:12 +02:00
zicodxx 383a00cd9c In Multiplayer when taking damage, the game will only leave menus when shield drop below 5 2012-05-16 01:06:13 +02:00
zicodxx eb87ed15e1 Do not allow ports below 1024; More verbosity for udp_open_socket() 2012-05-16 00:59:14 +02:00
zicodxx ffeddf4db6 Do not send endlevel packets to disconnected (but still saved) clients 2012-05-15 23:39:21 +02:00
zicodxx c4223a8fe5 During kmatrix bring up Game_wind againso the host can still follow the game - becomes necessary later with host-authority functions 2012-05-14 19:20:15 +02:00
zicodxx 8967ae77fe 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:27 +02:00
zicodxx 55aae15997 Made inline functions static 2012-05-14 17:13:24 +02:00
zicodxx e3a21dce5e Fixed some non-critical compiler warnings; Now compiling with -std=c99 -pedantic and fixed warnings (except for editor build) caused by this 2012-05-14 12:20:27 +02:00
zicodxx c5b3fc162e Incremented version to 0.57.3; Added Release notes 2012-05-10 19:10:45 +02:00
zicodxx a84bdf917f Reduced timeout from 10 to 5 seconds 2012-05-10 18:53:59 +02:00
zicodxx 9de6618ba0 Wrote seperate function for weapon autocycling that also cycles through non-autoselect weapons; Added option to not autoselect weapon when firing; On the way, smoothed the menu text in misc menu a bit 2012-05-10 14:39:24 +02:00
zicodxx 8cc22d8343 Reuse pre-defined player objects when loading coop savestate to revent messup when player amount or orders change in a certain way 2012-05-10 01:40:35 +02:00
zicodxx 8dfb4cde57 Added more versatility in picking targets for the creation of smart blobs - especially for Multiplayer; cleaned that code a bit; made dodging of homing projectiles a little easier 2012-05-09 01:22:28 +02:00
zicodxx b466072fd5 fixed copy/paste mistake 2012-04-30 00:38:41 +02:00
zicodxx 0472e76895 Similar to Network_new_game introduced imulti_new_game to exclusivly use in multi.c to execute stuff in new level only when starting a new game - for example resetting player ship inventory which is not supposed to happen on each level; Removed long obsolete control_invul_time varible 2012-04-27 02:09:46 +02:00
zicodxx e23535ffe8 little reorganization for draw_hud(): draw multiplayer names first, reticle last to prevent anything being drawn over by floating names and reticle not messed by anything else 2012-04-24 11:55:12 +02:00
zicodxx 20e8b6c497 fixed improper player disconnecting which might have been caused by endlevel packet 2012-04-23 16:15:20 +02:00
zicodxx d30fb514b1 Removed usage of 'oldmaxnet' variable when switching between coop and other game modes which would not be correctly set when coop mode is loaded from a netgame profile; Removed 'MaxNumNetPlayers' variable as already replaced by Netgame.max_numplayers 2012-04-18 11:28:21 +02:00
Chris Taylor 3e991237ed Call new obj_relink_all after playing a demo, so the editor is (hopefully) never faced with poorly linked objects and hence crashes 2012-04-17 17:14:21 +08:00
Chris Taylor 7b9f0f8d17 Rename MessageBox to ui_messagebox to avoid a conflict with Windows' MessageBox 2012-04-17 16:02:32 +08:00
Chris Taylor 7971e8cff8 Call free_mission() if a demo is corrupt, so the editor doesn't load a corrupt level 2012-04-17 15:45:58 +08:00
Chris Taylor 670219fa5a Set object lifeleft to IMMORTAL_TIME if the byte read in demo playback is -1. This allows the objects to stay when playing a demo, going to the editor then playing the game from the editor 2012-04-17 15:35:23 +08:00
Chris Taylor 7ff82427d9 Skip rendering of OBJ_NONE objects to avoid a failed Assert (can happen when playing a demo then going to the editor) 2012-04-17 15:20:51 +08:00
Chris Taylor 36aeba165a Reset the player object for the editor, since demo playback mucks it up 2012-04-17 15:11:49 +08:00
Chris Taylor a5f9d3933d Allow level progressing if playing the builtin mission with EDITOR compiled - only exit if Current_level_num is 0 2012-04-17 15:04:18 +08:00
Chris Taylor fa76bc657e Make a new mission when making a new mine to avoid a crash when testing it straight from the editor and winning, only create a new mine if a mission isn't loaded, if it thinks it needs to use Cursegp to fix the player object make sure Cursegp is initialised, remove key command for ToggleDrawAllSegments since add segment now has ctrl-A 2012-04-16 16:53:32 +08:00
Chris Taylor ee9f1b33db 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:41:26 +08:00
Chris Taylor ad5549793f Make movement in the editor's game screen use the player controls, make that movement more like the automap and resolve some likely conflicting key commands 2012-04-16 13:26:14 +08:00
zicodxx 4287e713b1 fixed two bugs caused by recent Multiplayer cleanup: Set more player-death-related veriables outside of dead_player_end() when creating new ship as not covered in subfunction is Palyer_is_dead is not true; also init my own inventory properly in multi_prep_level to get our inventory straight after receiving netgame information 2012-04-16 01:13:27 +02:00
zicodxx e8d4070413 Fixed set but unused variables in OGL build 2012-04-15 16:15:18 +02:00
zicodxx c308f45544 addition for last commit - forgot to fix when resolving merge-conflict 2012-04-15 16:05:59 +02:00
zicodxx a92f7497a3 Addition for last change in hmp_reset(): execute midiOutShortMsg() even if midiOutPrepareHeader() fails as not related to SysEx part 2012-04-15 15:52:12 +02:00
zicodxx 897a6aaf6b 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:46 +02:00
Chris Taylor e1eaf7cc65 Clicking on mine elements in the editor now works in ogl 2012-04-15 13:43:41 +08:00
Chris Taylor 1d05b49978 Set edge_list_size to Num_segments*12 to avoid crashes in the editor with certain third party levels 2012-04-15 09:32:04 +08:00
zicodxx 2a15431ec7 When possibly sending player positions prior to firing, do that before messing multibuf; Added more strict sanity checks for outgoing and incoming multi packets; Moved some general game stuff from net_udp_init() to multi_new_game() 2012-04-15 03:05:25 +02:00
Chris Taylor 8b22237d4e Set the correct palette for the editor 2012-04-14 18:28:07 +08:00
Chris Taylor b80b863f49 Fix bugs switching between game and editor and back: make sure ModeFlag is set to 0 before it has any chance to show an alert message, fixing a crash; allow OBJ_NONE in Assert; make Game_wind invisible when loading editor in case we show an alert; call mouse_flush() in ui_init() to fix mouse issues 2012-04-14 17:41:50 +08:00
Chris Taylor ef6e5180db 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:06:12 +08:00
Chris Taylor 4c9ac01f4b Don't bother generating a game text file (.txm) every time a level is loaded, even if the EDITOR is compiled. Just when a level is saved 2012-04-14 14:22:18 +08:00
Chris Taylor 81cf0853f0 Fix crash when loading a level in the editor 2012-04-14 12:23:49 +08:00
zicodxx 2baf397a68 Removed redundant call of songs_stop_all() when starting credits; Added failsafe for loop in case MHDR_DONE flag is not properly set by MIDI device; Added more verbosity for hmp_reset() 2012-04-12 19:45:44 +02:00
zicodxx 9990b806a5 Fixed some Multiplayer bugs: Reactor invulnerable time did not checked for hours spent in level so reactor would become invulnerable again after 60 minutes; Fixed the fix (heh) for misordered explode/reappear packets; Reset Player_eggs_dropped when initializing new ship so eggs are properly dropped when player disconnects two times without respawning; Cleaned player disconnecting a little bit and made code more straightforward 2012-04-12 02:15:23 +02:00
Chris Taylor a327d380a7 Fix a crash when going into a directory with no files in the editor file browser, clicking on listboxes for same sets inputbox correctly 2012-04-11 12:03:36 +08:00
Chris Taylor 7aa618b266 Draw the object rotation velocity, file browser and MessageBox dialogs properly 2012-04-11 10:52:19 +08:00
Chris Taylor e93c497a47 Fix unused variable warning in last commit 2012-04-09 20:51:36 +08:00
Chris Taylor 7ef1431885 Editor exits cleanly when clicking the close box, no more redundant gr_uscanline call in gl_urect for ogl (an initial attempt to fix the previous bug) 2012-04-09 20:40:55 +08:00
Chris Taylor d9bc0a16ff No setting the screen mode when calling a newmenu function, so if it shows the 'Save Mine' messagebox in the editor, it won't change the screen resolution and trash everything. (If this causes problems, we can make it use the MessageBox if it's still in the editor, nm_messagebox otherwise) 2012-04-09 19:18:49 +08:00
Chris Taylor 418e6ab674 Fix all remaining known editor drawing issues. In ogl: get the texture previews to draw, get userbox borders to draw in the right location, properly underline characters in the menus, draw all the borders properly (i.e. no gap), no scaling fonts. Software render: draw userbox borders again. Both: clear the whole status bar, clear to the right edge of the screen. 2012-04-09 17:28:44 +08:00
Chris Taylor 285531c4e0 Fix a nasty bug where pressing 'Alt' to explore the editor menubar would split the window stack in two, rendering the editor unresponsive 2012-04-09 17:12:01 +08:00
Chris Taylor 8a437a759c Get the clock, 'keypad' info, texture choosing page and object choosing page to draw (latter two just show black squares for ogl) 2012-04-09 10:12:58 +08:00
zicodxx 999e008dc6 in software rendering scale savestate thumbnail to correct size 2012-04-09 00:19:11 +02:00
zicodxx 9825e264d5 plasma fire can ignite bombs which are dropped while firing. to compensate added a timed check where at least one projectile must be older than 200ms to trigger a possible collision. this fixes this issue if the player is moving away from the bomb 2012-04-08 16:59:50 +02:00
zicodxx ba75f1237e added specification for Descent: Destination Saturn briefing screen to properly show briefings; added different briefing structure for Descent 1 Shareware which has a slightly different order of the usual briefings 2012-04-08 15:47:50 +02:00
zicodxx d39d58a585 record shields if player is invulnerable to get proper shield display in demo playback if player respawns with invulnerability on 2012-04-07 16:13:10 +02:00
zicodxx 9ca56e4039 fixed glitch when reappear and explode packets are misordered, rendering player invisible 2012-04-07 12:32:22 +02:00
zicodxx 513bd4b231 removed redundant definitions of FILENAME_LEN 2012-04-07 11:41:14 +02:00
zicodxx 51b6b4e271 made code more similar to D2X-Rebirth by introducing open_font which allows to keep track of font_data and free it properly 2012-04-07 11:35:38 +02:00
zicodxx abb2c08af3 made choose_drop_segment more similar to D2X-Rebirth and let fallback correctly check for reactor segment 2012-04-07 10:57:55 +02:00
zicodxx 4f8a60983e Introduced fixmul64 returning fix64 type to use with check_point_to_face() and prevent fix overflow with very large faces; on the way cleaned up NO_FIX_INLINE remnants and replaced QLONG with fix64 2012-04-05 02:41:56 +02:00
Chris Taylor 09a37b623a Make the editor draw the same for the non-ogl build as the ogl build, since I just made it draw the grey background over everything in the last commit. If you want to see what it's *supposed* to look like, go to yesterday's commit :P 2012-03-31 20:11:39 +08:00
Chris Taylor 801e989a66 Use correct coordinates for dialog border (still doesn't draw fully) 2012-03-31 19:47:39 +08:00
Chris Taylor 00245bccdc Make the main stuff (gadgets, two viewers) draw for the editor in ogl, still more tweaking required 2012-03-31 18:35:06 +08:00
Chris Taylor 2d8c86eaf1 Make all drawing in the editor single buffered, since the whole screen is double buffered. Fixes crash - but only shows a black screen and the menu for ogl 2012-03-31 12:27:10 +08:00
Chris Taylor c75f1d3937 Make sure the ogl font code recognises the editor font is fixed width, fixing a crash; take the plunge and make D1X Rebirth compile with editor for Mac OpenGL build (won't work yet) 2012-03-31 11:36:56 +08:00
zicodxx 24d0849125 Changed declaration of event_get_idle_second() from int32_t to fix since Windows does not know it without pstypes.h. Included maths.h for this but should now work flawlessly on all platforms 2012-03-30 16:29:03 +02:00
Chris Taylor 1237649a99 Make 2d/font.c more similar between d1x-rebirth and d2x-rebirth 2012-03-30 20:35:39 +08:00
zicodxx 0dae4f8206 Fixed Redbook playback which was not repeating the CD after finishing 2012-03-29 14:49:44 +02:00
zicodxx 1a76d33345 Immediately relay pdata packets from clients to others which should reduce artificial delay; allow sending of pdata packet when firing if enough time has passed since last update; only answer full game info requests 2 times per second and lite info 8 times per second 2012-03-29 10:15:58 +02:00
zicodxx 0e55ac91da Added forgotten D2 powerup capping code when starting level which hopefully fixes massive powerup loss 2012-03-28 21:45:40 +02:00
zicodxx 6251eb2eb0 Dynamically allocate line to read from descent.cfg and ensure a safe length 2012-03-28 13:43:31 +02:00
zicodxx 32ebfab29d Allow a total of 32 different player ship textures and stored N_PLAYER_SHIP_TEXTURES in player.h 2012-03-28 12:26:19 +02:00
zicodxx 4ddf79e16f Since the kicked message is shown after player is technically removed from the game we do not know hosts name anymore. Message changed accordingly 2012-03-28 12:09:19 +02:00
zicodxx d583415cfb in netgame info screen some setting-descriptions were interchanged and displayed wrong toggles 2012-03-28 12:02:15 +02:00