], $OPENGL_LIBS)
CEGUI_LIBS="-lCEGUIBase -lCEGUIOpenGLRenderer -lCEGUIFalagardWRBase"
- # The following are optionnal, but we need to link against them if cegui was built with them
- libssilly="$OPENGL_LIBS -lpng"
- AC_CHECK_LIB(CEGUISILLYImageCodec, createImageCodec,
- [CEGUI_LIBS="$CEGUI_LIBS -lCEGUISILLYImageCodec"],
- [echo "CEGUISILLYImageCodec not found/not working, disabled."],
- $libssilly
- )
-
+ # The following are optional, but we need to link against them if cegui was built with them
AC_CHECK_LIB(CEGUIXercesParser, main,
[CEGUI_LIBS="$CEGUI_LIBS -lCEGUIXercesParser"],
[echo "CEGUIXercesParser not found/not working, disabled."],
)
AC_CHECK_LIB(CEGUIDevILImageCodec, main,
- [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIDevILImageCodec"],
+ [
+ CEGUI_LIBS="$CEGUI_LIBS -lCEGUIDevILImageCodec"
+ AC_DEFINE([HAVE_LIBCEGUIDEVILIMAGECODEC],[1],Define to 1 to use DevIL codec)
+ ],
[echo "CEGUIDevILImageCodec not found/not working, disabled."],
$OPENGL_LIBS
)
AC_CHECK_LIB(CEGUITGAImageCodec, createImageCodec,
- [CEGUI_LIBS="$CEGUI_LIBS -lCEGUITGAImageCodec"],
+ [
+ CEGUI_LIBS="$CEGUI_LIBS -lCEGUITGAImageCodec"
+ AC_DEFINE(HAVE_LIBCEGUITGAIMAGECODEC,[1],Define to 1 to use the TGA codec)
+ ],
[echo "GUITGAImageCodec not found/not working, disabled."],
$OPENGL_LIBS
)
+ libssilly="$OPENGL_LIBS -lpng"
+ AC_CHECK_LIB(CEGUISILLYImageCodec, createImageCodec,
+ [
+ CEGUI_LIBS="$CEGUI_LIBS -lCEGUISILLYImageCodec"
+ AC_DEFINE([HAVE_LIBCEGUISILLYIMAGECODEC],[1],Define to 1 to use SILLY codec)
+ ],
+ [echo "CEGUISILLYImageCodec not found/not working, disabled."],
+ $libssilly
+ )
+ # Restore the libs
LIBS="$libstemp"
- echo "LIBS : $CEGUI_LIBS"
+ echo "CEGUI_LIBS : $CEGUI_LIBS"
fi
AC_SUBST(CEGUI_CFLAGS)
-static void init_sdlgui(char * skin_layout,int fullscreen,int tilt)
+static void init_sdlgui(char * skin_layout,int fullscreen,int tilt, char *image_codec_name)
{
SDL_Surface * screen;
// atexit (SDL_Quit);
try
{
- dbg(0, "Forcing silly image codec\n");
- CEGUI::OpenGLRenderer::setDefaultImageCodecName("SILLYImageCodec");
+ using namespace CEGUI;
+ if (image_codec_name) {
+ dbg(0, "Using image codec: %s from config\n", image_codec_name);
+ } else {
+#if defined (HAVE_LIBCEGUISILLYIMAGECODEC)
+ image_codec_name = "SILLYImageCodec";
+#elif defined(HAVE_LIBCEGUIDEVILIMAGECODEC)
+ image_codec_name = "DevILImageCodec";
+#elif defined (HAVE_LIBCEGUITGAIMAGECODEC)
+ image_codec_name = "TGAImageCodec";
+#else
+ fprintf (stderr, "No default image codec available. Try setting image_codec in your config\n");
+ exit (1);
+#endif
+ dbg(0, "Using default image codec: %s\n", image_codec_name);
+ }
+ CEGUI::OpenGLRenderer::setDefaultImageCodecName(image_codec_name);
+
CEGUI::System::setDefaultXMLParserName(CEGUI::String("TinyXMLParser"));
dbg(0, "Using %s as the default CEGUI XML Parser\n", CEGUI::System::getDefaultXMLParserName().c_str());
renderer = new CEGUI::OpenGLRenderer(0,XRES,YRES);
new CEGUI::System(renderer);
-
- using namespace CEGUI;
-
+
SDL_ShowCursor(SDL_ENABLE);
SDL_EnableUNICODE(1);
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
// strcpy(media_cmd_setting->u.str,media_window_title);
}
+ struct attr *image_codec_setting=attr_search(attrs, NULL, attr_image_codec);
+ char *image_codec_name=NULL;
+ if (image_codec_setting)
+ image_codec_name=image_codec_setting->u.str;
struct attr *skin_setting=attr_search(attrs, NULL, attr_skin);
if(skin_setting){
- init_sdlgui(skin_setting->u.str,fullscreen,tilt);
+ init_sdlgui(skin_setting->u.str,fullscreen,tilt, image_codec_name);
} else {
g_warning("Warning, no skin set for <sdl> in navit.xml. Using default one");
- init_sdlgui("TaharezLook",fullscreen,tilt);
+ init_sdlgui("TaharezLook",fullscreen,tilt, image_codec_name);
}