SBSPSS/Utils/MapEdit/TileSet.cpp

629 lines
15 KiB
C++
Raw Normal View History

2000-10-27 02:06:19 +02:00
/*********************/
/*** TileSet Stuph ***/
/*********************/
#include "stdafx.h"
2000-12-04 17:47:34 +01:00
#include <Vector3.h>
2000-10-27 02:06:19 +02:00
#include <gl\gl.h>
#include <gl\glu.h>
2000-11-14 16:03:04 +01:00
#include "GLEnabledView.h"
2000-10-27 02:06:19 +02:00
#include <Vector>
2001-02-01 23:48:22 +01:00
2000-12-04 17:47:34 +01:00
#include <GFName.hpp>
2000-10-27 02:06:19 +02:00
2000-11-06 21:24:11 +01:00
#include "Core.h"
2000-10-27 02:06:19 +02:00
#include "TileSet.h"
#include "GinTex.h"
#include "utils.h"
2000-11-14 16:03:04 +01:00
#include "MapEdit.h"
#include "MapEditDoc.h"
#include "MapEditView.h"
#include "MainFrm.h"
2000-11-28 15:34:42 +01:00
#include "LayerTileGui.h"
2000-11-14 16:03:04 +01:00
2000-10-27 02:06:19 +02:00
/*****************************************************************************/
2000-11-06 21:24:11 +01:00
/*** TileBank ****************************************************************/
2000-10-27 02:06:19 +02:00
/*****************************************************************************/
2000-11-14 16:03:04 +01:00
const float TileBrowserGap=0.2f;
const float TileBrowserX0=0-TileBrowserGap/2;
const float TileBrowserX1=1+TileBrowserGap/2;
const float TileBrowserY0=0-TileBrowserGap/2;
const float TileBrowserY1=1+TileBrowserGap/2;
2000-11-06 21:24:11 +01:00
/*****************************************************************************/
CTileBank::CTileBank()
{
2001-03-05 21:49:46 +01:00
LoadFlag=false;
2001-01-23 22:53:48 +01:00
CurrentSet=0; LastSet=0;
2000-11-17 22:36:13 +01:00
for (int i=0; i<MaxBrush; i++) Brush[i].Delete();
LastCursorPos=CursorPos=-1;
ActiveBrush=0;
SelStart=-1;
2000-11-28 22:16:00 +01:00
SelEnd=-1;
2001-03-01 18:28:20 +01:00
VisibleFlag=true;
2000-11-06 21:24:11 +01:00
}
/*****************************************************************************/
CTileBank::~CTileBank()
{
}
2000-11-20 21:33:42 +01:00
/*****************************************************************************/
2001-03-05 21:49:46 +01:00
void CTileBank::Load(CFile *File,int Version)
2001-01-23 22:53:48 +01:00
{
2001-03-05 21:49:46 +01:00
if (Version<FileVersion)
2001-01-23 22:53:48 +01:00
{
2001-03-05 21:49:46 +01:00
int ListSize;
GFName RootPath=File->GetFilePath();
GString FilePath;
char FixPath[1024];
FilePath=RootPath.Drive();
FilePath+=RootPath.Dir();
FilePath.Append('\\');
FilePath.Upper();
File->Read(&ListSize,sizeof(int));
File->Read(&CurrentSet,sizeof(int));
File->Read(&ActiveBrush,sizeof(int));
Brush[0].Load(File,Version);
Brush[1].Load(File,Version);
if (Version<2)
{
CurrentSet++;
}
2001-01-23 22:53:48 +01:00
2001-03-05 21:49:46 +01:00
// New Style rel storage
for (int i=0;i<ListSize;i++)
{
char c=1;
GString FullName;
2000-12-11 22:29:59 +01:00
2001-03-05 21:49:46 +01:00
while (c)
{
File->Read(&c,1);
FullName.Append(c);
}
FullName.Upper();
GFName::makeabsolute(FilePath,FullName,FixPath);
FullName=FixPath;
_fullpath( FixPath, FullName, 1024);
for (int z=0; z<strlen(FixPath); z++)
{// Invalidate any long name short cackness
if (FixPath[z]=='~') FixPath[z]='_';
}
FullName=FixPath;
CheckFilename(FullName);
FullName.Upper();
AddSet(FullName);
}
}
else
{
File->Read(&LayerCam,sizeof(Vector3));
2000-12-11 22:29:59 +01:00
File->Read(&CurrentSet,sizeof(int));
File->Read(&ActiveBrush,sizeof(int));
Brush[0].Load(File,Version);
Brush[1].Load(File,Version);
2001-01-24 23:35:11 +01:00
2001-03-05 21:49:46 +01:00
CElemBank::Load(File,Version);
}
2001-02-07 19:46:59 +01:00
2001-02-10 16:23:30 +01:00
2000-11-20 21:33:42 +01:00
}
/*****************************************************************************/
void CTileBank::Save(CFile *File)
{
2001-03-05 21:49:46 +01:00
int ListSize=GetSetCount();
2000-12-04 17:47:34 +01:00
GFName RootPath=File->GetFilePath();
2001-02-07 19:46:59 +01:00
GString SavePath;
2000-12-11 22:29:59 +01:00
2001-02-07 19:46:59 +01:00
SavePath=RootPath.Drive();
SavePath+=RootPath.Dir();
SavePath.Append('\\');
SavePath.Upper();
2000-11-20 21:33:42 +01:00
2001-03-05 21:49:46 +01:00
File->Write(&LayerCam,sizeof(Vector3));
2000-11-28 15:34:42 +01:00
File->Write(&CurrentSet,sizeof(int));
File->Write(&ActiveBrush,sizeof(int));
Brush[0].Save(File);
Brush[1].Save(File);
2000-11-20 21:33:42 +01:00
2001-03-05 21:49:46 +01:00
CElemBank::Save(File);
2000-11-06 21:24:11 +01:00
}
2000-11-29 18:07:57 +01:00
/*****************************************************************************/
2001-03-01 18:28:20 +01:00
void CTileBank::DeleteCurrent()
2000-11-29 18:07:57 +01:00
{
2001-03-05 21:49:46 +01:00
int ListSize=GetSetCount();
2000-12-11 22:29:59 +01:00
// Remap Brushes
for (int i=0; i<MaxBrush; i++)
{
2001-03-05 21:49:46 +01:00
Brush[i].RemoveSet(CurrentSet);
2000-12-11 22:29:59 +01:00
}
for (int Set=CurrentSet; Set<ListSize; Set++)
{
for (int i=0; i<MaxBrush; i++)
{
2001-01-23 22:53:48 +01:00
Brush[i].RemapSet(Set,Set);
2000-12-11 22:29:59 +01:00
}
}
2001-03-05 21:49:46 +01:00
SetList.erase(CurrentSet);
if (CurrentSet) CurrentSet--;
2000-11-29 18:07:57 +01:00
}
2000-11-14 16:03:04 +01:00
/*****************************************************************************/
2001-03-05 21:49:46 +01:00
CPoint CTileBank::GetTilePos(int ID,int Width)
2000-11-14 16:03:04 +01:00
{
2001-03-05 21:49:46 +01:00
if (ID==0)
return(CPoint(-1,-1));
else
return(IDToPoint(ID-1,Width));
2000-11-14 16:03:04 +01:00
}
2000-11-06 21:24:11 +01:00
/*****************************************************************************/
2001-03-05 21:49:46 +01:00
void CTileBank::Render(CCore *Core,Vector3 &CamPos,bool Is3d)
2000-11-06 21:24:11 +01:00
{
2001-03-05 21:49:46 +01:00
if (!GetSetCount()) return;
CElemSet &ThisSet=SetList[CurrentSet];
int ListSize=ThisSet.GetCount();
int BrowserWidth=ThisSet.GetBrowserWidth();
int TileID=0;
sMapElem ThisElem;
int SelFlag;
float Scale=CamPos.z/(float)BrowserWidth/2.0;
ThisElem.Flags=0;
ThisElem.Set=CurrentSet;
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
while(TileID!=ListSize)
{
CPoint Pos=GetTilePos(TileID,BrowserWidth);
float XPos=(float)Pos.x*(1+TileBrowserGap);
float YPos=(float)Pos.y*(1+TileBrowserGap);
glLoadIdentity();
glScalef(Scale,Scale,Scale);
glTranslatef(-CamPos.x+XPos,CamPos.y-YPos,0);
glColor3f(1,1,1);
ThisSet.RenderElem(TileID,0,Is3d);
// Selection
ThisElem.Tile=TileID;
SelFlag=0;
if (Brush[0].DoesContainTile(ThisElem)) SelFlag|=1;
if (Brush[1].DoesContainTile(ThisElem)) SelFlag|=2;
if (SelFlag)
{
glBegin(GL_QUADS);
switch(SelFlag)
{
case 1: // L
glColor4f(1,0,0,0.5);
BuildGLQuad(TileBrowserX0,TileBrowserX1,TileBrowserY0,TileBrowserY1,0.01f);
break;
case 2: // R
glColor4f(0,0,1,0.5);
BuildGLQuad(TileBrowserX0,TileBrowserX1,TileBrowserY0,TileBrowserY1,0.01f);
break;
case 3: // LR
glColor4f(1,0,0,0.5);
BuildGLQuad(TileBrowserX0,0.5,TileBrowserY0,TileBrowserY1,0.01f);
glColor4f(0,0,1,0.5);
BuildGLQuad(0.5,TileBrowserX1,TileBrowserY0,TileBrowserY1,0.01f);
break;
}
glEnd();
}
TileID++;
}
glPopMatrix();
2000-11-06 21:24:11 +01:00
}
2000-11-14 16:03:04 +01:00
/*****************************************************************************/
2001-03-05 21:49:46 +01:00
void CTileBank::RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d)
2000-11-14 16:03:04 +01:00
{
2001-03-05 21:49:46 +01:00
if (!GetSetCount()) return;
CElemSet &ThisSet=SetList[CurrentSet];
int ListSize=ThisSet.GetCount();
int BrowserWidth=ThisSet.GetBrowserWidth();
CPoint Start,End;
int MaxTile=ListSize;
float Scale=CamPos.z/(float)BrowserWidth/2.0;
if (CursorPos<-1 || CursorPos>ListSize) return;
if (!ListSize) return;
2000-11-14 16:03:04 +01:00
2001-03-05 21:49:46 +01:00
if (SelStart==-1)
2000-11-14 16:03:04 +01:00
{
2001-03-05 21:49:46 +01:00
Start=GetTilePos(CursorPos,BrowserWidth);
End=Start;
2000-11-14 16:03:04 +01:00
}
2001-03-05 21:49:46 +01:00
else
2000-11-14 16:03:04 +01:00
{
2001-03-05 21:49:46 +01:00
CPoint S=IDToPoint(SelStart-1,BrowserWidth);
CPoint E=IDToPoint(SelEnd-1,BrowserWidth);
Start=CPoint( min(S.x,E.x), min(S.y,E.y));
End=CPoint( max(S.x,E.x), max(S.y,E.y));
if (PointToID(End,BrowserWidth)>=MaxTile) return; // Invalid selection
2000-11-14 16:03:04 +01:00
}
2000-11-17 22:36:13 +01:00
2001-03-05 21:49:46 +01:00
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
for (int Y=Start.y; Y<=End.y; Y++)
{
for (int X=Start.x; X<=End.x; X++)
{
float XPos=(float)X*(1+TileBrowserGap);
float YPos=(float)Y*(1+TileBrowserGap);
glLoadIdentity();
glScalef(Scale,Scale,Scale);
glTranslatef(-CamPos.x+XPos,CamPos.y-YPos,0);
glBegin(GL_QUADS);
glColor4f(1,1,0,0.5);
BuildGLQuad(TileBrowserX0,TileBrowserX1,TileBrowserY0,TileBrowserY1,0);
glEnd();
}
}
glPopMatrix();
2001-03-01 18:28:20 +01:00
}
/*****************************************************************************/
void CTileBank::RenderGrid(CCore *Core,Vector3 &CamPos,bool Active)
{
2001-03-05 21:49:46 +01:00
if (!GetSetCount()) return;
CElemSet &ThisSet=SetList[CurrentSet];
int ListSize=ThisSet.GetCount();
int BrowserWidth=ThisSet.GetBrowserWidth();
int TileID=1; // Dont bother with blank, its sorted
float Scale=CamPos.z/(float)BrowserWidth/2.0;
if (!ListSize) return;
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
while(TileID!=ListSize)
{
CPoint Pos=GetTilePos(TileID,BrowserWidth);
float XPos=(float)Pos.x*(1+TileBrowserGap);
float YPos=(float)Pos.y*(1+TileBrowserGap);
glLoadIdentity();
glScalef(Scale,Scale,Scale);
glTranslatef(-CamPos.x+XPos,CamPos.y-YPos,0);
glBegin(GL_LINES);
glColor3f(1,1,1);
glVertex3f( TileBrowserX0,TileBrowserY0,0);
glVertex3f( TileBrowserX1,TileBrowserY0,0);
glVertex3f( TileBrowserX0,TileBrowserY1,0);
glVertex3f( TileBrowserX1,TileBrowserY1,0);
glVertex3f( TileBrowserX0,TileBrowserY0,0);
glVertex3f( TileBrowserX0,TileBrowserY1,0);
glVertex3f( TileBrowserX1,TileBrowserY0,0);
glVertex3f( TileBrowserX1,TileBrowserY1,0);
glEnd();
TileID++;
}
glPopMatrix();
2000-11-14 16:03:04 +01:00
}
/*****************************************************************************/
2001-02-14 23:35:47 +01:00
void CTileBank::FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)
2000-11-14 16:03:04 +01:00
{
2001-03-05 21:49:46 +01:00
if (!GetSetCount()) return;
CElemSet &ThisSet=SetList[CurrentSet];
int ListSize=ThisSet.GetCount();
int BrowserWidth=ThisSet.GetBrowserWidth();
GLint Viewport[4];
GLuint SelectBuffer[SELECT_BUFFER_SIZE];
int HitCount;
int TileID=0;
float Scale=CamPos.z/(float)BrowserWidth/2.0;
2000-11-14 16:03:04 +01:00
2001-03-05 21:49:46 +01:00
if (!ListSize) return;
glGetIntegerv(GL_VIEWPORT, Viewport);
glSelectBuffer (SELECT_BUFFER_SIZE, SelectBuffer );
glRenderMode (GL_SELECT);
glInitNames();
glPushName(-1);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
Core->GetView()->SetupPersMatrix();
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
while(TileID!=ListSize)
{
CPoint Pos=GetTilePos(TileID,BrowserWidth);
float XPos=(float)Pos.x*(1+TileBrowserGap);
float YPos=(float)Pos.y*(1+TileBrowserGap);
glLoadIdentity();
glScalef(Scale,Scale,Scale);
glTranslatef(-CamPos.x+XPos,CamPos.y-YPos,0);
glLoadName (TileID);
glBegin (GL_QUADS);
BuildGLQuad(TileBrowserX0,TileBrowserX1,TileBrowserY0,TileBrowserY1,0);
glEnd();
TileID++;
}
HitCount= glRenderMode (GL_RENDER);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
// Process hits
GLuint *HitPtr=SelectBuffer;
TileID=-2;
if (HitCount) // Just take 1st
{
TileID=HitPtr[3];
}
glMatrixMode(GL_MODELVIEW); // <-- Prevent arse GL assert
CursorPos=TileID;
2000-11-17 22:36:13 +01:00
SelEnd=CursorPos;
2000-11-14 16:03:04 +01:00
}
2001-03-01 18:28:20 +01:00
/*****************************************************************************/
bool CTileBank::LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag)
{
if (nFlags & MK_RBUTTON)
{
SelectCancel();
return(false);
}
Select(LBrush,DownFlag);
return(true);
}
/*****************************************************************************/
bool CTileBank::RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag)
{
if (nFlags & MK_LBUTTON)
{
SelectCancel();
return(false);
}
Select(RBrush,DownFlag);
return(false);
}
/*****************************************************************************/
bool CTileBank::MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos)
{
return(false);
}
/*****************************************************************************/
bool CTileBank::Command(int CmdMsg,CCore *Core,int Param0,int Param1)
{
switch(CmdMsg)
{
case CmdMsg_SubViewLoad:
2001-03-05 21:49:46 +01:00
LoadNewSet(Core);
2001-03-06 19:39:42 +01:00
GUIUpdate(Core);
2001-03-01 18:28:20 +01:00
break;
case CmdMsg_SubViewDelete:
DeleteSet(Core);
2001-03-06 19:39:42 +01:00
GUIUpdate(Core);
2001-03-01 18:28:20 +01:00
break;
case CmdMsg_SubViewUpdate:
2001-03-05 21:49:46 +01:00
ReloadAllSets();
2001-03-01 18:28:20 +01:00
Core->GetTexCache().Purge();
2001-03-06 19:39:42 +01:00
GUIUpdate(Core);
2001-03-01 18:28:20 +01:00
break;
case CmdMsg_SubViewSet:
2001-03-05 21:49:46 +01:00
CurrentSet=TileBankGUI.m_List.GetCurSel();
2001-03-06 19:39:42 +01:00
GUIUpdate(Core);
2001-03-01 18:28:20 +01:00
break;
case CmdMsg_ActiveBrushLeft:
ActiveBrush=LBrush;
break;
case CmdMsg_ActiveBrushRight:
ActiveBrush=RBrush;
default:
TRACE3("TileBank-Unhandled Command %i (%i,%i)\n",CmdMsg,Param0,Param1);
}
return(true);
}
2000-11-14 16:03:04 +01:00
/*****************************************************************************/
2000-11-15 22:22:40 +01:00
/*** Gui *********************************************************************/
2000-11-14 16:03:04 +01:00
/*****************************************************************************/
2001-02-09 22:17:01 +01:00
void CTileBank::GUIInit(CCore *Core)
2000-11-14 16:03:04 +01:00
{
2001-02-14 23:35:47 +01:00
Core->GUIAdd(TileBankGUI,IDD_LAYERTILE_GUI);
}
/*****************************************************************************/
void CTileBank::GUIKill(CCore *Core)
{
Core->GUIRemove(TileBankGUI,IDD_LAYERTILE_GUI);
2001-02-09 22:17:01 +01:00
}
2000-11-14 16:03:04 +01:00
2001-02-09 22:17:01 +01:00
/*****************************************************************************/
void CTileBank::GUIUpdate(CCore *Core)
{
2001-03-05 21:49:46 +01:00
int ListSize=GetSetCount();
2001-03-06 19:39:42 +01:00
bool IsSubView=Core->IsSubView();
2001-02-09 22:17:01 +01:00
if (TileBankGUI.m_List)
2000-11-28 15:34:42 +01:00
{
2001-02-09 22:17:01 +01:00
TileBankGUI.m_List.ResetContent();
2001-03-05 21:49:46 +01:00
if (ListSize)
2000-11-28 15:34:42 +01:00
{
2001-03-05 21:49:46 +01:00
for (int i=0; i<ListSize; i++)
2001-02-09 22:17:01 +01:00
{
2001-03-05 21:49:46 +01:00
TileBankGUI.m_List.AddString(GetSetName(i));
2001-02-09 22:17:01 +01:00
}
2001-03-05 21:49:46 +01:00
TileBankGUI.m_List.SetCurSel(CurrentSet);
2000-11-28 15:34:42 +01:00
}
2001-02-09 22:17:01 +01:00
else
{
2001-03-01 18:28:20 +01:00
IsSubView=FALSE;
2001-02-09 22:17:01 +01:00
}
2001-03-01 18:28:20 +01:00
TileBankGUI.m_List.EnableWindow(IsSubView);
2000-11-28 15:34:42 +01:00
}
2001-03-05 21:49:46 +01:00
2000-11-14 16:03:04 +01:00
}
2001-03-01 18:28:20 +01:00
/*****************************************************************************/
void CTileBank::GUIChanged(CCore *Core)
{
}
2000-11-14 16:03:04 +01:00
/*****************************************************************************/
2000-11-15 22:22:40 +01:00
/*** Functions ***************************************************************/
2000-11-14 16:03:04 +01:00
/*****************************************************************************/
2001-03-01 18:28:20 +01:00
bool CTileBank::Select(int BrushID,bool DownFlag)
2000-11-17 22:36:13 +01:00
{
if (DownFlag && SelStart==-1)
{
2000-11-28 22:16:00 +01:00
if (CursorPos<0) return(FALSE);
2000-11-17 22:36:13 +01:00
SelStart=CursorPos;
2001-03-05 21:49:46 +01:00
TRACE1("SEL Start %i\n",CursorPos);
2000-11-28 22:16:00 +01:00
if (CursorPos==0)
{
SetBrush(GetBrush(BrushID));
SelStart=-1;
TRACE0("Selected Blank\n");
}
2000-11-17 22:36:13 +01:00
}
else
if (!DownFlag && SelStart!=-1)
{
if (CursorPos==-1) return(SelectCancel());
SetBrush(GetBrush(BrushID));
SelStart=-1;
2001-03-05 21:49:46 +01:00
TRACE1("END SEL %i\n",CursorPos);
2000-11-17 22:36:13 +01:00
}
return(TRUE);
}
/*****************************************************************************/
void CTileBank::SetBrush(CMap &ThisBrush)
2000-11-14 16:03:04 +01:00
{
2001-03-05 21:49:46 +01:00
int BW=SetList[CurrentSet].GetBrowserWidth();
2000-11-28 22:16:00 +01:00
CPoint S=IDToPoint(SelStart-1,BW);
CPoint E=IDToPoint(SelEnd-1,BW);
int Width=abs(E.x-S.x)+1;
int Height=abs(E.y-S.y)+1;
2000-11-17 22:36:13 +01:00
sMapElem ThisElem;
2001-03-05 21:49:46 +01:00
int MaxTile=SetList[CurrentSet].GetCount();
2000-11-17 22:36:13 +01:00
2000-11-28 22:16:00 +01:00
// if (PointToID(End,BW)>=MaxTile) SelectCancel(); // Invalid selection
2000-11-17 22:36:13 +01:00
ThisElem.Set=CurrentSet;
ThisElem.Flags=0;
ThisBrush.Delete();
ThisBrush.SetSize(Width,Height);
for (int Y=0; Y<Height; Y++)
{
for (int X=0; X<Width; X++)
{
2000-11-28 22:16:00 +01:00
ThisElem.Tile=SelStart+X+(Y*BW);
2001-03-05 21:49:46 +01:00
if (!IsValid(CurrentSet,ThisElem.Tile))
2000-11-29 18:07:57 +01:00
{
2001-03-05 21:49:46 +01:00
TRACE2("Not valid %i %i\n",CurrentSet,ThisElem.Tile);
2000-11-29 18:07:57 +01:00
ThisElem.Tile=-1;
}
2001-03-05 21:49:46 +01:00
ThisBrush.Set(X,Y,ThisElem,true);
2000-11-17 22:36:13 +01:00
}
2000-11-15 22:22:40 +01:00
}
2000-11-17 22:36:13 +01:00
}
2000-11-14 16:03:04 +01:00
2000-11-17 22:36:13 +01:00
/*****************************************************************************/
2001-03-01 18:28:20 +01:00
bool CTileBank::SelectCancel()
2000-11-17 22:36:13 +01:00
{
SelStart=-1;
TRACE0("Select Cancelled\n");
2000-11-15 22:22:40 +01:00
return(TRUE);
2000-11-14 16:03:04 +01:00
}
2001-03-01 18:28:20 +01:00
/*****************************************************************************/
void CTileBank::DeleteSet(CCore *Core)
{
if (Core->Question("Delete Current Tile Bank\n\nAll used tiles in current set will be set to blank\nAre you sure?"))
{
int SetCount=GetSetCount();
int i,ListSize=Core->GetLayerCount();
for (i=0;i<ListSize;i++)
{
CLayerTile *ThisLayer=(CLayerTile*)Core->GetLayer(i);
if (ThisLayer->GetType()==LAYER_TYPE_TILE)
{
2001-03-05 21:49:46 +01:00
ThisLayer->RemoveSet(CurrentSet);
2001-03-01 18:28:20 +01:00
}
}
DeleteCurrent();
for (int Set=CurrentSet+1; Set<SetCount; Set++)
{
for (i=0;i<ListSize;i++)
{
CLayerTile *ThisLayer=(CLayerTile*)Core->GetLayer(i);
if (ThisLayer->GetType()==LAYER_TYPE_TILE)
{
ThisLayer->RemapSet(Set,Set-1);
}
}
}
}
CurrentSet--;
GUIUpdate(Core);
}