- Fixed a few bufs in the parser for composite textures.

- Changed: When loading Zips all patches in the patches/ directory should
  be loaded, not only those used by a texture in TEXTUREx. 
- Disabled timidity_mastervolume for the internal Timidity again because
  with the altered volume calculation it is no longer needed and the default
  volume is on the same level as OPL and FMOD.


SVN r909 (trunk)
This commit is contained in:
Christoph Oelckers 2008-04-13 11:40:53 +00:00
commit a53bfa7113
6 changed files with 60 additions and 12 deletions

View file

@ -457,15 +457,28 @@ int FMultiPatchTexture::CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf
FTextureFormat FMultiPatchTexture::GetFormat()
{
if (NumParts == 1) return Parts[0].Texture->GetFormat();
for(int i=0;i<NumParts;i++)
{
if (!Parts[i].Texture->UseBasePalette()) return TEX_RGB;
}
return TEX_Pal;
return UseBasePalette() ? TEX_Pal : TEX_RGB;
}
//===========================================================================
//
// FMultipatchTexture::UseBasePalette
//
// returns true if all patches in the texture use the unmodified base
// palette.
//
//===========================================================================
bool FMultiPatchTexture::UseBasePalette()
{
for(int i=0;i<NumParts;i++)
{
if (!Parts[i].Texture->UseBasePalette()) return false;
}
return true;
}
//==========================================================================
//
// FMultiPatchTexture :: TexPart :: TexPart
@ -723,17 +736,21 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part)
FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
: Pixels (0), Spans(0), Parts(0), bRedirect(false)
{
TArray<TexPart> parts;
sc.SetCMode(true);
sc.MustGetString();
uppercopy(Name, sc.String);
Name[8] = 0;
sc.MustGetStringName(",");
sc.MustGetNumber();
Width = sc.Number;
sc.MustGetStringName(",");
sc.MustGetNumber();
Height = sc.Number;
UseType = FTexture::TEX_Override;
if (sc.CheckString("{"))
{
@ -754,6 +771,10 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
{
bWorldPanning = true;
}
else if (sc.Compare("NullTexture"))
{
UseType = FTexture::TEX_Null;
}
else if (sc.Compare("NoDecals"))
{
bNoDecals = true;
@ -767,7 +788,6 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
}
NumParts = parts.Size();
UseType = FTexture::TEX_Override;
Parts = new TexPart[NumParts];
memcpy(Parts, &parts[0], NumParts * sizeof(*Parts));
@ -787,9 +807,7 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
}
//DefinitionLump = sc.G deflumpnum;
}
sc.SetCMode(false);
}