Commit Graph

42 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
e6a12f76e2 aio: check for NULL aiocb* params; made aio_h get/set static; various small improvements
mem: explicit mem_shutdown call - try to avoid exit order problems

unifont: remove logger calls (dependency on ps/)

This was SVN commit r1657.
2005-01-07 01:13:48 +00:00
9d317d8164 1) removed scaffolding from file
2) VFS: add path_copy convenience routine
3) various lib code: removed unnecessary const cluttering things (like
const char* _const_ name in param list)

This was SVN commit r1483.
2004-12-09 23:12:02 +00:00
8764693bd8 allow 0-length allocs without complaint (required when vfs_loading 0-length files, as happens with current art pack)
This was SVN commit r1258.
2004-10-19 13:29:51 +00:00
4f230f061d less dependencies: handle.h forward-defines Handle, so that not everything that uses res headers is dependent on h_mgr
This was SVN commit r1213.
2004-10-06 14:00:43 +00:00
d46cf9cf1f remove mem_assign and mem_assign_user (all call sites rewritten so that they're no longer needed)
still available in source, but shouldn't be necessary.

This was SVN commit r1156.
2004-09-19 13:41:49 +00:00
caedad6fc4 allow freeing 0 ptrs
This was SVN commit r999.
2004-08-15 21:48:34 +00:00
023592d23f bugfixes related to "lying about user's buffer" feature
also rearranged + cleaned up a bit

This was SVN commit r959.
2004-08-10 16:01:04 +00:00
687aea271e fixed alignment (broken after last user_p change)
This was SVN commit r949.
2004-08-09 16:44:42 +00:00
09cf9dce75 add support for lying about a memory handle's actual allocation (useful for the file code, which allocates extra room for padding yet wants to return the allocation's handle)
This was SVN commit r932.
2004-08-07 13:34:43 +00:00
ddd7821425 res reload callback interface change: now also receives handle of object being reloaded. simplifies tex reload code
This was SVN commit r602.
2004-06-25 22:19:19 +00:00
15ca5cbf21 newline stomper and fixed warnings
This was SVN commit r473.
2004-06-11 02:14:18 +00:00
0dc6007fbd (re)added headers so it'll work without HAVE_PCH
This was SVN commit r396.
2004-06-04 12:41:53 +00:00
c0d33d3330 Linux/GCC compat, a few newlines at end of file, minor changes
This was SVN commit r353.
2004-06-02 15:31:55 +00:00
3abf9ac4b5 lots of type fixes; types.h is now a convenience wrapper on top of the standard uintN_t routines
This was SVN commit r334.
2004-06-01 17:34:12 +00:00
c6054e9c4f automagic reload implemented (vfs and file monitor)
This was SVN commit r227.
2004-05-14 21:20:23 +00:00
f383cfd4a8 fix for vc7 (incomplete type in container). also some updates to vfs
This was SVN commit r221.
2004-05-08 01:11:51 +00:00
5b5726ed4d merge of (work in progress) VFS code with new dir layout
This was SVN commit r216.
2004-05-06 17:14:30 +00:00
89c5b0d88c the big merge (tm). see forum post for changes made.
This was SVN commit r158.
2004-03-02 23:56:51 +00:00