Commit Graph

1745 Commits (3e14c0fb3d889fbc4afba44a32d04d8ecd32a7fd)

Author SHA1 Message Date
Per Inge Mathisen d1b82698ce Fix bug introduced in r2086 which would give droids trouble avoiding obstacles.
Thanks to Troman for pointing out the problem.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2094 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 13:48:11 +00:00
Roman C db66f6c053 autogame feature update: after enabling autogame feature, make ai use droids built while autogame feature was off
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2093 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 13:40:22 +00:00
Dennis Schridde c08c2ba7eb Fix MSVC to have C99 isfinite().
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2092 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 12:49:20 +00:00
Per Inge Mathisen 998ebd166b MSVC does not support finitef() either, so remove assert instead.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2091 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 12:45:22 +00:00
Per Inge Mathisen 416504797b Use finitef() instead of isfinite() because isfinite() is C99 and therefore
not MSVC compatible.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2090 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 12:26:02 +00:00
Per Inge Mathisen d416f78650 Fix moveCalcTurn bug. If we are standing exactly on our last waypoint, our
driving angle will be infinite. Instead, make it (0, 0), which is more sane.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2089 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 12:21:21 +00:00
Per Inge Mathisen bd49bb3bc3 Clean up moveGetDirection(). Next step: Fix the bug in it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2088 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 11:42:04 +00:00
Per Inge Mathisen 4e86088118 Remove a ton of unused movement code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2087 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 11:25:08 +00:00
Per Inge Mathisen 939003a47f Remove a ton of useless MAKEFRACT casts used in the old pseudo-float code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2086 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 10:59:04 +00:00
Dennis Schridde d4feb045d9 PIE-Blender v1.0 by Kage.
Amoung a lot of changes here come:
- Handling of polygons referencing the same vertex more than once.
- Nicer GUI.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2085 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 10:22:05 +00:00
Giel van Schijndel 83ef0a6e3c * Make audio_SetTrackVals return the track ID number rather than write it into a pointer given as parameter (failure is now indicated by a zero value instead; non-zero indicates success)
* Move a large portion of code from audio_SetTrackVals into sound_SetTrackVals (audio_SetTrackVals only checks whether sound is enabled now, the rest of the job is entirely delegated to sound_SetTrackVals)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2084 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 23:39:40 +00:00
Giel van Schijndel 9de99e7d33 * Don't use (void) as parameter list for the function implementation (this is only required for function declarations, not implementations)
* in sound_GetAvailableID start looking for available IDs starting from ID_SOUND_NEXT, not zero (0) as that might cause ID collisions when used in conjunction with the hardcoded IDs in audio_id.*
 * Make ID_SOUND_MAX be equal to the highest ID number (of the ID set defined in audio_id.*) rather than one more (since this is what "max" suggests: the highest number, not one more than the highest number)
 * ID_SOUND_NEXT is now one higher than the highest ID number and can be/is used where one higher is required

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2082 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 23:25:29 +00:00
Giel van Schijndel bc40797884 * Remove global var `static SDWORD g_iMaxSameSamples` from track.c which was only ever written to (not read from)
* Remove parameter `SDWORD iMaxSameSamples` from sound_Init who's value was only used to set g_iMaxSameSamples

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2081 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 23:15:24 +00:00
Giel van Schijndel 99be7db2f4 Update Code::Blocks project to match:
* removal of bullet.h in r2060
 * renaming of base.h, bulletdef.h and weapons.h to basedef.h, projectiledef.h and weapondef.h respectively in r2063

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2080 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 23:12:34 +00:00
Giel van Schijndel 33a8ba3a18 * Fix column description id->volume (change copied from r2059 which was a patch by Martin Koller)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2078 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 22:17:32 +00:00
Giel van Schijndel 6e23e99afc * #include "lib/sound/audio.h" in the implementation files that need it rather than in a header file which doesn't use it at all
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2077 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 22:14:47 +00:00
Giel van Schijndel b10e316999 * Make all (I hope I didn't miss any) references to audio filenames lowercase (as all audio files themselves have a fully lowercase name)
* Fix two typos of wrong filenames (these two are not case mismatches) in audio_id.c (one used a ',' instead of '.' and used wav as extension, the other missed a '-')
 * Don't use case insensitive matching of filenames in audio_GetIDFromStr anymore as our filesystems aren't guaranteed to be case insensitive (this should cause no problems together with the above fixes)
 * Use calloc instead of malloc and a for-loop to allocate an array of NULL pointers in sound_Init

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2076 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 22:11:04 +00:00
Per Inge Mathisen a8e813fbbd Another small cleanup to movement code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2075 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 21:33:12 +00:00
Per Inge Mathisen edf0a59a2e A bit cleanup to movement code, and sprinkle a few asserts to find the moveCalcTurn bug.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2074 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 20:58:37 +00:00
Per Inge Mathisen bc383a6997 Fix projectile crash. Iteration became screwed up sometimes when a projectile
object was free()d and its memory was overwritten before we had time to iterate
to the next object in the list. Now we delay free() until after updates are done.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2073 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 20:55:50 +00:00
Per Inge Mathisen aa061810a5 Call the reference counting primitives when releasing objects. Ensure
that we take dead structures off the grid map immediately.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2072 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 18:46:07 +00:00
Per Inge Mathisen 99cf7adee0 Overwrite, instead of append, debug logfiles.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2071 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 18:31:37 +00:00
Per Inge Mathisen f94ff0ce9d New .sta file format in plain text. This should fix problems people have had
with corrupted player name and such when mixing 2.0 and 2.1 versions, or old 
and new versions of 2.1.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2070 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 18:14:25 +00:00
Per Inge Mathisen d079d6cf08 Make sure projectiles are not assigned to dead targets. Some cleanup.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2069 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 17:36:31 +00:00
Per Inge Mathisen d4cb4d289a Fix targeting of dead objects when structures use commanders and counterbatteries for
targeting. Also fix some indentation.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2067 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 22:32:29 +00:00
Per Inge Mathisen 8315dedc2f Use a linked list instead of a hash table to store the list of projectiles in play.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2066 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 20:55:41 +00:00
Ari Johnson d39a3ee15f Updated Xcode project file to reflect recent file renamings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2065 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 20:06:58 +00:00
Per Inge Mathisen 757ecb25c8 Missed one include somehow in the commit
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2064 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 19:57:09 +00:00
Per Inge Mathisen 2e99433ad0 Rename a few files for consistent naming. base.h -> basedef.h.
bulletdef.h -> projectiledef.h. weapons.h -> weapondef.h.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2063 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 19:56:16 +00:00
Ari Johnson 39b863d72d Updated Xcode project file to reflect removal of bullet.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2062 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 19:52:35 +00:00
Per Inge Mathisen b69de06264 Rename PROJ_OBJECT -> PROJECTILE and OBJ_BULLET -> OBJ_PROJECTILE for consistency
with other objects. To quickly adapt your patches and avoid conflict noise, run this 
on the revision prior to this one:

  sed -i s/OBJ_BULLET/OBJ_PROJECTILE/g src/*.c src/*.h src/*.l src/*.y
  sed -i s/PROJ_OBJECT/PROJECTILE/g src/*.c src/*.h src/*.l src/*.y


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2061 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 19:32:26 +00:00
Per Inge Mathisen 6f358cf600 Eliminate bullet.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2060 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 19:21:16 +00:00
Dennis Schridde e8d00066e0 Fix column description, id->volume. Patch by Martin Koller.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2059 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 17:32:33 +00:00
Dennis Schridde e80e0d4ca6 FILE_MAXCHAR -> MAX_PATH
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2058 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 17:17:16 +00:00
Dennis Schridde aa9727615c -lz: PhysFS needs this, since sometimes it is not properly linked.
SDL_net.h: Where the SDL headers are not in a standard include path it sometimes seems to have problems with it.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2057 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 15:35:40 +00:00
Per Inge Mathisen ace17002a8 Misc cleanups from ref count work
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2056 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 15:22:16 +00:00
Dennis Schridde 336130f53d One lib per line.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2055 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-11 23:30:26 +00:00
Dennis Schridde 7c51ddbadc - pie_MAX_POINTS became pie_MAX_VERTICES and was increased to 768 from 512. (Grim's request.)
- pie_MAX_POLYS became pie_MAX_POLYGONS.
- pie_MAX_POLY_VERTS became pie_MAX_VERTICES_PER_POLYGON and was decreased to 6 from 10. This _should_ work everywhere, I didn't see glitches. Grim recommended to even reduce it to 4, but the terrain renderer didn't like that. (When you pitched down the camera too much, the left screen side of the terrain disappeared.)
- iV_IMD_MAX_POINTS, iV_IMD_MAX_POLYS now are defined to the pie_ variants.
- scrPoints was moved into the scope of the only using function, pie_Draw3DShape2.
- aByteScale was never used, so it got removed.
- Some counters were changed from signed to unsigned.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2054 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-11 21:09:40 +00:00
Dennis Schridde 41d3a2a0b0 Fix Umlauts (and other characters) in strings (translation, input, etc).
Previously those displayed images instead of the appropriate letters.
This still doesn't allow for UTF-8 strings (since multi-byte characters are not handled), but it should work with ISO8859-X encodings.
Patch by Martin Koller.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2053 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-11 19:24:54 +00:00
Per Inge Mathisen 2063d578c3 Make sure hash table is re-initialized properly after closed
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2052 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-10 21:23:43 +00:00
Per Inge Mathisen 2de32d08ba Silence a Valgrind warning by not free()ing a NULL pointer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2051 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-10 20:32:59 +00:00
Per Inge Mathisen e2879a2206 Fix crash on starting cam2 where objects are released but animations that refer
to them are not. Bug looks like it has always been there, but hidden by old memory
management code.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2050 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-10 20:17:27 +00:00
Per Inge Mathisen 3cedbb58f5 Fix bug introduced in struct multiweapon code of r857, which crashes the first
level of cam2 because the non-nullness of an array pointer is checked instead of
the non-nullness of the first pointer in that array.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2048 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-09 19:58:27 +00:00
Giel van Schijndel e8e75c81a2 * Add dec130.h to the automake system
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2047 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-09 09:02:30 +00:00
Ari Johnson dad009776a Update to Xcode project file to include dec130.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2046 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-09 05:38:44 +00:00
Giel van Schijndel bd9977cf3d * Move some variables into a more local scope
* Make use of the fact that FUNCTIONALITY is a union and work some casts away
 * Turn some bitshifting with TILE_SHIFT into map_coord and world_coord function calls
 * Merge some duplicated code in function resetFactoryNumFlag

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2045 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 22:47:13 +00:00
Giel van Schijndel e531fb31fc * Remove a futile check for error condition (psBuilding->psStructureType->numFuncs == 0) which can never occur unless errors occur while loading a stats file (and if they do, they should be detected by the code loading that file)
* Use calloc instead of malloc followed by memset(0) (calloc both allocates memory; and then sets all of it to zero)
 * Move a lot of duplicated malloc (calloc now) calls out of the switch statement; and in front of it
 * Use map_coord and world_coord instead of bitshifting with TILE_SHIFT
 * Declare and use variables in a more local scope
 * Take advantage of the fact that FUNCTIONALITY now is a struct by not casting anymore
Parts from patch by Freddie Witherden <evilguru> plus changes by me

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2044 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 20:45:01 +00:00
Giel van Schijndel b091d350e0 * Don't take guesses on what kind of struct is the largest; use a union instead so that the compiler can deal with that
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2043 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 20:04:39 +00:00
Per Inge Mathisen 868b3594c8 Fix crash in campaign when saving a game where a repair structure has been destroyed.
Bug introduced in first reference count commit (r1995).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2042 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 13:20:27 +00:00
Giel van Schijndel a437f1efe2 * Change default of setting "ReopenBuildMenu" to true since this was the behaviour of the original Warzone AFAIK, and as such is probably expected by most people
* Remove commented out line which was an exact duplication of a line just below it

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2041 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-08 11:01:24 +00:00