Commit Graph

23 Commits

Author SHA1 Message Date
1679510bb8 Resolve Loader memory leak from 1f1642bfe3.
Use C++11 featured shared_ptr to avoid conditional deletion in multiple
locations.
Drops C compatibility(?) of Loader.h.

Differential Revision: https://code.wildfiregames.com/D2331
Tested on: clang 8.0.1., Jenkins
Comments on IRC #wfg 2005-05-07
Refs 77d3c5d0b5, 5e3b0f06ec, f19d8dafee.

This was SVN commit r23019.
2019-09-30 08:49:00 +00:00
cccd6849a7 cleanup (requires update-workspaces)
lib_errors.cpp: replace with status.cpp, adapt to needs at work
wutil: fix runtime warning reported via feedback box
config: merge CONFIG_PARANOIA and !CONFIG_FINAL into
CONFIG_ENABLE_CHECKS
add openmp, pointer_typedefs.h

This was SVN commit r9410.
2011-05-03 12:38:42 +00:00
4663ac0fe7 split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
2011-04-30 13:01:45 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
3c411dd174 large batch of Dehydra static code analysis fixes
(mostly passing arguments by const reference and checking LibError
return codes)

This was SVN commit r6214.
2008-07-12 10:45:11 +00:00
c0ed950657 had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).

it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.

after several hours, the code now requires fewer casts and less
guesswork.

other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.

This was SVN commit r5942.
2008-05-11 18:48:32 +00:00
a859562ea7 improvements and fixes:
- properly differentiate between buffer/offset alignment and length
alignment (relevant since block size has been increased to 256k)
- use VfsPath for most game paths instead of CStr
- clean up timer interface and implementation
- self-tests no longer crash
- file_cache.cpp: fix for the case where allocation fails (prevent
deleter from seeing a null pointer)
- allocators: move all shared_ptr-related stuff to its own component;
add DummySharedPtr
- codec: disable checksums (important for performance at work)
- File: made into an interface class to avoid export problems. not
entirely sure about this..
- vfs_path.h, path.h, os_path.h: proper fix for using
fs::change_extension and similar utility functions with derivatives of
basic_path
- lib_api: automatically link against import lib if building lib/ as a
DLL
- path_util: remove unused functions (this component is deprecated)
- compiler.h: add INLINE
- Xeromyces.cpp: pass PIVFS so that GetXMBPath works in self-test
(should do this mostly everywhere rather than have one singleton g_VFS)

This was SVN commit r5537.
2008-01-07 20:03:19 +00:00
e2eb5b2610 part4: adapt codebase to changes in lib/
mostly straightforward except for CVSFile / Filesystem. moved the former
into the newly created latter component. removed VFSUtil entirely (that
functionality is available from lib/file/file_system_util.h)

Xeromyces.cpp: simplify buffer handling since smart pointers are now in
play. also use WriteBuffer instead of membuffer.

This was SVN commit r5519.
2007-12-20 20:21:45 +00:00
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
871cdb6ef9 # SwEng (reduce full recompiles by splitting up master error header)
- error codes now accessed as ERR::NO_MEM, INFO::OK etc.
- no more X-macros => the above are now recognized by visual assist
- error codes are defined by the module originating them (lib_errors has
some generic ones)
  => no full rebuild when adding some
- error descriptions are now in C++ files => can be changed without full
rebuild

added AT_STARTUP in lib.h.

This was SVN commit r4374.
2006-09-22 13:19:40 +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
f0615df318 # Initial work on fancy water.
Also, horizon height (skybox vertical offset) can now be set from the
console with renderer.horizonHeight.

This was SVN commit r3893.
2006-05-25 05:46:17 +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
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
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
1ff0d112d2 revise loader return values - nicer interface now.
This was SVN commit r2281.
2005-05-11 04:39:21 +00:00
229a6b7a16 Loader: reword comment
EntityHandles.cpp: 4096 -> MAX_HANDLES

This was SVN commit r2259.
2005-05-09 04:37:36 +00:00
f8f94e02aa add high-level dox and updated some comments
This was SVN commit r2249.
2005-05-06 20:02:00 +00:00
1bcf156680 added macro that takes care of boilerplate "check for timeout and return progress" code.
This was SVN commit r2242.
2005-05-04 23:10:11 +00:00
22ee082694 - more accurate progress calculation (avoids accumulating errors)
- revised time accounting allows updates during a task that's
interrupted
- cleaned up LDR_NonprogressiveLoad

This was SVN commit r2233.
2005-05-03 21:39:03 +00:00
22dd4dd67b Entities: Removed Tag attribute; it is taken from the filename instead. Made entity XML files be loaded on demand. Probably stopped crash when maps contain non-existent entities. Fixed a few bugs in entity definitions.
Maps: Stored non-entity objects in XML instead of PMP, for easier manual
editing. Updated existing maps to newest format, so that they can still
work. Added undocumented _rewriteMaps() JS function. Also renamed _mem
to vmem, and reclassified its undocumentedness as unintentional, since
it's reasonably useful.
Loader: added NonprogressiveLoad function, for ScEd/_rewriteMaps/etc
which don't care about progressiveness.
main.cpp: re-enabled vfs_display, since it doesn't crash now
Vector3D: stopped warning

This was SVN commit r2078.
2005-03-29 20:50:04 +00:00
5e3b0f06ec documented and revised after review by philip (thanks!) - progress is now calculated from estimated duration; next instead of current description is returned
This was SVN commit r2032.
2005-03-21 13:33:21 +00:00
77d3c5d0b5 initial loader implementation - provides a queue that is worked off from the main loop; a timeout ensures responsiveness.
this is the framework that will allow progress bar updates.

This was SVN commit r2027.
2005-03-20 14:32:43 +00:00