/**********************/ /*** Layer Platform ***/ /**********************/ #include "stdafx.h" #include #include #include #include "GLEnabledView.h" #include "MapEdit.h" #include "MapEditDoc.h" #include "MapEditView.h" #include "MainFrm.h" #include "Core.h" #include "LayerThing.h" #include "LayerPlatform.h" #include "Utils.h" #include "Export.h" /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ CLayerPlatform::CLayerPlatform(sLayerDef &Def) { InitLayer(Def); } /*****************************************************************************/ void CLayerPlatform::InitLayer(sLayerDef &Def) { ThingBank=new CElemBank(-1,-1,false,CElem::CentreModeLR /*| CElem::CentreModeB*/); CLayerThing::InitLayer(Def); LoadThingScript(theApp.GetConfigStr("LayerScript","PlatformScript")); } /*****************************************************************************/ void CLayerPlatform::InitSubView(CCore *Core) { } /*****************************************************************************/ void CLayerPlatform::LoadDefThing(const char *Name,sLayerThing &ThisDef) { } /*****************************************************************************/ void CLayerPlatform::LoadOldThing(CFile *File,sLayerThing &ThisThing) { sLayerThingDataOLD OldThing; File->Read(&OldThing,sizeof(sLayerThingDataOLD)); ThisThing.Data.Platform.PlatformSpeed=OldThing.Speed; ThisThing.Data.Platform.PlatformTurnRate=OldThing.TurnRate; ThisThing.Data.Platform.PlatformType=OldThing.PlatformType; ThisThing.Data.Platform.PlatformMoveType=OldThing.MoveType; ThisThing.Data.Platform.PlatformCollisionFlag=OldThing.CollisionFlag; ThisThing.Data.Platform.PlatformTriCount=OldThing.TriCount; // Not needed but what the hell!! ThisThing.Data.Platform.PlatformTriStart=OldThing.TriStart; // Not needed but what the hell!! } /*****************************************************************************/ /*** Gui *********************************************************************/ /*****************************************************************************/ void CLayerPlatform::GUIInit(CCore *Core) { GUIPlatform.DisableCallback(true); Core->GUIAdd(GUIThing,IDD_LAYER_THING); Core->GUIAdd(GUIThingPos,IDD_LAYER_THING_POS); Core->GUIAdd(GUIPlatform,IDD_LAYER_PLATFORM); GUIPlatform.DisableCallback(false); GUIPlatform.m_SpeedSpin.SetRange(0,255); GUIPlatform.m_TurnRateSpin.SetRange(0,255); GUIPlatform.m_Param0Spin.SetRange(0,255); // Init type lists { CComboBox &List=GUIPlatform.m_MoveList; List.AddString("Linear"); List.AddString("Circular"); } { CComboBox &List=GUIPlatform.m_Type; List.AddString("Normal"); List.AddString("Weighted"); List.AddString("Rotating"); } GUIPlatform.m_Param0Txt.ShowWindow(SW_HIDE); GUIPlatform.m_Param0.ShowWindow(SW_HIDE); GUIPlatform.m_Param0Spin.ShowWindow(SW_HIDE); } /*****************************************************************************/ void CLayerPlatform::GUIKill(CCore *Core) { Core->GUIRemove(GUIThing,IDD_LAYER_THING); Core->GUIRemove(GUIThingPos,IDD_LAYER_THING_POS); Core->GUIRemove(GUIPlatform,IDD_LAYER_PLATFORM); } /*****************************************************************************/ void CLayerPlatform::GUIUpdate(CCore *Core) { int i,ListSize; CComboBox &List=GUIThing.m_DefList; // Setup Def Platform List ListSize=DefList.size(); List.ResetContent(); for (i=0; i2) { Thing.XY.resize(2); GUIThingPointUpdate(); } break; } } /*****************************************************************************/ void CLayerPlatform::Export(CCore *Core,CExport &Exp) { CLayerThing::Export(Core,Exp); } /*****************************************************************************/ void CLayerPlatform::ExportThingData(CCore *Core,CExport &Exp,sLayerThing &ThisThing,sLayerThingData &OutThing) { CElem &ThisElem=ThingBank->GetElem(ThisThing.ElemID,0); Exp.ExportElem3d(Core,ThisElem,OutThing.Platform.PlatformTriStart,OutThing.Platform.PlatformTriCount); }