2007-11-16 18:25:45 +00:00
|
|
|
/* ASE - Allegro Sprite Editor
|
2008-02-10 19:06:03 +00:00
|
|
|
* Copyright (C) 2001-2008 David A. Capello
|
2007-09-18 23:57:02 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2008-02-29 19:29:49 +00:00
|
|
|
#include <assert.h>
|
2007-09-18 23:57:02 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2007-12-05 01:30:50 +00:00
|
|
|
#include "jinete/jlist.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
#include "raster/blend.h"
|
2007-11-16 20:49:40 +00:00
|
|
|
#include "raster/cel.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
#include "raster/image.h"
|
|
|
|
#include "raster/layer.h"
|
2007-12-05 01:30:50 +00:00
|
|
|
#include "raster/sprite.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
#include "raster/stock.h"
|
2008-02-29 19:29:49 +00:00
|
|
|
#include "raster/undo.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
static bool has_cels(const Layer *layer, int frame);
|
|
|
|
static void layer_set_parent(Layer *layer, Layer *parent_set);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
#define LAYER_INIT(name_string) \
|
|
|
|
do { \
|
|
|
|
layer_set_name(layer, name_string); \
|
|
|
|
\
|
2007-12-05 01:30:50 +00:00
|
|
|
layer->sprite = sprite; \
|
2008-03-22 18:43:56 +00:00
|
|
|
layer->parent_layer = NULL; \
|
2007-09-18 23:57:02 +00:00
|
|
|
layer->readable = TRUE; \
|
2007-10-08 02:20:57 +00:00
|
|
|
layer->writable = TRUE; \
|
2007-09-18 23:57:02 +00:00
|
|
|
\
|
|
|
|
layer->blend_mode = 0; \
|
2007-11-16 20:49:40 +00:00
|
|
|
layer->cels = NULL; \
|
2007-09-18 23:57:02 +00:00
|
|
|
\
|
|
|
|
layer->layers = NULL; \
|
|
|
|
} while (0);
|
|
|
|
|
2008-01-23 16:16:43 +00:00
|
|
|
/**
|
|
|
|
* Creates a new empty (without frames) normal (image) layer.
|
|
|
|
*/
|
2007-12-05 01:30:50 +00:00
|
|
|
Layer *layer_new(Sprite *sprite)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
Layer *layer = (Layer *)gfxobj_new(GFXOBJ_LAYER_IMAGE, sizeof(Layer));
|
|
|
|
if (!layer)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
LAYER_INIT("Layer");
|
|
|
|
|
|
|
|
layer->blend_mode = BLEND_MODE_NORMAL;
|
2007-11-16 20:49:40 +00:00
|
|
|
layer->cels = jlist_new();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
return layer;
|
|
|
|
}
|
|
|
|
|
2007-12-05 01:30:50 +00:00
|
|
|
Layer *layer_set_new(Sprite *sprite)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
Layer *layer = (Layer *)gfxobj_new(GFXOBJ_LAYER_SET, sizeof(Layer));
|
|
|
|
if (!layer)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
LAYER_INIT("Layer Set");
|
|
|
|
|
|
|
|
layer->layers = jlist_new();
|
|
|
|
|
|
|
|
return layer;
|
|
|
|
}
|
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
Layer *layer_new_copy(Sprite *dst_sprite, const Layer *src_layer)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
Layer *layer_copy = NULL;
|
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
assert(dst_sprite != NULL);
|
|
|
|
|
|
|
|
switch (src_layer->gfxobj.type) {
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
case GFXOBJ_LAYER_IMAGE: {
|
2008-02-29 19:29:49 +00:00
|
|
|
Cel *cel_copy, *cel;
|
|
|
|
Image *image_copy, *image;
|
2007-09-18 23:57:02 +00:00
|
|
|
JLink link;
|
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
layer_copy = layer_new(dst_sprite);
|
2007-09-18 23:57:02 +00:00
|
|
|
if (!layer_copy)
|
|
|
|
break;
|
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
layer_set_blend_mode(layer_copy, src_layer->blend_mode);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
/* copy cels */
|
2008-03-22 18:43:56 +00:00
|
|
|
JI_LIST_FOR_EACH(src_layer->cels, link) {
|
2008-02-29 19:29:49 +00:00
|
|
|
cel = (Cel *)link->data;
|
|
|
|
cel_copy = cel_new_copy(cel);
|
2007-11-16 20:49:40 +00:00
|
|
|
if (!cel_copy) {
|
2007-09-18 23:57:02 +00:00
|
|
|
layer_free(layer_copy);
|
|
|
|
return NULL;
|
|
|
|
}
|
2008-02-29 19:29:49 +00:00
|
|
|
|
|
|
|
assert((cel->image >= 0) &&
|
2008-03-22 18:43:56 +00:00
|
|
|
(cel->image < src_layer->sprite->stock->nimage));
|
2008-02-29 19:29:49 +00:00
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
image = src_layer->sprite->stock->image[cel->image];
|
2008-02-29 19:29:49 +00:00
|
|
|
assert(image != NULL);
|
|
|
|
|
|
|
|
image_copy = image_new_copy(image);
|
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
if (undo_is_enabled(dst_sprite->undo))
|
|
|
|
undo_add_image(dst_sprite->undo, dst_sprite->stock, image_copy);
|
2008-02-29 19:29:49 +00:00
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
cel_copy->image = stock_add_image(dst_sprite->stock, image_copy);
|
2008-02-29 19:29:49 +00:00
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
layer_add_cel(layer_copy, cel_copy);
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case GFXOBJ_LAYER_SET: {
|
|
|
|
Layer *child_copy;
|
|
|
|
JLink link;
|
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
layer_copy = layer_set_new(dst_sprite);
|
2007-09-18 23:57:02 +00:00
|
|
|
if (!layer_copy)
|
|
|
|
break;
|
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
JI_LIST_FOR_EACH(src_layer->layers, link) {
|
2007-09-18 23:57:02 +00:00
|
|
|
/* copy the child */
|
2008-03-22 18:43:56 +00:00
|
|
|
child_copy = layer_new_copy(dst_sprite, link->data);
|
2007-09-18 23:57:02 +00:00
|
|
|
/* not enough memory? */
|
|
|
|
if (!child_copy) {
|
|
|
|
layer_free(layer_copy);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* add the new child in the layer copy */
|
|
|
|
layer_add_layer(layer_copy, child_copy);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* copy general properties */
|
2008-03-22 18:43:56 +00:00
|
|
|
if (layer_copy != NULL) {
|
|
|
|
layer_set_name(layer_copy, src_layer->name);
|
|
|
|
layer_copy->readable = src_layer->readable;
|
|
|
|
layer_copy->writable = src_layer->writable;
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return layer_copy;
|
|
|
|
}
|
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
/**
|
|
|
|
* Returns a new layer (flat_layer) with all "layer" rendered frame by
|
|
|
|
* frame from "frmin" to "frmax" (inclusive). "layer" can be a set of
|
|
|
|
* layers, so the routine flattens all children to an unique output
|
|
|
|
* layer.
|
|
|
|
*
|
|
|
|
* @param dst_sprite The sprite where to put the new flattened layer.
|
|
|
|
* @param src_layer Generally a set of layers to be flattened.
|
|
|
|
*/
|
|
|
|
Layer *layer_new_flatten_copy(Sprite *dst_sprite, const Layer *src_layer,
|
|
|
|
int x, int y, int w, int h, int frmin, int frmax)
|
|
|
|
{
|
|
|
|
Layer *flat_layer;
|
|
|
|
Image *image;
|
|
|
|
Cel *cel;
|
|
|
|
int frame;
|
|
|
|
|
|
|
|
flat_layer = layer_new(dst_sprite);
|
|
|
|
if (!flat_layer)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
layer_set_name(flat_layer, "Flat Layer");
|
|
|
|
|
|
|
|
for (frame=frmin; frame<=frmax; frame++) {
|
|
|
|
/* does this frame have cels to render? */
|
|
|
|
if (has_cels(src_layer, frame)) {
|
|
|
|
/* create a new image */
|
|
|
|
image = image_new(flat_layer->sprite->imgtype, w, h);
|
|
|
|
if (!image) {
|
|
|
|
layer_free(flat_layer);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* create the new cel for the output layer (add the image to
|
|
|
|
stock too) */
|
|
|
|
cel = cel_new(frame, stock_add_image(flat_layer->sprite->stock, image));
|
|
|
|
cel_set_position(cel, x, y);
|
|
|
|
if (!cel) {
|
|
|
|
layer_free(flat_layer);
|
|
|
|
image_free(image);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* clear the image and render this frame */
|
|
|
|
image_clear(image, 0);
|
|
|
|
layer_render(src_layer, image, -x, -y, frame);
|
|
|
|
layer_add_cel(flat_layer, cel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return flat_layer;
|
|
|
|
}
|
|
|
|
|
2007-12-05 01:30:50 +00:00
|
|
|
void layer_free(Layer *layer)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
switch (layer->gfxobj.type) {
|
|
|
|
|
|
|
|
case GFXOBJ_LAYER_IMAGE: {
|
|
|
|
JLink link;
|
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
/* remove cels */
|
|
|
|
JI_LIST_FOR_EACH(layer->cels, link)
|
|
|
|
cel_free(link->data);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
jlist_free(layer->cels);
|
2007-09-18 23:57:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case GFXOBJ_LAYER_SET: {
|
|
|
|
JLink link;
|
|
|
|
JI_LIST_FOR_EACH(layer->layers, link)
|
|
|
|
layer_free(link->data);
|
2008-02-10 19:06:03 +00:00
|
|
|
jlist_free(layer->layers);
|
2007-09-18 23:57:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gfxobj_free((GfxObj *)layer);
|
|
|
|
}
|
|
|
|
|
2008-01-23 16:16:43 +00:00
|
|
|
/**
|
|
|
|
* Returns TRUE if "layer" is a normal layer type (an image layer)
|
|
|
|
*/
|
2008-03-22 18:43:56 +00:00
|
|
|
bool layer_is_image(const Layer *layer)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
return (layer->gfxobj.type == GFXOBJ_LAYER_IMAGE) ? TRUE: FALSE;
|
|
|
|
}
|
|
|
|
|
2008-01-23 16:16:43 +00:00
|
|
|
/**
|
|
|
|
* Returns TRUE if "layer" is a set of layers
|
|
|
|
*/
|
2008-03-22 18:43:56 +00:00
|
|
|
bool layer_is_set(const Layer *layer)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
return (layer->gfxobj.type == GFXOBJ_LAYER_SET) ? TRUE: FALSE;
|
|
|
|
}
|
|
|
|
|
2008-01-23 16:16:43 +00:00
|
|
|
/**
|
|
|
|
* Returns TRUE if the layer is readable/viewable.
|
|
|
|
*/
|
|
|
|
bool layer_is_readable(const Layer *layer)
|
|
|
|
{
|
|
|
|
return layer->readable;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns TRUE if the layer is writable/editable.
|
|
|
|
*/
|
|
|
|
bool layer_is_writable(const Layer *layer)
|
|
|
|
{
|
|
|
|
return layer->writable;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the previous layer of "layer" that are in the parent set.
|
|
|
|
*/
|
2007-09-18 23:57:02 +00:00
|
|
|
Layer *layer_get_prev(Layer *layer)
|
|
|
|
{
|
2008-03-22 18:43:56 +00:00
|
|
|
if (layer->parent_layer != NULL) {
|
|
|
|
JList list = layer->parent_layer->layers;
|
2007-09-18 23:57:02 +00:00
|
|
|
JLink link = jlist_find(list, layer);
|
|
|
|
if (link != list->end && link->prev != list->end)
|
|
|
|
return link->prev->data;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
Layer *layer_get_next(Layer *layer)
|
|
|
|
{
|
2008-03-22 18:43:56 +00:00
|
|
|
if (layer->parent_layer != NULL) {
|
|
|
|
JList list = layer->parent_layer->layers;
|
2007-09-18 23:57:02 +00:00
|
|
|
JLink link = jlist_find(list, layer);
|
|
|
|
if (link != list->end && link->next != list->end)
|
|
|
|
return link->next->data;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
void layer_set_name(Layer *layer, const char *name)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
2008-03-22 18:43:56 +00:00
|
|
|
/* TODO warning overflow */
|
2007-11-16 20:49:40 +00:00
|
|
|
strcpy(layer->name, name);
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
void layer_set_blend_mode(Layer *layer, int blend_mode)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
2008-03-22 18:43:56 +00:00
|
|
|
if (layer_is_image(layer))
|
2007-09-18 23:57:02 +00:00
|
|
|
layer->blend_mode = blend_mode;
|
|
|
|
}
|
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
void layer_add_cel(Layer *layer, Cel *cel)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
if (layer_is_image(layer)) {
|
|
|
|
JLink link;
|
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
JI_LIST_FOR_EACH(layer->cels, link)
|
2007-11-19 14:23:15 +00:00
|
|
|
if (((Cel *)link->data)->frame >= cel->frame)
|
2007-09-18 23:57:02 +00:00
|
|
|
break;
|
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
jlist_insert_before(layer->cels, link, cel);
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
void layer_remove_cel(Layer *layer, Cel *cel)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
if (layer_is_image(layer))
|
2007-11-16 20:49:40 +00:00
|
|
|
jlist_remove(layer->cels, cel);
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
|
2007-11-19 14:23:15 +00:00
|
|
|
Cel *layer_get_cel(Layer *layer, int frame)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
if (layer_is_image(layer)) {
|
2007-11-16 20:49:40 +00:00
|
|
|
Cel *cel;
|
2007-09-18 23:57:02 +00:00
|
|
|
JLink link;
|
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
JI_LIST_FOR_EACH(layer->cels, link) {
|
|
|
|
cel = link->data;
|
2007-11-19 14:23:15 +00:00
|
|
|
if (cel->frame == frame)
|
2007-11-16 20:49:40 +00:00
|
|
|
return cel;
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void layer_add_layer(Layer *set, Layer *layer)
|
|
|
|
{
|
2008-03-22 18:43:56 +00:00
|
|
|
assert(set != NULL && layer_is_set(set));
|
|
|
|
|
|
|
|
jlist_append(set->layers, layer);
|
|
|
|
layer_set_parent(layer, set);
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
|
2007-11-19 14:23:15 +00:00
|
|
|
void layer_remove_layer(Layer *set, Layer *layer)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
2008-03-22 18:43:56 +00:00
|
|
|
assert(set != NULL && layer_is_set(set));
|
|
|
|
|
|
|
|
jlist_remove(set->layers, layer);
|
|
|
|
layer_set_parent(layer, NULL);
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void layer_move_layer(Layer *set, Layer *layer, Layer *after)
|
|
|
|
{
|
2008-03-22 18:43:56 +00:00
|
|
|
assert(set != NULL && layer_is_set(set));
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
jlist_remove(set->layers, layer);
|
|
|
|
|
|
|
|
if (after) {
|
|
|
|
JLink before = jlist_find(set->layers, after)->next;
|
|
|
|
jlist_insert_before(set->layers, before, layer);
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
2008-03-22 18:43:56 +00:00
|
|
|
else
|
|
|
|
jlist_prepend(set->layers, layer);
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
|
2007-11-19 14:23:15 +00:00
|
|
|
void layer_render(Layer *layer, Image *image, int x, int y, int frame)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
if (!layer->readable)
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch (layer->gfxobj.type) {
|
|
|
|
|
|
|
|
case GFXOBJ_LAYER_IMAGE: {
|
2007-11-19 14:23:15 +00:00
|
|
|
Cel *cel = layer_get_cel(layer, frame);
|
2007-09-18 23:57:02 +00:00
|
|
|
Image *src_image;
|
|
|
|
|
2007-11-16 20:49:40 +00:00
|
|
|
if (cel) {
|
2008-02-29 19:29:49 +00:00
|
|
|
assert((cel->image >= 0) &&
|
|
|
|
(cel->image < layer->sprite->stock->nimage));
|
|
|
|
|
|
|
|
src_image = layer->sprite->stock->image[cel->image];
|
|
|
|
assert(src_image != NULL);
|
|
|
|
|
|
|
|
image_merge(image, src_image,
|
|
|
|
cel->x + x,
|
|
|
|
cel->y + y,
|
|
|
|
MID (0, cel->opacity, 255),
|
|
|
|
layer->blend_mode);
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case GFXOBJ_LAYER_SET: {
|
|
|
|
JLink link;
|
|
|
|
JI_LIST_FOR_EACH(layer->layers, link)
|
2007-11-19 14:23:15 +00:00
|
|
|
layer_render(link->data, image, x, y, frame);
|
2007-09-18 23:57:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-23 16:16:43 +00:00
|
|
|
/**
|
|
|
|
* Returns TRUE if the "layer" (or him childs) has cels to render in
|
|
|
|
* frame.
|
|
|
|
*/
|
2008-03-22 18:43:56 +00:00
|
|
|
static bool has_cels(const Layer *layer, int frame)
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
if (!layer->readable)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
switch (layer->gfxobj.type) {
|
|
|
|
|
|
|
|
case GFXOBJ_LAYER_IMAGE:
|
2007-11-19 14:23:15 +00:00
|
|
|
return layer_get_cel(layer, frame) ? TRUE: FALSE;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
case GFXOBJ_LAYER_SET: {
|
|
|
|
JLink link;
|
2007-11-16 20:49:40 +00:00
|
|
|
JI_LIST_FOR_EACH(layer->layers, link) {
|
2007-11-19 14:23:15 +00:00
|
|
|
if (has_cels(link->data, frame))
|
2007-09-18 23:57:02 +00:00
|
|
|
return TRUE;
|
2007-11-16 20:49:40 +00:00
|
|
|
}
|
2007-09-18 23:57:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
2008-03-22 18:43:56 +00:00
|
|
|
|
|
|
|
static void layer_set_parent(Layer *layer, Layer *parent_set)
|
|
|
|
{
|
|
|
|
assert(parent_set == NULL || layer_is_set(parent_set));
|
|
|
|
|
|
|
|
layer->parent_layer = parent_set;
|
|
|
|
}
|