Commit Graph

5252 Commits (516067dec0b14c4bc99c5ce648811c27c39966db)

Author SHA1 Message Date
Giel van Schijndel 516067dec0 Alter frandom's API such that it takes no parameters and returns a float ranging from 0.f to 1.f
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6608 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 22:51:41 +00:00
Dennis Schridde f1ae7b9620 Some simplifications and cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6607 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 21:53:40 +00:00
Dennis Schridde d1780335ee Make more functions static, remove unused functions, unify spelling
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6606 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 21:53:34 +00:00
Dennis Schridde b8ba70de36 Try to cleanup some magic numbers, variable scope, etc
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6605 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 21:53:30 +00:00
Dennis Schridde b49952ce1e New function: frandom(x,y)
Returns a random floating point number between x and y

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6604 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 21:53:25 +00:00
Dennis Schridde 0b09ace43a More compact versions of fminf() / fmaxf()
Includes a comment on what might appear as magic or
incomplete implementation at first sight.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6603 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 04:07:44 +00:00
Dennis Schridde dd314e6cba Revert "TEMP Work In Progress TEMP"
That says it, doesn't it?

This reverts commit 9dd2471f34317d181479a75d3a41e703ca6649ac.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6602 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 03:54:30 +00:00
Dennis Schridde df6bd00d7e Provide fmaxf() / fminf() for non C99 compilers
Fixes #234.
This is not the patch attached there, since that one was broken.

From the manpage:
DESCRIPTION
       These functions return the larger value of x and y.
RETURN VALUE
       These functions return the maximum of x and y.
       If one argument is a NaN, the other argument is returned.
       If both arguments are NaN, a NaN is returned.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6601 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 03:53:08 +00:00
Dennis Schridde 80e64617b2 Use faster float code for hypotf, instead of falling back to doubles
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6600 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 03:53:05 +00:00
Dennis Schridde 10e935e6ee TEMP Work In Progress TEMP
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6599 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 03:53:01 +00:00
Dennis Schridde 882d6e76d9 Fix "infinite" flamer range
This should fix #53.
A projectiles death timer would be reset on penetration,
instead of dying at the same time as the projectile we spawned from

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6598 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 03:21:51 +00:00
Dennis Schridde 728c68b81e Use format strings where required (script parser)
Should fix #178

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6597 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 02:53:52 +00:00
Per Inge Mathisen c599637530 Fix potential bug that might cause a unit to go outside the map due to division rounding error,
since code was manually dividing by TILE_UNITS instead of bit-shifting with map_coord(). Patch
reviewed by EvilGuru. Crash report by acidjnk.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6595 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-07 19:13:14 +00:00
Per Inge Mathisen 4b8ee8ad09 Improve gridStartIterate assert message
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6594 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-07 19:07:13 +00:00
Per Inge Mathisen 2d24d351e5 qwzm: Make use of QGLViewer. This lets us rotate and translate the model, as well as add various
helpful hints to the scene. Note that you need to install QGLViewer to use qwzm now.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6592 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-07 18:21:06 +00:00
Per Inge Mathisen 90121f4920 pie2wzm: Fix spurious warning about missing connector directive in PIE model.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6590 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-07 12:35:11 +00:00
Per Inge Mathisen d4beacb790 pie2wzm: Make sure we output a line ending after the connector directive for multi-mesh models.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6589 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-07 12:28:37 +00:00
Per Inge Mathisen ea999b01a7 qwzm: Port over level parsing fix from pie2wzm. Fix connector parsing error.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6588 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-04 23:25:30 +00:00
Per Inge Mathisen 9b26e6c1bd qwzm: Add missing file from way back.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6587 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-04 23:13:02 +00:00
Per Inge Mathisen 86d734598f pie2wam: Add verbose mode. Fix parsing error in some multilevel files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6586 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-04 23:12:05 +00:00
Per Inge Mathisen 0bd4f60a78 Set svn eol-style native to scripts files and svg files that are missing it while I'm at it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6585 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-04 23:09:36 +00:00
Per Inge Mathisen bb9bc6e335 Set svn:eol-style native on some TXT files that are missing the property.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6584 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-04 23:04:18 +00:00
Per Inge Mathisen 1154d45ed1 Set svn:eol-style property on some WRF files that are missing it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6583 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-04 23:03:10 +00:00
Per Inge Mathisen fac247afba Fix bad texture page names in some PIE files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6582 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-04 23:00:47 +00:00
Per Inge Mathisen 28e24651e5 Fix missing svn:eol-style property on some PIE files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6581 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-04 22:30:42 +00:00
Per Inge Mathisen 4cae3b8f1b Improve handling of an error in NETsendfile reported in issue #215. Add TODO about
rewriting this whole function and reference to ticket.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6580 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-03 17:02:17 +00:00
Giel van Schijndel 449d93267e * Add CSV field entries for ECM, REPAIR and BRAIN
* Generate SQL INSERT statements from CSV data for ECM
  - REPAIR and BRAIN are still "exceptional" cases requiring syntactical extensions to the DB mini/meta language

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6579 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-01 19:10:29 +00:00
Giel van Schijndel 94cf481e0f Override operator<< for std::ostream (left operand) and PHYSFS_Version (right operand) instead of using a plain function to perform the version formatting
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6578 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-01 12:13:00 +00:00
Giel van Schijndel db0e543f40 * Fix warnings about "possibly dangerous code" added in r6570:
- Don't ignore write(2)'s return value, instead handle it properly to deal with the cases where write(2) gets interrupted (by a signal) or returns prematurely because of non-blocking I/O
  - Properly handle popen(3) returning NULL
 * Don't assume the data written to stdout by "which" will just fit in our buffer

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6577 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-01 11:54:25 +00:00
Guangcong Luo eccab0f6af The rest of my naming inconsistency fixes
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6574 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 20:05:05 +00:00
Buginator ae27065c85 Fixes ticket #237
Using C99 declaration instead of C98.
 

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6573 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 19:44:15 +00:00
Dennis Schridde ed2a2011f6 Improve preprocessor checks for type definitions
* Check for C99 instead of !MSVC where we deal with C99 stuff
 * C++98 defines bool as well
 * Move BOOL after the bool checks, so we could define it to bool more easily

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6572 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 15:51:47 +00:00
Dennis Schridde e88fb88376 Detect C++98 and do not mix feature detection code with platform hacks (!!)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6571 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 15:51:43 +00:00
Dennis Schridde d585762747 Add a few warnings about possibly dangerous code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6570 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 15:51:39 +00:00
Dennis Schridde 98842001af Use bool instead of BOOL where the latter is not required
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6569 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 15:51:35 +00:00
Dennis Schridde 30044e860c Fix usage of BOOL which should have been int instead
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6568 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 15:51:31 +00:00
Dennis Schridde bb5d6bec73 Remove unused variable
fixes #236, caused by r6566

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6567 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 14:39:36 +00:00
Buginator 6440d68d2c Closes ticket #131
Adds weapon range display to the sensor display routine.
Function was split for future enhancements.

This is *not* meant to be played with it enable all the time, as you know, it is a severe resource hog, and it is mainly helpful for modders, to check what the range of the weapons & sensors are.

NOTE: it only shows range for *first* weapon slot.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6566 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 06:20:22 +00:00
Dennis Schridde 9377726dec Make configure warning complain about correct sqlite3 version number
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6565 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-30 20:56:01 +00:00
Dennis Schridde f9ef8289a4 Bump SQLite3 to 3.6.10
An change was introduced on sqlite3_vfs which causes an incompatible
 pointer error when mixed with older sqlite versions. Thus bump the
 required version to 3.6.10 as well.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6564 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-30 18:28:21 +00:00
Giel van Schijndel b4d7219970 Update trunk changelog with r6562's changes to 2.1
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6563 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-25 01:22:53 +00:00
Giel van Schijndel 4812f76bd7 make -C po update-po (to include newly added translations, among which the one from r6559)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6560 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-25 00:07:00 +00:00
Giel van Schijndel 6986905a65 Give --join's parameter value a name: "host"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6559 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-25 00:06:25 +00:00
Giel van Schijndel 1809d9d0fc Add the changes of r6556 (backported to [milestone:2.1] in r6557) to the changelog
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6558 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-24 18:22:46 +00:00
Giel van Schijndel cb22e77099 * Check whether the system itself already provides strlcpy and/or strlcat
- If it does, check whether it's behaviour is consistent with our implementation
   - If behaviour is consistent: use the system's implementation
   - If not, rename our implementation (to prevent symbol clashes) and use our own


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6556 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-24 18:15:19 +00:00
Giel van Schijndel 1f4e369cf2 * Add a new struct-level qualifier: %csv-field-override
- This qualifier allows overriding of CSV field numbers given in base classes
  - This is required for the WEAPON stats because it differs from most other stats in that it doesn't have the "designable" field as the last CSV field
 * Specify all CSV field numbers for the fields in struct WEAPON
 * Generate SQL INSERT statements from weapons.txt


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6553 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-22 22:18:48 +00:00
Giel van Schijndel ca71081504 Add parentheses to resolve operator precedence problems
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6552 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-11 23:35:28 +00:00
Giel van Schijndel 5ea685ef33 Include the update of the Dutch translation in the ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6549 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-11 21:37:01 +00:00
Giel van Schijndel 129377b82d Update changelogs and bump version numbers in prepration of releasing 2.1.1
This addresses #202


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6548 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-11 21:34:54 +00:00
Giel van Schijndel 5b4c4ab655 Update Dutch translation:
* Add 859 newly translated messages (49% translated)

This closes #200, patch by Mathijs <vanRillandBath>

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6546 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-11 21:11:54 +00:00