Commit Graph

73 Commits (a57b33f800b50b0d992095c6bea3c32ca492dbcf)

Author SHA1 Message Date
Per Inge Mathisen a980ac2ffe Clean up gamelib, removing nearly empty maxpidef.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2850 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-21 23:06:31 +00:00
Dennis Schridde cc7840e866 change_int64_t_to_intptr_t.patch from patch #837 by <cybersphinx> Christian Ohm.
(Make WZ compile with the Tiny-C-Compiler by using the correct type for storing pointers as ints)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2757 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-08 23:11:59 +00:00
Per Inge Mathisen 81ccff31f7 Convert hash table to use 64 bit keys instead of 32 bit keys, since they are used
to store pointers.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2661 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 19:28:02 +00:00
Per Inge Mathisen c086e3c529 Clean up hash table code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2660 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 19:16:16 +00:00
Giel van Schijndel f5602b4778 * Replace a large amount of strncpy() calls with the safer strlcpy()
* Fix an error in src/game.c where we would use the wrong size as parameter to strlcpy()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2640 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 16:18:52 +00:00
Giel van Schijndel e06c186bd6 * Replace a _lot_ of strcpy(), strcat() and sprintf() calls with the safer strncpy(), strncat() and snprintf() respectively
* Refactor NETlogEntry() to use the array of strings (packetname[]) instead of a large switch-statement with a lot of copy & pasted code


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2617 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 21:11:29 +00:00
Dennis Schridde 20fe87c0f4 AM: Add lexers to BUILT_SOURCES and CLEAN_FILES as well.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2427 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 13:16:09 +00:00
Dennis Schridde e232e9a6b5 Yacc warning fixes by Pseudonym404 (http://forums.wz2100.net/index.php?topic=148.msg7837#msg7837):
- adding *.tab.c to BUILD_SOURCES and CLEANFILES before *.tab.h in applicable Makefile.am files causes *.tab.c to be the file that triggers the %.tab.h %.tab.c: %.y rule, resulting in the command run being "bison -y  -d -o[...].tab.c [...].y", not "bison -y  -d -o[...].tab.h [...].y", which (aside from being correct syntax Wink ) stops "warning: conflicting outputs to file `[...].tab.h'"
- chat_parser.y had %token _T_A declared twice, second instance removed
- audp_parser.y had trailing | signs (presumably from when NULL wasn't commented out)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2426 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 13:03:09 +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
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
Giel van Schijndel 7ae1b1bee7 Some more heap abolishing:
* Replace a lot of heap usage with malloc/free usage

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1816 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-04 22:02:05 +00:00
Dennis Schridde 68e56823e1 - Constification
- POINT -> Vector2i
- changed internalformat = getPixelFormat() to GL_RGBA in one place
- removed unused variables/functions
- proper intialisation


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1792 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-02 23:01:29 +00:00
Dennis Schridde 009b61447c - Remove unused code
- Remove duplicated code/macros
- VECTOR3D->Vector3i
- Create float variants of normal functions to simplify Watermelon's float-PIE patch


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1661 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 11:05:28 +00:00
Dennis Schridde 7812d1635a main.c : Unused variables
gamelib/ : FRACT->float and simplifications
frame.c : Indent


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1657 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-19 19:49:54 +00:00
Dennis Schridde 892287d4f4 GCC 4.2 compile fix (NULL is a pointer and thus shall not be "cast from pointer to integer of different size")
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1656 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-19 14:47:17 +00:00
Dennis Schridde 0cfa9f6467 - Some more housekeeping.
- Warzone reacts on loss of focus again!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1601 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-07 20:24:34 +00:00
Dennis Schridde ce16856887 FREE->free, MALLOC->malloc (sed+review)
This patch will create crashes where the code expects FREE to set the pointer to NULL! (Those problems should be fixed anyway.)
The only occassion where I saw this is when quiting a game, so it is not too much of an issue.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1459 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-15 10:43:05 +00:00
Giel van Schijndel 6671750da0 * move some pieces of gettext.h into the conditional `#if ENABLE_NLS` and provide dummies for them if NLS is disabled (the #else part of the definition), without this compiling with NLS disabled is impossible
* remove ptrlist.c from lib/gamelib/Makefile.raw
 * some modifications of char* -> const char*
 * modify typedef of audio callback function to take a parameter of `void *psObj` rather than `AUDIO_SAMPLE *psSample` to minimize exposure (psSample->psObj was the only thing used by all callback functions anyway)
 * modify all callback functions to match the new typedef's signature
 * modify all functions calling callbacks to match the new signature (I think I've got them all, but since passing a pointer to a void* parameter doesn't generate any compiler errors/warnings I might have missed one, which would lead to undefined behaviour)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1442 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-12 10:31:11 +00:00
Dennis Schridde 25aa853f29 - Remove lots of inclusions of windows.h (and move inclusion of frame.h up)
- Remove "-%token <sval> TEXT" from audp_parser.y since it clashed with declarations in MinGW's Windows headers. It does still compile and run, but this may have harmed something anyway. Please check!
- Hack around DATADIR being defined by objbase.h in MinGW by undefining it before the inclusion of shlobj.h (incl. in main.c) This only works since the case that DATADIR is actually used on Windows is extremely rare.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1437 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-11 14:21:45 +00:00
Stefan Huehner f33eeb1413 inline the only function from ani.c in its only user (init.c) and remove
ani.c and ani.c altogether



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1429 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 18:13:08 +00:00
Stefan Huehner e40142efcb Remove the unused ptrlist implementation from gamelib
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1428 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 18:01:06 +00:00
Stefan Huehner 9eda7db8a1 Code-Cleanup: remove a lot of type,function,variable
declarations/definitions which are not used anywhere.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1421 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 17:01:53 +00:00
Giel van Schijndel fc701e9595 * remove unused priority parameter from script function audio_module::audio (audio_track)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1407 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-09 17:45:30 +00:00
Giel van Schijndel 011d7187e2 * audp_parser can now only parse from a PHYSFS_file, it won't parse directly from a memory buffer anymore
* resource types ANI and ANIMCFG are now read directly from file

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1400 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-09 11:31:05 +00:00
Giel van Schijndel e95423ac68 * set filename from GetLastResourceFilename() in sound_ConstructTrack (this filename can at some point be read back into scripts, so it does matter how this filename is formatted, since loading from buffer originally used that function, we now use it for both file loading and buffer loading)
* change audp_parser/lexer to be able to read directly from a file (through PHYSFS)
 * change data.c's mapping for "AUDIOCFG" to use the parsing directly from file
 * rename dataAudioLoadFile to dataAudioLoad
 * add a second list with load function mappings to audio.c for load from file mappings
 * add a second piece of iteration code for the file mapping list

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1398 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 23:25:48 +00:00
Giel van Schijndel de5510938e * get rid of unused priority queue implementation (lib/gamelib/queue.[ch])
* remove an unused variable from lib/ivis_opengl/piemode.c
 * some code refactoring to increase readability, change if branches that handle error conditions to the folowing style:
    if (error)
    {
        deal with the error;
        return something (usually false or 0);
    }
    
    continue with normal execution path;

 * previously was something like: if(not error) {normal execution path;} else {deal with error;}; the above way groups error detection and handling which is more easily readable/understandable
 * wrap some if branches from r1374 with curly braces according to Per's advice on the dev mailinglist
 * completely get rid of iPriority from struct TRACK (also stripped it out of functions' argumentlists) since the only code that seemed to use it is the removed priority queue implementation

PS someone might want to look at lib/gamelib/audp_parser.y to finalize the modification to audio_SetTrackVals there, I'm not sure whether it will break any code/script if I would simply remove values from the parameter list, so I'm leaving it as is for this moment

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1378 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-05 20:19:58 +00:00
Giel van Schijndel 26f2672bfd * remove macro PTRVALID
* replace all instances of PTRVALID(ptr,size) by (ptr != NULL)
 * remove asserts of style ASSERT( x == NULL || x != NULL ) because they would evaluate to true always anyhow and as such wouldn't ever trigger
 * remove macros iV_HeapAlloc and iV_HeapFree and replaced them with MALLOC and FREE respectively (that's what they expanded to anyway)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1348 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-03 13:20:41 +00:00
Gerard Krol 42ed587327 Per's removal of the memory heap system. Now MALLOC is just malloc, and not some wrapper around a wrapper that will allocate it from a specific pool.
The MSVC poject will need to be updated I guess, as some files were deleted.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1343 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-03 10:33:26 +00:00
Dennis Schridde 3b09a756df - Remove unneeded gettext files and instead create them via autopoint
- Remove unneeded checks from autogen.sh (all of them are also checked in configure.ac)
- Move AM_CPPFLAGS=-$(top_srcdir), which was included in nearly every Makefile, to configure.ac
- Remove -g from CFLAGS for usual builds. This should be set by the buildscripts instead
- Remove CFLAGS_OVERRIDE, which was rendered obsolete by the above change


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1332 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-02 17:21:05 +00:00
Dennis Schridde 8c2c3c97a8 Clean yacc headers properly
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1295 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-29 10:08:12 +00:00
Dennis Schridde 2a74242eb3 - Replaced various vectors with Vector3i and Vector3f (idea by Watermelon)
- Vector3i from lib/ivis also used in lib/audio, maybe want to move it to some more generic place?
- Replace iPoint with Vector2i
- Remove additional integer type declarations from pietypes.h
- Rename all iSprite to iTexture
- Various warning fixes: Unsigned/signed comparisons, uninitialized variables, declared but not defined symbols
- Replace DEBUG_BLOCK with DEBUG_MALLOC (it was virtually the same)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1245 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-16 16:20:16 +00:00
Gerard Krol 4465a061c1 Fix warnings, and revert r1241 for effects.c (validatePie really needs a prototype at the top)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1242 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-15 23:17:09 +00:00
Per Inge Mathisen d3cadd9e4a Start making the code conform to -Wextra
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1146 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 16:46:48 +00:00
Per Inge Mathisen 79b3875fc4 This commit fixes all warnings (on my system). -Werror added for
debug builds. Hopefully this will not cause too much pain, but
rather increase code quality for the future.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1144 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 14:10:44 +00:00
Dennis Schridde 8a70df4064 Use some more advanced Automake techniques like noinst_HEADERS. Changes partly autogenerated by KDevelop, so this should be compatible with Automake 1.6.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1118 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-16 14:36:03 +00:00
Giel van Schijndel 35de2b63f1 * get rid of lib/ivis_common/geo.h (only had one line, which effectively made it a symlink to another include file)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1110 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-14 20:13:31 +00:00
Dennis Schridde 49ceba7503 Add GPL notices to all sourcecode files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1014 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-15 20:09:25 +00:00
Dennis Schridde f723a42e50 Proposed fix for non-MSVC buildsystems
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@984 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-09 22:07:58 +00:00
Dennis Schridde 711af01772 New MSVC project files with custom build rules to support automatic lexer/parser generation.
The include changes might break other buildsystem, I'll fix that when I am back on Linux.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@983 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-09 21:13:58 +00:00
Giel van Schijndel 3d23a48076 * expand the use of compiler-guards (C preprocessor macros) so that not only the forward declarations and referring macros are guarded, but the referred functions as well
* remove some unused things: variables, macros (MEMORYREPORT, MEMORYTREAP)
 * fix some signing errors:
  * change assignments of/comparisons with -1 to unsigned variables ((-1) directly, not through a preprocessor directive) to ~0 (left OpenAL-code alone)
  * remove some casts to (SDWORD) in comparisons which actually cause signed/unsigned errors rather than fix them
  * redefine some vars as unsigned

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@955 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-04 17:03:32 +00:00
Dennis Schridde c510f87ed7 Patch by Gerard Krol: Removal of debug macros
Changes several DBPx macros to debug() calls and:
I introduced 2 new categories: LOG_MOVEMENT and LOG_ATTACK
and what didn't fit in was set to LOG_NEVER.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@876 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-01 22:22:29 +00:00
Dennis Schridde a432f5628f Patches by Christian Ohm:
010 - Remove unused sound compression code
011 - Remove unused audio parameter VagID


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@863 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-26 11:45:04 +00:00
Dennis Schridde f25a9aa3ac Not yet changed parts from patches of Christian Ohm:
003 - Remove all references to hWnd
004 - Remove DirectDraw flag
005 - Remove DDrawDriverName and D3DDriverName
006 - Remove all references to hInstance
007 - Remove some unused Windows types
008 - Remove VidMem parameter
009 - Remove bitdepth variables


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@862 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-26 11:39:54 +00:00
Dennis Schridde fb74a1f8dc Patch by Thomas Rast: Include string.h against warnings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@821 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-06 14:40:07 +00:00
Dennis Schridde 770af57c20 Remove more extra types
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@812 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-04 23:16:51 +00:00
Dennis Schridde 67056c8d24 - Droped a lot of (nearly) unused types from lib/framework/types.h
- Remove lots of unused functions (Windows/DDraw related)
- Now store the used bitdepth in the config and thus make it configurable without having to modify the sourcecode


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@808 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-04 01:11:26 +00:00
Dennis Schridde d3cd44148d Patch by Gerard Krol: Replace STRING with char (STRING was confusingly defined to char)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@804 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-03 21:35:50 +00:00
Stefan Huehner 65e820b246 Add some more missing includes:
seqdisp.c, gtime.c: SDL/SDL_timer.h for SDL_GetTicks()
piesraw.c:          SDL/SDL_video.h for SDL_GL_GetProcAddress()



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@753 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 18:52:52 +00:00
Stefan Huehner b3e3d17b82 Include frameresource.h directly in its users. Fixup after
the big cleanup in 748:749.




git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@750 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 18:38:12 +00:00
Dennis Schridde 3261a09baf BIG cleanup of headers.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@749 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 17:24:55 +00:00