Commit Graph

40 Commits

Author SHA1 Message Date
43137fef3f Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c).
Differential Revision: https://code.wildfiregames.com/D716
Refs 09e974e1cb
Reviewed By: bb
Change in agreement with leper.

This was SVN commit r19899.
2017-07-10 14:26:24 +00:00
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
bd53e9d736 Remove unused ah_translate code.
This was SVN commit r16881.
2015-07-27 01:08:15 +00:00
4663ac0fe7 split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
2011-04-30 13:01:45 +00:00
0999ba0941 refactoring:
- simplify sys_get_executable_name interface - return OsPath directly,
rename to sys_ExecutablePathname
- add validation of path components in GetDirectoryEntries
- replace multiple calls to GetModuleFileNameW with
sys_ExecutablePathname
- lift nearly all MAX_PATH limitations (required at work)

This was SVN commit r9109.
2011-03-23 16:14:47 +00:00
64a02932e3 refactor headers: path_util -> path, native_path -> os_path, remove where unnecessary
This was SVN commit r9108.
2011-03-23 14:43:35 +00:00
dcd192cb60 refactor path interface:
- use wrapper class instead of std::wstring (reduces mixing of
strings/paths; allows safe+easy join via operator/ and convenient
case-insensitive comparison via operator==, avoids NativePathFromString,
similar to boost::filesystem)
- NativePath -> OsPath
- add hash and To/FromJSVal for Path
- add TS_ASSERT_PATH_EQUALS
- replace _wfopen_s with sys_OpenFile
- remove obsolete SortFiles/Directories

This was SVN commit r9107.
2011-03-23 13:36:20 +00:00
6d25329412 # towards locale-independent pathnames on Linux
c.f.
http://www.wildfiregames.com/forum/index.php?showtopic=14541&st=0&p=217250&#entry217250
and 2011-03-19 meeting

This was SVN commit r9090.
2011-03-21 17:53:13 +00:00
8f59d52697 sync with work; fix compile error due to lack of boost/serialization in 0ad svn
This was SVN commit r8965.
2011-02-21 09:23:51 +00:00
ba2a9d7af3 improvements from work: [update-workspaces required]
- split precompiled.h into several headers (simplifies reuse)
- enable additional warnings not in W4
- split ErrorReaction into ErrorReactionInternal - clarifies which
values can actually be returned by debug_DisplayError
- wsdl: slightly safer HDC usage via CS_OWNDC, avoid dipping into DC
cache via ValidateRect instead of BeginPaint; remove unused thread
create
- StdDeserializer - wasn't including byte_order => BYTE_ORDER was
undefined
- wsysdep: clean up error dialog message handling

This was SVN commit r8828.
2010-12-09 11:16:21 +00:00
9f6eb626b4 Fix reported build errors
This was SVN commit r7792.
2010-07-23 19:11:02 +00:00
1861448e6c needed to split lib into separate headers and source files, which requires lots of drudgery to specify paths for each include filename (no longer relying on same-directory lookups)
also rename wchar -> utf8 to avoid conflict with <wchar.h> (requires
rebuild of workspace)
(unfortunately copying history fails to "502 bad gateway"; had to delete
old + add new independently)

This was SVN commit r7340.
2010-03-01 14:52:58 +00:00
c2fd939898 license change to the more permissible Expat/MIT license for lib/ (see forum thread)
This was SVN commit r7316.
2010-02-08 16:23:39 +00:00
a444e6febc Don't use wide print functions on typically-byte-oriented streams
This was SVN commit r7198.
2009-11-14 11:03:43 +00:00
f432d9d18b fix dehydra warnings (some of which were dangerous pass-user-string-as-format-string vulnerabilities)
This was SVN commit r7177.
2009-11-07 09:32:19 +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
1743645fd3 Simplify the overly-complex CppDoc-breaking file headers
This was SVN commit r6832.
2009-04-18 17:51:05 +00:00
214b0e6683 Removed outdated licensing information
This was SVN commit r6831.
2009-04-18 17:17:34 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
c4654fd8fa bits: avoid sign conversion warning
debug: cleanup
ogl_tex, tex: use full-width types to avoid truncation warnings
wdbg_sym.cpp: skip __suppress and __profile symbols; add additional hex
display for floats; cleanup
wdll_ver.cpp: cppdoc+cleanup (remove non-reentrant C interface, replace
with std::string)
sysdep: add cppdoc

everything else: flag parameters are now consistently size_t instead of
int (avoids warnings, allows slightly better code on x64)

This was SVN commit r6392.
2008-09-18 11:27:55 +00:00
c0ed950657 had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).

it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.

after several hours, the code now requires fewer casts and less
guesswork.

other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.

This was SVN commit r5942.
2008-05-11 18:48:32 +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
38755cc589 # improvements to app_hooks
thesis pointed out more dependencies that had to be stomped on.
0ad-specific apphooks are now in pyrogenesis.
added function AH_IS_DEFINED (useful for ogl_tex, which now has its own
default version of a hook)

This was SVN commit r4765.
2007-01-13 18:37:51 +00:00
0bb0df5b2c # new year's cleanup (reduce dependencies, clean up headers)
- remove headers always included from PCH
- nommgr.h is only included ifdef REDEFINED_NEW (allows leaving out the
mmgr stuff)
- in lib/*.cpp, moved the corresponding include file to right behind the
PCH (catches headers that aren't compilable by themselves)
- byte_order no longer depends on SDL
- add debug_level (another means of filtering debug output; needed for
thesis)
- split posix stuff up into subdirs (lib/posix and sysdep/win/wposix).
makes including only some of the modules (e.g. sockets, time) much
easier.

This was SVN commit r4728.
2007-01-01 21:25:47 +00:00
05aadf1f12 # SwEng: remove X-macros from app_hooks (confused static code analysis)
This was SVN commit r4372.
2006-09-21 12:06:56 +00:00
35e91718c5 # Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.

This was SVN commit r4261.
2006-08-28 17:36:42 +00:00
600adac871 # housekeeping and bugfix in Loader queue
remove old instrumentation, fix warnings, add measured timing results
Loader: bugfix: no more memory leak whenever callback returns a warning
code. this was a loophole in the callback return value docs.

This was SVN commit r4048.
2006-06-29 22:52:50 +00:00
77faccb6cb # small fixes.
add translate_free (avoids mem leak in translate API)
debug: when skipping errors but an unexpected one is raised, trigger a
warning.
test_archive_builder: properly clean up archive; decrease number of
files to speed things up.

This was SVN commit r4035.
2006-06-25 15:35:28 +00:00
7cb82ada2f # lots of housekeeping/fixes
premake: document extra_params
ogl: remove EXT_ symbols, use glext instead
adts: move cache into separate file (also remove old cache impl)
move SDL files in sysdep/win to libraries/SDL
ScopeTimerAccrue: change #ifdef spaghetti into templated policy class
app_hooks, define VOID_FUNC to FUNC(.., (void) )
look at stalk walk code; any reason not to work on Win64?
replace ERR_TEX_CODEC_CANNOT_HANDLE with INFO_* - not an error. also
ERR_SYM_SUPPRESS_OUTPUT ERR_SYM_SINGLE_SYMBOL_LIMIT
wdbg_sym: only import RtlCaptureContext once (not every walk_stack)
add sys_last_error (!GetLastError on win32); converts to text in
display_error, also show sys_last_error and errno
app_hooks: move i18n impl out (belongs in pyrogenesis)
fixes to string_s test.

refs #124

This was SVN commit r4020.
2006-06-23 17:41:55 +00:00
ee4c7965dd # merge all local changes; moving over to new SVN server
* app_hooks: add display_error; can be used by atlas to override our
dialog box
* lots of small fixes (mostly pertaining to headers)
* debug: clean up display_error, protect from reentrancy, fix a few edge
cases (e.g. error message from dtor -> exit pressed -> suppress all
subsequent errors)
* delay_load: add warning: NLSO ctors are unreliable since we're
compiling into static lib

This was SVN commit r4009.
2006-06-22 18:26:08 +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
836cd08d5e # add CppDoc file header to all files, along with their descriptions.
also:
- renamed wdll to delay_load, and wdll_ver to dll_ver
- removed empty wcpu

This was SVN commit r3751.
2006-04-11 23:59:08 +00:00
34637ba5dc # refactor sysdep API, split it into parts
- split up detect.cpp into snd, cpu, gfx (headers were already split)
- rename detect functions for more clarity (e.g. get_cur_vmode ->
gfx_get_video_mode)
- rename lib/res/sound/snd to snd_mgr to avoid conflict with
sysdep/snd.cpp
- waio: set errno in aio_rw (addresses bug #73)

This was SVN commit r3745.
2006-04-10 20:12:25 +00:00
c4e3037e60 adts: add LL_OPT_* defines that enable optimizations (some only make sense if there are tons of files, and need to be able to disable them for thesis). realized this would be perfect application of policy template classes, which will replace this.
fix crashdumps: was failing to write out to file (underlying cause:
current directory no longer being set)
app_hooks: add get_log_dir; used by debug and wdbg_sym

minor improvements/documentation in archive+compression+file_cache+zip

main: remove dead ScEd code

This was SVN commit r3498.
2006-02-11 22:49:09 +00:00
034985c71f app_hooks.cpp: Remove "inline" from ah_xyz functions (gcc doesn't export
those functions when inline).
debug_putws converts to non-wide characters before printing.

This was SVN commit r2993.
2005-10-24 01:43:37 +00:00
a953a8ef57 debug_assert now displays function name also. this neatly avoids the need for __func__ in every debug_warn, which also breaks on Linux. all such constructions have been removed.
This was SVN commit r2968.
2005-10-19 06:29:55 +00:00
b17fbf003d -move app-specific stuff out of lib/ and into "hooks". see new lib/app_hooks* (note X macro goodness)
-move tex_codec stuff out of tex.cpp and into tex_codec.cpp
-tex_codec: use linked list of codecs instead of array (simplifies code
and removes limit)
-ogl_tex: add override mechanism for s3tc/automipmapgen extension detect
-tired of keeping of debug_warn text in sync with function name; now use
__func__ everywhere (and emulate that with __FUNCTION__ on MSC)
-add ONCE_NOT (opposite of ONCE)
-fix 3!! stupid bugs in ia32_control87, its caller and the header that
were canceling each other out. float exceptions now enabled except for
"inexact result" (too common). (update: nicolai had already fixed 2 of
these)

This was SVN commit r2964.
2005-10-19 03:06:54 +00:00