summary refs log tree commit diff
path: root/cards.h
diff options
context:
space:
mode:
Diffstat (limited to 'cards.h')
-rw-r--r--cards.h52
1 files changed, 27 insertions, 25 deletions
diff --git a/cards.h b/cards.h
index 65e3c2b..23a70fb 100644
--- a/cards.h
+++ b/cards.h
@@ -17,33 +17,35 @@
 #ifndef CARDS_H
 #define CARDS_H
 
-#include <stddef.h>
-#include <stdint.h>
-
-enum Cards {
-	CardsClub    = 0x00,
-	CardsDiamond = 0x0D,
-	CardsHeart   = 0x1A,
-	CardsSpade   = 0x27,
-
-	CardsA = 1,
-	Cards2, Cards3, Cards4, Cards5, Cards6, Cards7, Cards8, Cards9, Cards10,
-	CardsJ, CardsQ, CardsK,
-
-	CardsEmpty = 0x35,
-	CardsBack1, CardsBack2, CardsBack3, CardsBack4, CardsBack5, CardsBack6,
-	CardsBack7, CardsBack8, CardsBack9, CardsBack10, CardsBack11, CardsBack12,
-
-	CardsX = 0x43,
-	CardsO,
-	CardsLen,
+#include <SDL_rwops.h>
+#include <SDL_surface.h>
+
+enum Cards_Card {
+	Cards_Club,
+	Cards_Diamond = 13,
+	Cards_Heart = 26,
+	Cards_Spade = 39,
+
+	Cards_A = 1,
+	Cards_2, Cards_3, Cards_4, Cards_5, Cards_6, Cards_7, Cards_8, Cards_9,
+	Cards_10, Cards_J, Cards_Q, Cards_K,
+
+	Cards_Empty = 53,
+	Cards_Back1, Cards_Back2, Cards_Back3, Cards_Back4,
+	Cards_Back5, Cards_Back6, Cards_Back7, Cards_Back8,
+	Cards_Back9, Cards_Back10, Cards_Back11, Cards_Back12,
+
+	Cards_X = 67,
+	Cards_O,
+
+	Cards_CardLen,
 };
 
-struct CardsData {
-	uint8_t *ptr;
-	size_t len;
-} cardsData[CardsLen];
+struct Cards {
+	struct SDL_Surface *surfaces[Cards_CardLen];
+};
 
-int cardsLoad(const uint8_t *ptr, size_t len);
+struct Cards *Cards_Load(struct SDL_RWops *rw);
+void Cards_Free(struct Cards *cards);
 
 #endif