102 lines
2.3 KiB
C++
102 lines
2.3 KiB
C++
/***********************/
|
|
/*** Map Editor Core ***/
|
|
/***********************/
|
|
|
|
|
|
#include "stdafx.h"
|
|
#include "Core.h"
|
|
|
|
/*****************************************************************************/
|
|
/*****************************************************************************/
|
|
/*****************************************************************************/
|
|
CCore::CCore()
|
|
{
|
|
|
|
}
|
|
/*****************************************************************************/
|
|
CCore::~CCore()
|
|
{
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
/*** Layer Code **************************************************************/
|
|
/*****************************************************************************/
|
|
void CCore::LayerAdd(char *Name)
|
|
{
|
|
sLayer NewLayer;
|
|
|
|
if (!Name)
|
|
{
|
|
char DynName[32];
|
|
sprintf(DynName,"Layer%2d",Layers.size()+1);
|
|
Name=DynName;
|
|
}
|
|
|
|
strcpy(NewLayer.Name,Name);
|
|
TRACE1("New Layer [%s]\n",Name);
|
|
Layers.push_back(NewLayer);
|
|
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
void CCore::LayerSetActive(int i)
|
|
{
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
int CCore::LayerGetActive()
|
|
{
|
|
return(ActiveLayer);
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
int CCore::LayerGetCount()
|
|
{
|
|
return(Layers.size());
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
sLayer const &CCore::LayerGet(int i)
|
|
{
|
|
return(Layers[i]);
|
|
}
|
|
|
|
|
|
/*****************************************************************************/
|
|
void CCore::LayerDelete(int Layer)
|
|
{
|
|
Layers.erase(Layers.begin() + Layer);
|
|
TRACE0("Delete Layer\n");
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
void CCore::LayerMoveUp(int Layer)
|
|
{
|
|
sLayer Tmp;
|
|
|
|
Tmp=Layers[Layer];
|
|
Layers[Layer]=Layers[Layer-1];
|
|
Layers[Layer-1]=Tmp;
|
|
|
|
TRACE0("Layer Up \n");
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
void CCore::LayerMoveDown(int Layer)
|
|
{
|
|
sLayer Tmp;
|
|
|
|
Tmp=Layers[Layer];
|
|
Layers[Layer]=Layers[Layer+1];
|
|
Layers[Layer+1]=Tmp;
|
|
|
|
TRACE0("Layer Down\n");
|
|
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
/*****************************************************************************/
|
|
/*****************************************************************************/
|
|
|
|
|