/******************/ /*** Layer Tile ***/ /******************/ #include #include #include "MkLevelLayer.h" #include "MkLevelLayerTile.h" /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ CMkLevelLayerTile::CMkLevelLayerTile(sExpLayerHdr *LayerHdr) { Type=LayerHdr->Type; SubType=LayerHdr->SubType; Width=LayerHdr->Width; Height=LayerHdr->Height; sExpLayerTile *MapPtr=(sExpLayerTile *)((int)LayerHdr+sizeof(sExpLayerHdr)); InMap.SetSize(Width,Height); for (int Y=0; YTile; ThisTile.Flags=MapPtr->Flags; InMap.Set(X,Y,ThisTile); MapPtr++; } } } /*****************************************************************************/ /*****************************************************************************/ /*** Pre-Process *************************************************************/ /*****************************************************************************/ /*****************************************************************************/ void CMkLevelLayerTile::PreProcess(CMkLevel *Core) { int Width=InMap.GetWidth(); int Height=InMap.GetHeight(); OutMap.SetSize(Width,Height); for (int Y=0; YAddTile2d(InElem); } } } } /*****************************************************************************/ /*****************************************************************************/ /*** Process *****************************************************************/ /*****************************************************************************/ /*****************************************************************************/ void CMkLevelLayerTile::Process(CMkLevel *Core) { } /*****************************************************************************/ /*****************************************************************************/ /** Write ********************************************************************/ /*****************************************************************************/ /*****************************************************************************/ int CMkLevelLayerTile::Write(FILE *File,const char *LayerName,const char *MapName) { sLayerHdr Hdr; int ThisPos=ftell(File); int Width=OutMap.GetWidth(); int Height=OutMap.GetHeight(); Hdr.Type=Type; Hdr.SubType=SubType; Hdr.Width=Width; Hdr.Height=Height; fwrite(&Hdr,sizeof(sLayerHdr),1,File); printf("%s (%i,%i)= %i\n",LayerName,Width,Height,Width*Height*sizeof(sTileMapElem)); for (int Y=0; Y