SBSPSS/Utils/MapEdit/Layer.cpp

60 lines
1.9 KiB
C++
Raw Normal View History

2000-09-25 17:43:52 +02:00
/******************/
/*** Layer Core ***/
/******************/
#include "stdafx.h"
2000-12-04 17:47:34 +01:00
#include <Vector3.h>
2000-09-25 17:43:52 +02:00
#include <gl\gl.h>
#include <gl\glu.h>
2000-11-02 16:46:17 +01:00
#include "Core.h"
2000-09-25 17:43:52 +02:00
#include "Layer.h"
2001-01-23 22:53:48 +01:00
#include "LayerDef.h"
2000-09-25 17:43:52 +02:00
#include "Utils.h"
/*****************************************************************************/
2001-01-23 22:53:48 +01:00
sLayerInfoTable CLayer::InfoTable[]=
{
2001-02-14 23:35:47 +01:00
//Type SubType Name delete? Scale 3d Resizable Export TileView?
{LAYER_TYPE_TILE, LAYER_SUBTYPE_SCRATCH, "WorkPad", true, 1.0f, true, false, false, true,},
{LAYER_TYPE_SHADE, LAYER_SUBTYPE_BACK, "Back Shade", true, 4.0f, false, true, true, false,},
{LAYER_TYPE_TILE, LAYER_SUBTYPE_BACK, "Back", true, 4.0f, false, false, true, true,},
{LAYER_TYPE_TILE, LAYER_SUBTYPE_MID, "Mid", true, 2.0f, false, true, true, true,},
{LAYER_TYPE_TILE, LAYER_SUBTYPE_ACTION, "Action", false, 1.0f, true, true, true, true,},
{LAYER_TYPE_COLLISION, LAYER_SUBTYPE_NONE, "Collision", true, 1.0f, false, true, true, true,},
2001-01-23 22:53:48 +01:00
};
int CLayer::InfoTableSize=sizeof(InfoTable)/sizeof(sLayerInfoTable);
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
void CLayer::SetDefaultParams()
{
int Idx=CLayer::GetLayerIdx(GetType(),GetSubType());
ScaleFactor=InfoTable[Idx].ScaleFactor;
ResizeFlag=InfoTable[Idx].ResizeFlag;
Render3dFlag=InfoTable[Idx].Render3dFlag;
VisibleFlag=TRUE;
}
/*****************************************************************************/
int CLayer::GetLayerIdx(int Type,int SubType)
{
for (int i=0; i<InfoTableSize; i++)
{
if (InfoTable[i].Type==Type && InfoTable[i].SubType==SubType)
{
return(i);
}
}
return(-1);
}
2000-09-25 17:43:52 +02:00
/*****************************************************************************/
2000-11-02 16:46:17 +01:00
/*****************************************************************************/