[Scummvm-devel] PS2 #9 : performance : node optimization : important

Johannes Schickel lordhoto at gmail.com
Mon Mar 2 13:40:37 CET 2009


Willem Jan Palenstijn schrieb:
> On Mon, Mar 02, 2009 at 07:00:55AM +0100, sunmax at libero.it wrote:
>   
>> At the moment we have a set of bools "isDir", "isValid" flags.
>> + methods and maybe even couple more platform specific flags
>> (eg. "isDev", "isRoot") that could be set at node creation
>> without need to check them over and over. To do this it would
>> be useful if we could have a "uint32 flags" in FSNode where
>> each bit has a defined meaning. Some as "isDir", "isValid" bits
>> would be universal, shared between all platforms, a chunk of
>> this uint32 flags would then be reserved for the backends.
>>     
>
> I don't think mixing general and backend-specific flags in a single
> field is a good idea, because it exposes backend-specifics to engines,
> and also forces a specific way of caching these values on the backends.
>
> If you want to cache flags (like the general dir/read/write flags and
> the _IS_DEV you mention below) in a flag field, you can of course still
> do so in Ps2FSNode itself.
>   

I agree with Willem here, I guess you can just do it inside your own 
FSNode implementation. The isDir etc. API is IMHO way nicer than a 
getFlags method anyway.

// Johannes






More information about the Scummvm-devel mailing list