-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettings.cpp
More file actions
executable file
·73 lines (57 loc) · 1.55 KB
/
Copy pathSettings.cpp
File metadata and controls
executable file
·73 lines (57 loc) · 1.55 KB
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
#include "Settings.h"
Settings::Settings(GameData *GD)
{
Gamedata = GD;
SetDefaults();
/* FILE *input = fopen( "DownPour.ini", "r" );
if (input == NULL) {
Error("Can't load DownPour.ini! Using default settings");
}
else {
fscanf(input,"%s %d %d %d %d %d",temp,&X,&Y,&BBP,&FULLSCREEN,&port);
}
fclose(input);
*/
// Perform several checks to make sure the settings are valid
//CheckVideo();
return;
}
Settings::~Settings()
{
// Might want to save settings on exit here
for (int i=0; i < 6;++i)
if (Nicks[i] != NULL)
delete [] Nicks[i];
if (ThemePath != NULL)
delete [] ThemePath;
if (MyNick != NULL)
delete [] MyNick;
return;
}
void Settings::SetDefaults()
{
MyNick=new char[7];
sprintf(MyNick,"NoName%c",'\0');
for (int i=0; i < 6;++i)
Nicks[i]=NULL;
ThemePath=NULL;
X=640; Y=480; BBP=32; FULLSCREEN=0;
droprate=1500; floattime=7500; cleardroprate=3000;
increasedroprate=InMinutes(5);
port=9999;
classic=true;
// Setup the timers
FrameRate.ChangeDelay(30); // Set the framerate to 30MS
DropRate.ChangeDelay(droprate);
IncreaseDropRate.ChangeDelay(increasedroprate);
return;
}
void Settings::CheckVideo()
{
double temp=double(X) / Y;
if (temp != double(4) / 3) {
Error("Invalid screen resolution! Valid are 640x480 800x600 1024x768... Anything 4:3");
exit(0);
}
return;
}