Skip to content
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

VCR doesn't record when keys and mouse used simultaneously #1739

Closed
IBwWG opened this issue Feb 23, 2016 · 1 comment
Closed

VCR doesn't record when keys and mouse used simultaneously #1739

IBwWG opened this issue Feb 23, 2016 · 1 comment

Comments

@IBwWG
Copy link
Contributor

IBwWG commented Feb 23, 2016

  • Flixel version: dev (with unmerged vcr branch, but it should also affect main dev)
  • OpenFL version: 3.6.0
  • Lime version: 2.9.0
  • Affected targets: flash/debug, but probably all

Code snippet reproducing the issue:

(any working VCR. try a "shift-click" for example, then try to find it in the .fgr output)


Observed behavior: No shift-click recorded, only surrounding shifts.
Expected behavior: Record the shift-click.


Cause: This behaviour seems oddly intentional, but maybe there was a different intention behind the following code, originally:

    public function recordFrame():Void
    {
        var continueFrame = true;

        #if !FLX_NO_KEYBOARD
        var keysRecord:Array<CodeValuePair> = FlxG.keys.record();
        if (keysRecord == null) continueFrame = false;
        #end

        #if !FLX_NO_MOUSE
        var mouseRecord:MouseRecord = FlxG.mouse.record();
        if (mouseRecord == null) continueFrame = false;
        #end

        if (continueFrame)
        {
            frame++;
            return;
        }

        var frameRecorded = new FrameRecord().create(frame++);
//...

See, if either keys or mouse are null this frame, then we hit continueFrame = false and the frame gets recorded. But if neither are null, it defaults to true, and the frame is incremented and the function returns without recording.

My best guess is the intention was to skip frames that didn't have keyboard or mouse input (I took care of this in my PR) but that the logic got implemented backwards--it probably should've been that continueFrame is false by default, and only made true if either keys or mouse are not null, i.e. only record when there's something to record.

IBwWG pushed a commit to codingthat/flixel that referenced this issue Feb 23, 2016
IBwWG pushed a commit to codingthat/flixel that referenced this issue Feb 23, 2016
@IBwWG
Copy link
Contributor Author

IBwWG commented Feb 24, 2016

The PR should be good to go, now, unless I missed anything else.

IBwWG added a commit to codingthat/flixel that referenced this issue Apr 22, 2016
@Gama11 Gama11 added the Bug label Apr 22, 2016
@Gama11 Gama11 closed this as completed in 71cdf01 Apr 22, 2016
IBwWG added a commit to codingthat/flixel that referenced this issue Apr 22, 2016
Fix VCR to record simultaneous keys+mouse, closes HaxeFlixel#1739 (HaxeFlixel#1825)
Aurel300 pushed a commit to larsiusprime/haxeflixel that referenced this issue Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants