mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- removed all remains of the old EAX editor.
This commit is contained in:
parent
1ed1b42c21
commit
57058ef727
7 changed files with 485 additions and 877 deletions
|
@ -474,7 +474,6 @@ endif()
|
|||
# Start defining source files for ZDoom
|
||||
set( PLAT_WIN32_SOURCES
|
||||
sound/mididevices/music_win_mididevice.cpp
|
||||
win32/eaxedit.cpp
|
||||
win32/critsec.cpp
|
||||
win32/fb_d3d9.cpp
|
||||
win32/fb_d3d9_wipe.cpp
|
||||
|
|
|
@ -744,7 +744,7 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds)
|
|||
dclick = false;
|
||||
|
||||
// This used level.time which didn't work outside a level.
|
||||
nowtime = I_msTime();
|
||||
nowtime = (unsigned)I_msTime();
|
||||
if (doublebinds != NULL && int(DClickTime[ev->data1] - nowtime) > 0 && ev->type == EV_KeyDown)
|
||||
{
|
||||
// Key pressed for a double click
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
**
|
||||
**---------------------------------------------------------------------------
|
||||
** Copyright 2005-2016 Randy Heit
|
||||
** Copyright 2005-2016 Christoph Oelckers
|
||||
** Copyright 2005-2017 Christoph Oelckers
|
||||
** All rights reserved.
|
||||
**
|
||||
** Redistribution and use in source and binary forms, with or without
|
||||
|
@ -41,7 +41,19 @@
|
|||
#include "w_wad.h"
|
||||
#include "i_system.h"
|
||||
|
||||
#include "c_cvars.h"
|
||||
#include "c_dispatch.h"
|
||||
#include "files.h"
|
||||
#include "vm.h"
|
||||
#include "dobject.h"
|
||||
#include "menu/menu.h"
|
||||
|
||||
|
||||
|
||||
void InitReverbMenu();
|
||||
REVERB_PROPERTIES SavedProperties;
|
||||
ReverbContainer *CurrentEnv;
|
||||
extern ReverbContainer *ForcedEnvironment;
|
||||
|
||||
struct FReverbField
|
||||
{
|
||||
|
@ -51,6 +63,7 @@ struct FReverbField
|
|||
unsigned int Flag;
|
||||
};
|
||||
|
||||
|
||||
static const FReverbField ReverbFields[] =
|
||||
{
|
||||
{ 0, 25, 0, &REVERB_PROPERTIES::Environment, 0 },
|
||||
|
@ -656,3 +669,373 @@ void S_UnloadReverbDef ()
|
|||
}
|
||||
Environments = &Off;
|
||||
}
|
||||
|
||||
CUSTOM_CVAR(Bool, eaxedit_test, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
ForcedEnvironment = CurrentEnv;
|
||||
}
|
||||
else
|
||||
{
|
||||
ForcedEnvironment = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
struct EnvFlag
|
||||
{
|
||||
const char *Name;
|
||||
int CheckboxControl;
|
||||
unsigned int Flag;
|
||||
};
|
||||
|
||||
inline int HIBYTE(int i)
|
||||
{
|
||||
return (i >> 8) & 255;
|
||||
}
|
||||
|
||||
inline int LOBYTE(int i)
|
||||
{
|
||||
return i & 255;
|
||||
}
|
||||
|
||||
uint16_t FirstFreeID(uint16_t base, bool builtin)
|
||||
{
|
||||
int tryCount = 0;
|
||||
int priID = HIBYTE(base);
|
||||
|
||||
// If the original sound is built-in, start searching for a new
|
||||
// primary ID at 30.
|
||||
if (builtin)
|
||||
{
|
||||
for (priID = 30; priID < 256; ++priID)
|
||||
{
|
||||
if (S_FindEnvironment(priID << 8) == nullptr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (priID == 256)
|
||||
{ // Oh well.
|
||||
priID = 30;
|
||||
}
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
uint16_t lastID = Environments->ID;
|
||||
const ReverbContainer *env = Environments->Next;
|
||||
|
||||
// Find the lowest-numbered free ID with the same primary ID as base
|
||||
// If none are available, add 100 to base's primary ID and try again.
|
||||
// If that fails, then the primary ID gets incremented
|
||||
// by 1 until a match is found. If all the IDs searchable by this
|
||||
// algorithm are in use, then you're in trouble.
|
||||
|
||||
while (env != nullptr)
|
||||
{
|
||||
if (HIBYTE(env->ID) > priID)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (HIBYTE(env->ID) == priID)
|
||||
{
|
||||
if (HIBYTE(lastID) == priID)
|
||||
{
|
||||
if (LOBYTE(env->ID) - LOBYTE(lastID) > 1)
|
||||
{
|
||||
return lastID + 1;
|
||||
}
|
||||
}
|
||||
lastID = env->ID;
|
||||
}
|
||||
env = env->Next;
|
||||
}
|
||||
if (LOBYTE(lastID) == 255)
|
||||
{
|
||||
if (tryCount == 0)
|
||||
{
|
||||
base += 100 * 256;
|
||||
tryCount = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
base += 256;
|
||||
}
|
||||
}
|
||||
else if (builtin && lastID == 0)
|
||||
{
|
||||
return priID << 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
return lastID + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FString SuggestNewName(const ReverbContainer *env)
|
||||
{
|
||||
const ReverbContainer *probe = nullptr;
|
||||
char text[32];
|
||||
size_t len;
|
||||
int number, numdigits;
|
||||
|
||||
strncpy(text, env->Name, 31);
|
||||
text[31] = 0;
|
||||
|
||||
len = strlen(text);
|
||||
while (text[len - 1] >= '0' && text[len - 1] <= '9')
|
||||
{
|
||||
len--;
|
||||
}
|
||||
number = atoi(text + len);
|
||||
if (number < 1)
|
||||
{
|
||||
number = 1;
|
||||
}
|
||||
|
||||
if (text[len - 1] != ' ' && len < 31)
|
||||
{
|
||||
text[len++] = ' ';
|
||||
}
|
||||
|
||||
for (; number < 100000; ++number)
|
||||
{
|
||||
if (number < 10) numdigits = 1;
|
||||
else if (number < 100) numdigits = 2;
|
||||
else if (number < 1000) numdigits = 3;
|
||||
else if (number < 10000)numdigits = 4;
|
||||
else numdigits = 5;
|
||||
if (len + numdigits > 31)
|
||||
{
|
||||
len = 31 - numdigits;
|
||||
}
|
||||
mysnprintf(text + len, countof(text) - len, "%d", number);
|
||||
|
||||
probe = Environments;
|
||||
while (probe != nullptr)
|
||||
{
|
||||
if (stricmp(probe->Name, text) == 0)
|
||||
break;
|
||||
probe = probe->Next;
|
||||
}
|
||||
if (probe == nullptr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
void ExportEnvironments(const char *filename, uint32_t count, const ReverbContainer **envs)
|
||||
{
|
||||
FileWriter *f = FileWriter::Open("filename");
|
||||
|
||||
if (f != nullptr)
|
||||
{
|
||||
for (uint32_t i = 0; i < count; ++i)
|
||||
{
|
||||
const ReverbContainer *env = envs[i];
|
||||
const ReverbContainer *base;
|
||||
size_t j;
|
||||
|
||||
if ((unsigned int)env->Properties.Environment < 26)
|
||||
{
|
||||
base = DefaultEnvironments[env->Properties.Environment];
|
||||
}
|
||||
else
|
||||
{
|
||||
base = nullptr;
|
||||
}
|
||||
f->Printf("\"%s\" %u %u\n{\n", env->Name, HIBYTE(env->ID), LOBYTE(env->ID));
|
||||
for (j = 0; j < countof(ReverbFields); ++j)
|
||||
{
|
||||
const FReverbField *ctl = &ReverbFields[j];
|
||||
const char *ctlName = ReverbFieldNames[j];
|
||||
if (ctlName)
|
||||
{
|
||||
if (j == 0 ||
|
||||
(ctl->Float && base->Properties.*ctl->Float != env->Properties.*ctl->Float) ||
|
||||
(ctl->Int && base->Properties.*ctl->Int != env->Properties.*ctl->Int))
|
||||
{
|
||||
f->Printf("\t%s ", ctlName);
|
||||
if (ctl->Float)
|
||||
{
|
||||
float v = env->Properties.*ctl->Float * 1000;
|
||||
int vi = int(v >= 0.0 ? v + 0.5 : v - 0.5);
|
||||
f->Printf("%d.%03d\n", vi / 1000, abs(vi % 1000));
|
||||
}
|
||||
else
|
||||
{
|
||||
f->Printf("%d\n", env->Properties.*ctl->Int);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((1 << ctl->Flag) & (env->Properties.Flags ^ base->Properties.Flags))
|
||||
{
|
||||
f->Printf("\t%s %s\n", ctlName, ctl->Flag & env->Properties.Flags ? "true" : "false");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
f->Printf("}\n\n");
|
||||
}
|
||||
delete f;
|
||||
}
|
||||
else
|
||||
{
|
||||
M_StartMessage("Save failed", 1);
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DReverbEdit, GetValue)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_INT(index);
|
||||
ACTION_RETURN_FLOAT(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DReverbEdit, SetValue)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_INT(index);
|
||||
PARAM_FLOAT(value);
|
||||
ACTION_RETURN_FLOAT(value);
|
||||
return 1;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DReverbEdit, GrayCheck)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
ACTION_RETURN_BOOL(CurrentEnv->Builtin);
|
||||
return 1;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DReverbEdit, GetSelectedEnvironment)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
if (numret > 1)
|
||||
{
|
||||
numret = 2;
|
||||
ret[1].SetInt(CurrentEnv ? CurrentEnv->ID : -1);
|
||||
}
|
||||
if (numret > 0)
|
||||
{
|
||||
ret[0].SetString(CurrentEnv ? CurrentEnv->Name : "");
|
||||
}
|
||||
return numret;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DReverbEdit, FillSelectMenu)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_STRING(ccmd);
|
||||
PARAM_OBJECT(desc, DOptionMenuDescriptor);
|
||||
desc->mItems.Clear();
|
||||
for (auto env = Environments; env != nullptr; env = env->Next)
|
||||
{
|
||||
FStringf text("(%d, %d) %s", HIBYTE(env->ID), LOBYTE(env->ID), env->Name);
|
||||
FStringf cmd("%s \"%s\"", ccmd.GetChars(), env->Name);
|
||||
PClass *cls = PClass::FindClass("OptionMenuItemCommand");
|
||||
if (cls != nullptr && cls->IsDescendantOf("OptionMenuItem"))
|
||||
{
|
||||
auto func = dyn_cast<PFunction>(cls->FindSymbol("Init", true));
|
||||
if (func != nullptr)
|
||||
{
|
||||
DMenuItemBase *item = (DMenuItemBase*)cls->CreateNew();
|
||||
VMValue params[] = { item, &text, FName(cmd).GetIndex(), false, true };
|
||||
VMCall(func->Variants[0].Implementation, params, 5, nullptr, 0);
|
||||
desc->mItems.Push((DMenuItemBase*)item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// These are for internal use only and not supposed to be user-settable
|
||||
CVAR(String, reverbedit_name, "", CVAR_NOSET);
|
||||
CVAR(Int, reverbedit_id1, 0, CVAR_NOSET);
|
||||
CVAR(Int, reverbedit_id2, 0, CVAR_NOSET);
|
||||
|
||||
static void SelectEnvironment(const char *envname)
|
||||
{
|
||||
for (auto env = Environments; env != nullptr; env = env->Next)
|
||||
{
|
||||
if (!strcmp(env->Name, envname))
|
||||
{
|
||||
CurrentEnv = env;
|
||||
SavedProperties = env->Properties;
|
||||
if (eaxedit_test) ForcedEnvironment = env;
|
||||
|
||||
// Set up defaults for a new environment based on this one.
|
||||
int newid = FirstFreeID(env->ID, env->Builtin);
|
||||
UCVarValue cv;
|
||||
cv.Int = HIBYTE(newid);
|
||||
reverbedit_id1.ForceSet(cv, CVAR_Int);
|
||||
cv.Int = LOBYTE(newid);
|
||||
reverbedit_id2.ForceSet(cv, CVAR_Int);
|
||||
FString selectname = SuggestNewName(env);
|
||||
cv.String = selectname.GetChars();
|
||||
reverbedit_name.ForceSet(cv, CVAR_String);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InitReverbMenu()
|
||||
{
|
||||
// Make sure that the editor's variables are properly initialized.
|
||||
SelectEnvironment("Off");
|
||||
}
|
||||
|
||||
CCMD(selectenvironment)
|
||||
{
|
||||
if (argv.argc() > 1)
|
||||
{
|
||||
auto str = argv[1];
|
||||
SelectEnvironment(str);
|
||||
}
|
||||
else
|
||||
InitReverbMenu();
|
||||
}
|
||||
|
||||
CCMD(revertenvironment)
|
||||
{
|
||||
if (CurrentEnv != nullptr)
|
||||
{
|
||||
CurrentEnv->Properties = SavedProperties;
|
||||
}
|
||||
}
|
||||
|
||||
CCMD(createenvironment)
|
||||
{
|
||||
if (S_FindEnvironment(reverbedit_name))
|
||||
{
|
||||
M_StartMessage(FStringf("An environment with the name '%s' already exists", *reverbedit_name), 1);
|
||||
return;
|
||||
}
|
||||
int id = (reverbedit_id1 * 255) + reverbedit_id2;
|
||||
if (S_FindEnvironment(id))
|
||||
{
|
||||
M_StartMessage(FStringf("An environment with the ID (%d, %d) already exists", *reverbedit_id1, *reverbedit_id2), 1);
|
||||
return;
|
||||
}
|
||||
|
||||
auto newenv = new ReverbContainer;
|
||||
newenv->Builtin = false;
|
||||
newenv->ID = id;
|
||||
newenv->Name = copystring(reverbedit_name);
|
||||
newenv->Next = nullptr;
|
||||
newenv->Properties = CurrentEnv->Properties;
|
||||
S_AddEnvironment(newenv);
|
||||
SelectEnvironment(newenv->Name);
|
||||
}
|
||||
|
||||
CCMD(reverbedit)
|
||||
{
|
||||
C_DoCommand("openmenu reverbedit");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,758 +0,0 @@
|
|||
/*
|
||||
**
|
||||
**
|
||||
**---------------------------------------------------------------------------
|
||||
** Copyright 2005-2016 Randy Heit
|
||||
** All rights reserved.
|
||||
**
|
||||
** Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions
|
||||
** are met:
|
||||
**
|
||||
** 1. Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** 2. Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in the
|
||||
** documentation and/or other materials provided with the distribution.
|
||||
** 3. The name of the author may not be used to endorse or promote products
|
||||
** derived from this software without specific prior written permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
**---------------------------------------------------------------------------
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "resource.h"
|
||||
#include "s_sound.h"
|
||||
#include "templates.h"
|
||||
#include "cmdlib.h"
|
||||
#include "c_dispatch.h"
|
||||
#include "c_cvars.h"
|
||||
#include "doomstat.h"
|
||||
#include "v_video.h"
|
||||
#include "c_cvars.h"
|
||||
#include "vm.h"
|
||||
#include "symbols.h"
|
||||
#include "menu/menu.h"
|
||||
|
||||
|
||||
REVERB_PROPERTIES SavedProperties;
|
||||
ReverbContainer *CurrentEnv;
|
||||
extern ReverbContainer *ForcedEnvironment;
|
||||
|
||||
CUSTOM_CVAR (Bool, eaxedit_test, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
ForcedEnvironment = CurrentEnv;
|
||||
}
|
||||
else
|
||||
{
|
||||
ForcedEnvironment = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
struct MySaveData
|
||||
{
|
||||
const ReverbContainer *Default;
|
||||
const ReverbContainer **Saves;
|
||||
uint32_t NumSaves;
|
||||
|
||||
MySaveData (const ReverbContainer *def)
|
||||
: Default (def), Saves (nullptr), NumSaves (0) {}
|
||||
~MySaveData ()
|
||||
{
|
||||
if (Saves) delete[] Saves;
|
||||
}
|
||||
};
|
||||
|
||||
struct EnvControl
|
||||
{
|
||||
const char *Name;
|
||||
int EditControl;
|
||||
int SliderControl;
|
||||
int Min;
|
||||
int Max;
|
||||
float REVERB_PROPERTIES::*Float;
|
||||
int REVERB_PROPERTIES::*Int;
|
||||
HWND EditHWND;
|
||||
HWND SliderHWND;
|
||||
};
|
||||
|
||||
struct EnvFlag
|
||||
{
|
||||
const char *Name;
|
||||
int CheckboxControl;
|
||||
unsigned int Flag;
|
||||
};
|
||||
|
||||
EnvControl EnvControls[] =
|
||||
{
|
||||
{ "Environment", 0, 0, 0, 25, 0, &REVERB_PROPERTIES::Environment },
|
||||
{ "EnvironmentSize", IDCE_ENVIRONMENTSIZE, IDCS_ENVIRONMENTSIZE, 1000, 100000, &REVERB_PROPERTIES::EnvSize, 0 },
|
||||
{ "EnvironmentDiffusion", IDCE_ENVIRONMENTDIFFUSION, IDCS_ENVIRONMENTDIFFUSION, 0, 1000, &REVERB_PROPERTIES::EnvDiffusion, 0 },
|
||||
{ "Room", IDCE_ROOM, IDCS_ROOM, -10000, 0, 0, &REVERB_PROPERTIES::Room },
|
||||
{ "RoomHF", IDCE_ROOMHF, IDCS_ROOMHF, -10000, 0, 0, &REVERB_PROPERTIES::RoomHF },
|
||||
{ "RoomLF", IDCE_ROOMLF, IDCS_ROOMLF, -10000, 0, 0, &REVERB_PROPERTIES::RoomLF },
|
||||
{ "DecayTime", IDCE_DECAYTIME, IDCS_DECAYTIME, 100, 20000, &REVERB_PROPERTIES::DecayTime, 0 },
|
||||
{ "DecayHFRatio", IDCE_DECAYHFRATIO, IDCS_DECAYHFRATIO, 100, 2000, &REVERB_PROPERTIES::DecayHFRatio, 0 },
|
||||
{ "DecayLFRatio", IDCE_DECAYLFRATIO, IDCS_DECAYLFRATIO, 100, 2000, &REVERB_PROPERTIES::DecayLFRatio, 0 },
|
||||
{ "Reflections", IDCE_REFLECTIONS, IDCS_REFLECTIONS, -10000, 1000, 0, &REVERB_PROPERTIES::Reflections },
|
||||
{ "ReflectionsDelay", IDCE_REFLECTIONSDELAY, IDCS_REFLECTIONSDELAY, 0, 300, &REVERB_PROPERTIES::ReflectionsDelay, 0 },
|
||||
{ "ReflectionsPanX", IDCE_REFLECTIONSPANX, IDCS_REFLECTIONSPANX, -2000000, 2000000, &REVERB_PROPERTIES::ReflectionsPan0, 0 },
|
||||
{ "ReflectionsPanY", IDCE_REFLECTIONSPANY, IDCS_REFLECTIONSPANY, -2000000, 2000000, &REVERB_PROPERTIES::ReflectionsPan1, 0 },
|
||||
{ "ReflectionsPanZ", IDCE_REFLECTIONSPANZ, IDCS_REFLECTIONSPANZ, -2000000, 2000000, &REVERB_PROPERTIES::ReflectionsPan2, 0 },
|
||||
{ "Reverb", IDCE_REVERB, IDCS_REVERB, -10000, 2000, 0, &REVERB_PROPERTIES::Reverb },
|
||||
{ "ReverbDelay", IDCE_REVERBDELAY, IDCS_REVERBDELAY, 0, 100, &REVERB_PROPERTIES::ReverbDelay, 0 },
|
||||
{ "ReverbPanX", IDCE_REVERBPANX, IDCS_REVERBPANX, -2000000, 2000000, &REVERB_PROPERTIES::ReverbPan0, 0 },
|
||||
{ "ReverbPanY", IDCE_REVERBPANY, IDCS_REVERBPANY, -2000000, 2000000, &REVERB_PROPERTIES::ReverbPan1, 0 },
|
||||
{ "ReverbPanZ", IDCE_REVERBPANZ, IDCS_REVERBPANZ, -2000000, 2000000, &REVERB_PROPERTIES::ReverbPan2, 0 },
|
||||
{ "EchoTime", IDCE_ECHOTIME, IDCS_ECHOTIME, 75, 250, &REVERB_PROPERTIES::EchoTime, 0 },
|
||||
{ "EchoDepth", IDCE_ECHODEPTH, IDCS_ECHODEPTH, 0, 1000, &REVERB_PROPERTIES::EchoDepth, 0 },
|
||||
{ "ModulationTime", IDCE_MODULATIONTIME, IDCS_MODULATIONTIME, 40, 4000, &REVERB_PROPERTIES::ModulationTime, 0 },
|
||||
{ "ModulationDepth", IDCE_MODULATIONDEPTH, IDCS_MODULATIONDEPTH, 0, 1000, &REVERB_PROPERTIES::ModulationDepth, 0 },
|
||||
{ "AirAbsorptionHF", IDCE_AIRABSORPTIONHF, IDCS_AIRABSORPTIONHF, -100000, 0, &REVERB_PROPERTIES::AirAbsorptionHF, 0 },
|
||||
{ "HFReference", IDCE_HFREFERENCE, IDCS_HFREFERENCE, 1000000, 20000000, &REVERB_PROPERTIES::HFReference, 0 },
|
||||
{ "LFReference", IDCE_LFREFERENCE, IDCS_LFREFERENCE, 20000, 1000000, &REVERB_PROPERTIES::LFReference, 0 },
|
||||
{ "RoomRolloffFactor", IDCE_ROOMROLLOFFFACTOR, IDCS_ROOMROLLOFFFACTOR, 0, 10000, &REVERB_PROPERTIES::RoomRolloffFactor, 0 },
|
||||
{ "Diffusion", 0, 0, 0, 100000, &REVERB_PROPERTIES::Diffusion, 0 },
|
||||
{ "Density", 0, 0, 0, 100000, &REVERB_PROPERTIES::Density, 0 },
|
||||
};
|
||||
|
||||
EnvFlag EnvFlags[] =
|
||||
{
|
||||
{ "bReflectionsScale", IDC_REFLECTIONSSCALE, REVERB_FLAGS_REFLECTIONSSCALE },
|
||||
{ "bReflectionsDelayScale", IDC_REFLECTIONSDELAYSCALE, REVERB_FLAGS_REFLECTIONSDELAYSCALE },
|
||||
{ "bDecayTimeScale", IDC_DECAYTIMESCALE, REVERB_FLAGS_DECAYTIMESCALE },
|
||||
{ "bDecayHFLimit", IDC_DECAYHFLIMIT, REVERB_FLAGS_DECAYHFLIMIT },
|
||||
{ "bReverbScale", IDC_REVERBSCALE, REVERB_FLAGS_REVERBSCALE },
|
||||
{ "bReverbDelayScale", IDC_REVERBDELAYSCALE, REVERB_FLAGS_REVERBDELAYSCALE },
|
||||
{ "bEchoTimeScale", IDC_ECHOTIMESCALE, REVERB_FLAGS_ECHOTIMESCALE },
|
||||
{ "bModulationTimeScale", IDC_MODULATIONTIMESCALE, REVERB_FLAGS_MODULATIONTIMESCALE }
|
||||
};
|
||||
|
||||
inline int HIBYTE(int i)
|
||||
{
|
||||
return (i >> 8) & 255;
|
||||
}
|
||||
|
||||
inline int LOBYTE(int i)
|
||||
{
|
||||
return i & 255;
|
||||
}
|
||||
|
||||
uint16_t FirstFreeID (uint16_t base, bool builtin)
|
||||
{
|
||||
int tryCount = 0;
|
||||
int priID = HIBYTE(base);
|
||||
|
||||
// If the original sound is built-in, start searching for a new
|
||||
// primary ID at 30.
|
||||
if (builtin)
|
||||
{
|
||||
for (priID = 30; priID < 256; ++priID)
|
||||
{
|
||||
if (S_FindEnvironment (priID << 8) == nullptr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (priID == 256)
|
||||
{ // Oh well.
|
||||
priID = 30;
|
||||
}
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
uint16_t lastID = Environments->ID;
|
||||
const ReverbContainer *env = Environments->Next;
|
||||
|
||||
// Find the lowest-numbered free ID with the same primary ID as base
|
||||
// If none are available, add 100 to base's primary ID and try again.
|
||||
// If that fails, then the primary ID gets incremented
|
||||
// by 1 until a match is found. If all the IDs searchable by this
|
||||
// algorithm are in use, then you're in trouble.
|
||||
|
||||
while (env != nullptr)
|
||||
{
|
||||
if (HIBYTE(env->ID) > priID)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (HIBYTE(env->ID) == priID)
|
||||
{
|
||||
if (HIBYTE(lastID) == priID)
|
||||
{
|
||||
if (LOBYTE(env->ID) - LOBYTE(lastID) > 1)
|
||||
{
|
||||
return lastID+1;
|
||||
}
|
||||
}
|
||||
lastID = env->ID;
|
||||
}
|
||||
env = env->Next;
|
||||
}
|
||||
if (LOBYTE(lastID) == 255)
|
||||
{
|
||||
if (tryCount == 0)
|
||||
{
|
||||
base += 100*256;
|
||||
tryCount = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
base += 256;
|
||||
}
|
||||
}
|
||||
else if (builtin && lastID == 0)
|
||||
{
|
||||
return priID << 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
return lastID+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FString SuggestNewName (const ReverbContainer *env)
|
||||
{
|
||||
const ReverbContainer *probe = nullptr;
|
||||
char text[32];
|
||||
size_t len;
|
||||
int number, numdigits;
|
||||
|
||||
strncpy (text, env->Name, 31);
|
||||
text[31] = 0;
|
||||
|
||||
len = strlen (text);
|
||||
while (text[len-1] >= '0' && text[len-1] <= '9')
|
||||
{
|
||||
len--;
|
||||
}
|
||||
number = atoi (text + len);
|
||||
if (number < 1)
|
||||
{
|
||||
number = 1;
|
||||
}
|
||||
|
||||
if (text[len-1] != ' ' && len < 31)
|
||||
{
|
||||
text[len++] = ' ';
|
||||
}
|
||||
|
||||
for (; number < 100000; ++number)
|
||||
{
|
||||
if (number < 10) numdigits = 1;
|
||||
else if (number < 100) numdigits = 2;
|
||||
else if (number < 1000) numdigits = 3;
|
||||
else if (number < 10000)numdigits = 4;
|
||||
else numdigits = 5;
|
||||
if (len + numdigits > 31)
|
||||
{
|
||||
len = 31 - numdigits;
|
||||
}
|
||||
mysnprintf (text + len, countof(text) - len, "%d", number);
|
||||
|
||||
probe = Environments;
|
||||
while (probe != nullptr)
|
||||
{
|
||||
if (stricmp (probe->Name, text) == 0)
|
||||
break;
|
||||
probe = probe->Next;
|
||||
}
|
||||
if (probe == nullptr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
void ExportEnvironments (const char *filename, uint32_t count, const ReverbContainer **envs)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
retry:
|
||||
f = fopen (filename, "w");
|
||||
|
||||
if (f != nullptr)
|
||||
{
|
||||
for (uint32_t i = 0; i < count; ++i)
|
||||
{
|
||||
const ReverbContainer *env = envs[i];
|
||||
const ReverbContainer *base;
|
||||
size_t j;
|
||||
|
||||
if ((unsigned int)env->Properties.Environment < 26)
|
||||
{
|
||||
base = DefaultEnvironments[env->Properties.Environment];
|
||||
}
|
||||
else
|
||||
{
|
||||
base = nullptr;
|
||||
}
|
||||
fprintf (f, "\"%s\" %u %u\n{\n", env->Name, HIBYTE(env->ID), LOBYTE(env->ID));
|
||||
for (j = 0; j < countof(EnvControls); ++j)
|
||||
{
|
||||
const EnvControl *ctl = &EnvControls[j];
|
||||
if (ctl->Name &&
|
||||
(j == 0 ||
|
||||
(ctl->Float && base->Properties.*ctl->Float != env->Properties.*ctl->Float) ||
|
||||
(ctl->Int && base->Properties.*ctl->Int != env->Properties.*ctl->Int))
|
||||
)
|
||||
{
|
||||
fprintf (f, "\t%s ", ctl->Name);
|
||||
if (ctl->Float)
|
||||
{
|
||||
float v = env->Properties.*ctl->Float * 1000;
|
||||
int vi = int(v >= 0.0 ? v + 0.5 : v - 0.5);
|
||||
fprintf (f, "%d.%03d\n", vi/1000, abs(vi%1000));
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (f, "%d\n", env->Properties.*ctl->Int);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (j = 0; j < countof(EnvFlags); ++j)
|
||||
{
|
||||
if (EnvFlags[j].Flag & (env->Properties.Flags ^ base->Properties.Flags))
|
||||
{
|
||||
fprintf (f, "\t%s %s\n", EnvFlags[j].Name,
|
||||
EnvFlags[j].Flag & env->Properties.Flags ? "true" : "false");
|
||||
}
|
||||
}
|
||||
fprintf (f, "}\n\n");
|
||||
}
|
||||
fclose (f);
|
||||
}
|
||||
else
|
||||
{
|
||||
LPVOID lpMsgBuf;
|
||||
FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
nullptr,
|
||||
GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR)&lpMsgBuf,
|
||||
0,
|
||||
nullptr);
|
||||
if (IDRETRY == MessageBox (EAXEditWindow, (LPCTSTR)lpMsgBuf, "Save Failed!", MB_RETRYCANCEL|MB_ICONERROR))
|
||||
{
|
||||
LocalFree (lpMsgBuf);
|
||||
goto retry;
|
||||
}
|
||||
LocalFree (lpMsgBuf);
|
||||
}
|
||||
}
|
||||
|
||||
void SaveEnvironments (HWND owner, const ReverbContainer *defEnv)
|
||||
{
|
||||
MySaveData msd (defEnv);
|
||||
OPENFILENAME ofn = { sizeof(ofn) };
|
||||
char filename[PATH_MAX];
|
||||
|
||||
ofn.hwndOwner = owner;
|
||||
ofn.hInstance = g_hInst;
|
||||
ofn.lpstrFilter = "Text Files\0*.txt\0All Files\0*.*\0";
|
||||
ofn.lpstrCustomFilter = nullptr;
|
||||
ofn.nMaxCustFilter = 0;
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrFile = filename;
|
||||
ofn.nMaxFile = sizeof(filename);
|
||||
ofn.lpstrFileTitle = nullptr;
|
||||
ofn.nMaxFileTitle = 0;
|
||||
ofn.lpstrInitialDir = nullptr;
|
||||
ofn.lpstrTitle = "Save EAX Environments As...";
|
||||
ofn.Flags = OFN_ENABLEHOOK|OFN_ENABLESIZING|OFN_ENABLETEMPLATE|OFN_EXPLORER|
|
||||
OFN_NOCHANGEDIR|OFN_OVERWRITEPROMPT;
|
||||
ofn.nFileOffset = 0;
|
||||
ofn.nFileExtension = 0;
|
||||
ofn.lpstrDefExt = "txt";
|
||||
ofn.lCustData = (LPARAM)&msd;
|
||||
ofn.lpfnHook = SaveHookProc;
|
||||
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_SAVEEAX);
|
||||
|
||||
filename[0] = 0;
|
||||
|
||||
if (GetSaveFileName ((tagOFNA *)&ofn) && msd.NumSaves != 0)
|
||||
{
|
||||
ExportEnvironments (filename, msd.NumSaves, msd.Saves);
|
||||
}
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK EAXProc (HWND hDlg, uint32_t uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
SCROLLINFO scrollInfo;
|
||||
HWND hWnd;
|
||||
RECT rect;
|
||||
POINT ul;
|
||||
ReverbContainer *env;
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
hPropList = CreateDialog (g_hInst, MAKEINTRESOURCE(IDD_EAXPROPERTYLIST), hDlg, EAXProp);
|
||||
hWnd = GetDlgItem (hDlg, IDC_DUMMY);
|
||||
GetWindowRect (hPropList, &rect);
|
||||
PropListMaxSize.x = rect.right - rect.left;
|
||||
PropListMaxSize.y = rect.bottom - rect.top;
|
||||
GetWindowRect (hWnd, &rect);
|
||||
DestroyWindow (hWnd);
|
||||
ul.x = rect.left;
|
||||
ul.y = rect.top;
|
||||
ScreenToClient (hDlg, &ul);
|
||||
PropListMaxSize.x = rect.right - rect.left;
|
||||
|
||||
scrollInfo.cbSize = sizeof(scrollInfo);
|
||||
scrollInfo.fMask = SIF_RANGE|SIF_POS|SIF_PAGE|SIF_DISABLENOSCROLL;
|
||||
scrollInfo.nMin = 0;
|
||||
scrollInfo.nMax = PropListMaxSize.y;
|
||||
scrollInfo.nPos = 0;
|
||||
scrollInfo.nPage = rect.bottom - rect.top;
|
||||
SetScrollInfo (hPropList, SB_VERT, &scrollInfo, TRUE);
|
||||
|
||||
MoveWindow (hPropList, ul.x, ul.y, PropListMaxSize.x, rect.bottom - rect.top, FALSE);
|
||||
ShowWindow (hPropList, SW_SHOW);
|
||||
|
||||
// Windows should have a layout control like MUI so that I don't have
|
||||
// to do any extra work to make the dialog resizable.
|
||||
|
||||
GetClientRect (hDlg, &rect);
|
||||
PropListHeightDiff = (rect.bottom - rect.top) - scrollInfo.nPage;
|
||||
|
||||
// Using a scroll bar to create a size box seems like an odd way of
|
||||
// doing things.
|
||||
|
||||
hWnd = CreateWindow(
|
||||
"Scrollbar",
|
||||
(LPSTR)nullptr,
|
||||
WS_CHILD | WS_VISIBLE | SBS_SIZEGRIP | SBS_SIZEBOXBOTTOMRIGHTALIGN | WS_CLIPSIBLINGS,
|
||||
0,0,rect.right,rect.bottom,
|
||||
hDlg,
|
||||
(HMENU)IDC_SIZEBOX,
|
||||
g_hInst,
|
||||
nullptr);
|
||||
|
||||
TestLocation.x = DoneLocation.x = rect.right;
|
||||
TestLocation.y = DoneLocation.y = rect.bottom;
|
||||
GetWindowRect (GetDlgItem (hDlg, IDOK), &rect);
|
||||
ScreenToClient (hDlg, (LPPOINT)&rect.left);
|
||||
DoneLocation.x -= rect.left;
|
||||
DoneLocation.y -= rect.top;
|
||||
|
||||
GetWindowRect (GetDlgItem (hDlg, IDC_TESTEAX), &rect);
|
||||
ScreenToClient (hDlg, (LPPOINT)&rect.left);
|
||||
TestLocation.x -= rect.left;
|
||||
TestLocation.y -= rect.top;
|
||||
|
||||
GetWindowRect (hDlg, &rect);
|
||||
EditWindowSize.x = rect.right - rect.left;
|
||||
EditWindowSize.y = (rect.bottom - rect.top) - scrollInfo.nPage;
|
||||
|
||||
GetWindowRect (GetDlgItem (hDlg, IDC_NEW), &rect);
|
||||
ScreenToClient (hDlg, (LPPOINT)&rect.left);
|
||||
NewLeft = rect.left;
|
||||
|
||||
GetWindowRect (GetDlgItem (hDlg, IDC_SAVE), &rect);
|
||||
ScreenToClient (hDlg, (LPPOINT)&rect.left);
|
||||
SaveLeft = rect.left;
|
||||
|
||||
GetWindowRect (GetDlgItem (hDlg, IDC_REVERT), &rect);
|
||||
ScreenToClient (hDlg, (LPPOINT)&rect.left);
|
||||
RevertLeft = rect.left;
|
||||
|
||||
hWnd = GetDlgItem (hDlg, IDC_CURRENTENVIRONMENT);
|
||||
PopulateEnvDropDown (hWnd, IsDlgButtonChecked (hDlg, IDC_SHOWIDS)==BST_CHECKED, nullptr);
|
||||
EAXProc (hDlg, WM_COMMAND, MAKELONG(IDC_CURRENTENVIRONMENT,CBN_SELENDOK), (LPARAM)hWnd);
|
||||
|
||||
CheckDlgButton (hDlg, IDC_TESTEAX, eaxedit_test ? BST_CHECKED : BST_UNCHECKED);
|
||||
return 0;
|
||||
|
||||
case WM_SIZE:
|
||||
if (wParam != SIZE_MAXHIDE && wParam != SIZE_MAXSHOW)
|
||||
{
|
||||
GetClientRect (hWnd = GetDlgItem (hDlg, IDC_SIZEBOX), &rect);
|
||||
SetWindowPos (hWnd, HWND_BOTTOM, LOWORD(lParam)-rect.right, HIWORD(lParam)-rect.bottom, 0, 0, SWP_NOSIZE);
|
||||
|
||||
SetWindowPos (hPropList, nullptr, 0, 0, PropListMaxSize.x, HIWORD(lParam)-PropListHeightDiff, SWP_NOMOVE|SWP_NOZORDER|SWP_NOOWNERZORDER|SWP_DEFERERASE);
|
||||
SetWindowPos (GetDlgItem (hDlg, IDOK), nullptr, LOWORD(lParam)-DoneLocation.x, HIWORD(lParam)-DoneLocation.y, 0, 0, SWP_NOZORDER|SWP_NOOWNERZORDER|SWP_NOSIZE);
|
||||
SetWindowPos (GetDlgItem (hDlg, IDC_NEW), nullptr, NewLeft, HIWORD(lParam)-DoneLocation.y, 0, 0, SWP_NOZORDER|SWP_NOOWNERZORDER|SWP_NOSIZE);
|
||||
SetWindowPos (GetDlgItem (hDlg, IDC_SAVE), nullptr, SaveLeft, HIWORD(lParam)-DoneLocation.y, 0, 0, SWP_NOZORDER|SWP_NOOWNERZORDER|SWP_NOSIZE);
|
||||
SetWindowPos (GetDlgItem (hDlg, IDC_REVERT), nullptr, RevertLeft, HIWORD(lParam)-DoneLocation.y, 0, 0, SWP_NOZORDER|SWP_NOOWNERZORDER|SWP_NOSIZE);
|
||||
SetWindowPos (GetDlgItem (hDlg, IDC_TESTEAX), nullptr, LOWORD(lParam)-TestLocation.x, HIWORD(lParam)-TestLocation.y, 0, 0, SWP_NOZORDER|SWP_NOOWNERZORDER|SWP_NOSIZE);
|
||||
}
|
||||
return 0;
|
||||
|
||||
case WM_NCDESTROY:
|
||||
EAXEditWindow = 0;
|
||||
//new FS_Switcher;
|
||||
ForceWindowed = false;
|
||||
if (fullscreen)
|
||||
{
|
||||
setmodeneeded = true;
|
||||
}
|
||||
ForcedEnvironment = nullptr;
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
DestroyWindow (hPropList);
|
||||
DestroyWindow (hDlg);
|
||||
return 1;
|
||||
|
||||
case IDC_NEW:
|
||||
hWnd = GetDlgItem (hDlg, IDC_CURRENTENVIRONMENT);
|
||||
env = (ReverbContainer *)DialogBoxParam (g_hInst,
|
||||
MAKEINTRESOURCE(IDD_NEWEAX), hDlg, NewEAXProc,
|
||||
SendMessage (hWnd, CB_GETITEMDATA,
|
||||
SendMessage (hWnd, CB_GETCURSEL, 0, 0), 0));
|
||||
if (env != nullptr)
|
||||
{
|
||||
LRESULT i = AddEnvToDropDown (hWnd,
|
||||
SendMessage (GetDlgItem (hDlg, IDC_SHOWIDS), BM_GETCHECK, 0, 0)==BST_CHECKED,
|
||||
env);
|
||||
SendMessage (hWnd, CB_SETCURSEL, i, 0);
|
||||
UpdateControls (env, hDlg);
|
||||
|
||||
hWnd = GetDlgItem (hPropList, IDCE_ENVIRONMENTSIZE);
|
||||
SetFocus (hWnd);
|
||||
SendMessage (hWnd, EM_SETSEL, 0, -1);
|
||||
}
|
||||
return 0;
|
||||
|
||||
case IDC_REVERT:
|
||||
hWnd = GetDlgItem (hDlg, IDC_CURRENTENVIRONMENT);
|
||||
env = (ReverbContainer *)SendMessage (hWnd, CB_GETITEMDATA,
|
||||
SendMessage (hWnd, CB_GETCURSEL, 0, 0), 0);
|
||||
env->Properties = SavedProperties;
|
||||
UpdateControls (env, hDlg);
|
||||
return 0;
|
||||
|
||||
case IDC_SAVE:
|
||||
hWnd = GetDlgItem (hDlg, IDC_CURRENTENVIRONMENT);
|
||||
SaveEnvironments (hDlg,
|
||||
(ReverbContainer *)SendMessage (hWnd, CB_GETITEMDATA,
|
||||
SendMessage (hWnd, CB_GETCURSEL, 0, 0), 0));
|
||||
return 0;
|
||||
|
||||
case IDC_TESTEAX:
|
||||
if (HIWORD(wParam) == BN_CLICKED)
|
||||
{
|
||||
eaxedit_test = (SendMessage ((HWND)lParam, BM_GETCHECK, 0, 0) == BST_CHECKED);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SHOWIDS:
|
||||
if (HIWORD(wParam) == BN_CLICKED)
|
||||
{
|
||||
hWnd = GetDlgItem (hDlg, IDC_CURRENTENVIRONMENT);
|
||||
PopulateEnvDropDown (hWnd,
|
||||
SendMessage ((HWND)lParam, BM_GETCHECK, 0, 0)==BST_CHECKED,
|
||||
(ReverbContainer *)SendMessage (hWnd, CB_GETITEMDATA,
|
||||
SendMessage (hWnd, CB_GETCURSEL, 0, 0), 0));
|
||||
EAXProc (hDlg, WM_COMMAND, MAKELONG(IDC_CURRENTENVIRONMENT,CBN_SELENDOK),
|
||||
(LPARAM)hWnd);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_CURRENTENVIRONMENT:
|
||||
if (HIWORD(wParam) == CBN_SELENDOK)
|
||||
{
|
||||
env = (ReverbContainer *)SendMessage ((HWND)lParam, CB_GETITEMDATA,
|
||||
SendMessage ((HWND)lParam, CB_GETCURSEL, 0, 0), 0);
|
||||
UpdateControls (env, hDlg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
|
||||
case WM_GETMINMAXINFO:
|
||||
((MINMAXINFO *)lParam)->ptMaxTrackSize.x =
|
||||
((MINMAXINFO *)lParam)->ptMinTrackSize.x = EditWindowSize.x;
|
||||
((MINMAXINFO *)lParam)->ptMaxTrackSize.y = EditWindowSize.y + PropListMaxSize.y + 5;
|
||||
GetClientRect (GetDlgItem (hDlg, IDOK), &rect);
|
||||
((MINMAXINFO *)lParam)->ptMinTrackSize.y = rect.bottom * 10;
|
||||
return 0;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void ShowEAXEditor ()
|
||||
{
|
||||
EAXEditWindow = CreateDialog (g_hInst, MAKEINTRESOURCE(IDD_EAXEDIT), Window, EAXProc);
|
||||
}
|
||||
|
||||
extern int NewWidth, NewHeight, NewBits, DisplayBits;
|
||||
|
||||
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DReverbEdit, GetValue)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_INT(index);
|
||||
ACTION_RETURN_FLOAT(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DReverbEdit, SetValue)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_INT(index);
|
||||
PARAM_FLOAT(value);
|
||||
ACTION_RETURN_FLOAT(value);
|
||||
return 1;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DReverbEdit, GrayCheck)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
ACTION_RETURN_BOOL(CurrentEnv->Builtin);
|
||||
return 1;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DReverbEdit, GetSelectedEnvironment)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
if (numret > 1)
|
||||
{
|
||||
numret = 2;
|
||||
ret[1].SetInt(CurrentEnv ? CurrentEnv->ID : -1);
|
||||
}
|
||||
if (numret > 0)
|
||||
{
|
||||
ret[0].SetString(CurrentEnv ? CurrentEnv->Name : "");
|
||||
}
|
||||
return numret;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DReverbEdit, FillSelectMenu)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_STRING(ccmd);
|
||||
PARAM_OBJECT(desc, DOptionMenuDescriptor);
|
||||
desc->mItems.Clear();
|
||||
for (auto env = Environments; env != nullptr; env = env->Next)
|
||||
{
|
||||
FStringf text("(%d, %d) %s", HIBYTE(env->ID), LOBYTE(env->ID), env->Name);
|
||||
FStringf cmd("%s \"%s\"", ccmd.GetChars(), env->Name);
|
||||
PClass *cls = PClass::FindClass("OptionMenuItemCommand");
|
||||
if (cls != nullptr && cls->IsDescendantOf("OptionMenuItem"))
|
||||
{
|
||||
auto func = dyn_cast<PFunction>(cls->FindSymbol("Init", true));
|
||||
if (func != nullptr)
|
||||
{
|
||||
DMenuItemBase *item = (DMenuItemBase*)cls->CreateNew();
|
||||
VMValue params[] = { item, &text, FName(cmd).GetIndex(), false, true };
|
||||
VMCall(func->Variants[0].Implementation, params, 5, nullptr, 0);
|
||||
desc->mItems.Push((DMenuItemBase*)item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// These are for internal use only and not supposed to be user-settable
|
||||
CVAR(String, reverbedit_name, "", CVAR_NOSET);
|
||||
CVAR(Int, reverbedit_id1, 0, CVAR_NOSET);
|
||||
CVAR(Int, reverbedit_id2, 0, CVAR_NOSET);
|
||||
|
||||
static void SelectEnvironment(const char *envname)
|
||||
{
|
||||
for (auto env = Environments; env != nullptr; env = env->Next)
|
||||
{
|
||||
if (!strcmp(env->Name, envname))
|
||||
{
|
||||
CurrentEnv = env;
|
||||
SavedProperties = env->Properties;
|
||||
if (eaxedit_test) ForcedEnvironment = env;
|
||||
|
||||
// Set up defaults for a new environment based on this one.
|
||||
int newid = FirstFreeID(env->ID, env->Builtin);
|
||||
UCVarValue cv;
|
||||
cv.Int = HIBYTE(newid);
|
||||
reverbedit_id1.ForceSet(cv, CVAR_Int);
|
||||
cv.Int = LOBYTE(newid);
|
||||
reverbedit_id2.ForceSet(cv, CVAR_Int);
|
||||
FString selectname = SuggestNewName(env);
|
||||
cv.String = selectname.GetChars();
|
||||
reverbedit_name.ForceSet(cv, CVAR_String);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InitReverbMenu()
|
||||
{
|
||||
// Make sure that the editor's variables are properly initialized.
|
||||
SelectEnvironment("Off");
|
||||
}
|
||||
|
||||
CCMD(selectenvironment)
|
||||
{
|
||||
if (argv.argc() > 1)
|
||||
{
|
||||
auto str = argv[1];
|
||||
SelectEnvironment(str);
|
||||
}
|
||||
else
|
||||
InitReverbMenu();
|
||||
}
|
||||
|
||||
CCMD(revertenvironment)
|
||||
{
|
||||
if (CurrentEnv != nullptr)
|
||||
{
|
||||
CurrentEnv->Properties = SavedProperties;
|
||||
}
|
||||
}
|
||||
|
||||
CCMD(createenvironment)
|
||||
{
|
||||
if (S_FindEnvironment(reverbedit_name))
|
||||
{
|
||||
M_StartMessage(FStringf("An environment with the name '%s' already exists", *reverbedit_name), 1);
|
||||
return;
|
||||
}
|
||||
int id = (reverbedit_id1 * 255) + reverbedit_id2;
|
||||
if (S_FindEnvironment(id))
|
||||
{
|
||||
M_StartMessage(FStringf("An environment with the ID (%d, %d) already exists", *reverbedit_id1, *reverbedit_id2), 1);
|
||||
return;
|
||||
}
|
||||
|
||||
auto newenv = new ReverbContainer;
|
||||
newenv->Builtin = false;
|
||||
newenv->ID = id;
|
||||
newenv->Name = copystring(reverbedit_name);
|
||||
newenv->Next = nullptr;
|
||||
newenv->Properties = CurrentEnv->Properties;
|
||||
S_AddEnvironment(newenv);
|
||||
SelectEnvironment(newenv->Name);
|
||||
}
|
||||
|
||||
CCMD(reverbedit)
|
||||
{
|
||||
C_DoCommand("openmenu reverbedit");
|
||||
}
|
||||
|
|
@ -130,9 +130,6 @@ FJoystickCollection *JoyDevices[NUM_JOYDEVICES];
|
|||
extern HINSTANCE g_hInst;
|
||||
extern DWORD SessionID;
|
||||
|
||||
extern void ShowEAXEditor ();
|
||||
extern bool SpawnEAXWindow;
|
||||
|
||||
static HMODULE DInputDLL;
|
||||
|
||||
bool GUICapture;
|
||||
|
@ -141,10 +138,8 @@ extern FKeyboard *Keyboard;
|
|||
|
||||
bool VidResizing;
|
||||
|
||||
extern bool SpawnEAXWindow;
|
||||
extern BOOL vidactive;
|
||||
extern HWND Window, ConWindow;
|
||||
extern HWND EAXEditWindow;
|
||||
|
||||
EXTERN_CVAR (String, language)
|
||||
EXTERN_CVAR (Bool, lookstrafe)
|
||||
|
@ -499,12 +494,6 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
|
||||
case WM_KEYDOWN:
|
||||
// When the EAX editor is open, pressing Ctrl+Tab will switch to it
|
||||
if (EAXEditWindow != 0 && wParam == VK_TAB && !(lParam & 0x40000000) &&
|
||||
(GetKeyState (VK_CONTROL) & 0x8000))
|
||||
{
|
||||
SetForegroundWindow (EAXEditWindow);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SYSKEYDOWN:
|
||||
|
@ -530,11 +519,6 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case WM_DISPLAYCHANGE:
|
||||
case WM_STYLECHANGED:
|
||||
if (SpawnEAXWindow)
|
||||
{
|
||||
SpawnEAXWindow = false;
|
||||
ShowEAXEditor ();
|
||||
}
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_GETMINMAXINFO:
|
||||
|
@ -797,14 +781,12 @@ void I_GetEvent ()
|
|||
{
|
||||
if (mess.message == WM_QUIT)
|
||||
exit (mess.wParam);
|
||||
if (EAXEditWindow == 0 || !IsDialogMessage (EAXEditWindow, &mess))
|
||||
|
||||
if (GUICapture)
|
||||
{
|
||||
if (GUICapture)
|
||||
{
|
||||
TranslateMessage (&mess);
|
||||
}
|
||||
DispatchMessage (&mess);
|
||||
TranslateMessage (&mess);
|
||||
}
|
||||
DispatchMessage (&mess);
|
||||
}
|
||||
|
||||
if (Keyboard != NULL)
|
||||
|
|
|
@ -58,12 +58,12 @@ extern "C" {
|
|||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, uint32_t uType);
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, uint32_t uType);
|
||||
HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
|
||||
VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
|
||||
BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
|
||||
BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
|
@ -215,13 +215,13 @@ BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piVal
|
|||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, uint32_t nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, uint32_t nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, uint32_t nMaxFormats, int *piFormats, uint32_t *nNumFormats);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, uint32_t nAttributes, const int *piAttributes, int *piValues);
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, uint32_t nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, uint32_t nMaxFormats, int *piFormats, uint32_t *nNumFormats);
|
||||
BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
#endif /* WGL_ARB_pixel_format */
|
||||
|
||||
|
@ -296,9 +296,9 @@ BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribLis
|
|||
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
|
||||
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
|
||||
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
|
||||
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, uint32_t uState);
|
||||
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, uint32_t uState);
|
||||
BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
|
||||
#endif
|
||||
#endif /* WGL_3DL_stereo_control */
|
||||
|
||||
|
@ -314,21 +314,21 @@ BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, uint32_t uState);
|
|||
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
|
||||
#define WGL_GPU_NUM_RB_AMD 0x21A7
|
||||
#define WGL_GPU_NUM_SPI_AMD 0x21A8
|
||||
typedef uint32_t (WINAPI * PFNWGLGETGPUIDSAMDPROC) (uint32_t maxCount, uint32_t *ids);
|
||||
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (uint32_t id, int property, GLenum dataType, uint32_t size, void *data);
|
||||
typedef uint32_t (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (uint32_t id);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (uint32_t id, HGLRC hShareContext, const int *attribList);
|
||||
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
|
||||
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
|
||||
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
|
||||
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
uint32_t WINAPI wglGetGPUIDsAMD (uint32_t maxCount, uint32_t *ids);
|
||||
INT WINAPI wglGetGPUInfoAMD (uint32_t id, int property, GLenum dataType, uint32_t size, void *data);
|
||||
uint32_t WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
|
||||
HGLRC WINAPI wglCreateAssociatedContextAMD (uint32_t id);
|
||||
HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (uint32_t id, HGLRC hShareContext, const int *attribList);
|
||||
UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
|
||||
INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||
UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
|
||||
HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
|
||||
HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
|
||||
BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
|
||||
HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
|
||||
|
@ -473,13 +473,13 @@ BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piVal
|
|||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, uint32_t nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, uint32_t nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, uint32_t nMaxFormats, int *piFormats, uint32_t *nNumFormats);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, uint32_t nAttributes, int *piAttributes, int *piValues);
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, uint32_t nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, uint32_t nMaxFormats, int *piFormats, uint32_t *nNumFormats);
|
||||
BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
#endif /* WGL_EXT_pixel_format */
|
||||
|
||||
|
@ -546,28 +546,28 @@ BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, con
|
|||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, uint32_t uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, uint32_t *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, uint32_t uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, uint32_t *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, uint32_t uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, uint32_t *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, uint32_t uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, uint32_t *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, uint32_t *uMaxLineDelay, uint32_t *uMaxPixelDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
|
||||
BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
|
||||
BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
|
||||
BOOL WINAPI wglGenlockSourceI3D (HDC hDC, uint32_t uSource);
|
||||
BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, uint32_t *uSource);
|
||||
BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, uint32_t uEdge);
|
||||
BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, uint32_t *uEdge);
|
||||
BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, uint32_t uRate);
|
||||
BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, uint32_t *uRate);
|
||||
BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, uint32_t uDelay);
|
||||
BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, uint32_t *uDelay);
|
||||
BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, uint32_t *uMaxLineDelay, uint32_t *uMaxPixelDelay);
|
||||
BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
|
||||
BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
|
||||
BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
|
||||
BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
|
||||
BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
|
||||
BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
|
||||
BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
|
||||
BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
|
||||
BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif
|
||||
#endif /* WGL_I3D_genlock */
|
||||
|
||||
|
@ -575,15 +575,15 @@ BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, uint32_t *uMaxLineDelay,
|
|||
#define WGL_I3D_image_buffer 1
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, uint32_t uFlags);
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, uint32_t count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, uint32_t count);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, uint32_t uFlags);
|
||||
LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
|
||||
BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, uint32_t count);
|
||||
BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, uint32_t count);
|
||||
BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif
|
||||
#endif /* WGL_I3D_image_buffer */
|
||||
|
||||
|
@ -686,16 +686,16 @@ struct _GPU_DEVICE {
|
|||
typedef struct _GPU_DEVICE *PGPU_DEVICE;
|
||||
#define ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
|
||||
#define ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (uint32_t iGpuIndex, HGPUNV *phGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, uint32_t iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, uint32_t iGpuIndex, HGPUNV *hGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnumGpusNV (uint32_t iGpuIndex, HGPUNV *phGpu);
|
||||
BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, uint32_t iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
|
||||
BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, uint32_t iGpuIndex, HGPUNV *hGpu);
|
||||
BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
BOOL WINAPI wglDeleteDCNV (HDC hdc);
|
||||
#endif
|
||||
#endif /* WGL_NV_gpu_affinity */
|
||||
|
@ -769,14 +769,14 @@ void WINAPI wglFreeMemoryNV (void *pointer);
|
|||
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
|
||||
#define WGL_UNIQUE_ID_NV 0x20CE
|
||||
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (uint32_t uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef uint32_t (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglBindVideoCaptureDeviceNV (uint32_t uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
uint32_t WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
|
|
|
@ -2231,41 +2231,43 @@ OptionMenu "ReverbSettings" protected
|
|||
Title "Edit Reverb Environment"
|
||||
SafeCommand "Revert settings", "revertenvironment"
|
||||
StaticText " "
|
||||
SliderReverbEditOption "Environment Size", 1, 100, 0.01, 3, 0
|
||||
SliderReverbEditOption "Environment Diffusion", 0, 10, 0.01, 3, 1
|
||||
SliderReverbEditOption "Room", -10000, 0, 1, 0, 2
|
||||
SliderReverbEditOption "Room HF", -10000, 0, 1, 0, 3
|
||||
SliderReverbEditOption "Room LF", -10000, 0, 1, 0, 4
|
||||
SliderReverbEditOption "Decay Time", 1, 200, 0.01, 3, 5
|
||||
SliderReverbEditOption "Decay HF Ratio", 1, 20, 0.01, 3, 6
|
||||
SliderReverbEditOption "Decay LF Ratio", 1, 20, 0.01, 3, 7
|
||||
SliderReverbEditOption "Reflections", -10000, 1000, 1, 0, 8
|
||||
SliderReverbEditOption "Reflections Delay", 0, 0.3, 1, 3, 9
|
||||
SliderReverbEditOption "Reflections Pan X", -2000, 2000, 1, 3, 10
|
||||
SliderReverbEditOption "Reflections Pan Y", -2000, 2000, 1, 3, 11
|
||||
SliderReverbEditOption "Reflections Pan Z", -2000, 2000, 1, 3, 12
|
||||
SliderReverbEditOption "Reverb", -10000, 2000, 1, 0, 13
|
||||
SliderReverbEditOption "Reverb Delay", 0, 0.1, 0.01, 3, 14
|
||||
SliderReverbEditOption "Reverb Pan X", -2000, 2000, 1, 3, 15
|
||||
SliderReverbEditOption "Reverb Pan Y", -2000, 2000, 1, 3, 16
|
||||
SliderReverbEditOption "Reverb Pan Z", -2000, 2000, 1, 3, 17
|
||||
SliderReverbEditOption "Echo Time", 0.075, 0.25, 0.005, 3, 18
|
||||
SliderReverbEditOption "Echo Depth", 0, 1, 0.01, 3, 19
|
||||
SliderReverbEditOption "Modulation Time", 0.04, 4, 0.01, 3, 20
|
||||
SliderReverbEditOption "Modulation Depth",0, 1, 0.01, 3, 21
|
||||
SliderReverbEditOption "Air Absorption HF", -100, 0, 0.01, 3, 22
|
||||
SliderReverbEditOption "HF Reference", 10000, 200000, 1, 3, 23
|
||||
SliderReverbEditOption "LF Reference",20, 10000, 0.1, 3, 24
|
||||
SliderReverbEditOption "Room Rolloff Factor",0, 10, 0.01, 3, 25
|
||||
SliderReverbEditOption "Environment Size", 1, 100, 0.01, 3, 1
|
||||
SliderReverbEditOption "Environment Diffusion", 0, 10, 0.01, 3, 2
|
||||
SliderReverbEditOption "Room", -10000, 0, 1, 0, 3
|
||||
SliderReverbEditOption "Room HF", -10000, 0, 1, 0, 4
|
||||
SliderReverbEditOption "Room LF", -10000, 0, 1, 0, 5
|
||||
SliderReverbEditOption "Decay Time", 1, 200, 0.01, 3, 6
|
||||
SliderReverbEditOption "Decay HF Ratio", 1, 20, 0.01, 3, 7
|
||||
SliderReverbEditOption "Decay LF Ratio", 1, 20, 0.01, 3, 8
|
||||
SliderReverbEditOption "Reflections", -10000, 1000, 1, 0, 9
|
||||
SliderReverbEditOption "Reflections Delay", 0, 0.3, 1, 3, 10
|
||||
SliderReverbEditOption "Reflections Pan X", -2000, 2000, 1, 3, 11
|
||||
SliderReverbEditOption "Reflections Pan Y", -2000, 2000, 1, 3, 12
|
||||
SliderReverbEditOption "Reflections Pan Z", -2000, 2000, 1, 3, 13
|
||||
SliderReverbEditOption "Reverb", -10000, 2000, 1, 0, 14
|
||||
SliderReverbEditOption "Reverb Delay", 0, 0.1, 0.01, 3, 15
|
||||
SliderReverbEditOption "Reverb Pan X", -2000, 2000, 1, 3, 16
|
||||
SliderReverbEditOption "Reverb Pan Y", -2000, 2000, 1, 3, 17
|
||||
SliderReverbEditOption "Reverb Pan Z", -2000, 2000, 1, 3, 18
|
||||
SliderReverbEditOption "Echo Time", 0.075, 0.25, 0.005, 3, 19
|
||||
SliderReverbEditOption "Echo Depth", 0, 1, 0.01, 3, 20
|
||||
SliderReverbEditOption "Modulation Time", 0.04, 4, 0.01, 3, 21
|
||||
SliderReverbEditOption "Modulation Depth",0, 1, 0.01, 3, 22
|
||||
SliderReverbEditOption "Air Absorption HF", -100, 0, 0.01, 3, 23
|
||||
SliderReverbEditOption "HF Reference", 10000, 200000, 1, 3, 24
|
||||
SliderReverbEditOption "LF Reference",20, 10000, 0.1, 3, 25
|
||||
SliderReverbEditOption "Room Rolloff Factor",0, 10, 0.01, 3, 26
|
||||
SliderReverbEditOption "Diffusion",0, 100, 0.01, 3, 27
|
||||
SliderReverbEditOption "Density",0, 100, 0.01, 3, 28
|
||||
StaticText " "
|
||||
ReverbOption "Reflections Scale", 26, OnOff
|
||||
ReverbOption "Reflections Delay Scale", 27, OnOff
|
||||
ReverbOption "Decay Time Scale", 28, OnOff
|
||||
ReverbOption "Decay HF Limit", 29, OnOff
|
||||
ReverbOption "Reverb Scale", 30, OnOff
|
||||
ReverbOption "Reverb Delay Scale", 31, OnOff
|
||||
ReverbOption "Echo Time Scale", 32, OnOff
|
||||
ReverbOption "Modulation Time Scale", 33, OnOff
|
||||
ReverbOption "Reflections Scale", 29, OnOff
|
||||
ReverbOption "Reflections Delay Scale", 30, OnOff
|
||||
ReverbOption "Decay Time Scale", 31, OnOff
|
||||
ReverbOption "Decay HF Limit", 32, OnOff
|
||||
ReverbOption "Reverb Scale", 33, OnOff
|
||||
ReverbOption "Reverb Delay Scale", 34, OnOff
|
||||
ReverbOption "Echo Time Scale", 35, OnOff
|
||||
ReverbOption "Modulation Time Scale", 36, OnOff
|
||||
}
|
||||
|
||||
OptionMenu "ReverbNew" protected
|
||||
|
|
Loading…
Reference in a new issue