Initial megacommit.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-07-12 17:40:22 +00:00
parent a3be5d89ae
commit 775dc8a9c0
1920 changed files with 734652 additions and 0 deletions

View file

@ -0,0 +1,75 @@
#include "stdafx.h"
#include "DecodedVArray.h"
#include "main.h"
DecodedVArray::DecodedVArray()
{
Zero();
}
DecodedVArray::~DecodedVArray()
{
Destroy();
}
void DecodedVArray::Zero()
{
size = 0;
count = 0;
components = 0;
positions = 0;
posMtxInds = 0;
for (int i=0; i<3; i++)
normals[i] = 0;
for (int i=0; i<8; i++)
{
texMtxInds[i] = 0;
uvs[i] = 0;
}
for (int i=0; i<2; i++)
colors[i] = 0;
}
void DecodedVArray::Destroy()
{
//,,
delete [] positions;
delete [] posMtxInds;
for (int i=0; i<3; i++)
delete [] normals[i];
for (int i=0; i<2; i++)
delete [] colors[i];
for (int i=0; i<8; i++)
{
delete [] uvs[i];
delete [] texMtxInds[i];
}
Zero();
}
void DecodedVArray::Create(int _size, int pmcount, int tmcount, int nrmcount, int colcount, int tccount)
{
size = _size;
// position matrix indices
if (pmcount)
posMtxInds = new DecMtxInd[size];
// texture matrix indices
if (tmcount)
for (int i=0; i<tmcount; i++)
texMtxInds[i] = new DecMtxInd[size];
// positions (always)
positions = new DecPos[size];
// normals
if (nrmcount)
for (int i=0; i<nrmcount; i++)
normals[i] = new DecNormal[size];
// colors
if (colcount)
for (int i=0; i<colcount; i++)
colors[i] = new DecColor[size];
if (tccount)
for (int i=0; i<tccount; i++)
uvs[i] = new DecUV[size];
}