~ubuntu-branches/ubuntu/vivid/fceux/vivid

« back to all changes in this revision

Viewing changes to src/drivers/win/taseditor/history.cpp

  • Committer: Package Import Robot
  • Author(s): Joe Nahmias
  • Date: 2014-03-02 19:22:04 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140302192204-9f0aehi5stfnhn7d
Tags: 2.2.2+dfsg0-1
* Imported Upstream version 2.2.2
  + remove patches merged upstream; refresh remaining
  + remove windows compiled help files and non-free Visual C files
* Use C++11 standard static assertion functionality
* fix upstream installation of support files
* New patch 0004-ignore-missing-windows-help-CHM-file.patch
* update d/copyright for new, renamed, deleted files
* d/control: bump std-ver to 3.9.5, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
        historyCursorPos = -1;
147
147
        // create initial snapshot
148
148
        SNAPSHOT snap;
149
 
        snap.init(currMovieData, taseditorConfig.enableHotChanges);
 
149
        snap.init(currMovieData, greenzone.lagLog, taseditorConfig.enableHotChanges);
150
150
        snap.modificationType = MODTYPE_INIT;
151
151
        strcat(snap.description, modCaptions[snap.modificationType]);
152
152
        snap.keyFrame = -1;
404
404
                        // truncate after the timeline starts to differ
405
405
                        first_lag_changes = first_changes;
406
406
                greenzone.lagLog.invalidateFromFrame(first_lag_changes);
 
407
                // keep current snapshot laglog in touch
 
408
                snapshots[real_pos].laglog = greenzone.lagLog;
407
409
        } else
408
410
        {
409
411
                greenzone.lagLog = snapshots[real_pos].laglog;
484
486
// returns frame of first actual change
485
487
int HISTORY::registerChanges(int mod_type, int start, int end, int size, const char* comment, int consecutivenessTag, RowsSelection* frameset)
486
488
{
487
 
        // create new shanshot
 
489
        // create new snapshot
488
490
        SNAPSHOT snap;
489
 
        snap.init(currMovieData, taseditorConfig.enableHotChanges);
 
491
        snap.init(currMovieData, greenzone.lagLog, taseditorConfig.enableHotChanges);
490
492
        // check if there are Input differences from latest snapshot
491
493
        int real_pos = (historyStartPos + historyCursorPos) % historySize;
492
494
        int first_changes = snap.inputlog.findFirstChange(snapshots[real_pos].inputlog, start, end);
641
643
}
642
644
int HISTORY::registerAdjustLag(int start, int size)
643
645
{
644
 
        // create new shanshot
 
646
        // create new snapshot
645
647
        SNAPSHOT snap;
646
 
        snap.init(currMovieData, taseditorConfig.enableHotChanges);
 
648
        snap.init(currMovieData, greenzone.lagLog, taseditorConfig.enableHotChanges);
647
649
        // check if there are Input differences from latest snapshot
648
650
        int real_pos = (historyStartPos + historyCursorPos) % historySize;
649
651
        SNAPSHOT& current_snap = snapshots[real_pos];
681
683
}
682
684
void HISTORY::registerMarkersChange(int modificationType, int start, int end, const char* comment)
683
685
{
684
 
        // create new shanshot
 
686
        // create new snapshot
685
687
        SNAPSHOT snap;
686
 
        snap.init(currMovieData, taseditorConfig.enableHotChanges);
 
688
        snap.init(currMovieData, greenzone.lagLog, taseditorConfig.enableHotChanges);
687
689
        // fill description:
688
690
        snap.modificationType = modificationType;
689
691
        strcat(snap.description, modCaptions[modificationType]);
698
700
        if (snap.endFrame > snap.startFrame || modificationType == MODTYPE_MARKER_DRAG || modificationType == MODTYPE_MARKER_SWAP)
699
701
        {
700
702
                if (modificationType == MODTYPE_MARKER_DRAG)
701
 
                        strcat(snap.description, "=>");
 
703
                        strcat(snap.description, "->");
702
704
                else if (modificationType == MODTYPE_MARKER_SWAP)
703
 
                        strcat(snap.description, "<=>");
 
705
                        strcat(snap.description, "<->");
704
706
                else
705
707
                        strcat(snap.description, "-");
706
708
                _itoa(snap.endFrame, framenum, 10);
723
725
{
724
726
        // create new snapshot
725
727
        SNAPSHOT snap;
726
 
        snap.init(currMovieData, taseditorConfig.enableHotChanges);
 
728
        snap.init(currMovieData, greenzone.lagLog, taseditorConfig.enableHotChanges);
727
729
        // fill description: modification type + keyframe of the Bookmark
728
730
        snap.modificationType = MODTYPE_BOOKMARK_0 + slot;
729
731
        strcat(snap.description, modCaptions[snap.modificationType]);
741
743
{
742
744
        // create new snapshot
743
745
        SNAPSHOT snap;
744
 
        snap.init(currMovieData, taseditorConfig.enableHotChanges);
 
746
        snap.init(currMovieData, greenzone.lagLog, taseditorConfig.enableHotChanges);
745
747
        // check if there are Input differences from latest snapshot
746
748
        int real_pos = (historyStartPos + historyCursorPos) % historySize;
747
749
        int first_changes = snap.inputlog.findFirstChange(snapshots[real_pos].inputlog);
786
788
                        // truncate after the timeline starts to differ
787
789
                        first_lag_changes = first_changes;
788
790
                greenzone.lagLog.invalidateFromFrame(first_lag_changes);
 
791
                // keep current snapshot laglog in touch
789
792
                snap.laglog.invalidateFromFrame(first_lag_changes);
790
793
        } else
791
794
        {
792
795
                greenzone.lagLog = bookmarks.bookmarksArray[slot].snapshot.laglog;
 
796
                // keep current snapshot laglog in touch
793
797
                snap.laglog = greenzone.lagLog;
794
798
        }
795
799
        // Greenzone should be invalidated after the frame of Lag changes if this frame is less than the frame of Input changes
808
812
        {
809
813
                // reinit current snapshot and set hotchanges
810
814
                SNAPSHOT* snap = &snapshots[real_pos];
811
 
                snap->reinit(currMovieData, taseditorConfig.enableHotChanges, frameOfChange);
 
815
                snap->reinit(currMovieData, greenzone.lagLog, taseditorConfig.enableHotChanges, frameOfChange);
812
816
                // refill description
813
817
                strcat(snap->description, modCaptions[MODTYPE_RECORD]);
814
818
                char framenum[11];
842
846
        {
843
847
                // not consecutive - create new snapshot and add it to history
844
848
                SNAPSHOT snap;
845
 
                snap.init(currMovieData, taseditorConfig.enableHotChanges);
 
849
                snap.init(currMovieData, greenzone.lagLog, taseditorConfig.enableHotChanges);
846
850
                snap.recordedJoypadDifferenceBits = joypadDifferenceBits;
847
851
                // fill description:
848
852
                snap.modificationType = MODTYPE_RECORD;
881
885
{
882
886
        // create new snapshot
883
887
        SNAPSHOT snap;
884
 
        snap.init(md, taseditorConfig.enableHotChanges, getInputType(currMovieData));
 
888
        snap.init(md, greenzone.lagLog, taseditorConfig.enableHotChanges, getInputType(currMovieData));
885
889
        // check if there are Input differences from latest snapshot
886
890
        int real_pos = (historyStartPos + historyCursorPos) % historySize;
887
891
        int first_changes = snap.inputlog.findFirstChange(snapshots[real_pos].inputlog);
913
917
}
914
918
int HISTORY::registerLuaChanges(const char* name, int start, bool insertionOrDeletionWasDone)
915
919
{
916
 
        // create new shanshot
 
920
        // create new snapshot
917
921
        SNAPSHOT snap;
918
 
        snap.init(currMovieData, taseditorConfig.enableHotChanges);
 
922
        snap.init(currMovieData, greenzone.lagLog, taseditorConfig.enableHotChanges);
919
923
        // check if there are Input differences from latest snapshot
920
924
        int real_pos = (historyStartPos + historyCursorPos) % historySize;
921
925
        int first_changes = snap.inputlog.findFirstChange(snapshots[real_pos].inputlog, start);