1
0
forked from 0ad/0ad
Commit Graph

54 Commits

Author SHA1 Message Date
a5c82a4ef6 Removes unused forward declarations of class and struct.
This was SVN commit r25903.
2021-09-08 19:43:01 +00:00
34b1920e7b Split ScriptRequest in its own header.
We often only need to include ScriptRequest.h and not the full
ScriptInterface.h

Differential Revision: https://code.wildfiregames.com/D3920
This was SVN commit r25366.
2021-05-03 16:07:26 +00:00
f6348b9617 Clean up header includes, add new forward declarations.
This cleans up many un-necessary header includes, either simply
providing nothing or forward declarations in their place.

No major compilation time change here, though this does reduce depencies
in some headers.

Also fix up old MacOS STL-include fixes that are no longer relevant.

Differential Revision: https://code.wildfiregames.com/D3128
This was SVN commit r24227.
2020-11-21 11:20:29 +00:00
fd8f5abd2e [SM52 2/2] Update to Spidermonkey 52 APIs.
No particularly noteworthy changes, as most complex API changes were
already supported in SM45 and done.
The addition of JSStructuredCloneData allows to remove our custom class.

Changes:
- InformalValueTypeName is back in the API, so remove our
implementation.
- Stop using JSRuntime entirely in favour of JSContext*
- JSPropertyDescriptor is renamed.
- CompartmentOptions are tweaked slightly (no functional changes)
- JS::Construct - API update.
- JSClass split - API update.
- A js.msg error message was removed, so we had to use a different one.
- Tests fix: fix comparison of union instances
- Disable warning in spidermonkey Vector.h
- Update error reporting to SM52 (minor API updates)
- Ignore warnings about unused return values (would come from OOM, which
isn't recoverable)

Most of the patching was done by Itms.

Tested by: Stan, Freagarach
Fixes #4893

Differential Revision: https://code.wildfiregames.com/D3095
This was SVN commit r24203.
2020-11-18 14:39:04 +00:00
ce580f0de0 Always delete CMapReader. Patch by Sandarac. Fixes #4154.
This fixes an assertion failure in ScriptEngine that can occur when
closing
the game while in the loading screen.

Reviewed By: vladislavbelov, leper
Differential Revision: https://code.wildfiregames.com/D684
This was SVN commit r20035.
2017-08-25 00:37:48 +00:00
9defd11440 Pass ScriptInterface as a const ref where possible.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D739
This was SVN commit r20028.
2017-08-24 00:32:42 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
0cc23c1964 SpiderMonkey 38 upgrade: 33/35
Remove a workaround. Note that this removal is incomplete. Based on
patch by leper.

This was SVN commit r18687.
2016-09-02 16:53:22 +00:00
a144ec7e08 Indentation corrections and other code style fixes in preparation for the cinematic camera patch.
Refs #3301

This was SVN commit r17578.
2015-12-31 13:40:56 +00:00
c02a7e1a7b SpiderMonkey 31 upgrade
This upgrade also introduces exact stack rooting (see to the wiki:
JSRootingGuide) and fixes problems with moving GC. This allows us to
enable generational garbage collection (GGC).
Measurements a few months ago have shown a performance improvement of a
non-visual replay of around 13.5%. This probably varies quite a bit, but
it should be somewhere between 5-20%. Memory usage has also been
improved. Check the forum thread for details.

Thanks to everyone from the team who helped with this directly or
indirectly (review, finding and fixing issues, the required C++11
upgrade, the new autobuilder etc.)! Also thanks to the SpiderMonkey
developers who helped on the #jsapi channel or elsewhere!

Fixes #2462, #2415, #2428, #2684, #1374
Refs #2973, #2669

This was SVN commit r16214.
2015-01-24 14:46:52 +00:00
ceb3c3d366 MapReader: Load terrain before entities.
This allows component Init functions to make use of the terrain
immediately, instead of delaying some computations until the first
frame.

This was SVN commit r15262.
2014-06-01 18:08:11 +00:00
7901ed51d4 Implements skirmish maps, based on patch by sanderd17, fixes #1198. Skirmish maps are like scenarios, except the player can choose their civ during match setup. To create a skirmish map: place some skirmish entities for each player in Atlas (see templates/skirmish/* for examples), uncheck the player's civ in Atlas' player panel if desired, and save in the maps/skirmishes directory. The map will appear in match setup under the "Skirmish" match type.
Implements custom, VFS-based map load/save dialogs for Atlas (replaces
broken native file dialogs), fixes #631, #889.
Fixes map loading/saving to handle arbitrary subdirectories for better
organization.
Adds default settings to Atlas player panel, fixes #1872. Each setting
now has a checkbox to choose whether it should be saved with the map
(avoids writing lots of useless default data for each map).
Adds map preview setting to Atlas, refs #1745.
Cleans up and simplifies some duplicate code.
Fixes optional serialization performance test.

This was SVN commit r13938.
2013-10-04 02:29:16 +00:00
1fb7889539 Postproc manager
This was SVN commit r12755.
2012-10-15 10:34:23 +00:00
29e4f633f1 Add initial serialization test mode.
Reduce some dependencies on CSimulation2 to provide more flexibility.

This was SVN commit r10426.
2011-10-24 14:31:05 +00:00
3e4d74480d Adds AI control to Atlas player panel
Adds camera control to Atlas player panel
Changes map reader to handle per-player starting camera position. See
#55
Adds entity name filter to Atlas object panel
Fixes bug in Atlas map settings (caused crash when object panel was not
loaded)

This was SVN commit r9617.
2011-06-13 23:32:41 +00:00
942a45372c Random maps generated in their own thread, loading GUI is updated with progress.
Fixes some bugs in game loader error handling.

This was SVN commit r9220.
2011-04-10 05:31:18 +00:00
0e0ed94926 Implements random map system, fixes #6.
Includes default library "rmgen" w/ API based on rmgen tool.
Modifies rmgen scripts Cantabrian Highlands, Neareastern Badlands, and
Latium.
Old map support dropped from MapReader.
Fixes a few bugs in existing game setup and initialization scripts.

This was SVN commit r9096.
2011-03-22 01:34:45 +00:00
1c7e33b528 Remove a load of implicit CStr type conversions, since they're error-prone and can cause silent data loss.
Handle most CStr8/CStrW conversions via UTF-8 instead of effectively
assuming Latin-1.
Return UTF-8 strings from Xeromyces API.

This was SVN commit r8929.
2011-02-17 20:08:20 +00:00
9ee44bd9b8 Game setup changes, including showing name, civ, team, and some options loaded from the scenarios. Civ data added. Civ info window to preview civs. Icon tooltips. Support for random map implementation. Fixes #590.
This was SVN commit r8494.
2010-10-30 04:02:42 +00:00
6c7830df3f Rename CTextureManager and CTextureEntry since they are only for terrain textures
This was SVN commit r8076.
2010-09-04 21:26:52 +00:00
6c7b82130c # Redesigned the camera control system.
Add shift+wheel (and Q/E, and ctrl+arrows, and ctrl+WASD) to rotate the
camera.
Restrict the rotation and zoom to narrow ranges. (Constraints can be
disabled in the dev overlay).
Smooth the movement and rotation.
Fix some stupid whitespace.
Fix some const correctness.

This was SVN commit r7930.
2010-08-13 13:26:29 +00:00
65bcedb9fc Load map descriptions from their XML file.
Add basic hold-fire stance, and use it for some test maps.
Add JSON data container to map XML files, to simplify the interaction
between scripts and maps.
Fix fixed-point printing so it roundtrips safely through map files.
Fix camera startup positions in old-format maps.

This was SVN commit r7844.
2010-08-04 21:15:41 +00:00
c57575df3e Set each player's default camera location to their civ center.
This was SVN commit r7672.
2010-07-03 13:15:57 +00:00
11a20e1bcf # Handle terrain passability and movement costs in pathfinder.
Simplify terrain code (remove Handle indirection).
Delete unused terrain properties.

This was SVN commit r7590.
2010-05-27 23:31:03 +00:00
c34392053f # Add a demo map with all units on it.
Support XML-only maps with simple flat terrain.

This was SVN commit r7501.
2010-05-03 19:13:58 +00:00
5daac34ef9 Support startup scripts in map files, for testing.
Support CDATA sections when writing XML.

This was SVN commit r7483.
2010-04-29 23:22:18 +00:00
02ffe82ab7 Optimised pathfinder, particularly to avoid slow MSVC debug STL.
Added rough pathfinder test system.
MapReader: support loading maps into a minimal non-graphical environment
(for tests).

This was SVN commit r7317.
2010-02-08 22:05:05 +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
6cc0b1649a robustified GetPatch / GetTile:
- clarify the meaning of mapSize (patchesPerSide)
- use a single ClampCoordToMap function for clamping
- add annotations to all call sites when it is sure they will succeed
- otherwise, ensure return value is checked or at least add debug_assert
fixes #311 (successfully built house and dock at top of latium map)
thanks to Heron for tracking down the cause!

This was SVN commit r7183.
2009-11-08 16:49:52 +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
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +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
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
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
bdbb2bcb16 # Updated unit animation code.
Added UnitAnimation class, to act as the interface between the entity
and actor. (Currently doesn't work very well, but it does make
animations loop smoothly and sometimes kind of makes them stay
synchronised.)
Fixed corpse animation - it now plays the final frame of the death
animation before turning static.
Fixed update/interpolate timings.
Added JS function saveProfileData.
Updated ffmpeg library.

This was SVN commit r4880.
2007-02-10 03:09:52 +00:00
7130b389db Atlas: Disable selected tool before saving, so unit-placement previews don't get saved as real units.
Misc: Removed redundant code.

This was SVN commit r4857.
2007-02-04 14:56:38 +00:00
pyrolink
0d0a767fa2 #Trigger framework, terrain flattening on building placement
This was SVN commit r4648.
2006-11-24 19:45:04 +00:00
pyrolink
b62f53620f #Cinematic editor
This was SVN commit r4234.
2006-08-22 02:24:44 +00:00
92b9c07f95 Restoring SVN repository:
Greek basket texture

# New Greek vases

# housekeeping
documentation fix: trailing / in directory names is mandatory

# Atlas: Sky texture selection; save with maps

Atlas code tidying: Slightly nicer syntax for defining command handlers,
and some explanation of how it works

Automated build.

This was SVN commit r4008.
2006-06-21 22:37:31 +00:00
039f26f0c3 Fixed editor brokenness.
# More useful environment (water, lighting) editing
(now saved into the map files).
Fixed no-PCH a bit.

This was SVN commit r4002.
2006-06-11 07:03:59 +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
f45c44ca09 Rotated various things (terrain texture UVs, default light and camera angles) by 45 degrees.
Map XML: Store camera position. Stopped using DTDs (because they make it
too hard to change the XML structure without breaking all the old XML
files).
Game.h: Include fewer files, to make compilation sometimes faster.
World: Changed some things to not be singletons, since they were
(ab)used as CWorld members.

This was SVN commit r3670.
2006-03-21 20:55:45 +00:00
4aa740bff5 - split up lib/res into file, graphics and sound.
- wposix.cpp: initial support for MEM_RESERVE and MEM_COMMIT semantics
in mmap
- cstr: removed no longer necessary serialization header
- xmlutils: wrap new() calls in nommgr/mmgr; allows tracking other
allocs in this file.
- add u64_from_u32
- various minor comments/improvements.

This was SVN commit r2604.
2005-08-12 17:06:53 +00:00
ab980c1a31 Updated map format, to store lighting information in XML. Also, vital whitespace consistency improvements.
This was SVN commit r2276.
2005-05-11 03:07:08 +00:00
410c73cb46 made UnpackMap interruptible (since it takes up to 1900 ms).
root cause is slow automatic mipmap gen; philip is working on DDS mipmap
loader that allows them to be baked in.

This was SVN commit r2243.
2005-05-04 23:12:46 +00:00
e2791463a1 heavily revised.
ReadXML is now a closure that interrupts itself periodically (so
progress is updated). also split that monster into several sub-functions
and gave better variable names

This was SVN commit r2235.
2005-05-03 21:42:09 +00:00
f19d8dafee improved update frequency and accuracy of progress bar (by splitting up more init functions).
also add thunk mechanism to ease binding to member functions;
finally, added instrumentation to measure how long functions really take

This was SVN commit r2038.
2005-03-22 21:00:56 +00:00
79da4bf050 On-demand loading of actors (sort of)
This was SVN commit r2017.
2005-03-19 11:55:27 +00:00
4720a00f98 Made ScEd output entities into an XML file.
Added CStrW::utf8() (used by XMLWriter).

This was SVN commit r1716.
2005-01-12 14:31:47 +00:00