1
0
forked from 0ad/0ad
Commit Graph

39 Commits

Author SHA1 Message Date
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
7e6d38314d allocators: fix OverrunProtector - avoid crash at exit if the object was never actually used
lib: add display_msgw which is a wrapper around the sys_display_msgw
impl and takes care of translating text
lib_errors: codes are now an enum (this will allow a special return type
and make documentation much more clear); codes are defined in the
header, not from lib.h
wsdl: resolve todo comment

This was SVN commit r3217.
2005-12-10 07:04:31 +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
364e36128e g_YMinOffset declared in gameview.h instead of extern elsewhere
terrain: made const-correct
lib: Add round_up_to_pow2
minimap: cleanup. split user input and DrawViewRect out of Draw; add
m_Camera; made pointers const; user local x,x2 variables instead of
writing out m_CachedActualSize

This was SVN commit r2970.
2005-10-19 17:16:34 +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
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
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
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
ed5041a301 some infrastructure for self-tests: gets rid of boilerplate code.
squelch debug asserts during self-tests to avoid warning about intended
errors (passing invalid data into functions to test their error
reporting)

This was SVN commit r2646.
2005-09-02 02:47:25 +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
8475c16c31 fix bugs in ilog2 (yoink) and add self-test+asserts.
This was SVN commit r2600.
2005-08-11 02:02:10 +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
a1e149ab11 more of the asserts.. also:
- increase stack trace buffer size (needed for some complicated nested
expressions)
- fix bug in container output - no longer treat iterator (i.e.
x::iterator) as an x string (now uses match_wildcard instead of simple
string compare)
- add unicode match_wildcard
- bugfix for vectored exception handler - was always ignoring exceptions
from main thread (fixed the previous fix where it was always grabbing
all exceptions ;p)
- better array display (display less of huge arrays)
- fix nesting limit (which was too low); make sure infinite
nesting/indirection can't happen

This was SVN commit r2448.
2005-06-28 04:12:50 +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
f0cbe8e440 fix several shortcomings noted in the stack trace code. now handles pointers much better; all-round better parsing+formatting and more robust.
also moved some utility functions to lib.cpp

This was SVN commit r2352.
2005-05-27 04:40:29 +00:00
c65d966112 moved lock-free primitive (CAS) here; add support functions (memory barrier and instruction serialization)
lib: speed up round_up by requiring alignment to be a power of 2

This was SVN commit r2221.
2005-05-03 05:05:16 +00:00
1f237be66b add rand_up_to
This was SVN commit r2170.
2005-04-26 16:47:48 +00:00
ffdc1d8360 add lower-case hash (used by VFS) and revise match_wildcard to accept anything if pattern=0
This was SVN commit r2054.
2005-03-27 01:31:39 +00:00
df38ee95a8 remove atexit2 - explicit init and shutdown is safer and easier to understand.
add some initial docs.

This was SVN commit r2008.
2005-03-18 22:07:55 +00:00
157f77887c types.h => lib/types.h (avoid name collision)
This was SVN commit r1937.
2005-02-26 15:15:36 +00:00
28602d600d mmgr ported to linux
This was SVN commit r1895.
2005-02-02 17:01:33 +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
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
56949e6fc4 lib: add big endian readers; add VC intrinsic bswap routines
tex: improve flip / bgr convert (now generalized "transforms"); add
support for transforming image before encoding

wsdl: add SDL_ShowCursor, minimize when tasking out

main: WriteScreenshot improved, fixes flipped screenshots

This was SVN commit r1689.
2005-01-09 14:23:59 +00:00
9a00cd11d5 add match_wildcard function (for vfs_next_dirent)
This was SVN commit r1383.
2004-11-23 20:52:03 +00:00
1e47f64630 add log2
This was SVN commit r556.
2004-06-19 14:43:31 +00:00
b09211c4a3 remove *tot - non-portable and inefficient. replaced with stringstream
This was SVN commit r529.
2004-06-18 13:22:26 +00:00
a6246b9045 read_le16/32 can't be inline in source and extern in header - gcc won't export them
This was SVN commit r450.
2004-06-09 14:11:35 +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
f84bc36ca3 moved fminf+fmaxf to sysdep
This was SVN commit r372.
2004-06-02 21:50:50 +00:00
0ce04bf73f no message
This was SVN commit r364.
2004-06-02 16:59:12 +00:00
270aa5974e - endian ifdefs => __BYTE_ORDER == __BIG_ENDIAN
- round moved to sysdep with _MSC_VER ifdefs
- alternative CHECK_ERR macro (in lib.h)
- some linux compat stuff

This was SVN commit r350.
2004-06-02 15:15:12 +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
672c25084b fixed log location; win code modules now register init/shutdown (=> less dependencies, more control over init order)
This was SVN commit r277.
2004-05-27 17:30:06 +00:00
d1036b9a18 VFS updates; texture reloading now works, tex.cpp is WIP
This was SVN commit r223.
2004-05-13 13:52:48 +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