Commit f683efa7 authored by hybrid's avatar hybrid

Move some more variables into the loops.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3582 dfc29bdd-3216-0410-991c-e03cc46cb475
parent b89b2978
...@@ -867,7 +867,7 @@ void STextureAtlas::getScale(core::vector2df& scale) ...@@ -867,7 +867,7 @@ void STextureAtlas::getScale(core::vector2df& scale)
/*! /*!
*/ */
void STextureAtlas::getTranslation ( const c8 * name, core::vector2di &pos ) void STextureAtlas::getTranslation(const c8* name, core::vector2di& pos)
{ {
for ( u32 i = 0; i < atlas.size(); ++i) for ( u32 i = 0; i < atlas.size(); ++i)
{ {
...@@ -881,7 +881,7 @@ void STextureAtlas::getTranslation ( const c8 * name, core::vector2di &pos ) ...@@ -881,7 +881,7 @@ void STextureAtlas::getTranslation ( const c8 * name, core::vector2di &pos )
/*! /*!
*/ */
void STextureAtlas::create ( u32 border, E_TEXTURE_CLAMP texmode) void STextureAtlas::create(u32 border, E_TEXTURE_CLAMP texmode)
{ {
u32 i = 0; u32 i = 0;
u32 w = 0; u32 w = 0;
...@@ -953,17 +953,16 @@ void STextureAtlas::create ( u32 border, E_TEXTURE_CLAMP texmode) ...@@ -953,17 +953,16 @@ void STextureAtlas::create ( u32 border, E_TEXTURE_CLAMP texmode)
// build image // build image
core::dimension2d<u32> dim = core::dimension2d<u32>( wsum, hsum ).getOptimalSize(); core::dimension2d<u32> dim = core::dimension2d<u32>( wsum, hsum ).getOptimalSize();
IImage* master = new CImage( format, dim ); IImage* master = new CImage( format, dim );
master->fill ( 0 ); master->fill(0);
video::SColor col[2]; video::SColor col[2];
static const u8 wrap[][4] = static const u8 wrap[][4] =
{ {
{1, 0 }, // ETC_REPEAT {1, 0}, // ETC_REPEAT
{0, 1 }, // ETC_CLAMP {0, 1}, // ETC_CLAMP
{0, 1 }, // ETC_CLAMP_TO_EDGE {0, 1}, // ETC_CLAMP_TO_EDGE
{0, 1 } // ETC_MIRROR {0, 1} // ETC_MIRROR
}; };
s32 a,b; s32 a,b;
...@@ -1002,7 +1001,7 @@ void STextureAtlas::create ( u32 border, E_TEXTURE_CLAMP texmode) ...@@ -1002,7 +1001,7 @@ void STextureAtlas::create ( u32 border, E_TEXTURE_CLAMP texmode)
/*! /*!
*/ */
SHalflifeHeader * CAnimatedMeshHalfLife::loadModel( io::IReadFile* file, const io::path &filename ) SHalflifeHeader* CAnimatedMeshHalfLife::loadModel(io::IReadFile* file, const io::path& filename)
{ {
bool closefile = false; bool closefile = false;
...@@ -1099,7 +1098,7 @@ SHalflifeHeader * CAnimatedMeshHalfLife::loadModel( io::IReadFile* file, const i ...@@ -1099,7 +1098,7 @@ SHalflifeHeader * CAnimatedMeshHalfLife::loadModel( io::IReadFile* file, const i
store = io::path ( "c:/h2/convert/" ) + fname + ".bmp"; store = io::path ( "c:/h2/convert/" ) + fname + ".bmp";
SceneManager->getVideoDriver()->writeImageToFile ( TextureAtlas.Master, store ); SceneManager->getVideoDriver()->writeImageToFile ( TextureAtlas.Master, store );
#endif #endif
TextureAtlas.release (); TextureAtlas.release();
#endif #endif
} }
...@@ -1172,7 +1171,6 @@ f32 CAnimatedMeshHalfLife::SetController( s32 controllerIndex, f32 value ) ...@@ -1172,7 +1171,6 @@ f32 CAnimatedMeshHalfLife::SetController( s32 controllerIndex, f32 value )
} }
/*! /*!
*/ */
u32 CAnimatedMeshHalfLife::SetSkin( u32 value ) u32 CAnimatedMeshHalfLife::SetSkin( u32 value )
...@@ -1208,13 +1206,11 @@ bool CAnimatedMeshHalfLife::postLoadModel( const io::path &filename ) ...@@ -1208,13 +1206,11 @@ bool CAnimatedMeshHalfLife::postLoadModel( const io::path &filename )
OwnTexModel = false; OwnTexModel = false;
} }
u32 i;
// preload animations // preload animations
if (Header->numseqgroups > 1) if (Header->numseqgroups > 1)
{ {
c8 seq[8]; c8 seq[8];
for ( i = 1; i < Header->numseqgroups; i++) for (u32 i = 1; i < Header->numseqgroups; i++)
{ {
snprintf( seq, 8, "%02d.mdl", i ); snprintf( seq, 8, "%02d.mdl", i );
submodel = path + texname + seq; submodel = path + texname + seq;
...@@ -1229,7 +1225,6 @@ bool CAnimatedMeshHalfLife::postLoadModel( const io::path &filename ) ...@@ -1229,7 +1225,6 @@ bool CAnimatedMeshHalfLife::postLoadModel( const io::path &filename )
} }
/*! /*!
*/ */
void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level ) void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
...@@ -1266,7 +1261,6 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level ) ...@@ -1266,7 +1261,6 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
return; return;
} }
printf("id: %c%c%c%c\n", phdr[0], phdr[1], phdr[2], phdr[3]); printf("id: %c%c%c%c\n", phdr[0], phdr[1], phdr[2], phdr[3]);
printf("version: %d\n", hdr->version); printf("version: %d\n", hdr->version);
printf("name: \"%s\"\n", hdr->name); printf("name: \"%s\"\n", hdr->name);
...@@ -1389,18 +1383,15 @@ void CAnimatedMeshHalfLife::ExtractBbox( s32 sequence, core::aabbox3df &box ) ...@@ -1389,18 +1383,15 @@ void CAnimatedMeshHalfLife::ExtractBbox( s32 sequence, core::aabbox3df &box )
*/ */
void CAnimatedMeshHalfLife::calcBoneAdj() void CAnimatedMeshHalfLife::calcBoneAdj()
{ {
u32 j; SHalflifeBoneController *bonecontroller =
s32 i; (SHalflifeBoneController *)((u8*) Header + Header->bonecontrollerindex);
f32 value;
SHalflifeBoneController *bonecontroller;
bonecontroller = (SHalflifeBoneController *)((u8*) Header + Header->bonecontrollerindex);
for (j = 0; j < Header->numbonecontrollers; j++) for (u32 j = 0; j < Header->numbonecontrollers; j++)
{ {
i = bonecontroller[j].index; s32 i = bonecontroller[j].index;
f32 range = i <= 3 ? 255.f : 64.f; f32 range = i <= 3 ? 255.f : 64.f;
// check for 360% wrapping // check for 360% wrapping
f32 value;
if (bonecontroller[j].type & STUDIO_RLOOP) if (bonecontroller[j].type & STUDIO_RLOOP)
{ {
value = BoneController[i] * (360.f/256.f) + bonecontroller[j].start; value = BoneController[i] * (360.f/256.f) + bonecontroller[j].start;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment