Commit Graph

619 Commits (d301fd3a8235a198df999bd1b896d20a4b42ef75)

Author SHA1 Message Date
Dennis Schridde 290635ede8 Use POSIX definitions for WZ_OS_UNIX.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1638 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-15 17:17:32 +00:00
Ari Johnson 1ed4ff54e8 Mac OS X related improvements:
- WZ_OS_MAC && DEBUG implies --debug all so that Console.app can be used
   to view debugging output on debug builds when launching from Finder
 - DEBUG flag re-added to Debug builds in Xcode project; was removed
   accidentally at some point
 - WZ_OS_MAC no longer implies WZ_OS_UNIX; handled separately where
   necessary
 - Do not use Warzone's crash handler since Mac OS X provides a good
   crash reporter already that just saves the crash log, with lots of
   useful information, to ~/Library/Logs/CrashReporter/Warzone.crash.log


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1635 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-14 21:48:20 +00:00
Dennis Schridde 26c42e1698 Tiny note about endian_xxword -> SDL_SwapXXXX
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1633 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 22:37:13 +00:00
Giel van Schijndel 48f37b22d9 * Fix wrong interpretation of number of games (only the first byte of the 32bit long unsigned integer was used)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1630 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 18:52:29 +00:00
Giel van Schijndel 0a590a79af * Use network byte-order (big-endian) for size of game list as response to "list" command
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1629 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 18:19:22 +00:00
Giel van Schijndel 7b025ea3e1 * Make our lobby protocol code endian safe (response of a "list" command now always is preceded by a 32bit long, unsigned, little endian integer)
* Remove parameter `BOOL async` of NETfindGame since it wasn't used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1628 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 17:31:12 +00:00
Giel van Schijndel 70c07901ae * Remove unused spectator functions: NETspectate and NETisSpectator
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1626 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 11:36:46 +00:00
Giel van Schijndel a2d13bc53c * remove lib/netplay/netaudio_stub.c (only had empty functions)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1625 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 11:33:44 +00:00
Giel van Schijndel 1689bd9dc9 * Remove unused function NEThashFile
(This function was only used to generate a hash from the compiled Warzone executable, this hash was then used as a security value across the network. This method won't work when using different compilers, OSes, etc.)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1624 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 10:57:08 +00:00
Dennis Schridde 10128153aa - Comment,s comments, comments
- Move wzFPSmanager over to main.c, so the delay can be dealt with directly in the mainloop instead of the detour through frameUpdate
  - Adding the functions directly to main.c is probably not the wisest idea, but may be fixed later


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1623 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-12 23:41:29 +00:00
Dennis Schridde f5439cfa16 - More cleanup
- Split the mainloop into several (run) subfunctions
- start/stop functions for (de)initialization. This replaces the !Restart part
- removed necessity of several variables
- This is the last step before the event based mainloop


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1622 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-12 21:47:06 +00:00
Dennis Schridde 50ea035570 More cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1621 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-12 20:39:57 +00:00
Dennis Schridde 1b66305fd3 Revert r1619, because it broke campaign
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1620 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-12 17:58:10 +00:00
Dennis Schridde 22a7dd9dce Event based mainloop. WARNING: Is not yet fully finished and may have some flaws. Comments are appreciated.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1619 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-12 17:52:31 +00:00
Dennis Schridde 7c7911c92f - Fix gameloop exit, broken in r1615
- Split input event handling


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1616 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-12 15:54:35 +00:00
Dennis Schridde 981d56f328 active.state is a bitflag, so this should work even on Windows and still ignore the annoying focus switch on mouse-over.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1609 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-12 08:20:33 +00:00
Dennis Schridde a07d282350 Ignore SDL_APPMOUSEFOCUS on Linux, since it mostly happens accidentialy, while on Windows this is the only possibility to gain focus
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1607 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-10 17:55:05 +00:00
Giel van Schijndel 2e3b51d45a * We now also respond properly to loss of focus on Windows
* When receiving an SDL_ACTIVEEVENT also check for SDL_APPMOUSEFOCUS, but don't loose focus because of it, only gain focus when receiving this

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1605 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-10 10:24:56 +00:00
Giel van Schijndel b8a986228b * Warzone seems to hang when loosing focus (gets stuck into an infinite loop somewhere) on Windows
* Fix this by ignoring focus loss on Windows

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1603 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-10 08:21:42 +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
Ari Johnson ad582834c2 Added a hack to permit compilation on Mac OS X despite NSIG not being
defined in <sys/signal.h> for _POSIX_C_SOURCE or _ANSI_SOURCE.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1599 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-07 20:02:18 +00:00
Per Inge Mathisen b7e9c15c93 Some residual cleanup, including fixing an erronous static
assignment in the sound code.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1595 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-06 20:20:45 +00:00
Dennis Schridde 52349eb6cc Another try to workaround systems which usualy disable their POSIX extensions. AC_USE_SYSTEM_EXTENSIONS might have worked as well, but is not present before AC 2.61.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1593 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-06 17:51:04 +00:00
Dennis Schridde d6add14f37 Workaround broken MacOSX POSIX headers
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1592 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-06 16:53:53 +00:00
Dennis Schridde 7ee7276d89 Hacky fix for wrong POSIX checks. Now all non-Windows systems are treated as POSIX systems and required to support the Single UNIX specs Version 2.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1591 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-06 16:26:09 +00:00
Roman C 600e947bab - added two additional chat commands which can be recognized by AI
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1589 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-06 12:03:18 +00:00
Roman C 8fb6fd5b3c - increase number of allowed script instruction until the interpreter recognizes an infinite loop
- increase total number of scripts object variables to handle larger AI scripts

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1585 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-05 15:28:21 +00:00
Dennis Schridde 1587bc93c1 - Formating and removal of unused lines
- Removed a 20ms delay from the mainloop
- Added ASSERT_STATIC macro to check assumptions on compiletime


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1582 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-02 15:50:30 +00:00
Dennis Schridde 351060f21f - 1st attempt to create an API for image loading (support for PNG features like non 8bit channels still needs to be thought of). Appropriate code location is also missing (added new functions to tex.c, since they were not PNG related)
- Renamed pie_PNGLoadFile, because I got confused about pie_ vs. iV_ when working on my terrain stuff, and did not fix it when backporting to trunk
- iTexture (now aka iV_Image, s.a.) is given a depth field to enable support for different number of channels. This is required to support RGB only textures (without adding a useless alpha channel) and eg. for greyscale images like heightmaps
- Simplyfied iV_loadImage_PNG (formerly known as pie_PNGLoadFile, s.a.) and also removed lots of seemingly unnecessary conversions
- Converted page-8 from paletted to RGB for simplification. This multiplied the size by about 3x (still < 100kB)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1580 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-01 20:34:54 +00:00
Giel van Schijndel 6e33bd7cbb * Make progress bar white again
apparently we need a glDisable(GL_TEXTURE_2D) call at some times, or do nothing at other times, this is determined by pie_SetTexturePage by use of some global state, and the texture index, in other words pie_SetTexturePage to me seems like a dirty hack, but we need it for the moment

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1579 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-01 15:37:20 +00:00
Giel van Schijndel e252c12161 remove an unnecessary debug-statement
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1575 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-01 08:45:44 +00:00
Giel van Schijndel 9c0a67102d * Utilize OggVorbis decoding function from oggvorbis.[ch] instead of own implementation
* char* -> const char*

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1574 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-01 01:08:48 +00:00
Giel van Schijndel c4d97027ba * Fix a memory leak (didn't free the buffer we received, after using it)
* Remove the ability to decode into a specified buffer from sound_DecodeOggVorbis altogether, we now only use a buffer we malloc'ed ourselves
  * this might be slightly slower for streaming (depending on the malloc implementation), but can be easily optimized away by just increasing the buffer size (which IMO is a better optimization, because it's _a_lot_ simpler)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1573 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-01 00:30:37 +00:00
Giel van Schijndel 8a5c7d9f6d * remove ability to resize external buffer (realloc) because this made the code overly complex while providing only little gain
* instead we now just calculate the precise amount of memory needed ahead of time and just malloc for decoding of each track (decoding only occurs while loading so these extra malloc calls shouldn't go at the expense of performance)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1572 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-01 00:04:37 +00:00
Giel van Schijndel bfad55739b * modularize OggVorbis decoding code:
* remove OpenAL dependency of oggvorbis.[ch]
  * move sound_DecodeOggVorbisTrack to openal_track.c

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1571 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-30 23:52:51 +00:00
Ari Johnson d84e7fbf27 Warning linting on Mac OS X
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1570 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-30 20:42:18 +00:00
Giel van Schijndel c4ad4d1ca8 * remove a possible memory leak in sound streaming code
* some minor code cleanup

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1568 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-30 19:24:46 +00:00
Giel van Schijndel bdb506f697 * move OggVorbis decoding functionality to oggvorbis.[ch]
* did _not_ add copyright statement for "Eidos" to new files since Eidos never wrote anything about this OpenAL/OggVorbis code (if anyone thinks I'm wrong in doing this, please say so on the mailinglist)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1566 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-30 17:58:27 +00:00
Giel van Schijndel 1643e335e4 * remove unneeded header include directives
* use plain data types where appropriate
 * move the decision for streaming to a parameter of the decoder function (less tight coupling of client to internal decoder callbacks)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1565 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-30 16:55:53 +00:00
Giel van Schijndel d6758391d8 * Fix nameclash of <png.h> with lib/ivis_common/png.h
* renamed lib/ivis_common/png.[ch] to lib/ivis_common/png_util.[ch]

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1562 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-30 14:09:33 +00:00
Ari Johnson c62421a6ad Updated Xcode project to reflect pcx.c -> png.c change
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1561 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-30 02:10:22 +00:00
Giel van Schijndel 82eee99004 * Move PNG dumping code from screen.c to png.c
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1560 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 23:00:38 +00:00
Giel van Schijndel aff4430378 * Move PNG specific code to png.[ch] (PNG saving code still needs moving though)
NOTE: this _WILL_ require updating the MSVC project file

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1559 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 22:19:21 +00:00
Per Inge Mathisen e127a1d32c Code cleanup and remove unused code. There should be no behaviour changes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1558 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 21:42:22 +00:00
Dennis Schridde e5e418c480 - Sample prototype for a PNG saving function
- Vector2f type which will be needed for texture coordinates
- Output adjustment for pie_AddTexPage


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1550 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-29 00:58:39 +00:00
Dennis Schridde e9cfca5bb2 - WORLD_COORD() and MAP_COORD() macros to make world->tile and tile->world conversions (>>TILE_SHIFT,<<TILE_SHIFT,*TILE_UNITS,/TILE_UNITS) better readable
- Remove unecessary copying and code duplication from drawTerrainTiles
- Remove more BSP and unused code
- pie_Pagename -> pie_MakeTexPageName
- pie_AddBMPToTexPages -> pie_AddTexPage
- Whitespace and formating
- Fix hardcoded SKY_TEXPAGE id, which depends on the loading order in the wrf file. Changed to string (filename).
- iTexPage.textPage3dfx -> iTexPage.id
- Prevent unecessary texpage switching in pie_DrawTexTriangle


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1548 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 20:21:16 +00:00
Dennis Schridde 24c2c3296d - Remove unused function drawTexturedTile
- Increase drawed terrain size to 64 tiles
- (re)move some variables


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1547 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 13:53:41 +00:00
Per Inge Mathisen 4b36d353f2 Remove the unused iV_IMD_PSXTEX and iV_IMD_XTEX flags. The TYPE directive in
IMD files is now totally ignored.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1546 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 11:12:14 +00:00
Per Inge Mathisen b994a384c6 Simplify IMD loader code by removing support for IMD version 1 and the
unused NOTEXTURE directive. I believe the NOTEXTURE effect can be achieved
simply by not specifying a texture instead in more recent IMD versions.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1545 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 10:49:45 +00:00
Per Inge Mathisen 1b5cbb1c1e Remove flags from IMDShape since they were unused. Clean up IMD loader some
more. Remove unused GetLastHashName() and SetLastHashName().


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1544 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-28 10:36:21 +00:00
Dennis Schridde 5bd6e84852 - Change droid->direction to float, this should fix issues with vtols entering a loop around the target
- Make trigonometry tables static and remove usage of FRACT macros (trig.c)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1542 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-27 10:21:17 +00:00
Giel van Schijndel d86f1dd046 * remove assert in sound code (iSample != SAMPLE_NOT_ALLOCATED), this assertion is triggered much too oftenly, probably because we request OpenAl sources but never release them anymore, which is the result from depending too much on client code to be nice and tell the soundlib to release it
* remove a senseless forward declaration

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1541 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-26 17:51:17 +00:00
Per Inge Mathisen 69e282f30b Cleanup related to old BSP code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1537 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-24 20:15:41 +00:00
Giel van Schijndel 4548e56fe2 * Fix some signed vs unsigned comparisons
* Turn some implicit conversions of void* to something* into an explicit cast
 * remove some redundant commented out code
 * refactor some error checking code ( was: if (!error) normal exec path; else deal with error; now is: if (error) deal with error; normal exec path )

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1534 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 22:08:53 +00:00
Per Inge Mathisen 534472ce72 Remove used but ineffectual BSP IMD code. BSP data from PIE files not yet removed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1533 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 20:40:41 +00:00
Per Inge Mathisen dad0851e7e Remove unused PIETOOL code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1532 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 20:29:43 +00:00
Per Inge Mathisen ea932d1033 Remove more unused flags
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1531 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 18:45:24 +00:00
Per Inge Mathisen 3f97cc51b7 Remove many unused IMD flags and an unused debug function.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1530 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 18:11:01 +00:00
Per Inge Mathisen 9e1d57e718 Permit compilation without binary space partitioning. To test this, comment out
the #define BSPIMD line in lib/ivis_common/ivisdef.h header.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1529 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 17:59:13 +00:00
Dennis Schridde 153f21f20d Fix LC_MESSAGE for all systems missing it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1528 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 15:21:18 +00:00
Dennis Schridde ac178aa312 Revert to GNU gettext.h and move MSVC defines to the vcproj.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1527 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 14:30:34 +00:00
Giel van Schijndel 825ac28558 * use malloc instead of a variable sized array (is slower, requires more maintenance work, but is C89 and as such MSVC compatible, *sigh*)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1526 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 14:28:04 +00:00
Dennis Schridde 3eeaacbb0b Fix PNG code for MSVC (which doesn't support C99 variable sized arrays). Patch by v2k5.
Update AUTHORS


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1525 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 14:14:40 +00:00
Dennis Schridde 5c79953e18 Watermelon: projfix11a:
1. Fixed a bug (I made some parenthesis order mistakes, near predictX and predictY, which might corrupt predictX, predictY)
2. Fixed a value corruption when predictX or predictY becomes negative, since proj_SendProjectile only expects UDWORD (now set them to 0 when they become negative, so the turret wont try to fire projectiles to some off-map coords)
3. Fixed zero height building bug (invincible rearm pads) when an imd's ymin is equal to ymax...

lib/ivis_opengl/screen.c: \param channels


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1524 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-23 14:08:05 +00:00
Giel van Schijndel 486ac3ed11 * Use a variable sized array for the scanline array
allocated on the stack instead of the heap, which usually is a lot faster => stack alloc = O(1), heap (malloc=heap allocater) usually O(n) or O(log n)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1522 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-22 22:36:38 +00:00
Dennis Schridde 49b314f6a2 - Fix masterserver disconnect (patch by Gerard)
- Show hostname:port on connection errors
- Make gameserver and masterserver port configurable (as well as the masterserver name)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1512 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-21 13:46:28 +00:00
Dennis Schridde 6d55622b75 Several changes to texture loading:
- Be safer with stringlengths
- Create "page-123" texpages in pie_Pagename(). This code is needed since WZ might have loaded a different variant of a texpage (-urban,-arizona,...) and thus can only find it by the common "page-123" part
- Output filename on errors in in PNG loading
- Be a little bit less forgiving for wrong case
- Convert all TEXTURE references in PIE files to lowercase and replace 'fx`s' with 'fx', also replace 'urban area' and 'bases urban' with just 'urban' to keep consistency


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1505 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-19 18:04:41 +00:00
Giel van Schijndel 0f1188f387 * Patch by vs2k5 to enable compiling on systems which don't define a gettext locale directory
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1504 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 22:03:30 +00:00
Giel van Schijndel 0ecf2cba49 * now "properly" apply fix for segfault caused by using png_destroy_read_struct to destroy a write_struct
* (r1502 had a NULL pointer to many passed in the argumentlist)

thanks to vs2k5 for this fix (sorry couldn't find any other name anywhere on the mailinglist than your email userid)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1503 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 21:37:49 +00:00
Giel van Schijndel 6bfe7bfa86 * Fix segfault caused by using the wrong destruction function
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1502 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 21:25:32 +00:00
Giel van Schijndel 68eaeab5f3 * if we malloc we should free!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1501 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 20:06:35 +00:00
Giel van Schijndel 108e9ec935 Cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1500 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 18:17:21 +00:00
Giel van Schijndel d844dbab9c * Fix a segfault caused by dereferencing a NULL pointer when a resource has not been found
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1499 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 18:02:11 +00:00
Ari Johnson c79ff3b3c4 Fix to #include order in r1496
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1497 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 14:46:38 +00:00
Dennis Schridde f6da22d739 _MACOSX_ -> WZ_OS_MAC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1496 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 12:40:50 +00:00
Ari Johnson 91535c6596 Converted MacOS port to use Xcode to produce a universal binary. Warzone
will henceforth require MacOS 10.4 "Tiger" to run.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1492 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 03:10:53 +00:00
Giel van Schijndel aa9a519794 * Remove support for decoding (and encoding in case of screenshot dump code) of JPEG pictures
* Remove some dead (commented out) & dirty code from multiint.c which used JPEG code (image_load_from_jpg)
 * Remove dead (commented out) code from screen.c which used JPEG code (function static GLuint image_create_texture)
 * Remove unused backdrop types from pieblitfunc.[ch]
 * Convert last JPEG files into PNG, add a "comment" property on those: "All of these are converted from JPEG files, so this is JPEG quality."

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1490 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-17 18:24:31 +00:00
Giel van Schijndel 5756890d20 * Remove inclusion of <setjmp.h> which apparently libpng wants to include first (in <png.h>)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1489 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-17 17:48:19 +00:00
Giel van Schijndel baa3dcbb2a * Add PNG screenshot dumping code, when pressing F10 (with a default keymap) both a JPEG and PNG screendump will now be output
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1488 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-17 16:53:28 +00:00
Giel van Schijndel fd3324a9fe * pcx.c: use size_t for memory buffer length (size_t is the appropiate type for this, unsigned int is not)
* change macro BUFFER_SIZE to static const JPEG_bufferSize (compiler will optimize this away)
 * char* -> unsigned char*

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1486 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-17 12:58:22 +00:00
Giel van Schijndel c3683f64dd * make PNGheader be explicitly unsigned (required for compilers that define 'char' as being signed)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1485 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-17 12:23:54 +00:00
Giel van Schijndel f49c5cbdd5 * change pie_PNGLoadMem to pie_PNGLoadFile which (as the name suggests) now loads textures directly from PNG files (rather than memory buffers)
* change pie_ReloadTexPage to use files instead of memory buffers as well
 * change data.c's resource handler mappings to now load some more fileformats directly from file (all that directly or indirectly used to depend upon pie_PNGLoadMem)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1483 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 22:29:44 +00:00
Giel van Schijndel 7356aa1b9a * make pie_PNGLoadMem play nice and take the buffer size as an argument rather than assuming it to be 10000000 (10 million)
* do the same with pie_ReloadTexPage which calls pie_PNGLoadMem
 * char* -> const char* in tex.c
 * fix a syntax error from r1481

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1482 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 20:07:56 +00:00
Giel van Schijndel dcf4cb3263 * turn `integer overflow` debug message into an assert
* dump less information in the debug log if the assert is triggered (just "integer overflow; no more filenumbers available.")

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1481 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 20:00:12 +00:00
Giel van Schijndel 7527047316 * char* -> const char*
* make screen dumping code (screen shotstuff) more readable and friendly to edit (behaviour should be unchanged)
 * change screenDumpToDisk:
  * now returns void (rather than the target file name of the screen shot) since its only callee (a keymap callback) ignored the return value
  * use snprintf now instead of sprintf (to prevent buffer overflows)
  * add code to detect integer overflows (maybe we should just abort() on this condition?)
 * remove an empty and commented out function (screenTextOut)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1480 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 19:22:01 +00:00
Giel van Schijndel 300f691b0b * Fix error from last commit where the wrong pointer was used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1478 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 17:49:15 +00:00
Giel van Schijndel 09b08c1582 * remove senseless use of malloc (we now statically allocate on the stack)
* remove goto, placed the "goto"-code in an inline function instead
 * make pie_PNGLoadMem const correct (i.e. take a buffer we don't write to as const char*)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1477 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 17:34:11 +00:00
Giel van Schijndel 3c407e0972 * some const correctness (char* -> const char*)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1475 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 14:53:09 +00:00
Giel van Schijndel 51347f365c * remove MP3 decoding support
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1472 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-16 13:44:41 +00:00
Giel van Schijndel 1d160dbfe0 * remove now unused functions for working with hashnames on audio tracks
* `make -C po update-po`

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1471 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-15 22:46:57 +00:00
Dennis Schridde 5f87829d26 Clean indention and make the code a little bit more readable.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1469 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-15 20:45:09 +00:00
Per Inge Mathisen a9f120adec Add missing includes to quelch warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1467 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-15 18:48:13 +00:00
Giel van Schijndel f8c164fdde * Fix inconsistent newlines and set svn:eol-style to native in lib/ and src/
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1465 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-15 14:15:31 +00:00
Dennis Schridde 585db5249e Simplify code, especially the prepending of the debug part.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1462 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-15 12:46:08 +00:00
Dennis Schridde d3408cec7b - Remove mem.h and references
- Fix possible illegal writes for research messages


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1460 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-15 12:01:36 +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
Stefan Huehner c0a44c70e2 Make some more char* -> const char*
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1452 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-13 15:04:08 +00:00
Giel van Schijndel c028586ee4 Cleanup:
* AUDIO_SAMPLE
  * remove unused variable iLoops from the struct
  * rename bRemove to the more descriptive title of bFinishedPlaying
 * change sound_SetupChannel to return a BOOL rather than be return void and throw its output value in a pointer
 * make audio_Update() return void (instead of BOOL) since its output value was TRUE always anyway, plus all its callees ignored the output value
 * increase readability of lots of functions in audio.c
 * remove unused (and nothing doing) functions: audio_StopTrack, audio_SetTrackPan, audio_SetTrackVol and audio_SetTrackFreq

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1444 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-12 17:42:15 +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 e8da218797 Of course we need to leave room for ".png\0"...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1439 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-11 14:58:50 +00:00
Dennis Schridde 3cdae4332f - Fix a possible invalid write caused by writing up to 80 chars into a 64 char array.
The texture file in PIE files can now be up to MAX_PATH chars long.
- Find the reason for WZ discarding everything after the number in "page-123" styled texture references.
	This led to the problem with Grim's mod referencing the skybox texture instead of his own wall texture.
- Beautify some code


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1438 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-11 14:55:54 +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 aa1cb2ec14 Remove references to already removed header files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1431 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 18:29:58 +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
Dennis Schridde 751e6c44f7 Use pgettext instead of a custom implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1423 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 17:36:16 +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 c0fd40ff19 * revert changes of r1418 to droid.c and multiplay.c ( N_ macro was removed )
* since gettext_noop is always defined, remove the conditional definition of N_ which checks whether it is or is not defined

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1420 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 17:01:37 +00:00
Stefan Huehner 4d88263c9b Add registry_clear() to declarations, as it is exported
and used by other code.




git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1419 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 16:59:47 +00:00
Dennis Schridde 3c6c7b5b51 Cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1418 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 15:29:27 +00:00
Giel van Schijndel 79d4169bcd * fix two warnings in exceptionhandler.c
* add Q_ and Qn_ gettext macros (copied from Freeciv: GPL)
 * remove hack for ambiguous translations from droid.c; use Q_ instead
 * update makefiles accordingly
 * `make -C po update-po`

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1417 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 14:06:14 +00:00
Per Inge Mathisen 96cb7cafc5 Ressurect -Wno-unused-label. Reorganize string.h includes so that
_GNU_SOURCE can take effect first, to silence stpcpy() warnings from 
bison generated code.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1416 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 12:44:50 +00:00
Giel van Schijndel c3914a6ab2 * add the gettext no-op macro N_(string)
* use it in src/droid.c
 * throw some hardcoded strings (in a switch statement) in an array of strings instead (using N_ there as well)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1414 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 12:31:13 +00:00
Giel van Schijndel 365c37812d * Remove PIEPIXEL and change all of its instances to Vector3f (definition is exactly the same where types are concerned, only member vars were named different)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1412 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 10:47:20 +00:00
Giel van Schijndel cc17299668 * remove internal forward declarations of functions already declared in the header
* use proper constness:
  * make some functions take arguments of `const char*` rather than just `char*` (also modified some functions' return values to return `const char*` where appropiate)
 * modify rank retrieval functions to use a central array instead; currently ranklimits (i.e. the amount of kills required to promote) is hardcoded in switch statements, as is the case with the names of those ranks
 * `make -C po update-po`

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1409 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-09 22:09:27 +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
Dennis Schridde 8952155c7a - Add -Wextra to debug=yes, as it doesn't generate so many new warnings
- Add -Wno-nonnull to debug=strict to make it compile (Remove it from AM_CFLAGS)
- Remove -Wno-unused-label as this warning is not generated anymore
- Fix a "... from incompatible pointer type" warning which led to a lot of strings (and associated functions) in the widget area becoming const
- Maybe found the reason for images in UTF-8 strings


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1405 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-09 14:41:22 +00:00
Giel van Schijndel 80c250fd27 * merge 1364:1404 from trunk into branches/sound
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1404 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-09 14:35:02 +00:00
Giel van Schijndel 092afb2a01 * remove sound_CheckSample: only contained asserts, makes debugging difficult if you don't know where the assert really came from
* moved asserts to only two callees of sound_CheckSample

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1403 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-09 12:50:48 +00:00
Giel van Schijndel 3c874190c7 * remove the (unused) ability to decode tracks from memory buffers
* move construction (allocation and initialization) of struct TRACK to openal_track.c where it is also decoded

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1401 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-09 12:16:31 +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
Gerard Krol 28fe84976e Removed unused "cluster" functions from the sound code. I suppose
clusters are groups of close units.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1399 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-09 10:56:26 +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 99153c743c * remove some dead code (resource preload callback stuff)
* turn a one-statement function into an inline (resDoResLoadCallback)
 * revive resource loading from file (the function pointer for this was removed in r1394, to actually use this pointer new code had to be written)
 * modify resDataInit to handle memory allocation as well as data initialization
 * modify struct RES_DATA to not have a fixed size char array to contain the filename (is now dynamically allocated together with the rest of the struct, see resDataInit)
 * modify some argument lists to take `const char*` instead of `char*`
 * change resLoadFile to use RES_TYPE.fileLoad if available, also remove an unused if statement (well actually the condition could never be false)
 * resource type "WAV" (see data.c) now directly loads from a file (rather than copying the file entirely into memory and then to operate on that)
 * fix sound_ConstructTrack (track.c) where I used the wrong source to copy the filename from
 * fix sound_LoadTrackFromBuffer (track.c) to *not* add the track to the tracklist because this breaks other code
 * modify sound_ReleaseTrack (track.c) to gracefully deal with NULL pointers
 * remove dataAudioRelease (data.c) and instead just use sound_ReleaseTrack

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1397 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 21:39:24 +00:00
Giel van Schijndel 61975a7936 * Fix a missing semi-colon r1395
* Change some calls to FREE(TRACK*) to free(TRACK*), because TRACK is always allocated using malloc
 * Change only one instance of MALLOC and only other instance of FREE in lib/sound/track.c to malloc and free respectively

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1396 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 19:01:19 +00:00
Giel van Schijndel dfa8d64f27 * modify construction functions of TRACK to return pointers instead of BOOLs (and if we return a NULL pointer we first free the original memory, previous code would leak if errors would occur during construction)
* remove wrapping function audio_LoadTrackFromFile from lib/sound/audio.c
 * move similar code in sound_LoadTrackFromBuffer and sound_LoadTrackFromFile to a static inline: sound_ConstructTrack (lib/sound/track.c)
  * this code also allocates memory for a TRACK and a string using one malloc call, this to make one free call sufficient for cleaning those up (they should _always_ be free'd together anyway, which previously was *not* always the case: memleaks)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1395 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 18:51:15 +00:00
Giel van Schijndel 10964ceca2 * remove unused function pointer fileLoad from struct RES_TYPE in lib/framework/frameresource.h (there is code that sets this member, but none that uses it)
* remove function resAddFileLoad from lib/framework/frameresource.[ch] which was used to set RES_TYPE.fileLoad
 * remove only call to resAddFileLoad from src/data.c, function dataInitLoadFuncs
 * remove now completely unused function dataSaveGameLoad from src/data.c
 * modify function dataInitLoadFuncs in src/data.c:
  * modify the struct definition for the list of resource types
  * modify the list accordingly
  * remove the NULL-item from the end of the list
  * modify list iteration code to use a start and end iterator (end being a pointer just past the last valid list-item, begin being the first valid one)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1394 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 17:15:56 +00:00
Giel van Schijndel 0af269415c * remove some linked list wrapping macro (to increase code readability)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1393 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 15:35:00 +00:00
Roman C 0faf85229b Scripting Language:
-simple data types are lowercase on default
-casts using uppercase still allowed for compatibility with campaign scripts
-updated scripting manual accordingly

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1391 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-08 13:27:41 +00:00
Gerard Krol 6671fa934e 1. Removed the terrible memory leaks from the resource system. 2. Fixed the memory leaks for the terrain tiles. 3. Fixed a lot of uninitialised
variables. 4. Commented out some unused sound code.
I just love Valgrind :)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1390 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-07 13:23:14 +00:00
Giel van Schijndel a3ac39aa7d * fix a compile error caused by a curly brace to many
* (probably caused because I was editing this file when r1377 was committed which probably was merged wrongly with my changes)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1379 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-05 20:25:21 +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
Per Inge Mathisen 640e7be2a9 Sound code: Some code cleanup and removal of unused code. Also fix an assert
that was broken in several ways.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1377 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-05 19:42:00 +00:00
Giel van Schijndel a72ecb62fd * remove some else branches to inrease code readability (code itself should function exactly the same)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1374 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-05 18:43:42 +00:00
Giel van Schijndel c80d5dba3c * document audio_SetTrackVals (doxygen)
* remove some unnecessary else branches in audio_SetTrackVals (the if respective if branches really only where error handlers which caused the function to return anyway)
 * rename some things in audio_id.c to a more explaining name (i.e. the struct and its members)
 * fix some serious abuse of tabs ('\t') in audio_id.c, while the file looks partially good with a tabsize of 4, it looks awful with a tabsize of 8

PS audio_id.c's sole duty seems to be to map sound events to audio files, for the sake of moddability I think we ought to move this out of sources and into scripts.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1372 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-05 18:14:18 +00:00
Gerard Krol 7d6382905d Fix some problems introduced in r1286: 1. flickering water edges 2. transparent water was not correctly drawn
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1363 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-05 14:32:13 +00:00
Stefan Huehner 8c517891ea Remove the font.h header file (which had no implementation)
Remove all callers (which all were commented out)
The 'real' font implementation used lives in ivis_



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1357 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-03 18:14:24 +00:00
Stefan Huehner 7c9f1d19af Remove some unused function prototypes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1356 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-03 17:33:38 +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
Giel van Schijndel 13c85370b9 * enable libvorbisfile to seek into a file opened with PhysicsFS
* also allow this to be disabled on a per file basis (this code is basically taken from the sound branch: lib/sound/decoding.cpp)
 * some minor code cleanups (using a temporary to cast into, rather than casting directly into a function call's parameters, optimizer will optimize this away anyhow)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1345 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-03 11:15: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
Per Inge Mathisen 0de1ff1124 Fix warning
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1324 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-01 20:12:47 +00:00
Per Inge Mathisen 69dd9fbdc5 Add autogen.sh checks for gettext, and assign the _() macro to gettext.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1323 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-01 20:09:46 +00:00
Roman C 89f67fc187 Scripting Engine:
-fixed local string variables now being cleared between function calls
-implemented a setBit() scripting function to work with bitfields

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1318 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-01 16:22:01 +00:00
Dennis Schridde 6180aab09d - Make make visit intl/
- Update dbghelp.h to Wine 0.9.34
- Sync with branches/2.0


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1313 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-31 18:04:43 +00:00
Roman C 1c2ec5e07d Enabled recursive function calls for scripts.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1311 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-31 16:03:21 +00:00
Dennis Schridde c5e611767b Gettext support (0.16.1 included)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1310 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-31 15:34:35 +00:00
Gerard Krol d775cc8962 r1302 caused smoke to be nontransparent when viewed in front of the sky or fogbox. This is fixed by first drawing the sky and fogboxes and then
the terrain and other objects. (it was the other way around)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1304 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-30 19:41:44 +00:00
Gerard Krol bbd1fc594f Fix a bug introduced in r1302: Unit selection boxes were not shown or periodically disappeared.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1303 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-30 18:12:56 +00:00