Commit Graph

148 Commits

Author SHA1 Message Date
0d23e3f333 post-alpha sync with work.
debug stack trace fixes, remove more asm, change CONTINUE/OK scheme to
OK/ALL_COMPLETE, fix tests

This was SVN commit r9871.
2011-07-18 09:21:56 +00:00
034881d30c sync with work. simplify wnuma, refactor+fix topology (bugs: APIC IDs array didn't correspond to OS processor number; couldn't handle noncontiguous APIC ID field values)
This was SVN commit r9580.
2011-05-30 13:00:20 +00:00
34186dd017 refactor file interface. requires workspace update
- separate file_system_util into vfs functions (-> vfs/vfs_util) and
file_system (avoids ugly fs_util namespace prefix)
- get rid of non-portable O_BINARY_NP etc. flags
- use standard O_WRONLY etc. flags instead of LIO_WRITE; but avoid the
need for specifying O_CREAT|O_TRUNC
- only open files for aio when O_DIRECT is specified (which 0ad does
not) - avoids wasting time and security issues
- return file descriptor directly instead of via output param
- waio: safer FCB mechanism that avoids mixing descriptors between lowio
and aio

This was SVN commit r9550.
2011-05-25 10:39:13 +00:00
f608b44d1d fix self-test and map load on Windows (avoid mixing dir separators).
add more specific error codes (used at work)

This was SVN commit r9462.
2011-05-06 18:45:30 +00:00
5c76bc12fa refactor status code definitions: allow modules to define an array of them (more convenient+efficient).
merge ERR::NO_SYS, NOT_IMPLEMENTED into NOT_SUPPORTED
renderer: remove unnecessary ogl_shader include

This was SVN commit r9447.
2011-05-05 13:03:34 +00:00
dcec9c4ca9 gracefully handle the case where the file cache is full of data still referenced elsewhere.
fixes #832

This was SVN commit r9437.
2011-05-04 22:19:38 +00:00
7523894760 ENSURE(0) -> DEBUG_WARN_ERR(ERR::LOGIC) (a bit smaller, and more descriptive)
This was SVN commit r9423.
2011-05-04 12:10:17 +00:00
cccd6849a7 cleanup (requires update-workspaces)
lib_errors.cpp: replace with status.cpp, adapt to needs at work
wutil: fix runtime warning reported via feedback box
config: merge CONFIG_PARANOIA and !CONFIG_FINAL into
CONFIG_ENABLE_CHECKS
add openmp, pointer_typedefs.h

This was SVN commit r9410.
2011-05-03 12:38:42 +00:00
1636f062a3 make VFS thread-safe, per long-standing request by Philip
This was SVN commit r9369.
2011-04-30 15:57:43 +00:00
635c2a12e2 add error code for file not found. return error code from io::Load, warn and return from io::Store (both without triggering assertions).
remove out of date comment in io.cpp
fixes #811

This was SVN commit r9368.
2011-04-30 15:41:19 +00:00
5ca66fc757 cleanup: move ADTs into lib/adts (separate files). fix definition of ASSERT
This was SVN commit r9364.
2011-04-30 13:35:36 +00:00
0720025073 cleanup
reduce dependency on PCH. move KiB constants to alignment, ARRAY_SIZE to
code_annotation.h.
move glext_funcs.h to external_libraries/glext_funcs.h, move part of
ogl.h to external_libraries/opengl.h
remove unused saturating arithmetic functions

This was SVN commit r9363.
2011-04-30 13:22:46 +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
6c915291cc cleanup (requires update-workspaces):
major refactor of wfilesystem - remove gotos and workaround for FAT file
times
replace more round_up of constants with Align<>
remove old unused allocators (STL aligned, matrix, some shared_ptr)
move allocator utils into separate headers.
remove lockfree, wterminal
avoid testing __cplusplus

This was SVN commit r9361.
2011-04-30 12:34:28 +00:00
9bdb54bc76 fix failure to preallocate disk space on Windows by always rounding up the file size regardless of the io::Parameters
This was SVN commit r9358.
2011-04-30 09:13:10 +00:00
f22e40b64c Fix warning
This was SVN commit r9354.
2011-04-29 23:55:47 +00:00
34ba390a0d build fix for pre-C++0x compilers.
archive_zip, stream: work around possibly missing support for
std/tr1::bind in GCC by defining a functor manually
also renamed RVREF to RVALUE_REF and ensured RVALUE can convert from
both lvalue and rvalue.
io: avoid dodgy constants and possible overflow by using blockSize=0 to
indicate "don't split"

This was SVN commit r9352.
2011-04-29 22:55:35 +00:00
1139124451 Fix some build errors and warnings
This was SVN commit r9351.
2011-04-29 20:38:13 +00:00
2374caac3e major refactor of file/io and alignment code. requires update-workspaces
. completely rewrite waio - use IOCP, add several hardcore
optimizations. now outperforms the
  AS SSD and ATTO benchmarks when writing
. refactor file interface - use LIO_READ instead of 'r', allow access to
file descriptor.
. completely rewrite the IO wrapper. now much more simple, less CPU
overhead, adds
  support for pre-issue/post-completion hooks and preallocation.
  io::Run defaults to simple synchronous IO; use io::Parameters to get
asynchronous.
. add alignment.h with constants and Align() function template (more
efficient than
  round_up for compile-time constants)
. add UniqueRange - similar to C++0x unique_ptr (emulated for C++03),
plus a
  built-in size. avoids expensive thread-safe reference counting in
shared_ptr.

cleanup:
- move fat_time functions into archive_zip
- remove no longer needed io_align and block_cache
- reduce dependencies in sysdep/compiler (move parts to
code_annotation.h)
- move IOCP into separate file (reused by waio)

This was SVN commit r9350.
2011-04-29 19:10:34 +00:00
3d21cf98f9 better aio error checking / avoid unnecessary repeated calls to aio_error (investigated on the occasion of the recent Linux aio trouble)
This was SVN commit r9155.
2011-04-03 20:07:55 +00:00
01a0825c94 disable aio on linux until the glibc aio implementation and/or kernel is fixed (see http://www.wildfiregames.com/forum/index.php?showtopic=14561&pid=217711&st=0&#entry217711)
This was SVN commit r9150.
2011-04-03 19:07:35 +00:00
c396997009 fixes from work: avoid potential 0-pointer dereference in freelist, also avoid branching in freelist functions via sentinel
wdll_main.h: avoid warning for DLLs using TLS
file_system_util.h: export functions

This was SVN commit r9128.
2011-03-28 12:28:29 +00:00
1eb5eeb225 minor fixes from integration with working copy at work.
This was SVN commit r9116.
2011-03-24 09:05:06 +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
c3405e6f50 path improvements/fixes:
- replace more std::wstring with Native or VfsPath; wstring_from_utf8 ->
NativePathFromString
- replace sequences of Join(Path(), Basename+extension) with
ChangeExtension in wsdl, CacheLoader
- add Path::IsDirectory to replace .empty() / path_is_dir_sep(.back()).
also changed behavior to reflect the fact that "" is the VFS root
_directory_
- Path::Join now allows 2 identical path types (e.g. VfsPath) or one
char* literal (prevents inadvertently introducing non-safe characters).
to convert from wstring or wchar_t, use an explicit ctor (e.g.
VfsPath(wchar_t_string))

This was SVN commit r9091.
2011-03-21 19:54:08 +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
f6c1d98c9a Fix #739 (test failures).
Use JSON in debug serializer output unless it fails due to e.g. cyclic
values, in which case use toSource.
Disable file stats code by default, since its output isn't used.

This was SVN commit r8975.
2011-02-24 00:32:38 +00:00
1a2a7677fd replace set/map with boost::unordered_* to reduce the number of expensive filesystem::basic_path::operator< calls based on a patch by ortalo (thanks!)
This was SVN commit r8947.
2011-02-19 21:24:39 +00:00
fd46b9e370 fixes/improvements from work:
file/wfilesystem: avoid error dialog when opening a file that doesn't
exist
precompiled/pch_warnings: remove push/pop that prevented our warning
disables to applying to other code. update comments
topology: refactor APIC field access and add support for constructing
APIC ID from topology
waio: add file_attribute_normal
wsysdep: slightly safer sys_generate_random_bytes implementation

This was SVN commit r8869.
2011-01-28 13:40:07 +00:00
4575c26616 Disable compression of public.zip (fixes #671).
This was SVN commit r8785.
2010-12-04 15:57:55 +00:00
6e74c53ee9 fix file/dir mode bits
fixes #648
also fix self-test on ICC 12

This was SVN commit r8558.
2010-11-08 15:02:05 +00:00
24f1a00190 avoid setting executable bit in files/dirs we create
thanks to fabio for reporting + a suggested fix.
fixes #648

This was SVN commit r8554.
2010-11-08 10:39:52 +00:00
52851faeb6 cleanup - remove old cpu_memcpy and cpu_i64FromDouble that are no longer needed
This was SVN commit r8517.
2010-11-01 11:09:03 +00:00
825bbf8f51 parallel studio 2011 warning fixes
This was SVN commit r8484.
2010-10-28 12:22:11 +00:00
a596323ea6 Avoid bogus GCC warnings about uninitialised values
This was SVN commit r8429.
2010-10-21 20:33:27 +00:00
c9cc7d9784 skip populating directories when mounting and scanning archives => reduces startup time by about half a second when archives are present.
also disable archive stats (currently unused) and refactor directory
creation/association logic.

This was SVN commit r8321.
2010-10-10 10:22:11 +00:00
7f0b055907 warn when VFS directory creation fails due to an existing file of the same name (was seeing a crash due to a Zip file I had created in the cache directory)
This was SVN commit r8316.
2010-10-09 17:53:25 +00:00
0d172264f8 # Add -archivebuild mode to generate .zip files for releases, with automatic compression of textures.
Fix terrain manager to understand .cached.dds files.
Fix IArchiveWriter so you can pass it absolute paths of files to load,
and different relative paths for storing inside the archive.
Fix fs_util::ForEachFile when called on the VFS root.

This was SVN commit r8130.
2010-09-18 18:21:00 +00:00
ad02ab726d Expose VFS file priorities.
This was SVN commit r8096.
2010-09-10 20:29:38 +00:00
5b7afe3606 Fix zip file detection.
This was SVN commit r8095.
2010-09-10 20:28:48 +00:00
c0c8132dd4 fix VFS real path retrieval for files mounted from multiple directories (e.g. mods)
closes #564
GetRealPath was too simplistic and just asked the directory *most
recently mounted* into the file's VFS directory for its path. the
correct solution is to ask the file's loader for its path. the archiver
IFileLoader new returns the archive's pathname as the real path.
also simplified VfsFile's interface.

This was SVN commit r8082.
2010-09-05 21:41:45 +00:00
014d504e3a Fix FAT-tolerant timestamp comparison
This was SVN commit r8075.
2010-09-04 16:46:10 +00:00
99d56959aa Fix #552 (compile with new boost (1.44+)), based on patch from Karlik
This was SVN commit r8043.
2010-08-29 12:44:13 +00:00
9fa5af5fbf Avoid crash when loading texture named "".
Report texture-loading errors.

This was SVN commit r8006.
2010-08-19 21:58:27 +00:00
08cdb0b9c2 Fix more --without-pch
This was SVN commit r7896.
2010-08-10 20:22:23 +00:00
e20f93ffdc add proper OGG support, a near-total rewrite of a patch by Kyniker/Heron. not yet integrated into snd_mgr. also remove the no longer used CMusicPlayer and CPlayList.
This was SVN commit r7834.
2010-08-01 10:52:12 +00:00
1706363bab Fix #423 (Switch from CppDoc to Doxygen), based on patch from anr.
Also delete some unused declarations, and rename is_playing to
snd_is_playing.

This was SVN commit r7813.
2010-07-29 15:55:41 +00:00
8d7011998e Fix typo
This was SVN commit r7804.
2010-07-25 11:24:44 +00:00