adonthell-devel
[Top][All Lists]
Advanced

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

[Adonthell-devel] As seen on adonthell-commits ...


From: ksterker
Subject: [Adonthell-devel] As seen on adonthell-commits ...
Date: Tue, 19 Oct 2004 09:25:30 +0200

As I never tested this before, I am pretty delighted to see that notifications 
to adonthell-commits work again:     
http://lists.nongnu.org/mailman/listinfo/adonthell-commits 

As for this one:
I have refined the startup procedure somewhat. First of all, there are a bunch 
of command line arguments recognized. These can be passed to both C programs 
using adonthell_main as well as to python scripts.
'python test/inputtest.py -h' for example will print a help message and exit.

To initialize the individual modules, flags can be passed to adonthell::init. 
This will initilize the individual modules, using the backend specified in 
configuration file or on the command line. If none of those are given, fallback 
is 'sdl'. On shutdown, any modules initialized that way are cleaned up 
automatically.

For that to work, a script would have to look as follows:

  from adonthell import gfx, input, main
  import sys

  class InputtestApp:
      def __init__ (self, app):
          self.Letsexit = 0
          self.App = app

      def main (self):
          ## Initialize the gfx and input systems
          self.App.init_modules (main.app.GFX | main.app.INPUT)

          ## Set us a nice window
          gfx.screen.set_video_mode(640, 480)

          ## ...

  if __name__ == '__main__':
      myApp = main.AdonthellApp ()
      inputtest = InputtestApp (myApp)
      myApp.init (inputtest.main)

All scripts in test/ match this and work just like a charm.


The other thing I've added is a class for handling paths. The idea is yours 
Alex (I believe), but refined a bit. When opening a file via 
base::paths::open(), up to 3 locations are searched for the file in the given 
order:

1) the current saved game directory (when specified)
2) a user defined data directory (specified via command line [-d switch])
3) the builtin data directory

The first matching file found is opened and returned. Eventually I'd like to 
add another predefined 'extension' directory that sits somewhere in a users 
home directory. That could be used to install mods or something without need to 
use a privileged user account. That needs more thoughts, but something like the 
plugin ability of Morrowind would be nice for v0.6 or v0.7.

The reason for having the user defined data directory is mainly to allow 
developing. Designers can have a game directory inside their $HOME, where they 
can directly change stuff with the editors and then start the engine to test 
without need to install anything. Of course, this requires the a certain layout 
of the data. The editors would have to take care of that. Some sort of project 
management shared by all editors might help here ...


So much for the recent changes. More in my next mail ...

Kai





reply via email to

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