2000-11-24 23:34:20 +01:00
|
|
|
/**************/
|
|
|
|
/*** Export ***/
|
|
|
|
/**************/
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include <Vector>
|
|
|
|
|
|
|
|
#include "Core.h"
|
|
|
|
#include "TileSet.h"
|
|
|
|
#include "Map.h"
|
|
|
|
|
|
|
|
#include "Export.h"
|
|
|
|
#include "utils.h"
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
2000-12-11 22:29:59 +01:00
|
|
|
CExport::CExport(char *_Filename)
|
2000-11-24 23:34:20 +01:00
|
|
|
{
|
2000-12-11 22:29:59 +01:00
|
|
|
Filename=_Filename;
|
2000-11-24 23:34:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
CExport::~CExport()
|
|
|
|
{
|
|
|
|
fclose(File);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2001-01-24 23:35:11 +01:00
|
|
|
void CExport::BuildColTable(CTile &ThisTile)
|
|
|
|
{
|
|
|
|
u8 *RGB=ThisTile.GetGBTexRGB();
|
|
|
|
int Width=ThisTile.GetGBTexW();
|
|
|
|
int Height=ThisTile.GetGBTexH();
|
|
|
|
|
|
|
|
int X,Y;
|
|
|
|
ColTable.resize(Width);
|
|
|
|
|
|
|
|
for (X=0; X<Width; X++)
|
|
|
|
{
|
|
|
|
for (Y=Height; Y ; Y--)
|
|
|
|
{
|
|
|
|
int Ofs=X+((Y-1)*Width);
|
|
|
|
u8 R=RGB[(Ofs*3)+0];
|
|
|
|
u8 G=RGB[(Ofs*3)+1];
|
|
|
|
u8 B=RGB[(Ofs*3)+2];
|
|
|
|
if (R==255 && G==255 && B==255) break;
|
|
|
|
}
|
|
|
|
ColTable[X]=Y-1;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|