1
0
forked from 0ad/0ad
Commit Graph

646 Commits

Author SHA1 Message Date
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
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
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
0a368a4fec massive update to adts: cache now implemented via templated policy classes.
Entity.h: fix minor warning

This was SVN commit r3539.
2006-02-19 18:51:00 +00:00
5081b38c43 debug: remove old prototype
file_cache: use new remove_least_valuable interface
zip: add dox

This was SVN commit r3514.
2006-02-15 03:03:17 +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
21f8f8555e adts: remove_least_valuable safely handles empty cache
lib: add u32_hi/lo
archive: move archive builder logic here from vf_optimizer
file_cache: add flush() call - used when simulating cache
vfs_optimizer: WIP, not yet functional: file gatherer, 50% of TSP tour
generator

This was SVN commit r3486.
2006-02-09 05:59:33 +00:00
b17b43b525 don't complain if attempting to open non-zip files (happens when scanning mount point directory)
This was SVN commit r3482.
2006-02-07 07:16:02 +00:00
920795fd85 file_cache: add refcounting to ExtantBufMgr (required for correctness)
This was SVN commit r3473.
2006-02-04 23:32:01 +00:00
2f438a6889 cache_allocator bugfix: do not attempt to coalesce allocations that are at start/end of committed region. fixes self-test failure.
This was SVN commit r3466.
2006-02-03 21:44:09 +00:00
987a6b7d4e fixed wchar_t issues; now correctly separates utf16, CStrW and jschar.
NOTE: wchar_t should be defined as a built-in type; no more need to
define manually or change project settings.

adts: disambiguate iterator type; add operator- as required by VC8
std::equal() implementation
precompiled: squelch stupid warning (that informs us that array members
are now actually default-initialized as called for by C++)
file_cache: remove debug variable

This was SVN commit r3464.
2006-02-03 20:36:15 +00:00
1227cb2f6d adts: add RingBuf self-test. RingBuf: make entry#0 the 'head' and pop_front a no-op if empty.
allocators: allow pool_create at NLSO ctor time
lib: add rand() function based on libc rand and self-test. (this allows
easily returning a random number within a range, and avoids a number of
pitfalls - the naive rand()%range approach is baaad)
precompiled: add self_test.h, so that self tests won't be accidentally
disabled by forgetting to include the header

file_cache: add self-test; fixed 2 bugs that exposed (was incorrectly
splitting large blocks and not setting class_size bit properly). fix
weird corner case in BlockMgr (attempting to free LRU block but it is
locked).

file_io, wdbg_sym: tiny fixes

This was SVN commit r3461.
2006-02-03 04:02:53 +00:00
8ed6965d18 fix crash that happened after editing file while game is running. vfs_tree's tree_root object was being destroyed but not recreated when rebuilding the VFs tree. fixed that as well as correctly freeing all TNode memory upon rebuild.
This was SVN commit r3458.
2006-02-02 05:20:33 +00:00
7862e79e84 adts: optimize landlord algorithm at advisor's request (only relevant if we have tons of files in cache)
trace: make note of IO size

xmlutils: fix old remnant of Handle vfs_load return type.

This was SVN commit r3456.
2006-02-02 04:11:07 +00:00
d11fcc8257 file_cache: bugfix in CacheAllocator
hook up file_stats; implemented stats_dump (gives somewhat detailed
report at exit)

This was SVN commit r3448.
2006-01-31 07:48:32 +00:00
06412a7751 allocators: bugfix (wasn't setting freelist to 0)
archive: afile_read bugfix (wasn't returning byte count)
byte_order: add to_leXX, implement read_leXX in terms of that, add
write_leXX (and also big-endian versions)
compression: support 0 length buffers + minor fixes
file: no longer support passing fn_len (that didn't work anyway due to
DynHashTbl find(const char*) interface); add FILE_DONT_SET_FN
optimization that prevents cluttering name cache.
file_cache: add logic to verify load/free/load/free sequence; add
FILE_LONG_LIVED flag to specify exceptions (e.g. XMB files that don't
free their buffer immediately)
vfs_mount/vfs_tree: bugfix (was mixing up portable and VFS paths)
vfs_optimizer: small fixes; creating Zip files now works
vfs_tree: add PathName that stores pointer to path and name component
for efficiency + convenience
zip: bugfixes (wasn't endian safe; incorrect handling of cmethod; forgot
to initialize ZipArchive members)

config: add -buildarchive flag
Xeromyces.cpp, FileUnpacker.cpp: add FILE_LONG_LIVED
mapreader: bump time estimate for ReadXML

This was SVN commit r3446.
2006-01-31 03:47:52 +00:00
ecbcc59fba bugfix: no longer make freed buffers readonly because we need to write boundary tags into them for coalescing
This was SVN commit r3432.
2006-01-28 23:02:26 +00:00
d0066d32f0 another free()
This was SVN commit r3431.
2006-01-28 22:41:22 +00:00
cda1e4c177 bitten by free() redirector macro again.. fixed
This was SVN commit r3430.
2006-01-28 22:30:28 +00:00
e07622b56a Cache: implement meat of landlord algorithm and add remove()
allocators: add freelist capability to Bucket; add provision for
variable XOR fixed size allocs
archive: re-tag file buffers if reading uncompressed from archive;
improve LFH fixup logic
file_cache: add cache line invalidation; lock down pages (readonly) when
IO finished
file_io: cleanup+docs; properly cut off at EOF without breaking
alignment.
file_stats: add seek accounting (WIP)
vfs_optimizer: also record file_buf_free in the trace. initial
implementation of archive builder (WIP)
zip: lfh_fixup now more efficient (does not involve buffer manager -
instead it grabs LFH from temp blocks)
tex: plug FileIOBuf leak. avoid writing to tex.hm because that is a
read-only file_buf.

This was SVN commit r3428.
2006-01-28 22:19:42 +00:00
3b4295a177 Linux build fixes
This was SVN commit r3427.
2006-01-28 22:04:09 +00:00
afe37d9fe2 fix vc8 errors reported by andrew: (thanks!)
- made file_io_wait buffer non-const (less const_casting around -
buffers are really non-const. besides which, inadvertent use will be
caught via MMU)
- zip: disambiguate abs() param

This was SVN commit r3426.
2006-01-25 07:37:20 +00:00
1ea2d25373 forgot this one..
This was SVN commit r3425.
2006-01-25 07:23:53 +00:00
4a508c6b87 all lib/res/file headers included in file_internal.h
split stats into separate file; different call mechanism; add lots of
stats (WIP)

This was SVN commit r3424.
2006-01-25 07:21:45 +00:00
7838627cd2 - vfs_load now returns error code and takes FileIOBuf; that must be freed via file_buf_free. if Handle is needed, use mem_wrap.
- remove ScEd hacks and CFont et al macro rename
- fix accursed bug in VFS buffer management that was causing ReadFile to
fail without error (not allocating enough padding)
- vfs_tree: bugfix in tree_lookup
- waio: temporarily disable sector size determination (pending better
approach - need to determine if using DVD drive)

This was SVN commit r3421.
2006-01-24 08:16:29 +00:00
36cbf23c8e v2 of file/res code for thesis:
previous zip.* split up into archive, zip and compression. add O(1)
lookup via memento. add support for writing Zip archive. simplify IO by
having compression module allow queuing input buffers.

file: split up into file, file_Io, file_cache. add atom_fn that enables
string comparison via pointer compare. (stores all filenames/paths in
one place). add statistics gathering.
file_cache: landlord algorithm for caching files as well as LRU block
cache.
file_io: aio code that splits transfers into blocks revamped and made
into class.

vfs: filelist/trace code moved into new vfs_optimizer. add caching logic
to vfs_load.
vfs_optimizer: will generate zip archive (to replace current archive
builder script). not yet done
vfs_tree: major cleanup - now has nice base class rather than union
hackery.

This was SVN commit r3420.
2006-01-23 20:05:09 +00:00
f953258a9d Fix Linux build, don't EVER #include <windows.h> again!
Removed some apparently unnecessary #includes
Merged multiple M_PI definitions into maths/MathUtil.h
Add newline at end of file

This was SVN commit r3384.
2006-01-21 20:01:17 +00:00
32aca79221 allocator: add single_calloc (generalization of code previously in wposix for WDIR); add da_reserve; expand pool allocator to allow variable size entries
byte_order: add FOURCC_BE and _LE versions (needed for zip)
ogl: quick hack: prevent crash on laptop by providing a
pglDrawRangeElementsEXT stub
file, h_mgr: update pool_alloc call site

tex: fix incorrect indexing/stride for mipmap generation

vfs_mount: disable archives (zip code is WIP)
zip: heavy WIP. add support for writing archives (needed for thesis);
revised Zip read code. sped up archive open. further major changes
pending.

wposix: moved allocator code (see above)

This was SVN commit r3298.
2005-12-28 20:29:22 +00:00
3ea5fa5b46 Lots of fixes for the Linux build:
- renamed sysdep/unix/ functions where necessary
- more int -> LibError conversions in the sysdep/unix/ part
- added some explicit #include statements where necessary
- moved enum LibError/ErrorReaction declarations
  (gcc doesn't support forward enum declarations)

This was SVN commit r3267.
2005-12-17 22:00:54 +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
8792731c5c snd: support for fading (variable initial/final values and lengths; can choose linear,exponential or S-curve). also minor improvements.
timer: greatly speed up TIMER_ACCRUE by having it gather raw ticks and
only converting those to wall-clock time at exit when displaying the
values. old codepath remains and can be restored via TIMER_USE_RAW_TICKS

This was SVN commit r3241.
2005-12-13 23:17:50 +00:00
6e82e33ccf - display_msg and display_error -> debug prefix since in debug header
- debug_warn_err now takes LibError
- lib_error.cpp: revise error code -> string (only support liberror
now); add function to set errno from LibError
- unifont, CFont: parameter made a simple wchar_t from const wchar_t&
- mmap now sets errno
- Loader and VfsUtil function now return LibError as well
- Profile.cpp, ProfileViewer.cpp: fix int/uint/size_t warnings
- Renderer.cpp: fix cannot-generate-assignment-operator warning

This was SVN commit r3235.
2005-12-12 19:19:30 +00:00
1c1200a049 - massive overhaul of lib error code returning. int -> LibError everywhere.
- add translators from errno and GetLastError to LibError
- clarified return values of callbacks (they must return
INFO_CB_CONTINUE to continue)
- this exposed a few bugs in error handling chains (returning incorrect
values); also reduced say-nothing instances of return -1.
- move CHECK_ERR etc. macros to lib_error

This was SVN commit r3229.
2005-12-11 22:23:55 +00:00
e2f25f4598 - self test: rename stuff to SELF_TEST*; add provision for delayed all-at-once self tests (allows for init before the test and makes measuring elapsed time easier)
- config: add CONFIG_TRACE
- display_error_impl->sys_display_error
- cleaned up sysdep; add sys_ prefix everywhere and document everything
- add to vfs_load dox
- cursor: sys_cursor_load -> sys_cursor_create. sysdep code is no longer
dependent on tex; instead of calling tex_load, the caller passes a BGRA
texture in.
memcpy: huge kick in the pants for accompanying paper; now even faster.
- on_each_cpu -> sys_on_each_cpu (removed manager function also)
- wsdl: explain PeekMessage CPU usage issue

This was SVN commit r3203.
2005-12-07 03:38:39 +00:00
9be309d4c7 editordata: use tex_load to load the heightmap - don't need the ogl_tex functionality and this avoids the POT check (which would fail)
ogl_tex: remove POT-check-avoidance hack

This was SVN commit r3166.
2005-11-20 14:35:52 +00:00
41ae0f9a44 Various hacks to make ScEd work. Should be removed once ScEd is no longer needed.
This was SVN commit r3162.
2005-11-20 00:41:45 +00:00
0491a7980d ScEd: add mathutil header (seems to be required now, no longer included automatically); update to ogl_tex API (they have long been renamed in ps); fix issue with PS_CRect vs CRect
ogl_tex: add diagnostic code to track down ScEd crash

This was SVN commit r3159.
2005-11-19 22:27:53 +00:00
59f9e37930 lib error codes moved to errors.h and made X macros. this allows adding a corresponding text message, which is now output by debug_warn_err.
vfs_path, tex, tex_codec: small tweaks to error-related code.

This was SVN commit r3158.
2005-11-19 18:12:16 +00:00
76c7f96833 add safety check to get_slot (this appears to be part of the error andrew is getting - possibly the victim of mem corruption)
This was SVN commit r3151.
2005-11-19 04:13:37 +00:00
d5d6e4052e lib: only debug_warn in UNREACHABLE in paranoia builds - avoids lots of warnings in debug mode
cursor: fix definition of ALLOW_SYS_CURSOR and use DDS instead of PNG
ogl_tex: add ogl_tex_transform_to for convenience
tex: fix issue with transform code (might not flip image if it was DDS)
win: decompress cursor texture if it was DDS
renderer: use DDS instead of PNG for alpha maps

This was SVN commit r3148.
2005-11-18 16:23:39 +00:00
e527c66fda document DynArray and add self-test. fix 2 tiny little bugs.
This was SVN commit r3083.
2005-11-03 00:42:37 +00:00
3a5969f126 boil 5 state indicator flags down to 3, and store them as flags instead of bitfield
This was SVN commit r3078.
2005-11-02 06:35:34 +00:00
74bf76d523 fix bug #71 - was a double-free (both ~CRenderer and UnloadResources were calling UnloadWaterTextures)
This was SVN commit r3071.
2005-10-31 18:57:03 +00:00
20d038efda profiling indicates memcpy is a bottleneck, so globally replace all of them with memcpy2 (hand-optimized). depending on transfer size, this is 10%..300% faster. also made memcpy2 into a macro instead of thunk function because vc7 was still generating a jump.
This was SVN commit r3057.
2005-10-30 16:19:20 +00:00
501acc65f5 Extension function pointers are renamed from glXyzARB to pglXyzARB
to avoid conflicts with system header files.

This was SVN commit r3054.
2005-10-30 01:18:15 +00:00
875cb3bca1 Add ARB_vertex_shader specific functions to glext_funcs.h
Add an "instancing" model renderer to improve rendering of
non-transparent,
unanimated models. This renderer is used when the vertexshader path is
rendering path is used.

This was SVN commit r3052.
2005-10-30 00:22:22 +00:00
15d9278af6 tex, mem: fix refcnt issue that is the possible cause of bug#70! huge thanks to philip, who localized the problem to tex_wrap/memory not getting freed.
wdbg_sym: make sure symbol info is initialized even if *resolve() fails;
also fix warnings
renderer: make sure texture array is initialized

This was SVN commit r3049.
2005-10-29 22:29:55 +00:00
a7d6725f45 allocators, config: add CONFIG_OVERRUN_PROTECTION - allows disabling the lengthy work done by OverrunProtector
h_mgr: clarification of fn_store code
mem.cpp: fix recursive taking of a lock

This was SVN commit r3048.
2005-10-29 21:40:41 +00:00
f323726118 allocators: bugfix, unlock mem range before calling dtor
mem: made thread-safe; use OverrunProtector for Ptr2H

This was SVN commit r3047.
2005-10-29 18:30:39 +00:00
bc78557f10 move boilerplate overrun protect code into OverrunProtector
This was SVN commit r3046.
2005-10-29 17:58:26 +00:00
5d821cc925 wrap placement new in #include "nommgr.h" so that it works with memory tracker enabled
This was SVN commit r3044.
2005-10-29 03:18:27 +00:00
8c437850e6 allocators: add include guard and posix.h (needed for PROT_*)
debug: add debug_is_code_ptr and debug_is_stack_ptr
config: add CONFIG_OMIT_FP (needed for ia32_stackwalk).
h_mgr: hyperparanoid overrun detection straightjacket for key2idx - now
safe to use at any time and any unexpected changes cause access
violation.
ia32: add ia32_get_call_target, which disassembles backwards and checks
for a valid CALL instruction + its target
wdbg_sym: add win-specific walk stack function. it's quite simple and
requires EBP frames (hence CONFIG_OMIT_FP). rationale: dbghelp requires
~30 seconds (!) to start up. recent changes (tracking malloc callers via
debug_get_nth_caller) made this happen on every run, so added a
fast-path stack walker to avoid this.

This was SVN commit r3043.
2005-10-29 02:32:36 +00:00
e3b0f20d4e change requested by philip: debug_printf "tags" are now followed by '|' instead of ':' because something like "func: i am blowing up" is rather common.
This was SVN commit r3035.
2005-10-27 16:53:41 +00:00
7fa2770203 tex_dds now supports uncompressed images. also armor-plated the loader and split up decompression vs dds format code.
This was SVN commit r3032.
2005-10-27 00:51:30 +00:00
d49dd25385 ogl, h_mgr: tag-ified debug_printf string for use with new filter
debug: filter mechanism now usable. added docs

This was SVN commit r3001.
2005-10-24 17:38:22 +00:00
359f55700a file_open: cleanup
vfs_tree: move bucket allocator to allocators.cpp
allocators: add matrix self-test
zip: remove redundant timing code and add CHECK_ZFILE everywhere
ogl_tex: implement app hook for overriding gl upload caps
tex: add CHECK_TEX everywhere
TextureManager: only call LoadTextures once (instead of for each file
type)
debug: add hook for translating error messages; add filtering mechanism
to only show interesting debug_printfs (WIP). restructured code:
debug_puts is the sysdep part, while debug_printf does filtering and
then calls that

This was SVN commit r2990.
2005-10-23 23:57:59 +00:00
a5a9f4b657 g++ compilation fixes.
Fix: Unix symbol resolver ignores NULL parameters like Windows resolver
instead of crashing.
Fix: Bugs and crashes in the input system, caused by wrong use of
SDL_BUTTON_* constants.

This was SVN commit r2984.
2005-10-21 18:32:16 +00:00
26d2fc71ad loaders: increase timeout interval (less time wasted in main loop during loading)
vfs: move public functions into vfs.cpp to avoid confusion (except
vfs_mount in vfs_mount.cpp, but that's obvious)
h_mgr: fix bug in filename display causing dir names to be truncated
main/gamesetup: replace 2 bools with flags; remove Atlas trampoline
functions (clutters up main.cpp)
atlas: use GameSetup.h instead of extern ..

This was SVN commit r2983.
2005-10-21 18:01:21 +00:00
d43aa11d36 file: free cached IO blocks to avoid them appearing as "leaks"
vfs: now always check filter in VDir (Not only in debug mode)
vfs_tree: free VFS nodes to avoid them appearing as "leaks". bugfix in
bucket allocator - wasn't coping with exactly filled buckets correctly
all Handle users: add to_string method that writes the interesting parts
of a resource's user data to string.
h_mgr: show this information when a handle is closed
ogl_tex: add ogl_tex_find
add 2 timer clients
mem: now record address of function that allocated memory
GameSetup: fix shutdown order
Renderer: allow freeing individual alpha map textures (we cache the
composite)

This was SVN commit r2981.
2005-10-21 07:47:38 +00:00
39060e7900 cinput, ogl_shader, h_mgr, vfs: stomp on warnings
ia32, sysdep: add rint()
minimap: saw TODO on GetMapSpaceCoords and sped it up by 15% using rintf
and precalculating scaleX
timer: add indication of how often something was billed (helps measure
stuff called an indeterminate number of times)

This was SVN commit r2973.
2005-10-19 20:26:53 +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
b350f54162 ogl_tex: centralize OpenGL caps detection; allow user override for broken card/driver combos
- enable floating point exceptions (helps catch bugs)
file.cpp: improved error checking in dir_open/dir_next_ent code
vfs.h: expand docs; add note on patching + SCM
main: use spf (1/fps) to derive TimeSinceLastFrame (makes for smoother
updates)
timer: rename SUM_TIMER to TIMER_ACCRUE. interface change allows
unlimited number of timers (instead of static limit as before).
documented everything

This was SVN commit r2958.
2005-10-17 23:35:16 +00:00
953d2621dd timer: improved timer_add_client - no longer has fixed-size storage. btw, name will change here - not happy with SUM_TIMER.
GUI/input code: moved g_active, g_keys etc. into ps/Globals; it has its
own input handler as well

all users of fopen(): add file_make_full_native_path to get correct path
even though current dir = system/

This was SVN commit r2954.
2005-10-16 23:16:08 +00:00
af70f0136b GameView: made file-scope data static (prevents accidental/evil use from other files and name collisions)
TextureEntry: add SUM_TIMER around base color calculation
Zip: add SUM_TIMER around inflate/memcpy

main: re-removed g_MaxZoomHeight - this doesn't belong in the message
loop. it resides in GameView.cpp

This was SVN commit r2945.
2005-10-15 21:15:33 +00:00
6ff0cf4cab workaround: wdetect needs to call dir_open with absolute paths. we therefore allow this (disabling the full path conversion thing), but it's a hack.
wdbg: stripped SE_DEBUG_NAME test code (Not needed for now); also
improved breakpoint code (had a look over it).

This was SVN commit r2939.
2005-10-14 20:28:55 +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
8435fb880c vfs_mount: bugfix: wasn't populating VFS from archive (cause of massive VFS slowdown recently). also fixed another overzealous validate check
ogl_tex: bind() implementation much simplified; also fix bug that set
TMU correctly when disabling texturing
wsdl: fix stdout.txt redirect; now works regardless of current
directory. also no longer disable file buffering except when in full
debug mode (because it's so slow). also add minimize button to caption
bar in windowed mode.

This was SVN commit r2919.
2005-10-12 23:48:44 +00:00
a1cddc4ac3 gameview, renderer: LoadWaterTextures is now a coroutine because it takes friggin forever (3 seconds). VFS performance is down by a factor of ten! investigating is on todo.
dyn_array.h -> allocators.h
ogl_tex: reenable performance warning
tex: comments
h_mgr: debug_printf if long filename is passed in (so we notice)
wsdl: squelch DestroyWindow warning. will look into the cause.
sysdep: slightly simplify "restrict" determination

This was SVN commit r2916.
2005-10-12 17:19:07 +00:00
deaaf5236c Fix build for g++
This was SVN commit r2915.
2005-10-12 16:27:23 +00:00
4285883f3d wdetect: changed gfx_card detect to hopefully support multiple adapters (now returns the primary)
file: add timer
h_mgr bugfix: h_force_free wasn't clearing refcnt
mem: add note on shutdown order
snd: bugfixes: VSrc_validate was overzealous (al_src == 0 is allowed);
sd->is_valid wasn't being set -> leaked AL buffers.
wsdl: remove overzealous ReleaseDC check (false alarm)
gamesetup: clarify (resource) shutdown order

This was SVN commit r2913.
2005-10-12 15:09:32 +00:00
c1ec44d751 ogl_tex: work around bug #69; greatly simplify upload implementation; add support for emulating s3tc
tex: add support for generating mipmaps in software (simplifies
ogl_tex_upload)
all codecs: change interface, adding "restrict" keyword; rename util
functions to tex_util
tex_dds: support for decompressing images with mipmaps included

This was SVN commit r2909.
2005-10-12 04:41:28 +00:00
e9864faa97 all resource implementations:
- add automatically called validate function
- make sure dtors correctly handle partial reload failures

all file code: IO routines renamed to io_* from *_io

h_mgr: add suballocator for filenames; some reorganization+cleanup;
better example code and added some notes to docs

snd: reorg to move resource methods next to struct

This was SVN commit r2907.
2005-10-12 04:35:01 +00:00
c498468fd0 wsdl(+main): add support for cleanly shutting down game if X clicked or Alt+F4 pressed. also cleanup; correctly declare SDL_Event
dyn_array: add pool allocator - see comments.
file(+gamesetup): add suballocator for aiocb (requires shutdown); revise
validator; rename file_*_io to file_io_*

This was SVN commit r2906.
2005-10-12 04:27:55 +00:00
04650efe7a Lots of gcc -Wall fixes. The common ones:
- switch() statements don't handle all values in an enum
- missing \n at end of file
- non-virtual destructors in classes containing virtual functions
- order of initializers in constructor initializer lists
... some other stuff (signedness, nested comments, unused variables) as
well.

This was SVN commit r2864.
2005-10-07 15:24:29 +00:00
f1ee2cd66d Add the notion of render paths and an appropriate configuration option.
Add Ogl_Shader and Ogl_Program handle types for shaders/programs loaded
from
files.
In the vertexshader render path, use a vertex program for lighting for
optimization.

This was SVN commit r2853.
2005-10-05 16:42:09 +00:00
5e3b6fcbe3 goto crosses initialization (deja vu? ;)).
This was SVN commit r2840.
2005-10-03 19:37:45 +00:00
d367014972 vfs_store: set return value to #bytes written
fix 2 bugs in tex / ogl_tex reported by philip (related to caching) -
thanks!
tex: documented header and improved implementation. add tex_transform_to
for convenience. change tex_write to require going through tex_wrap.

This was SVN commit r2837.
2005-10-03 12:57:31 +00:00
ae20f157bc Accidentally committed experimental changes. Sorry about that.
This was SVN commit r2815.
2005-09-29 22:40:13 +00:00
c92c9376b9 Fix out-of-range write to the keys[] array, caused by fake SDL_KEY* events.
Pressing the Windows key no longer crashes the Linux build.

This was SVN commit r2814.
2005-09-29 22:22:43 +00:00
38dfc3da99 Hardware cursor isn't implemented for X.
Remove dead sys_cursor_create references.

This was SVN commit r2812.
2005-09-29 21:48:04 +00:00
d98abf0685 final refactor (i hope). split up fmt / int_fmt determination to allow override of fmt without overriding int_fmt (useful for unifont.cpp). this changed the signature of ogl_tex_upload. better explained flags in OglTex and warn_if_uploaded.
also a few improvements / stomped on some warnings.

This was SVN commit r2809.
2005-09-29 17:33:30 +00:00
cd2f3948dd changed sys_cursor interface to load directly from file; can add createFromMemory version later if ever needed.
cursor: reflects the above; much simplified now.

ogl_tex: preserve all texture state across reloads. add quality
mechanism (perf boost on older cards). split up upload code. add
ogl_tex_transform(). add more docs.

renderer, GUIrenderer, unifont: bring in line with ogl_tex changes (int
-> uint and call setters before ogl_tex_upload)

GameSetup.cpp: add tex quality mechanism

This was SVN commit r2803.
2005-09-29 05:00:20 +00:00
3ded398729 g++ forbis goto across variable declarations.
This was SVN commit r2796.
2005-09-28 18:46:26 +00:00
db27ff6c9b bugfix when writing screenshot: was calculating rounded up size for VFS incorrectly.
also fix refcnt for tex_wrap temporarily until mem_assign/mem_get_ptr
do.

h_mgr: add disallow-reload support (required for wrapped ogl_tex since
they are not backed by a file)

This was SVN commit r2780.
2005-09-27 15:35:17 +00:00
609be94b8c comments/cosmetics;
fix UNREACHABLE def on unix;
string_s: use HAVE_STRING_S;
wdbg_sym: fix option set code; explain why search path isn't needed
WriteScreenshot: make sure there's enough mem; use Handle to free mem
(more efficient+less error prone)

This was SVN commit r2779.
2005-09-27 15:20:56 +00:00
d6f31e4157 ogl_tex: documented and cleaned up.
h_mgr: add h_get_refcnt; saw h_alloc was a mess and split it up
mem: remove obsolete 'scope'

This was SVN commit r2759.
2005-09-21 16:11:43 +00:00
2a8953452d inlined bits and bit_mask for efficiency (as suggested by philip - thanks!)
add sanity check for struct Tex

This was SVN commit r2755.
2005-09-19 23:40:33 +00:00
13501cf58b hook up emulate_glCompressedTexImage2D to new tex transform code (which takes care of DDS unpack)
to that end, provide support for "wrapping" existing textures so that
tex_* and ogl_tex* calls may be used.

also have renderer use ogl_tex for its created-on-the-fly composite
alpha texture
also named atlas's thread (for fun+profit during debugging)

This was SVN commit r2754.
2005-09-19 22:48:20 +00:00
a3967624af add 64-bit endian-safe read; also bit_mask
work continues on DDS decode. endian-safe; supports dxt1a; now fairly
efficient and cleaned up.

This was SVN commit r2751.
2005-09-18 18:10:23 +00:00
2b69209fcd bits() param clarification
dds: serious cleanup of DDS decoder

This was SVN commit r2741.
2005-09-17 15:47:00 +00:00
6b10e4b010 tex codecs: fix some warnings (remove unnecessary locals)
ia32: fix register clobbering bug (thanks to philip for reporting it)

This was SVN commit r2738.
2005-09-16 19:19:14 +00:00
2ab9584840 snd.cpp: initialize listener orientation and position (my OpenAL drivers complained about the old random values)
premake stuff: call assembler objects *.asm.obj instead of *.obj (so
that ia32.asm doesn't collide with ia32.cpp)
ia32.asm: use .text section for proper linkage

This was SVN commit r2709.
2005-09-13 20:42:01 +00:00
808a0f7cbe config: additional macro is checked
lib: add bits() function (actually moved it from zip.cpp)
ia32: start moving code out to external asm file (will use NASM in
pre-build step; avoids needing MSC and GCC-specific inline code). move
memcpy test code out to other file

This was SVN commit r2706.
2005-09-13 04:00:41 +00:00
a0a01e7a7d Linux/GCC Compat, added some includes, ported inline assembly stuff to gnu syntax (and misc. cleanup in ia32.cpp)
This was SVN commit r2702.
2005-09-12 23:37:52 +00:00
d64e2ed19f dyn_array: use memcpy2
add tex error codes
move memcpy code to ia32
tex: simplify codec call with separate tex_codec_for* calls
codecs: use error code instead of string; remove redundant params
ia32: heavy WIP - testing memcpy implementations
util: prepare for zero-copy improvement to screenshot code

This was SVN commit r2695.
2005-09-10 14:28:55 +00:00
494d27bdd4 moved SAFE_DELETE to lib.h
dyn_array supports "wrapping" other types of memory (stopgap measure)
texture codecs now load via DynArray (intermediate step to all mem stuff
going through res/mem.cpp)
simplified tex codecs by doing as many checks as possible in
tex_load_mem ("template method"-esque)

This was SVN commit r2690.
2005-09-08 01:47:45 +00:00
1a7d67a97f dyn_array: efficient expandable array that doesn't waste mem or relocate itself. TODO: self test and dox
file: expose block size constant; always round user transfers up
tex: transform() now receives what to change, not what to achieve.
tex*: encoding works with DynArray+VFS backend
GameSetup: free g_BuildingPlacer to avoid mem leak.
fixed some warnings+bugs.

This was SVN commit r2679.
2005-09-06 22:44:48 +00:00
7b144a11ca ogl_tex: has to be aware of multitexturing because if hotloading a texture on TMU1, we have to re-bind it to that. done
waio: fix bug with SetErrorMode usage triggered by reading "The old new
thing" (Raymond Chen's blog)

This was SVN commit r2664.
2005-09-04 20:49:58 +00:00
819aca0f1c work around flaw in some DDS headers (not setting alpha flag). this is critical because renderer/GUI code now uses TEX_ALPHA flag instead of just checking against all known GL formats containing alpha
This was SVN commit r2663.
2005-09-04 20:05:21 +00:00
f4c535a326 lib.cpp: forgot to use TEST (for self-test)
self_test: add dox (also to wiki)
tex_codecs: further work; renamed+reorg for clarity. separating codecs
from IO implementation

This was SVN commit r2654.
2005-09-02 18:38:25 +00:00
50ea8c532c - PathPackage now does CHECK_ERR. adjusted callers appropriately
- mem.h: export mem_assign (needed to wrap a mem buffer)
- use stricmp in some file extension comparisons
- wposix: properly sets last-error code when opendir fails
- also: misc comments

This was SVN commit r2650.
2005-09-02 03:03:06 +00:00
21709a5a7a (as before, belonged in the previous batches)
This was SVN commit r2649.
2005-09-02 02:58:40 +00:00
71f7fccd12 split texture loader into codecs (greatly eases navigation)
tex.cpp now has loader API and codec support routines.
provide for codecs "transforming" the image; this allows e.g.
decompressing DDS, which is currently done in ogl code (but belongs
here)

This was SVN commit r2648.
2005-09-02 02:56:54 +00:00
9ec828f6fd - both tex.cpp and ogl_tex.cpp had functions named tex_* - confusing. renamed to ogl_tex* to disambiguate.
- ogl_tex_bind now supports multitexturing (avoids need to get id and
then bind manually)
- provide nicer API for querying texture properties (no longer one big
getter). improved GUI determination of texture alpha.
- renderer: another see-if-texture-has-alpha and fixed alpha map code
(wasn't checking if all are same size. only worked because the first map
was larger than the rest

This was SVN commit r2647.
2005-09-02 02:54:02 +00:00
9e40ebc93d RealDir.watch wasn't initialized, leading to complaints at exit. fixed
This was SVN commit r2614.
2005-08-13 23:37:31 +00:00
a0e7d02cdd Fixed and rebuilt ScEd. Updated tex to handle greyscale PNGs.
This was SVN commit r2610.
2005-08-13 17:14:57 +00:00
0e20c08969 waio: fix spurious WARN_ERR
vfs: integrate hotload code
fixed a few warnings as well.

This was SVN commit r2609.
2005-08-13 17:09:57 +00:00
fac9a8aa87 reading a gamedev thread triggered the realization that WDIR no longer needs to store full path in dirent. therefore, streamlined opendir/readdir/closedir; I guess they are a good bit more efficient now.
This was SVN commit r2606.
2005-08-12 22:19:31 +00:00
4aa740bff5 - split up lib/res into file, graphics and sound.
- wposix.cpp: initial support for MEM_RESERVE and MEM_COMMIT semantics
in mmap
- cstr: removed no longer necessary serialization header
- xmlutils: wrap new() calls in nommgr/mmgr; allows tracking other
allocs in this file.
- add u64_from_u32
- various minor comments/improvements.

This was SVN commit r2604.
2005-08-12 17:06:53 +00:00
aba23e4fdb config: got my grubby hands on a list of OS defines, so those have been assimilated. also add STL_ defines for GCC and ICC.
vfs.h: wording in dox
win.cpp: add note on suspending threads in display_error_impl

This was SVN commit r2598.
2005-08-10 20:53:52 +00:00
622ceeda94 - color -> colour
- add note on performance in TextureManager.cpp

debug_stl: more fine-grained #if STL_DINKUMWARE (gets this closer to
working on other STL implementations)
vfs.h: improved dox and moved vfs_path public functions here.
cursor: pass g_mouse_x as a parameter (SwEng)

This was SVN commit r2595.
2005-08-10 01:12:03 +00:00
ff97a903b8 wpthread: improved code and avoid memory alloc during thread creation
wsdl and tex: use british english terms

This was SVN commit r2594.
2005-08-10 00:33:15 +00:00
4b33f49da1 - sysdep cursor functions renamed sys_cursor_*
- res/cursor.cpp cleaned up, uses sys_cursor_*; also fixed some bugs.

This was SVN commit r2593.
2005-08-10 00:27:56 +00:00
b63bc42245 TextureManager: stopped memory leaks
wsdl: create window at expected size, and retrieve correct mouse coords
CStr: not ISerializable (=> not virtual)
Game: less excessive complaining, since the original problem seems to be
fixed
Entity: fixed evaluation order
Others: minor comments/etc

This was SVN commit r2591.
2005-08-09 21:26:40 +00:00
78c751aff6 ogl: add oglSquelchError call. use that if you know a piece of code will trigger an error and want to suppress it (e.g. INVALID_ENUM after using GL_CLAMP_TO_EDGE although we've already warned the user that not everything may work)
file: now provides a much more efficient alternative to file_enum that
does not sort all files (this was a problem for check_if_oal_dll which
was scanning the entire system32 dir)

- use the same DirEnt struct for file and VFS due to clever name pointer
trick.
- wposix: avoid malloc for most opendir() and fix mmap() bugs (thanks to
Philip for noticing+reporting them)
- VFS: was getting too large to manage, now split into an additional
file
- WIP: much more efficient mounting; supports other mount sources than
file or zip (e.g. if we want to add network files); clean separation
between VFS submodules; dox; beginning of thread locking.

This was SVN commit r2589.
2005-08-09 16:32:23 +00:00
5299dcad86 - config: all macros are defined as 1 / 0. testing with #if allows compiler warnings (testing undefined macro) to spot misspelled macros
- debug: add provision for naming threads. allows adding current thread
name to log messages and displays their names in the debugger.
- replaced various if(err < 0) complain() sequences with new variants of
CHECK_ERR (see lib.h)
- fixes to mmgr/VC debug alloc enable code
- improved h_mgr error reporting (now complains when h_free fails)
- US -> UK english (partial)
- fix tex_load double-free bug
- move win32 mouse cursor code into sysdep
- error dialog is now topmost to make sure it's visible (was a problem)
- handle WM_QUIT before displaying error dialog (makes sure it's shown)

also as in previous 3 revisions.

This was SVN commit r2588.
2005-08-09 16:23:19 +00:00
b3a9ed2886 New terrain properties stuff, gcc compatability and updated unix debugging stuff
This was SVN commit r2581.
2005-08-07 21:58:36 +00:00
67777bd159 cursor: remove old Win32 implementation
main: add new variable for clarity

scriptglue: massive refactor. added docs, rearranged into groups,
eliminate forward decls, consistent param checking, some progress on
consistent naming and formatting.

This was SVN commit r2492.
2005-07-20 00:57:17 +00:00
1d69845cee snd: better snd_disable dox
ia32: fix comments and fix EBP warning
wdbg: fix bug if exception locus is unavailable
wdetect: store full DS driver path (-> version reported correctly)

This was SVN commit r2491.
2005-07-20 00:54:39 +00:00
7a889deca3 cursor: tried all sorts of implementations to fix bug#66, but after 2 days of debugging, the problem was found to be elsewhere (issue with delay-loading). fixed by keeping a reference to user32 at startup.
main: replace old memory_debug_turbo_extreme_plus with debug_heap_enable

This was SVN commit r2488.
2005-07-16 17:52:05 +00:00
2f5b116842 mmgr: remove random fill option (makes no sense, since we want to fill with unused and freed memory pattern only)
snd: better explain __try hack; avoid any updates if not initialized
ia32: no longer user declspec(naked) (unsafe)
wdbg_sym: also declspec(naked) and refactor display of libstdc++ objects
wdll: remove redundant #undef
wsdl: add comment

This was SVN commit r2487.
2005-07-16 17:49:38 +00:00
5754128dec lib.h: have CHECK|RETURN_ERR etc. store+compare as i64 (safer). document details.
h_mgr.h: debug_warn if H_DEREF fails

have vfs / res functions only CHECK_ERR (i.e. complain) once per call
sequence. made sure vfs_load and vfs_open debug_warn and everything else
just passes on the error.

This was SVN commit r2482.
2005-07-14 00:19:56 +00:00
57f396a5b8 little stuff (adopt debug_get_nth_caller change, document catch(...))
snd: make __try() more obvious and fix old bug that causes a NULL read
when many sources are playing
add alloca implementation (takes care of stack overflow handling)

This was SVN commit r2475.
2005-07-09 20:20:57 +00:00
3d23b2d9f5 debug.h: more dox
snd.cpp - remove stack size note
vfs_tree - fix uninitialized variable problem
string_s - match official rename of strlen_s to strnlen
ia32 - fix infinite recursion, the apparent cause of bug#64

This was SVN commit r2470.
2005-07-04 17:03:08 +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
f3b5e08030 CStr: VC2005 fix - mustn't dereference end()
snd: Only open device once

This was SVN commit r2452.
2005-07-01 22:53:03 +00:00
ec6b78b252 rename assert2 debug_assert; use instead of all plain assert(), since there are no longer any issues (e.g. can't use while handling an exception)
This was SVN commit r2447.
2005-06-28 04:06:25 +00:00
8f9a3fc38f - config.h: massive improvements, much clearer.
- tentatively activate PCH if gcc > 3.4. remove XP_ defines (which were
undocumented; now in scripting/spidermonkey.h)
- rename some config defines
- move sysdep/debug.h to lib/debug.h (it's portable; was wrong all
along)
- grouped all debug heap related stuff to debug.h:debug_heap_*
- sysdep: fix circular include issue with debug.h

This was SVN commit r2427.
2005-06-22 03:23:22 +00:00
40bfeb37c1 ogl_tex: max_tex_size -> ogl_max_tex_size
assert_dlg, udbg, debug.h: dialog with stack trace is now used in dev
mode for exceptions as well

This was SVN commit r2393.
2005-06-16 21:52:35 +00:00
d24fd1b0c9 Use gl*ARB wherever possible. They are mapped onto the core gl* function if the driver's version is high enough, else onto the extension's gl*ARB function.
(Just for fun, compressed texture uploads are mapped onto a
decompression function if the user's system doesn't understand S3TC
textures.)
Corrected (unless I'm wrong) GL version identification logic.

This was SVN commit r2384.
2005-06-14 03:33:16 +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
641806cc22 zip, lockfree: minor comments
debug.*: move crashlog write code here
wdbg: improvements to breakpoint code. major cleanup in exception
handler; de-hackified. mostly done, not yet stress-tested when not
running in debugger

This was SVN commit r2333.
2005-05-22 22:32:58 +00:00
d0f7cb015c - Linux/GCC (as usual :P)
- Ported lockless code to gcc inline assembly
- A few new net messages (gather, attack, add waypoint)
- Support for new messages in network->entity order converter
- Implemented rudimentary JS interface for Interaction
- issueCommand JS API, connected to the network
- Removed Interaction stuff now replaced by JS
- And something in there should probably break VS builds :P

This was SVN commit r2316.
2005-05-18 05:32:09 +00:00
758251edfd further debug_out -> debug_printf; (comment) cleanup
ogl_tex: minor formatting improvements

This was SVN commit r2286.
2005-05-11 22:40:19 +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
5821ebb629 Tidied up a bit more
This was SVN commit r2283.
2005-05-11 05:26:24 +00:00
6034821b4a Slightly more readable enum naming in mipmap code
This was SVN commit r2282.
2005-05-11 04:56:05 +00:00
1436e919c1 Support reading DDS files with mipmaps
This was SVN commit r2273.
2005-05-10 18:29:18 +00:00
216eb8d2fe fix rare corner case where filter would be reset to GL_LINEAR. thanks, Philip!
This was SVN commit r2240.
2005-05-04 22:03:00 +00:00
4566893042 add include guards; reflect lockfree.h rename
This was SVN commit r2184.
2005-04-27 16:16:52 +00:00
9fd08fb044 vfs_tree: revise hash table implementation to make it reusable (not yet finished)
This was SVN commit r2122.
2005-04-09 22:25:23 +00:00
9d139926c9 file: provide FILE_TEXT flag that enables newline translation - useful when outputting XML files, so notepad doesn't see "\n" (which it can't handle)
vfs: no longer watch dirs when mounting - need to pass flag. allows
turning this off for screenshots dir (where hotloading doesn't make
sense)

vfs_tree: expand hash table when 3/4 full; 1/2 was quite wasteful.

main: do CPU init early, so timing during init can use TSCmain: do CPU
init early, so timing during init can use TSC

This was SVN commit r2098.
2005-04-29 13:17:17 +00:00
e86001f45e - file bugfix: truncate when opening for writing (problem reported by philip)
- file: now return size at close() time for use with VFS
- zip: tested open speed, added [exec time]  notes

This was SVN commit r2075.
2005-03-29 06:27:35 +00:00
36cd555ba7 slight change to error paths for convenience (RETURN_ERR)
This was SVN commit r2068.
2005-03-27 17:40:40 +00:00
2fa430a4e6 - fix bug (wasn't setting mount_point of dir being mounted => crash while writing screenshot)
- add check for changing filters while enumerating dirents
- add path_component_valid
- change iterator to only return valid entries (removing that burden
from user code)

This was SVN commit r2067.
2005-03-27 17:27:49 +00:00
f777979cc8 detect: add posix.h so _SC_* defines are visible (enables mem detect)
in several files, expand one-line function bodies (hard to debug)

This was SVN commit r2066.
2005-03-27 17:24:57 +00:00
6bf2600808 huge change:
- replace std::map with custom filename lookup container (more
efficient)
- split into 3 parts (was too big)
also added struct stat-like fields to vfsDirEnt

still under heavy development.

This was SVN commit r2058.
2005-03-27 01:46:54 +00:00
a4aa9ab246 zip: add instrumentation, see how much time decompression takes
This was SVN commit r2011.
2005-03-18 22:18:34 +00:00
c3bd4efa9b add O_NO_AIO_NP - if file.cpp doesn't want AIO access, the wposix code shouldn't open another (AIO capable) handle
wposix: also cleanup aio_reopen

This was SVN commit r2010.
2005-03-18 22:15:49 +00:00
ae172a9a01 Disabled mipmaps on GUI textures and cursors
This was SVN commit r1999.
2005-03-17 00:06:51 +00:00
8afc1d9daf use H_DEREF
This was SVN commit r1994.
2005-03-15 18:24:00 +00:00
1b2527c49e add dox to posix.h;
pre-existing dox have been converted to /* */; added "KEEP IN SYNC WITH
WIKI" warning

This was SVN commit r1993.
2005-03-15 18:23:13 +00:00
f1f945c2fa fix for bug reported by philip: had dxt1a and dxt1 backwards
This was SVN commit r1991.
2005-03-10 20:29:27 +00:00
3f15b5555c massive cleanup related to internal format. now calculated along with fmt during reload.
more changes pending (split TexData and its settings; make tex.cpp wrap
its data in Handle; clean up 'is loaded' checks)

This was SVN commit r1988.
2005-03-10 17:04:42 +00:00
a61e31e0a3 hook up JPG encoder. minor changes with JPG (en|de)code function shutdown
This was SVN commit r1987.
2005-03-10 17:02:10 +00:00
eab8c2957a add VFS destination plugin for jpeg-6b (allows writing out images as JPG)
removed unnecessary SIZEOF macro (replaced with sizeof)

This was SVN commit r1985.
2005-03-10 16:59:01 +00:00
11419fc1fe add pitch shift capability to snd.cpp and JS binding
This was SVN commit r1977.
2005-03-09 16:17:26 +00:00
56af3ca47d Made lodbias and vsync config options work. Removed CHEEZY_NOMIPMAP (which forced mipmaps to be enabled), since it's evil.
This was SVN commit r1971.
2005-03-09 00:55:22 +00:00
da1622ca06 reloading is optimized and armor-plated. eliminated an evil race condition.
wdir_watch.cpp: remove debug output and fix dir_get_changed_file
interface bug (was returning ERR_AGAIN instead of 1)

This was SVN commit r1964.
2005-03-02 12:06:40 +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
540a76e88b clean up reload code; add cache invalidate call when reloading (make sure file contents are actually loaded)
This was SVN commit r1948.
2005-02-27 19:11:39 +00:00
a8ef1b911e make reload ignore logic more clear
This was SVN commit r1945.
2005-02-27 14:35:38 +00:00
8e7b800521 remove atexit, minor improvements
This was SVN commit r1944.
2005-02-27 14:34:46 +00:00
ab67b4f3fa move VFS::is_subpath to file::file_is_subpath
This was SVN commit r1943.
2005-02-27 14:33:59 +00:00
3eb6d152d6 add high level dox to snd.h; improve comments; slight improvements to GCC-compat fixes
This was SVN commit r1934.
2005-02-26 14:52:57 +00:00
28602d600d mmgr ported to linux
This was SVN commit r1895.
2005-02-02 17:01:33 +00:00
79c7ca4cf6 fix for file_rel_chdir: check if n_path is valid, instead of argv0 (since argv0 is 0 when running sced)
This was SVN commit r1889.
2005-02-02 03:27:40 +00:00
d34780fb79 win_internal: add _getcwd prototype, made all extern
file: correct getcwd return value

This was SVN commit r1878.
2005-01-30 16:13:15 +00:00
f093b53459 Fixed problems in texture converter's DDS output, and in the game's DDS input.
This was SVN commit r1862.
2005-01-29 17:18:14 +00:00
f25f6a2d70 wdbg: fix crash when exiting abnormally (alt+f4) - was erasing elements from container while iterating through it
win internal files: slight changes while looking through

This was SVN commit r1850.
2005-01-28 18:16:51 +00:00
b48ede5438 Accept DDS files with mipmaps
This was SVN commit r1846.
2005-01-28 15:37:01 +00:00
b704c7b0e4 endian.h renamed (conflict with linux system header)
This was SVN commit r1844.
2005-01-27 20:00:47 +00:00
f3a61e4f69 wsdl: add prototypes for VC endian swap routines (avoid warning)
endian.*: split out of lib.* to reduce default dependencies
tex,zip: now include endian.h

This was SVN commit r1838.
2005-01-27 15:40:23 +00:00
6ca71568f5 vfs, ps/game.cpp: lint
dbghelp_funcs: no longer needed, since we load dbghelp statically

This was SVN commit r1788.
2005-01-23 19:49:45 +00:00
8c7df579bc precompiled: hook up mmgr (needs to be included in all files)
tex: lint fixes

unifont: split out glvprintf

This was SVN commit r1786.
2005-01-23 18:23:29 +00:00
e4bcd210d3 win_internal: move VC debug heaps here to avoid conflicts with mmgr
vfs: lint fixes

mem: remove h_add_ref from mem_get_ptr (was a hack, breaks some code)

This was SVN commit r1783.
2005-01-23 18:17:46 +00:00
85fd8a0f0e stomped various lint warnings:
- /* */ -> //
- clarified expressions
- add casts
- func() -> func(void)
- signed/unsigned

also KB -> KiB, MB -> MiB

This was SVN commit r1775.
2005-01-23 17:54:20 +00:00
44ffb32169 fix include path (relative to lib)
This was SVN commit r1774.
2005-01-23 17:50:07 +00:00
e332d876f8 stomped various lint warnings:
- /* */ -> //
- clarified expressions
- add casts
- func() -> func(void)
- signed/unsigned

This was SVN commit r1773.
2005-01-23 17:48:32 +00:00