SBSPSS/Utils/Libs/TexGrab/TexGrab.cpp

151 lines
3.5 KiB
C++
Raw Normal View History

2000-12-02 19:55:49 +01:00
/*=========================================================================
TexGrab.CPP
Author: Dave @ Fareham (based on work by Gary Liddon)
Created: 011200
Project: SpongeBob
Purpose: Main file for the new TexGrab lib, based on ParkGrab
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "TexGrab.h"
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Data
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
CTexGrab::CTexGrab()
{
m_PagePlacements=false;
m_compressTpages=false;
m_noWriteTpages=false;
m_useHalfTpage=false;
m_AnimatedHeadersOnly=false;
m_DontOutputBoxes=false;
m_AlignHeaders=false;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
CTexGrab::~CTexGrab()
{
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CTexGrab::Process()
{
2000-12-14 17:38:34 +01:00
MySprSet.setDebug(DebugFlag);
2000-12-02 19:55:49 +01:00
MySprSet.setHalfTpage(m_useHalfTpage);
MySprSet.setAnimatedHeader(m_AnimatedHeadersOnly);
MySprSet.setDontOutputBoxes(m_DontOutputBoxes);
MySprSet.setAlignHeaders(m_AlignHeaders);
MySprSet.setCompressTpages(m_compressTpages);
MySprSet.setNoWriteTpages(m_noWriteTpages);
MyFiles.SortOrder();
if (MyFiles.GetMaxSize())
MySprSet.SetMaxSize(MyFiles.GetMaxSize());
MySprSet.AddFiles(MyFiles.GetFileInfoVector());
if (m_IncOutFile)
MySprSet.SetIncOutFile(m_IncOutFile);
if (m_SprFile)
MySprSet.WriteSprFile(m_SprFile);
if (m_OutFile)
{
if (m_PagePlacements)
{
MySprSet.Write(m_OutFile,m_PageBase,m_WidthPages,m_HeightPages);
2000-12-06 20:29:40 +01:00
MySprSet.CreateTexInfo(TexInfo);
2000-12-02 19:55:49 +01:00
if (m_OutLbm)
MySprSet.WriteLBM(m_OutLbm);
if (m_ReportFile)
MySprSet.WriteReport(m_ReportFile);
if (m_rawTpageFile)
MySprSet.writeRawTPage(m_rawTpageFile);
}
else
GObject::Error(ERR_FATAL,"-t option hasn't been specified");
}
}
/*----------------------------------------------------------------------
Function: void CTexGrab::AddFile(char *Name)
Purpose: Add bitmaps to file list
Params: Name = Filename
---------------------------------------------------------------------- */
2001-02-02 20:18:13 +01:00
int CTexGrab::AddFile(const char *Name)
2000-12-02 19:55:49 +01:00
{
GString UpperName(Name);
UpperName.Upper();
2001-02-02 20:18:13 +01:00
int Idx=MyFiles.AddFile(UpperName);
return(Idx);
2000-12-02 19:55:49 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
---------------------------------------------------------------------- */
2001-02-02 20:18:13 +01:00
int CTexGrab::AddMemFrame(const char *Name,Frame &Frame)
2000-12-06 20:29:40 +01:00
{
GString UpperName(Name);
UpperName.Upper();
2001-02-02 20:18:13 +01:00
int Idx=MyFiles.AddMemFrame(UpperName,Frame);
return(Idx);
2000-12-06 20:29:40 +01:00
}
2000-12-02 19:55:49 +01:00
2001-03-08 00:20:09 +01:00
vector<FileInfo> const &CTexGrab::GetTexInfoList()
{
return(MyFiles.GetFileInfoVector());
}
2000-12-02 19:55:49 +01:00
/*
2001-03-08 00:20:09 +01:00
2000-12-02 19:55:49 +01:00
/*===========================================================================
end */