/****************/ /*** Layer 3d ***/ /****************/ #include #include #include "..\MkLevel.h" #include "MkLevelLayer3d.h" /*****************************************************************************/ /*****************************************************************************/ /*** Pre-Process *************************************************************/ /*****************************************************************************/ /*****************************************************************************/ void CMkLevelLayer3d::PreProcess(CMkLevel *Core) { int Width=InMap.GetWidth(); int Height=InMap.GetHeight(); OutMap.SetSize(Width,Height); for (int Y=0; YAddTile3d(InElem); } } } } /*****************************************************************************/ /*****************************************************************************/ /*** Process *****************************************************************/ /*****************************************************************************/ /*****************************************************************************/ void CMkLevelLayer3d::Process(CMkLevel *Core) { /* int Width=InMap.GetWidth(); int Height=InMap.GetHeight(); int i,ListSize; TriList.SetTexGrab(Core->GetTexGrab()); //!!! TexGrab.AllowRotate(true); TexGrab.AllowRotate(false); //!!! TexGrab.ShrinkToFit(true); TexGrab.ShrinkToFit(false); for (int Y=0; YGetTile(ThisElem); // Build Sorted List CList SortList; CList ZPosList; if (InTile.TriCount) { for (i=0; iThisFace.vtx[1].z) ThisZPos=ThisFace.vtx[1].z; if (ThisZPos>ThisFace.vtx[2].z) ThisZPos=ThisFace.vtx[2].z; ListSize=SortList.size(); for (ListPos=0; ListPos OutVtxList; TriList.Process(); ProcessVtxList(TriList.GetVtxList(),OutVtxList); LayerHdr.Type=Type; LayerHdr.SubType=SubType; LayerHdr.Width=Width; LayerHdr.Height=Height; fwrite(&LayerHdr,sizeof(sLayerHdr),1,File); int Pos3d=ftell(File); fwrite(&Hdr3d,sizeof(sLayer3d),1,File); for (int Y=0; Y const &InList,vector &OutList) { int i,ListSize=InList.size(); //int XMin,XMax,YMin,YMax; sVtx Ofs; OutList.resize(ListSize); if (!ListSize) return; /* XMin=XMax=InList[0].vx; YMin=YMax=InList[0].vy; // Find Min/Max for (i=1; iInList[i].vx) XMin=InList[i].vx; if (XMaxInList[i].vy) YMin=InList[i].vy; if (YMaxOutList[i].vx) XMin=OutList[i].vx; if (XMaxOutList[i].vy) YMin=OutList[i].vy; if (YMax