1
0
forked from 0ad/0ad
Commit Graph

2947 Commits

Author SHA1 Message Date
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