aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-02-20 17:18:43 -0500
committerNathan Vance <nathav63@gmail.com>2015-02-20 17:18:43 -0500
commitb29c03dd3b933d05e2f569acafeb7405971eb9e2 (patch)
treeea9090a2a45be4f675fde6023af1e49a886271b1 /view.c
parentStarted backend for game view (diff)
download7w-b29c03dd3b933d05e2f569acafeb7405971eb9e2.tar.gz
7w-b29c03dd3b933d05e2f569acafeb7405971eb9e2.tar.bz2
7w-b29c03dd3b933d05e2f569acafeb7405971eb9e2.zip
Added view for all wonders
Diffstat (limited to 'view.c')
-rw-r--r--view.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/view.c b/view.c
index beb62aa..7d1c99a 100644
--- a/view.c
+++ b/view.c
@@ -1,12 +1,34 @@
#include "7w.h"
void print_wonder(int x, int y, int player, int cursor);
+void print_wondersmall(int x, int y, int player);
void io_printcard(int x, int y, int era, int card);
void io_printhand(int x, int y, int player, int cursor);
void io_clearscreen();
int data_numplayers();
-void view_refresh(int focus, int cursor)
+void view_refresh(int focus, int cursor, int player)
{
-
+ io_clearscreen();
+ int num = data_numplayers();
+ int x, y, i;
+ int offset = 0;
+ if(num == 3) x = 0;
+ if(num == 4 || num == 5) x = 1;
+ if(num == 6 || num == 7) x = 2, offset = -1;
+ y = 4;
+ int change = -1;
+ for(i = 0; i < num; i++) {
+ int p = (player+i+offset)%num;
+ if(p < 0) p += num;
+ if(focus == p)
+ print_wonder(x*27, y, p, cursor);
+ else print_wondersmall(x*27, y, p);
+ if(x == 0) {
+ if(change == -1) change = 0;
+ else change = 1;
+ y = 0;
+ }
+ x += change;
+ }
}
bgstack15