Rename getShort->getUShort and getByte->getChar

actorid
Chris Robinson 13 years ago
parent 95b804a104
commit 930459365b

@ -44,7 +44,7 @@ public:
{
next.read(nif);
flags = nif->getShort();
flags = nif->getUShort();
frequency = nif->getFloat();
phase = nif->getFloat();
@ -71,7 +71,7 @@ public:
// At the moment, just skip it all
nif->skip(111);
int s = nif->getShort();
int s = nif->getUShort();
nif->skip(15 + s*40);
}
};
@ -133,7 +133,7 @@ public:
{
Controller::read(nif);
nif->getShort(); // always 0
nif->getUShort(); // always 0
data.read(nif);
}
@ -189,7 +189,7 @@ public:
{
Controller::read(nif);
data.read(nif);
nif->getByte(); // always 0
nif->getChar(); // always 0
}
void post(NIFFile *nif)

@ -69,12 +69,12 @@ public:
{
Named::read(nif);
external = !!nif->getByte();
external = !!nif->getChar();
if(external)
filename = nif->getString();
else
{
nif->getByte(); // always 1
nif->getChar(); // always 1
data.read(nif);
}
@ -82,7 +82,7 @@ public:
mipmap = nif->getInt();
alpha = nif->getInt();
nif->getByte(); // always 1
nif->getChar(); // always 1
}
void post(NIFFile *nif)
@ -102,7 +102,7 @@ public:
void read(NIFFile *nif)
{
int verts = nif->getShort();
int verts = nif->getUShort();
if(nif->getInt())
nif->load(vertices, verts*3);
@ -118,7 +118,7 @@ public:
// Only the first 6 bits are used as a count. I think the rest are
// flags of some sort.
int uvs = nif->getShort();
int uvs = nif->getUShort();
uvs &= 0x3f;
if(nif->getInt())
@ -136,7 +136,7 @@ public:
{
ShapeData::read(nif);
int tris = nif->getShort();
int tris = nif->getUShort();
if(tris)
{
// We have three times as many vertices as triangles, so this
@ -148,15 +148,12 @@ public:
// Read the match list, which lists the vertices that are equal to
// vertices. We don't actually need need this for anything, so
// just skip it.
int verts = nif->getShort();
if(verts)
int verts = nif->getUShort();
for(int i=0;i<verts;i++)
{
for(int i=0;i<verts;i++)
{
// Number of vertices matching vertex 'i'
short num = nif->getShort();
nif->skip(num*sizeof(short));
}
// Number of vertices matching vertex 'i'
int num = nif->getUShort();
nif->skip(num*sizeof(short));
}
}
};
@ -171,11 +168,11 @@ public:
ShapeData::read(nif);
// Should always match the number of vertices
activeCount = nif->getShort();
activeCount = nif->getUShort();
// Skip all the info, we don't support particles yet
nif->getFloat(); // Active radius ?
nif->getShort(); // Number of valid entries in the following arrays ?
nif->getFloat(); // Active radius ?
nif->getUShort(); // Number of valid entries in the following arrays ?
if(nif->getInt())
{
@ -421,11 +418,11 @@ public:
bi.unknown = nif->getVector4();
// Number of vertex weights
bi.weights.resize(nif->getShort());
bi.weights.resize(nif->getUShort());
for(size_t j = 0;j < bi.weights.size();j++)
{
nif->load(bi.weights[j].vertex);
nif->load(bi.weights[j].weight);
bi.weights[j].vertex = nif->getUShort();
bi.weights[j].weight = nif->getFloat();
}
}
}
@ -464,7 +461,7 @@ public:
{
int morphCount = nif->getInt();
int vertCount = nif->getInt();
nif->getByte();
nif->getChar();
int magic = nif->getInt();
/*int type =*/ nif->getInt();

@ -164,8 +164,8 @@ public:
}
char getByte() { char c; return load(c); }
unsigned short getShort() { unsigned short s; return load(s); }
char getChar() { char c; return load(c); }
unsigned short getUShort() { unsigned short s; return load(s); }
int getInt() { int i; return load(i); }
float getFloat() { float f; return load(f); }
Ogre::Vector3 getVector()
@ -193,7 +193,7 @@ public:
Transformation t;
t.pos = getVector();
t.rotation = getMatrix();
load(t.scale);
t.scale = getFloat();
t.velocity = getVector();
return t;
}

@ -55,7 +55,7 @@ public:
{
Named::read(nif);
flags = nif->getShort();
flags = nif->getUShort();
trafo = nif->getTrafo();
props.read(nif);

@ -38,7 +38,7 @@ public:
void read(NIFFile *nif)
{
Named::read(nif);
flags = nif->getShort();
flags = nif->getUShort();
}
};
@ -176,8 +176,8 @@ struct S_MaterialProperty
diffuse = nif->getVector();
specular = nif->getVector();
emissive = nif->getVector();
nif->load(glossiness);
nif->load(alpha);
glossiness = nif->getFloat();
alpha = nif->getFloat();
}
};
@ -196,8 +196,8 @@ struct S_VertexColorProperty
void read(NIFFile *nif)
{
nif->load(vertmode);
nif->load(lightmode);
vertmode = nif->getInt();
lightmode = nif->getInt();
}
};
@ -253,7 +253,7 @@ struct S_AlphaProperty
void read(NIFFile *nif)
{
nif->load(threshold);
threshold = nif->getChar();
}
};

Loading…
Cancel
Save