Lantz

Members
  • Content count

    217
  • Joined

  • Last visited

Community Reputation

142 Neutral

About Lantz

  • Rank
    Member
  1. random function, again

    You're not supposed to reseed on every use of rand. Try seeding once and you'll get totally different results. Edit: Ah, I see, no global seed. Then rand isn't what you're looking for.
  2. C#: Creating Object Arrays?

    Quote:Original post by philvaira Nevermind. Creating constructors with initialized defaults are a good thing, but also it can create random NPCs as well. Just pass on a few details, and let the constructor handle the rest of the details for you :) Lantz, I like that, too. I wonder which is better to use. I was trying to access those objects outside the class, but I can't access them. You don't have to instanciate the class like I suggested, my point was just that you need to do it somewhere. And to access them you need to make the array public or access them by some method/property of the class.
  3. Btw you can easily verify this by changing the size of the window.
  4. C#: Creating Object Arrays?

    Common[] npcArray = new Common[100]; This only creates an array of 100 references to Common, it does not create 100 instances of Common. Right before: npcArray[npcNum].setName(sNPCName); Do: npcArray[npcNum] = new Common(); // or however you instanciate that class
  5. I would guess that it's the frame + depth/stencil buffers. Just the frame buffer for a 1024x768x32 window with single buffering takes 3 megs. Then add double or tripple buffering and a depth/stencil buffer and you got yourself a whole lot of megabytes. I'm not sure that should show up as memory usage for the app if it's in video memory though, but perhaps it's not.
  6. I've had no problems whatsoever with SP2, and noone I know have either. It doesn't make your pc slower, sure if you keep the built-in firewall running it uses a little resources, but so does any third-party firewall.
  7. [web] HTML include

    IIRC there's a feature in IIS that adds a header and footer to all pages served, and there are problably similiar features in apache and other software. Not very flexible but it should be fast. Although the overhead of SSI and other methods is probably neglible.
  8. [web] HTML include

    Have a look at SSI (Server Side Includes). It's supported by most web server software.
  9. Surface Question???

    No, the back buffer is separate from the depth/stencil buffers. The back buffer has its own surface while the depth and stencil surfaces often are combined as the book said.
  10. Calculate a luminance value like this: L = 0.299R + 0.587G + 0.114B And use that for each component. This is done to compensate for the fact that the sensitivity of the human eye varies with the wavelength, ie. the human eye is more sensitive to green than red and blue. edit: and perhaps I should have read the thread through and noticed that this had already been covered
  11. C++ Console Password Masking

    char *c = new char; //temp getch() storage char *OUT = new char[13]; //filename Why?
  12. Draw a surface based on a set of points?

    How many points? Three?
  13. What's the point of Function Pointers?

    Look up how qsort works. That's a pretty good example of good function pointer usage. Also there's a bunch of stuff in the windows api that uses function pointers for callbacks. Sure, they could've done it with inheritance and base classes and stuff, but 1) it would be overkill in most cases and 2) it wouldnt work in C.
  14. TODO list bot

    Visual Studio .NET also has such a feature.