1
0
forked from 0ad/0ad
Commit Graph

79 Commits

Author SHA1 Message Date
87b5c233c5 Splits CRenderer part about scene to CSceneRenderer.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4412
This was SVN commit r26165.
2022-01-04 13:29:01 +00:00
4fba543488 Unifies providing SkyManager and WaterManager like other managers, refs b889826a3d.
This was SVN commit r26158.
2022-01-03 10:49:12 +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
781cec163e Remove CTerritoryManager pointer from CWorld, a relic from before simulation2.
Patch By: Sandarac
Differential Revision: https://code.wildfiregames.com/D731
This was SVN commit r19931.
2017-07-29 23:27:02 +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
e02d7ad949 Automatically replace %hs/%ls with %s in CLogger format strings.
Everything is char* now, so we don't need to mess around with different
string types.

Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs perl
-pi -e'1 while
s/(LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR).*)%[hl]s/$1%s/g'

This was SVN commit r16187.
2015-01-22 20:36:24 +00:00
38a8e2e0d6 Automatically convert most path.string().c_str() to path.string8()
Done with:

  ag -l 'LOG.*string\(\).c_str\(\)' source | xargs perl -pi -e'1 while
s/(LOG.*string)\(\)\.c_str\(\)/${1}8()/g'

This was SVN commit r16186.
2015-01-22 20:35:17 +00:00
49e2ecea63 Automatically convert all CLogger format strings from wchar_t* to char*.
Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs sed
-i 's/LOG\(MESSAGE\|MESSAGERENDER\|WARNING\|ERROR\)(L/LOG\1(/g'

This was SVN commit r16183.
2015-01-22 20:31:30 +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
a8a968d32c Catch exceptions by reference (by convention), based on patch from Markus, refs #1852
This was SVN commit r13421.
2013-05-22 22:27:53 +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
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
2b138f47db Handle map loading errors in autostart and normal setup modes. Adds TODOs for Atlas and Replay modes. See #764.
Fixes loading screen 'title'.
Fixes broken autostart behavior for random maps and multiplayer games.

This was SVN commit r9193.
2011-04-07 02:32:16 +00:00
dcd192cb60 refactor path interface:
- use wrapper class instead of std::wstring (reduces mixing of
strings/paths; allows safe+easy join via operator/ and convenient
case-insensitive comparison via operator==, avoids NativePathFromString,
similar to boost::filesystem)
- NativePath -> OsPath
- add hash and To/FromJSVal for Path
- add TS_ASSERT_PATH_EQUALS
- replace _wfopen_s with sys_OpenFile
- remove obsolete SortFiles/Directories

This was SVN commit r9107.
2011-03-23 13:36:20 +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
c3405e6f50 path improvements/fixes:
- replace more std::wstring with Native or VfsPath; wstring_from_utf8 ->
NativePathFromString
- replace sequences of Join(Path(), Basename+extension) with
ChangeExtension in wsdl, CacheLoader
- add Path::IsDirectory to replace .empty() / path_is_dir_sep(.back()).
also changed behavior to reflect the fact that "" is the VFS root
_directory_
- Path::Join now allows 2 identical path types (e.g. VfsPath) or one
char* literal (prevents inadvertently introducing non-safe characters).
to convert from wstring or wchar_t, use an explicit ctor (e.g.
VfsPath(wchar_t_string))

This was SVN commit r9091.
2011-03-21 19:54:08 +00:00
6d25329412 # towards locale-independent pathnames on Linux
c.f.
http://www.wildfiregames.com/forum/index.php?showtopic=14541&st=0&p=217250&#entry217250
and 2011-03-19 meeting

This was SVN commit r9090.
2011-03-21 17:53:13 +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
c0a7a36f7a Use JSFastNative API in more places, for improved compatibility with future SpiderMonkey versions.
Remove some unnecessary script-exposed functions, and move some more
into the Engine namespace.

This was SVN commit r8428.
2010-10-21 19:54:59 +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
8286218cad Delete lots of obsolete unused script-interface code.
Delete unused code from various other places.

This was SVN commit r7839.
2010-08-01 20:56:34 +00:00
1706363bab Fix #423 (Switch from CppDoc to Doxygen), based on patch from anr.
Also delete some unused declarations, and rename is_playing to
snd_is_playing.

This was SVN commit r7813.
2010-07-29 15:55: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
1c0536bf08 # Refactored the networking code, and redesigned the game setup screen.
Major updates to most network classes.
Simplify CNetServer so it doesn't duplicate any client behaviour; all
players now run CNetClient.
Remove most player/slot management from networking code.
Wait for all players to finish loading before starting the simulation.
Remove CGameAttributes; attributes are now just a JS object.
Remove CPlayer; they are now just simulation entities.
Handle player colours via simulation system.
Add a default map for Atlas, so it always has something to load.
Move network documentation to Doxygen.
Remove lots of now-unused code.

This was SVN commit r7653.
2010-06-30 21:41:04 +00:00
56bb858802 # Delete a lot of obsolete simulation code.
This was SVN commit r7555.
2010-05-20 18:09:23 +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
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
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
3334c83ce0 Fix build and tests on Linux
This was SVN commit r7174.
2009-11-06 18:35:32 +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
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
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
8d0a7170f6 # Slightly tidied up string code.
CStr: Indented comments more consistently. Made some parameters
pass-by-reference, made some others not. Removed some useless methods -
Length (use length or empty), GetSubstring (use substr), LCase/UCase
(use LowerCase/UpperCase). Removed operator[] bounds-checking because
VS2005 does that anyway.
Maybe fixed noncopyable warnings on VS2003.

This was SVN commit r4828.
2007-02-01 14:46:14 +00:00
27b6ffe2d6 # housekeeping
sorry, update-workspaces + rebuild is necessary (moved boost/utility
into PCH)

- ps/ : committed additional documentation on behalf of Joe.
- lib/ : HAVE_C99 - replace with specific e.g. HAVE_NPRINTF; intended to
help with MacOSX compat (by no longer requiring us to lie about
STDC_VERSION)
- NO_COPY_CTOR -> boost::noncopyable

This was SVN commit r4825.
2007-02-01 01:34:17 +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
pyrolink
b62f53620f #Cinematic editor
This was SVN commit r4234.
2006-08-22 02:24:44 +00:00
845b606763 # Updates to the tech system, and bug fixes.
Techs: Made a separate list of technologies for every player, rather
than array fields in CTechnology. This also involved changing the
tech-related JS functions.

Bugs:
- PS_MAX_PLAYERS should be 8 (the way it's used for array sizes, etc
indicates that it's the maximum possible number of players ever, but it
used to be 6 while the game had 8 players).
- When you changed a CJSSharedProperty that was inherited, m_Inherited
was set to false, so it was no longer inherited by subsequent entities
you created. They got initialized to garbage values as a result.

This was SVN commit r4138.
2006-07-18 04:17:46 +00:00
a56ec5bdcd Some cleanup - renamed CBaseEntity to CEntityTemplate, and removed JSInterface_BaseEntity.h and JSInterface_Entity.h (which were unused).
This was SVN commit r4091.
2006-07-13 03:29:33 +00:00
397a350e45 svn:ignore auto-generated test .cpp files.
Territories: Fixed memory leaks.
Atlas: New section-toolbar. Fixed colour of brush grid. Moved open/save
into File menu. Added 3D-ish lighting control. Added 'busy'
notifications.

This was SVN commit r4079.
2006-07-12 14:49:10 +00:00
7926b3d93c # Some groundwork for territories.
Entities with traits.is_territory_centre == true will act as territory
centres, and territory areas are calculated and displayed on the
minimap. It remains to display these areas in the game view and to make
Civ Centres "socketable" so you can build them on Settlements to claim
them.

This was SVN commit r4070.
2006-07-08 22:40:01 +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
d39a4fac21 Premake: include precompiled.h in the project; set up dependencies for Atlas projects.
# Attempted to make compilation faster
by including as little as possible in some .h files, and moving it into
.cpp.
Fixed BaseTechCollection memory leak.

This was SVN commit r3992.
2006-06-09 16:44:16 +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
6365c30098 # Fixed failure when saving maps
FilePacker: removed code that used to be in a #ifdef SCED
Changed to PSERROR system, for error-reporting consistency

This was SVN commit r3728.
2006-04-04 04:14:10 +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