Commit Graph

1155 Commits

Author SHA1 Message Date
eaf12ae666 #fix to isnan() bug
big thanks to philip for seeing the problem! :D
cause: not popping FPU stack. didn't happen on my athlonXP presumably
due to different FPU usage (possibly in drivers): pushing 8 values could
clear the stack and mask overflow. the cause was not due to compiler
(and FLD/FSTP param passing) because Philip uses VC2005 as well, but saw
the crash (on P4 CPU)

fixes #130

This was SVN commit r4072.
2006-07-09 00:24:21 +00:00
f3b3e0be6e # big refactor of error display code. fixes crash in release-mode selftest
* debug_write_crashlog and debug_dump_stack are now responsible for
detecting reentrancy (reported via new ERR_REENTERED error code).
* export debug_error_message_build to allow unit test of stack dumper
* split+clean up debug_display_error to allow this.
* error_description_r now returns buf for convenience
* ia32: fix typo causing disassembly to fail
* wdbg_sym: bugfix causing incorrect debug_walk_stack return value.
prevent recursive locking, provide locked version of
debug_resolve_symbol. add skip_this_frame for convenience.

refs #130

This was SVN commit r4067.
2006-07-07 01:22:23 +00:00
dd6679b0b8 # fixes to string_s selftest
snd_mgr: fix cppdoc comments (got shredded by IDE autofmt)
string_s: disable WARN_IF_PTR_LEN (too many false positives)
test_string_s: add missing debug_skip_next_err (fixes complaints on
VC2003)

refs #130

This was SVN commit r4066.
2006-07-06 15:52:59 +00:00
a0e92ee51c # small fixes
ia32: fix overly zealous error return in ia32_get_call_target
sysdep: more correct definition of fpclassify() (takes into account
argument size)

This was SVN commit r4055.
2006-07-02 20:03:05 +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
aeed96dafa # improvements to build system for asm files
split ia32_asm code up into memcpy, color
premake: add (windows-only so far) support for NASM include paths -
required when using %include. see rationale in vs.c
refs #124

This was SVN commit r4039.
2006-06-25 20:58:03 +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
3b753a4df8 # add cppdoc
refs #122

This was SVN commit r4034.
2006-06-25 15:31:58 +00:00
45af5f0d4f # final self-test fixes; integration complete.
reinstate and fix archive_builder and compression tests.
file: add dir_delete
wdbg_sym: stack trace check is now silent.
Win32Gui: fix indentation

closes #117

This was SVN commit r4022.
2006-06-24 13:41:42 +00:00
7e3265899c # fix errors in self-tests and the code they test. all now run through.
(archive_builder and compression tests are disabled ATM)

also fixed some compile warnings inside cxxtest.

refs #117

This was SVN commit r4021.
2006-06-24 10:44:08 +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
8f50fe1ff8 # work on self-tests
add ignore-next-error feature, use it in string_s
refs #117

This was SVN commit r4011.
2006-06-22 19:12:10 +00:00
aeac009990 #merge (2)
path_util: add cppdoc
string_s: fix self test
wsock: fix initialization (no longer requires NLSO ctor, which doesn't
work)

This was SVN commit r4010.
2006-06-22 18:49:23 +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
92b9c07f95 Restoring SVN repository:
Greek basket texture

# New Greek vases

# housekeeping
documentation fix: trailing / in directory names is mandatory

# Atlas: Sky texture selection; save with maps

Atlas code tidying: Slightly nicer syntax for defining command handlers,
and some explanation of how it works

Automated build.

This was SVN commit r4008.
2006-06-21 22:37:31 +00:00
823c93ce47 # bugfixes (string, pthread, screenshot writing)
- CStr : early out if empty, don't deref iterator (crashes in VC8)
- init VFS In archive_builder test
- wpthread: avoid race condition when creating threads. cleanup; replace
debug_warn with error codes
- Util: file_buf_free wasn't specifying FB_FROM_HEAP ->
http://www.wildfiregames.com/forum/index.php?showtopic=10085

This was SVN commit r4006.
2006-06-11 17:16:24 +00:00
05b3867104 bugfix: base32 now 0-terminates output string
This was SVN commit r3982.
2006-06-08 21:47:06 +00:00
d0acaecc5c # housekeeping
fix warnings in self tests
make win_pre_main_init manually callable and remove the main() hook (see
rationale at decl of win_pre_main_init)

This was SVN commit r3981.
2006-06-08 21:27:03 +00:00
9542ecdd7e # boatload of fixes to get self-tests to compile+mostly run
refs #117

stub_impl_hack: defines a function otherwise provided by main.cpp

remove old self_test.h contents (e.g. TEST); superceded by cxxtestgen
TS_ASSERT etc.
only include self_test from a test (otherwise, cxxtest include dir won't
be set)
cxxtest won't run tests named only "test"; add more descriptive name

FIXES uncovered by self tests
lib: infinite loop in log2
lockfree: incorrect params

This was SVN commit r3979.
2006-06-08 19:03:43 +00:00
76cbda8713 This was SVN commit r3971. 2006-06-07 22:15:29 +00:00
570c248b92 The first test, and support file for it and future tests
This was SVN commit r3958.
2006-06-07 02:30:47 +00:00
b8c131c431 # housekeeping
* zip.h removed old test symbols
* path_util fixed bug in mixed-separating-slash handling
* renamed ERR_OK to INFO_OK; allows searching for "return ERR_" to yield
all actual errors (instead of having to filter out ERR_OK)

This was SVN commit r3945.
2006-06-04 22:27:40 +00:00
5814e10126 # complete revamp of build system in preparation for automated self tests.
* now splits everything up into independent static libraries.
* fixed a great deal of incorrect #include statements. all headers must
now be specified with their full path relative to source. exception: if
file being included and including file are in the same directory, no
path needed.
use <> when relying on the build system's include path (e.g. for system
headers and external libraries, e.g. boost), otherwise "".

* temporarily renamed maths/Vector2D to Vector2D_Maths to avoid
conflict. these should be merged.
* hacked around VC linker stupidness when building static libs; texture
codecs must now be registered manually.

This was SVN commit r3931.
2006-06-02 03:56:24 +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
9124f7266c Tidied up some include paths
This was SVN commit r3929.
2006-06-02 01:01:39 +00:00
e0dfbe719d # add boatload of self-tests
(these are the old self-tests ripped out as well as new ones)
note: have not run yet; several would surely fail if they run (can't
anyway until cxxtest is installed)

This was SVN commit r3912.
2006-05-31 04:17:45 +00:00
1ead202b24 # add CppDoc comments; prepare for automated testing
ia32: prepend CPUCap enum names and rdtsc with ia32 to avoid conflicts.
move all self tests into separate headers as required for Cxxtest.
adts: remove some dead code.

add CppDoc comments to debug, lib (with heavy cleanup), tex, tex_codec,
snd_mgr
slight improvements to path

tex: refactor; split out tex_decode and encode to allow self-test

This was SVN commit r3911.
2006-05-31 04:01:59 +00:00
e2ce59292d # bugfix in archive generator: avoid assert triggered for uncachable files
problem was FILE_CACHED_AT_HIGHER_LEVEL flag preventing a buffer from
being added to cache, which was causing trace_entry_causes_io to leak a
buffer it allocated. documented the entire problem thoroughly.

wdbg_sym: no longer complain if stack trace generation just ended up
returning a warning

This was SVN commit r3886.
2006-05-21 01:16:38 +00:00
2db8963039 # big VFS update: laid groundwork for running as non-admin; move XMB files into separate directory tree
^ actually that was last revision, but forgot this there :P

housekeeping/cleanup of smaller issues I noticed while working:
lib: add NO_COPY_CTOR macro
lib_errors: fix descriptions, rename
INFO_ALREADY_PRESENT->INFO_ALREADY_EXISTS

* refactor "is valid VFS dir" to VFS_PATH_IS_DIR macro
* remove some scaffolding
* update docs
* scour all VFS APIs, make sure they receive valid VFS dir paths

second try for Trac notification:
closes #79
closes #80

This was SVN commit r3876.
2006-05-17 16:47:49 +00:00
e6be7e36d2 FILE_WRITE_TO_MOD is now FILE_WRITE_TO_TARGET
ERR_(FILE|PATH)_NOT_FOUND -> ERR_TNODE_NOT_FOUND, ERR_NOT_(FILE|DIR) ->
ERR_TNODE_WRONG TYPE
path_util:
- path_append: bugfix (no more extraneous /); add support for appending
slash
- path_replace: bugfix (no more warnings for expected error)
- add path_last_component, path_foreach_component
- move some defs to the header that belong there from vfs.h/path.h

file: add dir_create; move PosixFile definition here and provide
accessor for fileio
vfs: no longer automatically append slash; instead, make sure caller
does
vfs_mount:
- mount_realpath: bugfix (strip trailing /), interface improvement
- document write_target; clarify MULTIPLE_MOUNTINGS; add support for
creating real dirs
vfs_tree:
- refactor TDir::add into find, add, find_and_add
- fix TDir and TNode for dir-ends-with-slash requirement
- split up lookup into lookup_cb and path_foreach_component
- add support for inserting dirs with given mount point: tree_add_path
(needed when mounting)

wposix: get rid of weird PATH_MAX = 260 (Win32 weirdness)


TextureManager: remove no longer needed SupportedTextureFormats
GameSetup, Xeromyces: setup XMB location to data/cache/mods/official/xmb
Util: HardcodedErrorString now uses error_description_r
VFSUtil, i18n: fixes for dir slash issue

Closes #79, #80

This was SVN commit r3874.
2006-05-17 14:48:18 +00:00
a35ee9894d # add strict VSrc validation in OpenAL interface to track down bug
- required adding C99 insnan() implementation, along with fpclassify

This was SVN commit r3850.
2006-05-05 05:54:00 +00:00
ccafa5204e # document issue with direct AtomFn comparison; must use strcmp instead
This was SVN commit r3844.
2006-05-04 05:48:38 +00:00
cd67d271f0 # add CppDoc formatted comments to allocators,ogl_tex,snd_mgr
This was SVN commit r3843.
2006-05-04 05:45:04 +00:00
37663d86fb # bugfixes: prevent incorrect FPU results due to 0-length files, and incorrect file caching due to timestamps delayed by long sojourn in the debugger.
file_cache: avoid caching 0-length files (prevents div by 0)
adts: bit more defensiveness against size=0
trace: now use "dividers" in the trace file instead of relying on
monotony property of the get_time source. this avoids incorrectly
splitting the trace into runs when time is actually not monotonous
(which would cause lots of warnings), e.g. due to debugger.
in the process, changed interface to return (most-recent first) runs,
instead of only the raw unsorted entries.

This was SVN commit r3832.
2006-04-30 21:45:32 +00:00
f94ee87cc5 # bugfix in error reporting path: avoid repeated failure messages.
This was SVN commit r3829.
2006-04-28 04:58:31 +00:00
a7594bb39c # GCC compatibility
This was SVN commit r3828.
2006-04-28 04:53:23 +00:00
a8e200b4ac # bugfix to linux hotloading support: only try to load FAM once; do not complain constantly if it's unavailable
This was SVN commit r3826.
2006-04-28 01:25:31 +00:00
dfed3ac186 # bugfix: was triggering write-to-mod feature for all file writes due to incorrect flag comparison (2 bits must both be set)
This was SVN commit r3824.
2006-04-27 03:11:45 +00:00
641e55fefd #further VFS refactor (dirent enumeration interface unified, more code sharing)
- file: make DirIterator opaque struct with type field, as with
File/FileIo in recent commit. unifies all dir enum interfaces.
- add dir open/nextent/close functions to FileProvider_VTbl
- allocators: change signature of SingleAllocator to that of the
templated type (avoids need for cast)
  (affects archive, compression, zip)
- file_util: move dirent filter logic here so it can be used by file.cpp
also, not only vfs.

This was SVN commit r3822.
2006-04-26 22:38:25 +00:00
2bd3708339 # VFS: add support for redirecting writes of files that are in archives to writable mod directory (required for editor)
This was SVN commit r3818.
2006-04-25 17:35:35 +00:00
235e19c58f # Atlas: Updated Atlas DLL with fixed manifest. Double-click resizable panels to reset to default size. Moved player selection into extremely ugly drop-down list. Fixed culling when changing visible window's aspect ratio. Added manifest to VS2003 builds, to enable XP themes.
This was SVN commit r3814.
2006-04-25 05:10:47 +00:00
64ecf79c6a # more res/file refactoring (split up archive provider and builder)
also remove some stupid "returns ERR_OK or negative error code"
comments, which is now guaranteed by LibError return type anyway.

This was SVN commit r3807.
2006-04-24 05:20:14 +00:00
64ef19475d # housekeeping
terrain: fix unused a90 etc. warnings by commenting them out
renamed ERR_TEX_CODEC_CANNOT_HANDLE to INFO_.. (to prevent the kind of
mistake that philip just fixed)

This was SVN commit r3805.
2006-04-24 01:50:32 +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
2fbb899bb5 # Animate props.
tex: Reverted recent WARN_RETURN(ERR_TEX_CODEC_CANNOT_HANDLE) changes,
since (I think) it shouldn't warn about that being returned (because it
intentionally happens frequently).
XMLWriter: Trivial inconsequential optimisations (avoiding temporary
strings).

This was SVN commit r3801.
2006-04-23 22:22:18 +00:00
15e8d9a0b3 # error handling: make sure all lib/ failure paths are covered by error handling; simplify its use a bit
- validators now WARN_RETURN as well (rationale documented in
lib_errors.h)
- got rid of some CHECK_ERR (try to avoid multiple errors for the same
underlying problem)
- H_DEREF now first checks if handle is invalid already and returns that
if so; avoids the need for a RETURN_ERR before it.

This was SVN commit r3799.
2006-04-22 21:21:42 +00:00
83970eceae forgot to add this
This was SVN commit r3797.
2006-04-22 16:50:17 +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
8bb97e63cd # Work around a problem in ATI's binary Linux driver
This was SVN commit r3789.
2006-04-21 03:06:57 +00:00
8f02c6f10d # GCC compatibility
This was SVN commit r3788.
2006-04-20 06:53:22 +00:00
6792e95517 # fix vtbl_magic compile error on VC8; fix incorrect type in u32_from_larger; explanation+cleanup
- move AllocatorChecker to allocators.h since usefulness is not limited
to CacheAllocator
- file: add note on casting File.opaque
- vfs_redirector: was missing u32 (fails on VC8)
- zip: fix u32_from_larger (was using incorrect type)

This was SVN commit r3786.
2006-04-20 04:25:14 +00:00
fd08924348 # VC2005, GCC compatibility
Used new library include paths.
Renamed ia32.asm to ia32_asm.asm, so we don't need Premake modifications
to avoid object-file conflicts with ia32.cpp.

This was SVN commit r3784.
2006-04-20 01:33:57 +00:00
3ccb5676c6 # bugfix: off-by-one in sys_max_sector_size; add unix implementation of it
thanks to philip for the report!

This was SVN commit r3778.
2006-04-19 21:55:51 +00:00
6f9da5da7a # refactor vfs/file code (unify interface, dispatch between providers via virtual functions)
1) unify open/io interfaces: no longer distinguish between FileIo /
AFileIo. instead, one FileIo struct is always used; the
provider-specific data is embedded within it. this avoids the need for a
"base class", which is hard to access (f.fc.flags is ugly)
2) rename x_* redirector to xfile_* and move out of vfs_mount into
separate file
3) xfile is now implemented via "virtual functions" (avoids a lot of
boilerplate code)
4) xfile was too closely tied to vfs_mount (used internal fields);
fixed.

remaining lib/res files: made all flag parameters uint (not int) for
consistency

This was SVN commit r3776.
2006-04-19 15:19:04 +00:00
c81df59294 # Include headers for compilation without PCH
This was SVN commit r3774.
2006-04-19 05:30:02 +00:00
6fbce9c355 # refactoring
- color: the sse codepath is now detected and activated from within
color.cpp, which avoids making ia32 dependent on the color header. it's
called from gamesetup!InitRenderer.
- move VFSUtil::EnumDirEnts to vfs.cpp!vfs_dir_enum - allows it to be
used from within lib/ without dependency on ps (annoying for other
projects)

This was SVN commit r3764.
2006-04-14 06:32:05 +00:00
4856af5f25 This was SVN commit r3753. 2006-04-12 01:18:38 +00:00
kevmo
589c03a502 # housekeeping
Fixed includes to header files that were renamed, added defines for
ia32_fminf and ia32_fmaxf in sysdep.h, and added declarations for the
same in ia32.h

This was SVN commit r3752.
2006-04-12 01:12:18 +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
cde3c55eae # more SwEng improvements in snd_mgr / wdetect
snd_mgr: replace al_check("funcname") with AL_CHECK macro; allow
disabling WIN_LOADLIBRARY_HACK.
wcpu: move sys_on_each_cpu here from wsysdep
split up wdetect into wgfx, wsnd, wdll_ver

This was SVN commit r3748.
2006-04-11 01:45:07 +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
674bbc3735 # archive builder now unmounts and deletes old archives after building a new one
vfs_optimizer: also refactor existing_archives. all existing root dir
entries are filtered and only archives remain.

This was SVN commit r3743.
2006-04-10 19:09:11 +00:00
3dec1bfb20 # bugfix for #78: definition of PATH_MAX was too small/mixed up with VFS_MAX_PATH
This was SVN commit r3741.
2006-04-10 16:59:21 +00:00
6eac18d9fe # housekeeping (improve unreachable code annotations and avoid compiler warnings)
adts: use SAFE_FREE
config: add CONFIG_FINAL; use it in
compression,vfs_optimizer,scriptablecomplex
lib: add discussion of unreachable code avoidance; revise UNREACHABLE
and add NODEFAULT
ogl_tex, tex_dds: remove some unnecessary UNREACHABLE
sysdep: move compiler-specific implementation of UNREACHABLE here.
use NODEFAULT in snd, wdbg, wposix, wsdl

This was SVN commit r3739.
2006-04-10 06:44:54 +00:00
f3aa2dd222 # housekeeping:
* mapreader: increases progress bar update interval (was calling back
10x for 1%, which is an excessive slowdown)
* lib_errors: add ERR_MEM_OVERWRITTEN
* mmgr: replace debug_assert(0) with more specific errors

This was SVN commit r3737.
2006-04-09 07:46:37 +00:00
b37d3f2095 # fix W4 warnings on VC
This was SVN commit r3726.
2006-04-03 22:06:09 +00:00
44901d38b9 # further documentation and improvements to lib/res/file code
FILE_CACHE_BLOCK flag used more safely (copied in afile_read)
add file_sector_size (set from sysdep code)
documented and organized FileFlags
moved publically visible file_buf* decls to file.h; add FileBufFlags
file_buf_get: moved to file_io and renamed because it is not a part of
the file_buf manager itself
FILE_BLOCK_SIZE no longer exposed to users - it's an implementation
detail. for alignment purposes, you should use file_sector_size (less
wasteful)
add page_aligned allocator (mmap)
write buffers now allocated via file_buf_alloc(FB_FROM_HEAP) (avoids
wasting cache space)
append trace runs into the trace file (-> better input data for archive
ordering)
document lib_errors.h
tex_load: add provision for file_flags, used by ogl_tex_load to prevent
caching file data

simulation, entitymanager: add perf measurements

This was SVN commit r3725.
2006-04-03 21:28:10 +00:00
5738bd4820 # overhauled error handling; made sure all low-level function failures are caught at the source.
* replace all "return ERR_*" with WARN_RETURN(ERR_*) - makes sure
function failures are noticed *at the cause*, not later
* LibError_from_* now take bool warn_if_failed param
* replace more debug_warns with dedicated error codes (allows localized
error reports and doesn't spam the EXE with strings)

This was SVN commit r3722.
2006-04-03 01:00:45 +00:00
b5ad9faf74 # fix STL complaint when running on VC8 and building archive
(STL implementation AFAICS incorrectly disallows taking &vector[0] if
empty but memory has been reserved)

This was SVN commit r3715.
2006-04-02 04:50:47 +00:00
0d648b2df8 #More accurate bounds calculations to improve shadow resolution
and a fix for the auto-build: #define enums from EXT_framebuffer_object

* clip shadow bounds to frustum
* add CBrush, a class representing a convex object

This was SVN commit r3695.
2006-03-26 21:58:48 +00:00
8fd256c458 #Use EXT_framebuffer_object when available
* noframebufferobject configuration in system.cfg can be used to
  disable EXT_fbo (in case drivers are flaky etc.)
* shadow texture size now honours the OpenGL maximum texture size as
reported
  by the implementation

This was SVN commit r3693.
2006-03-26 17:36:33 +00:00
0e09451cfb # bugfix
avoid warning due to imbalanced buffer count

This was SVN commit r3687.
2006-03-25 21:44:25 +00:00
d6abc57868 # add instrumentation to file_cache; bugfixes
adts: whip together inefficient LRU cache manager (mostly for comparing
vs. Landlord)
file_cache: fix self-test (now correctly deals with small cache sizes)
file_stats: more stats for file cache
trace, vfs: bugfix: ignore writes recorded by the trace

This was SVN commit r3684.
2006-03-25 07:08:29 +00:00
8371f42da9 # IO bugfixes and improvements; more support for cache/seek measurements
adts: slight improvements
allocators: change POOL_VARIABLE_ALLOCS to -1 for safety; fix invalid
assumptions of it being 0
lib: more expressive param names
file: add file_get_random_name for randomized trace generation; allow
file_cache.h to declare externally visible file_buf_alloc API

file_cache: zero-length file bugfix; also add several flags to the API
routines allowing statistics gathering to be disabled (avoids distorting
stats due to e.g. trace_entry_causes_io cache simulation)

file_stats: add archive builder info; separate IO timing and seek
accounting (-> correct results)

trace: add random generation capability
vfs: made responsible for cache hit/miss accounting (fixes cache miss
rate display)

This was SVN commit r3681.
2006-03-24 21:56:00 +00:00
f5f4670d7f tweaks for thesis and minor fixes.
file: change block size to 32kb (=> yields highest throughput)
archive, file_io: add additional block cache forwarding path when
reading uncompressed data from archive (avoids repetitive IOs)
file_io, file_stats: fix inaccurate and incorrect IO throughput
calculation
file_stats: refactor some calculations to avoid division by 0

This was SVN commit r3665.
2006-03-18 21:28:47 +00:00
afae448b11 fix: memory leak fix wasn't correctly resetting root node during tree_clear. this caused crash after creating archive.
This was SVN commit r3656.
2006-03-18 01:07:05 +00:00
6eda8c2209 file_cache: make infinite loop warning less likely
vfs_mount: only notify archive builder of files that are archivable
vfs_optimizer: fix should-rebuild logic; make 2 criteria optional and
disable in final release for convenience

This was SVN commit r3651.
2006-03-16 18:57:09 +00:00
7564827a8a adts: DynHashTbl: safely handle calling clear() right before dtor
vfs: remove second call to tree_init (now done by vfs_mount)
vfs_tree: fix memory leak due to not destroying root node. commented and
armor-plated things while at it.

This was SVN commit r3647.
2006-03-16 07:16:24 +00:00
37c99471c2 archive: bugfix: archive_build_cancel is now no-op if build not in progress.
This was SVN commit r3642.
2006-03-15 21:37:30 +00:00
26dc8cc4c8 - tex_dds: fix comment; enable warning on unsupported formats
- renderer: avoid particle-emitter memory leak warnings

This was SVN commit r3639.
2006-03-15 18:32:24 +00:00
f037b13fc6 use new archive_open return value to ignore invalid zip files (and not add them to VFS)
This was SVN commit r3635.
2006-03-15 05:56:01 +00:00
3d93740456 - allocators: SingleAllocator: renamed free method to release() to avoid need for nommgr
- lib, sysdep.h: move DIR_SEP to sysdep.h
- archive, compression: minor touchups
- zip: large refactor: all accesses to little-endian structs are now
done by helper functions (fixes bug: wasn't endian swapping ECDR). also
detect unfinished zip files (for VFS mount to ignore)
- tex_dds: fix comment

This was SVN commit r3634.
2006-03-15 05:18:32 +00:00
1d5308316e bugfixes for problems reported by philip: (thanks!)
file_cache: add warning to cache_allocator to catch incorrect usage /
bugs
vfs_optimizer.cpp: tweak miniarchive threshold (currently have config
files in there; don't want those to trigger rebuild every time)
zip: clarification
tex_dds: we now bother checking the DDPIXELFORMAT mask bits because
uncompressed DDS files may be stored in any pixel component order, but
we require RGB for efficiency.
wsdl: fix failure to update; was constantly queuing events if mouse was
out of window

This was SVN commit r3627.
2006-03-14 07:20:12 +00:00
d776024848 bugfix: was not propagating mount point flags to Mount structure created for archives. this could result in no "archivable" files being found during archive build, leading to ERR_DIR_END.
This was SVN commit r3624.
2006-03-11 03:30:36 +00:00
b605cc8a85 adts: fix brain-dead bug that was slowing down Divider_Recip
vfs_optimizer: add note on future improvements

This was SVN commit r3622.
2006-03-10 22:35:58 +00:00
201aae41d9 file: pp_set_dir fix: safely handle case where pp.path already contains data; add TFile* member to DirEnt
vfs: add VFS_MOUNT_ARCHIVABLE flag; allow archive builder to only
include files from mount points with this set.

VFSUtil: make EnumDirEnts more efficient while at it (uses PathPackage
and filename storage)

This was SVN commit r3618.
2006-03-09 21:37:23 +00:00
e0280949fd file_cache: fix: add buf/size combo to exact_buf_oracle if file_io rounded size up.
trace: split code out of vfs_optimizer (was getting too large)
vfs_mount: expose API to unmount all (needed to be able to delete
archives after building)
vfs_optimizer: safely handle empty connection/node lists;
refactored+documented
vfs_tree: eliminate 'file in root dir' warning (can happen easily
enough)

rest: fixes/minor tweaks

This was SVN commit r3610.
2006-03-07 05:44:34 +00:00
9925188b68 Whoopsie - missed some brackets in wsysdep
This was SVN commit r3609.
2006-03-06 08:16:29 +00:00
bd922cbe02 Unix cursor support, some gcc warnings, etc
This was SVN commit r3608.
2006-03-06 03:46:12 +00:00
6e15ed1e82 fix bug related to FileId use; now safer due to separate node_from_id function
This was SVN commit r3605.
2006-03-05 07:35:42 +00:00
16fe4eeda2 - adts: add TODO comments
- file_cache: add checker for allocations (catches bugs in debug mode);
fix bug that freed buffers even thought they were on extant list.
- vfs_mount: bugfix: was passing P_path to vfs_opt_notify when it should
be V_path
- vfs_optimizer: big refactor; fix bugs in TourBuilder causing some
files to be omitted from archive (thus forcing unnecessary archive
rebuild - because #files not in archive was too big)

This was SVN commit r3602.
2006-03-04 18:58:09 +00:00
c1ca8c978c Various Linux build fixes.
This was SVN commit r3601.
2006-03-04 18:41:22 +00:00
ca1ac3034e fix 2 gnarly bugs:
- adts: Cache.remove_least_valuable was returning false prematurely even
though there were still some items pending eviction; that meant they
remained in cache
- file_cache: wasn't clearing exact_buf_oracle on reset. also made
make_read_only pass correct exact_buf rather than just rounding down.

This was SVN commit r3589.
2006-03-03 20:49:19 +00:00
dda6268466 - cgui: now convert EventName to lowercase in SendEventToAll
- compression: now use "fastest" compression mode and more memory unless
in FINAL build. this greatly speeds up archive generation at expense of
1.5% size increase (fine during development). done because profiling
shows ZLib accounts for 78% of CPU; practically nothing else shows up,
which shows effectiveness of compressing in parallel with reading from
disk.

- file_cache: documented; fixed several potential issues with exact_buf
when invalidating files.

This was SVN commit r3586.
2006-03-03 06:03:16 +00:00
39a9eb19cf again raised "infinite loop" warning threshold because it was still being hit, apparently. value is still plausible.
This was SVN commit r3582.
2006-03-02 07:23:30 +00:00
04b72b29b4 archive: new rule for choosing whether to compress files or not: leans heavily toward the former because that uses less memory when loading (less loss due to internal fragmentation)
everything else: bugfix: buffers added to extant list via
file_buf_retrieve (i.e. moved from cache to extant list) didn't have
their long_lived flag carried over; this caused a "not freed
immediately" warning.

This was SVN commit r3580.
2006-03-02 02:21:55 +00:00
0fd85b76db automatic archive builder now functional and enabled.
- allocators.cpp: fix: make sure all pool fields are reset in
pool_free_all; correct matrix self-test
- lib: fix self-test
- lib_error: give "informational" return codes values > 100 (allows
multiplexing with percent indicator)
- archive: add clarification to afile_enum; use vfs_load when building
archive (fixes caching problem); add support for progressive archive
creation
- file: allow pp_set_dir's path to end in slash (simplifies other code);
add file_exists
- file_cache: add stats+sanity checks to allocator; improve ExtantBufMgr
find(); add ExactBufOracle to translate padded address returned by Cache
to what was actually allocated; relax infinite-loop check; fix
file_cache_reset
- file_io: refactor callback logic so it can be used by vfs (needed for
vfs_load)
- vfs: vfs_load now supports calling back (required for archive builder)
- vfs_mount: optimize path caching in afile_cb: due to atom_fn system,
string compare can be done via pointer compare
- vfs_optimizer: support auto-build of archive (progressive); improve
should-build-archive check (WIP)
- vfs_path: add util functions (also used in screenshot code)
- vfs_tree: simplify pathname storage
- wposix: mmap bugfix
- main: call progressive archive builder; skip reload when doing so
(documented)
- JSInterface_VFS+scriptglue: add archiveBuilderCancel
- ps/Util: use new vfs_path helper function for cleverer screenshot
naming (correctly handles some being deleted)

This was SVN commit r3578.
2006-03-01 22:31:11 +00:00
78a5202e49 vfs_mount: bugfix: choose newer version of a file if present in loose dir and archive
vfs_optimizer: add enable/disable logic for trace
vfs_tree: add code to determine most recent file

This was SVN commit r3562.
2006-02-25 19:26:00 +00:00
4a0baf529d rename free() to dealloc() to avoid need for #include "nommgr.h"
This was SVN commit r3557.
2006-02-23 18:58:16 +00:00
bc07b9ff0a file code v2 is now feature complete and works.
- adts: add basic benchmark to self-test; use fminf instead of MIN; fix
overly pessimistic invalidation in Landlord_Cached
- allocators: no longer complain if DynArray is full
- lib: warn if rand() min=max
- archive: bugfixes: plug leak, correctly handle 0-length files, carry
over flags when reading uncompressed file from archive
- file: expose file_get_sorted_dirents and implement file_enum in terms
of that
- file_cache: many bugfixes (especially related to CacheAllocator
freelist)
- vfs_optimizer: finish implementation of archive builder
- zip: correctly handle 0-length files
- tex: add tex_is_known_extension
- sysdep: add efficient fminf implementation (assumes P6+)

- config: update archive builder call site
- gamesetup: add call for delayed self tests
- entity: return JSVAL_VOID as per philip's suggestion

This was SVN commit r3553.
2006-02-23 07:55:32 +00:00