Commit graph

128 commits

Author SHA1 Message Date
Areloch b54f41e36d Merge pull request #1378 from Areloch/PVS_Cleanup_595
Properly testing pointer vars aren't null before using them.
2015-08-22 23:17:43 -05:00
Azaezel 1df7e47a89 From @LuisAntonRebollo -Stymies infinite loop on exit with SDL2+opengl on windows. 2015-08-13 15:34:41 -05:00
Areloch 3a18819e1e Issue found by PVS Studio:
Several instances where we utilize a pointer variable without properly testing that they aren't null first.
2015-07-28 23:25:09 -05:00
Daniel Buckmaster 4f2f1ca4e1 Merge pull request #1356 from Areloch/PVS_Cleanup_813
Convert un-modified function arguments to const references.
2015-07-20 22:55:22 +10:00
Daniel Buckmaster c2e5dc3345 Merge remote-tracking branch 'bpay/clang-cl-build-fixes' into development
Conflicts:
	Engine/source/T3D/shapeBase.h
2015-07-17 16:55:12 +10:00
Areloch 11398bb04e Issue found with PVS-Studio:
A lot of instances where some function args are not actually modified in any way, meaning that it is better for performance to convert them into const references. This prevents an additional copy, which can help performance.
2015-07-16 22:02:18 -05:00
Daniel Buckmaster 86e0e67496 Merge pull request #1352 from Areloch/PVS_Cleanup_807
Unnecessarily repeated expressions
2015-07-16 15:45:32 +10:00
Areloch 5c688260d5 Issue found with PVS-Studio:
Many places utilize post-incrementation with iterators, but it's better performance to use pre-incrementation.

Resolved by changing the iter++ instances to ++iter;
2015-07-13 23:08:17 -05:00
Areloch 2002d74b78 Issue found with PVS-Studio:
Many instances of a function or expression being used repeatedly, which can lower performance.

Fixed it in these cases by creating on local var, reference or pointer that's used instead.
2015-07-13 22:51:17 -05:00
Raul Ferriz 5ef130d581 Fixed some random Worder warnings 2015-07-03 15:52:38 +02:00
Daniel Buckmaster 6b9e5dd15e Merge pull request #1330 from jamesu/stereo_render_fix
Basic fix for stereo rendering without a display device
2015-07-02 23:45:10 +10:00
Daniel Buckmaster 39f0e269d6 Merge pull request #1328 from GarageGames/release-3.7
Release 3.7
2015-06-24 19:00:57 +10:00
James Urquhart efc47ed757 Basic fix for stereo rendering without a display device 2015-06-21 20:59:41 +01:00
rextimmy b5f8e9aa70 gfxGLDevice setShader fix. 2015-06-15 21:10:49 +10:00
James Urquhart 3a457749ec Oculus VR DK2 Support
- Updated to work with 0.5.x SDK
- Uses Oculus Rendering rather than PostFX
- Stereo rendering refactored so more rendering info is grabbed from the DisplayDevice
- Implements an Offscreen Canvas for in-game gui with oculus
- Message dialogs and metrics display can now go to the OffScreen Canvas (if oculus demo is setup correctly)
2015-05-06 23:09:51 +01:00
LuisAntonRebollo e6b7cf108b Fix GLSL include when file is empty. 2015-03-08 23:25:23 +01:00
Ben Payne 6040a8d855 Fix macro token pasting errors when compiling with clang-cl 2015-03-04 19:10:53 -05:00
Daniel Buckmaster 497a15cfd0 Merge pull request #1214 from bpay/cppcheck-cleaning
Fix some issues flagged by cppcheck
2015-03-01 18:27:40 +11:00
Ben Payne f67a0353d0 Review fixes 2015-02-23 14:57:37 -05:00
Daniel Buckmaster 905dd50d36 Merge pull request #980 from Azaezel/gl_debug_callbacks
opengl error reporting formatting
2015-02-22 12:24:30 +11:00
Ben Payne be0b9728e5 Don't self-assign 2015-02-20 18:42:32 -05:00
Ben Payne 0ffd7f5620 Fix member vars left uninitialized in constructors 2015-02-20 18:41:51 -05:00
Luis Anton Rebollo 098fa19abb Merge pull request #1014 from Lopuska/patch-1
vSync on opengl
2015-02-15 23:02:32 +01:00
Luis Anton Rebollo 8da9b7461f Merge pull request #1085 from Azaezel/DX9CubemapMips
cubemap Mip retrieval-DX
2015-02-15 22:55:11 +01:00
Azaezel 43e0826308 reordered by request 2015-02-12 14:47:39 -06:00
Azaezel 02de4658e5 nvidia nsight debugger support.
requires defining the TORQUE_NSIGHT_WORKAROUND preprocessor macro
2015-02-12 14:31:10 -06:00
Luis Anton Rebollo 1097e957a3 Merge pull request #1048 from Lopuska/patch-11
missing texture format.
2015-02-07 18:04:46 +01:00
Luis Anton Rebollo cc9be50422 Merge pull request #1121 from bpay/fix-buffer-overflows
Fix buffer overflows
2015-02-02 20:15:51 +01:00
Daniel Buckmaster 014b566014 Merge remote-tracking branch 'gg/development-3.6' into development
Conflicts:
	Engine/source/T3D/gameFunctions.cpp
2015-01-29 21:17:38 +11:00
Ben Payne 4694b0a8ed Fix buffer size larger than necessary 2015-01-26 16:52:04 -05:00
Ben Payne a88339c219 Fix buffer overflows due to incorrect use of sizeof
A snippet of example code:

UTF16 pszFilter[1024];
...
convertUTF8toUTF16((UTF8 *)mData.mFilters, pszFilter, sizeof(pszFilter));

Since the conversion function is expecting the third parameter to be the
length in 16-bit characters, *not* bytes, this results in the function
writing outside the bounds of the output array.

To make this less likely to happen in the future (I hope), I've provided a
template function that infers the correct size of a static array, so it's
no longer necessary to pass the size in most cases. The sized function has
been renamed with an "N" suffix to hopefully encourage this use.

This bug was caught due to a warning from MSVC about stack corruption
occurring in codeBlock::exec(), after opening a file open dialog twice in
succession. After some hunting, I found that this was due to
FileDialog::Execute() passing incorrect buffer sizes to the conversion
function, which resulted in the function writing a null terminator into
some memory that happened to be in the stack frame of codeBlock::exec()!
2015-01-26 16:52:01 -05:00
LuisAntonRebollo 52d8aa3a97 Remove a get* OpenGL function causing CPU-GPU sync point (bad performance). 2015-01-26 01:56:13 +01:00
Luis Anton Rebollo 6492028bb2 Merge pull request #1035 from bpay/memfixes
Memfixes
2015-01-25 13:42:32 +01:00
Luis Anton Rebollo ea0e3fd683 Merge pull request #1096 from bpay/fix-include-guards
Fix include guards
2015-01-24 23:02:13 +01:00
LuisAntonRebollo 4e9034854d Linux implementation. Include changes for gcc x64. 2015-01-24 22:08:26 +01:00
Anis ee4f0df69a Update gfxGLDevice.win.cpp 2015-01-19 17:44:48 +01:00
LuisAntonRebollo aa35157eef PlatformSDL implementation. 2015-01-19 01:17:37 +01:00
LuisAntonRebollo 21d58bb191 Modified files for SDL2. 2015-01-19 00:33:23 +01:00
Ben Payne b2b950c84a Add missing include guards to some headers 2015-01-06 00:42:33 -05:00
Azaezel f1d382fcff cubemap Mip retrieval-DX
similar to opengl, if the textures comprising a cubemap contain mips, it retrieves them, otherwise it generates them.
2014-12-27 11:34:08 -06:00
Luis Anton Rebollo 39bd99a61a Merge pull request #1056 from Lopuska/patch-12
mipmap support on OpenGL cubemap
2014-12-27 03:18:16 +01:00
LuisAntonRebollo 6789270789 OpenGL: Mipmaps for GFXGLCubemap. Fix dynamic cubemaps. 2014-12-27 03:03:33 +01:00
Luis Anton Rebollo 9eb05b2bdc Merge pull request #1083 from BeamNG/opengl_intel_WIP
Fix/walkaround for OpenGL on Intel
2014-12-27 01:13:14 +01:00
LuisAntonRebollo c2c9cf4a2d OpenGL: Mipmaps for GFXGLCubemap. Fix compressed textures. 2014-12-27 00:01:21 +01:00
LuisAntonRebollo 2f8f89d486 OpenGL: Mipmaps for GFXGLCubemap. Fix mipmaps size. 2014-12-26 21:28:31 +01:00
LuisAntonRebollo 9150c7f5ab OpenGL: Mipmaps for GFXGLCubemap. 2014-12-26 21:03:54 +01:00
Daniel Buckmaster ae284a89ec Merge branch 'development' into defineconsolemethod
Conflicts:
	Engine/source/materials/materialDefinition.cpp
2014-12-26 13:22:16 +11:00
Daniel Buckmaster 3ab048c5b0 Fixes after feedback from Luis.
* Made use of dStrIsEmpty in more locations (and fixed it :P)
 * Removed commented-out code
 * Corrected default params
 * Fixed some console warning formats
 * Removed tabs
 * Corrected setExtent API
2014-12-23 18:48:02 +11:00
Daniel Buckmaster 9396ae7176 Merge remote-tracking branch 'Winterleaf/Development-Console' into defineconsolemethod
Conflicts:
	Engine/source/T3D/missionMarker.cpp
2014-12-21 21:23:55 +11:00
Anis ca04726ad6 glGenerateMipmap on uncompressed cubemap 2014-12-16 15:14:30 +01:00