#include "raine_sdl.h"
#include "cpuid.h"
#include "version.h"

void backslash(char *s)
{
#ifndef RAINE_UNIX
  while(*s){

      if(*s == '/')

	 *s = '\\';

      s ++;
   }
#endif
}

int main() {
  char str[256];
  printf("Raine2 version " VERSION "\n");
  get_cpu_name(str);
  printf("CPU: %s\n",str);

#ifdef RAINE_UNIX
   sprintf(dir_cfg.share_path, "/usr/share/games/raine/");
   sprintf(dir_cfg.exe_path, "%s/.raine/", getenv("HOME"));
#else
#if !defined(RAINE_WIN32) || defined(__MINGW32__)
   strcpy(dir_cfg.exe_path, argv[0]);
#else
   strcpy(dir_cfg.exe_path, __argv[0]);
#endif

   strcpy(get_filename(dir_cfg.exe_path),"");
   if (!dir_cfg.exe_path[0]) { // No path
	   getcwd(dir_cfg.exe_path,255);
	   chdir(dir_cfg.exe_path);
	   strcat(dir_cfg.exe_path,"/");
   }
   strlwr(dir_cfg.exe_path);
   backslash(dir_cfg.exe_path);

   strcpy(dir_cfg.share_path,dir_cfg.exe_path); // avoid useless ifdefs...
#endif

   // set config filename

#ifdef RAINE_DOS
   strcpy(dir_cfg.config_file, "raine.cfg");
#else
#ifdef RAINE_WIN32
   strcpy(dir_cfg.config_file, "raine32.cfg");
#else
   strcpy(dir_cfg.config_file, "rainex.cfg");
#endif
#endif

}
