• Advertisement
Sign in to follow this  
  • entries
    177
  • comments
    531
  • views
    163898

Not Untitled

Sign in to follow this  

126 views

OK I got it so the Task Manager reports 63MB's and the GC reports 2MB's(<- what?). That's better than 170MB with the GC saying 120MB(ouch).

The problem was:

1) I was creating a new entry class for each one in the WAD directory, but only had one instance. Three thousand new statements later...

2) For TEXTURE1/2 I forgot to put in the file seek line, so the classes got nothing but garbage data. One "patch"(that's what I call them) had over 5000 descriptions. Yikes!

Thanks to everyone who commented in the previous entry. Also following Rob Loach's comment, is this a good method of disposing the textures?


namespace Doom
{

public class Texture
{

private Direct3D.Texture Direct3D_Texture = null;

public static implicit operator Direct3D.Texture( Texture ConversionTexture )
{
return ConversionTexture.Direct3D_Texture;
}

// constructor + variables(without HTML)

~Texture()
{
if( Direct3D_Texture != null )
{
if( Direct3D_Texture.Disposed == false )
{
Direct3D_Texture.Dispose();
}
}
return;
}

}

}






I'm creating the textures like this:

SortedList.Add( Name, new Texture( Offset, File ) );

So I assume that their destructors will be called when the list is destroyed?
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement