1
0
forked from 0ad/0ad
Commit Graph

85 Commits

Author SHA1 Message Date
ffc4a56b9f Revert non-ASCII characters from source and configuration files introduced in 157c6af18e.
Fixes #6846

Differential Revision: https://code.wildfiregames.com/D5185
This was SVN commit r27965.
2023-12-03 00:30:12 +00:00
bb
157c6af18e Make the space in 0 A.D. non-breaking throughout the codebase.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful

Will add linter rule in seperate commit

Happy recompiling everyone!

Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
2023-07-27 20:54:46 +00:00
a541f3a317 Fix hotloading making models disappear.
The actors were always hotloaded because of a bad logic change in
76acc4e146.

Fixes #6228

Differential Revision: https://code.wildfiregames.com/D4175
This was SVN commit r25805.
2021-06-17 07:52:50 +00:00
0bc7ba50ea Add an option to reduce the diversity of actor variants
Variants can now have limited or no diversity. This can occasionally
speed rendering slightly (5-10% FPS increase was reported on Combat Demo
Huge, which is very variant-heavy).

Reported by: bb
Based on a patch by: bb
Fixes #5831

Differential Revision: https://code.wildfiregames.com/D3035
This was SVN commit r25613.
2021-05-31 11:42:46 +00:00
66fbc23f2c De-singletonify CConfigDB, make hooks RAII.
CConfigDB is no longer a singleton, and its members are no longer
static.
This makes it possible to have several instances of it, useful for
testing of if we ever want to have different config profiles.

Also updates hooks to delete themselves on destruction, to fit a more
natural RAII pattern. Long-lived objects must take care to destroy hooks
before ConfigDB is reset.

Differential Revision: https://code.wildfiregames.com/D3866
This was SVN commit r25326.
2021-04-27 07:45:40 +00:00
a97f7f3917 Hotloading fix after 76acc4e146
Emplace does not replace existing element, insert_or_assign does.

While at it:
 - Clean up the 'outdated' logic and reuse it for actors
 - When an actor fails to load, return a placeholder. This improves
hotloading of broken actors, and makes Cunit behaviour more predictable.
 - Some minor cleanup

Reported by: Stan
Fixes #6157

Differential Revision: https://code.wildfiregames.com/D3882
This was SVN commit r25308.
2021-04-24 09:39:33 +00:00
76acc4e146 Implement quality levels for actors & corresponding setting.
An actor file, as referenced by the VisualActor, can now define
different actors for different "quality level" setting.
In this initial version, the quality is handled directly by the object
manager.

Actor format impact:
- '<qualitylevels>' may be used as the root node, containing actor nodes
as children.
  - such actor nodes can refer to a file, or to an inline actor, or
simply be inlined.
  - such actor nodes may have a 'quality' attribute, specifying the
maximum quality level of this actor. By default, 255 (the maximum) is
implied.
- The actor format remains valid, but 'groups', 'variants', 'material',
'castshadow' and 'float' can be given a [minquality, maxquality[ range
via XML attributes. Outside of this range, the XML node is ignored
(making it possible to define, in a single actor file, several quality
levels).

Quality is a 0-255 value, with:
- Range 0-99 intended for lower level-of-detail actors (billboards,
etc.)
- Range 100-200 the 'normal' range for models. 100 is "low", 150
"medium", and 200 "high".
- Range 201-255 used for higher quality actors that might be used for
e.g. cinematics.
The range is wide to make it easier to add intermediate levels in the
future and it seemed easier given that an integer value of some kind was
required anyways.

Engine impacts:
- A new CActorDef class is introduced, wrapping an art/actors XML file
and its different quality levels. ObjectBase remains the definition of a
given 'actor', now at a given quality level.
- CActorDef imposes a maximal # of quality level for a particular actor
definition (5 currently).
- CUnit is made to refer to an Actor Definition explicitly, not a
particular ObjectBase.
- As a minor optimisation, variation keys are calculated on
pointer-to-sets-of-selections, instead of raw sets-of-selections, as
this reduces copying.
- some refactoring, including better const-correctness and hotloading
support via std::shared_ptr.

Differential Revision: https://code.wildfiregames.com/D3787
This was SVN commit r25210.
2021-04-08 07:22:24 +00:00
e009d322cc Add missing files in 4942cabab5
This was SVN commit r24488.
2020-12-31 14:27:02 +00:00
558d43bac5 Replace some functor structs with lambdas, closures or range-based fors.
This was SVN commit r16923.
2015-08-19 03:33:04 +00:00
a18fbd12ec XML validation. Based on patch by historic_bruno. Refs #245.
This was SVN commit r16733.
2015-06-07 21:56:52 +00:00
568c415d0a Convert wchar_t*/wstring arguments to UTF-8 strings in CLogger messages.
This was SVN commit r16188.
2015-01-22 20:37:38 +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
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
d5897854be Allow terrain aligned props. Patch by sanderd17. Fixes #2033.
This was SVN commit r13549.
2013-07-11 22:53:31 +00:00
08bd07ddd6 Adds safe bool operator to ICmpPtr, replacing the null() method, based on patch by leper. Also changes bool operator in AtSmartPtr to safe bool. Fixes #1077.
Changes some CmpPtr variable names for consistency.

This was SVN commit r11036.
2012-02-08 02:46:15 +00:00
cccd6849a7 cleanup (requires update-workspaces)
lib_errors.cpp: replace with status.cpp, adapt to needs at work
wutil: fix runtime warning reported via feedback box
config: merge CONFIG_PARANOIA and !CONFIG_FINAL into
CONFIG_ENABLE_CHECKS
add openmp, pointer_typedefs.h

This was SVN commit r9410.
2011-05-03 12:38:42 +00:00
4663ac0fe7 split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
2011-04-30 13:01:45 +00:00
29dd635d3b Fix decals and LOS texture in Actor Viewer, by slightly reducing use of globals.
Fix particles in Actor Viewer.
Expand terrain in Actor Viewer.
Change background to black so it blends with the LOS texture more
nicely.

This was SVN commit r9172.
2011-04-05 20:32:03 +00:00
823e63a93b # Initial version of new particle system.
This was SVN commit r9151.
2011-04-03 19:15:15 +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
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
16a4eb36dd Various minor optimisations.
Enable SpiderMonkey method JIT in Release mode.
Add Engine.ProfileStart/Engine.ProfileStop functions for scripts.
Fix AI to clone initial entity data and shared metadata.

This was SVN commit r9003.
2011-03-03 00:16:14 +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
310f3466a8 # Hotloading of actor XML files.
Stop ignoring actor XML animation speeds.
Add decentralised registration of hotloaders.
Move player ID storage into CModel, to simplify CUnit.
Remove obsolete unit ID allocation code.
Remove some material junk.

This was SVN commit r7605.
2010-06-03 01:29:43 +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
5b302658a3 # fix permissions of created directories
also took the opportunity to move file_system_posix to file_system since
a further FS abstraction layer = YAGNI. also namespaced
file_system_util.

This was SVN commit r7074.
2009-08-04 19:57:53 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +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
e9c34cc04c VS2008 compatibility
This was SVN commit r5561.
2008-01-17 23:07:26 +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
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
f4adce44bf cleanup:
- callbacks now have a uintptr_t "cbData" parameter (instead of
haphazard void*/uintptr_t, cb/ctx/data)
- resource loading code now more uniformly deals with u8* pointers
instead of void*

allocators: add support for page_aligned_alloc via boost::shared_ptr.
add evil hack to avoid the need for default ctor and ensure alignment in
SingleAllocator
archive: improve Decompressor
compression:
. near complete rewrite (previous code was a poorly factored mess)
. fix bug related to buffer allocation
. no longer provide get_output API (prone to abuse)
. add call to get max. size of output buffer (for preallocation)

This was SVN commit r5370.
2007-09-25 09:39:20 +00:00
fa45d214b3 # Added support for COLLADA skeletal animations.
Moved COLLADA-loading code into separate class, since it now handles
both PMD and PSA.
Desingletonised CSkeletonAnimManager, moved into CGameView.
Made Atlas load its icons with buffered IO, for possible efficiency.

This was SVN commit r4934.
2007-03-01 18:52:53 +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
6cfb96855a # Added initial play-testing support in the scenario editor.
Atlas: Added simulation play/pause/reset controls; automatically plays
while recording cinematics.
FFmpeg: Fixed broken output files.
MapReader: Fixed entity loading.
ObjectHandlers: Made unit preview more robust when the preview unit gets
destroyed.
Various: Replaced manual matrix construction with SetYRotation call.
Turned some more CStr8 back into CStr.
h_mgr: Optimisation - don't calculate slow debug-output strings if
they're never going to be seen (since it takes a few hundred
milliseconds).
TerrainRenderer: Made more tolerant of accidental negative times.
Entity: Fixed m_refd being out of date when deleteAll is called. Fixed
problems when doing an initializeAll...deleteAll...initializeAll
sequence.
SCN: Removed non-useful AoE3Ed code that never did anything.
SVNLog: Made output more valid and made titles more descriptive, so it
works properly in FF's live bookmarks.

This was SVN commit r4779.
2007-01-17 03:25:20 +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
a1a7dac59c # Integrated Actor Viewer and Actor Editor tools
ObjectManager: Removed ObjectTypes because it hasn't been used for
years.
Atlas: Fixed leak when saving with Xerces. Changed range of water
shininess slider.
Actor Editor: Relabelled "Freq" to "Ratio". Made modal dialogs use the
correct parent.

This was SVN commit r4376.
2006-09-22 17:43:00 +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
554b9e537e - Changed actor selection sets to CStr8 rather than CStrW.
- Added more comments in ScriptableComplex.h/inl explaining how they are
split up and when to #include the inl.

This was SVN commit r4180.
2006-07-29 22:02:11 +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
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
d605cb39ec # Atlas editor: Control over 'random' actor variations.
Actor variation selection (though not saved to maps, so not very
useful).
Added more levels of complexity to the waiting-for-game-to-respond
message pump, to fix reentrancy problems.
Use number keys to assign player to selected unit.

This was SVN commit r3913.
2006-05-31 05:27:02 +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
6fbce9c355 # refactoring
- color: the sse codepath is now detected and activated from within
color.cpp, which avoids making ia32 dependent on the color header. it's
called from gamesetup!InitRenderer.
- move VFSUtil::EnumDirEnts to vfs.cpp!vfs_dir_enum - allows it to be
used from within lib/ without dependency on ps (annoying for other
projects)

This was SVN commit r3764.
2006-04-14 06:32:05 +00:00
c41248b585 # Updates to actor prop-switching system
Forced variant names to lowercase. Allowed empty prop model names to
remove inherited props. Removed a little code duplication.
Entity: Changed confusing (and probably incorrect) loop/STL logic, to
use slightly more confusing syntax instead.

This was SVN commit r3761.
2006-04-14 03:14:43 +00:00
d3f57744d9 Refactored actor variation system, and added support for entity-level selections (controlled by the current animation).
Avoided tooltip error message.
Avoided noisy warnings when textures fail to load.

This was SVN commit r3653.
2006-03-17 03:59:49 +00:00
ed38414b41 Texture converter, DevIL: ABGR DDS support.
Textures: converted ARGB to ABGR.
Misc: warning fixes, etc.

This was SVN commit r3631.
2006-03-14 21:29:19 +00:00
124f7171bd More reliable texture blending. Resource unloading. Minor fixes.
This was SVN commit r3106.
2005-11-06 05:05:07 +00:00
04650efe7a Lots of gcc -Wall fixes. The common ones:
- switch() statements don't handle all values in an enum
- missing \n at end of file
- non-virtual destructors in classes containing virtual functions
- order of initializers in constructor initializer lists
... some other stuff (signedness, nested comments, unused variables) as
well.

This was SVN commit r2864.
2005-10-07 15:24:29 +00:00