timesynk/old/main.c

31 lines
792 B
C

#include "main.h"
#include "common.h"
#include "stubs.h"
#include "game.h"
#include "player.h"
#include "console.h"
// TODO: add arguments, so user can connect to server via cmdline option
int main(int argc, char *argv[]) {
// initialize our interface system (ncurses, SDL, etc.)
if (interfaceInit() == ERROR) {
return ERROR;
}
is_running = 1;
consoleLog(" ");
// h'okay, let's add our default player commands
// TODO: move this elsewhere, possibly gameInit()
playerSetCommand(PLAYER_MOVE, playerMove);
playerSetCommand(PLAYER_ACTIVATE, playerActivate);
playerSetCommand(PLAYER_LOOK, playerLook);
gameInit();
// start our program loop!
interfaceLoop();
gameClose();
netClose(); // TODO: move this to interfaceClose
interfaceClose();
return SUCCESS;
}