Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #include "SgSystem.h"
00007 #include "SgInit.h"
00008
00009 #include <iostream>
00010 #include "SgException.h"
00011 #include "SgMemCheck.h"
00012 #include "SgProp.h"
00013
00014 using namespace std;
00015
00016
00017
00018 namespace {
00019
00020 bool s_isSgInitialized = false;
00021
00022 }
00023
00024
00025
00026 void SgFini()
00027 {
00028 SgProp::Fini();
00029 SgMemCheck();
00030 s_isSgInitialized = false;
00031 }
00032
00033 void SgInitImpl(bool compiledInDebugMode)
00034 {
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef NDEBUG
00043 if (! compiledInDebugMode)
00044 {
00045 cerr <<
00046 "Incompatible library: SmartGame was compiled "
00047 "without NDEBUG, but main program with\n";
00048 abort();
00049 }
00050 #else
00051 if (compiledInDebugMode)
00052 {
00053 cerr << "Incompatible library: SmartGame was compiled "
00054 "with NDEBUG, but main program without\n";
00055 abort();
00056 }
00057 #endif
00058
00059 SgProp::Init();
00060 s_isSgInitialized = true;
00061 }
00062
00063 void SgInitCheck()
00064 {
00065 if (! s_isSgInitialized)
00066 throw SgException("SgInit not called");
00067 }
00068
00069
00070