1
0
forked from 0ad/0ad
Commit Graph

315 Commits

Author SHA1 Message Date
78ccac427d Remove -fixedframe mode since it doesn't work at all
This was SVN commit r7549.
2010-05-20 00:55:02 +00:00
f0c2479309 avoid non-utf8 encoded characters being passed to main() on windows
refs #503

This was SVN commit r7544.
2010-05-14 21:15:33 +00:00
e140aa7baf Avoid running the old simulation code in the background when it's not needed.
Optimise GUI updates to only occur when necessary.
Switch to more peaceful music after starting the game.

This was SVN commit r7492.
2010-05-01 16:20:58 +00:00
c02771fef2 Remove CSoundGroupMgr, since it is unnecessary and broken and leaks memory
This was SVN commit r7442.
2010-04-06 15:17:06 +00:00
53744640ec Fix non-PCH builds
This was SVN commit r7409.
2010-03-28 18:21:48 +00:00
89cce1b3ac # Switch to new simulation system by default
This was SVN commit r7401.
2010-03-26 16:10:42 +00:00
7c2e9027c2 # Rewrite of the game's simulation system
Giant merge from
http://svn.wildfiregames.com/hg-source/file/5fb522019d5e
Infrastructure is largely complete, gameplay is largely missing
Disabled by default; use command-line flag "-sim2"
(Second attempt at commit...)

This was SVN commit r7259.
2010-01-09 19:20:14 +00:00
f0d9806b3f # Restructured GUI implementation
CGUI now represents a single 'page'. CGUIManager maintains multiple
pages and switches between them.
Split the XML files into pregame, loading, session and messagebox pages.
Added hotloading of GUI pages.
Minor GUI cleanups.
(Merge from hg 81862d33780c)

This was SVN commit r7214.
2009-12-03 20:17:22 +00:00
f85f0c0c2e (Dummy change to help hgsvn)
This was SVN commit r7213.
2009-12-03 20:10:22 +00:00
6ec9128e78 refactor: move reload functionality into ps/Filesystem to allow reloading non-resource files (e.g. scripts); VFS is now responsible for returning VirtualPath and invalidating the changed file/directory
This was SVN commit r7171.
2009-11-06 11:50:04 +00:00
4c44602ea0 add support for hotloading (i.e. reacting to directory change notifications and reloading the affected files)
also clean up VFS a bit.
ogl_tex now tolerates deleting/renaming texture files that are in use
(except for a warning message which can be 'continue'd)

This was SVN commit r7166.
2009-11-04 22:35:54 +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
6b619cfb38 remove obsolete NO_GUI that's just cluttering up the code
This was SVN commit r7086.
2009-08-08 10:04:43 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
07a4f809d8 # Replace Xerces with Libxml2
(in Xeromyces, whose name now doesn't make much sense but oh well)

This was SVN commit r6770.
2009-03-24 00:55:35 +00:00
fe6370aff8 more dehydra. disabled lockfree module (not in use).
This was SVN commit r6240.
2008-07-17 17:00:00 +00:00
e14d5be529 timing-related fix (only occurs with certain timer resolutions due to incorrect arithmetic)
frequency_filter wasn't dealing correctly with resolution = 0
.. which was happening due to incorrect cpu_i64FromDouble macros

This was SVN commit r6200.
2008-07-05 08:27:33 +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
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
871c71317c # fix filesystem bugs that prevented screenshots from being written
This was SVN commit r5600.
2008-02-05 07:40:57 +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
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
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
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
ee0c58dbc2 fixes for the relocated res/file/archive stuff (adjust include paths)
also moved vfs_optimizer into archive directory

This was SVN commit r5389.
2007-10-06 07:45:15 +00:00
5664f097d9 Profiler: Added malloc-counting to GCC. Fixed counting of unlogged allocations in the root node.
GUI: Tried a tiny bit to improve the response to mouse movement.
Atlas: Realised you can do "new XML(...)" to parse XML.

This was SVN commit r5180.
2007-06-15 17:03:26 +00:00
92578ae553 # Some initial work on networking, fixing session setup, game startup, and command queueing.
- Fixed outdated / buggy networking code in the GUI scripts.
- Finished the API to CNetClient so that it's possible to start a CGame
from it.
- Some enhancements for debugging networking: Enabled updates while the
game is minimized/out-of-focus if it's in a network session. Also
reduced the turn length to something slightly more manageable but still
unplayable (1 sec versus 3 sec).
- Fixed a bug where IssueCommand used to access the order it creates
after queueing it, which is bad if the order gets deleted while being
queued (e.g. in CNetClient).

This was SVN commit r5139.
2007-06-04 07:41:05 +00:00
ecaf665d5a Separate JS_ShutDown from the normal ScriptingHost shutdown, because it's resetting non-thread-safe per-process state.
DllLoader: Report dlerror when dlopen fails.
AtlasObject: Avoid ICC warnings caused by 'const T' being equivalent to
'T' when 'T' is already const.

This was SVN commit r5133.
2007-06-03 15:37:26 +00:00
c9f10be090 acpi and mahaf: now set ModuleInitState to error if something fails (prevents a subsequent init from returning true and allowing its dependent to continue and crash into a wall)
wtime: "implement" CLOCK_MONOTONIC (that's what the timer already did,
anyhow)

main: move early init to GameSetup!EarlyInit (fixes atlas problem with
timer)

This was SVN commit r5101.
2007-05-26 23:29:20 +00:00
44f5288a1d # SwEng
png.h, wxwidgets.h: automatically link against lib files
main: document and avoid potential memory leak with args
AtlasUI/ErrorReporter: move crashlog_sender.cpp here as per Philip's
suggestion. currently disabled via #if 0
stdafx: add missing header apparently required by trigger.h

This was SVN commit r5034.
2007-05-05 17:41:20 +00:00
4be0fe18a0 # SwEng
. major compat fixes for interoperation with wxw.
. add crashlog_sender (modified version of debgrpt wxw sample). compiles
but untested, will be changed heavily
further improvements:
. wposix no longer declares CRT functions. instead, use CRT headers..
but don't allow their (incorrect/non-POSIX) declarations to propagate to
users.
. split up win.cpp into wstartup, wutil, winit
. extern "C" -> EXTERN_C
. move sdl.* to lib/external_libraries and add png.h+zlib.h (fixes for
and include of the library)

This was SVN commit r5028.
2007-05-04 17:30:32 +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
102b3925ac GCC compatibility
This was SVN commit r4872.
2007-02-07 14:02:09 +00:00
465c0a037b # Fixed some trigger bugs.
- Conditions were not properly converted to JavaScript (not read from
the XML file correctly either).
- Added an OrderFromTriggers function so that triggers can give orders
which ignore fog of war.
- Fixed some spelling mistakes in TriggerSpecs.xml (parameter vs.
parameters).
- Moved trigger update to CSimulation update, which is more correct.

This was SVN commit r4821.
2007-01-29 22:21:25 +00:00
ec69bccb2c # Tidied up some code.
- Made some classes not be singletons, since there's no reason why they
should be.
 - Made them non-global too (because globals have unclear lifetimes, and
make it harder to test things, etc). They're now owned by CGameView and
CWorld, and mostly accessed via g_Game or arguments (vaguely trying to
avoid the graphics code calling into the game code).
 - Moved CGameView implementation into pimpl, so the header file isn't
so heavy.
 - Changed a few pointers into references, to indicate that they're
never NULL.

This was SVN commit r4756.
2007-01-08 01:56:46 +00:00
95f8aa126f # fixes for overzealous vc8 optimization and housekeeping
these are required by thesis and improve 0ad code.
- sysdep/win init/shutdown mechanism is now better documented and
survives clever vc8 optimization
- moved some extern declarations from win_internal into separate headers

main: remove debug_filter_add("LOADER") - was for my debugging
convenience

This was SVN commit r4752.
2007-01-07 16:50:36 +00:00
cbafd43eea # Changed handling of command-line arguments.
* Added CmdLineArgs, which does the parsing then lets various pieces of
code check for whatever arguments they want.
 * Made Atlas exit out of main() cleanly, instead of calling exit()
itself.
 * Disabled the global exception-catching in unit tests, via a
entry_noSEH, so it doesn't make debugging harder.
 * Added nice printing of CStr in unit test failure messages, and added
comparison of vector vs constant array.

This was SVN commit r4688.
2006-12-09 14:39:52 +00:00
pyrolink
0d0a767fa2 #Trigger framework, terrain flattening on building placement
This was SVN commit r4648.
2006-11-24 19:45:04 +00:00
12f0720f31 More minimap fixes on game restart (recalculate everything because the map size might have changed).
This was SVN commit r4520.
2006-10-08 03:28:22 +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
8e02ec84f9 Updated OpenAL to 1.1 (which no longer includes ALUT).
Changed player-id code a bit so the entity and actor and unit should
stay in sync more often. (The entity/actor/unit mixing still looks a bit
dodgy and unreliable, though.)
Simplified console help code.
Allowed init/shutdown to be done with the simulation/world/etc parts
disabled (so the actor viewer can load faster).

This was SVN commit r4289.
2006-09-02 21:20:25 +00:00
35e91718c5 # Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.

This was SVN commit r4261.
2006-08-28 17:36:42 +00:00
bc24974496 # sweng
forward declare SDL_event. remove SDL dependency of network code.
refs #140

This was SVN commit r4252.
2006-08-26 21:52:18 +00:00
7d3d8fdbf3 # move ps/Network into top level project (and static lib).
This was SVN commit r4249.
2006-08-26 20:25:37 +00:00
e4ed1d52b9 # CSimulation cleanup and optimization (1)
moved some fields (e.g. size of health bar) out of CEntity and into
BaseEntity so they can be shared between entities (instead of duplicated
in each).

TODO: is it ok to remove AddProperty for those properties in CEntity?
(BaseEntity is still adding them)

This was SVN commit r4078.
2006-07-12 14:36:59 +00:00
5586f29c5f # housekeeping
remove no longer needed timers and debug_printfs.
delete JSInterface_*Entity.cpp files because they are empty and cause
linker warnings.

This was SVN commit r4043.
2006-06-26 12:47:23 +00:00
d0acaecc5c # housekeeping
fix warnings in self tests
make win_pre_main_init manually callable and remove the main() hook (see
rationale at decl of win_pre_main_init)

This was SVN commit r3981.
2006-06-08 21:27:03 +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