40 lines
915 B
C
40 lines
915 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(" ");
|
|
consoleAddCommand("quit", appQuit);
|
|
// 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);
|
|
|
|
// initialize our network system (sockets, winsock, etc.)
|
|
netInit();
|
|
|
|
gameInit();
|
|
// start our program loop!
|
|
interfaceLoop();
|
|
|
|
gameClose();
|
|
interfaceClose();
|
|
return SUCCESS;
|
|
}
|
|
|
|
void appQuit() {
|
|
consoleLog("lolol");
|
|
is_running = 0;
|
|
}
|