Commit Graph

650 Commits (f0fd2363da56b81f1d5ef444937a73c44bcc8634)

Author SHA1 Message Date
Per Inge Mathisen e509767d23 Clean out some unused code from netplay.c|h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2109 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-15 13:48:22 +00:00
Roman C 7337171595 Show correct line number of the error in the input script file when using script includes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2108 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-15 13:11:09 +00:00
Dennis Schridde 807f41a852 - Further improve moveGetDirection.
- Extend the Vector library.
- Cleanup (more Vectors).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2104 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 20:13:24 +00:00
Giel van Schijndel 6b912bc40d * Remove duplicated function sound_TrackAudibleRadius (was an unused duplicate of sound_GetTrackAudibleRadius)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2103 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 19:56:10 +00:00
Giel van Schijndel ebff194ba7 * Remove some unused macros
* Remove a dual check of psTrack == NULL in sound_Play2DTrack (is already tested by invoked function sound_CheckTrack)
 * sound_GetTrackID now won't loop through a list of 600 pointers to find a match anymore if the given pointer is NULL

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2102 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 19:12:46 +00:00
Giel van Schijndel 27bbae281b * Add a workaround for a crash in OpenAL triggered when shooting the first scavengers in the campaign
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2100 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 18:42:39 +00:00
Giel van Schijndel 2bb8afe647 * Check whether g_apTrack == NULL since that is a valid state when audio is disabled
* Add some additional info about which track is being asked about into the assert

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2095 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 14:19:14 +00:00
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
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
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 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 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 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
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 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
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
Giel van Schijndel 7b0625d4a7 * Change the adpcm decoder to use a more object oriented approach (rather than global vars which would make decoding multiple streams impossible)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2037 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-07 14:23:48 +00:00
Giel van Schijndel fcf6f02015 * Use an int16_t instead of a short, since this code quite obviously depends on these variables to have an exact size of 16 bits
* Put curly braces on a line of their own
 * Use INT16_MAX and INT16_MIN instead of magic numbers
 * Make some global vars statically linked and const (since they're constants for the adpcm audio codec only)
 * Make some functions in rpl_reader statically linked (they're only used in that file)
 * Add include file dec130.h instead of forward declaring functions in source files

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2036 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-07 13:58:15 +00:00
Giel van Schijndel ed62f3da96 * Use 'unsigned int' instead of a fixed-with type to store the width, height and depth of an image
* Change an assert(FALSE) into a more descriptively styled: !"text string"

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2030 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-06 13:47:39 +00:00
Per Inge Mathisen cbada4698b Remove two excessive logging calls
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2017 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 20:39:34 +00:00
Per Inge Mathisen 64c9ca9ecd Optimize non-enabled calls to debug() by moving the if test before we do a function call.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1994 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 11:54:09 +00:00
Dennis Schridde 714bcc5924 displayBuffer -> fileLoadBuffer, original patch by vs2k5. displayBuffer was abused to load nearly everything.
Reuse FILE_LOAD_BUFFER_SIZE macro, which was abandoned before. (That's also why fileLoadBuffer is now defined in src/init.c, even though the place is probably inappropriate.)
Make fileLoadBuffer static instead of malloced.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1992 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 00:28:49 +00:00
Giel van Schijndel d55bd507c6 * Remove unused parameter char* DisplayBuffer from function pie_UploadDisplayBuffer (maybe we might as well remove this function altogether ?)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1986 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-27 12:30:29 +00:00
Giel van Schijndel 84a07b03a5 * Remove unused (and sometimes empty) functions sound_SetSamplePan, sound_SetSampleVolAll, sound_GetMaxVolume, audio_GetMixVol, audio_Get3DVolume
* Remove global var g_i3DVolume and audio_Set3DVolume which would set its value since g_i3DVolume was never ever read (well audio_Get3DVolume read it, but this function never got called)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1976 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 19:04:33 +00:00
Dennis Schridde 28358cb9e3 Backport r1973: Verbose problem report for not found gdb or program.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1974 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 18:17:43 +00:00
Giel van Schijndel 18dcb24b3c * Rename functions
mixer_GetCDVolume    to sound_GetMusicVolume
   mixer_SetCDVolume    to sound_SetMusicVolume
   mixer_GetWavVolume   to sound_GetUIVolume
   mixer_SetWavVolume   to sound_SetUIVolume
   mixer_Get3dWavVolume to sound_GetEffectsVolume
   mixer_Set3dWavVolume to sound_SetEffectsVolume
 * Make the above functions use floats instead of SDWORD (int32_t) and use a range of 0.0 - 1.0 instead of 0 - 100
 * Remove global var g_iGlobalVol which was only used by one function and wasn't reused in multiple calls, now use a local function var instead: float originalVolume

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1972 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 18:09:38 +00:00
Dennis Schridde d301fd3a82 Enhance POSIX crashdump with time of execution (not crash!)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1971 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 18:04:39 +00:00
Dennis Schridde 0c46dfdea3 - Get full path to warzone binary, so gdb can actually find it. (It runs in an empty env, so it doesn't even have PATH.)
- Add some debug output (which will never get shown, since we setup the crashhandler before the debughandler).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1968 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 17:35:09 +00:00
Dennis Schridde 428c893226 Revert to the old implementation of STATIC_ASSERT. Beware: This does not work in global context (outside of a function).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1965 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 12:34:39 +00:00
Giel van Schijndel e3d9c70e94 * remove unused function audio_Get2DPlayerRotAboutVerticalAxis
* remove global var g_bStopAll which seems to function as some kind of crude (and non-functional) mutex lock (while Warzone doesn't even uses threads!)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1961 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-24 21:11:43 +00:00
Giel van Schijndel 46434a1e5d * Remove global var BOOL display3D which is always true anyway
* Adapt all code that depends on display3D by either removing if (!display3D){} code or removing the conditional around if(display3D){}
 * remove now useless function audio_Display3D (returned display3D) and now unused function audio_Get2DPlayerPos

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1958 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-24 19:38:36 +00:00
Per Inge Mathisen d3271aa386 Remove now quite useless encryption and anti-cheat code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1953 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-24 13:38:22 +00:00
Giel van Schijndel 2658fa36aa * Change kf_MoveToLastMessagePos() to be more readable (i.e. simply return on error, don't wrap the actual working, non-error, code in a conditional), also use map_coord instead of `>> TILE_SHIFT`
* Remove unused (and probably useless) function audio_PlayPreviousQueueTrack
 * Remove unused functions audio_ReleaseTrack, audio_GetAvailableID, audio_GetSampleMixVol
 * Remove useless assignment in audio_GetPreviousTrackPos and make check for invalid coordinates more easily readable


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1911 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-21 13:39:05 +00:00
Giel van Schijndel 37be498275 Cleanup:
* Change the array iteration code such that it is a bit easier to read
 * remove audio_CheckAllUnloaded() which only forwarded to sound_CheckAllUnloaded()
 * Add some comments

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1910 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-21 13:03:52 +00:00
Dennis Schridde e5ff965bbc Remove unused "altVal"(disp3d) and macros(fract), make macro safer(map)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1902 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 23:32:17 +00:00
Dennis Schridde cc2294112b Clean my WC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1894 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 18:00:46 +00:00
Dennis Schridde 9a5fd28e0c - More generic cleanup
- Reorder debug=yes CFLAGS so the -Wno- flags are at the end
- Make skybox float-uv aware


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1890 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 16:51:40 +00:00
Dennis Schridde 92bf004d99 Cleanup pie_PiePolyFrame and some other minor changes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1884 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 14:27:14 +00:00
Dennis Schridde 8ee46cc331 Minimal comment/header reordering.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1878 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-18 16:32:38 +00:00
Dennis Schridde 1f723e656c More cleanup...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1876 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-18 15:46:12 +00:00
Dennis Schridde 3f2786c030 - More cleanup
- Teach for to pieblitfunc
- sed DrawTransImage to DrawImage (they were defined this way before anyway) and remove an unnecessary parameter


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1875 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-18 14:25:06 +00:00
Dennis Schridde 07a8031e94 Introduce PIE5 format.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1871 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-17 18:58:29 +00:00
Dennis Schridde 96609e273b More backdrops by Terminator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1870 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-17 00:29:34 +00:00
Dennis Schridde b7efd162b2 Another backdrop by Terminator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1869 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-16 12:31:31 +00:00
Giel van Schijndel e292810a5c Forgot to actually commit this:
* r1866 removed piefunc.c from raw Makefiles instead of rendfunc.c: fixed

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1868 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 22:17:45 +00:00