1
1
forked from 0ad/0ad
Commit Graph

49 Commits

Author SHA1 Message Date
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
ebac85ee81 # hopefully support non-admin accounts and unwritable directories by moving output folders to home/appdata
the old behavior (using directories under binaries/) can be kept by
passing -writableRoot on the command line.
the first game load will be slower than usual due to re-creation of
cached XMBs.

This was SVN commit r7065.
2009-08-02 11:07:42 +00:00
c8cfd8b40b # groundwork for separated data/cache etc. directories (XDG)
remove path.cpp (it was based on the premise that all data files lie
below binaries/data)

This was SVN commit r7063.
2009-08-01 19:37:38 +00:00
7976d84a3d Remove external resources and make log files standalone, to simplify installation
This was SVN commit r7062.
2009-08-01 18:16:12 +00:00
cdfb58a62f Fix some more GCC warnings
This was SVN commit r7045.
2009-07-28 09:27:56 +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
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
b0a6d6dca8 committing the current status of dacian's new network code on matei's request
also includes sound support.

GameSetup: ensure all ScriptingInit are called; moved simulation
ScriptingInits and init/shutdown to SimulationScriptInit.cpp (reduces
#includes)

This was SVN commit r6028.
2008-06-16 18:19:35 +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
e2eb5b2610 part4: adapt codebase to changes in lib/
mostly straightforward except for CVSFile / Filesystem. moved the former
into the newly created latter component. removed VFSUtil entirely (that
functionality is available from lib/file/file_system_util.h)

Xeromyces.cpp: simplify buffer handling since smart pointers are now in
play. also use WriteBuffer instead of membuffer.

This was SVN commit r5519.
2007-12-20 20:21:45 +00:00
a34b759720 . split up lib.h/.cpp, include the remnants from PCH, remove (pretty much universal) include of it.
. timer, config: fix definition of ALLOW_RDTSC
. add movsx_be64 (for whirlpool), revise implementation, move to
byte_order, add test
. MAX -> std::max, remove those macros
. add timestamp to system_info as requested by philip

This was SVN commit r5050.
2007-05-09 21:01:11 +00:00
5a427440d0 #SwEng
fpclassify fix
EntityManager: rename getExtant -> GetExtantAsHandles, fix its
implementation+call site to avoid dynamic alloc/auto ptr, rename extant
-> IsExtant
vsnprintf2 -> sys_vsnprintf. remove printf.h (function is declared in
sysdep header)
use SUS/posix-ish strcasecmp instead of defining that to the
windows-only stricmp
add cppdoc for ia32/cpu

This was SVN commit r5011.
2007-04-30 19:58:04 +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
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
13f2e3ca0c Tried compiling with ICC9 on Linux, which raised various issues:
* Fixed some bugs with incorrect macro usage (SDL_BYTE_ORDER vs
SDL_BYTEORDER, {MSC,GCC}_VER vs {MSC,GCC}_VERSION, OS_WIN/OS_UNIX in
projects where they're not defined).
 * Removed some redundant declarations of g_Console.
 * Removed some unnecessary semicolons.
 * Removed some unused variables.
 * Added throw specification to operator new.

This was SVN commit r4698.
2006-12-16 01:01:15 +00:00
a265a441fd # Fixed string handling for Windows/Linux compatibility.
* vsnprintf2: Made compatible between GCC and MSVC - it now always
null-terminates the buffer, and returns -1 on overflow. Fixes #158.
Added tests.
 * MeshManager: Use shared_ptr.expired() instead of checking for
bad_weak_ptr exception.
 * Xeromyces: Added tests for GetXMBPath, because it does unusual things
in sscanf which MSVC's /analyze complains about.
 * ConfigDB, ScriptGlue: Replaced some asserts with return-on-failure,
to avoid invalid array accesses when continuing after the assert (as
complained about by /analyze).
 * CStr: Removed "using namespace std". Added tests for handling of
invalid UTF-8.

This was SVN commit r4625.
2006-11-07 21:03:13 +00:00
de0f893c18 Recompiled Premake on Windows. Added some headers so HAVE_PCH=0 works in MSVC.
This was SVN commit r4442.
2006-09-30 21:36:19 +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
5f7855f7f0 Simplification of #Include paths: relative names are used only for included files in the same directory as the including file; everything else uses the full path relative to source/.
This was SVN commit r3930.
2006-06-02 02:10:27 +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
01700f0e9f # refactor VFS path-related functions; split into separate files
- replace all hardcoded strrchr functions (used to get extension / file
name only) with path helper functions (found a few bugs in the process)
- split VFS-independent path helper functions into lib/path_util (allows
including by other files without pulling in entire VFS)
- renamed pp_* functions path_package_*
- split remaining path helper functions into lib/res/file/path
- vfs: split should-reload logic out of vfs_reload_changed_files

- lib: add comments to rand/xrand

This was SVN commit r3796.
2006-04-22 16:26:16 +00:00
0e40dfc480 file: add note on pp_set_dir
CLogger: fix log file opening (now uses VFS path correctly)
ScriptingHost: fix error reporter - no longer does redundant write to
console

This was SVN commit r3246.
2005-12-14 18:32:02 +00:00
b6dfb8174f fix 64bit bug: wsdl defined SDL_Event.user.code as intptr_t, but real SDL doesn't. brought that in line and fixed GUIHotkey code.
config: proper detect for clock_gettime

file: file_rel_chdir -> file_set_root_dir; it no longer changes current
directory; instead, root dir is prepended to all paths (not that bad
perf-wise)

netlog: avoid a CRT assert if log file open failed. now that current dir
is no longer being set, we need to think about what will happen to the
logs - they either need to use file_make_full_native_path, or use the
entire file.cpp interface instead of fopen etc.

This was SVN commit r2936.
2005-10-13 19:11:22 +00:00
2ea40a23a3 VS2005 compatibility fixes and warning adjustments:
Updated DLLs.
Added DirectX headers/libraries, since they're not in the platform SDK.
Fixed invalid STL iterator usage.
Disabled STL in stack trace, since it breaks.
Added comments for some reported warnings.
Corrected some apparent off-by-one errors.
Defined strlen_s to strnlen.
Probably broke pre-beta2 versions of VC2005.

This was SVN commit r2454.
2005-07-02 21:42:55 +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
b657a1cbca Added CStr and some other things to precompiled.h, to reduce build times.
Altered CStr/UniDoubler's macros, to avoid polluting/conflicting/etc.
Fixed headers in non-PCH builds.
Used the _d version of vorbisfile*.lib in Debug builds.

This was SVN commit r2366.
2005-06-01 20:12:45 +00:00
fd4eb91e93 debug_out -> debug_printf; MICROLOG moved to ps/Pyrogenesis.h
This was SVN commit r2285.
2005-05-11 18:56:30 +00:00
2b33ba8ade security push: checked every strcpy / strncpy. converted most to strcpy_s; some are flagged as "safe" (e.g. if copying literal that's obviously OK)
This was SVN commit r1962.
2005-03-01 20:13:00 +00:00
ad16ecfb36 fix bug: was assigning char to pointer, instead of writing to *pointer
This was SVN commit r1768.
2005-01-23 17:36:57 +00:00
6787a32b3c potential vsnprintf buffer overflow
This was SVN commit r1179.
2004-09-21 14:35:30 +00:00
dbee9e74fd Fixed lack of termination when log messages exceed 512 chars
This was SVN commit r1148.
2004-09-17 23:13:38 +00:00
880b768abd Noticed "Engine exited successfully on " << __DATE__
This was SVN commit r1069.
2004-08-27 18:47:14 +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
506b283844 Now actually uses IsInitialised() correctly, to avoid crashing when logging messages before the config DB is loaded
This was SVN commit r1037.
2004-08-24 11:05:41 +00:00
ac8cfef8d0 bugfix: was memsetting the memory log /stream/, not buffer. while at it, we just alloc via calloc
This was SVN commit r1013.
2004-08-18 01:51:23 +00:00
589106ae1c increase memory buffer size (due to boundschecker overrun warning)
This was SVN commit r1012.
2004-08-18 01:32:05 +00:00
d41cdc4dff Allow NULL categories, and make them very interesting
This was SVN commit r996.
2004-08-15 21:10:49 +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
65ec0b468d Added vsnprintf2, a wrapper around vsnprintf to make it more gcc-like (allowing %lld, %1$d, etc)
This was SVN commit r944.
2004-08-09 15:44:35 +00:00
b61b1e805c Better error handling! Wow!
This was SVN commit r778.
2004-07-19 19:05:34 +00:00
4b87f4bbca Avoid some potential crashes
This was SVN commit r716.
2004-07-12 12:25:27 +00:00
ca5b760310 Linux/GCC: Changed a whole bunch of wide character format strings... In VC++,
the wide printf functions default %s to be a wide string. GCC defaults
it to
a narrow string. Everything I could find uses %ls or %hs as appropriate
now.

This was SVN commit r715.
2004-07-11 22:30:08 +00:00
f2dc64e75d Send log messages to the console
This was SVN commit r704.
2004-07-11 16:03:26 +00:00
e0fab05437 Make errors more noticeable when debugging
This was SVN commit r610.
2004-06-28 15:30:15 +00:00
c7a84e84be added precompiled.h everywhere
This was SVN commit r392.
2004-06-03 18:38:14 +00:00
0f02c697c4 fixed path to log file
This was SVN commit r295.
2004-05-29 16:36:28 +00:00
d736ac7026 CLogger Initial Commit
This was SVN commit r206.
2004-04-14 21:52:59 +00:00