Commit Graph

40 Commits

Author SHA1 Message Date
e104b41be2 Cleanups includes for cassert and streams.
This was SVN commit r25002.
2021-03-03 22:26:49 +00:00
d7d0f142d8 Update (and debundle) fmt dependancy
We now support the most recent released version of `fmt` available (at
the time
of committing).

As we no longer patch `fmt` to get it to work within `pyrogenesis`, this
commit
also mostly removes its source from our code-tree (some headers are
retained for
Windows builds).


If you are a user of...

Linux/BSD: You will now need to have `fmt` installed from your
distribution's
           package repository. The minimum supported version of `fmt` is
`4.0`.

      OSX: The source is acquired and compiled (in `build-osx-libs.sh`),
           then included and linked automatically.

  Windows: The relevant header files are retained and, along with a
pre-built
           library, are the only things still bundled.


Accepted by: wraitii
Tested by:
* Freagarach (Lubuntu 18.04, `fmt 4.0.0`)
* Krinkle (MacOS 10.14, `fmt 6.1.2`)
* nephele (Alpine Linux)
* wraitii (MacOS 10.14)
* Nescio (Fedora 33, `fmt 7.0.3`)

Windows library files built by: Stan
Fixes: #3190
Differential Revision: https://code.wildfiregames.com/D2689
This was SVN commit r24267.
2020-11-26 21:01:32 +00:00
395a10beb0 Fix compilation error on arch introduced by 5473393e30
CLogger.h uses std::deque but doesn't include the required header file.
This fails since 5473393e30 on Arch Linux

Reported by: navigo_ps91
Reviewed By: irishninja
Differential Revision: https://code.wildfiregames.com/D2928
This was SVN commit r23933.
2020-08-05 09:25:24 +00:00
32a105d6f8 Update cppformat from v0.11.0 to v1.1.0, fixes #5646, refs #3190.
Use the opportunity to rename the lib from cppformat to fmt, refs #4148.

Patch By: adrian
Rebased By: s0600204
Differential Revision: https://code.wildfiregames.com/D2613
This was SVN commit r23562.
2020-04-01 07:29:33 +00:00
ba736916fc Clean up ThreadUtil, use standard C++11 constructs instead of custom ones.
ThreadUtil shipped a scope lock and a mutex implementation, which can be
removed since we now have these in the standard library.
This lets us clean up this header which get included everywhere (through
profiler includes).

Tested By: Angen and Stan
Differential Revision: https://code.wildfiregames.com/D1915
This was SVN commit r22344.
2019-06-06 19:30:48 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
dcf5a2667f CLogger: Use cppformat instead of sys_vswprintf.
sys_vswprintf relies on platform-specific printf implementations, which
vary widely between platforms (in handling of truncation, return values,
use of %s/%S/%hs/%ls for mixing char and wchar_t strings, etc) and are
therefore a pain.

Use cppformat's fmt::sprintf instead, which has very similar syntax to
sprintf but is more C++ish and is portable.

Also, wchar_t is stupid, so use char* strings (which are expected to be
UTF-8) in CLogger. This creates a bit of a pain with changing all
callers to convert to char* strings, but that's their fault for not
using UTF-8 already.

Refs #3011.

This was SVN commit r16182.
2015-01-22 20:30:05 +00:00
19dbbb816d Changed all references from old CLogger API to use the new API. Removed old API. Fixes #247
This was SVN commit r8791.
2010-12-05 08:41:55 +00:00
2963422173 Add screenshot location logging w/ rendered console message. Rendered messages are hidden before screenshot is taken. Fixes #675
This was SVN commit r8675.
2010-11-21 01:25:16 +00:00
5d764f1435 Run network server in a separate thread, to minimise latency.
Make some parts of logger and console thread-safe.
Simplify console: remove special commands; remove prefix for script
commands.
Remove LOG_ONCE, to simplify logger.
Change some code to use the new logger interface.
Fix OOS when revealing map.
Clean up some formatting.

This was SVN commit r8511.
2010-10-31 22:00:28 +00:00
9b9e4fa1b4 Support Unicode reliably in logger, via explicit conversion to UTF-8.
Expand date buffer to avoid Y10K bug, Y100K bug, etc.

This was SVN commit r7694.
2010-07-05 00:03:10 +00:00
1c0536bf08 # Refactored the networking code, and redesigned the game setup screen.
Major updates to most network classes.
Simplify CNetServer so it doesn't duplicate any client behaviour; all
players now run CNetClient.
Remove most player/slot management from networking code.
Wait for all players to finish loading before starting the simulation.
Remove CGameAttributes; attributes are now just a JS object.
Remove CPlayer; they are now just simulation entities.
Handle player colours via simulation system.
Add a default map for Atlas, so it always has something to load.
Move network documentation to Doxygen.
Remove lots of now-unused code.

This was SVN commit r7653.
2010-06-30 21:41:04 +00:00
dfb10c8209 # Various networking code cleanups.
Don't flush network queue after every message.
Desingletonify CGameAttributes to allow testing.
Make network server/client basically testable.
Add very basic tests for network server/client.
Fix FsmActionCtx memory leak.
Split CNetHost into a separate file.
Convert CNetHost, CNetSession to a more conventional coding style.
Delete CNetLogger, since it's a lot of complexity and is barely used and
is redundant with CLogger.
Other minor simplifications.

This was SVN commit r7623.
2010-06-07 22:19:05 +00:00
5982c07002 Support multi-line messages in log display.
This was SVN commit r7611.
2010-06-05 22:22:21 +00:00
65cf204423 Display warnings and errors on screen for a short time (fixes #119).
Add warn(), error() functions for simulation scripts.

This was SVN commit r7600.
2010-05-31 22:44:59 +00:00
77d2c67ada misc. string fixes
convert remaining %s to %hs or %ls
use WPRINTF_ARGS on unicode printf functions
fix: __func__ can't be widened via preprocessor (-> revert to char*)
convert remaining external_[directory|file_string to string()
Util: don't mix fwprintf and fprintf
Formation: fix dangling pointer (storing result of c_str())

This was SVN commit r7164.
2009-11-04 15:29:28 +00:00
8a52113e60 huge cleanup and conversion of most string handling (especially paths) to unicode
please note: format strings must be %hs for char* arguments and %ls for
wchar_t*

This was SVN commit r7161.
2009-11-03 21:46:35 +00:00
d83945e1e7 Annotate functions that have printf-style format strings, for compile-time type checking (see #293)
This was SVN commit r7072.
2009-08-04 13:31:41 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
Zyi
6822796a95 Simplified the logger:
- Removed the configurable interestingness from system.cfg.
- InterestingLog contains all warning and errors now.
- Modified and implemented methods in CLogger to write messages,
warnings and errors to the log.
- Modified a warning in CLocale so that the log wouldn't get spammed.

To do:
- Modify all of the logging statements in the source code.
- Remove the current preprocessor directives LOG_INFO, LOG_WARNING and
LOG_ERROR so that they can be used to log messages.

This was SVN commit r6817.
2009-04-11 22:53:33 +00:00
b51353ae0b Use NONCOPYABLE macro, to avoid ICC warnings
This was SVN commit r6589.
2009-01-03 18:40:28 +00:00
5228800b73 # Fixed Linux build
Use noncopyable instead of boost::noncopyable. (But maybe this should be
changed to the NONCOPYABLE macro instead?)
Use boost::filesystem::wpath::file_string instead of
external_file_string, since the latter varies between std::string on
Linux and std::wstring on Windows.
Use wcstombs instead of wcstombs_s.
Use rtl_AllocateAligned instead of _mm_malloc.

This was SVN commit r6574.
2009-01-02 21:19:41 +00:00
b979033385 Stopped CLogger outputting error messages with debug_printf while in test cases that are intentionally triggering errors.
This was SVN commit r6259.
2008-07-19 19:02:27 +00:00
5529977ecd fix: CLogger's ELogMethod is now inside the class and does not use names that are vulnerable to macro destruction (fixes a conflict with Windows system header's #define ERROR)
This was SVN commit r5532.
2007-12-29 16:22:23 +00:00
f5a2a141dc Fixed non-PCH compiles.
Removed a few global variables from Atlas.
Added call to srand(time).
Restored NotebookEvent in wxJS.
Fixed CPU-detection in Valgrind.

This was SVN commit r5318.
2007-09-02 23:38:58 +00:00
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
be3f3bdbfb # SwEng / MacOSX compat
further cleanup to sysdep.h: avoid pulling in win and ia32; split header
up into stl, compiler, and the actual sys_* API. (all but the latter are
in PCH).

timer: also avoid dragging in ia32
win: move snprintf fix to posix.h
cpu: simplify reasoning about cores, now given as logicalPerCore (not
package)
vfs_optimizer: fix if archive building is partially disabled

This was SVN commit r5008.
2007-04-30 14:35:19 +00:00
d2935684ff Collada: Integrated skeleton XML with game. Added some tests. Fixed memory leak when loading ill-formed XML.
Added TestLogger, so tests can check the right log messages were
produced.

This was SVN commit r4960.
2007-03-16 23:32:10 +00:00
27b6ffe2d6 # housekeeping
sorry, update-workspaces + rebuild is necessary (moved boost/utility
into PCH)

- ps/ : committed additional documentation on behalf of Joe.
- lib/ : HAVE_C99 - replace with specific e.g. HAVE_NPRINTF; intended to
help with MacOSX compat (by no longer requiring us to lie about
STDC_VERSION)
- NO_COPY_CTOR -> boost::noncopyable

This was SVN commit r4825.
2007-02-01 01:34:17 +00:00
8b7d1fcfb3 * Moved command-line options list from system.cfg into readme.txt. Updated the list to reflect reality. Removed -novbo option because you can use the .cfg file instead.
* Changed log files to trigger standards mode in Firefox (to be
consistent with other browsers), by making it valid HTML5. Changed the
font and some spacing.
 * Made CLogger default to ignoring messages if it hasn't been
initialised yet, instead of crashing.
 * Added leak reporting to the unit tests.
 * Renamed mods/_tests to mods/_test.xero, since it's only used by
Xeromyces and the other tests use mods/_test.otherstuff instead.
 * Fixed Atlas compilation on Windows.
 * Moved Atlas's DLL-loading code into a separate class, so it can be
shared.

This was SVN commit r4707.
2006-12-20 03:09:21 +00:00
2fac02f40a # Actor Viewer tool: added controls to toggle shadows, ground and polygon counts.
Elsewhere:
Disabled stack-trace test because it gives me assertion failures.
Fixed some uses of snprintf (which doesn't always add a \0 to the end of
the string), then got bored so there are still lots of broken ones.
Probably should replace snprintf with something more like snprintf_s
(but non-fatal) or something.
Made CLogger output valid HTML (except for the potentially dodgy
doctype). Removed its memory-logger, since we never use it and MICROLOG
can be used instead for quick execution-tracing.
Added tests to make sure CLogger handles long strings properly (which it
didn't). Made CLogger not a singleton, so it can be tested sensibly.

This was SVN commit r4424.
2006-09-28 20:41:12 +00:00
90bfaf9c99 # housekeeping + bugfix in file trace recorder
entity.cpp: fix indenting (was using space instead of tab)
replace all instance of & operator=( with NO_COPY_CTOR
trace: fix bug reported by michael: if trace file is huge, indices would
keep on being recorded but data was cut off after a certain limit,
leading to invalid pointers (into garbage data)

This was SVN commit r4158.
2006-07-21 01:11:23 +00:00
3d26549032 Fixed file properties - removed svn:executable and svn:keywords (left over from CVS conversion?) from all files; set svn:eol-style=native for *.cpp, *.h (and fixed files with inconsistent line endings)
This was SVN commit r3802.
2006-04-23 23:14:18 +00:00
a69ac0dee9 - fix w4 warnings
- add convenience macros for config_db(CFG_GET_SYS_VAL)
- VFSUtil::EnumDirEnts now uses flags instead of bool recursive
- UNUSED() for params, UNUSED2 (<- need better name) for variables
- config.h defines must be tested with #if (always defined) -> allows
detecting misspellings thanks to compiler warnings
- replace debug_assert(0) with debug_warn (its sole purpose)
- replace ScriptingHost::ValueToInt et al with ToPrimitive
- use nommgr.h to disable both mmgr and VC debug heap

This was SVN commit r2585.
2005-08-09 15:55:44 +00:00
dd3c8f6fb5 Use the standard Singleton for CLogger, to fix problems with unordered shutdown
This was SVN commit r2383.
2005-06-13 19:31:48 +00:00
MarkT
793794649f Combat code, some scripting, broken network, and fixed some bugs.
This was SVN commit r1301.
2004-11-11 07:09:32 +00:00
97777fe688 LOG_ONCE, to avoid flooding the log with the same message every frame
This was SVN commit r1067.
2004-08-27 17:41:02 +00:00
0037a0c6c0 Now allows categorised logging with user-configurable interest levels. By default, all errors and warnings are 'interesting' (reported in interestinglog.html and the console), and system.cfg lets you alter your interest in particular categories.
This was SVN commit r993.
2004-08-15 20:57:04 +00:00
fc476e04f6 stomped on numerous warnings
This was SVN commit r584.
2004-06-21 16:29:47 +00:00
d736ac7026 CLogger Initial Commit
This was SVN commit r206.
2004-04-14 21:52:59 +00:00