-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvideo.cpp
More file actions
39 lines (29 loc) · 994 Bytes
/
Copy pathvideo.cpp
File metadata and controls
39 lines (29 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "game.h"
#include "video.h"
#include <SDL_render.h>
PrintLastToken(int row)
{
if(G.players[G.playerturn].arms==RED)
SDL_SetRenderDrawColor( V.renderer, 0xFF, 0x00, 0x00, 0xFF ); //red
else
SDL_SetRenderDrawColor( V.renderer, 0xFF, 0xFF, 0x00, 0xFF ); //yellow
#define NICERADIUS 4/10
int line=LinesFree(row,G)+1;
double precision;/*
if(V.xstep>V.ystep)precision=1.0/2/V.xstep;else precision=1.0/2/V.ystep;*/
if(V.xstep>V.ystep)precision=30.0/V.xstep;else precision=100.0/V.ystep;
for(double i = 0.0; i < 360; i+= precision)
SDL_RenderDrawLine(V.renderer,V.xstep*(row-1/2.0),V.ystep*(line-1/2.0),
V.xstep*(row-1/2.0+cos(i)*NICERADIUS),V.ystep*(line-1/2.0+sin(i)*NICERADIUS));
SDL_RenderPresent(V.renderer);
}
displayWinner()
{
if(G.playerturn)
printf("\n\n\n\007The winner is: %s !\n\n",G.players[G.playerturn].name);
else
printf("\n\n\n\007The winner is: %s !\n\n",G.players[G.playerturn].name);
}