Complete disaster-recovery snapshot: engine/game source, game data assets, VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive. Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false, no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
63 lines
1.2 KiB
C++
63 lines
1.2 KiB
C++
// SpanFile.cpp: implementation of the CSpanFile class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#include "stdafx.h"
|
|
#include "PatchIT.h"
|
|
#include "SpanFile.h"
|
|
|
|
#ifdef _DEBUG
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[]=__FILE__;
|
|
#define new DEBUG_NEW
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
// Construction/Destruction
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
CSpanFile::CSpanFile()
|
|
{
|
|
Buffer=NULL;
|
|
FileSpan=NULL;
|
|
}
|
|
|
|
void CSpanFile::Load(CString fname)
|
|
{
|
|
File.Open(fname,CFile::modeRead);
|
|
if(Buffer) delete Buffer;
|
|
if(FileSpan) delete FileSpan;
|
|
Size=File.GetLength();
|
|
Buffer=new BYTE[Size];
|
|
File.Read(Buffer,Size);
|
|
FileSpan=new Span(Buffer,Size);
|
|
File.Close();
|
|
}
|
|
|
|
CString CSpanFile::SpanReport(CSpanFile &file)
|
|
{
|
|
CString str;
|
|
str="";
|
|
FileSpan->SpanInfo(str,Buffer,file.Buffer);
|
|
|
|
return str;
|
|
}
|
|
|
|
void CSpanFile::MapFiles(CSpanFile &file,DWORD MinSize)
|
|
{
|
|
FileSpan->MapLargestSpan(file.FileSpan,1);
|
|
|
|
int blocksize=MinSize;
|
|
}
|
|
|
|
void CSpanFile::BuildOps(CSpanFile &file,CPatchOperation *oplist)
|
|
{
|
|
FileSpan->BuildOps(file.FileSpan,oplist,Buffer,file.Buffer);
|
|
|
|
}
|
|
|
|
CSpanFile::~CSpanFile()
|
|
{
|
|
|
|
}
|