2001-04-17 18:42:07 +02:00
|
|
|
/******************/
|
|
|
|
/*** Layer Item ***/
|
|
|
|
/******************/
|
|
|
|
|
|
|
|
#include <Davelib.h>
|
|
|
|
#include <List2d.h>
|
|
|
|
|
|
|
|
//#include "MkLevel.h"
|
|
|
|
#include "MkLevelLayerItem.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*** Pre-Process *************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
void CMkLevelLayerItem::PreProcess(CMkLevel *Core)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*** Process *****************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
void CMkLevelLayerItem::Process(CMkLevel *Core)
|
|
|
|
{
|
2001-04-19 17:12:21 +02:00
|
|
|
ProcessList(Core);
|
2001-04-17 18:42:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/** Write ********************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
2001-06-25 17:54:07 +02:00
|
|
|
int CMkLevelLayerItem::Write(CMkLevel *Core,FILE *File,const char *LayerName)
|
2001-04-17 18:42:07 +02:00
|
|
|
{
|
|
|
|
int ThisPos=ftell(File);
|
|
|
|
sThingHdr Hdr;
|
|
|
|
int i,ListSize=ThingList.size();
|
|
|
|
|
|
|
|
Hdr.Count=ListSize;
|
|
|
|
fwrite(&Hdr,sizeof(sThingHdr),1,File);
|
|
|
|
|
|
|
|
for (i=0; i<ListSize; i++)
|
|
|
|
{
|
|
|
|
sMkLevelLayerThing &ThisThing=ThingList[i];
|
|
|
|
sThingItem OutThing;
|
|
|
|
|
|
|
|
OutThing.Type=ThisThing.Type;
|
|
|
|
OutThing.Pos.X=ThisThing.XY[0].x;
|
|
|
|
OutThing.Pos.Y=ThisThing.XY[0].y;
|
|
|
|
fwrite(&OutThing,sizeof(sThingItem),1,File);
|
|
|
|
}
|
|
|
|
|
2001-06-25 17:54:07 +02:00
|
|
|
Size=ftell(File)-ThisPos;
|
2001-04-17 18:42:07 +02:00
|
|
|
return(ThisPos);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|