Difference between revisions of "TODO"

Jump to navigation Jump to search
292 bytes added ,  21:44, 1 May 2006
(This has been done a long time ago)
Line 92: Line 92:


=== Files ===
=== Files ===
* Add a FilesystemManager or FileManager or so which should unify and/or replace the current File/FilesystemNode classes (and maybe SaveFileManager). The goal is to make these things as portable as possible while keeping it easy to use for the coder. Some new functionality we need:
** check for existence of file/directory
** check whether given directory is readable/writeable
** convert FSNode into a string representation (for prefs file)
** convert said string representation back to FSNode
*: Of course that can be added w/o a FileManager class, too - but it might be nice to have all of these integrated.
* Get rid of the incRef/decRef API of class File. Instead, add a clone() method which generates a new (independant) File object for the same file (only would work for files in read mode, obviously). Convert the audio code to use this instead of the ref counting.<br> Reason: Using a shared file object can lead to race conditions if multiple threads try to use it at the same time; on some systems (Symbian) it is apparently not even possible to do it; iahd t can also cause problems even in non-threaded code, when we seek in one block of code, and then try to access it from another block, w/o reseeking first.
* Get rid of the incRef/decRef API of class File. Instead, add a clone() method which generates a new (independant) File object for the same file (only would work for files in read mode, obviously). Convert the audio code to use this instead of the ref counting.<br> Reason: Using a shared file object can lead to race conditions if multiple threads try to use it at the same time; on some systems (Symbian) it is apparently not even possible to do it; iahd t can also cause problems even in non-threaded code, when we seek in one block of code, and then try to access it from another block, w/o reseeking first.
* Don't rely on the existence of SEEK_CUR, SEEK_END, SEEK_SET -- rather, define our own enum for this and convert all client code to use it.
* Don't rely on the existence of SEEK_CUR, SEEK_END, SEEK_SET -- rather, define our own enum for this and convert all client code to use it.
* Try to replace all usages of paths by FilesystemNode. In particular, Engine::_gameDataPath and File::addDefaultDirectory() will have to be adjusted. The idea behind this is to ease portability.
* Consider removing write support from class File completely. After all, we do not support writing to data files on many platforms anyway. There are only three things for which we need writable files:
*# Savegames -- but for those we already have the SavefileManage, so no problem
*# Resources dumps -- useful for debugging. To support those, we could add a new DumpFile class, which simply does nothing on systems which don't support this
*# Config file -- this one is the trickiest. The best approach is probably to make the actual reading/writing of the config file adjustable by the backend. This would also help to reduce the #ifdef hell in config-manager.cpp (see also the [[Modular Backends]] plans).


=== GUI ===
=== GUI ===
1,079

edits

Navigation menu