Commit graph

87 commits

Author SHA1 Message Date
Chris Taylor 6df1b85b87 Fix error due to -Werror -Wmissing-declarations in write_mission
This error was reported for gcc. Also set file extension correctly for 'enhanced' missions (though currently unused). Also some tidying up in response to feedback.
2016-11-15 15:03:34 +08:00
Chris Taylor 0e0bc755be Write mission file when calling create_new_mission
This removes an ambiguity when loading a saved game - we need to know the mission descent version **before** calling LoadLevel in state_restore_all_sub (a chicken and egg situation if we go down the fake dummy mission path). This also creates a fully playable mission (albeit simple).
2016-11-14 21:42:35 +08:00
Chris Taylor c6f5e91f4a Saved games from editor generated levels now work
Editor generated levels use the dummy mission created by create_new_mission.
2016-11-13 17:21:45 +08:00
Chris Taylor ac52a30214 Fix spurious exploding wall and crash when playing a level loaded with the editor
When File->'Play in 320x200' is chosen, use StartNewGame(Current_level_num). For now use create_new_mission and Current_level_num = 1 every time. Also remove the now redundant hacks GM_EDITOR and editor_reset_stuff_on_level.
2016-11-12 15:38:38 +08:00
Chris Taylor 48e9061960 Make the listbox handlers return a window_event_result
Make the listbox handlers and all sub-handlers (when_selected callbacks) return a window_event_result. Makes code more readable and removes one use of window_close, making it easier to inform event system if a window closes in future.
2016-10-27 15:22:41 +08:00
Kp 6a3ded191f Move EDITOR to dxxsconf.h; rename to DXX_USE_EDITOR
Rename symbol EDITOR to DXX_USE_EDITOR to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
2016-09-11 18:49:16 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 771665835d Move LastMission to CCfg 2016-08-06 19:55:25 +00:00
Kp b449986ea8 Use make_unique to reset editor's Current_mission 2016-08-06 19:55:25 +00:00
Kp a230d24226 Allow trailing comments after num_levels and num_secrets 2016-07-30 21:56:31 +00:00
Kp 7d468491a1 Fix -Wshadow warnings in mission.cpp 2016-05-22 17:49:32 +00:00
Kp e3eceb2c6e Fix -Wshadow warnings in load_mission 2016-05-22 17:49:31 +00:00
Chris Taylor e7c437f7fb Address Clang name lookup issues: lookup descent_version_type enumerations against 'Mission' type instead of from Mission/Mission_path instances 2016-03-06 13:01:41 +08:00
Kp 86709f547b Fix capitalization of PHYSFS_File
Per comment in physfs.h, the spelling PHYSFS_file is deprecated.
Replace all instances with PHYSFS_File.
2016-01-09 16:38:14 +00:00
Kp 608cfdbf07 Combine Mission::enhanced with Mission::descent_version 2016-01-09 16:38:09 +00:00
Kp 309426e024 Use enum class for descent_version 2015-10-18 21:01:18 +00:00
Kp ddf1ded74c Simplify add_missions_to_list 2015-10-11 22:21:00 +00:00
Kp ad8c64d7ff Remove unnecessary extension strip in promote 2015-10-11 22:21:00 +00:00
Kp 1ecbeb6bf9 Remove redundant use of PHYSFSX_exists 2015-10-09 02:46:11 +00:00
Kp 5fc3e44bee Simplify setup of linked ham 2015-10-09 02:46:11 +00:00
Kp 78de0ac119 Add fwd-event.h with forward declarations of event.h 2015-10-09 02:46:10 +00:00
Kp 17b1943c5e Mark various per-file structures as static 2015-08-12 03:11:46 +00:00
Kp f00725f740 Use forward-declaration header for player.h 2015-07-25 23:10:45 +00:00
Kp 70c4cc87ab Use forward-declaration header for weapon.h 2015-07-25 23:10:45 +00:00
Kp fc4b686d9d Store PHYSFS_list element count in list when needed 2015-05-09 17:38:57 +00:00
Kp c3925353fd Use null_sentinel_iterator for PHYSFS_list_t 2015-04-26 20:15:51 +00:00
Kp 143c536c77 Use PHYSFS_list_t for more functions 2015-04-26 20:15:50 +00:00
Kp 65ff319ebb Use ntstring for LastMission 2015-03-22 18:49:20 +00:00
Kp cc508be34c Pass selection for EVENT_NEWMENU_SELECTED 2015-02-28 22:34:07 +00:00
Kp f2fb31a120 Merge 'D1 emulation issues' into unification/master
Requested by btb: https://github.com/dxx-rebirth/dxx-rebirth/pull/38
2015-02-20 03:00:46 +00:00
Kp 5a015b38e5 Add D1_MISSION_HOGSIZE2 to load_mission_d1 cases
Fixes: 33c118f999 ("Enable Int3 as d_debugbreak")
2015-02-15 17:24:55 +00:00
Bradley Bell f535bff4f8 When emulating D1, put descent.hog at front of search list.
That way we get the D1 music when playing a D1 mission.
This also means we get D1 music in the menu, etc.
Therefore only keeps D1 assets loaded until non-D1 mission is selected.
2015-02-08 12:26:36 -08:00
Kp 88c740b3a5 Record briefing without modification 2015-01-18 01:58:31 +00:00
Kp 43abfdf431 Split set_briefing_filename 2015-01-18 01:58:31 +00:00
Kp e9e69a1a1a Use ntstring copy_if in set_briefing_filename 2015-01-18 01:58:30 +00:00
Kp f7815810e8 Use RAIIPHYSFS_File to manage PHYSFS_File
Fixes a few leaks on error paths.
2015-01-17 18:31:42 +00:00
Kp 68d705a85a Use bool conversion to test PHYSFS_File pointer 2015-01-17 18:31:42 +00:00
Kp d443e28147 Reuse mle_path as Mission_path 2015-01-15 04:30:03 +00:00
Kp b175c944ef Simplify mle_path 2015-01-14 02:26:20 +00:00
Kp ea3c789f64 Fix Windows build break due to strchr losing const
Mingw32 headers and Apple libc++ both strip const from strchr.  Store
the result into a const char* to restore const to the pointer.
2015-01-14 02:26:20 +00:00
Kp 24bdbfb933 Move mle path carefully 2015-01-13 04:19:42 +00:00
Kp 1c4c33513b Copy secret level name without modification 2015-01-12 00:26:03 +00:00
Kp ddc40a6634 Copy level name without modification 2015-01-12 00:26:03 +00:00
Kp b6a3735f53 Add convenience d_strnicmp for literal right side 2015-01-12 00:26:03 +00:00
Kp 5402e8c546 Add unchecked_partial_range for ranges without end 2015-01-11 05:08:30 +00:00
Kp ac1340e3c9 Use ntstring for mission_name 2014-12-22 04:35:48 +00:00
Kp 1344fb2779 Fix crash choosing jukebox directory
newmenu_listbox1 returns immediately
2014-12-22 04:35:47 +00:00
Kp 2766114959 Make PHYSFSX_gets_line_t::line_t be array<> 2014-12-20 04:36:10 +00:00
Kp 7c24f6896f Stop briefing search on dot or null
Mission names are passed in without an extension.  Short mission names
read beyond the end of the buffer, causing AddressSanitizer to kill the
program.

Reported by btb: https://github.com/dxx-rebirth/dxx-rebirth/issues/20
2014-12-08 03:54:11 +00:00
Kp 73b0a016a8 Fix loading robots-?.mvl
Rework movie loading to fix loading built-in robot movies.  The previous
code always ignored loading the last entry in the movie array, which was
blank until 18f6919b33.  The last entry
was unused after d38a3d1362, so it was
removed, which caused the code to skip the robots entry.

Commit d38a3d1362 broke unloading add-on
movies by removing the strcpy which saved their name.  Add code to save
the name to extra_robot_movie_mission and call it when switching
missions.

Reported by btb: https://github.com/dxx-rebirth/dxx-rebirth/pull/17
2014-12-06 17:56:56 +00:00