-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.c
101 lines (76 loc) · 1.29 KB
/
functions.c
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "functions.h"
#include "grid.h"
#include "misc.h"
void Function_Exit(LifeGrid *lifegrid)
{
Function_Close(lifegrid);
gtk_main_quit();
}
void Function_New(LifeGrid *lifegrid)
{
Function_Close(lifegrid);
Grid_Create(lifegrid, 400, 600);
}
void Function_Close(LifeGrid *lifegrid)
{
if (Grid_Is_Evolving(lifegrid))
{
Grid_Stop_Evolution(lifegrid);
}
if (Grid_Is_Created())
{
Grid_Destroy(lifegrid);
}
}
void Function_Zoom_In(LifeGrid *lifegrid)
{
if (Grid_Is_Created())
{
if (Grid_Get_Zoom_Level(lifegrid) < ZOOM_LEVEL_MAX)
{
Grid_Zoom_In(lifegrid);
}
}
}
void Function_Zoom_Out(LifeGrid *lifegrid)
{
if (Grid_Is_Created())
{
if (Grid_Get_Zoom_Level(lifegrid) > 1)
{
Grid_Zoom_Out(lifegrid);
}
}
}
void Function_Continue(LifeGrid *lifegrid)
{
if (Grid_Is_Created())
{
if (! Grid_Is_Evolving(lifegrid))
{
Grid_Start_Evolution(lifegrid);
}
}
}
void Function_Stop(LifeGrid *lifegrid)
{
if (Grid_Is_Created())
{
if (Grid_Is_Evolving(lifegrid))
{
Grid_Stop_Evolution(lifegrid);
}
}
}
void Function_Change_Delay(LifeGrid *lifegrid, uint32 delay)
{
if (Grid_Is_Created())
{
Grid_Change_Delay(lifegrid, delay);
if (Grid_Is_Evolving(lifegrid))
{
Grid_Stop_Evolution(lifegrid);
Grid_Start_Evolution(lifegrid);
}
}
}