SBSPSS/Utils/MkLevel/Layers/MkLevelLayerTrigger.cpp

71 lines
2.6 KiB
C++
Raw Normal View History

2001-04-17 18:42:07 +02:00
/*********************/
/*** Layer Trigger ***/
/*********************/
#include <Davelib.h>
#include <List2d.h>
//#include "MkLevel.h"
#include "MkLevelLayerTrigger.h"
/*****************************************************************************/
/*****************************************************************************/
/*** Pre-Process *************************************************************/
/*****************************************************************************/
/*****************************************************************************/
void CMkLevelLayerTrigger::PreProcess(CMkLevel *Core)
{
}
/*****************************************************************************/
/*****************************************************************************/
/*** Process *****************************************************************/
/*****************************************************************************/
/*****************************************************************************/
void CMkLevelLayerTrigger::Process(CMkLevel *Core)
{
2001-04-19 17:12:21 +02:00
ProcessList(Core);
2001-04-17 18:42:07 +02:00
printf("%i Trigger\n",ThingList.size());
}
/*****************************************************************************/
/*****************************************************************************/
/** Write ********************************************************************/
/*****************************************************************************/
/*****************************************************************************/
2001-06-25 17:54:07 +02:00
int CMkLevelLayerTrigger::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];
sThingTrigger OutThing;
OutThing.Type=ThisThing.Type;
OutThing.Pos.X=ThisThing.XY[0].x;
OutThing.Pos.Y=ThisThing.XY[0].y;
2001-04-30 23:49:54 +02:00
OutThing.Width=ThisThing.Data.Trigger.TriggerWidth;
OutThing.Height=ThisThing.Data.Trigger.TriggerHeight;
2001-05-02 20:40:41 +02:00
OutThing.TargetPos.X=ThisThing.Data.Trigger.TriggerTargetX;
OutThing.TargetPos.Y=ThisThing.Data.Trigger.TriggerTargetY;
2001-05-05 23:18:12 +02:00
OutThing.TargetSize.X=ThisThing.Data.Trigger.TriggerTargetW;
OutThing.TargetSize.Y=ThisThing.Data.Trigger.TriggerTargetH;
2001-07-26 18:51:29 +02:00
OutThing.Val0=ThisThing.Data.Trigger.TriggerVal0;
OutThing.Val1=ThisThing.Data.Trigger.TriggerVal1;
2001-04-17 18:42:07 +02:00
fwrite(&OutThing,sizeof(sThingTrigger),1,File);
}
2001-06-25 17:54:07 +02:00
Size=ftell(File)-ThisPos;
2001-04-17 18:42:07 +02:00
return(ThisPos);
}
/*****************************************************************************/