[Bf-python] Texture module

Willian Padovani Germano wgermano at ig.com.br
Wed Nov 12 03:39:43 CET 2003


Hi Alex,

I'll give some suggestions, but feel free to disagree, we're a nice group
here : ).

For the set???() methods, strings conform to the API, and you can use
switch/case statements based on tex type to make sure things go well.  But
it's nice to have the equivalent member variable (like .mode for .setMode())
accept and return the or'ed int value.  Users can then choose what they
prefer and this is consistant with the (sadly) not so consistent bpython
API.

For the get???() methods:

> [It would be nice to say "if 'interpol' in m.imageflags: ..."]

The example with constant dicts is just as readable, though with a few more
characters, but certainly executes faster.  And the examples I remember
return ints, so it's also more usual.  Good documentation can do the rest to
prevent errors from script writers -- who are programmers, too.  Anyway they
have to check for the texture type and only then see what to get/change in
it, so it really isn't any harder for them.

About speed: of course we should not go crazy over speed issues, but a
simple and elegant approach -- specially when it's not harder to code --
counts in the end, when we consider BPython working as a whole.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list