strtok

Members
  • Content count

    174
  • Joined

  • Last visited

Community Reputation

191 Neutral

About strtok

  • Rank
    Member
  1. How stupid was this?

    Why are you asking other people for advice when you already know the answer? First, you did something that wasn't very smart and potentially dangerous. By doing so, you also broke the law. Lastly, you were caught doing it. Be a responsible citizen and a responsible adult: admit your guilt and and pay the fine. Laws exist for a reason. Don't waste the valuable time of civil servants. Take your punishment gracefully and use it as an opportunity to learn something. I mean no offense to you personally, but this type of behavior is an ailment of our society. Police officers are busy people. He may not show up to court because--*gasp*--he may have better things to do. This does NOT make you any less guilty for what you did. This does NOT somehow make the fact that you broke the law go away. Being less than honest about your reasons for making the switch, attempting to downplay your choice and agency in the matter, is wrong. How will doing that do anything to improve yourself as a person and as a citizen, or help society? It doesn't. Take responsibility for your actions. P.S. -- I support people who contest charges when they are truly innocent. However, you've essentially admitted to everything and are just wondering if you should try to wiggle out of it. Bad form.
  2. Microsoft visual studio 2010 error

    This just means that your program started, and then exited successfully (0 means success; anything else means failure).
  3. GUI Font Rendering

    Without a fancy scaling technique, you only really have one alternative: rasterize font glyphs to texture at the appropriate target resolution, and then render in such a way as to achieve a direct mapping between texels and pixels. If you know the specific sizes and resolutions in advance you can pre-compute the textures, otherwise you'll have to do it at runtime.
  4. Smartpointers in DX9?

    http://www.bradwich.com/blog/2007/11/30/smart-pointers-direct3d/
  5. Carmack on government

    Interesting discussion. I agree with Carmack. I for one will do the same as Carmack--that is, vote for candidates that favor smaller government. Most people understand and agree that they should live within their means (making sacrifices to make do with needs instead of wants, avoiding consumer debt, etc.), yet for some reason it's OK for the government to exceed its means. News flash: if you get into a mortgage you can't afford or do nothing but spend credit you don't have (just a few examples), you're going to experience some very negative consequences. It's foolish to think that the government can engage in that same behavior without experiencing those same consequences. "Common sense" has been mentioned quite a few times above, and it's true--if common sense dictates that certain practices lead to weak results in one's individual life, rest assured that those same results will occur when government engages in them. This is just common sense. Carmack likens taxes to a utility bill. When the burden becomes too great, you cut back, and rightly so--this is only "common sense." Government needs to do the same thing any reasonable individual does when faced with problems: cut back, make do with less, prioritize, compromise, and focus on the pure necessities. I'm not opposed to taxes, just as I'm not opposed to paying my electricity bill. However, I am opposed to a monolithic government that continues to consume resources at an alarming rate for diminishing returns, just as I am opposed to buying a $350,000.00 on my income (average cost of a decent home in my area) or spending the rest of my life paying interest on credit card debt. Government needs to work harder for every dollar it receives, by learning to spend it more wisely, just as I work hard for every one I receive. The disease of entitlement, and its reflection in government, needs to go.
  6. Using individual bits of a data type as booleans

    Quote:Original post by Perlohmann if ((orders & 0x8) == 1) //binary '1000' { //attack the attacking player's out of play creatures } Actually, that won't work. You probably meant this: if ((orders & 0x8) == 0x8) { //attack the attacking player's out of play creatures }
  7. Graduating soon, possible dilemma

    You might consider applying for some other software programming positions outside of games. If you want to be a programmer, the best experience is programming. Testing does help some people get into programming positions, but in my opinion the skill sets are quite different. Anyway, just a suggestion. Besides, if games doesn't work out (or is delayed for whatever reason) you'll have real-world experience to fall back on, to get a job in other software sectors.
  8. Here's my story--maybe it will help. I got interested in programming during junior high when I stumbled upon some BASIC programs in my algebra textbook. I already loved games, and once I figured out I could tell a computer what to do, I knew I wanted to be a game programmer. I then spent most of my teenage years reading books and just learning on my own. I moved from BASIC to Visual BASIC to C and to C++. Eventually I went to school got a degree in Computer Science. After graduation, I got sidetracked in boring software development. I ended up in a job I didn't enjoy, so I quit. I spent the next year doing part-time web programming on a contract basis and building a game demo...from scratch. I figured if I could build something substantial on my own, I might have a shot. Turns out that the demo was *very* useful in catching the eye of potential employers. I ended up with a fabulous job at a fantastic studio. Anyway, it all boils down to this: do you love programming? Do you love it enough to spend your free time getting better at it? When you write code, do you really think about how to improve it and make it better? Do you consume books, articles, and other sources of information that will help you design and implement things in more efficient and elegant ways? If you can do those things, then you can be a great programmer, and by extension, a game programmer. Despite taking physics and math courses (including linear algebra) at my university, I never really felt confident with them. One of the goals of my demo was to change that. It worked! Practice really makes perfect. It can be done if you want it enough and are willing to sacrifice for it! P.S. -- I made the transition from "boring" software development to game development at age 28, so it's not like you're too old or anything.
  9. Send the email message to your phone's SMS email address, and then you'll get it as a text message: http://sms411.net/how-to-send-email-to-a-phone/
  10. C++: ZeroMemory() and inheritance

    Using memcpy to copy objects is considered bad practice (see item 96 in "C++ Coding Standards" by Herb Sutter), and by extension, so is using memset/ZeroMemory in a constructor. First off, if your object has virtual functions, you've just overwritten the vtable pointer with the null pointer. Oops. Second of all, if you have member variables that are non-POD types, you've potentially clobbered any custom initialization that was done in their constructors. You should really use initializer lists to initialize an object via the constructor. If you feel your class is "too large" for this, then you probably have a bad design and you should split up the class into smaller pieces.
  11. C++ doesn't suck. Unfortunately these days it's very popular to bash it, especially by people who don't know the language. You won't reap the benefits of using C++ unless you pay the price to truly learn it. You can argue that you don't have the time or desire to do so, but don't expect to find something else that has the same advantages (specifically, the excellent balance between high level abstraction and performance) while somehow being "easy" or less complex. If C++ isn't the right tool for the job, then don't use it. However, if you're looking for a C++ replacement, then you should just use C++ (and invest whatever is necessary to become more fluent). It's not perfect (what is?) but it is extremely good at what it does, which is to provide high abstraction capabilities while maintaining high performance.
  12. who can give me any advice?

    Here's how I did it: 1. Read lots of books; learned a lot about subjects I wasn't familiar with 2. Built a game demo in my spare time, where I applied the things I'd learned and put them into practice 3. Submitted applications to a whole load of studios 4. Eventually got hired! I would definitely suggest building a demo to include with a resume. It goes a long way.
  13. A **Foo is a pointer to a pointer to Foo. If you have such a pointer, the only way to get to the members of Foo (such as 'i') is to dereference that pointer twice. A dereference operation is not a type, therefore you cannot typedef it.
  14. passing variable to classes automatically

    Quote:Original post by Storyyeller Wouldn't that just change the problem of passing too many arguments in the constructor, to passing too many arguments in the update function? I probably will encapsulate the vectors though No, the idea is you pass a single interface that the entity uses to interact with the outside world. This interface hides the implementation details. If you have too many arguments, then you bundle them up into some object as a single argument. When you can, don't pass data (i.e. a concrete container type, such as a vector); instead, pass an interface. When you can, don't require your entities to hold direct pointers to global state; instead, pass an interface.
  15. passing variable to classes automatically

    You shouldn't give each entity a pointer to a vector for a number of reasons: 1. If you ever change the data structure that you're using to store entities, you have to go back and update all of your existing entities 2. It's not very clean to have each entity store direct pointers to global containers like that Instead of giving each entity the information it needs to add other entities at creation time, you could pass it at update time. For instance: class Entity; class EntityContext { public: virtual void AddEntity (Entity *entity) = 0; virtual void RemoveEntity (Entity *entity) = 0; }; class GameEntityContext : public EntityContext { private: typedef std::vector<Entity *> EntityVector; EntityVector *entities_; public: explicit GameEntityContext (EntityVector *entities) : entities_(entities) {assert(entities_);} void AddEntity (Entity *entity) {entities_.push_back(entity);} void RemoveEntity (Entity *entity) { ... } }; class Entity { public: virtual void Update (EntityContext *entity_context) = 0; }; ... // in the main game's update function, you do this: // NOTE: this nees to be much more sophisticated since // any Entity could potential add to or remove from the vector GameEntityContext::EntityVector current_entities(entities_); GameEntityContext entity_context(&entities_); for (GameEntityContext::iterator it= current_entities_.begin(); it != current_entities_.end(); ++it) { it->Update(&entity_context); } // then in a particular Entity's Update function: entity_context->AddEntity(new_entity); Code not tested and not guaranteed to compile. However, it illustrates the point. Each Entity does not store a persistent pointer to either a vector or an EntityContext: instead, this is passed in as a parameter to the Update function. All an Entity needs to do to add another is call AddEntity on that EntityContext. This gives you a lot of flexibility and makes you resilient to changes later on.