--- np2/x11/main.c 2008/03/18 15:33:14 1.29 +++ np2/x11/main.c 2008/04/03 13:52:49 1.31 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.29 2008/03/18 15:33:14 monaka Exp $ */ +/* $Id: main.c,v 1.31 2008/04/03 13:52:49 monaka Exp $ */ /* * Copyright (c) 2003 NONAKA Kimihiro @@ -31,6 +31,10 @@ #include #include +#if defined(USE_SDLAUDIO) || defined(USE_SDLMIXER) +#include +#endif + #include "np2.h" #include "diskdrv.h" #include "dosio.h" @@ -191,8 +195,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 +240,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 +367,10 @@ fontmng_failure: skbdwin_deinitialize(); +#if defined(USE_SDLAUDIO) || defined(USE_SDLMIXER) + SDL_Quit(); +#endif + TRACETERM(); dosio_term();