Xetrov

Member
  • Content count

    62
  • Joined

  • Last visited

Community Reputation

116 Neutral

About Xetrov

  • Rank
    Member
  1. Mac OS X woes

    Check out MacPorts (http://www.macports.org/) A quick check shows glew, freetype, libsdl available. I'm unsure about the rest. For most of the libs I need I found in macports already, and the ones that weren't I compiled manually and didn't have any problems with the configure && make etc. I agree it wasn't easy the first time trying to sort it all out, and this is why I try to avoid it as much as possible :)
  2. Render Class

    The point is so that as far as the rest of your code is concerned, it doesn't matter if you are using OpenGL or Direct3D or whatever. The render class can be changed for the different graphics APIs, and you dont have to change any of your code.
  3. I have a nice C++ class for vector math functions which wraps a float[3] -- CVector, and the same thing with Quaternions etc... I'm using boost::python to expose my C++ classes/functions to python. Currently I have wrapped any functions taking or returning a CVector to take or return a boost tuple instead. However this is a somewhat dirty solution as I want to use vector math in python too. So the question is, which would be faster? : 1) Expose the C++ CVector class to python -- pro: easy. con: maybe not too efficient to have to convert all the time -- there might be a lot of vector math... 2) Create a python vector class and convert to that instead of tuples (as I currently am). pro: wont need to make repeated conversions back to C++ vectors. con: the conversion on passing/returning may take a bit longer, also python math functions probably add a little overhead on C++. After writing that out, I think #2 is probably better...
  4. Limiting access to python modules

    Fruny's post got me looking around a bit more... Can I redefine __import__ before I execute my scripts? But then how can I stop a redefinition :D There has to be an easier/cleaner method than just checking every line of python before I pass it to the interpreter... [Edited by - Xetrov on November 26, 2004 12:41:46 AM]
  5. Limiting access to python modules

    SiCrane: Yes, thats what I want. Well I want two interpreter/environments actually: 1) The main game environment which is a set of python scripts which hook into my C++ engine 2) The console which can only be allowed an even more minimal choice of modules (or probably none except those loaded by the engine) So the game scripts need to have a limited environment to avoid the modules such as sockets. If it is easier, is it possible to disallow *all* module loading from paths which the engine doesn't like, and disallow all C module loading -- so I can recreate any modules etc if I want them (eg string). Does that clear it up at all?
  6. I've got python embedded in my game to provide scripting for a number of different uses, not the least of which is the game logic. Eventually I expect users to be able to create mods by modifying these python scripts -- however I want to limit the modules that can be loaded in these scripts, eg only a few standard python modules such as string and maybe the file i/o stuff in addition to my game/engine modules, but definately not modules such as sockets... How do I go about blocking unwanted modules, (or including only modules that I want). Can I do it with the standard python library or will I have to hack it a bit to stop sys.path changes etc?
  7. FreeType

    just glScale(1, -1, 1); before you call the Render func.
  8. Detecting IP change

    When it does you will lose all your current network connections anyway -- there is the event.
  9. No, not necessarily. You could have some cool HUD tracking stuff and/or radar. Drawing the outline of objects for example... It wouldn't need to be on all the time, so you could turn it on only when you enter an asteroid field for example. You could imagine all ships are lit, except maybe tough stealth fighters which dont show up on radar anyway.
  10. Constructor Speed

    Well, AFAIK, the second one will be slower because A and B have already been constructed. eg: MyClass::MyClass ( float a, float b ) : A ( a ), B ( b ) {} will essentially be: A(a); B(b); and MyClass::MyClass ( float a, float b ) { A = a; B = b; } will essentially be: A(); B(); A = a; B = b; On the other hand, maybe your compiler is smart enough to optimize that anyway :)
  11. Cuban Missile Crisis

    If you haven't seen it, I really recommend that you sit down and watch Thirteen Days: http://www.imdb.com/title/tt0146309/ It is one of the scariest movies I have ever seen, and is really well made. I don't like to think about what would happen if it was the current US government. Of course Russia isn't like it used to be either :)
  12. Quote:Original post by Extrarius Of course, I'm still voting for the 11-step rating system from -5 to +5 What's the point of giving a 0 rating? ;)
  13. From C# to C++

    Well I guess you are going to have to learn how to code again :)
  14. Zipping a BMP file...

    Ever heard of PNG? It is an image format with lossless compression via ZLib.
  15. Quote: Casting literals is strange. Why not this? float x = 400.0f / 300.0f Fair enough, but that doesnt exactly work when you want to use variables instead ;)