Commit Graph

82 Commits (d72395ef6f7314764541e7db9185ad23300c697f)

Author SHA1 Message Date
Buginator 49f164b23f Fix a out-of-order list
(r8516)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8530 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-28 19:34:15 +01:00
Buginator d6261ced17 Add new debug flag "input" to be used for input (keyboard/ mouse) issues.
Add allot more debugging for the input routine(s) to help find keymap issues.
*Change* Add a user friendly (numpad) clarification to the keymap editor, and also color it yellow.
*Change* Rename "Multiplayer Options" to "Multiplayer Options / Alliance dialog" to clarify what this is used for.

(r8376)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8518 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-28 19:34:13 +01:00
Buginator 11482e4a96 Fix a typo
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8352 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-22 16:19:54 +01:00
Buginator 0aff0b46cf Add a new debug flag type, LOG_FATAL.
This is used to differentiate LOG_ERROR (which is a *non* fatal error, but a error none the less) and fatal errors which result in program termination with no *visible* output (on windows/macs) on our end because of the crappy GUI functions so we usually dump it to stderr.txt and there is no clue that the program had to exit for whatever reason.

Hopefully, this will be helpful to windows people so they can differentiate between *our* exit/abort routines, and crashes that occur in drivers which look exactly the same since they get dumped back to the desktop with no visible clue why.

LOG_FATAL is *always* on in both debug & release builds.

On LOG_FATAL debug lines, on windows, we now throw up a modal dialog box with the current error message.  At this time, this only happens when we have a error, and we use abort() right after the error, which makes it fatal.

That explains why this touches ~60 files :)


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8320 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-22 16:19:51 +01:00
Per Inge Mathisen b549837969 Remove unused include
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7914 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:06:55 +02:00
Buginator 11ab9125ad Add new macro, info(), it is shorthand for debug(LOG_INFO,...). This is used to *always* display informational messages on both debug & release builds.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7734 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-16 22:28:34 +02:00
Buginator fc8bbc5bd9 Feature fixes & enhancements.
*Adds LOG_FEATURE (--debug feature) so we can keep track of features.

*Disallow VTOLs from being able to poach features.

*Changes feature spawning from instant to a variable time period.

*When feature can't be placed, break out of routine instead of sending invalid data.

*Actually remove features, and notify others that the feature was removed. (AKA, actually sync between machines.)

ASSERT() when numNaybors is invalid.
Fix a spamming debug line mistakenly changed in r6677


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6737 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-28 03:36:26 +00:00
Buginator 9d868d4c0c Adds LOG_LIFE to track when units are created.
(We already had LOG_DEATH)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6694 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-22 17:59:57 +00:00
Gerard Krol 5601741b95 Brace for impact, this is the new terrain renderer!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6682 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-21 23:35:21 +00:00
Buginator e920507134 Change debug() output from gametime to real time.
In MP games, since gametime can vary so much between machines, needed a more reliable time source to sync up messages between them.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6679 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-21 22:24:02 +00:00
Dennis Schridde aac41748dc Bump copyright
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6617 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 18:01:48 +00:00
Dennis Schridde cbbc58d1e9 Move files which extend a c std library header to a filename of similar name
Extension functions dealing with ...
 * strings are in string_ext.h
 * stdio (namely printf variants) are in stdio_ext.h
 * math are in math_ext.h

These headers are no longer included by frame.h

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6613 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:09 +00:00
Dennis Schridde 98842001af Use bool instead of BOOL where the latter is not required
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6569 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 15:51:35 +00:00
Per Inge Mathisen 0881493713 New cheat "noassert" and new command line option "--noassert" turns off the abort functionality in ASSERT() calls.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6527 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-02 11:16:40 +00:00
Giel van Schijndel 03353e833e Allow the initialisation function of the debug callback to fail and report its failure through its return value:
* If initialisation of the debug callback failed, do ''not'' add it to the list of debug callbacks to use

This fixes ticket:136

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6249 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-08 19:30:18 +00:00
Giel van Schijndel 38f5b64c91 Add a new command line option: --flush-debug-stderr which causes the debug output to be flushed when used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5636 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 19:49:36 +00:00
Giel van Schijndel ed3f1508b8 * Remove the dumpLog function and associated code from debug.c
* Add a new function dbgDumpLog to dumpinfo.cpp for dumping the last debug messages
 * Add a debug output callback to dumpinfo.cpp which is used to fetch the debug messages and store them in a ring buffer


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5581 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 01:08:07 +00:00
Giel van Schijndel 859196ed2c Move duplicated code, for printing to ''all'' debug output callbacks, to a function of its own.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5580 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-18 23:13:49 +00:00
Giel van Schijndel 9d77329842 * Add a new statically-sized string macro vssprintf, which allows printing to statically sized strings just like ssprintf, with as difference that this macro function operates similar to vsprintf rather than sprintf
* Replace uses of strncmp, snprintf and vsnprintf with sstrcmp, ssprintf and vssprintf respectively


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5579 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-18 22:47:28 +00:00
Dennis Schridde 452b737b64 Output gameTime for debug messages. Should make it easier to recognize relevant messages and their relation over time.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5317 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 18:07:45 +00:00
Giel van Schijndel 3b4df24942 Use WZ_DECL_UNUSED for the data parameter of debug_callback_win32debug to squelch the warning about it being unused
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5211 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-04 17:50:40 +00:00
Giel van Schijndel 855ec725d4 Use sstrcpy|sstrcat instead of strlcpy|strlcat for manipulation of statically sized strings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5176 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 13:46:49 +00:00
Per Inge Mathisen 4d845c8067 Fix debug log calls going off when they shouldn't
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5147 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-22 19:33:05 +00:00
Per Inge Mathisen 36e2ff2517 Update changelog in trunk as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5056 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 22:11:28 +00:00
Per Inge Mathisen 91727f270b objTrace() no longer requires a debug part parameter, and always outputs the ID
of the traced droid.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5047 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 14:58:20 +00:00
Giel van Schijndel 61c8bbc4b9 * Don't "Guarantee nul-termination" after snprintf as snprintf does that itself already (per the C99 spec)
* Use strlcpy for copying strings instead of snprintf "%s"
 * Don't cast the return value from vsnprintf to (void)
 * When we use va_start make sure to use va_end as well...
 * Fix indentation


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4785 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-26 14:21:41 +00:00
Per Inge Mathisen f0226edf93 Add new debug level for messages and new log calls.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4685 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-19 21:41:18 +00:00
Per Inge Mathisen 28669696a4 Clean up debug log. We now print the function name first automatically - no need to
put that into the debug call. Rename some categories to make them line up correctly in log.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4684 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-19 14:52:35 +00:00
Giel van Schijndel 678edfead2 Provide an alternative `dumpLog` implementation:
* one that works with the POSIX write() syscall on an integer file descriptor
 * and one that works with WinAPI's WriteFile() function on a HANDLE

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4513 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 23:37:46 +00:00
Dennis Schridde 10f2ccfd56 TRUE->true, FALSE->false (except in scripts)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4311 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 16:51:17 +00:00
Roman C 3b1c952de1 Speed up script execution when "--debug script" is not enabled.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4228 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-22 17:42:07 +00:00
Giel van Schijndel 23230caf2a * Revert r3804 (replaces usage of strnlen with strnlen with the unsafe strlen)"
* Finish r3795 where I nicely #included the correct files but forgot to replace strnlen with strnlen1 - 1


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3805 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 17:57:43 +00:00
Ari Johnson 66f662e16a Removed usage of GNU extension strnlen()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3804 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 17:48:13 +00:00
Giel van Schijndel 33759c07c4 Don't use `strnlen` in debug.c as it's a GNU extension (and as such isn't always available), instead use `strnlen1 - 1`
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3795 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 11:53:25 +00:00
Per Inge Mathisen b92c8c5a33 Dumpt the last two log message calls into the exception handler report.
This way we get to see the message given by asserts in the dump file.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3781 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-14 22:07:53 +00:00
Dennis Schridde 2d29dc2191 Replace runtime code_part_names size checking by counting with a STATIC_ASSERT on its size.
Additionaly:
- Introduce ARRAY_SIZE macro
- Use code_part instead of int where applicable


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3539 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-22 16:03:58 +00:00
Dennis Schridde cbccd3336c Revert r3537, as it may not be safe on all compilers...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3538 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-22 15:47:20 +00:00
Dennis Schridde d2370600d8 Replace code_part_names() with code_part2string(), which gets us rid of having to check that the array size matches the enum on runtime.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3537 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-22 15:41:21 +00:00
Per Inge Mathisen 5b1ec5cfc1 Add new debug mechanic: objTrace(). It works like debug(), but also takes an object parameter.
Debugging info given with it will only be displayed for the enabled game object. Default key
to enable debugging info for a game object is CTRL+L. Converted LOG_MOVEMENT to use it.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3432 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-11 22:45:04 +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 52aa90d200 Fix a few spelling errors, and add a new debug category 'multisync'.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3227 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-29 17:55:20 +00:00
Giel van Schijndel 1f2d5cbddf * Add a new debugging level LOG_SAVEGAME or "savegame"
* Add a large quantity of debug() calls to game.c
 * Correct some spelling errors in comments

Part of patch #853 by Buginator


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2826 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-15 18:32:07 +00:00
Giel van Schijndel bd37e62cb2 * Replace a lot of strncat(dst, src, sizeof(dst) - strlen(dst) - 1) calls with the less bloated strlcat(dst, src, sizeof(dst)) form
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2637 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 15:47:17 +00:00
Giel van Schijndel 6b4cba1700 * Rename pLevelName to aLevelName (hungarian notation is a pain. Especially when it's wrong!)
* Get rid of several magic numbers
 * Some const correctness
 * Replace a huge amount of strcpy(), strcat(), strncpy() and strncat() calls with a strlcpy() and strlcat() calls respectively


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


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2617 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 21:11:29 +00:00
Per Inge Mathisen 9ec705bd9c Add new debug tag LOG_MAP
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2597 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-23 18:18:48 +00:00
Dennis Schridde c7b00fadaf More work on the ICC front:
- Less strict warnings in debug-mode (still unusable, because ICC warns about _a lot_)
- Explicit conversions
- Clarify parameter evaluation order


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2550 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-15 18:09:18 +00:00
Per Inge Mathisen 0266477bd9 Add new debug category: gui
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2338 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-03 16:24:17 +00:00
Per Inge Mathisen 3834067f15 Cleanup of visibility code. Added new debug category: "sensor".
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2320 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-02 20:23:09 +00:00