PhysicsFS 2.0.3 imported.
This commit is contained in:
parent
bcc0937726
commit
993311d151
459 changed files with 87785 additions and 0 deletions
|
@ -0,0 +1,38 @@
|
|||
// ByteSwap.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "ByteSwap.h"
|
||||
|
||||
STDMETHODIMP CByteSwap2::Init() { return S_OK; }
|
||||
|
||||
STDMETHODIMP_(UInt32) CByteSwap2::Filter(Byte *data, UInt32 size)
|
||||
{
|
||||
const UInt32 kStep = 2;
|
||||
UInt32 i;
|
||||
for (i = 0; i + kStep <= size; i += kStep)
|
||||
{
|
||||
Byte b = data[i];
|
||||
data[i] = data[i + 1];
|
||||
data[i + 1] = b;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
STDMETHODIMP CByteSwap4::Init() { return S_OK; }
|
||||
|
||||
STDMETHODIMP_(UInt32) CByteSwap4::Filter(Byte *data, UInt32 size)
|
||||
{
|
||||
const UInt32 kStep = 4;
|
||||
UInt32 i;
|
||||
for (i = 0; i + kStep <= size; i += kStep)
|
||||
{
|
||||
Byte b0 = data[i];
|
||||
Byte b1 = data[i + 1];
|
||||
data[i] = data[i + 3];
|
||||
data[i + 1] = data[i + 2];
|
||||
data[i + 2] = b1;
|
||||
data[i + 3] = b0;
|
||||
}
|
||||
return i;
|
||||
}
|
37
lib/physfs-2.0.3/lzma/CPP/7zip/Compress/ByteSwap/ByteSwap.h
Normal file
37
lib/physfs-2.0.3/lzma/CPP/7zip/Compress/ByteSwap/ByteSwap.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
// ByteSwap.h
|
||||
|
||||
#ifndef __BYTESWAP_H
|
||||
#define __BYTESWAP_H
|
||||
|
||||
#include "../../ICoder.h"
|
||||
#include "Common/MyCom.h"
|
||||
|
||||
// {23170F69-40C1-278B-0203-020000000000}
|
||||
DEFINE_GUID(CLSID_CCompressConvertByteSwap2,
|
||||
0x23170F69, 0x40C1, 0x278B, 0x02, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
|
||||
// {23170F69-40C1-278B-0203-040000000000}
|
||||
DEFINE_GUID(CLSID_CCompressConvertByteSwap4,
|
||||
0x23170F69, 0x40C1, 0x278B, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
|
||||
class CByteSwap2:
|
||||
public ICompressFilter,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
public:
|
||||
MY_UNKNOWN_IMP
|
||||
STDMETHOD(Init)();
|
||||
STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
|
||||
};
|
||||
|
||||
class CByteSwap4:
|
||||
public ICompressFilter,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
public:
|
||||
MY_UNKNOWN_IMP
|
||||
STDMETHOD(Init)();
|
||||
STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,17 @@
|
|||
// ByteSwapRegister.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../../Common/RegisterCodec.h"
|
||||
|
||||
#include "ByteSwap.h"
|
||||
static void *CreateCodec2() { return (void *)(ICompressFilter *)(new CByteSwap2); }
|
||||
static void *CreateCodec4() { return (void *)(ICompressFilter *)(new CByteSwap4); }
|
||||
|
||||
static CCodecInfo g_CodecsInfo[] =
|
||||
{
|
||||
{ CreateCodec2, CreateCodec4, 0x020302, L"Swap2", 1, true },
|
||||
{ CreateCodec4, CreateCodec4, 0x020304, L"Swap4", 1, true }
|
||||
};
|
||||
|
||||
REGISTER_CODECS(ByteSwap)
|
|
@ -0,0 +1,3 @@
|
|||
// StdAfx.cpp
|
||||
|
||||
#include "StdAfx.h"
|
|
@ -0,0 +1,8 @@
|
|||
// StdAfx.h
|
||||
|
||||
#ifndef __STDAFX_H
|
||||
#define __STDAFX_H
|
||||
|
||||
#include "../../../Common/MyWindows.h"
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue