if (!Storage::instance().exists(Util::getDataPath2())){
Global::debug(0) << "Cannot find data path '" << Util::getDataPath2().path() << "'! Either use the -d switch to specify the data directory or find the data directory and move it to that path" << endl;
return false;
}
/* do implementation specific setup */
initSystem(out);
dumb_register_stdfiles();
// Sound::initialize();
// Filesystem::initialize();
Graphics::SCALE_X = GFX_X;
Graphics::SCALE_Y = GFX_Y;
Configuration::loadConfigurations();
const int sx = Configuration::getScreenWidth();
const int sy = Configuration::getScreenHeight();
Graphics::Bitmap::setFakeGraphicsMode(sx, sy);
/* music */
atexit(&dumb_exit);
out << "Initialize random number generator" << endl;
/* initialize random number generator */
srand(time(NULL));
registerSignals();
#ifdef HAVE_NETWORKING
out << "Initialize network" << endl;
Network::init();
atexit(Network::closeAll);
#endif
/* this mutex is used to show the loading screen while the game loads */
if (!Storage::instance().exists(Util::getDataPath2())){
Global::debug(0) << "Cannot find data path '" << Util::getDataPath2().path() << "'! Either use the -d switch to specify the data directory or find the data directory and move it to that path" << endl;
white.fill(Graphics::makeColor(255, 0, 0));
white.BlitToScreen();
Util::restSeconds(1);
return false;
} else {
white.fill(Graphics::makeColor(255, 255, 255));
white.BlitToScreen();
}
return true;
}
diff --git a/util/init.h b/util/init.h
index 50b549c0..d8bc2784 100644
--- a/util/init.h
+++ b/util/init.h
@@ -1,31 +1,32 @@
#ifndef _paintown_init_h
#define _paintown_init_h
/* global vars */
#define GFX_X 640
#define GFX_Y 480
namespace Global{
extern volatile int speed_counter4;
extern volatile unsigned int second_counter;
extern const double LOGIC_MULTIPLIER;
extern const int TICS_PER_SECOND;
extern const int WINDOWED;
extern const int FULLSCREEN;
extern bool rateLimit;
/* pass WINDOWED or FULLSCREEN in. FIXME: replace with an enum */