Esempio n. 1
0
File: Main.c Progetto: PTJohe/LCOM
int main(int argc, char *argv[]) {
	initLog();
	LOG("main", "Starting Where's Wally? ...");

	/* Initialize service */
	sef_startup();

	/* Enable IO-sensitive operations for ourselves */
	sys_enable_iop(SELF);

	printf("Starting \"Where's Wally?\" ....\n");

	initGraphics(MODE_1280_1024);

	WallyNIX* wally = (WallyNIX*) startWallyNIX();
	while (!wally->exit) {
		updateWallyNIX(wally);

		if (!wally->exit) {
			if (wally->timerFPS->ticked) {
				wally->timerFPS->ticked = 0;
				drawWallyNIX(wally);

				copyToMouseBuffer();
				if (getMouse()->draw) {
					drawMouse();
				}

				copyToVideoMem();
			}
		}
	}
	stopWallyNIX(wally);

	exitGraphics();

	LOG("main", "Terminated Where's Wally? ...");
	printf("\"Where's Wally?\" exited successfully.\n");

	return EXIT_SUCCESS;
}
Esempio n. 2
0
 void shutdown() {
     if (isInitialized()) {
         close();
         exitGraphics();
     }
 }