Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add timeline options for onion skin, loop section, and animation dire…
…ction - Add red/blue onion skin type - Add app::calculate_next_frame() function to calculate the next frame depending of the timeline configuration (loop range, animation direction) - Add app::finder() to simplify the access to widgets loaded from xml files
- Loading branch information
Showing
20 changed files
with
820 additions
and
89 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- ASEPRITE --> | ||
<!-- Copyright (C) 2014 by David Capello --> | ||
<gui> | ||
<vbox id="mainbox"> | ||
<grid columns="2"> | ||
<separator cell_hspan="2" text="Onion Skin:" left="true" horizontal="true" /> | ||
<hbox cell_hspan="2"> | ||
<radio group="1" text="Merge Frames" id="merge" /> | ||
<radio group="1" text="Red/Blue Tint" id="tint" /> | ||
<button id="reset_onionskin" text="Reset" width="60" /> | ||
</hbox> | ||
|
||
<label text="Opacity:" /> | ||
<slider min="0" max="255" id="opacity" cell_align="horizontal" width="128" /> | ||
|
||
<label text="Opacity Step:" /> | ||
<slider min="0" max="255" id="opacity_step" cell_align="horizontal" width="128" /> | ||
|
||
<separator cell_hspan="2" text="Loop:" left="true" horizontal="true" /> | ||
<button id="loop_section" text="Set Loop Section" /> | ||
<button id="reset_loop_section" text="Reset Loop Section" /> | ||
<hbox cell_hspan="2"> | ||
<radio group="2" text="Normal" id="normal" /> | ||
<radio group="2" text="Reverse" id="reverse" /> | ||
<radio group="2" text="Ping-pong" id="pingpong" /> | ||
</hbox> | ||
</grid> | ||
</vbox> | ||
</gui> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* Aseprite | ||
* Copyright (C) 2001-2014 David Capello | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#ifdef HAVE_CONFIG_H | ||
#include "config.h" | ||
#endif | ||
|
||
#include "app/handle_anidir.h" | ||
|
||
#include "app/settings/document_settings.h" | ||
#include "raster/sprite.h" | ||
|
||
namespace app { | ||
|
||
raster::FrameNumber calculate_next_frame( | ||
raster::Sprite* sprite, | ||
raster::FrameNumber frame, | ||
IDocumentSettings* docSettings, | ||
bool& pingPongForward) | ||
{ | ||
FrameNumber first = FrameNumber(0); | ||
FrameNumber last = sprite->getLastFrame(); | ||
|
||
if (docSettings->getLoopAnimation()) { | ||
FrameNumber loopBegin, loopEnd; | ||
docSettings->getLoopRange(&loopBegin, &loopEnd); | ||
if (loopBegin < first) loopBegin = first; | ||
if (loopEnd > last) loopEnd = last; | ||
|
||
first = loopBegin; | ||
last = loopEnd; | ||
} | ||
|
||
switch (docSettings->getAnimationDirection()) { | ||
|
||
case IDocumentSettings::AniDir_Normal: | ||
frame = frame.next(); | ||
if (frame > last) frame = first; | ||
break; | ||
|
||
case IDocumentSettings::AniDir_Reverse: | ||
frame = frame.previous(); | ||
if (frame < first) frame = last; | ||
break; | ||
|
||
case IDocumentSettings::AniDir_PingPong: | ||
if (pingPongForward) { | ||
frame = frame.next(); | ||
if (frame > last) { | ||
frame = last.previous(); | ||
if (frame < first) frame = first; | ||
pingPongForward = false; | ||
} | ||
} | ||
else { | ||
frame = frame.previous(); | ||
if (frame < first) { | ||
frame = first.next(); | ||
if (frame > last) frame = last; | ||
pingPongForward = true; | ||
} | ||
} | ||
break; | ||
} | ||
|
||
return frame; | ||
} | ||
|
||
} // namespace app |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* Aseprite | ||
* Copyright (C) 2001-2014 David Capello | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#ifndef APP_HANDLE_ANIDIR_H_INCLUDED | ||
#define APP_HANDLE_ANIDIR_H_INCLUDED | ||
#pragma once | ||
|
||
#include "raster/frame_number.h" | ||
|
||
namespace raster { | ||
class Sprite; | ||
} | ||
|
||
namespace app { | ||
|
||
class IDocumentSettings; | ||
|
||
raster::FrameNumber calculate_next_frame( | ||
raster::Sprite* sprite, | ||
raster::FrameNumber frame, | ||
IDocumentSettings* docSettings, | ||
bool& pingPongForward); | ||
|
||
} // namespace app | ||
|
||
#endif |
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.