summary refs log tree commit diff
path: root/sol.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sol.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sol.c b/sol.c
index 724aefd..c0882ac 100644
--- a/sol.c
+++ b/sol.c
@@ -102,7 +102,7 @@ static void gameDraw(void) {
 	}
 }
 
-static bool gameFind(uint *stack, uint *index, Sint8 card) {
+static bool gameFind(uint *stack, uint *index, Card card) {
 	for (*stack = 0; *stack < StacksLen; ++*stack) {
 		for (*index = 0; *index < stacks[*stack].len; ++*index) {
 			if (stacks[*stack].cards[*index] == card) return true;
@@ -111,7 +111,7 @@ static bool gameFind(uint *stack, uint *index, Sint8 card) {
 	return false;
 }
 
-static bool gameAvail(Sint8 card) {
+static bool gameAvail(Card card) {
 	uint stack, index;
 	if (card < 0) return false;
 	if (!gameFind(&stack, &index, card)) return false;
@@ -130,7 +130,7 @@ static bool gameAvail(Sint8 card) {
 	}
 }
 
-static bool gameReveal(Sint8 card) {
+static bool gameReveal(Card card) {
 	uint stack, index;
 	if (!gameFind(&stack, &index, card)) return false;
 	if (stack < Tableau1 || stack > Tableau7) return false;
@@ -140,13 +140,13 @@ static bool gameReveal(Sint8 card) {
 	return true;
 }
 
-static bool gameMove(uint dest, Sint8 card) {
+static bool gameMove(uint dest, Card card) {
 	uint source, index;
 	if (!gameFind(&source, &index, card)) return false;
 	if (source == dest) return false;
 
 	uint count = stacks[source].len - index;
-	Sint8 destTop = stackTop(&stacks[dest]);
+	Card destTop = stackTop(&stacks[dest]);
 
 	if (dest >= Foundation1 && dest <= Foundation4) {
 		if (count > 1) return false;
@@ -204,7 +204,7 @@ enum {
 struct Item {
 	SDL_Rect rect;
 	uint texture;
-	Sint8 card;
+	Card card;
 };
 
 struct List {
@@ -241,7 +241,7 @@ static void layoutClear(void) {
 	layout.drag.len = 0;
 }
 
-static void layoutCard(struct List **list, SDL_Rect *rect, Sint8 card) {
+static void layoutCard(struct List **list, SDL_Rect *rect, Card card) {
 	if (card == layout.dragItem.card) {
 		*list = &layout.drag;
 		*rect = layout.dragItem.rect;
@@ -300,7 +300,7 @@ static void layoutTableau(void) {
 		struct List *list = &layout.main;
 		SDL_Rect rect = base;
 		for (uint j = 0; j < stacks[i].len; ++j) {
-			Sint8 card = stacks[i].cards[j];
+			Card card = stacks[i].cards[j];
 			layoutCard(&list, &rect, card);
 			rect.x += TableauDeltaX;
 			rect.y += (card > 0 ? TableauDeltaYFront : TableauDeltaYBack);