Page MenuHomeWildfire Games

Decorelate the "sound" attribute from the "event" attribute
ClosedPublic

Authored by Stan on Nov 19 2020, 12:36 AM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP24629: Prevent the game from playing sounds too often (8 times for a cavalry slaughter…
Summary

Currently

  • One can have both sound and event in the animation attribute, causing the sound to be played twice
  • Have different event or sound in props, causing the sound to be played more than twice
  • One cannot have props with different event or sounds from the parent.
  • The sound tag is useless

This patch decorelates the sound attribute from the event attribute, allowing the former to overide the later, for instance you might want to play a sound at a different time, so that it plays during load and shooting,

This patch only calls the sound once per mesh group, instead of potentially once per prop

Test Plan

Test tweaking variants with different sound and events attributes and agree this in improvement

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Stan created this revision.Nov 19 2020, 12:36 AM

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
fatal error: fatal error: fatal errorfatal errorfile '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
: 
file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/MacroArgs.h' has been modified since the precompiled header 'obj/atlas_Debug/precompiled.h.gch' was built
1 error generated.
1 error generated.
1 error generated.
1 error generated.
make[1]: *** [obj/atlas_Debug/GameLoop.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [obj/atlas_Debug/CameraCtrlHandlers.o] Error 1
make[1]: *** [obj/atlas_Debug/ActorViewer.o] Error 1
make[1]: *** [obj/atlas_Debug/Brushes.o] Error 1
make: *** [atlas] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/1980/display/redirect

Stan requested review of this revision.Nov 19 2020, 12:46 AM
Freagarach added inline comments.
source/graphics/UnitAnimation.cpp
176 ↗(On Diff #14033)
191 ↗(On Diff #14033)

Isn't this more like a nextPos?

216 ↗(On Diff #14033)

Your new variable?

Stan updated this revision to Diff 15336.Jan 15 2021, 11:22 AM
Stan marked 3 inline comments as done.

Years, fix notes

Build is green

builderr-debug-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/liblobby_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libengine_dbg.a(precompiled.o) has no symbols
../../../source/graphics/ShaderProgram.cpp:86:15: warning: 'Reload' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void Reload()
                     ^
../../../source/graphics/ShaderProgram.h:124:15: note: overridden virtual function is here
        virtual void Reload() = 0;
                     ^
../../../source/graphics/ShaderProgram.cpp:118:15: warning: 'Bind' overrides a member function

See https://jenkins.wildfiregames.com/job/macos-differential/2873/display/redirect for more details.

Freagarach added inline comments.Jan 15 2021, 11:45 AM
source/graphics/UnitAnimation.cpp
230 ↗(On Diff #15336)

Can you use the variable here?

Freagarach added inline comments.Jan 15 2021, 12:32 PM
source/graphics/UnitAnimation.cpp
180 ↗(On Diff #15336)
This revision was not accepted when it landed; it landed in state Needs Review.Jan 15 2021, 3:35 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Jan 15 2021, 3:35 PM