Commit graph

4 commits

Author SHA1 Message Date
OTHGMars bab3d9d5f3 Fix for bug in GFXVideoMode::parseFromString()
When testing PR #2264 I discovered that GFXVideoMode::parseFromString() will never assign false to the fullScreen value. That value must be initialized to false going in. I found it hard to believe that that could be the case and not have caused a problem before now, so I dropped:
```c++
   GFXVideoMode vmTest = GFXInit::getDesktopResolution();
   vmTest.fullScreen = true;
   vmTest.parseFromString("800 600 false 32 60");
   Con::printf("%s becomes %s", "800 600 false 32 60", vmTest.toString().c_str());
```
into the end of _GFXInitGetInitialRes() and the output string is:
800 600 false 32 60 becomes 800 600 true 32 60 0

None of the values get assigned by the macro [here](https://github.com/GarageGames/Torque3D/blob/development/Engine/source/gfx/gfxStructs.cpp#L46-L48) if their function evaluates to zero or the token is missing from the string. This commit corrects that for the boolean case to only skip the assignment if the string token is not found.
2018-07-07 02:23:59 -04:00
Glenn Smith 47d5b6ead7 As suggested, extract strlen calls from sizes into variables so it isn't called twice 2018-03-08 20:59:40 -05:00
Glenn Smith 79c34c68db Use strncpy instead of strcpy because again, buffer overflows 2018-03-06 02:35:33 -05:00
DavidWyand-GG 7dbfe6994d Engine directory for ticket #1 2012-09-19 11:15:01 -04:00