Exemplo n.º 1
0
// Returns on the layer's textures.
const Texture* FontFaceLayer::GetTexture(int index)
{
	ROCKET_ASSERT(index >= 0);
	ROCKET_ASSERT(index < GetNumTextures());

	return textures[index];
}
Exemplo n.º 2
0
// Returns one of the layout's textures.
TextureLayoutTexture& TextureLayout::GetTexture(int index)
{
	ROCKET_ASSERT(index >= 0);
	ROCKET_ASSERT(index < GetNumTextures());

	return textures[index];
}
Exemplo n.º 3
0
char *MaterialStrata::GetCritterName(RasterAnimHost *Test)
{
char Ct;

for (Ct = 0; Ct < GetNumAnimParams(); Ct ++)
	{
	if (Test == GetAnimPtr(Ct))
		return (MaterialStrataCritterNames[Ct]);
	} // for
for (Ct = 0; Ct < GetNumTextures(); Ct ++)
	{
	if (Test == GetTexRootPtr(Ct))
		{
		return (MaterialStrataTextureNames[Ct]);
		} // if
	} // for
if (Test == &StrataColor[0])
	return ("Strata Color 1");
if (Test == &StrataColor[1])
	return ("Strata Color 2");
if (Test == &StrataColor[2])
	return ("Strata Color 3");
if (Test == &StrataColor[3])
	return ("Strata Color 4");

return ("");

} // MaterialStrata::GetCritterName
Exemplo n.º 4
0
void TextureLayout::WriteCacheFile(FILE* f)
{   
	int sr = GetNumRectangles();
	fwrite(&sr, sizeof(sr), 1, f);
	for (int i = 0; i < sr; ++i)
	{
		auto& rect = GetRectangle(i);

		TextureLayoutRectangleCache rectc;
		rectc.dimensions_x = rect.GetDimensions().x;
		rectc.dimensions_y = rect.GetDimensions().y;
		rectc.id = rect.GetId();
		rectc.texture_index = rect.GetTextureIndex();
		rectc.texture_position_x = rect.GetPosition().x;
		rectc.texture_position_y = rect.GetPosition().y;
		rectc.texture_stride = rect.GetTextureStride();

		fwrite(&rectc, sizeof(TextureLayoutRectangleCache), 1, f);
	}

	int sl = GetNumTextures();
	fwrite(&sl, sizeof(sl), 1, f);
	for (int i = 0; i < sl; ++i)
	{
		GetTexture(i).WriteCacheFile(f, &rectangles[0]);
	}
}
Exemplo n.º 5
0
void MaterialStrata::SetDefaults(void)
{
double EffectDefault[WCS_EFFECTS_MATERIALSTRATA_NUMANIMPAR] = {100.0, 0.0, 0.0, 1.0};
double RangeDefaults[WCS_EFFECTS_MATERIALSTRATA_NUMANIMPAR][3] = {FLT_MAX, -FLT_MAX, 1.0,	// deformation scale
														FLT_MAX, -FLT_MAX, 1.0,				// north dip
														FLT_MAX, -FLT_MAX, 1.0,				// west dip
														5.0, -5.0, .01};					// bump intensity
long Ct;

for (Ct = 0; Ct < GetNumAnimParams(); Ct ++)
	{
	AnimPar[Ct].SetDefaults(this, (char)Ct, EffectDefault[Ct]);
	AnimPar[Ct].SetRangeDefaults(RangeDefaults[Ct]);
	} // for
for (Ct = 0; Ct < GetNumTextures(); Ct ++)
	{
	TexRoot[Ct] = NULL;
	} // for
Enabled = 1;
ColorStrata = BumpLines = 0;
LinesEnabled = 1;
StrataColor[0].SetDefaults(this, WCS_EFFECTS_MATERIAL_NUMANIMPAR);
StrataColor[1].SetDefaults(this, WCS_EFFECTS_MATERIAL_NUMANIMPAR + 1);
StrataColor[2].SetDefaults(this, WCS_EFFECTS_MATERIAL_NUMANIMPAR + 2);
StrataColor[3].SetDefaults(this, WCS_EFFECTS_MATERIAL_NUMANIMPAR + 3);
PixelTexturesExist = 0;

AnimPar[WCS_EFFECTS_MATERIALSTRATA_ANIMPAR_BUMPINTENSITY].SetMultiplier(100.0);

} // MaterialStrata::SetDefaults
Exemplo n.º 6
0
TextureLayout& TextureLayout::operator+=(const TextureLayout &layout)
{
  const int texture_size = GetNumTextures();

  for (TextureList::const_iterator i = layout.textures.begin(); i != layout.textures.end(); ++i)
  {
    TextureLayoutTexture *texture = *i;

    texture->AddReference();
    textures.push_back(texture);
  }
  for (RectangleList::const_iterator i = layout.rectangles.begin(); i != layout.rectangles.end(); ++i)
  {
    TextureLayoutRectangle *rect = *i;

    rect->AddReference();
    rect->Place(texture_size + rect->GetTextureIndex(), rect->GetPosition());
    rectangles.push_back(rect);
  }

  return *this;
}
Exemplo n.º 7
0
MaterialStrata::~MaterialStrata()
{
RootTexture *DelTex;
long Ct;

if (GlobalApp->GUIWins)
	{
	if (GlobalApp->GUIWins->MSG && GlobalApp->GUIWins->MSG->GetActive() == this)
		{
		delete GlobalApp->GUIWins->MSG;
		GlobalApp->GUIWins->MSG = NULL;
		} // if
	} // if

for (Ct = 0; Ct < GetNumTextures(); Ct ++)
	{
	if (DelTex = TexRoot[Ct])
		{
		TexRoot[Ct] = NULL;
		delete DelTex;
		} // if
	} // for

} // MaterialStrata::~MaterialStrata
Exemplo n.º 8
0
/*!
\b Parameters:

\arg \b pNumBlocksX, pNumBlocksY    Number of horizontal and vertical blocks

\b Operation:

This method sets a grid to the ::IND_Surface object. A grid is just a mesh which vertices
can be moved in order to deform the graphical object. You can set grids of different levels
of tesselation.

Using grids you can apply lot of different morphing effects to your sprites or animations 
(waves, bubble animation, etc). It is also possible to change the position of all the vertices 
so it would be possible to create for example a "snake" sprite that could simulate the crawling 
when moving.

There is a restriction: the amount of horizontal and vertical blocks should be power of two.

Example: 
- SetGrid (4, 4) => Correct!
- SetGrid (16, 2) => Correct!
- SetGrid (1, 8) => Correct!
- SetGrid (1, 3) => Incorrect!
*/
bool IND_Surface::SetGrid (int pNumBlocksX, int pNumBlocksY)
{
	// At least one block
	if (pNumBlocksX < 1 || pNumBlocksY < 1) return 0;

	// Only power of two values allowed
	IND_Math mMath;
	if (!mMath.IsPowerOfTwo (pNumBlocksX) || !mMath.IsPowerOfTwo (pNumBlocksY)) return 0;

	// Only 1-texture-IND_Surfaces allowed
	if (GetNumTextures() > 1) return 0;

	// Reset attributes
	mSurface.mAttributes.mIsHaveGrid		= 1;
	mSurface.mAttributes.mBlocksX			= pNumBlocksX;
	mSurface.mAttributes.mBlocksY			= pNumBlocksY;
	mSurface.mAttributes.mWidthBlock		= (mSurface.mAttributes.mWidth / mSurface.mAttributes.mBlocksX);
	mSurface.mAttributes.mHeightBlock		= (mSurface.mAttributes.mHeight / mSurface.mAttributes.mBlocksY);
	mSurface.mAttributes.mNumBlocks			= mSurface.mAttributes.mBlocksX * mSurface.mAttributes.mBlocksY;

	// Reset the vertex array
	DisposeArray (mSurface.mVertexArray);
	mSurface.mVertexArray = new CUSTOMVERTEX2D [mSurface.mAttributes.mBlocksX * mSurface.mAttributes.mBlocksY * 4];

	// Current position of the vertex
	int mPosX = 0; 
	int mPosY = mSurface.mAttributes.mHeight; 
	int mPosZ = 0;
	
	// Position in which we are storing a vertex
	int mPosVer = 0;

	// Position in which we are storing a texture
	int mCont = 0;

	// Create the new vertex array
	// We iterate the blocks starting from the lower row
	// We MUST draw the blocks in this order, because the image starts drawing from the lower-left corner 
	for (int i = GetBlocksY(); i > 0; i--)
	{	
		for (int j = 1; j < GetBlocksX() + 1; j++)
		{
			// ----- Block creation (using the position, uv coordiantes and texture) -----

			// We push into the buffer the 4 vertices of the block

			// Normal block
			if (i != 1 && j !=  GetBlocksX())
			{
				Push4Vertices  (mSurface.mVertexArray,						// Pointer to the buffer
								mPosVer,									// Position in wich we are storing a vertex 
								mPosX,										// x
								mPosY,										// y
								mPosZ,										// z
								mSurface.mAttributes.mWidthBlock,			// Block width
								mSurface.mAttributes.mHeightBlock,			// Block height
								mSurface.mAttributes.mWidth,				// U mapping coordinate
								mSurface.mAttributes.mHeight);				// V mapping coordinate
			}

			// The ones of the right column
			if (i != 1 && j ==  GetBlocksX())
			{
				Push4Vertices  (mSurface.mVertexArray,						// Pointer to the buffer
								mPosVer,									// Position in wich we are storing a vertex 
								mPosX,										// x
								mPosY,										// y
								mPosZ,										// z
								mSurface.mAttributes.mWidthBlock,			// Block width
								mSurface.mAttributes.mHeightBlock,			// Block height
								mSurface.mAttributes.mWidth,				// U mapping coordinate
								mSurface.mAttributes.mHeight);				// V mapping coordinate
			}	
			
			// The ones of the upper row
			if (i == 1 && j != GetBlocksX())
			{
				Push4Vertices  (mSurface.mVertexArray,						// Pointer to the buffer
								mPosVer,									// Position in wich we are storing a vertex 
								mPosX,										// x
								mPosY,										// y
								mPosZ,										// z
								mSurface.mAttributes.mWidthBlock,			// Block width
								mSurface.mAttributes.mHeightBlock,			// Block height
								mSurface.mAttributes.mWidth,				// U mapping coordinate
								mSurface.mAttributes.mHeight);				// V mapping coordinate
			}	
			
			// The one of the upper-right corner
			if (i == 1 && j ==  GetBlocksX())
			{	
				Push4Vertices  (mSurface.mVertexArray,						// Pointer to the buffer
								mPosVer,									// Position in wich we are storing a vertex 
								mPosX,										// x
								mPosY,										// y
								mPosZ,										// z
								mSurface.mAttributes.mWidthBlock,			// Block width
								mSurface.mAttributes.mHeightBlock,			// Block height
								mSurface.mAttributes.mWidth,				// U mapping coordinate
								mSurface.mAttributes.mHeight);				// V mapping coordinate
			}

			// ----- Advance -----
								
			// Increase the vertex's position by 4
			mPosVer += 4;

			// ----- Column change -----

			// We point to the next block
			mPosX += mSurface.mAttributes.mWidthBlock;
		}

		// ----- Row change -----

		// We point to the next block		
		mPosX = 0;
		mPosY -= mSurface.mAttributes.mHeightBlock;
	}

	return 1;
}
Exemplo n.º 9
0
unsigned long int MaterialStrata::Save(FILE *ffile)
{
ULONG ItemTag, TotalWritten = 0;
long BytesWritten, Ct;
unsigned long int AnimItemTag[WCS_EFFECTS_MATERIALSTRATA_NUMANIMPAR] = {WCS_EFFECTS_MATERIALSTRATA_DEFORMSCALE, 
																WCS_EFFECTS_MATERIALSTRATA_NORTHDIP,
																WCS_EFFECTS_MATERIALSTRATA_WESTDIP,
																WCS_EFFECTS_MATERIALSTRATA_BUMPINTENSITY};
unsigned long int TextureItemTag[WCS_EFFECTS_MATERIALSTRATA_NUMTEXTURES] = {WCS_EFFECTS_MATERIALSTRATA_TEXDEFORMATION,
																			WCS_EFFECTS_MATERIALSTRATA_TEXBUMPINTENSITY};
unsigned long int ColorItemTag[4] = {WCS_EFFECTS_MATERIALSTRATA_COLOR1, 
									WCS_EFFECTS_MATERIALSTRATA_COLOR2,
									WCS_EFFECTS_MATERIALSTRATA_COLOR3,
									WCS_EFFECTS_MATERIALSTRATA_COLOR4};

if (BrowseInfo)
	{
	ItemTag = WCS_EFFECTS_BROWSEDATA + WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT;
	if (BytesWritten = WriteBlock(ffile, (char *)&ItemTag,
		WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
		{
		TotalWritten += BytesWritten;

		ItemTag = 0;
		if (BytesWritten = WriteBlock(ffile, (char *)&ItemTag,
			WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
			{
			TotalWritten += BytesWritten;

			if (BytesWritten = BrowseInfo->Save(ffile))
				{
				TotalWritten += BytesWritten;
				fseek(ffile, -(BytesWritten + WCS_BLOCKSIZE_LONG), SEEK_CUR);
				if (WriteBlock(ffile, (char *)&BytesWritten,
					WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
					{
					fseek(ffile, 0, SEEK_END);
					} // if wrote size of block 
				else
					goto WriteError;
				} // if browse data saved 
			else
				goto WriteError;
			} // if size written 
		else
			goto WriteError;
		} // if tag written 
	else
		goto WriteError;
	} // if

if ((BytesWritten = PrepWriteBlock(ffile, WCS_EFFECTS_MATERIALSTRATA_ENABLED, WCS_BLOCKSIZE_CHAR,
	WCS_BLOCKTYPE_CHAR, WCS_BLOCKSIZE_CHAR,
	WCS_BLOCKTYPE_CHAR, (char *)&Enabled)) == NULL)
	goto WriteError;
TotalWritten += BytesWritten;
if ((BytesWritten = PrepWriteBlock(ffile, WCS_EFFECTS_MATERIALSTRATA_COLORSTRATA, WCS_BLOCKSIZE_CHAR,
	WCS_BLOCKTYPE_CHAR, WCS_BLOCKSIZE_CHAR,
	WCS_BLOCKTYPE_CHAR, (char *)&ColorStrata)) == NULL)
	goto WriteError;
TotalWritten += BytesWritten;
if ((BytesWritten = PrepWriteBlock(ffile, WCS_EFFECTS_MATERIALSTRATA_LINESENABLED, WCS_BLOCKSIZE_CHAR,
	WCS_BLOCKTYPE_CHAR, WCS_BLOCKSIZE_CHAR,
	WCS_BLOCKTYPE_CHAR, (char *)&LinesEnabled)) == NULL)
	goto WriteError;
TotalWritten += BytesWritten;
if ((BytesWritten = PrepWriteBlock(ffile, WCS_EFFECTS_MATERIALSTRATA_BUMPLINES, WCS_BLOCKSIZE_CHAR,
	WCS_BLOCKTYPE_CHAR, WCS_BLOCKSIZE_CHAR,
	WCS_BLOCKTYPE_CHAR, (char *)&BumpLines)) == NULL)
	goto WriteError;
TotalWritten += BytesWritten;

for (Ct = 0; Ct < GetNumAnimParams(); Ct ++)
	{
	ItemTag = AnimItemTag[Ct] + WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT;
	if (BytesWritten = WriteBlock(ffile, (char *)&ItemTag,
		WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
		{
		TotalWritten += BytesWritten;

		ItemTag = 0;
		if (BytesWritten = WriteBlock(ffile, (char *)&ItemTag,
			WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
			{
			TotalWritten += BytesWritten;

			if (BytesWritten = AnimPar[Ct].Save(ffile))
				{
				TotalWritten += BytesWritten;
				fseek(ffile, -(BytesWritten + WCS_BLOCKSIZE_LONG), SEEK_CUR);
				if (WriteBlock(ffile, (char *)&BytesWritten,
					WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
					{
					fseek(ffile, 0, SEEK_END);
					} /* if wrote size of block */
				else
					goto WriteError;
				} /* if anim param saved */
			else
				goto WriteError;
			} /* if size written */
		else
			goto WriteError;
		} /* if tag written */
	else
		goto WriteError;
	} // for

for (Ct = 0; Ct < 4; Ct ++)
	{
	ItemTag = ColorItemTag[Ct] + WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT;
	if (BytesWritten = WriteBlock(ffile, (char *)&ItemTag,
		WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
		{
		TotalWritten += BytesWritten;

		ItemTag = 0;
		if (BytesWritten = WriteBlock(ffile, (char *)&ItemTag,
			WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
			{
			TotalWritten += BytesWritten;

			if (BytesWritten = StrataColor[Ct].Save(ffile))
				{
				TotalWritten += BytesWritten;
				fseek(ffile, -(BytesWritten + WCS_BLOCKSIZE_LONG), SEEK_CUR);
				if (WriteBlock(ffile, (char *)&BytesWritten,
					WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
					{
					fseek(ffile, 0, SEEK_END);
					} /* if wrote size of block */
				else
					goto WriteError;
				} /* if strata color saved */
			else
				goto WriteError;
			} /* if size written */
		else
			goto WriteError;
		} /* if tag written */
	else
		goto WriteError;
	} // for

for (Ct = 0; Ct < GetNumTextures(); Ct ++)
	{
	if (TexRoot[Ct])
		{
		ItemTag = TextureItemTag[Ct] + WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT;
		if (BytesWritten = WriteBlock(ffile, (char *)&ItemTag,
			WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
			{
			TotalWritten += BytesWritten;

			ItemTag = 0;
			if (BytesWritten = WriteBlock(ffile, (char *)&ItemTag,
				WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
				{
				TotalWritten += BytesWritten;

				if (BytesWritten = TexRoot[Ct]->Save(ffile))
					{
					TotalWritten += BytesWritten;
					fseek(ffile, -(BytesWritten + WCS_BLOCKSIZE_LONG), SEEK_CUR);
					if (WriteBlock(ffile, (char *)&BytesWritten,
						WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT))
						{
						fseek(ffile, 0, SEEK_END);
						} // if wrote size of block
					else
						goto WriteError;
					} // if anim param saved
				else
					goto WriteError;
				} // if size written
			else
				goto WriteError;
			} // if tag written
		else
			goto WriteError;
		} // if
	} // for

ItemTag = WCS_PARAM_DONE;
if ((BytesWritten = WriteBlock(ffile, (char *)&ItemTag,
	WCS_BLOCKSIZE_LONG + WCS_BLOCKTYPE_LONGINT)) == NULL)
	goto WriteError;
TotalWritten += BytesWritten;
goto WriteIt;

WriteError:
TotalWritten = 0UL;

WriteIt:
return (TotalWritten);

} // MaterialStrata::Save
Exemplo n.º 10
0
ULONG MaterialStrata::Load(FILE *ffile, unsigned long ReadSize, short ByteFlip)
{
ULONG ItemTag = 0, Size, BytesRead, TotalRead = 0;
union MultiVal MV;
char TexRootNumber = -1;

while (ItemTag != WCS_PARAM_DONE)
	{
	// read block descriptor tag from file 
	if (BytesRead = ReadBlock(ffile, (char *)&ItemTag,
		WCS_BLOCKTYPE_LONGINT + WCS_BLOCKSIZE_LONG, ByteFlip))
		{
		TotalRead += BytesRead;
		if (ItemTag != WCS_PARAM_DONE)
			{
			// read block size from file 
			if (BytesRead = ReadBlock(ffile, (char *)&MV, ItemTag & 0x0000ffff, ByteFlip))
				{
				TotalRead += BytesRead;
				BytesRead = 0;
				switch (ItemTag & 0xff)
					{
					case WCS_BLOCKSIZE_CHAR:
						{
						Size = MV.Char[0];
						break;
						}
					case WCS_BLOCKSIZE_SHORT:
						{
						Size = MV.Short[0];
						break;
						}
					case WCS_BLOCKSIZE_LONG:
						{
						Size = MV.Long;
						break;
						}
					default:
						break;
					} // switch 

				switch (ItemTag & 0xffff0000)
					{
					case WCS_EFFECTS_BROWSEDATA:
						{
						if (BrowseInfo)
							BrowseInfo->FreeAll();
						else
							BrowseInfo = new BrowseData();
						if (BrowseInfo)
							BytesRead = BrowseInfo->Load(ffile, Size, ByteFlip);
						else if (! fseek(ffile, Size, SEEK_CUR))
							BytesRead = Size;
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_DEFORMSCALE:
						{
						BytesRead = AnimPar[WCS_EFFECTS_MATERIALSTRATA_ANIMPAR_DEFORMSCALE].Load(ffile, Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_NORTHDIP:
						{
						BytesRead = AnimPar[WCS_EFFECTS_MATERIALSTRATA_ANIMPAR_NORTHDIP].Load(ffile, Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_WESTDIP:
						{
						BytesRead = AnimPar[WCS_EFFECTS_MATERIALSTRATA_ANIMPAR_WESTDIP].Load(ffile, Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_BUMPINTENSITY:
						{
						BytesRead = AnimPar[WCS_EFFECTS_MATERIALSTRATA_ANIMPAR_BUMPINTENSITY].Load(ffile, Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_COLOR1:
						{
						BytesRead = StrataColor[0].Load(ffile, Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_COLOR2:
						{
						BytesRead = StrataColor[1].Load(ffile, Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_COLOR3:
						{
						BytesRead = StrataColor[2].Load(ffile, Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_COLOR4:
						{
						BytesRead = StrataColor[3].Load(ffile, Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_ENABLED:
						{
						BytesRead = ReadBlock(ffile, (char *)&Enabled, WCS_BLOCKTYPE_CHAR + Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_COLORSTRATA:
						{
						BytesRead = ReadBlock(ffile, (char *)&ColorStrata, WCS_BLOCKTYPE_CHAR + Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_LINESENABLED:
						{
						BytesRead = ReadBlock(ffile, (char *)&LinesEnabled, WCS_BLOCKTYPE_CHAR + Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_BUMPLINES:
						{
						BytesRead = ReadBlock(ffile, (char *)&BumpLines, WCS_BLOCKTYPE_CHAR + Size, ByteFlip);
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_TEXTUREROOTNUM:
						{
						BytesRead = ReadBlock(ffile, (char *)&TexRootNumber, WCS_BLOCKTYPE_CHAR + Size, ByteFlip);
						if (TexRootNumber >= 0 && TexRootNumber < GetNumTextures())
							{
							TexRoot[TexRootNumber] = new RootTexture(this, 0, 0, 0);
							} // if
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_TEXTUREROOT:
						{
						if (TexRootNumber >= 0 && TexRootNumber < GetNumTextures() && TexRoot[TexRootNumber])
							{
							BytesRead = TexRoot[TexRootNumber]->Load(ffile, Size, ByteFlip);
							} // if
						else if (! fseek(ffile, Size, SEEK_CUR))
							BytesRead = Size;
						TexRootNumber = -1;
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_TEXDEFORMATION:
						{
						if (TexRoot[WCS_EFFECTS_MATERIALSTRATA_TEXTURE_DEFORMATION] = new RootTexture(this, 0, 0, 0))
							{
							BytesRead = TexRoot[WCS_EFFECTS_MATERIALSTRATA_TEXTURE_DEFORMATION]->Load(ffile, Size, ByteFlip);
							} // if
						else if (! fseek(ffile, Size, SEEK_CUR))
							BytesRead = Size;
						break;
						}
					case WCS_EFFECTS_MATERIALSTRATA_TEXBUMPINTENSITY:
						{
						if (TexRoot[WCS_EFFECTS_MATERIALSTRATA_TEXTURE_BUMPINTENSITY] = new RootTexture(this, 0, 0, 0))
							{
							BytesRead = TexRoot[WCS_EFFECTS_MATERIALSTRATA_TEXTURE_BUMPINTENSITY]->Load(ffile, Size, ByteFlip);
							} // if
						else if (! fseek(ffile, Size, SEEK_CUR))
							BytesRead = Size;
						break;
						}
					default:
						{
						if (! fseek(ffile, Size, SEEK_CUR))
							BytesRead = Size;
						break;
						} 
					} // switch 

				TotalRead += BytesRead;
				if (BytesRead != Size)
					break;
				} // if size block read 
			else
				break;
			} // if not done flag 
		} // if tag block read 
	else
		break;
	} // while 

return (TotalRead);

} // MaterialStrata::Load