1
0
forked from 0ad/0ad
Commit Graph

3073 Commits

Author SHA1 Message Date
2be5d5b752 More GCC/64-bit fixes
This was SVN commit r6190.
2008-07-04 11:10:18 +00:00
4a73261ba1 fix - FMVector3::XAxis wasn't defined
This was SVN commit r6189.
2008-07-03 20:28:22 +00:00
2109f4eb0e Merged in Dacian's network changes.
This was SVN commit r6187.
2008-07-03 06:29:22 +00:00
0d82179d64 add header and include guard
This was SVN commit r6173.
2008-07-02 06:21:06 +00:00
5fe79fbb7c adding needed include
This was SVN commit r6169.
2008-07-01 22:12:03 +00:00
49f0feb969 Fixed Linux build more
This was SVN commit r6168.
2008-07-01 21:43:08 +00:00
e3d60ad0b2 fix inadvertent dependency on sse2
This was SVN commit r6167.
2008-07-01 20:27:37 +00:00
58c3b031d6 Partly fixed Linux build
This was SVN commit r6166.
2008-07-01 20:18:05 +00:00
1c610fd8b0 A bunch of constness changes in dcdt to get rid of a few compiler warnings
This was SVN commit r6165.
2008-07-01 16:05:05 +00:00
b79375a0c5 color conversion: avoid type punning by returning SColor4ub directly. that required a non-extern-C declaration of the SSE function, so i replaced it with straightforward intrinsics.
ia32: no longer needs #if since build system ensures it's not compiled
on amd64

This was SVN commit r6164.
2008-06-30 19:08:29 +00:00
10a6ef4e17 fix a few remnants of the previous sysdep/win folder location, including a relative path in icon.rc
This was SVN commit r6163.
2008-06-30 18:19:14 +00:00
a3696c0b91 premake: detect processor architecture from script
lib/sysdep: clean up by moving OS and cpu-arch folders into "os" and
"arch" folders

This was SVN commit r6162.
2008-06-30 17:34:18 +00:00
58407c7438 workaround for invalidId issue (fixes windows build)
class static const member apparently sometimes requires external linkage
and enum causes conversion warnings, so go with file-scope constants.

This was SVN commit r6161.
2008-06-30 17:31:09 +00:00
8bb535de75 GL functions have stdcall convention on windows, so that needs to be included in the cast
note that windows build is currently broken - comment out
const size_t CUnit::invalidId;
in Unit.cpp (seems to be a dark corner of the C++ standard, am currently
discussing this with simon)

This was SVN commit r6158.
2008-06-29 21:32:52 +00:00
697ef257d5 ssize_t specialization issue is hopefully now fixed in a manner palatable for both MSC and GCC :)
This was SVN commit r6157.
2008-06-29 21:24:46 +00:00
2382899a87 add system-specific AllocateAligned call (because _mm_malloc isnt as portable as hoped)
("RTL" directly has been added to sysdep - requires update of workspace)

This was SVN commit r6156.
2008-06-29 10:30:33 +00:00
84f5428b9f Mismatching typedef int ObjectID. All the other places use size_t, so I changed this one to size_t too.
This was SVN commit r6155.
2008-06-29 10:15:13 +00:00
d977cdc89b Added simple test for the float->4ub color conversion
This was SVN commit r6154.
2008-06-29 10:13:40 +00:00
6f0be5ce94 Even static const's need to be defined, in case the compiler can't inline the constant value
This was SVN commit r6153.
2008-06-29 10:12:52 +00:00
d513f3a579 Fixed logging of boost::basic_path and a type-punned pointer
This was SVN commit r6152.
2008-06-29 09:59:26 +00:00
7d18028fe2 Un-type-pun importExtensionFunctions
This was SVN commit r6151.
2008-06-29 09:54:26 +00:00
91873a66a2 Const-correctness (less compile warnings)
This was SVN commit r6148.
2008-06-28 21:49:14 +00:00
d790210c11 Fixes for ENet compilation
This was SVN commit r6146.
2008-06-28 20:19:13 +00:00
a68d99144b Compile fix for newer versions of GCC (>= 4.3)
This was SVN commit r6144.
2008-06-28 18:51:06 +00:00
67eefaf733 size_t fixes
This was SVN commit r6143.
2008-06-28 18:50:32 +00:00
f2129f70a5 AMD64 assembly modifications for linux
This was SVN commit r6142.
2008-06-28 18:44:06 +00:00
e62deac770 get rid of some instances of type punning (dangerous in the face of aliasing optimizations)
This was SVN commit r6140.
2008-06-28 17:51:18 +00:00
f2037e3dca uint/size_t fixes
This was SVN commit r6139.
2008-06-28 17:31:14 +00:00
26737d624e Indicate load_sys_cursor failed if compiling without system cursor support
This was SVN commit r6138.
2008-06-28 17:28:06 +00:00
9f44f08611 UINT_MAX -> ULONG_MAX to avoid truncating negative 64-bit values into positive 32-bit ones
This was SVN commit r6136.
2008-06-28 17:19:57 +00:00
7d9a366d40 Fixed annoying "unmatched '" warning on gcc
This was SVN commit r6135.
2008-06-28 17:18:33 +00:00
82eb8d355f GCC fix (*(u32*)&float_var confuses gcc)
This was SVN commit r6133.
2008-06-28 17:10:25 +00:00
4d61367fd7 don't crash if SoundMgr is given an invalid index (happens if entities dont define a soundGroup - we need to find a way to prevent the underlying cause.
fixes #203, see also
http://www.wildfiregames.com/forum/index.php?showtopic=11703

This was SVN commit r6132.
2008-06-28 10:27:04 +00:00
504ec69508 Fixed some integer type conversion warnings.
This was SVN commit r6130.
2008-06-28 01:09:45 +00:00
ee969c4627 Changed link in error dialog from bugs.wildfiregames.com to trac.wildfiregames.com
This was SVN commit r6125.
2008-06-27 21:32:38 +00:00
ad15764e1b committing patch from simon (compiles clean on win32, pathfinding still works)
see http://www.wildfiregames.com/forum/index.php?showtopic=11817&hl=#

This was SVN commit r6120.
2008-06-26 20:20:17 +00:00
0994b71316 fixes
bits: avoid warning, document ceil_log2 corner case
cpu, x86_x64: remove unused cpu_MemoryFence
wdbg_heap: avoid warning
test_bits: fix incorrect test values
TerrainOverlay: fix use of struct vs. class, correct unintended
search&destroy of intended->ssize_tended (LOL)

This was SVN commit r6119.
2008-06-26 20:12:42 +00:00
010cbdd283 More uint/size_t fixes
This was SVN commit r6116.
2008-06-26 07:48:42 +00:00
f41bd37c81 Only use #pragma warning on MSVC
This was SVN commit r6115.
2008-06-26 07:43:22 +00:00
6e893a2050 Some uint/size_t compile fixes
This was SVN commit r6114.
2008-06-26 07:25:50 +00:00
10237a66c7 GCC/Linux build fixes
This was SVN commit r6107.
2008-06-25 23:01:13 +00:00
129f923cf5 fix: GCC requires emmintrin.h for _mm_mfence
This was SVN commit r6106.
2008-06-25 20:37:25 +00:00
8529e2b14f dacian's network files were not yet completely in SVN. added the remaining files, removed obsolete ones
This was SVN commit r6105.
2008-06-25 20:34:23 +00:00
b5987f11e8 Cleaned up TerrainOverlay a little
This was SVN commit r6104.
2008-06-24 23:35:46 +00:00
557f08db27 Fix some GCC build issues
This was SVN commit r6103.
2008-06-24 23:28:22 +00:00
e943dbf44b fixes
wsdl: check handles before using, prevent bogus error message due to
stupid MapWindowPoints return value
cursor: robustify, add CppDoc

This was SVN commit r6096.
2008-06-22 11:11:59 +00:00
b478fde5a1 add support for positional sound and "omnipresent" interface sounds
snd_mgr: remove support for sound cones (will not be used); only set
VSrc rolloff factor if relative flag is set
main: hack: flip listener up vector to 'fix' L/R flip (cause is unknown,
coord systems appear to be correct)

This was SVN commit r6092.
2008-06-21 20:06:30 +00:00
a74ffe9a76 wsdl bugfixes:
- robustify gamma ramp calculation, hopefully avoid "invalid parameter"
error message
- fix two mixups of client vs. screen coordinates that caused button
presses to be ignored after moving the window

This was SVN commit r6090.
2008-06-21 18:24:07 +00:00
e364a26a3f fixes:
- Xeromyces filename had been changed to VfsPath but was still being
passed to LOG() without .string().c_str()
- CPUID.4 is "reserved" on AMD, they require a separate codepath for
determining cache parameters.

This was SVN commit r6040.
2008-06-17 18:27:19 +00:00
cf2f61e19a fix Zip archive creation code (note: just the low-level archive code; "vfs_optimizer" is still inoperational)
archive_zip: truncate requires full path; 7-zip apparently relies on
ECDR.m_cd_numEntriesOnDisk
codec: re-enable checksum generation (both explorer and 7-z demand that
CRC be computed)
codec, codec_zlib, stream: wasn't counting the number of output bytes
generated during Finish()

This was SVN commit r6034.
2008-06-16 20:33:47 +00:00
028a92375f fixes from work:
- aligned_allocator.h: use _mm_malloc instead of _aligned_malloc
(somewhat more portable)
bits: fix incorrect handling of bit_mask(0)
- archive_zip.cpp: fix ArchiveWriter_Zip (wasn't opening its output
file, ECDR record wasn't at end of file due to padding)
- io_align.cpp: move routines to header (DLL export)
- wdbg_heap.cpp: avoid crash in report hook if CRT memory block is
invalid

This was SVN commit r6030.
2008-06-16 18:36:36 +00:00
2b4f3416a8 SimulationScriptInit.cpp: add missing headers
SoundGroup.cpp: fix: avoid invalid-handle complaints if quickstart has
disabled sound

This was SVN commit r6029.
2008-06-16 18:33:47 +00:00
b0a6d6dca8 committing the current status of dacian's new network code on matei's request
also includes sound support.

GameSetup: ensure all ScriptingInit are called; moved simulation
ScriptingInits and init/shutdown to SimulationScriptInit.cpp (reduces
#includes)

This was SVN commit r6028.
2008-06-16 18:19:35 +00:00
6324deb7d0 fix to prevent further issues due to invalid XMB files (c.f. matt's "crash upon combat" bug report, http://www.wildfiregames.com/forum/index.php?showtopic=11703). as per philip's excellent suggestion, they are now only tagged with a header iff the file contents are valid.
details:
- add a new magic string "XMBu" to indicate an unfinished XMB file;
- header magic fields are now exclusively strings to avoid type punning;
- XMBFile::Initialize now has a return value which is checked by
ReadXMBFile;
- the XML loader re-creates the XMB if that fails.

This was SVN commit r6016.
2008-06-15 17:24:32 +00:00
34fec9cb85 preemptive fix: prevent CRT error messages generated after PostQuitMessage from vanishing
This was SVN commit r6005.
2008-06-01 10:19:17 +00:00
5d80d2ee5d fixes+improvements from work:
- add AlignedAllocator - an STL allocator that returns
cache-line-aligned objects (required to avoid RFOs when threads write to
various independent items in a container)
- bits: bit_mask can now be used for N=0..numBits (works around
full-word-shifts-are-undefined issue)
- precompiled.h: remove scoped_ptr, add function-related stuff from TR1
- numa:
  . add numa_IsMemoryInterleaved
  . numa_Allocate is now able to allocate large pages as well (reduces
TLB misses)
- os_cpu: interface change to support 32-bit apps running on WoW64
systems with > 4 GB of memory
- topology: use new x86_x64_EnumerateCaches API; fix detection of cache
ID
- x86_x64: provide the means of enumerating all caches returned by CPUID
and detect L1 cache size

This was SVN commit r6004.
2008-06-01 08:25:12 +00:00
9f3c3df49c fixed logic error in VFS choose-loose-or-archive-file decision (was causing the archive file to be used regardless of whether the loose one was newer or not)
This was SVN commit r5994.
2008-05-31 18:50:39 +00:00
04127c7af3 fixes/improvements to lib code from work
- topology.cpp: modify interface due to thread-safety issue. caller is
now responsible for ensuring the first _Detect call isn't reentered;
everything else is safe.
- fix thread-safety issue in wnuma; use winit mechanism to ensure it's
ready before use
- VFS now takes a cacheSize parameter (required for being able to
disable read-only file caches for the image loader at work)
- allow dynarray that isn't actually holding memory
- debug_stl: VC9 fix (disable this code except on the exact STL version
on which it was tested)
- zlib, lib_api: changes to macro used to toggle between static and
dynamic linking
- add boost filesystem header in external_libraries
- amd64: cpu_ topology functions are now provided by x86_x64
- cpu: remove cpu_ClockFrequency (dangerous, may be tempting to use
during WHRT init which would cause a crash). use x86_x64_ClockFrequency
or os_cpu_ClockFrequency instead.
- werrno: cope with newer boost versions
- wmman: follow SUSv3 in rejecting zero-length mappings

This was SVN commit r5954.
2008-05-13 19:43:02 +00:00
d1a9348b91 major refactor of topology.cpp: each piece of information is detected separately on-demand (reduces coupling and static data)
fix documentation of ceil_log2 relating to input=0
remove os_cpu_SetThreadAffinity (redundant)
wcpu: make max # processors available via os_cpu.h; remove warning if
process affinity is restricted

This was SVN commit r5951.
2008-05-13 05:51:25 +00:00
b429c492ff (hopefully correctly) port the new os_cpu functions to Linux and OSX
the OSX port lacks thread affinity (too complex, can't test), but a link
to the API documentation is included.

This was SVN commit r5946.
2008-05-12 18:38:48 +00:00
ffdff6888d add NUMA and shared-L2-cache detect code (required at work)
enable most of IA-32 specific code to be used in amd64 (resides in
directory lib/sysdep/x86_x64)

bits: add IsBitSet
remove mem_PageSize (use os_cpu_PageSize instead)
cpuid: change interface to allow gracefully supporting later
subfunctions that require input parameters
amd64_asm.asm: add amd64 implementation of cpuid
cpu: move functions provided by OS to sysdep/os_cpu.cpp
cpu topology: avoid trouble when process affinity is set by remapping
processor numbers to 0..PopulationCount(processAffinity)
topology.cpp: move ex-ia32 topology code here.

This was SVN commit r5945.
2008-05-12 18:15:08 +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
cc243f67eb fixes/improvements made at work:
- fix lots of 64-bit warnings
- round_up/down now templates
- avoid warning with definition of byte swap functions; remove
duplication of that in wsdl
- codec_zlib.cpp: avoid domination warning
- vfs/file_cache: VFS is now responsible for handling zero-length files
(no longer considered an error; just returns zero pointer and size=0)
- cpu: export all functions (thus obviating cpu_memcpy_thunk). this
required renaming asm functions and adding thunk functions that call
them
- winit: fix segment merge statement, reinstate /include (otherwise init
functions are stripped by linker)
- wstartup: VC CRT init section definitions have changed in amd64 build;
match their definition
- wsysdep.cpp: more descriptive text for osError = 0

This was SVN commit r5899.
2008-05-01 15:41:42 +00:00
a915bdc1b6 fix problems related to 64-bit compilation in lib
. dbghelp is now pulled in by a separate external_libraries header
. disable _SECURE_SCL (improves perf)
. amd64: initial implementation of essential functions, not yet complete
. manifest: disabled on ICC because its IPO module incorrectly
interprets /manifestdependency
. wdbg_sym: no longer support stack walks on non-ia32 win2k (avoids
trouble due to mixing SEH and dtors)
. winit and wstartup: had to remove forced symbol include - does not
link otherwise on ICC (for reasons unknown). function pointers are
actually included and called on x64 windows (compiling with MSC)

This was SVN commit r5895.
2008-04-19 18:10:00 +00:00
de9cfc6592 bucket: all routines exported, add bucket_fast_alloc
This was SVN commit r5894.
2008-04-19 17:35:28 +00:00
e76a15d19d Fixed unused argument warning.
Trying post-commit hook again: fixed #194.

This was SVN commit r5885.
2008-04-15 13:49:08 +00:00
00cdb335c6 Skip standalone document declaration in generated XML, since it's pointless.
Unrelated to this checkin, fixed #194.

This was SVN commit r5884.
2008-04-15 13:45:17 +00:00
7d82d87ce8 [requires workspace rebuild due to added directory]
replace ONCE with direct calls to ScriptingInit in simulation/network
code as well.
note: GameSetup is now responsible for calling ServerSession's init
instead of Server doing it

added simulation/scripting with a module that takes care of all
scripting init (reduces CCD)

This was SVN commit r5883.
2008-04-13 14:50:11 +00:00
af6694262a cleanup:
remove ONCE(ScriptingInit) constructs, replace with direct call from
GameSetup
revised GameSetup's InitScripting (organize into groups)
JSCollection: remove #define of two concrete collection types (made
typedef, moved to their respective entity.h and player.h)

This was SVN commit r5871.
2008-04-06 14:03:23 +00:00
4dc92352fc vfs_lookup: fix bug when creating physical directories via VFS
CollageManager: avoid creating zero-length files to avoid VFS compaints
test_MeshManager.h now runs correctly without errors/asserts
XMLUtils.cpp: bugfix (pointed out by Philip)

This was SVN commit r5855.
2008-04-05 19:47:57 +00:00
bdc7f3af7c Initialize CNetServerSession and CNetClient::CServerSession at server and client startup rather than when they are first created, to prevent crashes in SpiderMonkey due to intializing during an event handler or in a different thread.
This was SVN commit r5854.
2008-04-05 18:36:39 +00:00
a9fcc1a87c small fixes required by use of lib codebase at work
This was SVN commit r5796.
2008-03-29 18:29:26 +00:00
bc999e00d7 paranoid error checking of pthread mutex functions (safely fails use-after-free requests)
fixes a crash at shutdown after a client has connected

This was SVN commit r5788.
2008-03-25 21:20:43 +00:00
1aa514a6ef fix (i.e. remove) mahaf warnings when running on least-permission account or when running multiple game instances
cpu, timer: fixes for when using lib code from DLL (required for work)

This was SVN commit r5787.
2008-03-24 15:44:37 +00:00
74b4ac19c1 cleanup+fixes; wdbg_heap is now feature complete.
should be safe to distribute this build

code_annotation.h: add our own noncopyable to avoid DLL base class
warning
debug: remove some unicode functions (unnecessary); minor cleanup
debug_stl: disabled
mahaf: do not warn when running as non admin
wdbg: add wdbg_printf and wdbg_assert for use in allocation hook. add
header
wdbg_heap: now feature complete.
. allows storing 3..4 frames from the call stack with 0 space overhead.
. prevents garbage file/line output.
. takes care of allocation counting (previously done by profiler)
wdbg_sym.cpp: cleanup+fixes (locking, wdbg_*)

fix: properly specify __declspec(dllimport) for certain classes

This was SVN commit r5679.
2008-02-25 21:19:52 +00:00
3f23e37fac fix atlas screenshot (code that passes the extension wasn't updated when porting to boost::filesystem; the one inside the game engine was)
This was SVN commit r5672.
2008-02-23 18:30:30 +00:00
bf31dd66b3 increase handle limit to 16k
in 2008-02-09 meeting, decided to stick with a fixed-size array for
simplicity. (changing to vector would require modifying the m_refd
bitset optimization. there is a 32k handle limit due to serialization
code anyway, and no pressing need to justify changing either)

This was SVN commit r5612.
2008-02-09 19:11:01 +00:00
df3198ce1e fix massive inefficiency in write_buffer (allocating new buffer each time)
This was SVN commit r5611.
2008-02-09 18:57:59 +00:00
871c71317c # fix filesystem bugs that prevented screenshots from being written
This was SVN commit r5600.
2008-02-05 07:40:57 +00:00
292975834b # remove potential confusion that was the source of map load/store bug
merge FilePacker and FileUnpacker into FileIo.
add CppDoc documentation
make clear what kind of 'size' is meant (file/buffer vs payload)

This was SVN commit r5599.
2008-02-04 11:40:42 +00:00
455556783e # Fixed walking on a multistep path, which sometimes stopped after the first few steps.
The problem was incorrect logic in the start-next-segment-of-the-path
code that was added to allow multiple segments to be handled within the
same update. I'm not sure how this worked before but it seemed to give
continuous paths! Likely that's because the pathing for contact actions
is different.

Also added more sanity checks in Aura.cpp for deleted entities in the
m_Influenced queue. There was a crash caused by something here though
it's hard to reproduce.

This was SVN commit r5597.
2008-02-04 08:24:17 +00:00
e4f3567d39 # Fixed a file save bug (wrong data size was being written, making the saved file invalid).
This was SVN commit r5595.
2008-02-04 07:30:15 +00:00
7773b9b204 # Some fixes to projectiles
- Removed use of erase() in the middle of iterating through projectiles
in CProjectileManager - that was dangerous! Replaced projectiles vector
with a linked list to make it easy and efficient to delete elements in
the middle.
- Fixed animation. It seemed like a problem with updating the Y position
came up and was more apparent as we lowered the turn length.

This was SVN commit r5593.
2008-02-03 09:10:15 +00:00
0201229520 Fixed build on Ubuntu.
This was SVN commit r5584.
2008-01-26 04:43:02 +00:00
58360a629c - fix incorrect use of block vs. sector aligned (both offset and length must be block-aligned to allow proper caching)
- use helper functions to reduce occurrences of BLOCK_SIZE and
SECTOR_SIZE
- wmi: provide for shutting it down (gets rid of its two threads); only
initialize if actually needed (costs 200ms)
- ogl_tex: don't complain if there's no gfx_card info (due to not having
used wmi)

This was SVN commit r5572.
2008-01-20 21:52:54 +00:00
aebf8cbf68 fix VFS bug preventing directories from being created:
- vfs_lookup: currentPath was of wrong type; simplified and fix create
logic
- archive_zip: fix: correctly handle filenames with /
- vfs: remove workaround for above bug
- io: temporarily disable block caching (works around problem with zip
file created by 7z)

add and use new wdbg_heap module (WIP)
remove mmgr

This was SVN commit r5571.
2008-01-20 16:53:09 +00:00
1700e90a15 fix VC9 warning*, update some comments, remove old VC6 workarounds
* http://www.wildfiregames.com/forum/index.php?showtopic=11479&hl=

This was SVN commit r5564.
2008-01-19 11:44:41 +00:00
9269be9ee3 remove mmgr and macros that redefine malloc/new/free
(see http://www.wildfiregames.com/forum/index.php?showtopic=11450&hl= )

clean up debug module
. no longer include platform-dependent header (-> less rebuilds)
. DISPLAY_ERROR -> DEBUG_DISPLAY_ERROR
. parts of config.h that don't affect all files moved to config.2 (->
fewer full rebuilds)
. remove creaky symbol cache (no longer needed for mmgr)
. remove TLS thread naming stuff (can use debugger's thread window
instead; no need for platform independence there)

wdbg: remove thread suspension and breakpoint APIs (not needed)

acpi: fix: u64 -> uintptr_t

wutil: fix WinScopedLock, use that instead of direct lock() functions

misc:
. get rid of SAFE_STRCPY, replace with strcpy_s
. remove _getcwd (shouldn't be used)

This was SVN commit r5563.
2008-01-19 11:33:11 +00:00
e9c34cc04c VS2008 compatibility
This was SVN commit r5561.
2008-01-17 23:07:26 +00:00
4df9e47976 wsdl: add WS_ flags mentioned as required by MSDN (even if it worked before)
wsdl: add note on deadlock in ChoosePixelFormat
ScriptGlue.cpp: timer.cpp no longer provides Seconds(), so remove that.

This was SVN commit r5549.
2008-01-14 21:04:55 +00:00
f4da60b0d9 timer: display clocks instead of seconds if using rdtsc (avoids needing cpu_ClockFrequency on linux, which isn't currently implemented; also avoids differing results due to CPU freq throttling)
tex: minor formatting

This was SVN commit r5547.
2008-01-13 11:25:19 +00:00
c85957662a Changed Windows memory-allocation counter to get more predictable performance. Removed slow debug_printf warning about low FPS, to avoid positive feedback.
This was SVN commit r5546.
2008-01-12 21:08:11 +00:00
8e341c2d6b shared_ptr: use Philip's idea of making the Deleter's operator() a template instead of its enclosing class. in code, use DummySharedPtr() instead of passing a DummyDeleter
h_mgr: compile fix for windows memory tracker (see forum thread)
timer: add assert to catch incorrect behaviour as reported by philip

This was SVN commit r5544.
2008-01-10 19:29:52 +00:00
52626dd655 Fixed that CNetLogManager::Shutdown wasn't called. Fixed that CNetLogger::m_Level was used uninitialised.
This was SVN commit r5542.
2008-01-10 01:17:09 +00:00
5d50893c00 Fixed h_mgr crash on Linux
This was SVN commit r5541.
2008-01-10 00:50:05 +00:00
607094333a Added ArrayDeleter for shared_ptr(new[])
This was SVN commit r5540.
2008-01-08 23:38:52 +00:00
6541294ebf More Linux build fixes
This was SVN commit r5539.
2008-01-08 00:09:52 +00:00
e1e9ba150c additional linux fix (hopefully): "add" sscanf_s
This was SVN commit r5538.
2008-01-07 20:07:05 +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
3273a8425c Partial Linux build fixes
This was SVN commit r5536.
2008-01-07 15:32:32 +00:00
2c2a394a1e Fixed allocators.h reference. Fixed repeated warning in GCC.
This was SVN commit r5535.
2008-01-07 02:06:27 +00:00
ad55f9f1bc pending improvements and partial fixes to self-tests
fix: g_frequencyFilter is now in globals.cpp instead of in main (since
other modules access it and main.cpp isn't included in the self-test)
fix: globals.h now avoids dragging sdl.h into other projects
allocators: got rid of references to the old master header (must now
include the specific header, e.g. dynarray.h)

This was SVN commit r5534.
2008-01-03 22:07:18 +00:00
9cea581f43 config: add means of enabling/disabling wsdl (and cautionary note about SDL on windows)
wsdl: fix mouse trouble related to shutdown, use wmi instead of ddraw,
disable low-level kbd hook (not needed), cleanup

This was SVN commit r5533.
2007-12-29 16:45:22 +00:00
5529977ecd fix: CLogger's ELogMethod is now inside the class and does not use names that are vulnerable to macro destruction (fixes a conflict with Windows system header's #define ERROR)
This was SVN commit r5532.
2007-12-29 16:22:23 +00:00
6c99218ce1 forgot to add this file :S
This was SVN commit r5528.
2007-12-23 12:56:40 +00:00
2bffecb331 h_mgr: fix: ModuleInitState wasn't set => shutdown didn't happen => leaked a lot of memory
sysdep/win: save-last-error logic now wrapped in a scoped class (avoids
need for "goto exit")

This was SVN commit r5527.
2007-12-23 12:20:37 +00:00
5bf9bca9ef fix/disable warnings.
there are too many W4 and "potentially uninitialized", so those are
disabled by 0ad_warning_disable.h.

the silly "int x = strlen" and very dangerous "int x = (void*)p" (and
vice versa) problems are fixed.

This was SVN commit r5526.
2007-12-23 12:18:57 +00:00
8667ea74c8 fixes and improvements
- directoryPosix: replace most methods with boost filesystem (but not
all: the latter cannot efficiently enumerate files AND query their
size/mtime)
- AllocatorChecker: better name for member functions
- file: move the File class here
- trace: bugfix
- io: move UnalignedWriter to write_buffer.cpp (basically the same
thing)
- vfs: remove unnecessary "vfs" warts from variable names
- vfs_tree: VfsFile now stores single Name/Size/MTime fields instead of
the FileInfo record (less clunky)
- vfs_path: use boost filesystem's version of the basename/extension
functions
- lf_alloc: remove (no longer necessary, won't be finished - not worth
the trouble)
- path_util: remove path_foreach_component (replaced by better path
traversal logic) and PathPackage (obsoleted by fs::path)

! resource loading code now receives VfsPath as its filename. there is
also OsPath (native absolute path) and Path (relative to binaries/data)

- tex is now independent of file loading code; it just en/decodes
in-memory buffers
- wdll_ver: clean up, use smart pointer to simplify bailout code
- wsdl: remove nonexistent failure path from calc_gamma (cruised by here
because SDL_SetGamme is failing once after a cold boot at work)
- wsnd: simplify OpenAL DLL search, use boost::filesystem
- wutil: Wow64 redirection is now packaged in a (RAII) class

This was SVN commit r5525.
2007-12-22 18:15:52 +00:00
d10b4851e2 fix: "config.h" should be "lib/config.h" (not sure why VC finds the files even though they are in different directories)
This was SVN commit r5522.
2007-12-21 08:17:20 +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
63086f4e26 part3: now functional file loading code (not entirely finalized)
(too many changes to list..)

moved tex_* files to lib/tex
archive builder and hotloading modules are disabled.\

This was SVN commit r5518.
2007-12-20 20:14:21 +00:00
2e5d9452aa part2: misc source/lib fixes/improvements
move all except user-specified config choices out of config.h and into
appropriate headers
CPU_IA32 -> ARCH_IA32
wsdl: disable use of ddraw (will soon be replaced by WMI)

use shared_ptr without namespace qualifier (it's in tr1)
debug_warn -> debug_assert(0)
LIB_API to allow building as DLL
smart pointers: reduce use of .get()
cache_adt: use map instead of hash_map (avoids needing a hashCompare
class). also remove spurious warning
code_annotation.h: better cassert implementation
move FPS measuring portion of timer.cpp into frequency_filter
move include of memory headers into mmgr.h (to avoid errors, we must
ensure they are included if mmgr is used)
posix_filesystem.h: move definition of mkdir to wfilesystem
stl: disable iterator checks in release mode
wmi: fix COM init bug, use smart pointers
wutil: add code to get DLL module handle (if compiled as such), add
WinScopedLock
timer: fix handling of raw ticks

This was SVN commit r5517.
2007-12-20 20:09:19 +00:00
03543147b7 part1a: misc fixes
TerrainOverlay: fix warnings
PathfindEngine.cpp: correct float type, mark as noncopyable
TriggerManager: explicitly construct as CStrW

This was SVN commit r5516.
2007-12-20 19:57:41 +00:00
541de496e3 part1: misc fixes
se_dcdt: reduce warning spew a bit
TerrainOverlay: fix warnings
PathfindEngine.cpp: correct float type, mark as noncopyable
TriggerManager: explicitly construct as CStrW

This was SVN commit r5515.
2007-12-20 19:56:01 +00:00
b00ac7e5b5 fix to ia32_Generation (unfortunately, things are not as simple as querying the CPU family).
this hopefully fixes lag problems michael is seeing because rdtsc is
being used on his 7-th gen athlon (which was falsely reported as 6th gen
by the old version of this code)

This was SVN commit r5510.
2007-12-10 21:32:38 +00:00
75ab906315 WIP file code, getting pretty close to functional
archive: ArchiveEntry now a mememto and not exposed directly
typedefs for boost::shared_ptr
fixed up dir_util to new interface
add "FileProvider" that does Load/Store and indicates Precedence

vfs: structure has changed. one RealDirectory per OS dir; vfs_tree
stores it; populate uses it to Add() stuff to vfs_tree; lookup does path
traversal and calls populate

This was SVN commit r5499.
2007-12-01 18:32:43 +00:00
ea96aa6b89 bucket: remove size optimization that causes warnings
path_util: add path_IsDirectory and path_split
wdbg_sym.cpp: bugfix for non-IA32 codepath

This was SVN commit r5498.
2007-12-01 18:23:28 +00:00
f304a4debe Enable overlays other than the pathfinding one when the pathfinding one is hidden.
This was SVN commit r5496.
2007-12-01 18:05:46 +00:00
317f98a6c0 WIP of new file code
archive: pretty much done except for trace and archive_builder
IO: io_manager still needs to be fixed/revised (especially WRT buffer
and alignment management)
posix: done
vfs: need to complete vfs_mount and tie it in to vfs.cpp
dir_util: needs further revisions (VFS interface changed since then)

This was SVN commit r5475.
2007-11-20 18:51:07 +00:00
d19a2cba65 include boost smart pointers from PCH
factor out the "atom_fn" mechanism into lib/allocators/string_pool.cpp
factor out FAT date/time handling into lib/fat_time.cpp
path_util: replace strcpy with SAFE_STRCPY; add additional functions
that avoid passing an output buffer via StringPool

This was SVN commit r5474.
2007-11-20 18:44:36 +00:00
207d1367ec # A number of network synchronization fixes.
- The server will no longer send a new turn until the previous one has
been "acknowledged". (TODO: this may create lag between turns in its
current form; investigate and possibly allow executing two turns while
the third is being negotiated).
- Mutexes are now being used in NetServer and NetClient to ensure
commands go into the right batches.
- Commented out some orders in the GUI code that should not be there and
are not 100% working anyway (they were part of the follow/formation
system).
- Units that spawn or are created by scripts now have net-safe position
and orientation.
- Added a debug flag that can be turned on to print details about when
commands are received and executed (DEBUG_SYNCHRONIZATION). This is
especially useful if you diff the stdouts of two running games. There
should be no differences if everything is in synch.

This was SVN commit r5463.
2007-11-18 09:09:06 +00:00
e3d8592fa2 current version of archive interface (for review purposes)
This was SVN commit r5451.
2007-11-10 19:39:26 +00:00
0636b65228 mem: update comment
renderer, WaterManager: remove unnecessary header

This was SVN commit r5450.
2007-11-10 18:45:17 +00:00
c057dd8f10 wdir_watch.cpp: change header
wgfx: robustify gfx_get_video_mode
wfilesystem: update comments
wsnd: update comments to reflect use of readdir, not layer on top
remove test_allocators (has been replaced by tests/ in lib/allocators)

This was SVN commit r5449.
2007-11-10 17:59:47 +00:00
084ba8fcb0 cache_adt.h: add peek() routine, move CacheEntry to global scope.
config: add read-only cache option
debug: fix error code
input: remove dependency on file header
lockfree: add LF_ReferenceCounter

This was SVN commit r5448.
2007-11-10 17:47:25 +00:00
0095685b71 fix issues with HeaderlessAllocator (incorrect list insertion order, document a known limitation of the allocator). green bar
This was SVN commit r5447.
2007-11-10 17:43:02 +00:00
05cadb76a8 problems with self-test: partial fixes, disabled the currently failed tests
(it's possible they are exposing the bug causing cacheAllocator to fail
on linux)

This was SVN commit r5446.
2007-11-10 14:07:50 +00:00
23a1c6196f incorporate allocators/ into build
the old lib/allocators.h is now a bridge to the new headers (temporary)
make slight interface changes in lib/res/file to match new allocators
interface

This was SVN commit r5445.
2007-11-10 13:55:32 +00:00
11081d8e36 fix: update-workspaces is picking up the self-tests in this "branch", so rename the test dirs
This was SVN commit r5444.
2007-11-10 13:47:43 +00:00
149ebb67c0 add WIP file code to a new folder (not included in the build)
This was SVN commit r5443.
2007-11-10 13:39:45 +00:00
abc8edceeb delete the correct files this time..
This was SVN commit r5442.
2007-11-10 13:34:13 +00:00
954ff35810 comedy of errors: deleted in the wrong place -.-. reverting changes from that revision..
This was SVN commit r5441.
2007-11-10 13:33:28 +00:00
e6dd9f1f1b these files were mistakenly copied from lib/res/file to lib/file; that revision can't be reverted, so delete.
This was SVN commit r5440.
2007-11-10 13:29:54 +00:00
267eac33b5 This was SVN commit r5439. 2007-11-10 13:15:03 +00:00
e8f6fe7172 move allocators here (the old cache_allocator is now in headerless.cpp)
This was SVN commit r5438.
2007-11-10 13:13:36 +00:00
6ba71202c9 # Multiplayer synchronization fixes.
This was SVN commit r5429.
2007-10-23 06:52:23 +00:00
6f376f0b0f Changed console net log level to ERROR, to reduce message spam.
This was SVN commit r5423.
2007-10-21 09:40:06 +00:00
41d3ef5fa5 Fix compile on GCC 4.1, where the ArraySize function trick did not work.
This was SVN commit r5418.
2007-10-17 07:36:12 +00:00
e6604e7c0e Fix more DCDT compile errors (in gcc 4.1.2 on Linux).
This was SVN commit r5417.
2007-10-16 08:12:48 +00:00
kai
f20890f5fa pathfinder change: triangulation now handles static object update and removal. dcdt initialization is moved to RequestTriangulationPath() and will only be invoked when -triPathfind flag is supplied. unit radius slightly increased (again) to revolve the unit bouncing problem around buildings.
This was SVN commit r5416.
2007-10-13 23:37:23 +00:00
ddffdba2c3 Changed console character to a _ since the vertical line glyph didn't seem to be available on OS X.
This was SVN commit r5415.
2007-10-13 18:22:20 +00:00
8a5ba90c53 Removed assert(g_Console) from console logging functions, because g_Console might not exist on shutdown.
This was SVN commit r5414.
2007-10-13 16:59:03 +00:00
990f603655 Fixed a freeze where a lock was acquired twice (in OpenFile and Activate).
This was SVN commit r5413.
2007-10-13 16:56:05 +00:00
336573b114 Fix Windows and GCC compile errors.
This was SVN commit r5412.
2007-10-13 16:36:17 +00:00
dax
746c081c9c Network logging has been improved with a more flexible set o classes (sinks). Two implementations for a file sink and the game console sink are provided so currently network logging is output using both these sinks.
This was SVN commit r5411.
2007-10-13 15:17:50 +00:00
caeade1b95 Fix struct sockaddr.
This was SVN commit r5408.
2007-10-12 07:41:19 +00:00
277ed33da6 # OS X fixes.
- Networking no longer tries to use IPV6, ignoring the family type of
CSocketAddr. This address will be replaced when we switch to ENet
anyway.
- The name of the Atlas semaphore now also includes a timestamp, since
the RNG generated the same sequence of names for multiple runs of the
game, causing problems if the games crashed and leaked semaphores, and
making debugging painful.
- get_executable_name now also works if the game is within an app bundle
(useful for packaging it more nicely later on, and since wxWidgets
expects us to be in an app bundle).

This was SVN commit r5407.
2007-10-11 08:00:05 +00:00
46dd72de18 # Fixed STL debug compile errors on GCC.
This was SVN commit r5406.
2007-10-11 07:55:24 +00:00
fa0a07cdab # Fixed DCDT compile errors on GCC.
This was SVN commit r5405.
2007-10-11 07:54:52 +00:00
kai
7ba586b16e adding flag -triPathfind to enable triangulation pathfinding. it will use the orignial A* without the flag
This was SVN commit r5397.
2007-10-10 19:35:23 +00:00