XNA Creators Club Online
community forums

Search Forums

Page 1 of 21 (210 items) 1 2 3 4 5 Next > ... Last »
  • Re: Removing int[] from lists

    Right, especially since it allows you to do this: List<Point> points = new List<Point>();   points.Add(new Point(0, 0));   points.Remove(new Point(0, 0));   If it's not X and Y coordinates you're ...
    Posted to XNA Framework (Forum) by Cygon4 on 11/21/2009
  • Re: Removing int[] from lists

    If the int arrays in your list always consist of two elements, you could use a struct instead. If those are coordinates, simply use XNA's Point struct, or otherwise write your own with custom Equals() and GetHashCode() implementations. This would make the List<>.Remove() method behave as expected and also avoid the forming of ...
    Posted to XNA Framework (Forum) by Cygon4 on 11/19/2009
  • Re: Accessing Vector3 elements as an index. Ideas and thoughts on the following code?

    [quote user="Rhys Perkins"]Good point, I've updated the method to the following:             // Clamp to the range [0,3]               row = (row > 3) ? 3 : row;               row = (row < 0) ? 0 : row;  ...
    Posted to General (Forum) by Cygon4 on 11/13/2009
  • Re: Accessing Vector3 elements as an index. Ideas and thoughts on the following code?

    [quote user="Shawn Hargreaves"]Why multiply the row by 16? There are only four columns per row, so this just needs to multiply by 4 (or shift by 2). It's a minor detail, but making the switch values consecutive without any gaps increases the chance that this will end up translating to an efficient jump table rather than a slower ...
    Posted to General (Forum) by Cygon4 on 11/13/2009
  • Re: Accessing Vector3 elements as an index. Ideas and thoughts on the following code?

    Benchmark with 100,000,000 x 16 calls to the method Mine: 12.12 seconds (11.72 ngen'd) Yours: 15.89 seconds (16.56 ngen'd) Whatever GCC does, addition or bitwise or doesn't seem to make a difference to the .NET jitter or ngen. Given the marginal difference, I'd use the extension method any day, but I'm still ...
    Posted to General (Forum) by Cygon4 on 11/13/2009
  • Re: Accessing Vector3 elements as an index. Ideas and thoughts on the following code?

    [quote user="Rhys Perkins"]I have one for Matrix too now.  If anyone would like to see it, please shout![/quote] *shout* Try to beat this: /// <summary>Provides helper methods for working with matrices</summary>  ...
    Posted to General (Forum) by Cygon4 on 11/13/2009
  • Re: How best to access a service?

    Same here. Either use XNA's component concept and query your services in Initialize() (or LoadContent() or when needed if you wish, just not in the constructor), or use dependency injection and add the required services as parameters to your component's constructor, any optional services as properties. Personally, I'm using ...
    Posted to XNA Framework (Forum) by Cygon4 on 11/11/2009
  • Re: Drawing lots of 3d sprites

    For a similar task in a game I'm working on, I wrote this: Nuclex Framework: PrimitiveBatch. It's roughly what Shawn says, a 3D SpriteBatch that batches all kinds of primitives. Texture switches, different shaders and graphics device state changes are all supported and vertices will be batched together optimally as long as the drawing ...
    Posted to General (Forum) by Cygon4 on 11/11/2009
  • Re: Regarding what "Packaging as XNA Creators Club" does in XNA.

    I don't quite understand where you expect the problem. You can use svndumpfilter like that to obliterate any path from a repository (if you have access to the repository from the file system). If there's a Graphics directory somewhere beneath the bin folder, it would disappear from the repository, too. It will be as if bin and obj ...
    Posted to XNA Framework (Forum) by Cygon4 on 11/9/2009
  • Re: Regarding what "Packaging as XNA Creators Club" does in XNA.

    You can just delete those folders in your working copy and commit that. If you're concerned about repository size or want to obliterate those binaries from your repository history, this is only possible if you have access to the repository itself on the file system level. If you have that kind of access, you can use svndumpfilter to ...
    Posted to XNA Framework (Forum) by Cygon4 on 11/9/2009
Page 1 of 21 (210 items) 1 2 3 4 5 Next > ... Last »