Reformat all the things. Have fun with merge conflicts.

This commit is contained in:
Pierre Bourdon
2016-06-24 10:43:46 +02:00
parent 2115e8a4a6
commit 3570c7f03a
1116 changed files with 187405 additions and 180344 deletions

View File

@ -8,50 +8,53 @@
namespace DX11
{
D3DBlob::D3DBlob(unsigned int blob_size, const u8* init_data) : ref(1), size(blob_size), blob(nullptr)
D3DBlob::D3DBlob(unsigned int blob_size, const u8* init_data)
: ref(1), size(blob_size), blob(nullptr)
{
data = new u8[blob_size];
if (init_data) memcpy(data, init_data, size);
data = new u8[blob_size];
if (init_data)
memcpy(data, init_data, size);
}
D3DBlob::D3DBlob(ID3D10Blob* d3dblob) : ref(1)
{
blob = d3dblob;
data = (u8*)blob->GetBufferPointer();
size = (unsigned int)blob->GetBufferSize();
d3dblob->AddRef();
blob = d3dblob;
data = (u8*)blob->GetBufferPointer();
size = (unsigned int)blob->GetBufferSize();
d3dblob->AddRef();
}
D3DBlob::~D3DBlob()
{
if (blob) blob->Release();
else delete[] data;
if (blob)
blob->Release();
else
delete[] data;
}
void D3DBlob::AddRef()
{
++ref;
++ref;
}
unsigned int D3DBlob::Release()
{
if (--ref == 0)
{
delete this;
return 0;
}
return ref;
if (--ref == 0)
{
delete this;
return 0;
}
return ref;
}
unsigned int D3DBlob::Size() const
{
return size;
return size;
}
u8* D3DBlob::Data()
{
return data;
return data;
}
} // namespace DX11