-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
75 lines (60 loc) · 2.26 KB
/
main.cpp
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
/*
#############################################################################
# Tux in Space - space exploration game #
# Copyright (C) 2016-2017 Emanuele Sorce <[email protected]> #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, version 3 or compatibles. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software #
# Foundation, Inc. #
#############################################################################
########################################################################
# This is the Main function and contein program initialization
########################################################################
*/
#include "main.h"
using namespace std;
//
// MAIN FUNCTION
//
int main () {
// INITIALIZATION OF THE PROGRAM
// settings
setting set;
// Initialize the debug
debug_Init();
// initialize the program directories
if(set.InitDir() != signal::good) {
printf("\n\nTUX IN SPACE:\n\nError: can't Create program directories!\nPress something to exit");
in_s();
return EXIT_FAILURE;
}
// print loading and license banner
OPS(set, "LOADING TUX IN SPACE........\n\n" BANNER);
// The big type STRucture
signal result;
typeSTR stype(result);
// error handling
if(result != signal::good){
if(result == signal::file_err) {
OPS_Error(set, "Can't find the " TYPE_DATABASE_FILE " file conteining the definitions of objects types\n\nexiting...");
debug_Printf(IRREGULARITY "Stype initialization failed! exiting with file error signal");
return EXIT_FAILURE;
}
}
// RUNNING
while
(Run (set, stype) != false);
// EXITING THE PROGRAM
// goodbye message
OPS (set, "TUX IN SPACE\n%r-%r-%r-\n\n\nSEE YOU LATER!");
return EXIT_SUCCESS;
}