aboutsummaryrefslogtreecommitdiff
path: root/layer.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-09-27 03:00:09 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-09-27 03:00:09 +0200
commitec1991ba992640171eabe2f5d1029a2836624c58 (patch)
treeec98c0c0bc54e9e8d784d989b44a9f6525342f7f /layer.h
parente22d703662aef2d756162c3800c542075c372666 (diff)
downloadosc-graphics-ec1991ba992640171eabe2f5d1029a2836624c58.tar.gz
make layer list double-linked
* does not in any way affect rendering performance * inserting is a bit more complex, but still O(1) * deleting is a lot faster (O(1)) since we do not have to search by name
Diffstat (limited to 'layer.h')
-rw-r--r--layer.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/layer.h b/layer.h
index d06707c..21fab50 100644
--- a/layer.h
+++ b/layer.h
@@ -27,7 +27,7 @@ public:
const char *types;
};
- SLIST_ENTRY(Layer) layers;
+ LIST_ENTRY(Layer) layers;
char *name;
@@ -92,7 +92,7 @@ private:
};
class LayerList {
- SLIST_HEAD(layers_head, Layer) head;
+ LIST_HEAD(layers_head, Layer) head;
SDL_mutex *mutex;
@@ -110,7 +110,7 @@ class LayerList {
public:
LayerList() : mutex(SDL_CreateMutex())
{
- SLIST_INIT(&head);
+ LIST_INIT(&head);
}
~LayerList()
{
@@ -118,7 +118,7 @@ public:
}
void insert(int pos, Layer *layer);
- bool delete_by_name(const char *name);
+ void delete_layer(Layer *layer);
void render(SDL_Surface *target);
};