Commit Graph
75 Commits
Author SHA1 Message Date
Goober5000 8a29586ef5 properly calculate submodel host orient 2022-01-30 22:58:24 -05:00
Goober5000 bd90781499 rename a couple variables for clarification 2022-01-30 22:23:44 -05:00
Goober5000 b15858f686 redo initialization 2021-11-05 01:19:48 -04:00
Goober5000 cbda26b4fb allow subtitles to use different line spacing
This adds an optional extra factor to `show-subtitle` and `show-subtitle-text` to adjust the line height.  Useful for double-spacing, 1.5-spacing, etc.
2021-11-04 23:19:45 -04:00
Goober5000 7c92dd9f7c hoist model_get and model_get_instance out of a bunch of functions 2020-12-16 11:55:31 -05:00
Baezon cb0f3461aa v1 2020-09-08 21:42:42 -04:00
Baezon 303ee3fca1 const objp for object_get_model 2020-09-04 22:29:31 -04:00
Baezon 4df4987b81 v2 2020-09-04 17:36:53 -04:00
asarium ad1ede7b74 Add new options system
This is a system for storing arbitrary data in the config file and then
easily retrieving it later on. This has full Lua support for exposing
the available options in a custom UI and changing the values of the
options. This ported some of the existing command line options over to
the new system which is opt-in for the moment by using a mod_table flag.
2019-03-02 14:02:21 +01:00
CasparKielwein 97fdca6b52 remove unused functions in camera 2018-12-22 20:10:56 +01:00
asarium 8f4d51b14a Convert ade_get_args to variadic template based solution
This maintains the type information which can be used for enforce
const-correctness and also for implementing more advanced ways of
handling the type information.
2018-09-26 19:15:42 +02:00
asarium eeed22b91a Enable misc-unused-parameters
clang-tidy was used for fixing the warnings. It is not clear if this is
actually an improvement so this may still be disabled later.
2018-04-25 11:57:55 +02:00
asarium 48873185ce Another batch of misc- checks 2018-04-25 11:13:20 +02:00
asarium 4c1ed2f66a Move graphics matrix handling out of OpenGL code
All transformations are now handled by shaders so there is nothing
special going on in the graphics API specific code anymore. Since model
uniform buffers require access to these matrices I moved the matrix
handling out of the graphics API code.
2017-09-05 12:36:32 +02:00
asarium 9a8bfc0217 More const correctness 2017-01-02 13:17:59 +01: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 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
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
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
niffiwan 9dfa67b64d Correctly compare vector .end() 2015-10-30 22:01:06 +10:00
niffiwan fb20632b18 Fix memory leak in cam_create/cam_close 2015-10-28 21:26:00 +10: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
Echelon9 ae8a310e97 Simplify duplicative camera/ includes, which are in camera/camera.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
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
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
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 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
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
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
The_E 20abba69dc Fix my fix from revision 9305: Properly check for null pointer dereference
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9651 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
Valathil fd125acb19 Fix for Mantis 1978: Add eyepoint directions to cameras; Add guncam view for cameras that are bound to turrets 2012-12-14 22:18:45 +00:00
The_E a71b5f4247 PVS Studio fix: Add checks against NULL pointer dereferences 2012-11-03 09:23:23 +00:00
chief1983 4e5d3e2e57 Fix all the 'no newline at end of file' warnings I saw thrown by gcc on FreeBSD. 2012-11-02 17:30:17 +00:00
Goober5000 ca08b3813a reverting 9121 -- I'll give karajorma the benefit of the doubt and assume he just didn't see the compatibility additions 2012-08-19 07:20:06 +00:00
karajorma 8e043a0019 Revert 9119 and 9120 since at least one of them breaks compatibility with 3.6.12 2012-08-19 06:13:45 +00:00
Goober5000 53f080ea67 all mod_table flags should also default to NO
also, change the generic_anim flag on whether to use the HUD color settings to be a bit more descriptive
2012-08-19 03:27:31 +00:00
The_E b006d8de1a Since we can't change the default cutscene camera behaviour (switching off the HUD when cutscene camera is active), this introduces a mod.tbl setting to alter this behaviour.
The new setting is called "$Cutscene camera disables HUD:", is a boolean, and defaults to true.
2012-05-11 07:57:01 +00:00
Echelon9 6d4f266e52 Use SCP_* types to access STL types wherever possible. This allows more complete memory monitoring 2011-10-03 09:06:56 +00:00
Echelon9 10f9ecac09 Documentation: Code cleanup of camera.cpp and camera.h, and removal of redundant function 2011-09-12 12:15:27 +00:00
Echelon9 80a027a400 PVS-Studio fix: V803 Decreased performance. In case 'tvs' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator.
For further discussion see, http://www.viva64.com/en/b/0093/

The scenarios where it will improve performance are under Debug builds. This improvement will however allow quicker use of other profiling tools that need to run on Debug builds.

Note. Code with size_t does not see the performance improvement comparison to iterators due to absence of array overrun check.
2011-08-28 08:31:25 +00:00
Echelon9 a248a37d58 PVS-Studio: Fix V805. Decreased performance. It is inefficient to identify an empty string by using 'strlen(str) > 0' construct 2011-08-24 13:37:01 +00:00
Echelon9 2808f6624d PVS-Studio fix: Expression 'idx < 0' is always false. Unsigned type value is never < 0. 2011-08-11 14:15:05 +00:00
The_E 7f5c3d343e Valathil's code cleanup patch. 2011-07-20 18:04:43 +00:00
Echelon9 eb129200a1 Fix: Convert a further subset of strcpy() to the SAFE_STRINGS strcpy_s() version 2010-12-20 04:28:01 +00:00
Goober5000 0458d83f94 a couple of small but important fixes to the subtitle code, including (finally) the complete fix for Mantis #2152 2010-03-20 06:37:26 +00:00
Goober5000 725b48d2b9 handle variables in show-subtitle 2010-03-19 07:39:51 +00:00
Goober5000 5a3fa6f576 allow specification of fonts via show-subtitle 2010-03-19 06:31:15 +00:00
Goober5000 7fa0a70c9e this is a long-overdue rewrite of WMC's show-subtitle sexps 2010-03-15 01:55:40 +00:00
Wanderer 5983a47bc4 fix for mantis 2125 2010-03-04 20:34:52 +00:00