summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2018-06-23 01:04:35 +0300
committerTuomas Virtanen <katajakasa@gmail.com>2018-06-23 01:04:35 +0300
commit86ecb3fc8b4bea5d1f632281ed7166ac23f8d418 (patch)
treeea0c7b80b0d726e1c9c1c571c2c01eecd2b9e268 /include
parent4b999a94dbea71228fe27455165d7014b3777942 (diff)
Atlas cleanups
Diffstat (limited to 'include')
-rw-r--r--include/kitchensink/internal/subtitle/kitatlas.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/kitchensink/internal/subtitle/kitatlas.h b/include/kitchensink/internal/subtitle/kitatlas.h
index b43db2f..ad583a1 100644
--- a/include/kitchensink/internal/subtitle/kitatlas.h
+++ b/include/kitchensink/internal/subtitle/kitatlas.h
@@ -8,8 +8,6 @@
#include "kitchensink/kitconfig.h"
-#define MAX_SHELVES 256
-
typedef struct Kit_TextureAtlasItem {
int cur_shelf; //< Current shelf number in cache
int cur_slot; //< Current slot on shelf in cache
@@ -19,13 +17,21 @@ typedef struct Kit_TextureAtlasItem {
SDL_Surface *surface; //< Current item surface
} Kit_TextureAtlasItem;
+typedef struct Kit_Shelf {
+ uint16_t width;
+ uint16_t height;
+ uint16_t count;
+} Kit_Shelf;
+
typedef struct Kit_TextureAtlas {
int cur_items; //< Current items count
int max_items; //< Maximum items count
+ int max_shelves; //< Maximum shelf count
+ int border; //< Cleared border between atlas items in texture
int w; //< Current atlas width
int h; //< Current atlas height
Kit_TextureAtlasItem *items; //< Cached items
- uint16_t shelf[MAX_SHELVES][3]; //< Atlas current shelf width, height, item count
+ Kit_Shelf *shelves; //< Atlas shelves
} Kit_TextureAtlas;
KIT_LOCAL Kit_TextureAtlas* Kit_CreateAtlas(int w, int h);