//
// main.h
//
// main() function of the program
//
//
// Author: Tomi Belan <tomi.belan@gmail.com>, (C) 2006
//
// Copyright: See COPYING file that comes with this distribution
//
//


#ifndef _main_h_
#define _main_h_

#include <SDL.h>
#include <SDL_ttf.h>
#include <SDL_mixer.h>
#include <map>
#include <string>

#include "programmode.h"

#ifdef __WIN32__
#define DIR_SEP "\\"
#else
#define DIR_SEP "/"
#endif

#define MENU_BACKGROUND "pozadie-lode3.png"

#define FRAMES_PER_SECOND 60

#define ERR_NOTICE      1
#define ERR_WARNING     2
#define ERR_ERROR       3
#define ERR_FATAL_ERROR 4

#define DEBUG_LEVEL ERR_NOTICE

#define set_rect_pos(r,xx,yy) ((r).x=(xx),(r).y=(yy),(r))
#define set_rect_dim(r,ww,hh) ((r).w=(ww),(r).h=(hh),(r))
#define set_rect(r,xx,yy,ww,hh) ((r).x=(xx),(r).y=(yy),(r).w=(ww),(r).h=(hh),(r))

void stopProgram();
std::string tr(std::string str);
bool rectanglesCollide(SDL_Rect, SDL_Rect);
void simpleText(const char *, int line);
SDL_Surface *loadImage(std::string filename, bool hasAlpha = false);
SDL_Surface *createSurface(int w, int h);
int error(const char *str2, int type);

extern std::string programDataPath;

extern std::map<std::string, SDL_Surface*> imagePool;

extern SDL_Surface *screen;

extern ProgramMode *activeProgramMode;
extern ProgramMode *newProgramMode;

extern TTF_Font *papyrusFont;

extern bool haveSound;

#endif
