Commit Graph

230 Commits (a6b56ed7e9bdb1182edbe4fc8b55ad73c48fb139)

Author SHA1 Message Date
Giel van Schijndel 1faab1bc89 * Fix compiling with MSVC (variable declarations at the start of the function)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1774 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-30 07:17:43 +00:00
Dennis Schridde d56e96c52e Fix STATIC_ASSERT to not produce "unused variable" warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1772 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-30 02:26:41 +00:00
Dennis Schridde 98cb1153c0 Make trig* functions const, which should be safe since they only depend on arrays which are setup on startup.
Also rename "count" to "i", since it really only is a loop iterator.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1769 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-30 01:41:48 +00:00
Dennis Schridde 9c6a4b29db Use special events structs for event handling.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1767 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 22:57:32 +00:00
Giel van Schijndel 6cb536c0d1 * Now load the "STR_RES" resource type directly from a file rather than an intermediate memory buffer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1760 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 18:12:02 +00:00
Giel van Schijndel 31d16a09bd * Fix assertion messages (the function names used there where incorrect, probably a copy&paste error)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1758 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 18:00:47 +00:00
Dennis Schridde 58e8bda3a9 _ISOC99_SOURCE is a libc macro, we now use WZ_C99 instead (which gets defined via __STDC_VERSION__)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1749 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 14:55:24 +00:00
Dennis Schridde fde0d68082 - (__STDC_VERSION__ >= 199901L) -> defined(_ISOC99_SOURCE)
- Tune lighting and enable by default (This doesn't seem to affect the terrain)
- Declaration updates (Trolltech says that attributes need to go after the "static inline", the GCC manual is a bit unspecific about this)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1744 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-29 14:09:10 +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 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 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
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
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
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
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
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
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
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
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
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 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 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 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
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
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