Commit Graph

552 Commits (cbb0795bd35bd73eef629bbaaed0483bc738aacf)

Author SHA1 Message Date
Per Inge Mathisen 2ec98482ba Remove workaround for Direct3D bug
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1710 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 19:29:36 +00:00
Dennis Schridde 8efecd07b2 const and indent
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1709 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 19:14:23 +00:00
Dennis Schridde b29fad2da0 Load the object matrices by loading them and not by loading the identity and multiplying.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1708 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 18:51:47 +00:00
Dennis Schridde 3c2afc391e Move the calculation of the relative light position for shadows out of the ShadowDrawLoop, into Draw3DShape, so we don't need to calculate it twice for the front- and the backface.
Patch inspired by Watermelon.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1707 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 18:25:15 +00:00
Dennis Schridde 2313b8d53e The Vector3 functions where not really const, since they operated on pointers.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1706 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-26 17:00:55 +00:00
Dennis Schridde f29d7647f6 It's probably safer with these types... (Because of the previous commits)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1704 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-25 18:03:48 +00:00
Dennis Schridde 9d4a007121 More inlining and const
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1703 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-25 17:58:23 +00:00
Dennis Schridde 52486bee8b const const const
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1702 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-25 17:21:13 +00:00
Giel van Schijndel de4b91e2c3 * Use a forward declaration of `struct OggVorbisDecoderState` instead of a dual typedef (one typedef as void for external functions, one as the struct for the implementation file), only to allow us to take pointers to it
* Drop now unnecessary extern "C" declaration, since C++'s function overloading shouldn't cause problems now
 * Add "struct" keyword in front of all declarations of `struct OggVorbisDecoderState` or pointers to it

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1698 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-25 14:56:18 +00:00
Giel van Schijndel 12078733b8 * Fix usage of `new` which is both a) a keyword in C++, and b) an undescriptive variable name
* Make sure function overloading by a C++ compiler doesn't cause linker errors by declaring affected functions extern "C"

Patch by Christian Ohm (in message <20070523201048.GF3778@localdomain>);
 * applied changes to lib/ivis_common/imdload.c
 * brought linker errors to light caused by function overloading

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1695 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-23 20:57:11 +00:00
Giel van Schijndel 856830a0e4 Cleanup:
* Remove some forward declarations of deprecated, unused and undefined functions
 * Remove some unused functions which only said: "return TRUE;"

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1692 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-23 19:36:21 +00:00
Giel van Schijndel b22dbc7fe5 * Remove netusers_stub.c. Its only contained function was NETuseNetwork, which granted direct write access to global var NetPlay.bComms. This was camouflaged as a nice function call, so instead we now use it directly as it is: accessing/modifying a global variable.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1690 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-23 18:48:36 +00:00
Giel van Schijndel b3a43af4d3 * Add code to support the C99 bool type (fallback for non-C99 compatible compilers provided!)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1688 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-23 17:03:22 +00:00
Dennis Schridde 057f140b6c Make MSVC happy
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1682 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 20:12:39 +00:00
Dennis Schridde 1014259054 This should enable floating point precision in IMD (.pie) files.
It should even render them as floats. I wasn't able to see a difference after modifying some PIE files, though.
This patch is heavily inspired by Watermelon's work. (Namely piefloat.patch)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1681 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 19:56:07 +00:00
Dennis Schridde 7544470e35 Cleanup. Note the FIXME!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1680 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 19:42:05 +00:00
Dennis Schridde 49f8259226 More cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1679 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 18:57:11 +00:00
Dennis Schridde 504126bda9 Forgotten cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1678 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 18:33:07 +00:00
Dennis Schridde b8f038d37a Cleanup IMD loader.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1677 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 18:25:46 +00:00
Dennis Schridde 041e086d53 - -Sint32 pie_RotateProject(SDWORD x, SDWORD y, SDWORD z, SDWORD* xs, SDWORD* ys)
+Sint32 pie_RotateProject(Vector3i *v3d, Vector2i *v2d)
  This removes the necessity of the wrapper pie_RotProj.
- Also changed a few "Vector3i null" to "zero" for less confusion.
- And removed an unused variable that hid behind an assignment.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1674 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-21 14:06:31 +00:00
Giel van Schijndel 6e5038d237 use (u)intX_t types for structs send accross the network (for the size guarantees)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1672 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 22:55:12 +00:00
Giel van Schijndel 0a25bfacb7 * Use C99 types for the *WORD typedefs instead of SDL's own types
NOTE: MSVC users don't get scared since SDL defines the C99 types for MSVC

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1671 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 21:48:07 +00:00
Per Inge Mathisen c511ab63b6 Fix crash introduced in commit r1661 in function pie_RotateTranslate3iv,
where the y and z parameters were not switched, as they should be.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1670 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 21:41:48 +00:00
Dennis Schridde 01fea434fb Turn some sqrt() into sqrtf() where double precision is not needed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1667 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 14:47:32 +00:00
Dennis Schridde 23e39b56dc Add a STATIC_ASSERT which also works in global scope.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1665 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 14:24:54 +00:00
Per Inge Mathisen b620f3f25f Remove all mention of non-existent type iVector
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1664 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 14:18:14 +00:00
Stefan Huehner d30dcb1520 2 small fixes in function declarations : () -> (void)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1663 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 13:51:53 +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 d1d55cc977 FRACT->float,[if]SQRT->sqrtf
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1658 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-19 21:32:19 +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
Per Inge Mathisen fc3d29124d Weed out some deadwood from the multiplayer code, and fix a warning.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1653 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-17 14:00:15 +00:00
Ari Johnson e0872c90af WZ_OS_MAC now no longer unsets WZ_OS_UNIX due to compatability update in
r1638.  Exception handler still removed if WZ_OS_MAC is set.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1640 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-15 20:33:55 +00:00
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