Commit Graph

64 Commits (cac17150d32a925ac9401cb0e9f7dc0591ab795a)

Author SHA1 Message Date
Per Inge Mathisen 917187ca7d Clean out some excess global defines.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3753 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 16:23:20 +00:00
Giel van Schijndel b3a3cecaed Rename fractions.h to math-help.h and remove most junk from it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3584 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:01:37 +00:00
Per Inge Mathisen ae19f5bd54 Move PHYSFS_APPEND and PHYSFS_PREPEND macros to lib/framework/
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3354 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-05 14:50:16 +00:00
Per Inge Mathisen eddebc7f81 Move some initialization code from src/ into lib/framework
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3353 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-05 13:50:34 +00:00
Per Inge Mathisen dc7a84da62 Log droid death and packet source. Beware: This will make net games incompatible
between before and after this commit.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3311 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-02 17:08:29 +00:00
Per Inge Mathisen 877ac6456c Add lots of doxygenized comments.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3230 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-29 22:34:41 +00:00
Ari Johnson 47816967a7 Updated Xcode project and some endian fixes; also changed endian_*() calls
to expand to ((void) (x)) on little-endian systems, so that the compiler
will catch little-endian developers who forget to update the endian_*()
calls when they change the names of structure fields.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3205 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-27 23:55:34 +00:00
Giel van Schijndel 7711572f0a * Add a new module (printf_ext.c) to contain some printf extensions (C99 printf variants for MSVC)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2803 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-11 20:58:10 +00:00
Giel van Schijndel 673812b2a4 * Add file strlfuncs.h; this file contains an inline implementation of strlcpy and strlcat (safer variants of strncpy and strncat respectively)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2627 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-26 17:05:29 +00:00
Dennis Schridde fbd3a9c394 Use Unix PATH_MAX as default and thus move all "fixes" to Windows.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2425 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 12:59:05 +00:00
Dennis Schridde 08a43494fd - Clean up macros a bit more
- Use WZ_CC_GNU_PREREQ (copied from glibc's features.h) instead of custom code
- Move platform.h into wzglobal.h


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2424 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 12:30:00 +00:00
Giel van Schijndel b5e548e800 * Use a union instead of first casting to void* before casting to uint32_t* from float* (prevents type punning of pointers)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2412 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-17 22:17:16 +00:00
Giel van Schijndel 29c1229322 * Prevent a warning about "dereferencing type-punned pointer will break strict-aliasing rules" by casting a &float through a void* before casting it to uint32_t*
* Add an explanation about floats (that they're basically the same as 32bit integers as far as endianness conversions are concerned)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2379 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-16 09:09:30 +00:00
Giel van Schijndel 1ee0356036 * Adapt the writeFXData and readFXData functions to use the PHYSFS big endian swapping write and read functions
* Don't write directly from the memory of the EFFECTs (since this memory doesn't always have the same size on 32vs64bit systems)
 * Guarantee to always write the IMD's hash number as if it's a uint32_t (this fixes 64bit compatibility of these functions)
 * Add functions openLoadFile and openSaveFile which perform the file opening for loadFile2 and saveFile and now readFXData and writeFXData as well

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2378 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-15 21:26:05 +00:00
Giel van Schijndel ed73e62898 Leave the memory management up to the memory management functions!
That is:
 * Don't use a custom memory heap implementation anymore
 * Remove all usages of HEAP code and replace it with malloc/free

NOTE: MacOSX projectfile probably requires an update

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1820 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 11:46:00 +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 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 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 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
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
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 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
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
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
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
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
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
Dennis Schridde 6d5b7850c4 Backport (from branches/2.0):
- ChangeLog for 2.0.6
- Exception handler


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1293 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-29 09:45:11 +00:00
Dennis Schridde bc50d5185d POSIX signal handler now outputs a plaintext file.
It uses strlen(), which is not required to be signal safe, but I can't imagine it to be not reentrant and suffering from heap/stack corruption...
It uses strsignal(), which is a GNU extension. strsignal is implemented using the signum as an index into an array of signal descriptions, which should be easily cloneable for non GNU systems if needed.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1190 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-01 01:29:07 +00:00
Dennis Schridde 8cdad4a810 - Change signalHandler to use POSIX signal safe file functions
- Reorder read_gdmp output
- Added compilation date to gdmp
- Reordered gdmp values: sysInfo now after programVersion/compileDate instead of before, to match read_gdmp display order

Still not implemented: Custom (signal safe) sprintf replacement, so we can output textfiles instead of binary blobs.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1189 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-01 00:15:50 +00:00
Dennis Schridde d399a897a9 Port of r1164 (exception handler). (Remove dbghelp.h when it is included in MinGW W32API.)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1165 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-23 16:36:11 +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 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 f942dc4700 Make framerate limit configurable (through "framerate" config value).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@949 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-31 20:29:24 +00:00
Dennis Schridde 526cd5482f Patches by Christian Ohm:
013 - Cleanup environ.c-h
015 - Remove some unused code from frame.c-h
017 - Remove unused function ScanFilename()
023 - Fix more warnings, remove unnecessary functions


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@865 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-26 11:58:01 +00:00
Dennis Schridde fafa69842f x86_64 fixes by Pseudonym404. (Incl. some minor other changes, eg in src/game.c)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@854 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-25 01:26:05 +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 532ada3156 Add doxygen style headers to .h files to document
their meaning.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@759 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-25 16:46:28 +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
Dennis Schridde a88bbc0c37 Patch by Stefan Huehner: "string 1"
Replace all STRING with char or const char.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@716 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-16 16:02:17 +00:00
Dennis Schridde 27b07a0ba1 Patch by Stefan Huehner: "code cleanup: const 2"
Patch marks several read-only function parameters and datastructures as such by adding const.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@709 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 21:16:17 +00:00
Dennis Schridde 728b9a9913 - Commit patches "code cleanup: void" and "code cleanup: const" by Stefan Huehner
- Replace every occurence of VOID with void (and LPVOID with void*)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@703 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 09:09:05 +00:00
Dennis Schridde 76b6d70f6d Remove any occurences of GetTickCount() (a Windows function) with SDL_GetTicks() which was used on non MSVC anyway.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@656 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-27 19:09:35 +00:00
Dennis Schridde 7f3693b592 Revised framecounting to give correct results and use more informative names.
Also removed some unused framecounting functions.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@655 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-27 19:01:34 +00:00