- Since KDIZD is the only mapset I know of that used reverb, and it didn't

define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump
  to REVERBS to remove any possible misunderstanding that this is something
  that requires EAX hardware support. (Ideally, it would have been REVERBDEF,
  but that's 10 characters long.) The eaxedit console command has also been
  renamed to reverbedit for the same reason.
- Fixed: The Palette part of FRemapTable was not initialized with alpha values
  other than 0. I'm not sure if it would be better to fix this in the game
  palette that it copies from or not, but right now, they get set
  unconditionally to 255.

SVN r983 (trunk)
This commit is contained in:
Randy Heit 2008-05-20 04:02:49 +00:00
parent 2878e1870a
commit 5b8055bfc7
12 changed files with 63 additions and 49 deletions

View file

@ -1,4 +1,14 @@
May 19, 2008
- Since KDIZD is the only mapset I know of that used reverb, and it didn't
define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump
to REVERBS to remove any possible misunderstanding that this is something
that requires EAX hardware support. (Ideally, it would have been REVERBDEF,
but that's 10 characters long.) The eaxedit console command has also been
renamed to reverbedit for the same reason.
- Fixed: The Palette part of FRemapTable was not initialized with alpha values
other than 0. I'm not sure if it would be better to fix this in the game
palette that it copies from or not, but right now, they get set
unconditionally to 255.
- Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case
the texture is high-res.
- Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |="

View file

@ -1,6 +1,6 @@
/*
** a_soundenvironment.cpp
** Actor that controls the EAX settings in its zone
** Actor that controls the reverb settings in its zone
**
**---------------------------------------------------------------------------
** Copyright 1998-2006 Randy Heit

View file

@ -930,8 +930,8 @@ void M_DrawLoad (void)
{
FTexture *title = TexMan["M_LOADG"];
screen->DrawTexture (title,
(SCREENWIDTH-title->GetScaledWidth()*CleanXfac)/2, 20*CleanYfac,
DTA_CleanNoMove, true, DTA_BilinearFilter, true, TAG_DONE);
(SCREENWIDTH - title->GetScaledWidth()*CleanXfac)/2, 20*CleanYfac,
DTA_CleanNoMove, true, TAG_DONE);
}
else
{
@ -1293,7 +1293,7 @@ void M_DrawSave()
{
FTexture *title = TexMan["M_SAVEG"];
screen->DrawTexture (title,
(SCREENWIDTH-title->GetWidth()*CleanXfac)/2, 20*CleanYfac,
(SCREENWIDTH-title->GetScaledWidth()*CleanXfac)/2, 20*CleanYfac,
DTA_CleanNoMove, true, TAG_DONE);
}
else

View file

@ -371,9 +371,9 @@ void R_InitTranslationTables ()
translationtables[TRANSLATION_Standard][1]->Remap[i] = 0x40 + (i&0xf);
translationtables[TRANSLATION_Standard][2]->Remap[i] = 0x20 + (i&0xf);
translationtables[TRANSLATION_Standard][0]->Palette[i] = GPalette.BaseColors[0x60 + (i&0xf)];
translationtables[TRANSLATION_Standard][1]->Palette[i] = GPalette.BaseColors[0x40 + (i&0xf)];
translationtables[TRANSLATION_Standard][2]->Palette[i] = GPalette.BaseColors[0x20 + (i&0xf)];
translationtables[TRANSLATION_Standard][0]->Palette[i] = GPalette.BaseColors[0x60 + (i&0xf)] | MAKEARGB(255,0,0,0);
translationtables[TRANSLATION_Standard][1]->Palette[i] = GPalette.BaseColors[0x40 + (i&0xf)] | MAKEARGB(255,0,0,0);
translationtables[TRANSLATION_Standard][2]->Palette[i] = GPalette.BaseColors[0x20 + (i&0xf)] | MAKEARGB(255,0,0,0);
}
}
else if (gameinfo.gametype == GAME_Heretic)
@ -384,9 +384,9 @@ void R_InitTranslationTables ()
translationtables[TRANSLATION_Standard][1]->Remap[i] = 145+(i-225); // red
translationtables[TRANSLATION_Standard][2]->Remap[i] = 190+(i-225); // blue
translationtables[TRANSLATION_Standard][0]->Palette[i] = GPalette.BaseColors[114+(i-225)];
translationtables[TRANSLATION_Standard][1]->Palette[i] = GPalette.BaseColors[145+(i-225)];
translationtables[TRANSLATION_Standard][2]->Palette[i] = GPalette.BaseColors[190+(i-225)];
translationtables[TRANSLATION_Standard][0]->Palette[i] = GPalette.BaseColors[114+(i-225)] | MAKEARGB(255,0,0,0);
translationtables[TRANSLATION_Standard][1]->Palette[i] = GPalette.BaseColors[145+(i-225)] | MAKEARGB(255,0,0,0);
translationtables[TRANSLATION_Standard][2]->Palette[i] = GPalette.BaseColors[190+(i-225)] | MAKEARGB(255,0,0,0);
}
}
else if (gameinfo.gametype == GAME_Strife)
@ -444,7 +444,7 @@ void R_InitTranslationTables ()
for (int j = 0x20; j <= 0xFB; ++j)
{
translationtables[TRANSLATION_Standard][i]->Palette[j] =
GPalette.BaseColors[translationtables[TRANSLATION_Standard][i]->Remap[j]];
GPalette.BaseColors[translationtables[TRANSLATION_Standard][i]->Remap[j]] | MAKEARGB(255,0,0,0);
}
}
}
@ -466,7 +466,7 @@ void R_InitTranslationTables ()
int b = GPalette.BaseColors[i].b;
int v = (r*77 + g*143 + b*37) >> 12;
remap->Remap[i] = IcePaletteRemap[v];
remap->Palette[i] = PalEntry(IcePalette[v][0], IcePalette[v][1], IcePalette[v][2]);
remap->Palette[i] = PalEntry(255, IcePalette[v][0], IcePalette[v][1], IcePalette[v][2]);
}
// set up shading tables for shaded columns
@ -528,7 +528,7 @@ static void SetRemap(FRemapTable *table, int i, float r, float g, float b)
int ig = clamp (int(g * 255.f), 0, 255);
int ib = clamp (int(b * 255.f), 0, 255);
table->Remap[i] = ColorMatcher.Pick (ir, ig, ib);
table->Palette[i] = PalEntry(ir, ig, ib);
table->Palette[i] = PalEntry(255, ir, ig, ib);
}
static void R_CreatePlayerTranslation (float h, float s, float v, FPlayerSkin *skin, FRemapTable *table, FRemapTable *alttable)
@ -558,6 +558,10 @@ static void R_CreatePlayerTranslation (float h, float s, float v, FPlayerSkin *s
}
memcpy(table->Palette, GPalette.BaseColors, sizeof(table->Palette));
}
for (i = 1; i < 256; ++i)
{
table->Palette[i].a = 255;
}
// [GRB] Don't translate skins with color range 0-0 (APlayerPawn default)
if (start == 0 && end == 0)

View file

@ -8,7 +8,7 @@
#include "w_wad.h"
#include "i_system.h"
struct FEAXField
struct FReverbField
{
int Min, Max;
float REVERB_PROPERTIES::*Float;
@ -16,7 +16,7 @@ struct FEAXField
unsigned int Flag;
};
static const FEAXField EAXFields[] =
static const FReverbField ReverbFields[] =
{
{ 0, 25, 0, &REVERB_PROPERTIES::Environment, 0 },
{ 1000, 100000, &REVERB_PROPERTIES::EnvSize, 0, 0 },
@ -56,9 +56,9 @@ static const FEAXField EAXFields[] =
{ 0, 0, 0, 0, 6 },
{ 0, 0, 0, 0, 7 }
};
#define NUM_EAX_FIELDS (int(countof(EAXFields)))
#define NUM_REVERB_FIELDS (int(countof(ReverbFields)))
static const char *EAXFieldNames[NUM_EAX_FIELDS+2] =
static const char *ReverbFieldNames[NUM_REVERB_FIELDS+2] =
{
"Environment",
"EnvironmentSize",
@ -465,7 +465,7 @@ FArchive &operator<< (FArchive &arc, ReverbContainer *&env)
return arc;
}
static void ReadEAX (int lump)
static void ReadReverbDef (int lump)
{
FScanner sc;
const ReverbContainer *def;
@ -473,7 +473,7 @@ static void ReadEAX (int lump)
REVERB_PROPERTIES props;
char *name;
int id1, id2, i, j;
bool inited[NUM_EAX_FIELDS];
bool inited[NUM_REVERB_FIELDS];
BYTE bools[32];
sc.OpenLumpNum(lump);
@ -488,20 +488,20 @@ static void ReadEAX (int lump)
memset (inited, 0, sizeof(inited));
props.Instance = 0;
props.Flags = 0;
while (sc.MustGetString (), NUM_EAX_FIELDS > (i = sc.MustMatchString (EAXFieldNames)))
while (sc.MustGetString (), NUM_REVERB_FIELDS > (i = sc.MustMatchString (ReverbFieldNames)))
{
if (EAXFields[i].Float)
if (ReverbFields[i].Float)
{
sc.MustGetFloat ();
props.*EAXFields[i].Float = clamp (sc.Float,
double(EAXFields[i].Min)/1000,
double(EAXFields[i].Max)/1000);
props.*ReverbFields[i].Float = clamp (sc.Float,
double(ReverbFields[i].Min)/1000,
double(ReverbFields[i].Max)/1000);
}
else if (EAXFields[i].Int)
else if (ReverbFields[i].Int)
{
sc.MustGetNumber ();
props.*EAXFields[i].Int = (j = clamp (sc.Number,
EAXFields[i].Min, EAXFields[i].Max));
props.*ReverbFields[i].Int = (j = clamp (sc.Number,
ReverbFields[i].Min, ReverbFields[i].Max));
if (i == 0 && j != sc.Number)
{
sc.ScriptError ("The Environment field is out of range.");
@ -510,7 +510,7 @@ static void ReadEAX (int lump)
else
{
sc.MustGetString ();
bools[EAXFields[i].Flag] = sc.MustMatchString (BoolNames);
bools[ReverbFields[i].Flag] = sc.MustMatchString (BoolNames);
}
inited[i] = true;
}
@ -522,27 +522,27 @@ static void ReadEAX (int lump)
// Add the new environment to the list, filling in uninitialized fields
// with values from the standard environment specified.
def = DefaultEnvironments[props.Environment];
for (i = 0; i < NUM_EAX_FIELDS; ++i)
for (i = 0; i < NUM_REVERB_FIELDS; ++i)
{
if (EAXFields[i].Float)
if (ReverbFields[i].Float)
{
if (!inited[i])
{
props.*EAXFields[i].Float = def->Properties.*EAXFields[i].Float;
props.*ReverbFields[i].Float = def->Properties.*ReverbFields[i].Float;
}
}
else if (EAXFields[i].Int)
else if (ReverbFields[i].Int)
{
if (!inited[i])
{
props.*EAXFields[i].Int = def->Properties.*EAXFields[i].Int;
props.*ReverbFields[i].Int = def->Properties.*ReverbFields[i].Int;
}
}
else
{
if (!inited[i])
{
int mask = 1 << EAXFields[i].Flag;
int mask = 1 << ReverbFields[i].Flag;
if (def->Properties.Flags & mask)
{
props.Flags |= mask;
@ -550,9 +550,9 @@ static void ReadEAX (int lump)
}
else
{
if (bools[EAXFields[i].Flag])
if (bools[ReverbFields[i].Flag])
{
props.Flags |= 1 << EAXFields[i].Flag;
props.Flags |= 1 << ReverbFields[i].Flag;
}
}
}
@ -568,19 +568,19 @@ static void ReadEAX (int lump)
}
}
void S_ParseSndEax ()
void S_ParseReverbDef ()
{
int lump, lastlump = 0;
atterm (S_UnloadSndEax);
atterm (S_UnloadReverbDef);
while ((lump = Wads.FindLump ("SNDEAX", &lastlump)) != -1)
while ((lump = Wads.FindLump ("REVERBS", &lastlump)) != -1)
{
ReadEAX (lump);
ReadReverbDef (lump);
}
}
void S_UnloadSndEax ()
void S_UnloadReverbDef ()
{
ReverbContainer *probe = Environments;

View file

@ -291,7 +291,7 @@ void S_InitData ()
LastLocalSndInfo = LastLocalSndSeq = "";
S_ParseSndInfo ();
S_ParseSndSeq (-1);
S_ParseSndEax ();
S_ParseReverbDef ();
}
//==========================================================================

View file

@ -219,8 +219,8 @@ void S_UpdateSounds (void *listener);
// [RH] S_sfx "maintenance" routines
void S_ParseSndInfo ();
void S_ParseSndEax ();
void S_UnloadSndEax ();
void S_ParseReverbDef ();
void S_UnloadReverbDef ();
void S_HashSounds ();
int S_FindSound (const char *logicalname);

View file

@ -1348,7 +1348,7 @@ void ShowEAXEditor ()
EAXEditWindow = CreateDialog (g_hInst, MAKEINTRESOURCE(IDD_EAXEDIT), Window, EAXProc);
}
CCMD (eaxedit)
CCMD (reverbedit)
{
if (EAXEditWindow != 0)
{

View file

@ -327,7 +327,7 @@ END
IDD_EAXEDIT DIALOGEX 0, 0, 280, 326
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE
CAPTION "EAX Environment Editor"
CAPTION "Environment Editor"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
COMBOBOX IDC_CURRENTENVIRONMENT,7,19,265,14,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
@ -346,7 +346,7 @@ END
IDD_NEWEAX DIALOGEX 0, 0, 348, 257
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Create New EAX Environment..."
CAPTION "Create New Environment..."
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
EDITTEXT IDC_NEWENVNAME,32,216,187,12,ES_AUTOHSCROLL

View file

@ -142,7 +142,7 @@
>
</File>
<File
RelativePath=".\sndeax.txt"
RelativePath=".\reverbs.txt"
>
</File>
<File

View file

@ -222,7 +222,7 @@ textures/-noflat-.png noflat.png
sndinfo.txt sndinfo.txt
sndseq.txt sndseq.txt
sndeax.txt sndeax.txt
reverbs.txt reverbs.txt
--------