summaryrefslogtreecommitdiff
path: root/src/spriteloader
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-01-16 16:43:29 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-22 22:16:07 +0100
commite7e53163404d4bb04b1213fccfb0772596b37f95 (patch)
tree86cca82012836952f47583bddc0eee2b79c5667f /src/spriteloader
parent02e874145792670c46205d28e876b01de4cc2348 (diff)
downloadopenttd-e7e53163404d4bb04b1213fccfb0772596b37f95.tar.xz
Add: Allow sprite encoders (blitters) to specify an alignment for sprite width and height.
Diffstat (limited to 'src/spriteloader')
-rw-r--r--src/spriteloader/spriteloader.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/spriteloader/spriteloader.hpp b/src/spriteloader/spriteloader.hpp
index 5a37abc2d..c75f4685c 100644
--- a/src/spriteloader/spriteloader.hpp
+++ b/src/spriteloader/spriteloader.hpp
@@ -82,5 +82,14 @@ public:
* Convert a sprite from the loader to our own format.
*/
virtual Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) = 0;
+
+ /**
+ * Get the value which the height and width on a sprite have to be aligned by.
+ * @return The needed alignment or 0 if any alignment is accepted.
+ */
+ virtual uint GetSpriteAlignment()
+ {
+ return 0;
+ }
};
#endif /* SPRITELOADER_HPP */