adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: adonthell/src/tools/pydonthell Makefile.am,1.2


From: Kai Sterker <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src/tools/pydonthell Makefile.am,1.26,1.27 pydonthell.cc,1.8,1.9
Date: Sun, 12 Jan 2003 18:24:32 -0500

Update of /cvsroot/adonthell/adonthell/src/tools/pydonthell
In directory subversions:/tmp/cvs-serv17348/src/tools/pydonthell

Modified Files:
        Makefile.am pydonthell.cc 
Log Message:
ADDED first bits of the new item implementation
FIXED pydonthell to work again
ADDED fix for Windows/BeOS versions: it's no longer required to set the working 
directory of the adonthell exe, as it'll chdir there automatically. (Thanks 
Shard!)


Index: Makefile.am
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/pydonthell/Makefile.am,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** Makefile.am 24 Aug 2001 12:32:46 -0000      1.26
--- Makefile.am 12 Jan 2003 23:24:29 -0000      1.27
***************
*** 5,10 ****
  pydonthell_SOURCES = pydonthell.cc
  
! CPPFLAGS +=-I../.. $(SDL_CFLAGS) $(OGG_CFLAGS) $(PY_CFLAGS) 
  
  pydonthell_LDADD = ../../libadonthell.a $(SDL_LIBS) $(OGG_LIBS) $(PY_LIBS)
  
--- 5,11 ----
  pydonthell_SOURCES = pydonthell.cc
  
! CPPFLAGS =-I../.. $(SDL_CFLAGS) $(OGG_CFLAGS) $(PY_CFLAGS) 
  
  pydonthell_LDADD = ../../libadonthell.a $(SDL_LIBS) $(OGG_LIBS) $(PY_LIBS)
+ pydonthell_LDFLAGS = -Wl,-E
  

Index: pydonthell.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/pydonthell/pydonthell.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** pydonthell.cc       8 Oct 2001 08:19:37 -0000       1.8
--- pydonthell.cc       12 Jan 2003 23:24:29 -0000      1.9
***************
*** 21,24 ****
--- 21,25 ----
  
  #include "game.h"
+ #include "prefs.h"
  #include "python_class.h"
  
***************
*** 35,39 ****
       * 
       */
!     void initadonthellc (void);
  }
  
--- 36,40 ----
       * 
       */
!     void init_adonthell (void);
  }
  
***************
*** 62,91 ****
      }
      
!     if (!game::init (myconfig)) 
!         return 1;
      
!     // add the working directory to python's path (otherwise, scripts
!     // without absolute path cannot be executed)
!     string path = dirname (argv[0]);
!     if (path[0] != '/') 
!     {
!         string tmp = getcwd (NULL, 0);
!         path = tmp + path;
!     }
! 
!     // the only way to pass that path to python seems to be the
!     // PYTHONPATH environment variable
!     string pythonpath = path;
!     char *env = getenv ("PYTHONPATH");
      
!     if (env)
!     {
!         pythonpath += ":";
!         pythonpath += env;
!     }
      
!     setenv ("PYTHONPATH", pythonpath.c_str (), 1);
      
      Py_Main (argc, argv);
!     game::cleanup (); 
  }
--- 63,81 ----
      }
      
!     game::init (DATA_DIR); 
!     game::set_game_data_dir (myconfig.gamedir);
      
!     python::init ();
!     python::insert_path (".");
!     python::insert_path (DATA_DIR"/modules");
      
!     init_adonthell ();
      
!     python::module = python::import_module ("adonthell"); 
!     if (!python::module) return false;     
      
+     data::globals = PyModule_GetDict (python::module);
+ 
      Py_Main (argc, argv);
!     python::cleanup ();
  }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]