Commit Graph

156 Commits

Author SHA1 Message Date
rpolzer 58f0f9e557 q3map2/picomodel: remove some warnings
imported from netradiant, initial commit message:

> q3map2 is now waring free
2018-01-27 22:53:18 +01:00
Rudolf Polzer 5a40208a05 q3map2: fix some more warnings
imported from netradiant, initial commit message:

> fix some more warnings
2018-01-27 22:53:18 +01:00
Thomas Debesse ff416cdfb9 q3map2: drop quakelive encrypted pk3 vfs 2018-01-27 02:26:30 +01:00
Thomas Köppe d3d00345c5 [q3map2/{vis,visflow}.c] Reinstate offsetof-based size computation.
The logic isn't entirely legitimate, since fixedWinding_t is a
fixed-size type that is *sometimes* treated as a variable-sized type,
but it would require deeper refactoring to make this strictly
conforming. As it is, we just keep the offset computation as a
reasonable way to calculate the allocation size.

Fixes #583.
2018-01-22 16:03:21 +00:00
Timothee Besset 67fa177673 cleanup more offsetof usage 2018-01-22 08:43:48 -06:00
Thomas Köppe f061ce9990 Change winding_t, winding_accu_t and brush_t to use flexible array members rather than fixed-sized arrays.
The arrays were always meant to be variably sized, and objects are only ever allocated dynamically. Object size computations are simplified with this change.

Flexible arrays were introduced in C99, so this change means that we will require a C99-conforming compiler henceforth.
2018-01-22 02:23:23 +00:00
Timothee "TTimo" Besset c0a5da84f0
Merge pull request #535 from illwieckz/unvanquished
initial unvanquished support
2018-01-21 15:09:53 -06:00
Timothee Besset 08b44c433d Disable the deprecated functions warning 2018-01-21 14:59:29 -06:00
Timothee Besset fc33f1818c Merge branch 'master' of github.com:TTimo/GtkRadiant 2018-01-21 14:47:38 -06:00
Timothee Besset e08d6b6429 Visual Studio 2017. Fixed q3map2_urt 64 bit compilation also. 2018-01-21 14:47:06 -06:00
Thomas Köppe ec0907f7ca Use standard "offsetof" facility rather than manual code involving null pointer dereferences. 2018-01-21 01:54:24 +00:00
Timothee "TTimo" Besset 3c49dd161d
Merge pull request #576 from tkoeppe/bugfixes
Bugfixes in sciptlib.c and map.c
2018-01-20 15:35:53 -06:00
Timothee "TTimo" Besset 61d14dfd10
Merge pull request #578 from Pan7/donotalias
Extra donotenterlarge surfaceparm for nonotenterlarge
2018-01-16 08:59:54 -06:00
Pan 911d5562f6 Extra donotenterlarge surfaceparm for nonotenterlarge 2018-01-16 13:12:13 +01:00
Thomas Köppe 606d72adf2 [q3map2] Fix errnoneous plane access if plane was not found 2018-01-08 15:17:58 +00:00
Thomas Debesse da38f7754c [q3map2] reduce diff noise with netradiant tree 2018-01-07 21:16:53 +01:00
neumond eee8d14261 q3map2: Add -game unvanquished 2018-01-07 21:16:53 +01:00
Timothee "TTimo" Besset 94849adc93
Merge pull request #534 from illwieckz/noradiosity
Proper working with noradiosity 1 lights
2018-01-07 13:06:03 -06:00
Timothee "TTimo" Besset fe4fbe25a8
Merge pull request #568 from rsfbarreira/patch-1
Fix undefined behavior in FreeStackWinding
2018-01-07 13:01:27 -06:00
Ricardo Barreira 5e308f9056
Fix undefined behavior in FreeStackWinding
Fix subtraction of unrelated pointers and integer overflow in FreeStackWinding (both are undefined behavior).

In rare cases "i" would non-deterministically be between 0 and 2 even though the
pointers were in unrelated addresses, which caused a spurious free of one of
the three windings - eventually the real free would happen, be detected as a
double free and an exit(1) would ensue.

Example contents of w and stack->windings that triggered this in a test: 0xa9251c0 0x7f440a924f78

Checking for pointer equality makes the behavior defined and correct: http://port70.net/~nsz/c/c99/n1256.html#6.5.9
2017-10-31 13:05:32 +00:00
Thomas Debesse a3773852a4 preproc: add a FreeBSD condition everytime there is Linux or MacOS 2017-08-30 14:20:01 +00:00
Timothee Besset 3a6c9d30ed fix compile warning 2017-08-20 15:46:40 -05:00
neumond 89c8c7355d Proper working with noradiosity 1 lights 2017-08-06 02:31:22 +02:00
Timothee "TTimo" Besset 578fd09625 Merge pull request #526 from Pan7/fixAddWarn
Fix warning variable add is used uninitialized
2017-07-11 10:35:16 +02:00
Pan7 714cc90ce7 Fix warning variable add is used uninitialized 2017-07-10 15:30:04 +02:00
Pan7 a8925cbedb Fix xml passing to parameter warnings 2017-07-10 01:04:28 +02:00
Pan7 cc8cbd8a72 Fix uninitialized use of ext warning 2017-04-27 18:12:09 +02:00
Matthias Krüger 1498ce667d q3map2: don't store lightmap if the last bounce computation ran empty. 2017-03-13 10:58:35 +01:00
TTimo a26c818a1e remove the old .vcproj 2017-01-01 09:08:37 -06:00
Rudolf Polzer 1342e8ae5f fix two obvious typos 2016-10-14 02:10:02 +02:00
TTimo 8557f1820f more cleanups 2016-08-20 17:50:23 -06:00
TTimo de8105beb4 readability 2016-08-20 16:06:09 -06:00
Timothee "TTimo" Besset 28e9b8ec59 Merge pull request #364 from tkoeppe/memsize
[tools/quake3/q3map2] Fix memset size bugs
2016-08-20 16:03:57 -06:00
Timothee "TTimo" Besset cee35a43d7 Merge pull request #367 from tkoeppe/nan
[tools/quake3/q3map2/light{,maps}_ydnar.c] Fix float-to-int conversion
2016-08-20 15:56:26 -06:00
Thomas Köppe 7ea2c399ad [tools/quake3/q3map2] Fix memset size bugs 2016-08-16 23:41:29 +01:00
Thomas Köppe 87002dc31a [quake3/q3map2/brush.c] Fix misnamed variable 2016-08-16 22:50:14 +01:00
Thomas Köppe f463907e46 [tools/quake3/q3map2/light{,maps}_ydnar.c] Fix float-to-int conversion by preventing NaN values 2016-08-14 12:16:13 +01:00
Thomas Köppe d18d90278e [quake3/q3map2/brush.c] Fix arithmetic bug 2016-08-14 01:14:17 +01:00
Timothee "TTimo" Besset c918a29cd0 Merge pull request #352 from Pan7/Sys_FPrintf
Using Sys_FPrintf with SYS_WRN and SYS_ERR
2016-06-11 13:01:13 -05:00
Pan7 5105fc5db8 Using Sys_FPrintf with SYS_WRN and SYS_ERR 2016-05-16 21:20:20 +02:00
Timothee Besset cc68a76900 phrasing.. 2016-04-24 15:05:09 -05:00
Timothee Besset a88ef20680 fix short alloc and heap corruption for winding_accu_t and brush_t - brought about by https://github.com/TTimo/bspc/pull/4 2016-04-24 15:02:50 -05:00
Timothee Besset b36b3ba4b6 Visual Studio 2015 on debug configs too 2016-04-24 14:52:52 -05:00
Thomas Debesse d58490f20b split fixaas stuff from q3map2 2016-02-13 04:54:26 +01:00
Thomas Debesse cd07f71691 split bsp analyze/info/scale stuff from q3map2 2016-02-13 04:54:26 +01:00
Thomas Debesse cd5ff8d96c split bsp conversion stuff from q3map2 2016-02-12 20:02:35 +01:00
Timothee "TTimo" Besset 8428b75fcb Merge pull request #273 from QBall147/master
Increase MAX_MAP_VISIBILITY as certain QuakeLive maps are starting to hi...
2016-01-10 11:31:47 -06:00
Timothee Besset 4e08b4bd49 compile x64 q3map2 against new libxml2 x64 lib folder 2015-12-24 22:31:49 -06:00
Timothee Besset 5ed4d02c78 more Visual Studio 2015 conversion 2015-12-24 19:21:23 -06:00
TTimo 48369d78f9 - Convert to Visual Studio 2015
- Drop STLPort
- Rebuild libxml2 binaries, update project files accordingly
- Rebuild jpeg-9 binaries
2015-11-07 23:44:49 -06:00
QBall147 17349a28db Increase MAX_MAP_VISIBILITY as certain QuakeLive maps are starting to hit the limit 2014-08-14 19:05:13 +01:00
Alex Lo 76ea7385dd Fixed a number of out of bounds accesses.
Visual Studio's static code analyser found a number of out of bounds array
accesses. This commit fixes a number of them as well as a few other problems
the analyser brought up.

This also fixes #1 in the issue tracker.
2013-11-01 00:24:58 +00:00
TTimo 666847b0ce switch to xp compatible compiler toolchain, add/fix an archive and upload script for the VM builder 2013-08-24 22:50:12 +00:00
Chris Brooke 3e5bc317d0 Added -exportents to q3map2. 2013-07-15 04:58:15 +01:00
Timothee Besset 0241ec6d9b put q3map2.exe x64 in install/x64, and copy the dependent DLLs 2013-06-07 05:13:20 +01:00
Timothee Besset 7c1f101a29 spitting x64 q3map2 now 2013-06-02 00:56:33 +01:00
Timothee Besset f397e4a8d6 link libxml2 2013-06-01 23:39:34 +01:00
Timothee Besset 9f425c0c72 add include path for gdk-pixbuf 2013-06-01 23:26:37 +01:00
Timothee Besset 1ec0ec94ba switching to newer gtk and libxml. wip 2013-06-01 23:05:35 +01:00
Timothee "TTimo" Besset ca29808460 missed those - q3map2 x64 2013-05-30 03:22:29 -05:00
Timothee "TTimo" Besset 2ca658fe9f convert projects to msvc 2012 2013-05-23 20:44:41 -05:00
Timothee 'TTimo' Besset 2bd4ea84f0 better QL Linux homepath config 2012-08-29 21:43:19 -05:00
Timothee 'TTimo' Besset c692d7b5c5 point to the right QL homepath 2012-08-29 20:49:09 -05:00
Chris Brooke 2101cf6ae7 QuakeLive PK3 support for Q3Map2 2012-07-27 17:46:54 +01:00
Chris Brooke 26d3246edf Additional Surface parameters for Quake Live -
snowsteps
woodsteps

The below params have been added but have not been implemented yet in ql
(been told it probably will be re-purposed at a later date)

dmgthrough <-- Missile dmg through surface(?)
2012-07-02 05:54:59 +01:00
Timothee 'TTimo' Besset b19c4bc879 this was built on top of 1.5, so it never got properly transformed to a GPL license. took care of that now 2012-05-28 18:29:36 -05:00
Timothee 'TTimo' Besset b36ee55e96 cleanup 2012-05-27 18:53:14 -05:00
Timothee 'TTimo' Besset 6476802ae8 dunno what happened there, someone brain farted hard 2012-05-06 15:55:10 -05:00
alex8664 67411cb18e This is fix for failure of compilation on new libpng 2012-03-31 17:31:50 +04:00
Ben Noordhuis 3a959349ac q3map2: harden UNIX path sniffer against buffer overflows 2012-03-18 02:17:09 +01:00
Ben Noordhuis 808e1c9f6f q3map2: fix dangling pointer dereference
`last` was used but not initialized.

Also fixes a segmentation fault if PATH is not in the environment.
2012-03-18 02:17:09 +01:00
Ben Noordhuis d7e9dab03d q3map2: getpwent() result may not be persistent
Use getpwuid_r() instead and store the path in a static buffer.
2012-03-18 02:17:09 +01:00
Ben Noordhuis c2be26a9bd q3map2: add safe string copy functions
* Q_strncpyz()
* Q_strncat()
* Q_strcat()

Guard against buffer overruns, always zero terminate the result.
2012-03-18 02:17:09 +01:00
Ben Noordhuis ca8d032cfb fix warning: unused variable 'foo' 2012-03-18 02:17:09 +01:00
Timothee TTimo Besset 830125fad0 uncrustify! now the code is only ugly on the *inside* 2012-03-17 15:01:54 -05:00
rambetter 88f8603d62 8MB stack size linker options on all VC2008 proj files.
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@485 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-04-06 04:12:34 +00:00
rambetter 33da149be0 Backing out commit 483. Going to set linker flags instead.
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@484 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-04-06 04:08:22 +00:00
rambetter e39f6f4bae Increasing stack size on Windows build.
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@483 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-04-06 03:56:18 +00:00
rambetter a62e98a1f9 Fixing a Sys_Printf() in main() for "q3map2 -convert". The usage message was
copied from "-scale" and was incorrect.  Thanks to Ensiform from ioquake3 IRC
room for reporting this bug.


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@482 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-03-06 19:14:50 +00:00
rambetter 561e062c87 This is a major change that updates the 3rd party libs on Windows builds.
A couple of things are broken right now:
- OpenGL font in Windows not appearing (expected to be broken, will fix)
- Linux build broken because it loads some .vcproj files that are removed
- 3rd party libs are downloaded from porky.nerius.com, not id Software


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@473 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-02-21 14:37:49 +00:00
Forest Hale 53af03faff use bsp version 47 for the appropriate games, this unbreaks a previous
commit


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@440 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-01-30 03:18:05 +00:00
rambetter 7dceb250fe Modifying game_reaction.h (for the game Reaction) to add custom surfaces.
This is more convenient than using custinfoparms.txt.  TTI (from the
Reaction team) game these to me.


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@434 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-01-22 07:03:51 +00:00
rambetter 083f7c7d6a In function AddGamePath() in path_init.c for q3map2,
only adding path if it's not already added (remove duplicates).
It's cleaner this way.


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@432 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-01-20 07:15:47 +00:00
rambetter 89f0eeeb28 Adding game_reaction.h to q3map2. We cannot use "-game quake3" because
we use ~/.Reaction instead of ~/.q3a .  Oh well.  This is for Reaction Quake III.


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@431 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-01-20 06:31:26 +00:00
rambetter cb169716fe Fixing a 45 degree model clipping problem.
Introducing Q3MAP2_EXPERIMENTAL_MODEL_CLIPPING_FIX to control the new code,
current value is 1 (enable the fix).
This code fixes the q3map2 regression test model_clipping_45_degrees.


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@429 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-01-19 06:41:33 +00:00
rambetter 3b0589dd8b Renaming #define constants:
EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES ->
  Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES
EXPERIMENTAL_SNAP_NORMAL_FIX ->
  Q3MAP2_EXPERIMENTAL_SNAP_NORMAL_FIX
EXPERIMENTAL_SNAP_PLANE_FIX ->
  Q3MAP2_EXPERIMENTAL_SNAP_PLANE_FIX


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@423 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-01-12 03:21:31 +00:00
rambetter 098fe8f8d5 Increasing the values of 3 constants that control how much space is reserved
for the stack and/or static memory for holding arrays of structures.
MAX_ORIGINAL_EDGES changed from 0x10000 to 0x20000 (x2 increase).
MAX_MAP_BRUSHES changed from 0x8000 to 0x10000 (x2 increase).
MAX_MAP_DRAW_VERTS changed from 0x80000 to 0x100000 (x2 increase).
This is pertaining to q3map2 only.
There is a real-world case where increasing these constants is needed.
That case is when compiling Icy World for Urban Terror.
Besides that, increasing these does not hurt anything (other than requiring
more memory).


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@422 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-01-11 09:49:45 +00:00
rambetter ea589bedcc As per TTimo's suggestion, turning all three experimental q3map2 fixes on
in q3map2.h: EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES,
EXPERIMENTAL_SNAP_NORMAL_FIX, and EXPERIMENTAL_SNAP_PLANE_FIX.  These are all
set to 1 now.


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@421 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-01-11 08:25:10 +00:00
rambetter a16ee23adf Importing code changes for q3map2 from Rambetter-math-fix-experiments branch
into trunk.  Right now all the new code that fixes problems is turned off. 
There are three	new #defines in q3map2.h:
EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES, EXPERIMENTAL_SNAP_NORMAL_FIX,
and EXPERIMENTAL_SNAP_PLANE_FIX.  All of these are currently set to 0, which
means don't enable that new code.  You can easily edit these to be 1 in order
to enable the new code.

There are very very minor changes to the code even with these three #defines
disabled.  They are as follows.

- In PlaneEqual() in map.c, now considering deltas equal to given epsilon
values as "far enough to be different".  Previously, the '<=' operation was
used, now '<' is being used.

- In FindFloatPlane() in map.c, considering delta equal to distanceEpsilon
(for plane distance) to be sufficiently far away.  Before, delta had to be
strictly greater than distanceEpsilon.

- VectorNormalize() in mathlib.c is more accurate now. 	This change itself
causes at least	one regression test to succeed.  The previous implementation
of VectorNormalize() caused excessive errors to	be introduced due to sloppy
arithmetic.

Note, the epsilon changes account for the possibility that the epsilons 
are set to 0.0 on the command-line.


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@416 8a3a26a2-13c4-0310-b231-cf6edde360e5
2011-01-10 06:15:47 +00:00
TTimo 7c46911658 rebuilt gtk binary dependencies file
fixed/optimized a number of VC9 project settings
fixed sprintf being hijacked by intl.dll stuff


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@345 8a3a26a2-13c4-0310-b231-cf6edde360e5
2010-12-13 04:21:05 +00:00
TTimo e393e112f4 compiles again on win32, trashed mhash
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@338 8a3a26a2-13c4-0310-b231-cf6edde360e5
2010-11-26 05:59:17 +00:00
TTimo 8f437051fa misc
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@328 8a3a26a2-13c4-0310-b231-cf6edde360e5
2009-12-31 18:24:36 +00:00
Forest Hale 28bbf5a00b remove some FIXME comments about quakelive paths, since they are the
same as quake3 currently


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@323 8a3a26a2-13c4-0310-b231-cf6edde360e5
2008-09-20 11:12:28 +00:00
Forest Hale f4633277de patch from Rudolf Polzer implementing bsp46 support and adding -game
quakelive and -game nexuiz modes to q3map2


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@322 8a3a26a2-13c4-0310-b231-cf6edde360e5
2008-09-20 11:07:36 +00:00
TTimo cc4e44e31a merge branch work back into trunk
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@319 8a3a26a2-13c4-0310-b231-cf6edde360e5
2008-09-01 17:34:10 +00:00
TTimo 2def0428da ABToSVK commit
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant.ab@308 8a3a26a2-13c4-0310-b231-cf6edde360e5
2008-08-24 03:20:51 +00:00
Forest Hale 88cea027e6 ported over the 1.5 branch version of q3map2 which is newer
made Visual Studio files work in VS2005 Express
fixed a ton of warnings in VS2005 Express
fixed some compile problems on OpenSUSE 11.0


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@302 8a3a26a2-13c4-0310-b231-cf6edde360e5
2008-07-25 07:31:37 +00:00
TTimo 11f8765db7 MSVC8: change output dir rules to put binaries into install/
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant@252 8a3a26a2-13c4-0310-b231-cf6edde360e5
2008-04-25 02:17:12 +00:00
TTimo 94199c49dc fix windows compile, it's possible the linux build broke and will need misc tweaks. you need a new GtkR-1.6-deps.zip
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant@227 8a3a26a2-13c4-0310-b231-cf6edde360e5
2008-03-18 17:47:38 +00:00
TTimo c5ff0803df towards compiling on windows again
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant@198 8a3a26a2-13c4-0310-b231-cf6edde360e5
2008-02-28 16:47:26 +00:00