• Advertisement

FritoBandito

Member
  • Content count

    46
  • Joined

  • Last visited

Community Reputation

122 Neutral

About FritoBandito

  • Rank
    Member
  1. Help with game engine design

    The sprite was actually just an example that could be expanded upon and applied where appropriate. The goal of the post was to present something that starts the mind down the avenue of considering who should own what and why. The answers to those questions are what is important, not the example at face value.
  2. Help with game engine design

    Here's a construct that might help organize your thought (and thus your code) and help sort out some of your details about object ownership and collection: class Sprite { public: void rescale(float newScale); /*etc*/ friend class SpriteFactory; protected: Sprite(); Sprite(Sprite const&); Sprite& operator=(const Sprite&); } Here, SpriteFactory is a singleton factory class who has the sole capability of creating a Sprite. Creation rules - check. The SpriteFactory can take default ownership of any Sprite that it creates and can hand off ownership to something more appropriate later on. This goes a long way in managing object lifetimes. Using this, you can also prune your heap of unused Sprites just by iterating to gather all of your unclaimed children and destroying them. Recycling unclaimed children to satisfy requests for new Sprites is also a possibility. Another approach is allowing the Sprites to simply remain property of SpriteFactory and instead expose methods to tag and retrieve Sprites(get/set interface to hash implementation). Others will likely have different approaches (or variations on this one), but I feel this would be a step in the right direction.
  3. Also available as an alternative is Nokia's (Qt) qmake. GPL/LGPL/Commercial licensing. http://doc.trolltech.com/4.7/qmake-tutorial.html
  4. Good library to work with MP3 format??

    Also a fan of FMOD here. Another worthy of consideration is irrKlang.
  5. Have a program scan itself in memory.

    ^but even with the label method you will have some problems. Optimization is one because a compiler is free to remove a label that it has profiled as not being a jump target (surely you won't actually employ the labels in the code?). The other problem is that you miss the function prologue and epilogue. I remember reading an article from a Microsoft development team member about this subject. I wish I had the link, but I will attempt to paraphrase it. Piracy and copyright infringement are by-products of success and with success comes money. You are better off paying lawyers instead of programmers to handle piracy and copyright infringement.
  6. singleton instance

    Why would you not use the form: CEngine* CEngine::Instance() { static CEngine* instance_ = 0; if(!instance_) instance_ = new CEngine; return instance_; } ? Instead of the global with no construction guarantee? This approach also rids us of a member (c_pEngine) in the interface of the class.
  7. First openGL game - SUPER slow

    "Mesa DRI Intel(R) 915GM 20061017 x86/MMX/SSE2" From the FAQ (linked previously): "Alternately, Mesa acts as the core for a number of OpenGL hardware drivers within the DRI (Direct Rendering Infrastructure): The libGL.so library provides the GL and GLX API functions, a GLX protocol encoder, and a device driver loader. The device driver modules (such as r200_dri.so) contain a built-in copy of the core Mesa code. The X server loads the GLX module. The GLX module decodes incoming GLX protocol and dispatches the commands to a rendering module. For the DRI, this module is basically a software Mesa renderer.
  8. First openGL game - SUPER slow

    Greetings, You have no hardware acceleration. http://www.mesa3d.org/faq.html
  9. visual basic help

    Yes, VB and VB.NET are capable of producing a quality, entertaining game. Just as ItsDan said, it comes down to the capability of the programmer. On the subject of c++ and low-level programming: Try assembly sometime and you might be surprised at just how much c++ abstracts away from the programmer. c++ _is_ a high level language in all regards. More on the specifics of Visual Basic: I would strongly suggest not using VB6 (or earlier variants of it) as it has been deprecated for some time now. And finally, with making an MMO game, choice of language is definitely one of your lesser concerns. Regards.
  10. linking an .a archive in a MSVC++ program

    Greetings, objconv is a great addition to anyone's programming toolbox. It should help out in your situation. http://www.agner.org/optimize/?e=0#objconv
  11. hiding graphics without resourcefiles

    I would place them external to the application and apply an easy/quick encryption algo to them and call it good. That will discourage 99% of those who would seek to steal your copyrighted material. The other 1% will get it no matter what your measures.
  12. Stupid header problem

    Ironhand69, The syntax is fine because this is a pointer assignment (IMG_Load returns SDL_Surface*). Hope that helps.
  13. Question about $ in C++

    Yes, the same can also be said for MASM and LINK. It was either a decision that was made in terms of the entire suite of programming tools way back when the development began, or it is something that spilled over into VC/++ from MASM. Either way, MS likes the $$. Can't say I blame them. Haha.
  14. Is Dev-Cpp still Supported ??

    As another alternative you can try RadASM. Not only is it the premiere assembly IDE for win32, but it also supports many other languages including c++. It is written entirely in assembly so it is lightweight and rather fast. ;) It officially supports msvc 6 but you can coerce it into using msvc7+. Includes resource editor, dialog editor, code completion, etc. Works with HLA, too. Having used assembler you might already be aware of this, but I thought I might throw it out there for you. This is what I was referring to when I said "not exclusively" when speaking of Visual Studio with assembly source. http://www.radasm.com/download/radasm.html
  15. Is Dev-Cpp still Supported ??

    grofaz, you do realize that MASM is actually a part of Visual Studio, right? I realize you can get it as a separate install as MASM32 (much the way VSTookKit was to the whole of Visual Studio), but it is indeed a part of Visual Studio. You can also have all of the variants of win32 projects with ONLY assembly files if you wish. Infact, VS 2005 and beyond directly supports syntax hilighting and line-based debugging for assembly products (induction of usertype.dat is necessary for hilighting). I use it for assembly projects myself (not exclusively). You should try it sometime, you might like it. P.S. I do understand the whole "lean and mean" mentality, which is why I use assembler for selective optimization in my projects. And please, for the love of all that is good in the programming world, do not use dev-cpp.
  • Advertisement