Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Status bar can change opacity of several cels (related to issue #225)
- Loading branch information
Showing
4 changed files
with
112 additions
and
6 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* 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/context_access.h" | ||
#include "app/document.h" | ||
#include "app/document_range.h" | ||
#include "raster/layer.h" | ||
#include "raster/sprite.h" | ||
|
||
namespace app { | ||
|
||
using namespace raster; | ||
|
||
std::vector<Cel*> get_cels_in_range(Sprite* sprite, const DocumentRange& range) | ||
{ | ||
std::vector<Cel*> cels; | ||
|
||
for (LayerIndex layerIdx = range.layerBegin(); layerIdx <= range.layerEnd(); ++layerIdx) { | ||
Layer* layer = sprite->indexToLayer(layerIdx); | ||
if (!layer->isImage()) | ||
continue; | ||
|
||
LayerImage* layerImage = static_cast<LayerImage*>(layer); | ||
|
||
for (FrameNumber frame = range.frameEnd(), | ||
begin = range.frameBegin().previous(); | ||
frame != begin; | ||
frame = frame.previous()) { | ||
Cel* cel = layerImage->getCel(frame); | ||
if (cel) | ||
cels.push_back(cel); | ||
} | ||
} | ||
return cels; | ||
} | ||
|
||
} // 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,36 @@ | ||
/* 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_UTIL_RANGE_UTILS_H_INCLUDED | ||
#define APP_UTIL_RANGE_UTILS_H_INCLUDED | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
namespace raster { | ||
class Sprite; | ||
} | ||
|
||
namespace app { | ||
class DocumentRange; | ||
|
||
std::vector<Cel*> get_cels_in_range(raster::Sprite* sprite, const DocumentRange& range); | ||
|
||
} // namespace app | ||
|
||
#endif |