Commit Graph

85 Commits

Author SHA1 Message Date
02253f82f0 Add/rename header guards
This was SVN commit r7326.
2010-02-17 23:21:49 +00:00
a39cb0c83e Fix --without-pch build
This was SVN commit r7224.
2009-12-23 01:46:44 +00:00
77d2c67ada misc. string fixes
convert remaining %s to %hs or %ls
use WPRINTF_ARGS on unicode printf functions
fix: __func__ can't be widened via preprocessor (-> revert to char*)
convert remaining external_[directory|file_string to string()
Util: don't mix fwprintf and fprintf
Formation: fix dangling pointer (storing result of c_str())

This was SVN commit r7164.
2009-11-04 15:29:28 +00:00
8a52113e60 huge cleanup and conversion of most string handling (especially paths) to unicode
please note: format strings must be %hs for char* arguments and %ls for
wchar_t*

This was SVN commit r7161.
2009-11-03 21:46:35 +00:00
e257bef5da Fix even more 64-bit warnings
This was SVN commit r7152.
2009-10-05 16:15:51 +00:00
214b0e6683 Removed outdated licensing information
This was SVN commit r6831.
2009-04-18 17:17:34 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
1e3cd00c72 Set svn:eol-style=native
This was SVN commit r6816.
2009-04-11 17:00:39 +00:00
5341322d03 # fix some sound-related problems
clamp gain to 1.0, refactor code a bit

This was SVN commit r6517.
2008-11-23 20:29:12 +00:00
166c38dd0b Fixing crash bug:
Function call failed: return value was -100020 (Invalid function
argument), Location: snd_mgr.cpp:1696 (snd_set_gain)

This was SVN commit r6484.
2008-11-16 19:54:43 +00:00
0f559024db file: for unicode Open function, convert input to UTF8 and delegate to char* version (avoids hacky assignment to m_pathname, and also necessary because _wfopen isn't portable)
secure_crt.cpp: provide implementation of _wfopen_s

SoundGroup: fix: all attributes now have default values in case the XML
file leaves out some fields

This was SVN commit r6405.
2008-09-20 17:42:43 +00:00
fa7ce687f0 fix error handling - ensure SoundGroup doesn't crash when sound loading fails (previously it was only handling the case where loading failed due to sound being disabled)
This was SVN commit r6269.
2008-07-23 05:39:54 +00:00
4027a8f11b dehydra-inspired fix: get rid of all using namespace std (potentially confusing / pollutes namespace).
Long iterator type names are better expressed via typedefs, anyway :)
(or 'auto' keyword of upcoming C++09)

This was SVN commit r6226.
2008-07-13 21:22:03 +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
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
b5987f11e8 Cleaned up TerrainOverlay a little
This was SVN commit r6104.
2008-06-24 23:35:46 +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
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
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
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
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
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
fba692c8b5 # Fixed some warnings and potentially misleading code
* Removed ToJSVal<jsval> because it's treated as ToJSVal<long> and
causes minor confusion and/or compiler errors.
   Changed script interface functions to return either C++ types or a
jsval_t wrapper.
 * Replaced some C casts with static_cast to avoid significant confusion
and to cause compiler errors instead.
 * Removed some redundant argument-checking code. Simplified some
string-generating code.
 * Fixed some "dereferencing type-punned pointer will break
strict-aliasing rules" warnings (from `g++ -O3`).

This was SVN commit r5115.
2007-05-29 19:01:21 +00:00
9d2acce9d8 # SwEng/cleanup
- deleted most old libraries/headers in codepit to avoid confusion (they
are now in SVN anyway). updated required-libraries-linux.txt accordingly
- moved rand() into separate file, out of lib.cpp
- removed CGUIScrollBarStyle.cpp to avoid empty-file warning
- wxwidgets.h: remove redundant #pragma lib and include wxw PCH
- move openal-specific stuff to external_libraries/openal.h
- cpu, bsd: macosx is-a bsd, so only test OS_BSD

This was SVN commit r5082.
2007-05-18 00:14:26 +00:00
9809d5ace4 #bugfixes
wdbg: ignore exceptions generated during normal OutputDebugString
operation. (unclear why we are now getting them all of the sudden -
shouldn't happen!)

JS: fix strings identifying JS functions (some were inadvertently
renamed according to capitalized C++ names)

GameLoop: add code to import Atlas_ReportError

Register: fix include guard name and thus unbreak Atlas

This was SVN commit r5062.
2007-05-11 13:11:25 +00:00
a34b759720 . split up lib.h/.cpp, include the remnants from PCH, remove (pretty much universal) include of it.
. timer, config: fix definition of ALLOW_RDTSC
. add movsx_be64 (for whirlpool), revise implementation, move to
byte_order, add test
. MAX -> std::max, remove those macros
. add timestamp to system_info as requested by philip

This was SVN commit r5050.
2007-05-09 21:01:11 +00:00
78d950e419 Add some missing file comments in source/lib.
win_internal -> win.h (pulls in <windows.h>, with fixes afterwards)
remove empty waio_internal and wsysdep
Move source/sound license notice into source/sound/license.txt

This was SVN commit r5044.
2007-05-08 15:11:53 +00:00
f0babca374 add license files that are now referenced from some source files (instead of direct author/copyright/license notices in the source)
This was SVN commit r5042.
2007-05-08 14:02:06 +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
73683b6109 # SwEng
. the massive renaming undertaking: camelCase functions -> PascalCase.
. add some cppdoc.
. minor additional renaming improvements: e.g. GetIsClosed -> IsClosed
. in entity code, replace constructs like "pvec = new vector; return
pvec; use *pvec; delete pvec" with a simple stack variable passed as
output parameter (avoid unnecessary dynamic allocs)
. timer: simpler handling of raw ticks vs normal timer (less #if)

This was SVN commit r5017.
2007-05-02 12:07:08 +00:00
cfeda2cbab #fixed minor bug with soundgroups
This was SVN commit r4798.
2007-01-20 04:23:08 +00:00
95a1abbcf3 # Fixed Linux build
Forgot that you can't initialise std::exception with a message.
Fixed invalid goto jumping over declarations that aren't POD types with
no initialiser.

This was SVN commit r4793.
2007-01-19 18:06:54 +00:00
2d98baf8e5 # Sound file fixes.
JSI_Sound: Fixed problems with freeing sounds after they've been played.
Fixed non-working exception code when failing to load a file (and made
it throw an obvious std::exception instead of a hidden LibError).
Changed most functions to return false when called on a sound that has
been played already, instead of causing an invalid-handle error.
Consistentised whitespace.

This was SVN commit r4789.
2007-01-18 16:24:37 +00:00
94099e035a # housekeeping
. add note to HAVE_C99 as per last meeting.
. moved a few extern declarations to header (required for some code
analysis tools)
. tiny warning fix in SoundGroup

This was SVN commit r4772.
2007-01-14 23:13:08 +00:00
0b150ee311 #Added Sound Group Manager, updated Sound Groups.
refs #138.  Added SoundGroupMgr.h and .cpp, revised loading and clean up
in SoundGroup class.

This was SVN commit r4761.
2007-01-13 16:00:52 +00:00
db045c330b # Made Atlas compile on linux
graphics: basic terrain passibility
atlas: lots of changes to make atlas compile under linux
unix/X: more clipboard support - copy from 0AD to other programs
unix/debug: use sys_get_executable_name instead of hard-coded paths
... and lots of other misc. changes

This was SVN commit r4640.
2006-11-12 04:02:36 +00:00
1f268b17bb GCC compatibility (fixed CStr.h case, got rid of a few warnings)
This was SVN commit r4581.
2006-10-20 01:06:43 +00:00
8ef17c2d04 #fixed minor bug in SoundGroups
fixed a bug regarding the indexing of soundgroups.  index is no longer
static.

This was SVN commit r4563.
2006-10-17 07:55:35 +00:00
78382c14c9 Fixed some potential sources of errors.
This was SVN commit r4539.
2006-10-10 05:21:41 +00:00
de0f893c18 Recompiled Premake on Windows. Added some headers so HAVE_PCH=0 works in MSVC.
This was SVN commit r4442.
2006-09-30 21:36:19 +00:00
920cbe4dc3 #First submission of SoundGroup.h and SoundGroup.cpp ref #138
This was SVN commit r4440.
2006-09-30 20:13:11 +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
b8c131c431 # housekeeping
* zip.h removed old test symbols
* path_util fixed bug in mixed-separating-slash handling
* renamed ERR_OK to INFO_OK; allows searching for "return ERR_" to yield
all actual errors (instead of having to filter out ERR_OK)

This was SVN commit r3945.
2006-06-04 22:27:40 +00:00
5814e10126 # complete revamp of build system in preparation for automated self tests.
* now splits everything up into independent static libraries.
* fixed a great deal of incorrect #include statements. all headers must
now be specified with their full path relative to source. exception: if
file being included and including file are in the same directory, no
path needed.
use <> when relying on the build system's include path (e.g. for system
headers and external libraries, e.g. boost), otherwise "".

* temporarily renamed maths/Vector2D to Vector2D_Maths to avoid
conflict. these should be merged.
* hacked around VC linker stupidness when building static libs; texture
codecs must now be registered manually.

This was SVN commit r3931.
2006-06-02 03:56:24 +00:00
5f7855f7f0 Simplification of #Include paths: relative names are used only for included files in the same directory as the including file; everything else uses the full path relative to source/.
This was SVN commit r3930.
2006-06-02 02:10:27 +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
34637ba5dc # refactor sysdep API, split it into parts
- split up detect.cpp into snd, cpu, gfx (headers were already split)
- rename detect functions for more clarity (e.g. get_cur_vmode ->
gfx_get_video_mode)
- rename lib/res/sound/snd to snd_mgr to avoid conflict with
sysdep/snd.cpp
- waio: set errno in aio_rw (addresses bug #73)

This was SVN commit r3745.
2006-04-10 20:12:25 +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
c600e0a3e0 design notes from meeting: ambient sound
This was SVN commit r3336.
2006-01-08 02:05:44 +00:00