-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for spellcast command's -x flag for all spells #293
Open
meszaros-lajos-gyorgy
wants to merge
19
commits into
arx:master
Choose a base branch
from
arx-insanity:feat/spellcast-x-flag
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
13421bd
SpellsLvl01: add support for -x spellcast flag
meszaros-lajos-gyorgy 0d1ad32
SpellsLvl02: extract conditions that check spellcasts' -x flag into v…
meszaros-lajos-gyorgy 1721114
SpellsLvl03: add support for -x spellcast flag
meszaros-lajos-gyorgy b54b528
Spells: Prevent loop sounds of spells with spellcast -x flag
meszaros-lajos-gyorgy 81a1934
SpellsLvl04: Add support for -x spellcast flag
meszaros-lajos-gyorgy 8de7c0c
SpellsLvl01: Wrap more sound related functions with checks for spellc…
meszaros-lajos-gyorgy cfa4083
SpellsLvl02: Wrap more sound related functions with checks for spellc…
meszaros-lajos-gyorgy a63450d
SpellsLvl03: Wrap more sound related functions with checks for spellc…
meszaros-lajos-gyorgy d12d6d0
SpellsLvl05: Wrap more sound related functions with checks for spellc…
meszaros-lajos-gyorgy 9953856
SpellsLvl06: Wrap sound related functions with checks for spellcast -…
meszaros-lajos-gyorgy af9cf90
SpellsLvl07: Wrap sound related functions with checks for spellcast -…
meszaros-lajos-gyorgy bf23d43
SpellsLvl01: Remove extra space after if keyword
meszaros-lajos-gyorgy 11dca3a
SpellsLvl08: Wrap sound related functions with checks for spellcast -…
meszaros-lajos-gyorgy 70fa40d
SpellsLvl09: Wrap sound related functions with checks for spellcast -…
meszaros-lajos-gyorgy 9256ffb
SpellsLvl10: Wrap sound related functions with checks for spellcast -…
meszaros-lajos-gyorgy 07e16a5
Spells: Simplify emitsSound conditions
meszaros-lajos-gyorgy 31551cf
Spell: Extract emitsSound's logic into a method
meszaros-lajos-gyorgy 2736b66
spells: Restore whitespace
meszaros-lajos-gyorgy cef5377
spells: Restore whitespace
meszaros-lajos-gyorgy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could all or some of these ARX_SOUND calls get a conditional variant where you pass the bool in? yes of course its more efficient to put the if() around each call instead of doing a method call just to jump back immediately, but i dont think this would affect anything.
just easier than to have 500 if(emitsSound) clauses in each spell file.
alternatively, create a macro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, you'd pass a bool to a function just to tell it if it should do anything or not? That doesn't sound good.
It looks like the flag is set at the start of a spell and not anywhere else, so why not check the bit value once and use a member variable for that? Maybe see if you can use Spell base class to simplify what you want to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively,
ARX_SOUND_PlaySFX_loop()
could be wrapped in a member function, sayplaySoundLoop()
that checks for the member variable away from the main code, if reducing clutter is the goal.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that playSoundLoop would do exactly what i proposed first with a function. the conditional macro thing would not add any extra function calls but make it a oneliner that is much easier to read. the files are long enough as they are
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't imagine reading that code a year later without having to inspect that macro and spending time on it. This doesn't feel like self-documenting code.