diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-27 03:00:09 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-27 03:00:09 +0200 |
commit | ec1991ba992640171eabe2f5d1029a2836624c58 (patch) | |
tree | ec98c0c0bc54e9e8d784d989b44a9f6525342f7f /layer.h | |
parent | e22d703662aef2d756162c3800c542075c372666 (diff) | |
download | osc-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.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); }; |