#include "stdafx.h"

void AddMasterList (CListBox& MasterList)
{
	FILE *file;
	int data,version,len,i;

	file = fopen ("content\\effects\\mw.effects","rb");
	if (!file)
	{
		MessageBox (NULL,"No mw.effects file found","Error",MB_OK);
		return;
	}

	fread (&data,sizeof (int),1,file);
	ASSERT (data == 'GFX#');
	fread (&version,sizeof (int),1,file);
	if (version < 21)
	{
		MessageBox (NULL,"Unable to handle old version of mw.effects","Error",MB_OK);
		return;
	}

	fread (&len,sizeof (int),1,file);			// read len

	for (i=0;i<len;i++)
	{
		CString name;
		size_t strlen;
		char *buf;

		fread (&strlen,sizeof (size_t),1,file);
		if (strlen > 0)
		{
			buf = name.GetBufferSetLength (strlen+5);
			fread (buf,strlen+1,1,file);
			name.ReleaseBuffer ();
			if (name != "")
				MasterList.AddString (name);
		}
	}
	fclose (file);
}

void KillMasterList (CListBox& MasterList)
{
}


