Compare commits

...
3683 Commits
Author SHA1 Message Date
z64555 8b517ddda9 Adds outwindow init and the SCP_mspdbcs init and cleanup. 2016-08-15 17:45:22 -05:00
z64555 6bc5a395e0 Pointless style flag is pointless 2016-08-15 17:28:52 -05:00
z64555 318496992e Fix bug where scene would not repaint when window was resized to something smaller. 2016-08-15 17:24:55 -05:00
z64555 1e28d526ae Prevent excessive calls to wxfred::render_resize if the viewport size didn't change. 2016-08-15 16:10:48 -05:00
z64555 26a746d612 Some work on the viewport:
* Viewport now resizes. There's some kinks with re-draw to work out, though
* Viewport now displays starfield
* Viewport now displays mission grid
2016-08-15 07:24:39 -05:00
z64555 5b41dce69c Update wxfred2.cpp to use flagsets. Also a bit of whitespace maintenance (yawn). 2016-08-15 05:38:04 -05:00
z64555 ea9b611782 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into wxfred2 2016-08-15 04:37:40 -05:00
m!m ddd64146d9 Merge pull request #820 from z64555/fix/filelength
Adds macro to replace instances of the deprecated filelength with...
2016-08-15 11:12:50 +02:00
MageKing17 43ca34cb4c Merge pull request #821 from SamuelCho/lightshafts_reorder
Reorder lightshafts in the post process pipeline.
2016-08-14 20:16:50 -07:00
SamuelCho 60bee02f92 Reorder lightshafts in the post process pipeline. Fixes the glare effect from being too bright. 2016-08-14 19:09:29 -07:00
z64555 2b4117256a Adds macro to replace instances of the deprecated filelength with _filelength if using MSVC. 2016-08-14 20:11:40 -05:00
z64555 9474f58820 Setup OS and FSO backend initialization.
* Currently only works on Windows due to the OpenGL loader (wxFredRender) being rather basic.
2016-08-14 19:36:16 -05:00
Fabian Woltermann d5ac9a33c1 Merge pull request #815 from asarium/feature/flagsetInitializer
Add initializer_list support for flagset
2016-08-14 17:07:33 +02:00
asarium d1baf8edca Add initializer_list support for flagset
This allows to initialize a flagset instance from a {...} expression
without having to create an intermediary instance.
2016-08-14 16:39:29 +02:00
m!m af9cc94470 Merge pull request #807 from The-E/ship_subsys_flags
Changes the subsystem flags to the new flag system.
2016-08-14 16:24:28 +02:00
z64555 6f7039ed01 Merge pull request #809 from asarium/fix/joystickGUIDs
Fix wrong joystick event assignment
2016-08-14 02:11:58 -05:00
z64555 006853ae44 Forgot to set canvas target in context creation. 2016-08-13 20:33:50 -05:00
z64555 22f56a12d9 * Implements wxFredRender's render_init() and render_frame() functions.
* Implements glcViewport's construction
2016-08-13 20:09:52 -05:00
Fabian Woltermann 8a85b5abe8 Merge pull request #811 from Echelon9/fix/legacy-mode-warning-wrapping
Improve legacy mode warning console message
2016-08-14 00:48:00 +02:00
Echelon9 69a88cf58f Improve legacy mode warning console message
Without the new line, this important warning line can get lost within
the console messages e.g. on Linux.
2016-08-13 17:44:03 -04:00
asarium a4d70c78cb Fix wrong joystick event assignment
Kobrar reported that joystick events were not properly assigned to the
right Joystick instances because the GUIDs of the joysticks was the same
(that's another problem since the code assumes that they actually are
Globally Unique like the name says).

The fix was to simply use the instance ID for checking if two sticks are
the same which seems to work more reliably.
2016-08-13 23:14:47 +02:00
m!m ecc878586c Merge pull request #808 from The-E/flagset_emergency_fix
Bugfix for flagsets
2016-08-13 21:54:15 +02:00
Fabian Woltermann d7e6e5e152 Fixes an issue in flagsets where the sanity check for flagset::set was inverted. 2016-08-13 18:26:17 +02:00
Fabian Woltermann b352a4c13a Merge pull request #770 from asarium/cmake_/ninjaColor
Enable color diagnostics for Ninja generator
2016-08-13 15:17:42 +02:00
Fabian Woltermann dc11b13edd Merge pull request #783 from MageKing17/feature/more-target-flags
Greatly expand available flags for creating target priority groups.
2016-08-13 15:17:15 +02:00
Fabian Woltermann e1ba2256ed Changes the subsystem flags to the new flag system. 2016-08-13 13:52:51 +02:00
Fabian Woltermann 0117ba446c Merge pull request #794 from z64555/fix/joystick_hats1
More compatibility code for joystick hats.
2016-08-13 11:50:24 +02:00
Fabian Woltermann 71acc296f0 Merge pull request #804 from z64555/feature/freelook
Feature/freelook
2016-08-13 11:50:06 +02:00
z64555 d24aa9f478 Remove 4-pos hat to 8-pos hat conversion code. Revert this commit if needed in the future! 2016-08-13 01:03:50 -05:00
z64555 431dd7067e More joystick hat compatibility code.
* There's now registers for both 4 position and 8 position hats for both timestamps and downcounts
* There's conversion code to allow an 8-position hat to act like a 4-position hat, which is needed by the FSO codebase which only uses 4-pos hats
* There's also conversion code to allow a 4-pos hat to act like an 8-position hat to some degree.
2016-08-13 01:03:49 -05:00
MageKing17 c17c58265a Merge pull request #805 from Echelon9/feature/readme-badges
Add badges to Readme
2016-08-12 22:17:17 -07:00
Echelon9 229a578b61 Add badges to Readme
Re-add visual badges that provide overview of build and code quality
status via Travis and Coverity.
2016-08-13 00:40:54 -04:00
z64555 994f8f7ec4 Fix bug introduced by freelook code that disabled target padlock view mode. 2016-08-12 21:47:04 -05:00
MageKing17 78de88adcf Greatly expand available flags for creating target priority groups.
Target priorities could previous only select based on very few flags, for the simple reason that very few were defined in the ai_tgt_*_flags[] arrays. This simply adds additional flags (even some that seem a little silly; I can't actually think of a reason to especially target "objects that are being rendered", but hey, maybe somebody will find a use for it in the future).
2016-08-12 19:24:07 -07:00
Fabian Woltermann 770fce8de5 Bitset flags -- take 2 (#775)
This introduces a new mechanism for handling bit flags. Instead of using an int (or two, or three) to write bits into, this uses the std::bitset in a wrapper class that accepts an enum class as input. This means that certain classes of errors we've had a few of in the engine, where a coder used the wrong set of flags or checked them against the wrong variable (SF_STEALTH vs SIF_STEALTH, for example) can now be detected at a compiler level rather than not at all.
2016-08-12 16:13:50 -07:00
z64555 b60f8742e2 Re-Re-enables the freelook mode. Somehow got lost during the Antipodes merge. 2016-08-12 18:09:24 -05:00
Fabian Woltermann 1ea71d2ba6 Merge pull request #803 from asarium/fix/fredFastDebug
Fix FRED configuration
2016-08-12 21:15:13 +02:00
asarium e8d74a833b Fix FRED configuration 2016-08-12 20:28:29 +02:00
Fabian Woltermann 97153b80a1 Merge pull request #801 from asarium/warnings/more64bit
And another batch of 64-bit fixes
2016-08-12 14:55:06 +02:00
asarium a685642554 And another batch of 64-bit fixes 2016-08-12 09:42:55 +02:00
MageKing17 96c7ea9247 Merge pull request #798 from asarium/cleanup/windebug
Remove unused code in windebug.cpp
2016-08-11 18:40:19 -07:00
MageKing17 a1c82455e4 Merge pull request #797 from asarium/warnings/evenmore64bit
Another batch of 64-bit warning fixes.
2016-08-11 18:40:09 -07:00
z64555 80f6f31f15 Merge pull request #799 from The-E/math_include_cleanup
A bit of include cleanup
2016-08-11 20:39:04 -05:00
z64555 682b279553 Merge pull request #800 from The-E/only_old_stars
Dead code cleanup in starfield.cpp
2016-08-11 20:39:01 -05:00
Fabian Woltermann 2d85ced533 Merge pull request #788 from asarium/build/sdlmain
Use the provided sdlmain library again
2016-08-11 23:04:00 +02:00
Fabian Woltermann ab315f2064 Merge pull request #792 from asarium/cleanup/disableFredDeprecation
Disable MBCS deprecation warnings in FRED
2016-08-11 23:03:40 +02:00
Fabian Woltermann b5e837a040 Merge pull request #796 from asarium/fix/memoryStats
Fix Windows memory statistics
2016-08-11 23:03:26 +02:00
Fabian Woltermann 444a9ba614 Merge pull request #789 from asarium/cmake_/msvcWarningSpecifications
Clean up CMake MSVC warning handling
2016-08-11 23:02:52 +02:00
Fabian Woltermann e103bcdf69 Removes a bit of dead code that we probably aren't going to develop any further. 2016-08-11 23:01:28 +02:00
Fabian Woltermann 44c64d79f1 Removes old int type includes we carried around from when we supported old compilers 2016-08-11 22:57:49 +02:00
asarium c40ede030a Another batch of 64-bit warning fixes. 2016-08-11 22:19:50 +02:00
asarium 76c220251b Remove unused code in windebug.cpp 2016-08-11 22:10:43 +02:00
MageKing17 affecc9285 Merge pull request #791 from asarium/warnings/more64bit
Fix even more 64-bit warnings
2016-08-11 12:54:51 -07:00
asarium c6a74c2f04 Fix Windows memory statistics 2016-08-11 21:48:11 +02:00
asarium 9a46e9b55e Fix negative shift warning
This converts the fix conversion macros to constexpr functions which
should have the same runtime effects with the added type safety.
2016-08-11 10:42:40 +02:00
asarium 6c3da4b455 Fix even more 64-bit warnings 2016-08-11 10:08:11 +02:00
z64555 83724c0d8a Merge pull request #793 from MageKing17/bugfix/invalid-joystick-buttons
Fix a couple button-related joystick issues.
2016-08-10 23:24:39 -05:00
MageKing17 9f12e1f749 Fix hat position comparison in joy_down()
getHatPosition() returns a value from the HatPosition enum, so the conversion to a 0-based index is incorrect (and causes the hat switch to basically not work with continuous controls).
2016-08-10 20:42:00 -07:00
MageKing17 7906f0b9b3 Fix allowing invalid joystick buttons through to the joystick API.
When the hat switch code was fixed to restrict joysticks to 32 buttons again, it forgot to invalidate buttons between numButtons() and 32. This could lead to some assertions being failed when the joystick got asked for the status of a nonexistent button.
2016-08-10 18:55:57 -07:00
z64555 20990416a9 Implement wxFredRender components. 2016-08-10 17:56:51 -05:00
asarium d7707053c3 Disable MBCS deprecation warnings in FRED 2016-08-10 23:44:20 +02:00
z64555 627ef75af0 Fix (undocumented) issue with hat presses not registering. (#777)
* Fix (undocumented) issue with hat presses not registering.

* Use array instead of a vector for _hat::DownCount

* No, no die-nam-ick numbor of boot-ons to-day. Und no, ve only haff vone hat. Sad Heavy is Sad.

* Fixes an out-of-bounds error caused by incorrect indexing in Joystick::handleHatEvent.
Also fixes a bug where the hatGetDownTime would return a nonzero value if the hat was active but in a different position than the input parameter.
2016-08-10 23:31:09 +02:00
MageKing17 9cef8ed64b Merge pull request #782 from asarium/fix/luaFixes
Fix a few lua related issues
2016-08-10 12:19:35 -07:00
MageKing17 8f32c6100e Merge pull request #786 from asarium/fix/grbatch
Fix wrong return type in grbatch
2016-08-10 11:26:27 -07:00
asarium 2b52c7888e Remove _cdecl usages 2016-08-10 18:03:29 +02:00
asarium 74b0702577 Specify ignored warnings in CMake toolchain file
This means that it's no longer necessary to include pstypes.h just for
ignoring the standard warnings.
2016-08-10 17:24:04 +02:00
asarium b26a70d96a Use the provided sdlmain library again 2016-08-10 16:45:04 +02:00
asarium 5b28824f62 Fix wrong return type in grbatch 2016-08-10 15:18:55 +02:00
Fabian Woltermann 9953fd924e Merge pull request #779 from asarium/warnings/more64bit
More 64-bit MSVC warning fixes
2016-08-10 14:32:21 +02:00
Fabian Woltermann 14f80e6a07 Merge pull request #784 from asarium/fix/fontHeightHack
Improve font top and bottom offset handling
2016-08-10 14:30:50 +02:00
Fabian Woltermann e805cc15fc Merge pull request #785 from asarium/fix/modelrenderVars
Fix uninitialized values in modelrender
2016-08-10 14:30:22 +02:00
asarium 0cabe71fdd More 64-bit MSVC warning fixes 2016-08-10 13:33:12 +02:00
asarium f5c0234d3b Fix uninitialized values in modelrender 2016-08-10 13:28:36 +02:00
asarium 19de867f31 Improve font top and bottom offset handling 2016-08-10 12:59:19 +02:00
niffiwan c3b4380351 Merge pull request #781 from asarium/fix/mainhallDistance
Fix wrong parameter order
2016-08-10 09:50:29 +10:00
asarium 72a956e0ed Fix wrong handle pointer validation 2016-08-10 00:06:33 +02:00
asarium 5e12ec392c Fix wrong parameter order 2016-08-10 00:03:17 +02:00
asarium 188bf2bb1e Fix wrong initial value 2016-08-09 23:55:38 +02:00
MageKing17 5f38b7fbce Merge pull request #780 from asarium/fix/shaderCrash
Fix Assert caused by invalid comparision
2016-08-09 13:58:29 -07:00
asarium b982c04a00 Fix Assert caused by invalid comparision 2016-08-09 22:24:00 +02:00
m!m 079c6ae86e Fix FRED executable version information (#778) 2016-08-09 11:15:46 -07:00
m!m 22c0255277 Fix a bunch of 64-bit MSVC warnings (#709)
* Fix a bunch of 64-bit warnings

* Fix Linux compilation error

* Fix Mac error

* Fix some issues

* Fix more GCC warnings

* Remote unwanted change

* Remove accidentally readded file

* Fix wrong limit check

* Use BEAM_INDEX macro for getting beam object index

* Fix 32-bit warning

* Use BEAM_INDEX instead of pointer arithmetic
2016-08-09 11:08:54 -07:00
asarium 526962fb60 Fix Clang warning 2016-08-09 10:44:27 +02:00
Fabian Woltermann 7265711551 Merge pull request #776 from scp-fs2open/revert-720-cleanup/update-sdl2-to-custom-libsdl
Revert "Update included SDL2.dll files to ones compiled from our custom libsdl."
2016-08-09 09:01:54 +02:00
Fabian Woltermann 5ffc569eed Merge pull request #759 from asarium/fix/hudParseErrors
Detect HUD gauges parse error and print a warning
2016-08-09 08:30:34 +02:00
Fabian Woltermann 6703007ee2 Merge pull request #761 from MageKing17/feature/allow-ai-slowdown
Add an AI flag to enable old, unused behavior when attacking big ships.
2016-08-09 08:29:58 +02:00
MageKing17 cdef2ee86a Revert "Update included SDL2.dll files to ones compiled from our custom libsdl." 2016-08-08 21:10:04 -07:00
MageKing17 552a575232 Merge pull request #773 from asarium/fix/772
Fix logic error in controlsconfig.cpp
2016-08-08 12:27:56 -07:00
asarium bfdcad1848 Fix logic error in controlsconfig.cpp
This fixes #772.
2016-08-08 19:54:12 +02:00
MageKing17 76b7c0a3d2 Merge pull request #771 from asarium/feature/noninteractive
Add noninteractive mode
2016-08-08 08:39:13 -07:00
asarium 8dbfb3a334 Fix CI failure with outdated GCC version 2016-08-08 16:49:22 +02:00
asarium 84973dd56f Use CMake variable for determining library with dlsym 2016-08-08 16:47:29 +02:00
asarium 1086e330fb Fix warnings by updating external includes 2016-08-08 16:22:39 +02:00
asarium 775d404bf1 Enable color diagnostics for Ninja generator
Also improves flags handling a bit. Previously only the C++ flags were
set, now the C flags are set as well.
2016-08-08 15:59:33 +02:00
asarium ab6c3f4ac8 Add noninteractive mode
If the -noninteractive command line option is set then dialogs won't be
shown and the default action is taken. This should be useful for
the standalone server.
2016-08-08 15:46:08 +02:00
Fabian Woltermann 302b0297b5 Merge pull request #767 from asarium/fix/64-bitFRED
Fix 64-bit compilation of FRED
2016-08-08 13:21:37 +02:00
z64555 92fc16372f Create wxFredRender files, this'll be for the graphics of wxFred and used by the glcViewport class(es). 2016-08-08 05:50:41 -05:00
z64555 cd25f907ac Merge pull request #2 from asarium/wxfred2_dev
Fix MSVC compilation issues
2016-08-08 04:33:11 -05:00
asarium c2363989e4 Fix MSVC compilation issues 2016-08-08 11:27:45 +02:00
z64555 7b13d5c1f2 Merge pull request #1 from asarium/wxfred2_dev
Fix wxFRED CMake and compliation errors
2016-08-08 04:18:56 -05:00
asarium 25f6be7867 Use the version string in the project headers 2016-08-08 11:17:05 +02:00
asarium 9756b52845 Fix wxFRED CMake and compliation errors 2016-08-08 11:17:05 +02:00
z64555 93101aa8ce Remove glrcMissionFrame. 2016-08-08 04:07:48 -05:00
z64555 10a37e6ddb Add link targets to core codebase. 2016-08-08 02:46:08 -05:00
z64555 469a31602e Fix access violation. Can't append items to wxChoice elements for the moment. 2016-08-07 23:15:43 -05:00
z64555 3521740a60 Update XRC and generated files to use wxWidgets 3.0.2 (or later. wxFormBuilder doesn't say which version it uses) 2016-08-07 23:15:42 -05:00
z64555 beaee70a82 Fix building after rebase with master. 2016-08-07 23:15:42 -05:00
z64555 eb3b65e051 Implement Copy functions, settle on using OIN_t's for object selection queues. 2016-08-07 23:15:41 -05:00
z64555 4bb547ce09 (FRED) Fix bug where AIF_NO_DYNAMIC flags weren't set with copied objects 2016-08-07 23:15:40 -05:00
z64555 5294db25b3 Implement port of core mission management functions 2016-08-07 23:15:40 -05:00
z64555 5983ddeea4 Some FRED cleanup and debugging 2016-08-07 23:15:39 -05:00
z64555 37d16a65c4 Updating README with info on wxWidget's Release packages. 2016-08-07 23:15:39 -05:00
z64555 8c54c63908 Update the README a bit. 2016-08-07 23:15:38 -05:00
z64555 ae7bf0667e Fix linking due to an unknown, removed, or renamed ailocal.h 2016-08-07 23:15:38 -05:00
z64555 c018329a4c Adds new define to disable FSO's mem* function overrides 2016-08-07 23:15:38 -05:00
z64555 f188960f91 Fixes compiling by de-tangling a #include chain that was exposed by commit 798a8922879f7af8ebd2bb07a6cdaa655a2e038b 2016-08-07 23:15:37 -05:00
niffiwan 7255d5e8e4 Update Linux to link successfully with libcode.a 2016-08-07 23:15:36 -05:00
z64555 198c6cace9 End of linkage work. (This commit is probably temporary)
* Includes wxfredstubs.cpp to prevent linkage to certain data members and functions defined in freespace.cpp.
 * "_SECURE_SCL" and "_HAS_ITERATOR_DEBUGGING" defines removed from the project files
 * C runtime library (CRT) switched to use DLL so as to integrate with wxWidgets default settings.
2016-08-07 23:15:34 -05:00
z64555 5efe85b4db Beginning setup to link into code.lib, defined some variables needed for linkage and link tests. 2016-08-07 23:15:01 -05:00
z64555 fb8fe9bb75 Started work on docFRED2, and mission load/save methods. More work done on glcViewport. 2016-08-07 23:14:59 -05:00
z64555 790f8b9d8c Some header name wrangling, a Big O snuck in somehow. 2016-08-07 23:14:03 -05:00
z64555 0bcc9f27d4 glcViewport and glrcMissionFrame classes added. README updated. 2016-08-07 23:13:59 -05:00
MageKing17 4b900bb84c Merge pull request #764 from asarium/wxFRED/graphicsInterface
Add interface for creating an OpenGL context
2016-08-07 15:42:30 -07:00
MageKing17 820d4b88be Merge pull request #769 from asarium/fix/768
Fix for #768
2016-08-07 15:38:24 -07:00
asarium 5ba393ce5d Fix for #768
Apparently MSVC 2013 allocates memory when locking a mutex which calls
our allocation hook when the tries to call our memory tracking function
which leads to a deadlock. Since there is no way of providing a memory
allocation function for std::mutex the best solution is to simply
disable the lock_guard for everything before MSVC 2015. That will
probably corrupt the memory tracking values at some point but it's
better than not being able to run FSO at all.
2016-08-07 23:45:38 +02:00
MageKing17 c76c1cb4ff Add an AI flag to enable old, unused behavior when attacking big ships.
Coverity defects 1320483, 1320484, 1320485, and 1320486 noted that several values were being set and then immediately overwritten before they could do anything. These appear to be related to behavior that Volition disabled before release that would allow the AI to slow down while attacking capital ships. It seemed a shame to waste this code, so I've added a flag to enable the behavior.
2016-08-07 14:27:59 -07:00
asarium 1fb0a57fd8 Fix 64-bit compilation of FRED 2016-08-07 23:00:17 +02:00
Fabian Woltermann 8543e99352 Merge pull request #755 from asarium/fix/gladVersion
Use the OpenGL version provided by GLAD
2016-08-07 22:28:09 +02:00
Fabian Woltermann 17e5918eeb Merge pull request #756 from asarium/cleanup/gladLoader
Improve GLAD config a bit
2016-08-07 22:27:53 +02:00
Fabian Woltermann d0ea08ed6c Merge pull request #766 from asarium/fix/linewidth
Fix for #765
2016-08-07 22:27:17 +02:00
asarium 0bf5ba092b Add interface for creating an OpenGL context
This allows to use a different method of creating and managing the
OpenGL context. This is needed of wxFRED where the OpenGL context is
created by wxWidgets. This will probably also fix #753 since it uses the
old wgl based method of creating an OpenGL context in FRED.
2016-08-07 21:38:36 +02:00
MageKing17 195b0b1d53 Merge pull request #763 from The-E/radarsetup_flag_fix
SIF_STEALTH and SF2_STEALTH are different things, I'm afraid
2016-08-07 11:41:22 -07:00
asarium 4f5ae67020 Fix for #765
glLineWidth is no longer an effective way of setting the line width of
2D operations.
2016-08-07 19:49:48 +02:00
Fabian Woltermann 580892243f SIF_STEALTH and SF2_STEALTH are different things, I'm afraid 2016-08-07 16:46:14 +02:00
niffiwan 9b537434fc Merge pull request #760 from MageKing17/coverity/1360950
Make sure va_end() gets called in ade_get_args() (fix Coverity 1360950)
2016-08-07 10:46:34 +10:00
MageKing17 5cdcd2beac Make sure va_end() gets called in ade_get_args() (fix Coverity 1360950)
If a required argument is invalid, ade_get_args() returns 0, but it wasn't making sure va_end(vl) got called first, leading to potential memory corruption (probably not a huge issue in actual usage because most people try not to release scripts that throw errors).
2016-08-06 12:57:03 -07:00
asarium 7baefbcd45 Detect HUD gauges parse error and print a warning
Previously the code simply skipped the invalid tokens and silently
ignored them. This is frustrating for modders and also let #758 slip
into the code base which would not have happened otherwise.
2016-08-06 21:40:52 +02:00
MageKing17 02aad7e5a7 Merge pull request #758 from asarium/fix/hudparse
Fix parsing code error introduced by TTF merge
2016-08-06 11:56:03 -07:00
asarium 0d165f159e Fix parsing code error introduced by TTF merge 2016-08-06 19:15:47 +02:00
asarium e6f00e37ae Improve GLAD config a bit
This removes the built-in OpenGL function pointer because we don't need
it since we are using the SDL function for that. Also explicitly uses a
compatibility loader although that has no effect on the generated code.
2016-08-06 15:24:19 +02:00
asarium 877fae7d5f Use the OpenGL version provided by GLAD 2016-08-06 15:15:23 +02:00
MageKing17 82ac53a693 Merge pull request #750 from PhantomHoover/master
Fixed actual_main to correctly return 0 on success and made
2016-08-06 00:04:54 -07:00
MageKing17 a4c6437104 Merge pull request #749 from The-E/parse_object_flag_fix
Fixes a mismatched flag type error in multiteamselect.
2016-08-06 00:04:31 -07:00
MageKing17 858df67078 Merge pull request #754 from niffiwan/fix/coverity_and_travis
Fix coverity scan triggered from travis
2016-08-06 00:04:09 -07:00
niffiwan 41b0b53b85 Fix coverity scan triggered from travis
Update modeling file to deal with SDL2.0 changes
2016-08-06 16:42:56 +10:00
Fabian Woltermann d60b756b4b Merge pull request #748 from asarium/fix/cfileArchiver
Fix compilation of cfile(archiver|extractor)
2016-08-06 08:29:13 +02:00
MageKing17 9ee98d45a2 Merge pull request #752 from asarium/fix/multiSort
Fix sorting function multi_create_sort_func
2016-08-05 15:13:41 -07:00
Fabian Woltermann fb9f3bc322 Merge pull request #751 from asarium/fix/fredOpenGL
Make sure that SDL OpenGL is initialized
2016-08-05 23:40:54 +02:00
asarium 81e3cf6fac Fix sorting function multi_create_sort_func
The function returned the wrong value for same string which caused the
MSVC debug runtime to throw an error. This fixes that.
2016-08-05 23:38:17 +02:00
asarium 0473ead31f Make sure that SDL OpenGL is initialized
The documentation says that the SDL OpenGL attributes need to be
initialized before a window is created. These changes implement that by
moving the actual SD_Window creation inside the OpenGL setup. FRED only
sets the native window handle to the correct HWND and gropengl uses
that.
2016-08-05 21:51:29 +02:00
Phantom Hoover 9ef81071fe doxygenate game_main() 2016-08-05 19:57:51 +01:00
Phantom Hoover 7b094e6966 good point mageking 2016-08-05 19:46:36 +01:00
Fabian Woltermann 88df37c6d6 Merge pull request #747 from asarium/coverity/1360947
Fix for Coverity 1360947
2016-08-05 19:19:24 +02:00
Phantom Hoover ef147c7284 Fixed actual_main to correctly return 0 on success and made
-shadow_quality imply -enable_shadows.
2016-08-05 18:10:16 +01:00
Fabian Woltermann e470d2959e Fixes a mismatched flag type error in multiteamselect. 2016-08-05 19:08:31 +02:00
asarium bc304bddfc Fix compilation of cfile(archiver|extractor) 2016-08-05 18:40:52 +02:00
Fabian Woltermann 0a0a1db421 Merge pull request #742 from asarium/fix/beamPiercingEffect
Fix variable for piercing beam particle effect
2016-08-05 18:32:48 +02:00
Fabian Woltermann dffb0c7c1d Merge pull request #746 from asarium/coverity/1320536
Fix wrong argument order in multiple functions
2016-08-05 18:32:30 +02:00
Fabian Woltermann 6dacfd8ffb Merge pull request #745 from asarium/coverity/1093292
Fix for Coverity 1093292
2016-08-05 18:32:16 +02:00
Fabian Woltermann ab17ccd424 Merge pull request #743 from asarium/fix/fredSDLMain
Call SDL_SetMainReady() in fred_init
2016-08-05 18:31:56 +02:00
asarium b408ca72f3 Fix for Coverity 1360947 2016-08-05 18:25:59 +02:00
asarium 7435d7a703 Fix for Coverity 1320538 2016-08-05 17:53:47 +02:00
asarium fa60c666bc Fix for Coverity 1320537 2016-08-05 17:50:49 +02:00
asarium 04d494e1a4 Fix for Coverity 1320536
Apparently someone mixed up left and right...
2016-08-05 17:49:01 +02:00
asarium 7e3b30f5bf Fix for Coverity 1093296 2016-08-05 17:38:57 +02:00
asarium e4783b3d34 Fix for Coverity 1093295 2016-08-05 17:37:52 +02:00
asarium 8ee84a05c0 Fix for Coverity 1093294 2016-08-05 17:35:35 +02:00
asarium 6899b1680d Fix for Coverity 1093293 2016-08-05 17:33:16 +02:00
asarium 1cfbc8859e Fix for Coverity 1093292
"Unchecked return value from library". The function can't return an
error value so I added a ml_printf (which is used at another place for
error logging as well) to log the error.
2016-08-05 17:28:44 +02:00
asarium 9a10a78ed3 Fix variable for piercing beam particle effect 2016-08-05 10:54:00 +02:00
Fabian Woltermann bd7a691b8e Merge pull request #722 from z64555/cleanup/fred
Cleanup/fred
2016-08-05 10:30:47 +02:00
asarium 6e9ce021cc Call SDL_SetMainReady() in fred_init 2016-08-05 09:58:30 +02:00
z64555 17a6896e1d Merge branch 'master' into cleanup/fred
Conflicts:
	fred2/fred.cpp
	fred2/fredrender.cpp
2016-08-04 19:18:16 -05:00
z64555 d46b17606d Fix linking with the Freespace project 2016-08-04 13:54:38 -05:00
Fabian Woltermann a570eca073 Merge pull request #739 from asarium/cmakeMerge/particlesystems
Add a new particle effect system
2016-08-04 12:46:33 +02:00
Fabian Woltermann c7f3097f7d Merge pull request #731 from asarium/fix/standaloneAssert
Fix Assertion when running in standalone mode
2016-08-04 11:28:30 +02:00
Fabian Woltermann e8954c4297 Merge pull request #733 from asarium/fix/openglVersion
Actually enforce the OpenGL 2.0 requirement
2016-08-04 11:28:07 +02:00
asarium bbeaaa1565 Add a new particle effect system
This is similar to the script I wrote a few years ago but unlike that
one, this solution doesn't kill the performance.
2016-08-04 11:08:39 +02:00
m!m 91b1d294ec Merge pull request #738 from MageKing17/coverity/1360951
Remove duplicate fclose() call (fix Coverity defect 1360951)
2016-08-03 23:26:32 +02:00
Fabian Woltermann eb164b3ff8 Merge pull request #737 from X3N0-Life-Form/lua_iff
Expose IFF to lua
2016-08-03 22:36:55 +02:00
MageKing17 4b634327e1 Remove duplicate fclose() call (fix Coverity defect 1360951)
It looks like this was added to trunk (a0f31e6), synced with antipodes (4952b70), and then one of the antipodes merges (7e77b5a) wound up combining both additions.
2016-08-03 13:28:29 -07:00
X3N0-Life-Form 625ea48d9e Expose IFF to lua
Adds the 'attacks' function to the 'team' lua type, which exposes the iff_x_attacks_y function to the lua engine.
2016-08-03 21:27:19 +02:00
Fabian Woltermann 0afe5ba8bd Merge pull request #730 from asarium/feature/openGLDebug
Use an OpenGL debug context and debug extensions
2016-08-03 11:47:49 +02:00
Fabian Woltermann 1783df6b5f Merge pull request #728 from asarium/fix/reallocCrash
Fix segfault when calling realloc
2016-08-03 11:47:30 +02:00
Fabian Woltermann 34d88d9d99 Merge pull request #735 from asarium/fix/axemFonts
Fix some font scripting bugs reported by Axem
2016-08-03 11:44:55 +02:00
Fabian Woltermann 8a9c9fb999 Merge pull request #734 from asarium/fix/luaConst
Fix const correctness in lua.cpp/.h
2016-08-03 11:28:27 +02:00
asarium 5d14899808 Fix const correctness in lua.cpp/.h 2016-08-03 10:53:23 +02:00
asarium acab2d2c46 Fix campaign list spacing 2016-08-03 10:41:09 +02:00
asarium 63f7f04502 Add error message for wrong font index 2016-08-03 10:27:22 +02:00
asarium 026564b973 Actually enforce the OpenGL 2.0 requirement 2016-08-03 09:53:51 +02:00
z64555 33ae17f00b Merge pull request #671 from asarium/feature/joystickAPI
Add improved joystick API
2016-08-03 02:21:43 -05:00
Fabian Woltermann d9a45d8dc0 Merge pull request #729 from asarium/fix/luaFontIndex
Fix off-by-one error in Lua font API
2016-08-02 23:27:38 +02:00
asarium 1679d81efa Fix Assertion when running in standalone mode
The Assertion which was triggered was carried over from the OpenGL code
but the stub code was using pretty much the same code so removing the
Assertion seems like the correct way to solve this.
2016-08-02 23:04:35 +02:00
asarium 0b5aed3e11 Use an OpenGL debug context and debug extensions
This instructs SDL to create an OpenGL debug context when a debug build
is used. Additionally it uses GL_ARB_debug_output if it's available to
provide OpenGL debug output.
2016-08-02 20:24:50 +02:00
asarium f91c681ee1 Add improved joystick API
This API allows to handle events from multiple joysticks but currently
only the events from the configured joystick are used.
2016-08-02 20:08:21 +02:00
asarium 3a63dc3800 Fix segfault when calling realloc 2016-08-02 20:00:35 +02:00
asarium 2e90049eba Fix off-by-one error in Lua font API 2016-08-02 19:39:13 +02:00
Cliff Gordon b92be0b5da Merge pull request #727 from asarium/fix/freebsd
LGTM, shouldn't even affect any other build platforms.
2016-08-02 12:38:05 -05:00
Cliff Gordon dae5c58b98 Merge pull request #723 from asarium/fix/configCase
Well, running dos2unix on it didn't create any local changes, so it looks to be entirely unix line endings now, as it should be.  LGTM.
2016-08-02 12:28:00 -05:00
asarium 1f4e40757d Fix build on FreeBSD 2016-08-02 19:10:51 +02:00
Fabian Woltermann dfc10ad8db Merge pull request #725 from asarium/fix/fontOptions
Fix code that was overwritten by TTF merge
2016-08-02 14:54:58 +02:00
asarium bb503de698 Fix code that was overwritten by TTF merge 2016-08-02 12:34:55 +02:00
Fabian Woltermann f3f4560824 Merge pull request #724 from asarium/cleanup/directx
Remove last remains of DirectX
2016-08-02 12:18:14 +02:00
Fabian Woltermann 9bfc0be819 Merge pull request #696 from asarium/cmakeMerge/memory
Add new memory tracking subsystem
2016-08-02 12:17:56 +02:00
Fabian Woltermann 36f08ca62b Merge pull request #715 from asarium/fix/fredCwd
Use the current working directory for FRED
2016-08-02 12:16:45 +02:00
Fabian Woltermann b4db345e5e Merge pull request #692 from asarium/test/ttf-3
TrueType support
2016-08-02 12:16:23 +02:00
Fabian Woltermann 2cfd82b182 Merge pull request #720 from MageKing17/cleanup/update-sdl2-to-custom-libsdl
Update included SDL2.dll files to ones compiled from our custom libsdl.
2016-08-02 12:15:51 +02:00
z64555 0c90a75900 Cleanup missionsave.h and .cpp 2016-08-02 04:24:18 -05:00
z64555 060c090827 Doxy and organize wing.h and .cpp. Probably needs a bit more cleanup. 2016-08-02 04:23:04 -05:00
z64555 a57483ffad Cleanup of mainfrm.h and .cpp 2016-08-02 04:23:02 -05:00
z64555 581e6320e1 Cleanup grid.h and .cpp 2016-08-02 04:21:56 -05:00
z64555 35dc235599 Cleanup of fredrender.h and .cpp. 2016-08-02 04:21:54 -05:00
z64555 fddbbf47bd Remove unused Preferences dialog and related variables. 2016-08-02 04:21:52 -05:00
z64555 1c4eb25e84 Cleanup freddoc.h and .cpp 2016-08-02 04:21:24 -05:00
z64555 ed3c9f1621 Cleanup of fred.h and fred.cpp 2016-08-02 04:21:22 -05:00
z64555 f836d5e002 Some header wrangling 2016-08-02 04:21:20 -05:00
z64555 2829eb5e35 Remove editor.h 2016-08-02 04:21:18 -05:00
z64555 c062a071fb Cleanup and doxy a few dialogs 2016-08-02 04:19:39 -05:00
asarium a4302fde2f Remove last remains of DirectX 2016-08-02 11:10:24 +02:00
asarium 16be3b7cc5 Add support for TrueType fonts
This allows to use standard TrueType Fonts for text rendering in FSO. It uses the NanoVG library which provides the ability of drawing 2D shapes. This library is used for most 2D operations now and can also be used directly by using the PathRenderer class.
2016-08-02 10:57:28 +02:00
asarium 9630b595e0 Make config key check case-insensitive
Fix for #719.
2016-08-02 10:39:04 +02:00
MageKing17 0d8e09f136 Merge pull request #716 from asarium/fix/fredErrorPrinting
Clean up FRED init a bit
2016-08-02 01:32:51 -07:00
m!m 44c7155f34 Merge pull request #718 from chief1983/speech_debugging
Speech Debugging
2016-08-02 10:31:00 +02:00
m!m 6a12b90df5 Merge pull request #721 from MageKing17/cleanup/remove-old-def_files
Remove old def_files.cpp file and clean up some redundant imports.
2016-08-02 10:29:16 +02:00
Cliff 8f58fa88c1 Add some debugging to the speech code for troubleshooting future issues, under the Speech filter. 2016-08-01 22:12:45 -05:00
MageKing17 dd4af145bf Remove old def_files.cpp file and clean up some redundant imports.
The CMake merge changed the default files system to include individual files instead of use a bunch of hardcoded strings, but the old file got left behind for some reason. Also, the same merge added some spurious extra imports of def_files.h which I removed at the same time (although if somebody wanted to go through and clean up all of our imports again, it'd probably be a good time for it).
2016-08-01 14:20:24 -07:00
MageKing17 253987dfb3 Update included SDL2.dll files to ones compiled from our custom libsdl. 2016-08-01 14:11:20 -07:00
SamuelCho 9a91e6041c Merge pull request #714 from The-E/fxaa-fix2
Moves the FXAA pass to after the tonemapping step
2016-08-01 10:23:01 -07:00
asarium 18154bfa60 Clean up FRED init a bit
Maybe this will help tracking down that FRED OpenGL issue
2016-08-01 19:10:51 +02:00
asarium 28f9fafa84 Use the current working directory for FRED
This allows to run the executable in a different directory. This is very
useful for debugging from within Visual Studio.
2016-08-01 18:38:21 +02:00
Fabian Woltermann e3d4cc1bc7 _actually_ move the fxaa pass 2016-08-01 11:54:00 +02:00
Fabian Woltermann 2b333fc299 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into fxaa-fix2
Conflicts:
	code/graphics/gropenglpostprocessing.cpp
2016-08-01 11:48:58 +02:00
Fabian Woltermann 97c7ad43ce Moves the FXAA pass to after the tonemapping step, as recommended in the FXAA documentation 2016-08-01 11:46:45 +02:00
Fabian Woltermann 6a76b99083 Merge pull request #713 from SamuelCho/fxaa_fix
Make sure we can write to the alpha channel before doing the FXAA luminance prepass
2016-08-01 11:43:55 +02:00
SamuelCho c049c64c00 Make sure we can write to the alpha channel before doing the FXAA luminance prepass. 2016-07-31 21:04:04 -07:00
MageKing17 feb49eae9f Merge pull request #710 from asarium/fix/nestedModFolder
Fix directory creation for nested mod folders.
2016-07-30 16:05:48 -07:00
asarium 7cf42b6811 Fix directory creation for nested mod folders.
The launcher passes the mod folders as relative paths using / as the
directory separator. That path is copied into the cf_root path and when
cf_create_directory tries to create the directory, mkdir_recursive can't
handle the / in the path and tries to create two path elements at once
which is not supported by mkdir.

These changes fix that by converting mod paths to the native format
(from the / format, so it's a No-op on Unix) before using it in
cf_create_root().
2016-07-30 21:53:15 +02:00
Fabian Woltermann 42a217d48a Merge pull request #706 from asarium/cmake_/gcc-leak-check
Add option for -fsanitize=leak on GCC
2016-07-30 08:41:54 +02:00
MageKing17 24ccb7c8ff Merge pull request #707 from asarium/fix/memleak_modelinterp
Fix memory leak in modelinterp.cpp
2016-07-29 10:40:51 -07:00
m!m e3e0eae93e Merge pull request #702 from The-E/fb_thruster_adjustments
Adds a commandline switch analoguous to framebuffer shockwaves to enable the distortion effect for thrusters
2016-07-29 14:39:32 +02:00
asarium d0bfc47e59 Fix memory leak in modelinterp.cpp
bsp_info.outline_buffer was allocated but not freed when unloading the
model.
2016-07-29 12:30:21 +02:00
asarium 31712e0c48 Add option for -fsanitize=leak on GCC 2016-07-29 12:00:33 +02:00
asarium 7b352e511c Add new memory tracking subsystem
This expands the existing system which only worked on Windows to all
supported platforms.

If the MSVC debug runtime is not present then its behavior is emulated
by adding a header to each allocated memory block.
2016-07-29 11:02:45 +02:00
m!m 0819d57fd5 Merge pull request #705 from rtoijala/fix-lua51-search
Add lua51 as a possible pkg-config name
2016-07-29 10:28:00 +02:00
Fabian Woltermann d709ac3732 Merge pull request #697 from asarium/cmake_/platformChecks
Use CMake for determining if a specific header is available
2016-07-29 10:04:29 +02:00
Fabian Woltermann f30e8a3141 Merge pull request #704 from asarium/fix/cmakeConfig
Fix default CMake configuration
2016-07-29 10:04:07 +02:00
Risto Toijala baa2f9f5d7 Add lua51 as a possible pkg-config name
Basically the same as PR #628 but for CMake this time.
2016-07-29 11:00:00 +03:00
asarium 3b4e258f32 Fix default CMake configuration 2016-07-28 23:10:02 +02:00
Fabian Woltermann 624c5842c0 Merge pull request #703 from asarium/fix/submodules
Add CMake error if external modules could not be found
2016-07-28 22:36:28 +02:00
asarium 465d95dd7f Add CMake error if external modules could not be found 2016-07-28 21:16:35 +02:00
MageKing17 850824cd3c Merge pull request #701 from scp-fs2open/lab_weapon_thruster_fix
Fixes issue when rendering thrusters on weapon models
2016-07-28 12:01:51 -07:00
Fabian Woltermann 53222e66e3 Adds a commandline switch analoguous to framebuffer shockwaves to enable the distortion effect for thrusters 2016-07-28 20:22:49 +02:00
Fabian Woltermann 9f0897d916 Fixes issue when rendering thrusters on weapon models 2016-07-28 20:04:40 +02:00
Fabian Woltermann c0e67c44e8 Merge pull request #699 from asarium/ci/vsversionUpdate
Update tested visual studio versions
2016-07-28 11:36:24 +02:00
MageKing17 b40631e268 Merge pull request #698 from asarium/fix/portableMode
Expose portable mode in launcher
2016-07-28 02:17:03 -07:00
asarium 4edd6fd5a9 Update tested visual studio versions 2016-07-28 11:09:39 +02:00
asarium 690d293d9a Expose portable mode in launcher 2016-07-28 10:17:20 +02:00
Fabian Woltermann 4c53d46aec Merge pull request #695 from asarium/cmake_/appimage
Add AppImage support for nightly builds
2016-07-27 23:21:05 +02:00
asarium 06768e72d4 Use Platform checks for determining if a header is available 2016-07-27 22:24:28 +02:00
asarium 5826b880fb Add AppImage support 2016-07-27 20:53:40 +02:00
Fabian Woltermann 6646bf3002 Merge pull request #694 from asarium/fix/nightly
Fix AppVeyor Bintray config
2016-07-27 19:26:56 +02:00
asarium ea77b6fc7e Fix AppVeyor Bintray config 2016-07-27 19:24:35 +02:00
Fabian Woltermann aec35e4aba Merge pull request #693 from asarium/fix/nightly
Fix nightly BinTray user
2016-07-27 18:49:20 +02:00
asarium 676bc68beb Fix nightly BinTray user 2016-07-27 18:47:02 +02:00
Fabian Woltermann fc2a3e2869 Merge pull request #691 from asarium/fix/secureVars
Update secure variables for the main repo
2016-07-27 18:15:49 +02:00
asarium 983f1f386d Update AppVeyor variables 2016-07-27 16:12:09 +02:00
Fabian Woltermann a1582c7619 Merge pull request #690 from asarium/fix/Readme
Update readme
2016-07-27 16:03:28 +02:00
Fabian Woltermann 4a1c7ad37b Merge pull request #689 from asarium/cmake_/binarySourceDir
Don't allow binary and source directory to be the same
2016-07-27 16:03:01 +02:00
asarium b02270a6eb Update secure variables for the main repo 2016-07-27 15:57:36 +02:00
asarium 65bc829ffc Update readme 2016-07-27 15:46:04 +02:00
asarium c51d7e5676 Don't allow binary and source directory to be the same 2016-07-27 15:43:51 +02:00
Fabian Woltermann a3c674b1f1 Merge pull request #680 from asarium/cmake_/pr
Move build system to CMake
2016-07-27 15:23:16 +02:00
asarium 0af3a04140 Don't link the speech lib
It's not needed, we just need the header.
2016-07-26 22:30:57 +02:00
asarium 8a883eb3a0 Disable speech building on MSVC2010 2016-07-26 22:24:06 +02:00
asarium 3e0f1a8501 Turn FRED warning into status message 2016-07-26 22:18:18 +02:00
asarium 4d25eabcf6 Enable FRED2 by default
If MFC could not be found then it's disabled without causing an error.
2016-07-26 22:16:13 +02:00
Fabian Woltermann 4b2c2d6ef2 Fix for cf_create_directory (#687)
Changes cf_create_directory so that it can actually do what its comment says it does, namely create directories recursively.
2016-07-24 09:24:59 -07:00
asarium 33141220c0 If supported set the Freespace2 as the default project 2016-07-23 22:24:50 +02:00
m!m 3e1cd6c02f Merge pull request #686 from The-E/screenshot_fix
Fixes issue with the screenshot code where the screenshot directory w…
2016-07-23 12:05:07 +02:00
Fabian 72c2d7af38 Fixes issue with the screenshot code where the screenshot directory was not created if necessary. 2016-07-23 10:00:38 +02:00
asarium 29d180d3a7 Fix build naming 2016-07-22 22:22:11 +02:00
Fabian Woltermann 959226e087 Merge pull request #683 from MageKing17/cleanup/weapon-objects
Various cleanup related to weapon objects.
2016-07-22 14:13:42 +02:00
asarium 26ed09d5b3 Fix revision in version 2016-07-22 12:10:05 +02:00
asarium 1bcd5400d3 Move build system to CMake 2016-07-22 12:07:19 +02:00
MageKing17 92e4b5b259 Merge pull request #684 from DahBlount/share_fire_dir_update
Avoid setting flags when using the share fire direction flag
2016-07-21 19:30:39 -07:00
DahBlount 8201f0ef1c Avoid setting flags when using the share fire direction flag
Originally, "share fire dir" forced the "salvo mode" flag. This
interfered with the "use multiple guns" flag. In order to avoid this, I
instead made "share fire dir" if either "salvo mode" or "use multiple
guns" is not found, as those are the only two flags that, coupled with
"share fire dir" give the desired results.
2016-07-21 17:44:08 -06:00
MageKing17 df1d84fe6e Greatly simplify scoring for weapon kills.
Bombs can give points for being shot down. This was being handled by a full-blown pair of damage_ship/damage_ship_id arrays, just like ships have for scoring purposes. This is ridiculous overkill when most bombs are shot down with a single pull of the trigger and means we were storing a couple hundred bytes of data that would be completely unused for the vast majority of projectiles. Now, whoever shoots down a bomb gets the points for it; period. Simple, and we can remove all scoring data from the weapon struct.
2016-07-21 14:44:24 -07:00
MageKing17 9b2e83ed3b Minor cleanup of weapon/weapon collision code.
Lots of references to Weapons[A->instance] and Weapons[B->instance], despite having created pointers for them earlier in the function. Also, I have no idea what was up with the override conditional.
2016-07-21 14:44:24 -07:00
MageKing17 f7591078b9 Change collisionInfo from an mc_info object to an mc_info* pointer.
This seems preferable to storing an entire mc_info object on every weapon, when the vast majority of projectiles (by the very nature of the fact that they still exist) won't have collided with anything.

On the other hand, I'm not wild about allocating and freeing memory every time a weapon collides with a ship or debris. If anyone has a better solution, I'm all ears.
2016-07-21 14:44:24 -07:00
Fabian Woltermann 9a6e939f3d Merge pull request #682 from MageKing17/cleanup/gun-convergence
Remove redundant code branch in gun convergence code.
2016-07-21 22:53:32 +02:00
MageKing17 eb6b77dba0 Remove redundant code branch in gun convergence code.
"If a or b else a" should never ever execute the "else a" branch; this appears to be an artifact left over from Wanderer's reorganization of the autoaim/convergence code in 7bb10d8, before which standard convergence and automatic convergence were handled in separate conditionals.
2016-07-21 12:28:25 -07:00
niffiwan c3c66c9be3 Merge pull request #677 from MageKing17/cleanup/gropengl-error-checking
Add some error checking to gropenl.cpp.
2016-07-21 19:19:21 +10:00
niffiwan a63ffa65ce Merge pull request #678 from MageKing17/bugfix/ship-tbm-countermeasure-fix
Make modular ship tables not reset to species countermeasures.
2016-07-21 19:18:06 +10:00
Fabian Woltermann 7176c6cba2 Merge pull request #681 from asarium/fix/stlport
Remove STLPort
2016-07-21 10:43:57 +02:00
asarium 8b3768ba71 Remove STLPort 2016-07-21 10:15:03 +02:00
Fabian Woltermann d021e38f22 Merge pull request #679 from MageKing17/fred/dedicated-gpu
Make FRED use high-performance GPU by default.
2016-07-21 06:14:41 +02:00
MageKing17 7cc7973c23 Make FRED use high-performance GPU by default.
Literally a copy-paste of the code added by PR #119 from freespace.cpp to fred.cpp.
2016-07-20 12:54:49 -07:00
MageKing17 6d0b3925f0 Make modular ship tables not reset to species countermeasures.
If a modular ship table modifies a ship entry without specifying a "$Countermeasure type:" entry, and the species has a "$Countermeasure type:" entry, FSO would reset the ship's countermeasure type to match the species default, even if we weren't defining the class for the first time. This just adds a first_time check to the else branch to avoid that.
2016-07-20 11:45:41 -07:00
MageKing17 8df65dc3e5 Add some error checking to gropenl.cpp.
The first sign of a problem creating the OpenGL context for FRED should not be failing an assertion when trying to call sscanf() on the OpenGL version. I added a check that will report an error much sooner (as soon as SDL_GL_CreateContext() fails), threw some OpenGL error-checking around the glGetString(GL_VERSION) call to be on the safe side, and slapped an Assertion() in there for good measure.

Also there was a \n missing from the mprintf() call if window creation failed.
2016-07-20 11:11:13 -07:00
Fabian Woltermann 357cc882da Merge pull request #676 from asarium/fix/msvcWarnings
Fix Visual Studio warnings
2016-07-20 18:49:06 +02:00
asarium 8b8c370995 Fix GCC/Clang warning 2016-07-20 14:31:27 +02:00
asarium 71a1f6c307 Fix Visual Studio warnings
The only major change is that all bpp variables in bmpman have been converted into ints. Before it was a mix of ubyte and int.
2016-07-20 13:49:41 +02:00
m!m aa169af2c0 Merge pull request #675 from MageKing17/cleanup/gitignore-vc-db-files
Add *.VC.db and *.VC.VC.opendb to .gitignore file.
2016-07-19 19:50:01 +02:00
MageKing17 3cd6e3ce6b Add *.VC.db and *.VC.VC.opendb to .gitignore file.
These are created by VS 2015 (as of update 2) and should be ignored like other local Visual Studio files. *.VC.db is a new format for the IntelliSense database (replacing *.sdf used by previous versions), and *.VC.VC.opendb is a lockfile indicating the database is in use.
2016-07-19 09:05:17 -07:00
m!m 3d5682ae7e Merge pull request #673 from MageKing17/appveyor/version-3-7-5
Get rid of AppVeyor version number.
2016-07-19 12:10:27 +02:00
m!m 8b3fb148eb Merge pull request #672 from MageKing17/bugfix/force-feedback
Fix a couple force feedback issues.
2016-07-19 12:09:47 +02:00
MageKing17 20d3410398 Get rid of AppVeyor version number.
FSO hasn't been on 3.7.3 for a while, now, and the version number is pretty irrelevant to CI in the first place.
2016-07-18 12:25:25 -07:00
MageKing17 ab23830778 Correct haptic effect for docking.
SDL_HAPTIC_SQUARE was removed immediately before the SDL 2.0.0 release and replaced with SDL_HAPTIC_LEFTRIGHT, due to running out of bits. SDL_HAPTIC_SQUARE is a periodic effect. SDL_HAPTIC_LEFTRIGHT is for controller rumble. Just because the latter replaced the former doesn't mean they're equivalent (and in fact they are completely different, which results in a malformed effect that won't work right, if at all). As a result, I've replaced the effect with SDL_HAPTIC_SINE, since a sine wave is the closest periodic effect to a square wave. This allows the effect to actually work, although not in exactly the same way as it would if it were actually a square wave (SDL 2.1 is supposed to contain SDL_HAPTIC_SQUARE again and presumably the effect can be changed back to a square wave whenever that happens).
2016-07-18 11:14:31 -07:00
MageKing17 19b5ee97f7 Allow force feedback to work again.
It turns out that SDL_HapticOpenFromJoystick() is currently bugged (I found the SDL bugzilla bug for it). SDL_HapticOpen() allows force feedback to work, with the caveat that it operates on indices and so anyone with multiple force feedback devices won't get the one matching their selected joystick. The only other alternatives are to add our own code to match the haptic device to the currently-selected joystick, to add a haptic device selector to the launcher, or to distribute a custom version of SDL that fixes SDL_HapticOpenFromJoystick(). This is the lowest-effort change (which can and should be reverted if SDL releases a new version that fixes it).
2016-07-18 11:07:10 -07:00
MageKing17 19181b016c Merge pull request #670 from asarium/fix/joystickEvents
Fix joystick axis events being ignored.
2016-07-18 09:28:32 -07:00
MageKing17 343bee1eed Merge pull request #669 from asarium/fix/joystickID
Only process events from the right joystick
2016-07-18 09:28:28 -07:00
asarium 9a1b143308 Fix joystick axis events being ignored. 2016-07-18 18:09:12 +02:00
asarium d8e3b382fc Only process events from the right joystick
The axis handler already checked if the right joystick was used but the
button and hat handlers didn't.
2016-07-18 14:06:14 +02:00
MageKing17 e1042da9ae Merge pull request #668 from SamuelCho/aabitmap_alpha_channel_fix
Remove alpha channel check in opengl_aabitmap_ex_internal
2016-07-17 20:05:35 -07:00
SamuelCho 426a25e35e Remove alpha channel check in opengl_aabitmap_ex_internal since it's breaking 32-bit aabitmaps. 2016-07-17 19:34:51 -07:00
MageKing17 d089fd2282 Merge pull request #667 from asarium/feature/onlyMainWindowEvents
Only process events that belong to the main window
2016-07-17 10:26:28 -07:00
MageKing17 f1c62b4948 Merge pull request #666 from niffiwan/fix/apng_endbyframes2
End apngs by frame count as well as time
2016-07-17 10:25:19 -07:00
asarium 0e653bfb78 Add documentation 2016-07-17 18:27:54 +02:00
asarium 05dda73ecd Only process events that belong to the main window
SDL2 support multiple windows and differentiates the events for the
individual windows using the windowID field in the events. These changes
check if that window ID belongs to our main window and ignores any
events that don't belong to it. This allows to add another window
without screwing up the rest of FSO with its input.
2016-07-17 18:20:56 +02:00
niffiwan 4bd9c45d1d End apngs by frame count as well as time
Choose that if a system is too slow to compose & render apngs fast
enough, play the anim until the last frame anyway, potentially messing
up time sync between frames, but at least don't have looped anims
stuttering as they skip back to the 1st frame from some non-end frame.

Most modern-ish systems won't see this issue unless there's lots of
apngs playing at the same time...
2016-07-17 13:48:49 +10:00
MageKing17 88f51f2f0a Merge pull request #665 from The-E/monopub_removal
Bad reference removal
2016-07-16 12:25:02 -07:00
Fabian 1ea313c445 Removes references to monopub.h (removed in the AP merge) from the project files that still reference it 2016-07-16 21:11:14 +02:00
Fabian Woltermann 2eab9514a9 Merge pull request #663 from asarium/feature/exitOnSdlQuit
Quit game when receiving SDL_QUIT event
2016-07-16 17:09:18 +02:00
Fabian Woltermann fd0229e44f Merge pull request #664 from asarium/feature/unresponsive
Ignore all OS events when loading a mission
2016-07-16 17:09:08 +02:00
asarium 9f9809be5d Ignore all OS events when loading a mission
This should fix the "Application unresponsive" errors.
2016-07-16 16:23:30 +02:00
asarium 8db274ee7f Quit game when receiving SDL_QUIT event
This allows FSO to exit gracefully when receiving a SIGINT or SIGTERM
2016-07-16 15:48:22 +02:00
Fabian Woltermann 14dad6eceb Merge pull request #662 from asarium/feature/eventListeners
Add API for registering custom event handler
2016-07-16 15:43:17 +02:00
asarium 0751a7ab0f Use a vector instead of unordered_map 2016-07-16 15:18:30 +02:00
asarium 54381c2762 Fix typo 2016-07-16 15:18:30 +02:00
asarium afef5a7309 Add API for registering custom event handler
May be useful for future text input or scripting implementations
2016-07-16 15:18:30 +02:00
m!m 5a0bfffc75 Merge pull request #661 from scp-fs2open/antipodes
SDL Everywhere Master Edition
2016-07-16 14:15:48 +02:00
Fabian Woltermann bbaf78ad76 Merge pull request #660 from asarium/antipodes_/sync
Sync Antipodes
2016-07-16 13:59:09 +02:00
asarium aa639881aa Merge branch 'master' into antipodes_/sync 2016-07-16 13:48:12 +02:00
Fabian Woltermann d28be156d9 Merge pull request #659 from SamuelCho/monochrome_gamma_correction
Fix gamma correction for colors sourced outside of textures
2016-07-14 09:58:33 +02:00
SamuelCho e620ffbb65 Make sure we gamma correct colors coming from the GL color state or the color verts. 2016-07-13 23:58:57 -07:00
Fabian Woltermann c4ce653431 Merge pull request #658 from SamuelCho/neb_nohtl_removal_fix
Fixed nebula missions from breaking scene render targets following the nohtl removal.
2016-07-13 12:44:59 +02:00
SamuelCho ac46ee4030 Fixed nebula missions from breaking scene render targets following the nohtl removal. 2016-07-12 23:36:05 -07:00
MageKing17 10d6c48abc Merge pull request #656 from The-E/make_beams_bright_again
Make beams and warps bright again
2016-07-12 13:36:16 -07:00
Fabian Woltermann 5fca2355b9 Adds TMAP_FLAG_EMISSIVE for the 2D warp effect, and ups the scaling applied to textures with that flag from 1.5 to 2.0 to better approximate the brightness beams used to have.
Also sets a glow texture for the 3D warp effect.
2016-07-12 21:51:39 +02:00
SamuelCho e3ad7d213a Merge pull request #655 from niffiwan/fix/delete_spurious_file
Delete spurious temp file
2016-07-11 00:18:25 -07:00
niffiwan 5b332c4400 Delete spurious temp file
From #654
2016-07-11 17:10:08 +10:00
m!m d98f6f1bb1 Merge pull request #654 from SamuelCho/remove_unused_gfx_code
Strip out unused rendering code.
2016-07-11 09:07:45 +02:00
SamuelCho 701ae8f3b5 Removed unused variables following the rendering code removal. 2016-07-10 21:29:47 -07:00
SamuelCho 1ef7688fa1 Strip out unused rendering code. 2016-07-10 19:29:11 -07:00
z64555 fcc40b4812 Merge pull request #648 from The-E/nohtl_removal_fix
Fixes a small issue in the nohtl removal commit.
2016-07-09 18:30:19 -05:00
Fabian Woltermann ef33ee490d Fixes a small issue in the nohtl removal commit. In this case, the original line "if (!Cmdline_nohtl || (s <= 0.0f))" was replaced by "if (s <= 0.0f)", which unfortunately is not the intended behaviour here. 2016-07-10 00:53:12 +02:00
Fabian Woltermann 1469ba20ca Merge pull request #646 from niffiwan/fix/apng_optional_caching
Allow apng's to not be cached
2016-07-09 13:05:42 +02:00
niffiwan 8162abc256 Allow apng's to not be cached
Main use case is headanis where only one is played at a time and
caching the frames merely increases memory use & fragmentation, leading
to malloc errors with heavy apng use
2016-07-09 20:04:16 +10:00
Fabian Woltermann 0b98320841 Merge pull request #644 from chief1983/antipodes_/sdl204
Upgrade Mac Frameworks.tgz and the libsdl folder to SDL 2.0.4.
2016-07-09 08:10:30 +02:00
MageKing17 011368dff5 Merge pull request #645 from MageKing17/feature/remove-subsystem-limit
Remove subsystem limit.
2016-07-08 23:08:25 -07:00
MageKing17 241c0eaa95 Remove subsystem limit.
Allows support for as many subsystems as available memory allows by replacing the Ship_subsystems[] pointer array with a pointer vector. It still just contains pointers to dynamically-allocated subsystem arrays (allocated in blocks of NUM_SHIP_SUBSYSTEMS_PER_SET), so this should behave almost identically to the current code.
2016-07-08 15:06:58 -07:00
Cliff 7424c41f3f Remove the mac i386 builds from the build matrix too. 2016-07-08 15:44:46 -05:00
SamuelCho 98e56ea3e3 Merge pull request #598 from asarium/cleanup/graphics
Remove unused graphics functions
2016-07-08 13:12:47 -07:00
chief1983 ae8e3c3145 Upgrade Mac Frameworks.tgz and the libsdl folder to SDL 2.0.4. Remove Only Active Archs setting from Travis configuration to see if that's enough to get it to only build x64 now. 2016-07-08 14:46:55 -05:00
Fabian Woltermann 8ff201fddb Merge pull request #641 from MageKing17/cleanup/deprecate-nohtl-and-brief-lighting
Deprecate -nohtl and -brief_lighting.
2016-07-08 21:32:07 +02:00
MageKing17 70529dbd5a Deprecate -nohtl and -brief_lighting.
-nohtl hasn't worked for years, and -brief_lighting was always supposed to be a temporary flag before making the behavior always on.
2016-07-08 09:39:29 -07:00
Fabian Woltermann bcb072a146 Merge pull request #636 from asarium/antipodes_/sync
Sync Antipodes
2016-07-07 11:35:38 +02:00
Fabian Woltermann 876663ffdc Merge pull request #642 from SamuelCho/mac_pbr_lod_fix
Fix for the PBR shader compilation error on Mac
2016-07-07 11:34:36 +02:00
Samuel Cho a43bb9ad37 OpenGL 2.1 spec doesn't support texture LOD lookups in the fragment shader unless we use GL_ARB_shader_texture_lod. Should allow PBR to work on Mac now. 2016-07-07 00:13:39 -07:00
asarium 2b5fd5e7ec Merge branch 'master' into antipodes_/sync 2016-07-06 18:46:11 +02:00
m!m 8478f47d9e Merge pull request #9 from chief1983/mysync
Undo some merge conflict clobbering in Xcode project
2016-07-06 18:25:42 +02:00
chief1983 9825d62694 Nevermind, we don't need universal support after all, we target 10.7 and 10.6 was the last 32-bit supporting OS. 2016-07-06 10:25:45 -05:00
Fabian Woltermann 7516ce039e Merge pull request #640 from SamuelCho/physically_based_rendering
Physically based rendering
2016-07-06 14:01:32 +02:00
SamuelCho 75c16008c6 This function should always return the number of mip map levels. 2016-07-05 23:15:11 -07:00
SamuelCho f5a96c33be Some explanation for why we need OGL_EXT_FRAMEBUFFER_OBJECT to use glGenerateMipmap() 2016-07-05 23:15:10 -07:00
SamuelCho bbab2f2b1e Fix blending of particles dependant on if texture map has an alpha channel. 2016-07-05 23:15:10 -07:00
SamuelCho bbae9d5242 Don't replace RGB channels of texture in the passthrough shader if it has an alpha channel when using gr_aabitmap_ex 2016-07-05 23:15:09 -07:00
SamuelCho 12edc6a53b Fixed constant alpha not being applied to the texture map. 2016-07-05 23:15:09 -07:00
SamuelCho dd73d8fb63 New lighting model based off of Blinn-Phong and Fresnel-Shlick. Introduced -reflect maps. New gloss parameters for specular power. High dynamic range rendering. Improved bloom pass. 2016-07-05 23:15:08 -07:00
chief1983 c1d074d5d0 One last fix, actually fixes running the game now. 2016-07-06 00:35:13 -05:00
MageKing17 539704d55a Merge pull request #639 from jg18/ping_color_fix
Fix text color of ping values in server list.
2016-07-05 21:14:11 -07:00
chief1983 824e6bd817 Undo some merge clobbering. 2016-07-05 22:44:35 -05:00
jg18 b4a764e6cd Fix text color of ping values in server list.
Update ping color value ranges to be more realistic. Also add orange as a
ping value text color.
2016-07-05 20:20:32 -07:00
asarium 256503cd08 Use better Frameworks file 2016-07-05 20:58:50 +02:00
asarium a6df7eef35 Merge branch 'master' into antipodes_/sync
The APNG changes required some additional work. A cursor now owns the
bitmap handle that will be used for the cursor. This is required in
order to support variable FPS cursors.
2016-07-05 12:09:22 +02:00
niffiwan 74b1cdbfc5 Merge pull request #637 from asarium/ci/macosxErrorLog
Upload the MacOSX build log to pastebin if the build fails
2016-07-05 18:54:26 +10:00
asarium c10338480a Fix Windows compile 2016-07-05 10:10:53 +02:00
m!m 0af0064b6d Merge pull request #638 from MageKing17/cleanup/read-player-controls
Clean up read_player_controls() somewhat.
2016-07-05 10:03:11 +02:00
MageKing17 6453fa3ed3 Clean up read_player_controls() somewhat.
I don't remember why I was reading this function, but I noticed that the "can_warp" and "warp_failed" variables didn't actually seem to be serving any purpose, and there was some redundant code in the PCM_WARPOUT_STAGE* case they were "used" in.
2016-07-04 18:38:17 -07:00
m!m 76ffc26680 Merge pull request #537 from niffiwan/apng_pr
APNG support
2016-07-04 23:34:49 +02:00
asarium 5a847268bf Upload the build log to pastebin if the build fails 2016-07-04 22:34:46 +02:00
Fabian Woltermann dc8079b730 Merge pull request #634 from MageKing17/bugfix/change-ship-class-subsystem-target-fix
Fix several problems with change_ship_type()
2016-07-04 21:49:15 +02:00
asarium 6c4de8161d Use new Framework 2016-07-04 11:44:38 +02:00
asarium cd2a692150 Merge branch 'master' into antipodes_/sync 2016-07-04 11:15:40 +02:00
MageKing17 28db7bb2f9 Fix several problems with change_ship_type()
This was a bit of a doozy.

If the player's current target changes ship class with change_ship_type(), Player_ai->targeted_subsys will still be pointing to the old subsystem list; this could cause problems (specifically out-of-bounds array accesses) when trying to e.g. look up nonexistant submodels. Similar problems occur with any other AIs targeting a subsystem on the ship in question. In order to fix this, several changes were made.

Firstly, change_ship_type() will now go through every Ai_info object looking for ones targeting a subsystem of the ship changing classes, or with an AI_GOAL_DESTROY_SUBSYSTEM goal for the ship changing classes, and convert them all to the new subsystem (if there's a match) or remove the target/goal (if there isn't), reusing the existing subsystem comparison logic (for transferring damage). Near the end, there's a Player_ai comparison to call hud_cease_subsystem_targeting(0) if necessary.

Additionally, change_ship_type() will also look through every weapon looking for anything that might be homing in on or fired from a subsystem on the ship changing types; these are handled similarly to targeted subsystems, including clearing the weapon's homing_subsys/turret_subsys attribute if a matching subsystem isn't found.

Also handles sp->last_targeted_subobject[], which contains subsystem pointers to keep track of which subsystem each player was previously targeting on that ship.

Lastly, change_ship_type() will now kill ship sparks if the model number has changed (trying to transfer sparks to matching submodels would be a herculean task and probably fail most of the time anyway, with similarly-named subobjects with different shapes so the coordinates wouldn't make sense anyway).
2016-07-03 20:28:52 -07:00
niffiwan 774140d461 Merge pull request #635 from MageKing17/bugfix/color-table-parsing
Fix color table parsing.
2016-07-03 21:59:38 +10:00
MageKing17 bf6cbb9f18 Fix color table parsing.
Accidentally forgot one array in PR #633, causing a crash if a color table is actually present.
2016-07-03 02:17:07 -07:00
niffiwan 9a5085d7fd Merge pull request #633 from MageKing17/feature/color-orange
Adds Color_orange and a corresponding color tag to colors.tbl.
2016-06-23 19:41:02 +10:00
MageKing17 bb3828b80b Adds Color_orange and a corresponding color tag to colors.tbl.
Inserts "Orange" between "Bright Yellow" and "UI Light Green" and adds the default color tag "$o" to use it. (Prerequisite for using orange as a ping display color.)

Also added some comments to identify the RGB values by the corresponding color name, because as it turns out, they're awfully hard to read as-is.
2016-06-22 19:59:55 -07:00
Goober5000 ec9936138b Merge pull request #620 from asarium/antipodes_/mouseCompileFix
Fix compilation with SDL 2.0.4
2016-06-20 22:25:47 -04:00
m!m b7b89337b7 Merge pull request #631 from rtoijala/fix-vpath-builds
fix VPATH builds
2016-06-18 18:20:02 +02:00
Risto Toijala 5577c4e16e fix VPATH builds
https://www.gnu.org/software/automake/manual/html_node/VPATH-Builds.html

VPATH builds were broken because mongoose.h was not found.
Makefile.am stated that it should be found in ../mongoose, which is
incorrect for VPATH builds. The search path should be relative to the
source tree ( i.e. $(VPATH) ).

Example:
mkdir -p build/debug
cd build/debug
../../autogen.sh
../../configure --enable-debug
make

The search path would then be (relative to the source tree)
build/mongoose, not ./mongoose as it should.

Fix this by changing ../mongoose to ./($VPATH)/../mongoose.

In the previous example, $(VPATH) is ../../../code, so the search path
is now correctly ./../../../code/../mongoose.

For in-tree builds, the path was previously ../mongoose. It is now
.//../mongoose, which is equivalent.
2016-06-18 16:02:17 +03:00
niffiwan 1d28184ce6 Merge pull request #442 from asarium/antipodes_/luaMouse
Improve CursorManager
2016-06-18 12:53:16 +10:00
MageKing17 3ed6874cb2 Merge pull request #629 from asarium/fix/625
Fix for #625
2016-06-17 08:32:37 -07:00
m!m e0b8abc0ba Merge pull request #609 from jg18/ping_fix
Fix ping calculations in server list.
2016-06-17 10:17:28 +02:00
asarium e3664152ca Validate fiction viewer file name 2016-06-16 19:49:34 +02:00
asarium 371c49724e Turn invalid file error into warning 2016-06-16 19:49:34 +02:00
m!m b2fc33563d Merge pull request #628 from rtoijala/lua51-build-fix
accept lua51 as pkg-config name for Lua
2016-06-16 19:25:30 +02:00
Risto Toijala 73c20cedd3 accept lua51 as pkg-config name for Lua 2016-06-16 15:34:53 +03:00
niffiwan b51d6f84b8 Merge pull request #626 from rtoijala/misleading-indentation
Fix indentation warnings
2016-06-15 20:43:13 +10:00
Risto Toijala 7d7c87c290 Fix indentation warnings
GCC 6 warns about misleading indentation because it counts tabs as 8
spaces. The rest of the code uses tabs, these lines use 4 spaces.
Replace spaces with tabs.

Whitespace changes only.
2016-06-15 12:40:44 +03:00
m!m cb9c66966d Merge pull request #619 from MageKing17/feature/spinup-without-external-models
Move conditional so that weapon spinup happens without external models.
2016-06-05 13:06:38 +02:00
m!m 441ac5c066 Merge pull request #621 from tomimaki/master
Fix compiling debug build on linux with glibc 2.23
2016-06-04 11:36:06 +02:00
tomimaki 1b65fd50a0 Fix compiling debug build on linux with glibc 2.23 (#1) 2016-06-04 00:11:04 +02:00
asarium 44b44bb249 Fix compilation with SDL 2.0.4 2016-06-03 19:58:50 +02:00
MageKing17 5d307d24f4 Move conditional so that weapon spinup happens without external models.
Moves the sip->draw_primary_models[bank_to_fire] check so that it only contains the code related to shipp->primary_rotate_ang[bank_to_fire], since that really does only matter if external models are present. The rest of the spinup code doesn't actually care about the model, though, so it seems odd (and unfair to modders) to not allow it to function just because the ship has external primary models disabled.

I also wrapped the spinup code in a basic check that winfo_p->weapon_submodel_rotate_vel is greater than zero because most weapons aren't going to have a spinup, so there's no need to perform the other calculations for them (it's probably a marginal savings at best, but since I was getting rid of the best-case savings of most ships not having external primary models enabled, I figured I may as well replace it).

Minor formatting changes to the other lines just because it took me a while to figure out what the code was doing when I first read it; "if(" changed to "if (", and line breaks inserted into the one-line conditionals.
2016-06-02 21:40:16 -07:00
jg18 d06d6e6df0 Change f2fld() macro to f2d(). 2016-05-30 14:08:28 -07:00
jg18 e78327d879 Fix ping average calculation. 2016-05-30 13:59:51 -07:00
jg18 8f42977ee8 Fix ping calculations in server list.
Fix calculations of server ping in in-game server list. Minimize floating
point calculations, using double instead of float, avoid calling timer
twice when receiving pong, and capture pong time more precisely.
2016-05-30 13:59:51 -07:00
m!m d60c8d5f3f Merge pull request #615 from niffiwan/feature/player_min_speed
Add player minimum speed feature
2016-05-27 14:19:08 +02:00
niffiwan 278a797db2 Add player minimum speed feature
Allows the players ship to have a minimum speed set. If the ships speed
drops below this (per ship) value, the throttle is increased to the
minimum.
For ships that are gliding, their engines will be reactivated when the
ships overall velocity falls below the minimum speed.
Currently only sets a minimum Z speed, Y & X are ignored.
2016-05-27 20:34:15 +10:00
m!m 1a59a1c811 Merge pull request #612 from Yarn366/messages_suffix_fix
Fix for automatic message suffixes
2016-05-25 19:40:42 +02:00
MageKing17 96c01e6c1e Merge pull request #613 from DahBlount/Fix-Warp-No-Collide
Prevent "no collide" objects from colliding during warp sequence
2016-05-25 01:07:50 -07:00
DahBlount 50496c8143 Add OF_COLLIDES check to avoid OBJ_RECALC_PAIRS
OBJ_RECALC_PAIRS unsets then sets the OF_COLLIDES flag, so when a ship
with "no collide" set on it warps out, the flag is essentially ignored
and the ship can collide during the warp sequence.
2016-05-24 22:54:10 -06:00
Yarn366 7d3b824428 Added a flag the message_extra struct that tells whether the base animation exists. Also changed message_play_anim() to use this flag rather than the first_frame field to decide whether to add a suffix to the name. 2016-05-23 01:10:33 -04:00
niffiwan d3d026651e Add __gc lua cleanup function
Per m!m review
2016-05-10 19:42:22 +10:00
niffiwan 7af57209e1 Add LUA support for streaming anims 2016-05-10 19:42:22 +10:00
niffiwan 67ca370cba Fix a minor deviation from the spec 2016-05-10 19:42:21 +10:00
niffiwan e269b77645 Convert warnings to mprintf's
With png & apngs sharing the same filename these warnings could fire
quite a bit, and the lack of an anim playing should be very obvious to
the modder anyway.
2016-05-10 19:42:21 +10:00
niffiwan 0e02552267 Fix bug in handling dispose operations
I didn't read the spec correctly; only the previous frames portion of
the output buffer is supposed to be cleared/reverted; not the entire
output buffer
2016-05-10 19:42:21 +10:00
niffiwan 6155df93d9 Minor tweaks to improve performance
Also updated/added a few comments
Fix a bug; last frame wasn't being processing
2016-05-10 19:42:21 +10:00
niffiwan 38c7d6e33c Update FRED to allow *.png file selection
For campaign, command briefing & event editors
(plus the probably unused message editor)
2016-05-10 19:42:21 +10:00
niffiwan d519c83697 Add comment for why we're not using .apng 2016-05-10 19:42:21 +10:00
niffiwan b7bad1aba9 Check for nullptr before calling cfclose 2016-05-10 19:42:21 +10:00
niffiwan 886ecbf151 Fix a bunch of cfile leaks in bm_load_animation 2016-05-10 19:42:21 +10:00
niffiwan 1fd8f7afba Cleanup apng owned resources on ctor exception 2016-05-10 19:42:21 +10:00
niffiwan b24bea8507 Ensure total_time is set if anim is already loaded
i.e. fix the actual bug, not just the symptoms!
2016-05-10 19:42:21 +10:00
niffiwan 0fc4b89820 Missed weapon thruster/glow calcs
Thanks to Axem for finding the bug
2016-05-10 19:42:21 +10:00
niffiwan 58facec264 Fix MSVC2015 warning (int to bool conv) 2016-05-10 19:42:21 +10:00
niffiwan e9e49f5276 Fixes per m|m's review
Use unique_ptr for safer pointer management
Simplify frame delay calcs when looping
Ensure animated cursor times don't lose precision
Switch Error to an Assertion
Fix LUA documentation formatting
2016-05-10 19:42:21 +10:00
niffiwan 3df84a3986 Fix travis warning signed-v-unsigned comparison
I reckon this is an issue with gcc 4.6.3, 4.8.4 doesn't think it's an
issue, maybe due to the way the way the constants were init'd with HEX
values
2016-05-10 19:42:21 +10:00
niffiwan 375a251334 Complete apng feature
Handle total_time directly requested from bm_load_animation
Make generic_anims request total_time directly
Move png-vs-apng check to apng class
Remove redundancy in apng exception messages
Update comments
2016-05-10 19:42:21 +10:00
niffiwan 87770aad8f Add total_time output param to bm_load_animation
Also convert int to bool, and replace NULL with nullptr
2016-05-10 19:42:20 +10:00
niffiwan 2f1b686349 Finish conversion to new frame calc function
Also remove debug code
2016-05-10 19:42:20 +10:00
niffiwan 200c4c82a5 Simplify shockwave_get_framenum
Have get call set rather than duplicate code for calculating the frame
number
2016-05-10 19:42:20 +10:00
niffiwan 0b20b15c2c Fix issues found by Axem
Fix silly issue preventing getFrame() from working
Remove infinite loop when calculating frame num
Convert more animations to use new frame calc function
2016-05-10 19:42:20 +10:00
niffiwan 78d6957be8 Tweak lua loadTexture to be able to load apngs
Reorder precendence of static image vs animation loading
i.e. load animations 1st if requested, then load still images
if the animation failed to load or if animations weren't requested
2016-05-10 19:42:20 +10:00
niffiwan 50c791c998 Add support for non-streaming apngs
i.e. apngs (pre)loaded into bmpman slots

handles apng variable frame delays
Includes new lua function (getFrames) to find the current frame for
apngs. Also uses new function to correctly display apngs for mission
loading animations, ship thrusters & engine glows.
2016-05-10 19:42:20 +10:00
niffiwan 90b35b72fb Add support for streaming apngs
includes:
 full-colour & hud-colour headanis
 cbanims & intelanims
 mainhall animations (including playing in reverse)

Notably does not support ship/weapon select anims as they need
keyframes and there isn't anywhere to specify them in the apng format
2016-05-10 19:42:20 +10:00
MageKing17 8906c735c6 Merge pull request #607 from niffiwan/feature/lua_tAnim_instant
Add instant flag to lua triggered anims
2016-05-08 10:57:36 -07:00
MageKing17 2ee839152c Merge pull request #608 from niffiwan/cleanup/lua_ets_desc
Fix ETS virtvar comments
2016-05-08 10:57:20 -07:00
niffiwan 6be09e7157 Merge pull request #606 from MageKing17/cleanup/fred2-executable-version
Update FRED2_Open executable version to 3.7.5.
2016-05-08 19:32:33 +10:00
niffiwan 1715b20d30 Fix ETS virtvar comments 2016-05-08 15:05:19 +10:00
niffiwan 37497cb7d7 Add instant flag to lua triggered anims
Just expose the existing instant flag from the animation handling code
2016-05-07 21:10:26 +10:00
MageKing17 b62eba559b Update FRED2_Open executable version to 3.7.5.
Not sure how this got missed multiple times, but better late than never.
2016-05-06 16:10:20 -07:00
Cliff Gordon 4fa84ee388 Merge pull request #600 from MageKing17/bugfix/grammar-compilation
Make VS 2013 and 2015 use the copy of gc.exe like 2010 does.
2016-05-01 16:01:30 -05:00
Goober5000 776f0df434 Merge pull request #592 from downwash/mantis-02851
Removed support for // comments in FRED
2016-04-29 02:02:25 -04:00
MageKing17 39ce7d4253 Make VS 2013 and 2015 use the copy of gc.exe like 2010 does.
Recent update to VS 2015 Community Edition appears to have removed gc.exe for some reason; the safest thing to do would seem to be to go back to using the copy of it we were already keeping around for VS 2010 Express.
2016-04-27 14:51:47 -07:00
m!m c33b54464e Merge pull request #599 from PeterMitsis/double-float-conversions
Minor trig cleanup
2016-04-27 11:54:06 +02:00
Peter Mitsis e3cde7086c hud: Simplify HudGaugeLock::renderLockTrianglesOld()
Uses the following trig identities to reduce the number of floating
point operations in HudGaugeLock::renderLockTrianglesOld().
    sin(-x) = -sin(x)
    cos(-x) = cos(x)

Signed-off-by: Peter Mitsis <[email protected]>
2016-04-24 21:56:06 -04:00
Peter Mitsis 180674154c trig: Use floating point versions of trig functions
Replaces calls to double-precision floating point trig functions with
calls to single-precision floating point trig functions as follows:
    cos() -> cosf()
    sin() -> sinf()
    tan() -> tanf()
    acos() -> acosf()
    asin() -> asinf()
    atan() -> atanf()

This allows the compiler to avoid generating unnecessary instructions
that convert a float to a double and then a double back to a float.

Signed-off-by: Peter Mitsis <[email protected]>
2016-04-24 21:56:06 -04:00
Peter Mitsis 181b758577 Replace ANG_TO_RAD() macro with fl_radians() macro
Both the ANG_TO_RAD() and fl_radians() macros were serving the same
purpose; they converted an angle from degrees to radians. To reduce
code duplication, ANG_TO_RAD() was replaced with the existing
fl_radians().

Signed-off-by: Peter Mitsis <[email protected]>
2016-04-24 21:56:06 -04:00
asarium 57f015a764 Remove unused graphics functions 2016-04-18 22:36:25 +02:00
niffiwan 3f5e30b4dc Merge pull request #596 from MageKing17/bugfix/template-first-time
Make ship templates default first_time to true, like ship classes.
2016-04-18 18:56:38 +10:00
MageKing17 15dec7e508 Make ship templates default first_time to true, like ship classes.
Otherwise, the first_time code never gets evaluated for template-based ships and you never get engine glows from species. Fixes issue #594.
2016-04-17 17:02:44 -07:00
downwash 7e3198392b Removed support for // comments in FRED 2016-04-16 23:28:13 +02:00
MageKing17 f247330e4b Merge pull request #591 from niffiwan/bugfix/mouse_hat_interaction
Stop joystick hat binds being triggered spuriously
2016-04-13 09:36:07 -07:00
niffiwan 6c1dd85738 Stop joystick hat binds being triggered spuriously
There was a bug in the controls code that meant trigger type controls
bound to a joystick hat could be triggered by unrelated mouse button
presses. i.e. bind "hat-back" to cycle secondary weapons and secondary
banks would change when you fired with left mouse button.

Root cause is left bitshifting by 32 or more, which is implementation
defined and at least on Linux/GCC resulted in the above behaviour.
2016-04-13 22:21:08 +10:00
m!m 1a5700a0cb Make new registry configurable on commandline (#587) 2016-04-10 13:18:44 +02:00
Yarn366 3584164ec0 Fix for tab key on barracks screen (#589)
* Fixed tab key not actually switching between single player/multiplayer.
2016-04-10 13:02:30 +02:00
m!m 2679f97dc2 Merge pull request #586 from niffiwan/bugfix/asan_triggered_anim_memcpy
Fix issue with memcpy on overlapping memory
2016-04-06 13:34:38 +02:00
niffiwan 0a041aade1 Fix issue with memcpy on overlapping memory
Triggered animations (e.g. models with rotating afterburner flaps)
could trigger a memcpy on overlapping memory. This may not have caused
issues, but is undefined behaviour according to the spec
Also see #574
2016-04-06 20:26:34 +10:00
MageKing17 9845a1ad46 Merge pull request #580 from Goober5000/dumb_rotate_compatibility
use $rotate, $rotate_rate, and $rotate_time, and their $dumb_ equivalents, with proper backwards compatibility
2016-04-03 20:41:08 -07:00
Goober5000 33151e956d fix a bug in the option comparison, and also add sanity checking for infinite rotation rates 2016-04-03 21:07:55 -04:00
Goober5000 08e565a855 use $rotate, $rotate_rate, and $rotate_time, and their $dumb_ equivalents, with proper backwards compatibility 2016-04-03 18:15:20 -04:00
Fabian Woltermann fb61239f85 Merge pull request #582 from asarium/fix/cfilecrash
Fix crash in cfile.cpp
2016-04-03 23:16:35 +02:00
asarium 88ffa54ae0 Fix crash in cfile.cpp 2016-04-03 22:12:13 +02:00
m!m 5de6635111 Merge pull request #576 from PeterMitsis/cfile-cleanup
Cfile cleanup
2016-04-02 09:35:31 +02:00
Peter Mitsis 04dc9f28cc cfile: Fix minor issues found during code review
Signed-off-by: Peter Mitsis <[email protected]>
2016-04-01 20:03:00 -04:00
Fabian Woltermann 55bdad3799 Merge pull request #579 from DahBlount/Share_Fire_Direction-Accuracy-Fix
Remove redundant function and add check to add "salvo mode" if "share fire direction" is found
2016-04-02 01:00:19 +02:00
DahBlount 63bb60935c Remove redundant function and add check to add "salvo mode" if "share fire direction" is found 2016-04-01 16:26:55 -06:00
MageKing17 6d82031115 Merge pull request #577 from asarium/fix/572
Fix issue #572
2016-04-01 04:05:11 -07:00
asarium 05fbb8d4de Fix issue #572 2016-04-01 12:03:19 +02:00
MageKing17 f4645e3e6c Merge pull request #569 from downwash/mantis-03153
Clarified a warning message about wave tresholds (Mantis 3153)
2016-04-01 01:42:32 -07:00
Peter Mitsis 8924aa06e9 cfile: Simplify cf_delete()
Removes the unnecessary attempt at opening the specified prior to
calling _unlink().

Signed-off-by: Peter Mitsis <[email protected]>
2016-03-31 21:50:37 -04:00
Peter Mitsis 673b8f61eb cfile: Remove superfluous memset() in cfile_flush_dir()
There is no need to zero the 'stat' structure before using in stat().

Signed-off-by: Peter Mitsis <[email protected]>
2016-03-31 21:50:37 -04:00
Peter Mitsis f75f6af43a cfile: Refactor cfile_chdir() and cfile_push_chdir()
Reworks cfile_chdir() and cfile_push_chdir() to extract common and
reduce code duplication.

Signed-off-by: Peter Mitsis <[email protected]>
2016-03-31 21:50:37 -04:00
Peter Mitsis 71a61143bf cfile: Simplify cfile_init() and cfile_in_root_dir()
Removes unnecessary error checking and simplifies the logic.

Signed-off-by: Peter Mitsis <[email protected]>
2016-03-31 21:50:37 -04:00
Peter Mitsis cca2a776e1 cfile: Only define cfile_chdrive() for _WIN32
Not only was the use of of cfile_chdrive() already conditional on _WIN32
being defined, so too was its extern declaration.

Signed-off-by: Peter Mitsis <[email protected]>
2016-03-31 21:50:37 -04:00
Peter Mitsis 8e21aa6c88 cfile: Apply 'static' keyword
Signed-off-by: Peter Mitsis <[email protected]>
2016-03-31 21:50:37 -04:00
MageKing17 6bb1ccc830 Merge pull request #575 from niffiwan/bugfix/controlsconfig_delete
Fix new[] vs delete mismatch
2016-03-31 15:47:26 -07:00
niffiwan f6ef7c1cd6 Fix new[] vs delete mismatch
Found by address sanitiser
2016-03-31 20:10:16 +10:00
downwash a4c1d8f2eb Wing editor no longer allows invalid values for wave treshold 2016-03-28 12:38:48 +02:00
Bernard Vervaet 20c5a86dcb Clarified a warning message about wave tresholds (Mantis 3153) 2016-03-28 00:11:29 +02:00
m!m ccc616fec3 Merge pull request #568 from niffiwan/bugfix/cleanup_weapon_model_unload
Cleanup weapon_info when models are unloaded
2016-03-27 15:21:18 +02:00
niffiwan 07284cf221 Cleanup weapon_info when models are unloaded
Avoids the assertions at model/modelread.cpp:3062
ASSERTION FAILED: "Polygon_models[num]->id == model_num" (etc)
2016-03-27 17:04:14 +10:00
Fabian Woltermann 2b4d08e842 Merge pull request #565 from chief1983/xcode_73_upgrade
[xcode_73_upgrade] Apply some recommended project file changes
2016-03-25 14:18:00 +01:00
Fabian Woltermann 1e3857e385 Merge pull request #567 from Yarn366/fix_shadow_tech_room
Fixed ship position in ship database
2016-03-25 14:17:25 +01:00
Yarn366 8635a8b537 Fixed ship position in ship database 2016-03-24 22:07:13 -04:00
MageKing17 762691c78f Merge pull request #566 from ln-zookeeper/master
Fix for Mantis 3170
2016-03-23 15:53:30 -07:00
Lari Nieminen f8cb347a62 Fix for Mantis 3170
Despite what the original report claims, the ship.cpp change described in it actually works.
2016-03-24 00:23:30 +02:00
Cliff Gordon 2d2df40efb [xcode_73_upgrade] Apply some recommended project file changes after Xcode 7.3 upgrade. 2016-03-23 13:15:51 -05:00
Cliff Gordon f0518514a3 Merge pull request #564 from asarium/ci/macosxFail
Make Travis build fail if one command fails
2016-03-23 12:53:25 -05:00
asarium 64104c19a8 Make Travis build fail if one command fails 2016-03-23 17:49:35 +01:00
Cliff Gordon 847521b012 Merge pull request #563 from asarium/fix/shaderOSX
Fix MacOSX compilation error
2016-03-23 11:47:56 -05:00
m!m e6d0f9f72a Fix MacOSX compilation error 2016-03-23 16:15:28 +01:00
MageKing17 1cd9d3fb04 Merge pull request #562 from asarium/cleanup/openglShaders
Clean up shader loading code a bit
2016-03-23 02:10:48 -07:00
asarium 6184ae6db6 Clean up shader loading code a bit 2016-03-22 17:38:42 +01:00
MageKing17 b270ad1bb9 Merge pull request #560 from Goober5000/dumb_rotation_tweak
fix the $dumb_rotate turn rate calculation to align with regular $rotate
2016-03-19 14:52:10 -07:00
Goober5000 fbc0c79973 fix the $dumb_rotate turn rate calculation to align with regular $rotate 2016-03-19 17:02:55 -04:00
Fabian Woltermann 559e56d8af Merge pull request #554 from asarium/antipodes_/prefPath
Unify config handling on all platforms
2016-03-18 10:17:48 +01:00
MageKing17 caf41665f4 Merge pull request #556 from MageKing17/bugfix/issue-347
Fix mission screen grid by changing the drawing of the lines.
2016-03-17 06:01:29 -07:00
MageKing17 90a2676f17 Fix mission screen grid by changing the drawing of the lines.
Instead of using the clipping plane, simply don't draw the grid below the scanline. Fixes issue #347.
2016-03-16 16:40:56 -07:00
MageKing17 5032d06964 Merge pull request #555 from asarium/fix/model_glsl
Fix flag file inconsistency
2016-03-16 16:15:33 -07:00
asarium f9f65b0795 Fix flag file inconsistency 2016-03-16 23:18:01 +01:00
asarium d55a054228 Fix some default section scoping issues 2016-03-16 20:16:16 +01:00
asarium 54cb475d30 Unify config handling on all platforms
This will use SDL_GetPrefPath to determine a suitable config directory which will be used for all runtime writing. Additionally all platforms will now use the configuration ini files, the Windows registry will be deprecated. For better compatibility with current installs there is a "legacy mode" which will work like the current install. It will be used as long as the launcher doesn't write the configuration file to the new location. Migrating old installs requires copying the existing pilot files to the new location and copying any existing configuration data.
2016-03-16 19:42:52 +01:00
Fabian Woltermann c9380f0091 Merge pull request #553 from niffiwan/cleanup/faster_debug_default_runtime_checks
Set Basic Runtime Checks to Default
2016-03-14 09:42:42 +01:00
niffiwan 033ba61588 Set Basic Runtime Checks to Default
Ref: https://randomascii.wordpress.com/2011/07/22/visual-c-debug-buildsfast-checks-cause-5x-slowdowns/
One option to speed up debug
2016-03-13 13:56:55 +10:00
Fabian Woltermann 09ce1f1846 Merge pull request #551 from asarium/fix/registry
Fix Windows Registry configuration
2016-03-12 15:02:07 +01:00
MageKing17 40d49eb17a Merge pull request #552 from asarium/antipodes_/sync
Sync Antipodes
2016-03-11 13:55:01 -08:00
asarium 6184136ffe Fix Windows Registry configuration 2016-03-11 12:41:59 +01:00
asarium 2d4d0081cd Merge branch 'master' into antipodes_/sync
Conflicts:
	code/cmdline/cmdline.cpp
	code/io/timer.cpp
	code/network/multi.cpp
	configure.ac
	projects/MSVC_2005/Fred2.vcproj
	projects/MSVC_2005/Freespace2.sln
	projects/MSVC_2005/Freespace2.vcproj
	projects/MSVC_2005/code.vcproj
	projects/MSVC_2008/Fred2.vcproj
	projects/MSVC_2008/Freespace2.doxproj
	projects/MSVC_2008/Freespace2.vcproj
	projects/MSVC_2008/code.vcproj
	projects/MSVC_2010/Fred2.vcxproj
	projects/MSVC_2012/Fred2.vcxproj
	projects/MSVC_2012/Freespace2.vcxproj
	projects/MSVC_2012/code.vcxproj
	projects/MSVC_2012/code.vcxproj.filters
	projects/Xcode4/FS2_Open.xcodeproj/project.pbxproj
	projects/Xcode4/Frameworks.tgz
	projects/Xcode4/Info.plist
2016-03-11 12:36:52 +01:00
MageKing17 e98fd0bab3 Merge pull request #549 from asarium/fix/fictionviewer
Add validation when parsing a file spec
2016-03-10 12:25:50 -08:00
asarium a1a8a53a65 Add validation when parsing a file spec
This issue was spotted by Taranis who encountered an assertion caused by
an empty file name. This check will make sure that every string parsed
as a file name will at least contain one character.
2016-03-10 18:33:43 +01:00
Cliff Gordon 38b51723e0 Automated 3.7.5 versioning commit 2016-03-10 10:09:20 -06:00
Fabian Woltermann dc708ccbbb Merge pull request #547 from Goober5000/game_level_seed
improve RNG seeding
2016-02-28 22:09:57 +01:00
Goober5000 5206220f5a simplify the random number seeding; don't seed the RNG for every mission in single player 2016-02-27 13:25:48 -05:00
Fabian Woltermann c049e7335b Merge pull request #535 from jg18/remove_ipx
Remove IPX support.
2016-02-27 00:18:39 +01:00
jg18 a05d19db6b Re-enable TCP/IPX selector buttons.
Re-enable the TCP selector button and unhide the IPX selector button.
Attempting to select IPX brings up a pop-up that IPX is no longer supported.
2016-02-25 10:28:50 -08:00
jg18 cb65ca8655 Revert changes to net_addr struct format.
Revert changes that were made to net_addr struct format in commit 220fa18.
The net_addr struct is now the same as it was in retail.
2016-02-25 10:28:49 -08:00
jg18 1adb64e39d Remove IPX support.
Remove support for the IPX protocol. The IPX selector button in the multi
options menu is now hidden, and the TCP button is disabled since there is no other option.
2016-02-25 10:28:49 -08:00
Fabian Woltermann 6c308037e8 Merge pull request #546 from SamuelCho/fred_outline_fix
Fixes ships in FRED only rendering wireframe instead of both wireframe and model when selected.
2016-02-25 09:25:39 +01:00
SamuelCho 706b3a7f5e Fixes ships in FRED only rendering wireframe instead of both wireframe and model when selected. 2016-02-24 23:32:57 -08:00
niffiwan 4c23cd0d00 Merge pull request #545 from asarium/fix/iamstupid
Fix some issues from my previous PRs
2016-02-22 21:40:10 +10:00
m!m 1fbeccd61e Merge pull request #544 from niffiwan/feature/bm_used
Add debug console command: bm_used
2016-02-22 12:24:49 +01:00
asarium 564fc9a680 Update commend to match updated code 2016-02-22 12:11:44 +01:00
asarium 688c514352 Actually dump opened files to log file 2016-02-22 12:10:46 +01:00
niffiwan acc57397e5 Add debug console command: bm_used
Reports how many bmpman slots are used, with subtotals for each image
type and EFFs broken down by sub-type
2016-02-22 18:49:57 +10:00
Fabian Woltermann e47884e0fb Merge pull request #543 from asarium/cleanup/graphics
Clean up the renderer interface
2016-02-22 09:12:41 +01:00
Fabian Woltermann 81bd363d6d Merge pull request #542 from asarium/feature/cfile_debugging
Add source tracking for cfiles
2016-02-21 23:34:51 +01:00
asarium 108d60330f Clean up the renderer interface 2016-02-21 23:24:01 +01:00
asarium 58575399f5 Add source tracking for cfiles 2016-02-21 22:34:37 +01:00
Fabian Woltermann 1253575a68 Merge pull request #540 from asarium/bmpman/loading
Move texture loading out of graphics code
2016-02-21 17:26:17 +01:00
asarium a1d46479d7 Remove -img2dds 2016-02-21 15:57:52 +01:00
asarium a4043fbf21 Improve Assertion message a bit 2016-02-21 15:40:18 +01:00
asarium 83b8361dcd Move texture loading out of graphics code
Currently the graphics code handles loading texture information and data
but that should be done by bmpman itself. I removed two graphics API
functions and added a new one which is called to notify the graphics
code that a texture has been loaded.
2016-02-21 15:40:18 +01:00
Fabian Woltermann be677937ae Merge pull request #541 from asarium/ci/unused_function
Disable unused function warnings in release mode
2016-02-21 15:39:24 +01:00
asarium aebdc6328b Disable unused function warnings in release mode 2016-02-21 12:10:30 +01:00
m!m 801b808764 Merge pull request #529 from MageKing17/bugfix/objcollide-speed-check
Don't assume non-turning weapons have a fixed velocity.
2016-02-14 15:04:08 +01:00
m!m 73d12d15a3 Merge pull request #532 from Goober5000/function_parameter_tweak
modify function headers as suggested in PR #530
2016-02-11 10:46:51 +01:00
Goober5000 c9a45c9fbd come on, Travis, stop halting after a single warning 2016-02-11 01:13:00 -05:00
Goober5000 ddd3a7d6fe resolve Travis warning 2016-02-11 00:50:20 -05:00
Goober5000 e302f0e456 convert the rest of the model instance functions to have model_instance_num parameters instead of object parameters 2016-02-10 23:23:44 -05:00
Fabian Woltermann 0ed147fb45 Merge pull request #533 from Yarn366/scale_gauges_fix
$Scale Gauges fix
2016-02-07 12:18:22 +01:00
Goober5000 da812f9433 modify the actual function calls 2016-02-06 18:05:33 -05:00
Yarn366 5e623d10b0 Moved the check for negative values in $Force Scaling Above so that $Scale Gauges can work properly 2016-02-06 16:40:08 -05:00
Goober5000 471c898df5 modify function headers as suggested in PR #530 2016-02-06 15:46:06 -05:00
MageKing17 4e9f5dc754 Merge pull request #531 from Goober5000/intrinsic_rotation_refactor
refactor of dumb_rotation to intrinsic_rotation
2016-02-05 11:00:28 -08:00
Goober5000 df41bbe172 refactor of dumb_rotation to intrinsic_rotation
This is a renaming of the Dumb_rotation infrastructure, which is now called Intrinsic_rotation.  Intrinsic rotations are automatically applied to submodels without the need for an associated subsystem.  Dumb rotations are now a type of intrinsic rotation, and look_at rotations will be added in a future PR.  The same code will handle both; the only difference is in how the intrinsic rotation is calculated.  (In the case of dumb-rotation, it is calculated the same way as normal rotation; in the case of look-at, it will be calculated using submodel_look_at.)
2016-02-05 12:40:55 -05:00
Cliff Gordon 617fd6a977 Merge pull request #519 from chief1983/project_removal_201601
Project removal 2016-01
2016-02-03 10:38:44 -06:00
MageKing17 54e052bc2f Don't assume non-turning weapons have a fixed velocity.
Somewhat related to PR #528, this changes the branch that assumes constant velocity from checking for an absence of the WIF_TURNS flag to checking for the presence of the PF_CONST_VEL flag (because non-turning weapons can be given an acceleration time).
2016-01-31 18:54:41 -08:00
Goober5000 17c6b7cd58 Merge pull request #528 from ln-zookeeper/master
Fixed $Acceleration Time not working right on non-homing secondaries
2016-01-31 16:45:29 -05:00
Lari Nieminen f12d2395dc Fixed $Acceleration Time not working right on non-homing secondaries 2016-01-31 23:27:52 +02:00
Goober5000 746fe56b32 Merge pull request #525 from asarium/cleanup/timer
Remove some unused code from timer.h/.cpp
2016-01-31 16:12:04 -05:00
Goober5000 ccd815f6a0 Merge pull request #521 from asarium/antipodes_/timerOverflow
Use the correct type for high resolution timers
2016-01-31 16:10:01 -05:00
MageKing17 a87af22357 Merge pull request #523 from asarium/fix/time
Change timestamp integer handling again
2016-01-29 16:34:15 -08:00
MageKing17 4179d95975 Merge pull request #524 from Goober5000/small_fixes
one small bugfix, one small comment tweak
2016-01-29 16:33:31 -08:00
asarium fc6bc3a1c6 Remove some unused code from timer.h/.cpp
The removed code has been replaced by the profiling subsystem.
2016-01-29 22:00:58 +01:00
Goober5000 5bcc89be3a one small bugfix, one small comment tweak
This fixes a bug where, when the skybox is changed after loading a new mission, it tries to delete its model instance which was already deleted in model_instance_free_all.  Setting the instance reference to -1 when the instance is freed fixes this.  (This is something that would typically be handled by the object_delete function, as it is for ship_delete, asteroid_delete, and weapon_delete, but there is no such equivalent for skyboxes.)

Since this is such a small PR, I decided to also include a stash where I restored a comment that was inadvertently deleted by Swifty's hud_lock variable scope fix PR.
2016-01-29 12:37:14 -05:00
asarium 54b2eddc14 Change timestamp integer handling again 2016-01-28 16:39:10 +01:00
Fabian Woltermann 7a7abe1b3b Merge pull request #522 from asarium/fix/time
Use integer math instead of floats for timestamps
2016-01-27 20:32:05 +01:00
Fabian Woltermann 75c69271a9 Merge pull request #520 from MageKing17/bugfix/object-recycling-errors
Fix object recycling errors
2016-01-27 20:31:20 +01:00
asarium 64c4e4d7b4 Use integer math instead of floats for timestamps 2016-01-27 15:34:37 +01:00
asarium 75625270c9 Use the correct type for high resolution timers 2016-01-27 14:27:46 +01:00
MageKing17 1159e66168 Avoid checking for combat music if the projectile's parent was recycled. 2016-01-27 01:25:46 -08:00
MageKing17 37a98b8cf8 Check B->parent_sig before checking B->parent in objcollide.cpp.
Could cause problems with recycled objects (specifically, I had a crash once because "Objects[B->parent].instance" was well over MAX_SHIPS due to being a weapon instead of a ship, causing the "Ships[Objects[B->parent].instance].team" reference to fail hard).
2016-01-26 23:59:23 -08:00
MageKing17 a5b705b2c1 Store debris damage type on the debris object itself.
If the Object that had been assigned to that particular debris's parent wound up getting recycled and used for something else, the code in shiphit.cpp would cause a crash as soon as that debris hit something. This would happen fairly reliably in cluttered missions like BP massive battle.
2016-01-26 23:36:24 -08:00
Goober5000 76b98684cc Merge pull request #512 from Goober5000/dumb_rotation_refactor
Dumb rotation refactor
2016-01-26 22:04:08 -05:00
Cliff Gordon aa0de45ddb Part C: Update references to these projects in the CI configs and other areas. 2016-01-26 16:51:28 -06:00
Cliff Gordon e6855a4153 Part B: Move Xcode4 project to Xcode. 2016-01-26 16:35:26 -06:00
Cliff Gordon f61b869c7f Part A: Remove 5 old crusty projects. 2016-01-26 16:34:57 -06:00
Goober5000 59d6a44db3 colons are redundant 2016-01-25 19:31:52 -05:00
MageKing17 8dc4030dbc Merge pull request #518 from Yarn366/hud_scale_limit
Hud scale limit (part 2)
2016-01-25 16:31:41 -08:00
Yarn366 882467cb5a Merge branch 'master' into hud_scale_limit 2016-01-25 17:14:59 -05:00
Yarn366 5b8410de98 Values of "Force Scaling Above" that are <= 0 are now handled in adjust_base_res rather than in gauge_load_common. (This fixes a bug that prevented this parameter from working properly under certain conditions.)
Also removed an erroneous plus sign in adjust_base_res.
2016-01-25 17:00:08 -05:00
m!m 79f3f08543 Merge pull request #500 from Yarn366/hud_scale_limit
Hud scale limit
2016-01-25 22:20:16 +01:00
Yarn366 1bd7160461 Remove parameters from gauge_settings constructor and change values after struct creation. 2016-01-25 15:13:17 -05:00
Yarn366 8464e1769f Use a constructor rather than a define to create a gauge settings struct. 2016-01-25 04:41:24 -05:00
MageKing17 32d3298646 Merge pull request #515 from asarium/antipodes_/s3tc
Fix s3tc texture loading
2016-01-25 01:40:16 -08:00
MageKing17 426bb7e160 Merge pull request #514 from asarium/antipodes_/fixMessage
Fix compilation errors in FRED
2016-01-25 01:26:27 -08:00
Goober5000 975e108841 further accommodation of the dumb-rotation movement type, including, finally, proper collision detection! 2016-01-25 01:29:51 -05:00
Goober5000 6d60bb1511 add some additional clarifying comments 2016-01-25 00:49:21 -05:00
Goober5000 28faa9e588 warn for dumb-rotation as well as regular rotation 2016-01-25 00:26:26 -05:00
Yarn366 3ccfbb6aac Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into hud_scale_limit 2016-01-24 23:26:19 -05:00
Goober5000 78ff02501b improve debug warning handling 2016-01-24 21:41:31 -05:00
Goober5000 165124267a Add model_instance handling for weapons, asteroids, and skyboxes 2016-01-24 21:28:43 -05:00
Goober5000 b9033ab2a2 fix Travis error 2016-01-24 19:00:04 -05:00
Goober5000 102efb192c some additional error handling 2016-01-24 17:55:13 -05:00
asarium 3db8e5476e Improve default value in scripting API 2016-01-24 23:18:51 +01:00
asarium dcf70d2427 Fix VS 2010/2012 compilation 2016-01-24 23:18:50 +01:00
asarium 6c28b1afb9 Add grab argument for setCursorHidden
This should be used when hiding the cursor while in game.
2016-01-24 23:18:49 +01:00
asarium 0ecb7873e7 Doxygen documentation 2016-01-24 23:18:48 +01:00
asarium 498d0dcd1f Don't set the cursor state every frame
There might still be some issues where the code assumes that the cursor state is set every frame.
2016-01-24 23:18:48 +01:00
asarium 907791498a Fix lua documentation 2016-01-24 23:18:46 +01:00
asarium d1af182c61 Remove LuaError when the cursor fails to load
That should be handled by the script calling that function
2016-01-24 23:18:45 +01:00
asarium 328bb2494a Clean up CursorManager memory management 2016-01-24 23:18:44 +01:00
asarium 95c88cd62d Fix compilation errors in FRED 2016-01-24 23:17:19 +01:00
asarium 3b1fc36caf Fix s3tc texture loading
force_s3tc_enable needs to be set before SDL_InitSubSystem
2016-01-24 23:16:28 +01:00
MageKing17 952e277839 Merge pull request #513 from asarium/antipodes_/sync
Sync Antipodes
2016-01-24 14:10:23 -08:00
MageKing17 da7ec6db4d Merge pull request #463 from niffiwan/feature/cm_decoy_once_alt
Allow countermeasures to decoy missiles once only (alternate solution)
2016-01-24 14:08:02 -08:00
asarium 4a869b8ec3 Merge branch 'master' into antipodes_/sync 2016-01-24 21:20:18 +01:00
Cliff Gordon e36b5398ef Merge pull request #516 from asarium/ci/generic
Use generic architecture for Travis CI
2016-01-24 12:29:14 -06:00
asarium 335cc4a114 Use generic architecture by default 2016-01-24 14:31:13 +01:00
Goober5000 4b05468f3c update comment with a small clarification, add an assertion that the function contract is being followed, and fix an incipient bug by adding a necessary is_ship flag 2016-01-20 14:44:45 -05:00
asarium 77e832d3c9 Merge branch 'master' into antipodes_/sync
Conflicts:
	code/cmdline/cmdline.cpp
	code/cmdline/cmdline.h
2016-01-20 17:56:12 +01:00
Goober5000 26a500bf7c address warnings flagged by Travis 2016-01-19 22:18:09 -05:00
Goober5000 81ad6dc1b5 remove a field that is now redundant 2016-01-05 01:04:46 -05:00
Goober5000 025c58c679 fix const-correctness due to Swifty's change 2016-01-05 00:56:51 -05:00
Goober5000 bb93319871 small update due to changed API 2016-01-04 23:34:30 -05:00
Goober5000 8f224a76a4 incorporate turning rate 2016-01-04 23:34:30 -05:00
Goober5000 a640015afc tweak the creation of dumb_rotate instances; move the check for can_move below look_at and dumb_rotate 2016-01-04 23:34:29 -05:00
Goober5000 82807f2760 delete dumb rotations when we delete the associated instance 2016-01-04 23:34:29 -05:00
Goober5000 97924c0628 Add data structures and the hook to create the dumb rotations when model instances are created. This might be sufficient to get dumb rotations working for ships. 2016-01-04 23:34:28 -05:00
Goober5000 680ac9175f move the two dumb_rotation iterations into one function (which calls a subfunction) in modelread.cpp, and add some descriptive commenting 2016-01-04 23:34:28 -05:00
Goober5000 e3c4f90287 first chunk of work to reimplementing dumb_rotate in a way that syncs with the rest of the model code 2016-01-04 23:34:27 -05:00
Goober5000 ed2bbc35eb Merge pull request #501 from SamuelCho/kill_ship_model_start
Killed the last vestiges of ship_model_start/stop.
2016-01-04 22:45:03 -05:00
Fabian Woltermann 23aa8cb18d Merge pull request #504 from niffiwan/fix/shield_hit_anim_duration
Allow shield hit animations to play to the end
2016-01-04 15:40:03 +01:00
Yarn366 af2725b2b7 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into hud_scale_limit 2016-01-04 03:58:12 -05:00
Yarn366 ca95a3c25d Changed default gauge settings from a function to a define 2016-01-04 03:57:13 -05:00
m!m a9b4be5928 Merge pull request #425 from Echelon9/fix/SHADER_MODEL-concept-removal
OpenGL: Refactor GLSL setup and remove DirectX Shader Model concept
2016-01-03 23:56:46 +01:00
Echelon9 7691c4905e Correct comment regarding glGetString(GL_SHADING_LANGUAGE_VERSION) 2016-01-03 16:33:05 -05:00
Echelon9 9bd4fb3ac7 Lift up FXAA shader GLSL version check to opengl_post_load_shader(), out of the GLSL shader compiler preprocessor stage. 2016-01-03 16:33:05 -05:00
Echelon9 49b5d9a3b7 Fix up the revert of 0345d09a513082d15b53b045471f3fe1e3621b9b 2016-01-03 16:33:04 -05:00
Echelon9 22f14d56ea Revert "GLSL: Provide a dynamic #version directive to the shaders, in line with OpenGL standards"
This reverts commit 0345d09a513082d15b53b045471f3fe1e3621b9b.
2016-01-03 16:33:04 -05:00
Echelon9 5f4568cc0e OpenGL: Correct typo in one use of the __VERSION__ predefined macro 2016-01-03 16:33:04 -05:00
Echelon9 39842e7115 OpenGL: Rely on predefined macro __VERSION__ in GLSL language specification, rather than rolling our own. This predefined macro has been a language feature in all GLSL versions we support. See Section 3.3 Preprocessor. 2016-01-03 16:33:04 -05:00
Echelon9 cb90d286e5 GLSL: Provide a dynamic #version directive to the shaders, in line with OpenGL standards 2016-01-03 16:33:04 -05:00
Echelon9 e4c98e8527 Remove final DirectX Shader Model concepts. OpenGL GLSL version supported by the driver can be directly queried, rather than a layer of abstraction through SM2, SM3 and SM4. Allows Use_GLSL to be removed following refactoring. 2016-01-03 16:33:04 -05:00
Echelon9 5d593f0df0 Plumb through is_minimum_GLSL_version() 2016-01-03 16:33:04 -05:00
Echelon9 a045e5d266 Refactor out -disable_glsl_model command line option, which is encoded in Use_GLSL internally 2016-01-03 16:33:04 -05:00
Echelon9 21b8e3bb52 Add helper function is_minimum_GLSL_version() 2016-01-03 16:33:04 -05:00
Echelon9 3aa671a211 Replace SHADER_MODEL with GLSL_VERSION 2016-01-03 16:33:04 -05:00
Echelon9 d3ce9874a7 DirectX Shader Model 4.0 is equivalent to GLSL version 3.30. Source: https://www.opengl.org/wiki/Detecting_the_Shader_Model 2016-01-03 16:33:04 -05:00
SamuelCho 1cfbc24fb9 Merge branch 'master' into kill_ship_model_start 2016-01-03 13:04:03 -08:00
SamuelCho 4a4486c9be Merge branch 'master' into kill_ship_model_start 2016-01-03 13:02:47 -08:00
Yarn366 a1caca08ab Merge branch 'master' into hud_scale_limit 2016-01-03 14:18:18 -05:00
niffiwan e32e21bcd0 Merge pull request #509 from SamuelCho/team_glow_alpha_channel
Only enable team glow colors if team color texture mask has an alpha channel.
2016-01-03 20:16:24 +10:00
Yarn366 3fd9b8f802 Fix the errors reported by AppVeyor and Travis CI (take 2) 2016-01-03 04:29:59 -05:00
Yarn366 890c607ad2 Fix the errors reported by AppVeyor and Travis CI (hopefully) 2016-01-03 03:56:13 -05:00
Yarn366 e2dac4b7b4 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into hud_scale_limit 2016-01-03 03:12:29 -05:00
Yarn366 3512fcc18e Changed the gauge loaders to accept a pointer to the new gauge_settings struct instead of a bunch of values. 2016-01-03 03:12:00 -05:00
SamuelCho f57e346eff Only enable team glow colors if team color texture mask has an alpha channel. 2016-01-02 16:47:28 -08:00
niffiwan 768e097c73 Merge pull request #508 from MageKing17/cleanup/stop-exporting-no_fps_capping
Stop exporting -no_fps_capping to the launcher.
2016-01-03 09:20:28 +10:00
MageKing17 b0115a5f80 Stop exporting -no_fps_capping to the launcher.
Given the number of unintended consequences that can result from use of this command-line flag, we should return to the pre-137eb7e4d4cb0f9c153d15bbcce847347aa3d716 behavior of not including it in the exe_params[] array; anyone who knows what it does and why we don't advertise it can still use it for testing purposes, but it should prevent the typical user from turning it on without knowing exactly what can go wrong.
2016-01-02 12:19:13 -08:00
niffiwan a23630346b Merge pull request #505 from DahBlount/Fix-for-Coverity-#1343617
Fix for coverity 1343617
2015-12-31 17:40:29 +10:00
DahBlount d4d805d6ca Move turret_enemy_objnum check further up in block and change to Assertion 2015-12-30 23:44:04 -07:00
niffiwan b147ea0a21 Merge pull request #506 from Karajorma/BUGFIX-RepeatCounts
Fix the issue with repeat counts first discovered on this thread http…
2015-12-30 21:47:27 +10:00
Karajorma 8a2eec5b4a Fix the issue with repeat counts first discovered on this thread http://www.hard-light.net/forums/index.php?topic=90763.msg1801379#msg1801379 2015-12-30 16:56:50 +08:00
niffiwan ee64b83aec Allow shield hit animations to play to the end
Previously they'd always stop at 75% complete, and it's probably just
luck that it worked correctly for ✌️
2015-12-28 14:55:54 +10:00
MageKing17 24b58db67f Merge pull request #479 from SamuelCho/hud_lock_fix_for_issue_456
My attempt to fix the HUD lock scoping issues raised by issue #456.
2015-12-25 22:52:40 -08:00
Samuel Cho 2ddee36007 Cleaned up HudGaugeLock::render() and removed hud_draw_diamond() since that's not being used. 2015-12-25 19:34:39 -08:00
Goober5000 7e9a798101 Merge pull request #503 from Goober5000/sf2_no_disabled_self_destruct
add no-disabled-self-destruct ship flag
2015-12-21 11:08:38 -05:00
Goober5000 542dc68df2 add to Ship_flag_names array 2015-12-21 00:56:51 -05:00
Goober5000 b1ac0876d4 add no-disabled-self-destruct ship flag
Normally, ships whose weapons or engines subsystems are destroyed will
self-destruct after 90 seconds if they are part of a wing (see
ai_maybe_self_destruct).  This adds a ship flag to prevent that from
happening.
2015-12-20 23:12:59 -05:00
Goober5000 7badc4dfd9 Merge pull request #476 from MageKing17/feature/weapon-bank-modular-compatibility
Modular tables now clear allowed weapons if +noreplace isn't specified.
2015-12-17 00:47:28 -05:00
niffiwan 036aae0ee2 Merge pull request #502 from SamuelCho/team_color_glows
Team color glows
2015-12-17 12:50:53 +10:00
SamuelCho 9cc70790c9 Save all the channels of the team mask, not just the red and green channels. 2015-12-16 00:57:12 -08:00
SamuelCho 7d392bd61c Adjust the blended glow color value by how much the team mask contributes to this fragment. 2015-12-16 00:44:58 -08:00
SamuelCho 1552e02a51 Added support for glowing team color textures. 2015-12-16 00:20:15 -08:00
Fabian Woltermann 175640d60a Merge pull request #492 from SamuelCho/faster_bmp_lookup
Changed bitmap_lookup to use ubyte instead of floats.
2015-12-16 06:39:50 +01:00
SamuelCho 6583066936 Don't reset lock rendering timers and switches unless we really need to. 2015-12-15 20:39:38 -08:00
MageKing17 3c564b3210 Merge pull request #494 from DahBlount/Share-Fire-Direction-Turret-Flag
Share fire direction turret flag
2015-12-15 12:48:53 -08:00
DahBlount 9b7ebff53a Change NULL to nullptr and change fighter beam flag comparison from > to != 2015-12-15 09:54:34 -07:00
DahBlount 1491d4a79a Create "share fire direction" subsystem flag 2015-12-15 09:54:32 -07:00
Fabian Woltermann d603c463af Merge pull request #499 from DahBlount/Final-Attempt-at-Fixing-Environment-Reflections
Fix environment reflection rotation issue
2015-12-15 15:12:27 +01:00
SamuelCho 3eb47c1867 ship_render() still needs to clear out miscellaneous per-draw model data. 2015-12-14 23:19:08 -08:00
SamuelCho 2db4bc37f2 Removed unused variable sii. 2015-12-14 00:06:16 -08:00
SamuelCho 0f0f6377d0 Killed the last vestiges of ship_model_start/stop. 2015-12-13 23:51:24 -08:00
Yarn366 8e7ad5f651 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into hud_scale_limit 2015-12-14 01:41:13 -05:00
DahBlount bade3c58eb Normalize the position vector used in environmental reflections 2015-12-13 15:03:31 -07:00
niffiwan d2c8943e96 Merge pull request #498 from asarium/antipodes_/sync
Sync Antipodes
2015-12-13 08:42:27 +10:00
asarium deade82a19 Merge branch 'master' into antipodes_/sync
Conflicts:
	configure.ac
2015-12-12 18:36:32 +01:00
m!m 85a36e6fd8 Merge pull request #496 from SamuelCho/missing_destroyed_subsys
Fixes missing destroyed submodels from the polymodel_instance rendering commit.
2015-12-09 22:26:42 +01:00
Samuel Cho 2deffc1156 Removed comment from model_set_instance that no longer describes SSF_NO_DISAPPEAR functionality. 2015-12-09 10:32:36 -08:00
Fabian Woltermann 82ae54a6e8 Merge pull request #495 from SamuelCho/no_lighting_fix
Restore SIF2_NO_LIGHTING functionality for ship_render().
2015-12-09 09:02:11 +01:00
SamuelCho 0062d2567a Fixes missing destroyed submodels from the polymodel_instance rendering commit. 2015-12-08 23:53:53 -08:00
SamuelCho 7972cad563 Restore SIF2_NO_LIGHTING functionality for ship_render(). 2015-12-08 20:06:27 -08:00
niffiwan c9cff48b95 Merge pull request #493 from ln-zookeeper/master
Fix a small glitch in shield icon alpha range
2015-12-08 22:49:09 +10:00
Lari Nieminen 8d0624b064 Fix a small glitch in shield icon alpha range
Calculates the alpha range using the actual number of shield segments instead of 4.
2015-12-08 14:08:34 +02:00
SamuelCho 236857ed37 Changed bitmap_lookup to use ubyte instead of floats for the color channels. Should make reading bitmaps faster. 2015-12-07 22:59:28 -08:00
MageKing17 fa57ea358a Merge pull request #444 from asarium/feature/benchmark
Add benchmark command line option
2015-12-07 02:28:15 -08:00
MageKing17 a7bf7c63de Merge pull request #490 from Goober5000/shipfx_little_explosions_fix
for model vertices, use the entire range of RAND_MAX, not the range divided by 32
2015-12-05 15:45:52 -08:00
Goober5000 81676b7d3f a few tweaks from the PR...
a) remove redundant (shadowing) polymodel *pm declaration
	b) end Warnings with \n
	c) remove no-longer-needed Asserts (they are handled by the Error check above)
2015-12-05 14:25:28 -05:00
Goober5000 e1e188a43c use the entire range of RAND_MAX, not the range divided by 32 2015-12-05 13:02:27 -05:00
Goober5000 47286d1af2 Merge pull request #483 from chief1983/fix/292_unused_functions
Wrap some unused functions in a diagnostic protection pragma
2015-12-04 21:08:55 -05:00
Yarn366 fa10977e77 Added parameters that allow HUD scaling to be disabled at lower resolutions and enabled at higher resolutions. 2015-12-03 20:06:06 -05:00
Fabian Woltermann aaa80dfa6f Merge pull request #486 from SamuelCho/model_instance_rendering
Allow model rendering code to use polymodel_instance.
2015-12-03 06:34:09 +01:00
SamuelCho 59fa7bd544 Remove superfluous line. 2015-12-02 19:08:59 -08:00
m!m 3c8b47ccfc Merge pull request #460 from MageKing17/feature/subsys-autorepair-when-disabled
Adds the ability for subsystems to repair themselves when disabled.
2015-12-02 21:37:20 +01:00
MageKing17 81d8d063c2 Un-cluttering the autorepair conditional by spreading it out a little.
Should hopefully be a bit more readable this way.
2015-12-02 12:11:20 -08:00
MageKing17 75471276fc Adds "don't autorepair if disabled" to blacklist a specific subsystem.
Obviously won't do anything if "repair disabled subsystems" ship flag isn't set. If both subsystem-specific flags get set at the same time, whichever one would be default behavior (based on the presence or absence of the ship-wide flag) gets removed and a Warning generated.
2015-12-02 08:29:04 -08:00
MageKing17 89d6031c79 Adds the ability for subsystems to repair themselves when disabled.
Can either be set for individual subsystems via the "autorepair if disabled" flag, or set for an entire ship via the "repair disabled subsystems" flag. It will, by necessity, only have an effect if the ship's "$Subsystem Repair Rate:" is a positive number.
2015-12-02 08:29:03 -08:00
MageKing17 551d64192c Merge pull request #481 from The-E/vm_vec_cleanup2
Cleanup in vecmat, aile 2
2015-12-02 08:18:37 -08:00
asarium 661678f693 Fix an issue identified by MageKing17 2015-12-02 17:07:53 +01:00
asarium 94ca29735c Quit when the end of the mission is reached 2015-12-02 17:03:54 +01:00
asarium 20f84c179a When benchmarking automatically accept pilot screen 2015-12-02 17:03:54 +01:00
asarium 5f622094af Add commandline option for benchmarking 2015-12-02 17:03:54 +01:00
SamuelCho 64ad950a80 Allow model rendering code to use polymodel_instance. Removes the reliance on ship_model_start/stop for rendering models. Also fix a bunch of oversights involving blown off models in the polymodel_instance code. 2015-12-01 23:53:24 -08:00
niffiwan a30937b041 Merge pull request #484 from chief1983/asan_flag
AddressSanitizer toggle flag for configure.ac
2015-12-02 13:17:18 +10:00
Cliff Gordon 764e1772b0 Remove the -Wno-unused-function hider. Should be able to fix these with this method if any more crop up on Linux. 2015-12-01 20:56:10 -06:00
Cliff Gordon ea549ab5a0 [fix/292_unused_functions] Mark rotate_z and accurate_square_root as unused. Last part of the issues in #292. 2015-12-01 20:56:06 -06:00
niffiwan af22ab34d3 Merge pull request #482 from chief1983/fix/187_debugging
Enhance an Assert to help track down how issue 187 could happen
2015-12-02 08:35:53 +10:00
chief1983 c8785dc093 [asan_flag] AddressSanitizer toggle flag for configure.ac. 2015-12-01 16:32:32 -06:00
Cliff Gordon 870ad9e3ae [fix/187_debugging] Enhance an Assert to help track down how issue 187 could happen. 2015-12-01 14:54:57 -06:00
The E 487f769064 Renaming vm_copy_transpose_matrix to vm_copy_transpose 2015-12-01 20:38:30 +01:00
The E 7604e82f05 Renaming vm_transpose_matrix to vm_transpose 2015-12-01 20:37:33 +01:00
The E e0defd287a Renaming vm_vec_crossprod to vm_vec_cross 2015-12-01 20:36:34 +01:00
The E a413255728 Renaming vm_vec_dotprod to vm_vec_dot 2015-12-01 20:35:47 +01:00
MageKing17 d6b0e9f566 Merge pull request #480 from The-E/mat_inverse_cleanup
Addressing a few small issues with PR 468
2015-12-01 07:35:31 -08:00
Fabian Woltermann 22e6de42a4 Remove comment here 2015-12-01 13:04:22 +01:00
Fabian Woltermann 9548002890 Removing code that has no place here 2015-12-01 11:39:28 +01:00
Fabian Woltermann 0334bd0c3b Addressing a few small issues with PR 468 2015-12-01 11:34:00 +01:00
Fabian Woltermann 12b98063fb Merge pull request #474 from Goober5000/hull_hit_soundfx_fix
retail sounds 36 and 37 should actually be converted to 3D
2015-12-01 11:06:37 +01:00
Fabian Woltermann 854bd5ba21 Merge pull request #468 from DahBlount/Fix-reflections-for-real
Final fix for reflections
2015-12-01 11:04:06 +01:00
DahBlount 096029a88d Add Doxygen comments and additional changes 2015-12-01 00:55:30 -07:00
SamuelCho d8ab39e261 This line in the HUD lock gauge wasn't supposed to be deleted. 2015-11-30 23:48:57 -08:00
DahBlount 02d15f36b7 Change a1d to a2d 2015-12-01 00:34:55 -07:00
SamuelCho 66c9e0c136 My attempt to fix the HUD lock scoping issues raised by issue #456. 2015-11-30 23:16:43 -08:00
DahBlount fb29b28113 Add function to invert matrix4 and change mview to GL_env_texture_matrix to properly setup environment maps. 2015-11-30 09:36:30 -07:00
DahBlount 3fa03fcda0 Fix ENVMAP vertex shader to use the inverse of gl_ModelViewMatrix 2015-11-30 09:36:29 -07:00
niffiwan 94130f8a9e Merge pull request #477 from asarium/antipodes_/sync
Sync Antipodes
2015-11-30 14:10:31 +10:00
Goober5000 cb8154a993 Merge pull request #478 from Yarn366/mantis/3096
Fix for Mantis 3096
2015-11-29 18:16:50 -05:00
Yarn366 a4f793e6dc Use the same FOV for everything in the main view, and apply the pi*(4/9) correction for ships to the briefing view. 2015-11-29 17:22:48 -05:00
asarium c43d177a72 Merge branch 'master' into antipodes_/sync
Conflicts:
	code/freespace2/freespace.cpp
	code/globalincs/pstypes.h
2015-11-29 13:29:04 +01:00
m!m e36e9ff879 Merge pull request #473 from rtoijala/unix_modlist
Unix modlist
2015-11-28 19:43:47 +01:00
Risto Toijala 3287ff6b3a unix mods: change error to warning
Ignore failure to open directories that the filesystem gave us.
There's nothing we can do about it.

Also improve missing mod warning.

Tiny style improvement.
2015-11-28 18:20:56 +02:00
Risto Toijala 81092417bd unix mods: use "." instead of full cwd path to avoid error condition 2015-11-28 18:19:50 +02:00
Risto Toijala 947deb8e12 unix mods: switch parent and dir for readability 2015-11-28 18:18:26 +02:00
MageKing17 bd1aa5e455 Modular tables now clear allowed weapons if +noreplace isn't specified.
This makes them behave more like ship flags and should bring them around towards how modders intuitively expect using a modular table to override a ship's allowed weapons to work.

Fixes Mantis 3176.
2015-11-28 06:53:23 -08:00
Goober5000 01e4741da6 Merge pull request #475 from Yarn366/background_editor_spinner_fix
Fix for spinners in background editor
2015-11-28 02:22:18 -05:00
Yarn366 37f4587230 Apply rounding to orientation values so that the spinners in the background editor work properly 2015-11-28 01:56:09 -05:00
Goober5000 e11f6904b4 retail sounds 36 and 37 should actually be converted to 3D 2015-11-28 00:27:27 -05:00
MageKing17 d74981b700 Merge pull request #471 from MageKing17/feature/escort-gauge-right-aligned-names
Add "Right-Align Ship Names:" option to HudGaugeEscort.
2015-11-27 18:24:24 -08:00
MageKing17 6df0a704f2 Add "Right-Align Ship Names:" option to HudGaugeEscort.
It allows the escort gauge to render with ship names right-aligned, as the name would suggest. Changed gr_force_fit_string() to return the width instead redundantly returning the (already modified in-place) string; nothing else actually cares about the return value, so secondary impact should be nonexistent.
2015-11-27 18:22:45 -08:00
Risto Toijala 0b84c18686 also accept backslashes as path separators on unix 2015-11-27 20:16:45 +02:00
Risto Toijala 7523669819 allow subfolders in mod paths 2015-11-27 20:16:45 +02:00
Risto Toijala b1b8ae9668 move unix modlist handling to function 2015-11-27 20:16:45 +02:00
Risto Toijala bddf438fb6 clean up unix mod handling 2015-11-27 20:16:45 +02:00
MageKing17 87d07c9597 Merge pull request #472 from ln-zookeeper/bm_unlock_unload_fixes
Fixes to some bm_unlock and bm_unload calls
2015-11-26 23:53:09 -08:00
Lari Nieminen 407a2356eb Fixed silly syntax error 2015-11-26 18:06:41 +02:00
Lari Nieminen 0c5e6c7281 Fixes to some bm_unlock and bm_unload calls
As requested in https://github.com/scp-fs2open/fs2open.github.com/pull/449/files#r45241401

Note that I also included the ref_count >= 1 check.
2015-11-26 16:35:23 +02:00
m!m 2bd78eee74 Merge pull request #464 from The-E/inline_vecmat_removal
Removing the _INLINE_VECMAT preprocessor define
2015-11-26 13:49:01 +01:00
niffiwan 256ba6f9f2 Remove proposed AI profiles flag
Make the new behaviour the default, the change to gameplay should be
minimal due to the 2-frame feature being by far the largest factor in
current countermeasure effectiveness
2015-11-26 18:57:36 +10:00
niffiwan 040c1f39da Merge pull request #469 from Yarn366/more_hud_table_options
Shivan Hunter's requested HUD table features
2015-11-25 21:07:28 +10:00
Yarn366 8f6bdcddeb Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into more_hud_table_options 2015-11-24 16:32:45 -05:00
m!m ed855e6e1c Merge pull request #467 from PeterMitsis/toolchain
Abstract toolchain capabilities
2015-11-24 09:57:32 +01:00
Yarn366 33c7c4eae9 Added "Radar Center Offsets:" and "Radar Size:" to the 2D and 3D radar gauges 2015-11-23 19:48:04 -05:00
Yarn366 962261421e Added "Dock Max Width:" and "Order Max Width:" to extra target data gauge 2015-11-23 18:29:40 -05:00
Yarn366 5144dba6b4 Added "Fixed Header Position:" to wingman gauge 2015-11-23 18:22:37 -05:00
Peter Mitsis 9bbebfc55e [fix] toolchain: Abstract compiler capabilities
Fixes various typos from the commit titled
    'toolchain: Abstract compiler capabilities'

Signed-off-by: Peter Mitsis <[email protected]>
2015-11-23 06:54:41 -05:00
MageKing17 02fc2b29ca Revert "Fix envmap orientation"
This reverts commit a033f653d0.
2015-11-23 00:20:55 -08:00
Fabian Woltermann b097d3e7c2 Merge pull request #466 from DahBlount/fix/mantis_0003014
Fix Mantis 0003014
2015-11-23 07:40:59 +01:00
DahBlount a033f653d0 Fix envmap orientation 2015-11-22 17:02:06 -07:00
The E 4b37433c4f Removing the _INLINE_VECMAT preprocessor define. This is something the compiler is better equipped to decide. 2015-11-22 21:00:24 +01:00
Peter Mitsis 002dc3a965 toolchain: Introduce __ALIGNED(x) macro
The __ALIGNED(x) macro may be used to tell the compiler to align the
symbol's address to an 'x' byte boundary.  Note that 'x' must be a
power of two.

Signed-off-by: Peter Mitsis <[email protected]>
2015-11-22 11:32:07 -05:00
Peter Mitsis 7da81210ea toolchain: Introduce likely() and unlikely() macros
The likely() and unlikely() macros may be used as hints to the compiler to
indicate whether a branch is likely or unlikely to be taken so that it may
generate code accordingly.

Signed-off-by: Peter Mitsis <[email protected]>
2015-11-22 11:32:07 -05:00
Peter Mitsis 57c16bd58a toolchain: Replace __attribute__((__unused__)) with __UNUSED
Abstracting this allows for the possibility of other compilers to have their
own implementation of marking a variable as potentially unused without using
the __attribute__ keyword (which is not supported on all compilers).

Signed-off-by: Peter Mitsis <[email protected]>
2015-11-22 11:32:07 -05:00
Peter Mitsis 13c86d9540 toolchain: Abstract compiler capabilities
Abstract compiler capabilities to help simplify support for various
toolchains.

Signed-off-by: Peter Mitsis <[email protected]>
2015-11-22 11:32:04 -05:00
niffiwan 338d6c9aaf Allow countermeasures to decoy missiles once only
Adds ai_profiles flag
    $countermeasures decoy a missile once:
Also (re)adds logging to make it easier to figure out what the
countermeasures are doing. Try adding "+countermeasures" to your
debug_filter.cfg file.
2015-11-22 20:36:03 +10:00
Goober5000 d59c4d44cc Merge pull request #461 from niffiwan/fix/cm_float_int
CMEASURE_DETONATE_DISTANCE should be a float
2015-11-21 14:32:05 -05:00
niffiwan 0e07f4414e CMEASURE_DETONATE_DISTANCE should be a float
Thanks to Goober5000 for noticing this
2015-11-21 21:18:08 +10:00
Fabian Woltermann 71cf169a0a Merge pull request #457 from asarium/feature/versionCheck
Add "$Minimum version" to game settings table
2015-11-21 11:08:13 +01:00
Fabian Woltermann 184a583a32 Merge pull request #459 from MageKing17/bugfix/support-subsystem-repair
Fix support subsystem repair rate (for real this time).
2015-11-20 17:24:47 +01:00
Fabian Woltermann fd66a432f5 Merge pull request #458 from MageKing17/cleanup/version-specific-comment-consistency
Improve consistency/flexibility of version-specific comments.
2015-11-20 17:23:47 +01:00
MageKing17 039359e7f2 Fix support subsystem repair rate (for real this time).
PR #445 was unfortunately incomplete; it fixed the time estimate for repairs, but not the actual repair part. I think I've identified which piece of code was preventing the actual repairs from working. This "repair_allocated > 0" conditional is actively preventing the "sip->sup_hull_repair_rate == 0.0f" branch from executing (so repair_allocated remains 0 and subsystems can't actually repair).
2015-11-20 06:50:49 -08:00
asarium 0bb6002f0a Fix compilation error
Apparently multi_update.cpp isn't used anywhere in the code. That file
could be removed in the future.
2015-11-20 12:24:10 +01:00
MageKing17 91dbf8b751 Improve consistency/flexibility of version-specific comments.
matches_version_specific_tag() now uses the previously-FRED-only scan_fso_version_string() function, meaning it now supports version-specific comments with as few numbers as ;;FSO 3;; to as many numbers as ;;FSO 3.7.3.20151106;;, instead of you being required to supply exactly 3 numbers.
2015-11-20 03:22:45 -08:00
Fabian Woltermann 0c6bada5d5 Merge pull request #455 from Goober5000/set_arrival_info_sexp_help_tweak
improve sexp help regarding bitmasks on ship-arrival-info and ship-departure-info
2015-11-20 12:10:59 +01:00
asarium 519e89b6fa Add "$Minimum version" to game settings table
This allows a modder to specify a minimum FSO version that is needed
for the mod.
2015-11-20 11:51:51 +01:00
Goober5000 ce7c7eb3f5 Merge pull request #454 from MageKing17/bugfix/lua-wing-indexer-crash
Fix various issues with wings in the Lua interface
2015-11-20 01:31:39 -05:00
Goober5000 8f3342f05e improve sexp help regarding bitmasks on ship-arrival-info and ship-departure-info 2015-11-20 00:41:46 -05:00
MageKing17 6dd3158570 Make l_Wing functions handle invalid handles.
Indexing an invalid wing handle now returns invalid ship handles, getting its length returns 0, and getting its name returns an empty string.
2015-11-19 20:27:32 -08:00
MageKing17 004fdae08f Clean up a couple minor issues in lua.cpp
A few comparisons weren't excluding their upper bounds properly, and the documentation for the l_Wing length function was the documentation for the l_Mission_Wings length function.
2015-11-19 20:20:47 -08:00
MageKing17 8fcb1ee789 Add isValid() function to l_Wing objects.
The l_Mission_Wings indexer will return an invalid wing if supplied an invalid name/index. However, you had no way of telling that this was the case because there was no isValid() function to test its validity.
2015-11-19 20:18:31 -08:00
MageKing17 9630d80827 Change wing_name_lookup() to wing_lookup() in l_Mission_Wings indexer.
Avoids inconsistency whereby some wings could be looked up by index but not by name.
2015-11-19 20:16:37 -08:00
niffiwan e49159bd91 Merge pull request #418 from asarium/build/native
Use -march=native for linux builds
2015-11-20 14:10:44 +10:00
niffiwan a13542616d Merge pull request #452 from MageKing17/bugfix/too-many-classes-error
Change warning from too many ship/weapon classes to an error.
2015-11-20 14:09:28 +10:00
Fabian Woltermann 1960723f88 Merge pull request #453 from Yarn366/target_font_height_fix
Target bracket line height fix
2015-11-19 22:54:17 +01:00
asarium 206fbabaa5 Use -march=native for linux builds 2015-11-19 22:38:19 +01:00
MageKing17 5394b4943d Change warning from too many ship/weapon classes to an error.
If a modular table broke the weapons limit, it would warn about too many weapon classes, and then not actually skip the entry, because of the "if(!replace)" conditional around it, resulting in nonsensical parsing errors. Rather than just fix this error, it was suggested on IRC (by The_E) that these problems should instead cause immediate errors. Upon reflection, this makes more sense: if the mod exceeds the limits, there's little point in loading it anyway and having things be missing.

Hopefully, eventually, these limits will be removed altogether, but until then, exceeding them should not just be a dismissible warning.
2015-11-19 12:37:45 -08:00
Yarn366 69f9d9f090 Make the target bracket gauge account for the sizes of the font and the attacker blip 2015-11-19 15:35:31 -05:00
niffiwan 1cb08e0262 Merge pull request #450 from asarium/fix/subModelRange
Make this Assert a little more informative
2015-11-19 07:07:09 +10:00
asarium 154a50028b Make this Assert a little more informative 2015-11-18 18:43:19 +01:00
niffiwan 26d97ce5d7 Merge pull request #446 from asarium/antipodes_/deleteOldFiles
Remove some now unused files
2015-11-18 09:40:11 +10:00
niffiwan e11771980e Merge pull request #447 from MageKing17/bugfix/fred-message-delete-assert
Fix incorrect assertion in FRED's Event Editor when deleting a message.
2015-11-18 09:39:35 +10:00
MageKing17 edbec0fca9 Fix incorrect assertion in FRED's Event Editor when deleting a message.
The function can get called with an m_cur_msg of -1 if there are no messages defined by the mission; since this is apparently intended behavior (and causes no problems thanks to the immediately-following if-statement), may as well change this assertion.
2015-11-17 14:08:38 -08:00
asarium f2cbb687b7 Remove some now unused files 2015-11-17 16:05:21 +01:00
m!m 2c268e4ec6 Merge pull request #437 from niffiwan/feature/aspect_lost_lock_det
Allow aspect missiles to die when have lost lock
2015-11-16 20:10:42 +01:00
m!m 2a9cff4f46 Merge pull request #443 from DahBlount/InBriefMissionChange
Add jumpToMission LUA function and a jump to hub function
2015-11-16 19:58:34 +01:00
DahBlount 9050c08bec Add jumpToMission LUA function and a jump to hub function
The purpose of this function is to provide modders the capability to jump to a mission using LUA scripts. There is an optional argument for jumping to a hub mission, a good example is the JAD campaign map.
2015-11-16 10:45:59 -07:00
Goober5000 799ebe01ce Merge pull request #445 from DahBlount/Subsys-Repair-Fix
Fix support subsystem repair rate
2015-11-15 20:26:18 -05:00
DahBlount 248c398ba9 Fix support subsystem repair rate 2015-11-15 17:44:26 -07:00
Goober5000 96ede6f68b Merge pull request #433 from Yarn366/multiple_background_adjustment
Change criteria for using second mission background
2015-11-15 01:07:53 -05:00
Goober5000 8177c03f3f Merge pull request #423 from niffiwan/feature/customise_cm_det_rad
Add two small countermeasure features
2015-11-15 01:01:39 -05:00
m!m 546339c53a Merge pull request #440 from The-E/no_persona_defaulting
small error correction
2015-11-14 23:20:14 +01:00
The E f790b3b0c6 small error correction 2015-11-14 23:13:32 +01:00
m!m bbcfe162da Merge pull request #439 from The-E/no_persona_defaulting
Adds Persona flag "$Allow substitution of missing messages:"
2015-11-14 15:54:44 +01:00
m!m 51efc000ab Merge pull request #435 from PeterMitsis/lighting-apply-keywords
Lighting apply keywords
2015-11-14 14:35:57 +01:00
The E cbad1cf10f Addressing style comments 2015-11-14 13:30:51 +01:00
Peter Mitsis 56343f0d03 lighting: remove void keyword from empty argument list
Routines in the lighting module that do not have any arguments do not
need the 'void' keyword in either their definitions or declarations.

Signed-off-by: Peter Mitsis <[email protected]>
2015-11-14 07:08:52 -05:00
The E 67d51037ff Adds Persona flag "$Allow substitution of missing messages:" 2015-11-14 12:55:41 +01:00
Goober5000 9bd51acb58 Merge pull request #430 from niffiwan/ant-uk_backslash
Fix issue with backslash on UK keyboards
2015-11-14 00:18:18 -05:00
Goober5000 47d82a007f Merge pull request #434 from asarium/multi/staticAssert
Check the size of data in multi packets
2015-11-13 21:20:44 -05:00
m!m 036000f79c Merge pull request #438 from DahBlount/Damage-Attenuation-Update
Deprecate +Min Damage and +Max Damage, add +Attenuation Damage:
2015-11-13 21:51:58 +01:00
DahBlount 3e6fb113ee Deprecate +Min Damage and +Max Damage, add +Attenuation Damage: 2015-11-13 12:26:04 -07:00
MageKing17 515f9fffb5 Merge pull request #431 from The-E/more_ship_classes
Upped MAX_SHIP_CLASSES to 500
2015-11-13 07:13:21 -08:00
asarium 28c9512727 Fix compilation
Now the static_asserts use the types from cstdint
2015-11-13 11:52:52 +01:00
Fabian Woltermann e9a3e457cc Merge pull request #426 from Yarn366/events_editor_filename_fix
Fix for crash in events editor
2015-11-12 19:27:17 +01:00
Fabian Woltermann 3637a9717c Merge pull request #427 from DahBlount/Directional-Beam-Glows
Directional beam glows
2015-11-12 19:26:27 +01:00
niffiwan ed6637031d Allow aspect missiles to die when have lost lock
Note that aspect missiles don't lose lock when their target dies, I'll
see about adding that later
2015-11-12 19:09:59 +10:00
Peter Mitsis f5ccad9619 lighting: Apply keywords
Applies the following keywords to the lighting module:
   const
   static
   void
   extern

Signed-off-by: Peter Mitsis <[email protected]>
2015-11-11 11:20:01 -05:00
Peter Mitsis b10de88cf0 lighting: Remove unused global variables
The following global variables from the lighting module were unused
and are being removed:
	int cell_shaded_lightmap = -1;
	int spec = 0;

Signed-off-by: Peter Mitsis <[email protected]>
2015-11-11 11:20:01 -05:00
asarium 34a7f7d60f Check the size of data in multi packets
This will make sure that compiler changes that affect the size of a
type are noticed early.
2015-11-11 14:56:14 +01:00
niffiwan 1b9892f363 Remove obsolete comment 2015-11-11 22:16:35 +10:00
Yarn366 9d6b373781 Undid the function name changes 2015-11-10 23:22:34 -05:00
Yarn366 05eb4c0617 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into multiple_background_adjustment 2015-11-10 19:51:08 -05:00
Yarn366 320fd33431 If even one element in the first mission background is missing, fall back to the second background if it exists 2015-11-10 19:48:54 -05:00
niffiwan 22832957f3 Merge pull request #432 from MageKing17/bugfix/ship-turret-target-order
Fix ship-turret-target-order.
2015-11-11 09:26:38 +10:00
MageKing17 dba2d28265 Fix ship-turret-target-order.
We were declaring an array of NUM_TURRET_ORDER_TYPES ints, and then only specifying the first oindex of them; the memcpy() could've been changed to multiply by oindex instead, but it seemed cleaner to just reset new_target_order to -1 in all values and get rid of the redundant per-ship reset.

Discovered by triggering an Int3() in aiturret.cpp (line 1167 as of this writing) and finding uninitialized values in the turret_targeting_order array.
2015-11-10 14:55:55 -08:00
The E 647f6a867b Upped MAX_SHIP_CLASSES to 500 2015-11-10 15:55:46 +01:00
niffiwan c7866a774a Fix issue with backslash on UK keyboards 2015-11-10 17:45:35 +10:00
DahBlount 89d072e18c Add +Directonal Glow:
This goes directly below +Muzzleglow: in $Beam Info: and causes the muzzle glow to be rendered along a projected poly instead of a bitmap.
Takes a float argument that is the length of the glow.
2015-11-09 14:28:40 -07:00
Yarn366 b1e7a2a1bf Don't add an extension to a sound's file name if the extension is supposed to be present already 2015-11-09 00:31:40 -05:00
niffiwan 4849f443aa Missed two places to use killer_infop 2015-11-08 14:51:04 +10:00
niffiwan aff81fe471 Countermeasures can detonate a single missile
As opposed to detonating all missiles within a radius. Is more
efficient than previous code that traversed the entire missile object
list to find all the missiles to detonate

Add to weapons tbl/tbm
$Countermeasure:
    +Single Missile Kill:   False
2015-11-08 14:42:29 +10:00
niffiwan 26d40553b2 Allow countermeasure kill-distance to be moddable
Trivial efficiency improvement by calculating a pointer once & reusing
it. Add more countermeasure nprintf messages

Add to weapons tbl/tbm
$Countermeasure:
    +Missile Detonation Radius: 40
2015-11-08 14:41:40 +10:00
MageKing17 f876b89c24 Merge pull request #422 from niffiwan/cleanup/subsys_path_assert
Change Assert to Error
2015-11-07 20:20:40 -08:00
niffiwan 2c8d921d64 Change Assert to Error
This seems to be a data error rather than a coding error. Also provide
the user with more info to assist with tracking down the source of the
problem.
2015-11-08 13:04:13 +10:00
Fabian Woltermann fc52668f30 Merge pull request #421 from Echelon9/fix/gr_opengl_init
Small tweaks to gr_opengl_init()
2015-11-07 14:35:13 +01:00
Echelon9 97c5a29b76 Better wrap to 80 character lines where sensible in gr_opengl_init() 2015-11-07 23:17:42 +11:00
Echelon9 fa9bd1c446 Whitespace clean up 2015-11-07 23:17:42 +11:00
Echelon9 04352920ee Export opengl_tnl_init(), so that it doesn't need to be extern'd. Consistent with opengl_tnl_shutdown() 2015-11-07 23:17:42 +11:00
Echelon9 8111924f9b OpenGL: Use the Core rather than older Extension form of GL_MAX_TEXTURE_IMAGE_UNITS 2015-11-07 23:17:42 +11:00
Echelon9 a11c69673e Const correctness for ver in gr_opengl_init() 2015-11-07 23:17:42 +11:00
MageKing17 ee730d23c9 Merge pull request #420 from Echelon9/fix/GL_SHADING_LANGUAGE_VERSION
Use the Core rather than older Extension form of GL_SHADING_LANGUAGE_VERSION
2015-11-07 04:07:29 -08:00
Echelon9 0b61d0bd8e OpenGL: Use the Core rather than older Extension form of GL_SHADING_LANGUAGE_VERSION. 2015-11-07 21:52:43 +11:00
Fabian Woltermann 0fcde305ec Merge pull request #419 from Echelon9/fix/GLSL4-sample-keyword
OpenGL: As of GLSL 4.00 'sample' is a keyword
2015-11-07 08:21:42 +01:00
Echelon9 697c900a25 OpenGL: As of GLSL 4.00 'sample' is a keyword. See further Section 3.6 Keywords https://www.opengl.org/registry/doc/GLSLangSpec.4.00.7.pdf 2015-11-07 14:44:06 +11:00
m!m fbc9ede423 Merge pull request #398 from Goober5000/g3_const
const-correctness inspired by #392, because why not be masochistic
2015-11-06 16:51:32 +01:00
m!m 0f36c6905d Merge pull request #417 from niffiwan/shadows_default_off
Disable shadows by default
2015-11-05 23:15:19 +01:00
niffiwan 1d66596bfb Disable shadows by default
Enable shadows with -enable_shadows
-shadow_quality should still work
2015-11-06 07:59:03 +10:00
Fabian Woltermann 444874b110 Merge pull request #416 from Goober5000/shipfx_shadow_function_retval_tweaks
change these functions to return bool rather than int; fixes a minor warning
2015-11-05 17:35:02 +01:00
Goober5000 b704050c21 change these functions to return bool rather than int; fixes a minor warning 2015-11-05 00:36:06 -05:00
MageKing17 5676dbf9bd Merge pull request #414 from Goober5000/issue_412_fix
properly close the fiction viewer when returning to the main menu
2015-11-04 03:04:09 -08:00
Goober5000 564f31aeab properly close the fiction viewer when returning to the main menu 2015-11-04 00:54:02 -05:00
niffiwan 0ea25e79a9 Merge pull request #411 from The-E/sexp_profiling
Profiling support for mission events and scripts
2015-11-03 22:32:51 +10:00
The E 5a37992d3d Adds profiling for sexp events and lua On Frame scripts. 2015-11-03 13:10:07 +01:00
Fabian Woltermann 3ade9ae1de Merge pull request #389 from Goober5000/shipfx_eye_in_shadow_alt_pr
Alternative suggested PR to #384
2015-11-02 09:51:17 +01:00
Fabian Woltermann f2aea8e69d Merge pull request #410 from niffiwan/valgrind/ds_load_buffer
Fix memory leak in ds_load_buffer
2015-11-02 09:50:08 +01:00
niffiwan 5c74720265 Fix memory leak in ds_load_buffer 2015-11-01 19:33:10 +10:00
niffiwan 556e9a4447 Merge pull request #404 from Yarn366/scalable_head_anis
Scalable head ANIs
2015-11-01 15:41:42 +10:00
MageKing17 f48a31c610 Merge pull request #409 from asarium/antipodes_/sync
Sync Antipodes
2015-10-31 15:10:25 -07:00
Goober5000 1bd8e11194 Merge pull request #401 from niffiwan/fix/missionparse_ammo_II
Guard against negative array index reads
2015-10-31 15:08:49 -04:00
asarium 5f23381c07 Merge branch 'master' into antipodes_/sync
Conflicts:
	code/cmdline/cmdline.cpp
	code/globalincs/pstypes.h
	code/globalincs/windebug.cpp
	code/graphics/2d.cpp
	code/windows_stub/stubs.cpp
2015-10-31 17:18:29 +01:00
m!m bfc34953eb Merge pull request #408 from niffiwan/coverity/modeling_update
Model Assert/Assertion as Coverity killpaths
2015-10-31 11:46:11 +01:00
niffiwan 1c84c54e4f Model Assert/Assertion as Coverity killpaths 2015-10-31 20:17:12 +10:00
Goober5000 d790301fab Merge pull request #407 from niffiwan/valgrind/control_configs
Fix memory leak from Control_config_presets
2015-10-31 00:31:09 -04:00
niffiwan 253d8a7eb1 Fix memory leak from Control_config_presets 2015-10-31 14:06:56 +10:00
Goober5000 dc3c5fb561 Merge pull request #406 from niffiwan/travis/fix_cov_scan_builds
Fix coverity_scan builds
2015-10-30 23:39:59 -04:00
niffiwan eb1ff0f433 Fix coverity_scan builds
i.e. they should be building debug, not release
2015-10-31 12:51:33 +10:00
Fabian Woltermann 30564248a6 Merge pull request #405 from niffiwan/valgrind/camera_leak
Fix memory leak in cam_create/cam_close
2015-10-30 16:45:06 +01:00
niffiwan 9dfa67b64d Correctly compare vector .end() 2015-10-30 22:01:06 +10:00
Yarn366 c3c7477114 Made head animations scale to the size of the gauge window. Also deprecated "Animation Background Size" parameter and added the more accurately named "Animation Size" parameter, which sets how large animations should be. 2015-10-29 14:35:08 -04:00
Goober5000 bbad1c2159 more const-correctness per PR comments 2015-10-29 09:34:18 -04:00
niffiwan bb6e01caaf Merge pull request #403 from Yarn366/sparky_hi_fallback_fix
Sparky hi fallback fix
2015-10-29 19:05:07 +10:00
Yarn366 fc941e9ca8 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into sparky_hi_fallback_fix 2015-10-28 18:26:49 -04:00
Yarn366 93e8e3ab6f Resolutions below 1024x600 are no longer changed to 800x600 if sparky_hi_fs2.vp is missing.
In addition, the gr_get_resolution_class function has been added to avoid duplication of its code.
2015-10-28 18:21:31 -04:00
Goober5000 14eec21c68 Merge pull request #384 from The-E/mc_info_constructor
Better handling for mc_info
2015-10-28 08:48:57 -04:00
niffiwan 1ceae13be2 Guard against negative array index reads
Also convert Assert to Assertion to provide more info
2015-10-28 21:53:57 +10:00
niffiwan fb20632b18 Fix memory leak in cam_create/cam_close 2015-10-28 21:26:00 +10:00
niffiwan 62fcbeaae8 Merge pull request #380 from Goober5000/wf_never_existed_removal
remove WF_NEVER_EXISTED
2015-10-28 19:35:46 +10:00
niffiwan 4250751ccc Merge pull request #393 from Goober5000/convert_qsort_to_std_sort
convert qsort to std::sort
2015-10-28 19:33:12 +10:00
Fabian Woltermann 0a08b6348b Revert "Removes inline keyword from mc_info_init declaration"
This reverts commit c789b117cf.
2015-10-28 09:19:21 +01:00
Fabian Woltermann c789b117cf Removes inline keyword from mc_info_init declaration 2015-10-28 08:54:03 +01:00
niffiwan cc84210ac4 Merge pull request #399 from Goober5000/const_cast_trimming
remove obsolete const_casts
2015-10-28 17:13:36 +10:00
Goober5000 8a125ab019 remove obsolete const_casts 2015-10-28 00:18:31 -04:00
Goober5000 a7dcda9000 wip to avoid const_cast 2015-10-28 00:02:35 -04:00
Goober5000 bfc0948f1c let's change this antipattern here too 2015-10-27 22:52:03 -04:00
Goober5000 75411d92bb const-correctness inspired by 392, because why not be masochistic 2015-10-27 22:46:35 -04:00
MageKing17 afe29c60fe Merge pull request #392 from DahBlount/CLoseup-zoom-testing
Fix Closeup_Pos and Closeup_Zoom
2015-10-27 17:16:50 -07:00
m!m b0befdc1ba Merge pull request #397 from MageKing17/bugfix/issue-396
Restore local SSM behavior.
2015-10-27 22:55:39 +01:00
DahBlount 51c61b5144 Change closeup_pos in draw_model_icon() to a pointer 2015-10-27 15:51:45 -06:00
DahBlount 6cf105b768 Fix Closeup_Pos and Closeup_Zoom
The draw_model_rotating() and draw_model_icon() functions were receiving
the whole Weapon_Info array instead of a single weapon_info object (wip
in this case).
2015-10-27 15:51:44 -06:00
MageKing17 5fd09f8557 Restore local SSM behavior broken by 88e7c83. Fixes issue #396.
Not sure how I missed that when reviewing the PR, but there you go.
2015-10-27 14:48:21 -07:00
Fabian Woltermann 630ab5a3cc Makes sure mc_info_init sets everything to safe data. 2015-10-27 08:24:06 +01:00
Fabian Woltermann e28640ded0 Revert "Introduces a proper constructor for mc_info and removes the mc_info_init function on grounds of grave misuse of memset."
This reverts commit 35e34ac97c.
2015-10-27 08:15:45 +01:00
m!m 3708f101b4 Merge pull request #394 from niffiwan/valgrind/csg_read_missions
Fix memory leaks in mission_campaign_load
2015-10-26 23:15:24 +01:00
m!m 332b9fa4a4 Merge pull request #395 from The-E/debug_sexp_fix
Fix the debug sexp
2015-10-26 23:07:03 +01:00
The E e6aa565b42 Name change as suggested by m|m 2015-10-26 20:31:24 +01:00
The E 788e28c646 Creates a new variant of Warning that is not #ifdefed out on release to make the debug sexp work as its description implies 2015-10-26 19:47:51 +01:00
Goober5000 6ccf4116fc Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into wf_never_existed_removal 2015-10-26 02:27:10 -04:00
Goober5000 c4240324fb the comment really shouldn't have changed from the original retail '// if the current wave is zero, it never existed', because it illuminates the thought process behind the code 2015-10-26 02:26:51 -04:00
niffiwan 4fc2d9c610 Fix memory leaks in mission_campaign_load 2015-10-26 13:49:21 +10:00
Goober5000 ccc71a8e8b looks like we'll need them in these three other files too 2015-10-25 21:20:57 -04:00
Goober5000 7dde0a79a7 that was just dumb 2015-10-25 21:14:08 -04:00
Goober5000 e895f86e44 come on, Travis 2015-10-25 20:48:02 -04:00
Goober5000 31e9a0dd7d more linux compatibility 2015-10-25 20:23:26 -04:00
Goober5000 505de1b905 linux compatibility 2015-10-25 19:51:50 -04:00
Goober5000 b82d0c579d convert qsort to std::sort 2015-10-25 19:16:36 -04:00
niffiwan 68d2e5f0eb Merge pull request #391 from Goober5000/fred_completion_music_text_tweak
tweak the FRED and wxFRED dialog text to match the action
2015-10-26 08:46:33 +10:00
Goober5000 3c4861859b tweak the FRED and wxFRED dialog text to match the action 2015-10-25 16:33:28 -04:00
Fabian Woltermann 8ab5cd3085 Merge pull request #390 from Goober5000/game_sunspot_process_tweak
small optimization of shadow checks
2015-10-24 21:51:18 +02:00
Goober5000 eaa09dd862 small optimization of shadow checks 2015-10-24 15:42:06 -04:00
Goober5000 45c8ed8926 Merge pull request #383 from niffiwan/valgrind/generic_anim_stream
Fix memory leaks in generic_anim_stream
2015-10-24 15:18:50 -04:00
Goober5000 1f6fc358f8 just a tweak to avoid comparing whitespace 2015-10-24 15:07:58 -04:00
Goober5000 5b8584b892 clarify the use of mc_info_init, and make sure that model_instance_num and submodel_num have the proper values 2015-10-24 15:06:58 -04:00
MageKing17 0cdac667a3 Merge pull request #385 from asarium/coverity/1093606
Fix Coverity 1093606 for real this time
2015-10-24 05:41:26 -07:00
MageKing17 5137787a99 Merge pull request #388 from asarium/coverity/1093600
Revert "Fix for Coverity 1093600: Negative array index read"
2015-10-24 05:40:56 -07:00
asarium ddacb8cf32 Revert "Fix for Coverity 1093600: Negative array index read"
This reverts commit 2aa569c1e7.

As discussed in #386 hud_squadmsg_is_target_order_valid actually doesn't properly catch cases where the target_objnum may be -1.
2015-10-24 14:16:31 +02:00
asarium 88e7c83a8e Fix Coverity 1093606 for real this time 2015-10-24 12:53:03 +02:00
niffiwan 5b489da8a8 Merge pull request #376 from asarium/ci/fatalWarnings
Travis CI: Make warnings fatal errors
2015-10-24 20:08:53 +10:00
The E 35e34ac97c Introduces a proper constructor for mc_info and removes the mc_info_init function on grounds of grave misuse of memset. 2015-10-24 09:58:38 +02:00
MageKing17 1ba35d42ae Merge pull request #369 from The-E/player-fighterbays
Allow ships to arrive from hangars on player ships
2015-10-24 00:36:02 -07:00
niffiwan 409ba384b0 Fix memory leaks in generic_anim_stream 2015-10-24 15:04:13 +10:00
niffiwan 51c2a61d76 Merge pull request #382 from asarium/valgrind/1
Fix memory leak in bm_load_animation
2015-10-24 08:42:36 +10:00
asarium f1fd9f9a3d Fix memory leak in bm_load_animation 2015-10-23 22:35:56 +02:00
Goober5000 96d32b5031 remove WF_NEVER_EXISTED 2015-10-22 23:27:43 -04:00
Fabian Woltermann 21a16fbf15 Change this line back to what it was, with more accurate comment 2015-10-16 11:27:40 +02:00
Fabian Woltermann 76b6f954da Merge pull request #377 from MageKing17/bugfix/sexps-accessing-wrong-nodes
Fixes numerous SEXPs accessing the wrong nodes.
2015-10-16 06:06:58 +02:00
MageKing17 064a07349f Fixes numerous SEXPs accessing the wrong nodes.
Affected SEXPs include turret-set-target-order, turret-set-direction-preference, turret-set-rate-of-fire, turret-set-optimum-range, ship-turret-target-order, turret-get-primary-ammo, turret-set-primary-ammo, turret-get-secondary-ammo, and turret-set-secondary-ammo.

It's worth noting that while turret-set-direction-preference, turret-set-rate-of-fire, and turret-set-optimum-range were wrong, they were wrong in a way that wouldn't actually affect the outcome most of the time (thanks to the "if(turret == NULL)" checks simply skipping invalid subsystem names).
2015-10-15 18:58:27 -07:00
asarium bcedaee793 Fix "uninitialized variable warning" 2015-10-14 18:54:14 +02:00
asarium a020095b07 Disable array bounds checks in a Travis build 2015-10-14 18:44:57 +02:00
asarium a5f918a811 Remove -ansi option as it's not supported by clang 2015-10-14 18:20:44 +02:00
asarium 4e21d9ee79 Make error fatal when doing a CI build 2015-10-14 18:09:16 +02:00
asarium 7efd107bfa Fix format warning and syntax error 2015-10-14 18:07:45 +02:00
asarium 9f4589df65 Fix unitialized variable warning
GCC was complaining about an uninitialized warning but that was probably a false positive.
2015-10-14 17:51:21 +02:00
asarium 1d2153794c Fix an overflow warning
Signed overflow is not well defined in the standard but unsinged it so now that is used to determine if the model index counter has overflown.
2015-10-14 17:45:46 +02:00
asarium 4a40aad107 Fix invalid index warning
The new version now prints the name of the help overlay that could not be added.
2015-10-14 17:44:03 +02:00
asarium 14f1ceec4d Fix "unused return" warnings 2015-10-14 17:41:31 +02:00
Fabian Woltermann 2f78ae308b Consistency for the doxygen comments 2015-10-13 10:17:35 +02:00
Fabian Woltermann bc788d6cb7 More comment cleanup 2015-10-13 09:29:07 +02:00
Fabian Woltermann f1b9c15618 More comment tweaks 2015-10-13 09:15:52 +02:00
Fabian Woltermann eab9fab9ca Further, non-multi-breaking changes as suggested by MageKing17. 2015-10-13 09:11:36 +02:00
Fabian Woltermann a6d3982c7c Merge pull request #375 from MageKing17/bugfix/homing_pos-null-check
Check IS_VEC_NULL(&wp->homing_pos) for det_radius and arm_radius.
2015-10-13 08:01:48 +02:00
MageKing17 7852d13ce5 Check IS_VEC_NULL(&wp->homing_pos) for det_radius and arm_radius.
"$Detonation Radius:" and "$Arm radius:" would both rely on wp->homing_pos being set if wp->homing_object was; however, during free flight time, wp->homing_pos remains uninitialized (a null vector). As a result, their vm_vec_dist() calls would be comparing with the distance from the mission origin (coordinates 0,0,0) instead of the actual location of whatever they were homing in on. In the case of detonation radius, this would result in instant detonation on launch if you fired within det_radius of the mission origin. In the case of arm radius, this would result in the weapon being armed during free flight if launched within the arm_radius of the origin (and yes, you could theoretically experience the effects of both of these bugs simultaneously).

Theoretically, this solution is still less than ideal (a target sitting exactly on the mission origin could cause wonkiness), but it's consistent with the IS_VEC_NULL() checks elsewhere in weapons.cpp. A "proper" solution would basically require rewriting the entire homing code... which, obviously, if somebody would like to volunteer for, I wouldn't stop you ;). In the meantime, firing a homing weapon at a target sitting on the mission origin is even less likely than firing a weapon with one of the affected attributes within a certain distance of the mission origin, which was already pretty uncommon (it took a weapon with an abnormally large detonation radius of 1 kilometer to even realize this bug existed).
2015-10-12 22:48:15 -07:00
Fabian Woltermann ad62f1d342 Merge pull request #374 from MageKing17/bugfix/homing-object-NULL-confusion
Stop comparing/setting homing_object to NULL.
2015-10-13 07:23:34 +02:00
MageKing17 75ae511ae6 Stop comparing/setting homing_object to NULL.
The rest of the codebase uses &obj_used_list to mean "no homing target", and the inconsistency could cause all kinds of issues.
2015-10-12 16:10:05 -07:00
niffiwan 89ebdd9bc1 Merge pull request #373 from MageKing17/bugfix/turret-ammo-bank-3-typo
Fix a typo in the weapon editor dialogue for turret bank 3 ammo.
2015-10-13 08:27:41 +10:00
MageKing17 ccd6d1e619 Fix a typo in the weapon editor dialogue for turret bank 3 ammo. 2015-10-12 15:12:13 -07:00
Fabian Woltermann ca47f62e94 Merge pull request #342 from asarium/antipodes_/multiDisplay
Add support for specifying the used display
2015-10-09 08:21:25 +02:00
Fabian Woltermann db8990f61a Merge pull request #365 from asarium/antipodes_/sync
Sync Antipodes
2015-10-09 08:19:09 +02:00
Fabian Woltermann 92ace8e983 Further comment tweaks 2015-10-08 09:49:48 +02:00
MageKing17 61f2e78515 Merge pull request #370 from Goober5000/memset_bugfix
fix a memset typo identified by Echelon9
2015-10-05 12:38:59 -07:00
Goober5000 ebd81d9539 fix a memset typo identified by Echelon9 2015-10-05 11:49:54 -04:00
Fabian Woltermann d3df7ef2b1 Adds explanatory comments and applies the same logic to the net signature overload. 2015-10-05 08:08:46 +02:00
The E 99306be6cf Amendment based on Kara's feedback. Should allow same behaviour in both SP and MP. 2015-10-04 12:23:35 +02:00
The E 6835d2bf9f Only remove the player ship from the arrival list in singleplayer 2015-10-03 22:15:57 +02:00
Goober5000 3f9ce3b6a5 Merge pull request #368 from asarium/fix/configureType
Fix typo in configure.ac
2015-10-03 14:12:27 -04:00
asarium 08067bc871 Fix typo in configure.ac 2015-10-03 19:18:52 +02:00
MageKing17 415f113f4d Merge pull request #366 from The-E/ciws
Fixes the logic surrounding the ciws flag
2015-10-02 13:54:52 -07:00
MageKing17 a5b504bb85 Merge pull request #367 from The-E/longer-descriptions
Slightly increases the length limit for tech descriptions.
2015-10-02 13:54:09 -07:00
The E 9f94568d2f Slightly increases the length limit for tech descriptions. 2015-10-02 20:37:04 +02:00
The E ad4fed744e Normalizes the logic to work the same way in both cases 2015-10-02 20:22:51 +02:00
The E 0a081fb292 Fixes the logic surrounding the ciws flag 2015-10-02 19:33:09 +02:00
asarium f08466f0f3 Merge branch 'master' into antipodes_/sync
Conflicts:
	ci/travis/before_install.sh
	ci/travis/install.sh
	code/sound/voicerec.cpp
2015-10-01 22:45:10 +02:00
Fabian Woltermann efa5dc9620 Merge pull request #364 from Goober5000/background_bitmaps_tweak
made background sexp errors less fatal
2015-10-01 18:18:24 +02:00
Goober5000 bfb4db1dd4 made background sexp errors less fatal 2015-09-30 23:36:47 -04:00
MageKing17 2d56358755 Merge pull request #363 from DahBlount/Fix-debug-warning-in-Min/Max-Damage-definition-code
Additional debub warning move
2015-09-30 14:41:00 -07:00
DahBlount d52e27dcc4 Move debug warnings to optional_string()
Only check if we actually set a value for min or max damage.
2015-09-30 13:54:18 -06:00
Fabian Woltermann 12acacbba8 Merge pull request #362 from DahBlount/Fix-debug-warning-in-Min/Max-Damage-definition-code
Fix debug warning in min max damage definition code
2015-09-30 21:43:13 +02:00
DahBlount 3bbabea978 Add additional checks to min/max damage code
This checks the damage attenuation code for have a parameter being set
to 0.0f before hand to prevent debug warnings.
2015-09-30 13:19:10 -06:00
m!m cdc43731af Merge pull request #361 from Goober5000/cfile_null_bugfix
cfclose() will hit an assertion if we try to close a null pointer
2015-09-30 21:08:03 +02:00
Goober5000 edc806897f cfclose() will hit an assertion if we try to close a null pointer 2015-09-30 15:03:00 -04:00
MageKing17 f32a6e7ab9 Merge pull request #359 from ln-zookeeper/fotg_to_master
Make the array bounds check actually work
2015-09-25 12:30:14 -07:00
Lari Nieminen 2e9b2de40a Make the array bounds check actually work 2015-09-24 09:25:59 +03:00
MageKing17 69ab8c179d Merge pull request #357 from Goober5000/fiction_viewer_conditional_support
Fiction viewer conditional support
2015-09-23 16:14:46 -07:00
Goober5000 37657fc537 oh rubbish 2015-09-23 18:39:51 -04:00
Goober5000 1a5a0d6a7f change an Error to an Assertion, and made Fiction_viewer_text use nullptr instead of NULL 2015-09-23 18:38:34 -04:00
m!m 1a196cbd7a Merge pull request #356 from MageKing17/cleanup/voice-recognition-mantis-2373
Voice recognition cleanup based on Mantis #2373 patch.
2015-09-23 23:32:46 +02:00
MageKing17 89a6d69e08 Voice recognition cleanup based on Mantis #2373 patch.
* Frees cpAudio pointer in VOICEREC_deinit()
* Validates that the ship/wing can actually take orders, and validates that it can take the specific order in question before trying to send it.
* Reports the confidence of the voice match if DEBUG_ON is set.
* Various commenting changes based on the patch.

Not included: using confidence to discard voice matches that fall below a certain confidence level. I haven't noticed a tendency towards spurious matches, and I didn't want to introduce this without additional data, especially when it might cause problems for people with different accents (and ESPECIALLY without a setting to tweak the threshold value, which the original patch did not have; it was hardcoded at 90%).
2015-09-23 14:10:02 -07:00
Goober5000 b59c015df2 fix a subtle bug caught by Travis 2015-09-22 21:32:19 -04:00
Goober5000 c90db8c498 Merge pull request #314 from MageKing17/cleanup/fred-save-refactor
Refactor mission saving to avoid duplicate code.
2015-09-22 21:19:23 -04:00
Goober5000 cc79554f7a keep track of the active stage via index rather than via pointer because the vector may be resized 2015-09-22 20:39:37 -04:00
Goober5000 3df6bb82db add basic conditional support to fiction viewer stages 2015-09-22 20:17:31 -04:00
Goober5000 56a9391e31 some const-correctness 2015-09-22 19:02:10 -04:00
niffiwan bc5b7e6906 Merge pull request #355 from ln-zookeeper/l_cf_get_path_id_buf_fix
Fix possible out of bounds array access
2015-09-22 19:13:01 +10:00
Lari Nieminen 6dc3d67905 Fix possible out of bounds array access
If the input string is "/", then buf[-1] would get accessed and in rare cases also modified.
2015-09-22 11:43:20 +03:00
Goober5000 0d1764d42e Merge pull request #353 from Yarn366/per_mission_ui_backgrounds
Per-mission UI backgrounds
2015-09-21 17:02:03 -04:00
MageKing17 f4f31084fa Merge pull request #354 from Goober5000/no_move_collision_tweak
collision optimization: two objects which do not move will never coll…
2015-09-21 13:56:38 -07:00
Goober5000 5fb98551c9 collision optimization: two objects which do not move will never collide with one another 2015-09-21 16:30:19 -04:00
Yarn366 5f58aaa392 Merge branch 'master' into per_mission_ui_backgrounds 2015-09-20 21:05:46 -04:00
Yarn366 484be09275 Added support for custom fiction viewer backgrounds. Also moved the $UI parameter so it occurs just before the $File parameter. 2015-09-20 15:59:29 -04:00
m!m 26e65cc9e5 Merge pull request #350 from niffiwan/headzlessIII
Reduce bmpslot usage by headz
2015-09-19 12:49:11 +02:00
Fabian Woltermann 26bca473e2 Merge pull request #352 from niffiwan/headz_comment_fix
Fix comment for HudGaugeTalkingHead::render
2015-09-19 11:00:32 +02:00
niffiwan 0132e2a320 Fix comment for HudGaugeTalkingHead::render 2015-09-19 18:55:30 +10:00
Yarn366 873694eae2 Added unified functions for loading and saving custom UI backgrounds 2015-09-19 04:47:11 -04:00
niffiwan 0b1c916352 Merge pull request #351 from MageKing17/cleanup/scripting-call-bm_release-instead-of-bm_unload
Make script_state::UnloadImages() call bm_release instead of bm_unload.
2015-09-19 15:09:50 +10:00
MageKing17 835c4a7d0e Make script_state::UnloadImages() call bm_release instead of bm_unload.
Should result in reduced BMPMAN slot usage with certain scripts as bm_unload() unloads the image data but holds on to the slot, while bm_release() releases the slot.
2015-09-18 21:22:07 -07:00
Yarn366 f0c0d60a11 Fiction viewer UI can now be set in mission files and game_settings.tbl 2015-09-18 21:51:24 -04:00
niffiwan 12f4bcfd9b Reduce bmpslot usage by headz
As headani's (both ANI & EFF) are streamed there's no need to have
the anim data in bmpman, the streaming code does that with only two
slots, rather than one slot per ani frame
Also fix a "leak" in the streaming code use of bmpman slots. i.e. each
time a message was played another slot would be used & not released
2015-09-18 19:34:28 +10:00
niffiwan 30c8d09c55 Merge pull request #349 from MageKing17/bugfix/for-counter-double-free
Fix double-free with for-counter (introduced by myself).
2015-09-17 13:06:06 +10:00
MageKing17 53f7f493cf Merge pull request #335 from ln-zookeeper/fotg_to_master
Fixed the $On Ship Arrive hook code as per issue #334 and PR #333
2015-09-16 19:58:01 -07:00
MageKing17 24b0b28f6a Fix double-free with for-counter (introduced by myself).
In 9ec10dd I thought I was fixing a memory leak, but the actual scenario was that the freeing was just delayed until later. This removes the freeing added by 9ec10dd and changes the free() calls into vm_free() calls.
2015-09-16 19:55:24 -07:00
Yarn366 0af93bcceb Fixed attempts to access current debriefing as an array when saving the debriefing background 2015-09-16 14:24:59 -04:00
Yarn366 9cb1af00aa Added support for custom command briefing backgrounds 2015-09-16 14:06:15 -04:00
Yarn366 4ef212157a Briefing backgrounds are now set with $briefing_background_xxx instead of $background_xxx 2015-09-16 02:17:53 -04:00
Yarn366 3bb9b0068c Added support for custom debriefing backgrounds 2015-09-16 01:32:57 -04:00
Yarn366 09aa01db6b Added support for custom weapon select backgrounds 2015-09-16 00:14:54 -04:00
Yarn366 36cc228527 Added support for custom ship select backgrounds 2015-09-15 23:49:43 -04:00
niffiwan 022e3324ce Merge pull request #348 from MageKing17/bugfix/dont-call-popup-during-gr_init
Stop calling popup() during gr_init().
2015-09-16 11:15:25 +10:00
Yarn366 f41c5a2a65 Added support for custom red-alert backgrounds 2015-09-15 21:08:25 -04:00
MageKing17 d672ee885f Stop calling popup() during gr_init().
While investigating issue #345, it was discovered that `popup()` is getting called during `gr_init()` (and since this is before `gamesnd_parse_soundstbl()` gets called, the eventual call to `gamesnd_play_iface()` results in reading invalid memory). Given that this is basically relying on a feature in the middle of the function initializing it, and given that both lines are preceded by `mprintf()` calls saying basically the same thing, it seems the best solution is to just remove the troublesome lines altogether.
2015-09-15 17:59:16 -07:00
MageKing17 3329285192 Refactor mission saving to avoid duplicate code.
Makes save_mission_file() and autosave_mission_file() delegate to a new save_mission_internal() function. Tested and works with both manual and automatic saves.

As an aside, this fixes a slight inconsistency between manual and automatic saving (which inspired this refactor in the first place): when the order of save_fiction() and save_cutscenes() was swapped (in r10886 a.k.a. d6e0a73), autosave_mission_file() wasn't also changed, so autosaves of missions with "#Cutscenes" sections can't actually be loaded.
2015-09-10 13:34:57 -07:00
z64555 9df07cda5e Merge pull request #343 from Echelon9/fix/bm_load_and_parse_eff-return-type
Refactor bm_load_and_parse_eff() return type to bool
2015-09-08 09:48:53 -05:00
Echelon9 d7eca39338 Refactor bm_load_and_parse_eff() return type to bool, thereby removing a TODO 2015-09-08 22:14:43 +08:00
z64555 d1e6aa2b4f Merge pull request #344 from Echelon9/fix/bm_set_render_target-return-type
Refactor bm_set_render_target() return type to bool
2015-09-08 09:02:14 -05:00
Echelon9 b7aaf2e885 Refactor bm_set_render_target() return type to bool, thereby removing a TODO 2015-09-07 17:07:24 +10:00
asarium 28c40ae888 Add support for specifying the used display 2015-09-06 22:34:09 +02:00
m!m 0339f1ba62 Merge pull request #341 from MageKing17/bugfix/mantis-3173
Fix Mantis #3173.
2015-09-06 14:45:28 +02:00
MageKing17 1a0f2cf0e0 Fix Mantis #3173.
So in PR #294, I made 0-damage beams call the damage-applying code so they could be used to TAG things. The way I did this was I removed the do_damage check from the conditional before the switch block that handles beams damaging things.

This was a horrible mistake.

do_damage was set to 0 if a beam dealt <= 0 damage, but before that, it would only be set to 1 if the damage timestamp had elapsed. Removing the do_damage check caused damaging beams to deal damage every frame, which obviously will cause a substantial damage increase (well, unless your framerate was so low that beams would deal less than their full damage anyway).

This commit restores the do_damage check, and simply avoids setting do_damage to 0 if the beam isn't a damaging one (the <= 0 check is moved to beam_get_ship_damage() instead, so we can skip the attenuation calculation if we're not going to deal damage in the first place).
2015-09-06 05:33:30 -07:00
niffiwan e7136c8875 Merge pull request #339 from asarium/antipodes_/fix/openglFlip
Workaround for freezing when exiting abnormally
2015-09-04 09:38:41 +10:00
Lari Nieminen 473090e9e0 Made $On Ship Arrive cope with generic anchors (e.g. "<any hostile>")
This changes the interface of mission_set_arrival_location() to return the objnum of the anchor (if any; -1 otherwise).
2015-09-04 01:23:32 +03:00
Fabian Woltermann d5a2238225 Merge pull request #340 from asarium/fix/unneededWarnings
Re-enable two gcc warnings
2015-09-03 18:10:32 +02:00
m!m cbec552c19 Merge pull request #338 from Goober5000/sound_index_tweak2
Sound index tweak2
2015-09-03 17:02:38 +02:00
asarium 032aa154de Re-enable two warnings
The unknown pragmas have been fixed by wrapping them in a visual studio ifdef
2015-09-03 15:38:33 +02:00
Fabian Woltermann b23227d08d Merge pull request #336 from asarium/antipodes_/betterStacktrace
Improve linux stacktraces
2015-09-03 13:39:05 +02:00
asarium 855982ac38 Workaround for freezing when exiting abnormally
When using the Linux AMD proprietary driver FSO gets stuck when trying to swap buffers when performing an abnormal shutdown (e.g. when exiting via a dialog). This skips the gr_flip calls when we are going to close as it doesn't matter anyway.
2015-09-03 13:09:37 +02:00
Goober5000 3b5ba969cc change the Warning to an mprintf since technically SSM entries do not need a name 2015-09-02 22:49:31 -04:00
Goober5000 be5fdd0308 sprintf_s only works in Visual Studio; change to regular sprintf 2015-09-02 22:45:46 -04:00
Goober5000 abd31038e7 a bit of code cleanup with some robustness for SSM entry names 2015-09-02 22:45:38 -04:00
Goober5000 902fd5efbc fix a VS2013 warning 2015-09-02 22:45:24 -04:00
Goober5000 7db9adae00 since Alarm Sound is optional, it's possible the sound index won't get assigned 2015-09-02 22:45:04 -04:00
m!m f82a730f7e Merge pull request #337 from Yarn366/mantis/3172
Fixed language autodetection
2015-09-02 23:44:08 +02:00
Yarn366 932a5230e9 Fixed language autodetection 2015-09-02 17:13:33 -04:00
asarium a38908af19 Improve linux stacktraces
The new version of dumP-stacktrace uses abi::__cxa_demangle to determine the real name of a C++ function instead of printing the mangled name to the stacktrace.
2015-09-02 16:28:20 +02:00
Lari Nieminen 81d18573aa Fixed the $On Ship Arrive hook code as per issue #334 and PR #333 2015-09-02 10:53:21 +03:00
Fabian Woltermann fadd4e6d18 Merge pull request #327 from Goober5000/per_mission_briefing_backgrounds
mjn.mixael's request for per-mission briefing backgrounds
2015-08-31 09:03:05 +02:00
Fabian Woltermann e02adc2b8f Merge pull request #329 from asarium/antipodes_/stubsCleanup
Remove usage of HMMIO
2015-08-31 09:02:06 +02:00
Fabian Woltermann 6484a19094 Merge pull request #331 from AxemP/NoBeamFlashImpact
Removes the beam flash impact from appearing when viewing from the hit object's cockpit
2015-08-31 09:00:01 +02:00
Fabian Woltermann 66c9b7584c Merge pull request #330 from asarium/antipodes_/messageBoxCleanup
Replace Win32 MessageBox with os::dialogs version
2015-08-31 08:58:54 +02:00
z64555 98fba0c00b Merge pull request #328 from niffiwan/bmpslots
Add debug console command to log bmpman slot info
2015-08-30 18:47:57 -05:00
MageKing17 f95db90cc0 Merge pull request #332 from niffiwan/bmp_eff_cleanup
Minor bmpman/generic anim cleanup
2015-08-30 10:19:37 -07:00
niffiwan 2199863587 Minor bmpman/generic anim cleanup
Remove redundant Assert from bm_load_animation
Replace magic numbers in EFF streaming animations
2015-08-30 14:50:21 +10:00
asarium d57eefde7f Undefine MessageBox if it is defined 2015-08-29 23:01:38 +02:00
MageKing17 df8317f3ed Merge pull request #311 from ln-zookeeper/fotg_to_master
Added Lua functions to read mouse/joystick sensitivity and deadzone
2015-08-29 09:38:21 -07:00
Axem cc08e986a2 Don't need that 2015-08-29 11:19:48 -05:00
Axem 65cce032d3 Merge branch 'NoBeamFlashImpact' of https://github.com/AxemP/fs2open.github.com.git 2015-08-29 11:15:36 -05:00
Axem b8479fba88 I am comitting this! 2015-08-29 11:15:32 -05:00
Axem 7f22a80af6 Prelim work 2015-08-29 11:14:38 -05:00
Lari Nieminen 58b8f2a33c Added Lua functions to read mouse/joystick sensitivity and deadzone 2015-08-29 16:54:19 +03:00
asarium 451d451417 Replace Win32 MessageBox with os::dialogs version
Also moved SCP_MessageBox into os::dialogs namespace
2015-08-28 16:24:35 +02:00
Fabian Woltermann d8bd42722d Merge pull request #322 from z64555/enhancement/joy_asynch
joy_asynch - Enables SDL's event handling for joystick axes
2015-08-28 12:02:28 +02:00
asarium 45ba56a721 Remove usages of mmio 2015-08-28 11:47:26 +02:00
asarium b500e072da Use cross-platform compatible struct 2015-08-28 11:46:10 +02:00
asarium 9589751f3d Remove now unused compatibility function 2015-08-28 10:55:07 +02:00
Fabian Woltermann 90aee951e5 Merge pull request #325 from asarium/antipodes_/fix/cursor
Fix cursor initialization
2015-08-27 22:29:20 +02:00
asarium d5528551e1 Fix cursor initialization
Now matches the code in master and if FSO isn't launched in the correct directory displays the correct error message instead of an assertion.
2015-08-27 21:52:00 +02:00
Fabian Woltermann 47484ab363 Merge pull request #319 from asarium/antipodes_/sync
Sync Antipodes
2015-08-27 21:50:19 +02:00
Fabian Woltermann 0aec74ae29 Merge pull request #320 from asarium/ci/container
Travis CI: Switch to container infrastructure
2015-08-27 21:49:36 +02:00
asarium 4e6a1ae716 Switch to container infrastructure 2015-08-27 21:39:23 +02:00
z64555 f8d8c32d4e Use correct C library for limits.h this time 2015-08-27 05:58:31 -05:00
niffiwan ebca85531c Add debug console command to log bmpman slot info 2015-08-27 20:06:35 +10:00
m!m 0954d4e4ee Merge pull request #326 from MageKing17/bugfix/mantis-3144
Fix Mantis #3144.
2015-08-27 11:46:12 +02:00
MageKing17 ddace0c233 Add clarifying comment per m!m's note on GitHub. 2015-08-27 02:43:18 -07:00
m!m 7a38519a83 Merge pull request #302 from niffiwan/coverity+travis
Integrate Coverity with Travis CI
2015-08-27 10:49:12 +02:00
Goober5000 05d4e44c97 mjn.mixael's request for per-mission briefing backgrounds; see http://www.hard-light.net/forums/index.php?topic=90337.0 2015-08-27 01:22:14 -04:00
MageKing17 d4d6ab3fd7 Fix Mantis #3144.
Stops stripping newlines from ship descriptions, and resizes the text width according to Yarn's findings.
2015-08-26 20:36:43 -07:00
niffiwan 3754bfbfdf Merge branch 'master' into coverity+travis
Conflicts:
	.travis.yml
2015-08-27 12:40:33 +10:00
MageKing17 3a5f7143a2 Merge pull request #321 from Goober5000/subsystem_mprintf_fix
the model filename is useful to have in the debug message
2015-08-24 10:15:47 -07:00
Goober5000 b2215ddf7d the model filename is useful to have in the debug message 2015-08-24 12:59:15 -04:00
asarium 73e6f1fc07 Fix gcc/clang compilation warnings 2015-08-24 12:20:50 +02:00
asarium e08ba026f8 Merge branch 'master' into antipodes_/sync
Conflicts:
	.travis.yml
	code/cmdline/cmdline.cpp
	code/fs2netd/fs2netd_client.cpp
	code/fs2netd/tcp_client.cpp
	code/globalincs/pstypes.h
	code/graphics/2d.cpp
	code/graphics/2d.h
	code/parse/lua.cpp
	code/parse/scripting.cpp
	code/windows_stub/stubs.cpp
	configure.ac
	projects/MSVC_2012/Freespace2.vcxproj
	projects/MSVC_2012/code.vcxproj
	projects/MSVC_2013/code.vcxproj
	projects/MSVC_2015/code.vcxproj
2015-08-24 12:10:16 +02:00
z64555 b51e8c00de simplify joystick_read_raw_axis() 2015-08-24 03:07:42 -05:00
z64555 23b2bf5d84 Instate usage of consts instead of magic numbers 2015-08-24 03:05:10 -05:00
m!m 50feb3ed08 Merge pull request #315 from niffiwan/eff_streaming_is_done
Remove obsolete comments
2015-08-23 12:31:44 +02:00
niffiwan a6f2cc5937 Remove obsolete comments
EFF streaming was implemented in 48e0517e (svn r9109)
2015-08-23 20:26:01 +10:00
niffiwan 545287cebf Merge pull request #307 from asarium/ci/macosx
Add CI support for MacOSX
2015-08-23 19:52:15 +10:00
m!m 84a315d1db Merge pull request #8 from niffiwan/asarium-ci_macosx
We need sudo; force it on
2015-08-23 10:11:43 +02:00
niffiwan 00c3733670 Merge pull request #313 from MageKing17/bugfix/fred-ship-loadout-invalid-memory
Replaces a reference to MAX_SHIP_CLASSES with Ship_info.size().
2015-08-23 14:10:00 +10:00
niffiwan 7fdfdc6134 We need sudo; force it on 2015-08-23 13:53:13 +10:00
MageKing17 6a69b02bbb Replaces a reference to MAX_SHIP_CLASSES with Ship_info.size().
This would cause FRED to treat essentially unspecified pieces of memory as ship classes and then see if this nonsense class had the SIF_DEFAULT_PLAYER_SHIP flag set... and if so, put it in the default list of available ships. With a debug build (where the memory past the end of Ship_info is all identical for quite a ways), this could result in the default, empty mission saving as 60 megabytes.
2015-08-22 18:33:22 -07:00
Goober5000 886deddf99 Merge pull request #306 from MageKing17/bugfix/call-ssm-strike-warning
Fixes call-ssm-strike resulting in a Warning about a null vec3d.
2015-08-22 18:36:14 -04:00
MageKing17 360a55be63 Merge pull request #312 from MageKing17/bugfix/on-turret-fired-swarm-fix
Fix null pointer dereference with swarm turrets and "$On Turret Fired:".
2015-08-22 15:12:30 -07:00
MageKing17 91d25a8744 Fix null pointer dereference with swarm turrets and "$On Turret Fired:".
Forgot to set last_fired_turret and its last_fired_weapon_info_index, causing CHA_ONTURRETFIRED to crash as soon as a swarm turret fired.

Oops.
2015-08-22 14:29:27 -07:00
MageKing17 c990f44f82 Merge pull request #310 from ln-zookeeper/fotg_to_master
Supplement +Disable with +Disable: <bool>, to allow the table to enab…
2015-08-22 12:32:58 -07:00
Lari Nieminen 0d8f6f26ce Supplement +Disable with +Disable: <bool>, to allow the table to enable binds disabled by default 2015-08-22 22:18:07 +03:00
MageKing17 55b857f269 Merge pull request #260 from ln-zookeeper/fotg_to_master
Whitespace and commenting tweaks
2015-08-22 11:58:19 -07:00
Lari Nieminen 00fa839d1d Added a few comments and fixed typos in some others 2015-08-22 21:55:37 +03:00
Goober5000 ef3bb65d63 Merge pull request #305 from MageKing17/bugfix/fred-glowpoint-init
Makes FRED call glowpoint_init().
2015-08-22 14:17:26 -04:00
m!m 56ab9e02c8 Merge pull request #304 from MageKing17/bugfix/parselo-char-fix
Makes vsprintf() stop chopping off the last character. Fixes issue #298.
2015-08-22 19:21:30 +02:00
MageKing17 cbcb053fbc Merge pull request #309 from asarium/fix/drawSubsystem
Fix gr.drawSubsystemTargetingBrackets
2015-08-22 10:16:07 -07:00
asarium b76bccb9ef Actually set the bounds of the drawn subsystem 2015-08-22 17:16:42 +02:00
Axem a535d66fc8 Prelim work 2015-08-22 08:36:58 -05:00
m!m be4cac366b Merge pull request #308 from niffiwan/gcc-warn
Fix gcc warning in ship/ship.cpp
2015-08-22 13:06:56 +02:00
m!m a691e81e14 Merge pull request #303 from MageKing17/bugfix/lua-null-pointer-checks
Add null pointer checks throughout lua.cpp.
2015-08-22 13:06:23 +02:00
asarium 07fcd05fff Add CI support for MacOSX
Requires enabling the multi-os feature of travis CI
2015-08-22 12:59:49 +02:00
niffiwan 9737994de5 Fix gcc warning in ship/ship.cpp
Use SIZE_T_ARG in Warning
2015-08-22 20:45:45 +10:00
MageKing17 fe1db37902 Makes FRED call glowpoint_init().
Avoids a constant stream of warnings when using "$Glowpoint overrides:".
2015-08-22 03:40:27 -07:00
MageKing17 238dbc5749 Makes vsprintf() stop chopping off the last character. Fixes issue #298.
Also fixes saving missions in FRED, since it uses the same function.
2015-08-22 03:38:16 -07:00
MageKing17 cd3b543e56 Add null pointer checks throughout lua.cpp.
Previously, the "this != NULL" checks in the isValid() methods were covering most of these cases, but they were removed as part of PR #274 because clang was generating warnings because calling a method on a null pointer is undefined behavior (so the condition *should* be tautological). This performs the checks outside of isValid(), which should avoid (at least this variety of) undefined behavior while fixing the crashes that dereferencing null pointers was causing.
2015-08-22 03:36:26 -07:00
niffiwan b3c1441d06 Integrate Coverity with Travis CI
This should let Coverity run a scan via Travis whenever commits
are pushed to the "coverity_scan" branch.
Some hackery is required to avoid submitting too many builds to
Coverity. See travis-ci/travis-ci#1975 for details.
2015-08-22 18:39:55 +10:00
MageKing17 fb8ffcacfd Fixes call-ssm-strike resulting in a Warning about a null vec3d.
ssm_create() subtracts the start coordinates from the position of the target, and then normalizes that. Since call-ssm-strike was using the position of the target as the start coordinates, this was obviously resulting in normalizing a null vec3d, generating the spurious warning. This just makes call-ssm-strike use a point immediately behind the target's position (using the target's orientation) as the starting coordinate, thereby avoiding the warning.
2015-08-21 21:12:03 -07:00
niffiwan 0061718de4 Merge pull request #301 from MageKing17/bugfix/check-sexp-syntax
Fix check_sexp_syntax() so it works properly with OPF_SSM_CLASS.
2015-08-22 13:57:59 +10:00
MageKing17 d7ff43a1d1 Fix check_sexp_syntax() so it works properly with OPF_SSM_CLASS.
Also makes OP_BEAM_FLOATING_FIRE grab the correct ship_index for the subsystem check.
2015-08-21 13:41:45 -07:00
MageKing17 a748be2315 Merge pull request #300 from z64555/enhancement/nojoypoll
Removes joystick polling. Joy axes are now queried every frame.
2015-08-21 12:42:01 -07:00
z64555 f56f0c471d Removes joystick polling. Joy axes are now queried every frame. 2015-08-21 14:32:07 -05:00
MageKing17 b610b9b246 Merge pull request #299 from niffiwan/bmp_overflow
Fix Coverity 1093366: Operands don't affect result
2015-08-21 09:47:02 -07:00
niffiwan 00a0b1bae7 Fix Coverity 1093366: Operands don't affect result
The previous check was always false, replace with something that should
safely detect uint overflow
2015-08-21 22:49:28 +10:00
Fabian Woltermann 509bd8c010 Merge pull request #294 from MageKing17/feature/beam-tagging-with-no-damage
Remove do_damage check before calling hit functions in beam collisions.
2015-08-21 09:32:29 +02:00
Fabian Woltermann 9afae0b64d Merge pull request #287 from MageKing17/feature/on-turret-fired-for-all
Add CHA_ONTURRETFIRED support to beam and swarm turrets.
2015-08-21 09:31:32 +02:00
Cliff Gordon 0a2b97c3bc Merge pull request #41 from MageKing17/ship_info
Ship_info vectorization, ship templates.
2015-08-20 21:51:18 -05:00
MageKing17 52a2ac542e Merge pull request #296 from asarium/fix/vsprintf
Fix SCP_string version of vsprintf
2015-08-20 19:47:47 -07:00
Cliff Gordon 9bc635e098 Merge pull request #288 from MageKing17/feature/glide-decay-ai-profile-flag
Makes glide decay work even when not thrusting.
2015-08-20 21:46:42 -05:00
Cliff Gordon f824df070b Merge pull request #290 from MageKing17/cleanup/move-voice-recognition-grammar-files
Move the temporary grammar files into the build directory.
2015-08-20 21:34:10 -05:00
z64555 afe2f2dac6 Merge pull request #297 from MageKing17/bugfix/mantis-2436
Fix Mantis #2436. Does the mouse mapping within player_control_read_stick vs. trying to remap later on.
2015-08-20 16:57:54 -05:00
MageKing17 72af3059e9 Fix Mantis #2436.
Instead of the mouse's axes being automatically bound to heading/pitch/throttle, it finds what the axes are bound to (by looking through Axis_map_to[]) and modifies the corresponding values.
2015-08-20 14:53:01 -07:00
asarium 51832fd563 Fix SCP_string version of vsprintf
The previous version didn't use the c-library which would cause incompatibilities with formats that assume all format specified to be supported.
2015-08-20 22:52:49 +02:00
MageKing17 059af731a7 Merge pull request #295 from ln-zookeeper/master
Revert "Fixes Mantis #2436: Mouse controls ignore the axis binds." du…
2015-08-20 13:50:01 -07:00
Lari Nieminen b4c625c51a Revert "Fixes Mantis #2436: Mouse controls ignore the axis binds." due to the joystick axis problems it caused
This reverts commit da71e629b4.
2015-08-20 22:07:56 +03:00
z64555 882bb85232 forgot to shift the value from sdl 2015-08-20 08:17:16 -05:00
z64555 a82784756c Enables asychronous joystick polling 2015-08-20 07:24:40 -05:00
MageKing17 27d85189ea Remove do_damage check before calling hit functions in beam collisions.
This should allow 0-damage beams to be used to apply TAG effects.
2015-08-19 22:17:05 -07:00
MageKing17 b296300365 Simplify some references to Weapon_info[b->weapon_info_index].
These were all referenced when there was already a weapon_info pointer to that element; it makes more sense to use that pointer instead of re-indexing Weapon_info[].
2015-08-19 22:15:23 -07:00
MageKing17 a5bff0c192 Merge pull request #293 from chief1983/fix/292_warnings_part_b
Fix/292 warnings part b
2015-08-19 16:47:17 -07:00
MageKing17 20279838bf Move the temporary grammar files into the build directory.
These are only used for voice recognition on Windows. In addition, the gc.exe shouldn't be needed locally since it should be included with SAPI, which Visual Studio 2010 and later should already include.

I also tried to backport some of the changes from the 2013/2015 project files to the 2010/2012 project files, but lack of certain compiler flags made me tend to err on the conservative side in that regard.
2015-08-19 16:33:13 -07:00
Cliff Gordon f0c4bf2e3a [fix/292_warnings_part_b] Cast Frametime (of type fix) to int for printf specifier to avoid a warning. 2015-08-19 17:01:07 -05:00
Cliff Gordon 38e48bec16 [fix/292_warnings_part_b] Remove deprecated register type hint. 2015-08-19 17:01:07 -05:00
MageKing17 e5b7d48989 Add a couple more static_cast<int>()s to get rid of warnings. 2015-08-19 14:52:15 -07:00
Cliff Gordon 6850ac6fe0 Merge pull request #291 from asarium/fix/ssm-warnings
Fix warning introduced by #289
2015-08-19 16:05:42 -05:00
asarium 0c80c8d8c0 Fix warning introduced by #289 2015-08-19 22:34:08 +02:00
MageKing17 64c9b272e7 Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info
Conflicts:
	code/pilotfile/pilotfile.cpp
2015-08-19 11:53:25 -07:00
m!m 42ddd2fe5f Merge pull request #289 from MageKing17/feature/variable-ssm-strikes
Allow SSM(/SSB) strikes to be more variable.
2015-08-19 20:39:29 +02:00
MageKing17 692c86c8e6 Allow SSM(/SSB) strikes to be more variable.
Allows specifying a min/max for count, radius, and/or offset. To make them variable, instead of e.g. "+Count:", specify "+Min Count:", which adds a requirement for "+Max Count:". Each time the strike is activated, it will pick a different random count, and each projectile in the strike will have a different random radius and offset.
2015-08-19 11:36:50 -07:00
MageKing17 ba2fe6603c Merge pull request #274 from asarium/fix/printf
Fix remaining gcc/clang warnings
2015-08-19 10:37:13 -07:00
asarium 71d3139d14 Remove commented line 2015-08-19 11:26:32 +02:00
asarium 8d564da80c Fix for loop 2015-08-19 11:26:32 +02:00
asarium e037b08e2e Add doxygen documentation for format macros 2015-08-19 11:26:32 +02:00
asarium 1d65102292 Fix alignment in tcp_client.cpp 2015-08-19 11:26:32 +02:00
asarium 3a69db26eb Fix unneded checks for this != nullptr in lua.cpp 2015-08-19 11:26:31 +02:00
asarium e075241e54 Fix unneded check for this != nullptr in object.h 2015-08-19 11:26:31 +02:00
asarium 191194dfa7 Remove part of condition that is always true
Fixes a clang compiler warning
2015-08-19 11:26:31 +02:00
asarium 733b020bf5 Fix unneded check for this != nullptr in wmcgui.h 2015-08-19 11:26:31 +02:00
asarium 9ec178f116 Use the right version of abs 2015-08-19 11:26:31 +02:00
asarium fb068f6037 Fix invalid pointer comparision warning
This should match what the code is actually supposed to do
2015-08-19 11:26:31 +02:00
asarium bb6045d762 Check if the compiler supports the -Wno-unused-but-set-variable flag 2015-08-19 11:26:31 +02:00
asarium e8bb02bed3 Disable a few warnings in release mode
These will happen if debug builds use variables for debug checks
2015-08-19 11:26:31 +02:00
asarium a6e93c7d46 Fix another braces warning 2015-08-19 11:26:30 +02:00
asarium 1cd7744d34 Fix "operator '?:' has lower precedence" warning
I think the ?: expression was meant to take precedence
2015-08-19 11:26:30 +02:00
asarium fc3166ac52 Fix suggest braces around initialization of subobject warning 2015-08-19 11:26:30 +02:00
asarium 3826e24da2 Fix format warning in stubs.cpp 2015-08-19 11:26:30 +02:00
asarium 3ece769330 Fix format warnings in weapons.cpp 2015-08-19 11:26:30 +02:00
asarium 6ac1326dc8 Fix format warning in species_defs.cpp 2015-08-19 11:26:30 +02:00
asarium 03b26baf55 Fix format warning in ds.cpp 2015-08-19 11:26:30 +02:00
asarium 4b25b49432 Fix format warning in plr.cpp 2015-08-19 11:26:30 +02:00
asarium 721422f951 Fix format warning in pilotfile.cpp
Also fixes a logic error in the code (I think...)
2015-08-19 11:26:29 +02:00
asarium 509d11c29d Fix format warning in csg.cpp 2015-08-19 11:26:29 +02:00
asarium eb765b0c99 Fir format warnings in parselo.cpp 2015-08-19 11:26:29 +02:00
asarium 3d06468e2a Fix format warnings in lua.cpp 2015-08-19 11:26:29 +02:00
asarium 1de9ad1ace Fix format warnings in object.cpp 2015-08-19 11:26:29 +02:00
asarium 559198a2e4 Fix format warning in collideshipweapon.cpp 2015-08-19 11:26:29 +02:00
asarium 6b093f2ee9 Fix set but unused variable warning in multiutil.cpp 2015-08-19 11:26:29 +02:00
asarium 280ceabb45 Fix format warning in multi_options.cpp 2015-08-19 11:26:28 +02:00
asarium ff51e79531 Fix set but unused variable warning in chat_api.cpp 2015-08-19 11:26:28 +02:00
asarium 9cbf944dee Fix format warning in modelread.cpp 2015-08-19 11:26:28 +02:00
asarium 1ded65c3d0 Fix invalid usage of mprintf 2015-08-19 11:26:28 +02:00
asarium c26bd197dc Fix format warning in mainhallmenu.cpp 2015-08-19 11:26:28 +02:00
asarium 32b35ba62c Fix format warnings in credits.cpp 2015-08-19 11:26:28 +02:00
asarium 8d5273b3c0 Fix set but unused variable warning in vecmat.cpp
I kept the code in comments as it may be usedful at some point.
2015-08-19 11:26:28 +02:00
asarium 6a5e660ff3 Fix format warnings in lighting.cpp 2015-08-19 11:26:28 +02:00
asarium aaf470f49b Fix format warning in keycontrol.cpp 2015-08-19 11:26:28 +02:00
asarium 077dc61660 Fix format warnings in hudshield.cpp 2015-08-19 11:26:27 +02:00
asarium 116df2e2c3 Fix set but unused variable warning in grstub.cpp 2015-08-19 11:26:27 +02:00
asarium 4670d5f87f Fix set but unused variable warning in gropengltnl.cpp 2015-08-19 11:26:27 +02:00
asarium f986d28c56 Fix format warnings in safe_string.h 2015-08-19 11:26:27 +02:00
asarium dba0e8b458 Fix format warnings in gamesnd.cpp 2015-08-19 11:26:27 +02:00
asarium cf68c5970e Fix unused but set variable warnings in tcp_client.cpp 2015-08-19 11:26:27 +02:00
asarium fc140194d3 Fix set but unused variable warning in ddsutils.cpp 2015-08-19 11:26:27 +02:00
asarium a0b040c597 Fix unused but set variable error
I removed some function calls but all of them didn't have any side effects so it should be fine.
2015-08-19 11:26:27 +02:00
asarium 89e63d60b8 Fix warnings in decoder16.cpp 2015-08-19 11:26:26 +02:00
asarium 24a0b05b39 Fix unused but defined variable warning in controlsconfig.cpp
It's weird that shift and alt aren't used in this function but I couldn't find any reference to that in the structure for the controls config.
2015-08-19 11:26:26 +02:00
asarium 89f6794a13 Fix C++11 warning in aicode.cpp 2015-08-19 11:26:26 +02:00
asarium f625df5c38 Fix format warning in aicode.cpp 2015-08-19 11:26:26 +02:00
asarium 37eadf4d16 Disable unreferenced function warning 2015-08-19 11:26:26 +02:00
asarium a232a646dc Fix size_t format warnings 2015-08-19 11:26:26 +02:00
asarium 40c81134ac Fix "format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’" warning 2015-08-19 11:26:26 +02:00
asarium a63e1a2ba1 Fix invalid usage of mprintf 2015-08-19 11:26:26 +02:00
asarium f00af4d89f Fix "declaration of ‘i’ shadows a previous local" warning 2015-08-19 11:26:25 +02:00
asarium c697dcb926 Fix "comparison between signed and unsigned integer expressions" warning 2015-08-19 11:26:25 +02:00
asarium 29afbe8ef5 Use new macro for size_t printf arguments 2015-08-19 11:26:25 +02:00
asarium 6f01adfb2e Add portable format macros for size_t and ptrdiff_t 2015-08-19 11:26:25 +02:00
asarium 6a578b3fcd Fix non-sensical comparision
std::string::find_* returns std::string::npos if the token couldn't be found.
2015-08-19 11:26:25 +02:00
MageKing17 048d65d3ca Makes glide decay work even when not thrusting.
For any mods that might want to keep the old behavior, adds "$glide decay requires thrust:" AI profile flag.
2015-08-19 00:50:18 -07:00
MageKing17 e94511b7aa Add CHA_ONTURRETFIRED support to beam and swarm turrets. 2015-08-19 00:06:11 -07:00
Fabian Woltermann 8b4f7dde77 Merge pull request #277 from MageKing17/bugfix/infinite-trigger-count
Fix infinite trigger count not interacting correctly with "+Interval:"
2015-08-19 08:33:12 +02:00
MageKing17 990411fd0b Merge pull request #286 from Goober5000/woutersmits_fix
fix an obscure edge-case sexp crash
2015-08-18 23:30:26 -07:00
Goober5000 bd3cd7eb18 Merge pull request #195 from Echelon9/fix/sort-uniq-includes
Review and refactor #include's
2015-08-19 00:05:02 -04:00
Goober5000 17851dcc56 fix an obscure edge-case sexp crash
This bug was found by, of all people, woutersmits, while FREDding his happynewyear campaign.  See http://www.hard-light.net/forums/index.php?topic=90069.0 for discussion.  The crash was triggered by the use of ( validate-all-arguments ) as the entire sexp tree for one of his mission events.

This was a two-part fix.  The first part was to ensure that every *-argument sexp (of which validate-all-arguments is but one) is actually used within a when-argument or every-time-argument tree.  More specifically, every sexp operation that expects an argument handler should first check that the arg_handler node actually exists.

The second part was to partially revert one of Taylor's old commits:

Revision: 3644
Author: taylor
Date: Tuesday, October 24, 2006 9:17:24 AM
Message:
various bits of cleanup (warning messages, things that Valgrind complained about, etc.)
fix an out-of-bounds issue on Sexp_nodes[] which was leading to stack corruption

----
Modified : /branches/fs2_open_3_6_9/fs2_open/code/parse/sexp.cpp

This was intended to prevent a -1 array reference into Sexp_nodes[].  What Taylor did was to cause repeated calls of the parent_operator function to loop endlessly at the topmost parent.  But there are certain edge cases (such as the one woutersmits discovered) where you need to know whether a parent is the topmost one.  What Taylor should have done, and what this change does, is to keep the -1 as a valid return value but check for it in the places where it may cause an issue.
2015-08-18 21:32:14 -04:00
MageKing17 062929b8bd Merge pull request #284 from Goober5000/sexp_assertions
various assertions to improve the sexp code
2015-08-18 17:56:39 -07:00
Goober5000 efce7de00d fix syntax error, add node reference 2015-08-18 19:58:34 -04:00
Goober5000 2b032a1dbc tweaks per MageKing17's suggestions 2015-08-18 13:27:57 -04:00
m!m c8053d06b7 Merge pull request #285 from MageKing17/cleanup/hook-variable-removal
Cleanup hook variable removal
2015-08-18 17:52:10 +02:00
MageKing17 ce3755b333 Further hook variables cleanup.
Consolidated a few sequential calls, corrected a few instances of "ObjectB" being removed when "Object" was set, and removed a couple instances of hook variables that weren't set being removed.
2015-08-18 08:11:11 -07:00
MageKing17 313787effb Add RemHookVars() calls to aiturret.cpp, object.cpp, and ship.cpp.
CHA_ONTURRETFIRED wasn't clearing its hook variables. Neither was CHA_ONWPEQUIPPED or CHA_ONWPFIRED, CHA_PRIMARYFIRE, CHA_SECONDARYFIRE, CHA_ONWPSELECTED, or CHA_ONWPDESELECTED.
2015-08-18 07:58:03 -07:00
m!m 2011e86096 Merge pull request #280 from Echelon9/antipodes
Fix antipodes on OS X
2015-08-18 15:55:52 +02:00
Echelon9 a3df507f8a Remove extraneous Apple-specific code to set working directory (no longer effective). 2015-08-18 23:53:26 +10:00
Echelon9 6c153a9ff8 Establish a current working directory on OS X, which is not otherwise set when run via Finder 2015-08-18 23:49:12 +10:00
niffiwan 578083367d Merge pull request #283 from Goober5000/comment-fix
* remove an incorrect comment (the *= multiplies the variable by the …
2015-08-18 18:34:59 +10:00
Goober5000 e1d3838b2e various assertions to improve the sexp code 2015-08-18 01:00:43 -04:00
Goober5000 1bf6f822ae * remove an incorrect comment (the *= multiplies the variable by the entire RHS; it doesn't multiply and then add) 2015-08-18 00:35:51 -04:00
Fabian Woltermann 0ce1f10fee Merge pull request #279 from asarium/antipodes
Sync Antipodes
2015-08-16 22:08:51 +02:00
m!m 081eba90e5 Merge pull request #281 from Echelon9/fix/doc-cfile-init
Document cfile_init() function.
2015-08-16 18:15:48 +02:00
Echelon9 9487688edb Document cfile_init() function. 2015-08-17 01:41:37 +10:00
Echelon9 6c843519a2 Fully address the OS X -psn_* command line issue. 2015-08-17 00:07:49 +10:00
asarium b0acb49fba Add format string macros 2015-08-15 17:10:43 +02:00
asarium 84279530d7 Merge branch 'master' into antipodes
Conflicts:
	code/globalincs/pstypes.h
	code/globalincs/windebug.cpp
	code/windows_stub/stubs.cpp
	projects/MSVC_2015/Freespace2.vcxproj
	projects/MSVC_2015/code.vcxproj
2015-08-15 16:41:34 +02:00
m!m 2240e17413 Merge pull request #278 from Echelon9/fix/doxygen
Fix doxygen documentation
2015-08-15 13:29:03 +02:00
Echelon9 bd0fb590ca Fix incorrect Doxygen comment for bm_lock(). 2015-08-15 13:56:54 +10:00
Echelon9 420558d623 Fix incorrect Doxygen comment, there is no type @ret. 2015-08-15 13:55:05 +10:00
Echelon9 6061df4e65 Fix incorrect Doxygen comment for dc_draw_cursor(). 2015-08-15 13:53:23 +10:00
Echelon9 830e523408 Fix incorrect Doxygen comment for opengl_shader_link_object() and keep line lengths below recommended 80 characters. 2015-08-15 13:51:23 +10:00
Echelon9 a21dd67d85 Fix incorrect Doxygen comment for opengl_shader_create() and keep line lengths below recommended 80 characters. 2015-08-15 13:49:20 +10:00
Echelon9 0319816539 Fix incorrect Doxygen comment for hud_anim_render(). 2015-08-15 13:46:53 +10:00
Echelon9 9bccc64705 Fix incorrect Doxygen comment for free_object_slots(). 2015-08-15 13:45:20 +10:00
m!m 81fe1e3952 Merge pull request #276 from MageKing17/bugfix/beam-create-with-coords
Fix beam-create with targeting coordinates instead of a ship/subsystem.
2015-08-14 21:27:32 +02:00
MageKing17 488a0f1da2 Fix infinite trigger count not interacting correctly with "+Interval:"
There's an undocumented feature whereby negative trigger counts are treated as infinite. However, since it doesn't use the bump_timestamp system of positive trigger counts, it'll behave more like an infinite repeat count (e.g. with "+Interval: 5" it will only check every 5 seconds instead of becoming active again after 5 seconds have passed). This just makes negative values set bump_timestamp and excludes them from resetting the timestamp if the event didn't trigger that frame (checking MEF_USING_TRIGGER_COUNT so that the other behavior is still possible if you set a negative repeat_count and don't specify a trigger_count).
2015-08-14 11:24:47 -07:00
MageKing17 d0cde03a69 Fix beam-create with targeting coordinates instead of a ship/subsystem.
If the subsystem was <none>, sexp_beam_floating_fire() wasn't consuming the node, resulting in it also being parsed as the X coordinate (making it always zero, because atoi("<none>") == 0).
2015-08-14 11:20:33 -07:00
Fabian Woltermann 76f67edb36 Merge pull request #275 from MageKing17/bugfix/actually-call-beam-create
Make beam-create actually call sexp_beam_floating_fire().
2015-08-14 19:51:29 +02:00
MageKing17 cbeb03b2d5 Make beam-create actually call sexp_beam_floating_fire().
Somehow, this got missed during the creation of the pull request, and I guess nobody (not even me) actually tried using it since then.
2015-08-14 10:32:27 -07:00
MageKing17 ef34e5e39e Merge pull request #272 from MageKing17/bugfix/actually-fix-cargo-size-check
Actually fix the `cargo_size` check for turrets.
2015-08-13 18:08:29 -07:00
MageKing17 7b15fe0786 Do a couple more MAX_SHIP_*_BANKS to num_*_banks replacements. 2015-08-13 15:03:31 -07:00
MageKing17 fada4f514e Make primary weapon cargo_size check first check the WIF2_BALLISTIC flag. 2015-08-13 03:59:52 -07:00
Fabian Woltermann 64f046c388 Merge pull request #273 from MageKing17/bugfix/ammo-sexp-multi-fix
Fix writing to undefined memory in multiplayer SEXP code for turret a…
2015-08-13 07:32:14 +02:00
MageKing17 d74d09554e Fix writing to undefined memory in multiplayer SEXP code for turret ammo.
`multi_sexp_set_turret_primary_ammo()` and `multi_sexp_set_turret_secondary_ammo()` were using an uninitialized pointer instead of an uninitialized array, like every other instance of multi_get_string(). This is just begging to write to invalid memory.
2015-08-12 22:02:29 -07:00
MageKing17 d07673cbe1 Actually fix the cargo_size check for turrets.
So it turns out it actually was the secondary code triggering the Assertion, because `ship_system->weapons.secondary_bank_weapons[]` was full of 0s. Subach HL-7 is weapon type 0, and obviously doesn't have a `cargo_size`. I see no reason to iterate through `MAX_SHIP_PRIMARY_BANKS`/`MAX_SHIP_SECONDARY_BANKS` if there aren't that many banks being used anyway.
2015-08-12 21:18:37 -07:00
MageKing17 1684b7f85e Make a few more changes to ship_info based on m!m's notes.
Copy constructor and copy-assignment are made private and unimplemented (may cause problems on VS 2010/2013? I have a vague memory of something similar needing to be removed for 2010 to work; we could always wrap 'em in an _MSC_VER check, of course). Speaking of an _MSC_VER check, adds a define for `NOEXCEPT` to `noexcept`, but only if we're not using a version of Visual Studio prior to 2015 (when `noexcept` support was added). It *should* allow the move constructor for ship_info to be used whenever the vector resizes both pre- and post-VS 2015 (and on non-MS compilers), but it could use some testing. ship_info::clone() made public (and used for ship templates instead of copy-assignment), and ship_info::move() now takes a ship_info&& object (and move-assignment/constructor use std::move() to keep it an rvalue).
2015-08-12 20:52:56 -07:00
MageKing17 4fb6f3d459 Changing a Ship_info.size() to !Ship_info.empty() as pointed out by m!m. 2015-08-12 14:39:42 -07:00
MageKing17 439ea76475 Adding static_cast<int>() to locations pointed out by m!m. 2015-08-12 14:39:12 -07:00
MageKing17 529fd197d8 Revert unintended missiongoals.cpp changes from vectorization commit.
I may make a separate pull request for this at some point, but it definitely doesn't belong here.
2015-08-12 14:23:36 -07:00
MageKing17 389a1a1a3d Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info 2015-08-12 14:10:10 -07:00
m!m b3aec16833 Merge pull request #271 from MageKing17/bugfix/fix-primary-cargo-size-check
Fix cargo size check for primary weapons I screwed up in PR 269.
2015-08-12 23:07:37 +02:00
MageKing17 28d04bfee4 Fix cargo size check for primary weapons I screwed up in PR 269.
Should've checked more than just that FRED was working... d'oh.
2015-08-12 14:03:33 -07:00
MageKing17 6985b198ec Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info
Conflicts:
	code/ship/ship.cpp
2015-08-12 13:25:34 -07:00
MageKing17 1aa7af5167 Merge pull request #263 from Echelon9/fix/printf-issues
Resolve numerous format string issues
2015-08-12 13:05:17 -07:00
MageKing17 d953b2e668 Fix the Num_ship_classes reference added by PR #269 to Ship_info.size(). 2015-08-11 14:42:21 -07:00
MageKing17 4fc84e61c6 Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info
Conflicts:
	code/ship/ship.cpp
2015-08-11 14:27:48 -07:00
MageKing17 92a5839bb1 Merge pull request #270 from DahBlount/Turret_Ammo_Fix
Turret Ammo Fix: Default Bank and Ammo Removal location
2015-08-11 14:20:10 -07:00
MageKing17 b15dfcb906 Merge pull request #269 from MageKing17/bugfix/turret-ammo-FRED-support
Hopefully fix FRED and turret ammo.
2015-08-11 14:15:55 -07:00
MageKing17 cd5824073c Fix another copy-paste error, this time in the assertions. 2015-08-10 10:05:44 -07:00
MageKing17 36f7ac9ee3 Fix another copy-paste error.
Well, two copy-paste errors.
2015-08-09 18:12:09 -07:00
DahBlount 5c3d7b0f64 Turret bank fix and ammo removal
A turret's current_primary_bank/current_secondary_bank is always
initialized to -1, this is set to 0 if it is still -1 when a turret
tries to fire. Ammo removal for swarm and corkscrew weapons is now done
using a single flag check instead of the original two.
2015-08-09 19:29:16 -05:00
MageKing17 51be6aee77 Fix copy-paste error.
Whoops!
2015-08-09 17:21:22 -07:00
MageKing17 d59ee5953d Make subsys_set() use cargo_size for ammo. 2015-08-09 17:13:19 -07:00
MageKing17 3b43614ae9 Hopefully fix FRED and turret ammo.
Adds a get_max_ammo_count_for_turret_bank() function that the weapon editor can use for turrets instead of trying to hack the behavior into get_max_ammo_count_for_bank somehow. Adjusts weaponeditordlg.cpp to use it, and also fixes missionparse.cpp so that ammo values get correctly converted from a percentage to the number of actual missiles (but only when FRED isn't running).
2015-08-09 16:53:50 -07:00
Echelon9 930f386064 Generalise warning string if we can't provide callback operator information. 2015-08-08 18:10:26 +10:00
m!m 4a154e630f Merge pull request #267 from DahBlount/Turret-ammo-sexp-desc
Fix Turret Ammo Setter SEXP Descriptions
2015-08-07 18:05:10 +02:00
DahBlount 5412f16352 Fix the descriptions of the turret ammo setter sexps
The setter Sexps incorrectly had the same descriptions as the getter
sexps.
2015-08-07 09:02:43 -07:00
Echelon9 efc4d62bd0 Change s/Error code/Error message/ in GUISystem::ParseClassInfo() 2015-08-06 17:56:53 +10:00
Echelon9 8160cd40dc Change s/Error code/Error message/ in parse_glowpoint_table() 2015-08-06 17:54:41 +10:00
Fabian Woltermann 3f4861271b Merge pull request #264 from MageKing17/update/2015-project-files
Update the VS 2015 project files.
2015-08-06 09:34:39 +02:00
MageKing17 1ffe2629cf Add collision_lod and auto_shield_spread_mid_span to clone() and move(). 2015-08-06 00:28:04 -07:00
MageKing17 dc80ae0c9a Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info
Conflicts:
	code/ship/ship.cpp
2015-08-06 00:25:42 -07:00
MageKing17 87ce8a47fc Update the VS 2015 project files.
These are basically just the 2013 project files updated to use the v140_xp toolset, but this gives the MSVC_2015 folder the same improvements that the MSVC_2013 folder got in commit 66bddb9.
2015-08-06 00:13:41 -07:00
Echelon9 c15e7ec28c Fix: warning: format not a string literal and no format arguments [-Wformat-security] 2015-08-05 21:07:05 +10:00
Echelon9 aee7ee6322 Fix: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘const char*’ [-Wformat=] 2015-08-05 20:57:21 +10:00
Echelon9 6dd45acb45 Fix: warning: format not a string literal and no format arguments [-Wformat-security] 2015-08-05 20:44:37 +10:00
Echelon9 3385a0a6a3 Fix: warning: format not a string literal and no format arguments [-Wformat-security] 2015-08-05 20:38:10 +10:00
Echelon9 8f9fd97902 Fix: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=] 2015-08-05 20:29:41 +10:00
Echelon9 85c8c718bf Fix missing format string specifier. 2015-08-05 20:20:15 +10:00
Echelon9 4f4449958b Fix: warning: format ‘%s’ expects a matching ‘char*’ argument [-Wformat=] 2015-08-05 20:14:48 +10:00
Echelon9 cffdbe932f Fix: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=] 2015-08-05 20:12:41 +10:00
Echelon9 81fa44472d Fix: warning: too many arguments for format [-Wformat-extra-args] 2015-08-05 20:08:02 +10:00
Echelon9 0388fb065c Fix: warning: format ‘%s’ expects a matching ‘char*’ argument [-Wformat=] 2015-08-05 20:05:19 +10:00
Echelon9 4328134c82 Fix: warning: format not a string literal and no format arguments [-Wformat-security] 2015-08-05 20:00:07 +10:00
Echelon9 e1c38230af Fix: warning: format not a string literal and no format arguments [-Wformat-security] 2015-08-05 19:59:09 +10:00
Echelon9 9f2a2dd4ed Ensure sufficient format string specifiers. 2015-08-05 19:57:58 +10:00
Echelon9 13837b07f7 Ensure sufficient format string specifiers are present. 2015-08-05 19:55:03 +10:00
Echelon9 c4ce711171 Ensure sufficient format string specifiers are present. 2015-08-05 19:51:06 +10:00
Echelon9 d686d28053 Ensure sufficient format string specifier. 2015-08-05 19:48:58 +10:00
Echelon9 b260d92898 Fix too many variables for format string. 2015-08-05 19:45:42 +10:00
Echelon9 d14b8b9a79 Fix Error() with two few format string specifiers. 2015-08-05 19:44:21 +10:00
MageKing17 33cd9c6233 Merge pull request #262 from Echelon9/fix/issue261
Correct Warning() in parse_startbl
2015-08-05 01:28:39 -07:00
Echelon9 c829808dd7 Correct Warning() in parse_startbl 2015-08-05 16:48:49 +10:00
Fabian Woltermann aed2b60bcf Merge pull request #256 from Echelon9/fix/issue255
Resolve Coverity-reported incorrect for() loops.
2015-08-03 12:58:13 +02:00
Fabian Woltermann 5b91bee129 Merge pull request #259 from ln-zookeeper/fotg_to_master
Added $Collision LOD ship table property, for using a LOD for collisi…
2015-08-03 12:57:47 +02:00
Lari Nieminen 1bf86532fe Added $Collision LOD ship table property, for using a LOD for collision detection 2015-08-03 13:20:14 +03:00
MageKing17 f5259eb6be Merge pull request #258 from Echelon9/fix/issue257
Add correct argument to printf format string.
2015-08-03 02:22:35 -07:00
Echelon9 bdc90c007b Ensure grammar works as a whole. 2015-08-03 19:04:10 +10:00
Echelon9 88ca967d3f Improve the warning documentation associated with a faulty ship copy flag. 2015-08-03 19:03:17 +10:00
Echelon9 9ea2ae4299 Add correct argument to printf format string. 2015-08-03 18:01:13 +10:00
Echelon9 3b26eb85ae Resolve Coverity-reported incorrect for() loops. 2015-08-02 20:02:44 +10:00
Fabian Woltermann 4aab4a969a Merge pull request #249 from asarium/printf_checks
Add format specifying macros
2015-08-01 07:47:22 +02:00
m!m 0f2562a29c Merge pull request #254 from The-E/better_assertions
Make this assertion in modelanim a bit more useful.
2015-07-31 22:43:36 +02:00
The E 0450ce7621 Make this assertion in modelanim a bit more useful. 2015-07-31 22:25:25 +02:00
Fabian Woltermann 44c4c7de76 Merge pull request #251 from DahBlount/turret_ammo
Turret Ammo Implementation
2015-07-31 11:45:01 +02:00
Fabian Woltermann aff0328b4f Merge pull request #253 from jg18/fix_openal_log
Log OpenAL info for selected device.
2015-07-31 11:44:11 +02:00
jg18 b50bd7586c Log OpenAL info for selected device.
Fix the issue pointed out by Yarn where the OpenAL info for the default
device was being logged instead of the info for the selected
device. http://www.hard-light.net/forums/index.php?topic=90070.0.
2015-07-30 15:27:36 -07:00
DahBlount d973c9e147 Add cases for turret ammo setter multi_sexps
Can't believe I forgot this part. This just ensures the sexps actually
work.
2015-07-30 15:22:31 -05:00
DahBlount 9e3cb6baa3 Multi_SEXP Turret Ammo Functions
This adds multiplayer functionality to the Turret getter and setter
SEXPs.
2015-07-30 15:06:04 -05:00
DahBlount 0fd43dad75 Turret Ammo SEXPs
This adds getter and setter SEXPs for turret ammo.
"turret-get-primary-ammo"
"turret-get-secondary-ammo"
"turret-set-primary-ammo"
"turret-set-secondary-ammo"

I also forgot to make turrets that don't have the "use multiple guns"
flag set switch banks if their first bank is empty, so that has been
fixed as well.
2015-07-29 12:25:24 -05:00
DahBlount 688baa2bb6 Turret Ammo Implementation
This creates the foundation of turret ammo through the "turret use ammo" subsystem flag. Turret ammo works in the same manner as ship ammo, where the ammo is equal to bank capacity divided by the cargo size of the weapon. This was tested using the Blue Planet: War in Heaven mod.
Test case: UEFg Narayana turrets 19 through 21, all of which contain Apocalypse torpedos with a $Cargo Size: of 2.5, were changed to use ammo with a $SBank Capacity of 20, resulting in a total ammo capacity of 8 torpedos. The Narayana was ordered to attack a GTCv Diomedes; it fired 8 torpedos each from turrets 19 through 21 before stopping. The mission was left to proceed for an additional 2 minutes, in which time the Narayana did not fire any more torpedos. Note: The Apocalypse takes 20 seconds to fire each 4 torpedo burst.
Conclusion: Success
2015-07-28 12:32:08 -05:00
Cliff Gordon 1b3af6fea6 Merge pull request #245 from ln-zookeeper/fotg_to_master
Added a +Minimum Weapon Span auto spread shield option to control the…
2015-07-27 09:12:02 -05:00
Fabian Woltermann 1d46578f00 Merge pull request #250 from asarium/antipodes_/fix/mac_psn
Proposed fix for #248
2015-07-26 15:25:04 +02:00
asarium 9e4ab0342c Proposed fix for #248 2015-07-26 14:23:13 +02:00
asarium d93f2e9d26 Add format specifying macros 2015-07-26 14:08:31 +02:00
Lari Nieminen cacad0ba70 Fixed possibility of +Minimum Weapon Span breaking with modular tables. 2015-07-25 01:14:03 +03:00
MageKing17 1b514de28e Merge pull request #247 from chief1983/fix/cid_1204285_divide_by_zero
[fix/cid_1204285_divide_by_zero] Fix CID 1204285: Division by zero
2015-07-24 13:49:05 -07:00
Cliff Gordon f47bbed3ef [fix/cid_1204285_divide_by_zero] Fix CID 1204285: Division by zero in set_currentItem() 2015-07-24 11:59:02 -05:00
MageKing17 33d83fe4fe Merge pull request #246 from ln-zookeeper/master
Fixed bug with ship-ship collisions incorrectly choosing which quadra…
2015-07-24 00:32:35 -07:00
Lari Nieminen 202a4077a4 Fixed bug with ship-ship collisions incorrectly flashing a shield quadrant on the light ship. 2015-07-24 10:08:59 +03:00
Lari Nieminen 7b2c992380 Added a +Minimum Weapon Span auto spread shield option to control the minimum distance weapons must have traveled before being allowed to hit the shield. 2015-07-21 21:59:31 +03:00
m!m c7bf2395a5 Merge pull request #244 from chief1983/antipodes_/merge_ce69e71
Antipodes /merge ce69e71
2015-07-19 09:23:01 +02:00
Cliff Gordon (chief1983) 7314b0a65f Merge remote-tracking branch 'origin/master' into antipodes
Conflicts:
	projects/MSVC_2013/Fred2.vcxproj
2015-07-18 18:51:19 -05:00
Cliff Gordon ce69e7179e Merge pull request #243 from chief1983/fix/sse_fred_name
Fix the output Fred SSE target name.
2015-07-18 18:46:48 -05:00
Cliff Gordon (chief1983) fc6765144d Fix the output Fred SSE target name. Edited in VS2013 which fixed the file's line endings to CRLF. 2015-07-18 11:02:01 -05:00
Fabian Woltermann ce22e3a0d4 Merge pull request #239 from PeterMitsis/math-refactoring
Math refactoring
2015-07-17 13:35:42 +02:00
Fabian Woltermann be628af117 Merge pull request #223 from ln-zookeeper/master
Fixes Mantis #2436: Mouse controls ignore the axis binds.
2015-07-17 13:16:58 +02:00
Fabian Woltermann 27774594f3 Merge pull request #238 from asarium/antipodes_/fixNULL
Don't compare NULL with integer
2015-07-16 20:55:47 +02:00
asarium 5a107d3834 From chief1983: Also fix errors in rtvoice.cpp 2015-07-16 20:24:36 +02:00
Cliff Gordon f5e97b6fc3 Merge pull request #241 from chief1983/osx_sdl203
[osx_sdl203] Upgrade the SDL2 framework to the latest 2.0.3.
2015-07-15 15:15:07 -05:00
Cliff Gordon 2b36cc48c7 [osx_sdl203] Upgrade the SDL2 framework to the latest 2.0.3. 2015-07-15 14:01:47 -05:00
asarium 273af3afdf Don't mix NULL and integers 2015-07-15 17:26:18 +02:00
Cliff Gordon 75f1a5ad5c Merge pull request #240 from chief1983/fix/badmerge_configure
[fix/badmerge_configure] Fix a bad merge in configure.ac
2015-07-15 10:14:10 -05:00
Cliff Gordon f3d15d9a38 [fix/badmerge_configure] Fix a bad merge in configure.ac that duplicated some text. 2015-07-15 09:23:53 -05:00
Peter Mitsis 83d00839ed fvi: Refactor solution to quadratic formula
The classic solution to the quadratic equation ...
     a*x*x + b*x + c = 0
is ...
         -b +- sqrt(b*b - 4*ac)
     x = ----------------------
                 2*a

This can be optimized by substituting b = 2*B.
         -2*B +- sqrt((2*B)*(2*B) - 4*a*c)
     x = ---------------------------------
                       2*a

This expands to ...
         -2*B +- sqrt(4*B*B - 4*a*c)
     x = ---------------------------
                    2*a

And simplifies to ...
         -2*B +- 2*sqrt(B*B - 4*a*c)
     x = ---------------------------
                    2*a

         -B +- sqrt(B*B - a*c)
     x = ---------------------
                  a

Signed-off-by: Peter Mitsis <[email protected]>
2015-07-15 09:18:47 -04:00
Peter Mitsis b72cf669b8 Refactor bez_fact()
Uses an array of precalculated factorials that are accessed as a lookup table
instead of computing the factorials at runtime.  This cuts down on compiled
code bloat (compiler was both unrolling and inlining the computation's loop)
everywhere it was used.

NOTE: The original implementation returned an 'int'.  As a result, the largest
uncorrupted factorial it could compute was 12!.  For this reason, the lookup
table only goes up to 12!.

Signed-off-by: Peter Mitsis <[email protected]>
2015-07-15 09:08:19 -04:00
Peter Mitsis 9d3dd5c322 Refactor macros fl_radians() and fl_degrees()
Rejiggers the macros fl_radians() and fl_degrees() to avoid unnecessary
operations.  The new placement of the parentheses permit the compiler to
evaluate (PI / 180.f) and (180.f / PI) at compile time rather than run time.

Signed-off-by: Peter Mitsis <[email protected]>
2015-07-15 09:08:19 -04:00
Fabian Woltermann f3adfb6afc Merge pull request #236 from chief1983/fix/osx_xcode
[fix/osx_xcode] Xcode can finally compile SDL Everywhere
2015-07-15 14:57:30 +02:00
Cliff Gordon 876af805bb [fix/osx_xcode] Don't need joy-unix.cpp in OS X now, with joy-sdl.cpp doing its job. 2015-07-13 16:36:57 -05:00
Cliff Gordon 25bce65f5a [fix/osx_xcode] Should have done this a year and a half ago: Remove the SDLMain.* files as they are not needed with SDL2. 2015-07-13 16:36:57 -05:00
Cliff Gordon 3022fc3385 Accidentally committed changes to version string. 2015-07-13 16:36:57 -05:00
Cliff Gordon 0a7e7e84c9 update xcode with recommended changes in version 6.4. 2015-07-13 16:36:57 -05:00
Cliff Gordon fc45026140 Test fix. 2015-07-13 16:36:56 -05:00
Cliff Gordon bfaf474c9e Merge remote-tracking branch 'origin/master' into antipodes 2015-07-13 16:36:40 -05:00
Fabian Woltermann 5f39c386ef Merge pull request #234 from Echelon9/fix/clean-build
Clean up GCC build warnings
2015-07-12 09:54:30 +02:00
Echelon9 3e8278d698 Fix: model/modelread.cpp: warning: variable ‘flags’ set but not used [-Wunused-but-set-variable] 2015-07-11 22:47:25 +10:00
Echelon9 37cf848f51 Fix: model/modelrender.cpp:2898:9: warning: declaration of ‘view_pos’ shadows a previous local [-Wshadow] 2015-07-11 22:36:42 +10:00
Echelon9 95f615a894 Fix: bmpman/bmpman.cpp: warning: enumeration value ‘x’ not handled in switch [-Wswitch] 2015-07-11 22:30:12 +10:00
Echelon9 bae2d3116b Fix: controlconfig/controlsconfig.cpp:2116:13: warning: declaration of ‘j’ shadows a previous local [-Wshadow] 2015-07-11 22:15:49 +10:00
Echelon9 542c794e72 Fix: object/collideshipship.cpp:1159:12: warning: variable ‘q’ set but not used [-Wunused-but-set-variable] 2015-07-11 22:08:52 +10:00
Echelon9 d029b82d98 Fix: ai/aicode.cpp:11855:9: warning: variable ‘dist_to_f2’ set but not used [-Wunused-but-set-variable] 2015-07-11 22:04:41 +10:00
Echelon9 ad8064ef81 Fix warning: variable ‘dist’ set but not used [-Wunused-but-set-variable] 2015-07-11 21:58:07 +10:00
Echelon9 a4e12d135b Fix: ai/aibig.cpp:1266:10: warning: variable ‘box_dist’ set but not used [-Wunused-but-set-variable] 2015-07-11 21:39:49 +10:00
Echelon9 053ae6d287 Fix: modelrender.h:86:7: warning: ‘model_render_params::Replacement_textures’ will be initialized after [-Wreorder] 2015-07-11 21:28:01 +10:00
Fabian Woltermann 15bceee125 Merge pull request #232 from asarium/fix/snd_cfile
Fixes Mantis 3168: snd_load leaks cfile handles if it can't parse a file.
2015-07-11 12:29:42 +02:00
Echelon9 08e50885cb Fix: warning: ‘opengl_vertex_buffer::ibo_size’ will be initialized after [-Wreorder] 2015-07-11 20:18:34 +10:00
asarium e6dbb28b48 Fix for Mantis 3168: snd_load leaks cfile handles if it can't parse a file. 2015-07-11 11:36:21 +02:00
Echelon9 1e151865d4 Fix: object/collideshipweapon.cpp:67:185: warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:45:38 +10:00
Echelon9 c2a2ef5682 Fix: object/collideshipweapon.cpp:39:63: warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:42:15 +10:00
Echelon9 3acc777afe Fix: model/modelread.cpp: warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:40:12 +10:00
Echelon9 aa7bd5bf2c Fix: asteroid/asteroid.cpp:1614:99: warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:32:36 +10:00
Echelon9 ca2cd63a95 Fix: asteroid/asteroid.cpp:949:10: warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:30:55 +10:00
Echelon9 1787b95498 Fix: ai/aicode.cpp:14896:75: warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:28:59 +10:00
Echelon9 2586198e0e Fix: asteroid/asteroid.cpp:1653:68: warning: declaration of ‘asteroid_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:14:38 +10:00
Echelon9 b7e76de184 Fix: asteroid/asteroid.cpp:1614:98: warning: declaration of ‘asteroid_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:12:27 +10:00
Echelon9 f656232030 Fix: asteroid/asteroid.cpp:1477:50: warning: declaration of ‘asteroid_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:10:02 +10:00
Echelon9 e4e3064bea Fix: asteroid/asteroid.cpp:1363:92: warning: declaration of ‘asteroid_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:07:37 +10:00
Echelon9 f804539a15 Fix: debris/debris.cpp:846:10: warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:04:25 +10:00
Echelon9 ca9ae8bb8e Fix: nebula/neb.cpp:1422:37: warning: declaration of ‘eye’ shadows a global declaration [-Wshadow] 2015-07-06 23:01:21 +10:00
Echelon9 767b39fbbc Fix: nebula/neb.cpp:1416:33: warning: declaration of ‘eye’ shadows a global declaration [-Wshadow] 2015-07-06 22:59:55 +10:00
Echelon9 6d0996d90c Fix: graphics/grstub.cpp:736:71: warning: declaration of ‘shader’ shadows a global declaration [-Wshadow] 2015-07-06 22:57:12 +10:00
Echelon9 294cf79e04 Fix: graphics/gropenglshader.cpp: warning: declaration of ‘shader’ shadows a global declaration [-Wshadow] 2015-07-06 22:54:10 +10:00
Echelon9 b7864cd2aa Fix: graphics/gropenglshader.cpp:231:73: warning: declaration of ‘shader’ shadows a global declaration [-Wshadow] 2015-07-06 22:52:01 +10:00
Echelon9 4bf5f15f72 Fix: graphics/gropenglpostprocessing.cpp:682:79: warning: declaration of ‘shader’ shadows a global declaration [-Wshadow] 2015-07-06 22:49:38 +10:00
Echelon9 4a0e3b4c40 Fix: graphics/generic.cpp:35:117: warning: declaration of ‘anim’ shadows a global declaration [-Wshadow] 2015-07-06 22:46:23 +10:00
Echelon9 3860951b6c Fix: graphics/*.cpp warning: declaration of ‘light’ shadows a global declaration [-Wshadow] 2015-07-06 22:36:10 +10:00
Echelon9 54003a2622 Fix: debris/debris.cpp:850:10: warning: declaration of ‘light’ shadows a global declaration [-Wshadow] 2015-07-06 22:30:50 +10:00
Echelon9 b7bc60708c Fix: asteroid/asteroid.cpp:953:10: warning: declaration of ‘light’ shadows a global declaration [-Wshadow] 2015-07-06 22:29:04 +10:00
Echelon9 dc5651ab70 Fix: object/collideshipship.cpp:539:10: warning: declaration of ‘light’ shadows a global declaration [-Wshadow] 2015-07-06 22:26:31 +10:00
Echelon9 f12dc5478b Fix: ai/aicode.cpp: warning: declaration of ‘color’ shadows a global declaration [-Wshadow] 2015-07-06 22:19:28 +10:00
Echelon9 8051bac868 Fix: ai/aigoals.cpp:203:48: warning: declaration of ‘ai_goal’ shadows a global declaration [-Wshadow] 2015-07-06 22:15:18 +10:00
Echelon9 d94823ef77 Fix: graphics/gropenglbmpman.cpp:561:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] 2015-07-06 21:47:01 +10:00
Echelon9 eda6f33d77 Fix: graphics/gropenglbmpman.cpp:561:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] 2015-07-06 21:41:31 +10:00
Echelon9 9db610ef2c Fix: network/multiutil.cpp:692:76: warning: declaration of ‘net_player’ shadows a global declaration [-Wshadow] 2015-07-06 21:30:27 +10:00
Echelon9 2b8ef9e1fd Fix: graphics/2d.cpp:2142:1: warning: declaration of ‘team_color’ shadows a global declaration [-Wshadow] 2015-07-06 21:19:56 +10:00
Echelon9 1aa858a164 Fix: graphics/2d.cpp:1874:7: warning: variable ‘t0’ set but not used [-Wunused-but-set-variable] 2015-07-06 21:17:48 +10:00
Echelon9 aae7c47748 Fix: lab/lab.cpp:943:9: warning: declaration of ‘j’ shadows a previous local [-Wshadow] 2015-07-06 21:14:45 +10:00
Echelon9 53164a169c Fix: mission/missioncampaign.cpp:1200:12: warning: declaration of ‘mission’ shadows a global declaration [-Wshadow] 2015-07-06 21:12:11 +10:00
Echelon9 fe1b607214 Fix: mission/missioncampaign.cpp:1012:12: warning: declaration of ‘mission’ shadows a global declaration [-Wshadow] 2015-07-06 21:08:00 +10:00
Echelon9 040d157644 Fix: mission/missioncampaign.cpp:1088:12: warning: declaration of ‘mission’ shadows a global declaration [-Wshadow] 2015-07-06 21:03:30 +10:00
Echelon9 475155d62f Fix: mission/missioncampaign.cpp:1600:6: warning: declaration of ‘mission’ shadows a global declaration [-Wshadow] 2015-07-06 20:58:53 +10:00
Echelon9 85a0bda946 Fix: model/modelanim.cpp:536:78: warning: declaration of ‘anim’ shadows a global declaration [-Wshadow] 2015-07-06 20:54:14 +10:00
Echelon9 f2c8aa665f Fix: missionui/missionshipchoice.cpp:923:9: warning: declaration of ‘header’ shadows a global declaration [-Wshadow] 2015-07-06 19:51:45 +10:00
Fabian Woltermann 181098e1e4 Merge pull request #230 from PeterMitsis/math-optimizations
math/vecmat optimizations
2015-07-06 02:42:14 -07:00
Echelon9 66257146b7 Fix: model/modelcollide.cpp:1215:36: warning: declaration of ‘mc_info’ shadows a global declaration [-Wshadow] 2015-07-06 19:40:21 +10:00
Fabian Woltermann d4d60b2645 Merge pull request #226 from asarium/fix/audiostr_cfile
Use the CFILE system to handle audio IO
2015-07-06 01:42:24 -07:00
Fabian Woltermann 368dcdddc2 Merge pull request #228 from asarium/antipodes
Sync Antipodes
2015-07-06 01:41:52 -07:00
Echelon9 60d1234abd Fix: model/modelread.cpp:270:12: warning: declaration of ‘i’ shadows a previous local [-Wshadow] 2015-07-05 17:13:01 +10:00
Echelon9 2bac9ba5fa Fix: model/modelrender.cpp:780:55: warning: declaration of ‘color’ shadows a global declaration [-Wshadow] 2015-07-05 17:07:39 +10:00
Echelon9 6e273ccd7f Fix: gamehelp/contexthelp.cpp:391:9: warning: declaration of ‘font’ shadows a global declaration [-Wshadow] 2015-07-05 17:01:37 +10:00
Echelon9 4885807d82 Fix: iff_defs/iff_defs.cpp:68:4: warning: declaration of ‘temp_color_t’ shadows a previous local [-Wshadow] 2015-07-05 16:57:35 +10:00
Echelon9 444f830fdc Fix: network/multi_voice.cpp: warning: parameter set but not used [-Wunused-but-set-parameter] 2015-07-05 16:51:16 +10:00
Echelon9 e98d84314a Fix: network/multimsgs.cpp:8473:70: warning: declaration of ‘bolt_type’ shadows a global declaration [-Wshadow] 2015-07-05 16:44:48 +10:00
Echelon9 5e9fd26028 Fix: network/multimsgs.cpp:8493:7: warning: declaration of ‘bolt_type’ shadows a global declaration [-Wshadow] 2015-07-05 16:42:24 +10:00
Echelon9 3a3e901249 Fix: network/multiteamselect.cpp:1720:7: warning: declaration of ‘wing’ shadows a global declaration [-Wshadow] 2015-07-05 16:40:04 +10:00
Echelon9 1f8c1dccde Fix: object/collidedebrisweapon.cpp:100:10: warning: declaration of ‘weapon’ shadows a global declaration [-Wshadow] 2015-07-05 16:35:11 +10:00
Echelon9 0dc48f8470 Fix: object/collidedebrisweapon.cpp:45:10: warning: declaration of ‘weapon’ shadows a global declaration [-Wshadow] 2015-07-05 16:32:57 +10:00
Echelon9 83a8b2bee5 Fix: object/collideshipship.cpp:457:115: warning: declaration of ‘light’ shadows a global declaration [-Wshadow] 2015-07-05 16:27:21 +10:00
Echelon9 2c4fb4286c Fix: object/collideshipweapon.cpp:470:10: warning: declaration of ‘weapon’ shadows a global declaration [-Wshadow] 2015-07-05 16:19:20 +10:00
Echelon9 570f6dd581 Fix: object/collideshipship.cpp:1316:138: warning: declaration of ‘mc_info’ shadows a global declaration [-Wshadow] 2015-07-05 16:14:24 +10:00
Echelon9 b326e77574 Fix: object/collideshipweapon.cpp:543:85: warning: declaration of ‘weapon’ shadows a global declaration [-Wshadow] 2015-07-05 15:55:15 +10:00
Echelon9 6d6d3e99e5 Fix: object/collideweaponweapon.cpp:168:10: warning: variable ‘dist’ set but not used [-Wunused-but-set-variable] 2015-07-05 14:25:53 +10:00
Echelon9 c7045147f3 Fix: object/collideshipship.cpp:1316:126: warning: declaration of ‘light’ shadows a global declaration [-Wshadow] 2015-07-05 14:17:53 +10:00
Peter Mitsis 3495b190d4 Streamline vm_quaternion_rotate()
Calculates sinf(theta * 0.5) once only instead of three times.

Signed-off-by: Peter Mitsis <[email protected]>
2015-07-05 00:03:31 -04:00
Peter Mitsis 62a7865f94 Streamline vm_angle_2_matrix()
The values of sin(0) and cos(0) are well known and do not need to be calculated
at run time.

Signed-off-by: Peter Mitsis <[email protected]>
2015-07-05 00:03:31 -04:00
Peter Mitsis 8193dbb316 Streamline vm_vec_avg_n()
Instead of performing three consecutive divisions, vm_vec_avg_n() now performs
one division at the start and three multiplications at the end.  Recall that
multiplication is faster than division.

Signed-off-by: Peter Mitsis <[email protected]>
2015-07-05 00:03:31 -04:00
Peter Mitsis 95d1701794 Remove unnecessary checking before atan2_safe()
The routine atan2_safe() already contains a test that checks if both parameters
are zero--that is the point of the routine.  Thus, there is no need for the
caller of atan2_safe() to perform that same check.

Signed-off-by: Peter Mitsis <[email protected]>
2015-07-05 00:03:31 -04:00
Peter Mitsis 945f655e0e Remove unnecessary vm_vec_normalize() checks
The routine vm_vec_normalize() always returns a value greater than zero.
Thus, there is no need to test its return value for values that are less
than or equal to zero.

Signed-off-by: Peter Mitsis <[email protected]>
2015-07-05 00:03:31 -04:00
Peter Mitsis 11b65fe0bf Remove unnecessary vm_vec_copy_normalize() checks
The routine vm_vec_copy_normalize() always returns a value greater than zero.
Thus, there is no need to test its return value for values that are less than
or equal to zero.

Signed-off-by: Peter Mitsis <[email protected]>
2015-07-05 00:03:27 -04:00
Echelon9 6618165926 Fix: model/modelinterp.cpp:4342:14: warning: declaration of ‘j’ shadows a previous local [-Wshadow] 2015-07-05 00:59:13 +10:00
Echelon9 6950c69ebb Fix: model/modelinterp.cpp:2034:44: warning: declaration of ‘gpoi’ shadows a previous local [-Wshadow] 2015-07-05 00:54:29 +10:00
Echelon9 b8ff93dad2 Fix: model/modelinterp.cpp:2603:43: warning: declaration of ‘gpoi’ shadows a previous local [-Wshadow] 2015-07-05 00:52:39 +10:00
Echelon9 c220480075 Fix: lab/lab.cpp:2497:45: warning: declaration of ‘color’ shadows a global declaration [-Wshadow] 2015-07-05 00:40:13 +10:00
Echelon9 182b297af4 Fix: model/modelrender.cpp:2560:10: warning: variable ‘objp’ set but not used [-Wunused-but-set-variable] 2015-07-05 00:30:34 +10:00
Echelon9 a0527afd55 Fix: ship/ship.cpp:3132:14: warning: declaration of ‘i’ shadows a previous local [-Wshadow] 2015-07-05 00:04:05 +10:00
Echelon9 9283ff8227 Fix: controlconfig/controlsconfig.cpp:669:9: warning: variable ‘k’ set but not used [-Wunused-but-set-variable] 2015-07-04 23:51:24 +10:00
Echelon9 769e98fe4c Fix: controlconfig/controlsconfig.cpp:669:9: warning: variable ‘j’ set but not used [-Wunused-but-set-variable] 2015-07-04 23:46:38 +10:00
Echelon9 3c48d81a52 Fix: controlconfig/controlsconfig.cpp:1443:27: warning: variable ‘len’ set but not used [-Wunused-but-set-variable] 2015-07-04 23:41:59 +10:00
Echelon9 7f100c439a Fix: controlconfig/controlsconfig.cpp:1442:18: warning: variable ‘jptr’ set but not used [-Wunused-but-set-variable] 2015-07-04 23:34:40 +10:00
Echelon9 481ec12450 Fix: bmpman/bmpman.cpp:2671:12: warning: variable ‘bmp’ set but not used [-Wunused-but-set-variable] 2015-07-04 23:29:00 +10:00
Echelon9 312648668c Fix: anim/animplay.cpp:257:25: warning: variable ‘render_time’ set but not used [-Wunused-but-set-variable] 2015-07-04 23:20:18 +10:00
Echelon9 f4aa493f59 Fix: anim/animplay.cpp:257:25: warning: variable ‘decompress_time’ set but not used [-Wunused-but-set-variable] 2015-07-04 23:16:08 +10:00
Echelon9 039ad64a33 Fix: ai/aicode.cpp:10715:9: warning: variable ‘dist’ set but not used [-Wunused-but-set-variable] 2015-07-04 19:03:09 +10:00
Echelon9 c83a2ea2e8 Fix: ai/aicode.cpp:8169:24: warning: variable ‘time_to_enemy’ set but not used [-Wunused-but-set-variable] 2015-07-04 18:58:10 +10:00
Echelon9 edbedeb84a Fix: ai/aicode.cpp:8017:10: warning: variable ‘eshipp’ set but not used [-Wunused-but-set-variable] 2015-07-04 17:39:44 +10:00
Echelon9 d855154fa9 Fix: graphics/gropenglshader.cpp:387:7: warning: variable ‘in_error’ set but not used [-Wunused-but-set-variable] 2015-07-04 17:33:22 +10:00
Echelon9 7fea629121 Fix: graphics/gropengltnl.cpp:696:8: warning: variable ‘rval’ set but not used [-Wunused-but-set-variable] 2015-07-04 17:10:17 +10:00
Echelon9 183f0615e2 Fix: graphics/gropengltnl.cpp:812:6: warning: variable ‘render_pass’ set but not used [-Wunused-but-set-variable] 2015-07-04 17:08:41 +10:00
Echelon9 e9330b4f5f Fix: graphics/gropengltnl.cpp:1378:6: warning: variable ‘zbuff’ set but not used [-Wunused-but-set-variable] 2015-07-04 16:52:50 +10:00
Echelon9 785398657c Fix: menuui/readyroom.cpp:1175:15: warning: variable ‘z’ set but not used [-Wunused-but-set-variable] 2015-07-04 16:22:59 +10:00
Echelon9 fff2d5280c Fix: model/modelrender.cpp:2560:8: warning: variable ‘shipp’ set but not used [-Wunused-but-set-variable] 2015-07-04 16:18:38 +10:00
Echelon9 cd503fd2e4 Fix: object/objcollide.cpp:1247:8: warning: variable ‘max’ set but not used [-Wunused-but-set-variable] 2015-07-04 16:10:15 +10:00
Echelon9 e7e046f949 Fix: object/objcollide.cpp:1248:8: warning: variable ‘overlap_min’ set but not used [-Wunused-but-set-variable] 2015-07-04 16:08:40 +10:00
Echelon9 6e6ff3c7c0 Fix: object/objectsort.cpp: warning: variable ‘wp’ set but not used [-Wunused-but-set-variable] 2015-07-04 16:06:13 +10:00
Echelon9 4f4fe00b97 Fix: ship/ship.cpp:18381:6: warning: variable ‘clip_started’ set but not used [-Wunused-but-set-variable] 2015-07-04 16:01:36 +10:00
Echelon9 98d6b6ce8b Fix: weapons.cpp:7374:8: warning: variable ‘clip_plane’ set but not used [-Wunused-but-set-variable] 2015-07-04 15:55:15 +10:00
asarium 1d7ea819a3 Fix linux compilation 2015-07-03 19:34:32 +02:00
asarium 1d93fdea2e Merge branch 'master' into antipodes
Conflicts:
	code/freespace2/freespace.cpp
	code/graphics/2d.cpp
	code/network/stand_gui-unix.cpp
	projects/MSVC_2012/Fred2.vcxproj
	projects/MSVC_2012/Freespace2.vcxproj
	projects/MSVC_2013/code.vcxproj
	projects/MSVC_2013/code.vcxproj.filters
	projects/MSVC_2015/Fred2.vcxproj
	projects/MSVC_2015/Freespace2.vcxproj
	projects/MSVC_2015/code.vcxproj
2015-07-03 19:15:43 +02:00
asarium 597000ca46 Use our CFILE system to handle audio IO 2015-07-03 19:08:56 +02:00
m!m 3180a38ae7 Merge pull request #227 from chief1983/fix/sdl_dialog_vs
Add the osapi/dialog files to the other VS projects.
2015-07-03 19:06:50 +02:00
Cliff Gordon (chief1983) 032c19e889 Add the osapi/dialog files to the other VS projects. 2015-07-03 11:39:09 -05:00
Goober5000 a47ac6c5ee Merge pull request #211 from Echelon9/fix/janitorial-changes
Janitorial changes
2015-07-02 14:47:55 -04:00
Goober5000 da79469606 Merge pull request #224 from Echelon9/fix/issue196
Passing value 2.0 to asin() leads to implementation-defined result
2015-07-02 14:40:29 -04:00
Echelon9 a93215f781 Ensure input domain to asin() does not lead to irrational results (implementation defined behaviour) 2015-07-01 23:15:36 +10:00
Echelon9 58f7fb247b Document ai_update_aim() after touching the function 2015-07-01 23:07:17 +10:00
Echelon9 aa1feb0799 Refrain from unnecessarily passing a pointer to global object to ai_update_aim() 2015-07-01 23:07:17 +10:00
Echelon9 833e7b1d7a Ensure consistent capitalisation of ai_update_aim() parameter. 2015-07-01 23:07:17 +10:00
Echelon9 b2a07f19c2 Remove redundant parameter to compute_time_to_enemy(). Function doesn't need a pointer to the enemy objp, where it uses distance directly instead. 2015-07-01 23:07:17 +10:00
Echelon9 b38e153861 Remove redundant parameter to prioritize_goals(). 2015-07-01 23:07:17 +10:00
Echelon9 39188f7926 Remove redundant parameter to ai_ignore_wing(). 2015-07-01 23:07:17 +10:00
Echelon9 29fa74fd63 Remove redundant parameter to draw_brackets_diamond_quick(). 2015-07-01 23:07:17 +10:00
Echelon9 8e018c5338 Clean up load_animating_pointer(). 2015-07-01 23:07:17 +10:00
Echelon9 0810ae08de Clean up definition of asteroid_process_pre(). 2015-07-01 23:07:16 +10:00
Echelon9 366d409da4 Clean up definition of asteroid_process_post(). 2015-07-01 23:07:16 +10:00
Goober5000 2434365103 Merge pull request #219 from PeterMitsis/fvi_apply_const_and_static_keywords
math/fvi: apply const and static keywords
2015-06-30 11:11:17 -04:00
Goober5000 bd18c88198 Merge pull request #77 from chief1983/fix/nat_multiplayer
[fix/nat_multiplayer] Fix for multiple users behind a NAT
2015-06-29 21:33:10 -04:00
Cliff Gordon 6e0f9c1cd2 [fix/nat_multiplayer] Simplify the new psnet check. 2015-06-29 16:51:49 -05:00
Cliff Gordon 5311ea4f7a [fix/nat_multiplayer] Vestigare's submitted patch for allowing multiple users behind a NAT to connect to a remote standalone. 2015-06-29 16:50:06 -05:00
Lari Nieminen 09dfcf559e Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com 2015-06-28 18:13:51 +03:00
Cliff Gordon 0a9ae3eb46 Merge pull request #222 from scp-fs2open/revert-113-coverity/1298257
Revert "Fix Coverity 1298257: Uninitialized scalar var"
2015-06-28 10:00:42 -05:00
Peter Mitsis 7a59192bbb More application of static and const keywords
Applies the const and static keywords to the recently restored routines.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-28 09:09:26 -04:00
Fabian Woltermann 6a0e550aac Revert "Fix Coverity 1298257: Uninitialized scalar var" 2015-06-28 13:59:13 +02:00
Lari Nieminen da71e629b4 Fixes Mantis #2436: Mouse controls ignore the axis binds. 2015-06-28 14:42:17 +03:00
Peter Mitsis ca07a428e3 Revert "Remove nine unused routines from math/fvi module"
This reverts commit 8cdabf6a23.

Conflicts:

	code/math/fvi.cpp
2015-06-28 07:20:34 -04:00
Fabian Woltermann 150a00a17a Merge pull request #209 from ln-zookeeper/master
Fixes and enhancements for detail boxes and spheres
2015-06-27 11:43:56 +02:00
Fabian Woltermann bdf844fc83 Merge pull request #113 from niffiwan/coverity/1298257
Fix Coverity 1298257: Uninitialized scalar var
2015-06-27 11:28:19 +02:00
Fabian Woltermann 464d49d182 Merge pull request #212 from Echelon9/fix/mantis3137
Fix Mantis 3137
2015-06-26 13:43:55 +02:00
Fabian Woltermann 3386dc6f20 Merge pull request #218 from asarium/fix/hudmessageIterator
Fix usage of invalid iterator in hudmessage.cpp
2015-06-26 13:42:14 +02:00
Fabian Woltermann ff76a32508 Merge pull request #216 from Echelon9/fix/color-struct-alignment
Improve alignment of color struct
2015-06-26 13:41:31 +02:00
asarium 6b95037dcc Fix usage of invalid iterator. 2015-06-25 18:22:51 +02:00
Peter Mitsis 3cb0c72ced Apply static and const keywords to math/fvi module
Improves readability.  It also has the potential to help the compiler make
better decisions.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-25 07:51:53 -04:00
Echelon9 2cf8d0cc98 Improve alignment of color struct (28 bytes -> 24 bytes, c.14%). 2015-06-25 23:39:17 +12:00
Peter Mitsis 8cdabf6a23 Remove nine unused routines from math/fvi module
Removes the following unused routines ...
 1. accurate_square_root()
 2. fvi_point_dist_plane()
 3. fvi_segment_plane()
 4. fvi_sphere_perp_edge()
 5. check_sphere_point()
 6. fvi_check_sphere_sphere()
 7. fvi_cull_polyface_sphere()
 8. fvi_closest_point_on_line_segment()
 9. fvi_closest_line_line()
2015-06-25 07:03:59 -04:00
Lari Nieminen e0605f125c Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com 2015-06-25 13:07:41 +03:00
Fabian Woltermann 911f3d647f Merge pull request #214 from Echelon9/fix/issue213
Avoid shadowed declaration of previous local 'gpoi'
2015-06-25 10:09:23 +02:00
Echelon9 2ca1f40d98 Avoid shadowed declaration of previous local 'gpoi' 2015-06-25 17:20:10 +12:00
Echelon9 b5610a5005 Proposed refactor of #Cutscenes in mission files, per wiki documentation. 2015-06-25 16:56:24 +12:00
Goober5000 341fdd3589 Merge pull request #207 from Echelon9/fix/issue206
Resolve order of precedence compiler warning.
2015-06-25 00:43:10 -04:00
Echelon9 7f673c8ab6 Goober5000 code review: consistency change. 2015-06-25 16:25:35 +12:00
Echelon9 ce6179a58f Resolve order of precedence compiler warning. 2015-06-25 14:27:31 +12:00
Fabian Woltermann 83fc90c74b Merge pull request #210 from chief1983/fix/205_cleanup
Fix/205 cleanup
2015-06-24 15:11:59 +02:00
Cliff Gordon (chief1983) 8c73f39e6e Remove the files from PR 205 via IDE. 2015-06-24 00:06:29 -05:00
Cliff Gordon (chief1983) 8efaf28a8a Revert "Fixed project files for all MSVS versions that support vcxproj"
This reverts commit 610f8a2ff3.
2015-06-23 22:37:35 -05:00
Cliff Gordon (chief1983) 8a3cc22605 Revert "Remove references to AVX from VS2010 project"
This reverts commit 3205f42dc2.
2015-06-23 22:37:15 -05:00
Lari Nieminen fc9acb3a4d Added support for detail box $box_offset. 2015-06-24 00:48:07 +03:00
Lari Nieminen 2e012969e7 Fixed detail sphere $offset not working right. 2015-06-24 00:44:13 +03:00
Lari Nieminen 84b7a06a44 Restored ability to combine detail boxes and spheres. 2015-06-23 19:53:18 +03:00
Lari Nieminen 8fd09be8a0 Replaced the static Interp_render_* variables with normal local ones. 2015-06-23 19:50:17 +03:00
Fabian Woltermann 83a7e862ae Merge pull request #205 from Echelon9/fix/cleanup-empty-files
Cleanup empty files
2015-06-23 11:32:48 +02:00
Echelon9 85428f5eb4 Remove added <MinimalRebuild> option to MSVC_2012. 2015-06-23 18:44:31 +10:00
Fabian Woltermann e73dbd1647 Merge pull request #170 from z64555/parselo
Organizes required_string(); Doxy's required_string() and required_st…
2015-06-23 10:16:59 +02:00
Fabian Woltermann b11497d075 Merge pull request #183 from ln-zookeeper/master
Added a "no-secondary-lock-on" ship flag to disable secondary homing.
2015-06-23 10:16:24 +02:00
Fabian Woltermann 14ed049331 Merge pull request #198 from Echelon9/fix/issue197
Update format string specifier to unsigned int (mainhallmenu.cpp)
2015-06-23 10:14:38 +02:00
Rhys Kidd 00d4271550 Merge pull request #1 from The-E/fix/cleanup-empty-files
Fixed project files for all MSVS versions that support vcxproj
2015-06-23 18:14:20 +10:00
Fabian Woltermann ff22d7b9a6 Merge pull request #200 from Echelon9/fix/issue199
Retval of bm_get_size (int handle) should be a size_t
2015-06-23 10:14:18 +02:00
Fabian Woltermann ce3bb0a6a9 Merge pull request #202 from Echelon9/fix/issue201
Retval of bm_page_out(int handle) should be a bool
2015-06-23 10:14:00 +02:00
Fabian Woltermann 4c55ad45a0 Merge pull request #204 from Echelon9/fix/issue203
Retval of bm_has_alpha_channel(int handle) should be a bool
2015-06-23 10:13:34 +02:00
The_E 3205f42dc2 Remove references to AVX from VS2010 project 2015-06-23 10:11:24 +02:00
The_E 610f8a2ff3 Fixed project files for all MSVS versions that support vcxproj 2015-06-23 10:03:08 +02:00
Echelon9 0fde8c3925 Update Xcode 4+ project file for removal of empty files. 2015-06-23 16:05:01 +10:00
Echelon9 8ba1ddbbc2 Makefile removal of references to missionui/missionstats.[cpp|h]. 2015-06-23 14:52:58 +10:00
Echelon9 3af13b603d Remove empty missionui/missionstats.[cpp|h]. 2015-06-23 14:46:42 +10:00
Echelon9 54508b6429 Makefile and source code removal of references to ai/ailocal.h 2015-06-23 14:39:43 +10:00
Echelon9 b62196dc0d Remove empty ai/ailocal.h 2015-06-23 14:32:02 +10:00
Echelon9 8eeff0e06c Remove missionrecommend.[cpp|h] from Makefile. 2015-06-23 14:30:01 +10:00
Echelon9 da9d363230 Remove empty missionrecommend.[cpp|h] files. 2015-06-23 14:23:28 +10:00
Echelon9 cb617b5e9f Modify usage of bm_has_alpha_channel that needs to pass int to the OpenGL driver. Use ternary operator. 2015-06-23 14:05:58 +10:00
Echelon9 130a148816 Remove TODO doxygen comment. 2015-06-23 13:59:10 +10:00
Echelon9 33cae6930c Amend retval in declaration and definition to bool. 2015-06-23 13:57:58 +10:00
Echelon9 6abba98455 Increase consistency with adjacent code style, and avoid >80 character line wrap. 2015-06-23 11:49:48 +10:00
Echelon9 0437f81999 Ensure paramater name matches between declaration and definition. 2015-06-23 11:44:47 +10:00
Echelon9 4f649f1cdb Remove TODO doxygen comment. 2015-06-23 11:40:27 +10:00
Echelon9 e33f2e1d38 Amend retval in declaration and definition to bool. 2015-06-23 11:39:44 +10:00
Echelon9 df1c50bc47 Convert internal mem_taken type to size_t. 2015-06-23 11:07:29 +10:00
Echelon9 79597e9757 Ensure parameter name matches between declaration and definition. 2015-06-23 10:59:43 +10:00
Echelon9 6447208960 Remove TODO doxygen comment. 2015-06-23 10:48:47 +10:00
Echelon9 c061ee6324 Amend retval in declaration and definition to size_t. 2015-06-23 10:48:11 +10:00
Echelon9 57c9e1ae6a Address putative requirement for mm/mmreg.h to have <windows.h> included first. 2015-06-23 10:16:59 +10:00
Echelon9 60aec6f6cb Update format string specifier to unsigned int. 2015-06-22 21:40:43 +10:00
Echelon9 418b9e06d7 Simplify duplicative weapon/ includes, which are in weapon/weapon.h 2015-06-22 20:24:31 +10:00
Echelon9 d2f5575e20 Simplify duplicative ui/ includes. 2015-06-22 20:24:31 +10:00
Echelon9 8c12affa23 Simplify duplicative species_def/ includes, which are in species_def/species_def.h 2015-06-22 20:24:31 +10:00
Echelon9 ca552b45f5 Simplify duplicative ship/ includes, which are in ship/shipfx.h 2015-06-22 20:24:31 +10:00
Echelon9 00bfe37cb4 Simplify duplicative radar/ includes. 2015-06-22 20:24:31 +10:00
Echelon9 2964132f7d Properly guard inclusion of playerman/managepilot.h 2015-06-22 20:24:31 +10:00
Echelon9 eb739e2a9b Simplify duplicative pilotfile/ includes, which are in pilotfile/pilotfile.h 2015-06-22 20:24:31 +10:00
Echelon9 8c2c451e8e Simplify duplicative parse/ includes. 2015-06-22 20:24:31 +10:00
Echelon9 29faabdfb3 Simplify duplicative object/ includes. 2015-06-22 20:24:31 +10:00
Echelon9 2b251e3cb3 Simplify duplicative model/ includes. 2015-06-22 20:24:31 +10:00
Echelon9 ed2170b2ea Simplify duplicative mod_table/ includes. 2015-06-22 20:24:31 +10:00
Echelon9 493d9a4280 Simplify duplicative missionui/ includes. 2015-06-22 20:24:31 +10:00
Echelon9 a7e6be3368 Simplify duplicative mission/ includes. 2015-06-22 20:24:30 +10:00
Echelon9 dd3a6c2e50 Simplify duplicative menuui/ includes. 2015-06-22 20:24:30 +10:00
Echelon9 97a134e51f Simplify duplicative math/ includes. 2015-06-22 20:24:30 +10:00
Echelon9 e613f4db7d Simplify duplicative lab/ includes, which are in lab/wmcgui.h 2015-06-22 20:24:30 +10:00
Echelon9 47af1ff851 Simplify duplicative hud/ includes. 2015-06-22 20:24:30 +10:00
Echelon9 4e6f525f7c Simplify duplicative graphics/ includes. 2015-06-22 20:24:30 +10:00
Echelon9 b25feb69aa Simplify duplicative gamesnd/ includes, which are in gamesnd/gamesnd.h 2015-06-22 20:24:30 +10:00
Echelon9 90bb4e3a7b Simplify duplicative freespace2/ includes, which are in freespace2/freespace.h 2015-06-22 20:24:30 +10:00
Echelon9 39e1ed3403 Simplify fireball/ include logic. 2015-06-22 20:24:30 +10:00
Echelon9 45664465be Simplify debugconsole/ include logic. 2015-06-22 20:24:30 +10:00
Echelon9 1601f83a05 Guard extraneous inclusion of globalincs/pstypes.h 2015-06-22 20:24:30 +10:00
Echelon9 ae8a310e97 Simplify duplicative camera/ includes, which are in camera/camera.h 2015-06-22 20:24:30 +10:00
Echelon9 0d35f901b3 Simplify duplicative autopilot/ includes, which are in autopilot/autopilot.h 2015-06-22 20:24:30 +10:00
Echelon9 726036b91e Simplify duplicative bmpman/ includes, which are in bmpman/bmpman.h 2015-06-22 20:24:30 +10:00
Echelon9 c5493bb480 Scripted sort and uniq on (internal) project includes. Improves search time and as a by product removed a number of duplicative includes. 2015-06-22 20:24:30 +10:00
Fabian Woltermann fda36a1476 Merge pull request #193 from PeterMitsis/vecmat_apply_const_and_static_keywords
vecmat: apply const and static keywords
2015-06-22 12:13:46 +02:00
Fabian Woltermann e176132106 Merge pull request #194 from Echelon9/feature/make-cppcheck
Add 'make cppcheck' command line option.
2015-06-22 12:10:54 +02:00
Echelon9 2c36ce39af Add 'make cppcheck' command line option. 2015-06-21 15:37:25 +10:00
Peter Mitsis fc6f7cbbb6 Add static and const keywords to vector math routines
Improves readability.  It also has the potential to help the compiler make
better decisions.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-20 08:01:25 -04:00
Peter Mitsis 7c2eb53e62 Remove unused routine vm_fvec_matrix_interpolate()
Not only is the routine vm_fvec_matrix_interpolate() unused, it does not appear
to have been used for the duration of the project.  The only reference to it
found in the history was in a removed comment.  That comment indicated that it
was implemented in 1997.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-20 07:59:34 -04:00
MageKing17 bcf19f1256 Merge pull request #192 from jg18/log_enhanced_sound
Log usage status of enhanced sound.
2015-06-20 01:54:59 -07:00
jg18 4d6d679c7b Log usage status of enhanced sound. 2015-06-19 23:50:14 -07:00
Fabian Woltermann feb6d188f7 Merge pull request #188 from chief1983/fix/standalone_name_hang
[fix/standalone_name_hang] Prevent the standalone from hanging
2015-06-19 21:24:47 +02:00
MageKing17 179229fa81 Add max_shield_recharge and shield_impact_explosion_anim to copy/move functions. 2015-06-18 14:45:43 -07:00
MageKing17 ab9d2e20fb Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info
Conflicts:
	code/ship/ship.cpp
2015-06-18 14:40:53 -07:00
MageKing17 35813b5e0f Merge pull request #120 from chief1983/mp_for_2012
Add /MP to all projects and configs in VS 2012 project files.
2015-06-18 14:14:49 -07:00
MageKing17 eff6d402f3 Merge pull request #76 from chief1983/fix/triplemon_hud
[fix/triplemon_hud] Yarn's triple-monitor fix
2015-06-18 14:11:51 -07:00
Cliff Gordon 3e8b62999b [fix/standalone_name_hang] Prevent the standalone from hanging when attempting to set a name that is too long. 2015-06-17 14:14:06 -05:00
Cliff Gordon (chief1983) c56925a830 Disable the minimal rebuilds that were enabled for debug configurations. Also contains some whitespace cleanup that VS applied automatically. 2015-06-17 10:38:15 -05:00
Cliff Gordon 28c1286c4d Merge remote-tracking branch 'origin/master' into mp_for_2012 2015-06-17 10:15:44 -05:00
Cliff Gordon 2d662075c3 Merge remote-tracking branch 'origin/master' into fix/triplemon_hud 2015-06-17 10:11:57 -05:00
Cliff Gordon 3247fb08d0 Merge pull request #185 from FSCyborg/patch-1
Resolve CID 1093395 - Unnecessary sanity check
2015-06-17 10:02:17 -05:00
FSCyborg 916fce023d Resolve CID 1093395 - Unnecessary sanity check
Pretty sure this is just a paranoid check.  If it's negative it should get changed to at least 2 in the following line.  Let me know if I have any misconceptions.
2015-06-15 16:12:22 -04:00
Fabian Woltermann b9f9afe26a Revert "Merge pull request #181 from PeterMitsis/math-cleanup"
This reverts commit 1192c1dafc, reversing
changes made to 8643fa7327.
2015-06-15 08:58:59 +02:00
Goober5000 335f1be322 Merge pull request #177 from FSCyborg/patch-1
Resolve CID 1093428 & 1093429
2015-06-14 20:43:39 -04:00
MageKing17 1cc452c13e Merge pull request #182 from DahBlount/feature/dont_spawn_if_shot
Create "don't spawn if shot" flag
2015-06-14 15:32:09 -07:00
Lari Nieminen 4acad3b126 Added a "no-secondary-lock-on" ship flag to disable secondary homing. 2015-06-14 22:25:54 +03:00
DahBlount 923d9851b9 Create "don't spawn if shot" flag
This flag prevents submunitions from being created if a parent weapon is
shot down.
2015-06-14 10:51:09 -07:00
Fabian Woltermann 1192c1dafc Merge pull request #181 from PeterMitsis/math-cleanup
Math cleanup
2015-06-14 11:40:31 +02:00
Peter Mitsis 85f50d9c94 Streamline vm_quaternion_rotate()
Calculates sinf(theta * 0.5) once only instead of three times.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:31 -04:00
Peter Mitsis 1af0f814c9 Refactor bez_fact()
Uses an array of precalculated factorials that are accessed as a lookup table
instead of computing the factorials at runtime.  This cuts down on compiled
code bloat (compiler was both unrolling and inlining the computation's loop)
everywhere it was used.

NOTE: The original implementation returned an 'int'.  As a result, the largest
uncorrupted factorial it could compute was 12!.  For this reason, the lookup
table only goes up to 12!.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:31 -04:00
Peter Mitsis 42dc0fcc74 Streamline fl_radians() and fl_degrees() macros
Rewrites the macros to avoid unnecessary divisions.  The compiler is now free
to precalculate the scaling ratio and perform it in a single multiply.  Note
that the previous placement of the parentheses meant that the compiler (at
least GCC) was performing a multiply followed by a divide.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:31 -04:00
Peter Mitsis 93639e967c Cosmetic: Do not check for negative vector magnitudes
Mathematically, the magnitude of a vector can not be negative.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:31 -04:00
Peter Mitsis 3f0476a880 Streamline vm_angle_2_matrix()
The values of sin(0) and cos(0) are well known and do not need to be calculated
at run time.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:31 -04:00
Peter Mitsis a92ebdc08a Remove commented out from vm_vec_copy_normalize()
The commented out code was cluttering things up.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:30 -04:00
Peter Mitsis ee40ac7089 Streamline vm_vec_avg_n()
Instead of perform three consecutive divisions, vm_vec_avg_n() now performs one
division at the start and three multiplications at the end.  Recall that
multiplication is faster than division.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:30 -04:00
Peter Mitsis b883078ce8 Remove unnecessary checking before atan2_safe()
The routine atan2_safe() already contains a test that checks if both parameters
are zero--that is the point of the routine.  Thus, there is no need for the
caller of atan2_safe() to perform that same check.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:30 -04:00
Peter Mitsis 748fe8e5dd Remove unnecessary vm_vec_normalize() checks
The routine vm_vec_normalize() always returns a non-zero value.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:30 -04:00
Peter Mitsis c9003f0c9d Remove unnecessary vm_vec_copy_normalize() checks
The routine vm_vec_copy_normalize() always returns a non-zero value.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:30 -04:00
Peter Mitsis 391be952f5 Add static and const keywords to vector math routines
Improves readability.  It also has the potential to help the compiler make
better decisions.

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:30 -04:00
Peter Mitsis 49d6474237 Update vecmat.h and vecmat.cpp file mode bits
Changes the file mode bits of vecmat.h and vecmat.cpp to make them consistent
with the other files under "code/math".

Signed-off-by: Peter Mitsis <[email protected]>
2015-06-13 23:14:30 -04:00
m!m 8643fa7327 Merge pull request #178 from FSCyborg/patch-2
Resolve CID 1093431 & 1093432
2015-06-13 20:20:06 +02:00
m!m a71e527e04 Merge pull request #179 from FSCyborg/patch-3
Resolve CID 1093435 & 1093437
2015-06-13 20:16:25 +02:00
FSCyborg 8515b68c0c Resolve CID 1093435 & 1093437
Should resolve issues 1093435 and 1093437. These issues cannot cause crashes because the denominator is indirectly checked, but it's good to change to get coverity and other future diagnosing programs to stop yelling at us.
2015-06-13 13:35:10 -04:00
FSCyborg 6393189c19 Resolve CID 1093431 & 1093432
Should resolve issues 1093431 and 1093432. These issues cannot cause crashes because the denominator is indirectly checked, but it's good to change to get coverity and other future diagnosing programs to stop yelling at us.
2015-06-13 13:26:25 -04:00
FSCyborg 418d17b4da Resolve CID 1093428 & 1093429
Should resolve issues 1093428 and 1093429.  These issues cannot cause crashes because the denominator is indirectly checked, but it's good to change to get coverity and other future diagnosing programs to stop yelling at us.
2015-06-13 13:16:56 -04:00
Fabian Woltermann f6d0e7d97a Merge pull request #126 from AxemP/PainFlash
Adding customizable pain flash and shield pain flash settings
2015-06-13 15:22:40 +02:00
MageKing17 3cb6cc305b Merge pull request #172 from DahBlount/feature/weapon_dmg_decay
Weapon Damage Decay
2015-06-12 11:39:31 -07:00
DahBlount 5f63e86dde Add sanity checks and an extra parameter
This adds extra sanity checks to the Weapon Damage Decay code and also
adds a new parameter for weapons that can GAIN damage is they approach
the end of their lifetime.
2015-06-12 09:56:13 -07:00
DahBlount e8f58f5947 Create Weapon Damage Decay framework
This adds the $Daamge Time: and +Min Damage: entries to weapons.tbl.
These parameters are used to create damage attenuation for non-beam primary weapon.
2015-06-12 05:01:21 -07:00
Axem 27e81df523 Commit cause reasons 2015-06-11 19:50:35 -05:00
z64555 5bd09cfac5 Merge pull request #171 from DahBlount/feature/random_fire_delay
Add Max delay and Min Delay
2015-06-11 13:47:10 -05:00
DahBlount 58f38c2e1e Add Max delay and Min Delay
This adds two weapons.tbl entries that allow a weapon to have a range of
possible fire delay times which results in random firing time. simulates
real life firing time error for the most part.
2015-06-11 08:15:22 -07:00
z64555 99a06b4839 Organizes required_string(); Doxy's required_string() and required_string_one_of() 2015-06-10 09:00:33 -05:00
Fabian Woltermann f162db5e48 Merge pull request #161 from ln-zookeeper/master
Added a $Max Shield Recharge ship table entry for limiting how full t…
2015-06-10 15:18:44 +02:00
Fabian Woltermann 15b822f10f Merge pull request #169 from z64555/ap-VS12_VS13_build_fix
Resolves link errors when trying to build in MSVS 2012 and MSVS 2013.
2015-06-10 15:17:34 +02:00
Fabian Woltermann a3dedeabe4 Merge pull request #163 from asarium/antipodes_/dialogs
Add unified dialog handling
2015-06-10 15:16:22 +02:00
z64555 5c20006500 Resolves link errors when trying to build in MSVS 2012 and MSVS 2013. 2015-06-10 07:04:35 -05:00
Zacam 1e6455c393 Merge pull request #166 from The-E/master
Sets AVX instruction sets for all projects
2015-06-07 01:33:44 -07:00
The E 66c5dff14a Sets AVX instruction sets for all projects 2015-06-07 10:30:33 +02:00
m!m 2190fccc66 Merge pull request #165 from The-E/master
Sets AVX output for VS2015
2015-06-07 10:25:11 +02:00
The E 6204241b7d Sets AVX output for VS2015 2015-06-07 10:22:11 +02:00
asarium 575091aea4 Add unified dialog handling
This also changes the lables on the dialog to make sense and also unifies Int3 behavior by using a function provided by SDL.
2015-06-06 14:53:26 +02:00
Fabian Woltermann 00a3513c84 Merge pull request #162 from asarium/antipodes_/outwndFix
Fix outwnd on Unix
2015-06-05 18:26:55 +02:00
asarium 92556a5116 Fix outwnd on Unix 2015-06-05 00:08:24 +02:00
Lari Nieminen 26e31a4cf0 Added a $Max Shield Recharge ship table entry for limiting how full the shields may recharge. 2015-06-04 15:35:41 +03:00
Fabian Woltermann 421d8be977 Merge pull request #153 from Echelon9/fix/Xcode4-project-file
Update Xcode4+ project files for the removal of timerbar.cpp|h
2015-06-04 13:35:09 +02:00
Fabian Woltermann 7a505887ff Merge pull request #135 from ln-zookeeper/master
Added customizable shield impact explosion effects, originally adapte…
2015-06-04 13:33:40 +02:00
m!m 3c229a9c81 Merge pull request #157 from AxemP/LuaOnBeamFire
Adds On Beam Fire scripting hook
2015-06-04 10:05:56 +02:00
Axem 4b20b46509 Commit because reasons? (Why git, why) 2015-06-03 17:44:37 -05:00
Axem 7e8557d564 Merging with new updated master 2015-06-03 17:38:52 -05:00
Fabian Woltermann 2aed7ccf71 Merge pull request #147 from asarium/antipodes_/os_sleep
Replace Sleep with os_sleep
2015-06-03 16:54:42 +02:00
m!m 8c3e9dcdd7 Merge pull request #154 from AxemP/LuaAfterburn+BeamFire
Adds Afterburner Engage/Ending scripting hooks
2015-06-03 16:26:36 +02:00
m!m 91ea6b83cf Merge pull request #155 from AxemP/LuaApplyWhack
Adds applyWhack() scripting function for ship objects
2015-06-03 16:24:30 +02:00
asarium 2d47bcd9ad Replace Sleep with os_sleep 2015-06-03 16:20:39 +02:00
Fabian Woltermann 7cf0f97e9d Merge pull request #160 from asarium/antipodes
Sync Antipodes
2015-06-03 15:31:19 +02:00
asarium 7aef2c5eaf Merge branch 'master' into antipodes 2015-06-03 12:50:21 +02:00
Fabian Woltermann d7f54dd703 Merge pull request #151 from jg18/enhanced_sound
Add support for enhanced sound.
2015-06-02 08:13:42 +02:00
jg18 7fe5ba8db8 Make enhanced sound on by default. 2015-06-01 11:18:07 -07:00
jg18 faa0c5e9ee Make minor corrections to enhanced sound. 2015-06-01 10:24:07 -07:00
Axem 61e4f739ce Adds On Beam Fire scripting hook 2015-05-31 18:02:36 -05:00
Axem 852a4eb3fa Tweaking formatting... 2015-05-31 17:26:03 -05:00
Axem 7975300304 Cutting out the beam fire 2015-05-31 17:20:39 -05:00
Axem 58e8c23665 Adds on Afterburner Engage, Afterburner End, and On Beam Fire scripting hooks 2015-05-31 11:51:22 -05:00
Axem 2fa7e8f096 Adds applyWhack() scripting function for ship objects 2015-05-31 11:18:45 -05:00
Lari Nieminen 037c5a06aa Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com 2015-05-31 14:28:52 +03:00
MageKing17 859405b62e Merge pull request #149 from SamuelCho/mantis3163
Refactored how color setting is done for model rendering. Fixes Mantis 3163
2015-05-30 19:24:15 -07:00
Echelon9 2943d3f1a4 Address Xcode issue with quotes and version strings. 2015-05-31 12:07:57 +10:00
Echelon9 f2fb83801c Update Xcode4+ project files for the removal of timerbar.cpp|h 2015-05-31 10:54:46 +10:00
Goober5000 74ae0a9395 Merge pull request #148 from SamuelCho/mantis3161
Fix for Mantis 3161. Corrected model debug rendering when calling the immediate version of model rendering.
2015-05-30 18:13:05 -04:00
Goober5000 aa0d424699 Merge pull request #150 from SamuelCho/skybox_render_order
Eliminate sorting of draw calls for skyboxes for correctness.
2015-05-30 13:03:33 -04:00
Goober5000 4fe9668fa3 Merge pull request #152 from SamuelCho/mantis3162
Rectified jump nodes not rendering in FRED. Fixes Mantis 3162.
2015-05-30 13:00:44 -04:00
SamuelCho 0c9996c32b Rectified jump nodes not rendering in FRED. Fixes Mantis 3162. 2015-05-29 23:37:50 -07:00
jg18 ad910280e7 Add support for enhanced sound.
Add support for enhanced in-mission sound, with 128 audio channels and a
new system for specifying per-sound priorities and concurrent playback
limits using modular extensions of soudns.tbl.
2015-05-29 23:05:30 -07:00
SamuelCho a7c1e29bf6 Eliminate sorting of draw calls for skyboxes for correctness. 2015-05-29 22:58:28 -07:00
SamuelCho 2ba39e6b6d Refactored how color setting is done for model rendering. Fixes Mantis 3163. 2015-05-29 21:54:33 -07:00
SamuelCho 44de943a99 Fix for Mantis 3161. Corrected model debug rendering when calling the immediate version of model rendering. 2015-05-29 19:47:23 -07:00
asarium 0c705fee6f Merge branch 'master' into antipodes
Conflicts:
	code/debugconsole/timerbar.cpp
	code/graphics/gropengl.cpp
	projects/MSVC_2010/code.vcxproj
	projects/MSVC_2012/code.vcxproj
	projects/MSVC_2012/code.vcxproj.filters
2015-05-29 17:47:58 +02:00
m!m 661b650911 Merge pull request #145 from asarium/fix/timerbar
Remove unused timerbar files
2015-05-29 17:45:10 +02:00
asarium badbe4a239 Remove unused timerbar files 2015-05-29 16:31:41 +02:00
MageKing17 db781c1a7f Hopefully fix VS 2010 compilation.
Apparently VS 2010 doesn't like vector::emplace_back() with 0 arguments. A push_back() of a generic ship_info object should provide basically the same effect.
2015-05-29 02:06:04 -07:00
MageKing17 8fb0436b42 Add new variables to clone() and move().
Also add model_icon_angles to the constructor (let's just make absolutely sure it's zeroed out on initialization).
2015-05-28 23:56:22 -07:00
MageKing17 7e696a55d2 Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info
Also added model_icon_angles to the ship_info() constructor, and model_icon_angles, thruster_glow_noise_mult, and min_engine_vol to ship_info::clone() and and ship_info::move().

Conflicts:
	code/ship/ship.cpp
	code/ship/ship.h
2015-05-28 23:49:33 -07:00
Fabian Woltermann 3b90519be4 Merge pull request #144 from asarium/antipodes_/haptic
[Antipodes] Add some debug code to sdl haptic initialization
2015-05-28 16:32:38 +02:00
Fabian Woltermann 0311484e12 Merge pull request #143 from asarium/antipodes_/cleanup/endian
[Antipodes] Unify byte order detection using SDL
2015-05-28 16:32:05 +02:00
asarium d59dd99d28 Add some debug code to sdl haptic initialization 2015-05-28 15:43:00 +02:00
Fabian Woltermann 2e1ae8c126 Merge pull request #142 from asarium/antipodes_/cleanup/outwnd
Remove dead code from outwnd.cpp
2015-05-28 14:45:20 +02:00
Fabian Woltermann b6cd096204 Merge pull request #141 from asarium/antipodes
Sync Antipodes
2015-05-28 14:44:34 +02:00
asarium 7eaaf94342 Unify byte order detection using SDL 2015-05-28 14:41:13 +02:00
asarium ffcb4ca268 Use the new outwnd.cpp on every platform 2015-05-28 13:57:47 +02:00
asarium acccaa929d Fix compilation under linux 2015-05-28 13:56:07 +02:00
asarium e0ce4737ec Clean outwnd.cpp
It had a lot of dead code related to the unused debug output window.
2015-05-28 13:18:32 +02:00
asarium 4b6041980e Merge branch 'master' into antipodes
Conflicts:
	code/osapi/osapi.cpp
2015-05-28 13:07:57 +02:00
Fabian Woltermann 0bc1d365e6 Merge pull request #139 from asarium/antipodes_/joystickGUID
[Antipodes] Make the joystick system use GUIDs to identify the joysticks
2015-05-28 11:37:36 +02:00
asarium e0c919baea Change enum class back to enum 2015-05-28 11:34:31 +02:00
asarium a7efca662d Make the joystick system use GUIDs to identify the joysticks 2015-05-28 11:34:30 +02:00
Fabian Woltermann 9140069a85 Merge pull request #138 from asarium/antipodes_/cleanup/joy
[Antipodes] Remove now unused functions
2015-05-28 11:23:22 +02:00
Fabian Woltermann fae5f227b7 Merge pull request #137 from asarium/antipodes_/cleanup/mouse
[Antipodes] Remove unneded functions from mouse.h/.cpp
2015-05-28 11:22:56 +02:00
Fabian Woltermann 5baa57216a Merge pull request #136 from asarium/antipodes_/externalCode
[Antipodes] Update externalcode to use SDL to do DLL loading
2015-05-28 11:22:35 +02:00
Fabian Woltermann a181616583 Merge pull request #134 from asarium/antipodes_/SDLupdate
[Antipodes] Update SDL to version 2.0.3
2015-05-28 11:22:18 +02:00
m!m 3030e20121 Merge pull request #140 from scp-fs2open/possible-appveyor-fix
Remove AppVeyor logger.
2015-05-28 11:03:00 +02:00
MageKing17 9f65ab39d0 Remove AppVeyor logger.
Apparently it's causing the nonsensical failures for builds of the 2013 project.
2015-05-28 00:28:11 -07:00
asarium 13f22d0ac9 Remove now unused functions 2015-05-27 15:50:42 +02:00
asarium 90efc5d1b1 Remove unneded functions from mouse.h/.cpp 2015-05-27 15:07:15 +02:00
asarium d6460398e6 Update externalcode to use SDL to do DLL loading 2015-05-27 15:01:40 +02:00
Lari Nieminen 3e4cfa361d Added customizable shield impact explosion effects, originally adapted from Wanderer branch. 2015-05-27 13:41:50 +03:00
asarium 9ec7a5886d Update SDL to version 2.0.3
This version now works out of the box with FRED although I don't know exactly why, if it breaks in the future SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT could help fix it.
2015-05-27 12:35:50 +02:00
Fabian Woltermann a127a8cad6 Merge pull request #133 from ln-zookeeper/master
Added a $Model Icon Direction ship table entry for overriding the ang…
2015-05-27 11:31:31 +02:00
Lari Nieminen 8fd0bf3f7f Added a $Model Icon Direction ship table entry for overriding the angle from which ship icons are rendered from. 2015-05-27 12:19:06 +03:00
Fabian Woltermann d4d4868fe7 Merge pull request #128 from asarium/antipodes_/resolutionFix
[Antipodes] Pick a better default resolution
2015-05-27 11:11:50 +02:00
Fabian Woltermann af79c18752 Merge pull request #132 from z64555/ap-mousewheel
Expands mouse functionality.
2015-05-27 10:39:22 +02:00
z64555 3a0b78366d Some documentation on the MOUSE_BUTTON and MOUSE_WHEEL defines 2015-05-27 03:31:29 -05:00
z64555 c2e72b0098 can haz better bool algea-bra? 2015-05-27 03:25:35 -05:00
z64555 bf3c861f19 Merge pull request #130 from The-E/antipodes
Adjustments to the MSVC2010 project files for AP
2015-05-27 03:14:27 -05:00
z64555 56f9f608be Merge pull request #119 from The-E/dedicated_gpu
Use high-performance GPU by default.
2015-05-27 03:13:49 -05:00
z64555 69b845ef83 Adds mousewheel functions in addition to support for X1 and X2 buttons. These currently take up the same mappings as joy buttons 4 through 9. 2015-05-27 03:06:03 -05:00
Fabian Woltermann 258662ff4c Merge pull request #104 from MageKing17/feature/subspace-beams
Subspace Beams
2015-05-27 10:00:44 +02:00
Fabian Woltermann a0ed1ac897 Merge pull request #125 from ln-zookeeper/master
Added a $Thruster Glow Noise Mult ship table entry for decreasing/inc…
2015-05-27 09:56:45 +02:00
Fabian Woltermann 136091fc68 Merge pull request #131 from asarium/mantis/3160
Mantis 3160: Only set processor affinity if a commandline flag is present
2015-05-27 09:32:50 +02:00
asarium c5cf337365 Only set processor affinity if a commandline flag is present 2015-05-27 00:31:08 +02:00
The E 0af8e800a5 Adjustments to the MSVC2010 project files for AP 2015-05-26 22:10:22 +02:00
Fabian Woltermann 6b9f475f64 Merge pull request #129 from asarium/antipodes_/VS2015
Fix compilation of Antipodes on VS2015
2015-05-26 21:08:49 +02:00
asarium 5471cafea5 Readd resolution switch 2015-05-26 19:57:00 +02:00
asarium d39053d82c Fix linking issues by directly compiling the SDL file, 2015-05-26 19:40:42 +02:00
asarium 356c2637b5 Fix VS2015 project files 2015-05-26 19:07:38 +02:00
asarium 178c69b212 Fix warnings 2015-05-25 22:09:35 +02:00
asarium a7e8ecfe07 Use the desktop size to initialize a default video card config 2015-05-25 22:09:34 +02:00
MageKing17 69cd61637b Merge pull request #127 from asarium/antipodes
Sync Antipodes
2015-05-25 11:47:41 -07:00
asarium 9d7b3dcb11 Merge branch 'master' into antipodes
Conflicts:
	projects/MSVC_2012/code.vcxproj
	projects/MSVC_2012/code.vcxproj.filters
2015-05-25 15:57:48 +02:00
Axem e396686570 Adding customizable pain flash and shield pain flash settings 2015-05-24 09:00:30 -05:00
Lari Nieminen 72a082c9eb Added a $Thruster Glow Noise Mult ship table entry for decreasing/increasing the effect of noise applied to the glow radius. 2015-05-23 00:11:43 +03:00
MageKing17 67a87a33f3 Change if-elseif chain to switch statement.
Somewhat easier to read this way.
2015-05-22 12:38:13 -07:00
MageKing17 b2cff0788a Make these assertions more clear. 2015-05-22 12:37:19 -07:00
MageKing17 fa61278c10 Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into feature/subspace-beams 2015-05-22 12:32:34 -07:00
m!m 585a5fe64d Merge pull request #112 from ln-zookeeper/master
Added $Minimum Engine Volume to ships.tbl, with which to customize ho…
2015-05-21 19:44:26 +02:00
Lari Nieminen 81f7d272fd Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com 2015-05-21 18:35:32 +03:00
Goober5000 ee6cd1d204 Merge pull request #121 from MageKing17/bugfix/fred-warnings
Fix a couple FRED warnings.
2015-05-21 00:06:48 -04:00
Cliff Gordon a4c1f89720 Merge remote-tracking branch 'origin/master' into fix/triplemon_hud
Conflicts:
	code/freespace2/freespace.cpp
2015-05-20 17:15:15 -05:00
Cliff Gordon (chief1983) 9429770f3d Add /MP to all projects and configs in VS 2012 project files. 2015-05-20 12:19:43 -05:00
m!m 2c5999b1d0 Merge pull request #114 from chief1983/rename_2011
[rename_2011] Rename MSVC_2011 to MSVC_2012
2015-05-20 17:32:38 +02:00
Cliff Gordon 2f152ce085 [rename_2011] Fix the appveyor config to handle the renamed project. 2015-05-20 09:27:40 -05:00
Cliff Gordon (chief1983) 3163319217 Merge remote-tracking branch 'origin/master' into rename_2011 2015-05-19 21:33:53 -05:00
Cliff Gordon (chief1983) 8e4f6afddd Add the shadows files to the VS 2012 project. The diff looks like a lot changed, but most is apparently just whitespace. diff -w shows a clean set of file additions. 2015-05-19 21:30:32 -05:00
The E ef9ae017b5 Make sure we use the same calling convention both times 2015-05-19 21:21:54 +02:00
The E 2c626b4eec According to AMD and NV, these _should_ force their drivers into high-performance mode 2015-05-19 20:48:01 +02:00
MageKing17 cac6737541 Fix a couple FRED warnings.
Change a couple instances of setting a DWORD_PTR to -1 by explicitly casting it to a DWORD_PTR.
2015-05-19 11:39:36 -07:00
MageKing17 ab900aad1c Avoid calling ssm_create() from ship_apply_tag() if ssm_index < 0.
This would happen if a TAG level 3 weapon had no specified SSM (or an invalid one). Since nothing can call ssm_create() with a negative ssm_index now, changed it to a size_t and simplified one of the verification conditionals.
2015-05-19 10:55:17 -07:00
Fabian Woltermann a69566f8bd Merge pull request #116 from asarium/ci/appveyor
Add AppVeyor configuration
2015-05-19 08:03:07 +02:00
MageKing17 67c75304e7 Merge pull request #115 from asarium/fix/luacpp
Fix scripting function ad.playMusic
2015-05-18 17:30:10 -07:00
niffiwan 6a88616f9b Merge pull request #96 from asarium/fix/unordered_map
Change SCP_hash_map to SCP_unordered_map
2015-05-19 07:48:23 +10:00
asarium 57f709fcec Add AppVeyor configuration 2015-05-18 23:26:38 +02:00
asarium 4a3da56ffd Merge branch 'master' into antipodes 2015-05-18 22:29:27 +02:00
asarium 6c24aaae77 Actually get the loop variable from the lua stack 2015-05-18 21:57:44 +02:00
MageKing17 764c1ab03f Fix F3 lab using old idx value.
This was causing everything to use the Ship_info index of the size of the species vector; for FS2, that meant 3, which meant GTF Ares.
2015-05-18 10:09:29 -07:00
MageKing17 cde82a9093 Get rid of erroneous assertion. 2015-05-18 10:08:12 -07:00
MageKing17 16229a9950 Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info 2015-05-18 10:04:21 -07:00
Fabian Woltermann 7bf700f173 Merge pull request #105 from MageKing17/mantis/3139
Fix Mantis #3139.
2015-05-18 18:21:49 +02:00
Lari Nieminen 742925e0d9 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com 2015-05-18 19:07:31 +03:00
Cliff Gordon 761de4a671 [rename_2011] Rename MSVC_2011 to MSVC_2012 since that's what the IDE actually released as. 2015-05-18 10:53:15 -05:00
m!m 8502c66e7c Merge pull request #108 from niffiwan/coverity/1298258
Fix Coverity 1298258: Uninitialized scalar var
2015-05-18 11:46:56 +02:00
m!m dcebc4aa50 Merge pull request #110 from niffiwan/coverity/1298255
Fix Coverity 1298255: Uninitialized scalar var
2015-05-18 11:45:10 +02:00
Lari Nieminen 54a2a3ea5b Fixed stupid syntax error. 2015-05-18 00:49:31 +03:00
Lari Nieminen 56273906b7 Fixed incorrect volume ramping. 2015-05-17 17:04:57 +03:00
niffiwan 9df5407dfb I think this should resolve the Travis issue 2015-05-17 19:48:18 +10:00
niffiwan 51b8e83d89 Fix Coverity 1298257: Uninitialized scalar var
Add all struct members to constructor (esp thrust_scale which was read
uninitialised). Remove some var sets that the constructor now sets as
defaults. Also fixes 1298248
2015-05-17 13:25:00 +10:00
Lari Nieminen a44daaba35 Added $Minimum Engine Volume to ships.tbl, with which to customize how the ship's speed affects engine sound volume. 2015-05-17 03:33:46 +03:00
niffiwan 2d832dd11e Fix Coverity 1298255: Uninitialized scalar var
Copy particle min/max life values from modelinterp
Also avoid double->float conversion
2015-05-16 21:51:39 +10:00
niffiwan 1784e880ae Merge pull request #50 from asarium/coverity/1093690
Fix for Coverity 1093690: Resource leak
2015-05-16 20:05:43 +10:00
asarium 189f23a341 Change SCP_hash_map to SCP_unordered_map
Also uses std::unordered_map on every platform now
2015-05-16 11:40:10 +02:00
asarium cc9109843a Fix for Coverity 1093690: Resource leak
This introduces a move constructor for CJumpNode to handle freeing resources.
2015-05-16 11:20:20 +02:00
niffiwan 1deb837973 Merge pull request #102 from asarium/fix/noallocator
Remove SCP_vm_allocator
2015-05-16 14:13:44 +10:00
niffiwan 3859d16640 Fix Coverity 1298258: Uninitialized scalar var
Also fixes 1298256, 1298254, 1298253

For vertex vars use default value-initialisation to zero the struct
http://en.cppreference.com/w/cpp/language/value_initialization

Note that parts of vertex don't seem used in relevant codepaths, e.g.
the colours. A zero init approach should be safer should code change in
future.
2015-05-16 12:44:56 +10:00
MageKing17 e68261bbf3 Merge pull request #107 from niffiwan/coverity/1298268
Fix Coverity 1298268: Division by float zero
2015-05-15 19:01:37 -07:00
MageKing17 e2a350940a Merge pull request #106 from niffiwan/coverity/1298261
Fix Coverity 1298261 Missing break in switch
2015-05-15 19:00:07 -07:00
niffiwan 6512edec77 Fix Coverity 1298268: Division by float zero
The div-by-zero won't be triggered by this code because the
secondaryteam is "none". Play it safe and protect the div anyway
2015-05-16 10:59:15 +10:00
niffiwan 2910a7a6eb Fix Coverity 1298261 Missing break in switch 2015-05-16 10:36:30 +10:00
MageKing17 8efbd74cf0 Fix Mantis #3139.
This make ship explosion shockwaves use the tabled damage type. The code was creating a new shockwave_create_info object, initializing it, and then only copying some of the attributes of the ship's "shockwave" shockwave_create_info member (not including damage type). It makes more sense to use copy-assignment and then specifically override the attributes that should be overridden.
2015-05-15 16:40:25 -07:00
MageKing17 05b79a41fb Allow beams to be spawned weapons. 2015-05-15 16:28:42 -07:00
niffiwan e24f459eaf Merge pull request #103 from asarium/travis/badge
Add Travis CI badge to Readme.md
2015-05-16 09:23:02 +10:00
MageKing17 9a5fa95c54 Add subspace beam strikes.
Overhaul hudartillery.cpp to use STL containers (removes hardcoded limits on maximum number of strike types, simultaneously active strikes, and projectiles per strike), use modular tables, allow for different shape options, and allow beams as the weapon.
2015-05-15 16:19:44 -07:00
MageKing17 abfba82d48 Add beam-create SEXP.
Fires a floating beam from a given set of coordinates (like fire-beam and fire-beam-at-coordinates).
2015-05-15 16:11:36 -07:00
MageKing17 0609d3919f Allow floating beams.
Makes it possible for a beam to fire from a point in space instead of a turret.
2015-05-15 16:09:35 -07:00
MageKing17 f8954cc941 Fix typo of "section" as "secion". 2015-05-15 15:28:27 -07:00
asarium 794a7f5bd1 Add coverity badge to Readme.md 2015-05-16 00:02:56 +02:00
asarium 762e7c3e24 Remove SCP_vm_allocator 2015-05-15 23:39:15 +02:00
MageKing17 41df065706 Merge pull request #101 from asarium/antipodes
Sync Antipodes
2015-05-15 14:31:18 -07:00
MageKing17 165fc95411 Merge pull request #100 from ln-zookeeper/master
Fixed a bug with the next/prev subsystem targeting keys not working i…
2015-05-15 14:29:34 -07:00
asarium 43ef44e479 Install the right SDL package 2015-05-15 18:04:30 +02:00
asarium 5a0b3305da Merge branch 'master' into antipodes 2015-05-15 17:40:58 +02:00
Lari Nieminen 268c2558d5 Fixed a bug with the next/prev subsystem targeting keys not working if the target only has one subsystem. 2015-05-15 15:16:58 +03:00
niffiwan 34170b1cd2 Merge pull request #97 from asarium/travis/master
Add Travis CI config file
2015-05-15 20:39:20 +10:00
niffiwan 9147fc483f Merge pull request #52 from asarium/fix/warnings
Fix compilation warnings
2015-05-15 20:37:58 +10:00
Fabian Woltermann 450bc83068 Merge pull request #99 from SamuelCho/fog_shader_fix
Fix errors when model shader variants use fog but don't use diffuse maps.
2015-05-15 08:11:42 +02:00
SamuelCho 65d3d59c0f Fix errors when model shader variants use fog but don't use diffuse maps. 2015-05-14 22:40:43 -07:00
asarium e50555c4ae Add Travis CI config file 2015-05-14 22:20:30 +02:00
asarium e677ed7657 Fix warning 'allocate_poly_list' : unreferenced local function has been removed 2015-05-14 17:37:41 +02:00
niffiwan 82c2805b36 Merge branch 'ln-zookeeper-master' 2015-05-14 19:44:27 +10:00
niffiwan bf13e5053e Merge branch 'master' into ln-zookeeper-master
Conflicts:
	code/ai/ai_profiles.cpp
2015-05-14 19:38:19 +10:00
Fabian Woltermann f6093feceb Merge pull request #94 from MageKing17/bugfix/bomb-invulnerability
Make an AI profile flag for the aspect bomb invulnerability fix.
2015-05-14 10:54:56 +02:00
Fabian Woltermann 2ae6216c93 Merge pull request #95 from SamuelCho/bracket_trans_fix
Fixed ship select bracket rendering and lighting on transparent geometry.
2015-05-14 10:54:28 +02:00
asarium a237d7faad Fix compilation on OS X 2015-05-14 10:45:32 +02:00
asarium 77283e9c7a Fix conversion warnings 2015-05-14 10:45:32 +02:00
asarium f7a22d7ed0 Fix BM_TYPE to ubyte conversion warnings 2015-05-14 10:45:31 +02:00
asarium ab1b12fdd6 Fix "conversion from 'SPPHRASERNG' to 'ULONG'" warning 2015-05-14 10:45:30 +02:00
asarium d5938614c1 Fix "forcing value to bool 'true' or 'false'" warning 2015-05-14 10:45:29 +02:00
asarium 83bb7e144f Fix unused function warning 2015-05-14 10:45:29 +02:00
asarium 65b1569df2 Fix macro redefinition warning 2015-05-14 10:45:28 +02:00
asarium b849eec785 Fix "conversion from 'BM_TYPE' to 'ubyte'" warning 2015-05-14 10:45:27 +02:00
asarium b883ebc038 Fix usage of uninitialized variable warning 2015-05-14 10:45:26 +02:00
asarium 3cfbcbe363 Fix signed < unsigned warning 2015-05-14 10:45:25 +02:00
SamuelCho 5255f129dc Fixed gradient brackets in ship select screen. Fixed lighting for transparent meshes when using deferred lighting. 2015-05-13 20:38:17 -07:00
MageKing17 9555602823 Make an AI profile flag for the aspect bomb invulnerability fix.
Originally introduced in r8696 back in 2012 (hash d7d6009ea1), this fix changes retail balance and should be behind a flag.
2015-05-13 20:15:27 -07:00
MageKing17 9db390b553 Avoid bug in older clang versions.
Avoids calling std::swap() on multidimensional arrays.
2015-05-12 19:45:55 -07:00
MageKing17 48095d34e6 Fix a few typos. 2015-05-12 19:45:11 -07:00
MageKing17 51a8932f7f Add glowpoint_bank_override_map to the ship_info operations. 2015-05-12 19:44:26 -07:00
MageKing17 274a32e1ac Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info
Conflicts:
	code/model/modelread.cpp
	code/ship/ship.h
2015-05-12 19:22:58 -07:00
Lari Nieminen 2c1d1b12cc Allowed bay path speed modifiers to function in both pathing modes. 2015-05-13 00:35:40 +03:00
Lari Nieminen 133f059b8d Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com 2015-05-13 00:21:04 +03:00
Cliff Gordon fbbfef9ae2 Missing project file additions for shadows to compile on OS X. 2015-05-12 15:37:44 -05:00
MageKing17 ccf623f4b1 Merge pull request #93 from asarium/antipodes
Sync Antipodes
2015-05-12 11:41:56 -07:00
asarium c6e7087b60 Merge branch 'master' into antipodes
Conflicts:
	code/graphics/2d.cpp
	projects/MSVC_2013/code.vcxproj.filters
2015-05-12 20:34:35 +02:00
The E 556550fbde Updated project files for MSVC 2015 2015-05-12 20:27:34 +02:00
Fabian Woltermann 5dfbc6d292 Merge pull request #88 from SamuelCho/soft_shadows_deferred_lighting
Soft shadows, deferred lighting, and various graphics improvements and optimizations
2015-05-12 20:06:33 +02:00
Lari Nieminen 4fbf65ae8b Warn about bay path speed multipliers currently only working with the 'alt1' pathing type. 2015-05-11 19:50:13 +03:00
Lari Nieminen c9ec754eb6 Fixed $bay arrive/depart speed multiplier not working correctly. 2015-05-11 19:09:55 +03:00
niffiwan 1fe476a9e2 Merge pull request #79 from asarium/mantis/3134
From LotF: Fix for Mantis 3134
2015-05-10 21:45:25 +10:00
Lari Nieminen ffed62372f Added ai_profiles and path metadata options to force AI ships flying bay paths to gradually accelerate/decelerate instead of flying the path at max speed. 2015-05-10 11:52:09 +03:00
MageKing17 367c060749 Merge pull request #91 from ln-zookeeper/master
Avoid loading the anchor ship model multiple times when resolving pat…
2015-05-09 17:13:31 -07:00
Lari Nieminen 24d16213a6 Avoid loading the anchor ship model multiple times when resolving path masks. 2015-05-10 02:23:44 +03:00
MageKing17 be57943a52 Merge pull request #90 from ln-zookeeper/master
Revert a part of f6e2f1d2 / r11129 which causes collision problems in…
2015-05-09 16:03:09 -07:00
Lari Nieminen 7a8c7cc6c2 Revert a part of f6e2f1d2 / r11129 which causes collision problems in some corner cases. 2015-05-09 13:42:12 +03:00
niffiwan c85904b3c5 Merge pull request #85 from MageKing17/bugfix/random-multiple-of
Fix random-multiple-of.
2015-05-09 19:47:23 +10:00
MageKing17 08a1434b71 Merge pull request #89 from niffiwan/coverity/1093714_mk2
Fix Coverity 1093714: Negative array index read
2015-05-09 01:42:50 -07:00
niffiwan d69b7d7e0d Add newline to Assertion msg 2015-05-09 18:27:20 +10:00
niffiwan 93a5d82ca8 Fix Coverity 1093714: Negative array index read
This is very unlikely, but add an assertion anyway just in case someone
in future messes us keeping num_primary_banks & primary_bank_weapons in
sync.
2015-05-09 17:08:21 +10:00
SamuelCho 90c8025588 Code cleanup before the big soft shadows and deferred lighting merge into master. 2015-05-08 21:55:28 -07:00
SamuelCho 520b89408e Fixed warnings related to graphics code additions. 2015-05-08 21:21:20 -07:00
SamuelCho 094c5fe302 Resolve faster ibx and improved profiling merges. 2015-05-08 20:53:59 -07:00
niffiwan 27cdf337fb Merge pull request #74 from SamuelCho/faster_ibx
Greatly increase the generation speed of index buffers.
2015-05-09 13:35:54 +10:00
niffiwan f2d3763bdd Merge pull request #86 from MageKing17/bugfix/sexp-not-segfault
Fix typo in eval_not.
2015-05-09 13:30:29 +10:00
SamuelCho 96cbfb1fdf #include <algorithm> to get faster index buffer generation working on Linux. 2015-05-08 20:20:29 -07:00
MageKing17 290d25d6ae Fix typo in eval_not.
Can cause serious problems by accessing Sexp_nodes[-1].value. Caused chief1986 to segfault on OS X.
2015-05-08 16:13:35 -07:00
MageKing17 9ef7aa2432 Fix random-multiple-of.
I don't know if I was just tired when I wrote this originally or what, but there were two problems here; one, the for-loop condition was inverted (and since I made it a for-loop instead of a while-loop, I'm not sure why I didn't take out the "break" condition), so its contents would never actually evaluate. Two, the node matching random_argument wasn't being stored anywhere so even if the for-loop condition hadn't been wrong, it would've just used the last valid argument instead of the first argument every time. Fixes GitHub issue #84.
2015-05-08 16:09:37 -07:00
asarium d822f2a467 Merge branch 'master' into antipodes
Conflicts:
	code/io/timer.cpp

timer conflict was fixed by using the performance counters of SDL instead of what the OS offers directly
2015-05-08 22:24:36 +02:00
niffiwan a39a7530f8 Merge pull request #82 from ln-zookeeper/master
Added a "Show Destroyed Subsystems" flag to ship lab for viewing -des…
2015-05-08 20:32:13 +10:00
Fabian Woltermann 77ee6f100b Merge pull request #83 from asarium/feature/betterGamesndParsing
Improve gamesnd modular parsing
2015-05-08 10:32:26 +02:00
asarium 88a85e4024 Improve gamesnd modular parsing
As requested by jg18, this improves the sound.tbl parser to properly handle +nocreate. If the file name of an entry should not be changed you have to specify <same>.
2015-05-08 08:48:17 +02:00
m!m 2223db66d2 Merge pull request #81 from asarium/antipodes
Sync Antipodes
2015-05-08 08:08:29 +02:00
Lari Nieminen ce853a5f07 Added a "Show Destroyed Subsystems" flag to ship lab for viewing -destroyed submodels. 2015-05-08 01:20:58 +03:00
MageKing17 87b79774d1 Merge pull request #80 from asarium/fix/gitignore
Update .gitignore to include voice recognition files
2015-05-07 13:46:32 -07:00
asarium 48206c3ef8 Update .gitignore to include voice recognition files 2015-05-07 22:41:22 +02:00
asarium 2453161a54 Merge branch 'master' into antipodes 2015-05-07 22:38:11 +02:00
Fabian Woltermann 0349240a33 Merge pull request #75 from SamuelCho/profiling_microseconds
Improved profiling code to have a timing resolution of microseconds instead of milliseconds
2015-05-07 21:03:44 +02:00
Samuel Cho 135620dcf9 Merge branch 'faster_ibx' of https://github.com/SamuelCho/fs2open.github.com into faster_ibx 2015-05-07 09:47:41 -07:00
Swifty 60a5a6bd7c Removal of IBX file code and related command-line options. 2015-05-07 09:46:58 -07:00
Swifty 5a68f6d830 Greatly increase the generation speed of index buffers. 2015-05-07 09:46:57 -07:00
asarium aa6936a2a5 From LotF: Fix for Mantis 3134
dynamic weapon point firing causes a crash when used on a fighter with more than 6 firing points
2015-05-07 18:27:48 +02:00
niffiwan 935af40c87 Merge pull request #78 from ln-zookeeper/master
Make firepoint HUD gauge light up only firepoints that'll fire next
2015-05-07 20:32:28 +10:00
Lari Nieminen 42d830e62f * Made the firepoint HUD gauge light up only the firepoints which will fire next, if "dynamic primary linking" ship flag or "cycle" weapon flag is used. 2015-05-06 23:40:40 +03:00
Swifty 7cf5a3e085 Removal of IBX file code and related command-line options. 2015-05-06 12:27:50 -07:00
Cliff Gordon 0ce31bf471 [fix/triplemon_hud] Yarn's triple-monitor fix, see http://www.hard-light.net/forums/index.php?topic=89262.0. Patch tweaked to work around changes in 9aed627. 2015-05-06 10:40:45 -05:00
Fabian Woltermann 4d90765185 Merge pull request #48 from MageKing17/bugfix/fred-ship-editor-persona
Fix persona selection in FRED's ship editor.
2015-05-06 12:27:05 +02:00
niffiwan 7b82acb327 Merge pull request #73 from MageKing17/mantis/3140
Fix Mantis 3140.
2015-05-06 20:17:26 +10:00
niffiwan 666e1ddeeb Merge pull request #70 from ln-zookeeper/master
Add optional control preset names

Also display the name in the control config page (F2)
2015-05-06 19:11:51 +10:00
Swifty dd9f9ed921 Improved profiling code to have a timing resolution of microseconds instead of milliseconds. 2015-05-05 20:41:05 -07:00
Swifty 47c2aa0bbc Greatly increase the generation speed of index buffers. 2015-05-05 19:08:41 -07:00
MageKing17 e59bb76f72 Get rid of warning on 64-bit compilers.
If size_t is bigger than an int, this line generates warnings.
2015-05-05 14:43:20 -07:00
MageKing17 202bd3a5dc Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info 2015-05-05 14:39:01 -07:00
MageKing17 5f43e78be2 Fix Mantis 3140.
Changes the "virtual frame" used for aspect locks to be 640x480 so as to correct different lock behavior due to both different aspect ratios and different resolutions. Applies a scaling factor to the drawing of the lock indicator on the HUD so that it traverses roughly the same portion of the screen regardless of resolution.
2015-05-05 12:54:07 -07:00
Cliff Gordon e3ca0ec5b1 Merge pull request #59 from Echelon9/fix/doxygen
Fix doxygen documentation
2015-05-05 09:41:41 -05:00
Echelon9 464a25b457 Fix empty documentation/doxygen using .gitkeep and global .gitignore trick. Otherwise, Git does not index empty folders. 2015-05-06 00:18:28 +10:00
Echelon9 819f53721d Revert "Fix empty documentation/doxygen using .gitignore trick. Otherwise, Git does not index empty folders."
This reverts commit 550998e827.
2015-05-05 23:59:39 +10:00
niffiwan 4e68213569 Merge pull request #72 from chief1983/mantis/3158b
Fix for Mantis #3158: prevent narrowing that breaks compilation in stricter compilers
2015-05-05 11:37:09 +10:00
Cliff Gordon 6b080df736 Fix for Mantis #3158 (take 2): change the size of the token used for released but active streams to fit into an int without narrowing. 2015-05-04 20:33:02 -05:00
Lari Nieminen 0bb972b141 Made it possible to name control presets, and made controls config display the current preset's name if there are multiple to choose from. 2015-05-05 00:38:24 +03:00
niffiwan 93d88650e1 Merge pull request #68 from chief1983/fix/HAVE_CXX11-freebsd
Fix for a 'HAVE_CXX11 already defined' warning

(related to clang on non-OSX OS's)
2015-05-05 07:34:08 +10:00
Cliff Gordon cd399f90a1 Fix for a 'HAVE_CXX11 already defined' warning on almost every compiled object on FreeBSD. 2015-05-04 14:42:41 -05:00
Fabian Woltermann 189275da56 Merge pull request #56 from asarium/coverity/1093600
Fix for Coverity 1093600: Negative array index read
2015-05-03 21:57:23 +02:00
Fabian Woltermann 4c7d80cba8 Merge pull request #63 from asarium/coverity/1093530
Fix for Coverity 1093530: Negative array index read
2015-05-03 21:56:16 +02:00
Fabian Woltermann 4a14e26256 Merge pull request #64 from asarium/coverity/1093515
Fix for Coverity 1093515: Negative array index read
2015-05-03 21:55:50 +02:00
Fabian Woltermann 0fc8e53f5f Merge pull request #65 from asarium/coverity/1237276
Fix for Coverity 1237276: Uninitialized scalar field
2015-05-03 21:55:04 +02:00
Fabian Woltermann ba2a1c9e7d Merge pull request #62 from asarium/coverity/1093555
Fix for Coverity 1093555: Negative array index read
2015-05-03 21:53:56 +02:00
Fabian Woltermann 115a2979b1 Merge pull request #67 from asarium/fix/aigoals
Fix usage of negative index
2015-05-03 21:53:01 +02:00
asarium e9b9797b6e Fix usage of negative index
I have no idea why this didn't cause any issues earlier...
2015-05-03 21:27:23 +02:00
Fabian Woltermann 08f8487023 Merge pull request #66 from asarium/antipodes
Sync antipodes branch
2015-05-03 16:19:44 +02:00
asarium 922f482d08 Merge branch 'master' into antipodes
Conflicts:
	code/cutscene/cutscenes.cpp
	code/freespace2/freespace.cpp
	code/hud/hudconfig.cpp
2015-05-03 16:05:56 +02:00
asarium da0ef89ac5 Fix for Coverity 1237276: Uninitialized scalar field
The field will contain an arbitrary value left over from earlier computations.
In subtitle::​subtitle(int, int, char const*, char const*, float, float, color const*, int, bool, bool, int, int, bool): A scalar field is not initialized by the constructor
2015-05-03 14:55:06 +02:00
asarium fe49ef63aa Fix for Coverity 1093515: Negative array index read
A memory location at a negative offset from the beginning of the array will be read, resulting in incorrect values.
In multi_options_process_packet(unsigned char *, header *): Negative value used to index an array in a read operation
2015-05-03 14:44:26 +02:00
asarium f51bc78126 Fix for Coverity 1093530: Negative array index read
A memory location at a negative offset from the beginning of the array will be read, resulting in incorrect values.
In message_queue_process(): Negative value used to index an array in a read operation
2015-05-03 14:34:06 +02:00
m!m 711c7a7bf8 Merge pull request #61 from niffiwan/coverity-1093565
Fix Coverity 1093565: Negative array index read
2015-05-03 04:27:22 -07:00
asarium ca16b4710d Fix for Coverity 1093555: Negative array index read
A memory location at a negative offset from the beginning of the array will be read, resulting in incorrect values.
In multi_create_standalone_object(): Negative value used to index an array in a read operation

observer_create() will only fail in exceptional circumstances so a showing an error dialog should be acceptable
2015-05-03 13:12:23 +02:00
niffiwan 471cf4c988 Fix Coverity 1093565: Negative array index read
Add an assertion to catch any callers that haven't correctly set
the target_name. Also fix a minor typo in the comments
2015-05-03 20:31:16 +10:00
Goober5000 d734a36940 Merge pull request #60 from niffiwan/coverity-1093484
Fix Coverity 1093484
2015-05-03 02:14:34 -04:00
niffiwan 25079f5ed2 Fix Coverity 1093484
time_t is 64bit on 64bit systems; casting a pointer to a larger type is
dangerous, but assigning to a larger type should be fine
2015-05-03 15:42:25 +10:00
Goober5000 f0a0632d9d Merge pull request #51 from asarium/coverity/1093689
Fix for Coverity 1093689: Resource leak
2015-05-02 23:47:28 -04:00
Echelon9 b8ba7f1466 Address obsolete Doxyfile sections, per Doxygen 1.8.9.1 automatic Doxyfile updater. 2015-05-03 11:39:36 +10:00
Echelon9 550998e827 Fix empty documentation/doxygen using .gitignore trick. Otherwise, Git does not index empty folders. 2015-05-03 11:23:19 +10:00
Swifty 6da0d162b8 Fixed compilation issues. 2015-05-02 17:18:51 -07:00
asarium 3528dffabd Fix for Coverity 1093587: Negative array index read
The random value shouldn't be used if there are no countermeasures so this shouldn't cause any issues.
2015-05-02 23:53:39 +02:00
Swifty c620372357 Soft shadows, deferred lighting, and various major graphics optimizations. 2015-05-02 14:35:37 -07:00
asarium 2aa569c1e7 Fix for Coverity 1093600: Negative array index read
hud_squadmsg_is_target_order_valid already checks if ainfo->target_objnum is less than zero so that check is not needed
2015-05-02 23:14:59 +02:00
Goober5000 584ec36f62 Merge pull request #53 from asarium/coverity/1093688
Fix for Coverity 1093688: Resource leak
2015-05-02 15:45:50 -04:00
Goober5000 93c46bd1f9 Merge pull request #55 from asarium/coverity/1093606
Fix for Coverity 1093606: Negative array index read
2015-05-02 15:45:17 -04:00
Goober5000 b6cc62c435 Merge pull request #54 from asarium/coverity/1093683
Fix for Coverity 1093683: Resource leak
2015-05-02 15:44:26 -04:00
asarium 00a288d53e Fix for Coverity 1093606: Negative array index read 2015-05-02 19:41:55 +02:00
asarium 4bfea90a17 Fix for Coverity 1093683: Resource leak 2015-05-02 19:32:39 +02:00
asarium aef3e3ac36 Fix for Coverity 1093688: Resource leak 2015-05-02 19:24:57 +02:00
asarium a7398d7f5c Fix for Coverity 1093689: Resource leak 2015-05-02 18:19:28 +02:00
MageKing17 0a6ab7d1f7 Fix persona selection in FRED's ship editor.
The old code operated under the assumption that all wingman personas would be at the start of the persona list. Since this assumption was neither checked for nor warned if violated anywhere else, I've made FRED work regardless of how they might be distributed throughout the Personas[] array.
2015-05-01 16:23:29 -07:00
MageKing17 e8bed8f892 Merge branch 'master' of ssh://github.com/scp-fs2open/fs2open.github.com into ship_info
Conflicts:
	code/ship/ship.cpp
2015-05-01 13:09:32 -07:00
Fabian Woltermann e2d740513a Merge pull request #47 from MageKing17/mantis/2971
Fix for 2971 from MageKing17: Stop executing HUD code when running as standalone.
2015-05-01 08:27:01 +02:00
MageKing17 1a29b395ab Stop standalones from executing hud_shield_quadrant_hit().
Also add some assertions to avoid (or at least help detect) similar errors in the future. Should fix Mantis 2971.
2015-04-30 22:10:17 -07:00
Goober5000 b2e01d6173 Merge pull request #42 from MageKing17/argument_sexps
*-argument sexp short-circuiting
2015-04-30 22:46:38 -04:00
Me bc17966b08 Merge pull request #46 from DahBlount/recoil
Feature: add primary weapon recoil
2015-05-01 08:02:53 +10:00
MageKing17 be9990f6a5 Fix cf_file_exists().
Was passing the pointer to *size instead of *offset, so instead of seeing if the file didn't have an offset, we were checking if it didn't have a size.
2015-04-29 23:21:49 -07:00
niffiwan c5bddac8fb Merge pull request #43 from niffiwan/cpp11_mk2
Cpp11 support for GCC
2015-04-30 14:36:20 +10:00
DahBlount 3de25b7e3a modifier value changes
We don't want to change things at run time so initialize them to
non-zero values.
2015-04-29 18:11:16 -07:00
DahBlount 2768863c36 Add ship_recoil_modifier 2015-04-29 18:01:52 -07:00
DahBlount 7b78df2363 Add "apply recoil" flag and modifier
This adds the "apply recoil" weapon flag and $Recoil Modifier:
weapons.tbl entry.
2015-04-29 17:26:33 -07:00
MageKing17 d84736be1c Revert "Made the firepoint HUD gauge light up only the firepoints which will fire next, if "dynamic primary linking" ship flag or "cycle" weapon flag is used."
This reverts commit 5042c44904.

(Apparently, "git revert" on a range is only inclusive of the end commit, not the starting commit.)
2015-04-29 16:35:41 -07:00
MageKing17 1591237acf Reverting recent string of commits.
Since they didn't go through code review (and break compilation), reverting the recent string of commits (just used "git revert -n 5042c44..05b4635").
2015-04-29 16:19:59 -07:00
zookeeper 05b4635048 Added bay arrive/depart speed multipliers to +Path Metadata.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@11271 387891d4-d844-0410-90c0-e4c51a9137d3

Conflicts:
	code/ai/ai_profiles.cpp
2015-04-29 23:19:02 +03:00
zookeeper eef1041323 Initialize bay_arrive_speed_mult and bay_depart_speed_mult.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@10731 387891d4-d844-0410-90c0-e4c51a9137d3

Conflicts:
	code/ai/ai_profiles.cpp
2015-04-29 23:17:51 +03:00
zookeeper 18058a45f7 Added ai_profiles.tbl options to force AI ships flying bay paths to gradually accelerate/decelerate instead of flying the path at max speed.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@10422 387891d4-d844-0410-90c0-e4c51a9137d3

Conflicts:
	code/ai/ai_profiles.cpp
2015-04-29 23:16:55 +03:00
zookeeper fbb76863fd Probably fixed a bug with the next/prev subsystem targeting keys not working if the target only has one subsystem.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@11209 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 23:12:42 +03:00
zookeeper 400fd0f9a8 Fixed $Thruster Glow Noise Mult not having effect in the ship lab.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@10789 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 23:07:41 +03:00
zookeeper b18337754d Added a $Model Icon Direction ship table entry for overriding the angle from which ship icons are rendered from.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@10612 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 23:04:25 +03:00
zookeeper 92a28b71cb Added a $Thruster Glow Noise Mult ship table entry for decreasing/increasing the effect of noise applied to the glow radius.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@10610 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 23:04:24 +03:00
zookeeper 0656175a72 Added a $Minimum Engine Volume ship table entry for specifying the minimum engine sound volume used when ship is stationary.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@10609 387891d4-d844-0410-90c0-e4c51a9137d3

Conflicts:
	code/object/objectsnd.cpp
2015-04-29 23:04:23 +03:00
zookeeper dc820fdfc1 Avoid loading the anchor ship model multiple times when resolving path masks.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@11235 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 22:45:57 +03:00
zookeeper 5042c44904 Made the firepoint HUD gauge light up only the firepoints which will fire next, if "dynamic primary linking" ship flag or "cycle" weapon flag is used.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@11256 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 22:42:58 +03:00
Lari Nieminen 91000b4468 Revert "Fixed +Spread From LOD not working right."
This reverts commit 4b15ec4e75.
2015-04-29 22:41:17 +03:00
Lari Nieminen 91614162f2 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com 2015-04-29 22:38:05 +03:00
zookeeper 4b15ec4e75 Fixed +Spread From LOD not working right.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@11268 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 22:36:43 +03:00
MageKing17 e84a6e8d33 Fix tech room mission lists.
get_mission_info() was returning an uninitialized int due to rval no longer being initialized to 0 by setjmp(). Since rval isn't actually needed anymore, I went ahead and removed it. The only bits of code that actually check the return value of get_mission_info() are the tech room's mission simulator and some of the multiplayer code, so this bug wasn't actually preventing missions from being played through the ready room.
2015-04-29 12:34:11 -07:00
niffiwan 763601033b Remove unused function from palman.[cpp|h] 2015-04-29 21:00:19 +10:00
niffiwan caf2876d50 Merge pull request #40 from asarium/antipodes
Add proper usage of SDLMain again
2015-04-29 20:58:58 +10:00
niffiwan 0ff8c8191f Remove gcc -Wshadow warnings 2015-04-29 20:55:56 +10:00
asarium 62cfccb325 Remove the rest of no-grab 2015-04-29 12:51:47 +02:00
niffiwan b0bb0ee3be Remove gcc -Wunused-but-set-variable warnings 2015-04-29 20:27:49 +10:00
MageKing17 31140ab533 Make FRED use the new try-catch logic.
Missed during the recent parseExceptions merge; there was a usage of setjmp() during the background import dialogue.
2015-04-28 19:09:19 -07:00
asarium 5701b477f4 Remove accidentally added files 2015-04-28 21:01:00 +02:00
asarium 78c52ebcc9 Fix some merge issues 2015-04-28 21:00:41 +02:00
niffiwan e3d1428e35 From Yarn: fix mantis 3157
Switch German and Polish translations of "Transport"
2015-04-28 19:36:30 +10:00
Fabian Woltermann 1d332d693d Merge pull request #38 from asarium/feature/parseExceptions
Replace longjmp with exceptions
2015-04-28 07:47:53 +02:00
niffiwan 36c656c389 bah, lrn2markdown 2015-04-27 20:46:37 +10:00
niffiwan 43b8cf2221 Resolve github issue #34 (add Coverity Badge)
Also freshen up the new README.md contents
2015-04-27 20:43:51 +10:00
MageKing17 ad91ba61b5 Short-circuit eval_sexp() on SEXP_NAN_FOREVER.
Since SEXP_NAN_FOREVER is supposed to indicate that the node will always evaluate to SEXP_NAN_FOREVER, we should short-circuit the process like we do for SEXP_KNOWN_TRUE and SEXP_KNOWN_FALSE.
2015-04-27 03:11:33 -07:00
MageKing17 7dea7075e7 Clean up eval_sexp() return value comparisons.
From niffiwan and myself (almost entirely niffiwan). Since eval_sexp() can't actually (and shouldn't) return certain special values, remove conditions checking for them and remove the erroneous comment claiming they should be returned.
2015-04-27 03:09:45 -07:00
MageKing17 9ec10dd3e6 Fix memory leak in for-counter.
Switch from strdup() to vm_strdup(), and make sure the allocated strings get freed after usage.
2015-04-27 03:06:28 -07:00
MageKing17 83b59fb76c Make *-argument SEXPs possible to short-circuit.
Fixes Mantis 3136. Written by niffiwan and myself. Allows the *-of SEXPs to return SEXP_KNOWN_FALSE when they can't evaluate ever again, allowing the when-argument or every-time-argument SEXP containing them to itself return SEXP_KNOWN_FALSE.
2015-04-27 03:05:18 -07:00
Lari Nieminen 418d53f169 Removed false "returns ptr to vector" comments. 2015-04-27 11:57:39 +03:00
MageKing17 15f6549087 Ship templates!
Restores ship templates, only working, thanks to ship_info now having a proper copy-assignment operator.
2015-04-27 00:05:57 -07:00
MageKing17 3a7307d0ce Somewhat-related followup to Ship_info vectorization.
There were some references to MAX_WEAPON_TYPES in missionscreencommon.cpp that really looked like they should've been referring to Num_weapon_types (formatted similarly to some references to MAX_SHIP_CLASSES which were changed to Ship_info.size() references). Figured I might as well fix them at the same time.
2015-04-27 00:03:20 -07:00
MageKing17 bc0c7cf4c5 Vectorization of Ship_info.
Converts Ship_info from a ship_info[] to an SCP_vector<ship_info>. ship_info now has proper constructors, assignment operators, and a destructor. Num_ship_classes removed; various references to Num_ship_classes and/or MAX_SHIP_CLASSES (which remains for various other structures which need it) changed to Ship_info.size() instead.

This doesn't make the ship class limit dynamic, but it is a preparatory step to get there.
2015-04-27 00:01:22 -07:00
MageKing17 5daf294f25 Remove irrelevant assertion.
Removes assertion in ship_model_update_instance() about turrets having the ability to rotate. Matches previous change to ship_model_start() (done in r10822; see also Mantis 3061).
2015-04-26 15:51:37 -07:00
MageKing17 0bcb3f24e6 Fix automatic "$Short name:" generation.
Made it include srcend (i.e. the null terminator) so that treating short_name as a null-terminated string (which it should be) doesn't access invalid memory. Also removed unused "destend" pointer.
2015-04-26 13:48:11 -07:00
MageKing17 9e66027e8b Remove unused "tspecies_names" pointer array. 2015-04-26 13:38:20 -07:00
MageKing17 d1444b45ac Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com 2015-04-26 10:04:57 -07:00
MageKing17 26553f1327 Voice recognition upgrades.
Switches to an in-process recognizer, removes the hard-coded wing list (which could in accessing invalid memory, when used with a custom grammar file), and fixes up the grammar file a bit.
2015-04-26 10:03:44 -07:00
Cliff Gordon (chief1983) 18ef1f77d4 FreeBSD 10 is on Clang now, -ansi doesn't mean anything here. 2015-04-26 10:27:12 -05:00
asarium 9d7e6824a5 Fix compilation 2015-04-26 15:57:52 +02:00
asarium 67cf5c31ee Remove unnecessary function call 2015-04-25 18:55:08 +02:00
asarium 6582285676 Merge remote-tracking branch 'upstream/antipodes' into antipodes 2015-04-25 18:41:10 +02:00
asarium 900c77216a Add usage of SDLMain again 2015-04-25 18:39:29 +02:00
Fabian Woltermann 88d1b2b520 Merge pull request #39 from asarium/antipodes
Merge branch 'master' into antipodes
2015-04-25 17:57:49 +02:00
asarium 7e77b5a67c Merge branch 'master' into antipodes
Conflicts:
	.gitignore
	code/Makefile.am
	code/ai/ai.h
	code/ai/ai_profiles.cpp
	code/ai/ai_profiles.h
	code/ai/aibig.cpp
	code/ai/aicode.cpp
	code/ai/aiturret.cpp
	code/asteroid/asteroid.cpp
	code/asteroid/asteroid.h
	code/bmpman/bm_internal.h
	code/bmpman/bmpman.cpp
	code/bmpman/bmpman.h
	code/camera/camera.cpp
	code/camera/camera.h
	code/cfile/cfile.cpp
	code/cmdline/cmdline.cpp
	code/cmdline/cmdline.h
	code/controlconfig/controlsconfig.h
	code/controlconfig/controlsconfigcommon.cpp
	code/cutscene/movie.cpp
	code/cutscene/oggplayer.cpp
	code/debugconsole/consoleparse.cpp
	code/fred2/campaigneditordlg.cpp
	code/fred2/fred.cpp
	code/fred2/fred.rc
	code/fred2/missionsave.cpp
	code/fred2/resource.h
	code/fred2/sexp_tree.cpp
	code/fred2/sexp_tree.h
	code/fred2/shipflagsdlg.cpp
	code/fred2/shipflagsdlg.h
	code/fred2/shiptexturesdlg.cpp
	code/fred2/voiceactingmanager.cpp
	code/freespace2/freespace.cpp
	code/freespace2/freespace.rc
	code/gamehelp/contexthelp.cpp
	code/globalincs/alphacolors.cpp
	code/globalincs/alphacolors.h
	code/globalincs/version.h
	code/globalincs/vmallocator.h
	code/globalincs/windebug.cpp
	code/graphics/2d.cpp
	code/graphics/font.cpp
	code/graphics/generic.cpp
	code/graphics/generic.h
	code/graphics/grinternal.h
	code/graphics/gropengl.cpp
	code/graphics/gropengldraw.cpp
	code/graphics/gropenglextension.h
	code/graphics/gropenglpostprocessing.cpp
	code/graphics/gropenglstate.cpp
	code/graphics/gropenglstate.h
	code/graphics/gropengltexture.cpp
	code/graphics/gropengltnl.cpp
	code/hud/hud.cpp
	code/hud/hud.h
	code/hud/hudconfig.cpp
	code/hud/hudlock.cpp
	code/hud/hudmessage.cpp
	code/hud/hudparse.cpp
	code/hud/hudreticle.cpp
	code/hud/hudreticle.h
	code/hud/hudshield.cpp
	code/hud/hudsquadmsg.cpp
	code/hud/hudtarget.cpp
	code/hud/hudtarget.h
	code/hud/hudtargetbox.cpp
	code/inetfile/cftp.cpp
	code/inetfile/chttpget.cpp
	code/io/joy.cpp
	code/io/joy_ff.cpp
	code/io/key.cpp
	code/io/keycontrol.cpp
	code/io/mouse.cpp
	code/io/timer.cpp
	code/localization/localize.cpp
	code/localization/localize.h
	code/math/fvi.cpp
	code/math/vecmat.cpp
	code/menuui/credits.cpp
	code/menuui/mainhallmenu.cpp
	code/menuui/mainhallmenu.h
	code/menuui/optionsmenumulti.cpp
	code/menuui/playermenu.cpp
	code/mission/missionbriefcommon.cpp
	code/mission/missioncampaign.cpp
	code/mission/missiongoals.h
	code/mission/missionmessage.cpp
	code/mission/missionparse.cpp
	code/mission/missionparse.h
	code/missionui/missionbrief.cpp
	code/missionui/missioncmdbrief.cpp
	code/missionui/missiondebrief.cpp
	code/missionui/missionscreencommon.cpp
	code/missionui/missionshipchoice.cpp
	code/missionui/missionweaponchoice.cpp
	code/missionui/redalert.cpp
	code/missionui/redalert.h
	code/mod_table/mod_table.cpp
	code/mod_table/mod_table.h
	code/model/model.h
	code/model/modelcollide.cpp
	code/model/modelinterp.cpp
	code/model/modelread.cpp
	code/network/multi.cpp
	code/network/multi_dogfight.cpp
	code/network/multi_ingame.cpp
	code/network/multi_log.cpp
	code/network/multi_rate.cpp
	code/network/multiteamselect.cpp
	code/network/multiui.cpp
	code/network/multiutil.cpp
	code/network/stand_gui-unix.cpp
	code/object/collideshipship.cpp
	code/object/collideshipweapon.cpp
	code/object/object.cpp
	code/object/object.h
	code/object/objectsnd.cpp
	code/object/objectsort.cpp
	code/osapi/osapi.cpp
	code/osapi/osapi_unix.cpp
	code/osapi/outwnd.h
	code/parse/generic_log.cpp
	code/parse/lua.cpp
	code/parse/parselo.cpp
	code/parse/parselo.h
	code/parse/scripting.cpp
	code/parse/scripting.h
	code/parse/sexp.cpp
	code/parse/sexp.h
	code/physics/physics.cpp
	code/pilotfile/csg.cpp
	code/pilotfile/csg_convert.cpp
	code/pilotfile/pilotfile.cpp
	code/pilotfile/pilotfile_convert.h
	code/playerman/playercontrol.cpp
	code/radar/radardradis.cpp
	code/radar/radardradis.h
	code/radar/radarsetup.cpp
	code/radar/radarsetup.h
	code/ship/ship.cpp
	code/ship/ship.h
	code/ship/shipfx.cpp
	code/ship/shiphit.cpp
	code/sound/audiostr.cpp
	code/sound/ds.cpp
	code/sound/openal.cpp
	code/sound/rtvoice.cpp
	code/sound/sound.cpp
	code/sound/voicerec.cpp
	code/stats/medals.cpp
	code/stats/medals.h
	code/stats/scoring.cpp
	code/ui/ui.h
	code/weapon/beam.cpp
	code/weapon/weapon.h
	code/weapon/weapons.cpp
	code/wxfred2/aboutbox.cpp
	code/wxfred2/campaigneditor.cpp
	code/wxfred2/campaigneditor.h
	code/wxfred2/commandbriefingeditor.cpp
	code/wxfred2/debriefingeditor.cpp
	code/wxfred2/fredframe.cpp
	code/wxfred2/fredframe.h
	code/wxfred2/missionspecseditor.cpp
	code/wxfred2/missionspecseditor.h
	code/wxfred2/voiceactingmanagereditor.cpp
	code/wxfred2/wxfred.xrc
	code/wxfred2/wxfred2.cpp
	code/wxfred2/wxfred2.h
	configure.ac
	fs2open.Doxyfile
	jansson/LICENSE
	jansson/dump.c
	jansson/hashtable.c
	jansson/hashtable.h
	jansson/jansson.h
	jansson/jansson_config.h
	jansson/jansson_private.h
	jansson/load.c
	jansson/memory.c
	jansson/pack_unpack.c
	jansson/strbuffer.c
	jansson/strbuffer.h
	jansson/strconv.c
	jansson/utf.c
	jansson/utf.h
	jansson/value.c
	libpng/png.c
	libpng/png.h
	libpng/pngconf.h
	libpng/pngdebug.h
	libpng/pngerror.c
	libpng/pngget.c
	libpng/pnginfo.h
	libpng/pnglibconf.h
	libpng/pngmem.c
	libpng/pngpread.c
	libpng/pngpriv.h
	libpng/pngread.c
	libpng/pngrio.c
	libpng/pngrtran.c
	libpng/pngrutil.c
	libpng/pngset.c
	libpng/pngstruct.h
	libpng/pngtrans.c
	libpng/pngwio.c
	libpng/pngwrite.c
	libpng/pngwtran.c
	libpng/pngwutil.c
	projects/Eclipse/Freespace2/.project
	projects/MSVC_2005/Fred2.vcproj
	projects/MSVC_2005/Freespace2.sln
	projects/MSVC_2005/Freespace2.vcproj
	projects/MSVC_2005/code.vcproj
	projects/MSVC_2005/wxFRED2.vcproj
	projects/MSVC_2008/Fred2.vcproj
	projects/MSVC_2008/Freespace2.doxproj
	projects/MSVC_2008/Freespace2.vcproj
	projects/MSVC_2008/code.vcproj
	projects/MSVC_2010/Fred2.vcxproj
	projects/MSVC_2010/Freespace2.vcxproj
	projects/MSVC_2010/code.vcxproj
	projects/MSVC_2010/code.vcxproj.filters
	projects/MSVC_2010/wxFRED2.vcxproj
	projects/MSVC_2011/Fred2.vcxproj
	projects/MSVC_2011/Freespace2.vcxproj
	projects/MSVC_2011/code.vcxproj
	projects/MSVC_2011/code.vcxproj.filters
	projects/MSVC_2011/wxFRED2.vcxproj
	projects/MSVC_2013/Fred2.vcxproj
	projects/MSVC_2013/Freespace2.vcxproj
	projects/MSVC_2013/code.vcxproj
	projects/MSVC_2013/code.vcxproj.filters
	projects/MSVC_2013/libjpeg.vcxproj
	projects/MSVC_2013/liblua.vcxproj
	projects/MSVC_2013/libpng.vcxproj
	projects/MSVC_2013/wxFRED2.vcxproj
	projects/MSVC_2013/zlib.vcxproj
	projects/MSVC_6/Fred2.dsp
	projects/MSVC_6/Freespace2.dsp
	projects/MSVC_6/code.dsp
	projects/MSVC_6/wxFRED2.dsp
	projects/Xcode/English.lproj/InfoPlist.strings
	projects/Xcode/FS2_Open.xcodeproj/project.pbxproj
	projects/Xcode4/English.lproj/InfoPlist.strings
	projects/Xcode4/FS2_Open.xcodeproj/project.pbxproj
	projects/Xcode4/Frameworks.tgz
	projects/codeblocks/Freespace2/Freespace2.cbp
	zlib/adler32.c
	zlib/compress.c
	zlib/crc32.c
	zlib/crc32.h
	zlib/deflate.c
	zlib/deflate.h
	zlib/infback.c
	zlib/inffast.c
	zlib/inffixed.h
	zlib/inflate.c
	zlib/inftrees.c
	zlib/trees.c
	zlib/uncompr.c
	zlib/zconf.h
	zlib/zlib.h
	zlib/zutil.c
	zlib/zutil.h
2015-04-25 16:48:43 +02:00
asarium 9aed627ce7 Replace longjmp with exceptions
Also added a EditorConfig file
2015-04-24 15:03:59 +02:00
chief1983 f187522238 File exists wrappers for bitmaps and animations; eliminates worrying about extensions, only need the base filename and it'll tell you if it's available.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11328 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:09:19 +10:00
chief1983 26adf935f7 Globalize various file extension lists littered throughout the code so they can be referenced from other classes as needed, instead of being hardcoded multiple times.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11327 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:09:18 +10:00
chief1983 d68baac787 Eliminate some redundancy with ship allowed weapon parsing.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11326 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:09:17 +10:00
chief1983 c3d3f4d4dd Update OS X project to work with updated Jansson.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11325 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:09:17 +10:00
chief1983 cc037e3259 Upgrade Jansson to 2.7.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11324 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:09:16 +10:00
MageKing17 0c60515662 Record mission loading time in the debug log.
(Just changes a printf into an mprintf.)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11323 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:09:15 +10:00
MageKing17 ec88fdbae1 Minor objectsnd.cpp cleanup.
Should be all nonfunctional changes (yes, even those "else" branches that look like they change behavior; functionally speaking, those branches shouldn't get hit because FSO will delete the sounds when they shouldn't apply).

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11322 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:09:10 +10:00
MageKing17 83414b238d Remove required_string_3() and required_string_4().
Replaced with usage of required_string_one_of(). (required_string_either() not removed due to different behavior.)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11321 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:09:06 +10:00
MageKing17 a233f62afb Remove some redundant code in parselo.cpp.
7 cases in stuff_string() (both versions) were using identical code. Consolidated into one branch for clarity.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11320 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:08:31 +10:00
MageKing17 8ef442205c Fix minor problem with weapons.cpp.
If "@Laser Color2:" is defined for a weapon and you override that weapon with a modular table (even if that override entry doesn't actually contain any data), the weapon's laser_color_2 value would get defaulted to its laser_color_1 value. Now, only do that if changing laser_color_1 and the RGB values of the two colors matched before.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11319 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:08:31 +10:00
MageKing17 66bddb970c Commit various updates to the MSVS 2013 project files, following discussion in #scp.
Fixes Mantis 3104, amongst other minor issues. Given the existence of the Community Edition, decided to make FS2_SPEECH and FS2_VOICER defined by default. Setup release builds for debugging symbols. Corrected a few inconsistencies between configurations.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11318 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:08:30 +10:00
chief1983 4ecc546e34 Backport (?) r3727 and 3733 from fs2_open-unstable_old, the old CVS unstable branch.
3727: added MadProf's voice recognition enhancements
3733: fix spelling, and synch with voicerec.cpp

See http://www.hard-light.net/forums/index.php?topic=37643.msg880793#msg880793 for more information.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11317 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-23 12:08:29 +10:00
MageKing17 aaec401c8f Removing unused code from hud.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11315 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-19 00:10:27 +10:00
MageKing17 6f1e33938c Fix a possible crash with -reparse_mainhall.
Left over pointer towards a structure that had been cleared and rebuilt could cause a crash. Found (and fix tested) by Axem. Also thanks to z64555 for bouncing ideas back and forth until this solution was found.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11314 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-18 18:12:07 +10:00
chief1983 c4d1ed526c Other half of version bump to 3.7.3, I will probably have that automated by the next release cycle.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11310 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-18 18:12:06 +10:00
chief1983 161e7498c4 git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11309 387891d4-d844-0410-90c0-e4c51a9137d3 2015-04-18 18:12:04 +10:00
m_m e3311f36ac Fix for Mantis 3156: Fighter beam range depends on target radius
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11307 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-18 00:09:10 +10:00
MageKing17 ed11f9a1c1 Fix objnum/instance confusion in comm menu.
Could cause orders to be grayed out for the wrong ship, due to it happening to have an objnum matching the instance of the ship you were ordering.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11305 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-17 06:07:54 +10:00
niffiwan e0e3cffab6 Update credits for 3.7.2
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11304 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-16 00:08:49 +10:00
z64555 b6d48faf4d BMPMAN doxy effort. Also defines EXAMPLE_PATH in the doxyfile to enable use of the @example command, which references code snippets as examples.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11303 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-14 00:06:58 +10:00
zookeeper 73d6483df6 Typo-fixed and clarified some SEXP argument descriptions.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11302 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-12 12:07:23 +10:00
zookeeper 3952713eba Fixed "get-ets-values" to "get-ets-value" in the help string.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11301 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-12 12:07:22 +10:00
z64555 617c530a3b From Echelon9 and myself. Resolves some typos with the debug console parser.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11300 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-11 18:11:42 +10:00
niffiwan 8c0f95ced8 Fix mantis 3150
Use and set music volume changes requested by sexp_adjust_audio_volume()

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11299 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-11 12:12:06 +10:00
Goober5000 78f9c8f82c related to Mantis #3130 - don't create a VBO if we're not supposed to
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11298 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-11 12:12:03 +10:00
m_m 9ad5d09c0a From LotF and me: Fix for Mantis 3146: Crash when pressing enter key in empty region of main hall
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11296 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-31 18:58:28 +10:00
MageKing17 b61779e852 Fix mantis #3154.
Adds ON_CLBN_CHKCHANGE to the message map for the ships and weapons lists so that hitting spacebar to change the checked/unchecked status of a ship or weapon also updates the availability count.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11295 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-31 18:40:28 +10:00
m_m 2d82f7652d Fix "Callsigns still don't work when messages come from capships" issue
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11294 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-30 17:29:39 +10:00
The_E 9284264885 Patch to add MSVC2015 support. Also fixes a few warnings its compiler threw.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11292 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-29 11:05:02 +10:00
niffiwan 3e9c19c5c7 Fix mantis 3151
Implement case insensitive -mod dir search on *nix

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11291 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-28 11:12:25 +10:00
z64555 cd8595cf0f Fix for Mantis 3152: Moves the trail origin to the mathematical center of a laser bolt, if the weapon's render type is a laser.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11290 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-28 08:53:10 +10:00
The_E 1199555321 Adds a new debug output filter, "CFileDebug", which if enabled via debug_filter.cfg will print the absolute path to any file requested by the engine.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11289 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-22 13:04:55 +10:00
The_E 0808c3459f If a text file to be read by the engine is in Unicode, abort. Could be something important we're missing.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11288 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-22 13:04:55 +10:00
niffiwan b5fe481ab2 add script-eval-block sexp
This is a workaround to the sexp TOKEN_LENGTH limit
The script can be split across multiple arguments to allow scripts
longer than 32 chars (i.e. current TOKEN_LENGTH)
e.g.
( script-eval
  "ba.warning('foo"
  " more and more and more"
  " and the rest')"
)
Kudos to Axem for suggesting the idea
(And to zookeeper for reminding me to actually commit it!)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11286 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-21 11:41:49 +10:00
zookeeper 44b786c171 Fixed a mistake in $Model Point Shield Controls.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11285 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-19 16:40:17 +10:00
MageKing17 21cbf82196 Fix mantis 3147. From Admiral MS and myself.
From Admiral MS: Avoid bashing orientation if trying to avoid a collision.
From myself: Bash orientation if aspect seekers are equipped.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11284 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-18 18:21:21 +10:00
zookeeper ae32159408 Moved the fix in r11279 to a slightly more logical place.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11280 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-17 11:20:24 +10:00
zookeeper 56f694dc43 Check for and fix rare but possible discrepancy between sip->model_num and sip->subsystems[].model_num which can lead to model index collision errors.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11279 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-17 08:30:08 +10:00
zookeeper 95145a4f3f Slightly clarified variable use.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11276 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-07 09:39:26 +10:00
MageKing17 e0527d9bc7 Fix mantis #1929.
Makes the IDC_OLD_TEXTURE_LIST dropdown list use the same sorting as the old_texture_name[] array, and should also so that multiple old texture replacements for the same ship are properly erased.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11274 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-04 22:43:03 +10:00
MageKing17 4742378d50 Followup to r11266; let code use hardcoded defaults.
Presumably, the use of use_default_pos in load_gauge_radar_dradis() is the result of a copy&paste job, but removing it allows the default values to be used to compute coords.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11273 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-04 22:43:03 +10:00
zookeeper a2e15f4c61 Tweaks to the argument documentation of a bunch of scripting functions.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11272 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-03 16:22:51 +10:00
zookeeper 77b245eed2 Fixed shield handle not returning correct quads when indexing with the SHIELD_* enums.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11270 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-03 16:22:51 +10:00
niffiwan a1979e704e Coverity 1244962 Uninitialized scalar variable
Set default DRADIS coords to 0,0

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11266 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
niffiwan 23fbcb1a2f Add indentation for previous commit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11265 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
niffiwan dc02e70716 Coverity 1093719 Negative array index read
Check current_bank is > -1 before using it
Note: did not alter indentation in this commit in order to make
relevant changes easier to see

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11264 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
niffiwan 170614f150 Coverity 1093718 Negative array index read
Create swip after checking that its index is > -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11263 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
niffiwan 5c8a6234a1 Coverity 1093705 Negative array index read
Probably not an issue, but to be safe removing the unused pointer anyway
i.e. the check that instance >= 0 suggests there's a possiblilty that the
pointer could contains a negative array index read

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11262 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
niffiwan aadc41a40a Coverity 1093495+1093498 Missing break in switch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11261 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
zookeeper 2203c1e9a8 Ported r11232 from zookeeper branch: Set the Sender hook variable to nil in On Message Received hooks if message not coming from a ship.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11257 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-21 11:34:30 +10:00
MageKing17 40a9025aeb Fixes hardpoint gauge not rendering outline.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11247 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-12 17:13:54 +10:00
MageKing17 14bd62147c Adding a "$Briefing Grid:" interface color to colors.tbl.
Requested by Axem.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11245 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-12 17:13:54 +10:00
m_m 70d735ceb4 Added "On HUD Message Received" scripting hook which is invoked when the HUD receives message text to display.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11242 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-09 17:22:03 +10:00
niffiwan 7d92b1cecf Fix mantis 3138: remove spurious warning
Don't warn about low rotational velocities disabling collisions for
no_collide ships

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11238 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-03 17:08:58 +10:00
zookeeper 8a50f844b0 Improved warnings text and clarified variable use in turret modelread code.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11236 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-02 17:21:53 +10:00
zookeeper 35d6a9654d Ported r11100 from zookeeper branch: Fix various issues with $Acceleration Time.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11234 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-27 18:27:41 +10:00
zookeeper c47233ca3c Ported r11085 from zookeeper branch: Fixed weapon particle spews not taking launch velocity properly into account if $Acceleration Time is used.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11233 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-27 18:27:40 +10:00
MageKing17 d01856d992 Fix a potential crash during ships.tbl parsing.
Makes parse_ship() use ship_info_lookup_sub() instead of ship_info_lookup() (shouldn't be jumping through those hoops during table parsing if they're for FS1 mission conversion), and more importantly, added an error check to ship_info_lookup() to avoid sprintf() exceeding the length of the char array.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11230 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-24 09:22:32 +10:00
chief1983 ec758aa108 Fix for Mantis 3036: This unifies the cf_exists function to behave like the other functions in the cf_exists* family, and simultaneously addresses the bug.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11222 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-23 18:35:55 +10:00
MageKing17 f5c1b6608d Reverting r4959 per discussion on #scp and the forums.
Adding every "#"-variant was causing spurious errors when switching from the MediaVPs to no mod. See http://www.hard-light.net/forums/index.php?topic=88982.0 for details.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11221 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-20 18:50:38 +10:00
chief1983 7df12ebd75 Experimental flag to apply lighting to briefing window model popups. Flag should be removed and behavior made default if no issues arise after next release.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11218 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-16 18:58:02 +10:00
zookeeper 4422aaa311 Fixed an issue with disabled binds getting matched in key translation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11215 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:44 +10:00
chief1983 9ebcc3e437 Added OpenBSD to what is now a multi-BSD check.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11214 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
Goober5000 4f53f07681 minor modifications to mission cutscenes: change cutscene_name field to filename, because it's actually the filename of the cutscene make struct a plain old data object (no constructor) make parsing a little tidier, and make the SEXP formula and closing #end tag optional
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11213 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
Goober5000 61df0f18b1 add warning if a cutscene is specified that isn't in cutscenes.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11212 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
Goober5000 87e8170268 add optional_string_one_of, which is useful to have
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11211 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
Goober5000 b9a6a9f23e instead of an Int3(), use a Warning that's only displayed once
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11210 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
MageKing17 6a77d128c9 Fixing weird problem with snd_update_3d_pos() that, honestly, baffles me as to how the code ever worked on any system.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11208 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
zookeeper 20218b0924 Added support for NONE as a value for $Key Default, for making a key unbound by default.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11206 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
zookeeper b1f1756dd1 Fixed breakage of $Category and $Type from r10843.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11205 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
Goober5000 7250cd13a6 add ship class texture replacement using a simplified method that doesn't require the texture_set code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11204 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-23 18:15:11 +10:00
MageKing17 b23aea5a41 Fix mantis #3068.
Make hitting the "delete" key in the pilot-selection menu do the same thing as clicking on the "remove" button.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11202 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-22 18:01:31 +10:00
niffiwan a49eb75c6e Add warning for very fast ship-rotation values
Otherwise rotational collision detection is disabled for the ship
(and an int3() triggers in debug)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11201 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-20 11:54:49 +10:00
MageKing17 c8b48e4a36 Change m_badge_earned into a vector.
This makes it so that getting enough kills to cross the threshold for more than one badge simultaneously grants all of them (with the debriefing showing only the last one) and backs out all of them if the scoring is backed out.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11198 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-16 19:57:49 +10:00
Goober5000 709f483617 PAUSE ALL THE STREAMS
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11197 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-12 16:12:16 +10:00
MageKing17 ffd74fa60b Adding "+Available From Start:" to Medals.tbl.
Requested by MjnMixael.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11196 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-12 16:12:16 +10:00
Goober5000 1c826d366e add the pauseMusic scripting function, requested by MjnMixael
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11195 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-11 18:15:36 +10:00
Goober5000 1c464864c3 fix Mantis #3132 (is-iff returns true when the target is destroyed)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11193 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-10 16:37:43 +10:00
MageKing17 a03f96ca01 Related to r11189: avoid calling factor_table::getNextSlots() if the ship doesn't have the dynamic linking flag.
Basically, hitting "o" on any ship with more than 6 slots in a bank could crash FSO, even without the flag. Reported by Spoon.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11192 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-10 16:37:43 +10:00
MageKing17 15fad7f58b Correct copy-paste error in check_sexp_syntax() from the armor types commit.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11191 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-09 14:09:29 +10:00
Goober5000 f01c4bf952 fix Mantis #3135: account for the case when the game is paused before being minimized
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11190 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-08 17:14:57 +10:00
MageKing17 1d7c01181e Fix mantis #3133. Fixes logic errors in factor_table not being sure if it's supposed to be 0-based or 1-based at different times.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11189 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-08 17:14:57 +10:00
Goober5000 0162cab8bd move this around for more logical flow
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11188 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-08 17:14:57 +10:00
Goober5000 b02af2ef6e a more future-proof way to keep track of explicitly paused audio
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11187 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-04 16:39:40 +10:00
Goober5000 4eb1726004 this should fix Mantis #2888 (allow for head.ani files without letter suffixes)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11186 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-04 16:39:40 +10:00
Goober5000 2f734daf0d when the game returns from a paused state, don't unpause the music paused by sexp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11185 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-03 20:31:32 +10:00
Goober5000 a516b88803 it's good to check whether the music is paused, for bulletproof-ness
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11184 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-03 20:31:31 +10:00
Goober5000 9f12e1f56b added a sexp to pause and unpause music that is currently playing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11183 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-03 20:31:31 +10:00
Goober5000 255c2912cb minor reorganization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11182 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-03 16:23:42 +10:00
Goober5000 ac25da1bd9 remove the Error (originally Assert) from r1675 and add back the comment removed in r8005
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11181 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-01 20:37:52 +10:00
Goober5000 872bbe2a11 improve sexp code for obtaining pitch/bank/heading with the following changes: 1) use an alternate algorithm for extracting angles from an orientation matrix 2) properly round floats to integers when converting to degrees
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11180 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-29 19:53:19 +10:00
Goober5000 f7353121e6 m!m's fix for Mantis #3131: contrary to the xt change from r11138, NULL is only returned on vm_malloc failure (so should never happen in normal execution)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11179 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-25 19:15:56 +10:00
MageKing17 f64afbecfb From The_E, niffiwan, m_m, and myself: Fix Mantis 2404.
Makes "$Weapon Model Draw Distance:" actually stop external weapon models from being drawn beyond that distance (modified by detail level).

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11178 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-22 08:47:11 +10:00
niffiwan c05845cb9d Fix mantis 3114
Change turret-tagged-only behaviour back to retail
Add AI profiles flag to allow use of newer behaviour (i.e. stricter)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11177 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-21 19:26:53 +10:00
niffiwan a73404dbd5 Error needs LOCATION :)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11176 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-21 19:26:53 +10:00
The_E fbd590cd77 Improvement for this error message
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11175 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-21 18:43:52 +10:00
MageKing17 e4072d6e51 Adding area-of-effect capability to Electronics weapons.
By adding an "+Area Of Effect" line after "+New Style:" or "+Old Style:", it causes every ship caught in the weapon's shockwave or blast to suffer electronics disruption. Requested by Black Wolf.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11173 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-21 18:43:52 +10:00
MageKing17 0417b4c335 Ensure that the debriefing code sets the font before wordwrapping.
Also, explicitly set the font instead of relying on Debrief_ui_window.draw() doing it implicitly.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11172 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-18 18:09:08 +10:00
MageKing17 b14b590ab1 Adding "interceptable", "turret interceptable", and "fighter interceptable" weapon flags.
These allow munitions to be attacked by the AI without needing to set the "bomb" flag; "turret interceptable" means it can be attacked by turrets, "fighter interceptable" means it can be shot down by fighters, and "interceptable" sets both flags simultaneously. Requested by Rheyah.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11171 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-10 17:45:58 +10:00
m_m de57f043da From MageKing17 and me: Fix for Mantis 3128: Docking related crash - dock_list isn't initialized This patch makes the copy constructor and the assignment operator of the object class private as it contains members that should not be copied.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11170 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-08 10:57:03 +10:00
niffiwan 487f764764 Redo Coverity 1215458 Uninitialized pointer field
Includes more robust checks of cmdline_parm data

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11169 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-02 19:52:04 +10:00
m_m 86510572bf With help from MageKing17: Fix for Mantis 3123: Virtual variables and indexers that return nil break the scripting system
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11168 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-02 11:22:29 +10:00
MageKing17 e604125e5d Minor followup to r11150.
The regular parsing code not using the same broken logic as parse_comments() is not the same thing as it "ignoring" too high versions, and searching for repetitions of the same token would result in just finding the first one over and over again (the likelihood of this actually mattering to anyone is minuscule, but I needed something to test commit access, and this code has been tested).

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11167 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-30 13:23:58 +10:00
Swifty 33776fc4be gr_opengl_string retooled to use glDrawArrays. Should be a bit faster now.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11165 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-29 18:47:04 +10:00
zookeeper c13c35ec25 Fixed a FRED crash when using $Flight controls follow eyepoint orientation (patch by MageKing17).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11163 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-29 18:47:04 +10:00
zookeeper 83d6456c6a Clarified how to set a new variable with mn.SEXPVariables.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11161 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-28 22:04:56 +10:00
zookeeper 1d55b98017 Added a little extra info to two bmpman errors.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11160 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-28 22:04:56 +10:00
m_m bd602cc1a3 Revert 11158 as it breaks FRED compilation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11159 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-27 18:23:02 +10:00
m_m 89cd36a242 Fix a crash reported by Axem related to freeing the dock list of an object. This was caused by freeing the dock list from the destructor of an object which meant that copies of an object would corrupt the original object instance. To make sure that doesn't happen again the copy constructor and assignment operator of object have been made private.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11158 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-27 18:23:02 +10:00
Goober5000 414daaaed8 Mantis #3127: fix the spatial check in the rewritten algorithm
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11157 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-27 18:23:02 +10:00
The_E 4295cd3edb Corrects an unwanted change in formatting
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11155 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-27 18:22:42 +10:00
The_E 6c48551fb3 From MageKing17: Make the lua doManeuver command behave the same way as the sexp.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11154 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-27 18:22:42 +10:00
niffiwan 866667a977 Fix mantis 3126 (from MageKing17)
Remove limit of 32 tbms being loaded for any given table type
2014-10-24 19:35:47 +10:00
niffiwan d1aa2e1c37 Set 1024x768 32bit as default res on *nix
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11153 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-24 19:06:22 +10:00
niffiwan 07e1679138 Partial revert of r11145
A fake subsystem used as the firing point for fighter beams. It's
re-used for every fire point so the turret is supposed to only have 1
firepoint. i.e. energy consumption was already correctly calculated

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11152 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-24 19:06:21 +10:00
niffiwan 16f0ff1959 Allow fonts to set/change special char indexes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11151 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-24 19:06:21 +10:00
Goober5000 6cc96ce0c5 MageKing17 has done yeoman's work in fixing the version-specific commenting system. Thanks, MageKing17!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11150 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:40 +10:00
Goober5000 9161158996 xt branch: load stuff from the correct location
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11149 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:35 +10:00
Goober5000 557ef07079 xt branch: memset a bunch of weapons strings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11148 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:33 +10:00
Goober5000 130165af9f xt branch: WIF_MFLASH is unnecessary because we can check whether there is a muzzle flash index
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11147 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:32 +10:00
Goober5000 6e56b2970f xt branch: minor tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11146 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:31 +10:00
Goober5000 5a31e0b38e xt branch: 1) the number of beam firing points should be the same as the number of ship firing points, because that's how we're calculating the expenditure of weapon energy 2) clear out Ship_type information when we exit the game
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11145 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:29 +10:00
Goober5000 3234a8360c refine the calculation of effective_primary_banks... 1) optimization from xt branch: don't calculate if we only actually have one bank on our ship 2) make sure to count the current bank that we're firing, to avoid an edge case where we might have a negative fire penalty 3) make the condition logic a little clearer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11144 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:26 +10:00
Goober5000 14dfb5e73d xt branch: minor ship.cpp fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11143 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:21 +10:00
Goober5000 d734f76369 xt branch: "Nothing major here, just added the same basic stuff from the nebula code to make beam glows fade out depending on how close to the eye they are. The primary reason for this was for beams on fighters, since the muzzle glows tend to block your view when they show up. Having them fade out still gives you the visual effect, but allows you to see through them as well."
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11142 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:16 +10:00
Goober5000 871bb0b19a xt branch: minor optimizations in beam.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11141 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:14 +10:00
Goober5000 4f06fd2435 additional string safety
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11140 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-15 18:22:57 +10:00
Goober5000 e9f5c531e0 heh... Microsoft's implementation of snprintf doesn't conform to the standard!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11139 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-15 06:23:18 +10:00
Goober5000 dff2156c18 xt branch: more string safety
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11138 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:41 +10:00
Goober5000 f23a3c5843 SCP_string is useful here too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11137 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:40 +10:00
Goober5000 ff38449a46 string printing safety
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11136 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:39 +10:00
Goober5000 1318ccfa91 wut? defaulting to NULL here will cause these to never log anything...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11135 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:38 +10:00
Goober5000 65265f8ab8 fix a compile error (d'oh) and use type safety
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11134 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:37 +10:00
Goober5000 a541a22239 xt branch: optimize objectsort.cpp by not calculating some things every loop iteration
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11133 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:35 +10:00
Goober5000 aee1305841 according to the C standard... "The functions snprintf() and vsnprintf() write at most size bytes (including the trailing null byte ('\0')) to str." ...so we have that going for us, which is nice
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11132 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:33 +10:00
Goober5000 e43dacdcc3 xt branch: use CLAMP here
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11131 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:32 +10:00
Goober5000 8e4d98bd4f xt branch: minor tweaks to glow_points
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11130 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:31 +10:00
Goober5000 f6e2f1d236 xt branch: optimizations in modelcollide.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11129 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:25 +10:00
Goober5000 e22a4b0b5b xt branch: add capability for custom identifiers in build names (e.g. Xt-0314)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11128 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:24 +10:00
Goober5000 11855ed3d8 xt branch: having a float version of gr_opengl_string makes text scrolling nice and smooth at high nonstandard resolutions (also, looks like quad rendering works just fine here; no need to convert to tris)
convert credits.cpp to use float version of gr_opengl_string; eventually Taylor wanted to make the float version standard

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11127 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:23 +10:00
Goober5000 fe775aeedf xt branch: optimizations in fvi.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11126 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:22 +10:00
Goober5000 5c0bc126bb xt branch: tweaks to vecmat.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11125 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:20 +10:00
Goober5000 c6364987b3 we don't need to cast because mod is a float
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11124 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:17 +10:00
Goober5000 b8a05e30a0 xt: sprintf length safety
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11123 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 18:22:14 +10:00
Goober5000 5f3600dc79 probably good to change the comment too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11122 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 18:22:13 +10:00
Goober5000 f2d8277452 xt branch: additional optimizations using RAND_MAX_1f
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11121 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 18:22:12 +10:00
Goober5000 31562ba811 xt branch tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11120 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 18:22:10 +10:00
Goober5000 4200bb55d7 from xt branch: remove unneeded parameters, tweak some assets, minor optimization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11119 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 12:21:51 +10:00
Goober5000 bffdef1ce5 from xt branch: add some hysteresis to asteroid fields to prevent "popping" when an asteroid exceeds the bounds
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11118 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 06:22:25 +10:00
Goober5000 4dafc8ff5f this too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11117 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 06:22:24 +10:00
Goober5000 d5e81757b0 some turret changes from the XT branch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11116 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 06:22:22 +10:00
Goober5000 61c97871f0 technically, this is better
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11115 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-09 18:21:40 +10:00
Goober5000 50f16b7d02 better method of appending ellipsis (nb: strncpy pads with 0 if string is shorter than len)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11114 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-09 18:21:37 +10:00
Goober5000 8688b05c91 related to Mantis #3121, make SEXP parsing more robust, and remove some old debug/unused code in get_sexp_main()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11113 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-09 18:21:35 +10:00
chief1983 9a90a43801 Wrong variable type, may work in MSVC but not on clang or gcc.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11112 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-09 06:21:40 +10:00
Goober5000 15c6f18c74 remove unused debug function
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11111 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-08 18:22:27 +10:00
Goober5000 5552fbcbd9 related to Mantis #3121, add parentheses if the string passed to runSEXP doesn't have them
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11110 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-08 18:22:24 +10:00
Goober5000 a3b7eec214 make flag checking more efficient and prevent an Int3() on bad data
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11109 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-07 18:22:11 +10:00
Goober5000 2d14ca7539 Parias's patch for Mantis #3102 (make show-subtitle-text positioning consistent on MP clients)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11108 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-07 18:22:10 +10:00
Goober5000 88abaf6de4 I forget who requested this, but this change now causes FRED to allow numeric sexps to be used for OPF_WEAPON_BANK_NUMBER
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11107 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-07 18:22:08 +10:00
Goober5000 3b90b65547 allow sexps which reference sounds to use either the table index or the entry name as the reference (based on a patch by m!m, see http://www.hard-light.net/forums/index.php?topic=86293.0)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11106 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-07 18:22:07 +10:00
zookeeper 4e0beccfc9 Reverted r10944 and r10945 for now, with the exception of the GL_TRIANGLE_STRIP->GL_QUADS fix.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11105 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-07 12:21:56 +10:00
Goober5000 cc76884514 well ok, revert that
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11104 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-06 18:20:08 +10:00
Goober5000 c3bcfc6303 don't enable nav system always... that's not how this is supposed to work
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11103 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-06 18:20:06 +10:00
m_m 478bb022c7 Fixed a bug reported by Axem: The scripting API used the wrong functions to determine if a hud gauge is a custom hud gauge.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11102 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-06 12:20:50 +10:00
Goober5000 4037d3be68 tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11101 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-05 18:20:10 +10:00
Goober5000 85872114ee related to Mantis #2971: properly reset shield info when we have a null objp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11099 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:44 +10:00
Goober5000 93c7775109 stupid missing parenthesis >.>
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11098 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:44 +10:00
Goober5000 e15cd38a88 Between the Ashes HPC request: extend ai-chase-same-team to ai-disarm, ai-disable, and ai-destroy-subsys too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11097 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:44 +10:00
Goober5000 416af26244 and on the subject of Mantis #3110: fix the multi_sexp_deal_with_ship_flag issue that MageKing17 noticed, and tweak a sexp to be more clear
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11096 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:44 +10:00
Goober5000 cd2996f01d MageKing17's patch for Mantis #3110: Message Brackets not displayed with 'Invisible to Friendlies' flag
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11095 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:43 +10:00
Goober5000 f7e3bef9b7 Between the Ashes HPC request: allow ships to attack others on the same team
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11094 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:43 +10:00
Goober5000 31716a9348 use the OBJ_INDEX macro, because that's why we have it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11093 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:43 +10:00
z64555 ec60984483 From MageKing17, Makes the $CD: token for cutscenes.tbl optional. Useful, since a majority of assets no longer require physical CD's.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11092 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:43 +10:00
chief1983 5e94b75354 Fix Mantis 3109: Revert r11079 and reopen #2888 since I didn't realize that Fred messages also often use built-in suffix appending. Need to either use FUBAR's original solution or re-engineer something else.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11090 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-29 06:19:41 +10:00
niffiwan 484b518760 Fix mantis 2804: beams can use damage factors
Add game_setting.tbl option that allows beams to use weapons table
Armor/Shield/Subsystem damage factors

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11089 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-27 18:20:18 +10:00
niffiwan df3435cadd Fix mantis 3108 (from Yarn)
Make parsing of DRADIS and custom hud gauges consistent with the rest
of the hud gauges

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11087 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-27 00:19:25 +10:00
Goober5000 7917b9885d fix Mantis #2987 (AddressSanitizer: global-buffer-overflow in message_queue_process())
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11084 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-25 16:40:34 +10:00
Goober5000 e0aaa83513 CommanderDJ's patch for Mantis #2899 (AddressSanitizer: heap-buffer-overflow in snd_play() sound.cpp)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11083 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-25 16:40:34 +10:00
Goober5000 435b078157 Yarn's patch for Mantis #3107 (Parts of the interface code assume a font size of 10)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11082 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-25 16:40:34 +10:00
Goober5000 a3e83aacfe CommanderDJ's patch for Mantis #3050 (Custom mainhall text is limited to 10 chars in the campaign editor)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11081 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-24 20:08:21 +10:00
Goober5000 62a2fb3c00 Yarn's patch for Mantis #3106 (Font parameter in hud_gauges.tbl not parsed correctly)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11080 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-24 20:08:21 +10:00
chief1983 946d7a45af Fix for Mantis 2888 - add Suffix support to disable suffixes for messages on a per message basis in messages.tbl. See the wiki.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11079 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-24 20:08:21 +10:00
niffiwan ab3ebebc9c Parts of mantis 3103 (From MageKing17)
Points 3-5 from the mantis ticket
i.e. use OPF_SSM_CLASS in appropriate places

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11078 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-22 20:17:36 +10:00
m_m 5b79ed3ea5 Fix for Mantis 3093: mn.getMissionFilenname() doesn't return a value if in GS_STATE_BRIEFING
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11077 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-22 19:59:03 +10:00
m_m dd4c91f8b6 From Parias: Fix for Mantis 3094: Request for new scripting function: ts.playCutscene()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11076 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-18 19:11:16 +10:00
niffiwan fc9f570374 Update .gitignore for new autoconf & libtool
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11075 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-13 14:03:50 +10:00
niffiwan fb2ce33802 Fix mantis 3105 (from MageKing17)
Use a pointer for reading radar IFF info, not an object copy

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11074 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-13 13:52:21 +10:00
niffiwan d9a4320dbb Add missing \n to mod_table mprintf
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11073 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-13 13:52:21 +10:00
Zacam a867c1a020 Trunk Sync - r10941
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10942 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-11 19:22:13 +10:00
Zacam 38f7b9ab6c Trunk Sync - r10935
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10936 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-11 19:22:13 +10:00
Zacam f602424270 Trunk Sync r10914
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10915 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-11 19:22:13 +10:00
Zacam 9eda776332 AP Builds will now compile (post r10912 cleanup)
Still need to validate behaviours.

git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10913 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-11 19:22:13 +10:00
Zacam 4952b70488 Trunk Sync - r10911
There are a lot of changes here that should probably be examined, namely the Debug Console (which had conflicts) and Yarn's "any resolution" mainhalls code (Which also had conflicts) but for the most part this should be fairly clean.

git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10912 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-11 19:22:13 +10:00
z64555 4e5715058e Fixes 2713 - "Freelook Mode Unavailable."
Freelook has been re-enabled with a minimal amount of changes.

Efforts to add in slew control keys as well as the ability to map the mouse to a slew axis have resulted into a much larger project than previously expected. As such, these changes will be postponed until fully complete.

git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10566 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-11 19:22:12 +10:00
The_E 88dce29920 Trunk sync r10550
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10551 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-11 19:22:12 +10:00
niffiwan cd7b271b3b Tweak autotools
Use libtool, remove warnings about subdirs, DIE if autogen.sh pre-reqs
aren't met

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11072 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 1ac06f8b1c substitue main hall for displaying MjnMixael's main halls in fsport
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11046 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 7cd97633b6 Yarn's patch for Polish localization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11044 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 603e96865f VC6 compatibility
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11043 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 5e2046c44b use class declarations since these contain SCP_string
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11042 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 d2a6beaacc that variable isn't actually a buffer, so change the misleading name
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11041 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 cd76a257c1 subtitles can now be as long as messages
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11040 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 6052d9c4a4 since we can replace variables in SCP_string, use that instead of an arbitrary char[256] buffer also const-correctness in the constructor
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11039 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 c866ff0061 Karajorma missed an Opps :p
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11038 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 dd353a74d8 add an Assertion about a buffer overflow vulnerability in split_str
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11037 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
karajorma b05303fa63 Opps. Only need that defined once!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11036 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
karajorma 23d5913e9d The previously committed version of multi-eval did not include the code to allow it to determine if client side scripts should also be executed on the server. This version does but will break any previously created missions.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11035 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
karajorma 04fe7fb64a Fix Mantis 3077 (Subtitles including a message will crash multiplayer games).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11034 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
niffiwan 3052565490 Revert "Silence GCC warning variable ‘max_size’ set but not used"
Based on chief1983's comment that this code is still used, I'll take
the safer route of just telling gcc to shaddupaboudit

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11029 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 b63fd9a86a Mantis #3101: check for presence of support dockpoints in all builds, not just release
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11028 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 a7d6891520 MageKing17's patch: add door keys and quick start region, and fix single player / multiplayer description toggling also fix two warnings regarding int and boolean conversions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11027 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
niffiwan 9b37d1e0f4 Fix gcc warnings in hudconfig.cpp
declaration of ‘color’ shadows a global declaration [-Wshadow] (x2)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11021 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 15:42:09 +10:00
niffiwan 0bebe6f98a Partial fix for mantis 2932 (cutscenes)
Convert campaign viewed cutscenes

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11020 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 15:42:09 +10:00
niffiwan 743a27b82f Partial fix for mantis 2932 (RA wep idx)
Ensure pilot conversion RA weapon indexes are always valid

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11019 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 15:42:09 +10:00
niffiwan 57faea2bef Fix mantis 3099 (from Yarn)
Make HCF parsing more flexible

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11018 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 15:42:09 +10:00
niffiwan 1a3336e9bd Silence GCC warning variable ‘max_size’ set but not used
Code seems redundant as dscap_get_raw_data checks for a max size
anyway. And AFAIK the entire voice capture code is non-functional anyway

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11017 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:06 +10:00
niffiwan b88edd53bc Followup fix for mantis 2883 (from Yarn)
Set Lcl_special_chars when changing fonts
Change some copyright chars to use Lcl_special_chars

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11016 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:06 +10:00
Echelon9 cba4cc9943 Fix cppcheck (performance) Prefer prefix ++/-- operators for non-primitive types.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11015 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:06 +10:00
Echelon9 aa4b76d990 Fix cppcheck (style) Consecutive return, break, continue, goto or throw statements are unnecessary.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11014 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
Echelon9 44dc398b19 Fix cppcheck (style) Same expression on both sides of ||.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11013 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
Echelon9 85427ec76a Fix cppcheck (warning) Logical conjunction always evaluates to false: logfile_type < 0 && logfile_type >= 2.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11012 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
niffiwan 75e8f8642c Fix mantis 3020 (pilot stats issue)
Reset pilot stats when we're creating a new CSG file. Otherwise stats
from the current pilot or campaign will be inherited by the new pilot /
campaign

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11011 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
niffiwan e6b8a433f1 Fix mantis 3097 (valgrind)
Don't read past the start of the string

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11009 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
niffiwan c603d42b61 Followup fix for mantis 3049 (from Yarn)
Revert an Error back to a Warning
Prevent an out-of-bounds read of the Lcl_ext_str array

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11008 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
niffiwan 179c2ceb82 Fix mantis 3065 (clear RA data)
Clear red alert data when resetting campaign progress, changing
campaigns and switching pilots
In CSG read, move RA data clear from the read RA section to the data
reset function (i.e. clear if CSG is valid, not if section contains
data)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11007 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:12 +10:00
Echelon9 21cee81a2a Fix Coverity 1093622 Array compared against 0 in process_new_player_packet()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11006 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:12 +10:00
Echelon9 0f77e0aa34 Fix Coverity 1093621 Array compared against 0 in send_accept_packet()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11005 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:12 +10:00
Echelon9 f3a1589d42 Fix Coverity 1093619 Array compared against 0 in delete_player()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11004 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:12 +10:00
Echelon9 01df45e37e Fix Coverity 1093613 Negative array index read in stuff_loadout_list()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11003 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:11 +10:00
Echelon9 1484f93590 Fix Coverity 1093599 Negative array index read in hud_query_order_issued()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11002 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:11 +10:00
niffiwan b29868aea7 Followup fix for mantis 3016 (FRED Briefing window FOV)
Make FRED icons & labels respect the Briefing_window_FOV

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11001 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:11 +10:00
niffiwan 2427c9cfe3 Fix mantis 3092 (from Yarn)
Fix certain key string parsing in German & French

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10995 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-16 12:31:57 +10:00
niffiwan bfa3397dbd Fix mantis 2985 (from Yarn)
Fix float-to-int rounding errors in gr_[re|un]size_screen_pos

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10990 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-16 12:31:57 +10:00
niffiwan 3d8554b41f Followup fix to mantis 2887 (from MageKing17)
no-collide ship classes would collide unless the no-collide flag was set
in the mission file

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10989 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-16 12:31:57 +10:00
niffiwan 3c81c02829 oops - recommit r10986
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10988 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-16 12:31:56 +10:00
niffiwan 167739ed95 Fix gcc warning
declaration of ‘brief_line’ shadows a global declaration [-Wshadow]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10987 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan 5bcbad1e3a Fix mantis 3091 (from Yarn)
Treat non-ASCII chars above unsigned index 127 as word separators when
ending retail style colorisation

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10986 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
Zacam 060bc97360 From Axem: adds isInCampaign() lua function to tell when a mission is being played in a campaign (as opposed to via Techroom)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10985 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan a2fd4aa519 Fix mantis 3088 (from Yarn)
Fix two German keys not displaying in controls config

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10984 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan 4b7a69f34e Fix mantis 3089 (From MageKing17)
Move 3D ship select model drawing earlier so that the help overlay is
drawn over the top, not underneath

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10983 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan ce8ed29326 From Coverity ID 1230636 Improper use of negative value
false positive; but add comment explaining why

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10982 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan 43f3b6ade9 Fix Coverity ID 1230635 Unchecked return value
Check return code from lua EvalString on mainhall doors

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10981 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
Echelon9 0ed6dee427 Fix Mantis 3090: Valgrind: Conditional jump or move depends on uninitialised value(s) in webserverApiRequest()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10980 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan 335b05c82a Fix input lag with some ATI cards on Linux
From electrojustin; adds cmdline option to force a gl_finish call
prior to swapping buffers.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10979 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
m_m f8ff3be1fe From MageKing17: Fix for Mantis 3085: Unhelpful error reporting in hud_gauges.tbl if an invalid gauge type is specified.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10978 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:04 +10:00
niffiwan 7defc6aeeb Fix mantis 3086 (from Yarn)
Add special case to avoid crash from mismatched quotes in
tstrings.tbl German text

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10977 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:04 +10:00
niffiwan b725ec527a Fix mantis 3087 (from Yarn)
Readd translation support for default escort gauge header text

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10976 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:04 +10:00
Goober5000 5cbb9d991b Additional tweak for Mantis #2887 and follow-up to r10181: when modifying OF_COLLIDE, need to call obj_set_flags for collision code support
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10974 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:04 +10:00
m_m 27e824c215 Revert accidentally committed project file changes.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10973 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:04 +10:00
niffiwan 8e7a936c08 Fix line-endings in fred2/fred.rc
(somehow these got messed up in the git repo)
2014-08-06 19:41:46 +10:00
Goober5000 439b2c8cad add additional lookup for GTSC Faustus for next version of FSPort
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10972 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-06 19:39:35 +10:00
m_m 3db76adf40 From karajorma: Adds the multi-eval SEXP WARNING: This SEXP is subject to change and will likely be removed or changed in a future version, use with caution. Also fixes Mantis 3079: Add multi-eval to list of available SEXPs (.patch included)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10971 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-06 19:39:35 +10:00
m_m 8e4235a86e From ngld and Parias: Fix for Mantis 3084: Bitmaps loaded with gr.loadTexture() are never released.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10970 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-06 19:39:35 +10:00
m_m 9689711149 From FUBAR-BDHR, chief1983, m!m and MageKing17: Fix for Mantis 2887: Additional workaround for mantis 2693
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10969 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-06 19:39:34 +10:00
Zacam b562ebe1f5 From Axem: adds getFrametimeOverall() lua function for timing purposes outside of gameplay
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10967 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:23 +10:00
Zacam c03fad72cd Since we updated libpng, might as well update zlib as well. Now v1.2.8.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10966 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:23 +10:00
niffiwan 1a813db618 Fix mantis 3078 (From Yarn)
Don't set / reset unscaled screen area when rendering to texture
Also fix a pre-10844 bug where scaling down a cockpit gauge would
cause the gauge to be improperly clipped if it was close enough to the
right or bottom edge of the texture.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10965 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:23 +10:00
niffiwan b39b23c3f6 "Fix" gcc warnings in Control_config[]
warning: missing initializer for member 'config_item::BLAH'
[-Wmissing-field-initializers]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10964 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:23 +10:00
Zacam e6f92ddcd9 Fix Mantis 3075 : Upgrades libpng from 1.5.7 to 1.6.12
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10963 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:23 +10:00
The_E 04f2c365f8 Fix for Mantis 3080 from MjnMixael: Fix for inadvertently changed parsing order for mainhall tables.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10962 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:22 +10:00
niffiwan 1291e0ad82 Fix mantis 3073: Additional Mainhall capabilities (from ngld)
Adds two new mainhall.tbl options:
1) "+Misc anim over doors:" (misc anim rendered after doors)
2) "+Cheat String:" (exchanges misc anim when cheat is entered)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10961 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-30 20:41:21 +10:00
zookeeper 774ec066a4 Fix a render target bug by disabling environment mapping when doing full-scene RTT.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10959 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-30 20:41:21 +10:00
niffiwan 9f768b8cff Doh! Assign, not equality!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10958 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-30 20:41:21 +10:00
niffiwan f730df6c1a Fix Coverity ID 1093805 Uninitialized scalar variable
1st use of fbfire_info.bfi_flags so assign instead of |=

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10957 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-30 20:41:21 +10:00
niffiwan 5daa8d87d2 Fix Coverity 1093822 Uninitialized scalar variable
Set sensible looking defaults for the elems added to the beam_collision
struct since retail

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10956 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-30 20:41:20 +10:00
niffiwan 9314dc89da Fix gcc warnings in hud/hudtarget.cpp
declaration of ‘gauge_object’ shadows a member of 'this'
declaration of ‘esct’ shadows a global declaration [-Wshadow]
variable ‘srange’ set but not used [-Wunused-but-set-variable]
variable ‘ship_is_ballistic’ set but not used

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10955 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 20:39:18 +10:00
niffiwan 3cccc7cb13 Fix gcc warnings in hud/hud.cpp
declaration of ‘render’ shadows a member of 'this'
declaration of ‘font’ shadows a global declaration [-Wshadow]
variable ‘flags’ set but not used [-Wunused-but-set-variable]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10954 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 20:39:18 +10:00
niffiwan 71faaf3137 From MageKing17: tweak team colors
While we're looking at the Team Color code, let's have a warning if
someone tries to name a team 'none', and avoid pushing duplicate teams
to the Team_Names vector.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10953 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 20:39:18 +10:00
niffiwan 1a0ef281ed Fix gcc warning in io/keycontrol.cpp
suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
This code previously worked only by fluke!

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10952 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 20:39:17 +10:00
z64555 021a0bd3a7 From MageKing17: Followup to r10914. Makes the name check ignore case.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10951 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
niffiwan e2eddea231 Fix gcc warnings in globalincs/alphacolors.cpp
warning: declaration of ‘i’ shadows a previous local [-Wshadow]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10950 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
niffiwan 2b191eef2d Fix Coverity 1228854 Copy-paste error
Check pof_file_hud for "$POF target file:" not pof_file ("$POF file:")

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10949 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
niffiwan e93c1e94b6 Fix Coverity ID 1228858 Missing varargs init or cleanup
In required_string_one_of(int arg_count, ...)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10948 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
zookeeper 751861c397 Fixed bits missing from r10946.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10947 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
zookeeper ae1c4435cf Turned the required SEXP variable arguments for add-background-bitmap and add-sun-bitmap into optional arguments.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10946 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
zookeeper a23438f590 Fixed inverted normals in RTT if post-processing is on.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10945 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
zookeeper 6b404f1daa Fixed RTT bugs: 1) inverted geometry, 2) the output being mirrored both ways and a quarter of the output missing if post-processing is off.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10944 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
niffiwan 2838afdd60 Fix several gcc warnings in code/graphics/gropengldraw.cpp
variable ‘clipped’ set but not used [-Wunused-but-set-variable]
variable ‘swapped’ set but not used [-Wunused-but-set-variable]
the address of ‘Distortion_texture’ will always evaluate as ‘true’
[-Waddress]
declaration of ‘vertex’ shadows a global declaration [-Wshadow]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10943 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
Goober5000 0bd67304c4 a tweaked version of ngld's patch for additional main hall capabilities (see Mantis #3071)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10941 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
Goober5000 6249638c5a use static casts to make our intentions clear and prevent compiler warnings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10940 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:03 +10:00
Goober5000 5eeb6dd219 some const-correctness in preparation for the Mantis #3071 patch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10939 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:03 +10:00
Goober5000 d04ae65f8b for Mantis #2064: remove ship template feature which never worked without crashing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10938 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:03 +10:00
Goober5000 a30269bd3c for Mantis #2651: revert r10933, per forum discussion: http://www.hard-light.net/forums/index.php?topic=88047.0
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10937 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:03 +10:00
niffiwan 60bad89060 Fix gcc warning: ordered comparison of pointer with integer zero
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10935 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:03 +10:00
niffiwan ca31f9a402 Fix mantis 2651: from ZekeSulastin
Add support for up to 98 joystick buttons

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10933 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:29 +10:00
Goober5000 469e566b20 another localization patch by Yarn: disable character remapping when the game is running in Polish
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10932 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:29 +10:00
Goober5000 e13e37245e MageKing17's tweaks, with a couple of my own
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10931 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:29 +10:00
Goober5000 038ccffdaa Mantis #2999 - add docking log entries for support ships
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10930 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
niffiwan b19622cf96 Fix gcc warning in hud/hud.cpp
the address of ‘Hud_text_flash’ will always evaluate as ‘true’ [-Waddress]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10929 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
The_E 96e8e77f4e Fix for Mantis 3064 from MageKing17: Followup fix.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10928 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
The_E b178fd0cbc Fix for Mantis 3076 from MageKing17: Fixes behaviour of animated textures on skyboxes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10927 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
The_E d3ef69848c Fix for Mantis 3064 from MageKing17: Adds more functionality to colors.tbl. * "#Start Colors" is now optional; no more need for a blank section at the start of a colors.tbl just to define some team colors. * "#Interface Colors" section added for redefining various colors used by the interface. * "#Color Tags" section added for redefining or adding your own text color tags. * "#Default Text Color" section for choosing what color tag is the baseline default for various different screens. * And the big one, support for *-clr.tbm modular table files.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10926 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
The_E a5a1a0ff3b Patch for Mantis 3069 by MageKing17: Fixes help.tbl error reporting
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10925 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
Goober5000 6f80088695 for Mantis #2153: MageKing17's FRED support for error messages when wingmen have illegal weapons
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10924 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
Goober5000 905f0999c2 Yarn's patch which allows FreeSpace fonts to support all characters that exist in both Code Page 437 and Windows-1252
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10923 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
The_E 3eaf02c022 Fixes an unintended linebreak removal in previous commit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10922 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
The_E 5bff2754c2 From MageKing17: Fixes for a couple of clang warnings.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10921 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
The_E 5e6746af43 From MageKing17: Improves sexp help text to clear up possible confusion about indexes that are zero-based.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10920 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
niffiwan d2cbf65e1e Fix mantis3054 (from ngld)
In weapon select screen check weapon model index is != -1 before drawing it

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10918 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
m_m fca002ada8 From Axem: Add ba.getGameDifficulty() scripting function to get the current difficulty level.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10916 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:32 +10:00
The_E d3089bb406 Fix for Mantis 2882 by Mageking17 (change-team-color with None color results in error)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10914 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:32 +10:00
The_E b96b0e87d8 Removes nonfunctional debug code left over from the :V: days
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10911 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:32 +10:00
The_E 3d3fa6a749 Moving an assignment out of an if statement for better readability
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10910 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:32 +10:00
The_E 514a8c3557 PVS Studio fix: Make the logic responsible for sending the builtin rearm messages behave as intended.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10909 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:32 +10:00
Goober5000 fe4b949c06 fix Mantis #3072 (crashes when using different languages)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10908 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
chief1983 ae351d2924 Fix Mantis 2886 - Option to render External weapon models, besides Tech models, in Weapon lab, from FUBAR.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10907 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
chief1983 4854087a18 Fix Mantis 2885 - SEXP flag to enable/disable primitive sensors, from FUBAR.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10906 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 831e0f3be7 Address clang warning: parameter 'x,' not found in the function declaration [-Wdocumentation]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10904 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 307923e8dd Address clang warning: unknown command tag name 'brieft'; did you mean 'brief'? [-Wdocumentation]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10903 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 eacf4d4e6e Address clang warning: parameter [x] not found in the function declaration [-Wdocumentation]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10902 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 2859e74ac9 Address clang warning: extra ';' after member function definition [-Wextra-semi]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10901 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Goober5000 98a6166956 follow-up to r7163: this makes the text display properly in-game, no Unicode support needed (thanks to Yarn for the patch)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10900 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 07cad23aed Address clang warning: commas at the end of enumerator lists are a C++11 extension
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10899 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 255fef6e47 Address clang warning: unused variable
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10898 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 fc1b587cb6 Address clang warning: declaration shadows a field of 'HudGaugeRadarDradis' [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10897 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Goober5000 8cdfb029d3 add mod_table option for red-alert for delayed ships (Mantis #3055)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10895 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Goober5000 2fe0ec8ef0 Yarn's patch for Mantis #3049 (character remapping in tstrings.tbl)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10894 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
The_E 75f533a6fe Fix for Mantis 2960: Actually make sure that we're not performing invalid operations on a vector.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10887 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
The_E d6e0a731db From MageKing17: Patch for Mantis 3074: Correct mismatch between mission write and mission parse
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10886 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
Echelon9 327c67ff1d Address clang warnings - hud/hud.cpp:1310:3: warning: delete called on 'HudGauge' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10885 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
Echelon9 80e1ecee69 Address clang warning - hud/hudtarget.cpp:7224:12: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10884 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
Echelon9 02aa18c260 Address clang warning - io/keycontrol.cpp:2504:7: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10883 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
The_E 53e78033c6 Fix unintended linebreak removal from 10880
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10882 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
Echelon9 bc568a9149 Address clang warning - lab/lab.cpp:912:8: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10881 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
The_E 0d9cc00ba8 From MageKing17: Removes redundant function call
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10880 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
Echelon9 46288483c9 Address clang warning - menuui/mainhallmenu.cpp:2141:9: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10879 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
The_E 580330c224 From MageKing17: Patch for a small issue in briefing text color spans
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10878 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 3f645215ad Address clang warning - object/collideshipweapon.cpp:258:17: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10877 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 d3f914a404 Address clang warning - ./ui/ui.h:291:7: warning: private field 'ignore_escape' is not used [-Wunused-private-field]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10876 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 7f9d879d7b Address clang warning - ./ship/shipfx.h:202:6: warning: private field 'stage' is not used [-Wunused-private-field]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10875 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 54de592835 Address clang warning - debugconsole/console.cpp:169:13: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10874 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 03c32c1648 Further tweak fix for Coverity 1093783 Uninitialized scalar variable, and remove redundant variable in opengl_light structure
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10873 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 713e291bdc Partially re-add the secure coding aspects of 10806 (which was rolled back in 10857). Fundamentally, the code in theora_open is written in a non-secure manner prior to this fix. That the callers currently appear per Goober to use it correctly is not the issue. There is no way of enforcing that contract as to length of the string unless it is internally handled in the function. Also Goober's comment that all callers use string lengths of MAX_FILENAME_LEN is incorrect. Examples trivially found that use the separate define NAME_LENGTH, which could be changed in future.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10872 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
chief1983 137eb7e4d4 Fix Mantis #2790, Easy options should be just that again.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10869 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
chief1983 f89d864756 Fix Mantis #3070, courtesy of Yarn.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10868 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Echelon9 7a56e7ff4a Fix Clang warnings about incorrect type given different pointer sizes for the architecture. Use the standard compliant ptrdiff_t
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10867 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Echelon9 a0ed86d6bc Remove a tautological Assert(), which cannot be triggered due to the type
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10866 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Goober5000 475e4d5d35 Yarn's fix for Mantis #2362 (scale images properly with show-subtitle-image)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10865 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Goober5000 3743449a42 from MageKing17: choose alt_names and callsigns by array index instead of substring; fixes Mantis #2934
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10864 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Goober5000 79b73f241b MageKing17's patch for callsigns not resetting when the mission is cleared (Mantis #2934)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10863 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Echelon9 2da2527207 Quieten a number of warnings related to UI_USERBOX without a declaration yet. Added TODO.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10862 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Echelon9 f8ef768bbf Address Clang warnings are overloaded virtual functions in UI_GADET. Also opportunity to simplify code by making the most of inherited polymorphism. Docs cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10861 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Echelon9 522eb962ff Fix a range of issue identified via clang warnings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10860 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Goober5000 ad761f980f fix a bug introduced by r10852: MAX_OBJECTS is not a valid object index
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10859 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Goober5000 41d7f2408c fix a bug introduced by r10837: 0 is a valid path index
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10858 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Goober5000 7c07151e26 roll back r10806 because 1) all callers to this function have names which are MAX_FILENAME_LEN in size; and 2) the memset already sets all characters to 0, so there's no need to add a null terminator
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10857 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Goober5000 05e0af6ebd the minimum macro is defined as MIN in FSO to avoid conflicts; no need to #undef (since rev 10796 uses MIN anyway)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10856 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 d37e4c567d Fix Coverity #1093706 Negative array index read in scoring_eval_kill_on_weapon()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10855 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 130ed7c7e3 Fix Coverity #1093707 Negative array index read in start_ship_animation()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10854 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 8d6e82c3bc Fix Coverity #1093711 Negative array index read in event_music_enemy_arrival()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10853 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 823c144ecc Fix Coverity #1093715 Negative array index read in maybe_weapon_detonate()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10852 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 abc0fd11b5 Fix Coverity #1093720 Negative array index read in ai_big_maybe_follow_subsys_path()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10851 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 c3494516bd Fix Coverity #1093544 Negative array index read in multi_ts_handle_mouse()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10850 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
Echelon9 9cbd23d2e9 Fix Coverity #1093783 Uninitialized scalar variable in gr_opengl_set_center_alpha()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10849 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
Echelon9 8cbb46f40c Fix Coverity #1224006 Uninitialized scalar variable in nebl_generate_section()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10848 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
Echelon9 c85caef631 Fix Coverity #1224005 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10847 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
The_E 3545cacda0 From MageKing17: Patch for Mantis 761(!): Text color tags do not work in debriefings. Also allows color spans in text to cover line breaks.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10846 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
The_E 7be5b03c62 From MageKing17: Patch form Mantis 3067 (Nebula flashing not following player view point)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10845 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
niffiwan 027f218f7f Allow any resolution for mainhalls (From Yarn)
Also includes support for more than two mainhall resolutions, zooming
so one mainhall can adapt to multiple resolutions, setting new mainhall
fonts, help overlays for all resolutions and adjustable tooltip padding.
Also allows preload screens to be any resolution & aspect ratio.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10844 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
z64555 cdb954f333 Fixes mantis 2877: $Type and $Category entries in controlconfigdefaults.tbl would not properly parse. #defines and enumerated names in the controls code (Such as TAB_SHIP and the various CC_TYPE's) may now be used in the .tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10843 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:06 +10:00
The_E 8c1bef0415 From FUBAR: Patch for Mantis 2842 (Adds new section to game_settings.tbl called "#FRED SETTINGS". Also adds a parameter for it, "$Disable Hard Coded Message Head Ani Files:", a boolean value that controls whether FRED fills the head ani selection in the Event Editor with the retail head ani names)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10842 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:06 +10:00
The_E c07d792e4e From FUBAR: Patch for Mantis 2872 (Make FRED emit a warning for invalid ship classes in a mission file)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10841 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:06 +10:00
niffiwan 545fd5e6ac Fix mantis 3056
In redalert loadout, only store the current number of banks in use by
ships, not all banks where the weapon idx is -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10840 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 18:54:31 +10:00
Echelon9 c837a21f0d Now that standalone server is support on more than Windows, ensure its features are applied as consistently as possible
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10839 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
Echelon9 666f53e44b Fix Coverity #1093598 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10838 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
Echelon9 edad644595 Fix Coverity #1093597 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10837 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
Echelon9 82058a8c99 Fix Coverity #1093552 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10836 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
Echelon9 ae6365bc35 Fix Coverity #1093545 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10835 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
Echelon9 c2122f9767 Fix Coverity #1093544 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10834 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
zookeeper 8e0304a58f Fixed a bug in normal maps caused by a redundant and float-inaccurate calculation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10833 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
niffiwan 2740cf5ea2 Allow missions to exit to mainhall on successful completion
Activate with either a mission flag, or the 3rd parameter to the
end-mission sexp. Covers ending via the debrief, skipped from dying
5x times or skipped training mission
Does NOT work for redalert missions or multi (yet)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10832 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
niffiwan 322d1f39e0 Fix mantis 2945 (From MageKing17)
Don't set PF_PROJECTED in g3_transfer_vertex() as it's not projecting
the vertex
Note: displaying nebula emp/lightning used to depend on unitialised data!

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10828 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:54 +10:00
Zacam cc36ac9faf Follow-up to r10793, missed a spot of [more]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10827 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:54 +10:00
m_m a45e930047 Fix for Mantis 3063: Animation code-related sound entries doesn't use new sound format
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10826 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:54 +10:00
The_E 83ffa764b5 Fix for Mantis 3016 part 2 (Make FRED respect the Briefing Window FOV setting in game_settings.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10825 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:54 +10:00
The_E 54787e8402 Fix for Mantis 3016 (Briefing window FOV different from retail). Also adds a new setting to game_settings.tbl, "$Briefing Window FOV:" under Graphics, which takes a single float argument to set the FOV of the briefing window.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10824 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
The_E 8da0ac791e From MageKing17: Patch for Mantis 3060 (Beam particles not generated correctly in certain cases)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10823 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
The_E 971192ab30 From MageKing17: Patch for Mantis 3061 (Turrets can't have an initial rotation defined)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10822 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
The_E 505e1e77f5 From MageKing17: Patch for Mantis 3012 (Various issues with ships in nebula)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10821 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
The_E cba1eb07db Fix for Mantis 2982: Removes superfluous Assert.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10820 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
CommanderDJ 358e2ab4fc Fix Mantis 2773: Models turn black when full nebula enabled in FRED.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10819 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
niffiwan f5199ea122 Fix mantis 2929
Save shortcut rank to the csg flags & bump csg version
Add function to read the csg rank during pilotfile::verify()
Reorder 'find pilots' call so that Game_mode is valid for verify

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10818 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
niffiwan 603a4086f5 Fix mantis 2920: prevent pilots switching languages
In other words, a pilot can only be used in the same language it was
created with. Checks both the initial selection screen and in the
barracks.
Also fixes issue with PLR version being ignored in pilotfile::verify()

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10817 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
niffiwan 05adea0e25 Fix mantis 2923
Backout all_time and multi_stats from the pilotfile stats as
required

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10816 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 3f752b9a40 Address Coverity 1093687 Resource leak in os_init_cmdline() that would occur when the -parse_cmdline_only flag was set. Refactored to improve readability at the same time. Order of precedence remains data/cmdline_fso.cfg, per-user cmdline_fso.cfg (on Linux and Mac), then actual commandline. The presence of -parse_cmdline_only will ignore all settings in on-disk cmdline_fso.cfg files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10815 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 55f34b1b58 Address Coverity 1093378 and 1093379 Resource leaks in object ChttpGet::ChttpGet()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10814 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 a0f31e6dc5 Address Coverity 1093380 Resource leak in object CFtpGet::CFtpGet()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10813 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 f5a9d32d14 Address Coverity 1093781 and 1093782 Uninitialized scalar variables in cftp.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10812 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 d0b786fe87 Address Coverity 1093635 Out-of-bounds read in multi_team_report()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10811 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 d8e26c8e02 Address Coverity 1212011 Unchecked return value in DCF(multi oo)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10810 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 05991a9fbf Address Coverity 1107318 Logically dead code in outwnd_print(), check for NULL id has already occurred
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10809 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 55af81050d Fix Mantis 3059: Coverity 1204289 String not null terminated in cf_search_root_pack()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10808 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 27495abda6 Address Coverity 1093373 Copy-paste error in vm_find_bounding_sphere()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10807 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 129a2d0d85 Address Coverity 1204290 Copy into fixed size buffer - strncpy() should be restricted by length to that of the target string, and does not guarantee null termination if the source string overran
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10806 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:35 +10:00
Echelon9 1883fcb8ae Address Coverity 1093663: Out-of-bounds access with memcpy() in multi_oo_pack_data() for clients only
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10805 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:35 +10:00
niffiwan 2ea048ee51 Fix mantis 3005: add arg so end-campaign sexp can ignore the death screen
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10804 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:35 +10:00
niffiwan c4978d3661 Fix r10801 (thanks to MageKing17 for noticing this)
Really avoid using -1 as an array index

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10803 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
chief1983 d2ffd40d67 Fix an assertion logic reversal in r10797, spotted by MageKing17.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10802 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
niffiwan e86d0c573d Fix pilot conversion issue (followup to r9630)
-1 is a valid weapon index, but avoid indexing the array with it

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10801 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
Zacam 1d6e173023 Fix for Mantis 3058: On warp out, glowpoints still stay "on" and in mission space without a ship; from MageKing17
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10799 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
Zacam 2db5a3b991 Fix for Mantis 2725: Beam sounds not panning correctly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10798 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
Zacam 3e22cc0d54 Fix for Mantis 3057: Loadout (Ship/Weapon Select effect) rendering black models or no effect. Also corrects wireframe color for FS2 effect from black to blue. Committed on behalf of MageKing17.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10797 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
m_m 3390ba23a0 Fix for Mantis issue 2891: gr.drawString text box height irregular
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10796 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
niffiwan 1f246b7de1 Coverity ID 1093586 Negative array index read
Shouldn't be able to occur since when artillery_objnum is set to -1,
artillery_lock_time is also set to 0.0f. BUT, protect the array
access anyway in case the surrounding code changes in future.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10794 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
Goober5000 35096fd957 use the [more] color, per MageKing17's previous changes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10793 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
niffiwan 1bd98325bd Coverity ID 1093722 Negative array index read
Move -1 check to before the convinience ptr is created & used

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10788 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:19 +10:00
niffiwan 06b0eb8d35 Fix mantis 3051 (From MageKing17)
Only store CPVs on accepting mission results
Add copy of CPVs to missioncampaign and pilot .csg so redalert missions
can rollback the CPVs if required

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10786 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:53 +10:00
niffiwan 5801bd47ea Coverity ID 1093538 Negative array index read
Change unknown +Default Ship index (-1) to 1st ship index (0)
Fix loop iteration
Change Assert to Assertion

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10774 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:53 +10:00
niffiwan a545580a5a Coverity ID 1093533 Negative array index read
This negative read occurs regularly, but it'd be very very rare for that
random read value to evaluate to OBJ_WEAPON and cause further issues.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10773 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:53 +10:00
niffiwan 3b77e65f5f Raise MAX_PATH_LEN to 256 so FSO can run in long paths
Specifically avoid one issue with running FSO in the default Steam dir
Converted some magic 128/127 numbers to MAX_PATH_LEN
Convert some Int3() into more friendly errors
Stopgap measure until proper fix added with compressed VP support
Fix mantis 3028

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10772 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:52 +10:00
zookeeper 3a3e8599df Removed an assert checking for a condition which can rarely be false (presumably due to inaccuracy in vector normalization) but which doesn't actually need to be true.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10766 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:52 +10:00
niffiwan 9da72db80e Coverity 1221482: Dereference after null check
Stop Ctrl-PgUp/PgDown crashing when a briefing icon is not in closeup mode

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10764 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:52 +10:00
niffiwan e3ebdd3ce9 Coverity ID 1221483: Missing break in switch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10763 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:52 +10:00
niffiwan 8baa713ef8 Fix a few gcc compile errors introduced by r10756
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10760 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-07 12:37:26 +10:00
The_E 147bf23067 Catch a lua error that apparently can happen
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10759 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-07 12:37:26 +10:00
niffiwan fdd8666524 Fix mantis 3048 (From MageKing17)
Fix "more" & offsets in [cmd|de|]briefings

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10758 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-07 12:37:26 +10:00
m_m d84d9d31aa Added multiple scripting features related to messaging as requested by Axem.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10756 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:18 +10:00
m_m 6d5b5ddde1 Add support for voice acting in fiction viewer.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10755 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:18 +10:00
niffiwan f54429d49f Fix mantis 3041
Allow set-skybox-model to set skybox flags (with FRED support - thanks
m!m)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10754 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
Goober5000 8e1c4be1b6 quotes can span multiple lines as well, so let's keep track of that flag (fixes Mantis #3001)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10753 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
Goober5000 e10550cdbd fix a bug in the when-argument sexp that managed to escape detection from its original design! spotted by MageKing17, fixes Mantis #3052
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10748 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
Goober5000 a1e5d76c02 roll back r10741 pending further code review; see Mantis #3052
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10743 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
Goober5000 cf8c06f850 follow-up to r10734: in the event of any SND_F flags being added in the future, this is more future-proof
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10742 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
The_E c562e34516 From MageKing17: Fix for Mantis 3502 (Flush the sexp result tree after argument evaluation to avert accidental short-circuit results)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10741 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
niffiwan 28c31c9ba2 Fix mantis 3053 (From MageKing17)
Check KEY_DEBUGGED1 to allow event.log snapshot to trigger when using
release+cheats

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10740 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:30:00 +10:00
niffiwan e926d6bad0 Fix mantis 2812 (From Yarn)
Add modular help tables and allow more than 2 help overlays

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10739 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:30:00 +10:00
The_E 52331f89a2 Stopgap fix to avert a crash in get_subsystem_world_pos later on
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10738 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 f995298abf Fix Coverity 1093663: Out-of-bounds access in multi_oo_pack_data()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10737 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 62b9833bf0 Fix Coverity 1093638, 1093640 and 1093667: Out-of-bounds access in tcp_client.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10736 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 0279040e80 Fix Coverity 1093799 Uninitialized scalar variable -- initialise array contents to zero
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10735 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 ff38404cac Fix Coverity 1093788 Uninitialized scalar variable - no need for bitwise AND when value is so far unset
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10734 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 a779ee3ed4 Fix Coverity 1093783 Uninitialized scalar variable with opengl_light structure in gr_opengl_set_center_alpha()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10733 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 4033465143 Fix Coverity reports of Uninitialized scalar variable with the vertex struct. Should vertex ever be converted to a class from a struct, these memsets as well as the pre-existing ones will need to be removed in favour of a proper constructor of the then vertex class.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10732 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
niffiwan e7d041c332 Fix mantis 2940
Only reset pilotfile stats when the local Player is reset

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10722 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:58 +10:00
m_m c1b2d7c1ee Fix for Mantis 3045: gr.drawImage()'s UV arguments aren't working properly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10721 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-25 19:03:50 +10:00
Goober5000 53e5ba5913 remove Import Weapon Loadouts feature, which was mainly used for versions of FSPort prior to 3.0 and was broken from r2768 to r10718 anyway
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10720 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-25 19:03:50 +10:00
The_E 154a1a6c76 Removing dead and potentially confusing code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10719 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-25 19:03:50 +10:00
Goober5000 9fdfde9ae6 restore a strcpy that was accidentally removed in r2768 (fixes Mantis #3046)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10718 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-25 19:03:50 +10:00
The_E d5388ad4bf Fixes crash in the texture replacement editor: Erasing the end element of a size 0 vector is probably not a safe thing to do
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10717 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-25 19:03:50 +10:00
niffiwan c27079fb7a Fix Coverity ID 1215457 Out-of-bounds write
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10716 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-24 09:35:04 +10:00
niffiwan e037571170 Fix Coverity ID 1215458 Uninitialized pointer field
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10715 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-24 09:35:04 +10:00
z64555 d5e81f4561 Fixes 3039: C++ STL was having data race issues with instantiating the debug_commands and the vector that was supposed to reference them. Seems like ✌️ ran into this issue a few times before...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10712 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-23 22:04:59 +10:00
The_E 003d5e5a2a Amendment to 10706: INT, FLOAT and STRING are already defined symbols on Windows, I've changed them to AT_INT etc so that compilation can happen.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10710 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-22 20:49:29 +10:00
niffiwan e31a8be138 Fix mantis 3026
Update Linux --help option to show all cmdline options
Added data/checks for expected args to cmdline options
Add extra const-ness per m!m review

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10706 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
m_m a6a41efa84 Add support for countermeasures that will pull aspect seekers away from their previous targets.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10705 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
The_E 3344f554f9 More ship flag/ship info flag confusion cleared up
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10704 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
The_E 2c59a39bf6 See 10701, same issue here
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10702 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
The_E 3e1d0082c4 Checking a ship_info flag against a ship flag isn't going to work
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10701 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
chief1983 b4785ea039 Add some lib locations for Solaris for software installed from OpenCSW.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10695 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
asarium 6c16d0a890 Revert "Add support for countermeasures that will pull aspect seekers away from their previous targets."
This reverts commit 263ed7f05d.
2014-05-17 22:17:57 +02:00
asarium 263ed7f05d Add support for countermeasures that will pull aspect seekers away from their previous targets. 2014-05-17 22:12:37 +02:00
niffiwan 8da9a68d31 Fix assertion when entering barracks in debug
Assert that there's one more line free, not number-of-ships lines

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10689 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
The_E c22fd46f18 Change the "Report Bug" button's URL to scp.indiegames.us
In other news, did you know that FRED has a "Report Bug" button in its About dialog?

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10666 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
niffiwan bd64590ec1 Fix mantis 2981
Read & write pilot loop data in the same order

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10665 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
niffiwan ec90cae8d9 Fix Coverity ID 1212016 Copy into fixed size buffer
replace strcpy with strcpy_s

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10662 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
niffiwan e199a928c4 Fix Coverity ID 1212017 Copy into fixed size buffer
replace strcpy with strcpy_s

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10661 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
niffiwan 3890ca6928 Fix Coverity ID 1212013 Macro compares unsigned to 0
Use MAX instead of CLAMP

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10660 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
niffiwan 6b955bb7b8 Fix Coverity ID 1212014. Unsigned compared against 0
Removed the >= 0 check

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10659 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:11 +10:00
niffiwan cc21af0d08 Fix Coverity ID 1212015.
Check the pointers value vs '\0', not the pointer

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10658 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:11 +10:00
z64555 153cb7dc79 Debug console. Now with more intuitive pagination from the help list!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10654 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:11 +10:00
niffiwan 5ccfbe1119 Remove GCC Warning (unused-variable)
Since token_str is only used in 1x .cpp, move the declaration from
the .h to the .cpp

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10653 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:38 +10:00
z64555 2903bbee1f Resolves complaints from VC6 about several instances of find_if that were not scoped properly. None of the other compilers seemed to have noticed...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10647 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:38 +10:00
z64555 c6e9736c18 Resolves some warnings concerning signed/unsigned comparisons. Fixes a typo with a DCF_BOOL output message. Fixes compiling on MSVS 6.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10646 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:38 +10:00
zookeeper 9b822a3fa7 Fixed gr.drawOffscreenIndicator() returning wrongly scaled coordinates.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10645 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
The_E cc8f3d2b21 Fixes another C4800: Conversion from int to bool warning
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10632 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
The_E e3421897b9 fixes a bunch of C4800 warnings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10631 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
zookeeper 90c0e77250 Fixed missing closing tags.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10629 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
chief1983 5e21ff72b9 Revert some accidental solution file changes from the debug console commit.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10627 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
chief1983 f11188246b Fix debug console compiling error on Linux.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10626 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
chief1983 5b8728411f Add debugconsole files to makefile. Also, remove lingering reference to dbugfile.h which was deleted in r7857.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10625 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
chief1983 4dcf6a62ee Add debugconsole to Xcode 3 project.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10624 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
chief1983 92d9b8b308 Redo the LastUpgradeVersion part of r10558.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10623 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
z64555 8d5fbab768 z64555's debug console. Take 2. Includes changes to most (not Xcode) project files to include the added files of r10621
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10622 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
z64555 f18f8a9ea7 debug console amendment, these files got ignored, somehow.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10621 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:36 +10:00
The_E 98355da7d5 Revert 10619: Missing files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10620 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:36 +10:00
z64555 2b2ba832f8 z64555's debug console.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10619 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:36 +10:00
zookeeper edc515e681 Fixed Mantis #3037; surface shields will again check for a shield mesh collision before hull collision.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10618 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:35 +10:00
zookeeper c80484f890 Clarified documentation of gr.drawPolygon and gr.drawSphere.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10616 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:35 +10:00
niffiwan b42f468552 Fix issues added in r10587
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10611 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-04 20:52:23 +10:00
niffiwan a861372efc Add lua campaign lib & functions to retrieve mission filenames
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10602 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-04 20:52:23 +10:00
niffiwan 7c3631002b From Yarn: Fix mantis 3031
Use PF_USE_AFFIRMATIVE_ICON where necessary

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10601 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-04 20:52:23 +10:00
Echelon9 67ccdfb6d3 Fix Mantis Issue #2976: AddressSanitizer: global-buffer-overflow in firing_aspect_seeking_bomb()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10596 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-04 20:52:22 +10:00
karajorma bb7e894107 Output how much of the player's score comes from the currently displayed list of kills by ship type in the barracks.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10595 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-25 16:04:45 +10:00
Echelon9 8267319073 Resolve build errors reported on MSVC in beam_ok_to_fire()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10594 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-25 16:04:45 +10:00
Echelon9 c1fdd9a58c Correct the cast to size_t in buffer_data constructors
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10593 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-25 16:04:45 +10:00
Echelon9 a7e1390397 Fix Mantis Issue 3035: AddressSanitizer: double-free in interp_configure_vertex_buffers() of memory contained in buffer_data object. Add a copy-constructor and copy-assignment operator which are required as we manage our own memory in buffer_data
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10592 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-25 16:04:45 +10:00
Echelon9 ceeabbf805 Reverse commit in r10558. Given we regularly have users provide Debug logs, this will prevent that small subset with only 32bit Mac's from running a Debug build
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10588 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-25 16:04:44 +10:00
niffiwan b1ca9a33da Fix mantis 2950: make shields-on/shields-off multi compatible
Fix multi player for alter-ship-flag

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10587 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 974bf06237 Fix Coverity 1093381: Resource leak in object due to absence of destructor. Provided that release() has already been called, which would mean memory has been cleaned up on most paths, this destructor will be in essence a NOP (or close to it). If memory has typically not been cleaned up already, this addition will improve memory usage over time.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10581 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 b36f1c1709 Fix Coverity 1093306: Whilst the return value was not checked in beam.cpp, the correct fix is to convert the function to void given no location actually checks the return value.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10580 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 bdd192a17d Fix Coverity 1093302: Unchecked return value. This is the only occasion where the return value of ship_get_by_signature() is not checked. Likely oversight.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10579 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 5268ef1916 Related to Coverity 1093623: The self-assignment at present has no effect
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10578 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 26ee96a012 Fix Coverity 1093493: Missing break in switch statement. No logical reason why LE_ORDER_EVADE should fall through to LE_ORDER_STAY_NEAR. Only switch statement in block without a break statement further indicates an oversight.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10577 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 389f4b3dfb Fix Coverity 1093376: Copy-paste error in ade_table_entry::OutputMeta()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10576 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 1205336fee Fix Coverity 1194949: Copy-paste error in gr_opengl_bitmap_ex()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10575 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
chief1983 0bb037bb85 Removes the DS_Store hidden files from the Xcode4 Frameworks archive.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10572 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
chief1983 46c61fcbcf Unify all the revision placeholders out to 6 digits for increased regex replacement reliablity.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10570 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
chief1983 f903da75e3 Increase Xcode and Xcode4 version and filename consistency with other platforms.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10569 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
Echelon9 3c155fd888 Fix Mantis Issue #3033: AddressSanitizer: global-buffer-overflow in shockwave_move()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10568 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
Echelon9 308179256a Fix Mantis Issue 3032: AddressSanitizer: SEGV on unknown address 0x00000000f000 in texture_info::LoadTexture()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10567 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
zookeeper a20f54957c Ported r10282 from zookeeper branch: added a new #SOUND SETTINGS section to game_settings.tbl and in it overrides for the default sound, music and voice volume.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10563 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:24 +10:00
zookeeper 1f2f6d8d8e Ported r10395 from zookeeper branch: made the Shields handle support non-quadrant shields.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10562 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:24 +10:00
zookeeper 636f903f72 Ported r10442 from zookeeper branch: increased the arrival/departure paths restriction dialog's width by 100px so even longer path names will be fully visible.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10561 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:24 +10:00
Echelon9 01d718f8e9 Project files in Xcode4 folder adopt latest suggested project file settings from Xcode 5.1.1
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10558 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-14 19:40:17 +10:00
Echelon9 7e47598eb9 Fix issue 3030: Clang warning: semantic issue, '&&' within '||' in gr_[re|un]size_screen_pos() and gr_[re|un]size_screen_posf()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10557 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-14 19:40:17 +10:00
Echelon9 7aaa5fa4a1 Fix Mantis 3029: Clang warning: expression result unused in multi_pinfo_blit_squadron_logo()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10556 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-14 19:40:17 +10:00
m_m 77d7871266 Fix for Mantis 3027: Crash if ship AI is forced to change target
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10552 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-14 19:40:17 +10:00
m_m d3dde35341 Fix for an invalid index crash.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10550 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-14 19:40:17 +10:00
niffiwan 3a113e6176 Remove gcc warnings (unused)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10548 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-31 17:28:25 +10:00
The_E 6e91857745 From Yarn: Fixes interface graphics scaling issues. If, for some reason, you want to have the interface graphics stretched, use the -stretch_menu commandline flag.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10544 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan c5417c1909 Fix mantis 3025: pass lua HookVar integer data as an integer, not a struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10543 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
Goober5000 d195c97056 Yarn's fix for Mantis #3024
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10531 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
Goober5000 c5a7223943 this will likely fix Mantis #3013
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10530 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
The_E 4f39ef2e07 Fix for Mantis 3023 by Yarn: Make sure the vasudan mainhall fun cheat works again
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10519 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
The_E 07980be92e Fix for Mantis 3015: Makes sure rotation values are always in the 0-359 degree range
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10518 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan 08280e3d9e Remove gcc warnings (unused & shadow)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10517 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan ca17188572 Fix mantis 2921: start mainhall music when leaving the credits state
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10507 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
Goober5000 d7b6a1ac6f add briefing icons for ship-with-cargo and wing-with-cargo
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10506 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
zookeeper 7099170497 Changed the label of the "Broadcast Locally" multiplayer option from "/multidata" to "Broadcast Locally".
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10498 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan 7f1a2c734f From Axem: fix newly added hud gauge sexps
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10497 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
karajorma 2356f04f04 Yarn's fix for Mantis 3017 (Certain HUD elements don't work after the changes to strings.tbl). Not very happy with the way it fixes thing (it only solves problems for French, German and Polish, which kinda makes the changes to strings.tbl in r9761 somewhat pointless) but it makes sense to wait for SDL and truetype support and then fix everything properly then.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10496 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan 55bec33861 From Axem & niffiwan: stop briefing/credits/mainhall music with scripting
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10495 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
m_m 626269d4a4 Fix for Mantis 3018: Setting a weapon's Target/HomingObject/HomingPosition etc doesn't work
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10494 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
Fabian Woltermann 083905b4f8 Merge pull request #16 from asarium/fix/hudmessage
Fix a crash with invalid iterators
2014-03-16 22:57:45 +01:00
asarium 31d6ca5a0e Fix a crash with invalid iterators 2014-03-16 22:32:10 +01:00
niffiwan 3f349849d6 Fix mantis 3019: flush bitmap to prevent alpha-additive-blend shenanigans with lua drawRectangle
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10493 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:32 +10:00
Goober5000 ff675c3653 New method of handling quotes and comments that examines lines character by character like most languages do, instead of just searching for the start of a comment. If a comment character is inside a quoted string, it will not kick off a new comment. (This actually fixes the core design flaw that caused semicolons to truncate messages, so the $semicolon tag is technically no longer necessary. It will still be kept, of course.) Fixes Mantis #3001.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10492 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:32 +10:00
Goober5000 0eb5606527 the #define already has a (char)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10491 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:31 +10:00
niffiwan 2f22873e35 From Axem: add hud-set-custom-gauge-active and hud-set-retail-gauge active
Deprecates hud-set-active-gauge and hud-activate-gauge-type in favor of hud-set-custom-gauge-active and hud-set-retail-gauge active, which are clearer to understand and now accept INT_MAX number of gauges, instead of just 1.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10489 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:31 +10:00
Goober5000 03144d3846 going through old revisions, r8540 is wrong, since it was like that in trunk -- memsetting the whole struct to -1 sets all integers and floats to -1 (so let's go back to the old way in case some old retail code relied on model_instance_num, model_num, or submodel_num being set to -1)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10481 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:31 +10:00
m_m 638ad77a21 Add a scripting hook variable that specifies the mouse buttons. This variable is named MouseButton and is a bit field which uses the MOUSE_* defines (index 0 for right, 1 for left, 2 for middle).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10477 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:31 +10:00
niffiwan 4e98285d2a Followup to mantis 3009; missed the Lead Sight gauge in the 1st fix
Rechecked all other gauges that set slew=true in their contructors
(vs 1st pass which checked gauges that set slew=true in hudparse.cpp)
I think I got them all now...

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10476 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:31 +10:00
Zacam 5e67acf5fe Adds cursor.h/.cpp to 2011 Project for building.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10488 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-10 20:52:22 +10:00
m_m 088f0c2c4f Fix a few mouse related issues. This adds the CursorManager class which handles loading cursors and showing/hiding the cursor.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10487 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-10 20:52:22 +10:00
niffiwan 6c3ae961ab Copy in m4/sdl2.m4 from SDL2.0.1 for autotools
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10485 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-07 20:17:43 +10:00
Zacam d617e85008 Adds SDL2main.lib to linking for SSE2 Debug/Release builds.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10479 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:14 +10:00
Zacam a8dfb820a1 Trunk Sync r10476
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10478 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:14 +10:00
m_m b7bea462ee Merge changes of trunk r10463.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10468 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:14 +10:00
Zacam 18648cbc37 Trunk Sync: r10464 This is sans Trunk Commit 10463 due to osapi changes.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10465 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:14 +10:00
The_E b4172fa379 Fix for some crashes, by Flaming_Sword
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10276 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:14 +10:00
The_E edeb8768af Trunk sync r10257
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10259 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:14 +10:00
The_E ebf8fd19d3 From m!m: Proper use of SDL2Main
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10258 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:14 +10:00
The_E 956d98de1d The fuck is wrong with you, svn, I told you to sync
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10248 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:14 +10:00
The_E 3748206525 Correctly initialize haptic support.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10234 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
The_E 013db60499 Replace call to vwglSwapIntervalEXT with SDL_GL_SetSwapInterval
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10231 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
The_E 753e82f5c6 Removes the CRITICAL_SECTION macros, as these were just obscuring calls to SDL functions
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10230 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
The_E 09df160371 Change std::map SDL2FS2 to SCP_map
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10229 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
The_E 09d039fd42 sync to trunk 10223
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10228 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
The_E 31db49d6fd Sync to trunk revision 10223
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10227 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
chief1983 bd68173a4f Closer to working compile with Xcode 5.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10173 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
m_m 66c37c8fda Fix a problem with the mouse where the controls were stuck.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10172 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
m_m 3fa9b5275e Also delete the old unix-osapi file, it isn't needed anymore.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10167 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
m_m 44d9279fa8 Merge both osapi files into one file.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10163 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-06 19:24:13 +10:00
karajorma a7428c5a72 Bigger (and better?) Briefing and Debriefing editors courtesy of Axem.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10475 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-26 21:37:14 +10:00
zookeeper 6f906561bb Fixed oversight in r10430: the $Weapon class hook condition didn't work on $Weapon Collision hooks if the other object was an asteroid.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10474 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:02 +10:00
Zacam 3ef41e164c I think we can allow for 32bit Color Depth to be the default option now.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10473 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:02 +10:00
karajorma 159d8e7107 Fix a bug where you couldn't press g to start a mission in debug builds.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10471 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
karajorma b4dad30c77 Add a SEXP for checking the current state of ship flags.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10470 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
karajorma 64efaddaab Make the Mission Objectives editor a little larger. Cause why not?
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10469 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
karajorma ebfdf4e901 Fix a bug with the event.log where SEXPs which weren't in events would also write data to the log.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10467 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
karajorma 5dc4bfea97 Fix a bug with the multiplayer SEXP code. The callback functions write to the packet and thus can also make it go out of bounds.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10466 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
m_m 05702504c4 Fix for Coverity 1107332: Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10464 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
m_m 08dad5b3af Add -no_unfocused_pause option.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10463 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
niffiwan a2b42bf5f1 Fix mantis 3009: set slew correctly for hud gauges
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10462 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:35 +10:00
m_m 3490ac3a9c Add lua function to get a handle of the current player
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10446 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
The_E 37ded5589d Adds set-motion-debris-override sexp. This can be used to control the presence of motion debris, and overrides any user choice made through the -nomotiondebris commandline flag.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10445 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
zookeeper cef02e7b9f Clarified which time units are expected by camera.setOrientation() and camera.setPosition().
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10431 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
zookeeper a72f0f9d62 Allowed the $Weapon class hook condition to work on $Weapon Collision hooks.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10430 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 6d5e026a3e Mantis #3004: don't remove subspace drives from support ships
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10429 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 df73bacb9e Mantis #3004: standardize checks for whether ships can depart to docking bays, and whether departure goals are achievable, and whether a ship can be commanded to depart; also fix the default behavior if a ship attempts to warp out but is unable to
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10428 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
m_m d97f31d034 Fix for Coverity Issue 1166829: Dereference before null check
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10411 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 a880bcb9c2 Mantis #3004: ship_get_ship_with_dock_bay was written in such a way that it allowed a negative array index to create all sorts of havoc
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10407 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 dbe5f61dd6 following up from r10000 and r10004, fix the hud squad message display for support ship aborts (and in the process optimize things slightly)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10406 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 0a9063a525 wing names with the hash at the beginning aren't subject to the name bashing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10405 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 827286ec95 only warn once, because old missions tended to have a *lot* of these broken +Team values
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10404 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:33 +10:00
karajorma aeb089b216 If we've already written the content of CTEXT(n) to a variable, we should use that, rather than calling CTEXT(n) 500+ times.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10403 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:33 +10:00
m_m 5fa9a5c946 Fix for Coverity 1147623: Out-of-bounds access
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10393 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:33 +10:00
m_m 0d54630e83 Fix for Coverity 1107329: Improper use of negative value
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10392 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:33 +10:00
Echelon9 f97e478c6d Fix Coverity 1093576 Improper use of negative value: In model_collide_flatpoly(unsigned char *): Negative value can be returned from function is not being checked before being used improperly (CWE-394). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10391 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 3b19fab1c1 Fix Coverity 1093446 Dereference after null check: In obj_snd_stop_all(): Pointer is checked against null but then dereferenced anyway (CWE-476). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10390 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 6d52a7c2b2 Fix Coverity 1093407 Logically dead code: In model_interp_sub(void *, polymodel *, bsp_info *, int): Code can never be reached because of a logical contradiction (CWE-561). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10389 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 0288075eb0 Fix Coverity 1093392 Logically dead code: In obj_snd_assign(int, int, vec3d *, int, int, ship_subsys *): Code can never be reached because of a logical contradiction (CWE-561). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10388 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 cf0928ab8c Fix Coverity 1129278 Uninitialized scalar field: In object::object(): A scalar field is not initialized by the constructor (CWE-457). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10387 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 b2231f28d1 Fix Coverity 1102734 Uninitialized scalar field: In collider_pair::collider_pair(): A scalar field is not initialized by the constructor (CWE-457). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10386 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 846cdad098 Fix Coverity 1107319 Copy-paste error: In collide_weapon_weapon(obj_pair *): A copied piece of code is inconsistent with the original (CWE-398). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10385 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 64dad52741 Fix Coverity 1093455 Dereference after null check: In read_model_file(polymodel *, char *, int, model_subsystem *, int): Pointer is checked against null but then dereferenced anyway (CWE-476). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10384 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 2936dde64f Fix Coverity 1093728 Allocation size mismatch: In model_allocate_interp_data(int, int, int): Allocation size is not a multiple of the target pointer's pointed-to type (CWE-131). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10383 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 f02cba4090 Fix Coverity 1093413 Logically dead code: In model_collide_sub(void *): Code can never be reached because of a logical contradiction (CWE-561). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10382 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 7241a6b686 Fix Coverity 1093669 Out-of-bounds access: In triggered_rotation::add_queue(queued_animation *, int): Out-of-bounds access to a buffer (CWE-119). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10381 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 0572c25aa1 Fix Coverity 1093859: Uninitialized scalar field In mst_info::​mst_info(): A scalar field is not initialized by the constructor (CWE-457). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10380 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 d503d1d42e Expand the .gitignore exclusions to cover modern Xcode project local files. Based off StackOverflow suggestions as documented.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10379 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 0b494959e1 Fix Mantis 2997: Make +Bitmap a required table item if a weapon trail has been set
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10378 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
karajorma f9f2b1e8d7 There was some confusion about the old help text.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10377 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
The_E e4009799c6 Remove a pointless, ✌️ original assert (All ships should be able to send messages regardless of whether they're flyable; checking whether they are accomplishes literally nothing)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10376 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
The_E d36fc2a88e Remove per-campaign detail settings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10351 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:26:00 +10:00
The_E 6b39db6b12 Remove a superfluous $ sign from gauge_load_common, which was messing up hud_gauges tables that defined differing fonts for hud gauges.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10350 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:26:00 +10:00
zookeeper 6e8a90fbbc Fixed targethit1 -> targhit1 in an error message.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10349 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:26:00 +10:00
zookeeper 0794dcded3 Another little Lua documentation fix.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10348 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:26:00 +10:00
zookeeper dc37d2e5de Two small Lua documentation fixes.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10347 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:26:00 +10:00
m_m 5050494c45 Fix for Coverity 1135848
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10311 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:25:59 +10:00
niffiwan c08aaf1ec2 Coverity ID 1093440: Evaluation order violation in weapon_create()
Related to weapon substitution code
Also a gcc warning (sequence point)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10301 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:25:59 +10:00
m_m 8fb2a7ffad Add -profile_write_file options to write frame times to a file. See Wiki for more information.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10299 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:25:59 +10:00
zookeeper 0cac254b04 Fixed Mantis #3000.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10298 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:25:59 +10:00
niffiwan 9f67d2e337 From Admiral MS: add scripting function to get the waypoint-list of a waypoint
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10297 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
niffiwan 2605583be6 From Admiral MS: add scripting function to get the wing of a ship
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10296 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
niffiwan e1711a326e From Admiral MS: scripting access to ship orders; also allows modifying some order values
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10295 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper 270d3d9248 Fixed breakage from r10254: key tokens in messages weren't getting translated right.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10293 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper 7f74ce48a6 Fixed +Spread From LOD not working.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10290 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper 31ab1cff2c Ported "no homing speed ramp" weapon flag from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10289 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper dbded13fa4 Ported $Acceleration Time weapons table option from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10288 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper ef94f4bb04 Ported $Velocity Inherit weapons table option from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10287 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
karajorma 1adabef7bd X3N0-Life-Form's Call-SSM-Strike SEXP.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10286 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
karajorma c27f75cd5a Add support for replaying briefing and command briefing cutscenes. The go back a stage and go to first stage buttons will now count these as a briefing stage.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10280 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
karajorma 7ef94f084b Allow training missions to also show mission goals.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10279 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
karajorma cd9c2f851b Make it easier to distinguish the events in the mission log
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10278 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
Goober5000 2c34ca0218 fix Mantis #2994: a model can have initial animation states even if it doesn't have animations
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10277 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
niffiwan cecc445e8b Move $Scale Gauges: token before $Reticle Style: to avoid breaking parsing when both are specified
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10275 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
niffiwan 7f05cca670 Ensure Offset & Origin are used together (hud gauges)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10274 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
niffiwan 4d7c218d59 Tweak HUD so that retail gauge scale/no-scale can be set in a minimalistic hud gauges table
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10273 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
niffiwan 770cd66755 Add scaling option to Yarns hud gauges
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10272 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
Goober5000 0b4f71c84d Mantis #2951: fix memory corruption issues by changing weapon substitution patterns to use C-style arrays rather than SCP_vectors
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10270 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
Goober5000 b090ea1f68 revert r10082 temporarily while substitute pattern feature is modified
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10269 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
niffiwan 84728de587 Add cmdline flag to disable use of pixel buffer objects
Workaround a bug/deficiency in recent linux intel video drivers

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10268 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
Goober5000 a04e83ab01 red-alert will now work with ships that appear at some point subsequent to mission start
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10267 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
Goober5000 180115feba correct ammo for red-alerted ballistic primaries
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10257 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:44 +10:00
zookeeper e93e27fc0d Improved the calculation for how many segments to use for drawing circles and arcs.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10255 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:44 +10:00
zookeeper 61d9ce895b Ported the $On Action and $On Action Stopped scripting hooks from zookeeper branch. Also bumps the char limit for conditions from 32 to 64.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10254 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:44 +10:00
niffiwan e3715cc420 change var names to avoid warnings re shadowing 2014-01-01 19:58:36 +10:00
niffiwan 366f4d5642 set HAVE_CXX11 for clang 2014-01-01 19:30:05 +10:00
niffiwan 547d615552 set HAVE_CXX11 for MSVC 2014-01-01 18:56:32 +10:00
niffiwan 4f074d94d1 Add compile time catch for memmove used on non-trivial objects 2013-12-22 20:09:44 +10:00
niffiwan a4ac843d5b Add compile time catch for memcpy used on non-trivial objects 2013-12-22 19:53:52 +10:00
niffiwan 0115235de7 Add lua on-collision hooks for beams: from Axem & Wanderer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10253 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
z64555 63ab561e59 Mantis 2977 - Fixes some scripting hooks and references broken by r9549
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10252 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
The_E 9ff8f21b1f Adds a check to see if the model actually has a defined viewpoint; We can't generate the firepoint display if it doesn't
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10251 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
karajorma 69749cdaee Add the was-destroyed-delay SEXP by the WCS team. Add support to alter-ship-flag for hiding ship names.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10250 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
m_m 9cd218a595 Fix Mantis 2978: Off by 1 error with getShipClassIndex()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10249 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
Echelon9 5875b4f3a3 Fix Coverity CID 1093619: Array compared against 0
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10247 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
Echelon9 08f36eb32c Fix Coverity CID 1109072: Copy into fixed size buffer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10246 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
Echelon9 f834aa80a9 Fix Coverity CID 1093375: Copy-paste error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10245 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
Echelon9 b35ba0e419 Fix Coverity CID 1093368 - Copy-paste error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10244 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
Echelon9 d753954bcb Fix Coverity CIDs 1107320, 1107321, 1107322, 1107323 - Copy paste coding corrected
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10243 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
chief1983 5664773a29 Allow game_settings.tbl to define the FS2NetD port, so TCs can work out of the box on *nix, etc.
http://www.hard-light.net/forums/index.php?topic=86317.0

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10242 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
niffiwan 8105d2a372 Fix Coverity ID 1093819: Uninitialized scalar variable in (template) class ade_obj::GetPtr()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10241 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
niffiwan 34b1f276f3 Fix Coverity ID 1093784Y: Uninitialized scalar variable in struct order_h
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10240 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
chief1983 975f94f207 USHRT_MAX is in limits.h on Linux.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10239 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
Goober5000 d9b45b0eb2 just minor tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10237 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
Goober5000 1ff223687d when new subsystem entries are inserted, make sure the blank subsystem gets saved and inserted at the proper spot so that we don't use stale data (fixes Mantis #2979)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10236 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
chief1983 a45af2f019 Found the constant USHRT_MAX I was looking for just a little too late.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10235 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
chief1983 da4b191160 Saner parsing all around for webapi port number.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10233 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
chief1983 459e2bd469 Fix a warning when copying the webapi port token int into its destination ushort.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10232 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
niffiwan 359a98410a Add compile time catch for memset used on non-trivial objects
Fix one instance of this problem in osapi/outwnd_unix.cpp
2013-12-16 19:44:23 +10:00
niffiwan 1acfc1c326 Allow gcc on Linux to compile with -std=c++11
Tested with 4.6.3, 4.7.2 & 4.8.0
2013-12-16 19:37:02 +10:00
niffiwan 9e73870862 add wxfred2 execs to .gitignore
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10225 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan c5c7e58507 autotools: use autoreconf & m4 dir to make it easier to add/manage macros
add m4/wxwin.m4 macro file from wxWidgets 2.9.5 (previously pasted into acinclude.m4)
remove obsolete WX* macros from acinclude.m4
move acinclude to m4/fso.m4

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10224 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
zookeeper 6d3b183373 Ported parts of r9727 from zookeeper branch: Added support for multiple control presets.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10223 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan d904a4d516 Fix Coverity ID 1093569: Negative array index read in create_wings()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10222 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan def53398bc Fix Coverity ID 1093574: Negative array index read in sexp_change_player_score()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10221 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan 620f6aaf3d Fix Coverity ID 1093581: Negative array index read in sexp_clear_ship_goals()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10220 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan 3ffe479cca Fix Coverity ID 1093579: Negative array index write in sexp_damage_escort_list()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10219 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan 7d846defa5 Coverity 110733[01]: Negative array index read in get_string_or_variable()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10218 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan aa60c5acec Coverity ID 109381[456]: Uninitialized scalar variable in load_gauge_target_monitor()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10217 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan 336db15246 Coverity ID 1093808: Uninitialized scalar variable in init_ai_target_priorities()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10216 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan 6d402f43aa Coverity ID 1093550: Negative array index write in multi_voice_release_token()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10215 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:01 +10:00
niffiwan 9480b079ca Coverity ID 1093508: Negative array index write in observer_create()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10214 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:01 +10:00
niffiwan 7b9f485a34 Coverity ID 1135850: Out-of-bounds read in hud_target_change_check()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10213 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:01 +10:00
zookeeper d13236e0e4 Ported r9704 from zookeeper branch: Added scripting function for drawing filled and unfilled arcs and made drawCircle able to draw unfilled circles.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10211 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-11 18:52:14 +10:00
niffiwan a3256bbf88 Fix two issues found by Yarn
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10210 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-11 18:52:14 +10:00
niffiwan 0402e46f89 Merge Yarn adaptable hud with m!m common hud parse
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10209 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-11 18:52:14 +10:00
niffiwan 706152c7d5 Add common parsing function for hud tables (originally from m!m with updates from me)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10208 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-11 18:52:14 +10:00
niffiwan e6d4b83907 update .gitignore to ignore codeblocks layout files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10207 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-11 18:52:13 +10:00
Echelon9 45d6f9be21 Fix Mantis 2975: AddressSanitizer: global-buffer-overflow in HudGaugeLeadSight::render()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10205 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:58 +10:00
Echelon9 ce41e56f46 Fix Mantis 2896: AddressSanitizer: global-buffer-overflow in hud_lock_reset() hudlock.cpp (v2)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10204 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:58 +10:00
Goober5000 3eedfc7853 don't freak out if we don't have a beam texture
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10203 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:58 +10:00
Goober5000 645ee9a2ba make warning messages friendlier
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10202 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:58 +10:00
Echelon9 be08468a81 Fix Mantis 2974: WebUI interface: Chat tab does not print messages sent from WebUI
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10201 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:58 +10:00
Goober5000 ab1b8912b7 Sushi (or maybe LPine) broke Shield_Hit_Ani for modular tables when coding a Diaspora feature
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10200 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
Echelon9 e75a09d203 Update Jansson library to upstream v2.5 -- http://www.digip.org/blog/2013/09/jansson-2.5-released.html
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10199 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
Goober5000 f3c902c39b add wing_bash_ship_name, which handles the hash symbol thing, accommodates Blue Planet's capship trick, and works in FRED and while we're at it, do a little bit of const'ing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10198 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
Goober5000 6804e5ae7d a spelling fix, and also clarify a sexp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10197 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
niffiwan 6443005f5c Tweak insignia limits again per Oddgrim's recommendations
http://www.hard-light.net/forums/index.php?topic=86195.msg1722757#msg1722757

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10196 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
niffiwan 07dbfed088 Fix compile issue on Linux re: INT_MAX / <limits.h>
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10195 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
zookeeper 7ff59d0559 Enabled fighterbay door animations to better define which bay path must be used or not used for the animation to trigger using +sub_type. Fixes the (undocumented) current numbering of fighterbay +sub_types to be 1-based instead of 0-based. Turns the SUBTYPE_CHECK macro to a proper function.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10194 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
zookeeper 9f65775702 Made +delay and +acceleration in animation code optional and default to 0.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10192 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
Goober5000 1e78f8c6e1 fix hidden divide-by-zero
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10190 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
zookeeper 1c74472423 Added an $On Ship Arrive scripting hook.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10188 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
Echelon9 49c56eea91 Fix Mantis 2970: AddressSanitizer: global-buffer-overflow in show_ship_subsys_count()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10187 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:56 +10:00
Echelon9 9d6fdb07ba Fix Mantis 2969: AddressSanitizer: global-buffer-overflow in ai_do_objects_repairing_stuff()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10186 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:56 +10:00
zookeeper 54a4f26146 Replaced shield_hit_info in escort_info with its own simple set of timer variables. Fixes Mantis #2966 and makes the code simpler and safer.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10185 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:56 +10:00
niffiwan 41fee37f3f Bump model insignia faces/vertexes limits
(so that newer more detailed ships can have proper insignia)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10184 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:56 +10:00
niffiwan 4c93092045 Add warning for model insignia specifying an invalid LOD
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10183 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Echelon9 14fc0cfd88 Fix Mantis 2800: Particles not removed on standalone
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10182 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Goober5000 c19ac5df9d when changing ship types, make sure the collision flags propagate
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10181 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Goober5000 1467b0ef16 for wing names with hash symbols, put the ship number before the hash
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10180 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Goober5000 3bc14442c5 just make this block similar to the other one
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10179 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
niffiwan 668e67c52d Fix Coverity 1093549: Negative array index write
(practically impossible to occur, but lets be safe in case multi_voice_get_stream() changes in future)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10178 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
zookeeper 4b7543361b Added initialization of render box and sphere offsets.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10177 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
niffiwan e58cbc159b Fix mantis 2967: use Medals array instead of Ranks (from Yarn)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10176 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Echelon9 da6c95b8c4 Fix Mantis 2968: AddressSanitizer: global-buffer-overflow in shield_info_reset() - relates to hud_target_change_check()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10175 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Goober5000 69c7ee68f5 don't Int3() because this can happen when a ship is missing from a mod (i.e. when it turns into the GTF Ulysses)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10174 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
Echelon9 af9b12e448 Resolve compilation failure introduced by r10170
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10171 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
zookeeper b7a7bb968e Fixed some improper initialization of escort list hit_infos.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10170 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
zookeeper 85e39497cd More fixes to potentially uninitialized shield_hit_infos.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10168 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
Echelon9 b6b3a24e05 General clean up of commented out #ifndef NDEBUG blocks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10166 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
Echelon9 cb446460e4 General cleanup of commented out code in beam.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10165 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
Echelon9 396afcacf8 Ensure compliance with the usual form of test in the FS2_Open codebase for running in Debug mode
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10164 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 20:12:54 +10:00
niffiwan 7f20857796 Honour ships' "no lighting" flag in the techroom (from Axem)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10162 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:38 +10:00
zookeeper a59be2e7c7 Allowed shield_info_reset() to initialize shield_hit_info to empty values if it's not associated with a ship, as required by hudescort.cpp. Might fix Mantis #2961.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10161 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
niffiwan 1a3fc26bfe Move set-ets-values sexp to the correct category (thanks to Axem for finding this)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10160 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 ad1bef5344 some things don't need to be re-inited every time you pause the game
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10159 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 0fb563b241 set ballistic HUD gauge any time HUD is changed -- fixes Mantis #2962
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10158 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 9ec027641d add quotes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10157 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 92435f7217 fix some things that FreeBSD complained about
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10156 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Wanderer 141f6bc121 fix issue with burst firing secondaries - thanks to Goober for finding it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10150 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Wanderer 96cc3c017d feature commit: excluding weapons from linked fire penalty (per request)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10147 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
chief1983 4e54350dcc Fix #2959. Framebuffer explosions need framebuffer objects, or it seems we assert later in the code.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10145 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
chief1983 04e7b4c288 Recommit the ship.h part of 10082 as the OBO fixes seem to have fixed #2958.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10144 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Echelon9 3bbd389420 LLVM/Clang warns that a dangling else can occur without one level of braces
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10143 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 4611a77dbd re-commit r10082, except for ship.h, because it's the size of the ship_weapon struct that's causing the mysterious crashes (Mantis #2958)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10141 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 9ca44d8ce4 fix an off-by-one error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10140 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 40c4583792 fix Echelon9's fix >:( also add a judicious Assert for Mantis #2958
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10139 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 724e7816e4 Fix an actual Volition bug. This has AI balance implications, but it's already in the "pick a random weapon" section, so it will probably be all right.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10138 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
zookeeper 204ebfca63 Remember to initialize shield_point_augment_ctrls.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10137 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 70d05d3815 scramble messages on a per-ship basis
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10136 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
zookeeper 8cd19aa588 Merged model point shields from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10135 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
chief1983 1cb031c190 Fix #2959 by reverting r10082. I can probably talk zookeeper into converting the troublesome SCP_vectors into static variables so this isn't causing memset issues.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10132 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 f6a92e0972 allow modder to specify countermeasure type on a per-species basis
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10131 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
karajorma bad6af8a3a Yarn's fix for Mantis 2941 (Strings.tbms without the current language crash the game).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10130 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
chief1983 b2167c61a3 Fix #2957 - FreeBSD RAND_MAX is 0x7ffffffd, not 0x7fffffff, so we can't always assume that it's the latter. Also move the check earlier in the code, if it's going to break at all, break immediately on any non-conforming platform so we can fine tune this some more.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10129 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 e8a7c8cf57 medal_stuff passes the duck test, so make it an official class
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10128 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 6470f9043f make init_ship_entry actually init all the fields in ship_info make draw_weapon_models a ship flag instead of a boolean remove the MAX_SHIP_FLAGS #define because it didn't mean what everybody thought it meant
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10127 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
niffiwan da21b44d07 fix gcc warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10125 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
niffiwan 4581ed9aa2 Persona-specific promotion debriefings (from Yarn)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10124 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
chief1983 5ceabf1e8b Add support for the framecap menu option.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10121 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
chief1983 5ebd06bb29 Fix WebUI server name changes updating in clients and FS2NetD.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10120 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 858afb0cef turns out gcc doesn't like the two angled brackets adjacent to one another
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10119 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 13c8f95046 let's not make expensive copies of all these SCP_strings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10118 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 8179453ffa fix Mantis #2955: crash when trying to join multiplayer server, caused by trying to memcpy an integer into a ushort (also add some sanity asserts)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10117 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 389a2c6955 fix Mantis #2933: don't output alt ship class information using fout_version
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10116 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Echelon9 9cdd329f11 Webui: Resolve bug that was causing standalone game name to not appear
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10115 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
niffiwan da92a1a709 Add stub for std_init_os() so that *nix can compile
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10114 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
niffiwan f01eefe832 According to the medal_stuff class, some of these should be MAX_FILENAME_LEN, not NAME_LENGTH
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10113 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
karajorma f4a7a117e4 Fix Mantis 2954 (Standalone can't find default language)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10112 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
Goober5000 7585aed83b clarify help... OP_AND will actually evaluate all arguments
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10111 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
Goober5000 f8dcbffab8 rather than piggy-back the perform-actions sexp on top of the when sexp, it works better to make it its own operator (fixes Mantis #2956)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10110 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
Echelon9 e5115993bf AddressSanitizer: alloc-dealloc-mismatch (operator new vs free) in hud_close()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10109 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
Echelon9 ea93153446 Remove this memory event, as clear() is called after loop, which will call the destructor of each item. Picked up by AddressSanitizer as this was attempting to free() memory allocated with new()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10108 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
m_m a8b201beb7 Changed most MessageBox calls to use SCP_Messagebox, also fixed some of the event processing.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10155 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
The_E 47e6c09e1f Revert 10149. Needs more review
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10154 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
Echelon9 cd689b60e2 Remove extraneous WIN32 #ifdef's
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10153 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
m_m 4dbf2a4830 Derp, forgot to remove testing stuff.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10152 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
The_E 983214e3e5 From m!m: Enables FRED building. IMPORTANT NOTE: This requires a patched libsdl, the patch is included in the libsdl directory. Binaries were provided by m!m.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10151 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
The_E 2c5af51316 Removes a bunch of win32 ifdefs
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10149 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
m_m 20fb8f7196 Fixed crash in joy_ff_stop_effects caused by uninitialized function pointers.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10146 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
m_m db7b16feda MSVC 2011 Project Updates for SDL2/joy-sdl
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10106 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
Echelon9 a9c2fd7794 Cleanup some stray comments in cftp and chttpget
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10105 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
Echelon9 b397f376d8 SDL2 code changes to bring more common platform code into play
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10104 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
Echelon9 3dd0ddd95d Ensure the SDL2.framework is copied into the final application bundle
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10103 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:18 +10:00
Echelon9 90853677c4 Support SDL2 bindings and SDL2.framework on Xcode4/5. Please remember to delete your projects/Xcode4/Frameworks/ folder and recreate from the modified projects/Xcode4/Frameworks.tgz
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10102 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
Echelon9 0fccedc811 For now, we need to duplicate this code in osapi.cpp and osapi_unix.cpp, so that Mac and Unix can compile
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10101 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
chief1983 21cd06389b MSVC 2008 Project Updates for SDL2/joy-sdl.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10100 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E bfa7beb62d Adds include and linker directories to the FRED project (Does not resolve building errors though!)
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10099 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E 9294acc319 Adds an SCP_Warning function that acts as frontend to SDL_ShowSimpleMessagebox
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10098 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E 93ed384775 Removes redundant code
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10097 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E e15599d4cf Adds SDL force feedback support (Thanks, taylor!)
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10096 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E bcc6a3bdfb Allow borderless window mode on non-Windows platforms
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10073 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E dd0de23b3b Oops, deleted the wrong entry
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10072 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E 1831931c91 Comment cleanup
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10071 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E 0682ab8a05 We're not going to need the no-di-mouse cmdline argument anymore
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10070 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E 97f1c547a0 Actually initializing the keyboard input map is probably a good idea
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10069 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E abd5af41b4 Fix OpenGL context creation
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10068 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E a3ec953400 Updated project files for VS2012
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10067 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E e039693c13 Small snafu while merging
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10066 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E 02d44009ce ...
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10065 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E 81f623fb01 More missing things
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10064 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:17 +10:00
The_E 119fbbe38d Big commit part 2: Stuff the svn missed
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10063 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:16 +10:00
The_E 25915f6de0 IIt begins!
SDL2 Everywhere, from me and Flaming_Sword. Outstanding issues: FRED integration, project file updates, cleanup.

git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10062 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:16 +10:00
The_E 0a85a86c65 Sync to trunk 10060
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10061 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:16 +10:00
The_E 2f46cbe8a3 sync to trunk 10046
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@10047 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:16 +10:00
chief1983 4996303b5a Sync over r9194 from trunk.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9580 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:15 +10:00
chief1983 219c9b2c72 from trunk, committed with the pilot code.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9579 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:15 +10:00
chief1983 722ccb0299 Sync line endings on freespace.rc with trunk.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9578 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:15 +10:00
chief1983 1d39c15693 This wasn't supposed to be in 9574.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9577 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:15 +10:00
chief1983 69c9f459ce Trunk sync over r8579 that was missed apparently.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9576 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:15 +10:00
chief1983 0110f662dc Trunk sync commit r9565.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9575 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:15 +10:00
chief1983 b75e9ce1f8 Demo/standalone removal code from trunk to antipodes.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9574 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:15 +10:00
chief1983 14641d8136 Mainhall comment sync.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9573 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:15 +10:00
chief1983 93d4d11350 Remnant differences from Inferno removal.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9572 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:15 +10:00
chief1983 9a4f3f3fa0 More misc project differences.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9571 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:14 +10:00
chief1983 db12f67c4a More misc project file changes, properties on Xcode4 files.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9570 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:14 +10:00
chief1983 d9f7661bcb Sync some misc project file differences against trunk.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9569 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:14 +10:00
chief1983 47f3829aa4 Sync whitespace/formatting/comment purge differences from trunk to Antipodes.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9568 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:14 +10:00
chief1983 32957c999c Trunk sync r9564, for easier differencing.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9566 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:14 +10:00
Zacam 684908b239 Trunk Sync: r9544
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9548 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:14 +10:00
The_E 499c62b181 Trunk sync r9530
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9531 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:14 +10:00
niffiwan 3675a990ab Fix mantis 2781: use LastPlayer consistently in .ini files/registry
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9521 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:14 +10:00
chief1983 2a5429ea1d Trunk sync r9516.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9519 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:14 +10:00
chief1983 e1650f1255 Trunk sync r9508.
git-svn-id: svn://svn.icculus.org/fs2open/branches/antipodes@9509 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 18:40:14 +10:00
Goober5000 70f84212df we can just use the STL methods here
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10095 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:44 +10:00
Goober5000 a739c172f4 add an important note
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10094 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:44 +10:00
niffiwan b4ab0f3a44 fix gcc warning: declaration of ‘shipp’ shadows a previous local [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10092 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan 7a1b8d5be1 Coverity 1129269: Dereference after null check
add checks to deal with parent_objp == NULL

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10091 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan ed49e0786b Coverity 1129274: Negative array index read
weapon_create can return -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10090 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan e5260a381a Coverity 1129270: Negative array index read
weapon_create can return -1
(& oops, r10087 was 1129271, not 1129270)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10089 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan 95ab88de98 remove gcc warning: [-Wunused-but-set-variable]
(ret_val earmarked for future use)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10088 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan ae429e756e Coverity 1129270: Negative array index read
weapon_create can return -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10087 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan 442f3fb846 Coverity 1129272: Negative array index read
weapon_create can return -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10086 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan 1dad7f799e Coverity 1129273: Negative array index read
weapon_create can return -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10085 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan b2958b5e4a Remove a magic number
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10084 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 fa7cf7a910 "new" shouldn't really ever fail
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10083 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 33b871d29d remove non-working and non-supported $substitute feature for weapons (Mantis #2951)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10082 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 6bc71834ec this exited_ship constructor is redundant and interferes with the POD-ness of the struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10081 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 35347262d4 make man_thruster a POD struct, and initialize maneuvering thrusters in ship_info initialization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10080 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 de792bc0ca memset initialized the wrong level of pointer :-/
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10079 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 ed04c7788b these memsets aren't needed
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10078 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 e9fc00df0c now that we have queued_animation_init, we can rewrite this properly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10077 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 551ba6ba1a ugh, neither the constructor nor the memsets are actually needed here
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10076 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 fcb31d94c1 change p_dock_function_info to a class as well
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10075 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 b7db596f12 change dock_function_info to a class
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10074 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 13513588df turn p_object into a class ensure that p_object dock instances are cleared between missions, not just when the game exits handle Player_start_pobject in a saner way the p_object Reset method is nice, but it turns out we don't need it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10060 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 6b97f368e8 sync functions for freeing dock instances
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10059 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 d310647bfe clear dock lists when objects are deleted, and redundantly clear them between missions and when object instances are destroyed (Mantis #2952)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10058 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 ed06a01897 restore r10051, this time allocating triggered_rotation instances when we need them
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10057 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 7413a7a7d2 don't unnecessarily retime collision checks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10056 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
niffiwan 0299c7e42b fix gcc warning: [-Wreorder]
‘game_snd::flags’ will be initialised after ‘uint game_snd::signature’

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10055 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
The_E c0a3d69ed2 Revert revision 10051: If we're going to use a global vector to store animation info, we need to fill it (and the references to it) too.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10054 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
niffiwan 3b89290cd8 fix gcc warning: [-Wreorder]
‘campaign::variables’ will be initialised after ‘int campaign::num_missions’

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10052 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
Goober5000 d11c7ccc2f ship subsystems should reference an index in a global Triggered_rotations vector rather than maintaining their own class object, which wastes space
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10051 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
Goober5000 afe08580c0 make cmission and campaign into full-fledged classes since they contain non-POD types remove a memset which hoses the multi campaign class
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10050 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
Goober5000 3aeee91f14 better assignment of vec3d and matrix (matrix should be set to identity, not all-0)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10049 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
Goober5000 e0fa46a185 more memset refactoring... turn texture_replace back into a POD struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10048 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
Echelon9 cc8310a491 Webui: Clarify the use of branching if statements, to be consistent with existing code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10046 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 0e34a25207 Webui: Support setting an alternative port than 8080 to host the webui on
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10045 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 d9ac71740a Webui: Support the setting of a non-default username and password in multi.cfg. These settings are +webapi_username and +webapi_password
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10044 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 8009d34928 Webui: support writing to fs2_standalone.log on Unix or Mac OS X when running a standalone server
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10043 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 07e35d7bd1 LLVM warning: Initialization of pointer of type 'bool *' to null from a constant boolean expression
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10042 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 2d9dfebae3 Re-enable -Wno-shorten-64-to-32 for Xcode. There remains code in the project, including third party, that assumes implicit 64->32 casts are permitted, which the expectation of overflow. We'll need to re-enable this warning later and revisit specific cases in question, either adding an explicit cast, or handling any cases where overflow is theoretically possible and undersired.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10041 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 93e3461748 Xcode 4/5 project file cleanup. These are redundant settings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10040 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 5c8d8f6ded Xcode 4/5 project file cleanup. Further deprecated settings related to cfilearchiver
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10039 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 fa1403f9a9 Further Xcode 4/5 project file cleanup. Install setting not required as we build an .app bundle
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10038 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 af81604303 Further cleanup Xcode 4/5 project file. Promote settings to top level where possible, remove redundant GCC settings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10037 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 eefa00cb19 Clean up Xcode4/5 project file. Remove blank overrides at the lower level of specific projects
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10036 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
niffiwan 196bfa25d3 Revert "oops - using the right pointer helps (from r10032)" (too hasty)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10035 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
niffiwan a2fe09fe6c oops - using the right pointer helps (from r10032)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10034 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
The_E 184df2fb9e Make sure is-facing does not blow up id OSWPT_TYPE_NONE is encountered
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10033 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
niffiwan 1f2005ab02 Fix mantis 2946 part C: when enabling sheields, only rebalance ETS if the shields were previously off
Also fix same issue in alter-ship-flag ( "no-shields" ... )

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10032 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Wanderer 6f3e773359 Fix for Mantis #2807 - not particularly elegant fix but enough to prevent the reported null vec issue
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10031 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Wanderer e4f63a227c Solution to issues mentioned in Mantis #2949
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10030 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
The_E 25d5cf17f0 Small performance improvement: Only call opengl_shader_t::uniforms::end() once, not every iteration.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10029 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Wanderer db183e021c Continued on Mantis #2806
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10028 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
The_E 521e31d766 ...aaand cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10027 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
The_E ec56e7771a Ooops, small buffer collision. Need to load the depth buffer to texture unit 2.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10026 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
The_E 551a539fe8 Adds depth buffer access to post processing shaders (via use of the depth_tex uniform)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10025 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Wanderer 0d4cc04cd6 Fix for Mantis #2352 - Turret reset when idle woes and other limited rotation turret woes.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10024 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
niffiwan 9525d19b89 Fix mantis 2946 part B: set defaults ets when calling shields-on
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10023 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Wanderer ca0bcd5dbf Fix for Mantis #2806 - added option to rotate the turrets according to 'initial' state animation code in the lab - option enabled by default but can be toggled via render options
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10022 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Goober5000 6836199eeb ship_subsys is now a class
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10021 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Goober5000 f883a4bc09 make script_hook behave as a POD object, and fix some parameter passing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10020 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Goober5000 90e7709da5 fix warning and mismatched line endings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10019 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Wanderer 8a8c338409 Fix for Mantis #2784
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10018 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Wanderer f571d2336f Assert to trap lua getSignature access to objects with invalid signature.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10017 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Wanderer 6cbc4f78c4 Fix to prevent invalid weapon bitmap references from being created in the lab.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10016 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
The_E e6a77d8a34 Moves game_settings.tbl parsing up a few lines so that it takes place before graphics are initialized (Necessary due to the table deciding whether to load external shaders or not)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10015 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
niffiwan 6e265e7e96 Fix mantis 2946: set ets shield index to zero when sexp shields-off is called
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10014 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Goober5000 39024965b8 promptly change the icon type when the wing checkbox is checked load icons.tbl earlier in FRED so that briefing icons work correctly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10013 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Goober5000 5d73931b6d this should now allow wing icons to be specified too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10012 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Goober5000 686088fa90 store briefing icons in a master list rather than in species_def allow ship classes to specify their own briefing icon to override normal icon
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10011 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 7e6cb331bf game_snd has a STL field, so it is properly a class and consequently species_info needs to be a class as well
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10010 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
The_E 45791f371d Make sure we only write to the event log if the buffer to do this actually exists
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10009 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
The_E b5e0647d54 Adds a check to the mn.Debris table in lua to check for invalid debris pieces
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10008 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
The_E 7b0f6b310b Make sure entries in the Debris[] array get cleared properly upon deletion
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10007 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
The_E d20df5b4c9 Adds a safety check to model_render_glow_points to stop it from blowing up when a glowpoint texture is for some reason not available
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10006 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 1ab4286a25 some calculations will be above 999999, so just do it this way; the end result doesn't matter anyway as we just need the minimum
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10005 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 80320485c1 fix some more loose ends in the revised support ship code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10004 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 f8b3d75fa4 fail
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10003 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 4bf48943d4 oh come on
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10002 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 c17fd1af7d fix somebody's spelling
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10001 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
Goober5000 6a8bc0a5ed make support ship deployment more robust, and prevent an edge case where too many support ships could be in the mission at one time
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10000 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
niffiwan f3318caef7 some updates to r9885 per discussion with Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9999 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
niffiwan fa04b7c412 Fix mantis 2905: lead sight for secondaries uses subsys distance when targeting a subsys
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9998 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
Goober5000 941fcf34ef and that shouldn't have been committed in r9995
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9997 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
Goober5000 522299eadf the game doesn't like it when you do an Assertion while it's shutting down
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9996 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
Goober5000 5aa3bddf70 change object from a struct to a class, since it contains the objsnd_num field :-/
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9995 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
niffiwan f301cefe2c redo r9978 with BUF-1 instead of x[BUF+1]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9994 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
zookeeper 3df8818635 Fixed subtle breakage I caused to surface shields in r9794.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9993 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
Goober5000 758bf662e7 valid timestamps are actually > 0
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9992 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan 629ca0cdc0 Fix mantis 2938: ship.time_first_tagged should be initialised to 0
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9989 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan aa3f9080d9 From X3N0-Life-Form: add custom sound for SSM strikes
(I updated the patch to use parse_sound instead of the missing stuff_sound)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9988 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan 617e4472a2 Remove stuff_sound declaration - was never implemented
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9987 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan 2c03139f97 Fix mantis 2889: add sexps's ets-get-value & ets-set-values
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9986 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan 797ffdf0f4 Fix mantis 2883
update hud_num_make_mono (& callers) to handle the font number
add partial support for specifying special char indexes for individual fonts

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9985 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
Goober5000 7b3a2ddeb5 Mantis #2944: add a hack to remember the color we faded out to
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9984 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
The_E 575bc3bcce From Axem: Allow secondaries to cause shudder effects through use of the Shudder flag
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9983 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:02 +10:00
niffiwan 7f7f857559 Add the Polish font01.vf checksum
Sourced from https://svn.icculus.org/freespace2/trunk

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9982 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:50 +10:00
niffiwan e39c972f3d Coverity 1112867: Buffer not null terminated
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9981 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:50 +10:00
niffiwan 24e7810b24 Coverity fixes from Flaming_Sword
Uninitialized scalar field 1093859 1093917 1093810
Out-of-bounds read/access 1093669 1093670
Logically dead code 1093413 1093396 1093407 1093408 1093409 1093410 1093423 1093427 1093390
Allocation size mismatch 1093729 1093728
Unused pointer value 1093921 1093922
Wrong sizeof argument 1093732 1093731
Operands don't affect result 1093365
Dereference after null check/return value 1093475 1093455 1093627

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9979 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:50 +10:00
niffiwan f5757f8591 Coverity 1093664: Out-of-bounds write
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9978 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 0e561c822a Coverity 1093500: Missing break in switch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9977 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
The_E a43062a426 Makes the following changes to the FRED project for MSVC2013: -Set WINVER and _WIN32_WINNT to 0x501
In combination with this download: http://go.microsoft.com/?linkid=9832071 this will enable FRED building on that compiler.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9976 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
chief1983 aaab9f2f00 Fix FreeBSD since it doesn't have libdl and doesn't need to include it to build currently. May break Solaris but it doesn't work yet anyway.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9973 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
chief1983 eb1cfc9ef7 Fix Unix building on several platforms breaking from the new WebUI standalone code. See http://www.hard-light.net/forums/index.php?topic=85859
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9972 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 5f5d13f2b6 Remove 2 unused hudbrackets functions (only with "#if 0" for now)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9971 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 93992f55ff Coverity 1093668: Out-of-bounds access in fs2netd/tcp_client.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9970 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
zookeeper 5586cd14b0 Port r9959 from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9968 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
The_E 4a422d3398 Updated for released version of VS2013. Note that FRED building is currently not supported on this platform due to MS deprecating Multibyte Charset for MFC, and haven't provided a workaround at this time.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9967 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 2615ca9ab0 Coverity 1107315: Buffer not null terminated
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9966 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 6002874610 Coverity 1107314: Buffer not null terminated
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9965 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
chief1983 b790092b50 This will actually fix the webui code to support jansson 2.2.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9964 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
chief1983 63de4932f8 Ubuntu LTS still uses jansson 2.2.1 in their repo and the code does in fact support 2.2. The libs change was definitely my fault though, I forgot all about r7939.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9963 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan df6f8b5292 And tweak it again, for some reason 2.4 != 2.4.0 :rolleyes:
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9962 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 9df9586ef0 Fix new standalone builds
Bumped jansson required version to 2.4.0 since that's the version included with our source

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9960 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
chief1983 8d371f9e94 From Eli2: WebUI-based standalone/dedicated server code for all supported non-Windows platforms. See WIP documentation at http://www.hard-light.net/wiki/index.php/FS2_WebUI_Standalone.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9957 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:48 +10:00
chief1983 22cfa72250 One more Solaris tweak. No malloc_size or malloc_usable_size on Sun kit. Still can't get it to link though.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9949 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:48 +10:00
Goober5000 c1aaefea08 patch for Mantis #2937
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9946 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
Goober5000 bce047db1e fix handling of multi-line comments, and add !* and *! as a possible option
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9945 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
zookeeper 92712f5579 Port 9940-9941 from zookeeper branch: Made the targeting box render the target relative to player's eyepoint orientation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9942 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
zookeeper 9ed68b129d Port r9936 from zookeeper branch: Fixed possible crashes related to the eyepoint orientation features.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9939 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
zookeeper 5312b47983 Typo fix.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9938 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
Goober5000 a81491161e allow setting of background and mask bitmaps for the medal case
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9935 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
zookeeper 81a40458c2 Fixed -misc maps being dependent on LOD and lighting levels.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9929 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
The_E ea6edd3f8c Catch a rare error condition where shield_hit_tri was -1 for some reason
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9927 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
niffiwan 6b3c7bd83e more fixes for wxfred all-lowercase filenames
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9926 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
Goober5000 7343c92c23 spelling
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9925 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
niffiwan 7298f50b7a From Admiral MS: Add a scripting function to check if a ship is in the field of view of a turret.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9924 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
m_m 6021fb4bea Some new scripting functions as requested by Axem: Access to the CargoSize of a weapon class Access to the AltName of a ship class Access to the actual capacity of a weapon bank Access to the callsign of a ship Access to the alternate ship type of a ship Access to the maximum velocity of a ship with respect to its engine energy level
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9923 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
niffiwan 184cda8e58 remove gcc warnings [-Wunused-but-set-variable] in ship/shiphit.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9922 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
niffiwan e725bfc7a1 remove gcc warnings [-Wshadow] in ship/shiphit.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9921 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
niffiwan af56b43beb Coverity 1093367: logical vs bitwise operator in stars_draw_background()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9920 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
Goober5000 762045168a merp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9918 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
Goober5000 73ebcda173 additional memory management improvements
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9917 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
Goober5000 2359bd5c7a more clarification of structs vs. classes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9916 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
chief1983 75148a3f76 Upgrade Xcode4 project file to...Xcode 5, turning on recommend compiler warnings. Feel free to disable them if they were off for a reason.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9915 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 a0c510e1c6 fix Mantis #2931: don't prematurely exit the model_interp_tmappoly method if we're drawing outlines
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9913 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 595a4c44c5 initialize this just to prevent loose ends
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9912 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 8dc043ae23 WMC has a screwy way of destroying his jumpnode class, so we need a screwy workaround to avoid hitting an Assert...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9911 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 22d491e50b add copy-variable-from-index and copy-variable-between-indexes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9910 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 0a7409c7a8 better ranges are also good
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9909 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 f77dd3c219 change sexp operator names for clarity, make sure mprintfs have newlines, and fix typo
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9908 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
chief1983 ae169ebb39 Add .svn folders to .gitignore.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9907 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
niffiwan 92e5d5bee3 Coverity 1093637: "fix" out of bounds read of Weapon_info[Weapons[other_obj->instance].weapon_info_index].subtype
(fix for release, at least, Assert probably handles this in debug)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9906 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:45:59 +10:00
niffiwan 01629bd946 Redo 9903 - this is a more robust solution
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9905 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:32 +10:00
niffiwan 7348b9b08d remove gcc warnings [-Wunused-but-set-variable] in network/psnet2.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9904 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:32 +10:00
niffiwan 2fe56e6780 Coverity 1093639: fix out of bounds access (ip_addr.sin_addr with proto TCP)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9903 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan e991f7b3ac remove gcc warnings [-Wshadow] in mission/missionlog.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9902 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan 14058b834d Coverity 1093641: fix out of bounds write (Log_line_timestamps[Num_log_lines])
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9901 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan a7c074e5c3 Coverity 1093645 (out of bounds read): fix 2nd case & correct previous "fix"
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9900 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Echelon9 d0d932fb43 Fix Coverity 1093773: Uninitialized scalar variable - hostaddr.sin_zero
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9899 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan a2b7935a15 remove gcc warnings [-Wunused-but-set-variable] in fs2netd/fs2netd_client.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9898 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan 02afed1d78 Coverity: more out-of-bounds fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9897 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 2f573aeb29 fix ship sounds when in observer mode (bug was introduced in revision 7923)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9896 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 26f8b5fed1 make collider_pair an actual class since its constructor is called by hash_map
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9891 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 9e8356b72c setting to 0 is better because -1 triggers an Int3() on the first swarm entry
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9890 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan e68d8097cd Fix waaay too short char * var for hostname
(this was a buffer overrun for every fs2netd game until coverity complained)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9889 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 5531c0d6b4 resolve issues with ship-templates and memcpy by deprecating ship-copy
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9888 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan 0c4c9ec9c9 Fix mantis 2906
reset stats in Pilot (i.e. .plr) on new pilot create/clone

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9887 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 3e3714fb8d fix declaration
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9886 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 0f1971c5aa change the ship struct to a class, and remove use of memcpy and memset for setting/copying the entire ship class
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9885 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 bdc0767bb0 change strcpy to strcpy_s (left over from r9832)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9884 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
Goober5000 d3e0a2b904 improved error messaging for icons.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9883 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
Echelon9 96e2f96f1a Fix Coverity 1093931 and 1093932: Missing varargs init or cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9882 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
Echelon9 4d63d6ea05 Fix Coverity 1093734: Copy into fixed size buffer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9881 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
z64555 ee1711ed0b Fixed spelling error with 2 filenames. Updated MSVC project and filters to reflect previous changes with filenames.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9880 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan b26ec341bd Coverity: more out-of-bounds errors (& fix mistakes in previous "fixes")
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9879 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan 1861195702 add .gitignore file :D
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9878 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan 576baed1d3 add Coverity modeling file
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9877 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan 019c18fab4 Coverity: fix some out-of-bounds access/read/write issues
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9876 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan d7cc54b324 Change Assert -> Assertion (plus removed some trailing whitespace)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9875 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan 910d4bd293 Coverity: fix some out-of-bounds access issues
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9874 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan 5f0351c72b Coverity: buffer not null terminated issues
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9873 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
niffiwan 7e1ad3dd5b Coverity: potential array out of bounds read in ade_set_object_with_breed
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9872 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
niffiwan a02b97b25a remove GCC warnings in lua.cpp [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9871 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
z64555 f44356a4c5 Looks like I missed 2 files for renaming.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9870 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
z64555 63df481478 Compliance modifications. EOL to Unix style (LF only), files renamed to only lowercase
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9869 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
zookeeper f1d0d36647 Port r9734 from zookeeper branch: Added scripting function to enable/disable tips of the day in mainhall.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9868 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
zookeeper 40af858593 Port r9823 from zookeeper branch: Added an option to make pitch and yaw axes be determined by eyepoint orientation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9867 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
zookeeper ad1c2f0ecd Port r9738 from zookeeper branch: Forgot this from r9728; makes changing eyepoint orientation affect chase view as well.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9866 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
zookeeper e8a15e7b22 Port r9728 from zookeeper branch: Made eyepoints match the orientation of their parent submodel.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9865 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
zookeeper f164e30b0b Port r9725 from zookeeper branch: Added a Lua function for drawing offscreen indicators. Includes refactoring of some of HudGaugeOffscreen gauge code to separate the position finding and drawing logic.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9864 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
niffiwan a2ac3497b8 (redo 9781) remove GCC warnings in sexp.cpp [-Wunused-but-set-variable]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9863 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
niffiwan 5135771062 Update ChangeLog, 1st time since 2002...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9862 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
CommanderDJ 5022356faa Fix a couple of typos.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9861 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
Goober5000 55c2f4b156 well crap, looks like I broke XSTR in r9809
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9859 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
niffiwan 7adf66330d Coverity CID 1093820: read of uninitialised var in beam_render_muzzle_glow(beam *b)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9858 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:23 +10:00
niffiwan 8b78abd7a6 Coverity CID 1093930: read from pointer after free in GUIScreen::Add(GUIObject* new_gauge)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9857 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:23 +10:00
niffiwan 5ec75bdd06 Coverity CID 1093821: use of an uninitialised variable in ship_select_blit_ship_info()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9856 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:23 +10:00
z64555 79415c262a Fixes mantis 2925 and 2926. Errors with declaring wxFlexGridSizer item sizes in wxFormBuilder.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9855 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:23 +10:00
Goober5000 3e4eca4104 reintegrate Goober5000 branch into trunk: adds STLport support and fixes MSVC6 compatibility with SCP_hash_map (part 2)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9854 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:23 +10:00
Goober5000 82fbd9a7c1 reintegrate Goober5000 branch into trunk: adds STLport support and fixes MSVC6 compatibility with SCP_hash_map (part 1)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9853 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
Goober5000 67b171612d proper class/struct distinction and use of vector over list are A-1 SUPAR
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9851 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
Goober5000 69e1d4e36b the adjustment should be fixed this way, since most people don't count from 0 to n-1
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9846 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
The_E 52381d05db Small adjustment to the error message here to minimize confusion
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9844 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
The_E 16e60920cf Changes an Assert to an Assertion in order to provide better feedback in case stuff_int_list fails due to too many entries in the passed list of integers
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9843 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
niffiwan 62d06cfcd9 Coverity multiple CID: fix potential not null terminated strings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9842 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
niffiwan ece9b2034b Coverity CID 1093804: init member raw8 of color struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9841 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:21 +10:00
niffiwan 05a298c68d Coverity CID 1099443: fix out of bounds access
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9840 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:24 +10:00
Goober5000 8a72823839 turn hud_anim back into an actual struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9834 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
Goober5000 c7f6394d6c polymodel code now has basic class management in place and no longer uses memset
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9833 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
Goober5000 8e096f5c15 remove bad use of memcpy by assigning player class using an actual assign() method (part 2)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9832 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
Goober5000 52edd5b112 remove bad use of memcpy by assigning player class using an actual assign() method
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9831 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
Goober5000 52e9c4a8e0 allow fade-in and fade-out with any color, not just black, white, and red
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9830 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
z64555 5c0a97db80 Allows compiling of wxFred2 on *Nix machines. Includes niffiwan's autocools, fixes some referencing issues with button graphics, and includes graphics for the program and application icons.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9829 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
niffiwan cebded3acb Tweak autotools compilation
Add -pipe to potentially speed up compiles
Change -mtune to generic to clarify intent
(people compiling executables for their own use (i.e. not for distribution)
should set CXXFLAGS="-march=native" before running autogen.sh)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9824 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:36 +10:00
Goober5000 7e5b2aee52 turn mc_info into a plain data struct, part 2
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9822 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:36 +10:00
Goober5000 4a9d457154 turn mc_info back into a plain data struct, part 1
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9821 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 c46c0d1412 derp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9820 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 444d4b801a make engine_wash_info a struct again
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9819 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 2ee1b24b65 queued_animation uses a mess of memcpy and memset, so make sure it's a plain struct!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9818 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 fe934190ac clarify that some structs should now be treated as classes change shockwave_create_info back to being a struct fix some missing shockwave_create_info initialization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9817 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 b4cc5d72f4 use an index rather than an iterator into the waypoint list so that ai_info is again a plain old data object
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9816 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Echelon9 e7cbe63a08 Resovle a few const char build errors for non-Windows platforms
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9815 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 f0830b6d64 scoring_level_init is only supposed to initialize a subset of the stats
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9814 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 7248acc004 use a copy method rather than memcpy to clone stats (Mantis #2922)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9813 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Swifty 4a1e2cb4c5 From Kobrar: Make sure we normalize when normal mapping is off.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9812 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
Goober5000 fc191a40f2 whoops
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9811 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
Goober5000 97e18cd758 various fixes for pilotfile stats
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9810 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
Goober5000 4bd10888ff make localization more robust with additional checks on string length, more consting, and stronger typing and make XSTR const, since we don't want to modify the strings it translates and then CONST ALL THE THINGS
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9809 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
chief1983 d8e4b8de55 Add profiling.cpp to the Makefile.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9808 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
chief1983 d1ac95963f Add profiling file to Xcode projects, and remove the wxfred2 files from their code.lib targets.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9807 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
The_E e2281c39cb Adds Swifty's frame profiling code. In order to activate it, use the -profile_frame_time commandline parameter. ATTENTION PLATFORM MAINTAINERS:
This adds a new file to the source tree named profiling.cpp, add this to the respective project files (I've already done it for the various MSVS projects)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9806 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:33 +10:00
Goober5000 2e779e8bef MOAR const!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9805 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:33 +10:00
Goober5000 38ae06e97d derp... apply consting to FRED
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9804 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:33 +10:00
The_E 3f6f498340 Fix a function call that got broken in all the consting.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9803 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:33 +10:00
Goober5000 8cf10e86f8 remove Bobboau's "better error messages" which were never fully implemented and are more distracting than helpful
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9802 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:46:41 +10:00
Goober5000 886018d28f here a const, there a const, everywhere a const const
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9801 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:46:41 +10:00
Goober5000 0dfcea3b22 make MAX_MEDALS dynamic (missed a file)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9800 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:27:08 +10:00
Goober5000 7f90f5c674 make MAX_MEDALS dynamic
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9799 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:27:03 +10:00
Goober5000 fcf6d56774 fix tech-add-intel-xstr to actually localize from tstrings.tbl (Mantis #2919)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9798 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
Goober5000 ebe1043a13 add tech-add-intel-xstr, and modify intel_info_lookup to properly translate intel entries (fixes Mantis #2919)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9797 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
chief1983 cc0caf5e55 The last remaining code change (I think) blocking Solaris compatibility.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9796 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
The_E c0919e0777 Admiral MS' AI flag to enable the AI to be smarter when using afterburners. flag name is "free-afterburner-use". See http://www.hard-light.net/forums/index.php?topic=83818.0 for reference
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9795 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
zookeeper d993c3e1f5 Merge auto spread shields from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9794 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
zookeeper 46ad62f831 Clarified a warning about missing glowpoint textures.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9791 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
Goober5000 b3798527a0 allow medals.tbl to specify images for debriefing views of medals, not just medal case views
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9789 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:18 +10:00
The_E 81c5c06218 Experimental Configurations to make AVX builds
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9788 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:18 +10:00
Goober5000 6d6c82c652 make localization names consistent, and move medal localization into localize.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9787 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:33 +10:00
niffiwan e19e9d1afd Allow the use of __attribute__ (GCC specific syntax) In particular, __attribute__((__unused__)) to shush compiler warning -Wunused-but-set-variable
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9786 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:33 +10:00
z64555 32bd62bc18 wxFred2: whoops, forgot some resource files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9785 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:32 +10:00
z64555 ec02c3c972 wxFred progress: GUI elements designed, organized code/wxfred2, work begun on main fred viewport.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9784 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:32 +10:00
Goober5000 138e6b853f yeesh... a veritable cascade of const-correctness
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9783 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:32 +10:00
chief1983 0a1379159d Revert r9781 until it can be implemented without breaking MSVC.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9782 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:32 +10:00
niffiwan 809ee2483d remove GCC warnings in sexp.cpp [-Wunused-but-set-variable]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9781 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:32 +10:00
niffiwan 9a602777bd Fix mantis 2911: stop (de)activate-glow-point-bank sexp from processing the 1st arg twice
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9780 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
The_E 41af7e5ec0 Project files vor MSVS 2013. Please note that in order to build FRED, you need to install the Multibyte MFC library from http://www.microsoft.com/en-us/download/confirmation.aspx?id=39309
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9779 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
niffiwan 5a6493fa62 remove GCC warnings in sexp.cpp [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9778 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
zookeeper 143463b478 Port r9723 from zookeeper branch to trunk: Made is-facing able to check for target objects other than ships.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9777 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
zookeeper f98030b122 Port r9705 from zookeeper branch to trunk: Exposed a ship's autoaim FOV to Lua and allowed $Autoaim FOV to take floats rather than just ints.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9776 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
zookeeper fd21b9054b Port r9701 from zookeeper branch to trunk: Added a Lua function to check whether a ship is warp-capable.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9775 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 d5f03daa6b spelling, hehe
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9774 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 96587dd2ab allow specification of medal, callsign, and label coordinates
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9773 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 0debee3c51 pretty sure this needs to be 0, per line 325
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9772 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 3550b720cb remove requirement that game_settings.tbl should specify a campaign filename with an extension
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9771 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 42d096a3c2 allow a user-specified number of credit images
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9770 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 a921665872 add missing newline
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9769 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 52413c944f what's this? a Volition bug?
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9768 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:30 +10:00
karajorma 602e608065 Fix Mantis 2883 (All the 1's have vanished since r9761)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9767 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:30 +10:00
The_E 06900df8df As requested by Axem, adds "player-is-cheating" sexp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9766 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
chief1983 6c88f96cc0 Bump version to 3.7.1 for nightlies.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9765 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
niffiwan 7fad36e90c Fix for mantis 2907: In red alert missions that skip briefings, use the red alert "continue" button, not the ship/weapon select "commit" button.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9764 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
niffiwan 3d1edee29a Fix for mantis 2878: LUA playMusic uses players music volume, not the requested volume
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9763 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
karajorma 0b0b3fdf70 Allow event.log to snapshot all events that are checked this frame. Allow event.log to record the status of the event the previous time it was checked in addition to its status this frame.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9762 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
karajorma 2691085f9f Add support for other languages beyond French, German and Polish. Any non-unicode language should work now.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9761 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
karajorma 800602701a Add alter-ship-flag support for several more flags
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9760 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
karajorma 18ca1c08db Add the toggle-subsystem-scanning option to the alter-ship-flag SEXP
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9759 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
Goober5000 8f7320119e show-subtitle-text will now display subtitles from a message
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9758 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
Goober5000 d7fc8372aa Number 3 from Axem's "A triplet of small patches", http://www.hard-light.net/forums/index.php?topic=82749.0
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9757 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
karajorma f38b90f431 Fix Mantis Mantis 2913 (Time Compression SEXPs do not work in multiplayer)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9756 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
karajorma c251c031f0 Fix Mantis 2903 (Spinners in the Object Editor point in the wrong direction).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9753 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
The_E 7b53a46e88 From m|m: Fix for Mantis 2914 (AmmoLeft and AmmoMax return strange things in scripting)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9752 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
chief1983 5b7c056cb1 Revert 9749 until after 3.7.0.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9751 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
karajorma 53d0129e8f Fix Mantis 2912 (Hud-set-max-targeting-range doesn't work on multiplayer clients).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9750 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
The_E 6524a2140f As requested by Aesaar, raise the per-model debris limit to 48 (previously 32). Also increases the per-frame debris limit to 96 (previously 64)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9749 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
z64555 134b0dd757 fix for mantis 2874: Pilot conversion not preserving axis mappings. Also adds a warning that is activated whenever the pilot loading process has to skip bytes of "extra/unknown data" in a section.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9748 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
niffiwan 315373e952 Fix mantis 2908: finally get "richer" pilot conversion exceptions data working correctly THANK YOU Tony D @stackoverflow! http://stackoverflow.com/questions/6248404/c-exceptions-is-throwing-c-string-as-an-exception-bad
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9747 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
niffiwan 99ef01ff6d Fix 3 for 2901: remove long/short read warning by making mainhall(csg flags), cutscenes(csg flags) & is_multi(plr flags) consistent between pilot conversion and normal save/loads
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9746 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
niffiwan d619d86976 Fix 2 for mantis 2901: 7 weapon slots (not 12) for pilot conversions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9745 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
niffiwan d60a930dc2 2808 accidentally clobbered 2810: change 3.6.18 last played pilot name before loading the pilot for the 1st time
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9744 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
The_E 4eb1787e4e Fix for Mantis 2898: Reverting r8627 to reinstate -img2dds
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9742 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
Echelon9 0f7d8ec579 Fix Mantis 2847: Assert: (team != -1) -- due to aicode issues tracking destroyed weapons
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9741 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
niffiwan 878a7a1921 Fix for mantis 2904: redalert wingmen without RA data are treated as destroyed
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9740 387891d4-d844-0410-90c0-e4c51a9137d3
2013-08-06 22:55:15 +10:00
niffiwan 12de1de128 Fix MSVC warning (int to char conversion): thanks to zookeeper for noticing this
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9739 387891d4-d844-0410-90c0-e4c51a9137d3
2013-08-06 22:55:15 +10:00
zookeeper cf4fa30f0f Fixed bug in RotationalVelocityDesired documentation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9737 387891d4-d844-0410-90c0-e4c51a9137d3
2013-08-06 22:55:14 +10:00
Echelon9 fb33fe020b Resolve a series of Xcode (LLVM compiler) warnings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9735 387891d4-d844-0410-90c0-e4c51a9137d3
2013-08-06 22:55:14 +10:00
niffiwan 59762a4db7 add some red alert doco
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9733 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:31 +10:00
niffiwan d4d10dedd9 add more data to pilot (csg) conversion error messages
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9732 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:31 +10:00
Echelon9 e776f8e5dd Fix issue where switch statement would fall through for TS_MOVE_PLAYER, which would then not get pushed to other hosts
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9731 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
niffiwan f8a74ae5c9 Partial fix for 2901: pilot conversion needs to read the ubyte mainhall from <= 3.6.18
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9730 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
m_m f410440604 Fix for Mantis 2884: Team colors not displayed on player ship.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9720 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
The_E bccd0533bd Removes a console command that basically amounted to being a more elaborate way of causing an Int3()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9719 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
The_E c6397750e0 Fix for Mantis 2861: Make sure we switch off shader-based effect rendering if the GPU can't handle it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9718 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 f5f42f65fa this is required for strict const-correctness
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9715 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 ce118c232c add a missing #include
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9714 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 509f509347 MSVC6 compatibility
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9710 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 bda6c72d31 remove an unused function, per Echelon9's detective work (Mantis #2900)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9709 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 b5f278c91c a modified version of Echelon9's fix for Mantis #2897 (heap corruption due to object indexes being too large for the object dock bitstring)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9708 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Echelon9 17c7d0be26 Documentation cleanup of object.cpp pursuant to Mantis 2897 bug-hunting.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9706 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
niffiwan aa22aca144 Fix for mantis 2503: clear red alert wingman data before loading new wingman data 2013-01-20 10:01:51 +00:00
The_E e0bb90040f change build output names to "fs2_open_3_6_17" instead of "*_17r" 2013-01-15 19:31:41 +00:00
niffiwan cae43dce4f related to mantis 2503: added assertion to detect crazy amounts of red alert wingman when writing .csg
player may lose one mission worth of progress, but shouldn't lose their campaign
2013-01-12 09:52:10 +00:00
chief1983 165eef24e2 Trunk sync r9495. 2013-01-10 05:28:17 +00:00
Zacam b999937222 Trunk Sync: r9480 2013-01-04 21:44:14 +00:00
niffiwan 216759ab3a autotools: exclude lua5.2 because it's not (yet) compatible with FSO
(backported from trunk so current BP AoA release has less issues on Linux)
2012-12-31 09:39:47 +00:00
chief1983 6954e5f615 Someone goofed a build output filename. 2012-12-30 21:30:55 +00:00
The_E 896c9eef86 Gaaah, forgot syntax 2012-12-30 09:27:55 +00:00
The_E 43857b0032 From Eli2: Lower the value of MAX_SHIPS_PER_PACKET to 64 in order to keep packet size down 2012-12-30 09:27:17 +00:00
Zacam 0437b5f229 Trunk Sync: r9464
Fixes Mantis 2432: Changing Sound in as a MULTI pilot does NOT save; from Eli2
2012-12-26 19:49:19 +00:00
chief1983 31f014ed5c Trunk sync r9456 2012-12-21 21:02:47 +00:00
Valathil 501d62db8b From Eli2: Replaced memset of player struct with reset(). Fixes random multi crashes. 2012-12-15 18:31:58 +00:00
The_E 6b07c37a63 Trunk sync r9435 2012-12-15 15:40:58 +00:00
Zacam ef048c5af2 Trunk Sync: r9425 2012-12-13 08:54:32 +00:00
Zacam d0e450cfd1 Trunk Sync: r9418 2012-12-09 23:16:22 +00:00
Zacam 55bf45393e Trunk Sync: r9408 2012-12-09 00:48:01 +00:00
Zacam ee28362f42 Trunk Sync: r9389 2012-12-03 01:06:58 +00:00
Zacam 3fdae2e3c1 Trunk Sync: r9386 2012-12-02 02:24:53 +00:00
The_E 0c222afeb0 Trunk sync r9353 2012-11-18 12:34:24 +00:00
Zacam dc82a0c7f8 Trunk Sync: r9351
You may see other sync's, but none have taken place during a live Feed Dump on Desert Bus!
2012-11-17 23:47:11 +00:00
Zacam 0d518330df Correct and update all MSVC build output names. 2012-11-11 01:45:55 +00:00
Zacam ba68ceca3f Trunk Sync: r9326 and set revision properties to this commit, tagged as 3.6.17 to eliminate any later fiddling or missing it for merge to Trunk. 2012-11-11 00:50:47 +00:00
chief1983 bd96b1a71f Somehow these lines got added in by accident. 2012-11-05 01:43:16 +00:00
Zacam 808fc0f8e7 Add XCode 4 Project for Antipodes 2012-11-04 10:06:00 +00:00
chief1983 73ab64e3da Trunk sync r9300 (last was actually synced with 9284, skipped 9296 since we don't have an Xcode4 project in Antipodes yet). 2012-11-02 20:28:04 +00:00
The_E e2fb98b862 Trunk sync r9275 2012-10-27 14:25:44 +00:00
The_E ce05f3a88a Trunk sync r9274 2012-10-21 07:58:11 +00:00
The_E 3ed94d11f9 Trunk sync r9230 2012-09-29 11:46:20 +00:00
The_E 1d75b96d5c Trunk sync r9215 2012-09-20 16:34:15 +00:00
Zacam c9a1d1869c Trunk Sync: r9195-9199 2012-09-13 17:21:17 +00:00
chief1983 ac44f7c59d Trunk Sync: r9193 2012-09-13 15:14:56 +00:00
chief1983 9091cb6531 Fix antipodes compiling on Linux. 2012-08-31 19:03:55 +00:00
chief1983 10eb2def8a Trunk Sync: r9149 2012-08-29 18:00:11 +00:00
Zacam 2b4479d853 XCode clean up for ltests.c 2012-08-23 15:36:42 +00:00
Zacam 362c8e4169 Trunk Sync: r9134 2012-08-22 21:44:43 +00:00
The_E 05d5744477 TRunk sync r9104 2012-08-12 07:44:05 +00:00
The_E 79b714ea12 Trunk sync r9092 2012-08-04 06:27:35 +00:00
The_E 1a4fd2f7dd Backport of trunk 9091 2012-08-04 06:21:36 +00:00
The_E b6bdffd23a Trunk sync r9082 2012-08-01 16:43:44 +00:00
The_E 49ba4f86ff Oops, the mainhall is inited differently now 2012-07-29 12:24:41 +00:00
The_E 1640d066a1 Trunk sync r9064 2012-07-29 11:40:49 +00:00
The_E 2c729eee15 Trunk sync r9057 2012-07-28 21:09:28 +00:00
The_E 68be57e92b Trunk sync r9031 2012-07-22 11:41:28 +00:00
The_E 8c8302a064 Trunk sync r9006 2012-07-11 17:25:38 +00:00
Zacam 2eb9357312 Trunk Sync r8980 2012-07-04 05:13:33 +00:00
CommanderDJ edcdfacdc9 Trunk sync r8915 2012-06-27 05:34:53 +00:00
The_E 43c83bf2fd Trunk sync r8906 2012-06-24 14:43:38 +00:00
The_E 444fccf77a Make sure we actually have a valid campaign file before trying to do stuff with invalid pointers 2012-06-24 14:36:04 +00:00
Zacam 5dc5f82e43 Trunk Sync r8897 2012-06-18 00:44:03 +00:00
CommanderDJ 35da255b8d Trunk sync r8874. 2012-06-12 07:57:20 +00:00
Zacam 592ad34c4e Trunk Sync r8845 2012-06-06 13:59:44 +00:00
CommanderDJ 8a430d927a Trunk sync r8830. 2012-05-28 12:23:16 +00:00
The_E 2d60cabe4a Trunk sync r8813 2012-05-22 10:39:23 +00:00
Zacam 58afb0a3da Trunk Sync: r8807 2012-05-20 22:48:54 +00:00
CommanderDJ 9abcb1e43c Trunk sync r8799 2012-05-20 03:13:27 +00:00
The_E a60c8f52db trunk sync r8786 2012-05-15 11:34:21 +00:00
CommanderDJ 3da8762458 Trunk rev 8773: supernova-stop sexp. 2012-05-11 17:16:19 +00:00
CommanderDJ 1d30cfd0bb Trunk rev 8768: Patch for Mantis 2650 (Allow 0 door animations in mainhall.tbls/tbms) 2012-05-11 17:06:33 +00:00
CommanderDJ 69d7a29820 Trunk sync 8775 2012-05-11 17:02:01 +00:00
The_E cc7a648fac Trunk sync r8766 2012-05-10 10:03:39 +00:00
The_E 4bd9093125 Trunk sync r8753 2012-05-05 14:09:52 +00:00
The_E 05283a3cfa Trunk sync r8742 2012-05-03 08:26:41 +00:00
The_E eee0c96fc1 Trunk sync r8696 2012-04-30 14:57:21 +00:00
The_E 45bd1d1d99 Trunk sync r8679 2012-04-15 11:41:31 +00:00
The_E 3f364d8718 trunk sync r8644 2012-04-01 16:21:23 +00:00
The_E 49819d2f4f Remove two unused function stubs 2012-03-31 14:29:38 +00:00
Zacam 866d4b7efb Trunk Sync r8631 2012-03-31 03:23:53 +00:00
Zacam 81973b528c Trunk Sync r8625 2012-03-25 19:44:25 +00:00
The_E fcbc4362b9 TRunk sync r8615 2012-03-15 12:11:58 +00:00
The_E 8891ccb74f Update to include mod_table stuff 2012-03-15 10:09:45 +00:00
chief1983 50c090b724 Trunk sync: r8603 (skip 8606, already handled by hand) 2012-03-09 18:34:29 +00:00
chief1983 1a52d39763 Keep that from happening again. 2012-03-09 18:29:43 +00:00
chief1983 4f6972468e How did these line endings get so jacked up? 2012-03-09 18:25:48 +00:00
The_E b44c33abc5 Trunk sync r8587 2012-03-06 12:30:49 +00:00
chief1983 c505fed7c0 Trunk sync: r8577 2012-03-05 20:36:27 +00:00
The_E af9261af10 Trunk sync r8575 2012-03-05 11:53:22 +00:00
The_E f3e4e78f02 oops, missed this one 2012-03-02 18:12:37 +00:00
The_E 02d8bd64c4 Trunk sync r8545 2012-03-02 16:05:44 +00:00
chief1983 b7716621a8 Trunk sync: r8523-8526 2012-02-23 19:01:29 +00:00
Zacam c7b77c2974 Fix for Mantis 2609: Resolves segmentation fault under linux caused by memsets clobbering the pointer that SCP_string used to check its length before assignment. 2012-02-21 15:20:15 +00:00
The_E f02c973621 From eli2: Patch for Mantis 2608 (Adds "$Always Viewable:" setting to cutscenes.tbl) 2012-02-20 14:53:30 +00:00
Zacam 37f0cf8b0d Trunk Sync: r8519 2012-02-19 19:16:06 +00:00
Zacam a068ae82f2 From Eli2: Corrects some issues with the last changes to the Main Hall code to allow compilation under linux. 2012-02-19 05:23:23 +00:00
The_E 4b013ac6ab Trunk sync r8515 2012-02-18 11:56:09 +00:00
Zacam 4e03a83484 Trunk Sync: r8512 2012-02-16 13:04:37 +00:00
Zacam 7506ed7941 Trunk Sync r8506. 8505 skipped as it is only Pilot Specific to Trunk, not needed for AP or would need factoring specifically to AP. 2012-02-15 08:03:56 +00:00
Zacam db52add4f8 Reported by ni1s: GCC complaint about missing .c_str() in the updated dynamic MAX_SHIELD_ICON dynamic change. 2012-02-15 07:58:46 +00:00
Zacam b27faceb28 Trunk Sync: r8465 2012-02-12 23:10:38 +00:00
Zacam 3b30274a75 Not only did rev 8439 not do what it was supposed to, it also broke subsystem scanning 2012-02-11 13:40:45 +00:00
Zacam 35e8ea59b0 Anomalous whitespace/tab and alignment cleanup. 2012-02-11 01:42:28 +00:00
Zacam 0f5843860b From CommanderDJ: The Pièce de résistance, MainHall.tbl is now modular. 2012-02-11 01:36:21 +00:00
Zacam 55996169ff Trunk Sync: r8456-8459 2012-02-10 19:05:36 +00:00
Zacam a74531eed3 Trunk Sync: r8452, r8454 2012-02-09 14:48:18 +00:00
Zacam 3a62c1bb23 From CommanderDJ:
Introduces +Name identifiers for mainhall.tbl entries:
-	+Name identifiers only need to be added to the lo-res (640x480) entry of the mainhall. If you really must add a +Name to both res versions, the two resolutions must have the exact same name.
-	+Name identifiers are added immediately under the $Main Hall string
Vectorises Main_hall_defines, thus removing the MAIN_HALLS_MAX limit.
Main halls are now loaded based purely on campaign files. Hall indexes are no longer stored in the player struct, and thus this patch changes the pilot file version.
2012-02-09 12:56:10 +00:00
Zacam 971c69a06e Trunk Sync: r8449-8450 2012-02-09 03:53:54 +00:00
chief1983 2aa9001450 Trunk Sync: r8446, r8447 2012-02-07 22:12:48 +00:00
The_E ebfeb106e9 Trunk sync r8441-8444 2012-02-06 12:57:58 +00:00
Zacam 1021553630 Trunk Sync: r8436-8439 2012-02-04 23:02:23 +00:00
Zacam 6ce90694c7 Trunk Sync: r8434 2012-02-04 19:37:38 +00:00
Zacam e2ea4f01e1 Trunk Sync: r8428-8432
r8427 not needed in Antipodes due to changes in Pilot data.
2012-02-04 17:36:23 +00:00
Zacam 2b0c9c20b7 Trunk Sync: r8423, r8424 2012-02-03 15:41:02 +00:00
Zacam dc01c779b3 Trunk Sync: r8417-8420 2012-02-02 00:44:02 +00:00
Zacam 46214abe92 Fix for the Fix for Mantis #2374: Had only updated the Effect 2 portion of the missionscreencommon. Don't I feel silly now. Did a little housekeeping while at it. 2012-02-01 17:31:19 +00:00
Zacam 016e024844 Trunk Sync: r8412-8414 2012-02-01 14:14:40 +00:00
Zacam feba1296d8 Trunk Sync: r8406-8410 2012-01-30 18:27:55 +00:00
Zacam 5c9e256e23 Slight touch up to Trunk Commit 8401: (! switch to !( to resolve a C4806 warning in MSVC. 2012-01-29 17:38:50 +00:00
Zacam 2191b124fe Trunk Sync: r8387-8403 2012-01-29 17:20:25 +00:00
The_E cb243c3f5c trunk sync r8382 - 8385 2012-01-28 17:45:57 +00:00
Zacam bd27ee5e81 Fix to Trunk r8379, for want of a ; a compile was lost. 2012-01-28 07:07:07 +00:00
Zacam ca926da3f3 Trunk Sync: r8373, r8376-8379 2012-01-28 06:53:43 +00:00
chief1983 b6e8dc552b Trunk Sync: 8368-8369 2012-01-24 18:40:54 +00:00
Zacam b925d70617 Trunk Sync: 8341. 8344. 8350. 8361-8363 2012-01-24 03:58:22 +00:00
chief1983 4cff0a9b3c Trunk Sync: r8239 2012-01-23 03:19:09 +00:00
chief1983 05792b8029 Trunk Sync: r8326-8327 2012-01-23 01:36:02 +00:00
chief1983 09d1ae2e56 Trunk sync: r8310 2012-01-22 21:42:14 +00:00
Zacam 2a641ffff7 Trunk Sync: r8304-8308 2012-01-22 12:15:42 +00:00
Zacam 45d55d5c75 Trunk Sync: r8297-8302 2012-01-22 07:52:20 +00:00
Zacam 4236636365 Trunk Sync: r8287, r8291-8295 2012-01-22 02:09:35 +00:00
The_E b7db6702dc TRunk sync r8270-8286, 8289 2012-01-21 12:12:25 +00:00
Zacam 0ff43753cf Trunk Sync: r8265-8267 2012-01-20 02:26:25 +00:00
The_E d02a86a86b Trunk sync revisions 8258, 8260-8263 2012-01-19 14:45:47 +00:00
Zacam be8e7478a7 Copy of Trunk 8256 2012-01-17 00:19:45 +00:00
chief1983 a57c66bdf3 Trunk sync: r8234-8254 2012-01-16 01:54:01 +00:00
Zacam e8da8b037c Trunk Sync: r8230-8233 2012-01-15 19:28:50 +00:00
Zacam 1af3bc902b Trunk Sync: r8227, r8228 2012-01-15 11:23:20 +00:00
Zacam cb2e53c6c0 Trunk Sync: r8222-8225 2012-01-15 08:31:47 +00:00
Zacam c33bf8d031 Trunk Sync: r8218-8220 2012-01-15 06:05:06 +00:00
Zacam cba78496b6 Trunk Sync: r8214-8216 2012-01-14 19:45:44 +00:00
Zacam e75c12920b Trunk Sync: r8207-8212 2012-01-14 02:35:17 +00:00
Zacam 3cbdb1d799 Okay. This was ridiculous running all these changes separately. This setts svn:eol-type across the board for types that were not previously set to LF as they should have been. 2012-01-13 18:44:18 +00:00
Zacam 16e4c568fe Meh. Let's do this right. svn:eol-type set to LF for all of these as well. *sighs* 2012-01-13 18:35:09 +00:00
Zacam 064fcd6b04 Set svn:eol-type to LF for these as well. 2012-01-13 18:29:34 +00:00
Zacam 368004ca20 Set svn:eol-style to LF for files. 2012-01-13 18:26:33 +00:00
Zacam aacaf1944b Trunk 8199: Various scripting patches from m!m:
--Eyepoint access to the model handle
--getCollisionDistance() to the collision info handle to get the precomputed distance to the hit point
--A Disabled variable for the ship handle
--getTimeUntilExplosion() for the ship handle to get the time until the ship finally explodes
--A change to the documentation of ad.play3DSound() to reflect that the function also takes position parameters
2012-01-13 17:53:56 +00:00
Zacam 1cd25cc0fb Synchronization of differences between Antipodes and Trunk. Cause unknown, just commit drift issues. Regular auditing will catch these faster, but people need to pay more attention when syncing Trunk changes over to Antipodes. 2012-01-13 17:49:57 +00:00
Zacam e157e27045 Wrong EOLs. 2012-01-13 17:46:33 +00:00
Zacam 7aa0e3732a Wrong EOL 2012-01-13 17:21:46 +00:00
chief1983 688ed8833a Trunk sync r8195 2012-01-13 16:49:15 +00:00
chief1983 ed2d5e0f76 Trunk sync r8164 2012-01-11 18:03:01 +00:00
The_E 5aa47d9169 Fix compilation for MacOS 2012-01-11 17:39:03 +00:00
The_E f95b58ec26 Backport trunk r8152 2012-01-06 01:04:37 +00:00
The_E a0a2efba63 And 8114 to 8116 2012-01-05 23:15:10 +00:00
The_E 4da4d0f682 Trun 8117 - 8120 need to be here as well 2012-01-05 22:57:00 +00:00
The_E 9f209d5d5d Trunk sync r8131 2012-01-05 22:49:11 +00:00
karajorma 6f2b86d7f2 Remove a magic number. This number will probably become something defined in mod.tbl eventually but for now at least it's easy to find again. 2011-12-31 06:39:35 +00:00
karajorma da1a3bcb7a Training weapons shouldn't cause smoke to come off of ships which haven't really taken any damage. 2011-12-31 06:24:36 +00:00
karajorma cf2cac5796 Switch from the directive-is-variable SEXP to the more powerful directive-value one. 2011-12-31 06:20:10 +00:00
The_E 8e06b279f9 Trunk sync r8112 2011-12-24 16:22:50 +00:00
Zacam 832999fbbd Trunk Sync r8104 2011-12-21 08:52:59 +00:00
The_E fddb57820e And this too? 2011-12-13 17:27:21 +00:00
The_E 340c28f3b0 Hmm, how did this get missed? 2011-12-13 17:18:25 +00:00
The_E ffc14f5d9e Trunk sync r8082 2011-12-13 16:23:01 +00:00
The_E 3c38ce4737 Trunk sync r 8066 2011-12-04 17:42:52 +00:00
Goober5000 06d3ba08be assigning an empty string is functionally equivalent to clearing the string, and is also compatible with MSVC6 2011-11-23 05:30:00 +00:00
Zacam 165c451719 Fix to Trunk Sync of 7971, when adding more lines to an if, braces are your friend. 2011-11-23 05:16:24 +00:00
Zacam 3966ab46d0 Trunk Sync r8044 (some fixes for MSVC 6 from Goober) 2011-11-23 04:50:57 +00:00
Zacam 7eb3b95751 Trunk Sync r8028 2011-11-23 01:23:54 +00:00
Zacam 6e648f5205 Trunk Sync r8013 2011-11-19 16:32:50 +00:00
niffiwan dee12f104f Fix for pilotfile conversion - convert non INF campaign files correctly 2011-11-17 01:52:33 +00:00
niffiwan 2a3b3cc958 PLR conversion: read two more values from .pl2 files 2011-11-17 01:52:26 +00:00
niffiwan ccaaff35c6 Fix incorrect string sizes used with cfread_string_len 2011-11-17 01:52:19 +00:00
The_E 465b3296ae Trunk sync r7997 2011-11-16 18:16:55 +00:00
Zacam 9f8c2061c8 Trunk Sync r7986 2011-11-13 10:15:32 +00:00
Zacam 9b8a667728 Trunk Sync r7974 2011-11-12 06:47:54 +00:00
Zacam 64acadfbb9 Trunk Sync r7969 2011-11-10 12:01:34 +00:00
Zacam aba7c37634 Trunk Sync r7960 2011-11-08 04:53:02 +00:00
Zacam 46ff890305 Trunk Sync r7952 2011-11-06 04:33:41 +00:00
Zacam f64c5ea811 Trunk Sync r7946 2011-11-05 09:36:17 +00:00
niffiwan 30c7a9971b Backport of Trunk r7939: : Fix our linking order to work with --as-needed 2011-11-05 02:35:00 +00:00
The_E 4afaa1449d Trunk sync r7942 2011-11-03 15:21:08 +00:00
Zacam 657182c001 Trunk Sync r7936 2011-11-01 04:16:18 +00:00
The_E 8cf61ad24b Fixes possible null pointer issues when not using FS2 2011-10-28 13:41:22 +00:00
Zacam d495ef5ca9 Trunk Sync r7926 2011-10-23 19:04:29 +00:00
Zacam 81255e2299 From ni1s: -Wreorder warnings clean up for GCC output. 2011-10-19 07:36:59 +00:00
Zacam 255c377047 Trunk Sync r7916 2011-10-17 17:58:47 +00:00
Zacam 897eea19d2 Trunk Sync r7909 2011-10-16 18:03:37 +00:00
Zacam 18970717c7 Match Trunk r7902: correct EOL type for these two. 2011-10-12 20:18:33 +00:00
Zacam eb0060e130 Trunk r7898: Improve performance of jpeg byte swap operation 2011-10-12 16:12:10 +00:00
Zacam d380153ed9 Trunk Sync r7895 2011-10-11 20:33:05 +00:00
Zacam 6c6849405d Trunk Sync r7891 2011-10-11 09:04:55 +00:00
Zacam a2c6d3cb47 Trunk r7885: From Eli2: fix for mantis 2517: loop sounds are always at 100% volume locked and afterburner fade out sound not work 2011-10-09 11:43:50 +00:00
Zacam 56f5a4c726 Trunk Sync r7882 2011-10-09 10:39:19 +00:00
Zacam 754d89da84 Copy of: Trunk 7874; Fix for medal room crash reported by QuantumDelta 2011-10-08 07:40:12 +00:00
Zacam 3839228867 Trunk Sync r7871 2011-10-08 05:41:06 +00:00
Zacam 23d0c5bb01 Trunk Sync r7862 2011-10-06 04:53:51 +00:00
Zacam 3993b21e6d Trunk Sync r7859 2011-10-05 04:08:51 +00:00
Zacam ac5e5cdc6f Trunk Sync r7856 2011-10-03 13:40:33 +00:00
Zacam 31ccffef1c Trunk Sync r7853 2011-10-03 11:28:19 +00:00
Zacam a6041628e7 Finish removing dbugfile.cpp/.h from the rest of the projects. 2011-10-02 08:11:10 +00:00
The_E f77910e72e Trunk sync r7842 2011-10-02 07:54:02 +00:00
The_E b4fec4791a From Eli2: Dead/unused code removal 2011-10-01 11:55:18 +00:00
Echelon9 116f14d1c3 PVS-Studio fix: V568 It's odd that the argument of sizeof() operator is the '(ushort) sc->m_okKills [idx]' expression.
Please note that this will break multiplayer compatibility with prior versions of Antipodes 8. See further http://www.hard-light.net/forums/index.php?topic=73257.msg1550632#msg1550632
2011-10-01 07:53:04 +00:00
The_E 475f364c22 From Eli2: Eclipse project files 2011-09-30 13:38:55 +00:00
Zacam ed827a5605 Fixes error on cmdline_nohtl in neblighting.cpp, restores sound index in gamesnd.h. 2011-09-30 05:04:02 +00:00
Zacam 8552e85396 Trunk Sync r7825 2011-09-28 17:27:15 +00:00
Zacam 0a6390abfb Corrections to the MSVC2005 workspace. 2011-09-27 08:06:29 +00:00
Zacam f429eec1e8 libpng Project had an extra Debug SSE in it. 2011-09-27 08:05:36 +00:00
Zacam f20499a45a Copy of Trunk 7815: Add set-docked SEXP. 2011-09-27 05:53:27 +00:00
Zacam 33e49eb177 De-commit the beta version of the sound code patch (it was accidentally merged anyway) as it currently only belongs in the RC branch. 2011-09-27 05:52:02 +00:00
Zacam 6258fb77f1 From niffiwan: Fix for Mantis 2501. (Copy from Trunk) 2011-09-26 21:15:51 +00:00
Zacam 1508051685 From CommanderDJ: Fix for Mantis 2224 "Chat messages may end up unreadable due to unfortunate color choice"
Allows for the specification of colors via a colors.tbl
(Wiki Documentation here: http://www.hard-light.net/wiki/index.php/Colors.tbl )
2011-09-26 05:50:47 +00:00
Zacam 640133f963 Trunk Sync r7807 2011-09-26 03:01:28 +00:00
Zacam 6de603683f Trunk Sync: Copy of 7801, From CommanderDJ: Patch for Mantis 2307, set-object-position weirdness when in nebula 2011-09-25 08:33:41 +00:00
Zacam e6a4e6114a And another Sync Drift check for AP to tidy things up. 2011-09-25 08:27:17 +00:00
Zacam 176f307316 Trunk Sync r7799 2011-09-25 04:10:42 +00:00
Zacam 7bcb3907db copy of Trunk r7795 2011-09-24 22:40:35 +00:00
Zacam 2c6a924a82 Copy's Trunk revert in r7794. 2011-09-24 19:55:31 +00:00
The_E 15afdd864a Trunk sync r7792 2011-09-24 17:44:49 +00:00
Zacam b3ff543742 Thanks to Backslash for noticing this: afterburner_reverse_accel wasn't set in sip-> to init as 0.0, this has been corrected (along with aligned to their entry order) 2011-09-23 02:05:58 +00:00
Zacam f882175397 From Eli2: Some copy/paste function clean-up 2011-09-21 22:02:58 +00:00
Zacam 9efca699d5 Copy of Trunk 7770: Documentation: Code cleanup of grbatch.cpp and work to prepare for 64bit with size_t 2011-09-21 19:06:43 +00:00
Echelon9 d1db372561 PVS-Studio fix: V512 A call of the 'memset' function will lead to underflow of the buffer '&stackFrame' (mspdb_callstack.cpp). 2011-09-21 14:18:09 +00:00
Zacam cfc2302eeb Adds Trunk 7766.
(Previous Commit message should have said 7764, not 7763.)
2011-09-20 04:48:10 +00:00
Zacam dabd1b9405 Trunk Sync r7763 2011-09-20 01:26:10 +00:00
The_E f22a692c22 MSVC 2011 projects 2011-09-18 09:50:17 +00:00
Echelon9 6ad11d2431 PVS-Studio false alarm: V802 On 32-bit platform, structure size can be reduced from 28 to 24 bytes by rearranging the fields according to their sizes in decreasing order (plr_convert.cpp). 2011-09-18 07:24:18 +00:00
Echelon9 048a0ee140 From niffiwan: A means of catching a non-sensical value to help track down Mantis 2503. See http://www.hard-light.net/forums/index.php?topic=73257.msg1548721 2011-09-18 05:21:36 +00:00
Zacam 08fbeb2e01 Project cleanup for the removals of cryptstring, scramble, and crypt.cpp/.h. 2011-09-18 00:46:43 +00:00
Zacam c0c96db795 Trunk Sync r7753 2011-09-18 00:08:52 +00:00
The_E 3f60c8a228 Trunk sync r7747 2011-09-17 20:32:54 +00:00
Zacam e5c2b03610 Fix from Valathil for the pan-and-paint that occurs from shaders on non-SM2.0 cards from weapon lighting not culling out properly. 2011-09-17 15:15:54 +00:00
Zacam a4c59963ef Trunk Sync (r7732, r7736, r7737) 2011-09-17 15:11:02 +00:00
Valathil c4797aede3 Don't do a boolean check on Floats could be -0.0 which is boolean true 2011-09-17 14:38:54 +00:00
Zacam 6d7c608b91 Enable Text-to-Speech (SVN Include) and Voice Recognition. (MSVC 2010) 2011-09-15 03:29:20 +00:00
Zacam 1d637cf6ae Enable Text-to-Speech (SVN Include) and Voice Recognition. 2011-09-14 22:49:05 +00:00
Zacam 1ca545c89b EOL inconsistencies corrected to match the rest of the files. 2011-09-14 19:25:38 +00:00
Zacam 662938705e Trunk Sync r7724 2011-09-14 19:12:08 +00:00
Zacam 9b4bd56b18 Trunk Sync r7721 2011-09-14 08:34:17 +00:00
Zacam 1ef95444f2 Trunk Sync r7716 2011-09-13 08:05:43 +00:00
Zacam 1356613dcd Trunk Sync r7711 2011-09-12 12:42:59 +00:00
Zacam 8a587f1a50 Trunk r7703: Allow customization of the thruster distortion effect in species_defs.tbl and ships.tbl 2011-09-12 04:02:17 +00:00
Zacam 1b3cef40f6 Trunk Sync r7701 2011-09-12 03:44:56 +00:00
Zacam a667215670 Fix for Trunk r7677 causing map corruption on model cache rebuild. 2011-09-10 21:12:30 +00:00
The_E b654d36399 Changing this uint32_t (what's that supposed to be?) to a regular int to allow compilation on VS 2011-09-10 09:26:28 +00:00
chief1983 c5f16fd6df Richard's fix for firepoint cycling predictability. 2011-09-09 22:54:46 +00:00
Zacam c9e53a41bc Copy of: Trunk 7693 2011-09-09 15:23:34 +00:00
Zacam 98bbc8bee3 These PVS-Studio checks were fixed by IssMneur in Trunk r7676 and don't need flagging. 2011-09-09 13:46:12 +00:00
The_E f7e75c32b1 A few PVS Studio things (fixes, false alarm marks) 2011-09-09 11:47:55 +00:00
Zacam c62f04749c This file was inadvertently changed during a Trunk Sync that had some test data applied to it, now matches Trunk. 2011-09-09 10:55:34 +00:00
Zacam cc0d1b563e Part Three: Synchronization pass of Antipodes and Trunk Differences.
Catching on anything missed in the first two passes.
2011-09-09 10:38:47 +00:00
Zacam 3b085e8b83 Part Two: Synchronization pass of Antipodes and Trunk Differences.
Trunk Sync r7685
2011-09-09 10:25:08 +00:00
Zacam c607d9844e Part One: Synchronization pass of Antipodes and Trunk Differences.
Whitespace/tab mostly and to catch any drift.
2011-09-09 09:38:52 +00:00
Zacam da8f806a10 Trunk Sync r7680 2011-09-08 11:33:58 +00:00
Zacam 17b3c8be17 Trunk Sync r7677 2011-09-08 05:47:44 +00:00
Zacam e9e29e3ae6 Trunk Sync r7674 2011-09-08 05:05:01 +00:00
Zacam 6e6aa1975c Trunk Sync r7665 2011-09-07 10:20:10 +00:00
Zacam a4635437ec "zbuffer_save" in 'void model_render_children_buffers' is declared but not used. 2011-09-07 08:05:23 +00:00
Zacam ce708461e6 Fix merge issue that was causing a compiler error. 2011-09-07 07:58:07 +00:00
Zacam 02412812e2 Trunk Sync r7660 2011-09-07 07:41:50 +00:00
The_E 60758c5e82 And a few things that went wrong while merging 2011-09-06 21:44:54 +00:00
The_E b725ff7e21 trunk sync r7657 2011-09-06 21:22:39 +00:00
The_E 86e99817a4 Ooops, messed up the merge here 2011-08-31 19:44:14 +00:00
The_E 75f66ee174 Trunk sync r7607 2011-08-31 19:36:54 +00:00
Zacam 37735762bc From Trunk 7595: Shipp can be NULL, which would lead to a crash. This resolves that crash from happening. 2011-08-30 23:00:56 +00:00
The_E d8a728d5f1 Trunk sync r7593 2011-08-30 18:17:09 +00:00
Zacam ad3b01c2f2 Trunk Sync r7563 2011-08-29 00:21:43 +00:00
Zacam 61c81e2a99 Trunk Sync r7542 2011-08-27 23:17:45 +00:00
Zacam 1ba4ce550f Trunk Sync r7537 2011-08-26 19:51:06 +00:00
Zacam b12b33b151 Trunk Sync r7534 2011-08-25 03:02:20 +00:00
Zacam 2f6d659147 Trunk Sync r7529 2011-08-24 20:41:13 +00:00
Zacam 971ae63ea3 Trunk Sync r7521 2011-08-24 05:35:30 +00:00
Zacam 61ae987752 Trunk Sync r7513 2011-08-22 18:22:17 +00:00
Zacam bce73f18e0 Hmm. No idea how this one got missed. FRED controls for Nebula Fog Distance. 2011-08-21 12:15:57 +00:00
Zacam ecd6db1169 Derp. No version for u. 2011-08-21 05:34:02 +00:00
Zacam 029e2a1c5b Somehow missed these in the Trunk Sync. MSVC 2005 updated. 2011-08-21 04:26:44 +00:00
Zacam 1452c349ee Trunk Sync r7502 2011-08-21 04:10:52 +00:00
Zacam 844bd02cbf Trunk Sync r7496 More Justice 2011-08-20 23:40:54 +00:00
Zacam 4b6bfbc980 Trunk Sync r7496 for GREAT JUSTICE! 2011-08-20 22:25:04 +00:00
Zacam 33d3a759e3 Trunk Sync r7494 2011-08-20 19:15:54 +00:00
Zacam e3dcfbe59a Trunk Sync r7490 2011-08-19 22:11:28 +00:00
Zacam 0ba0aa44e3 Resolves MSVC Errors from the sync of Hallecks Bomb code. "&& !(Game_mode & GM_DEMO_PLAYBACK)", error being that "GM_DEMO_PLAYBACK" is not available in Antipodes. 2011-08-19 02:57:40 +00:00
Zacam 037a418a62 Trunk Sync r7483 2011-08-18 20:22:52 +00:00
Zacam de70737203 Trunk Sync r7474 2011-08-15 22:16:25 +00:00
Zacam d9ab31b4ff Trunk 7469: PVS-Studio fix: Expression 'b->type < 0' is always false. Unsigned type value is never < 0. 2011-08-14 15:53:02 +00:00
Zacam 78e2500d9e Some additional PVS-Studio fixes as placed in the thread on Aug 10th:
http://www.hard-light.net/forums/index.php?topic=77590.msg1538811#msg1538811
2011-08-14 14:08:09 +00:00
Zacam db5f86892c Trunk 7465: change warnings to mprintfs 2011-08-14 14:00:43 +00:00
Echelon9 45b0a125bc PVS-Studio fix: A few outstanding issues with r7466 2011-08-14 13:59:32 +00:00
Echelon9 67eb406443 PVS-Studio: Fix V805. Decreased performance. It is inefficient to identify an empty string by using 'strlen(str) > 0' construct 2011-08-14 13:14:35 +00:00
Zacam 0504a180d3 Shader Update: main-f updated with latest cloaking code. small amount of cleanup done as well. 2011-08-14 02:39:31 +00:00
Zacam 2cda91d1a9 Trunk Sync r7461 2011-08-13 19:09:09 +00:00
Zacam 61d7289888 Trunk Sync r7458 2011-08-12 12:48:38 +00:00
Zacam 10a648755e Logging update: Major/Minor/Build update so that "Build" will always be available/log correctly even when "0" (ex: 3.7.0) without also needing "Revision" present. 2011-08-10 14:22:34 +00:00
Zacam f51b68afc3 Trunk Sync r7447 2011-08-10 14:14:07 +00:00
Zacam d3bb5578e3 From Echelon9: For testing, PVS-Studio output corrections. 2011-08-09 07:45:09 +00:00
Zacam 9df0ac03b6 Trunk Sync r7436 2011-08-09 07:41:01 +00:00
Zacam 3eb7d1699a Trunk Sync r7434 2011-08-08 01:53:57 +00:00
Zacam 9ea5438622 Trunk Sync r7428 2011-08-05 03:44:27 +00:00
The_E fb5c0d8b9e Trunk sync r7246 2011-08-04 16:27:02 +00:00
Zacam 4b9c69d9f6 Trunk Sync r7423 2011-08-04 13:47:38 +00:00
Zacam dcde3e4270 Trunk Sync r7420 2011-08-04 13:27:14 +00:00
The_E a5cde74b9e Reverting 7412 2011-08-02 13:03:42 +00:00
The_E beda0ef100 Trunk sync r7411 2011-08-02 11:28:10 +00:00
Zacam 3d27bc8b88 Trunk Sync - r7409 (from r7398, sans 7402 & 7408) 2011-08-02 03:57:38 +00:00
The_E 5a072e0319 Moving ai_profiles parsing up a few lines to get them parsed before weapons and ships, to fix issue with $Default Weapon Selection 2011-07-31 20:16:17 +00:00
The_E 13ec8c9ce4 Trunk sync r7396 2011-07-30 22:46:16 +00:00
The_E 1159c2111c Trunk sync r7391 2011-07-30 21:49:42 +00:00
Zacam d4c2990f45 Trunk Sync r7386 2011-07-29 21:11:23 +00:00
Zacam 24325508ae Trunk Sync r7384 2011-07-29 12:17:25 +00:00
The_E b5a1b4c263 Trunk sync r7282 2011-07-26 22:16:22 +00:00
The_E 35dc693427 Trunk sync r7379 2011-07-23 10:20:17 +00:00
Zacam dab3c6d3c9 Trunk Sync r7376 2011-07-23 02:09:07 +00:00
Zacam 4d5e94bf35 Trunk Sync r7372 2011-07-22 17:07:42 +00:00
The_E 727b77a8c0 Trunk sync r7366 2011-07-21 12:22:00 +00:00
The_E 08063525c7 trunk sync r7363 2011-07-20 18:07:56 +00:00
Zacam a115bdf287 Trunk Sync -r7359 2011-07-19 22:10:23 +00:00
Zacam 8cd8490d15 Trunk Sync -r7356 2011-07-19 19:27:13 +00:00
Zacam 2601fbeb53 Trunk Syn - r7350 2011-07-17 04:44:46 +00:00
The_E e274c1b218 Trunk sync r7246 2011-07-13 09:04:47 +00:00
Zacam 899abfe413 Trunk Sync - r7342 2011-07-11 08:22:54 +00:00
Zacam 872a5dd838 One should remember to revert testing code out before doing a Sync. *sighs* 2011-07-09 17:37:39 +00:00
Zacam de2c9aa442 Trunk Sync -r7336 2011-07-09 17:11:53 +00:00
Zacam 5e4f401371 From Valathil: Correction to commit 7292. Light sorting now takes place in the proper order. 2011-07-06 20:55:22 +00:00
The_E d12cc44de2 Trunk sync r7230 2011-07-06 10:51:40 +00:00
Zacam 5f0c4ad2a7 Trunk Sync - r7328 2011-07-06 05:23:54 +00:00
The_E 662dae1305 Trunk sync r7223 2011-07-05 12:40:08 +00:00
The_E 95f7c0d83b Reverting changes due to unforeseen consequences. 2011-07-04 14:56:27 +00:00
Zacam 4ff9c7914d Whoops. My bad. 2011-07-04 14:25:26 +00:00
The_E b98d27a892 Small update to the FXAA shaders. Also adds a function for shader uniform access that was previously missing. 2011-07-04 13:08:40 +00:00
Zacam eca9a5380b Trunk Sync - r7315 2011-07-04 06:41:27 +00:00
Zacam 0fc25700b2 Copy of Trunk 7307. 2011-07-02 01:03:24 +00:00
Zacam b654033b44 Trunk 7304 Copy 2011-07-01 23:40:13 +00:00
Zacam 6d377a87aa Typo found by Valathil. 2011-07-01 19:00:56 +00:00
Zacam 8d700fa600 From Trunk 7295: Swifty's collision detection improvements. 2011-07-01 18:08:54 +00:00
Zacam 4834b112b8 And now XCode can join the party too. 2011-07-01 17:41:27 +00:00
Zacam d87ccf8a48 Narf. 2011-07-01 17:29:21 +00:00
The_E d37114415f Adds missing header for libpng 2011-07-01 17:24:38 +00:00
Zacam a836a27fe0 Update:
libpng now at 1.5.2 (small update to pngutils)
zlib now at 1.2.5
Files are in "LF" instead of "CRLF" this time around.
2011-07-01 17:06:16 +00:00
The_E f000375fef Trunk sync r7293 2011-07-01 14:15:06 +00:00
Zacam efa75b4a22 Trunk Sync - r7289 2011-06-28 22:43:33 +00:00
The_E a9a8cfbfc5 A few operator constants were colliding for some reason 2011-06-28 09:36:56 +00:00
The_E a6a3e1900c Trunk sync r7280 2011-06-28 08:38:40 +00:00
Zacam a8f9b2a15e Trunk Sync - r7277 2011-06-28 04:04:47 +00:00
Zacam f8883ce805 Trunk Sync - r7274 2011-06-27 20:36:05 +00:00
Zacam d96982e6ce Catches one of the signed/unsigned conversions not covered under r7258. 2011-06-22 23:05:23 +00:00
Zacam 6d2d34b421 From Trunk: Standalone now makes it's own log file. 2011-06-21 23:09:41 +00:00
Zacam 12c5007f9c Update to r7260 from pyro3d 2011-06-20 13:18:16 +00:00
The_E 1de6dfa605 Trunk sync r7259 2011-06-19 17:24:40 +00:00
The_E 1f5d3fd63a Patch for buggy red alert data saving from Pyro3D 2011-06-19 13:22:03 +00:00
Zacam 8d587f1c75 Trunk 7257: "Fix compiler warnings re: signed/unsigned mismatch" by The E 2011-06-18 21:48:12 +00:00
Zacam 53b5dd43bd Trunk Sync - r7255 2011-06-18 19:40:53 +00:00
The_E 6546d07d90 Trunk sync r7253 2011-06-16 17:18:13 +00:00
Zacam 6698f622c3 Oops. 2011-06-16 15:50:20 +00:00
Zacam d4d47ab54c Update to some Additional Options under MSVC 2008 for Release Builds to enable "/MP" that are present in the rest of the vcproj files. 2011-06-16 15:18:01 +00:00
Zacam 27ae715cbe Trunk Sync - r7248 2011-06-16 15:07:09 +00:00
Zacam e9a6ceb9a3 Trunk Sync - r7245 2011-06-15 15:13:20 +00:00
The_E aa6bcda337 TRunk sync r7242 2011-06-14 16:42:03 +00:00
Zacam baa1b95549 Trunk Sync - r7240 2011-06-13 21:52:07 +00:00
The_E b0fd971cd8 Adding a few bits of sanity checking here. This doesn't address the underlying problem, which is somewhere in the red-alert storage code. 2011-06-12 12:53:55 +00:00
Zacam 80e9420172 Trunk Sync - r7235 2011-06-07 02:33:03 +00:00
chief1983 70598a3abd Trunk sync - r7230 2011-06-03 18:11:17 +00:00
Zacam e628e45e44 Trunk Sync - r7224 2011-06-01 21:24:46 +00:00
Zacam 5b3f98fa07 Trunk Sync - r7222 2011-05-31 02:41:44 +00:00
The_E e57b4f26bf Trunk sync r7219 2011-05-30 18:51:00 +00:00
Zacam 7bd7dfd24f Trunk Sync - r7213 2011-05-27 23:45:52 +00:00
Zacam 519c80477b Quick check for pyro3d's Mantis 2425 Patch. 2011-05-24 15:26:25 +00:00
Zacam 81e6dc277e Removing some unreachable returns. 2011-05-24 15:14:58 +00:00
Zacam 4557dc1e0b Trunk Sync - r7204 2011-05-24 15:12:06 +00:00
Zacam db4a193eba Trunk Sync - r7201 2011-05-23 16:49:43 +00:00
Zacam 80ba7361a8 Trunk Sync - r7197 2011-05-19 21:34:28 +00:00
Zacam 905ecf5f6f Let's try "GS_EVENT_END_CAMPAIGN (59)" instead of "GS_EVENT_EMD_CAMPAIGN (59)" 2011-05-19 11:34:48 +00:00
The_E 2975402985 Comment out a few warnings that are unnecessarily alarming. 2011-05-19 11:27:13 +00:00
Zacam 00741a4206 Trunk 7190 - Fix BSG warp effect shockwave 2011-05-19 10:49:41 +00:00
Zacam b886f25cd3 AP Red-Alert bug patch from Pyro3d
http://www.hard-light.net/forums/index.php?topic=73257.msg1511794#msg1511794
2011-05-19 10:48:32 +00:00
Zacam ca9126e8b2 Copy of Trunk 7188 2011-05-18 13:27:35 +00:00
Zacam 94f980b921 Copy of Trunk Commit r7186:
Adding an error message in case FXAA shader compilation fails.
2011-05-18 04:07:34 +00:00
The_E ad1f1ff97b Trunk sync r7184 2011-05-17 14:59:47 +00:00
Zacam 6e0f95ee0f Trunk Sync - r7182 2011-05-16 09:16:44 +00:00
Zacam a62b7c6d9b Trunk Sync - r7176 2011-05-11 00:32:21 +00:00
Zacam 51dbc52d4a Trunk Sync -r7171 2011-05-01 15:13:24 +00:00
Zacam 8467ad4a01 Trunk Sync -r7153 2011-04-28 22:57:45 +00:00
Zacam 40a9444f13 The E's fix for Mantis 2428 from Trunk. 2011-04-26 12:06:37 +00:00
Zacam 9cc432aeb0 Trunk Sync -r7146 2011-04-25 02:10:50 +00:00
Zacam ce2b01f20c Trunk Sync -r7141 2011-04-20 18:07:38 +00:00
Zacam 7b1908c4f8 Trunk Sync - r7136 2011-04-18 09:10:42 +00:00
The_E 2f3f8abb4b Trunk sync r7133 2011-04-17 18:18:36 +00:00
The_E 8da39cd0f8 This assertion is bogus. 2011-04-17 18:12:28 +00:00
The_E 793222a182 Actually, let's make it an Assertion. 2011-04-16 09:46:56 +00:00
The_E 6eadd3ec87 Adding some braces that were missing for some reason. 2011-04-16 09:45:43 +00:00
The_E 5e82657bf8 Fix issue with the tips popup popping up _every goddamn time, EVEN THOUGH I TOLD YOU NOT TO!_ 2011-04-16 09:19:51 +00:00
The_E ba09ace833 Okay, this one needs to be done properly at some point. For now, let us just assume that using Single-player mode by default is the right thing to do. 2011-04-13 14:51:40 +00:00
The_E 4fadf2c205 Trunk sync r7113 2011-04-11 15:46:20 +00:00
The_E d226931506 Trunk sync r7107 2011-04-05 12:07:21 +00:00
The_E 116c1945f5 Trunk sync r7104 2011-04-04 20:25:24 +00:00
Zacam cb85530ac8 Trunk Sync - r7099 2011-03-30 13:40:30 +00:00
Zacam 8bcd7b416b Removing platform #ifdef from the limits.h include as un-necessary. 2011-03-29 19:49:05 +00:00
Zacam 335bf6cd83 Reported by rsaxvc:
<limits.h> in bmpman (Probably due to MAX_INT being used)
Pull the "demo" dir out of the makefile
http://www.hard-light.net/forums/index.php?topic=75332.0
2011-03-29 13:54:07 +00:00
The_E ac1b4951f2 Minor patch to address issue with custom mainhalls not loading for fresh pilots. I hate this one. 2011-03-26 13:29:35 +00:00
The_E 58464ff04c Trunk sync r7080 2011-03-20 18:15:11 +00:00
The_E 2b52a08c55 More guarding against reading invalid values. 2011-03-20 18:00:18 +00:00
The_E 18d0c77e8e Fix for bug noted by Zacam. Note to self: read the code before toying with forces you don't understand. 2011-03-18 20:24:07 +00:00
The_E 5134c9abdd A few changes to bm_get_next_handle(). 2011-03-13 09:07:43 +00:00
Zacam 732de3d7b3 Trunk Sync - r7051 2011-03-11 09:57:38 +00:00
Zacam c60578f338 Trunk Sync - r7036 2011-03-03 03:49:54 +00:00
The_E 257520a27c Adding a few CLAMPs and log warnings to ensure validity 2011-02-27 20:06:44 +00:00
The_E 3325b4b804 This will allow for longer sexps. 2011-02-26 08:53:09 +00:00
Zacam 307ad4b32f Test commit of Doxygen MSVC Addin configuration file
http://doxygenbrowseraddin.codeplex.com/

Install and Configure/Run Doxygen first per:
http://www.hard-light.net/wiki/index.php/Doxygen_Documentation
2011-02-26 02:48:58 +00:00
Zacam d5542b9a31 Trunk Sync - r7030 2011-02-26 01:50:36 +00:00
Zacam 04c76be830 Trunk Sync - r7025 2011-02-25 04:30:55 +00:00
Zacam ff47346489 Removal of the /code/demo directory references from the remaining projects. 2011-02-24 15:58:19 +00:00
The_E c323582583 Fix for bug encountered in BP, From now on "0" is no longer a valid handle for bmpman slots 2011-02-18 15:22:28 +00:00
Zacam 4ab313e1b6 Trunk Sync - r7014 2011-02-14 17:03:01 +00:00
The_E 400383f901 Removing the nonfunctional demo code, part 2 2011-02-13 20:42:20 +00:00
The_E 5d22efe392 Removing the nonfunctional demo code. 2011-02-13 20:41:43 +00:00
Zacam b2535b181b Fixes Dialogue alignment in the Misc Ships Flags portion of the Ships Editor. 2011-02-07 19:02:15 +00:00
Zacam a79c2d8390 Trunk Sync - r7005
Some modification to list "no-ets" above "immobile"
2011-02-07 09:45:15 +00:00
Zacam 5abaa37b7f Trunk Sync -r7002 2011-02-06 03:26:41 +00:00
Zacam d340e3e1cd Nukes Particle Code. 2011-02-04 15:15:27 +00:00
Zacam 8afa55a716 Trunk Sync - r6993 2011-02-04 03:50:54 +00:00
Zacam 0349ed6db6 Trunk Sync - r6988 2011-01-30 17:56:40 +00:00
Zacam a5400e8e86 Trunk Sync - r6975 2011-01-25 16:49:43 +00:00
Zacam 7b472ce10a Trunk Sync - r6967 2011-01-23 18:23:47 +00:00
The_E f028c7a5f1 Trunk sync r6964 2011-01-23 16:25:29 +00:00
The_E 419592d706 Trunk sync r6959 2011-01-22 18:34:12 +00:00
Zacam 6eccb00b38 Trunk Sync - r6952 2011-01-19 10:33:07 +00:00
The_E 4cba1ccb03 Trunk sync r6949 2011-01-18 16:26:37 +00:00
Zacam ff073dfb4d Trunk Sync - r6945 2011-01-15 09:27:20 +00:00
The_E 41d452e689 Trunk sync r6934 2011-01-10 15:50:50 +00:00
Zacam 6fd659607f Trunk Sync - r2930 2011-01-08 08:02:04 +00:00
Zacam fa908e72a8 Trunk 6921 - "Add flag that applies damage to subsystem as if it were the hull." 2011-01-05 17:36:39 +00:00
chief1983 21040622bd Trunk r6924: Support for PNG/JPG/TGA based EFFs for the HUD and other graphics that previously required ANI/PCX. 2011-01-05 16:10:30 +00:00
Zacam 4d78024d0c GLSL version Detection fix.
http://www.hard-light.net/forums/index.php?topic=73712.0
2011-01-05 07:13:10 +00:00
Zacam 9b8d978e81 Trunk 6919, "resolve a conversion warning pointed out by FUBAR" 2011-01-02 20:46:42 +00:00
The_E f8674a1515 Trunk sync r6917 2011-01-01 13:41:57 +00:00
Zacam 5078462321 Dynamic Primary Linking, from chief1983. 2010-12-30 19:28:52 +00:00
Zacam 866f7f86f8 Trunk Sync - r6910 2010-12-29 18:39:43 +00:00
Zacam 2549635181 Thanks to Goober5000, this is the correct way to be doing this. 2010-12-28 04:49:27 +00:00
Zacam 35c7cf3514 Fixes the index for Player Main Hall. Still not saving (or being read) by CSG properly despite tripping breakpoints set on the cfread/cfwrite on the flags for main_hall. 2010-12-27 22:54:50 +00:00
Zacam 59e562a587 Fixes reports of Retail data showing "0 ms" for ships Velocity in Ship Selection Screen. When multiplying an INT by a FLOAT, setting the fl2i() on the float is a good idea. 2010-12-27 15:28:04 +00:00
Zacam 1aab2c261e Trunk Sync - r6898 2010-12-27 13:01:43 +00:00
Zacam 65143c8a26 Revert 6885. Not a good thing to do apparently. 2010-12-26 19:46:49 +00:00
Zacam 727c65d095 From Trunk: Fix for Mantis 2350 (Sound assignments get lost/become bogus when changing ship class) 2010-12-25 15:18:47 +00:00
Zacam 142eda661c Fix: MSVC signed/unsigned mismatch. 2010-12-25 13:16:37 +00:00
Zacam 4df9e6f78c Just noticed that I sorta messed up the Prev/Next Squad Logo buttons locations trying to disable the "Convert" button.
Thanks to The_E, this has now been fixed, and a "Disabled!" message will now show.
2010-12-25 12:10:32 +00:00
Zacam 716be042d5 Trunk 6880 - Fix for Mantis 2356. 2010-12-24 09:37:58 +00:00
Zacam 2c5f54c319 MSVC LNK4221 Resolution.
multi_oo.cpp/.h and psnet.cpp/.h are not being used and have been removed.
Headers updated to point to multi_obj or psnet2 as appropriate.
Multi.cpp #ifdef PSNET2 made default. vecmat.h added to multi_obj.h.
2010-12-24 09:35:09 +00:00
The_E f05fcfade1 Trunk synk r6876 2010-12-22 14:48:44 +00:00
The_E cc088c897a Fixes erroneous assert on valid last_ship_flown data. 2010-12-22 13:47:30 +00:00
Zacam 8c2e8ca45a Trunk Sync - r6875 2010-12-21 06:51:15 +00:00
karajorma e17d7206d5 Fix a bug in persistent variable handing which was corrupting pilots. 2010-12-20 16:01:19 +00:00
karajorma bc0b03683d Fix a bug where persistent variables were copied on top non-persistent variables that happened to have the same name. 2010-12-20 15:59:16 +00:00
Zacam 34e02ce943 Trunk Sync - r6865 2010-12-19 06:05:54 +00:00
Zacam 0edd54cf19 Potential fix for reported mainhall issues. Caused by my own commit 6677 and only partly corrected for in 6692. (note: I'm unable to reproduce the reported issues, so it's anybodies guess) 2010-12-16 23:52:39 +00:00
Zacam 8561bf8b4b From Karajorma: Fix for Mantis 1708 "Training messages do not take into account multiple binds for controls" 2010-12-16 07:15:30 +00:00
Zacam de3846675f Trunk Sync - r6855 2010-12-16 07:01:53 +00:00
Zacam 1a7298e0d5 Mantis 2354: Barracks can now be used to switch between Single/Multi Gameplay. 2010-12-16 05:58:50 +00:00
Zacam 805f948882 Mantis 2353: Doesn't resolve Importing/Converting older players, but now Cloning a pilot will retain Axis/Invert as well as sensitivity and dead zone. 2010-12-16 05:57:22 +00:00
Zacam 6083c4e8a1 I honestly have no idea what I have done here, but this should resolve Mantis 2353. (Tested on New pilot and converted) 2010-12-15 12:39:52 +00:00
karajorma ce8b569132 Might want to check that index is in bounds. 2010-12-15 12:24:20 +00:00
Zacam 76a427daae Not changing anything here, but it is making this mess a whole lot easier to read. (feel free to disagree if you want) 2010-12-15 11:36:45 +00:00
Zacam 24ff53937d Trunk Sync - r6847 2010-12-13 20:44:27 +00:00
Zacam b44703cc09 Copy of Trunk 6844. 2010-12-13 05:52:25 +00:00
The_E 27e6a17b97 Set type for pilotfile.h and pilotfile_convert.h correctly. 2010-12-13 04:02:02 +00:00
Zacam 6e41f25a6f MSVC_2008 Compiler warnings, fixed. 2010-12-13 03:54:08 +00:00
The_E 768e7df94b Save the savefile when leaving the options menu 2010-12-13 02:53:22 +00:00
Zacam a50f6a7a10 The E cleaned house on a slew of unused #IFDEFs, such as FS2_DEMO, MULTIPLAYER_BETA, OEM_BUILD, commented out code, etc. 2010-12-13 02:44:27 +00:00
Zacam ea971a95a1 INF_BUILD #ifdef/#ifndef's and Inferno Build Configurations go away. 2010-12-13 02:33:41 +00:00
The_E 9ca59918b2 Slight changes to fix linker warning 2010-12-13 01:42:11 +00:00
Zacam cbd55626f4 Quick fix. (Would have helped if I had saved the file prior to commit) 2010-12-12 23:55:29 +00:00
Zacam d86f450c55 Antipodes 8: New Pilot code, from taylor. 2010-12-12 23:53:05 +00:00
Zacam e635d7af70 Prep for Antipodes 8. EXE output filenames now match Trunk to make Merge easier once AP8 is done. 2010-12-12 23:44:13 +00:00
Zacam d4503bdece Adds radardradis.cpp/.h to codeblocks and MSVC_2005. 2010-12-12 04:51:05 +00:00
Zacam 6d9dedb2f8 Trunk Sync - r6830 2010-12-12 01:29:12 +00:00
Zacam 958191f75b Trunk 6822 - Goober5000: use standard font to output the "more" indicator 2010-12-10 19:08:56 +00:00
The_E 4c22ceda41 Fix for Mantis 2254. This adds the option "$Speed Unit Multiplier:" after "Length Unit Multiplier". This value, if left alone, is set to the same value as the length unit multiplier for compatibility. See Mantis for more notes. 2010-12-10 18:21:15 +00:00
The_E 0e64e47bfe Trunk sync r6820 2010-12-09 23:49:32 +00:00
The_E ca9d09cc39 Trunk sync - r6818 2010-12-09 23:25:11 +00:00
Zacam 065878be49 Trunk Sync - r6804 2010-12-06 20:11:49 +00:00
The_E 0ae81a217f Bah. getObjectType() != getConfigType() 2010-12-01 13:07:18 +00:00
The_E 6816a45506 Adding the hud-activate-gauge-type sexp, which can be used to switch a gauge category on or off. 2010-11-29 14:35:42 +00:00
Zacam e824b8b86e Trunk Sync -r6795 2010-11-29 12:45:07 +00:00
Swifty 464e3a7270 Lead sight now displays for secondary dumbfires and does not display until an armed weapon is in range. 2010-11-27 22:06:13 +00:00
Zacam 1e6030d5a1 Trunk 6789 - Goober5000 - bump number of misc anims to 32 2010-11-27 00:14:23 +00:00
The_E f1dd9cf410 Small logic changes here. Changes bug with hud gauges not getting turned off properly in options menu 2010-11-26 19:39:55 +00:00
Zacam 44ba6b9306 Trunk Sync - r6787 2010-11-26 01:52:39 +00:00
The_E d4424ed8b6 Bumping XSTR_SIZE to allow for "Artillery firing" message replacement 2010-11-24 20:47:54 +00:00
Zacam 5357113acd Trunk Sync - r6774 2010-11-24 02:59:12 +00:00
The_E 8d7a70b471 eval_sexp -> is_sexp_true 2010-11-23 08:06:10 +00:00
Zacam 423c16c380 Trunk Sync - r6768 2010-11-23 07:41:34 +00:00
Zacam a4bffc0c76 Trunk Sync - r6766 2010-11-22 21:14:27 +00:00
The_E 7b019a4005 Trunk sync r6762 2010-11-22 06:24:06 +00:00
Zacam fc0d8b53c8 Trunk Sync - r6760 2010-11-21 20:29:01 +00:00
The_E 5de50c2e3c More fixes for the "initial off" thing. 2010-11-20 23:38:53 +00:00
The_E f890e627c6 Logic is a good thing. If you don't reverse it. 2010-11-19 21:22:12 +00:00
The_E e62c853715 Various bugfixes related to the "off by default" setting 2010-11-19 21:21:47 +00:00
The_E 9d2fc56831 Fixes issue noticed by Axem, where messages without head anis would reuse the last head ani in use. 2010-11-19 17:18:56 +00:00
Swifty de5a72917d Rectified the behavior of View From Target from rendering the inverse of HUD elements it originally displayed. Targetbox returned to its original behavior of not displaying in external cam. 2010-11-17 21:52:08 +00:00
The_E 21976de611 Changes the firepoiunt display to be a tiny bit more efficient. Also, working as planned now. 2010-11-16 13:57:26 +00:00
The_E 28a87521a9 Fix for code analysis warning 2010-11-16 12:29:13 +00:00
The_E 38085dc5a8 Adding option to designate a custom HUD gauge as off by default, as well as a sexp to activate/deactivate custom gauges 2010-11-15 15:36:27 +00:00
Zacam b28a2754cb Trunk Sync - r6738 2010-11-14 19:41:45 +00:00
Swifty 6a95628a8f Rewrite of the HUD messages rewrite. 2010-11-14 19:28:11 +00:00
The_E f7c2c24f82 This wasn't supposed to be committed as well, sorry 2010-11-13 16:01:21 +00:00
The_E 00c67a65b5 Ooops, small oversight 2010-11-13 15:55:29 +00:00
The_E f7b3bbae18 Adding the "Fixed Message" gauge. This is used to display status messages, like the "Killed by..." and "Viewing from:..." messages. Usage is the same as the standard message gauge. 2010-11-13 11:16:29 +00:00
The_E d45e390fd0 Fixing bug where the coordinates for the subsystem reticle in the targetview window got manipulated wrongly if no hud_gauges.tbl was present. 2010-11-13 02:09:01 +00:00
The_E 52a7c5be81 The real fix for hud-set-directive 2010-11-12 03:01:30 +00:00
The_E e142759be4 Ooops, forgot to change this to a renderString() 2010-11-11 16:38:34 +00:00
The_E 94cc5ceaeb Adds an XWA-style firepoint display to the standard reticle. To use it, add "Firepoint display: YES" to the center reticle gauge (after "Filename:"). Additional options are "Firepoint size:" (size in pixels, default value is 5), "Firepoint X coordinate multiplier:" (Default is 15) and "Firepoint Y coordinate multiplier:" (Default value 10)
Also adds HudGauge::renderCircle().
2010-11-11 03:33:06 +00:00
The_E 91dedca11c Fix for faulty check 2010-11-11 03:17:37 +00:00
The_E 88f5848c12 But this is how you do it right 2010-11-09 18:36:00 +00:00
Zacam 3b42dd1f51 Hmm. There's a game-breaker, hopefully now fixed appropriately. (At least now it compiles) 2010-11-09 12:38:17 +00:00
The_E 949106b963 Adding the hud-set-directive sexp, to complete the set. 2010-11-09 09:48:23 +00:00
The_E 56c1859579 Trunk sync r6715 2010-11-09 04:10:53 +00:00
The_E bf7e1cc536 Fix issue with alternate weapon energy/ballistic ammo gauges not drawn correctly 2010-11-09 04:05:18 +00:00
The_E 8c12647629 Changes render permissions for the messages, head ani, and target view gauges. 2010-11-09 01:30:22 +00:00
The_E cb2a15ad1a Trunk sync r6711 2010-11-05 00:47:58 +00:00
chief1983 8755806397 Trunk sync - r6704 2010-10-29 19:10:21 +00:00
chief1983 2723cc7e99 Whoops, still testing this part 2010-10-29 17:08:38 +00:00
chief1983 3f0f10d3a6 Trunk sync - r6701 2010-10-29 17:05:36 +00:00
Zacam 5d506d2341 copy of Trunk Commit r6697 - Patch for minor snafu, from FUBAR 2010-10-29 01:20:57 +00:00
The_E 4e118acd49 Fixes issue with the head ani not being unloaded correctly 2010-10-28 19:03:07 +00:00
Zacam 89a8c659d1 Trunk Sync -r6694 2010-10-27 18:33:32 +00:00
The_E 8769780354 Fix for Mantis 2331 (hud-set-message not working properly) 2010-10-26 10:20:48 +00:00
chief1983 06c6a8a70f Trunk sync - r6689 2010-10-25 15:58:47 +00:00
The_E fa2da96059 Removing lua.c from the VS2010 project 2010-10-25 15:07:41 +00:00
Zacam 1e4b61547c Trunk Sync - r6684 2010-10-25 04:09:33 +00:00
Zacam b33234ab29 Trunk Sync - r6677 2010-10-25 00:25:52 +00:00
Zacam 3662c33157 Trunk Sync - r6675 2010-10-24 20:50:24 +00:00
The_E d9c0a50141 Adding "Message Source: None". Fixes oversight regarding hud-set-message 2010-10-23 14:51:24 +00:00
Zacam a246fa3a30 Trunk Sync - r6669 2010-10-22 20:47:28 +00:00
chief1983 84930ce188 Trunk sync - r6662 2010-10-22 20:34:37 +00:00
The_E ef61f16857 Fixes for build warnings 2010-10-22 20:33:35 +00:00
The_E f78fc33742 Removing unused variables and unused code 2010-10-22 20:13:58 +00:00
The_E 7572008d94 Basic lua integration of the new HUD gauges. 2010-10-22 20:09:11 +00:00
The_E 35d9c02231 Adding a getter function for the custom HUD gauge text 2010-10-22 19:33:14 +00:00
The_E f295358b00 Adding an option to specify a text offset for custom gauges 2010-10-22 18:33:39 +00:00
Zacam 4595b64430 Resolves for conversion type warnings. 2010-10-22 05:44:06 +00:00
Swifty 5e40c0ddb4 Fixed warnings when retrieving HUD config data. 2010-10-22 00:32:54 +00:00
chief1983 3b222fe39c Add radardradis files to code/Makefile.am 2010-10-21 22:44:48 +00:00
chief1983 089fd2fafe Trunk sync - r6655 2010-10-21 18:16:58 +00:00
Zacam 8bd65baa06 Resolves float-to-int conversion warning. 2010-10-20 20:43:16 +00:00
Zacam 63e36377da Removes unreferenced variable, some whitespace/formatting cleanup. 2010-10-20 20:42:29 +00:00
chief1983 19e491c4fc Fix compiling errors on VC6 2010-10-20 19:24:59 +00:00
Zacam 3322191676 Update 2005 and 2008 Project file output names from 6 to 7. 2010-10-20 18:19:15 +00:00
chief1983 f6683e6f41 VC6 rename output build to ant-7 from ant-6 2010-10-20 16:36:00 +00:00
chief1983 780eafe42e Add radar files to VC6 code project file. 2010-10-20 16:13:15 +00:00
chief1983 090965e952 Trunk sync - r6646 2010-10-20 15:15:07 +00:00
The_E a9cf01b21d Addng the hud-set-message sexp (Changes the text of a HUD gauge to a message from the messages list) 2010-10-20 09:11:52 +00:00
The_E 04158e45f1 Added radardradis files to the VS2010 project 2010-10-20 09:08:11 +00:00
chief1983 7995e438a4 Properly add radardradis files for Xcode 2010-10-19 23:41:26 +00:00
chief1983 48d5472738 Initial commit of HUD/Dradis code from Swifty's branch for Antipodes 7 2010-10-19 23:17:26 +00:00
chief1983 e9454476d0 More whitespace fixage 2010-10-19 22:19:15 +00:00
chief1983 d78d31a021 Somehow this line was left out of antipodes 2010-10-19 22:17:12 +00:00
chief1983 da31ed9fa2 Trunk sync - r6635 2010-10-19 14:57:03 +00:00
Zacam 1c11fee7e6 Trunk sync - r6632 2010-10-18 21:01:59 +00:00
Zacam 1c65117a01 Trunk sync - r6630. 2010-10-18 20:20:59 +00:00
chief1983 a1e1978565 Trunk sync - r6623 2010-10-18 17:12:35 +00:00
taylor 8e307b0353 this just seems to cause problems 2010-10-17 00:56:24 +00:00
chief1983 a5e31bb187 Add fsmemory.cpp to Xcode too, and some region stuff apparently 2010-10-16 17:49:45 +00:00
Zacam 74288b25ad Set fsmemory.cpp in the 2010 .filters file as well. 2010-10-16 08:12:31 +00:00
Zacam c60c5c354f Trunk Sync r6613 2010-10-16 06:46:33 +00:00
taylor da639658bf new/delete fixage for FRED 2010-10-16 06:07:50 +00:00
Goober5000 a865a61999 add fsmemory.cpp to VC6 project
add /FORCE:MULTIPLE to FRED
2010-10-16 05:34:23 +00:00
The_E d469ce0ebe These should be set as well. 2010-10-15 21:16:03 +00:00
The_E a47fc29330 --Added "-disable_glsl_model" commandline option to switch off shader-based model rendering but leave the option open to use post processing
--Changed shader compilation behaviour so that it stops to compile shaders if one of the lighting shaders fails, similar to the behaviour for normal and height map shaders
2010-10-15 21:11:36 +00:00
taylor dd0f58dffa better fix for warnings and messed up texture replacement 2010-10-14 04:15:34 +00:00
taylor 3f1263f39a fix standalone problems with new gr_*_buffer() setup 2010-10-14 04:15:30 +00:00
chief1983 92ef57241c Missed some VS2010 renames too 2010-10-13 18:42:36 +00:00
Zacam 4eaccb5149 Missed some. 2010-10-13 18:25:44 +00:00
chief1983 f338b6f373 Trunk sync - r6601. 2010-10-13 15:43:10 +00:00
Zacam c6a3ffca69 Project Synchronization: Trunk vs Antipodes
2005: Set PDB and Map Exports to explicitly FALSE on Release builds.
Removed <File Configuration> lines (save for in the case of phrases.xml) as they are unnecessary bloat.
Set Output Filenames to Antipodes instead of Trunk.
2008: Set PDB and Map Exports to explicitly FALSE on Release builds.
2010-10-12 22:38:26 +00:00
chief1983 85a0d81dc6 Let's get all the places it says trunk instead of ant-6, instead of just a few of them. 2010-10-12 00:30:26 +00:00
Zacam 849f1487c7 Swifty's FBO changes.
Read: http://www.hard-light.net/forums/index.php?topic=71692.msg1422165#msg1422165
2010-10-11 23:17:39 +00:00
chief1983 0848930abb Damn VC6 and its urges to use absolute paths for everything 2010-10-11 17:51:50 +00:00
Zacam a507e1eb2e And add fsmemory.h to MSVC_2005. 2010-10-09 00:16:12 +00:00
Zacam 75c3b91218 No idea who uses this, but added fsmemory.h to codeblocks. 2010-10-09 00:12:54 +00:00
Zacam 3a18295fb8 Trunk Sync - r6586. 2010-10-08 23:37:32 +00:00
Zacam 19171baf7d Warning Fix: void model_render_buffers
MSVC complains of "C4238: nonstandard extension used : class rvalue used as lvalue".
2010-10-08 23:15:01 +00:00
Zacam a40d0abf52 Trunk Sync - r6581. 2010-10-08 23:10:53 +00:00
Zacam 3b9443d380 Trunk Sync - r6575. 2010-10-06 20:22:00 +00:00
Zacam 2360d36072 Trunk Sync - r6571. 2010-10-06 09:56:50 +00:00
Zacam ab8a83e271 Trunk Sync - r6558. 2010-10-02 07:18:59 +00:00
Zacam 2edf65dfe0 Trunk Sync - r6556. 2010-10-02 00:51:18 +00:00
taylor a2cafff9ee fix bloom issue when clipping is enabled (death scene, cutscene, etc.) 2010-10-01 18:53:50 +00:00
Zacam dabd73e5e1 Trunk Sync - r6545. 2010-10-01 04:25:38 +00:00
Zacam 2a6e9c8662 Trunk Sync - r6543. 2010-10-01 04:13:00 +00:00
Zacam 1752bcaee8 Trunk Sync - r6537. 2010-09-30 06:10:56 +00:00
chief1983 053539e0ca Should help VC6 out a little bit but I'm still having problems. 2010-09-28 16:05:35 +00:00
Zacam a4f09bf1b5 Trunk Sync - r6532. 2010-09-27 19:04:53 +00:00
taylor 4da431b000 texture_target isn't completely valid until after opengl_create_texture() has been called 2010-09-26 21:16:09 +00:00
taylor d387a4644e re-comment debug message 2010-09-26 21:16:07 +00:00
Zacam d259ba852b Trunk Sync - r6524. 2010-09-26 18:17:08 +00:00
Echelon9 36e983b786 Code cleanup: Remove redundant Num_observer_obs ahead of converting Observers array to an STL container 2010-09-26 10:39:03 +00:00
Echelon9 0b8234bbb9 Code cleanup: No need to track separately the Num_files variable when Cutscene_list is an STL container 2010-09-26 10:33:51 +00:00
The_E 15c456250b Ooops, minor typo 2010-09-26 03:25:45 +00:00
Zacam f9a5615c64 Trunk Sync - r6515 (6506, 6507, 6508, 6511, 6512, 5614 actually committed, 5613/6515 ignored) 2010-09-26 01:44:56 +00:00
Zacam 457434d3eb Fix to add :AdditionalOptions="/FORCE:MULTIPLE" to MSVC 2008 to allow Fred compilation. 2010-09-26 01:26:06 +00:00
The_E d1a1bf068d Normalized line endings 2010-09-26 01:24:10 +00:00
The_E 84e64dcfa8 Bringing back the old-style shader compilation report 2010-09-26 01:23:06 +00:00
The_E 73c500259c Ooops, those are unneeded 2010-09-24 16:48:22 +00:00
The_E 32c46b8ac4 Fix FRED building. Note that this is partially an ugly hack through using the linkers' FORCE:MULTIPLE option. See also: http://msdn.microsoft.com/en-us/library/70abkas3.aspx 2010-09-24 16:34:33 +00:00
The_E aace5f90c7 Hopefully fix Xcode compilation issue reported by chief1983 2010-09-23 20:53:39 +00:00
chief1983 0c9fbb6b22 Add fsmemory.h to Xcode project 2010-09-23 17:06:07 +00:00
The_E 485d014b6d taylor's fix for the loading issues. Please regenerate your cache files. 2010-09-23 06:09:18 +00:00
The_E 335a9d80ec Only free what actually needs freeing 2010-09-23 05:17:01 +00:00
chief1983 06b703df07 Add fsmemory.h to the Linux build stuff. 2010-09-23 03:53:19 +00:00
chief1983 bdc6defdd0 Add fsmemory.h to VS2008 2010-09-23 03:31:33 +00:00
The_E 998fa46e57 Let's format this properly, shall we? 2010-09-23 03:25:23 +00:00
Zacam 753dfaeb3b Quick fix noted by The E, keeps really huge models (Like BP's UED Solaris) from crashing the exec. 2010-09-23 03:22:16 +00:00
The_E 21400d3688 Changed VS2010 project files to include fsmemory.h and to change the output name for the binaries 2010-09-23 02:32:54 +00:00
The_E bb6eea5f21 taylor's diff to make movies work again. See http://www.hard-light.net/forums/index.php?topic=71692.msg1417039#msg1417039 2010-09-23 02:31:31 +00:00
Zacam 9dac4b2bc4 From taylor: go_faster 2010-09-23 02:19:27 +00:00
Zacam 88377709f3 This is more like it. These files diff'd as different than Trunk versions, so I over-rode them with Trunk versions so that Antipodes and Trunk can finally have some 1:1 parity. 2010-09-23 02:14:26 +00:00
The_E 6d1909e823 Adding the explanation for disabling the 4290 warning 2010-09-23 02:01:39 +00:00
Zacam 585281635d Trunk Sync - r4290 2010-09-22 22:39:29 +00:00
Zacam 3bebbbbcd0 Trunk Sync r6269. I hope this works. This is supposed to be a Trunk overlay merge into Antipodes, which should mean that Antipodes is now a copy of Trunk in all respects. 2010-06-29 22:09:34 +00:00
Zacam cfc49b7680 taylor's changes3.diff
(see: http://www.hard-light.net/forums/index.php?topic=68146.msg1353724#msg1353724)
Some slight changes for alignment and whitespace (space vs tab), otherwise unchanged.
2010-03-21 21:00:26 +00:00
Zacam 139049947b Yet another fix on the broken commit for the Trunk update. 2010-03-02 22:28:39 +00:00
Zacam d340940da9 Oh ffs. No more Trunk syncs while at work anymore. Somewhere, a } got lost. 2010-03-02 22:11:53 +00:00
Zacam 83d895fce2 taylors 2nd sound code diff from Reply #99 on 03-01-2010, 00:08:44 on Testing forum. Sans Project file edits, as they have already been done. 2010-03-01 18:28:21 +00:00
Zacam d283dfd832 Trunk Sync - r5961 2010-03-01 18:22:26 +00:00
Zacam 287bc0294a Applied Goober5000's Trunk Commit r5943 to the MSVC 2005 Project Files and the cleaned them up. 2010-02-24 05:53:15 +00:00
chief1983 7ba1ec1738 Taylor's recent updates to the code 2010-02-24 00:21:41 +00:00
chief1983 fa9a637819 Add some missing files to build with the code target in Xcode 2010-02-23 21:47:41 +00:00
Zacam 15a2c3b584 Set SVN EOL Types on he new files.
From chief1983: OS X XCode project update for the new Sound Code.
2010-02-23 18:10:14 +00:00
Zacam c430677499 New Sound code addendum: For some STUPID reason, when I applied the patch at work, one file did not delete, one did not create. 2010-02-23 02:43:26 +00:00
Zacam 98b0e40445 The_E's fix for FRED compiling with taylors sound code. 2010-02-23 00:20:06 +00:00
Zacam f969eb52a2 taylors Sound Code. Linux, MSVC 6, 2005 & 2008 compiling.
(Mac OS-X Compiling still needs setup for the file changes)
2010-02-23 00:15:32 +00:00
Zacam 7a399e1db3 Trunk Sync - r5931. Updated build output filenames to 6, MSVC 6 project also outputs _ant (instead of _trunk) so as not to over-write Trunk build compiles. 2010-02-22 21:37:43 +00:00
Zacam c6c23bbd00 Trunk Sync - r5888
Special notes: MSVC_6_Release was corrected by hand, but none of the changes made to MSVC_6 were carried over.
2010-02-06 02:27:21 +00:00
Zacam 2a154a3a97 Updates libpng to 1.2.42. This is currently the highest and newest supportable MAX_VERSION, as 1.4.0 will break things.
No other changes for this lib upgrade needed.
2010-02-05 04:36:52 +00:00
Zacam 97790afcf1 Apparently, I mis-understood and left the cfclose in. Let's try this again. 2010-02-04 23:34:13 +00:00
Zacam 8c456a1e75 Let's see if this fixes things, or causes a snowball. If it does, everybody say thank you to ni1s. If it doesn't, then it's still my fault somehow. 2010-02-04 22:31:58 +00:00
Zacam ba404d8686 chief1983's fixes for Antipodes VC_6_Release distribution for PNG.
Additionally, corrected output names for Antipodes from *_trunk_*.exe to *_ant_5_*.exe.
2010-01-30 23:48:23 +00:00
Zacam 0692473238 Check on Speech for VC_6_Release 2010-01-29 23:43:29 +00:00
Flaming_Sword 29752c6ec1 PNG support - fixed MSVC6 workspace file 2010-01-26 04:57:18 +00:00
Zacam fc13daba42 Deleted and set to ignore. 2010-01-19 21:31:10 +00:00
Zacam ba66cee720 Trunk Sync - r5825 2010-01-17 23:13:55 +00:00
Zacam 456b98a468 Add's PNG compilation support for XCode, by Echelon9. 2010-01-15 22:00:49 +00:00
Zacam cd4c79dfa9 Fixes ExternalDLL in MSVC_6_Release.
Adds Makefile data for PNG for Linux Platforms.
Patches SPHelper.h for compiling speech under 2008 with less warnings.
2010-01-15 21:57:30 +00:00
Zacam c65b259ddd Potential start for adding PNG to MSVC_6_Release from Flaming Sword originally. 2010-01-12 05:07:23 +00:00
Zacam cd13843cbe Checked a whitespace difference out of 2008.
Removed "trackir.lib" and "../../trackir/lib" from MSVC 6 Release files.
2010-01-12 04:33:31 +00:00
Flaming_Sword 4943d9aafb Fixed possible calling cfclose() on NULL 2010-01-11 10:42:26 +00:00
Zacam b0cd916edb Trunk Sync - r5792 2010-01-08 02:50:10 +00:00
Flaming_Sword a3c2998f4f PNG support - added missing files 2010-01-06 09:17:23 +00:00
Flaming_Sword 2198d020ce PNG support 2010-01-06 08:42:32 +00:00
Flaming_Sword ce4c32b6d7 Exe names change for msvc2008 2010-01-06 08:29:23 +00:00
Flaming_Sword 2c47356550 trackir cleanup in msvc2008 2010-01-06 08:27:50 +00:00
Flaming_Sword 06ce9f76f6 Trunk sync to 5779 2010-01-06 08:24:54 +00:00
Flaming_Sword c07b803065 $Alt name:
For ships and weapon tbms - renaming existing tbl entries in mods
2010-01-05 12:25:14 +00:00
Flaming_Sword 849506485f Trunk sync to 5771 2010-01-05 10:13:32 +00:00
Flaming_Sword 258c434207 VC6 project file update for trackir changes 2010-01-05 10:00:01 +00:00
Flaming_Sword d227e102f7 Trunk sync to 5769 2010-01-05 09:19:55 +00:00
portej05 31e620931e Trunk Sync 2009-12-14 13:34:13 +00:00
Hery 7ec9f92db1 Post-processing
* the main post-processing code
 * shaders manager (support for the main and post-processing shaders)
 * simple post-processing effects
 * bloom
 * depth of field (inactive)
 * wrappers for OpenGL textures, render buffers and FBO
2009-11-24 15:57:49 +00:00
Hery b725a5e8bb Trunk sync (pending PostProcessing patch) 2009-11-24 15:31:34 +00:00
Flaming_Sword 2ccdcbc0fe Trunk sync 2009-11-19 12:14:17 +00:00
portej05 0ca19eb893 Trunk sync 2009-11-13 09:38:30 +00:00
portej05 391bcbfc64 Icons Patch + Trunk Sync (argh! on the two at once!) 2009-11-12 15:44:33 +00:00
portej05 d1a1f39974 Trunk Sync 2009-11-03 08:21:16 +00:00
portej05 6be1003994 Shouldn't have committed .aps or .cpp.bak 2009-10-28 16:30:45 +00:00
portej05 811755475d Zacams Icon Update for FSO 2009-10-28 16:28:38 +00:00
portej05 963d965699 Trunk Sync pending Zacams changes 2009-10-26 09:16:42 +00:00
portej05 763dc6f25c Trunk sync after Antipodes #3 2009-09-26 05:54:19 +00:00
portej05 0974d547a4 PDB_DEBUGGING for antipodes 2009-09-18 13:50:13 +00:00
portej05 d8b132d846 Antipodes3 from Flaming_Sword 2009-09-12 16:03:52 +00:00
portej05 b981f4147f Trunk Sync 2009-09-12 15:18:09 +00:00
portej05 d32784123b Sync to include Sushi's 5581 patch 2009-09-09 04:51:12 +00:00
portej05 bc99d2520f Trunk sync 2009-09-09 04:07:40 +00:00
portej05 8eb87b45b9 Trunk Sync for FS' EFF code 2009-09-03 14:20:46 +00:00
portej05 c1ef2b9f61 Trunk Sync 2009-08-28 11:58:32 +00:00
portej05 3d32f78038 Hery's shaders patch 2009-08-09 14:38:14 +00:00
portej05 d45b249561 Trunk sync (pending Hery's shaders patch) 2009-08-09 13:47:51 +00:00
portej05 302f615cff Trunk sync 2009-08-03 16:15:44 +00:00
portej05 eb9f23d6fd Trunk Sync 2009-07-31 09:27:55 +00:00
portej05 aaf3a9bf09 safe_strings changes 2009-07-26 05:15:24 +00:00
portej05 ffd33dd5fe Trunk Sync (Rodos overlong word fix) 2009-07-22 06:02:16 +00:00
Goober5000 b08d35d1d0 2009-07-22 04:21:53 +00:00
1495 changed files with 199041 additions and 252767 deletions

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
root = true
[*.{h,cpp}]
indent_style = tab
+283
View File
@@ -0,0 +1,283 @@
*.o
*.a
.dirstamp
libtool
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
compile
.deps/
code/.deps/
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
config.*
code/fs2_open_*
code/wxFRED2_*
configure
depcomp
install-sh
missing
.svn
*.layout
projects/Xcode/Frameworks/
#========
#OS junk files
[Tt]humbs.db
*.DS_Store
#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.sdf
*.opensdf
*.unsuccessfulbuild
ipch/
[Oo]bj/
[Bb]in
[Dd]ebug*/
[Rr]elease*/
Ankh.NoLoad
*.VC.db
*.VC.VC.opendb
#MonoDevelop
*.pidb
*.userprefs
#Tooling
_ReSharper*/
*.resharper
[Tt]est[Rr]esult*
*.sass-cache
#Project files
[Bb]uild/
#Subversion files
.svn
# Office Temp Files
~$*
# vim Temp Files
*~
#NuGet
packages/
*.nupkg
#ncrunch
*ncrunch*
*crunch*.local.xml
# visual studio database projects
*.dbmdl
#Test files
*.testsettings
#===========
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.1
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
# - added line-by-line explanations for EVERYTHING (some were missing)
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
#########################
#####
# OS X temporary files that should never be committed
#
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
.DS_Store
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
.Trashes
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
*.swp
# *.lock - this is used and abused by many editors for many different things.
# For the main ones I use (e.g. Eclipse), it should be excluded
# from source-control, but YMMV
*.lock
#
# profile - REMOVED temporarily (on double-checking, this seems incorrect; I can't find it in OS X docs?)
#profile
####
# Xcode temporary files that should never be committed
#
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...
*~.nib
####
# Xcode build files -
#
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"
DerivedData/
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"
build/
#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
#
# This is complicated:
#
# SOMETIMES you need to put this file in version control.
# Apple designed it poorly - if you use "custom executables", they are
# saved in this file.
# 99% of projects do NOT use those, so they do NOT want to version control this file.
# ..but if you're in the 1%, comment out the line "*.pbxuser"
# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html
*.pbxuser
# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html
*.mode1v3
# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html
*.mode2v3
# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file
*.perspectivev3
# NB: also, whitelist the default ones, some projects need to use these
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
####
# Xcode 4 - semi-personal settings
#
#
# OPTION 1: ---------------------------------
# throw away ALL personal settings (including custom schemes!
# - unless they are "shared")
#
# NB: this is exclusive with OPTION 2 below
xcuserdata
# OPTION 2: ---------------------------------
# get rid of ALL personal settings, but KEEP SOME OF THEM
# - NB: you must manually uncomment the bits you want to keep
#
# NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X,
# or manually install git over the top of the OS X version
# NB: this is exclusive with OPTION 1 above
#
#xcuserdata/**/*
# (requires option 2 above): Personal Schemes
#
#!xcuserdata/**/xcschemes/*
####
# XCode 4 workspaces - more detailed
#
# Workspaces are important! They are a core feature of Xcode - don't exclude them :)
#
# Workspace layout is quite spammy. For reference:
#
# /(root)/
# /(project-name).xcodeproj/
# project.pbxproj
# /project.xcworkspace/
# contents.xcworkspacedata
# /xcuserdata/
# /(your name)/xcuserdatad/
# UserInterfaceState.xcuserstate
# /xcsshareddata/
# /xcschemes/
# (shared scheme name).xcscheme
# /xcuserdata/
# /(your name)/xcuserdatad/
# (private scheme).xcscheme
# xcschememanagement.plist
#
#
####
# Xcode 4 - Deprecated classes
#
# Allegedly, if you manually "deprecate" your classes, they get moved here.
#
# We're using source-control, so this is a "feature" that we do not want!
*.moved-aside
# .xccheckout
#
# Per http://stackoverflow.com/questions/18340453/should-xccheckout-files-in-xcode5-be-ignored-under-vcs
#
*.xccheckout
####
# Visual Studio Code
.vscode
####
# Documentation
#
documentation/doxygen/*
!documentation/doxygen/.gitkeep
.idea/*
projects/*
+6
View File
@@ -0,0 +1,6 @@
[submodule "cmake/external/cotire"]
path = cmake/external/cotire
url = https://github.com/sakra/cotire.git
[submodule "cmake/external/rpavlik-cmake-modules"]
path = cmake/external/rpavlik-cmake-modules
url = https://github.com/asarium/cmake-modules.git
+93
View File
@@ -0,0 +1,93 @@
language: generic
sudo: required
dist: trusty
cache:
directories:
- $HOME/cmake
addons:
apt:
packages:
- ninja-build
- libopenal-dev
- libogg-dev
- libvorbis-dev
- libtheora-dev
- libreadline6-dev
- libpng12-dev
- libjpeg62-dev
- liblua5.1-0-dev
- libjansson-dev
- libsdl2-dev
coverity_scan:
project:
name: "scp-fs2open/fs2open.github.com"
notification_email: [email protected]
build_command: "ci/travis/script.sh"
# must match TRAVIS_BRANCH check below
branch_pattern: coverity_scan
deploy:
- provider: releases
api_key:
secure: "Wdt4Ccefo7a0ZDjEJQJgpghh7n72FtNJuKSAPUvoz4gtEX6Ct9J8yJI1t9V3jE3CTbbLJ21/Q6eZRDfT7UfNJe5DdepoJsP9DeFhKMWqQCq+AChqQWlm0KeZAffJoJreL8vXYhnRYcLT9ceZHEH6AqwN9TPV+xJziGPISAkYNZ8="
skip_cleanup: true
file_glob: true
file: "/tmp/builds/*"
on:
condition: '"$RELEASE_BUILD" == true'
tags: true
- provider: bintray
user: sirknightly
key:
secure: "CZtvDW/zPf1Nxru21i8Wd+9hgiBRA8VowWBX0gmCOGgRq9WHISttKQQmBWGHuyVZ3rYvtE4Va2bR+2qRN+TFNkUUuOCOQkdBJTCal9nS3G/LprEmsOashG0Q5PTfMMBnlKzKxaxGJW6UhFj2GySmHEAjsFLVpuNWGJeeZgZQ3UE="
file: ci/bintray.json
on:
condition: '"$NIGHTLY_BUILD" == true'
tags: true
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
# also note that fork's don't get access to secure keys
# you have to test using a branch in the main repo
- secure: "C3wF967ZeliwwP1vC12EMIBOaC568n26Z/cPnwzn317ve59DWH3YSfPZVgvt08GzmaXITGGsJvPB+qxfGoKvQzYE4O1B73q81RpUe5pB3IhF+ThQ91VfQZIRJR5xEGJaLINUlHTTZGX5jxlkVO9wAcauVj/s3b8sQ3dvUZauPvk="
matrix:
include:
# note that gcc Debug MUST be 1st for Coverity
- os: linux
compiler: gcc
env: CONFIGURATION="Debug"
- os: linux
compiler: clang
env: CONFIGURATION="Debug" CC=clang CXX=clang++
- os: osx
compiler: clang
env: CONFIGURATION="Debug"
- os: linux
compiler: gcc
env: CONFIGURATION="Release"
- os: linux
compiler: clang
env: CONFIGURATION="Release" CC=clang CXX=clang++
- os: osx
compiler: clang
env: CONFIGURATION="Release"
before_install:
# ugly hack; if running a coverity scan abort all except the 1st build
# see note re gcc compiler above needing to be 1st
# also note that branch_pattern & the TRAVIS_BRANCH check must match
# unfortunately COVERITY_SCAN_BRANCH isn't defined until later in the
# build process
- if ([[ "${TRAVIS_JOB_NUMBER##*.}" != "1" ]] && [[ "${TRAVIS_BRANCH}" == "coverity_scan" ]]); then false ; fi
- source "./ci/travis/check_release.sh"
- "./ci/travis/before_install.sh"
install:
- "./ci/travis/install.sh"
- export PATH=$HOME/cmake/bin:$PATH
before_script:
- "./ci/travis/before_script.sh"
script:
- if [ "$BUILD_DEPLOYMENT" = true ] ; then ./ci/travis/release.sh ; else ./ci/travis/script.sh ; fi
before_deploy:
- "./ci/travis/before_deploy.sh"
+186
View File
@@ -0,0 +1,186 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Make sure the source and binary directory are not the sample
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
message(FATAL_ERROR "Binary and source directory can not be the same! Choose another build directory.")
endif()
include(cmake/util.cmake)
# Set a few policies
set_policy(CMP0051 OLD)
set_policy(CMP0053 NEW)
set_policy(CMP0054 NEW)
SET(FSO_PROJECT_DESCRIPTION "Open source project based on the original FreeSpace 2 source code.")
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Executable output path")
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Library output path")
# CMAKE_INSTALL_PREFIX is defined but also overwritten by the PROJECT command so we need to set it later
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(RESET_INSTALL_PREFIX TRUE)
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
# Reset this variable
SET(TARGET_COPY_FILES "" CACHE INTERNAL "" FORCE)
SET(TARGET_COPY_DIRS "" CACHE INTERNAL "" FORCE)
### Define options and editable variables in the section below:
# This is only needed for single configuration generators so don't annoy others
if(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Default build configuration used." FORCE)
message(WARNING "CMAKE_BUILD_TYPE was not specified, defaulting to Release configuration.")
endif(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
# Override standard CMake configurations
set(CMAKE_CONFIGURATION_TYPES Debug Release FastDebug CACHE STRING "Available configurations" FORCE)
PROJECT(FS2_Open)
IF(CMAKE_CROSSCOMPILING)
SET(IMPORT_EXE_DIR "IMPORT_EXE_DIR-NOTFOUND" CACHE FILEPATH "Required for a cross compiling build, point to binary directory of a cmake build for the real OS")
INCLUDE(${IMPORT_EXE_DIR}/ImportExecutables.cmake)
ENDIF(CMAKE_CROSSCOMPILING)
# Check if the external modules exists
IF(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/rpavlik-cmake-modules/launcher-templates")
message(FATAL_ERROR "External submodules could not be found. Please make sure you have updated your submodules.")
endif()
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/finder")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/rpavlik-cmake-modules")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/cotire/CMake")
IF(RESET_INSTALL_PREFIX)
IF(NOT $ENV{FS2PATH} STREQUAL "")
IF(NOT IS_DIRECTORY $ENV{FS2PATH})
MESSAGE(WARNING "The path '$ENV{FS2PATH}' of the environment variable FS2PATH does not point to a directory! Install prefix wasn't set.")
ELSE(NOT IS_DIRECTORY $ENV{FS2PATH})
SET(CMAKE_INSTALL_PREFIX "$ENV{FS2PATH}" CACHE FILEPATH "Install path" FORCE)
FILE(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX} CMAKE_INSTALL_PREFIX)
ENDIF(NOT IS_DIRECTORY $ENV{FS2PATH})
ELSE(NOT $ENV{FS2PATH} STREQUAL "")
MESSAGE(STATUS "NO FS2PATH environment variable found, you can define this to point to your freespace install but it is not required.")
ENDIF(NOT $ENV{FS2PATH} STREQUAL "")
ENDIF(RESET_INSTALL_PREFIX)
IF (WIN32)
OPTION(FSO_USE_SPEECH "Use Windows specific text-to-speach libraries" ON)
OPTION(FSO_USE_VOICEREC "Enable voice recognition support" ON)
OPTION(FSO_BUILD_FRED2 "Build FRED2 binary" ON)
elseif(UNIX)
option(FSO_BUILD_APPIMAGE "Build an AppImage package" OFF)
set(APPIMAGE_ASSISTANT "" CACHE STRING "The root directory of an AppImage clone.")
ENDIF(WIN32)
OPTION(FSO_BUILD_TOOLS "Build tools related to FSO" OFF)
OPTION(FSO_DEVELOPMENT_MODE "Generate binaries in development mode, only use if you know what you're doing!" OFF)
OPTION(FSO_BUILD_WXFRED2 "Build wxFRED2 binary" OFF)
IF(WIN32 OR APPLE)
# On windows and mac the default should be to always build the included libraries
SET(FSO_BUILD_INCLUDED_LIBS_DEFAULT ON)
ELSE()
SET(FSO_BUILD_INCLUDED_LIBS_DEFAULT OFF)
ENDIF()
OPTION(FSO_BUILD_INCLUDED_LIBS "Build and use the included libraries istead of using the system headers and libraries" ${FSO_BUILD_INCLUDED_LIBS_DEFAULT})
OPTION(FSO_USE_LUAJIT "Use LuaJIT for Lua scripting, needs a working internet connection!" OFF)
OPTION(FSO_USE_OPENALSOFT "Download and build OpenAL Soft instead of using the system libraries" OFF)
OPTION(FSO_FATAL_WARNINGS "Determines if warnings in the build are considered fatal errors, primarily used for CI" OFF)
SET(FSO_FREESPACE_PATH "${CMAKE_INSTALL_PREFIX}" CACHE FILEPATH "The path of the FreeSpace directory you want to use. Please note that you will have to change CMAKE_INSTALL_PREFIX if you change this at some point.")
SET(FSO_RUN_ARGUMENTS "" CACHE STRING "Additional arguments passed to a generated executable when run with the generated build files.")
option(FSO_INSTALL_DEBUG_FILES "Install some debug files (currently only PDB files on windows)" OFF)
OPTION(COTIRE_ENABLE "Enable cotire, this speeds up builds but may cause issues while developing (default = OFF)" OFF)
MARK_AS_ADVANCED(FORCE FSO_CMAKE_DEBUG)
MARK_AS_ADVANCED(FORCE FSO_BUILD_INCLUDED_LIBS)
MARK_AS_ADVANCED(FORCE FSO_USE_OPENALSOFT)
MARK_AS_ADVANCED(FORCE FSO_USE_LUAJIT)
MARK_AS_ADVANCED(FORCE FSO_DEVELOPMENT_MODE)
MARK_AS_ADVANCED(FORCE FSO_FATAL_WARNINGS)
MARK_AS_ADVANCED(FORCE COTIRE_ENABLE)
mark_as_advanced(FORCE FSO_INSTALL_DEBUG_FILES)
IF(COTIRE_ENABLE)
# Include cotire file from https://github.com/sakra/cotire/
include(cotire)
ENDIF(COTIRE_ENABLE)
INCLUDE(globals)
INCLUDE(toolchain)
INCLUDE(platforms)
include(version)
INCLUDE(headers)
SET(GENERATED_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated_source)
include(generateHeaders)
if(FSO_BUILD_APPIMAGE)
include(appimage)
endif()
# This includes source code for some tools, either used in the build or also for something else
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(code)
ADD_SUBDIRECTORY(freespace2)
IF(FSO_BUILD_FRED2)
ADD_SUBDIRECTORY(fred2)
ENDIF(FSO_BUILD_FRED2)
IF(FSO_BUILD_WXFRED2)
ADD_SUBDIRECTORY(wxfred2)
ENDIF(FSO_BUILD_WXFRED2)
if ("${CMAKE_VERSION}" VERSION_GREATER "3.5")
# Default to using Freespace2 as startup project if CMake supports it.
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Freespace2)
endif()
IF(MSVC_USE_RUNTIME_DLL)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${BINARY_DESTINATION}")
IF(FSO_BUILD_FRED2)
SET(CMAKE_INSTALL_MFC_LIBRARIES ON)
ENDIF(FSO_BUILD_FRED2)
INCLUDE(InstallRequiredSystemLibraries)
ENDIF(MSVC_USE_RUNTIME_DLL)
include(package)
include(doxygen)
# Print used options to log
IF (WIN32)
message(STATUS "Building FRED2: ${FSO_BUILD_FRED2}")
message(STATUS "Using text to speech: ${FSO_USE_SPEECH}")
message(STATUS "Using voice recogition: ${FSO_USE_VOICEREC}")
elseif(UNIX)
message(STATUS "Building AppImage: ${FSO_BUILD_APPIMAGE}")
ENDIF()
message(STATUS "Building FSO tools: ${FSO_BUILD_TOOLS}")
message(STATUS "Building wxFRED: ${FSO_BUILD_WXFRED2}")
message(STATUS "Fatal warnings: ${FSO_FATAL_WARNINGS}")
+21 -1
View File
@@ -1,6 +1,26 @@
ChangeLog for fs2_open. All times are UTC.
Updated 2002-10-31 03:46
Features: September 2013
http://www.hard-light.net/forums/index.php?topic=85700.0
- show-subtitle-text can now display messages as well as raw text - Goober5000
- toggle subsytem scanning, scannable, cargo revealed, hidden from sensors, stealth and friendly stealth added to the alter-ship-flag sexp - karajorma
- Support added to add more languages besides English, French, German and Polish, leading the way to better localization! - karajorma
- event.log can now snapshot events checked in a frame and record the status of an event the previous time it was checked as well as the current state - karajorma
- added a player-is-cheating sexp - The E
- allow a user-specified number of credit images - Goober5000
- allow the specification of the positions of medals, callsigns and labels on the medal screen. - Goober5000
- lua function to check if a ship is warp capable, and access to a ship's auto-aim FOV - zookeeper
- is-facing now works for things that aren't ships (like waypoints!) - zookeeper
- experimental configurations to make AVX builds (see this post for more explainations) - The E
- new ship flag to enable smarter AI use of afterburners. Now it can use them while flying waypoints or attacking capital ships (use the free-afterburner-use flag with alter-ship-flag) - Admiral MS
- the number of medals is now dynamic! - Goober5000
- frame profiling code, see what exactly is slowing down FreeSpace. (Mostly for devs or coders) - Swifty + The E
- allowing fade-in and fade-out sexps to use any color, not just black, white and red. - Goober5000
==================================================================
( massive gap in updates, maybe this will be filled in someday...)
==================================================================
2002-10-30 22:57 randomtiger
-65
View File
@@ -1,65 +0,0 @@
# Makefile.am for fs2_open (top level)
#
# This file uses GNU Automake to generate makefiles
SUBDIRS = code
EXTRA_DIST = \
FS2OpenSCPReadMe.doc \
projects/MSVC_2005/Freespace2.sln \
projects/MSVC_2005/Freespace2.vcproj \
projects/MSVC_2005/code.vcproj \
projects/MSVC_6/Fred2.dsp \
projects/MSVC_6/Freespace2.dsp \
projects/MSVC_6/Freespace2.dsw \
projects/MSVC_6/code.dsp \
projects/MSVC_6/libjpeg.dsp \
projects/MSVC_6/liblua.dsp \
projects/MSVC_6/wxFRED2.dsp \
projects/Xcode/English.lproj/InfoPlist.strings \
projects/Xcode/FS2_Open.icns \
projects/Xcode/FS2_Open.xcodeproj/project.pbxproj \
projects/Xcode/Frameworks.tgz \
projects/Xcode/Info-debug.plist \
projects/Xcode/Info.plist \
projects/Xcode/README.Xcode \
projects/Xcode/SDLMain.h \
projects/Xcode/SDLMain.m
# D_ variants are defaults and should always be used
AM_CXXFLAGS = -I./code @D_CFLAGS@
AM_LDFLAGS = @D_LDFLAGS@
EXTRA_PROGRAMS = cfilearchiver cfileextractor
###############################################################################
##
## Begin utilitites
##
# cfilearchiver -- to create VPs
cfilearchiver_SOURCES = \
code/cfilearchiver/cfilearchiver.cpp
# cfileextractor -- to extract files from VPs
cfileextractor_SOURCES = \
code/cfileextractor/cfileextractor.cpp
# catch all to build utilitites
tools: cfilearchiver cfileextractor
# cleaning
clean-tools:
-test -z "$(EXTRA_PROGRAMS)" || rm -f $(EXTRA_PROGRAMS)
##
## End utilitites
##
###############################################################################
# make sure we get this stuff cleaned up
clean-generic: clean-tools
-11
View File
@@ -1,11 +0,0 @@
The "projects" directory contains ready projects for:
Microsoft Visual C++ 6
Microsoft Visual C++ 2005
Microsoft Visual C++ 2008
Micrsofot Visual C++ 2010
Apple Xcode
Code::Blocks
See the ChangeLog to see what's new.
See the INSTALL file for instructions on how to build fs2_open.
+38
View File
@@ -0,0 +1,38 @@
FreeSpace2 *S*ource *C*ode *P*roject
==
[![Build Status](https://travis-ci.org/scp-fs2open/fs2open.github.com.svg?branch=master)](https://travis-ci.org/scp-fs2open/fs2open.github.com)
[![Coverity](https://img.shields.io/coverity/scan/870.svg)](https://scan.coverity.com/projects/870)
Building
--
For building you will need [CMake](http://www.cmake.org/cmake/resources/software.html). Version 3.4 is required. Once you have installed CMake you should create a build directory where the project/make files should be created, **do not create them inside the source tree!**<br>
<br>
On Windows you can use the `cmake-gui` executable to get a nice GUI, on Unix just use `cmake`. Use the newly created directory as build directory (change to this directory on Unix) and run cmake. On Windows this can be done by clicking the `Configure` button. Choose your compiler version and hit `Generate` when configuring is done. <br>
Depending on the makefile generator used build the `all` or `ALL_BUILD` target to compile the project.<br>
### Available variables to control the build
* `FSO_BUILD_WXFRED2`: Build the wxfred2 project, requires wxWidgets
* `FSO_FREESPACE_PATH`: Sets the path of your FreeSpace install, can be used to automatically run the generated executables with the correct working directory, this is an optional variable. By default this will use the value of the `FS2PATH` environment variable.
* `FSO_BUILD_TOOLS`: Build some tools related to FSO
#### Windows only variables
* `FSO_BUILD_FRED2`: Build FRED2, requires a Visual Studio version that ships with MFC
* `FSO_USE_SPEECH`: Build a binary with text-to-speech support
* `FSO_USE_VOICEREC`: Build a binary with voice recognition support
#### Advanced variables
You should only use these variables if you know what you're doing
* `FSO_CMAKE_DEBUG`: Print CMake debugging informations
* `FSO_BUILD_INCLUDED_LIBS`: Build libraries from the included source
* `FSO_USE_OPENALSOFT`: Use [OpenALSoft](http://kcat.strangesoft.net/openal.html) for OpenAL support
* `FSO_USE_LUAJIT`: Use [luajit](http://luajit.org/) as a replacement for lua
* `FSO_DEVELOPMENT_MODE`: Toggles some development behavior, only use if you really need it.
* `FSO_RUN_ARGUMENTS`: If you run an executable from within the project, these arguments will also be passed to the executable
* `FSO_BUILD_POSTFIX`: Sets a postfix to be added to the executable name, may be useful for release candidates.
#### Visual Studio specific variables
* `MSVC_USE_RUNTIME_DLL`: Use the DLL version of the runtime, experimental and not well tested.
* `MSVC_SIMD_INSTRUCTIONS`: The instruction set the executables will be optimized for.
### Generating an installation package
CMake can automaticall generate installation packages of the project. To do this you will just need to run the `package` target of the build system and the package will be placed inside your build directory. On Windows you will have to install [NSIS](http://nsis.sourceforge.net/Main_Page) to use this.
-889
View File
@@ -1,889 +0,0 @@
# Configure paths for SDL
# Sam Lantinga 9/21/99
# stolen from Manish Singh
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN([AM_PATH_SDL],
[dnl
dnl Get the cflags and libraries from the sdl-config script
dnl
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
sdl_prefix="$withval", sdl_prefix="")
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
sdl_exec_prefix="$withval", sdl_exec_prefix="")
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
, enable_sdltest=yes)
if test x$sdl_exec_prefix != x ; then
sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
fi
fi
if test x$sdl_prefix != x ; then
sdl_args="$sdl_args --prefix=$sdl_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_prefix/bin/sdl-config
fi
fi
AC_REQUIRE([AC_CANONICAL_TARGET])
PATH="$prefix/bin:$prefix/usr/bin:$PATH"
AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
no_sdl=""
if test "$SDL_CONFIG" = "no" ; then
no_sdl=yes
else
SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_sdltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl
dnl Now check if the installed SDL is sufficiently new. (Also sanity
dnl checks the results of sdl-config to some extent
dnl
rm -f conf.sdltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro;
char *tmp_version;
/* This hangs on some systems (?)
system ("touch conf.sdltest");
*/
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_sdl_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_sdl_version");
exit(1);
}
if (($sdl_major_version > major) ||
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_sdl" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$SDL_CONFIG" = "no" ; then
echo "*** The sdl-config script installed by SDL could not be found"
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the SDL_CONFIG environment variable to the"
echo "*** full path to sdl-config."
else
if test -f conf.sdltest ; then
:
else
echo "*** Could not run SDL test program, checking why..."
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include "SDL.h"
int main(int argc, char *argv[])
{ return 0; }
#undef main
#define main K_and_R_C_main
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding SDL or finding the wrong"
echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means SDL was incorrectly installed"
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
SDL_CFLAGS=""
SDL_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
rm -f conf.sdltest
])
dnl ---------------------------------------------------------------------------
dnl Macros for wxWindows detection. Typically used in configure.in as:
dnl
dnl AC_ARG_ENABLE(...)
dnl AC_ARG_WITH(...)
dnl ...
dnl AM_OPTIONS_WXCONFIG
dnl ...
dnl ...
dnl AM_PATH_WXCONFIG(2.3.4, wxWin=1)
dnl if test "$wxWin" != 1; then
dnl AC_MSG_ERROR([
dnl wxWindows must be installed on your system
dnl but wx-config script couldn't be found.
dnl
dnl Please check that wx-config is in path, the directory
dnl where wxWindows libraries are installed (returned by
dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
dnl equivalent variable and wxWindows version is 2.3.4 or above.
dnl ])
dnl fi
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
dnl
dnl LDFLAGS="$LDFLAGS $WX_LIBS"
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl AM_OPTIONS_WXCONFIG
dnl
dnl adds support for --wx-prefix, --wx-exec-prefix and --wx-config
dnl command line options
dnl ---------------------------------------------------------------------------
AC_DEFUN([AM_OPTIONS_WXCONFIG],
[
AC_ARG_WITH(wx-prefix, [ --with-wx-prefix=PREFIX Prefix where wxWindows is installed (optional)],
wx_config_prefix="$withval", wx_config_prefix="")
AC_ARG_WITH(wx-exec-prefix,[ --with-wx-exec-prefix=PREFIX Exec prefix where wxWindows is installed (optional)],
wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
AC_ARG_WITH(wx-config,[ --with-wx-config=CONFIG wx-config script to use (optional)],
wx_config_name="$withval", wx_config_name="")
])
dnl ---------------------------------------------------------------------------
dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
dnl Test for wxWindows, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
dnl (the latter is for static linking against wxWindows). Set WX_CONFIG_NAME
dnl environment variable to override the default name of the wx-config script
dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
dnl case the macro won't even waste time on tests for its existence.
dnl ---------------------------------------------------------------------------
dnl
dnl Get the cflags and libraries from the wx-config script
dnl
AC_DEFUN([AM_PATH_WXCONFIG],
[
dnl do we have wx-config name: it can be wx-config or wxd-config or ...
if test x${WX_CONFIG_NAME+set} != xset ; then
WX_CONFIG_NAME=wx-config
fi
if test "x$wx_config_name" != x ; then
WX_CONFIG_NAME="$wx_config_name"
fi
dnl deal with optional prefixes
if test x$wx_config_exec_prefix != x ; then
wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
fi
if test x$wx_config_prefix != x ; then
wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
fi
dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
if test -x "$WX_CONFIG_NAME" ; then
AC_MSG_CHECKING(for wx-config)
WX_CONFIG_PATH="$WX_CONFIG_NAME"
AC_MSG_RESULT($WX_CONFIG_PATH)
else
AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
fi
if test "$WX_CONFIG_PATH" != "no" ; then
WX_VERSION=""
no_wx=""
min_wx_version=ifelse([$1], ,2.2.1,$1)
AC_MSG_CHECKING(for wxWindows version >= $min_wx_version)
WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args"
WX_VERSION=`$WX_CONFIG_WITH_ARGS --version`
wx_config_major_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_config_minor_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_config_micro_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_requested_major_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_requested_minor_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_requested_micro_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_ver_ok=""
if test $wx_config_major_version -gt $wx_requested_major_version; then
wx_ver_ok=yes
else
if test $wx_config_major_version -eq $wx_requested_major_version; then
if test $wx_config_minor_version -gt $wx_requested_minor_version; then
wx_ver_ok=yes
else
if test $wx_config_minor_version -eq $wx_requested_minor_version; then
if test $wx_config_micro_version -ge $wx_requested_micro_version; then
wx_ver_ok=yes
fi
fi
fi
fi
fi
if test "x$wx_ver_ok" = x ; then
no_wx=yes
else
WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs`
dnl starting with version 2.2.6 wx-config has --cppflags argument
wx_has_cppflags=""
if test $wx_config_major_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_major_version -eq 2; then
if test $wx_config_minor_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_minor_version -eq 2; then
if test $wx_config_micro_version -ge 6; then
wx_has_cppflags=yes
fi
fi
fi
fi
fi
if test "x$wx_has_cppflags" = x ; then
dnl no choice but to define all flags like CFLAGS
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CPPFLAGS=$WX_CFLAGS
WX_CXXFLAGS=$WX_CFLAGS
WX_CFLAGS_ONLY=$WX_CFLAGS
WX_CXXFLAGS_ONLY=$WX_CFLAGS
else
dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
fi
fi
if test "x$no_wx" = x ; then
AC_MSG_RESULT(yes (version $WX_VERSION))
ifelse([$2], , :, [$2])
else
if test "x$WX_VERSION" = x; then
dnl no wx-config at all
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
fi
WX_CFLAGS=""
WX_CPPFLAGS=""
WX_CXXFLAGS=""
WX_LIBS=""
WX_LIBS_STATIC=""
ifelse([$3], , :, [$3])
fi
fi
AC_SUBST(WX_CPPFLAGS)
AC_SUBST(WX_CFLAGS)
AC_SUBST(WX_CXXFLAGS)
AC_SUBST(WX_CFLAGS_ONLY)
AC_SUBST(WX_CXXFLAGS_ONLY)
AC_SUBST(WX_LIBS)
AC_SUBST(WX_LIBS_STATIC)
AC_SUBST(WX_VERSION)
])
# Configure paths for libogg
# Jack Moffitt <[email protected]> 10-21-2000
# Shamelessly stolen from Owen Taylor and Manish Singh
dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
dnl
AC_DEFUN([XIPH_PATH_OGG],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")
AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg header files are installed (optional)], ogg_includes="$withval", ogg_includes="")
AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
if test "x$ogg_libraries" != "x" ; then
OGG_LIBS="-L$ogg_libraries"
elif test "x$ogg_prefix" != "x" ; then
OGG_LIBS="-L$ogg_prefix/lib"
elif test "x$prefix" != "xNONE" ; then
OGG_LIBS="-L$libdir"
fi
OGG_LIBS="$OGG_LIBS -logg"
if test "x$ogg_includes" != "x" ; then
OGG_CFLAGS="-I$ogg_includes"
elif test "x$ogg_prefix" != "x" ; then
OGG_CFLAGS="-I$ogg_prefix/include"
elif test "x$prefix" != "xNONE"; then
OGG_CFLAGS=""
fi
AC_MSG_CHECKING(for Ogg)
no_ogg=""
if test "x$enable_oggtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Ogg is sufficiently new.
dnl
rm -f conf.oggtest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ogg/ogg.h>
int main ()
{
system("touch conf.oggtest");
return 0;
}
],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_ogg" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.oggtest ; then
:
else
echo "*** Could not run Ogg test program, checking why..."
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <ogg/ogg.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Ogg or finding the wrong"
echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
echo "*** or that you have moved Ogg since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
OGG_CFLAGS=""
OGG_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OGG_CFLAGS)
AC_SUBST(OGG_LIBS)
rm -f conf.oggtest
])
# Configure paths for libvorbis
# Jack Moffitt <[email protected]> 10-21-2000
# Shamelessly stolen from Owen Taylor and Manish Singh
# thomasvs added check for vorbis_bitrate_addblock which is new in rc3
dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
dnl
AC_DEFUN([XIPH_PATH_VORBIS],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(vorbis,[ --with-vorbis=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
AC_ARG_WITH(vorbis-libraries,[ --with-vorbis-libraries=DIR Directory where libvorbis library is installed (optional)], vorbis_libraries="$withval", vorbis_libraries="")
AC_ARG_WITH(vorbis-includes,[ --with-vorbis-includes=DIR Directory where libvorbis header files are installed (optional)], vorbis_includes="$withval", vorbis_includes="")
AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
if test "x$vorbis_libraries" != "x" ; then
VORBIS_LIBS="-L$vorbis_libraries"
elif test "x$vorbis_prefix" != "x" ; then
VORBIS_LIBS="-L$vorbis_prefix/lib"
elif test "x$prefix" != "xNONE"; then
VORBIS_LIBS="-L$libdir"
fi
VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm"
VORBISFILE_LIBS="-lvorbisfile"
VORBISENC_LIBS="-lvorbisenc"
if test "x$vorbis_includes" != "x" ; then
VORBIS_CFLAGS="-I$vorbis_includes"
elif test "x$vorbis_prefix" != "x" ; then
VORBIS_CFLAGS="-I$vorbis_prefix/include"
elif test "x$prefix" != "xNONE"; then
VORBIS_CFLAGS=""
fi
AC_MSG_CHECKING(for Vorbis)
no_vorbis=""
if test "x$enable_vorbistest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Vorbis is sufficiently new.
dnl
rm -f conf.vorbistest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>
int main ()
{
vorbis_block vb;
vorbis_dsp_state vd;
vorbis_info vi;
vorbis_info_init (&vi);
vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1);
vorbis_analysis_init (&vd, &vi);
vorbis_block_init (&vd, &vb);
/* this function was added in 1.0rc3, so this is what we're testing for */
vorbis_bitrate_addblock (&vb);
system("touch conf.vorbistest");
return 0;
}
],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_vorbis" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.vorbistest ; then
:
else
echo "*** Could not run Vorbis test program, checking why..."
CFLAGS="$CFLAGS $VORBIS_CFLAGS"
LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <vorbis/codec.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Vorbis or finding the wrong"
echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means Vorbis was incorrectly installed"
echo "*** or that you have moved Vorbis since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
VORBIS_CFLAGS=""
VORBIS_LIBS=""
VORBISFILE_LIBS=""
VORBISENC_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(VORBIS_CFLAGS)
AC_SUBST(VORBIS_LIBS)
AC_SUBST(VORBISFILE_LIBS)
AC_SUBST(VORBISENC_LIBS)
rm -f conf.vorbistest
])
dnl XIPH_PATH_THEORA([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libtheora, and define THEORA_CFLAGS and THEORA_LIBS
dnl
AC_DEFUN([XIPH_PATH_THEORA],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(theora,[ --with-theora=PFX Prefix where libtheora is installed (optional)], theora_prefix="$withval", theora_prefix="")
AC_ARG_WITH(theora-libraries,[ --with-theora-libraries=DIR Directory where libtheora library is installed (optional)], theora_libraries="$withval", theora_libraries="")
AC_ARG_WITH(theora-includes,[ --with-theora-includes=DIR Directory where libtheora header files are installed (optional)], theora_includes="$withval", theora_includes="")
AC_ARG_ENABLE(theoratest, [ --disable-theoratest Do not try to compile and run a test Theora program],, enable_theoratest=yes)
if test "x$theora_libraries" != "x" ; then
THEORA_LIBS="-L$theora_libraries"
elif test "x$theora_prefix" != "x" ; then
THEORA_LIBS="-L$theora_prefix/lib"
elif test "x$prefix" != "xNONE"; then
THEORA_LIBS="-L$libdir"
fi
THEORA_LIBS="$THEORA_LIBS -ltheora"
if test "x$theora_includes" != "x" ; then
THEORA_CFLAGS="-I$theora_includes"
elif test "x$theora_prefix" != "x" ; then
THEORA_CFLAGS="-I$theora_prefix/include"
elif test "x$prefix" != "xNONE"; then
THEORA_CFLAGS=""
fi
AC_MSG_CHECKING(for Theora)
no_theora=""
if test "x$enable_theoratest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $THEORA_CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $THEORA_LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Theora is sufficiently new.
dnl
rm -f conf.theoratest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <theora/theora.h>
#include <vorbis/codec.h>
int main ()
{
theora_info ti;
theora_state ts;
theora_info_init(&ti);
system("touch conf.theoratest");
return 0;
}
],, no_theora=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_theora" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.theoratest ; then
:
else
echo "*** Could not run Theora test program, checking why..."
CFLAGS="$CFLAGS $THEORA_CFLAGS"
LIBS="$LIBS $THEORA_LIBS $OGG_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <vorbis/codec.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Theora or finding the wrong"
echo "*** version of Theora. If it is not finding Theora, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means Theora was incorrectly installed"
echo "*** or that you have moved Theora since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
THEORA_CFLAGS=""
THEORA_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(THEORA_CFLAGS)
AC_SUBST(THEORA_LIBS)
rm -f conf.theoratest
])
dnl AM_PATH_OPENAL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for OpenAL, and define OPENAL_CFLAGS and OPENAL_LIBS
dnl
AC_DEFUN([AM_PATH_OPENAL],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(openal,[ --with-openal=PFX Prefix where OpenAL is installed (optional)], openal_prefix="$withval", openal_prefix="")
AC_ARG_WITH(openal-libraries,[ --with-openal-libraries=DIR Directory where OpenAL library is installed (optional)], openal_libraries="$withval", openal_libraries="")
AC_ARG_WITH(openal-includes,[ --with-openal-includes=DIR Directory where OpenAL header files are installed (optional)], openal_includes="$withval", openal_includes="")
AC_ARG_ENABLE(openaltest, [ --disable-openaltest Do not try to compile and run a test OpenAL program],, enable_openaltest=yes)
if test "x$openal_libraries" != "x" ; then
OPENAL_LIBS="-L$openal_libraries"
elif test "x$openal_prefix" != "x" ; then
OPENAL_LIBS="-L$openal_prefix/lib"
elif test "x$prefix" != "xNONE"; then
OPENAL_LIBS="-L$libdir"
fi
OPENAL_LIBS="$OPENAL_LIBS -lopenal"
if test "x$openal_includes" != "x" ; then
OPENAL_CFLAGS="-I$openal_includes"
elif test "x$openal_prefix" != "x" ; then
OPENAL_CFLAGS="-I$openal_prefix/include"
elif test "x$prefix" != "xNONE"; then
OPENAL_CFLAGS=""
fi
AC_MSG_CHECKING(for OpenAL)
no_openal=""
if test "x$enable_openaltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $OPENAL_CFLAGS"
LIBS="$LIBS $OPENAL_LIBS"
dnl
dnl Now check if the installed OpenAL is sufficiently new.
dnl
rm -f conf.openaltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <AL/al.h>
#include <AL/alc.h>
int main ()
{
#ifdef AL_VERSION_1_1
alcIsExtensionPresent(NULL, (const ALCchar*)"ALC_ENUMERATION_EXT");
system("touch conf.openaltest");
return 0;
#else
printf("\n*** OpenAL version 1.1 or greater is required.\n");
return 1;
#endif
}
],, no_openal=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_openal" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.openaltest ; then
:
else
echo "*** Could not run OpenAL test program, checking why..."
CFLAGS="$CFLAGS $OPENAL_CFLAGS"
LIBS="$LIBS $OPENAL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <AL/al.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding OpenAL or finding the wrong"
echo "*** version of OpenAL. If it is not finding OpenAL, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means OpenAL was incorrectly installed"
echo "*** or that you have moved OpenAL since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
OPENAL_CFLAGS=""
OPENAL_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OPENAL_CFLAGS)
AC_SUBST(OPENAL_LIBS)
rm -f conf.openaltest
])
dnl AM_PATH_OPENGL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for OpenGL, and define OPENGL_CFLAGS and OPENGL_LIBS
dnl
AC_DEFUN([AM_PATH_OPENGL],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(opengl,[ --with-opengl=PFX Prefix where OpenGL is installed (optional)], opengl_prefix="$withval", opengl_prefix="")
AC_ARG_WITH(opengl-libraries,[ --with-opengl-libraries=DIR Directory where OpenGL library is installed (optional)], opengl_libraries="$withval", opengl_libraries="")
AC_ARG_WITH(opengl-includes,[ --with-opengl-includes=DIR Directory where OpenGL header files are installed (optional)], opengl_includes="$withval", opengl_includes="")
AC_ARG_ENABLE(opengltest, [ --disable-opengltest Do not try to compile and run a test OpenGL program],, enable_opengltest=yes)
if test "x$opengl_libraries" != "x" ; then
OPENGL_LIBS="-L$opengl_libraries"
elif test "x$opengl_prefix" != "x" ; then
OPENGL_LIBS="-L$opengl_prefix/lib"
elif test "x$prefix" != "xNONE"; then
OPENGL_LIBS="-L$libdir"
fi
OPENGL_LIBS="$OPENGL_LIBS -lGL -lGLU"
if test "x$opengl_includes" != "x" ; then
OPENGL_CFLAGS="-I$opengl_includes"
elif test "x$opengl_prefix" != "x" ; then
OPENGL_CFLAGS="-I$opengl_prefix/include"
elif test "x$prefix" != "xNONE"; then
OPENGL_CFLAGS=""
fi
no_opengl=""
if test "x$enable_opengltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $OPENGL_CFLAGS"
LIBS="$LIBS $OPENGL_LIBS"
AC_CHECK_LIB(GL, glPushMatrix,
[AC_CHECK_HEADER(GL/gl.h,
[AC_CHECK_LIB(GLU, gluPerspective,
[AC_CHECK_HEADER(GL/glu.h, ,
dnl NOTE: this is a failure
no_opengl=yes
)]
)]
)]
)
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_opengl" = "x" ; then
ifelse([$1], , :, [$1])
else
OPENGL_CFLAGS=""
OPENGL_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OPENGL_CFLAGS)
AC_SUBST(OPENGL_LIBS)
])
+40
View File
@@ -0,0 +1,40 @@
version: 1.0.0.{build}
configuration:
- Debug
- Release
clone_depth: 10
environment:
matrix:
- VS_VERSION: 12
CMAKE_GENERATOR: Visual Studio 12 2013
PlatformToolset: v120_xp
- VS_VERSION: 14
CMAKE_GENERATOR: Visual Studio 14 2015
PlatformToolset: v140_xp
before_build:
- git submodule update --init --recursive
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/check_release.ps1
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/before_build.ps1
build_script:
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/build.ps1
deploy:
- provider: GitHub
auth_token:
secure: 3kV4efHXwRnfXzmJPRAOs8D7+MhwXUXYeayI/P5y114L09kJa6b6L70beXdW7yYr
on:
ReleaseBuild: true # deploy on release push only
- provider: BinTray
username: sirknightly
api_key:
secure: pYWqfiZhIWvFYdjVWPXNaHobmnkXIWa4+LwoiyMTEiu4Z0CiCAW0ZrMfTKVkORKz
subject: scp-fs2open
repo: FSO
package: nightly
version: $(VersionName)
publish: true
override: true
on:
NightlyBuild: true # deploy on nightly push only
-139
View File
@@ -1,139 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
PKG_NAME="fs2_open"
# check the version of a package
check_version() {
COMMAND=$1
MAJOR=$2
MINOR=$3
MICRO=$4
($COMMAND --version) </dev/null >/dev/null 2>&1 || return 1
ver=`$COMMAND --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
major=`echo $ver | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
minor=`echo $ver | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
micro=`echo $ver | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
test -z "$major" && major=0
test -z "$minor" && minor=0
test -z "$micro" && micro=0
fail=0
if [ ! "$major" -gt "$MAJOR" ]; then
if [ "$major" -lt "$MAJOR" ]; then
fail=1
elif [ ! "$minor" -gt "$MINOR" ]; then
if [ "$minor" -lt "$MINOR" ]; then
fail=1
elif [ "$micro" -lt "$MICRO" ]; then
fail=1
fi
fi
fi
return "$fail"
}
AUTOMAKE=
ACLOCAL=
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed to."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
for AM in automake-1.11 automake-1.10 automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake; do
(check_version "$AM" 1 6 1) && {
AUTOMAKE="$AM"
break
}
done
if [ -z "$AUTOMAKE" ]; then
echo
echo "**Error**: You must have \`automake' version 1.6.1 or greater"
echo "installed to compile $PKG_NAME. Download the appropriate package"
echo "for your distribution, or get the source tarball at"
echo "ftp://ftp.gnu.org/pub/gnu/"
DIE=1
fi
# if no automake, don't bother testing for aclocal
test -z "$AUTOMAKE" || {
for ACL in aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal-1.8 aclocal-1.7 aclocal-1.6 aclocal; do
(check_version "$ACL" 1 6 1) && {
ACLOCAL="$ACL"
break
}
done
if [ -z "$ACLOCAL" ]; then
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed seems to be outdated. Get a recent package from"
echo "ftp://ftp.gnu.org/pub/gnu/"
DIE=1
fi
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
for coin in `find $srcdir -name configure.ac -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
echo skipping $dr -- flagged as no auto-gen
else
echo processing $dr
macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
for k in $macrodirs; do
if test -d $k; then
aclocalinclude="$aclocalinclude -I $k"
##else
## echo "**Warning**: No such directory \`$k'. Ignored."
fi
done
echo "Running $ACLOCAL $aclocalinclude ..."
"$ACLOCAL" $aclocalinclude
echo "Running $AUTOMAKE --add-missing --copy --foreign $am_opt ..."
"$AUTOMAKE" --add-missing --copy --foreign $am_opt
echo "Running autoconf..."
autoconf
)
fi
done
#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
# to not run configure, call autogen.sh as,
# NOCONFIGURE=1 ./autogen.sh
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
&& echo Now type \`make\' to compile $PKG_NAME.
else
echo Skipping configure process.
fi
+5
View File
@@ -0,0 +1,5 @@
New-Item build -type directory
Set-Location -Path build
cmake -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER/../install" -DFSO_USE_SPEECH="ON" `
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS=SSE2 -G "$Env:CMAKE_GENERATOR" -T "$Env:PlatformToolset" ..
+28
View File
@@ -0,0 +1,28 @@
write "$env:DeployBuild"
write "$env:DeployConfig"
if ([System.Convert]::ToBoolean($env:DeployBuild)) {
# Release build
if (![System.Convert]::ToBoolean($env:DeployConfig)) {
exit 0 # End the build
}
$Configs = @("Release", "FastDebug")
foreach ($config in $Configs) {
cmake --build . --config "$config" --target INSTALL -- /verbosity:minimal
if (! ($?)) {
Add-AppveyorMessage "A release build failed!"
exit 1
}
}
7z a "$($env:PackageName)-builds-Win32.zip" "$env:APPVEYOR_BUILD_FOLDER/../install/*"
Push-AppveyorArtifact "$($env:PackageName)-builds-Win32.zip"
} else {
cmake --build . --config "$Env:CONFIGURATION" -- /verbosity:minimal
if (! ($?)) {
exit 1
}
}
+30
View File
@@ -0,0 +1,30 @@
# Default values
Set-AppveyorBuildVariable 'ReleaseBuild' 'false'
Set-AppveyorBuildVariable 'NightlyBuild' 'false'
Set-AppveyorBuildVariable 'DeployBuild' 'false'
Set-AppveyorBuildVariable 'PackagePrefix' ''
Set-AppveyorBuildVariable 'VersionName' ''
if ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^release_(.*)")) {
# Tag matches
Set-AppveyorBuildVariable 'ReleaseBuild' 'true'
Set-AppveyorBuildVariable 'PackageName' "fs2_open_$($matches[1])"
}
if ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^nightly_(.*)")) {
# Tag matches
Set-AppveyorBuildVariable 'NightlyBuild' 'true'
Set-AppveyorBuildVariable 'PackageName' "nightly_$($matches[1])"
Set-AppveyorBuildVariable 'VersionName' "$($matches[1])"
}
if (($Env:Configuration -eq "Release") -And ($Env:VS_VERSION -eq "14")) {
Set-AppveyorBuildVariable 'DeployConfig' 'true'
} else {
Set-AppveyorBuildVariable 'DeployConfig' 'false'
}
if ([System.Convert]::ToBoolean($env:ReleaseBuild) -Or [System.Convert]::ToBoolean($env:NightlyBuild)) {
Set-AppveyorBuildVariable 'DeployBuild' 'true'
}
+19
View File
@@ -0,0 +1,19 @@
{
"package": {
"subject": "scp-fs2open",
"repo": "FSO",
"name": "nightly"
},
"version": {
"name": "$VERSION_NAME"
},
"files": [
{
"includePattern": "/tmp/builds/(.*)",
"uploadPattern": "$1"
}
],
"publish": true
}
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env sh
set -ex
if [ "$NIGHTLY_BUILD" = true ]; then
echo "Generating bintray config..."
sed -e "s/\$VERSION_NAME/$VERSION_NAME/" ci/bintray.template.json > ci/bintray.json
fi
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env sh
set -ex
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# Nothing to do here
:
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
# Nothing to do here
:
fi
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env sh
set -ex
mkdir -p build
cd build
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
export CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON"
if [ "$BUILD_DEPLOYMENT" = true ]; then
for config in $BUILD_CONFIGS
do
mkdir -p $config
cd $config
eval $CMAKE -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_BUILD_TYPE=$config -DCMAKE_INSTALL_PREFIX="/tmp/release" \
-DFSO_BUILD_APPIMAGE=ON -DAPPIMAGE_ASSISTANT="$HOME/AppImageAssistant" \
-DFSO_BUILD_INCLUDED_LIBS=ON ../..
cd ..
done
else
eval $CMAKE -DCMAKE_BUILD_TYPE=$CONFIGURATION ..
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
cmake -G "Xcode" -DFSO_FATAL_WARNINGS=ON -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_INSTALL_PREFIX="/tmp/release" ..
fi
+46
View File
@@ -0,0 +1,46 @@
#!/usr/bin/env sh
RELEASE_BUILD=false
NIGHTLY_BUILD=false
BUILD_DEPLOYMENT=false
BUILD_CONFIGS="Release FastDebug"
VERSION_NAME=""
PACKAGE_NAME=""
RELEASE_PATTERN="^release_(.*)$"
NIGHTLY_PATTERN="^nightly_(.*)$"
if [[ "$TRAVIS_TAG" =~ $RELEASE_PATTERN ]]; then
echo "This is a release tag!";
RELEASE_BUILD=true;
PACKAGE_NAME="fs2_open_${BASH_REMATCH[1]}";
fi
if [[ "$TRAVIS_TAG" =~ $NIGHTLY_PATTERN ]]; then
echo "This is a nightly tag!";
NIGHTLY_BUILD=true;
VERSION_NAME="${BASH_REMATCH[1]}"
PACKAGE_NAME="nightly_${BASH_REMATCH[1]}";
fi
if ([ "$RELEASE_BUILD" = true ] || [ "$NIGHTLY_BUILD" = true ]); then
BUILD_DEPLOYMENT=true;
fi
if [ "$BUILD_DEPLOYMENT" = true ]; then
if ([ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CC" = "clang" ]); then
echo "Skipping non-release compiler";
exit 0;
fi
if ([[ "$CONFIGURATION" == "Debug" ]]); then
echo "Skipping non-release configuration";
exit 0;
fi
fi
export RELEASE_BUILD
export NIGHTLY_BUILD
export BUILD_DEPLOYMENT
export BUILD_CONFIGS
export VERSION_NAME
export PACKAGE_NAME
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env sh
set -ex
FILENAME=
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
if [ ! -d "$HOME/cmake/bin" ]; then
# If the cache does not currently contain CMake then download and install it
FILENAME=cmake-3.4.3-Linux-x86_64
mkdir -p $HOME/cmake/
wget -O /tmp/cmake.tar.gz --no-check-certificate https://www.cmake.org/files/v3.4/$FILENAME.tar.gz
tar -xzf /tmp/cmake.tar.gz -C $HOME/cmake/ --strip-components=1
fi
export PATH=$HOME/cmake/bin:$PATH
cd $HOME
if [ "${BUILD_DEPLOYMENT}" = true ]; then
wget -c "https://github.com/probonopd/AppImageKit/releases/download/5/AppImageAssistant" # (64-bit)
chmod a+x ./AppImageAssistant
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
gem install xcpretty xcpretty-travis-formatter thefox-pastebin
brew update
brew outdated cmake || brew upgrade cmake
fi
cmake --version
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env sh
set -ex
mkdir -p /tmp/builds
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
cd build
for config in $BUILD_CONFIGS
do
cd "$config"
ninja install appimage
cd ..
done
ls -al /tmp/release
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-Linux.tar.gz *.AppImage)
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
cd build
for config in $BUILD_CONFIGS
do
cmake --build . --config "$config" --target install | tee build.log \
| xcpretty -f `xcpretty-travis-formatter`
XCODE_RET=${PIPESTATUS[0]}
if [ "$XCODE_RET" -ne "0" ]; then
tar -cvzf build.log.tar.gz build.log
curl --upload-file build.log.tar.gz "https://transfer.sh/build.log.tar.gz"
exit $XCODE_RET
fi
done
ls -al /tmp/release
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-MacOSX.tar.gz *)
fi
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env sh
set -e
cd build
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
ninja
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
cmake --build . --config "$CONFIGURATION" | tee build.log | xcpretty -f `xcpretty-travis-formatter`
XCODE_RET=${PIPESTATUS[0]}
if [ "$XCODE_RET" -ne "0" ]; then
tar -cvzf build.log.tar.gz build.log
curl --upload-file build.log.tar.gz "https://transfer.sh/build.log.tar.gz"
exit $XCODE_RET
fi
fi
+4
View File
@@ -0,0 +1,4 @@
[Desktop Entry]
Name=FreeSpace Open
Exec=$<TARGET_FILE_NAME:Freespace2>
Icon=app_icon.png
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
HERE=$(dirname $(readlink -f "${0}"))
export LD_LIBRARY_PATH="${HERE}"/lib:$PATH
"${HERE}"/bin/$<TARGET_FILE_NAME:Freespace2> $@
+14
View File
@@ -0,0 +1,14 @@
include(WriteCompilerDetectionHeader)
set(REQUIRED_CXX_FEATURES cxx_rvalue_references cxx_nullptr)
get_property(CMAKE_CXX_KNOWN_FEATURES GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
write_compiler_detection_header(
FILE "${GENERATED_SOURCE_DIR}/scp_compiler_detection.h"
PREFIX SCP
COMPILERS AppleClang Clang GNU MSVC
FEATURES ${CMAKE_CXX_KNOWN_FEATURES}
VERSION 3.2
)
+23
View File
@@ -0,0 +1,23 @@
SET(BINARY_DESTINATION "bin")
SET(LIBRAY_DESTINATION "lib")
configure_file("${CMAKE_CURRENT_LIST_DIR}/AppRun.in" "${CMAKE_CURRENT_BINARY_DIR}/AppRun.gen" @ONLY)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AppRun-$<CONFIG>"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/AppRun.gen")
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/AppRun-$<CONFIG>" DESTINATION "." RENAME "AppRun")
configure_file("${CMAKE_CURRENT_LIST_DIR}/AppImage.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/AppImage.desktop.gen" @ONLY)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AppImage-$<CONFIG>.desktop"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/AppImage.desktop.gen")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AppImage-$<CONFIG>.desktop" DESTINATION "." RENAME "fso.desktop")
install(FILES "${CMAKE_SOURCE_DIR}/freespace2/resources/app_icon.png" DESTINATION ".")
add_custom_target(appimage
COMMAND "${APPIMAGE_ASSISTANT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/fs2_open_${FSO_BINARY_SUFFIX}.AppImage")
add_dependencies(appimage install)
+52
View File
@@ -0,0 +1,52 @@
// Code snippet from http://stackoverflow.com/a/7495023
#ifdef _WIN32
#include <intrin.h>
// Windows
#define cpuid __cpuid
#else
// GCC Inline Assembly
void cpuid(int CPUInfo[4],int InfoType){
__asm__ __volatile__ (
"cpuid":
"=a" (CPUInfo[0]),
"=b" (CPUInfo[1]),
"=c" (CPUInfo[2]),
"=d" (CPUInfo[3]) :
"a" (InfoType)
);
}
#endif
#include <iostream>
int main( int argc, char* argv[] )
{
int SSE = false;
int SSE2 = false;
int AVX = false;
int info[4];
cpuid(info, 0);
int nIds = info[0];
// Detect Instruction Set
if (nIds >= 1){
cpuid(info,0x00000001);
SSE = (info[3] & ((int)1 << 25)) != 0;
SSE2 = (info[3] & ((int)1 << 26)) != 0;
AVX = (info[2] & ((int)1 << 28)) != 0;
}
if(AVX)
std::cout << "AVX";
else if(SSE2)
std::cout << "SSE2";
else if(SSE)
std::cout << "SSE";
return 0;
}
+154
View File
@@ -0,0 +1,154 @@
# ------------------------- Begin Generic CMake Variable Logging ------------------
# /* C++ comment style not allowed */
# if you are building in-source, this is the same as CMAKE_SOURCE_DIR, otherwise
# this is the top level directory of your build tree
MESSAGE( STATUS "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR} )
# if you are building in-source, this is the same as CMAKE_CURRENT_SOURCE_DIR, otherwise this
# is the directory where the compiled or generated files from the current CMakeLists.txt will go to
MESSAGE( STATUS "CMAKE_CURRENT_BINARY_DIR: " ${CMAKE_CURRENT_BINARY_DIR} )
# this is the directory, from which cmake was started, i.e. the top level source directory
MESSAGE( STATUS "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR} )
# this is the directory where the currently processed CMakeLists.txt is located in
MESSAGE( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} )
# contains the full path to the top level directory of your build tree
MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} )
MESSAGE( STATUS "CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
# contains the full path to the root of your project source directory,
# i.e. to the nearest directory where CMakeLists.txt contains the PROJECT() command
MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
# set this variable to specify a common place where CMake should put all executable files
# (instead of CMAKE_CURRENT_BINARY_DIR)
MESSAGE( STATUS "EXECUTABLE_OUTPUT_PATH: " ${EXECUTABLE_OUTPUT_PATH} )
# set this variable to specify a common place where CMake should put all libraries
# (instead of CMAKE_CURRENT_BINARY_DIR)
MESSAGE( STATUS "LIBRARY_OUTPUT_PATH: " ${LIBRARY_OUTPUT_PATH} )
# tell CMake to search first in directories listed in CMAKE_MODULE_PATH
# when you use FIND_PACKAGE() or INCLUDE()
MESSAGE( STATUS "CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH} )
# this is the complete path of the cmake which runs currently (e.g. /usr/local/bin/cmake)
MESSAGE( STATUS "CMAKE_COMMAND: " ${CMAKE_COMMAND} )
# this is the CMake installation directory
MESSAGE( STATUS "CMAKE_ROOT: " ${CMAKE_ROOT} )
# this is the filename including the complete path of the file where this variable is used.
MESSAGE( STATUS "CMAKE_CURRENT_LIST_FILE: " ${CMAKE_CURRENT_LIST_FILE} )
# this is linenumber where the variable is used
MESSAGE( STATUS "CMAKE_CURRENT_LIST_LINE: " ${CMAKE_CURRENT_LIST_LINE} )
# this is used when searching for include files e.g. using the FIND_PATH() command.
MESSAGE( STATUS "CMAKE_INCLUDE_PATH: " ${CMAKE_INCLUDE_PATH} )
# this is used when searching for libraries e.g. using the FIND_LIBRARY() command.
MESSAGE( STATUS "CMAKE_LIBRARY_PATH: " ${CMAKE_LIBRARY_PATH} )
# the complete system name, e.g. "Linux-2.4.22", "FreeBSD-5.4-RELEASE" or "Windows 5.1"
MESSAGE( STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} )
# the short system name, e.g. "Linux", "FreeBSD" or "Windows"
MESSAGE( STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME} )
# only the version part of CMAKE_SYSTEM
MESSAGE( STATUS "CMAKE_SYSTEM_VERSION: " ${CMAKE_SYSTEM_VERSION} )
# the processor name (e.g. "Intel(R) Pentium(R) M processor 2.00GHz")
MESSAGE( STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} )
# is TRUE on all UNIX-like OS's, including Apple OS X and CygWin
MESSAGE( STATUS "UNIX: " ${UNIX} )
# is TRUE on Windows, including CygWin
MESSAGE( STATUS "WIN32: " ${WIN32} )
# is TRUE on Apple OS X
MESSAGE( STATUS "APPLE: " ${APPLE} )
# is TRUE when using the MinGW compiler in Windows
MESSAGE( STATUS "MINGW: " ${MINGW} )
# is TRUE on Windows when using the CygWin version of cmake
MESSAGE( STATUS "CYGWIN: " ${CYGWIN} )
# is TRUE on Windows when using a Borland compiler
MESSAGE( STATUS "BORLAND: " ${BORLAND} )
# Microsoft compiler
MESSAGE( STATUS "MSVC: " ${MSVC} )
MESSAGE( STATUS "MSVC_IDE: " ${MSVC_IDE} )
MESSAGE( STATUS "MSVC60: " ${MSVC60} )
MESSAGE( STATUS "MSVC70: " ${MSVC70} )
MESSAGE( STATUS "MSVC71: " ${MSVC71} )
MESSAGE( STATUS "MSVC80: " ${MSVC80} )
MESSAGE( STATUS "CMAKE_COMPILER_2005: " ${CMAKE_COMPILER_2005} )
# set this to true if you don't want to rebuild the object files if the rules have changed,
# but not the actual source files or headers (e.g. if you changed the some compiler switches)
MESSAGE( STATUS "CMAKE_SKIP_RULE_DEPENDENCY: " ${CMAKE_SKIP_RULE_DEPENDENCY} )
# since CMake 2.1 the install rule depends on all, i.e. everything will be built before installing.
# If you don't like this, set this one to true.
MESSAGE( STATUS "CMAKE_SKIP_INSTALL_ALL_DEPENDENCY: " ${CMAKE_SKIP_INSTALL_ALL_DEPENDENCY} )
# If set, runtime paths are not added when using shared libraries. Default it is set to OFF
MESSAGE( STATUS "CMAKE_SKIP_RPATH: " ${CMAKE_SKIP_RPATH} )
# set this to true if you are using makefiles and want to see the full compile and link
# commands instead of only the shortened ones
MESSAGE( STATUS "CMAKE_VERBOSE_MAKEFILE: " ${CMAKE_VERBOSE_MAKEFILE} )
# this will cause CMake to not put in the rules that re-run CMake. This might be useful if
# you want to use the generated build files on another machine.
MESSAGE( STATUS "CMAKE_SUPPRESS_REGENERATION: " ${CMAKE_SUPPRESS_REGENERATION} )
# A simple way to get switches to the compiler is to use ADD_DEFINITIONS().
# But there are also two variables exactly for this purpose:
# the compiler flags for compiling C sources
MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
# the compiler flags for compiling C++ sources
MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
# Choose the type of build. Example: SET(CMAKE_BUILD_TYPE Debug)
MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
# if this is set to ON, then all libraries are built as shared libraries by default.
MESSAGE( STATUS "BUILD_SHARED_LIBS: " ${BUILD_SHARED_LIBS} )
# the compiler used for C files
MESSAGE( STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
# the compiler used for C++ files
MESSAGE( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} )
# if the compiler is a variant of gcc, this should be set to 1
MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCC: " ${CMAKE_COMPILER_IS_GNUCC} )
# if the compiler is a variant of g++, this should be set to 1
MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCXX : " ${CMAKE_COMPILER_IS_GNUCXX} )
# the tools for creating libraries
MESSAGE( STATUS "CMAKE_AR: " ${CMAKE_AR} )
MESSAGE( STATUS "CMAKE_RANLIB: " ${CMAKE_RANLIB} )
#
#MESSAGE( STATUS ": " ${} )
# ------------------------- End of Generic CMake Variable Logging ------------------
+37
View File
@@ -0,0 +1,37 @@
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
SET(OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/documentation/doxygen")
FILE(MAKE_DIRECTORY "${OUTPUT_DIR}")
FILE(TO_NATIVE_PATH ${OUTPUT_DIR} OUTPUT_DIR)
SET(OUTPUT_DIR \"${OUTPUT_DIR}\")
SET(INPUTS "${CMAKE_CURRENT_SOURCE_DIR}/code" "${CMAKE_CURRENT_SOURCE_DIR}/freespace2" "${CMAKE_CURRENT_SOURCE_DIR}/fred2" "${CMAKE_CURRENT_SOURCE_DIR}/wxfred2")
SET(INPUT_DIRS)
FOREACH(DIR IN LISTS INPUTS)
FILE(TO_NATIVE_PATH ${DIR} native_dir)
LIST(APPEND INPUT_DIRS \"${native_dir}\")
ENDFOREACH(DIR)
STRING(REPLACE ";" " " INPUT_DIRS "${INPUT_DIRS}")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/fs2open.Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/fs2open.Doxyfile
@ONLY)
add_custom_target(doxygen
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/fs2open.Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
set_target_properties(doxygen
PROPERTIES
FOLDER "Documentation"
EXCLUDE_FROM_ALL ON
EXCLUDE_FROM_DEFAULT_BUILD ON
)
endif(DOXYGEN_FOUND)
Vendored Submodule
+1
Submodule cmake/external/cotire added at 40a46bf2fb.
+33
View File
@@ -0,0 +1,33 @@
add_library(speech INTERFACE)
if (WIN32)
find_package(WindowsSDK REQUIRED)
foreach(dir ${WINDOWSSDK_DIRS})
get_windowssdk_library_dirs("${dir}" LIB_DIRS)
find_library(SPEECH_LIBRARY
NAMES sapi
PATHS ${LIB_DIRS}
NO_DEFAULT_PATH)
if (SPEECH_LIBRARY)
set(SDK_DIR "${dir}")
break()
endif()
endforeach()
if (NOT SPEECH_LIBRARY)
message(SEND_ERROR "Text to speech library could not be found! Either install it or disable the speech option.")
return()
endif()
get_windowssdk_include_dirs("${SDK_DIR}" INCLUDE_DIRS)
target_include_directories(speech INTERFACE ${INCLUDE_DIRS})
else()
message(SEND_ERROR "Text to Speech is not supported on this platform!")
endif()
target_compile_definitions(speech INTERFACE -DFS2_SPEECH)
+5
View File
@@ -0,0 +1,5 @@
include(platformChecks)
include(Cxx11)
CONFIGURE_FILE(${CMAKE_CURRENT_LIST_DIR}/project.h.in ${GENERATED_SOURCE_DIR}/project.h)
+3
View File
@@ -0,0 +1,3 @@
SET(BINARY_DESTINATION ".")
SET(LIBRAY_DESTINATION "${BINARY_DESTINATION}")
+8
View File
@@ -0,0 +1,8 @@
SET(CODE_HEADERS ${CMAKE_SOURCE_DIR}/code)
SET(FREESPACE_HEADERS ${CMAKE_SOURCE_DIR}/freespace2)
SET(FRED_HEADERS ${CMAKE_SOURCE_DIR}/fred2)
SET(WXFRED_HEADERS ${CMAKE_SOURCE_DIR}/wxfred2)
+14
View File
@@ -0,0 +1,14 @@
SET(CPACK_PACKAGE_VERSION_MAJOR ${FSO_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${FSO_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${FSO_VERSION_BUILD})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${FSO_PROJECT_DESCRIPTION})
IF(WIN32)
SET(CPACK_NSIS_MUI_ICON ${FSO_INSTALLER_ICON})
set(CPACK_NSIS_MENU_LINKS "http://www.hard-light.net/" "FreeSpace Community")
ENDIF(WIN32)
include(CPack)
+11
View File
@@ -0,0 +1,11 @@
MESSAGE(STATUS "Doing Mac OSX specific things...")
SET(EXE_GUI_TYPE MACOSX_BUNDLE)
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
if (NOT COCOA_LIBRARY)
message(FATAL_ERROR "Couldn't find Cocoa!")
endif()
target_link_libraries(platform INTERFACE ${COCOA_LIBRARY})
+10
View File
@@ -0,0 +1,10 @@
target_compile_definitions(platform INTERFACE SCP_BSD)
find_library(EXECINFO_LIB execinfo)
if (NOT EXECINFO_LIB)
message(FATAL_ERROR "Couldn't find libexecinfo! Please install it and rerun the configuration.")
else()
target_link_libraries(platform INTERFACE "${EXECINFO_LIB}")
endif()
+2
View File
@@ -0,0 +1,2 @@
target_compile_definitions(platform INTERFACE SCP_SOLARIS)
+6
View File
@@ -0,0 +1,6 @@
INCLUDE(util)
MESSAGE(STATUS "Configuring UNIX specific things and stuff...")
target_compile_definitions(platform INTERFACE SCP_UNIX USE_OPENAL)
+20
View File
@@ -0,0 +1,20 @@
MESSAGE(STATUS "Configuring Windows specific things and stuff...")
target_link_libraries(platform INTERFACE
comctl32.lib
msacm32.lib
odbc32.lib
odbccp32.lib
vfw32.lib
winmm.lib
wsock32.lib
Psapi.lib
)
target_compile_definitions(platform INTERFACE WIN32 USE_OPENAL _WINDOWS)
# Specify minimum Windows version for the headers (currently this is XP)
target_compile_definitions(platform INTERFACE NTDDI_VERSION=0x05010000 _WIN32_WINNT=0x0501)
SET(EXE_GUI_TYPE WIN32)
+17
View File
@@ -0,0 +1,17 @@
include(CheckFunctionExists)
include(CheckIncludeFiles)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckLibraryExists)
include(CheckPrototypeDefinition)
include(CheckStructHasMember)
include(CheckSymbolExists)
include(CheckTypeSize)
CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
CHECK_INCLUDE_FILE_CXX("cxxabi.h" HAVE_CXXAPI_H)
set(PLATFORM_CHECK_HEADER "${GENERATED_SOURCE_DIR}/platformChecks.h")
CONFIGURE_FILE(${CMAKE_CURRENT_LIST_DIR}/platformChecks.h.in "${PLATFORM_CHECK_HEADER}")
+9
View File
@@ -0,0 +1,9 @@
#ifndef __PLATFORM_CHECKS_H__
#define __PLATFORM_CHECKS_H__
#pragma once
#cmakedefine HAVE_EXECINFO_H
#cmakedefine HAVE_CXXAPI_H
#endif // __PLATFORM_CHECKS_H__
+22
View File
@@ -0,0 +1,22 @@
add_library(platform INTERFACE)
IF(FSO_CMAKE_DEBUG)
INCLUDE(debug-vars)
ENDIF(FSO_CMAKE_DEBUG)
IF(WIN32)
INCLUDE(platform-win32)
ELSEIF(UNIX)
INCLUDE(platform-unix)
IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
INCLUDE(platform-freebsd)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
INCLUDE(platform-solaris)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include(platform-darwin)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
ELSE(WIN32)
MESSAGE(STATUS "This platform is not supported, good luck!")
ENDIF(WIN32)
+17
View File
@@ -0,0 +1,17 @@
#ifndef __PROJECT_H
#define __PROJECT_H
#define FS_VERSION_MAJOR @FSO_VERSION_MAJOR@
#define FS_VERSION_MINOR @FSO_VERSION_MINOR@
#define FS_VERSION_BUILD @FSO_VERSION_BUILD@
#define FS_VERSION_REVIS @FSO_VERSION_REVISION@
#define FS_VERSION_REVIS_STR "@FSO_VERSION_REVISION_STR@"
#define FS_VERSION_HAS_REVIS @FSO_VERSION_HAS_REVISION@
#define FS_VERSION_FULL "@FSO_FULL_VERSION_STRING@"
#define FS_PRODUCT_VERSION "@FSO_PRODUCT_VERSION_STRING@"
#endif // __PROJECT_H
+20
View File
@@ -0,0 +1,20 @@
MESSAGE(STATUS "Doing configuration specific to Apple Clang...")
# TODO: Actually add Mac specific flags here...
# Suppress specific warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -funroll-loops -fsigned-char -Wno-unknown-pragmas")
# Omit "conversion from string literal to 'char *' is deprecated" warnings.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-char-subscripts")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
set(CMAKE_CXX_FLAGS_RELEASE "-Wno-unused-variable")
set(CMAKE_CXX_FLAGS_DEBUG "-Wextra -Wshadow -Wno-unused-parameter")
+65
View File
@@ -0,0 +1,65 @@
# Clang
include(EnableExtraCompilerWarnings)
include(CheckCXXCompilerFlag)
MESSAGE(STATUS "Doing configuration specific to clang...")
unset(COMPILER_FLAGS)
if(DEFINED ENV{CXXFLAGS})
set(COMPILER_FLAGS $ENV{CXXFLAGS})
endif()
if(NOT COMPILER_FLAGS)
set(COMPILER_FLAGS "-march=native -pipe")
endif()
globally_enable_extra_compiler_warnings()
set(COMPILER_FLAGS "${COMPILER_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
# Omit "argument unused during compilation" when clang is used with ccache.
if(${CMAKE_CXX_COMPILER} MATCHES "ccache")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Qunused-arguments")
endif()
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
# Force color diagnostics for Ninja generator
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fdiagnostics-color")
endif()
# Omit "deprecated conversion from string constant to 'char*'" warnings.
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-write-strings")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-unused-function")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-deprecated -Wno-char-subscripts")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-unused-parameter")
check_cxx_compiler_flag(-Wshift-negative-value SUPPORTS_SHIFT_NEGATIVE_VALUE)
if(SUPPORTS_SHIFT_NEGATIVE_VALUE)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-shift-negative-value")
endif()
set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable")
set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
if (FSO_FATAL_WARNINGS)
# Make warnings fatal if the right variable is set
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Werror")
endif()
set(CMAKE_CXX_FLAGS ${COMPILER_FLAGS})
set(CMAKE_C_FLAGS ${COMPILER_FLAGS})
set(CMAKE_CXX_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_EXE_LINKER_FLAGS "")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g -rdynamic")
+73
View File
@@ -0,0 +1,73 @@
include(EnableExtraCompilerWarnings)
include(CheckCCompilerFlag)
include(util)
MESSAGE(STATUS "Doing configuration specific to gcc...")
option(GCC_ENABLE_LEAK_CHECK "Enable the -fsanitize=leak" OFF)
unset(COMPILER_FLAGS)
if(DEFINED ENV{CXXFLAGS})
set(COMPILER_FLAGS $ENV{CXXFLAGS})
endif()
if(NOT COMPILER_FLAGS)
set(COMPILER_FLAGS "-march=native -pipe")
endif()
globally_enable_extra_compiler_warnings()
set(COMPILER_FLAGS "${COMPILER_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
# Force color diagnostics for Ninja generator
CHECK_C_COMPILER_FLAG(-fdiagnostics-color SUPPORTS_DIAGNOSTIC_COLOR)
if(SUPPORTS_DIAGNOSTIC_COLOR)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fdiagnostics-color")
endif()
endif()
# Omit "deprecated conversion from string constant to 'char*'" warnings.
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-write-strings")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-unused-function")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-deprecated -Wno-char-subscripts")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-unused-parameter")
set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered")
set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
if (FSO_FATAL_WARNINGS)
# Make warnings fatal if the right variable is set
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Werror")
endif()
set(CMAKE_CXX_FLAGS ${COMPILER_FLAGS})
set(CMAKE_C_FLAGS ${COMPILER_FLAGS})
set(CMAKE_CXX_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_EXE_LINKER_FLAGS "")
if (GCC_ENABLE_LEAK_CHECK)
check_linker_flag("-fsanitize=leak" SUPPORTS_FSANITIZE_LEAK)
if (SUPPORTS_FSANITIZE_LEAK)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=leak")
endif()
endif()
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g -rdynamic")
IF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,-zignore")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+130
View File
@@ -0,0 +1,130 @@
include(EnableExtraCompilerWarnings)
include(CheckCXXCompilerFlag)
include(util)
MESSAGE(STATUS "Doing configuration specific to visual studio...")
set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS Debug)
option(MSVC_USE_RUNTIME_DLL "Use the dynamically linked version of the runtime" OFF)
MARK_AS_ADVANCED(FORCE MSVC_USE_RUNTIME_DLL)
# These are the warnings we disable
set(WARNING_FLAGS
/wd"4100" # unreferenced formal parameters
/wd"4127" # constant conditional (assert)
/wd"4201" # nonstandard extension used: nameless struct/union (happens a lot in Windows include headers)
/wd"4290" # C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
/wd"4390" # empty control statement (triggered by nprintf and mprintf's inside of one-line if's, etc)
/wd"4410" # illegal size for operand... ie... fxch st(1)
/wd"4511" # copy constructor could not be generated (happens a lot in Windows include headers)
/wd"4512" # assignment operator could not be generated (happens a lot in Windows include headers)
/wd"4514" # unreferenced inline function removed
/wd"4611" # _setjmp warning. Since we use setjmp alot, and we don't really use constructors or destructors, this warning doesn't really apply to us.
/wd"4663" # C++ language change (template specification)
/wd"4710" # is inline function not expanded (who cares?)
/wd"4711" # tells us an inline function was expanded (who cares?)
/wd"4786" # is identifier truncated to 255 characters (happens all the time in Microsoft #includes) -- Goober5000"
/wd"4996" # deprecated strcpy, strcat, sprintf, etc. (from MSVC 2005) - taylor
/wd"4311" # Disables warnings about casting pointer types to ints. The funny thing is these warnings can't be resolved, just disabled... - m!m
/wd"4302" # Same as above - m!m
/wd"4366" # The result of the unary '&' operator may be unaligned - m!m
$<$<CONFIG:Release>:/wd"4101"> # In release mode there are unreferenced variables because debug needs them
)
target_compile_options(compiler INTERFACE ${WARNING_FLAGS})
# Base
set(CMAKE_C_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo")
set(CMAKE_CXX_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo")
set(CMAKE_EXE_LINKER_FLAGS "/MANIFEST /DYNAMICBASE:NO /SAFESEH:NO /ERRORREPORT:PROMPT /NOLOGO")
set(CMAKE_STATIC_LINKER_FLAGS "")
# Release
set(CMAKE_C_FLAGS_RELEASE "/GL /W2 /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
set(CMAKE_CXX_FLAGS_RELEASE "/GL /W2 /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/OPT:REF /LTCG /INCREMENTAL:NO")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
globally_enable_extra_compiler_warnings()
CHECK_CXX_COMPILER_FLAG("/Zo" MSVC_COMPILER_SUPPORTS_ARCH_ZO)
if (MSVC_COMPILER_SUPPORTS_ARCH_ZO)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zo")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zo")
endif()
IF(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
ELSE(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
ENDIF(MSVC_USE_RUNTIME_DLL)
# Debug
set(CMAKE_C_FLAGS_DEBUG "/W4 /Gy /Zi /Od /RTC1 /Gd /Oy-")
set(CMAKE_CXX_FLAGS_DEBUG "/W4 /Gy /Zi /Od /RTC1 /Gd /Oy-")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /INCREMENTAL:NO /MAPINFO:EXPORTS /NODEFAULTLIB:libcmt.lib")
IF(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
ELSE(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
ENDIF(MSVC_USE_RUNTIME_DLL)
INCLUDE(MSVCMultipleProcessCompile)
# Visual Studio supports compiling for multiple vector instruction sets
SET(POSSIBLE_INSTUCTION_SETS "" SSE SSE2 AVX)
if (NOT DEFINED MSVC_SIMD_INSTRUCTIONS)
detect_simd_instructions(MSVC_DETECTED_SIMD_INSTRUCTIONS)
SET(MSVC_SIMD_INSTRUCTIONS "${MSVC_DETECTED_SIMD_INSTRUCTIONS}" CACHE FILEPATH "The SIMD instructions which will be used, possible values are ${POSSIBLE_INSTUCTION_SETS}")
MARK_AS_ADVANCED(FORCE MSVC_SIMD_INSTRUCTIONS)
endif()
set(FSO_INSTRUCTION_SET ${MSVC_SIMD_INSTRUCTIONS})
LIST(FIND POSSIBLE_INSTUCTION_SETS "${MSVC_SIMD_INSTRUCTIONS}" SET_INDEX)
if (SET_INDEX LESS 0)
MESSAGE(STATUS "An invalid instruction set was specified, defaulting to no special compiler options.")
else()
IF (NOT SET_INDEX EQUAL 0)
SET(FOUND)
FOREACH(list_index RANGE ${SET_INDEX} 1)
list(GET POSSIBLE_INSTUCTION_SETS ${list_index} _simd_set)
CHECK_CXX_COMPILER_FLAG("/arch:${_simd_set}" COMPILER_SUPPORTS_ARCH_${_simd_set})
IF(COMPILER_SUPPORTS_ARCH_${_simd_set})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:${_simd_set}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:${_simd_set}")
SET(FOUND TRUE)
BREAK()
ENDIF()
ENDFOREACH(list_index)
IF(NOT FOUND)
# Don't set anything, it will likely not work
MESSAGE(STATUS "Your compiler does not support any optimization flags, defaulting to none")
ENDIF(NOT FOUND)
ELSE()
CHECK_CXX_COMPILER_FLAG("/arch:IA32" COMPILER_SUPPORTS_ARCH_IA32)
IF(COMPILER_SUPPORTS_ARCH_IA32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:IA32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:IA32")
ENDIF(COMPILER_SUPPORTS_ARCH_IA32)
ENDIF()
endif()
target_compile_definitions(compiler INTERFACE _CRT_SECURE_NO_DEPRECATE
_CRT_SECURE_NO_WARNINGS _SECURE_SCL=0 NOMINMAX)
+33
View File
@@ -0,0 +1,33 @@
# File to execute compiler specific commands
add_library(compiler INTERFACE)
target_compile_definitions(compiler INTERFACE "$<$<CONFIG:Release>:NDEBUG>;$<$<CONFIG:Debug>:_DEBUG>;$<$<CONFIG:FastDebug>:_DEBUG>")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
include(toolchain-gcc)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
include(toolchain-msvc)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
include(toolchain-clang)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
include(toolchain-apple-clang)
ELSE("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
MESSAGE(STATUS "No special handling for this compiler present, good luck!")
ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Copy release settings to FastDebug
set(CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_EXE_LINKER_FLAGS_FASTDEBUG "${CMAKE_EXE_LINKER_RELEASE}")
set(CMAKE_STATIC_LINKER_FLAGS_FASTDEBUG "${CMAKE_STATIC_LINKER_FLAGS_RELEASE}")
if (MSVC)
# Adjust runtime library
string(REPLACE "/MD" "/MDd" CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_FASTDEBUG}")
string(REPLACE "/MT" "/MTd" CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_FASTDEBUG}")
string(REPLACE "/MD" "/MDd" CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_FASTDEBUG}")
string(REPLACE "/MT" "/MTd" CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_FASTDEBUG}")
endif()
+169
View File
@@ -0,0 +1,169 @@
include(CheckCCompilerFlag)
FUNCTION(MAKE_CACHE_INTERNAL VARIABLE)
SET(${VARIABLE} ${${VARIABLE}} CACHE INTERNAL "Internal cache variable")
ENDFUNCTION(MAKE_CACHE_INTERNAL)
FUNCTION(ADD_IMPORTED_LIB NAME INCLUDES LIBS)
ADD_LIBRARY(${NAME} INTERFACE)
target_link_libraries(${NAME} INTERFACE "${LIBS}")
target_include_directories(${NAME} INTERFACE "${INCLUDES}")
ENDFUNCTION(ADD_IMPORTED_LIB)
MACRO(PKG_CONFIG_LIB_RESOLVE NAME OUTVAR)
SET(${OUTVAR} "")
foreach(lib ${${NAME}_LIBRARIES})
find_library(${lib}_LIBRARY
NAMES ${lib}
HINTS ${${NAME}_LIBDIR} ${${NAME}_LIBRARY_DIRS}
)
if (NOT ${${lib}_LIBRARY} MATCHES ".*NOTFOUND.*")
SET(${OUTVAR} ${${OUTVAR}} ${${lib}_LIBRARY})
endif (NOT ${${lib}_LIBRARY} MATCHES ".*NOTFOUND.*")
endforeach(lib)
ENDMACRO(PKG_CONFIG_LIB_RESOLVE)
# Copy from http://cmake.3232098.n2.nabble.com/RFC-cmake-analog-to-AC-SEARCH-LIBS-td7585423.html
INCLUDE (CheckFunctionExists)
INCLUDE (CheckLibraryExists)
MACRO (CMAKE_SEARCH_LIBS v_func v_lib func)
CHECK_FUNCTION_EXISTS (${func} ${v_func})
IF (NOT ${v_func})
FOREACH (lib ${ARGN})
CHECK_LIBRARY_EXISTS (${lib} ${func} "" "HAVE_${func}_IN_${lib}")
IF (${HAVE_${func}_IN_${lib}})
SET (${v_func} TRUE)
SET (${v_lib} "${lib}" CACHE INTERNAL "Library providing ${func}")
BREAK()
ENDIF (${HAVE_${func}_IN_${lib}})
ENDFOREACH (lib)
ENDIF (NOT ${v_func})
ENDMACRO (CMAKE_SEARCH_LIBS)
# End copy
FUNCTION(EP_CHECK_FILE_EXISTS FILE OUTVAR TARGET NAME COMMAND WORKING_DIR)
string (REPLACE ";" " " COMMAND_STR "${COMMAND}")
IF(WIN32)
# Do something special for windows...
SET(COMMAND "cmd /C \"${COMMAND_STR}\"")
ELSE(WIN32)
SET(COMMAND "${COMMAND_STR}")
ENDIF(WIN32)
FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${NAME}" "
IF(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
MESSAGE(\"'${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}' already exists, nothing to be done.\")
ELSE(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
execute_process(COMMAND ${COMMAND} WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${WORKING_DIR}\")
ENDIF(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
")
SET(${OUTVAR} "${CMAKE_COMMAND}" -P ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${NAME} PARENT_SCOPE)
ENDFUNCTION(EP_CHECK_FILE_EXISTS)
MACRO(COPY_FILES_TO_TARGET _target)
FOREACH(file IN LISTS TARGET_COPY_FILES)
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${file}" "$<TARGET_FILE_DIR:${_target}>"
COMMENT "copying '${file}'..."
)
ENDFOREACH(file)
ENDMACRO(COPY_FILES_TO_TARGET)
macro(_clear_old_libraries_state)
set(is_debug FALSE)
set(is_optimized FALSE)
endmacro(_clear_old_libraries_state)
function(CONVERT_OLD_LIBRARIES)
_clear_old_libraries_state()
set(out_list)
foreach(lib ${ARGV})
if ("${lib}" STREQUAL "debug")
_clear_old_libraries_state()
set(is_debug TRUE)
elseif("${lib}" STREQUAL "optimized")
_clear_old_libraries_state()
set(is_optimized TRUE)
elseif("${lib}" STREQUAL "general")
_clear_old_libraries_state()
else("${lib}" STREQUAL "debug")
# Expecting normal library
if(is_debug)
list(APPEND out_list "$<$<CONFIG:Debug>:${lib}>")
elseif(is_optimized)
list(APPEND out_list "$<$<CONFIG:Release>:${lib}>")
else(is_debug)
list(APPEND out_list "${lib}")
endif(is_debug)
endif("${lib}" STREQUAL "debug")
endforeach(lib)
set(CONVERTED_LIBRARIES ${out_list} PARENT_SCOPE)
endfunction(CONVERT_OLD_LIBRARIES)
macro(set_policy policy value)
if (POLICY ${policy})
cmake_policy(SET ${policy} ${value})
endif ()
endmacro(set_policy)
macro(set_if_not_defined VAR VALUE)
if (NOT DEFINED ${VAR})
set(${VAR} ${VALUE})
endif()
endmacro(set_if_not_defined)
macro(configure_cotire target)
IF(COTIRE_ENABLE)
# Disable unity build as it doesn't work well for us
set_target_properties(${target} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
# add ignored paths for the precompiled header here
set_target_properties(code PROPERTIES COTIRE_PREFIX_HEADER_IGNORE_PATH
"${CMAKE_SOURCE_DIR};${CMAKE_BINARY_DIR}")
IF(DEFINED CMAKE_CONFIGURATION_TYPES)
cotire(${target} CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
ELSE(DEFINED CMAKE_CONFIGURATION_TYPES)
cotire(${target})
ENDIF(DEFINED CMAKE_CONFIGURATION_TYPES)
ENDIF(COTIRE_ENABLE)
endmacro(configure_cotire)
macro(add_target_copy_files)
INSTALL(FILES ${ARGN}
DESTINATION ${BINARY_DESTINATION}
)
SET(TARGET_COPY_FILES ${TARGET_COPY_FILES} ${ARGN} CACHE INTERNAL "" FORCE)
endmacro(add_target_copy_files)
function(detect_simd_instructions _out_var)
if(CMAKE_CROSSCOMPILING)
set(${_out_var} "" PARENT_SCOPE)
else()
message(STATUS "Detecting SIMD features of current CPU...")
TRY_RUN(RUN_RESULT COMPILE_RESULT "${CMAKE_BINARY_DIR}/temp" "${CMAKE_SOURCE_DIR}/cmake/cpufeatures.cpp"
RUN_OUTPUT_VARIABLE FEATURE_OUTPUT)
IF(COMPILE_RESULT)
MESSAGE(STATUS "Detected compatibility for the ${FEATURE_OUTPUT} feature set.")
SET(${_out_var} ${FEATURE_OUTPUT} PARENT_SCOPE)
ELSE(COMPILE_RESULT)
MESSAGE("Compilation of CPU feature detector failed, please set the instruction set manually.")
set(${_out_var} "" PARENT_SCOPE)
ENDIF(COMPILE_RESULT)
endif()
endfunction()
function (check_linker_flag _flag _out_var)
SET(CMAKE_REQUIRED_FLAGS "${_flag}")
CHECK_C_COMPILER_FLAG("" ${_out_var})
endfunction(check_linker_flag)
+52
View File
@@ -0,0 +1,52 @@
include(util)
if (EXISTS "${PROJECT_SOURCE_DIR}/version_override.cmake")
# This allows to override the values by using a special file
include("${PROJECT_SOURCE_DIR}/version_override.cmake")
endif()
set_if_not_defined(FSO_VERSION_MAJOR 3)
set_if_not_defined(FSO_VERSION_MINOR 7)
set_if_not_defined(FSO_VERSION_BUILD 5)
# A numeric revision e.g. the CI build number
set_if_not_defined(FSO_VERSION_REVISION 0)
# A generic revision string, can be anything
set_if_not_defined(FSO_VERSION_REVISION_STR "${FSO_VERSION_REVISION}")
if("${FSO_VERSION_REVISION}" STREQUAL "0" AND "${FSO_VERSION_REVISION_STR}" STREQUAL "${FSO_VERSION_REVISION}")
set(FSO_VERSION_HAS_REVISION 0)
else()
set(FSO_VERSION_HAS_REVISION 1)
endif()
set(FSO_FULL_VERSION_STRING "${FSO_VERSION_MAJOR}.${FSO_VERSION_MINOR}.${FSO_VERSION_BUILD}")
set(FSO_PRODUCT_VERSION_STRING "${FSO_FULL_VERSION_STRING}")
if (FSO_VERSION_HAS_REVISION)
set(FSO_FULL_VERSION_STRING "${FSO_FULL_VERSION_STRING}.${FSO_VERSION_REVISION_STR}")
endif()
IF(NOT FSO_VERSION_HAS_REVISION)
SET(FSO_BINARY_SUFFIX "${FSO_VERSION_MAJOR}_${FSO_VERSION_MINOR}_${FSO_VERSION_BUILD}")
ELSE()
SET(FSO_BINARY_SUFFIX "${FSO_VERSION_MAJOR}_${FSO_VERSION_MINOR}_${FSO_VERSION_BUILD}_${FSO_VERSION_REVISION_STR}")
ENDIF()
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
# This is a 64-bit builds
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_x64")
ENDIF()
IF (NOT "${FSO_INSTRUCTION_SET}" STREQUAL "")
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_${FSO_INSTRUCTION_SET}")
ENDIF()
IF (NOT "${FSO_BUILD_POSTFIX}" STREQUAL "")
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_${FSO_BUILD_POSTFIX}")
ENDIF()
set(CONFIG_POSTFIX "$<$<CONFIG:Release>:>$<$<CONFIG:Debug>:-DEBUG>$<$<CONFIG:FastDebug>:-FASTDBG>")
set(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}${CONFIG_POSTFIX}")
+56
View File
@@ -0,0 +1,56 @@
INCLUDE(source_groups.cmake)
INCLUDE(voice_rec.cmake)
ADD_LIBRARY(code STATIC ${file_root} ${VOICE_REC_FILES})
target_compile_features(code PUBLIC ${REQUIRED_CXX_FEATURES})
INCLUDE(default_files.cmake)
if (MSVC)
target_compile_definitions(code PUBLIC "PDB_DEBUGGING=1")
endif(MSVC)
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${CODE_HEADERS})
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${FREESPACE_HEADERS})
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${GENERATED_SOURCE_DIR})
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${GENERATED_SOURCE_DIR}/code)
target_link_libraries(code PUBLIC gl_12)
TARGET_LINK_LIBRARIES(code PUBLIC ${OPENAL_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC ${LUA_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC ${PNG_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC ${JPEG_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC oggvorbis)
TARGET_LINK_LIBRARIES(code PUBLIC ${SDL_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC platform)
TARGET_LINK_LIBRARIES(code PUBLIC compiler)
IF (FSO_USE_SPEECH)
find_package(Speech REQUIRED)
target_link_libraries(code PUBLIC speech)
ENDIF(FSO_USE_SPEECH)
# Headers for standalone "gui" on UNIX
IF(UNIX)
TARGET_LINK_LIBRARIES(code PUBLIC jansson)
TARGET_LINK_LIBRARIES(code PUBLIC ${MONGOOSE_LIBS})
ENDIF(UNIX)
IF(FSO_BUILD_TOOLS)
ADD_SUBDIRECTORY(cfilearchiver)
ADD_SUBDIRECTORY(cfileextractor)
ENDIF(FSO_BUILD_TOOLS)
include(util)
configure_cotire(code)
include(../cmake/Cxx11.cmake)
-848
View File
@@ -1,848 +0,0 @@
## code/Makefile.am for fs2_open
##
## $Id: Makefile.am,v 1.31.2.10 2007-11-22 04:52:12 taylor Exp $
EXTRA_DIST = \
freespace2/app_icon.ico \
freespace2/freespace.rc \
freespace2/freespaceresource.h \
freespace2/goal_com.bmp \
freespace2/goal_fail.bmp \
freespace2/goal_inc.bmp \
freespace2/goal_none.bmp \
freespace2/goal_ord.bmp \
fred2/addvariabledlg.cpp \
fred2/addvariabledlg.h \
fred2/adjustgriddlg.cpp \
fred2/adjustgriddlg.h \
fred2/asteroideditordlg.cpp \
fred2/asteroideditordlg.h \
fred2/bgbitmapdlg.cpp \
fred2/bgbitmapdlg.h \
fred2/briefingeditordlg.cpp \
fred2/briefingeditordlg.h \
fred2/campaigneditordlg.cpp \
fred2/campaigneditordlg.h \
fred2/campaignfilelistbox.cpp \
fred2/campaignfilelistbox.h \
fred2/campaigntreeview.cpp \
fred2/campaigntreeview.h \
fred2/campaigntreewnd.cpp \
fred2/campaigntreewnd.h \
fred2/cmdbrief.cpp \
fred2/cmdbrief.h \
fred2/createwingdlg.cpp \
fred2/createwingdlg.h \
fred2/customwingnames.cpp \
fred2/customwingnames.h \
fred2/debriefingeditordlg.cpp \
fred2/debriefingeditordlg.h \
fred2/dialog1.cpp \
fred2/dialog1.h \
fred2/dumpstats.cpp \
fred2/dumpstats.h \
fred2/editor.h \
fred2/eventeditor.cpp \
fred2/eventeditor.h \
fred2/folderdlg.cpp \
fred2/folderdlg.h \
fred2/fred.cpp \
fred2/fred.h \
fred2/fred.rc \
fred2/freddoc.cpp \
fred2/freddoc.h \
fred2/fredrender.cpp \
fred2/fredrender.h \
fred2/fredstubs.cpp \
fred2/fredview.cpp \
fred2/fredview.h \
fred2/grid.cpp \
fred2/grid.h \
fred2/ignoreordersdlg.cpp \
fred2/ignoreordersdlg.h \
fred2/initialships.cpp \
fred2/initialships.h \
fred2/initialstatus.cpp \
fred2/initialstatus.h \
fred2/mainfrm.cpp \
fred2/mainfrm.h \
fred2/makehelp.bat \
fred2/management.cpp \
fred2/management.h \
fred2/messageeditordlg.cpp \
fred2/messageeditordlg.h \
fred2/missiongoalsdlg.cpp \
fred2/missiongoalsdlg.h \
fred2/missionnotesdlg.cpp \
fred2/missionnotesdlg.h \
fred2/missionsave.cpp \
fred2/missionsave.h \
fred2/modifyvariabledlg.cpp \
fred2/modifyvariabledlg.h \
fred2/operatorargtypeselect.cpp \
fred2/operatorargtypeselect.h \
fred2/orienteditor.cpp \
fred2/orienteditor.h \
fred2/playerstarteditor.cpp \
fred2/playerstarteditor.h \
fred2/prefsdlg.cpp \
fred2/prefsdlg.h \
fred2/reinforcementeditordlg.cpp \
fred2/reinforcementeditordlg.h \
fred2/resource.h \
fred2/resource.hm \
fred2/setglobalshipflags.cpp \
fred2/setglobalshipflags.h \
fred2/sexp_tree.cpp \
fred2/sexp_tree.h \
fred2/shieldsysdlg.cpp \
fred2/shieldsysdlg.h \
fred2/ship_select.cpp \
fred2/ship_select.h \
fred2/shipchecklistbox.cpp \
fred2/shipchecklistbox.h \
fred2/shipclasseditordlg.cpp \
fred2/shipclasseditordlg.h \
fred2/shipeditordlg.cpp \
fred2/shipeditordlg.h \
fred2/shipflagsdlg.cpp \
fred2/shipflagsdlg.h \
fred2/shipgoalsdlg.cpp \
fred2/shipgoalsdlg.h \
fred2/shipspecialdamage.cpp \
fred2/shipspecialdamage.h \
fred2/shipspecialhitpoints.cpp \
fred2/shipspecialhitpoints.h \
fred2/shiptexturesdlg.cpp \
fred2/shiptexturesdlg.h \
fred2/starfieldeditor.cpp \
fred2/starfieldeditor.h \
fred2/stdafx.cpp \
fred2/stdafx.h \
fred2/textviewdlg.cpp \
fred2/textviewdlg.h \
fred2/voiceactingmanager.cpp \
fred2/voiceactingmanager.h \
fred2/waypointpathdlg.cpp \
fred2/waypointpathdlg.h \
fred2/weaponeditordlg.cpp \
fred2/weaponeditordlg.h \
fred2/wing.cpp \
fred2/wing.h \
fred2/wing_editor.cpp \
fred2/wing_editor.h \
fred2/hlp/afxcore.rtf \
fred2/hlp/afxhelp.hm \
fred2/hlp/afxprint.rtf \
fred2/hlp/appexit.bmp \
fred2/hlp/bullet.bmp \
fred2/hlp/curarw2.bmp \
fred2/hlp/curarw4.bmp \
fred2/hlp/curhelp.bmp \
fred2/hlp/editcopy.bmp \
fred2/hlp/editcut.bmp \
fred2/hlp/editpast.bmp \
fred2/hlp/editundo.bmp \
fred2/hlp/filenew.bmp \
fred2/hlp/fileopen.bmp \
fred2/hlp/fileprnt.bmp \
fred2/hlp/filesave.bmp \
fred2/hlp/fred.hm \
fred2/hlp/fred.hpj \
fred2/hlp/help.log \
fred2/hlp/hlpsbar.bmp \
fred2/hlp/hlptbar.bmp \
fred2/hlp/recfirst.bmp \
fred2/hlp/reclast.bmp \
fred2/hlp/recnext.bmp \
fred2/hlp/recprev.bmp \
fred2/hlp/scmax.bmp \
fred2/hlp/scmenu.bmp \
fred2/hlp/scmin.bmp \
fred2/res/bitmap1.bmp \
fred2/res/black_do.bmp \
fred2/res/bmp00001.bmp \
fred2/res/chained.bmp \
fred2/res/chained_directive.bmp \
fred2/res/cursor1.cur \
fred2/res/cursor2.cur \
fred2/res/data.bmp \
fred2/res/fred.ico \
fred2/res/fred.rc2 \
fred2/res/freddoc.ico \
fred2/res/green_do.bmp \
fred2/res/root.bmp \
fred2/res/root_directive.bmp \
fred2/res/toolbar.bmp \
fred2/res/toolbar1.bmp \
fred2/res/variable.bmp \
sound/phrases.xml \
sound/gc.exe \
wxfred2/res/fred.ico \
wxfred2/wxfred.xrc
# D_ variants are defaults and should always be used
# FS2_ variants are for game building and wxFRED
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@
AM_LDFLAGS = @D_LDFLAGS@ @FS2_LDFLAGS@
noinst_LIBRARIES = libcode.a
bin_PROGRAMS = @FS2_BINARY@
EXTRA_PROGRAMS = fs2_open_@PACKAGE_VERSION@ \
fs2_open_@PACKAGE_VERSION@_DEBUG \
wxFRED2_@PACKAGE_VERSION@ \
wxFRED2_@PACKAGE_VERSION@_DEBUG
###############################################################################
##
## Begin CORE library
##
FS2_SOURCES = \
ai/ai.cpp \
ai/ai.h \
ai/aibig.cpp \
ai/aibig.h \
ai/aicode.cpp \
ai/aigoals.cpp \
ai/aigoals.h \
ai/aiinternal.h \
ai/ailocal.h \
ai/aiturret.cpp \
ai/ai_profiles.cpp \
ai/ai_profiles.h \
anim/animplay.cpp \
anim/animplay.h \
anim/packunpack.cpp \
anim/packunpack.h \
asteroid/asteroid.cpp \
asteroid/asteroid.h \
autopilot/autopilot.cpp \
autopilot/autopilot.h \
bmpman/bm_internal.h \
bmpman/bmpman.cpp \
bmpman/bmpman.h \
camera/camera.cpp \
camera/camera.h \
cfile/cfile.cpp \
cfile/cfile.h \
cfile/cfilearchive.cpp \
cfile/cfilearchive.h \
cfile/cfilelist.cpp \
cfile/cfilesystem.cpp \
cfile/cfilesystem.h \
cmdline/cmdline.cpp \
cmdline/cmdline.h \
cmeasure/cmeasure.cpp \
cmeasure/cmeasure.h \
controlconfig/controlsconfig.cpp \
controlconfig/controlsconfig.h \
controlconfig/controlsconfigcommon.cpp \
cutscene/cutscenes.cpp \
cutscene/cutscenes.h \
cutscene/decoder16.cpp \
cutscene/decoder8.cpp \
cutscene/movie.cpp \
cutscene/movie.h \
cutscene/mve_audio.cpp \
cutscene/mvelib.cpp \
cutscene/mvelib.h \
cutscene/mveplayer.cpp \
cutscene/oggplayer.cpp \
cutscene/oggplayer.h \
ddsutils/ddsutils.cpp \
ddsutils/ddsutils.h \
debris/debris.cpp \
debris/debris.h \
debugconsole/console.cpp \
debugconsole/dbugfile.h \
debugconsole/timerbar.cpp \
debugconsole/timerbar.h \
exceptionhandler/exceptionhandler.cpp \
exceptionhandler/exceptionhandler.h \
external_dll/externalcode.h \
external_dll/trackirglobal.cpp \
external_dll/trackirglobal.h \
fireball/fireballs.cpp \
fireball/fireballs.h \
fireball/warpineffect.cpp \
fs2netd/fs2netd_client.cpp \
fs2netd/fs2netd_client.h \
fs2netd/tcp_client.cpp \
fs2netd/tcp_client.h \
fs2netd/tcp_socket.cpp \
fs2netd/tcp_socket.h \
fs2netd/protocol.h \
gamehelp/contexthelp.cpp \
gamehelp/contexthelp.h \
gamehelp/gameplayhelp.cpp \
gamehelp/gameplayhelp.h \
gamesequence/gamesequence.cpp \
gamesequence/gamesequence.h \
gamesnd/eventmusic.cpp \
gamesnd/eventmusic.h \
gamesnd/gamesnd.cpp \
gamesnd/gamesnd.h \
globalincs/alphacolors.cpp \
globalincs/alphacolors.h \
globalincs/def_files.cpp \
globalincs/def_files.h \
globalincs/fsmemory.cpp \
globalincs/fsmemory.h \
globalincs/globals.h \
globalincs/linklist.h \
globalincs/pstypes.h \
globalincs/safe_strings.cpp \
globalincs/safe_strings.h \
globalincs/safe_strings_test.cpp \
globalincs/systemvars.cpp \
globalincs/systemvars.h \
globalincs/version.cpp \
globalincs/version.h \
graphics/2d.cpp \
graphics/2d.h \
graphics/font.cpp \
graphics/font.h \
graphics/generic.cpp \
graphics/generic.h \
graphics/grbatch.cpp \
graphics/grbatch.h \
graphics/grinternal.h \
graphics/gropengl.cpp \
graphics/gropengl.h \
graphics/gropenglbmpman.cpp \
graphics/gropenglbmpman.h \
graphics/gropengldraw.cpp \
graphics/gropengldraw.h \
graphics/gropenglextension.cpp \
graphics/gropenglextension.h \
graphics/gropengllight.cpp \
graphics/gropengllight.h \
graphics/gropenglpostprocessing.cpp \
graphics/gropenglpostprocessing.h \
graphics/gropenglshader.cpp \
graphics/gropenglshader.h \
graphics/gropenglstate.cpp \
graphics/gropenglstate.h \
graphics/gropengltexture.cpp \
graphics/gropengltexture.h \
graphics/gropengltnl.cpp \
graphics/gropengltnl.h \
graphics/grstub.cpp \
graphics/grstub.h \
graphics/line.h \
graphics/tmapper.h \
hud/hud.cpp \
hud/hud.h \
hud/hudartillery.cpp \
hud/hudartillery.h \
hud/hudbrackets.cpp \
hud/hudbrackets.h \
hud/hudconfig.cpp \
hud/hudconfig.h \
hud/hudescort.cpp \
hud/hudescort.h \
hud/hudets.cpp \
hud/hudets.h \
hud/hudgauges.h \
hud/hudlock.cpp \
hud/hudlock.h \
hud/hudmessage.cpp \
hud/hudmessage.h \
hud/hudnavigation.cpp \
hud/hudnavigation.h \
hud/hudobserver.cpp \
hud/hudobserver.h \
hud/hudparse.cpp \
hud/hudparse.h \
hud/hudreticle.cpp \
hud/hudreticle.h \
hud/hudshield.cpp \
hud/hudshield.h \
hud/hudsquadmsg.cpp \
hud/hudsquadmsg.h \
hud/hudtarget.cpp \
hud/hudtarget.h \
hud/hudtargetbox.cpp \
hud/hudtargetbox.h \
hud/hudwingmanstatus.cpp \
hud/hudwingmanstatus.h \
iff_defs/iff_defs.cpp \
iff_defs/iff_defs.h \
inetfile/cftp.cpp \
inetfile/cftp.h \
inetfile/chttpget.cpp \
inetfile/chttpget.h \
inetfile/inetgetfile.cpp \
inetfile/inetgetfile.h \
io/key.cpp \
io/key.h \
io/keycontrol.cpp \
io/keycontrol.h \
io/mouse.cpp \
io/mouse.h \
io/timer.cpp \
io/timer.h \
jpgutils/jpgutils.cpp \
jpgutils/jpgutils.h \
jumpnode/jumpnode.cpp \
jumpnode/jumpnode.h \
lab/lab.cpp \
lab/lab.h \
lab/wmcgui.cpp \
lab/wmcgui.h \
lighting/lighting.cpp \
lighting/lighting.h \
localization/fhash.cpp \
localization/fhash.h \
localization/localize.cpp \
localization/localize.h \
math/fix.cpp \
math/fix.h \
math/floating.cpp \
math/floating.h \
math/fvi.cpp \
math/fvi.h \
math/spline.cpp \
math/spline.h \
math/staticrand.cpp \
math/staticrand.h \
math/vecmat.cpp \
math/vecmat.h \
menuui/barracks.cpp \
menuui/barracks.h \
menuui/credits.cpp \
menuui/credits.h \
menuui/fishtank.cpp \
menuui/fishtank.h \
menuui/mainhallmenu.cpp \
menuui/mainhallmenu.h \
menuui/mainhalltemp.cpp \
menuui/mainhalltemp.h \
menuui/optionsmenu.cpp \
menuui/optionsmenu.h \
menuui/optionsmenumulti.cpp \
menuui/optionsmenumulti.h \
menuui/playermenu.cpp \
menuui/playermenu.h \
menuui/readyroom.cpp \
menuui/readyroom.h \
menuui/snazzyui.cpp \
menuui/snazzyui.h \
menuui/techmenu.cpp \
menuui/techmenu.h \
menuui/trainingmenu.cpp \
menuui/trainingmenu.h \
mission/missionbriefcommon.cpp \
mission/missionbriefcommon.h \
mission/missioncampaign.cpp \
mission/missioncampaign.h \
mission/missiongoals.cpp \
mission/missiongoals.h \
mission/missiongrid.cpp \
mission/missiongrid.h \
mission/missionhotkey.cpp \
mission/missionhotkey.h \
mission/missionload.cpp \
mission/missionload.h \
mission/missionlog.cpp \
mission/missionlog.h \
mission/missionmessage.cpp \
mission/missionmessage.h \
mission/missionparse.cpp \
mission/missionparse.h \
mission/missiontraining.cpp \
mission/missiontraining.h \
missionui/chatbox.cpp \
missionui/chatbox.h \
missionui/fictionviewer.cpp \
missionui/fictionviewer.h \
missionui/missionbrief.cpp \
missionui/missionbrief.h \
missionui/missioncmdbrief.cpp \
missionui/missioncmdbrief.h \
missionui/missiondebrief.cpp \
missionui/missiondebrief.h \
missionui/missionloopbrief.cpp \
missionui/missionloopbrief.h \
missionui/missionpause.cpp \
missionui/missionpause.h \
missionui/missionrecommend.cpp \
missionui/missionrecommend.h \
missionui/missionscreencommon.cpp \
missionui/missionscreencommon.h \
missionui/missionshipchoice.cpp \
missionui/missionshipchoice.h \
missionui/missionstats.cpp \
missionui/missionstats.h \
missionui/missionweaponchoice.cpp \
missionui/missionweaponchoice.h \
missionui/redalert.cpp \
missionui/redalert.h \
mod_table/mod_table.cpp \
mod_table/mod_table.h \
model/model.h \
model/modelanim.cpp \
model/modelanim.h \
model/modelcollide.cpp \
model/modelinterp.cpp \
model/modelsinc.h \
model/modeloctant.cpp \
model/modelread.cpp \
nebula/neb.cpp \
nebula/neb.h \
nebula/neblightning.cpp \
nebula/neblightning.h \
network/chat_api.cpp \
network/chat_api.h \
network/multi.cpp \
network/multi.h \
network/multilag.cpp \
network/multilag.h \
network/multimsgs.cpp \
network/multimsgs.h \
network/multiteamselect.cpp \
network/multiteamselect.h \
network/multiui.cpp \
network/multiui.h \
network/multiutil.cpp \
network/multiutil.h \
network/multi_campaign.cpp \
network/multi_campaign.h \
network/multi_data.cpp \
network/multi_data.h \
network/multi_dogfight.cpp \
network/multi_dogfight.h \
network/multi_endgame.cpp \
network/multi_endgame.h \
network/multi_ingame.cpp \
network/multi_ingame.h \
network/multi_kick.cpp \
network/multi_kick.h \
network/multi_log.cpp \
network/multi_log.h \
network/multi_obj.cpp \
network/multi_obj.h \
network/multi_observer.cpp \
network/multi_observer.h \
network/multi_options.cpp \
network/multi_options.h \
network/multi_pause.cpp \
network/multi_pause.h \
network/multi_pinfo.cpp \
network/multi_pinfo.h \
network/multi_ping.cpp \
network/multi_ping.h \
network/multi_pmsg.cpp \
network/multi_pmsg.h \
network/multi_pxo.cpp \
network/multi_pxo.h \
network/multi_rate.cpp \
network/multi_rate.h \
network/multi_respawn.cpp \
network/multi_respawn.h \
network/multi_sexp.cpp \
network/multi_sexp.h \
network/multi_team.cpp \
network/multi_team.h \
network/multi_update.h \
network/multi_voice.cpp \
network/multi_voice.h \
network/multi_xfer.cpp \
network/multi_xfer.h \
network/psnet2.cpp \
network/psnet2.h \
network/stand_gui.cpp \
network/stand_gui-unix.cpp \
network/stand_gui.h \
object/collidedebrisship.cpp \
object/collidedebrisweapon.cpp \
object/collideshipship.cpp \
object/collideshipweapon.cpp \
object/collideweaponweapon.cpp \
object/deadobjectdock.cpp \
object/deadobjectdock.h \
object/objcollide.cpp \
object/objcollide.h \
object/objectdock.cpp \
object/objectdock.h \
object/object.cpp \
object/object.h \
object/objectshield.cpp \
object/objectshield.h \
object/objectsnd.cpp \
object/objectsnd.h \
object/objectsort.cpp \
object/parseobjectdock.cpp \
object/parseobjectdock.h \
object/waypoint.cpp \
object/waypoint.h \
observer/observer.cpp \
observer/observer.h \
palman/palman.cpp \
palman/palman.h \
parse/encrypt.cpp \
parse/encrypt.h \
parse/generic_log.cpp \
parse/generic_log.h \
parse/lua.cpp \
parse/lua.h \
parse/parselo.cpp \
parse/parselo.h \
parse/scripting.cpp \
parse/scripting.h \
parse/sexp.cpp \
parse/sexp.h \
particle/particle.cpp \
particle/particle.h \
pcxutils/pcxutils.cpp \
pcxutils/pcxutils.h \
pilotfile/pilotfile.cpp \
pilotfile/pilotfile.h \
pilotfile/pilotfile_convert.cpp \
pilotfile/pilotfile_convert.h \
pilotfile/plr.cpp \
pilotfile/csg.cpp \
pilotfile/plr_convert.cpp \
pilotfile/csg_convert.cpp \
pngutils/pngutils.cpp \
pngutils/pngutils.h \
physics/physics.cpp \
physics/physics.h \
playerman/managepilot.cpp \
playerman/managepilot.h \
playerman/player.h \
playerman/playercontrol.cpp \
popup/popup.cpp \
popup/popup.h \
popup/popupdead.cpp \
popup/popupdead.h \
radar/radar.cpp \
radar/radar.h \
radar/radardradis.cpp \
radar/radardradis.h \
radar/radarorb.cpp \
radar/radarorb.h \
radar/radarsetup.cpp \
radar/radarsetup.h \
render/3d.h \
render/3dclipper.cpp \
render/3ddraw.cpp \
render/3dinternal.h \
render/3dlaser.cpp \
render/3dmath.cpp \
render/3dsetup.cpp \
ship/afterburner.cpp \
ship/afterburner.h \
ship/awacs.cpp \
ship/awacs.h \
ship/shield.cpp \
ship/ship.cpp \
ship/ship.h \
ship/shipcontrails.cpp \
ship/shipcontrails.h \
ship/shipfx.cpp \
ship/shipfx.h \
ship/shiphit.cpp \
ship/shiphit.h \
ship/subsysdamage.h \
sound/audiostr.cpp \
sound/audiostr.h \
sound/acm.cpp \
sound/acm.h \
sound/ds.cpp \
sound/ds.h \
sound/ds3d.cpp \
sound/ds3d.h \
sound/dscap.cpp \
sound/dscap.h \
sound/fsspeech.cpp \
sound/fsspeech.h \
sound/openal.cpp \
sound/openal.h \
sound/rtvoice.cpp \
sound/rtvoice.h \
sound/sound.cpp \
sound/sound.h \
sound/speech.cpp \
sound/speech.h \
sound/voicerec.cpp \
sound/voicerec.h \
sound/ogg/ogg.cpp \
sound/ogg/ogg.h \
species_defs/species_defs.cpp \
species_defs/species_defs.h \
starfield/nebula.cpp \
starfield/nebula.h \
starfield/starfield.cpp \
starfield/starfield.h \
starfield/supernova.cpp \
starfield/supernova.h \
stats/medals.cpp \
stats/medals.h \
stats/scoring.cpp \
stats/scoring.h \
stats/stats.cpp \
stats/stats.h \
tgautils/tgautils.cpp \
tgautils/tgautils.h \
ui/button.cpp \
ui/checkbox.cpp \
ui/gadget.cpp \
ui/icon.cpp \
ui/inputbox.cpp \
ui/keytrap.cpp \
ui/listbox.cpp \
ui/radio.cpp \
ui/scroll.cpp \
ui/slider.cpp \
ui/slider2.cpp \
ui/ui.h \
ui/uidefs.h \
ui/uidraw.cpp \
ui/uimouse.cpp \
ui/window.cpp \
weapon/beam.cpp \
weapon/beam.h \
weapon/corkscrew.cpp \
weapon/corkscrew.h \
weapon/emp.cpp \
weapon/emp.h \
weapon/flak.cpp \
weapon/flak.h \
weapon/muzzleflash.cpp \
weapon/muzzleflash.h \
weapon/shockwave.cpp \
weapon/shockwave.h \
weapon/swarm.cpp \
weapon/swarm.h \
weapon/trails.cpp \
weapon/trails.h \
weapon/weapons.cpp \
weapon/weapon.h
## conditional includes follow:
## joystic support sources
if FS2_OS_WIN32
JOY_SOURCES = \
io/joy.cpp \
io/joy.h \
io/joy_ff.cpp \
io/joy_ff.h \
io/sw_error.hpp \
io/sw_force.h \
io/sw_guid.hpp \
io/swff_lib.cpp
endif
if FS2_OS_UNIX
JOY_SOURCES = \
io/joy.h \
io/joy_ff.h \
io/joy-unix.cpp
endif
## Win32-specific sources
if FS2_OS_WIN32
WIN32_SOURCES = \
directx/vasync.h \
directx/vd3dtypes.h \
directx/vddraw.h \
directx/vdinput.h \
directx/vdplay.h \
directx/vdplobby.h \
directx/vdsetup.h \
directx/vdvp.h \
globalincs/windebug.cpp \
graphics/gl/GLAUX.H \
graphics/gl/GLU.H \
graphics/gl/Gl.h \
graphics/gl/Glext.h \
graphics/gl/wglext.h \
osapi/monopub.h \
osapi/osapi.cpp \
osapi/osapi.h \
osapi/osregistry.cpp \
osapi/osregistry.h \
osapi/outwnd.cpp \
osapi/outwnd.h
endif
## Unix-specific sources
if FS2_OS_UNIX
UNIX_SOURCES = \
osapi/osapi_unix.cpp \
osapi/osapi.h \
osapi/osregistry_unix.cpp \
osapi/osregistry.h \
osapi/outwnd_unix.cpp \
osapi/outwnd.h \
windows_stub/stubs.cpp \
windows_stub/config.h
endif
## libcode.a
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${WIN32_SOURCES} \
${UNIX_SOURCES}
##
## End CODE library
##
###############################################################################
###############################################################################
##
## Begin MAIN fs2 binary
##
FS2OPEN_SOURCES = \
freespace2/freespace.cpp \
freespace2/freespace.h \
freespace2/levelpaging.cpp \
freespace2/levelpaging.h
fs2_open_@PACKAGE_VERSION@_DEBUG_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_@PACKAGE_VERSION@_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_@PACKAGE_VERSION@_DEBUG_LDADD = libcode.a
fs2_open_@PACKAGE_VERSION@_LDADD = libcode.a
##
## End MAIN binary
##
###############################################################################
###############################################################################
##
## Begin wxFRED2 binary
##
wxFRED_SOURCES = \
wxfred2/wxfred2.cpp \
wxfred2/wxfred2.h \
wxfred2/fredframe.cpp \
wxfred2/fredframe.h \
wxfred2/wxfred_xrc.cpp \
wxfred2/wxfred_xrc.h
wxFRED2_@PACKAGE_VERSION@_DEBUG_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_@PACKAGE_VERSION@_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_@PACKAGE_VERSION@_DEBUG_LDADD = libcode.a
wxFRED2_@PACKAGE_VERSION@_LDADD = libcode.a
##
## End wxFRED2 binary
##
###############################################################################
+17 -16
View File
@@ -12,17 +12,17 @@
#ifndef _AI_H
#define _AI_H
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
#include "ai/ai_profiles.h"
#include "physics/physics.h"
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#include "globalincs/systemvars.h"
#include "object/waypoint.h"
#include "physics/physics.h"
struct ship_weapon;
struct ship_subsys;
struct object;
struct ship_info;
class ship_subsys;
class object;
class ship_info;
#define AI_DEFAULT_CLASS 3 // default AI class for new ships (Fred)
@@ -32,7 +32,7 @@ typedef struct ai_flag_name {
int flag_list;
} ai_flag_name;
#define MAX_AI_FLAG_NAMES 1
#define MAX_AI_FLAG_NAMES 2
extern ai_flag_name Ai_flag_names[];
#define AIF_FORMATION_WING (1 << 0) // Fly in formation as part of wing.
@@ -64,6 +64,8 @@ extern ai_flag_name Ai_flag_names[];
#define AIF_UNLOAD_PRIMARIES (1 << 24) // Fire primaries as fast as possible!
#define AIF_TRYING_UNSUCCESSFULLY_TO_WARP (1 << 25) // Trying to warp, but can't warp at the moment
#define AIF_FREE_AFTERBURNER_USE (1 << 26) // Use afterburners while following waypoints or flying towards objects
#define AIF_AVOID_SHOCKWAVE (AIF_AVOID_SHOCKWAVE_SHIP | AIF_AVOID_SHOCKWAVE_WEAPON)
#define AIF_FORMATION (AIF_FORMATION_WING | AIF_FORMATION_OBJECT)
@@ -107,6 +109,7 @@ extern ai_flag_name Ai_flag_names[];
#define AIGF_PURGE (1<<5) // purge this goal next time we process
#define AIGF_GOALS_PURGED (1<<6) // this goal has already caused other goals to get purged
#define AIGF_DEPART_SOUND_PLAYED (1<<7) // Goober5000 - replacement for AL's hack ;)
#define AIGF_TARGET_OWN_TEAM (1<<8) // Goober5000 - removes standard precautions against AI ships taking traitorous actions
#define AIGF_DOCK_INDEXES_VALID (AIGF_DOCKER_INDEX_VALID|AIGF_DOCKEE_INDEX_VALID)
@@ -366,10 +369,10 @@ typedef struct ai_info {
int ai_class; // Class. Might be override of default.
// Probably become obsolete, to be replaced by path_start, path_cur, etc.
waypoint_list *wp_list; // waypoint list being followed
SCP_list<waypoint>::iterator wp_index; // waypoint index in list
waypoint_list *wp_list; // waypoint list being followed
size_t wp_index; // waypoint index in list
int wp_flags; // waypoint flags, see WPF_xxxx
int waypoint_speed_cap; // -1 no cap, otherwise cap - changed to int by Goober5000
int waypoint_speed_cap; // -1 no cap, otherwise cap - changed to int by Goober5000
// Path following information
int path_start; // Index into global array, start of path.
@@ -587,7 +590,7 @@ extern char** Ai_class_names;
extern int Num_ai_classes;
extern int Ai_firing_enabled;
extern char *Skill_level_names(int skill_level, int translate = 1);
extern const char *Skill_level_names(int skill_level, int translate = 1);
extern int Ai_goal_signature;
// need access to following data in AiBig.cpp
@@ -619,10 +622,9 @@ extern void init_ai_system(void);
extern void ai_attack_object(object *attacker, object *attacked, ship_subsys *ssp);
extern void ai_evade_object(object *evader, object *evaded);
extern void ai_ignore_object(object *ignorer, object *ignored, int ignore_new);
extern void ai_ignore_wing(object *ignorer, int wingnum, int priority);
extern void ai_ignore_wing(object *ignorer, int wingnum);
extern void ai_dock_with_object(object *docker, int docker_index, object *dockee, int dockee_index, int dock_type);
extern void ai_stay_still(object *still_objp, vec3d *view_pos);
extern void ai_set_default_behavior(object *obj, int classnum);
extern void ai_do_default_behavior(object *obj);
extern void ai_start_waypoints(object *objp, waypoint_list *wp_list, int wp_flags);
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hitpos, int shield_quadrant, vec3d *hit_normal);
@@ -724,8 +726,7 @@ void process_subobjects(int objnum);
//SUSHI: Setting ai_info stuff from both ai class and ai profile
void init_aip_from_class_and_profile(ai_info *aip, ai_class *aicp, ai_profile_t *profile);
//SUSHI: Updating AI aim
void ai_update_aim(ai_info *aip, object* En_Objp);
void ai_update_aim(ai_info *aip);
//SUSHI: Random evasive sidethrust
void do_random_sidethrust(ai_info *aip, ship_info *sip);
+455 -441
View File
@@ -8,12 +8,13 @@
#include "globalincs/pstypes.h"
#include "globalincs/def_files.h"
#include "def_files/def_files.h"
#include "ai/ai_profiles.h"
#include "parse/parselo.h"
#include "globalincs/pstypes.h"
#include "localization/localize.h"
#include "weapon/weapon.h"
#include "parse/parselo.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
// global stuff
@@ -67,456 +68,469 @@ int ai_path_type_match(char *p)
return -1;
}
void parse_ai_profiles_tbl(char *filename)
void parse_ai_profiles_tbl(const char *filename)
{
int i, rval;
int i;
char profile_name[NAME_LENGTH];
ai_profile_t dummy_profile;
char *saved_Mp = NULL;
char buf[NAME_LENGTH];
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0)
try
{
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", (filename) ? filename : "<default ai_profiles.tbl>", rval));
lcl_ext_close();
if (filename == NULL)
read_file_text_from_default(defaults_get_file("ai_profiles.tbl"));
else
read_file_text(filename, CF_TYPE_TABLES);
reset_parse();
// start parsing
required_string("#AI Profiles");
// new default?
if (optional_string("$Default Profile:"))
stuff_string(Default_profile_name, F_NAME, NAME_LENGTH);
// begin reading data
while (required_string_either("#End", "$Profile Name:"))
{
ai_profile_t *profile = &dummy_profile;
ai_profile_t *previous_profile = NULL;
bool no_create = false;
// get the name
required_string("$Profile Name:");
stuff_string(profile_name, F_NAME, NAME_LENGTH);
// see if it exists
for (i = 0; i < Num_ai_profiles; i++)
{
if (!stricmp(Ai_profiles[i].profile_name, profile_name))
{
previous_profile = &Ai_profiles[i];
break;
}
}
// modular table stuff
if (optional_string("+nocreate"))
{
no_create = true;
// use the previous one if possible,
// otherwise continue to use the dummy one
if (previous_profile != NULL)
profile = previous_profile;
}
else
{
// don't create multiple profiles with the same name
if (previous_profile != NULL)
{
Warning(LOCATION, "An ai profile named '%s' already exists! The new one will not be created.\n", profile_name);
}
else
{
// make sure we're under the limit
if (Num_ai_profiles >= MAX_AI_PROFILES)
{
Warning(LOCATION, "Too many profiles in ai_profiles.tbl! Max is %d.\n", MAX_AI_PROFILES - 1); // -1 because one is built-in
skip_to_string("#End", NULL);
break;
}
profile = &Ai_profiles[Num_ai_profiles];
Num_ai_profiles++;
}
}
// initialize profile if we're not building from a previously parsed one
if (!no_create)
{
// base profile, so zero it out
if (profile == &Ai_profiles[0])
{
memset(profile, 0, sizeof(ai_profile_t));
}
// brand new profile, so set it to the base defaults
else
{
memcpy(profile, &Ai_profiles[0], sizeof(ai_profile_t));
}
}
// set the name
strcpy_s(profile->profile_name, profile_name);
// fill in any and all settings; they're all optional and can be in any order
while (!check_for_string("$Profile Name:") && !check_for_string("#End"))
{
if (optional_string("$Player Afterburner Recharge Scale:"))
parse_float_list(profile->afterburner_recharge_scale, NUM_SKILL_LEVELS);
if (optional_string("$Max Beam Friendly Fire Damage:"))
parse_float_list(profile->beam_friendly_damage_cap, NUM_SKILL_LEVELS);
if (optional_string("$Player Countermeasure Life Scale:"))
parse_float_list(profile->cmeasure_life_scale, NUM_SKILL_LEVELS);
if (optional_string("$AI Countermeasure Firing Chance:"))
parse_float_list(profile->cmeasure_fire_chance, NUM_SKILL_LEVELS);
if (optional_string("$AI In Range Time:"))
parse_float_list(profile->in_range_time, NUM_SKILL_LEVELS);
if (optional_string("$AI Always Links Ammo Weapons:"))
parse_float_list(profile->link_ammo_levels_always, NUM_SKILL_LEVELS);
if (optional_string("$AI Maybe Links Ammo Weapons:"))
parse_float_list(profile->link_ammo_levels_maybe, NUM_SKILL_LEVELS);
if (optional_string("$Primary Ammo Burst Multiplier:"))
parse_float_list(profile->primary_ammo_burst_mult, NUM_SKILL_LEVELS);
if (optional_string("$AI Always Links Energy Weapons:"))
parse_float_list(profile->link_energy_levels_always, NUM_SKILL_LEVELS);
if (optional_string("$AI Maybe Links Energy Weapons:"))
parse_float_list(profile->link_energy_levels_maybe, NUM_SKILL_LEVELS);
if (optional_string("$Max Missles Locked on Player:") || optional_string("$Max Missiles Locked on Player:"))
parse_int_list(profile->max_allowed_player_homers, NUM_SKILL_LEVELS);
if (optional_string("$Max Player Attackers:"))
parse_int_list(profile->max_attackers, NUM_SKILL_LEVELS);
if (optional_string("$Max Incoming Asteroids:"))
parse_int_list(profile->max_incoming_asteroids, NUM_SKILL_LEVELS);
if (optional_string("$Player Damage Factor:") || optional_string("$AI Damage Reduction to Player Hull:"))
parse_float_list(profile->player_damage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Player Subsys Damage Factor:") || optional_string("$AI Damage Reduction to Player Subsys:"))
parse_float_list(profile->subsys_damage_scale, NUM_SKILL_LEVELS);
// represented in fractions of F1_0
if (optional_string("$Predict Position Delay:"))
{
int iLoop;
float temp_list[NUM_SKILL_LEVELS];
parse_float_list(temp_list, NUM_SKILL_LEVELS);
for (iLoop = 0; iLoop < NUM_SKILL_LEVELS; iLoop++)
profile->predict_position_delay[iLoop] = fl2f(temp_list[iLoop]);
}
if (optional_string("$AI Shield Manage Delay:") || optional_string("$AI Shield Manage Delays:"))
parse_float_list(profile->shield_manage_delay, NUM_SKILL_LEVELS);
if (optional_string("$Friendly AI Fire Delay Scale:"))
parse_float_list(profile->ship_fire_delay_scale_friendly, NUM_SKILL_LEVELS);
if (optional_string("$Hostile AI Fire Delay Scale:"))
parse_float_list(profile->ship_fire_delay_scale_hostile, NUM_SKILL_LEVELS);
if (optional_string("$Friendly AI Secondary Fire Delay Scale:"))
parse_float_list(profile->ship_fire_secondary_delay_scale_friendly, NUM_SKILL_LEVELS);
if (optional_string("$Hostile AI Secondary Fire Delay Scale:"))
parse_float_list(profile->ship_fire_secondary_delay_scale_hostile, NUM_SKILL_LEVELS);
if (optional_string("$AI Turn Time Scale:"))
parse_float_list(profile->turn_time_scale, NUM_SKILL_LEVELS);
if (optional_string("$Glide Attack Percent:")) {
parse_float_list(profile->glide_attack_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->glide_attack_percent[i] < 0.0f || profile->glide_attack_percent[i] > 100.0f) {
Warning(LOCATION, "$Glide Attack Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->glide_attack_percent[i]);
profile->glide_attack_percent[i] = 0.0f;
}
profile->glide_attack_percent[i] /= 100.0;
}
}
if (optional_string("$Circle Strafe Percent:")) {
parse_float_list(profile->circle_strafe_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->circle_strafe_percent[i] < 0.0f || profile->circle_strafe_percent[i] > 100.0f) {
Warning(LOCATION, "$Circle Strafe Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->circle_strafe_percent[i]);
profile->circle_strafe_percent[i] = 0.0f;
}
profile->circle_strafe_percent[i] /= 100.0;
}
}
if (optional_string("$Glide Strafe Percent:")) {
parse_float_list(profile->glide_strafe_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->glide_strafe_percent[i] < 0.0f || profile->glide_strafe_percent[i] > 100.0f) {
Warning(LOCATION, "$Glide Strafe Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->glide_strafe_percent[i]);
profile->glide_strafe_percent[i] = 0.0f;
}
profile->glide_strafe_percent[i] /= 100.0;
}
}
if (optional_string("$Random Sidethrust Percent:")) {
parse_float_list(profile->random_sidethrust_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->random_sidethrust_percent[i] < 0.0f || profile->random_sidethrust_percent[i] > 100.0f) {
Warning(LOCATION, "$Random Sidethrust Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->random_sidethrust_percent[i]);
profile->random_sidethrust_percent[i] = 0.0f;
}
profile->random_sidethrust_percent[i] /= 100.0;
}
}
if (optional_string("$Stalemate Time Threshold:"))
parse_float_list(profile->stalemate_time_thresh, NUM_SKILL_LEVELS);
if (optional_string("$Stalemate Distance Threshold:"))
parse_float_list(profile->stalemate_dist_thresh, NUM_SKILL_LEVELS);
if (optional_string("$Player Shield Recharge Scale:"))
parse_float_list(profile->shield_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$Player Weapon Recharge Scale:"))
parse_float_list(profile->weapon_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$Max Turret Target Ownage:"))
parse_int_list(profile->max_turret_ownage_target, NUM_SKILL_LEVELS);
if (optional_string("$Max Turret Player Ownage:"))
parse_int_list(profile->max_turret_ownage_player, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Required For Kill Scale:"))
parse_float_list(profile->kill_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Required For Assist Scale:"))
parse_float_list(profile->assist_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Awarded For Capship Assist:"))
parse_float_list(profile->assist_award_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Repair Penalty:"))
parse_int_list(profile->repair_penalty, NUM_SKILL_LEVELS);
if (optional_string("$Delay Before Allowing Bombs to Be Shot Down:"))
parse_float_list(profile->delay_bomb_arm_timer, NUM_SKILL_LEVELS);
if (optional_string("$Chance AI Has to Fire Missiles at Player:"))
parse_int_list(profile->chance_to_use_missiles_on_plr, NUM_SKILL_LEVELS);
if (optional_string("$Max Aim Update Delay:"))
parse_float_list(profile->max_aim_update_delay, NUM_SKILL_LEVELS);
if (optional_string("$Turret Max Aim Update Delay:"))
parse_float_list(profile->turret_max_aim_update_delay, NUM_SKILL_LEVELS);
if (optional_string("$Player Autoaim FOV:"))
{
float fov_list[NUM_SKILL_LEVELS];
parse_float_list(fov_list, NUM_SKILL_LEVELS);
for (i = 0; i < NUM_SKILL_LEVELS; i++)
{
//Enforce range
if (fov_list[i] < 0.0f || fov_list[i] >= 360.0f)
{
Warning(LOCATION, "$Player Autoaim FOV should be >= 0 and < 360.0 (read %f). Setting to 0.", fov_list[i]);
fov_list[i] = 0.0f;
}
//Convert units
profile->player_autoaim_fov[i] = fov_list[i] * PI / 180.0f;
}
}
if (optional_string("$Detail Distance Multiplier:"))
parse_float_list(profile->detail_distance_mult, NUM_SKILL_LEVELS);
set_flag(profile, "$big ships can attack beam turrets on untargeted ships:", AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS, AIP_FLAG);
set_flag(profile, "$smart primary weapon selection:", AIPF_SMART_PRIMARY_WEAPON_SELECTION, AIP_FLAG);
set_flag(profile, "$smart secondary weapon selection:", AIPF_SMART_SECONDARY_WEAPON_SELECTION, AIP_FLAG);
set_flag(profile, "$smart shield management:", AIPF_SMART_SHIELD_MANAGEMENT, AIP_FLAG);
set_flag(profile, "$smart afterburner management:", AIPF_SMART_AFTERBURNER_MANAGEMENT, AIP_FLAG);
set_flag(profile, "$allow rapid secondary dumbfire:", AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE, AIP_FLAG);
set_flag(profile, "$huge turret weapons ignore bombs:", AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS, AIP_FLAG);
set_flag(profile, "$don't insert random turret fire delay:", AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY, AIP_FLAG);
set_flag(profile, "$hack improve non-homing swarm turret fire accuracy:", AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY, AIP_FLAG);
set_flag(profile, "$shockwaves damage small ship subsystems:", AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS, AIP_FLAG);
set_flag(profile, "$navigation subsystem governs warpout capability:", AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP, AIP_FLAG);
set_flag(profile, "$ignore lower bound for minimum speed of docked ship:", AIPF_NO_MIN_DOCK_SPEED_CAP, AIP_FLAG);
set_flag(profile, "$disable linked fire penalty:", AIPF_DISABLE_LINKED_FIRE_PENALTY, AIP_FLAG);
set_flag(profile, "$disable weapon damage scaling:", AIPF_DISABLE_WEAPON_DAMAGE_SCALING, AIP_FLAG);
set_flag(profile, "$use additive weapon velocity:", AIPF_USE_ADDITIVE_WEAPON_VELOCITY, AIP_FLAG);
set_flag(profile, "$use newtonian dampening:", AIPF_USE_NEWTONIAN_DAMPENING, AIP_FLAG);
set_flag(profile, "$include beams for kills and assists:", AIPF_INCLUDE_BEAMS_IN_STAT_CALCS, AIP_FLAG);
set_flag(profile, "$score kills based on damage caused:", AIPF_KILL_SCORING_SCALES_WITH_DAMAGE, AIP_FLAG);
set_flag(profile, "$score assists based on damage caused:", AIPF_ASSIST_SCORING_SCALES_WITH_DAMAGE, AIP_FLAG);
set_flag(profile, "$allow event and goal scoring in multiplayer:", AIPF_ALLOW_MULTI_EVENT_SCORING, AIP_FLAG);
set_flag(profile, "$fix linked primary weapon decision bug:", AIPF_FIX_LINKED_PRIMARY_BUG, AIP_FLAG);
set_flag(profile, "$prevent turrets targeting too distant bombs:", AIPF_PREVENT_TARGETING_BOMBS_BEYOND_RANGE, AIP_FLAG);
set_flag(profile, "$smart subsystem targeting for turrets:", AIPF_SMART_SUBSYSTEM_TARGETING_FOR_TURRETS, AIP_FLAG);
set_flag(profile, "$fix heat seekers homing on stealth ships bug:", AIPF_FIX_HEAT_SEEKER_STEALTH_BUG, AIP_FLAG);
set_flag(profile, "$multi allow empty primaries:", AIPF_MULTI_ALLOW_EMPTY_PRIMARIES, AIP_FLAG);
set_flag(profile, "$multi allow empty secondaries:", AIPF_MULTI_ALLOW_EMPTY_SECONDARIES, AIP_FLAG);
set_flag(profile, "$allow turrets target weapons freely:", AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY, AIP_FLAG);
set_flag(profile, "$use only single fov for turrets:", AIPF_USE_ONLY_SINGLE_FOV_FOR_TURRETS, AIP_FLAG);
set_flag(profile, "$allow vertical dodge:", AIPF_ALLOW_VERTICAL_DODGE, AIP_FLAG);
set_flag(profile, "$force beam turrets to use normal fov:", AIPF_FORCE_BEAM_TURRET_FOV, AIP_FLAG);
set_flag(profile, "$fix ai class bug:", AIPF_FIX_AI_CLASS_BUG, AIP_FLAG);
set_flag(profile, "$turrets ignore targets radius in range checks:", AIPF2_TURRETS_IGNORE_TARGET_RADIUS, AIP_FLAG2);
set_flag(profile, "$no extra collision avoidance vs player:", AIPF2_NO_SPECIAL_PLAYER_AVOID, AIP_FLAG2);
set_flag(profile, "$perform fewer checks for death screams:", AIPF2_PERFORM_FEWER_SCREAM_CHECKS, AIP_FLAG2);
set_flag(profile, "$advanced turret fov edge checks:", AIPF2_ADVANCED_TURRET_FOV_EDGE_CHECKS, AIP_FLAG2);
set_flag(profile, "$require turrets to have target in fov:", AIPF2_REQUIRE_TURRET_TO_HAVE_TARGET_IN_FOV, AIP_FLAG2);
set_flag(profile, "$all ships manage shields:", AIPF2_ALL_SHIPS_MANAGE_SHIELDS, AIP_FLAG2);
set_flag(profile, "$ai aims from ship center:", AIPF2_AI_AIMS_FROM_SHIP_CENTER, AIP_FLAG2);
set_flag(profile, "$allow primary link at mission start:", AIPF2_ALLOW_PRIMARY_LINK_AT_START, AIP_FLAG2);
set_flag(profile, "$allow beams to damage bombs:", AIPF2_BEAMS_DAMAGE_WEAPONS, AIP_FLAG2);
set_flag(profile, "$disable weapon damage scaling for player:", AIPF2_PLAYER_WEAPON_SCALE_FIX, AIP_FLAG2);
set_flag(profile, "$countermeasures affect aspect seekers:", AIPF2_ASPECT_LOCK_COUNTERMEASURE, AIP_FLAG2);
set_flag(profile, "$ai guards specific ship in wing:", AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING, AIP_FLAG2);
profile->ai_path_mode = AI_PATH_MODE_NORMAL;
if (optional_string("$ai path mode:"))
{
stuff_string(buf, F_NAME, NAME_LENGTH);
int j = ai_path_type_match(buf);
if (j >= 0) {
profile->ai_path_mode = j;
}
else {
Warning(LOCATION, "Invalid ai path mode '%s' specified", buf);
}
}
set_flag(profile, "$no warp camera:", AIPF2_NO_WARP_CAMERA, AIP_FLAG2);
set_flag(profile, "$fix ai path order bug:", AIPF2_FIX_AI_PATH_ORDER_BUG, AIP_FLAG2);
set_flag(profile, "$strict turret-tagged-only targeting:", AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING, AIP_FLAG2);
set_flag(profile, "$aspect bomb invulnerability fix:", AIPF2_ASPECT_INVULNERABILITY_FIX, AIP_FLAG2);
set_flag(profile, "$glide decay requires thrust:", AIPF2_GLIDE_DECAY_REQUIRES_THRUST, AIP_FLAG2);
set_flag(profile, "$ai can slow down when attacking big ships:", AIPF2_AI_CAN_SLOW_DOWN_ATTACKING_BIG_SHIPS, AIP_FLAG2);
profile->bay_arrive_speed_mult = 1.0f;
profile->bay_depart_speed_mult = 1.0f;
if (optional_string("$bay arrive speed multiplier:")) {
stuff_float(&profile->bay_arrive_speed_mult);
}
if (optional_string("$bay depart speed multiplier:")) {
stuff_float(&profile->bay_depart_speed_mult);
}
// ----------
// compatibility
if (optional_string("$perform less checks for death screams:"))
{
mprintf(("Warning: \"$perform less checks for death screams\" flag is deprecated in favor of \"$perform fewer checks for death screams\"\n"));
bool temp;
stuff_boolean(&temp);
if (temp)
profile->flags2 |= AIPF2_PERFORM_FEWER_SCREAM_CHECKS;
else
profile->flags2 &= ~AIPF2_PERFORM_FEWER_SCREAM_CHECKS;
}
if (optional_string("$allow primary link delay:"))
{
mprintf(("Warning: \"$allow primary link delay\" flag is deprecated in favor of \"$allow primary link at mission start\"\n"));
bool temp;
stuff_boolean(&temp);
if (temp)
profile->flags2 &= ~AIPF2_ALLOW_PRIMARY_LINK_AT_START;
else
profile->flags2 |= AIPF2_ALLOW_PRIMARY_LINK_AT_START;
}
// if we've been through once already and are at the same place, force a move
if (saved_Mp && (saved_Mp == Mp))
{
char tmp[60];
memset(tmp, 0, 60);
strncpy(tmp, Mp, 59);
mprintf(("WARNING: Unrecognized parameter in ai_profiles: %s\n", tmp));
Mp++;
}
// find next valid option
skip_to_start_of_string_either("$", "#");
saved_Mp = Mp;
}
}
required_string("#End");
}
catch (const parse::ParseException& e)
{
mprintf(("TABLES: Unable to parse '%s'! Error message = %s.\n", (filename) ? filename : "<default ai_profiles.tbl>", e.what()));
return;
}
if (filename == NULL)
read_file_text_from_array(defaults_get_file("ai_profiles.tbl"));
else
read_file_text(filename, CF_TYPE_TABLES);
reset_parse();
// start parsing
required_string("#AI Profiles");
// new default?
if (optional_string("$Default Profile:"))
stuff_string(Default_profile_name, F_NAME, NAME_LENGTH);
// begin reading data
while (required_string_either("#End","$Profile Name:"))
{
ai_profile_t *profile = &dummy_profile;
ai_profile_t *previous_profile = NULL;
bool no_create = false;
// get the name
required_string("$Profile Name:");
stuff_string(profile_name, F_NAME, NAME_LENGTH);
// see if it exists
for (i = 0; i < Num_ai_profiles; i++)
{
if (!stricmp(Ai_profiles[i].profile_name, profile_name))
{
previous_profile = &Ai_profiles[i];
break;
}
}
// modular table stuff
if (optional_string("+nocreate"))
{
no_create = true;
// use the previous one if possible,
// otherwise continue to use the dummy one
if (previous_profile != NULL)
profile = previous_profile;
}
else
{
// don't create multiple profiles with the same name
if (previous_profile != NULL)
{
Warning(LOCATION, "An ai profile named '%s' already exists! The new one will not be created.\n", profile_name);
}
else
{
// make sure we're under the limit
if (Num_ai_profiles >= MAX_AI_PROFILES)
{
Warning(LOCATION, "Too many profiles in ai_profiles.tbl! Max is %d.\n", MAX_AI_PROFILES-1); // -1 because one is built-in
skip_to_string("#End", NULL);
break;
}
profile = &Ai_profiles[Num_ai_profiles];
Num_ai_profiles++;
}
}
// initialize profile if we're not building from a previously parsed one
if (!no_create)
{
// base profile, so zero it out
if (profile == &Ai_profiles[0])
{
memset(profile, 0, sizeof(ai_profile_t));
}
// brand new profile, so set it to the base defaults
else
{
memcpy(profile, &Ai_profiles[0], sizeof(ai_profile_t));
}
}
// set the name
strcpy_s(profile->profile_name, profile_name);
// fill in any and all settings; they're all optional and can be in any order
while (!check_for_string("$Profile Name:") && !check_for_string("#End"))
{
if (optional_string("$Player Afterburner Recharge Scale:"))
parse_float_list(profile->afterburner_recharge_scale, NUM_SKILL_LEVELS);
if (optional_string("$Max Beam Friendly Fire Damage:"))
parse_float_list(profile->beam_friendly_damage_cap, NUM_SKILL_LEVELS);
if (optional_string("$Player Countermeasure Life Scale:"))
parse_float_list(profile->cmeasure_life_scale, NUM_SKILL_LEVELS);
if (optional_string("$AI Countermeasure Firing Chance:"))
parse_float_list(profile->cmeasure_fire_chance, NUM_SKILL_LEVELS);
if (optional_string("$AI In Range Time:"))
parse_float_list(profile->in_range_time, NUM_SKILL_LEVELS);
if (optional_string("$AI Always Links Ammo Weapons:"))
parse_float_list(profile->link_ammo_levels_always, NUM_SKILL_LEVELS);
if (optional_string("$AI Maybe Links Ammo Weapons:"))
parse_float_list(profile->link_ammo_levels_maybe, NUM_SKILL_LEVELS);
if (optional_string("$Primary Ammo Burst Multiplier:"))
parse_float_list(profile->primary_ammo_burst_mult, NUM_SKILL_LEVELS);
if (optional_string("$AI Always Links Energy Weapons:"))
parse_float_list(profile->link_energy_levels_always, NUM_SKILL_LEVELS);
if (optional_string("$AI Maybe Links Energy Weapons:"))
parse_float_list(profile->link_energy_levels_maybe, NUM_SKILL_LEVELS);
if (optional_string("$Max Missles Locked on Player:") || optional_string("$Max Missiles Locked on Player:"))
parse_int_list(profile->max_allowed_player_homers, NUM_SKILL_LEVELS);
if (optional_string("$Max Player Attackers:"))
parse_int_list(profile->max_attackers, NUM_SKILL_LEVELS);
if (optional_string("$Max Incoming Asteroids:"))
parse_int_list(profile->max_incoming_asteroids, NUM_SKILL_LEVELS);
if (optional_string("$Player Damage Factor:") || optional_string("$AI Damage Reduction to Player Hull:"))
parse_float_list(profile->player_damage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Player Subsys Damage Factor:") || optional_string("$AI Damage Reduction to Player Subsys:"))
parse_float_list(profile->subsys_damage_scale, NUM_SKILL_LEVELS);
// represented in fractions of F1_0
if (optional_string("$Predict Position Delay:"))
{
int iLoop;
float temp_list[NUM_SKILL_LEVELS];
parse_float_list(temp_list, NUM_SKILL_LEVELS);
for (iLoop = 0; iLoop < NUM_SKILL_LEVELS; iLoop++)
profile->predict_position_delay[iLoop] = fl2f(temp_list[iLoop]);
}
if (optional_string("$AI Shield Manage Delay:") || optional_string("$AI Shield Manage Delays:"))
parse_float_list(profile->shield_manage_delay, NUM_SKILL_LEVELS);
if (optional_string("$Friendly AI Fire Delay Scale:"))
parse_float_list(profile->ship_fire_delay_scale_friendly, NUM_SKILL_LEVELS);
if (optional_string("$Hostile AI Fire Delay Scale:"))
parse_float_list(profile->ship_fire_delay_scale_hostile, NUM_SKILL_LEVELS);
if (optional_string("$Friendly AI Secondary Fire Delay Scale:"))
parse_float_list(profile->ship_fire_secondary_delay_scale_friendly, NUM_SKILL_LEVELS);
if (optional_string("$Hostile AI Secondary Fire Delay Scale:"))
parse_float_list(profile->ship_fire_secondary_delay_scale_hostile, NUM_SKILL_LEVELS);
if (optional_string("$AI Turn Time Scale:"))
parse_float_list(profile->turn_time_scale, NUM_SKILL_LEVELS);
if (optional_string("$Glide Attack Percent:")) {
parse_float_list(profile->glide_attack_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->glide_attack_percent[i] < 0.0f || profile->glide_attack_percent[i] > 100.0f) {
Warning(LOCATION, "$Glide Attack Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->glide_attack_percent[i]);
profile->glide_attack_percent[i] = 0.0f;
}
profile->glide_attack_percent[i] /= 100.0;
}
}
if (optional_string("$Circle Strafe Percent:")) {
parse_float_list(profile->circle_strafe_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->circle_strafe_percent[i] < 0.0f || profile->circle_strafe_percent[i] > 100.0f) {
Warning(LOCATION, "$Circle Strafe Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->circle_strafe_percent[i]);
profile->circle_strafe_percent[i] = 0.0f;
}
profile->circle_strafe_percent[i] /= 100.0;
}
}
if (optional_string("$Glide Strafe Percent:")) {
parse_float_list(profile->glide_strafe_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->glide_strafe_percent[i] < 0.0f || profile->glide_strafe_percent[i] > 100.0f) {
Warning(LOCATION, "$Glide Strafe Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->glide_strafe_percent[i]);
profile->glide_strafe_percent[i] = 0.0f;
}
profile->glide_strafe_percent[i] /= 100.0;
}
}
if (optional_string("$Random Sidethrust Percent:")) {
parse_float_list(profile->random_sidethrust_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->random_sidethrust_percent[i] < 0.0f || profile->random_sidethrust_percent[i] > 100.0f) {
Warning(LOCATION, "$Random Sidethrust Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->random_sidethrust_percent[i]);
profile->random_sidethrust_percent[i] = 0.0f;
}
profile->random_sidethrust_percent[i] /= 100.0;
}
}
if (optional_string("$Stalemate Time Threshold:"))
parse_float_list(profile->stalemate_time_thresh, NUM_SKILL_LEVELS);
if (optional_string("$Stalemate Distance Threshold:"))
parse_float_list(profile->stalemate_dist_thresh, NUM_SKILL_LEVELS);
if (optional_string("$Player Shield Recharge Scale:"))
parse_float_list(profile->shield_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$Player Weapon Recharge Scale:"))
parse_float_list(profile->weapon_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$Max Turret Target Ownage:"))
parse_int_list(profile->max_turret_ownage_target, NUM_SKILL_LEVELS);
if (optional_string("$Max Turret Player Ownage:"))
parse_int_list(profile->max_turret_ownage_player, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Required For Kill Scale:"))
parse_float_list(profile->kill_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Required For Assist Scale:"))
parse_float_list(profile->assist_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Awarded For Capship Assist:"))
parse_float_list(profile->assist_award_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Repair Penalty:"))
parse_int_list(profile->repair_penalty, NUM_SKILL_LEVELS);
if (optional_string("$Delay Before Allowing Bombs to Be Shot Down:"))
parse_float_list(profile->delay_bomb_arm_timer, NUM_SKILL_LEVELS);
if (optional_string("$Chance AI Has to Fire Missiles at Player:"))
parse_int_list(profile->chance_to_use_missiles_on_plr, NUM_SKILL_LEVELS);
if (optional_string("$Max Aim Update Delay:"))
parse_float_list(profile->max_aim_update_delay, NUM_SKILL_LEVELS);
if (optional_string("$Turret Max Aim Update Delay:"))
parse_float_list(profile->turret_max_aim_update_delay, NUM_SKILL_LEVELS);
if (optional_string("$Player Autoaim FOV:"))
{
float fov_list[NUM_SKILL_LEVELS];
parse_float_list(fov_list, NUM_SKILL_LEVELS);
for (i = 0; i < NUM_SKILL_LEVELS; i++)
{
//Enforce range
if (fov_list[i] < 0.0f || fov_list[i] >= 360.0f)
{
Warning(LOCATION, "$Player Autoaim FOV should be >= 0 and < 360.0 (read %f). Setting to 0.", fov_list[i]);
fov_list[i] = 0.0f;
}
//Convert units
profile->player_autoaim_fov[i] = fov_list[i] * PI / 180.0f;
}
}
if (optional_string("$Detail Distance Multiplier:"))
parse_float_list(profile->detail_distance_mult, NUM_SKILL_LEVELS);
set_flag(profile, "$big ships can attack beam turrets on untargeted ships:", AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS, AIP_FLAG);
set_flag(profile, "$smart primary weapon selection:", AIPF_SMART_PRIMARY_WEAPON_SELECTION, AIP_FLAG);
set_flag(profile, "$smart secondary weapon selection:", AIPF_SMART_SECONDARY_WEAPON_SELECTION, AIP_FLAG);
set_flag(profile, "$smart shield management:", AIPF_SMART_SHIELD_MANAGEMENT, AIP_FLAG);
set_flag(profile, "$smart afterburner management:", AIPF_SMART_AFTERBURNER_MANAGEMENT, AIP_FLAG);
set_flag(profile, "$allow rapid secondary dumbfire:", AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE, AIP_FLAG);
set_flag(profile, "$huge turret weapons ignore bombs:", AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS, AIP_FLAG);
set_flag(profile, "$don't insert random turret fire delay:", AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY, AIP_FLAG);
set_flag(profile, "$hack improve non-homing swarm turret fire accuracy:", AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY, AIP_FLAG);
set_flag(profile, "$shockwaves damage small ship subsystems:", AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS, AIP_FLAG);
set_flag(profile, "$navigation subsystem governs warpout capability:", AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP, AIP_FLAG);
set_flag(profile, "$ignore lower bound for minimum speed of docked ship:", AIPF_NO_MIN_DOCK_SPEED_CAP, AIP_FLAG);
set_flag(profile, "$disable linked fire penalty:", AIPF_DISABLE_LINKED_FIRE_PENALTY, AIP_FLAG);
set_flag(profile, "$disable weapon damage scaling:", AIPF_DISABLE_WEAPON_DAMAGE_SCALING, AIP_FLAG);
set_flag(profile, "$use additive weapon velocity:", AIPF_USE_ADDITIVE_WEAPON_VELOCITY, AIP_FLAG);
set_flag(profile, "$use newtonian dampening:", AIPF_USE_NEWTONIAN_DAMPENING, AIP_FLAG);
set_flag(profile, "$include beams for kills and assists:", AIPF_INCLUDE_BEAMS_IN_STAT_CALCS, AIP_FLAG);
set_flag(profile, "$score kills based on damage caused:", AIPF_KILL_SCORING_SCALES_WITH_DAMAGE, AIP_FLAG);
set_flag(profile, "$score assists based on damage caused:", AIPF_ASSIST_SCORING_SCALES_WITH_DAMAGE, AIP_FLAG);
set_flag(profile, "$allow event and goal scoring in multiplayer:", AIPF_ALLOW_MULTI_EVENT_SCORING, AIP_FLAG);
set_flag(profile, "$fix linked primary weapon decision bug:", AIPF_FIX_LINKED_PRIMARY_BUG, AIP_FLAG);
set_flag(profile, "$prevent turrets targeting too distant bombs:", AIPF_PREVENT_TARGETING_BOMBS_BEYOND_RANGE, AIP_FLAG);
set_flag(profile, "$smart subsystem targeting for turrets:", AIPF_SMART_SUBSYSTEM_TARGETING_FOR_TURRETS, AIP_FLAG);
set_flag(profile, "$fix heat seekers homing on stealth ships bug:", AIPF_FIX_HEAT_SEEKER_STEALTH_BUG, AIP_FLAG);
set_flag(profile, "$multi allow empty primaries:", AIPF_MULTI_ALLOW_EMPTY_PRIMARIES, AIP_FLAG);
set_flag(profile, "$multi allow empty secondaries:", AIPF_MULTI_ALLOW_EMPTY_SECONDARIES, AIP_FLAG);
set_flag(profile, "$allow turrets target weapons freely:", AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY, AIP_FLAG);
set_flag(profile, "$use only single fov for turrets:", AIPF_USE_ONLY_SINGLE_FOV_FOR_TURRETS, AIP_FLAG);
set_flag(profile, "$allow vertical dodge:", AIPF_ALLOW_VERTICAL_DODGE, AIP_FLAG);
set_flag(profile, "$force beam turrets to use normal fov:", AIPF_FORCE_BEAM_TURRET_FOV, AIP_FLAG);
set_flag(profile, "$fix ai class bug:", AIPF_FIX_AI_CLASS_BUG, AIP_FLAG);
set_flag(profile, "$turrets ignore targets radius in range checks:", AIPF2_TURRETS_IGNORE_TARGET_RADIUS, AIP_FLAG2);
set_flag(profile, "$no extra collision avoidance vs player:", AIPF2_NO_SPECIAL_PLAYER_AVOID, AIP_FLAG2);
set_flag(profile, "$perform fewer checks for death screams:", AIPF2_PERFORM_FEWER_SCREAM_CHECKS, AIP_FLAG2);
set_flag(profile, "$advanced turret fov edge checks:", AIPF2_ADVANCED_TURRET_FOV_EDGE_CHECKS, AIP_FLAG2);
set_flag(profile, "$require turrets to have target in fov:", AIPF2_REQUIRE_TURRET_TO_HAVE_TARGET_IN_FOV, AIP_FLAG2);
set_flag(profile, "$all ships manage shields:", AIPF2_ALL_SHIPS_MANAGE_SHIELDS, AIP_FLAG2);
set_flag(profile, "$ai aims from ship center:", AIPF2_AI_AIMS_FROM_SHIP_CENTER, AIP_FLAG2);
set_flag(profile, "$allow primary link at mission start:", AIPF2_ALLOW_PRIMARY_LINK_AT_START, AIP_FLAG2);
set_flag(profile, "$allow beams to damage bombs:", AIPF2_BEAMS_DAMAGE_WEAPONS, AIP_FLAG2);
set_flag(profile, "$disable weapon damage scaling for player:", AIPF2_PLAYER_WEAPON_SCALE_FIX, AIP_FLAG2);
set_flag(profile, "$countermeasures affect aspect seekers:", AIPF2_ASPECT_LOCK_COUNTERMEASURE, AIP_FLAG2);
set_flag(profile, "$ai guards specific ship in wing:", AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING, AIP_FLAG2);
profile->ai_path_mode = AI_PATH_MODE_NORMAL;
if(optional_string("$ai path mode:"))
{
stuff_string(buf, F_NAME, NAME_LENGTH);
int j = ai_path_type_match(buf);
if(j >= 0) {
profile->ai_path_mode = j;
} else {
Warning(LOCATION, "Invalid ai path mode '%s' specified", buf);
}
}
set_flag(profile, "$no warp camera:", AIPF2_NO_WARP_CAMERA, AIP_FLAG2);
set_flag(profile, "$fix ai path order bug:", AIPF2_FIX_AI_PATH_ORDER_BUG, AIP_FLAG2);
// ----------
// compatibility
if (optional_string("$perform less checks for death screams:"))
{
mprintf(("Warning: \"$perform less checks for death screams\" flag is deprecated in favor of \"$perform fewer checks for death screams\"\n"));
bool temp;
stuff_boolean(&temp);
if (temp)
profile->flags2 |= AIPF2_PERFORM_FEWER_SCREAM_CHECKS;
else
profile->flags2 &= ~AIPF2_PERFORM_FEWER_SCREAM_CHECKS;
}
if (optional_string("$allow primary link delay:"))
{
mprintf(("Warning: \"$allow primary link delay\" flag is deprecated in favor of \"$allow primary link at mission start\"\n"));
bool temp;
stuff_boolean(&temp);
if (temp)
profile->flags2 &= ~AIPF2_ALLOW_PRIMARY_LINK_AT_START;
else
profile->flags2 |= AIPF2_ALLOW_PRIMARY_LINK_AT_START;
}
// if we've been through once already and are at the same place, force a move
if ( saved_Mp && (saved_Mp == Mp) )
{
char tmp[60];
memset(tmp, 0, 60);
strncpy(tmp, Mp, 59);
mprintf(("WARNING: Unrecognized parameter in ai_profiles: %s\n", tmp));
Mp++;
}
// find next valid option
skip_to_start_of_string_either("$", "#");
saved_Mp = Mp;
}
}
required_string("#End");
// add tbl/tbm to multiplayer validation list
extern void fs2netd_add_table_validation(char *tblname);
extern void fs2netd_add_table_validation(const char *tblname);
fs2netd_add_table_validation(filename);
// close localization
lcl_ext_close();
}
void ai_profiles_init()
+10 -1
View File
@@ -9,8 +9,8 @@
#ifndef _AI_PROFILES_H_
#define _AI_PROFILES_H_
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#include "globalincs/systemvars.h"
// flag int defines
@@ -65,6 +65,10 @@
#define AIPF2_ASPECT_LOCK_COUNTERMEASURE (1 << 11)
#define AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING (1 << 12)
#define AIPF2_FIX_AI_PATH_ORDER_BUG (1 << 13)
#define AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING (1 << 14)
#define AIPF2_ASPECT_INVULNERABILITY_FIX (1 << 15)
#define AIPF2_GLIDE_DECAY_REQUIRES_THRUST (1 << 16)
#define AIPF2_AI_CAN_SLOW_DOWN_ATTACKING_BIG_SHIPS (1 << 17)
// AI Path types
#define AI_PATH_MODE_NORMAL 0
@@ -150,6 +154,11 @@ typedef struct ai_profile_t {
int ai_path_mode;
// Ships flying bay paths will gradually accelerate/decelerate instead of
// flying the whole path at max speed
float bay_arrive_speed_mult;
float bay_depart_speed_mult;
} ai_profile_t;
+152 -110
View File
@@ -10,22 +10,23 @@
#include "ai/aibig.h"
#include "globalincs/linklist.h"
#include "object/object.h"
#include "ship/ship.h"
#include "ship/afterburner.h"
#include "freespace2/freespace.h"
#include "weapon/weapon.h"
#include "io/timer.h"
#include "mission/missionparse.h"
#include "iff_defs/iff_defs.h"
#include "math/staticrand.h"
#include "ai/aigoals.h"
#include "freespace.h"
#include "globalincs/linklist.h"
#include "iff_defs/iff_defs.h"
#include "io/timer.h"
#include "math/staticrand.h"
#include "mission/missionparse.h"
#include "object/object.h"
#include "ship/afterburner.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
#ifdef _MSC_VER
#pragma optimize("", off)
#pragma auto_inline(off)
#endif
#define SCAN_FIGHTERS_INTERVAL 2000 // how often an AI fighter/bomber should scan for enemy fighter/bombers
// if sitting still and pounding on a big ship. If enemy fighters are
@@ -171,6 +172,8 @@ done_1:
}
mc_info mc;
mc_info_init(&mc);
mc.model_instance_num = Ships[objp->instance].model_instance_num;
mc.model_num = sip->model_num;
mc.orient = &objp->orient;
@@ -367,9 +370,13 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
object *target_objp;
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
if ( aip->target_objnum < 0 )
return 0;
target_objp = &Objects[aip->target_objnum];
if ( (aip->targeted_subsys != NULL) && (aip->target_objnum >= 0) && (aip->targeted_subsys->system_info->path_num >= 0) ) {
if ( (aip->targeted_subsys != NULL) && (aip->targeted_subsys->system_info->path_num >= 0) ) {
int subsys_path_num, subsys_in_sight, checked_sight;
float dist;
@@ -503,7 +510,7 @@ int ai_big_maybe_start_strafe(ai_info *aip, ship_info *sip)
{
// if moving slowly (or stopped), and SIF_SMALL_SHIP, then enter STRAFE mode if enemy fighter/bombers
// are near
if ( sip->flags & SIF_SMALL_SHIP ) {
if ( sip->is_small_ship() ) {
if ( timestamp_elapsed(aip->scan_for_enemy_timestamp) ) {
ship_obj *so;
object *test_objp;
@@ -518,7 +525,7 @@ int ai_big_maybe_start_strafe(ai_info *aip, ship_info *sip)
test_sp = &Ships[test_objp->instance];
if ( iff_x_attacks_y(Ships[Pl_objp->instance].team, test_sp->team) ) {
if ( Ship_info[test_sp->ship_info_index].flags & SIF_SMALL_SHIP ) {
if ( Ship_info[test_sp->ship_info_index].is_small_ship() ) {
dist_squared = vm_vec_dist_squared(&Pl_objp->pos, &test_objp->pos);
if ( dist_squared < ENTER_STRAFE_THREAT_DIST_SQUARED ) {
return 1;
@@ -597,11 +604,15 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
// see if Pl_objp needs to reposition to get a good shot at subsystem which is being attacked
if ( ai_big_maybe_follow_subsys_path() ) {
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
return;
}
vec3d *rel_pos, vec_to_enemy;
float weapon_travel_dist;
vec3d *rel_pos;
vec3d vec_to_enemy;
float weapon_travel_dist;
start_bank = Ships[aip->shipnum].weapons.current_primary_bank;
@@ -626,11 +637,25 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
weapon_travel_dist = ai_get_weapon_dist(&Ships[Pl_objp->instance].weapons);
if ( aip->targeted_subsys != NULL ) {
if (dist_to_enemy > (weapon_travel_dist-20))
if (dist_to_enemy > (weapon_travel_dist-20)) {
accelerate_ship(aip, 1.0f);
else {
ship *shipp = &Ships[Pl_objp->instance];
if ((aip->ai_flags & AIF_FREE_AFTERBURNER_USE) && !(shipp->flags[Ship::Ship_Flags::Afterburner_locked]) && (dot_to_enemy > 0.75f)) {
if (ai_maybe_fire_afterburner(Pl_objp, aip)) {
afterburners_start(Pl_objp);
aip->afterburner_stop_time = Missiontime + 3*F1_0;
}
} else if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
} else {
// AL 12-31-97: Move at least as quickly as your target is moving...
accelerate_ship(aip, MAX(1.0f - dot_to_enemy, Objects[aip->target_objnum].phys_info.fspeed/sip->max_speed));
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
}
} else {
@@ -651,10 +676,22 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
if (dist_to_enemy < ATTACK_STOP_DISTANCE) {
// accelerate_ship(aip, accel * 0.5f);
accelerate_ship(aip, -1.0f);
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
} else {
accelerate_ship(aip, accel);
}
ship *shipp = &Ships[Pl_objp->instance];
if ((aip->ai_flags & AIF_FREE_AFTERBURNER_USE) && !(shipp->flags[Ship::Ship_Flags::Afterburner_locked]) && (accel > 0.95f)) {
if (ai_maybe_fire_afterburner(Pl_objp, aip)) {
afterburners_start(Pl_objp);
aip->afterburner_stop_time = Missiontime + 3*F1_0;
}
} else if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
}
}
}
}
@@ -711,86 +748,75 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vec3d *f
}
if (tswp->num_secondary_banks > 0) {
int priority1, priority2;
priority1 = -1;
priority2 = -1;
// Maybe favor selecting a bomb.
// Note, if you're firing a bomb, if it's aspect seeking, the firing conditions can be looser.
if (Ship_info[Ships[En_objp->instance].ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP))
if (En_objp->phys_info.speed * dist_to_enemy < 5000.0f) // Don't select a bomb if enemy moving fast relative to distance
priority1 = WIF_BOMB;
if (!(En_objp->flags & OF_PROTECTED) || (aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP))) {
//ai_select_secondary_weapon(Pl_objp, tswp, priority1, priority2); // Note, need to select to get weapon speed and lifetime
if(aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP)) {
priority1 = WIF_PUNCTURE;
}
if (!(En_objp->flags[Object::Object_Flags::Protected]) || (aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP))) {
ai_choose_secondary_weapon(Pl_objp, aip, En_objp);
int current_bank = tswp->current_secondary_bank;
weapon_info *swip = &Weapon_info[tswp->secondary_bank_weapons[current_bank]];
if (current_bank > -1) {
weapon_info *swip = &Weapon_info[tswp->secondary_bank_weapons[current_bank]];
if(!(En_objp->flags & OF_PROTECTED) || ((aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP)) && swip->wi_flags & WIF_PUNCTURE )) { //override lockdown on protected ships when using anti subsystem weapons - Valathil
// If ship is protected and very low on hits, don't fire missiles.
if ((current_bank > -1) && (!(En_objp->flags & OF_PROTECTED) || (En_objp->hull_strength > 10*swip->damage))) {
if (aip->ai_flags & AIF_UNLOAD_SECONDARIES) {
if (timestamp_until(swp->next_secondary_fire_stamp[current_bank]) > swip->fire_wait*1000.0f) {
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (swip->fire_wait*1000.0f));
}
}
if (timestamp_elapsed(swp->next_secondary_fire_stamp[current_bank])) {
float firing_range;
if (swip->wi_flags2 & WIF2_LOCAL_SSM)
firing_range=swip->lssm_lock_range;
else
firing_range = MIN((swip->max_speed * swip->lifetime), swip->weapon_range);
// reduce firing range of secondaries in nebula
extern int Nebula_sec_range;
if ((The_mission.flags & MISSION_FLAG_FULLNEB) && Nebula_sec_range) {
firing_range *= 0.8f;
if(!(En_objp->flags[Object::Object_Flags::Protected]) || ((aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP)) && swip->wi_flags & WIF_PUNCTURE )) { //override lockdown on protected ships when using anti subsystem weapons - Valathil
// If ship is protected and very low on hits, don't fire missiles.
if (!(En_objp->flags[Object::Object_Flags::Protected]) || (En_objp->hull_strength > 10*swip->damage)) {
if (aip->ai_flags & AIF_UNLOAD_SECONDARIES) {
if (timestamp_until(swp->next_secondary_fire_stamp[current_bank]) > swip->fire_wait*1000.0f) {
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (swip->fire_wait*1000.0f));
}
}
float t = 0.25f; // default delay in seconds until next fire.
if (timestamp_elapsed(swp->next_secondary_fire_stamp[current_bank])) {
float firing_range;
if (swip->wi_flags2 & WIF2_LOCAL_SSM)
firing_range=swip->lssm_lock_range;
else
firing_range = MIN((swip->max_speed * swip->lifetime), swip->weapon_range);
// reduce firing range of secondaries in nebula
extern int Nebula_sec_range;
if ((The_mission.flags[Mission::Mission_Flags::Fullneb]) && Nebula_sec_range) {
firing_range *= 0.8f;
}
if (dist_to_enemy < firing_range*1.0f) {
float t = 0.25f; // default delay in seconds until next fire.
if (dist_to_enemy < firing_range*1.0f) {
//vm_vec_scale_add(&future_enemy_pos, enemy_pos, enemy_vel, dist_to_enemy/swip->max_speed);
//if (vm_vec_dist_quick(&future_enemy_pos, firing_pos) < firing_range * 0.8f) {
if (ai_fire_secondary_weapon(Pl_objp)) {
if ((aip->ai_flags & AIF_UNLOAD_SECONDARIES) || (swip->burst_flags & WBF_FAST_FIRING)) {
if (swip->burst_shots > swp->burst_counter[current_bank]) {
t = swip->burst_delay;
swp->burst_counter[current_bank]++;
} else {
t = swip->fire_wait;
if ((swip->burst_shots > 0) && (swip->burst_flags & WBF_RANDOM_LENGTH)) {
swp->burst_counter[current_bank] = myrand() % swip->burst_shots;
//vm_vec_scale_add(&future_enemy_pos, enemy_pos, enemy_vel, dist_to_enemy/swip->max_speed);
//if (vm_vec_dist_quick(&future_enemy_pos, firing_pos) < firing_range * 0.8f) {
if (ai_fire_secondary_weapon(Pl_objp)) {
int current_bank_adjusted = MAX_SHIP_PRIMARY_BANKS + current_bank;
if ((aip->ai_flags & AIF_UNLOAD_SECONDARIES) || (swip->burst_flags & WBF_FAST_FIRING)) {
if (swip->burst_shots > swp->burst_counter[current_bank_adjusted]) {
t = swip->burst_delay;
swp->burst_counter[current_bank_adjusted]++;
} else {
swp->burst_counter[current_bank] = 0;
t = swip->fire_wait;
if ((swip->burst_shots > 0) && (swip->burst_flags & WBF_RANDOM_LENGTH)) {
swp->burst_counter[current_bank_adjusted] = myrand() % swip->burst_shots;
} else {
swp->burst_counter[current_bank_adjusted] = 0;
}
}
}
} else {
if (swip->burst_shots > swp->burst_counter[current_bank]) {
t = set_secondary_fire_delay(aip, temp_shipp, swip, true);
swp->burst_counter[current_bank]++;
} else {
t = set_secondary_fire_delay(aip, temp_shipp, swip, false);
if ((swip->burst_shots > 0) && (swip->burst_flags & WBF_RANDOM_LENGTH)) {
swp->burst_counter[current_bank] = myrand() % swip->burst_shots;
if (swip->burst_shots > swp->burst_counter[current_bank_adjusted]) {
t = set_secondary_fire_delay(aip, temp_shipp, swip, true);
swp->burst_counter[current_bank_adjusted]++;
} else {
swp->burst_counter[current_bank] = 0;
t = set_secondary_fire_delay(aip, temp_shipp, swip, false);
if ((swip->burst_shots > 0) && (swip->burst_flags & WBF_RANDOM_LENGTH)) {
swp->burst_counter[current_bank_adjusted] = myrand() % swip->burst_shots;
} else {
swp->burst_counter[current_bank_adjusted] = 0;
}
}
}
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (t*1000.0f));
}
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (t*1000.0f));
}
//}
//}
}
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (t*1000.0f));
}
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (t*1000.0f));
}
}
}
@@ -861,6 +887,9 @@ void ai_big_chase()
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered (i.e. MODE start time)
aip->submode = AIS_STRAFE_AVOID;
aip->submode_start_time = Missiontime;
if (Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) {
afterburners_stop(Pl_objp);
}
return;
}
}
@@ -885,10 +914,10 @@ void ai_big_chase()
dist_to_enemy = vm_vec_normalized_dir(&vec_to_enemy, &enemy_pos, &player_pos); // - En_objp->radius;
dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
update_aspect_lock_information(aip, &vec_to_enemy, dist_to_enemy, En_objp->radius);
} else if (En_objp->flags & OF_PROTECTED) { // If protected and we're not attacking a subsystem, stop attacking!
} else if (En_objp->flags[Object::Object_Flags::Protected]) { // If protected and we're not attacking a subsystem, stop attacking!
update_aspect_lock_information(aip, &vec_to_enemy, dist_to_enemy - En_objp->radius, En_objp->radius);
aip->target_objnum = -1;
if (find_enemy(Pl_objp-Objects, MAX_ENEMY_DISTANCE, The_mission.ai_profile->max_attackers[Game_skill_level]) == -1) {
if (find_enemy(OBJ_INDEX(Pl_objp), MAX_ENEMY_DISTANCE, The_mission.ai_profile->max_attackers[Game_skill_level]) == -1) {
ai_do_default_behavior(Pl_objp);
return;
}
@@ -901,8 +930,12 @@ void ai_big_chase()
case SM_ATTACK:
case SM_SUPER_ATTACK:
if (vm_vec_dist_quick(&Pl_objp->pos, &predicted_enemy_pos) > 100.0f + En_objp->radius * 2.0f) {
if (maybe_avoid_big_ship(Pl_objp, En_objp, aip, &predicted_enemy_pos, 10.0f))
if (maybe_avoid_big_ship(Pl_objp, En_objp, aip, &predicted_enemy_pos, 10.0f)) {
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
return;
}
}
if (aip->target_time < 2.0f)
@@ -918,6 +951,13 @@ void ai_big_chase()
//
// Set turn and acceleration based on submode.
//
if (((aip->submode != SM_ATTACK) && (aip->submode != SM_SUPER_ATTACK) && (aip->submode != SM_ATTACK_FOREVER) && (aip->submode != SM_EVADE_WEAPON)) || (aip->mode == AIM_STRAFE)){
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
}
switch (aip->submode) {
case SM_CONTINUOUS_TURN:
ai_big_chase_ct();
@@ -1134,7 +1174,7 @@ void ai_big_attack_get_data(vec3d *enemy_pos, float *dist_to_enemy, float *dot_t
Assert(aip->mode == AIM_STRAFE);
// ensure that Pl_objp is still targeting a big ship
if ( !(esip->flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP)) ) {
if ( !(esip->is_big_or_huge()) ) {
ai_big_switch_to_chase_mode(aip);
return;
}
@@ -1199,7 +1239,7 @@ int ai_big_strafe_maybe_retreat(float dist, vec3d *target_pos)
float dist_to_target, dist_normal_to_target, time_to_target;
dist_to_target = vm_vec_mag_quick(&vec_to_target);
if (vm_vec_mag_quick(&aip->big_attack_surface_normal) > 0.9) {
dist_normal_to_target = -vm_vec_dotprod(&vec_to_target, &aip->big_attack_surface_normal);
dist_normal_to_target = -vm_vec_dot(&vec_to_target, &aip->big_attack_surface_normal);
} else {
dist_normal_to_target = 0.2f * vm_vec_mag_quick(&vec_to_target);
}
@@ -1224,10 +1264,9 @@ int ai_big_strafe_maybe_retreat(float dist, vec3d *target_pos)
aip->submode = AIS_STRAFE_RETREAT1;
aip->submode_start_time = Missiontime;
float box_dist;
int is_inside;
vec3d goal_point;
box_dist = get_world_closest_box_point_with_delta(&goal_point, En_objp, &Pl_objp->pos, &is_inside, STRAFE_RETREAT_BOX_DIST);
get_world_closest_box_point_with_delta(&goal_point, En_objp, &Pl_objp->pos, &is_inside, STRAFE_RETREAT_BOX_DIST);
// set goal point
aip->goal_point = goal_point;
@@ -1311,27 +1350,30 @@ void ai_big_strafe_attack()
ai_big_maybe_fire_weapons(target_dist, target_dot, &Pl_objp->pos, &En_objp->pos, &En_objp->phys_info.vel);
turn_towards_point(Pl_objp, &target_pos, NULL, 0.0f);
// Slow down if we've not been hit for a while
fix last_hit = Missiontime - aip->last_hit_time;
if ( target_dist > 1200 || last_hit < F1_0*6) {
accel = 1.0f;
} else {
float attack_time;
attack_time = f2fl(Missiontime - aip->submode_start_time);
if ( attack_time > 15 ) {
accel = 0.2f;
} else if ( attack_time > 10 ) {
accel = 0.4f;
} else if ( attack_time > 8 ) {
accel = 0.6f;
} else if ( attack_time > 5 ) {
accel = 0.8f;
} else {
if ( aip->ai_profile_flags2 & AIPF2_AI_CAN_SLOW_DOWN_ATTACKING_BIG_SHIPS ) {
// Slow down if we've not been hit for a while
if ( target_dist > 1200 || last_hit < F1_0*6) {
accel = 1.0f;
} else {
float attack_time;
attack_time = f2fl(Missiontime - aip->submode_start_time);
if ( attack_time > 15 ) {
accel = 0.2f;
} else if ( attack_time > 10 ) {
accel = 0.4f;
} else if ( attack_time > 8 ) {
accel = 0.6f;
} else if ( attack_time > 5 ) {
accel = 0.8f;
} else {
accel = 1.0f;
}
}
} else {
accel = 1.0f;
}
accel = 1.0f;
accelerate_ship(aip, accel);
// if haven't been hit in quite a while, leave strafe mode
@@ -1612,7 +1654,7 @@ void ai_big_strafe()
}
*/
// check if target is still a big ship... if not enter chase mode
if ( !(Ship_info[Ships[En_objp->instance].ship_info_index].flags & (SIF_BIG_SHIP|SIF_HUGE_SHIP)) ) {
if ( !(Ship_info[Ships[En_objp->instance].ship_info_index].is_big_or_huge()) ) {
ai_big_switch_to_chase_mode(aip);
return;
}
@@ -1685,12 +1727,12 @@ int ai_big_maybe_enter_strafe_mode(object *pl_objp, int weapon_objnum, int consi
// if Pl_objp's target is not a big/capital ship, then cannot enter strafe mode
// AL 12-31-97: Even though transports are considered big ships, don't enter strafe mode on them
if ( !(sip->flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP)) || (sip->flags & SIF_TRANSPORT) ) {
if ( !(sip->is_big_or_huge()) || (sip->flags[Ship::Info_Flags::Transport]) ) {
return 0;
}
// If Pl_objp not a fighter or bomber, don't enter strafe mode. -- MK, 11/11/97.
if ( !(Ship_info[Ships[pl_objp->instance].ship_info_index].flags & (SIF_FIGHTER | SIF_BOMBER)) ) {
if ( !(Ship_info[Ships[pl_objp->instance].ship_info_index].is_fighter_bomber()) ) {
return 0;
}
@@ -1712,7 +1754,7 @@ int ai_big_maybe_enter_strafe_mode(object *pl_objp, int weapon_objnum, int consi
//JAS IMPOSSIBLE } else {
// switch targets
sip = &Ship_info[Ships[parent_objp->instance].ship_info_index];
if ( !(sip->flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP)) || (sip->flags & SIF_TRANSPORT) ) {
if ( !(sip->is_big_or_huge()) || (sip->flags[Ship::Info_Flags::Transport]) ) {
return 0;
}
set_target_objnum(aip, OBJ_INDEX(parent_objp));
+2 -2
View File
@@ -12,10 +12,10 @@
#ifndef __AIBIG_H__
#define __AIBIG_H__
struct object;
class object;
struct ai_info;
struct vec3d;
struct ship_subsys;
class ship_subsys;
void ai_big_ship(object *objp);
void ai_big_chase();
+934 -564
View File
File diff suppressed because it is too large. Load diff
+53 -34
View File
@@ -11,18 +11,18 @@
#include "ai/aigoals.h"
#include "parse/sexp.h"
#include "globalincs/linklist.h"
#include "mission/missionlog.h"
#include "mission/missionparse.h"
#include "object/object.h"
#include "globalincs/linklist.h"
#include "playerman/player.h"
#include "network/multimsgs.h"
#include "network/multi.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
#include "network/multimsgs.h"
#include "object/object.h"
#include "object/objectdock.h"
#include "object/waypoint.h"
#include "parse/sexp.h"
#include "playerman/player.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
// all ai goals dealt with in this code are goals that are specified through
@@ -93,7 +93,7 @@ int Num_ai_goals = sizeof(Ai_goal_names) / sizeof(ai_goal_list);
// HUD what a ship's current orders are. If the AI goal doesn't correspond to something that
// ought to be printable, then NULL is used.
// JAS: Converted to a function in order to externalize the strings
char *Ai_goal_text(int goal)
const char *Ai_goal_text(int goal)
{
switch(goal) {
case 1:
@@ -171,7 +171,7 @@ void ai_post_process_mission()
// Goober5000 - MK originally iterated on only the first wing; now we iterate on only the player wing
// because the player wing may not be first
for ( i = 0; i < MAX_STARTING_WINGS; i++ ) {
if ( Starting_wings[i] == Player_ship->wingnum ) {
if (Starting_wings[i] >= 0 && Starting_wings[i] == Player_ship->wingnum) {
wing *wingp;
wingp = &Wings[Starting_wings[i]];
@@ -199,12 +199,17 @@ void ai_post_process_mission()
return;
}
// function which determines is a goal is valid for a particular type of ship
int ai_query_goal_valid( int ship, int ai_goal )
/**
* Determines if a goal is valid for a particular type of ship
*
* @param ship Ship type to test
* @param ai_goal_type Goal type to test
*/
int ai_query_goal_valid( int ship, int ai_goal_type )
{
int accepted;
if (ai_goal == AI_GOAL_NONE)
if (ai_goal_type == AI_GOAL_NONE)
return 1; // anything can have no orders.
accepted = 0;
@@ -214,7 +219,7 @@ int ai_query_goal_valid( int ship, int ai_goal )
int ship_type = Ship_info[Ships[ship].ship_info_index].class_type;
if(ship_type > -1)
{
if(ai_goal & Ship_types[ship_type].ai_valid_goals) {
if(ai_goal_type & Ship_types[ship_type].ai_valid_goals) {
accepted = 1;
}
}
@@ -521,14 +526,14 @@ int ai_goal_find_dockpoint(int shipnum, int dock_type)
// insanity?
if (loop_count >= 100)
Warning(LOCATION, "Too many iterations while looking for a dockpoint on %s. Either there was a bug or this is an übership.\n", shipp->ship_name);
Warning(LOCATION, "Too many iterations while looking for a dockpoint on %s.\n", shipp->ship_name);
// if we're here, just return the first dockpoint
return model_find_dock_index(Ship_info[shipp->ship_info_index].model_num, dock_type);
}
// function to fix up dock point references for objects.
// passed are the pointer to goal we are working with. aip if the ai_info pointer
// passed are the pointer to goal we are working with. aip is the ai_info pointer
// of the ship with the order. aigp is a pointer to the goal (of aip) of which we are
// fixing up the docking points
void ai_goal_fixup_dockpoints(ai_info *aip, ai_goal *aigp)
@@ -537,6 +542,7 @@ void ai_goal_fixup_dockpoints(ai_info *aip, ai_goal *aigp)
Assert ( aip->shipnum != -1 );
shipnum = ship_name_lookup( aigp->target_name );
Assertion ( shipnum != -1, "Couldn't find ai goal's target_name (%s); get a coder!\n", aigp->target_name );
docker_index = -1;
dockee_index = -1;
@@ -578,10 +584,10 @@ void ai_goal_fixup_dockpoints(ai_info *aip, ai_goal *aigp)
// look for docking points of the appriopriate type. Use cargo docks for cargo ships.
/*
if (Ship_info[Ships[shipnum].ship_info_index].flags & SIF_CARGO) {
if (Ship_info[Ships[shipnum].ship_info_index].flags[Ship::Info_Flags::Cargo]) {
docker_index = ai_goal_find_dockpoint(aip->shipnum, DOCK_TYPE_CARGO);
dockee_index = ai_goal_find_dockpoint(shipnum, DOCK_TYPE_CARGO);
} else if (Ship_info[Ships[aip->shipnum].ship_info_index].flags & SIF_SUPPORT) {
} else if (Ship_info[Ships[aip->shipnum].ship_info_index].flags[Ship::Info_Flags::Support]) {
docker_index = ai_goal_find_dockpoint(aip->shipnum, DOCK_TYPE_REARM);
dockee_index = ai_goal_find_dockpoint(shipnum, DOCK_TYPE_REARM);
}
@@ -979,6 +985,16 @@ void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp, char *actor_name )
aigp->priority = MAX_GOAL_PRIORITY;
}
// Goober5000 - we now have an extra optional chase argument to allow chasing our own team
if ( op == OP_AI_CHASE || op == OP_AI_CHASE_WING || op == OP_AI_DISABLE_SHIP || op == OP_AI_DISARM_SHIP ) {
if ((CDDDR(node) != -1) && is_sexp_true(CDDDR(node)))
aigp->flags |= AIGF_TARGET_OWN_TEAM;
}
if ( op == OP_AI_DESTROY_SUBSYS ) {
if ((CDDDDR(node) != -1) && is_sexp_true(CDDDDR(node)))
aigp->flags |= AIGF_TARGET_OWN_TEAM;
}
// Goober5000 - since none of the goals act on the actor,
// don't assign the goal if the actor's goal target is itself
if (aigp->target_name != NULL && !strcmp(aigp->target_name, actor_name))
@@ -1371,16 +1387,20 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
ship *shipp = &Ships[objp->instance];
// always valid if has subspace drive
if (!(shipp->flags2 & SF2_NO_SUBSPACE_DRIVE))
if (!(shipp->flags[Ship::Ship_Flags::No_subspace_drive]))
return AI_GOAL_ACHIEVABLE;
// if no subspace drive, only valid if there's somewhere to depart to
// if no subspace drive, only valid if our mothership is present
// locate a capital ship on the same team:
if (ship_get_ship_with_dock_bay(shipp->team) >= 0)
return AI_GOAL_ACHIEVABLE;
else
return AI_GOAL_NOT_KNOWN;
// check that we have a mothership and that we can depart to it
if (shipp->departure_location == DEPART_AT_DOCK_BAY)
{
int anchor_shipnum = ship_name_lookup(Parse_names[shipp->departure_anchor]);
if (anchor_shipnum >= 0 && ship_useful_for_departure(anchor_shipnum, shipp->departure_path_mask))
return AI_GOAL_ACHIEVABLE;
}
return AI_GOAL_NOT_KNOWN;
}
@@ -1641,7 +1661,7 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
}
// if ship is disabled, don't know if it can dock or not
if ( Ships[objp->instance].flags & SF_DISABLED )
if ( Ships[objp->instance].flags[Ship::Ship_Flags::Disabled] )
return AI_GOAL_NOT_KNOWN;
// we must also determine if we're prevented from docking for any reason
@@ -1787,7 +1807,7 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
// if the destination ship is dying or departing (but not completed yet), the mark goal as
// not achievable.
if ( Ships[sindex].flags & (SF_DYING | SF_DEPARTING) )
if ( Ships[sindex].is_dying_or_departing())
return AI_GOAL_NOT_ACHIEVABLE;
// if the destination object is no longer awaiting repair, then remove the item
@@ -1868,9 +1888,8 @@ int ai_goal_priority_compare(const void *a, const void *b)
// Prioritize goal list.
// First sort on priority.
// Then sort on time for goals of equivalent priority.
// objnum The object number to act upon. Redundant with *aip.
// *aip The AI info to act upon. Goals are stored at aip->goals
void prioritize_goals(int objnum, ai_info *aip)
void prioritize_goals(ai_info *aip)
{
// First sort based on priority field.
insertion_sort(aip->goals, MAX_AI_GOALS, sizeof(ai_goal), ai_goal_priority_compare);
@@ -1986,7 +2005,7 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
validate_mission_goals(objnum, aip);
// Sort the goal array by priority and other factors.
prioritize_goals(objnum, aip);
prioritize_goals(aip);
// Make sure there's a goal to pursue, else return.
if (aip->goals[0].signature == -1) {
@@ -2023,7 +2042,7 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
// Goober5000 - we may want to use AI for the player
// AL 3-7-98: If this is a player ship, and the goal is not a formation goal, then do a quick out
if ( !(Player_use_ai) && (objp->flags & OF_PLAYER_SHIP) && (current_goal->ai_mode != AI_GOAL_FORM_ON_WING) )
if ( !(Player_use_ai) && (objp->flags[Object::Object_Flags::Player_ship]) && (current_goal->ai_mode != AI_GOAL_FORM_ON_WING) )
{
return;
}
@@ -2180,11 +2199,11 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
if (aip->target_objnum != -1) {
// Only protect if _not_ a capital ship. We don't want the Lucifer accidentally getting protected.
if (Ship_types[Ship_info[Ships[shipnum].ship_info_index].class_type].ai_bools & STI_AI_PROTECTED_ON_CRIPPLE)
Objects[aip->target_objnum].flags |= OF_PROTECTED;
Objects[aip->target_objnum].flags.set(Object::Object_Flags::Protected);
}
} else // Just in case this ship had been protected, unprotect it.
if (aip->target_objnum != -1)
Objects[aip->target_objnum].flags &= ~OF_PROTECTED;
Objects[aip->target_objnum].flags.remove(Object::Object_Flags::Protected);
break;
}
@@ -2340,7 +2359,7 @@ void ai_update_goal_references(ai_goal *goals, int type, const char *old_name, c
}
}
int query_referenced_in_ai_goals(ai_goal *goals, int type, char *name)
int query_referenced_in_ai_goals(ai_goal *goals, int type, const char *name)
{
int i, mode, flag;
@@ -2405,7 +2424,7 @@ int query_referenced_in_ai_goals(ai_goal *goals, int type, char *name)
return 0;
}
char *ai_add_dock_name(char *str)
char *ai_add_dock_name(const char *str)
{
char *ptr;
int i;
+4 -4
View File
@@ -86,7 +86,7 @@ extern int Num_ai_goals;
extern int Num_ai_dock_names;
extern char Ai_dock_names[MAX_AI_DOCK_NAMES][NAME_LENGTH];
extern char *Ai_goal_text(int goal);
extern const char *Ai_goal_text(int goal);
// extern function definitions
extern void ai_post_process_mission();
@@ -118,10 +118,10 @@ extern void ai_mission_goal_complete( ai_info *aip );
extern void ai_mission_wing_goal_complete( int wingnum, ai_goal *remove_goalp );
extern void ai_update_goal_references(ai_goal *goals, int type, const char *old_name, const char *new_name);
extern int query_referenced_in_ai_goals(ai_goal *goals, int type, char *name);
extern char *ai_add_dock_name(char *str);
extern int query_referenced_in_ai_goals(ai_goal *goals, int type, const char *name);
extern char *ai_add_dock_name(const char *str);
extern int ai_query_goal_valid( int ship, int ai_goal );
extern int ai_query_goal_valid( int ship, int ai_goal_type );
extern void ai_add_goal_ship_internal( ai_info *aip, int goal_type, char *name, int docker_point, int dockee_point, int immediate = 1 );
extern void ai_add_goal_wing_internal( wing *wingp, int goal_type, char *name, int immediate = 1 );
+3
View File
@@ -10,6 +10,9 @@
#ifndef _AIINTERNAL_H
#define _AIINTERNAL_H
#include "ship/ship.h"
#include "weapon/weapon.h"
//Returns true if the specified object is a stealth ship, false if not
bool is_object_stealth_ship(object* objp);
-16
View File
@@ -1,16 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _AILOCAL_H
#define _AILOCAL_H
// -- Don't put anything in here --
// Put it in ai.h!
#endif
+357 -118
View File
@@ -1,27 +1,28 @@
#include "globalincs/systemvars.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
#include "freespace2/freespace.h"
#include "ai/aibig.h"
#include "ai/aiinternal.h"
#include "asteroid/asteroid.h"
#include "globalincs/linklist.h"
#include "weapon/beam.h"
#include "weapon/swarm.h"
#include "io/timer.h"
#include "render/3d.h"
#include "debugconsole/console.h"
#include "freespace.h"
#include "gamesnd/gamesnd.h"
#include "ship/shipfx.h"
#include "network/multimsgs.h"
#include "weapon/flak.h"
#include "globalincs/linklist.h"
#include "globalincs/systemvars.h"
#include "iff_defs/iff_defs.h"
#include "io/timer.h"
#include "math/staticrand.h"
#include "network/multi.h"
#include "ai/aibig.h"
#include "network/multimsgs.h"
#include "object/objectdock.h"
#include "ai/aiinternal.h" //Included last, so less includes are needed
#include "iff_defs/iff_defs.h"
#include "weapon/muzzleflash.h"
#include "parse/scripting.h"
#include "render/3d.h"
#include "ship/ship.h"
#include "ship/shipfx.h"
#include "weapon/beam.h"
#include "weapon/flak.h"
#include "weapon/muzzleflash.h"
#include "weapon/swarm.h"
#include "weapon/weapon.h"
#include <limits.h>
@@ -38,8 +39,7 @@
float Lethality_range_const = 2.0f;
DCF(lethality_range, "N for modifying range: 1 / (1+N) at 100")
{
dc_get_arg(ARG_FLOAT);
Lethality_range_const = Dc_arg_float;
dc_stuff_float(&Lethality_range_const);
}
float Player_lethality_bump[NUM_SKILL_LEVELS] = {
@@ -354,6 +354,54 @@ bool turret_weapon_has_flags2(ship_weapon *swp, int flags)
return false;
}
/**
* Just gloms all the flags from all the weapons into one variable. More efficient if all you need to do is test for the existence of a flag.
*/
int turret_weapon_aggregate_flags(ship_weapon *swp)
{
Assert(swp != NULL);
int i = 0, flags = 0;
for (i = 0; i < swp->num_primary_banks; i++)
{
if (swp->primary_bank_weapons[i] >= 0) {
flags |= Weapon_info[swp->primary_bank_weapons[i]].wi_flags;
}
}
for (i = 0; i < swp->num_secondary_banks; i++)
{
if (swp->secondary_bank_weapons[i] >= 0) {
flags |= Weapon_info[swp->secondary_bank_weapons[i]].wi_flags;
}
}
return flags;
}
/**
* Just gloms all the flags from all the weapons into one variable. More efficient if all you need to do is test for the existence of a flag.
*/
int turret_weapon_aggregate_flags2(ship_weapon *swp)
{
Assert(swp != NULL);
int i = 0, flags2 = 0;
for (i = 0; i < swp->num_primary_banks; i++)
{
if (swp->primary_bank_weapons[i] >= 0) {
flags2 |= Weapon_info[swp->primary_bank_weapons[i]].wi_flags2;
}
}
for (i = 0; i < swp->num_secondary_banks; i++)
{
if (swp->secondary_bank_weapons[i] >= 0) {
flags2 |= Weapon_info[swp->secondary_bank_weapons[i]].wi_flags2;
}
}
return flags2;
}
/**
* Returns true if any of the weapons in swp have the subtype specified
*
@@ -474,17 +522,17 @@ int valid_turret_enemy(object *objp, object *turret_parent)
sip = &Ship_info[shipp->ship_info_index];
// don't fire at ships with protected bit set!!!
if ( objp->flags & OF_PROTECTED ) {
if ( objp->flags[Object::Object_Flags::Protected] ) {
return 0;
}
// don't shoot at ships without collision check
if (sip->flags & SIF_NO_COLLIDE) {
if (!(objp->flags[Object::Object_Flags::Collides])) {
return 0;
}
// don't shoot at arriving ships
if (shipp->flags & SF_ARRIVING) {
if (shipp->is_arriving()) {
return 0;
}
@@ -501,7 +549,11 @@ int valid_turret_enemy(object *objp, object *turret_parent)
weapon *wp = &Weapons[objp->instance];
weapon_info *wip = &Weapon_info[wp->weapon_info_index];
if ( (!(wip->wi_flags & WIF_BOMB) && !(Ai_info[Ships[turret_parent->instance].ai_index].ai_profile_flags & AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY) ) ) {
if (wip->subtype == WP_LASER && !(wip->wi_flags3 & WIF3_TURRET_INTERCEPTABLE)) { // If the thing can't be shot down, don't try. -MageKing17
return 0;
}
if ( (!((wip->wi_flags & WIF_BOMB) || (wip->wi_flags3 & WIF3_TURRET_INTERCEPTABLE)) && !(Ai_info[Ships[turret_parent->instance].ai_index].ai_profile_flags & AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY) ) ) {
return 0;
}
@@ -552,55 +604,61 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
}
// check if protected
if (objp->flags & OF_PROTECTED) {
if (objp->flags[Object::Object_Flags::Protected]) {
return;
}
// check if beam protected
if (eeo->eeo_flags & EEOF_BEAM) {
if (objp->flags & OF_BEAM_PROTECTED) {
if (objp->flags[Object::Object_Flags::Beam_protected]) {
return;
}
}
// check if flak protected
if (eeo->eeo_flags & EEOF_FLAK) {
if (objp->flags & OF_FLAK_PROTECTED) {
if (objp->flags[Object::Object_Flags::Flak_protected]) {
return;
}
}
// check if laser protected
if (eeo->eeo_flags & EEOF_LASER) {
if (objp->flags & OF_LASER_PROTECTED) {
if (objp->flags[Object::Object_Flags::Laser_protected]) {
return;
}
}
// check if missile protected
if (eeo->eeo_flags & EEOF_MISSILE) {
if (objp->flags & OF_MISSILE_PROTECTED) {
if (objp->flags[Object::Object_Flags::Missile_protected]) {
return;
}
}
// don't shoot at small ships if we shouldn't
if (eeo->eeo_flags & EEOF_BIG_ONLY) {
if (!(Ship_info[shipp->ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP))) {
if (!(Ship_info[shipp->ship_info_index].is_big_or_huge())) {
return;
}
}
// don't shoot at big ships if we shouldn't
if (eeo->eeo_flags & EEOF_SMALL_ONLY) {
if ((Ship_info[shipp->ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP))) {
if ((Ship_info[shipp->ship_info_index].is_big_or_huge())) {
return;
}
}
// check if turret flagged to only target tagged ships
// check if turret flagged to only target tagged ships
// Note: retail behaviour was turrets with tagged-only could fire at bombs
// and could fire their spawn weapons
// this check is almost redundant; see the almost identical check in ai_fire_from_turret
// however if this is removed turrets still track targets but don't fire at them (which looks silly)
if (eeo->eeo_flags & EEOF_TAGGED_ONLY) {
if (!ship_is_tagged(objp)) {
if (!ship_is_tagged(objp) &&
( (The_mission.ai_profile->flags2 & AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING) ||
( !(objp->type == OBJ_WEAPON) && !(turret_weapon_has_flags(&eeo->turret_subsys->weapons, WIF_SPAWN))) )) {
return;
}
}
@@ -672,7 +730,7 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
if ( Weapons[objp->instance].homing_object == &Objects[eeo->turret_parent_objnum] ) {
if ( dist_comp < eeo->nearest_homing_bomb_dist ) {
if (!(ss->flags & SSF_FOV_REQUIRED) && (eeo->current_enemy == -1)) {
if (!(ss->flags[Ship::Subsystem_Flags::FOV_Required]) && (eeo->current_enemy == -1)) {
turret_has_no_target = true;
}
if ( (turret_has_no_target) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
@@ -683,7 +741,7 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
// if not homing, check if bomb is flying towards ship
} else if ( bomb_headed_towards_ship(objp, &Objects[eeo->turret_parent_objnum]) ) {
if ( dist_comp < eeo->nearest_bomb_dist ) {
if (!(ss->flags & SSF_FOV_REQUIRED) && (eeo->current_enemy == -1)) {
if (!(ss->flags[Ship::Subsystem_Flags::FOV_Required]) && (eeo->current_enemy == -1)) {
turret_has_no_target = true;
}
if ( (turret_has_no_target) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
@@ -695,7 +753,7 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
} // end weapon section
// maybe recalculate dist for big or huge ship
// if (shipp && (Ship_info[shipp->ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP))) {
// if (shipp && (Ship_info[shipp->ship_info_index].is_big_or_huge())) {
// fvi_ray_boundingbox(min, max, start, direction, hit);
// dist = vm_vec_dist_quick(hit, tvec);
// }
@@ -712,11 +770,11 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
// return if we're over the cap
// int max_turrets = 3 + Game_skill_level * Game_skill_level;
int max_turrets = The_mission.ai_profile->max_turret_ownage_target[Game_skill_level];
if (objp->flags & OF_PLAYER_SHIP) {
if (objp->flags[Object::Object_Flags::Player_ship]) {
max_turrets = The_mission.ai_profile->max_turret_ownage_player[Game_skill_level];
}
// Apply the per-turret limit for small targets, if there is one and this is a small target
if (ss->turret_max_target_ownage != -1 && (Ship_info[shipp->ship_info_index].flags & (SIF_SMALL_SHIP))) {
if (ss->turret_max_target_ownage != -1 && (Ship_info[shipp->ship_info_index].is_small_ship())) {
max_turrets = MIN(max_turrets, ss->system_info->turret_max_target_ownage);
}
if (num_att_turrets > max_turrets) {
@@ -725,7 +783,7 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
// modify distance based on lethality of objp to my ship
float active_lethality = aip->lethality;
if (objp->flags & OF_PLAYER_SHIP) {
if (objp->flags[Object::Object_Flags::Player_ship]) {
active_lethality += Player_lethality_bump[Game_skill_level];
}
@@ -746,7 +804,7 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
// maybe update nearest attacker
if ( dist_comp < eeo->nearest_attacker_dist ) {
if (!(ss->flags & SSF_FOV_REQUIRED) && (eeo->current_enemy == -1)) {
if (!(ss->flags[Ship::Subsystem_Flags::FOV_Required]) && (eeo->current_enemy == -1)) {
turret_has_no_target = true;
}
if ( (turret_has_no_target) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
@@ -764,7 +822,7 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
dist_comp *= 0.9f + (0.01f * asteroid_time_to_impact(objp));
if (dist_comp < eeo->nearest_dist ) {
if (!(ss->flags & SSF_FOV_REQUIRED) && (eeo->current_enemy == -1)) {
if (!(ss->flags[Ship::Subsystem_Flags::FOV_Required]) && (eeo->current_enemy == -1)) {
turret_has_no_target = true;
}
if ( (turret_has_no_target) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
@@ -785,12 +843,12 @@ int is_target_beam_valid(ship_weapon *swp, object *objp)
{
// check if turret has beam weapon
if (all_turret_weapons_have_flags(swp, WIF_BEAM)) {
if (objp->flags & OF_BEAM_PROTECTED) {
if (objp->flags[Object::Object_Flags::Beam_protected]) {
return 0;
}
if (all_turret_weapons_have_flags(swp, WIF_HUGE)) {
if (objp->type == OBJ_SHIP && !(Ship_info[Ships[objp->instance].ship_info_index].flags & (SIF_BIG_SHIP|SIF_HUGE_SHIP)) ) {
if (objp->type == OBJ_SHIP && !(Ship_info[Ships[objp->instance].ship_info_index].is_big_or_huge()) ) {
return 0;
}
}
@@ -950,21 +1008,22 @@ int get_nearest_turret_objnum(int turret_parent_objnum, ship_subsys *turret_subs
}
}
if( ( (tt->wif2_flags != 0) || (tt->wif_flags != 0) ) && (ptr->type == OBJ_WEAPON) ) {
if( ( (tt->wif_flags != 0) || (tt->wif2_flags != 0) || (tt->wif3_flags != 0) ) && (ptr->type == OBJ_WEAPON) ) {
if( ( (Weapon_info[Weapons[ptr->instance].weapon_info_index].wi_flags & tt->wif_flags ) == tt->wif_flags)
&& ( (Weapon_info[Weapons[ptr->instance].weapon_info_index].wi_flags2 & tt->wif2_flags ) == tt->wif2_flags) ) {
&& ( (Weapon_info[Weapons[ptr->instance].weapon_info_index].wi_flags2 & tt->wif2_flags ) == tt->wif2_flags)
&& ( (Weapon_info[Weapons[ptr->instance].weapon_info_index].wi_flags3 & tt->wif3_flags ) == tt->wif3_flags) ) {
found_something = true;
}
}
if( ( ( tt->sif_flags != 0 ) || ( tt->sif2_flags != 0 ) ) && (ptr->type == OBJ_SHIP) ) {
if( ( (Ship_info[Ships[ptr->instance].ship_info_index].flags & tt->sif_flags) == tt->sif_flags)
&& ( (Ship_info[Ships[ptr->instance].ship_info_index].flags2 & tt->sif2_flags) == tt->sif2_flags) ) {
found_something = true;
if( ( tt->sif_flags.any_set() && (ptr->type == OBJ_SHIP) ) ) {
if( (Ship_info[Ships[ptr->instance].ship_info_index].flags & tt->sif_flags) == tt->sif_flags)
{
found_something = true;
}
}
if((tt->obj_flags != 0) && !((ptr->flags & tt->obj_flags) == tt->obj_flags)) {
if ((tt->obj_flags.any_set()) && !((ptr->flags & tt->obj_flags) == tt->obj_flags)) {
found_something = true;
}
@@ -1049,7 +1108,7 @@ int get_nearest_turret_objnum(int turret_parent_objnum, ship_subsys *turret_subs
objp = &Objects[mo->objnum];
Assert(objp->type == OBJ_WEAPON);
if (Weapon_info[Weapons[objp->instance].weapon_info_index].wi_flags & WIF_BOMB)
if ((Weapon_info[Weapons[objp->instance].weapon_info_index].wi_flags & WIF_BOMB) || (Weapon_info[Weapons[objp->instance].weapon_info_index].wi_flags3 & WIF3_TURRET_INTERCEPTABLE))
{
evaluate_obj_as_target(objp, &eeo);
}
@@ -1151,7 +1210,7 @@ int find_turret_enemy(ship_subsys *turret_subsys, int objnum, vec3d *tpos, vec3d
if (Objects[target_objnum].signature == aip->target_signature) {
if (iff_matches_mask(Ships[Objects[target_objnum].instance].team, enemy_team_mask)) {
if ( !(Objects[target_objnum].flags & OF_PROTECTED) ) { // check this flag as well
if ( !(Objects[target_objnum].flags[Object::Object_Flags::Protected]) ) { // check this flag as well
// nprintf(("AI", "Frame %i: Object %i resuming goal of object %i\n", AI_FrameCount, objnum, target_objnum));
return target_objnum;
}
@@ -1166,8 +1225,8 @@ int find_turret_enemy(ship_subsys *turret_subsys, int objnum, vec3d *tpos, vec3d
if ((frand() < 0.8f) && (aip->target_objnum != -1) && Use_parent_target) {
//check if aip->target_objnum is valid target
int target_flags = Objects[aip->target_objnum].flags;
if ( target_flags & OF_PROTECTED ) {
auto target_flags = Objects[aip->target_objnum].flags;
if ( target_flags[Object::Object_Flags::Protected] ) {
// AL 2-27-98: why is a protected ship being targeted?
set_target_objnum(aip, -1);
return -1;
@@ -1176,15 +1235,15 @@ int find_turret_enemy(ship_subsys *turret_subsys, int objnum, vec3d *tpos, vec3d
// maybe use ship target_objnum if valid for turret
// check for beam weapon and beam protected, etc.
bool skip = false;
if ( (target_flags & OF_BEAM_PROTECTED) && beam_flag ) skip = true;
else if ( (target_flags & OF_FLAK_PROTECTED) && flak_flag ) skip = true;
else if ( (target_flags & OF_LASER_PROTECTED) && laser_flag ) skip = true;
else if ( (target_flags & OF_MISSILE_PROTECTED) && missile_flag ) skip = true;
if ( target_flags[Object::Object_Flags::Beam_protected] && beam_flag ) skip = true;
else if ( target_flags[Object::Object_Flags::Flak_protected] && flak_flag ) skip = true;
else if ( target_flags[Object::Object_Flags::Laser_protected] && laser_flag ) skip = true;
else if ( target_flags[Object::Object_Flags::Missile_protected] && missile_flag) skip = true;
if (!skip) {
if ( Objects[aip->target_objnum].type == OBJ_SHIP ) {
// check for huge weapon and huge ship
if ( !big_only_flag || (Ship_info[Ships[Objects[aip->target_objnum].instance].ship_info_index].flags & (SIF_BIG_SHIP|SIF_HUGE_SHIP)) ) {
if ( !big_only_flag || (Ship_info[Ships[Objects[aip->target_objnum].instance].ship_info_index].is_big_or_huge()) ) {
// check for tagged only and tagged ship
if ( tagged_only_flag && ship_is_tagged(&Objects[aip->target_objnum]) ) {
// select new target if aip->target_objnum is out of field of view
@@ -1195,7 +1254,7 @@ int find_turret_enemy(ship_subsys *turret_subsys, int objnum, vec3d *tpos, vec3d
in_fov = turret_fov_test(turret_subsys, tvec, &v2e);
if (turret_subsys->flags & SSF_FOV_EDGE_CHECK) {
if (turret_subsys->flags[Ship::Subsystem_Flags::FOV_edge_check]) {
if (in_fov == false)
if (object_in_turret_fov(&Objects[aip->target_objnum], turret_subsys, tvec, tpos, dist + Objects[aip->target_objnum].radius))
in_fov = true;
@@ -1214,12 +1273,12 @@ int find_turret_enemy(ship_subsys *turret_subsys, int objnum, vec3d *tpos, vec3d
enemy_objnum = get_nearest_turret_objnum(objnum, turret_subsys, enemy_team_mask, tpos, tvec, current_enemy, big_only_flag, small_only_flag, tagged_only_flag, beam_flag, flak_flag, laser_flag, missile_flag);
if ( enemy_objnum >= 0 ) {
Assert( !((Objects[enemy_objnum].flags & OF_BEAM_PROTECTED) && beam_flag) );
Assert( !((Objects[enemy_objnum].flags & OF_FLAK_PROTECTED) && flak_flag) );
Assert( !((Objects[enemy_objnum].flags & OF_LASER_PROTECTED) && laser_flag) );
Assert( !((Objects[enemy_objnum].flags & OF_MISSILE_PROTECTED) && missile_flag) );
Assert( !((Objects[enemy_objnum].flags[Object::Object_Flags::Beam_protected]) && beam_flag) );
Assert( !((Objects[enemy_objnum].flags[Object::Object_Flags::Flak_protected]) && flak_flag) );
Assert( !((Objects[enemy_objnum].flags[Object::Object_Flags::Laser_protected]) && laser_flag) );
Assert( !((Objects[enemy_objnum].flags[Object::Object_Flags::Missile_protected]) && missile_flag) );
if ( Objects[enemy_objnum].flags & OF_PROTECTED ) {
if ( Objects[enemy_objnum].flags[Object::Object_Flags::Protected] ) {
Int3();
enemy_objnum = aip->target_objnum;
}
@@ -1250,6 +1309,8 @@ void ship_get_global_turret_info(object *objp, model_subsystem *tp, vec3d *gpos,
vm_vec_unrotate(gvec, &tp->turret_norm, &objp->orient);
}
void turret_ai_update_aim(ai_info *aip, object *En_Objp, ship_subsys *ss);
/**
* Given an object and a turret on that object, return the actual firing point of the gun and its normal.
*
@@ -1274,11 +1335,59 @@ void ship_get_global_turret_gun_info(object *objp, ship_subsys *ssp, vec3d *gpos
gun_pos = &tp->turret_firing_point[ssp->turret_next_fire_pos % tp->turret_num_firing_points];
//model_find_world_point(gpos, gun_pos, tp->model_num, tp->turret_gun_sobj, &objp->orient, &objp->pos );
model_instance_find_world_point(gpos, gun_pos, tp->model_num, Ships[objp->instance].model_instance_num, tp->turret_gun_sobj, &objp->orient, &objp->pos);
model_instance_find_world_point(gpos, gun_pos, Ships[objp->instance].model_instance_num, tp->turret_gun_sobj, &objp->orient, &objp->pos);
if (use_angles)
model_instance_find_world_dir(gvec, &tp->turret_norm, tp->model_num, Ships[objp->instance].model_instance_num, tp->turret_gun_sobj, &objp->orient, &objp->pos );
else {
if (use_angles) {
model_instance_find_world_dir(gvec, &tp->turret_norm, Ships[objp->instance].model_instance_num, tp->turret_gun_sobj, &objp->orient);
} else if (tp->flags2 & MSS_FLAG2_SHARE_FIRE_DIRECTION) {
vec3d avg, tmp_pos, tmp_target, enemy_point, turret_norm;
vm_vec_avg_n(&avg, tp->turret_num_firing_points, tp->turret_firing_point);
model_instance_find_world_point(&tmp_pos, &avg, Ships[objp->instance].model_instance_num, tp->turret_gun_sobj, &objp->orient, &objp->pos);
if (targetp == nullptr) {
Assertion(ssp->turret_enemy_objnum >= 0, "The turret enemy object number %d for %s on ship number %d is invalid.", ssp->turret_enemy_objnum, ssp->sub_name, ssp->parent_objnum);
object *lep = &Objects[ssp->turret_enemy_objnum];
int best_weapon_tidx = turret_select_best_weapon(ssp, lep);
//This turret doesn't have any good weapons
if (best_weapon_tidx < 0)
return;
weapon_info *wip = get_turret_weapon_wip(&ssp->weapons, best_weapon_tidx);
float weapon_system_strength = ship_get_subsystem_strength(&Ships[ssp->parent_objnum], SUBSYSTEM_WEAPONS);
turret_ai_update_aim(&Ai_info[Ships[ssp->parent_objnum].ai_index], &Objects[ssp->turret_enemy_objnum], ssp);
if ((ssp->targeted_subsys != nullptr) && !(ssp->flags[Ship::Subsystem_Flags::No_SS_targeting])) {
vm_vec_unrotate(&enemy_point, &ssp->targeted_subsys->system_info->pnt, &Objects[ssp->turret_enemy_objnum].orient);
vm_vec_add2(&enemy_point, &ssp->last_aim_enemy_pos);
} else {
if ((lep->type == OBJ_SHIP) && (Ship_info[Ships[lep->instance].ship_info_index].is_big_or_huge())) {
vm_vec_unrotate(&turret_norm, &tp->turret_norm, &objp->orient);
ai_big_pick_attack_point_turret(lep, ssp, &tmp_pos, &turret_norm, &enemy_point, MIN(wip->max_speed * wip->lifetime, wip->weapon_range), tp->turret_fov);
}
else {
enemy_point = ssp->last_aim_enemy_pos;
}
}
vec3d target_moving_direction = ssp->last_aim_enemy_vel;
//Try to guess where the enemy will be, and store that spot in predicted_enemy_pos
if (The_mission.ai_profile->flags & AIPF_USE_ADDITIVE_WEAPON_VELOCITY) {
vm_vec_scale_sub2(&target_moving_direction, &objp->phys_info.vel, wip->vel_inherit_amount);
}
set_predicted_enemy_pos_turret(&tmp_target, &tmp_pos, objp, &enemy_point, &target_moving_direction, wip->max_speed, ssp->turret_time_enemy_in_range * (weapon_system_strength + 1.0f) / 2.0f);
} else {
tmp_target = *targetp;
}
vm_vec_normalized_dir(gvec, &tmp_target, &tmp_pos);
} else {
//vector gun_pos2;
//vm_vec_add(&gun_pos2, gpos, gun_pos);
vm_vec_normalized_dir(gvec, targetp, gpos);
@@ -1319,7 +1428,7 @@ void turret_ai_update_aim(ai_info *aip, object *En_Objp, ship_subsys *ss)
*/
int aifft_rotate_turret(ship *shipp, int parent_objnum, ship_subsys *ss, object *objp, object *lep, vec3d *predicted_enemy_pos, vec3d *gvec)
{
int ret_val = 0;
int ret_val __UNUSED = 0; // to be used in future, see comment @ end of function
if (ss->turret_enemy_objnum != -1) {
model_subsystem *tp = ss->system_info;
@@ -1348,13 +1457,13 @@ int aifft_rotate_turret(ship *shipp, int parent_objnum, ship_subsys *ss, object
//Figure out what point on the ship we want to point the gun at, and store the global location
//in enemy_point.
vec3d enemy_point;
if ((ss->targeted_subsys != NULL) && !(ss->flags & SSF_NO_SS_TARGETING)) {
if ((ss->targeted_subsys != NULL) && !(ss->flags[Ship::Subsystem_Flags::No_SS_targeting])) {
if (ss->turret_enemy_objnum != -1) {
vm_vec_unrotate(&enemy_point, &ss->targeted_subsys->system_info->pnt, &Objects[ss->turret_enemy_objnum].orient);
vm_vec_add2(&enemy_point, &ss->last_aim_enemy_pos);
}
} else {
if ((lep->type == OBJ_SHIP) && (Ship_info[Ships[lep->instance].ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP))) {
if ((lep->type == OBJ_SHIP) && (Ship_info[Ships[lep->instance].ship_info_index].is_big_or_huge())) {
ai_big_pick_attack_point_turret(lep, ss, &gun_pos, &gun_vec, &enemy_point, tp->turret_fov, MIN(wip->max_speed * wip->lifetime, wip->weapon_range));
} else {
enemy_point = ss->last_aim_enemy_pos;
@@ -1365,7 +1474,7 @@ int aifft_rotate_turret(ship *shipp, int parent_objnum, ship_subsys *ss, object
//Try to guess where the enemy will be, and store that spot in predicted_enemy_pos
if (The_mission.ai_profile->flags & AIPF_USE_ADDITIVE_WEAPON_VELOCITY) {
vm_vec_sub2(&target_moving_direction, &objp->phys_info.vel);
vm_vec_scale_sub2(&target_moving_direction, &objp->phys_info.vel, wip->vel_inherit_amount);
}
set_predicted_enemy_pos_turret(predicted_enemy_pos, &gun_pos, objp, &enemy_point, &target_moving_direction, wip->max_speed, ss->turret_time_enemy_in_range * (weapon_system_strength + 1.0f)/2.0f);
@@ -1388,7 +1497,7 @@ int aifft_rotate_turret(ship *shipp, int parent_objnum, ship_subsys *ss, object
in_fov = turret_fov_test(ss, gvec, &v2e);
if (ss->flags & SSF_FOV_EDGE_CHECK) {
if (ss->flags[Ship::Subsystem_Flags::FOV_edge_check]) {
if (in_fov == false)
in_fov = is_object_radius_in_turret_fov(&Objects[ss->turret_enemy_objnum], ss, gvec, &gun_pos, &v2e, predicted_enemy_pos, 0.0f);
}
@@ -1466,10 +1575,16 @@ ship_subsys *aifft_list[MAX_AIFFT_TURRETS];
float aifft_rank[MAX_AIFFT_TURRETS];
int aifft_list_size = 0;
int aifft_max_checks = 5;
DCF(mf, "")
DCF(mf, "Adjusts the maximum number of tries an AI may do when trying to pick a subsystem to attack (Default is 5)")
{
dc_get_arg(ARG_INT);
aifft_max_checks = Dc_arg_int;
dc_stuff_int(&aifft_max_checks);
if (aifft_max_checks <= 0) {
dc_printf("Value must be a non-negative, non-zero integer\n");
dc_printf("aifft_max_checks set to default value of 5\n");
aifft_max_checks = 5;
}
}
@@ -1502,7 +1617,7 @@ ship_subsys *aifft_find_turret_subsys(object *objp, ship_subsys *ssp, object *en
vm_vec_add2(&abs_gun_pos, &objp->pos);
// Only pick a turret to attack on large ships.
if (!(esip->flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP)))
if (!esip->is_big_or_huge())
return best_subsysp;
// Make sure big or huge ship *actually* has subsystems (ie, knossos)
@@ -1754,22 +1869,22 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
object *tobjp = &Objects[turret->turret_enemy_objnum];
// should not get this far. check if ship is protected from beam and weapon is type beam
if ( (wip->wi_flags & WIF_BEAM) && (tobjp->flags & OF_BEAM_PROTECTED) ) {
if ( (wip->wi_flags & WIF_BEAM) && (tobjp->flags[Object::Object_Flags::Beam_protected]) ) {
Int3();
return 0;
}
// should not get this far. check if ship is protected from flak and weapon is type flak
else if ( (wip->wi_flags & WIF_FLAK) && (tobjp->flags & OF_FLAK_PROTECTED) ) {
else if ( (wip->wi_flags & WIF_FLAK) && (tobjp->flags[Object::Object_Flags::Flak_protected]) ) {
Int3();
return 0;
}
// should not get this far. check if ship is protected from laser and weapon is type laser
else if ( (wip->subtype == WP_LASER) && (tobjp->flags & OF_LASER_PROTECTED) ) {
else if ( (wip->subtype == WP_LASER) && (tobjp->flags[Object::Object_Flags::Laser_protected]) ) {
Int3();
return 0;
}
// should not get this far. check if ship is protected from missile and weapon is type missile
else if ( (wip->subtype == WP_MISSILE) && (tobjp->flags & OF_MISSILE_PROTECTED) ) {
else if ( (wip->subtype == WP_MISSILE) && (tobjp->flags[Object::Object_Flags::Missile_protected]) ) {
Int3();
return 0;
}
@@ -1806,22 +1921,129 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
fire_info.turret = turret;
// fire a beam weapon
beam_fire(&fire_info);
weapon_objnum = beam_fire(&fire_info);
turret->flags |= SSF_HAS_FIRED; //set fired flag for scripting -nike
if (weapon_objnum != -1) {
objp = &Objects[weapon_objnum];
parent_ship->last_fired_turret = turret;
turret->last_fired_weapon_info_index = turret_weapon_class;
Script_system.SetHookObjects(4, "Ship", &Objects[parent_objnum], "Weapon", nullptr, "Beam", objp, "Target", &Objects[turret->turret_enemy_objnum]);
Script_system.RunCondition(CHA_ONTURRETFIRED, 0, NULL, &Objects[parent_objnum]);
Script_system.RemHookVars(4, "Ship", "Weapon", "Beam", "Target");
}
turret->flags.set(Ship::Subsystem_Flags::Has_fired); //set fired flag for scripting -nike
return true;
}
// don't fire swam, but set up swarm info instead
else if ((wip->wi_flags & WIF_SWARM) || (wip->wi_flags & WIF_CORKSCREW)) {
turret_swarm_set_up_info(parent_objnum, turret, wip, turret->turret_next_fire_pos);
ship_weapon *swp = &turret->weapons;
if (swp->current_secondary_bank < 0) {
swp->current_secondary_bank = 0;
}
int bank_to_fire = swp->current_secondary_bank;
if ((turret->system_info->flags2 & MSS_FLAG2_TURRET_USE_AMMO) && (swp->secondary_bank_ammo[bank_to_fire] < 0)) {
if (!(turret->system_info->flags & MSS_FLAG_USE_MULTIPLE_GUNS)) {
swp->current_secondary_bank++;
if (swp->current_secondary_bank >= swp->num_secondary_banks) {
swp->current_secondary_bank = 0;
}
return false;
} else {
return false;
}
} else {
turret_swarm_set_up_info(parent_objnum, turret, wip, turret->turret_next_fire_pos);
turret->flags |= SSF_HAS_FIRED; //set fired flag for scripting -nike
return true;
turret->flags.set(Ship::Subsystem_Flags::Has_fired); //set fired flag for scripting -nike
return true;
}
}
// now do anything else
else {
for (int i=0; i < wip->shots; i++)
{
for (int i = 0; i < wip->shots; i++) {
if (turret->system_info->flags2 & MSS_FLAG2_TURRET_USE_AMMO) {
ship_weapon *swp;
swp = &turret->weapons;
int bank_to_fire, num_slots = turret->system_info->turret_num_firing_points;
if (wip->subtype == WP_LASER) {
int points;
if (swp->num_primary_banks <= 0) {
return false;
}
if (swp->current_primary_bank < 0){
swp->current_primary_bank = 0;
return false;
}
int num_primary_banks = swp->num_primary_banks;
Assert(num_primary_banks > 0);
if (num_primary_banks < 1){
return false;
}
bank_to_fire = swp->current_primary_bank;
if (turret->system_info->flags & MSS_FLAG_TURRET_SALVO) {
points = num_slots;
} else {
points = 1;
}
if (swp->primary_bank_ammo[bank_to_fire] >= 0) {
swp->primary_bank_ammo[bank_to_fire] -= points;
} else if (!(turret->system_info->flags & MSS_FLAG_USE_MULTIPLE_GUNS) && (swp->primary_bank_ammo[bank_to_fire] < 0)) {
swp->current_primary_bank++;
if (swp->current_primary_bank >= swp->num_primary_banks) {
swp->current_primary_bank = 0;
}
return false;
} else {
return false;
}
}
else if (wip->subtype == WP_MISSILE) {
if (swp->num_secondary_banks <= 0) {
return false;
}
if (swp->current_secondary_bank < 0){
swp->current_secondary_bank = 0;
return false;
}
bank_to_fire = swp->current_secondary_bank;
int start_slot, end_slot;
start_slot = swp->secondary_next_slot[bank_to_fire];
end_slot = start_slot;
for (int j = start_slot; j <= end_slot; j++) {
swp->secondary_next_slot[bank_to_fire]++;
if (swp->secondary_next_slot[bank_to_fire] > (num_slots - 1)){
swp->secondary_next_slot[bank_to_fire] = 0;
}
if (swp->secondary_bank_ammo[bank_to_fire] >= 0) {
swp->secondary_bank_ammo[bank_to_fire]--;
} else if (!(turret->system_info->flags & MSS_FLAG_USE_MULTIPLE_GUNS) && (swp->secondary_bank_ammo[bank_to_fire] < 0)) {
swp->current_secondary_bank++;
if (swp->current_secondary_bank >= swp->num_secondary_banks) {
swp->current_secondary_bank = 0;
}
return false;
} else {
return false;
}
}
}
}
// zookeeper - Firepoints should cycle normally between shots,
// so we need to get the position info separately for each shot
ship_get_global_turret_gun_info(&Objects[parent_objnum], turret, turret_pos, turret_fvec, 1, NULL);
@@ -1829,13 +2051,12 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
weapon_objnum = weapon_create( turret_pos, &turret_orient, turret_weapon_class, parent_objnum, -1, 1, 0,0.0f, turret);
weapon_set_tracking_info(weapon_objnum, parent_objnum, turret->turret_enemy_objnum, 1, turret->targeted_subsys);
objp=&Objects[weapon_objnum];
wp=&Weapons[objp->instance];
wip=&Weapon_info[wp->weapon_info_index];
//nprintf(("AI", "Turret_time_enemy_in_range = %7.3f\n", ss->turret_time_enemy_in_range));
if (weapon_objnum != -1) {
objp = &Objects[weapon_objnum];
wp = &Weapons[objp->instance];
wip = &Weapon_info[wp->weapon_info_index];
parent_ship->last_fired_turret = turret;
turret->last_fired_weapon_info_index = wp->weapon_info_index;
@@ -1843,11 +2064,12 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
// AL 1-6-97: Store pointer to turret subsystem
wp->turret_subsys = turret;
Script_system.SetHookObjects(3, "Ship", &Objects[parent_objnum], "Weapon", objp, "Target", &Objects[turret->turret_enemy_objnum]);
Script_system.SetHookObjects(4, "Ship", &Objects[parent_objnum], "Weapon", objp, "Beam", nullptr, "Target", &Objects[turret->turret_enemy_objnum]);
Script_system.RunCondition(CHA_ONTURRETFIRED, 0, NULL, &Objects[parent_objnum]);
Script_system.RemHookVars(4, "Ship", "Weapon", "Beam", "Target");
// if the gun is a flak gun
if(wip->wi_flags & WIF_FLAK){
if (wip->wi_flags & WIF_FLAK) {
// show a muzzle flash
flak_muzzle_flash(turret_pos, turret_fvec, &Objects[parent_ship->objnum].phys_info, turret_weapon_class);
@@ -1863,8 +2085,10 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
{
flak_set_range(objp, flak_range_override);
}
} else if(wip->muzzle_flash > -1) {
mflash_create(turret_pos, turret_fvec, &Objects[parent_ship->objnum].phys_info, Weapon_info[turret_weapon_class].muzzle_flash);
}
// otherwise just do mflash if the weapon has it
else if (wip->muzzle_flash >= 0) {
mflash_create(turret_pos, turret_fvec, &Objects[parent_ship->objnum].phys_info, wip->muzzle_flash);
}
// in multiplayer (and the master), then send a turret fired packet.
@@ -1882,7 +2106,7 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
if ( wip->launch_snd != -1 ) {
// Don't play turret firing sound if turret sits on player ship... it gets annoying.
if ( parent_objnum != OBJ_INDEX(Player_obj) || (turret->flags & SSF_PLAY_SOUND_FOR_PLAYER) ) {
if ( parent_objnum != OBJ_INDEX(Player_obj) || (turret->flags[Ship::Subsystem_Flags::Play_sound_for_player]) ) {
snd_play_3d( &Snds[wip->launch_snd], turret_pos, &View_position );
}
}
@@ -1903,7 +2127,7 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
turret->turret_next_fire_stamp = timestamp((int) wait);
}
turret->flags |= SSF_HAS_FIRED; //set has fired flag for scriptng - nuke
turret->flags.set(Ship::Subsystem_Flags::Has_fired); //set has fired flag for scriptng - nuke
//Fire animation stuff
model_anim_start_type(turret, TRIGGER_TYPE_TURRET_FIRED, ANIMATION_SUBTYPE_ALL, 1);
@@ -1954,6 +2178,18 @@ void turret_swarm_fire_from_turret(turret_swarm_info *tsi)
Weapons[Objects[weapon_objnum].instance].turret_subsys = tsi->turret;
Weapons[Objects[weapon_objnum].instance].target_num = tsi->turret->turret_enemy_objnum;
Ships[Objects[tsi->parent_objnum].instance].last_fired_turret = tsi->turret;
tsi->turret->last_fired_weapon_info_index = tsi->weapon_class;
Script_system.SetHookObjects(4, "Ship", &Objects[tsi->parent_objnum], "Weapon", &Objects[weapon_objnum], "Beam", nullptr, "Target", &Objects[tsi->turret->turret_enemy_objnum]);
Script_system.RunCondition(CHA_ONTURRETFIRED, 0, NULL, &Objects[tsi->parent_objnum]);
Script_system.RemHookVars(4, "Ship", "Weapon", "Beam", "Target");
// muzzle flash?
if (Weapon_info[tsi->weapon_class].muzzle_flash >= 0) {
mflash_create(&turret_pos, &turret_fvec, &Objects[tsi->parent_objnum].phys_info, Weapon_info[tsi->weapon_class].muzzle_flash);
}
// maybe sound
if ( Weapon_info[tsi->weapon_class].launch_snd != -1 ) {
// Don't play turret firing sound if turret sits on player ship... it gets annoying.
@@ -1961,8 +2197,7 @@ void turret_swarm_fire_from_turret(turret_swarm_info *tsi)
snd_play_3d( &Snds[Weapon_info[tsi->weapon_class].launch_snd], &turret_pos, &View_position );
}
}
if(Weapon_info[tsi->weapon_class].muzzle_flash > -1)
mflash_create(&turret_pos, &turret_fvec, &Objects[tsi->parent_objnum].phys_info, Weapon_info[tsi->weapon_class].muzzle_flash);
// in multiplayer (and the master), then send a turret fired packet.
if ( MULTIPLAYER_MASTER && (weapon_objnum != -1) ) {
int subsys_index;
@@ -2049,7 +2284,7 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
// (NOTE: this will probably get changed by other parts of the code (swarming, beams, etc) to be
// a more accurate time, but we need to give it a long enough time for the other parts of the code
// to change the timestamp before it gets acted upon - taylor)
ss->turret_animation_done_time = timestamp(1000);
ss->turret_animation_done_time = timestamp(200);
} else {
return;
}
@@ -2208,57 +2443,61 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
if ( lep->type != OBJ_SHIP ) {
continue;
}
if ( !(Ship_info[Ships[lep->instance].ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP)) ) {
if ( !(Ship_info[Ships[lep->instance].ship_info_index].is_big_or_huge()) ) {
continue;
}
}
if ( wip->wi_flags2 & WIF2_SMALL_ONLY ) {
if ( (lep->type == OBJ_SHIP) && (Ship_info[Ships[lep->instance].ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP)) ) {
if ( (lep->type == OBJ_SHIP) && (Ship_info[Ships[lep->instance].ship_info_index].is_big_or_huge()) ) {
continue;
}
}
bool tagged_only = ((wip->wi_flags2 & WIF2_TAGGED_ONLY) || (ss->weapons.flags & SW_FLAG_TAGGED_ONLY));
if (lep->type == OBJ_SHIP) {
// Check if we're targeting a protected ship
if (lep->flags & OF_PROTECTED) {
if (lep->flags[Object::Object_Flags::Protected]) {
ss->turret_enemy_objnum = -1;
ss->turret_time_enemy_in_range = 0.0f;
continue;
}
// Check if we're targeting a beam protected ship with a beam weapon
if ( (lep->flags & OF_BEAM_PROTECTED) && (wip->wi_flags & WIF_BEAM) ) {
if ( (lep->flags[Object::Object_Flags::Beam_protected]) && (wip->wi_flags & WIF_BEAM) ) {
ss->turret_enemy_objnum = -1;
ss->turret_time_enemy_in_range = 0.0f;
continue;
}
// Check if we're targeting a flak protected ship with a flak weapon
else if ( (lep->flags & OF_FLAK_PROTECTED) && (wip->wi_flags & WIF_FLAK) ) {
else if ( (lep->flags[Object::Object_Flags::Flak_protected]) && (wip->wi_flags & WIF_FLAK) ) {
ss->turret_enemy_objnum = -1;
ss->turret_time_enemy_in_range = 0.0f;
continue;
}
// Check if we're targeting a laser protected ship with a laser weapon
else if ( (lep->flags & OF_LASER_PROTECTED) && (wip->subtype == WP_LASER) ) {
else if ( (lep->flags[Object::Object_Flags::Laser_protected]) && (wip->subtype == WP_LASER) ) {
ss->turret_enemy_objnum = -1;
ss->turret_time_enemy_in_range = 0.0f;
continue;
}
// Check if we're targeting a missile protected ship with a missile weapon
else if ( (lep->flags & OF_MISSILE_PROTECTED) && (wip->subtype == WP_MISSILE) ) {
else if ( (lep->flags[Object::Object_Flags::Missile_protected]) && (wip->subtype == WP_MISSILE) ) {
ss->turret_enemy_objnum = -1;
ss->turret_time_enemy_in_range = 0.0f;
continue;
}
// Check if weapon or turret is set to tagged-only
// must check here in case turret has multiple weapons and not all are tagged-only
else if (!ship_is_tagged(lep) && tagged_only) {
continue;
}
}
else
{
//can't tag anything else, other than asteroids
//but we don't want to waste this type of
//weaponary on asteroids now do we?
if ((wip->wi_flags2 & WIF2_TAGGED_ONLY) || (ss->weapons.flags & SW_FLAG_TAGGED_ONLY))
{
// check tagged-only for non-ship targets
if (tagged_only && (!(lep->type == OBJ_WEAPON) || (The_mission.ai_profile->flags2 & AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING))) {
continue;
}
}
@@ -2298,7 +2537,7 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
if (ss->turret_enemy_objnum != -1) {
float dot = 1.0f;
lep = &Objects[ss->turret_enemy_objnum];
if (( lep->type == OBJ_SHIP ) && !(ss->flags & SSF_NO_SS_TARGETING)) {
if (( lep->type == OBJ_SHIP ) && !(ss->flags[Ship::Subsystem_Flags::No_SS_targeting])) {
ss->targeted_subsys = aifft_find_turret_subsys(objp, ss, lep, &dot);
}
ss->turret_next_enemy_check_stamp = timestamp((int) (MAX(dot, 0.5f)*2000.0f) + 1000);
@@ -2325,7 +2564,7 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
return;
}
if (Objects[ss->turret_enemy_objnum].flags & OF_PROTECTED) {
if (Objects[ss->turret_enemy_objnum].flags[Object::Object_Flags::Protected]) {
// This can happen if the enemy was selected before it became protected.
ss->turret_enemy_objnum = -1;
return;
@@ -2391,7 +2630,7 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
ss->turret_next_fire_pos = ffp_pos;
}
ship_get_global_turret_gun_info(&Objects[parent_objnum], ss, &gpos, &gvec, use_angles, &predicted_enemy_pos);
ship_get_global_turret_gun_info(&Objects[parent_objnum], ss, &gpos, &gvec, use_angles, &predicted_enemy_pos);
// Fire in the direction the turret is facing, not right at the target regardless of turret dir.
vm_vec_sub(&v2e, &predicted_enemy_pos, &gpos);
@@ -2484,11 +2723,11 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
if ( ok_to_fire && (tp->flags & MSS_FLAG_TURRET_HULL_CHECK) ) {
int model_num = Ship_info[shipp->ship_info_index].model_num;
mc_info hull_check;
vec3d end;
vm_vec_scale_add(&end, &gpos, &gvec, model_get_radius(model_num));
mc_info hull_check;
mc_info_init(&hull_check);
hull_check.model_instance_num = shipp->model_instance_num;
hull_check.model_num = model_num;
hull_check.orient = &objp->orient;
+17 -16
View File
@@ -10,15 +10,15 @@
#include "anim/animplay.h"
#include "globalincs/linklist.h"
#include "io/timer.h"
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
#include "render/3d.h"
#include "pcxutils/pcxutils.h"
#include "anim/packunpack.h"
#include "bmpman/bmpman.h"
#include "cfile/cfile.h"
#include "cmdline/cmdline.h"
#include "globalincs/linklist.h"
#include "graphics/2d.h"
#include "io/timer.h"
#include "pcxutils/pcxutils.h"
#include "render/3d.h"
@@ -196,8 +196,8 @@ anim_instance *anim_play(anim_play_struct *aps)
}
if(aps->base_w < 0 || aps->base_h < 0) {
instance->base_w = gr_screen.max_w_unscaled;
instance->base_h = gr_screen.max_h_unscaled;
instance->base_w = gr_screen.max_w_unscaled_zoomed;
instance->base_h = gr_screen.max_h_unscaled_zoomed;
} else {
instance->base_w = aps->base_w;
instance->base_h = aps->base_h;
@@ -254,7 +254,7 @@ anim_instance *anim_play(anim_play_struct *aps)
int anim_show_next_frame(anim_instance *instance, float frametime)
{
int bitmap_id, bitmap_flags=0, new_frame_num, frame_diff=0, i, n_frames=0,frame_save;
float percent_through, decompress_time, render_time, time;
float percent_through, time;
vertex image_vertex;
int aabitmap = 0;
int bpp = 16;
@@ -461,8 +461,6 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
instance->file_offset = instance->parent->file_offset;
instance->loop_count++;
}
decompress_time = f2fl(t2-t1);
t1 = timer_get_fixed_seconds();
if ( frame_diff == 0 && instance->last_bitmap != -1 ) {
@@ -488,16 +486,20 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
// determine x,y to display the bitmap at
if ( instance->world_pos == NULL ) {
int old_max_w_unscaled = gr_screen.max_w_unscaled;
int old_max_h_unscaled = gr_screen.max_h_unscaled;
int old_max_w_unscaled_zoomed = gr_screen.max_w_unscaled_zoomed;
int old_max_h_unscaled_zoomed = gr_screen.max_h_unscaled_zoomed;
gr_set_screen_scale(instance->base_w, instance->base_h);
gr_set_clip(0, 0, instance->base_w, instance->base_h, false);
gr_set_clip(0, 0, instance->base_w, instance->base_h, GR_RESIZE_MENU);
if ( instance->aa_color == NULL ) {
gr_bitmap(instance->x, instance->y);
gr_bitmap(instance->x, instance->y, GR_RESIZE_MENU_NO_OFFSET);
}
else {
gr_set_color_fast( (color*)instance->aa_color );
gr_aabitmap(instance->x, instance->y);
gr_aabitmap(instance->x, instance->y, GR_RESIZE_MENU_NO_OFFSET);
}
gr_reset_screen_scale();
gr_set_screen_scale(old_max_w_unscaled, old_max_h_unscaled, old_max_w_unscaled_zoomed, old_max_h_unscaled_zoomed);
gr_reset_clip();
}
else {
@@ -510,7 +512,6 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
}
t2 = timer_get_fixed_seconds();
render_time = f2fl(t2-t1);
return 0;
}
+1 -1
View File
@@ -12,8 +12,8 @@
#ifndef __ANIMPLAY_H__
#define __ANIMPLAY_H__
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "globalincs/pstypes.h"
struct anim;
struct anim_info;
+1 -3
View File
@@ -9,10 +9,10 @@
#include "anim/animplay.h"
#include "anim/packunpack.h"
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
#include "anim/animplay.h"
const int packer_code = PACKER_CODE;
@@ -301,7 +301,6 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
Assert(packed_size == (save-dest_start) );
return packed_size;
break;
}
default:
@@ -467,7 +466,6 @@ int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, in
Assert(packed_size == (save-dest_start) );
return packed_size;
break;
}
default:
+283 -268
View File
@@ -10,37 +10,39 @@
#include "asteroid/asteroid.h"
#include "object/object.h"
#include "object/objcollide.h"
#include "freespace2/freespace.h"
#include "io/timer.h"
#include "render/3d.h"
#include "debugconsole/console.h"
#include "fireball/fireballs.h"
#include "freespace.h"
#include "gamesnd/gamesnd.h"
#include "particle/particle.h"
#include "globalincs/compatibility.h"
#include "globalincs/linklist.h"
#include "globalincs/systemvars.h"
#include "hud/hud.h"
#include "hud/hudescort.h"
#include "hud/hudgauges.h"
#include "ship/shiphit.h"
#include "math/staticrand.h"
#include "globalincs/systemvars.h"
#include "localization/localize.h"
#include "stats/scoring.h"
#include "hud/hudtarget.h"
#include "weapon/weapon.h"
#include "ship/ship.h"
#include "parse/parselo.h"
#include "iff_defs/iff_defs.h"
#include "io/timer.h"
#include "localization/localize.h"
#include "math/staticrand.h"
#include "math/vecmat.h"
#include "model/model.h"
#include "species_defs/species_defs.h"
#include "iff_defs/iff_defs.h"
#include "network/multiutil.h"
#include "network/multimsgs.h"
#include "network/multi.h"
#include "network/multimsgs.h"
#include "network/multiutil.h"
#include "object/objcollide.h"
#include "object/object.h"
#include "parse/parselo.h"
#include "parse/scripting.h"
#include "particle/particle.h"
#include "render/3d.h"
#include "ship/ship.h"
#include "ship/shiphit.h"
#include "species_defs/species_defs.h"
#include "stats/scoring.h"
#include "weapon/weapon.h"
#include <algorithm>
#include "globalincs/compatibility.h"
#define ASTEROID_OBJ_USED (1<<0) // flag used in asteroid_obj struct
#define MAX_ASTEROID_OBJS MAX_ASTEROIDS // max number of asteroids tracked in asteroid list
@@ -105,7 +107,7 @@ int asteroid_obj_list_add(int objnum)
int index;
asteroid *cur_asteroid = &Asteroids[Objects[objnum].instance];
index = cur_asteroid - Asteroids;
index = (int)(cur_asteroid - Asteroids);
Assert(index >= 0 && index < MAX_ASTEROID_OBJS);
Assert(!(Asteroid_objs[index].flags & ASTEROID_OBJ_USED));
@@ -318,8 +320,12 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
}
vm_angles_2_matrix(&orient, &angs);
objnum = obj_create( OBJ_ASTEROID, -1, n, &orient, &pos, radius, OF_RENDERS | OF_PHYSICS | OF_COLLIDES);
flagset<Object::Object_Flags> asteroid_default_flagset;
asteroid_default_flagset += Object::Object_Flags::Renders;
asteroid_default_flagset += Object::Object_Flags::Physics;
asteroid_default_flagset += Object::Object_Flags::Collides;
objnum = obj_create(OBJ_ASTEROID, -1, n, &orient, &pos, radius, asteroid_default_flagset);
if ( (objnum == -1) || (objnum >= MAX_OBJECTS) ) {
mprintf(("Couldn't create asteroid -- out of object slots\n"));
@@ -327,6 +333,11 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
}
asp->objnum = objnum;
asp->model_instance_num = -1;
if (model_get(asip->model_num[asteroid_subtype])->flags & PM_FLAG_HAS_INTRINSIC_ROTATE) {
asp->model_instance_num = model_create_instance(false, asip->model_num[asteroid_subtype]);
}
// Add to Asteroid_used_list
asteroid_obj_list_add(objnum);
@@ -797,7 +808,7 @@ void maybe_throw_asteroid(int count)
// if asteroid is inside inner bound, kill it
if (asteroid_in_inner_bound(&Asteroid_field, &objp->pos, 0.0f)) {
objp->flags |= OF_SHOULD_BE_DEAD;
objp->flags.set(Object::Object_Flags::Should_be_dead);
} else {
Asteroids[objp->instance].target_objnum = so->objnum;
@@ -826,10 +837,12 @@ void asteroid_delete( object * obj )
asp = &Asteroids[num];
Assert( Num_asteroids >= 0 );
if (asp->model_instance_num >= 0)
model_delete_instance(asp->model_instance_num);
asp->flags = 0;
Num_asteroids--;
Assert(Num_asteroids >= 0);
asteroid_obj_list_remove( obj );
}
@@ -859,20 +872,19 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
dist = vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
dot = vm_vec_dot(&Eye_matrix.vec.fvec, &vec_to_asteroid);
if ((dot < 0.7f) || (dist > 3000.0f)) {
if ( (dot < 0.7f) || (dist > asfieldp->bound_rad) ) {
if (Num_asteroids > MAX_ASTEROIDS-10) {
objp->flags |= OF_SHOULD_BE_DEAD;
objp->flags.set(Object::Object_Flags::Should_be_dead);
} else {
// check to ensure player won't see asteroid appear either
asteroid_wrap_pos(objp, asfieldp);
Asteroids[objp->instance].target_objnum = -1;
vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
dist = vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
dot = vm_vec_dot(&Eye_matrix.vec.fvec, &vec_to_asteroid);
dist = vm_vec_dist_quick(&objp->pos, &Eye_position);
if (( dot > 0.7f) && (dist < 3000.0f)) {
// player would see asteroid pop out other side, so reverse velocity instead of wrapping
if ( (dot > 0.7f) && (dist < (asfieldp->bound_rad * 1.3f)) ) {
// player would see asteroid pop out other side, so reverse velocity instead of wrapping
objp->pos = old_asteroid_pos;
vm_vec_copy_scale(&objp->phys_info.vel, &old_vel, -1.0f);
objp->phys_info.desired_vel = objp->phys_info.vel;
@@ -897,7 +909,7 @@ void lerp(float *goal, float f1, float f2, float scale)
*goal = (f2 - f1) * scale + f1;
}
void asteroid_process_pre( object *objp, float frame_time)
void asteroid_process_pre( object *objp )
{
if (Asteroids_enabled) {
// Make vel chase desired_vel
@@ -907,13 +919,14 @@ void asteroid_process_pre( object *objp, float frame_time)
}
}
int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos, collision_info_struct *asteroid_hit_info)
int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos, collision_info_struct *asteroid_hit_info, vec3d* hitnormal)
{
if (!Asteroids_enabled) {
return 0;
}
mc_info mc;
mc_info_init(&mc);
int num, asteroid_subtype;
Assert( pasteroid->type == OBJ_ASTEROID );
@@ -928,7 +941,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
if ( asteroid_hit_info == NULL ) {
// asteroid weapon collision
Assert( other_obj->type == OBJ_WEAPON );
mc.model_instance_num = -1;
mc.model_instance_num = Asteroids[num].model_instance_num;
mc.model_num = Asteroid_info[Asteroids[num].asteroid_type].model_num[asteroid_subtype]; // Fill in the model to check
model_clear_instance( mc.model_num );
mc.orient = &pasteroid->orient; // The object's orient
@@ -938,24 +951,34 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
mc.flags = (MC_CHECK_MODEL);
if (model_collide(&mc))
{
*hitpos = mc.hit_point_world;
if (hitnormal)
{
vec3d normal;
model_find_world_dir(&normal, &mc.hit_normal, mc.model_num, mc.hit_submodel, mc.orient);
*hitnormal = normal;
}
}
return mc.num_hits;
}
// asteroid ship collision -- use asteroid_hit_info to calculate physics
object *ship_obj = other_obj;
Assert( ship_obj->type == OBJ_SHIP );
object *pship_obj = other_obj;
Assert( pship_obj->type == OBJ_SHIP );
object* heavy = asteroid_hit_info->heavy;
object* light = asteroid_hit_info->light;
object* lighter = asteroid_hit_info->light;
object *heavy_obj = heavy;
object *light_obj = light;
object *light_obj = lighter;
vec3d zero, p0, p1;
vm_vec_zero( &zero );
vm_vec_sub( &p0, &light->last_pos, &heavy->last_pos );
vm_vec_sub( &p1, &light->pos, &heavy->pos );
vm_vec_sub( &p0, &lighter->last_pos, &heavy->last_pos );
vm_vec_sub( &p1, &lighter->pos, &heavy->pos );
mc.pos = &zero; // The object's position
mc.p0 = &p0; // Point 1 of ray to check
@@ -977,19 +1000,19 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
// HACK - this applies to big ships warping in/out of asteroid fields - not sure what it does
if (vm_vec_mag(&asteroid_hit_info->light_rel_vel) > 300) {
asteroid_hit_info->collide_rotate = 0;
vm_vec_sub( &asteroid_hit_info->light_rel_vel, &light->phys_info.vel, &heavy->phys_info.vel );
vm_vec_sub( &asteroid_hit_info->light_rel_vel, &lighter->phys_info.vel, &heavy->phys_info.vel );
}
} else {
asteroid_hit_info->collide_rotate = 0;
vm_vec_sub( &asteroid_hit_info->light_rel_vel, &light->phys_info.vel, &heavy->phys_info.vel );
vm_vec_sub( &asteroid_hit_info->light_rel_vel, &lighter->phys_info.vel, &heavy->phys_info.vel );
}
int mc_ret_val = 0;
if ( asteroid_hit_info->heavy == ship_obj ) { // ship is heavier, so asteroid is sphere. Check sphere collision against ship poly model
mc.model_instance_num = Ships[ship_obj->instance].model_instance_num;
mc.model_num = Ship_info[Ships[ship_obj->instance].ship_info_index].model_num; // Fill in the model to check
mc.orient = &ship_obj->orient; // The object's orient
if ( asteroid_hit_info->heavy == pship_obj ) { // ship is heavier, so asteroid is sphere. Check sphere collision against ship poly model
mc.model_instance_num = Ships[pship_obj->instance].model_instance_num;
mc.model_num = Ship_info[Ships[pship_obj->instance].ship_info_index].model_num; // Fill in the model to check
mc.orient = &pship_obj->orient; // The object's orient
mc.radius = pasteroid->radius;
mc.flags = (MC_CHECK_MODEL | MC_CHECK_SPHERELINE);
@@ -1003,7 +1026,6 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
mc.flags = MC_ONLY_SPHERE | MC_CHECK_SPHERELINE;
SCP_vector<int> submodel_vector;
polymodel *pm;
polymodel_instance *pmi;
if (model_collide(&mc)) {
@@ -1017,8 +1039,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
model_get_rotating_submodel_list(&submodel_vector, heavy_obj);
// Get polymodel and turn off all rotating submodels, collide against only 1 at a time.
pm = model_get(Ship_info[Ships[heavy_obj->instance].ship_info_index].model_num);
pmi = model_get_instance(Ships[ship_obj->instance].model_instance_num);
pmi = model_get_instance(Ships[heavy_obj->instance].model_instance_num);
// turn off all rotating submodels and test for collision
for (size_t j=0; j<submodel_vector.size(); j++) {
@@ -1039,10 +1060,10 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
// find the start and end positions of the sphere in submodel RF
pmi->submodel[submodel_vector[i]].angs = pmi->submodel[submodel_vector[i]].prev_angs;
world_find_model_instance_point(&p0, &light_obj->last_pos, pm, pmi, submodel_vector[i], &heavy_obj->last_orient, &heavy_obj->last_pos);
world_find_model_instance_point(&p0, &light_obj->last_pos, pmi, submodel_vector[i], &heavy_obj->last_orient, &heavy_obj->last_pos);
pmi->submodel[submodel_vector[i]].angs = copy_angles;
world_find_model_instance_point(&p1, &light_obj->pos, pm, pmi, submodel_vector[i], &heavy_obj->orient, &heavy_obj->pos);
world_find_model_instance_point(&p1, &light_obj->pos, pmi, submodel_vector[i], &heavy_obj->orient, &heavy_obj->pos);
mc.p0 = &p0;
mc.p1 = &p1;
@@ -1059,14 +1080,14 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
// set up asteroid_hit_info for rotating submodel
if (asteroid_hit_info->edge_hit == 0) {
model_instance_find_obj_dir(&asteroid_hit_info->collision_normal, &mc.hit_normal, heavy_obj, mc.hit_submodel);
model_instance_find_obj_dir(&asteroid_hit_info->collision_normal, &mc.hit_normal, Ships[heavy_obj->instance].model_instance_num, mc.hit_submodel, &heavy_obj->orient);
}
// find position in submodel RF of light object at collison
vec3d int_light_pos, diff;
vm_vec_sub(&diff, mc.p1, mc.p0);
vm_vec_scale_add(&int_light_pos, mc.p0, &diff, mc.hit_dist);
model_instance_find_world_point(&asteroid_hit_info->light_collision_cm_pos, &int_light_pos, mc.model_num, mc.model_instance_num, mc.hit_submodel, &heavy_obj->orient, &zero);
model_instance_find_world_point(&asteroid_hit_info->light_collision_cm_pos, &int_light_pos, mc.model_instance_num, mc.hit_submodel, &heavy_obj->orient, &zero);
}
}
// Don't look at this submodel again
@@ -1091,7 +1112,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
// get collision normal if not edge hit
if (asteroid_hit_info->edge_hit == 0) {
model_instance_find_obj_dir(&asteroid_hit_info->collision_normal, &mc.hit_normal, heavy_obj, mc.hit_submodel);
model_instance_find_obj_dir(&asteroid_hit_info->collision_normal, &mc.hit_normal, Ships[heavy_obj->instance].model_instance_num, mc.hit_submodel, &heavy_obj->orient);
}
// find position in submodel RF of light object at collison
@@ -1105,11 +1126,11 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
} else {
// Asteroid is heavier obj
mc.model_instance_num = -1;
mc.model_instance_num = Asteroids[num].model_instance_num;
mc.model_num = Asteroid_info[Asteroids[num].asteroid_type].model_num[asteroid_subtype]; // Fill in the model to check
model_clear_instance( mc.model_num );
mc.orient = &pasteroid->orient; // The object's orient
mc.radius = model_get_core_radius(Ship_info[Ships[ship_obj->instance].ship_info_index].model_num);
mc.radius = model_get_core_radius(Ship_info[Ships[pship_obj->instance].ship_info_index].model_num);
// check for collision between asteroid model and ship sphere
mc.flags = (MC_CHECK_MODEL | MC_CHECK_SPHERELINE);
@@ -1160,12 +1181,12 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
}
}
void asteroid_render(object * obj)
void asteroid_render(object * obj, draw_list *scene)
{
if (Asteroids_enabled) {
int num;
asteroid *asp;
num = obj->instance;
Assert((num >= 0) && (num < MAX_ASTEROIDS));
@@ -1174,7 +1195,13 @@ void asteroid_render(object * obj)
Assert( asp->flags & AF_USED );
model_clear_instance( Asteroid_info[asp->asteroid_type].model_num[asp->asteroid_subtype]);
model_render(Asteroid_info[asp->asteroid_type].model_num[asp->asteroid_subtype], &obj->orient, &obj->pos, MR_NORMAL|MR_IS_ASTEROID, OBJ_INDEX(obj) ); // Replace MR_NORMAL with 0x07 for big yellow blobs
model_render_params render_info;
render_info.set_object_number( OBJ_INDEX(obj) );
render_info.set_flags(MR_IS_ASTEROID);
model_render_queue(&render_info, scene, Asteroid_info[asp->asteroid_type].model_num[asp->asteroid_subtype], &obj->orient, &obj->pos); // Replace MR_NORMAL with 0x07 for big yellow blobs
}
}
@@ -1313,7 +1340,7 @@ void asteroid_do_area_effect(object *asteroid_objp)
ship_objp = &Objects[so->objnum];
// don't blast navbuoys
if ( ship_get_SIF(ship_objp->instance) & SIF_NAVBUOY ) {
if ( ship_get_SIF(ship_objp->instance)[Ship::Info_Flags::Navbuoy] ) {
continue;
}
@@ -1328,42 +1355,42 @@ void asteroid_do_area_effect(object *asteroid_objp)
/**
* Upon asteroid asteroid_obj being hit. Apply damage and maybe make it break into smaller asteroids.
*
* @param asteroid_obj pointer to asteroid object getting hit
* @param pasteroid_obj pointer to asteroid object getting hit
* @param other_obj object that hit asteroid, can be NULL if asteroid hit by area effect
* @param hitpos world position asteroid was hit, can be NULL if hit by area effect
* @param damage amount of damage to apply to asteroid
*/
void asteroid_hit( object * asteroid_obj, object * other_obj, vec3d * hitpos, float damage )
void asteroid_hit( object * pasteroid_obj, object * other_obj, vec3d * hitpos, float damage )
{
float explosion_life;
asteroid *asp;
asp = &Asteroids[asteroid_obj->instance];
asp = &Asteroids[pasteroid_obj->instance];
if (asteroid_obj->flags & OF_SHOULD_BE_DEAD){
if (pasteroid_obj->flags[Object::Object_Flags::Should_be_dead]){
return;
}
if ( MULTIPLAYER_MASTER ){
send_asteroid_hit( asteroid_obj, other_obj, hitpos, damage );
send_asteroid_hit( pasteroid_obj, other_obj, hitpos, damage );
}
asteroid_obj->hull_strength -= damage;
pasteroid_obj->hull_strength -= damage;
if (asteroid_obj->hull_strength < 0.0f) {
if (pasteroid_obj->hull_strength < 0.0f) {
if ( asp->final_death_time <= 0 ) {
int play_loud_collision = 0;
explosion_life = asteroid_create_explosion(asteroid_obj);
explosion_life = asteroid_create_explosion(pasteroid_obj);
asteriod_explode_sound(asteroid_obj, asp->asteroid_type, play_loud_collision);
asteroid_do_area_effect(asteroid_obj);
asteriod_explode_sound(pasteroid_obj, asp->asteroid_type, play_loud_collision);
asteroid_do_area_effect(pasteroid_obj);
asp->final_death_time = timestamp( fl2i(explosion_life*1000.0f)/5 ); // Wait till 30% of vclip time before breaking the asteroid up.
if ( hitpos ) {
asp->death_hit_pos = *hitpos;
} else {
asp->death_hit_pos = asteroid_obj->pos;
asp->death_hit_pos = pasteroid_obj->pos;
// randomize hit pos a bit, otherwise we will get a NULL vector when trying to find direction to toss child asteroids
vec3d rand_vec;
vm_vec_rand_vec_quick(&rand_vec);
@@ -1375,14 +1402,14 @@ void asteroid_hit( object * asteroid_obj, object * other_obj, vec3d * hitpos, fl
weapon_info *wip;
wip = &Weapon_info[Weapons[other_obj->instance].weapon_info_index];
// If the weapon didn't play any impact animation, play custom asteroid impact animation
if ( wip->impact_weapon_expl_index < 0 ) {
particle_create( hitpos, &vmd_zero_vector, 0.0f, Asteroid_impact_explosion_radius, PARTICLE_BITMAP, Asteroid_impact_explosion_ani );
if ( wip->impact_weapon_expl_effect < 0 ) {
particle::create( hitpos, &vmd_zero_vector, 0.0f, Asteroid_impact_explosion_radius, particle::PARTICLE_BITMAP, Asteroid_impact_explosion_ani );
}
}
}
// evaluate any relevant player scoring implications
scoring_eval_hit(asteroid_obj,other_obj);
scoring_eval_hit(pasteroid_obj,other_obj);
}
/**
@@ -1396,30 +1423,15 @@ void asteroid_level_close()
if (Asteroids[i].flags & AF_USED) {
Asteroids[i].flags &= ~AF_USED;
Assert(Asteroids[i].objnum >=0 && Asteroids[i].objnum < MAX_OBJECTS);
Objects[Asteroids[i].objnum].flags |= OF_SHOULD_BE_DEAD;
Objects[Asteroids[i].objnum].flags.set(Object::Object_Flags::Should_be_dead);
}
}
Asteroid_field.num_initial_asteroids=0;
}
DCF(asteroids,"Turns asteroids on/off")
{
if ( Dc_command ) {
dc_get_arg(ARG_TRUE|ARG_FALSE|ARG_NONE);
if ( Dc_arg_type & ARG_TRUE )
Asteroids_enabled = 1;
else if ( Dc_arg_type & ARG_FALSE )
Asteroids_enabled = 0;
else if ( Dc_arg_type & ARG_NONE )
Asteroids_enabled ^= 1;
}
if ( Dc_help )
dc_printf( "Usage: asteroids [bool]\nTurns asteroid system on/off. If nothing passed, then toggles it.\n" );
if ( Dc_status )
dc_printf( "asteroids are %s\n", (Asteroids_enabled?"ON":"OFF") );
}
DCF_BOOL2(asteroids, Asteroids_enabled, "enables or disables asteroids", "Usage: asteroids [bool]\nTurns asteroid system on/off. If nothing passed, then toggles it.\n");
void hud_target_asteroid()
{
@@ -1462,21 +1474,21 @@ int asteroid_count()
* See if asteroid should split up.
* We delay splitting up to allow the explosion animation to play for a bit.
*/
void asteroid_maybe_break_up(object *asteroid_obj)
void asteroid_maybe_break_up(object *pasteroid_obj)
{
asteroid *asp;
asteroid_info *asip;
asp = &Asteroids[asteroid_obj->instance];
asp = &Asteroids[pasteroid_obj->instance];
asip = &Asteroid_info[asp->asteroid_type];
if ( timestamp_elapsed(asp->final_death_time) ) {
vec3d relvec, vfh, tvec;
Script_system.SetHookObject("Self", asteroid_obj);
if(!Script_system.IsConditionOverride(CHA_DEATH, asteroid_obj))
Script_system.SetHookObject("Self", pasteroid_obj);
if(!Script_system.IsConditionOverride(CHA_DEATH, pasteroid_obj))
{
asteroid_obj->flags |= OF_SHOULD_BE_DEAD;
pasteroid_obj->flags.set(Object::Object_Flags::Should_be_dead);
// multiplayer clients won't go through the following code. asteroid_sub_create will send
// a create packet to the client in the above named function
@@ -1487,29 +1499,29 @@ void asteroid_maybe_break_up(object *asteroid_obj)
case ASTEROID_TYPE_SMALL:
break;
case ASTEROID_TYPE_MEDIUM:
asc_get_relvec(&relvec, asteroid_obj, &asp->death_hit_pos);
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &relvec);
asc_get_relvec(&relvec, pasteroid_obj, &asp->death_hit_pos);
asteroid_sub_create(pasteroid_obj, ASTEROID_TYPE_SMALL, &relvec);
vm_vec_normalized_dir(&vfh, &asteroid_obj->pos, &asp->death_hit_pos);
vm_vec_normalized_dir(&vfh, &pasteroid_obj->pos, &asp->death_hit_pos);
vm_vec_copy_scale(&tvec, &vfh, 2.0f);
vm_vec_sub2(&tvec, &relvec);
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &tvec);
asteroid_sub_create(pasteroid_obj, ASTEROID_TYPE_SMALL, &tvec);
break;
case ASTEROID_TYPE_LARGE:
asc_get_relvec(&relvec, asteroid_obj, &asp->death_hit_pos);
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_MEDIUM, &relvec);
asc_get_relvec(&relvec, pasteroid_obj, &asp->death_hit_pos);
asteroid_sub_create(pasteroid_obj, ASTEROID_TYPE_MEDIUM, &relvec);
vm_vec_normalized_dir(&vfh, &asteroid_obj->pos, &asp->death_hit_pos);
vm_vec_normalized_dir(&vfh, &pasteroid_obj->pos, &asp->death_hit_pos);
vm_vec_copy_scale(&tvec, &vfh, 2.0f);
vm_vec_sub2(&tvec, &relvec);
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_MEDIUM, &tvec);
asteroid_sub_create(pasteroid_obj, ASTEROID_TYPE_MEDIUM, &tvec);
while (frand() > 0.6f) {
vec3d rvec, tvec2;
vm_vec_rand_vec_quick(&rvec);
vm_vec_scale_add(&tvec2, &vfh, &rvec, 0.75f);
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &tvec2);
asteroid_sub_create(pasteroid_obj, ASTEROID_TYPE_SMALL, &tvec2);
}
break;
@@ -1533,8 +1545,8 @@ void asteroid_maybe_break_up(object *asteroid_obj)
random_shuffle(roids_to_create.begin(), roids_to_create.end());
int total_roids = roids_to_create.size();
for (int i = 0; i < total_roids; i++) {
size_t total_roids = roids_to_create.size();
for (size_t i = 0; i < total_roids; i++) {
vec3d dir_vec,final_vec;
vec3d parent_vel,hit_rel_vec;
@@ -1549,8 +1561,8 @@ void asteroid_maybe_break_up(object *asteroid_obj)
float r = sqrt(1.0f - y*y);
float phi = i * inc;
dir_vec.xyz.x = cos(phi)*r;
dir_vec.xyz.y = sin(phi)*r;
dir_vec.xyz.x = cosf(phi)*r;
dir_vec.xyz.y = sinf(phi)*r;
dir_vec.xyz.z = y;
// Randomize the direction a bit
@@ -1558,24 +1570,24 @@ void asteroid_maybe_break_up(object *asteroid_obj)
vm_vec_random_cone(&dir_vec, &tempv, (360.0f / total_roids / 2));
// Make the roid inherit half of the parent's velocity
vm_vec_copy_normalize(&parent_vel, &asteroid_obj->phys_info.vel);
vm_vec_copy_normalize(&parent_vel, &pasteroid_obj->phys_info.vel);
vm_vec_scale(&parent_vel, 0.5f);
// Make the hit position affect the direction, but only a little
vm_vec_sub(&hit_rel_vec, &asteroid_obj->pos, &asp->death_hit_pos);
vm_vec_sub(&hit_rel_vec, &pasteroid_obj->pos, &asp->death_hit_pos);
vm_vec_normalize(&hit_rel_vec);
vm_vec_scale(&hit_rel_vec, 0.25f);
vm_vec_avg3(&final_vec, &parent_vel, &hit_rel_vec, &dir_vec);
vm_vec_normalize(&final_vec);
asteroid_sub_create(asteroid_obj, roids_to_create[i], &final_vec);
asteroid_sub_create(pasteroid_obj, roids_to_create[i], &final_vec);
}
}
}
asp->final_death_time = timestamp(-1);
}
Script_system.RunCondition(CHA_DEATH, '\0', NULL, asteroid_obj);
Script_system.RunCondition(CHA_DEATH, '\0', NULL, pasteroid_obj);
Script_system.RemHookVar("Self");
}
}
@@ -1599,36 +1611,36 @@ int asteroid_get_random_in_cone(vec3d *pos, vec3d *dir, float ang, int danger)
return -1;
}
void asteroid_test_collide(object *asteroid_obj, object *ship_obj, mc_info *mc, bool lazy = false)
void asteroid_test_collide(object *pasteroid_obj, object *pship_obj, mc_info *mc, bool lazy = false)
{
float asteroid_ray_dist;
vec3d asteroid_fvec, terminus;
// See if ray from asteroid intersects bounding box of escort ship
asteroid_ray_dist = vm_vec_mag_quick(&asteroid_obj->phys_info.desired_vel) * ASTEROID_MIN_COLLIDE_TIME;
asteroid_fvec = asteroid_obj->phys_info.desired_vel;
asteroid_ray_dist = vm_vec_mag_quick(&pasteroid_obj->phys_info.desired_vel) * ASTEROID_MIN_COLLIDE_TIME;
asteroid_fvec = pasteroid_obj->phys_info.desired_vel;
if(IS_VEC_NULL_SQ_SAFE(&asteroid_fvec)){
terminus = asteroid_obj->pos;
terminus = pasteroid_obj->pos;
} else {
vm_vec_normalize(&asteroid_fvec);
vm_vec_scale_add(&terminus, &asteroid_obj->pos, &asteroid_fvec, asteroid_ray_dist);
vm_vec_scale_add(&terminus, &pasteroid_obj->pos, &asteroid_fvec, asteroid_ray_dist);
}
Assert(ship_obj->type == OBJ_SHIP);
Assert(pship_obj->type == OBJ_SHIP);
mc->model_instance_num = Ships[ship_obj->instance].model_instance_num;
mc->model_num = Ship_info[Ships[ship_obj->instance].ship_info_index].model_num; // Fill in the model to check
mc->orient = &ship_obj->orient; // The object's orientation
mc->pos = &ship_obj->pos; // The object's position
mc->p0 = &asteroid_obj->pos; // Point 1 of ray to check
mc->model_instance_num = Ships[pship_obj->instance].model_instance_num;
mc->model_num = Ship_info[Ships[pship_obj->instance].ship_info_index].model_num; // Fill in the model to check
mc->orient = &pship_obj->orient; // The object's orientation
mc->pos = &pship_obj->pos; // The object's position
mc->p0 = &pasteroid_obj->pos; // Point 1 of ray to check
mc->p1 = &terminus; // Point 2 of ray to check
if (lazy) {
mc->flags = MC_CHECK_MODEL | MC_ONLY_BOUND_BOX;
} else {
mc->flags = MC_CHECK_MODEL | MC_CHECK_SPHERELINE;
}
mc->radius = asteroid_obj->radius;
mc->radius = pasteroid_obj->radius;
model_collide(mc);
@@ -1636,13 +1648,17 @@ void asteroid_test_collide(object *asteroid_obj, object *ship_obj, mc_info *mc,
mc->p1 = NULL;
}
// Return !0 is the asteroid will collide with the escort ship within ASTEROID_MIN_COLLIDE_TIME
// seconds
int asteroid_will_collide(object *asteroid_obj, object *escort_objp)
/**
* Test if asteroid will collide with escort ship within ASTEROID_MIN_COLLIDE_TIME seconds
*
* @return !0 if the asteroid will collide with the escort
*/
int asteroid_will_collide(object *pasteroid_obj, object *escort_objp)
{
mc_info mc;
mc_info_init(&mc);
asteroid_test_collide(asteroid_obj, escort_objp, &mc);
asteroid_test_collide(pasteroid_obj, escort_objp, &mc);
if ( !mc.num_hits ) {
return 0;
@@ -1657,11 +1673,11 @@ int asteroid_will_collide(object *asteroid_obj, object *escort_objp)
*/
int asteroid_valid_ship_to_warn_collide(ship *shipp)
{
if ( !(Ship_info[shipp->ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP)) ) {
if ( !(Ship_info[shipp->ship_info_index].is_big_or_huge()) ) {
return 0;
}
if ( shipp->flags & (SF_DYING|SF_DEPART_WARP) ) {
if ( shipp->flags[Ship::Ship_Flags::Dying] || shipp->flags[Ship::Ship_Flags::Depart_warp] ) {
return 0;
}
@@ -1726,7 +1742,7 @@ void asteroid_verify_collide_objnum(asteroid *asp)
}
}
void asteroid_process_post(object * obj, float frame_time)
void asteroid_process_post(object * obj)
{
if (Asteroids_enabled) {
int num;
@@ -1771,6 +1787,7 @@ float asteroid_time_to_impact(object *asteroid_objp)
float time=-1.0f, total_dist, speed;
asteroid *asp;
mc_info mc;
mc_info_init(&mc);
asp = &Asteroids[asteroid_objp->instance];
@@ -1898,151 +1915,149 @@ that is being protected.
void asteroid_parse_tbl()
{
char impact_ani_file[MAX_FILENAME_LEN];
int rval;
// How did we get here without having any species defined?
Assertion(Species_info.size() > 0,
"Cannot parse asteroids/debris if there "
"are no species for them to belong to."
);
try
{
read_file_text("asteroid.tbl", CF_TYPE_TABLES);
reset_parse();
// open localization
lcl_ext_open();
required_string("#Asteroid Types");
if ((rval = setjmp(parse_abort)) != 0) {
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", "asteroid.tbl", rval));
lcl_ext_close();
size_t tally = 0;
size_t max_asteroids =
NUM_DEBRIS_SIZES + Species_info.size() * NUM_DEBRIS_SIZES;
#ifndef NDEBUG
SCP_vector<SCP_string> parsed_asteroids;
#endif
// parse and tally each asteroid
while (required_string_either("#End", "$Name:"))
{
asteroid_info new_asteroid;
asteroid_parse_section(&new_asteroid);
size_t species = tally / NUM_DEBRIS_SIZES;
if (tally >= max_asteroids)
{
#ifdef NDEBUG
// Bump the warning count in release so they get something
// even if the message never gets displayed.
Warning(LOCATION, "Ignoring extra asteroid/debris");
#else
SCP_string msg("Ignoring extra asteroid/debris '");
msg.append(new_asteroid.name);
msg.append("'\n");
Warning(LOCATION, "%s", msg.c_str());
parsed_asteroids.push_back(msg);
#endif
}
else
{
#ifndef NDEBUG
SCP_string msg;
msg.append("Parsing asteroid: '");
msg.append(new_asteroid.name);
msg.append("' as a '");
msg.append((species == 0) ? "generic" : Species_info[species - 1].species_name);
msg.append("'");
switch (tally % NUM_DEBRIS_SIZES) {
case ASTEROID_TYPE_SMALL:
msg.append(" small\n");
break;
case ASTEROID_TYPE_MEDIUM:
msg.append(" medium\n");
break;
case ASTEROID_TYPE_LARGE:
msg.append(" large\n");
break;
default:
Error(LOCATION, "Get a coder! Math has broken!\n"
"Important numbers:\n"
"\ttally: " SIZE_T_ARG "\n"
"\tNUM_DEBRIS_SIZES: %d\n",
tally, NUM_DEBRIS_SIZES
);
msg.append(" unknown\n");
}
parsed_asteroids.push_back(msg);
#endif
Asteroid_info.push_back(new_asteroid);
}
tally++;
}
required_string("#End");
if (tally != max_asteroids)
{
#ifndef NDEBUG
for (SCP_vector<SCP_string>::iterator iter = parsed_asteroids.begin();
iter != parsed_asteroids.end(); ++iter)
{
mprintf(("Asteroid.tbl as parsed:\n"));
mprintf(("%s", iter->c_str()));
}
#endif
Error(LOCATION,
"Found " SIZE_T_ARG " asteroids/debris when " SIZE_T_ARG " expected\n\n"
"<Number expected> = <Number of species> * %d + %d generic asteroids\n"
SIZE_T_ARG " = " SIZE_T_ARG "*%d + %d\n\n"
#ifdef NDEBUG
"Run a debug build to see a list of all parsed asteroids\n",
#else
"See the debug.log for a listing of all parsed asteroids\n",
#endif
tally, max_asteroids,
NUM_DEBRIS_SIZES, NUM_DEBRIS_SIZES,
max_asteroids, Species_info.size(), NUM_DEBRIS_SIZES, NUM_DEBRIS_SIZES
);
}
Asteroid_impact_explosion_ani = -1;
required_string("$Impact Explosion:");
stuff_string(impact_ani_file, F_NAME, MAX_FILENAME_LEN);
if (VALID_FNAME(impact_ani_file)) {
int num_frames;
Asteroid_impact_explosion_ani = bm_load_animation(impact_ani_file, &num_frames, nullptr, nullptr, nullptr, true);
}
required_string("$Impact Explosion Radius:");
stuff_float(&Asteroid_impact_explosion_radius);
if (optional_string("$Briefing Icon Closeup Model:")) {
stuff_string(Asteroid_icon_closeup_model, F_NAME, NAME_LENGTH);
}
else {
strcpy_s(Asteroid_icon_closeup_model, Asteroid_info[ASTEROID_TYPE_LARGE].pof_files[0]); // magic file from retail
}
if (optional_string("$Briefing Icon Closeup Position:")) {
stuff_vec3d(&Asteroid_icon_closeup_position);
}
else {
vm_vec_make(&Asteroid_icon_closeup_position, 0.0f, 0.0f, -334.0f); // magic numbers from retail
}
if (optional_string("$Briefing Icon Closeup Zoom:")) {
stuff_float(&Asteroid_icon_closeup_zoom);
}
else {
Asteroid_icon_closeup_zoom = 0.5f; // magic number from retail
}
}
catch (const parse::ParseException& e)
{
mprintf(("TABLES: Unable to parse '%s'! Error message = %s.\n", "asteroid.tbl", e.what()));
return;
}
read_file_text("asteroid.tbl", CF_TYPE_TABLES);
reset_parse();
required_string("#Asteroid Types");
int tally = 0;
int max_asteroids =
NUM_DEBRIS_SIZES + Species_info.size() * NUM_DEBRIS_SIZES;
#ifndef NDEBUG
SCP_vector<SCP_string> parsed_asteroids;
#endif
// parse and tally each asteroid
while (required_string_either("#End","$Name:"))
{
asteroid_info new_asteroid;
asteroid_parse_section( &new_asteroid );
int species = tally / NUM_DEBRIS_SIZES;
if (tally >= max_asteroids)
{
#ifdef NDEBUG
// Bump the warning count in release so they get something
// even if the message never gets displayed.
Warning(LOCATION, "Ignoring extra asteroid/debris");
#else
SCP_string msg("Ignoring extra asteroid/debris '");
msg.append(new_asteroid.name);
msg.append("'\n");
Warning(LOCATION,msg.c_str());
parsed_asteroids.push_back(msg);
#endif
}
else
{
#ifndef NDEBUG
SCP_string msg;
msg.append("Parsing asteroid: '");
msg.append(new_asteroid.name);
msg.append("' as a '");
msg.append((species == 0)?"generic":Species_info[species-1].species_name);
msg.append("'");
switch(tally % NUM_DEBRIS_SIZES) {
case ASTEROID_TYPE_SMALL:
msg.append(" small\n");
break;
case ASTEROID_TYPE_MEDIUM:
msg.append(" medium\n");
break;
case ASTEROID_TYPE_LARGE:
msg.append(" large\n");
break;
default:
Error(LOCATION, "Get a coder! Math has broken!\n"
"Important numbers:\n"
"\ttally: %d\n"
"\tNUM_DEBRIS_SIZES: %d\n",
tally, NUM_DEBRIS_SIZES
);
msg.append(" unknown\n");
}
parsed_asteroids.push_back(msg);
#endif
Asteroid_info.push_back(new_asteroid);
}
tally++;
}
required_string("#End");
if (tally != max_asteroids)
{
#ifndef NDEBUG
for(SCP_vector<SCP_string>::iterator iter = parsed_asteroids.begin();
iter != parsed_asteroids.end(); ++iter)
{
mprintf(("Asteroid.tbl as parsed:\n"));
mprintf((iter->c_str()));
}
#endif
Error(LOCATION,
"Found %d asteroids/debris when %d expected\n\n"
"<Number expected> = <Number of species> * %d + %d generic asteroids\n"
"%d = %d*%d + %d\n\n"
#ifdef NDEBUG
"Run a debug build to see a list of all parsed asteroids\n",
#else
"See the debug.log for a listing of all parsed asteroids\n",
#endif
tally, max_asteroids,
NUM_DEBRIS_SIZES, NUM_DEBRIS_SIZES,
max_asteroids, Species_info.size(), NUM_DEBRIS_SIZES, NUM_DEBRIS_SIZES
);
}
Asteroid_impact_explosion_ani = -1;
required_string("$Impact Explosion:");
stuff_string(impact_ani_file, F_NAME, MAX_FILENAME_LEN);
if ( VALID_FNAME(impact_ani_file) ) {
int num_frames;
Asteroid_impact_explosion_ani = bm_load_animation( impact_ani_file, &num_frames, NULL, NULL, 1);
}
required_string("$Impact Explosion Radius:");
stuff_float(&Asteroid_impact_explosion_radius);
if (optional_string("$Briefing Icon Closeup Model:")) {
stuff_string(Asteroid_icon_closeup_model, F_NAME, NAME_LENGTH);
} else {
strcpy_s(Asteroid_icon_closeup_model, Asteroid_info[ASTEROID_TYPE_LARGE].pof_files[0]); // magic file from retail
}
if (optional_string("$Briefing Icon Closeup Position:")) {
stuff_vec3d(&Asteroid_icon_closeup_position);
} else {
vm_vec_make(&Asteroid_icon_closeup_position, 0.0f, 0.0f, -334.0f); // magic numbers from retail
}
if (optional_string("$Briefing Icon Closeup Zoom:")) {
stuff_float(&Asteroid_icon_closeup_zoom);
} else {
Asteroid_icon_closeup_zoom = 0.5f; // magic number from retail
}
// close localization
lcl_ext_close();
}
/**
@@ -2084,7 +2099,7 @@ int set_asteroid_throw_objnum()
ship_objp = &Objects[so->objnum];
float radius = ship_objp->radius*2.0f;
if (Ship_info[Ships[ship_objp->instance].ship_info_index].flags & (SIF_HUGE_SHIP | SIF_BIG_SHIP)) {
if (Ship_info[Ships[ship_objp->instance].ship_info_index].is_big_or_huge()) {
if (ship_objp->pos.xyz.x + radius > Asteroid_field.min_bound.xyz.x)
if (ship_objp->pos.xyz.y + radius > Asteroid_field.min_bound.xyz.y)
if (ship_objp->pos.xyz.z + radius > Asteroid_field.min_bound.xyz.z)
+20 -12
View File
@@ -12,13 +12,14 @@
#ifndef __ASTEROID_H__
#define __ASTEROID_H__
#include "globalincs/pstypes.h"
#include "globalincs/globals.h" // for NAME_LENGTH
#include "globalincs/pstypes.h"
struct object;
struct polymodel;
class object;
class polymodel;
struct collision_info_struct;
class draw_list;
#define MAX_ASTEROIDS 512
@@ -52,7 +53,8 @@ typedef struct asteroid_split_info {
int max;
} asteroid_split_info;
class asteroid_info {
class asteroid_info
{
public:
char name[NAME_LENGTH]; // name for the asteroid
char pof_files[NUM_DEBRIS_POFS][MAX_FILENAME_LEN]; // POF files to load/associate with ship
@@ -79,10 +81,14 @@ public:
fireball_radius_multiplier( -1 )
{
name[ 0 ] = 0;
memset( pof_files, 0, sizeof( pof_files ) );
memset( detail_distance, 0, sizeof( detail_distance ) );
memset( modelp, 0, sizeof( modelp ) );
memset( model_num, -1, sizeof( model_num ) );
for (int i = 0; i < NUM_DEBRIS_POFS; i++)
{
modelp[i] = NULL;
model_num[i] = -1;
pof_files[i][0] = 0;
}
}
};
@@ -92,6 +98,7 @@ public:
typedef struct asteroid {
int flags;
int objnum;
int model_instance_num;
int asteroid_type; // 0..MAX_DEBRIS_TYPES
int asteroid_subtype; // Index in asteroid_info for modelnum and modelp
int check_for_wrap; // timestamp to check for asteroid wrapping around field
@@ -119,6 +126,7 @@ typedef enum {
typedef struct asteroid_field {
vec3d min_bound; // Minimum range of field.
vec3d max_bound; // Maximum range of field.
float bound_rad;
int has_inner_bound;
vec3d inner_min_bound;
vec3d inner_max_bound;
@@ -144,12 +152,12 @@ void asteroid_init();
void asteroid_level_init();
void asteroid_level_close();
void asteroid_create_all();
void asteroid_render( object *asteroid_objp );
void asteroid_render(object * obj, draw_list *scene);
void asteroid_delete( object *asteroid_objp );
void asteroid_process_pre( object *asteroid_objp, float frame_time);
void asteroid_process_post( object *asteroid_objp, float frame_time);
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vec3d * hitpos, collision_info_struct *asteroid_hit_info=NULL );
void asteroid_hit( object *asteroid_objp, object *other_objp, vec3d *hitpos, float damage );
void asteroid_process_pre( object *asteroid_objp );
void asteroid_process_post( object *asteroid_objp);
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vec3d * hitpos, collision_info_struct *asteroid_hit_info=NULL, vec3d* hitnormal=NULL );
void asteroid_hit( object *pasteroid_objp, object *other_objp, vec3d *hitpos, float damage );
int asteroid_count();
int asteroid_collide_objnum(object *asteroid_objp);
float asteroid_time_to_impact(object *asteroid_objp);
+157 -155
View File
@@ -5,28 +5,28 @@
#include "autopilot/autopilot.h"
#include "ai/ai.h"
#include "ai/aigoals.h"
#include "ship/ship.h"
#include "object/object.h"
#include "object/objcollide.h"
#include "object/waypoint.h"
#include "parse/sexp.h"
#include "freespace2/freespace.h"
#include "asteroid/asteroid.h"
#include "autopilot/autopilot.h"
#include "camera/camera.h"
#include "cfile/cfile.h"
#include "freespace.h"
#include "gamesnd/eventmusic.h"
#include "def_files/def_files.h"
#include "globalincs/linklist.h"
#include "iff_defs/iff_defs.h"
#include "sound/audiostr.h"
#include "mission/missiontraining.h"
#include "mission/missionmessage.h"
#include "io/timer.h"
#include "gamesnd/eventmusic.h"
#include "cfile/cfile.h"
#include "parse/parselo.h"
#include "globalincs/def_files.h"
#include "localization/localize.h"
#include "camera/camera.h"
#include "asteroid/asteroid.h"
#include "mission/missionmessage.h"
#include "mission/missiontraining.h"
#include "object/objcollide.h"
#include "object/waypoint.h"
#include "parse/parselo.h"
#include "parse/sexp.h"
#include "ship/ship.h"
#include "sound/audiostr.h"
#include <map>
// Extern functions/variables
@@ -178,7 +178,7 @@ bool CanAutopilot(vec3d targetPos, bool send_msg)
object *other_objp = &Objects[so->objnum];
// attacks player?
if (iff_x_attacks_y(obj_team(other_objp), obj_team(Player_obj))
&& !(Ship_info[Ships[other_objp->instance].ship_info_index].flags & SIF_CARGO)) // ignore cargo
&& !(Ship_info[Ships[other_objp->instance].ship_info_index].flags[Ship::Info_Flags::Cargo])) // ignore cargo
{
// Cannot autopilot if enemy within AutopilotMinEnemyDistance meters
if (vm_vec_dist_quick(&targetPos, &other_objp->pos) < AutopilotMinEnemyDistance) {
@@ -209,7 +209,7 @@ bool CanAutopilot(vec3d targetPos, bool send_msg)
// check for support ships
// cannot autopilot if support ship present
if ( ship_find_repair_ship(Player_obj) != NULL ) {
if ( ship_find_repair_ship(Player_obj) != 0 ) {
if (send_msg)
send_autopilot_msgID(NP_MSG_FAIL_SUPPORT_PRESENT);
return false;
@@ -231,32 +231,43 @@ bool StartAutopilot()
{
// Check for support ship and dismiss it if it is not doing anything.
// If the support ship is doing something then tell the user such.
bool done = false;
while (!done) {
object* support_ship_op = ship_find_repair_ship(Player_obj);
if ( support_ship_op == NULL ) {
// no more
done = true;
break;
for ( object *objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) )
{
if ((objp->type == OBJ_SHIP) && !(objp->flags[Object::Object_Flags::Should_be_dead]))
{
Assertion((objp->instance >= 0) && (objp->instance < MAX_SHIPS),
"objp does not have a valid pointer to a ship. Pointer is %d, which is smaller than 0 or bigger than %d",
objp->instance, MAX_SHIPS);
ship *shipp = &Ships[objp->instance];
if (shipp->team != Player_ship->team)
continue;
Assertion((shipp->ship_info_index >= 0) && (shipp->ship_info_index < static_cast<int>(Ship_info.size())),
"Ship '%s' does not have a valid pointer to a ship class. Pointer is %d, which is smaller than 0 or bigger than %d",
shipp->ship_name, shipp->ship_info_index, static_cast<int>(Ship_info.size()));
ship_info *sip = &Ship_info[shipp->ship_info_index];
if ( !(sip->flags[Ship::Info_Flags::Support]) )
continue;
// don't deal with dying or departing support ships
if ( shipp->is_dying_or_departing() )
continue;
Assert(shipp->ai_index != -1);
ai_info* support_ship_aip = &(Ai_info[Ships[objp->instance].ai_index]);
// is support ship trying to rearm-repair
if ( ai_find_goal_index( support_ship_aip->goals, AI_GOAL_REARM_REPAIR ) == -1 ) {
// no, so tell it to depart
ai_add_ship_goal_player( AIG_TYPE_PLAYER_SHIP, AI_GOAL_WARP, -1, NULL, support_ship_aip );
} else {
// yes
send_autopilot_msgID(NP_MSG_FAIL_SUPPORT_WORKING);
return false;
}
}
Assert( support_ship_op->type == OBJ_SHIP );
Assert( support_ship_op->instance >= 0 );
Assert( support_ship_op->instance < MAX_SHIPS );
Assert( Ships[support_ship_op->instance].ai_index != -1 );
ai_info* support_ship_aip = &(Ai_info[Ships[support_ship_op->instance].ai_index]);
// is support ship trying to rearm-repair
if ( ai_find_goal_index( support_ship_aip->goals, AI_GOAL_REARM_REPAIR ) == -1 ) {
// no, so tell it to depart
ai_add_ship_goal_player( AIG_TYPE_PLAYER_SHIP, AI_GOAL_WARP, -1, NULL, support_ship_aip );
} else {
// yes
send_autopilot_msgID(NP_MSG_FAIL_SUPPORT_WORKING);
return false;
}
}
if (!CanAutopilot())
return false;
@@ -275,7 +286,7 @@ bool StartAutopilot()
Autopilot_flight_leader = Player_obj;
}
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
if (The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics])
LockAPConv = timestamp(); // lock convergence instantly
else
LockAPConv = timestamp(3000); // 3 seconds before we lock convergence
@@ -314,7 +325,7 @@ bool StartAutopilot()
// instantly turn player toward tpos
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
if (The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics])
{
vm_vec_sub(&norm1, Navs[CurrentNav].GetPosition(), &Player_obj->pos);
vm_vector_2_matrix(&Player_obj->orient, &norm1, NULL, NULL);
@@ -323,7 +334,7 @@ bool StartAutopilot()
for (i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1 &&
(Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
(Ships[i].flags[Ship::Ship_Flags::Navpoint_carry] ||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)
)
)
@@ -334,7 +345,7 @@ bool StartAutopilot()
}
// damp speed_cap to 90% of actual -- to make sure ships stay in formation
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
if (The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics])
speed_cap = 0.90f * speed_cap;
if ( speed_cap < 1.0f ) {
@@ -356,28 +367,27 @@ bool StartAutopilot()
for (i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1 &&
(Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
(Ships[i].flags[Ship::Ship_Flags::Navpoint_carry] ||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)
)
)
{
// do we have capital ships in the area?
if (Ship_info[Ships[i].ship_info_index].flags
& ( SIF_CRUISER | SIF_CAPITAL | SIF_SUPERCAP | SIF_CORVETTE | SIF_AWACS | SIF_GAS_MINER | SIF_FREIGHTER | SIF_TRANSPORT))
if (Ship_info[Ships[i].ship_info_index].is_big_ship() || Ship_info[Ships[i].ship_info_index].flags[Ship::Info_Flags::Capital] || Ship_info[Ships[i].ship_info_index].flags[Ship::Info_Flags::Supercap])
{
capshipPresent = true;
capIndexes.push_back(i);
// ok.. what size class
if (Ship_info[Ships[i].ship_info_index].flags & (SIF_CAPITAL | SIF_SUPERCAP))
{
capship_counts[0]++;
if (capship_spreads[0] < Objects[Ships[i].objnum].radius)
capship_spreads[0] = Objects[Ships[i].objnum].radius;
}
else if (Ship_info[Ships[i].ship_info_index].flags & (SIF_CORVETTE))
{
if (Ship_info[Ships[i].ship_info_index].flags[Ship::Info_Flags::Capital] || Ship_info[Ships[i].ship_info_index].flags[Ship::Info_Flags::Supercap])
{
capship_counts[0]++;
if (capship_spreads[0] < Objects[Ships[i].objnum].radius)
capship_spreads[0] = Objects[Ships[i].objnum].radius;
}
else if (Ship_info[Ships[i].ship_info_index].flags[Ship::Info_Flags::Corvette])
{
capship_counts[1]++;
if (capship_spreads[1] < Objects[Ships[i].objnum].radius)
capship_spreads[1] = Objects[Ships[i].objnum].radius;
@@ -405,14 +415,14 @@ bool StartAutopilot()
radius = Objects[Ships[i].objnum].radius;
}
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
if (The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics])
{// instantly turn the ship to match the direction player is looking
//vm_vec_sub(&norm1, Navs[CurrentNav].GetPosition(), &Player_obj->pos);
vm_vector_2_matrix(&Objects[Ships[i].objnum].orient, &norm1, NULL, NULL);
}
// snap wings into formation
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS && // only if using cinematics
if (The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics] && // only if using cinematics
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY) // only if in a wing
&& Autopilot_flight_leader != &Objects[Ships[i].objnum]) //only if not flight leader's object
{
@@ -459,8 +469,10 @@ bool StartAutopilot()
}
}
// lock primary and secondary weapons
if ( LockWeaponsDuringAutopilot )
Ships[i].flags2 |= (SF2_PRIMARIES_LOCKED | SF2_SECONDARIES_LOCKED);
if (LockWeaponsDuringAutopilot) {
Ships[i].flags.set(Ship::Ship_Flags::Primaries_locked);
Ships[i].flags.set(Ship::Ship_Flags::Secondaries_locked);
}
// clear the ship goals and cap the waypoint speed
ai_clear_ship_goals(&Ai_info[Ships[i].ai_index]);
@@ -468,7 +480,7 @@ bool StartAutopilot()
// if they're not part of a wing set their goal
if (Ships[i].wingnum == -1 || The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
if (Ships[i].wingnum == -1 || The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics])
{
if (Navs[CurrentNav].flags & NP_WAYPOINT)
{
@@ -485,7 +497,7 @@ bool StartAutopilot()
}
// assign wing goals
if (!(The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS))
if (!(The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics]))
{
for (i = 0; i < MAX_WINGS; i++)
{
@@ -527,7 +539,7 @@ bool StartAutopilot()
{
if (Ships[i].objnum != -1)
{
if (Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
if (Ships[i].flags[Ship::Ship_Flags::Navpoint_carry] ||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY))
for (j = 0; j < MAX_AI_GOALS; j++)
{
@@ -546,7 +558,7 @@ bool StartAutopilot()
start_dist = DistanceTo(CurrentNav);
// ----------------------------- setup cinematic -----------------------------
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
if (The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics])
{
if (capshipPresent)
{
@@ -559,7 +571,7 @@ bool StartAutopilot()
vm_vec_add(&front, &Autopilot_flight_leader->orient.vec.fvec, &zero);
vm_vec_add(&up, &Autopilot_flight_leader->orient.vec.uvec, &zero);
vm_vec_add(&offset, &zero, &zero);
if (Ship_info[Ships[*idx].ship_info_index].flags & (SIF_CAPITAL | SIF_SUPERCAP))
if (Ship_info[Ships[*idx].ship_info_index].flags[Ship::Info_Flags::Capital] || Ship_info[Ships[*idx].ship_info_index].flags[Ship::Info_Flags::Supercap])
{
//0 - below - three lines of position
@@ -593,7 +605,7 @@ bool StartAutopilot()
capship_placed[0]++;
}
else if (Ship_info[Ships[*idx].ship_info_index].flags & SIF_CORVETTE)
else if (Ship_info[Ships[*idx].ship_info_index].flags[Ship::Info_Flags::Corvette])
{
//1 above - 3 lines of position
// front/back to zero
@@ -902,14 +914,16 @@ void EndAutoPilot()
{
if (Ships[i].objnum != -1 &&
(
Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
Ships[i].flags[Ship::Ship_Flags::Navpoint_carry] ||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY )
)
)
{
//unlock their weaponry
if ( LockWeaponsDuringAutopilot )
Ships[i].flags2 &= ~(SF2_PRIMARIES_LOCKED | SF2_SECONDARIES_LOCKED);
if (LockWeaponsDuringAutopilot) {
Ships[i].flags.remove(Ship::Ship_Flags::Primaries_locked);
Ships[i].flags.remove(Ship::Ship_Flags::Secondaries_locked);
}
Ai_info[Ships[i].ai_index].waypoint_speed_cap = -1; // uncap their speed
Ai_info[Ships[i].ai_index].mode = AIM_NONE; // make AI re-evaluate current ship mode
@@ -944,7 +958,7 @@ void EndAutoPilot()
}
// un-assign wing goals
if ( !(The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS) )
if ( !(The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics]) )
{
for (i = 0; i < MAX_WINGS; i++)
{
@@ -1030,7 +1044,7 @@ void nav_warp(bool prewarp=false)
for (int i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1
&& (Ships[i].flags2 & SF2_NAVPOINT_CARRY
&& (Ships[i].flags[Ship::Ship_Flags::Navpoint_carry]
|| (Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)))
{
vm_vec_add(&Objects[Ships[i].objnum].pos, &Objects[Ships[i].objnum].pos, &targetPos);
@@ -1058,7 +1072,7 @@ void NavSystem_Do()
{
if (AutoPilotEngaged)
{
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
if (The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics])
{
camera *cam = nav_get_set_camera();
if (CinematicStarted)
@@ -1137,7 +1151,7 @@ void NavSystem_Do()
}
// ramp time compression - only if not using cinematics
if (AutoPilotEngaged && !(The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS))
if (AutoPilotEngaged && !(The_mission.flags[Mission::Mission_Flags::Use_ap_cinematics]))
{
int dstfrm_start = start_dist - DistanceTo(CurrentNav);
@@ -1182,14 +1196,14 @@ void NavSystem_Do()
*/
for (int i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1 && Ships[i].flags2 & SF2_NAVPOINT_NEEDSLINK)
if (Ships[i].objnum != -1 && Ships[i].flags[Ship::Ship_Flags::Navpoint_needslink])
{
object *other_objp = &Objects[Ships[i].objnum];
if (vm_vec_dist_quick(&Player_obj->pos, &other_objp->pos) < (NavLinkDistance + other_objp->radius))
{
Ships[i].flags2 &= ~SF2_NAVPOINT_NEEDSLINK;
Ships[i].flags2 |= SF2_NAVPOINT_CARRY;
Ships[i].flags.remove(Ship::Ship_Flags::Navpoint_needslink);
Ships[i].flags.set(Ship::Ship_Flags::Navpoint_carry);
send_autopilot_msgID(NP_MSG_MISC_LINKED);
}
@@ -1201,7 +1215,7 @@ void NavSystem_Do()
void send_autopilot_msgID(int msgid)
{
if (msgid < 0 || msgid > NP_NUM_MESSAGES)
if (msgid < 0 || msgid >= NP_NUM_MESSAGES)
return;
send_autopilot_msg(NavMsgs[msgid].message, NavMsgs[msgid].filename);
@@ -1240,7 +1254,9 @@ void send_autopilot_msg(char *msg, char *snd)
// Inits the Nav System
void NavSystem_Init()
{
memset((char *)&Navs, 0, sizeof(Navs));
for (int i = 0; i < MAX_NAVPOINTS; i++)
Navs[i].clear();
AutoPilotEngaged = false;
CurrentNav = -1;
audio_handle = -1;
@@ -1258,75 +1274,69 @@ void NavSystem_Init()
void parse_autopilot_table(char *filename)
{
int rval;
SCP_vector<SCP_string> lines;
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0)
try
{
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", (filename) ? filename : "<default autopilot.tbl>", rval));
lcl_ext_close();
if (filename == NULL)
read_file_text_from_default(defaults_get_file("autopilot.tbl"));
else
read_file_text(filename, CF_TYPE_TABLES);
reset_parse();
required_string("#Autopilot");
// autopilot link distance
required_string("$Link Distance:");
stuff_int(&NavLinkDistance);
if (optional_string("$Interrupt autopilot if enemy within distance:"))
stuff_int(&AutopilotMinEnemyDistance);
else
AutopilotMinEnemyDistance = 5000;
if (optional_string("$Interrupt autopilot if asteroid within distance:"))
stuff_int(&AutopilotMinAsteroidDistance);
else
AutopilotMinAsteroidDistance = 1000;
if (optional_string("$Lock Weapons During Autopilot:"))
stuff_boolean(&LockWeaponsDuringAutopilot);
else
LockWeaponsDuringAutopilot = false;
// optional no cutscene bars
if (optional_string("+No_Cutscene_Bars"))
UseCutsceneBars = false;
// optional no cutscene bars
if (optional_string("+No_Autopilot_Interrupt"))
Cmdline_autopilot_interruptable = 0;
// No Nav selected message
char *msg_tags[] = { "$No Nav Selected:", "$Gliding:",
"$Too Close:", "$Hostiles:", "$Linked:", "$Hazard:",
"$Support Present:", "$Support Working:" };
for (int i = 0; i < NP_NUM_MESSAGES; i++)
{
required_string(msg_tags[i]);
required_string("+Msg:");
stuff_string(NavMsgs[i].message, F_MESSAGE, 256);
required_string("+Snd File:");
stuff_string(NavMsgs[i].filename, F_NAME, 256);
}
required_string("#END");
}
catch (const parse::ParseException& e)
{
mprintf(("TABLES: Unable to parse '%s'! Error message = %s.\n", (filename) ? filename : "<default autopilot.tbl>", e.what()));
return;
}
if (filename == NULL)
read_file_text_from_array(defaults_get_file("autopilot.tbl"));
else
read_file_text(filename, CF_TYPE_TABLES);
reset_parse();
required_string("#Autopilot");
// autopilot link distance
required_string("$Link Distance:");
stuff_int(&NavLinkDistance);
if (optional_string("$Interrupt autopilot if enemy within distance:"))
stuff_int(&AutopilotMinEnemyDistance);
else
AutopilotMinEnemyDistance = 5000;
if (optional_string("$Interrupt autopilot if asteroid within distance:"))
stuff_int(&AutopilotMinAsteroidDistance);
else
AutopilotMinAsteroidDistance = 1000;
if (optional_string("$Lock Weapons During Autopilot:"))
stuff_boolean(&LockWeaponsDuringAutopilot);
else
LockWeaponsDuringAutopilot = false;
// optional no cutscene bars
if (optional_string("+No_Cutscene_Bars"))
UseCutsceneBars = false;
// optional no cutscene bars
if (optional_string("+No_Autopilot_Interrupt"))
Cmdline_autopilot_interruptable = 0;
// No Nav selected message
char *msg_tags[] = { "$No Nav Selected:", "$Gliding:",
"$Too Close:", "$Hostiles:", "$Linked:", "$Hazard:",
"$Support Present:", "$Support Working:" };
for (int i = 0; i < NP_NUM_MESSAGES; i++)
{
required_string(msg_tags[i]);
required_string("+Msg:");
stuff_string(NavMsgs[i].message, F_MESSAGE, 256);
required_string("+Snd File:");
stuff_string(NavMsgs[i].filename, F_NAME, 256);
}
required_string("#END");
// close localization
lcl_ext_close();
}
@@ -1343,13 +1353,6 @@ int FindNav(char *Nav)
return -1;
}
// ********************************************************************************************
// Set A Nav point to "ZERO"
void ZeroNav(int i)
{
memset((char *)&Navs[i], 0, sizeof(NavPoint));
}
// ********************************************************************************************
// Removes a Nav
bool DelNavPoint(char *Nav)
@@ -1360,7 +1363,6 @@ bool DelNavPoint(char *Nav)
}
bool DelNavPoint(int nav)
{
if (nav != -1)
@@ -1373,7 +1375,7 @@ bool DelNavPoint(int nav)
}
}
ZeroNav(MAX_NAVPOINTS-1);
Navs[MAX_NAVPOINTS-1].clear();
return true;
}
@@ -1401,7 +1403,7 @@ bool AddNav_Ship(char *Nav, char *TargetName, int flags)
// Create the NavPoint struct
NavPoint tnav;
strncpy(tnav.m_NavName, Nav, 32);
strcpy_s(tnav.m_NavName, Nav);
tnav.flags = NP_SHIP | flags;
Assert(!(tnav.flags & NP_WAYPOINT));
@@ -1447,7 +1449,7 @@ bool AddNav_Waypoint(char *Nav, char *WP_Path, int node, int flags)
// Create the NavPoint struct
NavPoint tnav;
strncpy(tnav.m_NavName, Nav, TOKEN_LENGTH);
strcpy_s(tnav.m_NavName, Nav);
tnav.flags = NP_WAYPOINT | flags;
Assert(!(tnav.flags & NP_SHIP));
+12 -1
View File
@@ -9,6 +9,7 @@
#include "globalincs/pstypes.h"
#include "object/object.h"
#include <map>
// milliseconds between updates
@@ -25,8 +26,9 @@
#define NP_NOSELECT ( NP_HIDDEN | NP_NOACCESS )
#define NP_VALIDTYPE ( NP_WAYPOINT | NP_SHIP )
struct NavPoint
class NavPoint
{
public:
char m_NavName[32];
int flags;
@@ -35,6 +37,15 @@ struct NavPoint
vec3d *GetPosition();
char* GetInternalName();
void clear()
{
m_NavName[0] = 0;
flags = 0;
target_obj = NULL;
waypoint_num = -1;
}
};
+54
View File
@@ -0,0 +1,54 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/**
* @file bm_examples.cpp
* This file contains example code for using bmpman.
*/
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
void bm_create_example() {
static int test_inited = 0;
static int test_bmp;
static uint test_bmp_data[128 * 64];
if (!test_inited) {
test_inited = 1;
// Create the new bitmap and fill in its data.
// When you're done with it completely, call
// bm_release to free up the bitmap handle
test_bmp = bm_create(32, 128, 64, test_bmp_data);
int i, j;
for (i = 0; i < 64; i++) {
for (j = 0; j < 64; j++) {
uint r = i * 4;
test_bmp_data[j + i * 128] = r;
}
}
}
// page out the data, so that the next bm_lock will convert the new data to
// the correct bpp
bm_unload(test_bmp);
// put in new data
int x, y;
gr_reset_clip();
for (y = 0; y < 64; y++) {
for (x = 0; x < 128; x++) {
test_bmp_data[y * 128 + x] = 15;
}
}
// Draw the bitmap, the upper left corner is the origin (0, 0)
gr_set_bitmap(test_bmp);
gr_bitmap(0, 0);
}
+65 -91
View File
@@ -1,131 +1,105 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef __BM_INTERNAL_H__
#define __BM_INTERNAL_H__
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/**
* @file bm_internal.h
* These are functions and types used by bmpman and a few others.
*
* @details It is a "protected" header that requires BMPMAN_INTERNAL to be defined before it can be included. This is to
* provide a small measure of safety since this functions can cause problems if not used correctly
*/
// extra check to make sure this stuff doesn't end up in normal files
// don't use any of this unless BMPMAN_INTERNAL is defined
#ifdef BMPMAN_INTERNAL
#ifndef BMPMAN_INTERNAL
#error The file header "bmpman/bm_internal.h" is protected. Make sure you know what you are doing!
#endif
#include "globalincs/pstypes.h"
#include "bmpman/bmpman.h"
// no-type ( used in: bm_bitmaps[i].type )
#define BM_TYPE_NONE 0
// in-memory type ( used in: bm_bitmaps[i].type )
#define BM_TYPE_USER 1
// file-type types ( used in: bm_bitmaps[i].type )
#define BM_TYPE_PCX 2
#define BM_TYPE_TGA 3 // 16 or 32 bit targa
#define BM_TYPE_DDS 4 // generic identifier for DDS
#define BM_TYPE_PNG 5 // PNG
#define BM_TYPE_JPG 6 // 32 bit jpeg
#define BM_TYPE_ANI 7 // in-house ANI format
#define BM_TYPE_EFF 8 // specifies any type of animated image, the EFF itself is just text
// c-type types ( used in: bm_bitmaps[i].c_type )
#define BM_TYPE_DXT1 9 // 24 bit with switchable alpha (compressed)
#define BM_TYPE_DXT3 10 // 32 bit with 4 bit alpha (compressed)
#define BM_TYPE_DXT5 11 // 32 bit with 8 bit alpha (compressed)
#define BM_TYPE_CUBEMAP_DDS 12 // generic DDS cubemap (uncompressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT1 13 // 24-bit cubemap (compressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT3 14 // 32-bit cubemap (compressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT5 15 // 32-bit cubemap (compressed cubemap surface)
// special types ( used in: bm_bitmaps[i].type )
#define BM_TYPE_RENDER_TARGET_STATIC 16 // 24/32 bit setup internally as a static render target
#define BM_TYPE_RENDER_TARGET_DYNAMIC 17 // 24/32 bit setup internally as a dynamic render target
/// Moved from cpp file ///////////////////
// Consider these 'protected' structures and functions that should only be used by special bitmap functions
typedef union bm_extra_info {
union bm_extra_info {
struct {
// Stuff needed for animations
int first_frame; // used for animations -- points to index of first frame
int num_frames; // used for animation -- number of frames in the animation
int keyframe; // used for animation -- keyframe info
ubyte fps; // used for animation -- frames per second
int first_frame; //!< used for animations -- points to index of first frame
int num_frames; //!< used for animations -- number of frames in the animation
int keyframe; //!< used for animations -- keyframe info
float total_time; //!< used for animations -- total animation time (not always derived from num_frames/fps)
ubyte fps; //!< used for animations -- frames per second
struct {
// stuff for static animations
ubyte type; // type for individual images
char filename[MAX_FILENAME_LEN]; // filename for individual images
BM_TYPE type; //!< type for individual images
char filename[MAX_FILENAME_LEN]; //!< filename for individual images
} eff;
struct {
bool is_apng; //!< Is this animation an APNG?
float frame_delay; //!< cumulative frame delay
} apng;
} ani;
struct {
// Stuff needed for user bitmaps
void *data; // For user bitmaps, this is where the data comes from
ubyte bpp; // For user bitmaps, this is what format the data is
ubyte flags; // Flags passed to bm_create
void* data; //!< For user bitmaps, this is where the data comes from
ubyte bpp; //!< For user bitmaps, this is what format the data is
ubyte flags; //!< For user bitmaps, Flags passed to bm_create
} user;
} bm_extra_info;
};
typedef struct bitmap_entry {
struct bitmap_entry {
// identification
char filename[MAX_FILENAME_LEN]; // filename for this bitmap
char filename[MAX_FILENAME_LEN]; //!< filename for this bitmap
uint signature; // a unique signature identifying the data
uint palette_checksum; // checksum used to be sure bitmap is in current palette
int handle; // Handle = id*MAX_BITMAPS + bitmapnum
int last_used; // When this bitmap was last used
uint signature; //!< a unique signature identifying the data
uint palette_checksum; //!< checksum used to be sure bitmap is in current palette
int handle; //!< Handle = id*MAX_BITMAPS + bitmapnum
int last_used; //!< When this bitmap was last used
ubyte type; // PCX, USER, ANI, etc
ubyte comp_type; // What sort of compressed type, BM_TYPE_NONE if not compressed
signed char ref_count; // Number of locks on bitmap. Can't unload unless ref_count is 0.
BM_TYPE type; //!< PCX, USER, ANI, etc
BM_TYPE comp_type; //!< What sort of compressed type, BM_TYPE_NONE if not compressed
signed char ref_count; //!< Number of locks on bitmap. Can't unload unless ref_count is 0.
int dir_type; // which directory this was loaded from (to skip other locations with same name)
int dir_type; //!< which directory this was loaded from (to skip other locations with same name)
// compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
int mem_taken; // How much memory does this bitmap use? - UnknownPlayer
int num_mipmaps; // number of mipmap levels, we need to read all of them
size_t mem_taken; //!< How much memory does this bitmap use? - UnknownPlayer
int num_mipmaps; //!< number of mipmap levels, we need to read all of them
// Stuff to keep track of usage
ubyte preloaded; // If set, then this was loaded from the lst file
int preload_count; // how many times this gets used in game, for unlocking
ubyte used_flags; // What flags it was accessed thru
int load_count;
ubyte preloaded; //!< If set, then this was loaded from the lst file
int preload_count; //!< how many times this gets used in game, for unlocking
ubyte used_flags; //!< What flags it was accessed thru
int load_count;
// Bitmap info
bitmap bm;
bitmap bm; //!< Bitmap info
// Data for animations and user bitmaps
bm_extra_info info;
bm_extra_info info; //!< Data for animations and user bitmaps
#ifdef BMPMAN_NDEBUG
// bookeeping
ubyte used_last_frame; // If set, then it was used last frame
ubyte used_this_frame; // If set, then it was used this frame
int data_size; // How much data this bitmap uses
int used_count; // How many times it was accessed
ubyte used_last_frame; // If set, then it was used last frame
ubyte used_this_frame; // If set, then it was used this frame
size_t data_size; // How much data this bitmap uses
int used_count; // How many times it was accessed
#endif
} bitmap_entry;
};
extern bitmap_entry bm_bitmaps[MAX_BITMAPS];
// image specific lock functions
void bm_lock_ani( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_png( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_jpg( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_pcx( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_user( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_ani( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_png( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_apng( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_jpg( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_pcx( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_user( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, int bpp, ubyte flags );
#endif // BMPMAN_INTERNAL
#endif // __BM_INTERNAL_H__
+2913 -2553
View File
File diff suppressed because it is too large. Load diff
+617 -204
View File
@@ -1,288 +1,701 @@
#ifndef _BMPMAN_H
#define _BMPMAN_H
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
*/
/**
* @file bmpman.h
* Header file for the bitmap manager (bmpman)
*/
/**
* @example bm_examples.cpp
* @brief This containes examples of bmpman usage
*/
#ifndef _BMPMAN_H
#define _BMPMAN_H
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "globalincs/pstypes.h"
#ifndef NDEBUG
#define BMPMAN_NDEBUG
#define BMPMAN_NDEBUG //!< Enables BMPMAN debugging code
#endif
#define MAX_BITMAPS 4750 // How many bitmaps the game can handle
// NOTE: MAX_BITMAPS shouldn't need to be bumped again. With the fixed bm_release() and it's
// proper use even the largest missions should stay under this number. With the largest retail
// missions and wasteful content we should still have about 20% of the slots free. If it still
// goes over then it's something the artists need to fix. For instance the Terran Mara fighter,
// with -spec and -glow and using the Shinepack, needs 117 bitmap slots alone. 111 of those is
// just for the glowmaps. This number can be greatly reduced if the number of ani frames for
// another LOD than LOD0 has fewer or no ani frames. A 37 frame glow ani for LOD2 is little
// more than a waste of resources. Future reports of texture corruption should be initially
// approached with content as the cause and not code. If anything we could/should reduce
// MAX_BITMAPS in the future. Where it's at now should accomidate even the largest mods.
// -- Taylor
/**
* @defgroup BMPMAN_CONSTANTS Macro constants used in/with bmpman.h
*
* @{
*/
/**
* @brief How many bitmaps the game can handle
*
* @attention MAX_BITMAPS shouldn't need to be bumped again. With the fixed bm_release() and it's proper use even the
* largest missions should stay under this number. With the largest retail missions and wasteful content we should
* still have about 20% of the slots free. If it still goes over then it's something the artists need to fix.
* For instance the Terran Mara fighter, with -spec and -glow and using the Shinepack, needs 117 bitmap slots alone.
* 111 of those is just for the glowmaps. This number can be greatly reduced if the number of ani frames for another
* LOD than LOD0 has fewer or no ani frames. A 37 frame glow ani for LOD2 is little more than a waste of resources.
* Future reports of texture corruption should be initially approached with content as the cause and not code.
* If anything we could/should reduce MAX_BITMAPS in the future. Where it's at now should accomidate even the
* largest mods. -- Taylor
*/
#define MAX_BITMAPS 4750
#define BMP_AABITMAP (1<<0) // antialiased bitmap
#define BMP_TEX_XPARENT (1<<1) // transparent texture
#define BMP_TEX_OTHER (1<<2) // so we can identify all "normal" textures
#define BMP_TEX_DXT1 (1<<3) // dxt1 compressed 8r8g8b1a (24bit)
#define BMP_TEX_DXT3 (1<<4) // dxt3 compressed 8r8g8b4a (32bit)
#define BMP_TEX_DXT5 (1<<5) // dxt5 compressed 8r8g8b8a (32bit)
#define BMP_TEX_CUBEMAP (1<<6) // a texture made for cubic environment map
// Flag positions for bitmap.flags
// ***** NOTE: bitmap.flags is an 8-bit value, no more BMP_TEX_* flags can be added unless the type is changed!! ******
#define BMP_AABITMAP (1<<0) //!< antialiased bitmap
#define BMP_TEX_XPARENT (1<<1) //!< transparent texture
#define BMP_TEX_OTHER (1<<2) //!< so we can identify all "normal" textures
#define BMP_TEX_DXT1 (1<<3) //!< dxt1 compressed 8r8g8b1a (24bit)
#define BMP_TEX_DXT3 (1<<4) //!< dxt3 compressed 8r8g8b4a (32bit)
#define BMP_TEX_DXT5 (1<<5) //!< dxt5 compressed 8r8g8b8a (32bit)
#define BMP_TEX_CUBEMAP (1<<6) //!< a texture made for cubic environment map
//compressed texture types
#define BMP_TEX_COMP ( BMP_TEX_DXT1 | BMP_TEX_DXT3 | BMP_TEX_DXT5 )
// Combined flags
#define BMP_TEX_COMP ( BMP_TEX_DXT1 | BMP_TEX_DXT3 | BMP_TEX_DXT5 ) //!< Compressed textures
#define BMP_TEX_NONCOMP ( BMP_TEX_XPARENT | BMP_TEX_OTHER ) //!< Non-compressed textures
#define BMP_TEX_ANY ( BMP_TEX_COMP | BMP_TEX_NONCOMP ) //!< Any texture
//non compressed textures
#define BMP_TEX_NONCOMP ( BMP_TEX_XPARENT | BMP_TEX_OTHER )
// Flag positions for bitmap.type
#define BMP_FLAG_RENDER_TARGET_STATIC (1<<0) //!< Texture is a static type
#define BMP_FLAG_RENDER_TARGET_DYNAMIC (1<<1) //!< Texture is a dynamic type (animation)
#define BMP_FLAG_CUBEMAP (1<<2) //!< Texture is a cubemap
// any texture type
#define BMP_TEX_ANY ( BMP_TEX_COMP | BMP_TEX_NONCOMP )
// Bitmap types
enum BM_TYPE
{
BM_TYPE_NONE = 0, //!< No type
BM_TYPE_USER, //!< in-memory
BM_TYPE_PCX, //!< PCX
BM_TYPE_TGA, //!< 16 or 32 bit targa
BM_TYPE_DDS, //!< generic identifier for DDS
BM_TYPE_PNG, //!< PNG
BM_TYPE_JPG, //!< 32 bit jpeg
BM_TYPE_ANI, //!< in-house ANI format
BM_TYPE_EFF, //!< specifies any type of animated image, the EFF itself is just text
// special types
BM_TYPE_RENDER_TARGET_STATIC, //!< 24/32 bit setup internally as a static render target
BM_TYPE_RENDER_TARGET_DYNAMIC, //!< 24/32 bit setup internally as a dynamic render target
// Compressed types (bitmap.c_type)
BM_TYPE_DXT1, //!< 24 bit with switchable alpha
BM_TYPE_DXT3, //!< 32 bit with 4 bit alpha
BM_TYPE_DXT5, //!< 32 bit with 8 bit alpha
BM_TYPE_CUBEMAP_DDS, //!< generic DDS cubemap (uncompressed cubemap surface)
BM_TYPE_CUBEMAP_DXT1, //!< 24-bit cubemap (compressed cubemap surface)
BM_TYPE_CUBEMAP_DXT3, //!< 32-bit cubemap (compressed cubemap surface)
BM_TYPE_CUBEMAP_DXT5 //!< 32-bit cubemap (compressed cubemap surface)
};
/**
* @}
*/
struct bitmap
{
short w; //!< Width, in number of pixels
short h; //!< Height, in number of pixels
short rowsize; //!< What you need to add to go to next row
int bpp; //!< Requested bitdepth of each pixel. ( 7, 8, 15, 16, 24, 32)
int true_bpp; //!< The image's actual bitdepth
ubyte flags; //!< Various texture type flags. @see BMPMAN_CONSTANTS
ptr_u data; //!< Pointer to data, or maybe offset into VRAM.
ubyte *palette; /**< @brief Pointer to this bitmap's palette (if it has one).
* @details If BMP_NO_PALETTE_MAP flag is cleared, this palette just points to the screen palette. (gr_palette)
*/
};
extern size_t bm_texture_ram; //!< how many bytes of textures are used.
extern int Bm_paging; //!< Bool type that indicates if BMPMAN is currently paging.
extern const BM_TYPE bm_type_list[]; //!< List of valid bitmap types
extern const char *bm_ext_list[]; //!< List of extensions for those types
extern const int BM_NUM_TYPES; //!< Calculated number of bitmap types
extern const BM_TYPE bm_ani_type_list[]; //!< List of valid bitmap animation types
extern const char *bm_ani_ext_list[]; //!< List of extensions for those types
extern const int BM_ANI_NUM_TYPES; //!< Calculated number of bitmap animation types
extern int GLOWMAP; //!< References a map that is a fully lit version of its index -Bobboau
extern int SPECMAP; //!< References a map that is for specular mapping -Bobboau
extern int ENVMAP; //!< References a map that is for environment mapping -Bobboau
extern int NORMMAP; //!< Normal mapping
extern int HEIGHTMAP; //!< Height map for normal mapping
extern int MISCMAP; //!< Utility map, to be utilized for various things shader authors can come up with
/**
* @brief Initilizes the bitmap manager
*/
void bm_init();
/**
* @brief Closes the bitmap manager, freeing any allocated memory used by bitmaps. Is called at program close.
*/
void bm_close();
/**
* Gets the cache slot of the bitmap indexed by handle.
*
* @details if the bitmap is an ani, gets the first frame
*
* @returns The cache slot index of the bitmap if handle is valid
*
* @note If the handle is invalid, an Assert() fails
*/
int bm_get_cache_slot(int bitmap_id, int separate_ani_frames);
/**
* @brief Gets the next available bitmap slot.
*/
int bm_get_next_handle();
#define BMP_FLAG_RENDER_TARGET_STATIC (1<<0)
#define BMP_FLAG_RENDER_TARGET_DYNAMIC (1<<1)
#define BMP_FLAG_CUBEMAP (1<<2)
#define BMP_FLAG_RENDER_TARGET_MIPMAP (1<<3)
typedef struct bitmap {
short w, h; // Width and height
short rowsize; // What you need to add to go to next row
ubyte bpp; // How many bits per pixel it is. (7,8,15,16,24,32) (what is requested)
ubyte true_bpp; // How many bits per pixel the image actually is.
ubyte flags; // See the BMP_???? defines for values (this isn't for the BMP_FLAG_* stuff)
ptr_u data; // Pointer to data, or maybe offset into VRAM.
ubyte *palette; // If bpp==8, this is pointer to palette. If the BMP_NO_PALETTE_MAP flag
// is not set, this palette just points to the screen palette. (gr_palette)
} bitmap;
/**
* @brief Allocates memory for the given handle.
*
* @returns A pointer to the allocated vm if successful,
* @returns Null, if unsuccessful
*
* @note z64 - This function looks fishy. Not only is handle not used in release builds, but bm_bitmaps[handle].size
* and bm_texture_size aren't modified unless this is a debug build
*/
void *bm_malloc(int handle, size_t size);
/**
* @brief (DEBUG) Similar to bm_malloc, but only updates how much memory is used
*
* @note z64 - Also fishy (see bm_malloc)
*/
void bm_update_memory_used(int n, size_t size);
extern int Bm_paging;
class bitmap_lookup {
ubyte *Bitmap_data;
void bm_init();
int Width;
int Height;
int Num_channels;
void bm_close();
float map_texture_address(float address);
public:
bitmap_lookup(int bitmap_num);
~bitmap_lookup();
int bm_get_cache_slot( int bitmap_id, int separate_ani_frames );
bool valid();
int bm_get_next_handle();
float get_channel_red(float u, float v);
float get_channel_green(float u, float v);
float get_channel_blue(float u, float v);
float get_channel_alpha(float u, float v);
};
void *bm_malloc(int n, int size);
/**
* @brief Loads a bitmap so we can draw with it later.
*
* @param filename
*
* @returns The bitmap number if successful, else
* @returns a negative value if not
*/
int bm_load(const char* filename);
void bm_update_memory_used(int n, int size);
// how many bytes of textures are used.
extern int bm_texture_ram;
// This loads a bitmap so we can draw with it later.
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number.
int bm_load(char * filename);
/**
* @brief Loads a bitmap so we can draw with it later. (Preferred version)
*
* @param filename
*
* @returns The bitmap number if successful, else
* @returns a negative value if not
*/
int bm_load(const SCP_string& filename);
// special load function. basically allows you to load a bitmap which already exists (by filename).
// this is useful because in some cases we need to have a bitmap which is locked in screen format
// _and_ texture format, such as pilot pics and squad logos
int bm_load_duplicate(char *filename);
/**
* @brief Reloads a bitmap as a duplicate.
*
* @details This function basically allows you to load a bitmap which already exists (by filename). This is useful
* because in some cases we need to have a bitmap which is locked in screen format _and_ texture format, such as
* the pilot pics and squad logos
*
* @param filename
*
* @returns The bitmap number if successful, else
* @returns a negative value if not
*/
int bm_load_duplicate(const char *filename);
// Creates a bitmap that exists in RAM somewhere, instead
// of coming from a disk file. You pass in a pointer to a
// block of data. The data can be in the following formats:
// 8 bpp (mapped into game palette)
// 32 bpp
// On success, it returns the bitmap number. You cannot
// free that RAM until bm_release is called on that bitmap.
// See example at bottom of this file
int bm_create( int bpp, int w, int h, void *data = NULL, int flags = 0);
/**
* Loads a bitmap which exists somewhere in the RAM.
*
* @param bpp The bitdepth of the bitmap
* @param w The width of the bitmap
* @param h The height of the bitmap
* @param[in] data The bitmap's data glob
* @param flags
*
* @note The used RAM cannot be freed until bm_release is called on the created bitmap
*/
int bm_create(int bpp, int w, int h, void *data = NULL, int flags = 0);
// Frees up a bitmap's data, but bitmap number 'n' can
// still be used, it will just have to be paged in next
// time it is locked.
int bm_unload( int n, int clear_render_targets = 0, bool nodebug = false);
/**
* @brief Unloads a bitmap's data, but not the bitmap info
*
* @details The bm number (n) may be reused once this function has been called on it. However, it will have to be paged
* in the next time it is locked.
// like bm_unload() except that it's safe to use to free data without worrying about
// load_count so it's safe to use in relation to bm_release() and in gr_*_texture functions
int bm_unload_fast( int n, int clear_render_targets = 0 );
* @param handle The index number of the bitmap to free
* @param clear_render_targets If true, release a render target
* @param nodebug If true, exclude certain debug messages
*
* @returns 0 if not successful,
* @returns 1 if successful
*/
int bm_unload(int handle, int clear_render_targets = 0, bool nodebug = false);
// Frees up a bitmap's data, and it's slot, so bitmap
// number 'n' cannot be used anymore, and bm_load or
// bm_create might reuse the slot.
int bm_release( int n, int clear_render_targets = 0 );
/**
* @brief Quickly unloads a bitmap's data, ignoring the load_count
*
* @details Similar to bm_unload(), except that it can be safely used to free data without worrying about load_count.
* It's safe to use in relation to bm_release() and in gr_*_texture functions
*
* @param handle The bm number of the bitmap to free
* @param clear_render_targets If true, release a render target
*
* @note bm_free_data_fast() is used here and NOT bm_free_data()
*/
int bm_unload_fast(int handle, int clear_render_targets = 0);
// This loads a bitmap sequence so we can draw with it later.
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number of the first frame and nframes is set.
extern int bm_load_animation( char * filename, int * nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
/**
* @brief Frees both a bitmap's data and it's associated slot.
*
* @details Once called, the bm number 'n' cannot be used until bm_load or bm_create is re-inits the slot.
*
* @param handle The index number of the bitmap to release
* @param clear_render_targets If nonzero, also release render targets
*
* @returns 1 on success,
* @returns 0 otherwise
*
* @note If the passed handle is that of an ANI, it frees EVERY frame. Be sure to only pass the handle of the first frame!
*
* @todo upgrade return type and clear_render_targets type to bools
*/
int bm_release(int handle, int clear_render_targets = 0);
//Loads either animation (bm_load_animation) or still image (bm_load)
extern int bm_load_either(char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
/**
* @brief Loads a bitmap sequance so we can draw with it.
*
* @param[in] filename
* @param[out] nframes If non-null, set to the number of frames the animation has
* @param[out] fps If non-null, set to the fps of this animation
* @param[out] keyframe if non null, set to the keyframe index of this animation
* @param[in] can_drop_frames If set, allows dropped frames
* @param[in] dir_type Directory type
*
* @returns The bm number of the first bitmap in the sequence if successful, or
* @returns A negative value if unsuccessful
*/
int bm_load_animation(const char *filename, int *nframes = nullptr, int *fps = nullptr, int *keyframe = nullptr, float *total_time = nullptr, bool can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
// This locks down a bitmap and returns a pointer to a bitmap
// that can be accessed until you call bm_unlock. Only lock
// a bitmap when you need it! This will convert it into the
// appropriate format also.
extern bitmap * bm_lock( int bitmapnum, ubyte bpp, ubyte flags, bool nodebug = false);
/**
* @brief Loads either animation (bm_load_animation) or still image (bm_load)
*
* @param[in] filename
* @param[out] nframes If non-null and loading was successful, set to the number of frames the animation has
* @param[out] fps If non-null and loading was successful, set to the fps of this animation
* @param[out] keyframe if non null and loading was successful, set to the keyframe index of this animation
* @param[in] can_drop_frames
* @param[in] dir_type
*
* @returns The bm number of the first bitmap in the sequence if successful, or
* @returns A negative value if unsuccessful
*/
int bm_load_either(const char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, bool can_drop_frames = false, int dir_type = CF_TYPE_ANY);
// The signature is a field that gets filled in with
// a unique signature for each bitmap. The signature for each bitmap
// will also change when the bitmap's data changes.
extern uint bm_get_signature( int bitmapnum);
/**
* @brief Locks down the bitmap indexed by bitmapnum.
*
* @details Also converts the bitmap to the appropriate format specified by bpp and flags. Only lock a bitmap when you
* need it!
*
* @param handle The number indexing the desired bitmap
* @param bpp The desired bpp of the bitmep
* @param flags The desired bitmap format
* @param nodebug
//gets the image type
ubyte bm_get_type(int handle);
* @returns A pointer to the bitmap that's valid until bm_unlock is called if successful, or
* @returns NULL if unsuccessful
*/
bitmap* bm_lock(int handle, int bpp, ubyte flags, bool nodebug = false);
// Unlocks a bitmap
extern void bm_unlock( int bitmapnum );
/**
* @brief Returns a unique signiature for the bitmap indexed by handle
*
* @details A signature will change when the bitmap's data changes
*/
uint bm_get_signature(int handle);
//WMC - Returns 0 if invalid, nonzero if valid
extern int bm_is_valid(int handle);
/**
* @brief Returns the image type of the given bitmap handle
*/
BM_TYPE bm_get_type(int handle);
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
//WMC - Returns -1 on failure, handle or first frame handle on success.
int bm_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL );
/**
* @brief Unlocks a bitmap
*
* @details Decrements the ref_count member of the bitmap_entry struct, A bitmap can only be unloaded when the
* ref_count is 0
*/
void bm_unlock(int handle);
// get filename
extern void bm_get_filename(int bitmapnum, char *filename);
/**
* @brief Checks if the bitmap indexed by handle is valid
*
* @details Some early known false or out of range handles (such as negative) are checked within
* an initial routine pass, followed by a more thorough check routine to ensure the
* series of bitmaps within the bm_bitmaps[] structure have not become invalid.
*
* @returns Nonzero if valid, else
* @returns Zero otherwise
*
* @todo z64 - Returned value is essentially a bool type, need to check all caller functions to see if it can safely
* be updated to reflect this
*/
int bm_is_valid(int handle);
// call to load all data for all bitmaps that have been requested to be loaded
extern void bm_gfx_load_all();
extern void bm_unload_all();
/**
* @brief Gets info on the bitmap indexed by handle.
*
* @param[out] w If non-null, gets the width
* @param[out] h If non-null, gets the heigth
* @param[out] flags If non-null, gets the flags
* @param[out] nframs If non-null, gets the nframes
* @param[out] fps If non-null, gets the fps
*
* @returns The handle on success, or
* @returns The handle to the first frame on success, or
* @returns -1 on failure
*/
int bm_get_info(int handle, int *w = NULL, int * h = NULL, ubyte * flags = NULL, int *nframes = NULL, int *fps = NULL);
// call to get the palette for a bitmap
void bm_get_palette(int n, ubyte *pal, char *name);
/**
* @brief Gets the filename of the bitmap indexed by handle
*
* @param[out] filename The filename of the bitmap, if successful. Is set to an empty string if unseccessful
*
* @todo z64 - maybe deprecate this in favor of an SCP_string version
*/
void bm_get_filename(int bitmapnum, char *filename);
// Hacked function to get a pixel from a bitmap.
// Only works good in 8bpp mode.
void bm_gfx_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
/**
* @brief Gets the filename of the bitmap indexed by handle, which must exist.
*
* @details If the bitmap does not exist (i.e. the handle is invalid), then an Assertion halts program execution.
*
* @returns A const char* to the filename of the bitmap
*
* @todo z64 - maybe deprecate this in favor of an SCP_string version.
* @todo z64 - maybe combine this with the other bm_get_filename function like so:
* void bm_get_filename(int handle, SCP_string *filename, bool must_exist = false);
*/
const char *bm_get_filename(int handle);
// Returns number of bytes of bitmaps locked this frame
// ntotal = number of bytes of bitmaps locked this frame
// nnew = number of bytes of bitmaps locked this frame that weren't locked last frame
/**
* @brief Loads all data for all bitmaps that have been requested to be loaded
*
* @note This function is not defined.
*/
void bm_gfx_load_all();
/**
* @brief Unloads all used bitmaps, should only ever be called by game_shutdown()
*
* @todo Maybe move this declaration into bmpman.cpp and then extern this function within game_shutdown() to
* ensure it only ever gets called there.
*/
void bm_unload_all();
/**
* @brief Gets the palette for a given bitmap indexed by handle, and optionally the filename
*
* @param[out] pal Is set to reference the bitmap's palette
* @param[out] name (optional) Is set to the bitmap's filename
*
* @todo Maybe get rid of the optional filename and have the callers call bm_get_filename. Less efficient, however.
*/
void bm_get_palette(int handle, ubyte *pal, char *name);
/**
* @brief Hack to get a pixel from a bitmap
*
* @details only works good in 8bpp mode
*
* @note This function is not defined.
*/
void bm_gfx_get_pixel(int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b);
/**
* @brief (DEBUG) Gets memory size, in bytes, of the locked bitmaps
*
* @details Both params are non-optional, and must be non-null. There's currently no safety checks on either.
*
* @param ntotal[out] Memory size, in bytes, of the locked bitmaps
* @param nnew[out] Memory size, in bytes, of the bitmaps that were locked since the last frame
*
* @note This is a debug function, and is undefined within release builds
*/
void bm_get_frame_usage(int *ntotal, int *nnew);
// Reload a different image into an existing bmpman slot
int bm_reload(int bitmap_handle, char* filename);
/*
* Example on using bm_create
*
{
static int test_inited = 0;
static int test_bmp;
static uint test_bmp_data[128*64];
if ( !test_inited ) {
test_inited = 1;
// Create the new bitmap and fill in its data.
// When you're done with it completely, call
// bm_release to free up the bitmap handle
test_bmp = bm_create( 32, 128, 64, test_bmp_data );
int i,j;
for (i=0; i<64; i++ ) {
for (j=0; j<64; j++ ) {
uint r=i*4;
test_bmp_data[j+i*128] = r;
}
}
}
bm_unload(test_bmp); // this pages out the data, so that the
// next bm_lock will convert the new data to the
// correct bpp
// put in new data
int x,y;
gr_reset_clip();
for (y=0; y<64; y++)
for (x=0; x<128; x++ )
test_bmp_data[y*128+x] = 15;
// Draw the bitmap to upper left corner
gr_set_bitmap(test_bmp);
gr_bitmap( 0,0 );
}
*/
//============================================================================
// Paging stuff
//============================================================================
/**
* @brief Reloads an existing bmpman slot with different bitmap
*
* @param[in] filename The filename of the image to load
*
* @returns The bitmap handle on success, or
* @returns A negative value on failure
*
* @note This should only be used if you are certain the new picture is the same type, has same dimensions, etc.
*/
int bm_reload(int bitmap_handle, const char* filename);
/**
* @brief Tells bmpman to start keeping track of what bitmaps are used where
*/
void bm_page_in_start();
/**
* @brief Tells bmpman to stop paging (?)
*/
void bm_page_in_stop();
// Paging code in a library should call these functions
// in its page in function.
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_texture( int bitmapnum, int num_frames = 0 );
/**
* @brief Marks a texture as being used for this level
*
* @param[in] num_frames If specified, assumes this is an animated texture
*/
void bm_page_in_texture(int bitmapnum, int num_frames = 0);
// marks a texture as being a transparent textyre used for this level
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
/**
* @brief Marks a textures as being used for level and is transparant
*
* @param[in] num_frames If specified, assumes this is an animated texture
*/
void bm_page_in_xparent_texture(int bitmapnum, int num_frames = 1);
// Marks an aabitmap as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_aabitmap( int bitmapnum, int num_frames=1 );
/**
* @brief Marks a texture as being used for this level, and is anti-aliased
*
* @param[in] num_frames If specified, assumes this is an animated texture
*/
void bm_page_in_aabitmap(int bitmapnum, int num_frames = 1);
// unload a texture that was paged in
int bm_page_out( int handle );
/**
* @brief Unloads the bitmap indexed by handle that was previously paged-in
*
* @returns 0 If the bitmap had already been released, or
* @returns 0 If the handle is invalid, or
* @returns 1 If successful
*/
bool bm_page_out(int handle);
//
// Mode: 0 = High memory
// 1 = Low memory ( every other frame of ani's)
// 2 = Debug low memory ( only use first frame of each ani )
void bm_set_low_mem( int mode );
char *bm_get_filename(int handle);
/**
* @brief Sets BMPMAN's memory mode
*
* @details 0 = High memory;
* 1 = Low memory (loads every other frame of ani's);
* 2 = Debug low memory (only use first frame of each ani)
*
* @todo This should use an enum, or instead allow an arbitrary number to drop frames (like 1/2, 1/3, etc.)
*/
void bm_set_low_mem(int mode);
/**
* @brief Sets bm_set_components and bm_get_components to reference screen format functions
*/
void BM_SELECT_SCREEN_FORMAT();
/**
* @brief Sets bm_set_components and bm_get_components to reference texture format functions
*/
void BM_SELECT_TEX_FORMAT();
/**
* @brief Sets bm_set_components and bm_get_components to reference texture format functions (with alpha)
*/
void BM_SELECT_ALPHA_TEX_FORMAT();
// set the rgba components of a pixel, any of the parameters can be NULL
extern void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
extern void (*bm_set_components_32)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_16_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_32_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_16_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
/**
* @brief Functional pointer that references any of the bm_set_components functions.
*
* @details The bm_set_components functions packs the RGBA values into the ubyte array referenced by pixel, whose
* format differs according to its bpp value and presence of an alpha channel. The RGBA values are scaled accordingly.
*
* @param[out] pixel The pixel to set
* @param[in] r Red value (may not be NULL)
* @param[in] g Green value (may not be NULL)
* @param[in] b Blue value (may not be NULL)
* @param[in] a Alpha value (currently ignored)
*
* @note z64 - These functions were made predating the introduction of C++ classes, and are basically the equivalent
* of Pixel::set(ubyte *r, ubyte *b, ubyte *g). The original comment mentions that any of the rgba params may be
* NULL, but this is by far _NOT_ the case, as a NULL value will cause undefined behavior (really really bad chroma
* corruption)
*
* @note These functions assume the incoming bitdepth will always be >= to the outgoing bitdepth of the pixel. Should
* the incoming bitdepth be lower, the outgoing values will appear darker than they should be
*/
extern void(*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
// get the rgba components of a pixel, any of the parameters can be NULL
/**
* @brief Functional pointer that references any of the bm_set_components_32 functions.
*
* @details The bm_set_components functions packs the RGBA values into the ubyte array referenced by pixel, whose
* format differs according to its bpp value and presence of an alpha channel. The RGBA values are scaled accordingly.
*
* @see bm_set_components
*/
extern void(*bm_set_components_32)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
/**
* @brief Sets the 16bpp screen pixel to the specified RGBA value
*
* @see bm_set_components
*/
void bm_set_components_argb_16_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
/**
* @brief Sets the 32bpp screen pixel to the specified RGBA value
*
* @see bm_set_components
*/
void bm_set_components_argb_32_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
/**
* @brief Sets the 16bpp texture pixel to the specified RGBA value
*
* @see bm_set_components
*/
void bm_set_components_argb_16_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
/**
* @brief Sets the 32bpp texture pixel to the specified RGBA value
*
* @see bm_set_components
*/
void bm_set_components_argb_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
/**
* @brief Gets the RGBA components of a pixel according to the selected mode
*
* @see BM_SELECT_SCREEN_FORMAT() BM_SELECT_TEX_FORMAT() BM_SELECT_ALPHA_TEX_FORMAT()
*/
void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
extern int UNLITMAP; //this holds a reference to a map that is optional used instead of the base map for unlit rendering
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of its index -Bobboau
extern int SPECMAP; //this holds a reference to a map that is for specular mapping -Bobboau
extern int SPECGLOSSMAP; //this holds a reference to a map that is for specular mapping -Bobboau
extern int ENVMAP; //this holds a reference to a map that is for environment mapping -Bobboau
extern int NORMMAP; // normal mapping
extern int HEIGHTMAP; // height map for normal mapping
extern int AMBIENTMAP; // ambient occluion map. red channel affects ambient lighting, green channel affects diffuse and specular
extern int MISCMAP; // Utility map, to be utilized for various things shader authors can come up with
int bm_is_compressed(int num);
int bm_get_tcache_type(int num);
int bm_get_size(int num);
int bm_get_num_mipmaps(int num);
int bm_has_alpha_channel(int handle);
/**
* @brief Returns the compression type of the bitmap indexed by handle
*/
int bm_is_compressed(int handle);
/**
* @brief Gets the correct TCACHE_TYPE for compressed graphics (uncompressed are assumed TCACHE_TYPE_NORMAL)
*/
int bm_get_tcache_type(int handle);
/**
* @brief Gets the size, in bytes, taken up by the bitmap indexed by handle
*/
size_t bm_get_size(int handle);
/**
* @brief Gets the number of mipmaps of the indexed texture
*/
int bm_get_num_mipmaps(int handle);
/**
* @brief Checks to see if the indexed bitmap has an alpha channel
*
* @note Currently just checks if the bitmap is 32bpp and is not a .PCX
*/
bool bm_has_alpha_channel(int handle);
/**
* @brief (DEBUG) Prints all loaded bitmaps to an outwindow
*/
void bm_print_bitmaps();
int bm_make_render_target( int width, int height, int flags );
int bm_is_render_target(int bitmap_id);
int bm_set_render_target(int handle, int face = -1);
/**
* @brief Creates a render target as close to the desired resolution as possible.
*
* @returns the handle of an avilable render target if successful, or
* @returns -1 if not successful
*
* @note BM_FLAG_RENDER_TARGET_STATIC are drawn once/infrequently, while BM_FLAG_RENDER_TARGET_DYNAMIC are drawn roughly once every frame
*/
int bm_make_render_target(int width, int height, int flags);
/**
* @brief Checks to see if the given bitmap indexed by handle is a render target
*
* @returns The render type (BM_TYPE) if it is a render target, or
* @returns 0 if it is not
*/
int bm_is_render_target(int handle);
/**
* @brief (GR function) Calls gr_bm_set_render target for the given bitmap indexed by handle
*
* @returns true if successful, or
* @returns false if unsuccessful
*/
bool bm_set_render_target(int handle, int face = -1);
/**
* @brief Loads and parses an .EFF
*
* @param[in] filename The filename of the .EFF
* @param[in] dir_type
* @param[out] nframes (optional) If given, is set to the number of frames this .EFF has
* @param[out] nfps (optional) If given, is set to the fps of this .EFF
* @param[out] key (optional) If given, is set to the keyframe index of this .EFF
* @param[out] type (optional) If given, is set to the BM_TYPE of the .EFF
*
* @returns true If successful
* @returns false If not successful
*/
bool bm_load_and_parse_eff(const char *filename, int dir_type, int *nframes, int *nfps, int *key, BM_TYPE *type);
/**
* @brief Calculates & returns the current frame of an animation
*
* @param[in] frame1_handle Handle of the animation
* @param[in] elapsed_time Time in seconds since the animation started playing
* @param[in] loop (optional) specifies if the animation should loop, default is false which causes animation to hold on the last frame
* @param[in] divisor (optional) if greater than zero, elapsed time will be divided by this value i.e. allows "percentage complete" to be used to determine the frame instead of the animations total time derived from fps * frames
*
* @returns current frame of the animation (range is zero to the number of frames minus one)
*/
int bm_get_anim_frame(const int frame1_handle, float elapsed_time, const float divisor = 0.0f, const bool loop = false);
int bm_load_and_parse_eff(char *filename, int dir_type, int *nframes, int *nfps, int *key, ubyte *type);
#endif
+51 -41
View File
@@ -1,17 +1,15 @@
#include "camera/camera.h"
#include "math/vecmat.h"
#include "graphics/2d.h"
#include "globalincs/alphacolors.h"
#include "parse/parselo.h"
#include "physics/physics.h" //apply_physics
#include "globalincs/linklist.h"
#include "globalincs/systemvars.h" //VM_FREECAMERA etc
#include "graphics/font.h"
#include "hud/hud.h" //hud_get_draw
#include "math/vecmat.h"
#include "mod_table/mod_table.h"
#include "model/model.h" //polymodel, model_get
#include "parse/parselo.h"
#include "playerman/player.h" //player_get_padlock_orient
#include "ship/ship.h" //compute_slew_matrix
#include "graphics/font.h"
#include "mod_table/mod_table.h"
#include "globalincs/linklist.h"
//*************************IMPORTANT GLOBALS*************************
float VIEWER_ZOOM_DEFAULT = 0.75f; // Default viewer zoom, 0.625 as per multi-lateral agreement on 3/24/97
@@ -82,7 +80,7 @@ void camera::reset()
void camera::set_name(char *in_name)
{
if(name != NULL)
if(in_name != NULL)
strncpy(name, in_name, NAME_LENGTH-1);
}
@@ -332,8 +330,10 @@ void camera::get_info(vec3d *position, matrix *orientation)
eyep = get_submodel_eye(pm, object_host_submodel);
if(eyep)
{
Assertion(objp->type == OBJ_SHIP, "This part of the code expects the object to be a ship");
vec3d c_pos_in;
find_submodel_instance_point_normal( &c_pos_in, &host_normal, objp, eyep->parent, &eyep->pnt, &eyep->norm);
find_submodel_instance_point_normal(&c_pos_in, &host_normal, Ships[objp->instance].model_instance_num, eyep->parent, &eyep->pnt, &eyep->norm);
vm_vec_unrotate(&c_pos, &c_pos_in, &objp->orient);
vm_vec_add2(&c_pos, &objp->pos);
}
@@ -515,8 +515,8 @@ void warp_camera::do_frame(float in_frametime)
float tmp_angle = frand()*PI2;
tmp.xyz.x = 22.0f * (float)sin(tmp_angle);
tmp.xyz.y = -22.0f * (float)cos(tmp_angle);
tmp.xyz.x = 22.0f * sinf(tmp_angle);
tmp.xyz.y = -22.0f * cosf(tmp_angle);
this->set_velocity( &tmp, 0 );
}
@@ -540,8 +540,17 @@ void warp_camera::get_info(vec3d *position, matrix *orientation)
//*************************subtitle*************************
#define MAX_SUBTITLE_LINES 64
subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim, float in_display_time, float in_fade_time, color *in_text_color, int in_text_fontnum, bool center_x, bool center_y, int in_width, int in_height, bool in_post_shaded)
subtitle::subtitle(int in_x_pos, int in_y_pos, const char* in_text, const char* in_imageanim, float in_display_time,
float in_fade_time, const color *in_text_color, int in_text_fontnum, bool center_x, bool center_y, int in_width,
int in_height, bool in_post_shaded)
:display_time(-1.0f), fade_time(-1.0f), text_fontnum(-1), time_displayed(-1.0f), time_displayed_end(-1.0f),
post_shaded(false)
{
// Initialize color
gr_init_color(&text_color, 0, 0, 0);
SCP_string text_buf;
// basic init, this always has to be done
memset( imageanim, 0, sizeof(imageanim) );
memset( &text_pos, 0, 2*sizeof(int) );
@@ -551,17 +560,16 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim
if ( ((in_text != NULL) && (strlen(in_text) <= 0)) && ((in_imageanim != NULL) && (strlen(in_imageanim) <= 0)) )
return;
char text_buf[256];
if (in_text != NULL && in_text[0] != '\0')
{
strcpy_s(text_buf, in_text);
sexp_replace_variable_names_with_values(text_buf, 256);
in_text = text_buf;
text_buf = in_text;
sexp_replace_variable_names_with_values(text_buf);
in_text = text_buf.c_str();
}
int num_text_lines = 0;
char *text_line_ptrs[MAX_SUBTITLE_LINES];
const char *text_line_ptrs[MAX_SUBTITLE_LINES];
int text_line_lens[MAX_SUBTITLE_LINES];
//Setup text
@@ -569,11 +577,10 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim
int split_width = (in_width > 0) ? in_width : 200;
num_text_lines = split_str(in_text, split_width, text_line_lens, text_line_ptrs, MAX_SUBTITLE_LINES);
SCP_string temp_str;
for(int i = 0; i < num_text_lines; i++)
{
temp_str.assign(text_line_ptrs[i], text_line_lens[i]);
text_lines.push_back(temp_str);
text_buf.assign(text_line_ptrs[i], text_line_lens[i]);
text_lines.push_back(text_buf);
}
}
@@ -605,8 +612,8 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim
int old_fontnum;
if (text_fontnum >= 0)
{
old_fontnum = gr_get_current_fontnum();
gr_set_font(text_fontnum);
old_fontnum = font::get_current_fontnum();
font::set_font(text_fontnum);
}
else
{
@@ -627,7 +634,7 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim
// restore old font
if (old_fontnum >= 0)
{
gr_set_font(old_fontnum);
font::set_font(old_fontnum);
}
//Get image size
@@ -646,20 +653,20 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim
//Center it?
if(center_x)
image_pos.x = (gr_screen.max_w - tw)/2;
image_pos.x = (gr_screen.center_w - tw)/2 + gr_screen.center_offset_x;
if(center_y)
image_pos.y = (gr_screen.max_h - th)/2;
image_pos.y = (gr_screen.center_h - th)/2 + gr_screen.center_offset_y;
}
if(in_x_pos < 0 && !center_x)
image_pos.x += gr_screen.max_w + in_x_pos;
image_pos.x += gr_screen.center_offset_x + gr_screen.center_w + in_x_pos;
else if(!center_x)
image_pos.x += in_x_pos;
image_pos.x += gr_screen.center_offset_x + in_x_pos;
if(in_y_pos < 0 && !center_y)
image_pos.y += gr_screen.max_h + in_y_pos;
image_pos.y += gr_screen.center_offset_y + gr_screen.center_h + in_y_pos;
else if(!center_y)
image_pos.y += in_y_pos;
image_pos.y += gr_screen.center_offset_y + in_y_pos;
image_pos.w = in_width;
image_pos.h = in_height;
@@ -703,8 +710,8 @@ void subtitle::do_frame(float frametime)
int old_fontnum;
if (text_fontnum >= 0)
{
old_fontnum = gr_get_current_fontnum();
gr_set_font(text_fontnum);
old_fontnum = font::get_current_fontnum();
font::set_font(text_fontnum);
}
else
{
@@ -718,14 +725,14 @@ void subtitle::do_frame(float frametime)
for(SCP_vector<SCP_string>::iterator line = text_lines.begin(); line != text_lines.end(); ++line)
{
gr_string(x, y, (char*)line->c_str(), false);
gr_string(x, y, (char*)line->c_str(), GR_RESIZE_NONE);
y += font_height;
}
// restore old font
if (old_fontnum >= 0)
{
gr_set_font(old_fontnum);
font::set_font(old_fontnum);
}
if(image_id >= 0)
@@ -739,18 +746,18 @@ void subtitle::do_frame(float frametime)
vec3d scale;
bm_get_info(image_id, &orig_w, &orig_h);
scale.xyz.x = image_pos.w / (float) orig_w;
scale.xyz.y = image_pos.h / (float) orig_h;
scale.xyz.x = (image_pos.w > 0) ? (image_pos.w / (float) orig_w) : 1.0f;
scale.xyz.y = (image_pos.h > 0) ? (image_pos.h / (float) orig_h) : 1.0f;
scale.xyz.z = 1.0f;
gr_push_scale_matrix(&scale);
gr_bitmap(image_pos.x, image_pos.y, false);
gr_bitmap(fl2i(image_pos.x / scale.xyz.x), fl2i(image_pos.y / scale.xyz.y), GR_RESIZE_NONE);
gr_pop_scale_matrix();
}
// no scaling
else
{
gr_bitmap(image_pos.x, image_pos.y, false);
gr_bitmap(image_pos.x, image_pos.y, GR_RESIZE_NONE);
}
}
@@ -817,7 +824,7 @@ camid::camid()
sig = -1;
}
camid::camid(int n_idx, int n_sig)
camid::camid(size_t n_idx, int n_sig)
{
idx = n_idx;
sig = n_sig;
@@ -831,7 +838,7 @@ camera* camid::getCamera()
return Cameras[idx];
}
uint camid::getIndex()
size_t camid::getIndex()
{
return idx;
}
@@ -866,6 +873,9 @@ void cam_close()
{
//Set Current_camera to nothing
Current_camera = camid();
for (auto ii = Cameras.begin(); ii != Cameras.end(); ++ii) {
delete * ii;
}
Cameras.clear();
}
@@ -944,7 +954,7 @@ camid cam_get_current()
return Current_camera;
}
uint cam_get_num()
size_t cam_get_num()
{
return Cameras.size();
}
@@ -1078,4 +1088,4 @@ eye* get_submodel_eye(polymodel *pm, int submodel_num)
}
}
return NULL;
}
}
+6 -6
View File
@@ -2,11 +2,11 @@
#ifndef _CAMERA_H
#define _CAMERA_H
#include "graphics/2d.h"
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "physics/physics.h" //for avd
#include "globalincs/pstypes.h"
#include "graphics/2d.h"
#include "object/object.h"
#include "physics/physics.h" //for avd
#include <string>
@@ -137,8 +137,8 @@ private:
bool post_shaded;
public:
subtitle(int in_x_pos, int in_y_pos, char* in_text = NULL, char* in_imageanim = NULL,
float in_display_time = 0, float in_fade_time = 0.0f, color *in_text_color = NULL, int in_text_fontnum = -1,
subtitle(int in_x_pos, int in_y_pos, const char* in_text = NULL, const char* in_imageanim = NULL,
float in_display_time = 0, float in_fade_time = 0.0f, const color *in_text_color = NULL, int in_text_fontnum = -1,
bool center_x = false, bool center_y = false, int in_width = 0, int in_height = 0, bool post_shaded=false);
~subtitle();
@@ -166,7 +166,7 @@ void cam_reset_camera();
camid cam_lookup(char *name);
camid cam_get_camera(uint index);
camid cam_get_current();
uint cam_get_num();
size_t cam_get_num();
void get_turret_cam_pos(camera *cam, vec3d *pos);
void get_turret_cam_orient(camera *cam, matrix *ori);
+301 -253
View File
@@ -29,16 +29,17 @@
#endif
#include "cfile/cfile.h"
#include "parse/encrypt.h"
#include "cfile/cfilesystem.h"
#include "cfile/cfilearchive.h"
#include "cfile/cfilesystem.h"
#include "osapi/osapi.h"
#include "parse/encrypt.h"
#include <limits>
char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
#ifdef SCP_UNIX
char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
#ifdef SCP_UNIX
char Cfile_user_dir_legacy[CFILE_ROOT_DIRECTORY_LEN] = "";
#endif
// During cfile_init, verify that Pathtypes[n].index == n for each item
@@ -86,142 +87,160 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
{ CF_TYPE_CBANIMS, "data" DIR_SEPARATOR_STR "cbanims", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
{ CF_TYPE_INTEL_ANIMS, "data" DIR_SEPARATOR_STR "intelanims", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
{ CF_TYPE_SCRIPTS, "data" DIR_SEPARATOR_STR "scripts", ".lua .lc", CF_TYPE_DATA },
{ CF_TYPE_FICTION, "data" DIR_SEPARATOR_STR "fiction", ".txt", CF_TYPE_DATA },
{ CF_TYPE_FICTION, "data" DIR_SEPARATOR_STR "fiction", ".txt", CF_TYPE_DATA },
};
#define CFILE_STACK_MAX 8
int cfile_inited = 0;
int Cfile_stack_pos = 0;
static int Cfile_stack_pos = 0;
char Cfile_stack[CFILE_STACK_MAX][CFILE_ROOT_DIRECTORY_LEN];
static char Cfile_stack[CFILE_STACK_MAX][CFILE_ROOT_DIRECTORY_LEN];
Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS];
CFILE Cfile_list[MAX_CFILE_BLOCKS];
static CFILE Cfile_list[MAX_CFILE_BLOCKS];
char *Cfile_cdrom_dir = NULL;
static const char *Cfile_cdrom_dir = NULL;
//
// Function prototypes for internally-called functions
//
int cfget_cfile_block();
CFILE *cf_open_fill_cfblock(FILE * fp, int type);
CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size);
static int cfget_cfile_block();
static CFILE *cf_open_fill_cfblock(const char* source, int line, FILE * fp, int type);
static CFILE *cf_open_packed_cfblock(const char* source, int line, FILE *fp, int type, size_t offset, size_t size);
#if defined _WIN32
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type);
static CFILE *cf_open_mapped_fill_cfblock(const char* source, int line, HANDLE hFile, int type);
#elif defined SCP_UNIX
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type);
static CFILE *cf_open_mapped_fill_cfblock(const char* source, int line, FILE *fp, int type);
#endif
void cf_chksum_long_init();
static void cf_chksum_long_init();
void cfile_close()
static void dump_opened_files()
{
for (int i = 0; i < MAX_CFILE_BLOCKS; i++) {
auto cb = &Cfile_block_list[i];
if (cb->type != CFILE_BLOCK_UNUSED) {
mprintf((" %s:%d\n", cb->source_file, cb->line_num));
}
}
}
static void cfile_close()
{
mprintf(("Still opened files:\n"));
dump_opened_files();
cf_free_secondary_filelist();
}
// determine if the given path is in a root directory (c:\ or c:\freespace2.exe or c:\fred2.exe etc)
int cfile_in_root_dir(char *exe_path)
{
int token_count = 0;
char path_copy[CFILE_ROOT_DIRECTORY_LEN] = "";
char *tok;
// bogus
if(exe_path == NULL){
return 1;
}
// copy the path
memset(path_copy, 0, CFILE_ROOT_DIRECTORY_LEN);
strncpy(path_copy, exe_path, CFILE_ROOT_DIRECTORY_LEN - 1);
// count how many slashes there are in the path
tok = strtok(path_copy, DIR_SEPARATOR_STR);
if(tok == NULL){
return 1;
}
do {
token_count++;
tok = strtok(NULL, DIR_SEPARATOR_STR);
} while(tok != NULL);
#ifdef SCP_UNIX
// /freespace works, / does not
if(token_count <= 1) {
#define MIN_NUM_PATH_COMPONENTS 2 /* Directory + file */
#else
// C:/freespace works, C:/ does not
if(token_count <= 2){
#define MIN_NUM_PATH_COMPONENTS 3 /* Drive + directory + file */
#endif
return 1;
}
// not-root directory
return 0;
/**
* @brief Determine if the given path is in the root directory
*
* @param exe_path Path to executable
*
* @return true if root directory, false if not
*/
static bool cfile_in_root_dir(const char *exe_path)
{
int new_token;
int token_count = 0;
const char *p = exe_path;
Assert(exe_path != NULL);
do {
new_token = 0;
while (*p == DIR_SEPARATOR_CHAR) {
p++;
}
while ((*p != '\0') && (*p != DIR_SEPARATOR_CHAR)) {
new_token = 1;
p++;
}
token_count += new_token;
} while (*p != '\0');
return (token_count < MIN_NUM_PATH_COMPONENTS);
}
// cfile_init() initializes the cfile system. Called once at application start.
//
// returns: success ==> 0
// error ==> non-zero
//
int cfile_init(char *exe_dir, char *cdrom_dir)
/**
* @brief Initialize the cfile system. Called once at application start.
*
* @param exe_dir Path to a file (not a directory)
* @param cdrom_dir Path to a CD drive mount point (may be NULL)
*
* @return 0 On success
* @return 1 On error
*/
int cfile_init(const char *exe_dir, const char *cdrom_dir)
{
int i;
// initialize encryption
encrypt_init();
if ( !cfile_inited ) {
char buf[CFILE_ROOT_DIRECTORY_LEN];
if (cfile_inited) {
return 0;
}
cfile_inited = 1;
char buf[CFILE_ROOT_DIRECTORY_LEN];
memset(buf, 0, CFILE_ROOT_DIRECTORY_LEN);
strncpy(buf, exe_dir, CFILE_ROOT_DIRECTORY_LEN - 1);
i = strlen(buf);
strncpy(buf, exe_dir, CFILE_ROOT_DIRECTORY_LEN - 1);
buf[CFILE_ROOT_DIRECTORY_LEN - 1] = '\0';
size_t i = strlen(buf);
// are we in a root directory?
if(cfile_in_root_dir(buf)){
MessageBox((HWND)NULL, "FreeSpace2/Fred2 cannot be run from a drive root directory!", "Error", MB_OK);
return 1;
}
// are we in a root directory?
if(cfile_in_root_dir(buf)){
os::dialogs::Message(os::dialogs::MESSAGEBOX_ERROR, "FreeSpace2/Fred2 cannot be run from a drive root directory!");
return 1;
}
while (i--) {
if (buf[i] == DIR_SEPARATOR_CHAR){
break;
}
}
// This needs to be set here because cf_build_secondary_filelist assumes it to be true
cfile_inited = 1;
/*
* Determine the executable's directory. Note that DIR_SEPARATOR_CHAR
* is guaranteed to be found in the string else cfile_in_root_dir()
* would have failed.
*/
if (i >= 2) {
buf[i] = 0;
cfile_chdir(buf);
} else {
MessageBox((HWND)NULL, "Error trying to determine executable root directory!", "Error", MB_OK);
return 1;
}
char *p;
// set root directory
strncpy(Cfile_root_dir, buf, CFILE_ROOT_DIRECTORY_LEN-1);
p = strrchr(buf, DIR_SEPARATOR_CHAR);
*p = '\0';
cfile_chdir(buf);
// set root directory
strncpy(Cfile_root_dir, buf, CFILE_ROOT_DIRECTORY_LEN-1);
strncpy(Cfile_user_dir, os_get_config_path().c_str(), CFILE_ROOT_DIRECTORY_LEN-1);
#ifdef SCP_UNIX
snprintf(Cfile_user_dir, CFILE_ROOT_DIRECTORY_LEN-1, "%s/%s/", detect_home(), Osreg_user_dir);
// Initialize path of old pilot files
extern const char* Osreg_user_dir_legacy;
snprintf(Cfile_user_dir_legacy, CFILE_ROOT_DIRECTORY_LEN-1, "%s/%s/", getenv("HOME"), Osreg_user_dir_legacy);
#endif
for ( i = 0; i < MAX_CFILE_BLOCKS; i++ ) {
Cfile_block_list[i].type = CFILE_BLOCK_UNUSED;
}
// 32 bit CRC table init
cf_chksum_long_init();
Cfile_cdrom_dir = cdrom_dir;
cf_build_secondary_filelist(Cfile_cdrom_dir);
atexit( cfile_close );
for (i = 0; i < MAX_CFILE_BLOCKS; i++) {
Cfile_block_list[i].type = CFILE_BLOCK_UNUSED;
}
// 32 bit CRC table init
cf_chksum_long_init();
Cfile_cdrom_dir = cdrom_dir;
cf_build_secondary_filelist(Cfile_cdrom_dir);
atexit(cfile_close);
return 0;
}
@@ -235,13 +254,13 @@ void cfile_refresh()
#ifdef _WIN32
// Changes to a drive if valid.. 1=A, 2=B, etc
// If flag, then changes to it.
// Returns 0 if not-valid, 1 if valid.
int cfile_chdrive( int DriveNum, int flag )
{
int Valid = 0;
#ifdef _WIN32
int n, org;
org = -1;
@@ -257,99 +276,108 @@ int cfile_chdrive( int DriveNum, int flag )
if ( (!flag) && (n != org) )
_chdrive( org );
#endif // _WIN32
return Valid;
}
#endif // _WIN32
// push current directory on a 'stack' (so we can restore it) and change the directory
int cfile_push_chdir(int type)
/**
* @brief Common code for changing directory
*
* @param new_dir Directory to which to change
* @param cur_dir Current directory (only used on Windows)
*
* @retval 0 Success
* @retval 1 Failed to change to new directory's drive (Windows only)
* @retval 2 Failed to change to new directory
*/
static int _cfile_chdir(const char *new_dir, const char *cur_dir __UNUSED)
{
int e;
char dir[CFILE_ROOT_DIRECTORY_LEN];
char OriginalDirectory[CFILE_ROOT_DIRECTORY_LEN];
char *Path = NULL;
char NoDir[] = "\\.";
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN-1);
Assert(Cfile_stack_pos < CFILE_STACK_MAX);
if ( Cfile_stack_pos >= CFILE_STACK_MAX )
return -1;
strncpy(Cfile_stack[Cfile_stack_pos++], OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN-1);
cf_create_default_path_string( dir, sizeof(dir)-1, type, NULL );
int status;
const char *path = NULL;
const char no_dir[] = "\\.";
#ifdef _WIN32
char *colon_pos = strchr(dir, ':');
const char *colon = strchr(new_dir, ':');
if (colon_pos) {
if (!cfile_chdrive( tolower(*(colon_pos - 1)) - 'a' + 1, 1))
if (colon) {
if (!cfile_chdrive(tolower(*(colon - 1)) - 'a' + 1, 1))
return 1;
Path = colon_pos+1;
path = colon + 1;
} else
#endif // _WIN32
#endif /* _WIN32 */
{
Path = dir;
path = new_dir;
}
if (!(*Path)) {
Path = NoDir;
if (*path == '\0') {
path = no_dir;
}
// This chdir might get a critical error!
e = _chdir( Path );
if (e) {
/* This chdir might get a critical error! */
status = _chdir(path);
if (status != 0) {
#ifdef _WIN32
cfile_chdrive( tolower(OriginalDirectory[0]) - 'a' + 1, 1 );
#endif // _WIN32
cfile_chdrive(tolower(cur_dir[0]) - 'a' + 1, 1);
#endif /* _WIN32 */
return 2;
}
return 0;
}
int cfile_chdir(char *dir)
/**
* @brief Push current directory onto a 'stack' and change to a new directory
*
* The current directory is pushed onto a 'stack' so that it can be easily
* restored at a later time. The new directory is derived from @a type.
*
* @param type path type (CF_TYPE_xxx)
*
* @retval -1 'Stack' is full
* @retval 0 Success
* @retval 1 Failed to change to new directory's drive (Windows only)
* @retval 2 Failed to change to new directory
*/
int cfile_push_chdir(int type)
{
int e;
char dir[CFILE_ROOT_DIRECTORY_LEN];
char OriginalDirectory[CFILE_ROOT_DIRECTORY_LEN];
char *Path = NULL;
char NoDir[] = "\\.";
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN-1);
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN - 1);
#ifdef _WIN32
char *colon_pos = strchr(dir, ':');
if (colon_pos) {
if (!cfile_chdrive( tolower(*(colon_pos - 1)) - 'a' + 1, 1))
return 1;
Assert(Cfile_stack_pos < CFILE_STACK_MAX);
Path = colon_pos+1;
} else
#endif // _WIN32
{
Path = dir;
if (Cfile_stack_pos >= CFILE_STACK_MAX) {
return -1;
}
if (!(*Path)) {
Path = NoDir;
}
strncpy(Cfile_stack[Cfile_stack_pos++], OriginalDirectory,
CFILE_ROOT_DIRECTORY_LEN - 1);
// This chdir might get a critical error!
e = _chdir( Path );
if (e) {
#ifdef _WIN32
cfile_chdrive( tolower(OriginalDirectory[0]) - 'a' + 1, 1 );
#endif // _WIN32
return 2;
}
cf_create_default_path_string(dir, sizeof(dir) - 1, type, NULL);
return 0;
return _cfile_chdir(dir, OriginalDirectory);
}
/**
* @brief Change to the specified directory
*
* @param dir Directory
*
* @retval 0 Success
* @retval 1 Failed to change to new directory's drive (Windows only)
* @retval 2 Failed to change to new directory
*/
int cfile_chdir(const char *dir)
{
char OriginalDirectory[CFILE_ROOT_DIRECTORY_LEN];
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN - 1);
return _cfile_chdir(dir, OriginalDirectory);
}
int cfile_pop_dir()
@@ -379,7 +407,7 @@ int cfile_flush_dir(int dir_type)
// proceed to delete the files
del_count = 0;
#if defined _WIN32
int find_handle;
intptr_t find_handle;
_finddata_t find;
find_handle = _findfirst( "*", &find );
if (find_handle != -1) {
@@ -402,7 +430,7 @@ int cfile_flush_dir(int dir_type)
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[i], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
// delete the file
@@ -429,13 +457,12 @@ int cfile_flush_dir(int dir_type)
// filename = name of filename or filepath to process
// ext = extension to add. Must start with the period
// Returns: new filename or filepath with extension.
char *cf_add_ext(char *filename, char *ext)
char *cf_add_ext(const char *filename, const char *ext)
{
int flen, elen;
static char path[MAX_PATH_LEN];
flen = strlen(filename);
elen = strlen(ext);
size_t flen = strlen(filename);
size_t elen = strlen(ext);
Assert(flen < MAX_PATH_LEN);
strcpy_s(path, filename);
if ((flen < 4) || stricmp(path + flen - elen, ext)) {
@@ -446,39 +473,29 @@ char *cf_add_ext(char *filename, char *ext)
return path;
}
// Deletes a file. Returns 0 if an error occurs, 1 on success
int cf_delete(char *filename, int dir_type)
/**
* @brief Delete the specified file
*
* @param filename Name of file to delete
* @param path_type Path type (CF_TYPE_xxx)
*
* @return 0 on failure, 1 on success
*/
int cf_delete(const char *filename, int path_type)
{
char longname[MAX_PATH_LEN];
Assert( CF_TYPE_SPECIFIED(dir_type) );
Assert(CF_TYPE_SPECIFIED(path_type));
cf_create_default_path_string( longname, sizeof(longname)-1, dir_type, filename );
cf_create_default_path_string(longname, sizeof(longname) - 1,
path_type, filename);
FILE *fp = fopen(longname, "rb");
if (fp) {
// delete the file
fclose(fp);
if(_unlink(longname) == -1)
{
//ERROR - file is probably read only
return 0;
}
else
{
return 1;
}
}
else
{
//ERROR - file doesn't exist
return 0;
}
return (_unlink(longname) != -1);
}
// Same as _access function to read a file's access bits
int cf_access(char *filename, int dir_type, int mode)
int cf_access(const char *filename, int dir_type, int mode)
{
char longname[MAX_PATH_LEN];
@@ -492,29 +509,23 @@ int cf_access(char *filename, int dir_type, int mode)
// Returns 1 if the file exists, 0 if not.
// Checks only the file system.
int cf_exists(char *filename, int dir_type)
// cf_find_file_location checks the filesystem before VPs
// If offset is 0, it was found in the filesystem, so offset is boolean false
// If offset equates to boolean true, it was found in a VP and the logic will negate the function return
int cf_exists(const char *filename, int dir_type)
{
char longname[MAX_PATH_LEN];
size_t offset = 1;
Assert(CF_TYPE_SPECIFIED(dir_type));
if ( (filename == NULL) || !strlen(filename) )
return 0;
cf_create_default_path_string(longname, sizeof(longname) - 1, dir_type, filename);
FILE *fp = fopen(longname, "rb");
if (fp)
{
// Goober5000 - these were switched, causing the fclose to be unreachable
fclose(fp);
return 1;
}
return 0;
return (cf_find_file_location(filename, dir_type, 0, NULL, NULL, &offset) && !offset);
}
// Goober5000
// Returns !0 if the file exists, 0 if not.
// Checks both the file system and the VPs.
int cf_exists_full(char *filename, int dir_type)
int cf_exists_full(const char *filename, int dir_type)
{
if ( (filename == NULL) || !strlen(filename) )
return 0;
@@ -523,7 +534,7 @@ int cf_exists_full(char *filename, int dir_type)
}
// same as the above, but with extension check
int cf_exists_full_ext(char *filename, int dir_type, const int num_ext, const char **ext_list)
int cf_exists_full_ext(const char *filename, int dir_type, const int num_ext, const char **ext_list)
{
if ( (filename == NULL) || !strlen(filename) )
return 0;
@@ -535,7 +546,7 @@ int cf_exists_full_ext(char *filename, int dir_type, const int num_ext, const ch
}
#ifdef _WIN32
void cf_attrib(char *filename, int set, int clear, int dir_type)
void cf_attrib(const char *filename, int set, int clear, int dir_type)
{
char longname[MAX_PATH_LEN];
@@ -554,7 +565,7 @@ void cf_attrib(char *filename, int set, int clear, int dir_type)
}
#endif
int cf_rename(char *old_name, char *name, int dir_type)
int cf_rename(const char *old_name, const char *name, int dir_type)
{
Assert( CF_TYPE_SPECIFIED(dir_type) );
@@ -581,6 +592,28 @@ int cf_rename(char *old_name, char *name, int dir_type)
}
// This takes a path (e.g. "C:\Games\FreeSpace2\Lots\More\Directories") and creates it in its entirety.
// Do note that this requires the path to have normalized directory separators as defined by DIR_SEPARATOR_CHAR
static void mkdir_recursive(const char *path) {
size_t pre = 0, pos;
SCP_string tmp(path);
SCP_string dir;
if (tmp[tmp.size() - 1] != DIR_SEPARATOR_CHAR) {
// force trailing / so we can handle everything in loop
tmp += DIR_SEPARATOR_CHAR;
}
while ((pos = tmp.find_first_of(DIR_SEPARATOR_CHAR, pre)) != std::string::npos) {
dir = tmp.substr(0, pos++);
pre = pos;
if (dir.size() == 0) continue; // if leading / first time is 0 length
_mkdir(dir.c_str());
}
}
// Creates the directory path if it doesn't exist. Even creates all its
// parent paths.
void cf_create_directory( int dir_type )
@@ -589,7 +622,7 @@ void cf_create_directory( int dir_type )
int dir_tree[CF_MAX_PATH_TYPES];
char longname[MAX_PATH_LEN];
Assert( CF_TYPE_SPECIFIED(dir_type) );
Assertion( CF_TYPE_SPECIFIED(dir_type), "Invalid dir_type passed to cf_create_directory." );
int current_dir = dir_type;
@@ -606,13 +639,9 @@ void cf_create_directory( int dir_type )
for (i=num_dirs-1; i>=0; i-- ) {
cf_create_default_path_string( longname, sizeof(longname)-1, dir_tree[i], NULL );
if ( _mkdir(longname)==0 ) {
mprintf(( "CFILE: Created new directory '%s'\n", longname ));
}
mprintf(( "CFILE: Creating new directory '%s'\n", longname ));
mkdir_recursive(longname);
}
}
@@ -634,7 +663,7 @@ extern int game_cd_changed();
// error ==> NULL
//
CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize)
CFILE *_cfopen(const char* source, int line, const char *file_path, const char *mode, int type, int dir_type, bool localize)
{
/* Bobboau, what is this doing here? 31 is way too short... - Goober5000
if( strlen(file_path) > 31 )
@@ -719,7 +748,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
FILE *fp = fopen(longname, happy_mode);
if (fp) {
return cf_open_fill_cfblock(fp, dir_type);
return cf_open_fill_cfblock(source, line, fp, dir_type);
}
return NULL;
}
@@ -728,7 +757,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
//================================================
// Search for file on disk, on cdrom, or in a packfile
int offset, size;
size_t offset, size;
char copy_file_path[MAX_PATH_LEN]; // FIX change in memory from cf_find_file_location
strcpy_s(copy_file_path, file_path);
@@ -736,6 +765,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
if ( cf_find_file_location( copy_file_path, dir_type, sizeof(longname) - 1, longname, &size, &offset, localize ) ) {
// Fount it, now create a cfile out of it
nprintf(("CFileDebug", "Requested file %s found at: %s\n", file_path, longname));
if ( type & CFILE_MEMORY_MAPPED ) {
@@ -747,12 +777,12 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
hFile = CreateFile(longname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
return cf_open_mapped_fill_cfblock(hFile, dir_type);
return cf_open_mapped_fill_cfblock(source, line, hFile, dir_type);
}
#elif defined SCP_UNIX
FILE *fp = fopen( longname, "rb" );
if (fp) {
return cf_open_mapped_fill_cfblock(fp, dir_type);
return cf_open_mapped_fill_cfblock(source, line, fp, dir_type);
}
#endif
}
@@ -764,10 +794,10 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
if ( fp ) {
if ( offset ) {
// Found it in a pack file
return cf_open_packed_cfblock(fp, dir_type, offset, size );
return cf_open_packed_cfblock(source, line, fp, dir_type, offset, size );
} else {
// Found it in a normal file
return cf_open_fill_cfblock(fp, dir_type);
return cf_open_fill_cfblock(source, line, fp, dir_type);
}
}
}
@@ -788,7 +818,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
// returns: success ==> address of CFILE structure
// error ==> NULL
//
CFILE *cfopen_special(char *file_path, char *mode, const int size, const int offset, int dir_type)
CFILE *_cfopen_special(const char* source, int line, const char *file_path, const char *mode, const size_t size, const size_t offset, int dir_type)
{
if ( !cfile_inited) {
Int3();
@@ -797,7 +827,6 @@ CFILE *cfopen_special(char *file_path, char *mode, const int size, const int off
Assert( file_path && strlen(file_path) );
Assert( mode != NULL );
Assert( offset >= 0 );
// cfopen_special() only supports reading files, not creating them
if ( strchr(mode, 'w') ) {
@@ -813,10 +842,10 @@ CFILE *cfopen_special(char *file_path, char *mode, const int size, const int off
if ( offset ) {
// it's in a pack file
return cf_open_packed_cfblock(fp, dir_type, offset, size);
return cf_open_packed_cfblock(source, line, fp, dir_type, offset, size);
} else {
// it's a normal file
return cf_open_fill_cfblock(fp, dir_type);
return cf_open_fill_cfblock(source, line, fp, dir_type);
}
}
@@ -835,7 +864,7 @@ CFILE *ctmpfile()
FILE *fp;
fp = tmpfile();
if ( fp )
return cf_open_fill_cfblock(fp, 0);
return cf_open_fill_cfblock(LOCATION, fp, 0);
else
return NULL;
}
@@ -848,7 +877,7 @@ CFILE *ctmpfile()
// returns: success ==> index in Cfile_block_list[] array
// failure ==> -1
//
int cfget_cfile_block()
static int cfget_cfile_block()
{
int i;
Cfile_block *cb;
@@ -865,7 +894,13 @@ int cfget_cfile_block()
// If we've reached this point, a free Cfile_block could not be found
nprintf(("Warning","A free Cfile_block could not be found.\n"));
Assert(0); // out of free cfile blocks
// Dump a list of all opened files
mprintf(("Out of cfile blocks! Currently opened files:\n"));
dump_opened_files();
Assertion(false, "There are no more free cfile blocks. This means that there are too many files opened by FSO.\n"
"This is probably caused by a programming or scripting error where a file does not get closed."); // out of free cfile blocks
return -1;
}
@@ -943,7 +978,7 @@ int cf_is_valid(CFILE *cfile)
// returns: success ==> ptr to CFILE structure.
// error ==> NULL
//
CFILE *cf_open_fill_cfblock(FILE *fp, int type)
static CFILE *cf_open_fill_cfblock(const char* source, int line, FILE *fp, int type)
{
int cfile_block_index;
@@ -962,6 +997,9 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
cfbp->fp = fp;
cfbp->dir_type = type;
cfbp->max_read_len = 0;
cfbp->source_file = source;
cfbp->line_num = line;
int pos = ftell(fp);
if(pos == -1L)
@@ -979,7 +1017,7 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
// returns: success ==> ptr to CFILE structure.
// error ==> NULL
//
CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
static CFILE *cf_open_packed_cfblock(const char* source, int line, FILE *fp, int type, size_t offset, size_t size)
{
// Found it in a pack file
int cfile_block_index;
@@ -1001,6 +1039,9 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
cfbp->dir_type = type;
cfbp->max_read_len = 0;
cfbp->source_file = source;
cfbp->line_num = line;
cf_init_lowlevel_read_code(cfp,offset, size, 0 );
return cfp;
@@ -1016,9 +1057,9 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
// returns: ptr CFILE structure.
//
#if defined _WIN32
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type)
static CFILE *cf_open_mapped_fill_cfblock(const char* source, int line, HANDLE hFile, int type)
#elif defined SCP_UNIX
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
static CFILE *cf_open_mapped_fill_cfblock(const char* source, int line, FILE *fp, int type)
#endif
{
int cfile_block_index;
@@ -1045,6 +1086,9 @@ CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
#endif
cfbp->dir_type = type;
cfbp->source_file = source;
cfbp->line_num = line;
cf_init_lowlevel_read_code(cfp, 0, 0, 0 );
#if defined _WIN32
cfbp->hMapFile = CreateFileMapping(cfbp->hInFile, NULL, PAGE_READONLY, 0, 0, NULL);
@@ -1337,12 +1381,12 @@ int cfwrite_char(char b, CFILE *file)
return cfwrite( &b, sizeof(b), 1, file);
}
int cfwrite_string(char *buf, CFILE *file)
int cfwrite_string(const char *buf, CFILE *file)
{
if ( (!buf) || (buf && !buf[0]) ) {
return cfwrite_char(0, file);
}
int len = strlen(buf);
int len = (int)strlen(buf);
if(!cfwrite(buf, len, 1, file)){
return 0;
}
@@ -1351,7 +1395,7 @@ int cfwrite_string(char *buf, CFILE *file)
int cfwrite_string_len(const char *buf, CFILE *file)
{
int len = strlen(buf);
int len = (int)strlen(buf);
if(!cfwrite_int(len, file)){
return 0;
@@ -1377,7 +1421,11 @@ int cfilelength( CFILE * cfile )
Assert(cb->fp != NULL);
// cb->size gets set at cfopen
return cb->size;
// The rest of the code still uses ints, do an overflow check to detect cases where this fails
Assertion(cb->size <= static_cast<size_t>(std::numeric_limits<int>::max()),
"Integer overflow in cfilelength! A file is too large (but I don't know which...).");
return (int) cb->size;
}
// cfwrite() writes to the file
@@ -1422,7 +1470,7 @@ int cfwrite(const void *buf, int elsize, int nelem, CFILE *cfile)
Assert( cb->size == filelength(fileno(cb->fp)) );
#endif
return ((int)bytes_written / elsize);
return (int)(bytes_written / elsize);
}
@@ -1475,7 +1523,7 @@ int cfputc(int c, CFILE *cfile)
// returns: success ==> non-negative value
// error ==> EOF
//
int cfputs(char *str, CFILE *cfile)
int cfputs(const char *str, CFILE *cfile)
{
if(!cf_is_valid(cfile))
return EOF;
@@ -1580,7 +1628,7 @@ char *cfgets(char *buf, int n, CFILE *cfile)
// CRC code for mission validation. given to us by Kevin Bentley on 7/20/98. Some sort of
// checksumming code that he wrote a while ago.
#define CRC32_POLYNOMIAL 0xEDB88320
uint CRCTable[256];
static uint CRCTable[256];
#define CF_CHKSUM_SAMPLE_SIZE 512
@@ -1603,7 +1651,7 @@ ushort cf_add_chksum_short(ushort seed, ubyte *buffer, int size)
}
// update cur_chksum with the chksum of the new_data of size new_data_size
uint cf_add_chksum_long(uint seed, ubyte *buffer, int size)
uint cf_add_chksum_long(uint seed, ubyte *buffer, size_t size)
{
uint crc;
ubyte *p;
@@ -1617,7 +1665,7 @@ uint cf_add_chksum_long(uint seed, ubyte *buffer, int size)
return crc;
}
void cf_chksum_long_init()
static void cf_chksum_long_init()
{
int i, j;
uint crc;
@@ -1638,7 +1686,7 @@ void cf_chksum_long_init()
// single function convenient to use for both short and long checksums
// NOTE : only one of chk_short or chk_long must be non-NULL (indicating which checksum to perform)
int cf_chksum_do(CFILE *cfile, ushort *chk_short, uint *chk_long, int max_size)
static int cf_chksum_do(CFILE *cfile, ushort *chk_short, uint *chk_long, int max_size)
{
ubyte cf_buffer[CF_CHKSUM_SAMPLE_SIZE];
int is_long;
@@ -1693,16 +1741,14 @@ int cf_chksum_do(CFILE *cfile, ushort *chk_short, uint *chk_long, int max_size)
}
// get the chksum of a pack file (VP)
int cf_chksum_pack(char *filename, uint *chk_long, bool full)
int cf_chksum_pack(const char *filename, uint *chk_long, bool full)
{
const int safe_size = 2097152; // 2 Meg
const size_t safe_size = 2097152; // 2 Meg
const int header_offset = 32; // skip 32bytes for header (header is currently smaller than this though)
ubyte cf_buffer[CF_CHKSUM_SAMPLE_SIZE];
int cf_len = 0;
int cf_total;
int read_size;
int max_size;
size_t read_size;
size_t max_size;
if (chk_long == NULL) {
Int3();
@@ -1720,7 +1766,7 @@ int cf_chksum_pack(char *filename, uint *chk_long, bool full)
// get the max size
fseek(fp, 0, SEEK_END);
max_size = ftell(fp);
max_size = (size_t)ftell(fp);
// maybe do a chksum of the entire file
if (full) {
@@ -1728,17 +1774,19 @@ int cf_chksum_pack(char *filename, uint *chk_long, bool full)
}
// othewise it's only a partial check
else {
CLAMP(max_size, 0, safe_size);
if (max_size > safe_size) {
max_size = safe_size;
}
Assertion(max_size > header_offset,
"max_size (%d) > header_offset in packfile %s", max_size, filename);
"max_size (" SIZE_T_ARG ") > header_offset in packfile %s", max_size, filename);
max_size -= header_offset;
fseek(fp, -(max_size), SEEK_END);
fseek(fp, -((long)max_size), SEEK_END);
}
cf_total = 0;
size_t cf_total = 0;
size_t cf_len = 0;
do {
// determine how much we want to read
if ( (max_size - cf_total) >= CF_CHKSUM_SAMPLE_SIZE )
@@ -1762,7 +1810,7 @@ int cf_chksum_pack(char *filename, uint *chk_long, bool full)
return 1;
}
// get the 2 byte checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_short(char *filename, ushort *chksum, int max_size, int cf_type)
int cf_chksum_short(const char *filename, ushort *chksum, int max_size, int cf_type)
{
int ret_val;
CFILE *cfile = NULL;
@@ -1812,7 +1860,7 @@ int cf_chksum_short(CFILE *file, ushort *chksum, int max_size)
}
// get the 32 bit CRC checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_long(char *filename, uint *chksum, int max_size, int cf_type)
int cf_chksum_long(const char *filename, uint *chksum, int max_size, int cf_type)
{
int ret_val;
CFILE *cfile = NULL;
+33 -28
View File
@@ -99,7 +99,7 @@ typedef struct {
// callback function used for get_file_list() to filter files to be added to list. Return 1
// to add file to list, or 0 to not add it.
extern int (*Get_file_list_filter)(char *filename);
extern int (*Get_file_list_filter)(const char *filename);
// extra check for child directory under CF_TYPE_*
// NOTE: if specified cf_get_file_list() will not search pack files!
@@ -109,13 +109,13 @@ extern const char *Get_file_list_child;
// cfile directory. valid after cfile_init() returns successfully
#define CFILE_ROOT_DIRECTORY_LEN 256
extern char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN];
#ifdef SCP_UNIX
extern char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN];
#ifdef SCP_UNIX
extern char Cfile_user_dir_legacy[CFILE_ROOT_DIRECTORY_LEN];
#endif
//================= LOW-LEVEL FUNCTIONS ==================
// Call this once at the beginning of the program
int cfile_init(char *exe_dir,char *cdrom_dir=NULL);
int cfile_init(const char *exe_dir, const char *cdrom_dir=NULL);
// Call this if pack files got added or removed or the
// cdrom changed. This will refresh the list of filenames
@@ -123,18 +123,23 @@ int cfile_init(char *exe_dir,char *cdrom_dir=NULL);
void cfile_refresh();
// add an extension to a filename if it doesn't already have it
char *cf_add_ext(char *filename, char *ext);
char *cf_add_ext(const char *filename, const char *ext);
// return CF_TYPE (directory location type) of a CFILE you called cfopen() successfully on.
int cf_get_dir_type(CFILE *cfile);
// Opens the file. If no path is given, use the extension to look into the
// default path. If mode is NULL, delete the file.
CFILE *cfopen(char *filename, char *mode, int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
CFILE *_cfopen(const char* source_file, int line, const char *filename, const char *mode,
int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
#define cfopen(...) _cfopen(LOCATION, __VA_ARGS__) // Pass source location to the function
// like cfopen(), but it accepts a fully qualified path only (ie, the result of a cf_find_file_location() call)
// NOTE: only supports reading files!!
CFILE *cfopen_special(char *file_path, char *mode, const int size, const int offset, int dir_type = CF_TYPE_ANY);
CFILE *_cfopen_special(const char* source_file, int line, const char *file_path, const char *mode,
const size_t size, const size_t offset, int dir_type = CF_TYPE_ANY);
#define cfopen_special(...) _cfopen_special(LOCATION, __VA_ARGS__) // Pass source location to the function
// Flush the open file buffer
int cflush(CFILE *cfile);
@@ -149,21 +154,21 @@ void cf_set_version( CFILE * cfile, int version );
void cf_set_max_read_len(CFILE *cfile, size_t len);
// Deletes a file. Returns 0 on error, 1 if successful
int cf_delete(char *filename, int dir_type);
int cf_delete(const char *filename, int dir_type);
// Same as _access function to read a file's access bits
int cf_access(char *filename, int dir_type, int mode);
int cf_access(const char *filename, int dir_type, int mode);
// Returns 1 if the file exists, 0 if not.
// Checks only the file system.
int cf_exists(char *filename, int dir_type);
int cf_exists(const char *filename, int dir_type);
// Goober5000
// Returns 1 if the file exists, 0 if not.
// Checks both the file system and the VPs.
int cf_exists_full(char *filename, int dir_type);
int cf_exists_full(const char *filename, int dir_type);
// check num_ext worth of ext_list extensions
int cf_exists_full_ext(char *filename, int dir_type, const int num_ext, const char **ext_list);
int cf_exists_full_ext(const char *filename, int dir_type, const int num_ext, const char **ext_list);
// ctmpfile() opens a temporary file stream. File is deleted automatically when closed
CFILE *ctmpfile();
@@ -197,7 +202,7 @@ int cftell(CFILE *fp);
int cfputc(int c, CFILE *cfile);
// cfputs() writes a string to a file
int cfputs(char *str, CFILE *cfile);
int cfputs(const char *str, CFILE *cfile);
// cfgetc() reads a character to a file
int cfgetc(CFILE *cfile);
@@ -212,20 +217,20 @@ int cfeof(CFILE *cfile);
void *cf_returndata(CFILE *cfile);
// get the 2 byte checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_short(char *filename, ushort *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
int cf_chksum_short(const char *filename, ushort *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
// get the 2 byte checksum of the passed file - return 0 if operation failed, 1 if succeeded
// NOTE : preserves current file position
int cf_chksum_short(CFILE *file, ushort *chksum, int max_size = -1);
// get the 32 bit CRC checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_long(char *filename, uint *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
int cf_chksum_long(const char *filename, uint *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
// get the 32 bit CRC checksum of the passed file - return 0 if operation failed, 1 if succeeded
// NOTE : preserves current file position
int cf_chksum_long(CFILE *file, uint *chksum, int max_size = -1);
int cf_chksum_pack(char *filename, uint *chk_long, bool full = false);
int cf_chksum_pack(const char *filename, uint *chk_long, bool full = false);
// convenient for misc checksumming purposes ------------------------------------------
@@ -233,21 +238,21 @@ int cf_chksum_pack(char *filename, uint *chk_long, bool full = false);
ushort cf_add_chksum_short(ushort seed, ubyte *buffer, int size);
// update cur_chksum with the chksum of the new_data of size new_data_size
uint cf_add_chksum_long(uint seed, ubyte *buffer, int size);
uint cf_add_chksum_long(uint seed, ubyte *buffer, size_t size);
// convenient for misc checksumming purposes ------------------------------------------
//================= HIGH LEVEL FUNCTIONS ==================
int cfexist(char *filename); // Returns true if file exists on disk (1) or in hog (2).
int cfexist(const char *filename); // Returns true if file exists on disk (1) or in hog (2).
// rename a file, utilizing the extension to determine where file is.
#define CF_RENAME_SUCCESS 0 // successfully renamed the file
#define CF_RENAME_FAIL_ACCESS 1 // new name could not be created
#define CF_RENAME_FAIL_EXIST 2 // old name does not exist
int cf_rename(char *old_name, char *name, int type = CF_TYPE_ANY );
int cf_rename(const char *old_name, const char *name, int type = CF_TYPE_ANY );
// changes the attributes of a file
void cf_attrib(char *name, int set, int clear, int type);
void cf_attrib(const char *name, int set, int clear, int type);
// flush (delete all files in) the passed directory (by type), return the # of files deleted
// NOTE : WILL NOT DELETE READ-ONLY FILES
@@ -294,7 +299,7 @@ int cfwrite_vector(vec3d *vec, CFILE *file);
int cfwrite_angles(angles *ang, CFILE *file);
// writes variable length, null-termined string.
int cfwrite_string(char *buf, CFILE *file);
int cfwrite_string(const char *buf, CFILE *file);
/**
* @brief Write a fixed length string (not including its null terminator), with the length stored in file
@@ -304,9 +309,9 @@ int cfwrite_string(char *buf, CFILE *file);
*/
int cfwrite_string_len(const char *buf, CFILE *file);
int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter, int sort = CF_SORT_NONE, SCP_vector<file_list_info> *info = NULL );
int cf_get_file_list( int max, char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, const char *filter, int sort = CF_SORT_NONE, SCP_vector<file_list_info> *info = NULL );
int cf_get_file_list( int max, char **list, int type, const char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int type, const char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
void cf_sort_filenames( int n, char **list, int sort, file_list_info *info = NULL );
void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_list_info> *info = NULL );
@@ -319,7 +324,7 @@ void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_
// size - File size
// offset - Offset into pack file. 0 if not a packfile.
// Returns: If not found returns 0.
int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize = false);
int cf_find_file_location( const char *filespec, int pathtype, int max_out, char *pack_filename, size_t *size, size_t *offset, bool localize = false);
// Searches for a file. Follows all rules and precedence and searches
// CD's and pack files. Searches all locations in order for first filename using ext filter list.
@@ -333,10 +338,10 @@ int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack
// offset - Offset into pack file. 0 if not a packfile.
// Returns: If not found returns -1, else returns offset into ext_list.
// (NOTE: This function is exponentially slow, so don't use it unless truely needed!!)
int cf_find_file_location_ext(char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out = 0, char *pack_filename = NULL, int *size = NULL, int *offset = NULL, bool localize = false);
int cf_find_file_location_ext(const char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out = 0, char *pack_filename = NULL, size_t *size = NULL, size_t *offset = NULL, bool localize = false);
// Functions to change directories
int cfile_chdir(char *dir);
int cfile_chdir(const char *dir);
#ifdef _WIN32
int cfile_chdrive(int DriveNum, int flag);
@@ -387,6 +392,6 @@ namespace cfile
}
};
};
}
#endif /* __CFILE_H__ */
+25 -27
View File
@@ -27,13 +27,14 @@
#include "luaconf.h"
#include <sstream>
#include <limits>
#define CHECK_POSITION
// Called once to setup the low-level reading code.
void cf_init_lowlevel_read_code( CFILE * cfile, int lib_offset, int size, int pos )
void cf_init_lowlevel_read_code( CFILE * cfile, size_t lib_offset, size_t size, size_t pos )
{
Assert(cfile != NULL);
@@ -47,13 +48,12 @@ void cf_init_lowlevel_read_code( CFILE * cfile, int lib_offset, int size, int po
if ( cb->fp ) {
if ( cb->lib_offset ) {
fseek( cb->fp, cb->lib_offset, SEEK_SET );
fseek( cb->fp, (long)cb->lib_offset, SEEK_SET );
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
auto raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
}
}
@@ -84,9 +84,8 @@ int cfeof(CFILE *cfile)
Assert(cb->fp != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
auto raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
if (cb->raw_position >= cb->size ) {
@@ -116,12 +115,14 @@ int cftell( CFILE * cfile )
Assert(cb->fp != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
auto raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
return cb->raw_position;
// The rest of the code still uses ints, do an overflow check to detect cases where this fails
Assertion(cb->raw_position <= static_cast<size_t>(std::numeric_limits<int>::max()),
"Integer overflow in cftell, a file is probably too large (but I don't know which one).");
return (int) cb->raw_position;
}
@@ -143,7 +144,7 @@ int cfseek( CFILE *cfile, int offset, int where )
Assert( !cb->data );
Assert( cb->fp != NULL );
int goal_position;
size_t goal_position;
switch( where ) {
case CF_SEEK_SET:
@@ -162,13 +163,12 @@ int cfseek( CFILE *cfile, int offset, int where )
return 1;
}
int result = fseek(cb->fp, goal_position, SEEK_SET );
int result = fseek(cb->fp, (long)goal_position, SEEK_SET );
cb->raw_position = goal_position - cb->lib_offset;
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int tmp_offset;
tmp_offset = (int)ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
auto tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
return result;
@@ -185,7 +185,7 @@ int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
if(!cf_is_valid(cfile))
return 0;
int size = elsize*nelem;
size_t size = elsize*nelem;
if(buf == NULL || size <= 0)
return 0;
@@ -208,7 +208,7 @@ int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
}
if (cb->max_read_len) {
if ( (size_t)(cb->raw_position+size) > cb->max_read_len ) {
if ( cb->raw_position+size > cb->max_read_len ) {
std::ostringstream s_buf;
s_buf << "Attempted to read " << size << "-byte(s) beyond length limit";
@@ -216,18 +216,17 @@ int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
}
}
int bytes_read = fread( buf, 1, size, cb->fp );
size_t bytes_read = fread( buf, 1, size, cb->fp );
if ( bytes_read > 0 ) {
cb->raw_position += bytes_read;
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int tmp_offset;
tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
auto tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
return bytes_read / elsize;
return (int)(bytes_read / elsize);
}
@@ -253,9 +252,8 @@ int cfread_lua_number(double *buf, CFILE *cfile)
cb->raw_position += ftell(cb->fp)-orig_pos;
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int tmp_offset;
tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
auto tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
return items_read;
+7 -5
View File
@@ -34,18 +34,20 @@ typedef struct Cfile_block {
// int fd; // file descriptor
size_t data_length; // length of data for mmap
#endif
int lib_offset;
int raw_position;
int size; // for packed files
size_t lib_offset;
size_t raw_position;
size_t size; // for packed files
size_t max_read_len; // max read offset, for special error handling
const char* source_file;
int line_num;
} Cfile_block;
#define MAX_CFILE_BLOCKS 64
extern Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS];
extern CFILE Cfile_list[MAX_CFILE_BLOCKS];
// Called once to setup the low-level reading code.
void cf_init_lowlevel_read_code( CFILE * cfile, int lib_offset, int size, int pos );
void cf_init_lowlevel_read_code( CFILE * cfile, size_t lib_offset, size_t size, size_t pos );
#endif
+2 -2
View File
@@ -22,8 +22,8 @@
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "globalincs/pstypes.h"
void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_list_info> *info )
@@ -420,7 +420,7 @@ int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile)
}
}
return (out - (char *)buf)/elsize;
return (int)((out - (char *)buf)/elsize);
}
int cfwrite_compressed(void *param_buf, int param_elsize, int param_nelem, CFILE *cfile)
+163 -158
View File
@@ -9,13 +9,12 @@
#include "globalincs/pstypes.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <sstream>
#include <algorithm>
#ifdef _WIN32
#include <io.h>
@@ -33,12 +32,12 @@
#include <unistd.h>
#endif
#include "cmdline/cmdline.h"
#include "cfile/cfile.h"
#include "cfile/cfilesystem.h"
#include "cmdline/cmdline.h"
#include "globalincs/pstypes.h"
#include "localization/localize.h"
#include "osapi/osapi.h"
#define CF_ROOTTYPE_PATH 0
#define CF_ROOTTYPE_PACK 1
@@ -96,7 +95,6 @@ typedef struct cf_file_block {
static uint Num_files = 0;
static cf_file_block *File_blocks[CF_MAX_FILE_BLOCKS];
// Return a pointer to to file 'index'.
cf_file *cf_get_file(int index)
{
@@ -180,7 +178,7 @@ int cf_get_packfile_count(cf_root *root)
#if defined _WIN32
filespec += "*.vp";
int find_handle;
intptr_t find_handle;
_finddata_t find;
find_handle = _findfirst( filespec.c_str( ), &find );
@@ -220,19 +218,15 @@ int cf_get_packfile_count(cf_root *root)
}
// packfile sort function
int cf_packfile_sort_func(const void *elem1, const void *elem2)
bool cf_packfile_sort_func(const cf_root_sort &r1, const cf_root_sort &r2)
{
cf_root_sort *r1, *r2;
r1 = (cf_root_sort*)elem1;
r2 = (cf_root_sort*)elem2;
// if the 2 directory types are the same, do a string compare
if(r1->cf_type == r2->cf_type){
return stricmp(r1->path, r2->path);
if (r1.cf_type == r2.cf_type) {
return (stricmp(r1.path, r2.path) < 0);
}
// otherwise return them in order of CF_TYPE_* precedence
return (r1->cf_type < r2->cf_type) ? -1 : 1;
return (r1.cf_type < r2.cf_type);
}
// Go through a root and look for pack files
@@ -272,7 +266,7 @@ void cf_build_pack_list( cf_root *root )
#if defined _WIN32
strcat_s( filespec, "*.vp" );
int find_handle;
intptr_t find_handle;
_finddata_t find;
find_handle = _findfirst( filespec, &find );
@@ -341,7 +335,7 @@ void cf_build_pack_list( cf_root *root )
Assert(root_index == temp_root_count);
// sort the roots
qsort(temp_roots_sort, temp_root_count, sizeof(cf_root_sort), cf_packfile_sort_func);
std::sort(temp_roots_sort, temp_roots_sort + temp_root_count, cf_packfile_sort_func);
// now insert them all into the real root list properly
cf_root *new_root;
@@ -365,109 +359,123 @@ void cf_build_pack_list( cf_root *root )
vm_free(temp_roots_sort);
}
static char normalize_directory_separator(char in)
{
if (in == '/')
{
return DIR_SEPARATOR_CHAR;
}
void cf_build_root_list(char *cdrom_dir)
return in;
}
static void cf_add_mod_roots(const char* rootDirectory)
{
if (Cmdline_mod)
{
for (const char* cur_pos=Cmdline_mod; strlen(cur_pos) != 0; cur_pos+= (strlen(cur_pos)+1))
{
SCP_stringstream ss;
ss << rootDirectory;
if (rootDirectory[strlen(rootDirectory) - 1] != DIR_SEPARATOR_CHAR)
{
ss << DIR_SEPARATOR_CHAR;
}
ss << cur_pos << DIR_SEPARATOR_STR;
SCP_string rootPath = ss.str();
if (rootPath.size() + 1 >= CF_MAX_PATHNAME_LENGTH) {
Error(LOCATION, "The length of mod directory path '%s' exceeds the maximum of %d!\n", rootPath.c_str(), CF_MAX_PATHNAME_LENGTH);
}
// normalize the path to the native path format
std::transform(rootPath.begin(), rootPath.end(), rootPath.begin(), normalize_directory_separator);
cf_root* root = cf_create_root();
strncpy(root->path, rootPath.c_str(), CF_MAX_PATHNAME_LENGTH-1);
root->roottype = CF_ROOTTYPE_PATH;
cf_build_pack_list(root);
}
}
}
void cf_build_root_list(const char *cdrom_dir)
{
Num_roots = 0;
Num_path_roots = 0;
cf_root *root;
char str_temp[CF_MAX_PATHNAME_LENGTH], *cur_pos;
int path_len;
cf_root *root = nullptr;
#ifdef SCP_UNIX
// =========================================================================
// now look for mods under the users HOME directory to use before system ones
if (Cmdline_mod) {
for (cur_pos=Cmdline_mod; strlen(cur_pos) != 0; cur_pos+= (strlen(cur_pos)+1))
{
memset(str_temp, 0, CF_MAX_PATHNAME_LENGTH);
strncpy(str_temp, cur_pos, CF_MAX_PATHNAME_LENGTH-1);
if (os_is_legacy_mode())
{
// =========================================================================
#ifdef WIN32
// Nothing to do here, Windows uses the current directory as the base
#else
cf_add_mod_roots(Cfile_user_dir_legacy);
strncat(str_temp, DIR_SEPARATOR_STR, (CF_MAX_PATHNAME_LENGTH - strlen(str_temp) - 1));
root = cf_create_root();
strncpy(root->path, Cfile_user_dir_legacy, CF_MAX_PATHNAME_LENGTH - 1);
// truncated string check
if ( (strlen(Cfile_user_dir) + strlen(str_temp) + 1) >= CF_MAX_PATHNAME_LENGTH ) {
Int3();
}
root = cf_create_root();
strncpy( root->path, Cfile_user_dir, CF_MAX_PATHNAME_LENGTH-1 );
// do we already have a slash? as in the case of a root directory install
if ( (strlen(root->path) < (CF_MAX_PATHNAME_LENGTH-1)) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR) ) {
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
}
strncat(root->path, str_temp, (CF_MAX_PATHNAME_LENGTH - strlen(root->path) - 1));
root->roottype = CF_ROOTTYPE_PATH;
cf_build_pack_list(root);
// do we already have a slash? as in the case of a root directory install
if ((strlen(root->path) < (CF_MAX_PATHNAME_LENGTH - 1)) && (root->path[strlen(root->path) - 1] != DIR_SEPARATOR_CHAR)) {
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
}
}
// =========================================================================
root->roottype = CF_ROOTTYPE_PATH;
// =========================================================================
// set users HOME directory as default for loading and saving files
root = cf_create_root();
strncpy( root->path, Cfile_user_dir, CF_MAX_PATHNAME_LENGTH-1 );
// If it wasn't set before, set the pilot path
if (Pilot_file_path == NULL)
Pilot_file_path = root->path;
// do we already have a slash? as in the case of a root directory install
if( (strlen(root->path) < (CF_MAX_PATHNAME_LENGTH-1)) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR) ) {
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
}
root->roottype = CF_ROOTTYPE_PATH;
// set the default player location to here
if ( Pilot_file_path == NULL )
Pilot_file_path = root->path;
// Next, check any VP files under the current directory.
cf_build_pack_list(root);
// =========================================================================
// Next, check any VP files under the current directory.
cf_build_pack_list(root);
#endif
if(Cmdline_mod) {
// stackable Mod support -- Kazan
for (cur_pos=Cmdline_mod; *cur_pos != '\0'; cur_pos+= (strlen(cur_pos)+1))
{
memset(str_temp, 0, CF_MAX_PATHNAME_LENGTH);
strncpy(str_temp, cur_pos, CF_MAX_PATHNAME_LENGTH-1);
strncat(str_temp, DIR_SEPARATOR_STR, (CF_MAX_PATHNAME_LENGTH - strlen(str_temp) - 1));
root = cf_create_root();
if ( !_getcwd(root->path, CF_MAX_PATHNAME_LENGTH ) ) {
Error(LOCATION, "Can't get current working directory -- %d", errno );
}
// truncated string check
if ( (strlen(root->path) + strlen(str_temp) + 1) >= CF_MAX_PATHNAME_LENGTH ) {
Int3();
}
path_len = strlen(root->path);
// do we already have a slash? as in the case of a root directory install
if ( (path_len < (CF_MAX_PATHNAME_LENGTH-1)) && (root->path[path_len-1] != DIR_SEPARATOR_CHAR) ) {
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
path_len++;
}
strncat(root->path, str_temp, (CF_MAX_PATHNAME_LENGTH - path_len - 1));
root->roottype = CF_ROOTTYPE_PATH;
cf_build_pack_list(root);
}
// =========================================================================
}
else if (!Cmdline_portable_mode)
{
// =========================================================================
// now look for mods under the users HOME directory to use before system ones
cf_add_mod_roots(Cfile_user_dir);
// =========================================================================
// =========================================================================
// set users HOME directory as default for loading and saving files
root = cf_create_root();
strncpy(root->path, Cfile_user_dir, CF_MAX_PATHNAME_LENGTH - 1);
// do we already have a slash? as in the case of a root directory install
if ((strlen(root->path) < (CF_MAX_PATHNAME_LENGTH - 1)) && (root->path[strlen(root->path) - 1] != DIR_SEPARATOR_CHAR)) {
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
}
root->roottype = CF_ROOTTYPE_PATH;
// set the default player location to here
if (Pilot_file_path == NULL)
Pilot_file_path = root->path;
// Next, check any VP files under the current directory.
cf_build_pack_list(root);
// =========================================================================
}
char working_directory[CF_MAX_PATHNAME_LENGTH];
if ( !_getcwd(working_directory, CF_MAX_PATHNAME_LENGTH ) ) {
Error(LOCATION, "Can't get current working directory -- %d", errno );
}
cf_add_mod_roots(working_directory);
root = cf_create_root();
if ( !_getcwd(root->path, CF_MAX_PATHNAME_LENGTH ) ) {
Error(LOCATION, "Can't get current working directory -- %d", errno );
}
strcpy_s(root->path, working_directory);
path_len = strlen(root->path);
size_t path_len = strlen(root->path);
// do we already have a slash? as in the case of a root directory install
if ( (path_len < (CF_MAX_PATHNAME_LENGTH-1)) && (root->path[path_len-1] != DIR_SEPARATOR_CHAR) ) {
@@ -476,7 +484,7 @@ void cf_build_root_list(char *cdrom_dir)
root->roottype = CF_ROOTTYPE_PATH;
// set the default path for pilot files
// If the path wasn't set before use the working directory
if ( Pilot_file_path == NULL )
Pilot_file_path = root->path;
@@ -503,11 +511,11 @@ void cf_build_root_list(char *cdrom_dir)
// Given a lower case list of file extensions
// separated by spaces, return zero if ext is
// not in the list.
int is_ext_in_list( char *ext_list, char *ext )
int is_ext_in_list( const char *ext_list, const char *ext )
{
char tmp_ext[128];
strncpy( tmp_ext, ext, 127 );
strcpy_s( tmp_ext, ext);
strlwr(tmp_ext);
if ( strstr(ext_list, tmp_ext )) {
return 1;
@@ -546,7 +554,7 @@ void cf_search_root_path(int root_index)
#if defined _WIN32
strcat_s( search_path, "*.*" );
int find_handle;
intptr_t find_handle;
_finddata_t find;
find_handle = _findfirst( search_path, &find );
@@ -670,7 +678,11 @@ void cf_search_root_pack(int root_index)
VP_FILE_HEADER VP_header;
Assert( sizeof(VP_header) == 16 );
fread(&VP_header, 1, sizeof(VP_header), fp);
if (fread(&VP_header, sizeof(VP_header), 1, fp) != 1) {
mprintf(("Skipping VP file ('%s') because the header could not be read...\n", root->path));
fclose(fp);
return;
}
VP_header.version = INTEL_INT( VP_header.version ); //-V570
VP_header.index_offset = INTEL_INT( VP_header.index_offset ); //-V570
@@ -690,14 +702,18 @@ void cf_search_root_pack(int root_index)
for (i=0; i<VP_header.num_files; i++ ) {
VP_FILE find;
fread( &find, sizeof(VP_FILE), 1, fp );
if (fread( &find, sizeof(VP_FILE), 1, fp ) != 1) {
mprintf(("Failed to read file entry (currently in directory %s)!\n", search_path));
break;
}
find.offset = INTEL_INT( find.offset ); //-V570
find.size = INTEL_INT( find.size ); //-V570
find.write_time = INTEL_INT( find.write_time ); //-V570
find.filename[sizeof(find.filename)-1] = '\0';
if ( find.size == 0 ) {
int search_path_len = strlen(search_path);
size_t search_path_len = strlen(search_path);
if ( !stricmp( find.filename, ".." )) {
char *p = &search_path[search_path_len-1];
while( (p > search_path) && (*p != DIR_SEPARATOR_CHAR) ) {
@@ -766,7 +782,7 @@ void cf_build_file_list()
}
void cf_build_secondary_filelist(char *cdrom_dir)
void cf_build_secondary_filelist(const char *cdrom_dir)
{
int i;
@@ -833,18 +849,13 @@ void cf_free_secondary_filelist()
*
* @return If not found returns 0.
*/
int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize )
int cf_find_file_location( const char *filespec, int pathtype, int max_out, char *pack_filename, size_t *size, size_t *offset, bool localize )
{
int i;
uint ui;
int cfs_slow_search = 0;
char longname[MAX_PATH_LEN];
#if defined WIN32
long findhandle;
_finddata_t findstruct;
#endif
Assert( (filespec != NULL) && (strlen(filespec) > 0) ); //-V805
Assert( (pack_filename == NULL) || (max_out > 1) );
@@ -913,7 +924,9 @@ int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack
cf_create_default_path_string( longname, sizeof(longname)-1, search_order[ui], filespec, localize );
#if defined _WIN32
findhandle = _findfirst(longname, &findstruct);
_finddata_t findstruct;
intptr_t findhandle = _findfirst(longname, &findstruct);
if (findhandle != -1) {
if (size)
*size = findstruct.size;
@@ -969,7 +982,7 @@ int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack
*size = f->size;
if (offset)
*offset = f->pack_offset;
*offset = (size_t)f->pack_offset;
if (pack_filename) {
cf_root *r = cf_get_root(f->root_index);
@@ -997,7 +1010,7 @@ int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack
*size = f->size;
if (offset)
*offset = f->pack_offset;
*offset = (size_t)f->pack_offset;
if (pack_filename) {
cf_root *r = cf_get_root(f->root_index);
@@ -1024,7 +1037,7 @@ int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack
}
// -- from parselo.cpp --
extern char *stristr(const char *str, const char *substr);
extern char *stristr(char *str, const char *substr);
/**
* Searches for a file.
@@ -1044,7 +1057,7 @@ extern char *stristr(const char *str, const char *substr);
*
* @return If not found returns -1, else returns offset into ext_list.
*/
int cf_find_file_location_ext( char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize )
int cf_find_file_location_ext( const char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out, char *pack_filename, size_t *size, size_t *offset, bool localize )
{
int cur_ext, i;
uint ui;
@@ -1052,12 +1065,7 @@ int cf_find_file_location_ext( char *filename, const int ext_num, const char **e
char longname[MAX_PATH_LEN];
char filespec[MAX_FILENAME_LEN];
char *p = NULL;
#if defined WIN32
long findhandle;
_finddata_t findstruct;
#endif
Assert( (filename != NULL) && (strlen(filename) < MAX_FILENAME_LEN) );
Assert( (ext_list != NULL) && (ext_num > 1) ); // if we are searching for just one ext
// then this is the wrong function to use
@@ -1128,7 +1136,8 @@ int cf_find_file_location_ext( char *filename, const int ext_num, const char **e
cf_create_default_path_string( longname, sizeof(longname)-1, search_order[ui], filespec, localize );
#if defined _WIN32
findhandle = _findfirst(longname, &findstruct);
_finddata_t findstruct;
intptr_t findhandle = _findfirst(longname, &findstruct);
if (findhandle != -1) {
if (size)
*size = findstruct.size;
@@ -1175,11 +1184,11 @@ int cf_find_file_location_ext( char *filename, const int ext_num, const char **e
(*p) = 0;
// go ahead and get our length, which is used to test with later
int filespec_len = strlen(filespec);
size_t filespec_len = strlen(filespec);
// get total legnth, with extension, which is iused to test with later
// (FIXME: this assumes that everything in ext_list[] is the same length!)
uint filespec_len_big = filespec_len + strlen(ext_list[0]);
size_t filespec_len_big = filespec_len + strlen(ext_list[0]);
SCP_vector< cf_file* > file_list_index;
int last_root_index = -1;
@@ -1318,9 +1327,10 @@ int cf_find_file_location_ext( char *filename, const int ext_num, const char **e
// Returns true if filename matches filespec, else zero if not
int cf_matches_spec(char *filespec, char *filename)
int cf_matches_spec(const char *filespec, const char *filename)
{
char *src_ext, *dst_ext;
const char *src_ext;
const char *dst_ext;
src_ext = strrchr(filespec, '*');
if(!src_ext)
@@ -1353,7 +1363,7 @@ int cf_matches_spec(char *filespec, char *filename)
}
}
int (*Get_file_list_filter)(char *filename) = NULL;
int (*Get_file_list_filter)(const char *filename) = NULL;
const char *Get_file_list_child = NULL;
int Skip_packfile_search = 0;
@@ -1382,7 +1392,7 @@ static bool verify_file_list_child()
return true;
}
static int cf_file_already_in_list( SCP_vector<SCP_string> &list, char *filename )
static int cf_file_already_in_list( SCP_vector<SCP_string> &list, const char *filename )
{
char name_no_extension[MAX_PATH_LEN];
size_t i, size = list.size();
@@ -1410,11 +1420,12 @@ static int cf_file_already_in_list( SCP_vector<SCP_string> &list, char *filename
// This one has a 'type', which is a CF_TYPE_* value. Because this specifies the directory
// location, 'filter' only needs to be the filter itself, with no path information.
// See above descriptions of cf_get_file_list() for more information about how it all works.
int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter, int sort, SCP_vector<file_list_info> *info )
int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, const char *filter, int sort, SCP_vector<file_list_info> *info )
{
char *ptr;
uint i;
int l, own_flag = 0;
int own_flag = 0;
size_t l;
SCP_vector<file_list_info> my_info;
file_list_info tinfo;
@@ -1442,7 +1453,7 @@ int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter,
strcat_s(filespec, filter);
_finddata_t find;
int find_handle;
intptr_t find_handle;
find_handle = _findfirst( filespec, &find );
if (find_handle != -1) {
@@ -1458,7 +1469,7 @@ int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter,
ptr = strrchr(find.name, '.');
if (ptr)
l = ptr - find.name;
l = (size_t)(ptr - find.name);
else
l = strlen(find.name);
@@ -1509,7 +1520,7 @@ int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter,
ptr = strrchr(dir->d_name, '.');
if (ptr)
l = ptr - dir->d_name;
l = (size_t)(ptr - dir->d_name);
else
l = strlen(dir->d_name);
@@ -1557,7 +1568,7 @@ int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter,
ptr = strrchr(f->name_ext, '.');
if (ptr)
l = ptr - f->name_ext;
l = (size_t)(ptr - f->name_ext);
else
l = strlen(f->name_ext);
@@ -1587,7 +1598,7 @@ int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter,
return (int)list.size();
}
int cf_file_already_in_list( int num_files, char **list, char *filename )
int cf_file_already_in_list( int num_files, char **list, const char *filename )
{
int i;
@@ -1611,11 +1622,12 @@ int cf_file_already_in_list( int num_files, char **list, char *filename )
// This one has a 'type', which is a CF_TYPE_* value. Because this specifies the directory
// location, 'filter' only needs to be the filter itself, with no path information.
// See above descriptions of cf_get_file_list() for more information about how it all works.
int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort, file_list_info *info )
int cf_get_file_list( int max, char **list, int pathtype, const char *filter, int sort, file_list_info *info )
{
char *ptr;
uint i;
int l, num_files = 0, own_flag = 0;
int num_files = 0, own_flag = 0;
size_t l;
if (max < 1) {
Get_file_list_filter = NULL;
@@ -1636,7 +1648,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
cf_create_default_path_string( filespec, sizeof(filespec)-1, pathtype, filter );
_finddata_t find;
int find_handle;
intptr_t find_handle;
find_handle = _findfirst( filespec, &find );
if (find_handle != -1) {
@@ -1786,7 +1798,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
return num_files;
}
int cf_file_already_in_list_preallocated( int num_files, char arr[][MAX_FILENAME_LEN], char *filename )
int cf_file_already_in_list_preallocated( int num_files, char arr[][MAX_FILENAME_LEN], const char *filename )
{
int i;
@@ -1810,7 +1822,7 @@ int cf_file_already_in_list_preallocated( int num_files, char arr[][MAX_FILENAME
// This one has a 'type', which is a CF_TYPE_* value. Because this specifies the directory
// location, 'filter' only needs to be the filter itself, with no path information.
// See above descriptions of cf_get_file_list() for more information about how it all works.
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int pathtype, char *filter, int sort, file_list_info *info )
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int pathtype, const char *filter, int sort, file_list_info *info )
{
int num_files = 0, own_flag = 0;
@@ -1841,7 +1853,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
#if defined _WIN32
cf_create_default_path_string( filespec, sizeof(filespec)-1, pathtype, filter );
int find_handle;
intptr_t find_handle;
_finddata_t find;
find_handle = _findfirst( filespec, &find );
@@ -1997,7 +2009,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
// filename - optional, if set, tacks the filename onto end of path.
// Output: path - Fully qualified pathname.
//Returns 0 if the result would be too long (invalid result)
int cf_create_default_path_string( char *path, uint path_max, int pathtype, char *filename, bool localize )
int cf_create_default_path_string(char *path, uint path_max, int pathtype, const char *filename, bool localize )
{
#ifdef SCP_UNIX
if ( filename && strpbrk(filename,"/") ) {
@@ -2069,7 +2081,7 @@ int cf_create_default_path_string( char *path, uint path_max, int pathtype, char
// filename - optional, if set, tacks the filename onto end of path.
// Output: path - Fully qualified pathname.
//Returns 0 if the result would be too long (invalid result)
int cf_create_default_path_string( SCP_string &path, int pathtype, char *filename, bool localize )
int cf_create_default_path_string( SCP_string &path, int pathtype, const char *filename, bool localize )
{
#ifdef SCP_UNIX
if ( filename && strpbrk(filename,"/") ) {
@@ -2124,18 +2136,11 @@ int cf_create_default_path_string( SCP_string &path, int pathtype, char *filenam
void cfile_spew_pack_file_crcs()
{
int i;
char out_path[CFILE_ROOT_DIRECTORY_LEN+MAX_FILENAME_LEN];
char datetime[45];
uint chksum = 0;
time_t my_time;
#ifdef SCP_UNIX
sprintf(out_path, "%s%svp_crcs.txt", Cfile_user_dir, DIR_SEPARATOR_STR);
#else
sprintf(out_path, "%s%svp_crcs.txt", Cfile_root_dir, DIR_SEPARATOR_STR);
#endif
FILE *out = fopen(out_path, "w");
FILE *out = fopen(os_get_config_path("vp_crcs.txt").c_str(), "w");
if (out == NULL) {
Int3();
+3 -3
View File
@@ -15,7 +15,7 @@
#include "cfile/cfile.h"
// Builds a list of all the files
void cf_build_secondary_filelist( char *cdrom_path );
void cf_build_secondary_filelist( const char *cdrom_path );
void cf_free_secondary_filelist();
// Internal stuff
@@ -39,7 +39,7 @@ extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
// filename - optional, if set, tacks the filename onto end of path.
// Output: path - Fully qualified pathname.
//Returns 0 if result would be too long (invalid result)
int cf_create_default_path_string( char *path, uint path_max, int pathtype, char *filename=NULL, bool localize = false);
int cf_create_default_path_string( SCP_string &path, int pathtype, char *filename=NULL, bool localize = false );
int cf_create_default_path_string( char *path, uint path_max, int pathtype, const char *filename=NULL, bool localize = false);
int cf_create_default_path_string( SCP_string &path, int pathtype, const char *filename=NULL, bool localize = false );
#endif //_CFILESYSTEM_H
+19
View File
@@ -0,0 +1,19 @@
add_executable(cfilearchiver EXCLUDE_FROM_ALL cfilearchiver.cpp)
ADD_DEFINITIONS(-DNO_SAFE_STRINGS)
include_directories(${CODE_HEADERS})
set_target_properties(cfilearchiver
PROPERTIES
FOLDER "FSOTools"
)
TARGET_LINK_LIBRARIES(cfilearchiver PUBLIC ${SDL_LIBS})
TARGET_INCLUDE_DIRECTORIES(cfilearchiver PUBLIC ${GENERATED_SOURCE_DIR})
TARGET_INCLUDE_DIRECTORIES(cfilearchiver PUBLIC ${GENERATED_SOURCE_DIR}/code)
IF(MSVC)
set_target_properties(cfilearchiver PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG;PDB_DEBUGGING=1"
)
ENDIF(MSVC)
+19
View File
@@ -0,0 +1,19 @@
add_executable(cfileextractor EXCLUDE_FROM_ALL cfileextractor.cpp)
ADD_DEFINITIONS(-DNO_SAFE_STRINGS)
include_directories(${CODE_HEADERS})
set_target_properties(cfileextractor
PROPERTIES
FOLDER "FSOTools"
)
TARGET_LINK_LIBRARIES(cfileextractor PUBLIC ${SDL_LIBS})
TARGET_INCLUDE_DIRECTORIES(cfileextractor PUBLIC ${GENERATED_SOURCE_DIR})
TARGET_INCLUDE_DIRECTORIES(cfileextractor PUBLIC ${GENERATED_SOURCE_DIR}/code)
IF(MSVC)
set_target_properties(cfileextractor PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG;PDB_DEBUGGING=1"
)
ENDIF(MSVC)
+790 -467
View File
File diff suppressed because it is too large. Load diff
+23 -13
View File
@@ -13,9 +13,8 @@
#define FS_CMDLINE_HEADER_FILE
int parse_cmdline(char *cmdline);
int parse_cmdline(int argc, char *argv[]);
int fred2_parse_cmdline(int argc, char *argv[]);
// COMMAND LINE SETTINGS
// This section is for reference by all the *_init() functions. For example, the multiplayer init function
// could check to see if (int Cmdline_multi_stream_chat_to_file) has been set by the command line parser.
@@ -48,6 +47,7 @@ extern int Cmdline_use_last_pilot;
extern int Cmdline_window;
extern int Cmdline_fullscreen_window;
extern char *Cmdline_res;
extern char *Cmdline_center_res;
// FSO OPTIONS -------------------------------------------------
@@ -76,6 +76,10 @@ extern int Cmdline_bloom_intensity;
extern bool Cmdline_fxaa;
extern int Cmdline_fxaa_preset;
extern bool Cmdline_fb_explosions;
extern bool Cmdline_fb_thrusters;
extern bool Cmdline_no_batching;
extern int Cmdline_shadow_quality;
extern int Cmdline_no_deferred_lighting;
// Game Speed related
extern int Cmdline_cache_bitmaps;
@@ -95,11 +99,13 @@ extern int Cmdline_ship_choice_3d;
extern int Cmdline_weapon_choice_3d;
extern int Cmdline_warp_flash;
extern int Cmdline_autopilot_interruptable;
extern int Cmdline_stretch_menu;
// Audio related
extern int Cmdline_query_speech;
extern int Cmdline_snd_preload;
extern int Cmdline_voice_recognition;
extern int Cmdline_no_enhanced_sound;
// MOD related
extern char *Cmdline_mod; // DTP for mod support
@@ -111,22 +117,28 @@ extern char *Cmdline_spew_mission_crcs;
extern char *Cmdline_spew_table_crcs;
extern int Cmdline_objupd;
// Launcher related options
extern bool Cmdline_portable_mode;
// Troubleshooting
extern int Cmdline_load_all_weapons;
extern int Cmdline_nohtl;
extern int Cmdline_noibx;
extern int Cmdline_nomovies; // WMC Toggles movie playing support
extern int Cmdline_no_set_gamma;
extern int Cmdline_novbo;
extern int Cmdline_no_fbo;
extern int Cmdline_no_pbo;
extern int Cmdline_noglsl;
extern int Cmdline_mipmap;
extern int Cmdline_ati_color_swap;
extern int Cmdline_no_3d_sound;
extern int Cmdline_no_glsl_model_rendering;
extern int Cmdline_no_di_mouse;
extern int Cmdline_drawelements;
extern char* Cmdline_keyboard_layout;
extern bool Cmdline_gl_finish;
extern bool Cmdline_no_geo_sdr_effects;
extern bool Cmdline_set_cpu_affinity;
#ifdef WIN32
extern bool Cmdline_alternate_registry_path;
#endif
// Developer/Testing related
extern char *Cmdline_start_mission;
@@ -134,19 +146,17 @@ extern int Cmdline_old_collision_sys;
extern int Cmdline_dis_collisions;
extern int Cmdline_dis_weapons;
extern int Cmdline_noparseerrors;
#ifdef Allow_NoWarn
extern int Cmdline_nowarn;
#endif
extern int Cmdline_extra_warn;
extern int Cmdline_show_mem_usage;
extern int Cmdline_show_pos;
extern int Cmdline_show_stats;
extern int Cmdline_save_render_targets;
extern int Cmdline_debug_window;
extern int Cmdline_verify_vps;
#ifdef SCP_UNIX
extern int Cmdline_no_grab;
#endif
extern int Cmdline_reparse_mainhall;
extern bool Cmdline_frame_profile;
extern bool Cmdline_profile_write_file;
extern bool Cmdline_no_unfocus_pause;
extern bool Cmdline_benchmark_mode;
extern bool Cmdline_noninteractive;
#endif
+8 -7
View File
@@ -10,17 +10,18 @@
#include "cmeasure/cmeasure.h"
#include "ship/ship.h"
#include "math/staticrand.h"
#include "object/object.h"
#include "weapon/weapon.h"
#include "hud/hud.h"
#include "gamesnd/gamesnd.h"
#include "network/multimsgs.h"
#include "hud/hud.h"
#include "math/staticrand.h"
#include "mission/missionparse.h"
#include "network/multimsgs.h"
#include "object/object.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
int Cmeasures_homing_check = 0;
int Countermeasures_enabled = 1; // Debug, set to 0 means no one can fire countermeasures.
const float CMEASURE_DETONATE_DISTANCE = 40.0f;
//Used to set a countermeasure velocity after being launched from a ship as a countermeasure
//ie not as a primary or secondary.
@@ -92,7 +93,7 @@ void cmeasure_maybe_alert_success(object *objp)
if ( objp->parent == OBJ_INDEX(Player_obj) ) {
hud_start_text_flash(XSTR("Evaded", 1430), 800);
snd_play(&Snds[ship_get_sound(Player_obj, SND_MISSILE_EVADED_POPUP)]);
} else if ( Objects[objp->parent].flags & OF_PLAYER_SHIP ) {
} else if ( Objects[objp->parent].flags[Object::Object_Flags::Player_ship] ) {
send_countermeasure_success_packet( objp->parent );
}
}
+2 -1
View File
@@ -15,13 +15,14 @@
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
struct object;
class object;
#define CMEASURE_WAIT 333 // delay in milliseconds between countermeasure firing.
// Maximum distance at which a countermeasure can be tracked
// If this value is too large, missiles will always be tracking countermeasures.
#define MAX_CMEASURE_TRACK_DIST 300.0f
extern const float CMEASURE_DETONATE_DISTANCE;
extern int Cmeasures_homing_check;
extern int Countermeasures_enabled;
+284 -124
View File
@@ -10,24 +10,26 @@
#include "freespace2/freespace.h"
#include "controlconfig/controlsconfig.h"
#include "debugconsole/console.h"
#include "freespace.h"
#include "gamehelp/contexthelp.h"
#include "gamesequence/gamesequence.h"
#include "gamesnd/gamesnd.h"
#include "globalincs/alphacolors.h"
#include "graphics/font.h"
#include "hud/hudsquadmsg.h"
#include "io/joy.h"
#include "io/key.h"
#include "io/timer.h"
#include "ui/ui.h"
#include "io/joy.h"
#include "gamesnd/gamesnd.h"
#include "missionui/missionscreencommon.h"
#include "graphics/font.h"
#include "pilotfile/pilotfile.h"
#include "gamehelp/contexthelp.h"
#include "popup/popup.h"
#include "ui/uidefs.h"
#include "globalincs/alphacolors.h"
#include "network/multi_pmsg.h"
#include "network/multiutil.h"
#include "parse/scripting.h"
#include "pilotfile/pilotfile.h"
#include "popup/popup.h"
#include "ui/ui.h"
#include "ui/uidefs.h"
#ifndef NDEBUG
@@ -124,7 +126,7 @@ int Conflict_bright = 0;
static int Num_cc_lines;
static struct {
char *label;
const char *label;
int cc_index; // index into Control_config of item
int y; // Y coordinate of line
int kx, kw, jx, jw; // x start and width of keyboard and joystick bound text
@@ -135,6 +137,7 @@ struct config_item_undo {
int size;
int *index; // array (size) of Control_config indices of replaced elements
config_item *list; // array (size) of original elements
int reset_to_preset; // if >=0, then we ignore the above list and simply reset to the given preset instead
config_item_undo *next;
};
@@ -174,6 +177,9 @@ static int Background_bitmap;
static int Conflicts_tabs[NUM_TABS];
static UI_BUTTON List_buttons[LIST_BUTTONS_MAX]; // buttons for each line of text in list
static UI_WINDOW Ui_window;
static unsigned int Defaults_cycle_pos; // the controls preset that was last selected
int Control_config_overlay_id;
static struct {
int key; // index of other control in conflict with this one
@@ -345,11 +351,70 @@ int Config_allowed[] = {
#ifndef NDEBUG
int Show_controls_info = 0;
DCF_BOOL(show_controls_info, Show_controls_info)
DCF_BOOL(show_controls_info, Show_controls_info);
#endif
static int Axes_origin[JOY_NUM_AXES];
static int joy_get_unscaled_reading(int raw, int axn)
{
int rng;
rng = JOY_AXIS_MAX - JOY_AXIS_MIN;
raw -= JOY_AXIS_MIN; // adjust for linear range starting at 0
// cap at limits
if (raw < 0)
raw = 0;
if (raw > rng)
raw = rng;
return (int) ((uint) raw * (uint) F1_0 / (uint) rng); // convert to 0 - F1_0 range.
}
int joy_get_scaled_reading(int raw)
{
int x, d, dead_zone, rng;
float percent, sensitivity_percent, non_sensitivity_percent;
raw -= JOY_AXIS_CENTER;
dead_zone = (JOY_AXIS_MAX - JOY_AXIS_MIN) * Joy_dead_zone_size / 100;
if (raw < -dead_zone) {
rng = JOY_AXIS_CENTER - JOY_AXIS_MIN - dead_zone;
d = -raw - dead_zone;
} else if (raw > dead_zone) {
rng = JOY_AXIS_MAX - JOY_AXIS_CENTER - dead_zone;
d = raw - dead_zone;
} else
return 0;
if (d > rng)
d = rng;
Assert(Joy_sensitivity >= 0 && Joy_sensitivity <= 9);
// compute percentages as a range between 0 and 1
sensitivity_percent = (float) Joy_sensitivity / 9.0f;
non_sensitivity_percent = (float) (9 - Joy_sensitivity) / 9.0f;
// find percent of max axis is at
percent = (float) d / (float) rng;
// work sensitivity on axis value
percent = (percent * sensitivity_percent + percent * percent * percent * percent * percent * non_sensitivity_percent);
x = (int) ((float) F1_0 * percent);
//nprintf(("AI", "d=%6i, sens=%3i, percent=%6.3f, val=%6i, ratio=%6.3f\n", d, Joy_sensitivity, percent, (raw<0) ? -x : x, (float) d/x));
if (raw < 0)
return -x;
return x;
}
void control_config_detect_axis_reset()
{
joystick_read_raw_axis(JOY_NUM_AXES, Axes_origin);
@@ -387,21 +452,10 @@ int control_config_detect_axis()
void control_config_conflict_check()
{
int i, j, shift = -1, alt = -1;
int i, j;
for (i=0; i<CCFG_MAX; i++) {
Conflicts[i].key = Conflicts[i].joy = -1;
switch (Control_config[i].key_id) {
case KEY_LSHIFT:
case KEY_RSHIFT:
shift = i;
break;
case KEY_LALT:
case KEY_RALT:
alt = i;
break;
}
}
for (i=0; i<NUM_TABS; i++) {
@@ -462,15 +516,12 @@ void control_config_conflict_check()
// do list setup required prior to rendering and checking for the controls listing. Called when list changes
void control_config_list_prepare()
{
int j, k, y, z;
int j, y, z;
int font_height = gr_get_font_height();
Num_cc_lines = y = z = 0;
while (z < CCFG_MAX) {
if (Control_config[z].tab == Tab && !Control_config[z].disabled) {
k = Control_config[z].key_id;
j = Control_config[z].joy_id;
if (Control_config[z].hasXSTR) {
Cc_lines[Num_cc_lines].label = XSTR(Control_config[z].text, CONTROL_CONFIG_XSTR + z);
} else {
@@ -534,6 +585,8 @@ config_item_undo *get_undo_block(int size)
ptr->list = NULL;
}
ptr->reset_to_preset = -1;
return ptr;
}
@@ -566,41 +619,45 @@ int control_config_undo_last()
return -1;
}
if (Config_item_undo->index[0] & JOY_AXIS) {
tab = SHIP_TAB;
if (Config_item_undo->reset_to_preset > -1) {
control_config_reset_defaults(Config_item_undo->reset_to_preset);
} else {
tab = Control_config[Config_item_undo->index[0]].tab;
}
for (i=1; i<Config_item_undo->size; i++) {
if (Config_item_undo->index[i] & JOY_AXIS) {
if (tab != SHIP_TAB) {
tab = -1;
}
if (Config_item_undo->index[0] & JOY_AXIS) {
tab = SHIP_TAB;
} else {
if (Control_config[Config_item_undo->index[i]].tab != tab) {
tab = -1;
tab = Control_config[Config_item_undo->index[0]].tab;
}
for (i=1; i<Config_item_undo->size; i++) {
if (Config_item_undo->index[i] & JOY_AXIS) {
if (tab != SHIP_TAB) {
tab = -1;
}
} else {
if (Control_config[Config_item_undo->index[i]].tab != tab) {
tab = -1;
}
}
}
}
if (tab >= 0) {
Tab = tab;
}
if (tab >= 0) {
Tab = tab;
}
for (i=0; i<Config_item_undo->size; i++) {
z = Config_item_undo->index[i];
if (z & JOY_AXIS) {
config_item *ptr;
for (i=0; i<Config_item_undo->size; i++) {
z = Config_item_undo->index[i];
if (z & JOY_AXIS) {
config_item *ptr;
z &= ~JOY_AXIS;
ptr = &Config_item_undo->list[i];
Axis_map_to[z] = ptr->joy_id;
Invert_axis[z] = ptr->used;
z &= ~JOY_AXIS;
ptr = &Config_item_undo->list[i];
Axis_map_to[z] = ptr->joy_id;
Invert_axis[z] = ptr->used;
} else {
Control_config[z] = Config_item_undo->list[i];
} else {
Control_config[z] = Config_item_undo->list[i];
}
}
}
@@ -654,7 +711,7 @@ void control_config_bind_axis(int i, int axis)
int control_config_remove_binding()
{
int z, j, k;
int z;
config_item_undo *ptr;
if (Selected_line < 0) {
@@ -684,7 +741,6 @@ int control_config_remove_binding()
return -1;
}
j = k = -1;
ptr = get_undo_block(1);
ptr->index[0] = z;
ptr->list[0] = Control_config[z];
@@ -836,8 +892,6 @@ int control_config_clear_all()
return 0;
}
extern Joy_info joystick;
int control_config_axis_default(int axis)
{
Assert(axis >= 0);
@@ -847,7 +901,8 @@ int control_config_axis_default(int axis)
return -1;
}
if (!joystick.axis_valid[Axis_map_to_defaults[axis]]) {
auto joystick = io::joystick::getCurrentJoystick();
if (joystick == nullptr || Axis_map_to_defaults[axis] >= joystick->numAxes()) {
return -1;
}
}
@@ -860,10 +915,25 @@ int control_config_do_reset()
int i, j, total = 0;
config_item_undo *ptr;
config_item item;
config_item *preset;
bool cycling_presets = false;
// If there are presets, then we'll cycle to the next preset and reset to that
if (Control_config_presets.size() >= 1) {
cycling_presets = true;
if (++Defaults_cycle_pos >= Control_config_presets.size())
Defaults_cycle_pos = 0;
preset = Control_config_presets[Defaults_cycle_pos];
} else {
// If there are no presets, then we'll always reset to the hardcoded defaults
preset = Control_config;
}
// first, determine how many bindings need to be changed
for (i=0; i<CCFG_MAX; i++) {
if ((Control_config[i].key_id != Control_config[i].key_default) || (Control_config[i].joy_id != Control_config[i].joy_default)) {
if ((Control_config[i].key_id != preset[i].key_default) || (Control_config[i].joy_id != preset[i].joy_default)) {
total++;
}
}
@@ -874,7 +944,7 @@ int control_config_do_reset()
}
}
if (!total) {
if (!total && !cycling_presets) {
gamesnd_play_iface(SND_GENERAL_FAIL);
return -1;
}
@@ -882,7 +952,7 @@ int control_config_do_reset()
// now, back up the old bindings so we can undo if we want to
ptr = get_undo_block(total);
for (i=j=0; i<CCFG_MAX; i++) {
if ((Control_config[i].key_id != Control_config[i].key_default) || (Control_config[i].joy_id != Control_config[i].joy_default)) {
if ((Control_config[i].key_id != preset[i].key_default) || (Control_config[i].joy_id != preset[i].joy_default)) {
ptr->index[j] = i;
ptr->list[j] = Control_config[i];
j++;
@@ -901,23 +971,43 @@ int control_config_do_reset()
j++;
}
}
Assert(j == total);
control_config_reset_defaults();
if (cycling_presets)
control_config_reset_defaults(Defaults_cycle_pos);
else
control_config_reset_defaults();
control_config_conflict_check();
control_config_list_prepare();
gamesnd_play_iface(SND_RESET_PRESSED);
return 0;
}
// This sets all the controls to their default values
void control_config_reset_defaults()
// This sets all the controls to the default values in the given preset
// If no preset is given, the hardcoded defaults of Control_config are used
void control_config_reset_defaults(int presetnum)
{
int i;
config_item *preset;
if (presetnum >= 0)
preset = Control_config_presets[presetnum];
else
preset = Control_config;
// Reset keyboard defaults
for (i=0; i<CCFG_MAX; i++) {
Control_config[i].key_id = Control_config[i].key_default;
Control_config[i].joy_id = Control_config[i].joy_default;
// Note that key_default and joy_default are NOT overwritten here;
// they should retain the values of the first preset because
// for example the key-pressed SEXP works off the defaults of the first preset
Control_config[i].key_id = preset[i].key_default;
Control_config[i].joy_id = preset[i].joy_default;
Control_config[i].tab = preset[i].tab;
Control_config[i].hasXSTR = preset[i].hasXSTR;
Control_config[i].type = preset[i].type;
Control_config[i].disabled = preset[i].disabled;
}
for (i=0; i<NUM_JOY_AXIS_ACTIONS; i++) {
@@ -1216,7 +1306,7 @@ void control_config_button_pressed(int n)
}
}
char *control_config_tooltip_handler(char *str)
const char *control_config_tooltip_handler(const char *str)
{
int i;
@@ -1241,14 +1331,16 @@ void control_config_init()
Control_config_backup[i] = Control_config[i];
}
Defaults_cycle_pos = 0;
common_set_interface_palette(NOX("ControlConfigPalette")); // set the interface palette
Ui_window.create(0, 0, gr_screen.max_w_unscaled, gr_screen.max_h_unscaled, 0);
Ui_window.set_mask_bmap(Conflict_background_bitmap_mask_fname[gr_screen.res]);
Ui_window.tooltip_handler = control_config_tooltip_handler;
// load in help overlay bitmap
help_overlay_load(CONTROL_CONFIG_OVERLAY);
help_overlay_set_state(CONTROL_CONFIG_OVERLAY,0);
Control_config_overlay_id = help_overlay_get_index(CONTROL_CONFIG_OVERLAY);
help_overlay_set_state(Control_config_overlay_id,gr_screen.res,0);
// reset conflict flashing
Conflict_stamp = -1;
@@ -1338,9 +1430,6 @@ void control_config_close()
while (Config_item_undo){
free_undo_block();
}
// unload the overlay bitmap
help_overlay_unload(CONTROL_CONFIG_OVERLAY);
if (Background_bitmap){
bm_release(Background_bitmap);
@@ -1392,8 +1481,9 @@ void control_config_close()
void control_config_do_frame(float frametime)
{
char buf[256], *str, *jptr;
int i, j, k, w, x, y, z, len, line, conflict;
const char *str;
char buf[256];
int i, j, k, w, x, y, z, line, conflict;
int font_height = gr_get_font_height();
int select_tease_line = -1; // line mouse is down on, but won't be selected until button released
static float timer = 0.0f;
@@ -1438,7 +1528,7 @@ void control_config_do_frame(float frametime)
if (Axis_override >= 0) {
control_config_bind_axis(z, Axis_override);
strcpy_s(bound_string, Joy_axis_text[Axis_override]);
gr_force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
font::force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
bound_timestamp = timestamp(2500);
control_config_conflict_check();
control_config_list_prepare();
@@ -1451,7 +1541,7 @@ void control_config_do_frame(float frametime)
}
} else {
if (help_overlay_active(CONTROL_CONFIG_OVERLAY)) {
if (help_overlay_active(Control_config_overlay_id)) {
CC_Buttons[gr_screen.res][HELP_BUTTON].button.reset_status();
Ui_window.set_ignore_gadgets(1);
}
@@ -1461,14 +1551,14 @@ void control_config_do_frame(float frametime)
Ui_window.process(0);
if ( (k > 0) || B1_JUST_RELEASED ) {
if (help_overlay_active(CONTROL_CONFIG_OVERLAY)) {
help_overlay_set_state(CONTROL_CONFIG_OVERLAY, 0);
if (help_overlay_active(Control_config_overlay_id)) {
help_overlay_set_state(Control_config_overlay_id, gr_screen.res, 0);
Ui_window.set_ignore_gadgets(0);
k = 0;
}
}
if ( !help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
if ( !help_overlay_active(Control_config_overlay_id) ) {
Ui_window.set_ignore_gadgets(0);
}
@@ -1495,7 +1585,7 @@ void control_config_do_frame(float frametime)
}
if ((k > 0) && !Config_allowed[k & KEY_MASK]) {
popup(0, 1, POPUP_OK, XSTR( "That is a non-bindable key. Please try again.", 207));
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR( "That is a non-bindable key. Please try again.", 207));
k = 0;
}
@@ -1506,7 +1596,7 @@ void control_config_do_frame(float frametime)
control_config_bind_key(z, k);
strcpy_s(bound_string, textify_scancode(k));
gr_force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
font::force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
bound_timestamp = timestamp(2500);
control_config_conflict_check();
control_config_list_prepare();
@@ -1520,7 +1610,7 @@ void control_config_do_frame(float frametime)
control_config_bind_joy(z, i);
strcpy_s(bound_string, Joy_button_text[i]);
gr_force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
font::force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
bound_timestamp = timestamp(2500);
control_config_conflict_check();
control_config_list_prepare();
@@ -1544,7 +1634,7 @@ void control_config_do_frame(float frametime)
control_config_bind_joy(z, i);
strcpy_s(bound_string, Joy_button_text[i]);
gr_force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
font::force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
bound_timestamp = timestamp(2500);
control_config_conflict_check();
control_config_list_prepare();
@@ -1562,7 +1652,7 @@ void control_config_do_frame(float frametime)
}
} else if (Search_mode) {
if (help_overlay_active(CONTROL_CONFIG_OVERLAY)) {
if (help_overlay_active(Control_config_overlay_id)) {
CC_Buttons[gr_screen.res][HELP_BUTTON].button.reset_status();
Ui_window.set_ignore_gadgets(1);
}
@@ -1572,14 +1662,14 @@ void control_config_do_frame(float frametime)
Ui_window.process(0);
if ( (k > 0) || B1_JUST_RELEASED ) {
if ( help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
help_overlay_set_state(CONTROL_CONFIG_OVERLAY, 0);
if ( help_overlay_active(Control_config_overlay_id) ) {
help_overlay_set_state(Control_config_overlay_id, gr_screen.res, 0);
Ui_window.set_ignore_gadgets(0);
k = 0;
}
}
if ( !help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
if ( !help_overlay_active(Control_config_overlay_id) ) {
Ui_window.set_ignore_gadgets(0);
}
@@ -1673,7 +1763,7 @@ void control_config_do_frame(float frametime)
CC_Buttons[gr_screen.res][UNDO_BUTTON].button.enable(Config_item_undo != NULL);
if ( help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
if ( help_overlay_active(Control_config_overlay_id) ) {
CC_Buttons[gr_screen.res][HELP_BUTTON].button.reset_status();
Ui_window.set_ignore_gadgets(1);
}
@@ -1681,14 +1771,14 @@ void control_config_do_frame(float frametime)
k = Ui_window.process();
if ( (k > 0) || B1_JUST_RELEASED ) {
if ( help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
help_overlay_set_state(CONTROL_CONFIG_OVERLAY, 0);
if ( help_overlay_active(Control_config_overlay_id) ) {
help_overlay_set_state(Control_config_overlay_id, gr_screen.res, 0);
Ui_window.set_ignore_gadgets(0);
k = 0;
}
}
if ( !help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
if ( !help_overlay_active(Control_config_overlay_id) ) {
Ui_window.set_ignore_gadgets(0);
}
@@ -1794,7 +1884,7 @@ void control_config_do_frame(float frametime)
GR_MAYBE_CLEAR_RES(Background_bitmap);
if (Background_bitmap >= 0) {
gr_set_bitmap(Background_bitmap);
gr_bitmap(0, 0);
gr_bitmap(0, 0, GR_RESIZE_MENU);
}
// highlight tab with conflict
@@ -1815,7 +1905,7 @@ void control_config_do_frame(float frametime)
}
// set color and font
gr_set_font(FONT2);
font::set_font(font::FONT2);
if(Conflict_bright){
gr_set_color_fast(&Color_bright_red);
} else {
@@ -1828,9 +1918,9 @@ void control_config_do_frame(float frametime)
int sw, sh;
gr_get_string_size(&sw, &sh, conflict_str);
gr_string((gr_screen.max_w / 2) - (sw / 2), Conflict_warning_coords[gr_screen.res][1], conflict_str);
gr_string((gr_screen.max_w / 2) - (sw / 2), Conflict_warning_coords[gr_screen.res][1], conflict_str, GR_RESIZE_MENU);
gr_set_font(FONT1);
font::set_font(font::FONT1);
} else {
// might as well always reset the conflict stamp
Conflict_stamp = -1;
@@ -1884,7 +1974,7 @@ void control_config_do_frame(float frametime)
if (t % 2) {
gr_set_color_fast(&Color_text_normal);
gr_get_string_size(&w, NULL, XSTR( "?", 208));
gr_printf(x - w / 2, y - font_height / 2, XSTR( "?", 208));
gr_printf_menu(x - w / 2, y - font_height / 2, XSTR( "?", 208));
}
} else if (!(z & JOY_AXIS) && ((Conflicts[z].key >= 0) || (Conflicts[z].joy >= 0))) {
@@ -1896,7 +1986,7 @@ void control_config_do_frame(float frametime)
gr_set_color_fast(&Color_text_normal);
str = XSTR( "Control conflicts with:", 209);
gr_get_string_size(&w, NULL, str);
gr_printf(x - w / 2, y - font_height, str);
gr_printf_menu(x - w / 2, y - font_height, str);
if (Control_config[i].hasXSTR) {
strcpy_s(buf, XSTR(Control_config[i].text, CONTROL_CONFIG_XSTR + i));
@@ -1904,14 +1994,14 @@ void control_config_do_frame(float frametime)
strcpy_s(buf, Control_config[i].text);
}
gr_force_fit_string(buf, 255, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
font::force_fit_string(buf, 255, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
gr_get_string_size(&w, NULL, buf);
gr_printf(x - w / 2, y, buf);
gr_printf_menu(x - w / 2, y, buf);
} else if (*bound_string) {
gr_set_color_fast(&Color_text_normal);
gr_get_string_size(&w, NULL, bound_string);
gr_printf(x - w / 2, y - font_height / 2, bound_string);
gr_printf_menu(x - w / 2, y - font_height / 2, bound_string);
if (timestamp_elapsed(bound_timestamp)) {
*bound_string = 0;
}
@@ -1919,7 +2009,7 @@ void control_config_do_frame(float frametime)
if (Cc_lines[Num_cc_lines - 1].y + font_height > Cc_lines[Scroll_offset].y + Control_list_coords[gr_screen.res][CONTROL_H_COORD]) {
gr_set_color_fast(&Color_white);
gr_printf(Control_more_coords[gr_screen.res][CONTROL_X_COORD], Control_more_coords[gr_screen.res][CONTROL_Y_COORD], XSTR( "More...", 210));
gr_printf_menu(Control_more_coords[gr_screen.res][CONTROL_X_COORD], Control_more_coords[gr_screen.res][CONTROL_Y_COORD], XSTR( "More...", 210));
}
conflict = 0;
@@ -1944,20 +2034,19 @@ void control_config_do_frame(float frametime)
gr_set_color_fast(c);
if (Cc_lines[line].label) {
strcpy_s(buf, Cc_lines[line].label);
gr_force_fit_string(buf, 255, Control_list_ctrl_w[gr_screen.res]);
gr_printf(Control_list_coords[gr_screen.res][CONTROL_X_COORD], y, buf);
font::force_fit_string(buf, 255, Control_list_ctrl_w[gr_screen.res]);
gr_printf_menu(Control_list_coords[gr_screen.res][CONTROL_X_COORD], y, buf);
}
if (!(z & JOY_AXIS)) {
k = Control_config[z].key_id;
j = Control_config[z].joy_id;
x = Control_list_key_x[gr_screen.res];
jptr = NULL;
*buf = 0;
if ((k < 0) && (j < 0)) {
gr_set_color_fast(&Color_grey);
gr_printf(x, y, XSTR( "None", 211));
gr_printf_menu(x, y, XSTR( "None", 211));
} else {
if (k >= 0) {
@@ -1977,9 +2066,8 @@ void control_config_do_frame(float frametime)
gr_set_color_fast(c);
}
gr_printf(x, y, buf);
gr_printf_menu(x, y, buf);
len = strlen(buf);
Cc_lines[line].kx = x - Control_list_coords[gr_screen.res][CONTROL_X_COORD];
gr_get_string_size(&w, NULL, buf);
Cc_lines[line].kw = w;
@@ -1987,7 +2075,7 @@ void control_config_do_frame(float frametime)
if (j >= 0) {
gr_set_color_fast(&Color_text_normal);
gr_printf(x, y, XSTR( ", ", 212));
gr_printf_menu(x, y, XSTR( ", ", 212));
gr_get_string_size(&w, NULL, XSTR( ", ", 212));
x += w;
}
@@ -2010,8 +2098,8 @@ void control_config_do_frame(float frametime)
gr_set_color_fast(c);
}
gr_force_fit_string(buf, 255, Control_list_key_w[gr_screen.res] + Control_list_key_x[gr_screen.res] - x);
gr_printf(x, y, buf);
font::force_fit_string(buf, 255, Control_list_key_w[gr_screen.res] + Control_list_key_x[gr_screen.res] - x);
gr_printf_menu(x, y, buf);
Cc_lines[line].jx = x - Control_list_coords[gr_screen.res][CONTROL_X_COORD];
gr_get_string_size(&Cc_lines[line].jw, NULL, buf);
@@ -2027,7 +2115,7 @@ void control_config_do_frame(float frametime)
if (j < 0) {
gr_set_color_fast(&Color_grey);
gr_printf(x, y, XSTR( "None", 211));
gr_printf_menu(x, y, XSTR( "None", 211));
} else {
if (Conflicts_axes[z & ~JOY_AXIS] >= 0) {
@@ -2046,7 +2134,7 @@ void control_config_do_frame(float frametime)
gr_set_color_fast(c);
}
gr_string(x, y, Joy_axis_text[j]);
gr_string(x, y, Joy_axis_text[j], GR_RESIZE_MENU);
}
}
@@ -2060,8 +2148,47 @@ void control_config_do_frame(float frametime)
List_buttons[i++].disable();
}
// If multiple controls presets are provided, display which one is in use
if (Control_config_presets.size() > 1) {
SCP_string preset_str;
int matching_preset = -1;
for (i=0; i<(int)Control_config_presets.size(); i++) {
bool this_preset_matches = true;
config_item *this_preset = Control_config_presets[i];
for (j=0; j<CCFG_MAX; j++) {
if (!Control_config[j].disabled && Control_config[j].key_id != this_preset[j].key_default) {
this_preset_matches = false;
break;
}
}
if (this_preset_matches) {
matching_preset = i;
break;
}
}
if (matching_preset >= 0) {
sprintf(preset_str, "Controls: %s", Control_config_preset_names[matching_preset].c_str());
} else {
sprintf(preset_str, "Controls: custom");
}
gr_get_string_size(&w, NULL, preset_str.c_str());
gr_set_color_fast(&Color_text_normal);
if (gr_screen.res == GR_640) {
gr_string(16, (24 - font_height) / 2, preset_str.c_str(), GR_RESIZE_MENU);
} else {
gr_string(24, (40 - font_height) / 2, preset_str.c_str(), GR_RESIZE_MENU);
}
}
// blit help overlay if active
help_overlay_maybe_blit(CONTROL_CONFIG_OVERLAY);
help_overlay_maybe_blit(Control_config_overlay_id, gr_screen.res);
gr_flip();
}
@@ -2086,6 +2213,8 @@ float check_control_timef(int id)
// first, see if control actually used (makes sure modifiers match as well)
if (!check_control(id)) {
Control_config[id].continuous_ongoing = false;
return 0.0f;
}
@@ -2100,6 +2229,11 @@ float check_control_timef(int id)
}
if (t1 + t2) {
// We want to set this to true only after visiting control_used() (above)
// to allow it to tell the difference between an ongoing continuous action
// started before and a continuous action being started right now.
Control_config[id].continuous_ongoing = true;
return t1 + t2;
}
@@ -2111,7 +2245,7 @@ void control_check_indicate()
#ifndef NDEBUG
if (Show_controls_info) {
gr_set_color_fast(&HUD_color_debug);
gr_printf(490, 15, NOX("Ctrls checked: %d"), Control_check_count);
gr_printf_no_resize(gr_screen.center_offset_x + gr_screen.center_w - 154, gr_screen.center_offset_y + 5, NOX("Ctrls checked: %d"), Control_check_count);
}
#endif
@@ -2181,7 +2315,8 @@ int check_control_used(int id, int key)
return 0;
}
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id, 1) || mouse_down_count(1 << Control_config[id].joy_id)) {
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id, 1) ||
((Control_config[id].joy_id >= 0) && (Control_config[id].joy_id < MOUSE_NUM_BUTTONS) && mouse_down_count(1 << Control_config[id].joy_id))) {
//mprintf(("Key used %d", key));
control_used(id);
return 1;
@@ -2205,6 +2340,17 @@ int check_control(int id, int key)
return 1;
}
if (Control_config[id].continuous_ongoing) {
// If we reach this point, then it means this is a continuous control
// which has just been released
Script_system.SetHookVar("Action", 's', Control_config[id].text);
Script_system.RunCondition(CHA_ONACTIONSTOPPED, '\0', NULL, NULL, id);
Script_system.RemHookVar("Action");
Control_config[id].continuous_ongoing = false;
}
return 0;
}
@@ -2218,17 +2364,17 @@ void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr)
// joy_get_scaled_reading will return a value represents the joystick pos from -1 to +1 (fixed point)
*h = 0;
if (Axis_map_to[0] >= 0) {
*h = joy_get_scaled_reading(axes_values[Axis_map_to[0]], Axis_map_to[0]);
*h = joy_get_scaled_reading(axes_values[Axis_map_to[0]]);
}
*p = 0;
if (Axis_map_to[1] >= 0) {
*p = joy_get_scaled_reading(axes_values[Axis_map_to[1]], Axis_map_to[1]);
*p = joy_get_scaled_reading(axes_values[Axis_map_to[1]]);
}
*b = 0;
if (Axis_map_to[2] >= 0) {
*b = joy_get_scaled_reading(axes_values[Axis_map_to[2]], Axis_map_to[2]);
*b = joy_get_scaled_reading(axes_values[Axis_map_to[2]]);
}
*ta = 0;
@@ -2238,7 +2384,7 @@ void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr)
*tr = 0;
if (Axis_map_to[4] >= 0) {
*tr = joy_get_scaled_reading(axes_values[Axis_map_to[4]], Axis_map_to[4]);
*tr = joy_get_scaled_reading(axes_values[Axis_map_to[4]]);
}
if (Invert_axis[0]) {
@@ -2260,6 +2406,7 @@ void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr)
return;
}
int Last_frame_timestamp;
void control_used(int id)
{
// if we have set this key to be ignored, ignore it
@@ -2267,7 +2414,20 @@ void control_used(int id)
return;
}
Control_config[id].used = timestamp();
// This check needs to be done because the control code might call this function more than once per frame,
// and we don't want to run the hooks more than once per frame
if (Control_config[id].used < Last_frame_timestamp) {
if (!Control_config[id].continuous_ongoing) {
Script_system.SetHookVar("Action", 's', Control_config[id].text);
Script_system.RunCondition(CHA_ONACTION, '\0', NULL, NULL, id);
Script_system.RemHookVar("Action");
if (Control_config[id].type == CC_TYPE_CONTINUOUS)
Control_config[id].continuous_ongoing = true;
}
Control_config[id].used = timestamp();
}
}
void control_config_clear_used_status()
+16 -3
View File
@@ -5,12 +5,14 @@
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
*/
#ifndef CONTROLS_CONFIG_H
#define CONTROLS_CONFIG_H
#include "globalincs/pstypes.h"
#define CONTROL_CONFIG_XSTR 507
/*!
@@ -67,6 +69,7 @@ typedef struct config_item {
short joy_id; //!< joystick button bound to action
int used; //!< has control been used yet in mission? If so, this is the timestamp
bool disabled; //!< whether this action should be available at all
bool continuous_ongoing;//!< whether this action is a continuous one and is currently ongoing
} config_item;
/*!
@@ -285,11 +288,19 @@ extern int Axis_map_to[];
extern int Invert_axis[];
extern int Invert_axis_defaults[];
extern int Joy_dead_zone_size;
extern int Joy_sensitivity;
extern int Control_config_overlay_id;
extern config_item Control_config[]; //!< Stores the keyboard configuration
extern SCP_vector<config_item*> Control_config_presets; // tabled control presets; pointers to config_item arrays
extern SCP_vector<SCP_string> Control_config_preset_names; // names for Control_config_presets (identical order of items)
extern char **Scan_code_text;
extern char **Joy_button_text;
void control_config_common_init(); //!< initialize common control config stuff - call at game startup after localization has been initialized
void control_config_common_close(); //!< close common control config stuff - call at game shutdown
void control_config_init();
void control_config_do_frame(float frametime);
@@ -297,8 +308,8 @@ void control_config_close();
void control_config_cancel_exit();
void control_config_reset_defaults();
int translate_key_to_index(char *key);
void control_config_reset_defaults(int presetnum=-1);
int translate_key_to_index(const char *key, bool find_override=true);
char *translate_key(char *key);
char *textify_scancode(int code);
float check_control_timef(int id);
@@ -310,4 +321,6 @@ void clear_key_binding(short key);
void control_check_indicate();
void control_config_clear_used_status();
int joy_get_scaled_reading(int raw);
#endif
File diff suppressed because it is too large. Load diff
+67 -69
View File
@@ -10,17 +10,17 @@
#include "cutscene/cutscenes.h"
#include "ui/ui.h"
#include "gamesnd/gamesnd.h"
#include "freespace.h"
#include "gamesequence/gamesequence.h"
#include "freespace2/freespace.h"
#include "io/key.h"
#include "movie.h"
#include "popup/popup.h"
#include "menuui/mainhallmenu.h"
#include "gamesnd/gamesnd.h"
#include "globalincs/alphacolors.h"
#include "io/key.h"
#include "localization/localize.h"
#include "menuui/mainhallmenu.h"
#include "movie.h"
#include "parse/parselo.h"
#include "popup/popup.h"
#include "ui/ui.h"
extern int Cmdline_nomovies;
@@ -52,65 +52,61 @@ void cutscene_init()
{
atexit(cutscene_close);
char buf[MULTITEXT_LENGTH];
int rval;
cutscene_info cutinfo;
cutscene_info cutinfo;
// open localization
lcl_ext_open();
try
{
read_file_text("cutscenes.tbl", CF_TYPE_TABLES);
reset_parse();
if ((rval = setjmp(parse_abort)) != 0) {
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", "cutscenes.tbl", rval));
lcl_ext_close();
// parse in all the cutscenes
Cutscenes.clear();
skip_to_string("#Cutscenes");
ignore_white_space();
bool isFirstCutscene = true;
while (required_string_either("#End", "$Filename:"))
{
required_string("$Filename:");
stuff_string(cutinfo.filename, F_PATHNAME, MAX_FILENAME_LEN);
required_string("$Name:");
stuff_string(cutinfo.name, F_NAME, NAME_LENGTH);
required_string("$Description:");
stuff_string(buf, F_MULTITEXT, sizeof(buf));
drop_white_space(buf);
compact_multitext_string(buf);
cutinfo.description = vm_strdup(buf);
if (optional_string("$cd:"))
stuff_int(&cutinfo.cd);
else
cutinfo.cd = 0;
cutinfo.viewable = false;
if (isFirstCutscene) {
isFirstCutscene = false;
// The original code assumes the first movie is the intro, so always viewable
cutinfo.viewable = true;
}
if (optional_string("$Always Viewable:")) {
stuff_boolean(&cutinfo.viewable);
}
Cutscenes.push_back(cutinfo);
}
required_string("#End");
}
catch (const parse::ParseException& e)
{
mprintf(("TABLES: Unable to parse '%s'! Error message = %s.\n", "cutscenes.tbl", e.what()));
return;
}
read_file_text("cutscenes.tbl", CF_TYPE_TABLES);
reset_parse();
// parse in all the cutscenes
Cutscenes.clear();
skip_to_string("#Cutscenes");
ignore_white_space();
bool isFirstCutscene = true;
while ( required_string_either("#End", "$Filename:") )
{
memset(&cutinfo, 0, sizeof(cutscene_info));
required_string("$Filename:");
stuff_string( cutinfo.filename, F_PATHNAME, MAX_FILENAME_LEN );
required_string("$Name:");
stuff_string( cutinfo.name, F_NAME, NAME_LENGTH );
required_string("$Description:");
stuff_string(buf, F_MULTITEXT, sizeof(buf));
drop_white_space(buf);
compact_multitext_string(buf);
cutinfo.description = vm_strdup(buf);
required_string("$cd:");
stuff_int( &cutinfo.cd );
if (isFirstCutscene) {
isFirstCutscene = false;
// The original code assumes the first movie is the intro, so always viewable
cutinfo.viewable = true;
}
if (optional_string("$Always Viewable:")) {
stuff_boolean(&cutinfo.viewable);
}
Cutscenes.push_back(cutinfo);
}
required_string("#End");
// close localization
lcl_ext_close();
}
// function to return 0 based index of which CD a particular movie is on
@@ -156,6 +152,8 @@ void cutscene_mark_viewable(char *filename)
}
i++;
}
Warning(LOCATION, "Could not find cutscene '%s' in listing; cannot mark it viewable...", filename);
}
#define NUM_BUTTONS 8
@@ -254,7 +252,7 @@ int Cutscene_max_text_lines[GR_NUM_RESOLUTIONS] = {
static int Text_size;
static int Text_offset = 0;
static int Text_line_size[MAX_TEXT_LINES];
static char *Text_lines[MAX_TEXT_LINES];
static const char *Text_lines[MAX_TEXT_LINES];
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
@@ -262,7 +260,7 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
int cd_present = 0;
int cd_drive_num;
int cd_mve_is_on;
char volume_name[128];
char volume_name[MAX_PATH_LEN];
int num_attempts = 0;
@@ -322,7 +320,7 @@ void cutscenes_screen_play()
strcpy_s(name, Cutscenes[which_cutscene].filename );
// full_name = cf_add_ext(name, NOX(".mve"));
main_hall_stop_music();
main_hall_stop_music(true);
main_hall_stop_ambient();
int rval = movie_play(name);
main_hall_start_music();
@@ -335,7 +333,7 @@ void cutscenes_screen_play()
else
sprintf(str, XSTR("Unable to play movie %s.", 204), Cutscenes[which_cutscene].name);
popup(0, 1, POPUP_OK, str );
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, str );
}
}
@@ -582,7 +580,7 @@ void cutscenes_screen_do_frame()
GR_MAYBE_CLEAR_RES(Background_bitmap);
if (Background_bitmap >= 0) {
gr_set_bitmap(Background_bitmap);
gr_bitmap(0, 0);
gr_bitmap(0, 0, GR_RESIZE_MENU);
}
Ui_window.draw();
@@ -612,7 +610,7 @@ void cutscenes_screen_do_frame()
gr_set_color_fast(&Color_text_normal);
}
gr_printf(Cutscene_list_coords[gr_screen.res][0], Cutscene_list_coords[gr_screen.res][1] + y, Cutscenes[Cutscene_list[z]].name);
gr_printf_menu(Cutscene_list_coords[gr_screen.res][0], Cutscene_list_coords[gr_screen.res][1] + y, Cutscenes[Cutscene_list[z]].name);
y += font_height;
z++;
@@ -651,7 +649,7 @@ void cutscenes_screen_do_frame()
strncpy(line, Text_lines[z], len);
line[len] = 0;
gr_string(Cutscene_desc_coords[gr_screen.res][0], Cutscene_desc_coords[gr_screen.res][1] + y, line);
gr_string(Cutscene_desc_coords[gr_screen.res][0], Cutscene_desc_coords[gr_screen.res][1] + y, line, GR_RESIZE_MENU);
y += font_height;
z++;
-4
View File
@@ -14,10 +14,6 @@
#include "globalincs/pstypes.h"
typedef struct cutscene_info {
cutscene_info() :
viewable(false)
{}
char filename[MAX_FILENAME_LEN];
char name[NAME_LENGTH];
char *description;
+3 -3
View File
@@ -15,7 +15,7 @@ static void genLoopkupTable();
void decodeFrame16(ubyte *pFrame, ubyte *pMap, int mapRemain, unsigned char *pData, int dataRemain)
{
ubyte *pOrig, *pOffData, *pEnd, op;
ubyte *pOrig, *pOffData, op;
ushort offset;
int length = 0, i, j, xb, yb;
@@ -32,7 +32,6 @@ void decodeFrame16(ubyte *pFrame, ubyte *pMap, int mapRemain, unsigned char *pDa
offset = pData[0]|(pData[1]<<8);
pOffData = pData + offset;
pEnd = pData + offset;
pData += 2;
@@ -55,7 +54,8 @@ void decodeFrame16(ubyte *pFrame, ubyte *pMap, int mapRemain, unsigned char *pDa
}
if ((length-(pData-pOrig)) != 0) {
nprintf(("MVE", "DEBUG: junk left over: %d,%d,%d\n", (pData-pOrig), length, (length-(pData-pOrig))));
nprintf(("MVE", "DEBUG: junk left over: " PTRDIFF_T_ARG ",%d," PTRDIFF_T_ARG "\n",
(pData-pOrig), length, (length-(pData-pOrig))));
}
}
+15 -14
View File
@@ -13,18 +13,21 @@
#include <windows.h>
#endif
#include "graphics/2d.h"
#include "globalincs/systemvars.h"
#include "cutscene/movie.h"
#include "osapi/osapi.h"
#include "cmdline/cmdline.h"
#include "cfile/cfile.h"
#include "cmdline/cmdline.h"
#include "cutscene/cutscenes.h" // cutscene_mark_viewable()
#include "cutscene/movie.h"
#include "cutscene/mvelib.h"
#include "cutscene/oggplayer.h"
#include "globalincs/systemvars.h"
#include "graphics/2d.h"
#include "osapi/osapi.h"
extern int Game_mode;
const char *movie_ext_list[] = { ".ogg", ".mve" };
const int NUM_MOVIE_EXT = sizeof(movie_ext_list) / sizeof(char*);
#define MOVIE_NONE -1
#define MOVIE_OGG 0
@@ -41,9 +44,7 @@ int movie_find(char *filename, char *out_name)
{
char full_path[MAX_PATH];
char tmp_name[MAX_PATH];
int size, offset = 0;
const int NUM_EXT = 2;
const char *movie_ext[NUM_EXT] = { ".ogg", ".mve" };
size_t size, offset = 0;
if (out_name == NULL)
return MOVIE_NONE;
@@ -57,7 +58,7 @@ int movie_find(char *filename, char *out_name)
char *p = strrchr(tmp_name, '.');
if ( p ) *p = 0;
int rc = cf_find_file_location_ext(tmp_name, NUM_EXT, movie_ext, CF_TYPE_ANY, sizeof(full_path) - 1, full_path, &size, &offset, 0);
int rc = cf_find_file_location_ext(tmp_name, NUM_MOVIE_EXT, movie_ext_list, CF_TYPE_ANY, sizeof(full_path) - 1, full_path, &size, &offset, 0);
if (rc == MOVIE_NONE)
return MOVIE_NONE;
@@ -77,7 +78,6 @@ bool movie_play(char *name)
cutscene_mark_viewable(name);
}
extern int Mouse_hidden;
extern int Is_standalone;
if (Cmdline_nomovies || Is_standalone)
@@ -101,7 +101,8 @@ bool movie_play(char *name)
}
// clear the screen and hide the mouse cursor
Mouse_hidden++;
io::mouse::CursorManager::get()->pushStatus();
io::mouse::CursorManager::get()->showCursor(false);
gr_reset_clip();
gr_set_color(255, 255, 255);
gr_set_clear_color(0, 0, 0);
@@ -127,7 +128,7 @@ bool movie_play(char *name)
} else {
// uh-oh, movie is invalid... Abory, Retry, Fail?
mprintf(("MOVIE ERROR: Found invalid movie! (%s)\n", name));
Mouse_hidden--; // show the mouse cursor!
io::mouse::CursorManager::get()->popStatus();
return false;
}
} else if (rc == MOVIE_MVE) {
@@ -144,13 +145,13 @@ bool movie_play(char *name)
} else {
// uh-oh, movie is invalid... Abory, Retry, Fail?
mprintf(("MOVIE ERROR: Found invalid movie! (%s)\n", name));
Mouse_hidden--; // show the mouse cursor!
io::mouse::CursorManager::get()->popStatus();
return false;
}
}
// show the mouse cursor again
Mouse_hidden--;
io::mouse::CursorManager::get()->popStatus();
return true;
}
+3
View File
@@ -12,6 +12,9 @@
#ifndef _MOVIE_HEADER_FILE
#define _MOVIE_HEADER_FILE
extern const char *movie_ext_list[];
extern const int NUM_MOVIE_EXT;
bool movie_play(char *name);
void movie_play_two(char *name1, char *name2);
Loaded 100 of 1495 files, more files were not shown because too many files have changed in this diff. Show more