#include "main.h"
#include "game.h"

BITMAP *gui;
clientState *client;

void enter_game() {
  PALETTE pal;
  u_short port;
  gui = load_bitmap("data/images/gui.pcx", pal);

	wsock_init();

	// gets server port from config file
  port = (u_short)get_config_int("net", "serverport", DEFAULT_PORT);

  // initializes game console
  console_init();

  client = (clientState*)malloc(sizeof(struct clientState));
  client->queue = NULL;
	client_connect(&client, "localhost", port);
}

void render_playarea(BITMAP *bmp) {
  // blit gui
  blit(gui, bmp, 0, 0, 0, 0, gui->w, gui->h);
}
