Not Untitled

Published April 13, 2006
Advertisement
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?
0 likes 1 comments

Comments

Rob Loach
Make sure to implement IDisposable!
April 13, 2006 08:02 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement