--- np2/x11/main.c 2008/03/18 15:33:14 1.29 +++ np2/x11/main.c 2011/01/15 14:37:09 1.32 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.29 2008/03/18 15:33:14 monaka Exp $ */ +/* $Id: main.c,v 1.32 2011/01/15 14:37:09 monaka Exp $ */ /* * Copyright (c) 2003 NONAKA Kimihiro @@ -29,8 +29,13 @@ #include #include +#include #include +#if defined(USE_SDLAUDIO) || defined(USE_SDLMIXER) +#include +#endif + #include "np2.h" #include "diskdrv.h" #include "dosio.h" @@ -127,6 +132,11 @@ main(int argc, char *argv[]) progname = argv[0]; + setlocale(LC_ALL, ""); + bindtextdomain(np2appname, NP2LOCALEDIR); + bind_textdomain_codeset(np2appname, "UTF-8"); + textdomain(np2appname); + toolkit_initialize(); toolkit_arginit(&argc, &argv); @@ -191,8 +201,12 @@ main(int argc, char *argv[]) } if (modulefile[0] != '\0') { /* font file */ - snprintf(np2cfg.fontfile, sizeof(np2cfg.fontfile), - "%s/font.bmp", modulefile); + file_cpyname(np2cfg.fontfile, modulefile, + sizeof(np2cfg.fontfile)); + file_cutname(np2cfg.fontfile); + file_setseparator(np2cfg.fontfile, sizeof(np2cfg.fontfile)); + file_catname(np2cfg.fontfile, "font.bmp", + sizeof(np2cfg.fontfile)); /* resume/statsave dir */ file_cpyname(statpath, modulefile, sizeof(statpath)); @@ -232,6 +246,10 @@ main(int argc, char *argv[]) TRACEINIT(); +#if defined(USE_SDLAUDIO) || defined(USE_SDLMIXER) + SDL_Init(0); +#endif + if (fontmng_init() != SUCCESS) goto fontmng_failure; @@ -355,6 +373,10 @@ fontmng_failure: skbdwin_deinitialize(); +#if defined(USE_SDLAUDIO) || defined(USE_SDLMIXER) + SDL_Quit(); +#endif + TRACETERM(); dosio_term();