diff --git a/src/bygfoot.h b/src/bygfoot.h index 0338ed1c..527fd7a8 100644 --- a/src/bygfoot.h +++ b/src/bygfoot.h @@ -1,38 +1,45 @@ /* - bygfoot.h + bygfoot.h - Bygfoot Football Manager -- a small and simple GTK2-based - football management game. + Bygfoot Football Manager -- a small and simple GTK2-based + football management game. - http://bygfoot.sourceforge.net + http://bygfoot.sourceforge.net - Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.com) + Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.com) - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef BYGFOOT_H #define BYGFOOT_H +//#define MAC_BUILD + #include #include #include +#ifndef MAC_BUILD #ifdef HAVE_CONFIG_H # include #endif +#else +# include "config.h" +#include +#endif #include #include "gettext_macros.h" diff --git a/src/main.c b/src/main.c index d4c786d0..e832b185 100644 --- a/src/main.c +++ b/src/main.c @@ -326,7 +326,6 @@ main_init(gint *argc, gchar ***argv) #endif gchar buf[SMALL]; - gchar *pwd = g_get_current_dir(); support_directories = NULL; rand_generator = g_rand_new(); @@ -339,16 +338,31 @@ main_init(gint *argc, gchar ***argv) #endif #ifdef G_OS_UNIX +#ifndef MAC_BUILD file_add_support_directory_recursive(PACKAGE_DATA_DIR "/" PACKAGE "/support_files"); sprintf(buf, "%s%s%s", g_get_home_dir(), G_DIR_SEPARATOR_S, HOMEDIRNAME); file_add_support_directory_recursive(buf); #endif +#endif +#ifndef MAC_BUILD + gchar *pwd = g_get_current_dir(); sprintf(buf, "%s%ssupport_files", pwd, G_DIR_SEPARATOR_S); file_add_support_directory_recursive(buf); sprintf(buf, "%s%ssaves", pwd, G_DIR_SEPARATOR_S); file_add_support_directory_recursive(buf); g_free(pwd); +#else + CFURLRef newurlref; + CFStringRef newstring = CFSTR("support_files"); + + newurlref = CFBundleCopyResourceURL(CFBundleGetMainBundle(), newstring, NULL, NULL); + newstring = CFURLCopyPath(newurlref); + CFStringGetCString(newstring, buf, SMALL + 1, kCFStringEncodingASCII); + file_add_support_directory_recursive(buf); + CFRelease(newurlref); + CFRelease(newstring); +#endif main_init_variables(); @@ -370,10 +384,12 @@ main (gint argc, gchar *argv[]) #endif #ifdef ENABLE_NLS +#ifndef MAC_BUILD bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); #endif +#endif #ifdef G_OS_WIN32 int fd1 = open ("stdout.log", O_CREAT|O_WRONLY|O_TRUNC, 0666); dup2 (fd1, 1); diff --git a/src/support.c b/src/support.c index 00aff298..b0e73693 100644 --- a/src/support.c +++ b/src/support.c @@ -2,9 +2,15 @@ * DO NOT EDIT THIS FILE - it is generated by Glade. */ +#define MAC_BUILD + +#ifndef MAC_BUILD #ifdef HAVE_CONFIG_H # include #endif +#else +# include "config.h" +#endif #include #include