Commit Graph

1162 Commits (838e9f600987c7f22c9e3fc81f406ea433a88982)

Author SHA1 Message Date
Freddie Witherden 838e9f6009 Commit the first patch of patch #897 by Buginator and myself with some additional changes by myself
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3155 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-24 14:41:25 +00:00
Giel van Schijndel 84202107e7 * Remove #include "optimisepath.h" from src/move.c (didn't see this while committing r3153)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3154 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-24 14:05:31 +00:00
Giel van Schijndel bffd531dd7 * Remove unused file src/optimisepath.[ch]
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3153 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-24 14:02:13 +00:00
Giel van Schijndel fbf03af195 * Remove macros:
* ROUND: replace by a static inline function (math_round) instead
  * FRACTCONST: this macro just cast both of its arguments to float and then divide the first by the second
  * MAKEFRACT_D: this macro would cast to FRACT_D (which was typedef'd as float but should have been typedef'd as double); so cast to double instead (where required)
  * FRACTmul_D: would cast both of its arguments to FRACT_D and multiply them
  * FRACTdiv_D: would cast both of its arguments to FRACT_D and divide the first by the second
  * MAKEINT & MAKEINT_D (where #defined the same); this macro would just cast to SDWORD (aka "int" or "signed int")

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3152 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-24 13:57:19 +00:00
Giel van Schijndel e8be7978e6 * Make some functions const correct
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3151 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-24 11:59:47 +00:00
Giel van Schijndel 97991eab77 * Make sure that buildings we cheated ourselves (in debug mode with the "CTRL+O" menu) will be sent to the other players in a multiplayer game as well
* Also send a console text message to all players when a user does cheat himself a building

Patch #898 by Buginator; comments written by me

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3150 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-24 11:36:21 +00:00
Dennis Schridde 4dd10fd6bb clparse.c:262: warning: enumeration value ‘CLI_CONFIGDIR’ not handled in switch
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3143 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-23 21:13:06 +00:00
Giel van Schijndel 6a5a93076c * Add a command line option "--configdir" which enables the user to select another configuration directory than the default ~/.warzone2100-2.1
* This directory currently __needs__ to exist already!

Patch #896 by Buginator with some changes by me:
 * Renamed "userdir" to "configdir"
 * Split up PhysicsFS initialisation so that we call PHYSFS_init before gettext initialisation and select the write directory __after__ early command line parsing

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3138 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-23 17:01:42 +00:00
Giel van Schijndel ee3b875b7d * Use an ASSERT instead of an assert for (size >= MAX_PATH) so that we can provide the values of both variables to make debugging on this assertion easier
* Used this for the change in r3136 though I accidentally didn't commit it there...

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3137 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-23 16:54:14 +00:00
Giel van Schijndel 67d902a841 * Use snprintf "%s%s%s%s" instead of a single strlcpy followed by multiple strlcat calls
* Make sure to pass the buffer size as well to getPlatformUserDir (so that we can use strlcpy & strlcat instead of strcpy & strcat respectively)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3135 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-23 16:04:09 +00:00
Per Inge Mathisen 000dab7d3c Correctly calculate highest point for defensive structures larger than one tile.
This only applies to LASSAT in the current rules.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3134 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-23 10:27:39 +00:00
Giel van Schijndel 9fe5736f41 * Remove macro FRACTdiv and all places where it was used (all it did was casting both of its parameters to (float) and dividing the first by the second)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3133 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 23:37:30 +00:00
Giel van Schijndel ae90bd9c0c * Remove macro FRACTmul and all places where it was used (all it did was casting both of its parameters to (float) and multiply them)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3132 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 23:29:25 +00:00
Giel van Schijndel aeecc95088 * Remove macro MAKEFRACT and all places where it was used (all it did was casting to (float))
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3131 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 23:13:05 +00:00
Giel van Schijndel 846dfa9efa * Get rid of cheap modulus calculating macro MODFRACT and use function fmodf instead
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3130 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 21:39:31 +00:00
Giel van Schijndel b133979966 * Backport changes to src/multigifts.c and dependent changes to other files from netcode branch to trunk
* Utilize the net primitives API for sending & receiving of different types of gifts

Patch #888 by EvilGuru


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3123 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 18:51:45 +00:00
Freddie Witherden 2e6bf47a94 Make psDroid->numKills a float and rename it to psDroid->experience. Commits patch #894
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3122 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 17:07:26 +00:00
Giel van Schijndel 50c444f6e6 * Apply a large quantity of style changes from patch #888 by EvilGuru (it's a backport from the netcode branch btw) (to reduce the diff-size of it)
* Remove some useless casts
  * Rewrite some "else { if (X) { } }" statements to "else if (X) { }"
  * Rewrite several "if (X) { if (Y) { } }" statements to "if (X && Y) { }"
  * Remove some commented out (and sometimes also duplicated) code
  * Add some tiny bits of comments here & there


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3119 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 00:30:27 +00:00
Giel van Schijndel 75753bc3f8 * Replace two uses of strcpy() with the safer strlcpy()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3118 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 00:00:16 +00:00
Per Inge Mathisen 393dc79a05 Fix crash when combat units are assigned to commanders. See bug #10536.
Patch #891 by Thomas Frauendorfer <caotic>.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3113 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-21 18:28:46 +00:00
Per Inge Mathisen 921520d04b Remove dead code. Patch #890 by Thomas Frauendorfer <caotic>.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3112 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-21 18:23:18 +00:00
Per Inge Mathisen 53aa930d6e Turn IMD min and max dimensions into vectors.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3111 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-21 17:34:23 +00:00
Per Inge Mathisen cd415282be Cleanup renderStructure()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3110 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-21 17:14:18 +00:00
Freddie Witherden f85cadbdd2 Fix a bug with cursor trapping that would prevent it working when loading a saved game
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3109 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-20 20:15:34 +00:00
Per Inge Mathisen 35277a4b82 Temporary fix for bug introduced with commit 3065 that made direct weapons unable to hit. Patch #886 by Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3108 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-19 20:18:37 +00:00
Giel van Schijndel db3d933791 * Add a new cheat/debug-command "showsamples"
* This command will cause the amount of samples in the sound library's queues & lists to be constantly displayed (until turned off) on screen

Patch #887 by Buginator


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3107 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-19 20:17:54 +00:00
Gerard Krol ddca71af93 Fixes the broken save game loading from r3100.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3106 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-19 18:36:05 +00:00
Giel van Schijndel 41c602ca60 * Don't prefix the FPS rate displayed with leading zeros (there's no need for it)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3104 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-18 23:17:33 +00:00
Giel van Schijndel 008266c41f * Make showFPS a bool instead of an integer (as it can only be enabled or disabled)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3103 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-18 23:07:41 +00:00
Giel van Schijndel a419479ed8 * Remove some usage of macros MAKEINT (just a cast-to-SDWORD macro) and PERCENT (a / b * 100)
* ASSERT that our denominator isn't zero to prevent a divide by zero error (which I encountered, thus this patch)
  * In the main time provide a work around for when the denominator is zero (which due to the above ASSERT will only be useful for release builds, which is intentionally)
 * Move variable percent into a more local scope


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3102 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-18 22:54:10 +00:00
Giel van Schijndel 0fa3850cc3 * Remove commented out code (was only active if HARDWARE_TEST was defined, looks like PSX stuff)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3101 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-18 22:48:34 +00:00
Gerard Krol 718bff04f9 Removal of duplicate code. No changes should be observed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3100 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-18 21:11:04 +00:00
Gerard Krol 1e7bf56eba Fix the horizontal line in the sky that could be seen when using "mist" by increasing the height of the fogbox.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3091 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-17 20:42:13 +00:00
Gerard Krol 9e5c22f886 Scrolling tweaks: default acceleration is up from 800 to 1000, and scrolling speed increases when zooming out.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3090 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-17 20:32:17 +00:00
Gerard Krol d0063a089e The camera tweaks caused the starting camera position to be "not so nice". This should be fixed now.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3088 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-17 19:40:31 +00:00
Giel van Schijndel fa329f1b21 * When drawing the FPS "timer/display" (or whatever you wish to call it) don't make assumptions about the text's size
* Instead use iV_GetTextWidth & iV_GetTextHeight to find out...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3084 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-16 21:09:34 +00:00
Christian Ohm 77644a9dbd Adjust FPS counter again, since it was in the same position as the chat line.
Now it's about centered below the radar. Thanks to Buginator for noticing.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3083 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-16 19:12:18 +00:00
Christian Ohm 0c975d9c66 Adjust fps counter position, and save/load showFPS to/from the config file.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3082 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-16 18:40:25 +00:00
Ari Johnson ab26b78691 Warzone trunk now builds under Xcode again. This includes an Autorevision
target and changing pos.x, pos.y, and pos.z entries in the endianizing
routines to just x, y, and z to match the updated OBJECT_SAVE_V19 format.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3079 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-16 17:58:34 +00:00
Giel van Schijndel f5df84b931 * Replace some usages of sprintf combined with iV_DrawText by a single call to iV_DrawTextF
* Get rid of a string buffer which isn't needed anymore due to the above change..
 * Move string buffer buildInfo into a more local scope (the last place where it is used)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3077 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-16 16:07:46 +00:00
Per Inge Mathisen 2ff8addf56 Fix fog debug messages that said the opposite of what they meant.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3074 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-16 15:15:01 +00:00
Gerard Krol 4884837ded Relax camera movement while still preventing clipping through the terrain. Also disable panning to the default angle when releasing the
right mouse button.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3067 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-15 23:33:24 +00:00
Freddie Witherden c4fe7ad919 Update BASE_OBJECT and friends to use Vector3i.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3065 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-15 15:39:29 +00:00
Per Inge Mathisen e0c450b415 Remove excess display related code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3062 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-15 12:18:56 +00:00
Per Inge Mathisen 5417afae46 Read tile colour information directly from mapTiles, instead of going through tileScreenInfo
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3057 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-15 11:08:23 +00:00
Per Inge Mathisen 80d6e7df6d Use setTileColour accessor for tile lighting.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3055 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-14 16:27:39 +00:00
Per Inge Mathisen 0484f5e383 We no longer need .wlight to separately store water colour.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3054 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-14 16:21:12 +00:00
Per Inge Mathisen 9c8e54520f Clean up terrain colour handling a bit.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3046 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-13 22:00:54 +00:00
Per Inge Mathisen cf0007f8be Make sure we do not access tiles outside the map when checking height for
identified flying objects. Patch #880 by Buginator.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3045 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-13 19:13:11 +00:00
Per Inge Mathisen 1a89fbb9bc Remove legacy PSX way of generating visual fog by manipulating vertex colours. Instead
we rely on real OpenGL visual fog. Someone need to look at what scripts need in this
department - the difference between distance and depth fog was almost non-existent
before this change, and is none after, but we have lots of parameters we can easily tune
now from the scripts if we want.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3044 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-13 18:08:37 +00:00