- 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
parent e7ff22457e
commit a53bfa7113
6 changed files with 63 additions and 15 deletions

View file

@ -1,3 +1,11 @@
April 13, 2008 (Changes by Graf Zahl)
- 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.
April 12, 2008 April 12, 2008
- Changed FMOD_INIT_ENABLE_DSPNET use to its replacement from 4.14.00, - Changed FMOD_INIT_ENABLE_DSPNET use to its replacement from 4.14.00,
FMOD_INIT_ENABLE_PROFILE. Renamed the corresponding cvar to snd_profile. FMOD_INIT_ENABLE_PROFILE. Renamed the corresponding cvar to snd_profile.

View file

@ -89,6 +89,7 @@ public:
const BYTE *GetColumn (unsigned int column, const Span **spans_out); const BYTE *GetColumn (unsigned int column, const Span **spans_out);
const BYTE *GetPixels (); const BYTE *GetPixels ();
FTextureFormat GetFormat(); FTextureFormat GetFormat();
bool UseBasePalette() ;
void Unload (); void Unload ();
virtual void SetFrontSkyLayer (); virtual void SetFrontSkyLayer ();

View file

@ -759,6 +759,9 @@ public:
BYTE bHasCanvas:1; // Texture is based off FCanvasTexture BYTE bHasCanvas:1; // Texture is based off FCanvasTexture
BYTE bWarped:2; // This is a warped texture. Used to avoid multiple warps on one texture BYTE bWarped:2; // This is a warped texture. Used to avoid multiple warps on one texture
BYTE bIsPatch:1; // 1 if an FPatchTexture. Required to fix FMultipatchTexture::CheckForHacks BYTE bIsPatch:1; // 1 if an FPatchTexture. Required to fix FMultipatchTexture::CheckForHacks
BYTE bComplex:1; // Will be used to mark extended MultipatchTextures that have to be
// fully composited before subjected to any kinf of postprocessing instead of
// doing it per patch.
WORD Rotations; WORD Rotations;

View file

@ -205,7 +205,7 @@ int TimidityMIDIDevice::Resume()
{ {
if (!Started) if (!Started)
{ {
if (Stream->Play(true, timidity_mastervolume)) if (Stream->Play(true, 1/*timidity_mastervolume*/))
{ {
Started = true; Started = true;
return 0; return 0;
@ -335,10 +335,12 @@ bool TimidityMIDIDevice::NeedThreadedCallback()
void TimidityMIDIDevice::TimidityVolumeChanged() void TimidityMIDIDevice::TimidityVolumeChanged()
{ {
/*
if (Stream != NULL) if (Stream != NULL)
{ {
Stream->SetVolume(timidity_mastervolume); Stream->SetVolume(timidity_mastervolume);
} }
*/
} }
//========================================================================== //==========================================================================

View file

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

View file

@ -386,8 +386,21 @@ int FTextureManager::AddPatch (const char *patchname, int namespc, bool tryany)
void FTextureManager::AddGroup(int wadnum, const char * startlump, const char * endlump, int ns, int usetype) void FTextureManager::AddGroup(int wadnum, const char * startlump, const char * endlump, int ns, int usetype)
{ {
int firsttx = Wads.CheckNumForName (startlump); int firsttx;
int lasttx = Wads.CheckNumForName (endlump); int lasttx;
if (startlump && endlump)
{
firsttx = Wads.CheckNumForName (startlump);
lasttx = Wads.CheckNumForName (endlump);
}
else
{
// If there are no markers we have to search the entire lump directory... :(
firsttx = 0;
lasttx = Wads.GetNumLumps() - 1;
}
char name[9]; char name[9];
if (firsttx == -1 || lasttx == -1) if (firsttx == -1 || lasttx == -1)
@ -404,7 +417,7 @@ void FTextureManager::AddGroup(int wadnum, const char * startlump, const char *
for (firsttx += 1; firsttx < lasttx; ++firsttx) for (firsttx += 1; firsttx < lasttx; ++firsttx)
{ {
if (Wads.GetLumpFile(firsttx) == wadnum) if (Wads.GetLumpFile(firsttx) == wadnum && Wads.GetLumpNamespace(firsttx) == ns)
{ {
Wads.GetLumpName (name, firsttx); Wads.GetLumpName (name, firsttx);
@ -696,6 +709,10 @@ void FTextureManager::AddTexturesForWad(int wadnum)
// First step: Load sprites // First step: Load sprites
AddGroup(wadnum, "S_START", "S_END", ns_sprites, FTexture::TEX_Sprite); AddGroup(wadnum, "S_START", "S_END", ns_sprites, FTexture::TEX_Sprite);
// When loading a Zip, all graphics in the patches/ directory should be
// added as well.
AddGroup(wadnum, NULL, NULL, ns_patches, FTexture::TEX_WallPatch);
// Second step: TEXTUREx lumps // Second step: TEXTUREx lumps
LoadTextureX(wadnum); LoadTextureX(wadnum);
@ -721,7 +738,6 @@ void FTextureManager::AddTexturesForWad(int wadnum)
if (ns == ns_global) if (ns == ns_global)
{ {
// In Zips all graphics must be in a separate namespace. // In Zips all graphics must be in a separate namespace.
if (Wads.GetLumpFlags(i) & LUMPF_ZIPFILE) continue;
// Ignore lumps with empty names. // Ignore lumps with empty names.
if (Wads.CheckLumpName(i, "")) continue; if (Wads.CheckLumpName(i, "")) continue;