Beispiel #1
0
void initUI(void)
{
    bool optionsLoaded;
    bool mouseInitialized;
    
    initMachine();
    
    optionsLoaded = loadOptions();
    
    initGameEngine(&gCallbacks);
    mouseInitialized = initMouse(&gMouseCallbacks);
    
    // If we couldn't initialize a mouse and it was enabled on the options, then disable it.
    if ((!mouseInitialized) &&
        (gGameOptions.enableMouse)) {
        gGameOptions.enableMouse = false;
        gGameOptions.optionsSaved = false;
        
        // If there were no options loaded, then let's turn on the joystick instead.
        if (!optionsLoaded) {
            gGameOptions.enableJoystick = true;
        }
    }
    
    initJoystick(&gJoyCallbacks);
    
    if (gGameOptions.enableSound) {
        soundInit(gGameOptions.mockingBoardSlot, gGameOptions.enableSpeechChip);
    }
    
    if (!gGameOptions.optionsSaved) {
        saveOptions();
    }
}
Beispiel #2
0
int main(int argc, char** argv)
{
	// Initialize easylogging++ library
	initLoggingLibrary();

	// Welcome message !
	LOG(INFO) <<"======-=====-====-===-==-=- XEROF -=-==-===-====-=====-======";

	// Initialize Allegro5 library
	initGameEngine();

    // Initialize random seed
    initRandSeed();

	// Start the game loop
    GameLoop().startGame();

	return EXIT_SUCCESS;
}