mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-04-22 16:33:31 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom into g1.8
This commit is contained in:
commit
5c72b796fb
12 changed files with 340 additions and 62 deletions
|
@ -1033,7 +1033,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
|
|||
if (moceiling >= 0)
|
||||
mo->SetZ(newz - mo->height, false);
|
||||
mo->Translation = multiplayer ?
|
||||
TRANSLATION(TRANSLATION_PlayersExtra,self->special2) : 0;
|
||||
TRANSLATION(TRANSLATION_RainPillar,self->special2) : 0;
|
||||
mo->target = self->target;
|
||||
mo->velx = 1; // Force collision detection
|
||||
mo->velz = -mo->Speed;
|
||||
|
|
|
@ -90,7 +90,7 @@ struct F3DFloor
|
|||
|
||||
fixed_t delta;
|
||||
|
||||
int flags;
|
||||
unsigned int flags;
|
||||
line_t* master;
|
||||
|
||||
sector_t * model;
|
||||
|
|
|
@ -228,7 +228,7 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, fixed_t *ptextop, f
|
|||
FTexture * tex= TexMan(texnum);
|
||||
if (!tex) return false;
|
||||
|
||||
fixed_t totalscale = FixedMul(side->GetTextureYScale(side_t::mid), tex->yScale);
|
||||
fixed_t totalscale = abs(FixedMul(side->GetTextureYScale(side_t::mid), tex->yScale));
|
||||
fixed_t y_offset = side->GetTextureYOffset(side_t::mid);
|
||||
fixed_t textureheight = tex->GetScaledHeight(totalscale) << FRACBITS;
|
||||
if (totalscale != FRACUNIT && !tex->bWorldPanning)
|
||||
|
|
|
@ -539,7 +539,7 @@ bool P_Move (AActor *actor)
|
|||
!((actor->flags & MF_NOGRAVITY) || (actor->flags6 & MF6_CANJUMP))
|
||||
&& actor->Z() > actor->floorz && !(actor->flags2 & MF2_ONMOBJ))
|
||||
{
|
||||
if (actor->Y() <= actor->floorz + actor->MaxStepHeight)
|
||||
if (actor->Z() <= actor->floorz + actor->MaxStepHeight)
|
||||
{
|
||||
fixed_t savedz = actor->Z();
|
||||
actor->SetZ(actor->floorz);
|
||||
|
|
|
@ -56,7 +56,7 @@ class SightCheck
|
|||
fixed_t topslope, bottomslope; // slopes to top and bottom of target
|
||||
int Flags;
|
||||
divline_t trace;
|
||||
int myseethrough;
|
||||
unsigned int myseethrough;
|
||||
|
||||
bool PTR_SightTraverse (intercept_t *in);
|
||||
bool P_SightCheckLine (line_t *ld);
|
||||
|
|
|
@ -700,6 +700,7 @@ void R_InitTranslationTables ()
|
|||
{
|
||||
PushIdentityTable(TRANSLATION_Players);
|
||||
PushIdentityTable(TRANSLATION_PlayersExtra);
|
||||
PushIdentityTable(TRANSLATION_RainPillar);
|
||||
}
|
||||
// The menu player also gets a separate translation table
|
||||
PushIdentityTable(TRANSLATION_Players);
|
||||
|
@ -865,6 +866,29 @@ static void SetRemap(FRemapTable *table, int i, float r, float g, float b)
|
|||
table->Palette[i] = PalEntry(255, ir, ig, ib);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//
|
||||
// Sets the translation Heretic's the rain pillar
|
||||
// This tries to create a translation that preserves the brightness of
|
||||
// the rain projectiles so that their effect isn't ruined.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
static void SetPillarRemap(FRemapTable *table, int i, float h, float s, float v)
|
||||
{
|
||||
float ph, ps, pv;
|
||||
float fr = GPalette.BaseColors[i].r / 255.f;
|
||||
float fg = GPalette.BaseColors[i].g / 255.f;
|
||||
float fb = GPalette.BaseColors[i].b / 255.f;
|
||||
RGBtoHSV(fr, fg, fb, &ph, &ps, &pv);
|
||||
HSVtoRGB(&fr, &fg, &fb, h, s, (v*0.2f + pv*0.8f));
|
||||
int ir = clamp (int(fr * 255.f), 0, 255);
|
||||
int ig = clamp (int(fg * 255.f), 0, 255);
|
||||
int ib = clamp (int(fb * 255.f), 0, 255);
|
||||
table->Remap[i] = ColorMatcher.Pick (ir, ig, ib);
|
||||
table->Palette[i] = PalEntry(255, ir, ig, ib);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
static bool SetRange(FRemapTable *table, int start, int end, int first, int last)
|
||||
|
@ -900,7 +924,7 @@ static bool SetRange(FRemapTable *table, int start, int end, int first, int last
|
|||
//----------------------------------------------------------------------------
|
||||
|
||||
static void R_CreatePlayerTranslation (float h, float s, float v, const FPlayerColorSet *colorset,
|
||||
FPlayerSkin *skin, FRemapTable *table, FRemapTable *alttable)
|
||||
FPlayerSkin *skin, FRemapTable *table, FRemapTable *alttable, FRemapTable *pillartable)
|
||||
{
|
||||
int i;
|
||||
BYTE start = skin->range0start;
|
||||
|
@ -1023,6 +1047,7 @@ static void R_CreatePlayerTranslation (float h, float s, float v, const FPlayerC
|
|||
v = MIN (1.f, (0.2102f + 0.0489f*(float)(i - 144)) * basev);
|
||||
HSVtoRGB (&r, &g, &b, h, s, v);
|
||||
SetRemap(alttable, i, r, g, b);
|
||||
SetPillarRemap(pillartable, i, h, s, v);
|
||||
}
|
||||
alttable->UpdateNative();
|
||||
}
|
||||
|
@ -1103,7 +1128,9 @@ void R_BuildPlayerTranslation (int player)
|
|||
R_CreatePlayerTranslation (h, s, v, colorset,
|
||||
&skins[players[player].userinfo.GetSkin()],
|
||||
translationtables[TRANSLATION_Players][player],
|
||||
translationtables[TRANSLATION_PlayersExtra][player]);
|
||||
translationtables[TRANSLATION_PlayersExtra][player],
|
||||
translationtables[TRANSLATION_RainPillar][player]
|
||||
);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -1123,5 +1150,5 @@ void R_GetPlayerTranslation (int color, const FPlayerColorSet *colorset, FPlayer
|
|||
RGBtoHSV (RPART(color)/255.f, GPART(color)/255.f, BPART(color)/255.f,
|
||||
&h, &s, &v);
|
||||
|
||||
R_CreatePlayerTranslation (h, s, v, colorset, skin, table, NULL);
|
||||
R_CreatePlayerTranslation (h, s, v, colorset, skin, table, NULL, NULL);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ enum
|
|||
TRANSLATION_PlayerCorpses,
|
||||
TRANSLATION_Decorate,
|
||||
TRANSLATION_Blood,
|
||||
TRANSLATION_RainPillar,
|
||||
|
||||
NUM_TRANSLATION_TABLES
|
||||
};
|
||||
|
|
103
src/r_segs.cpp
103
src/r_segs.cpp
|
@ -171,31 +171,30 @@ fixed_t MaskedScaleY;
|
|||
|
||||
static void BlastMaskedColumn (void (*blastfunc)(const BYTE *pixels, const FTexture::Span *spans), FTexture *tex)
|
||||
{
|
||||
if (maskedtexturecol[dc_x] != FIXED_MAX)
|
||||
// calculate lighting
|
||||
if (fixedcolormap == NULL && fixedlightlev < 0)
|
||||
{
|
||||
// calculate lighting
|
||||
if (fixedcolormap == NULL && fixedlightlev < 0)
|
||||
{
|
||||
dc_colormap = basecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT);
|
||||
}
|
||||
|
||||
dc_iscale = MulScale18 (MaskedSWall[dc_x], MaskedScaleY);
|
||||
sprtopscreen = centeryfrac - FixedMul (dc_texturemid, spryscale);
|
||||
|
||||
// killough 1/25/98: here's where Medusa came in, because
|
||||
// it implicitly assumed that the column was all one patch.
|
||||
// Originally, Doom did not construct complete columns for
|
||||
// multipatched textures, so there were no header or trailer
|
||||
// bytes in the column referred to below, which explains
|
||||
// the Medusa effect. The fix is to construct true columns
|
||||
// when forming multipatched textures (see r_data.c).
|
||||
|
||||
// draw the texture
|
||||
const FTexture::Span *spans;
|
||||
const BYTE *pixels = tex->GetColumn (maskedtexturecol[dc_x] >> FRACBITS, &spans);
|
||||
blastfunc (pixels, spans);
|
||||
// maskedtexturecol[dc_x] = FIXED_MAX; // kg3D - seems to be useless
|
||||
dc_colormap = basecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT);
|
||||
}
|
||||
|
||||
dc_iscale = MulScale18 (MaskedSWall[dc_x], MaskedScaleY);
|
||||
if (sprflipvert)
|
||||
sprtopscreen = centeryfrac + FixedMul(dc_texturemid, spryscale);
|
||||
else
|
||||
sprtopscreen = centeryfrac - FixedMul(dc_texturemid, spryscale);
|
||||
|
||||
// killough 1/25/98: here's where Medusa came in, because
|
||||
// it implicitly assumed that the column was all one patch.
|
||||
// Originally, Doom did not construct complete columns for
|
||||
// multipatched textures, so there were no header or trailer
|
||||
// bytes in the column referred to below, which explains
|
||||
// the Medusa effect. The fix is to construct true columns
|
||||
// when forming multipatched textures (see r_data.c).
|
||||
|
||||
// draw the texture
|
||||
const FTexture::Span *spans;
|
||||
const BYTE *pixels = tex->GetColumn (maskedtexturecol[dc_x] >> FRACBITS, &spans);
|
||||
blastfunc (pixels, spans);
|
||||
rw_light += rw_lightstep;
|
||||
spryscale += rw_scalestep;
|
||||
}
|
||||
|
@ -226,7 +225,7 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
|||
FTexture *tex;
|
||||
int i;
|
||||
sector_t tempsec; // killough 4/13/98
|
||||
fixed_t texheight, textop, texheightscale;
|
||||
fixed_t texheight, texheightscale;
|
||||
bool notrelevant = false;
|
||||
|
||||
const sector_t *sec;
|
||||
|
@ -308,9 +307,14 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
|||
spryscale = ds->iscale + ds->iscalestep * (x1 - ds->x1);
|
||||
rw_scalestep = ds->iscalestep;
|
||||
|
||||
if (fixedlightlev >= 0)
|
||||
dc_colormap = basecolormap->Maps + fixedlightlev;
|
||||
else if (fixedcolormap != NULL)
|
||||
dc_colormap = fixedcolormap;
|
||||
|
||||
// find positioning
|
||||
texheight = tex->GetScaledHeight() << FRACBITS;
|
||||
texheightscale = curline->sidedef->GetTextureYScale(side_t::mid);
|
||||
texheightscale = abs(curline->sidedef->GetTextureYScale(side_t::mid));
|
||||
if (texheightscale != FRACUNIT)
|
||||
{
|
||||
texheight = FixedDiv(texheight, texheightscale);
|
||||
|
@ -324,8 +328,18 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
|||
dc_texturemid = MIN (frontsector->GetPlaneTexZ(sector_t::ceiling), backsector->GetPlaneTexZ(sector_t::ceiling));
|
||||
}
|
||||
|
||||
{ // encapsulate the lifetime of rowoffset
|
||||
fixed_t rowoffset = curline->sidedef->GetTextureYOffset(side_t::mid);
|
||||
fixed_t rowoffset = curline->sidedef->GetTextureYOffset(side_t::mid);
|
||||
|
||||
if (!(curline->linedef->flags & ML_WRAP_MIDTEX) &&
|
||||
!(curline->sidedef->Flags & WALLF_WRAP_MIDTEX))
|
||||
{ // Texture does not wrap vertically.
|
||||
fixed_t textop;
|
||||
|
||||
if (MaskedScaleY < 0)
|
||||
{
|
||||
MaskedScaleY = -MaskedScaleY;
|
||||
sprflipvert = true;
|
||||
}
|
||||
if (tex->bWorldPanning)
|
||||
{
|
||||
// rowoffset is added before the MulScale3 so that the masked texture will
|
||||
|
@ -341,16 +355,11 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
|||
textop = dc_texturemid - viewz + SafeDivScale16 (rowoffset, MaskedScaleY);
|
||||
dc_texturemid = MulScale16 (dc_texturemid - viewz, MaskedScaleY) + rowoffset;
|
||||
}
|
||||
}
|
||||
|
||||
if (fixedlightlev >= 0)
|
||||
dc_colormap = basecolormap->Maps + fixedlightlev;
|
||||
else if (fixedcolormap != NULL)
|
||||
dc_colormap = fixedcolormap;
|
||||
|
||||
if (!(curline->linedef->flags & ML_WRAP_MIDTEX) &&
|
||||
!(curline->sidedef->Flags & WALLF_WRAP_MIDTEX))
|
||||
{ // Texture does not wrap vertically.
|
||||
if (sprflipvert)
|
||||
{
|
||||
MaskedScaleY = -MaskedScaleY;
|
||||
dc_texturemid -= tex->GetHeight() << FRACBITS;
|
||||
}
|
||||
|
||||
// [RH] Don't bother drawing segs that are completely offscreen
|
||||
if (MulScale12 (globaldclip, ds->sz1) < -textop &&
|
||||
|
@ -467,6 +476,20 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
|||
}
|
||||
else
|
||||
{ // Texture does wrap vertically.
|
||||
if (tex->bWorldPanning)
|
||||
{
|
||||
// rowoffset is added before the MulScale3 so that the masked texture will
|
||||
// still be positioned in world units rather than texels.
|
||||
dc_texturemid += rowoffset - viewz;
|
||||
dc_texturemid = MulScale16 (dc_texturemid, MaskedScaleY);
|
||||
}
|
||||
else
|
||||
{
|
||||
// rowoffset is added outside the multiply so that it positions the texture
|
||||
// by texels instead of world units.
|
||||
dc_texturemid = MulScale16 (dc_texturemid - viewz, MaskedScaleY) + rowoffset;
|
||||
}
|
||||
|
||||
WallC.sz1 = ds->sz1;
|
||||
WallC.sz2 = ds->sz2;
|
||||
WallC.sx1 = ds->sx1;
|
||||
|
@ -576,7 +599,7 @@ void R_RenderFakeWall(drawseg_t *ds, int x1, int x2, F3DFloor *rover)
|
|||
}
|
||||
xscale = FixedMul(rw_pic->xScale, scaledside->GetTextureXScale(scaledpart));
|
||||
yscale = FixedMul(rw_pic->yScale, scaledside->GetTextureYScale(scaledpart));
|
||||
// encapsulate the lifetime of rowoffset
|
||||
|
||||
fixed_t rowoffset = curline->sidedef->GetTextureYOffset(side_t::mid) + rover->master->sidedef[0]->GetTextureYOffset(side_t::mid);
|
||||
dc_texturemid = rover->model->GetPlaneTexZ(sector_t::ceiling);
|
||||
rw_offset = curline->sidedef->GetTextureXOffset(side_t::mid) + rover->master->sidedef[0]->GetTextureXOffset(side_t::mid);
|
||||
|
@ -2508,9 +2531,9 @@ void R_StoreWallRange (int start, int stop)
|
|||
iend = DivScale32 (1, iend);
|
||||
ds_p->yrepeat = yrepeat;
|
||||
ds_p->iscale = istart;
|
||||
if (stop - start > 1)
|
||||
if (stop - start > 0)
|
||||
{
|
||||
ds_p->iscalestep = (iend - istart) / (stop - start - 1);
|
||||
ds_p->iscalestep = (iend - istart) / (stop - start);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
93
src/sound/oaldef.h
Normal file
93
src/sound/oaldef.h
Normal file
|
@ -0,0 +1,93 @@
|
|||
DEFINE_ENTRY(LPALENABLE,alEnable)
|
||||
DEFINE_ENTRY(LPALDISABLE, alDisable)
|
||||
DEFINE_ENTRY(LPALISENABLED, alIsEnabled)
|
||||
DEFINE_ENTRY(LPALGETSTRING, alGetString)
|
||||
DEFINE_ENTRY(LPALGETBOOLEANV, alGetBooleanv)
|
||||
DEFINE_ENTRY(LPALGETINTEGERV, alGetIntegerv)
|
||||
DEFINE_ENTRY(LPALGETFLOATV, alGetFloatv)
|
||||
DEFINE_ENTRY(LPALGETDOUBLEV, alGetDoublev)
|
||||
DEFINE_ENTRY(LPALGETBOOLEAN, alGetBoolean)
|
||||
DEFINE_ENTRY(LPALGETINTEGER, alGetInteger)
|
||||
DEFINE_ENTRY(LPALGETFLOAT, alGetFloat)
|
||||
DEFINE_ENTRY(LPALGETDOUBLE, alGetDouble)
|
||||
DEFINE_ENTRY(LPALGETERROR, alGetError)
|
||||
DEFINE_ENTRY(LPALISEXTENSIONPRESENT, alIsExtensionPresent)
|
||||
DEFINE_ENTRY(LPALGETPROCADDRESS, alGetProcAddress)
|
||||
DEFINE_ENTRY(LPALGETENUMVALUE, alGetEnumValue)
|
||||
DEFINE_ENTRY(LPALLISTENERF, alListenerf)
|
||||
DEFINE_ENTRY(LPALLISTENER3F, alListener3f)
|
||||
DEFINE_ENTRY(LPALLISTENERFV, alListenerfv)
|
||||
DEFINE_ENTRY(LPALLISTENERI, alListeneri)
|
||||
DEFINE_ENTRY(LPALLISTENER3I, alListener3i)
|
||||
DEFINE_ENTRY(LPALLISTENERIV, alListeneriv)
|
||||
DEFINE_ENTRY(LPALGETLISTENERF, alGetListenerf)
|
||||
DEFINE_ENTRY(LPALGETLISTENER3F, alGetListener3f)
|
||||
DEFINE_ENTRY(LPALGETLISTENERFV, alGetListenerfv)
|
||||
DEFINE_ENTRY(LPALGETLISTENERI, alGetListeneri)
|
||||
DEFINE_ENTRY(LPALGETLISTENER3I, alGetListener3i)
|
||||
DEFINE_ENTRY(LPALGETLISTENERIV, alGetListeneriv)
|
||||
DEFINE_ENTRY(LPALGENSOURCES, alGenSources)
|
||||
DEFINE_ENTRY(LPALDELETESOURCES, alDeleteSources)
|
||||
DEFINE_ENTRY(LPALISSOURCE, alIsSource)
|
||||
DEFINE_ENTRY(LPALSOURCEF, alSourcef)
|
||||
DEFINE_ENTRY(LPALSOURCE3F, alSource3f)
|
||||
DEFINE_ENTRY(LPALSOURCEFV, alSourcefv)
|
||||
DEFINE_ENTRY(LPALSOURCEI, alSourcei)
|
||||
DEFINE_ENTRY(LPALSOURCE3I, alSource3i)
|
||||
DEFINE_ENTRY(LPALSOURCEIV, alSourceiv)
|
||||
DEFINE_ENTRY(LPALGETSOURCEF, alGetSourcef)
|
||||
DEFINE_ENTRY(LPALGETSOURCE3F, alGetSource3f)
|
||||
DEFINE_ENTRY(LPALGETSOURCEFV, alGetSourcefv)
|
||||
DEFINE_ENTRY(LPALGETSOURCEI, alGetSourcei)
|
||||
DEFINE_ENTRY(LPALGETSOURCE3I, alGetSource3i)
|
||||
DEFINE_ENTRY(LPALGETSOURCEIV, alGetSourceiv)
|
||||
DEFINE_ENTRY(LPALSOURCEPLAYV, alSourcePlayv)
|
||||
DEFINE_ENTRY(LPALSOURCESTOPV, alSourceStopv)
|
||||
DEFINE_ENTRY(LPALSOURCEREWINDV, alSourceRewindv)
|
||||
DEFINE_ENTRY(LPALSOURCEPAUSEV, alSourcePausev)
|
||||
DEFINE_ENTRY(LPALSOURCEPLAY, alSourcePlay)
|
||||
DEFINE_ENTRY(LPALSOURCESTOP, alSourceStop)
|
||||
DEFINE_ENTRY(LPALSOURCEREWIND, alSourceRewind)
|
||||
DEFINE_ENTRY(LPALSOURCEPAUSE, alSourcePause)
|
||||
DEFINE_ENTRY(LPALSOURCEQUEUEBUFFERS, alSourceQueueBuffers)
|
||||
DEFINE_ENTRY(LPALSOURCEUNQUEUEBUFFERS, alSourceUnqueueBuffers)
|
||||
DEFINE_ENTRY(LPALGENBUFFERS, alGenBuffers)
|
||||
DEFINE_ENTRY(LPALDELETEBUFFERS, alDeleteBuffers)
|
||||
DEFINE_ENTRY(LPALISBUFFER, alIsBuffer)
|
||||
DEFINE_ENTRY(LPALBUFFERDATA, alBufferData)
|
||||
DEFINE_ENTRY(LPALBUFFERF, alBufferf)
|
||||
DEFINE_ENTRY(LPALBUFFER3F, alBuffer3f)
|
||||
DEFINE_ENTRY(LPALBUFFERFV, alBufferfv)
|
||||
DEFINE_ENTRY(LPALBUFFERI, alBufferi)
|
||||
DEFINE_ENTRY(LPALBUFFER3I, alBuffer3i)
|
||||
DEFINE_ENTRY(LPALBUFFERIV, alBufferiv)
|
||||
DEFINE_ENTRY(LPALGETBUFFERF, alGetBufferf)
|
||||
DEFINE_ENTRY(LPALGETBUFFER3F, alGetBuffer3f)
|
||||
DEFINE_ENTRY(LPALGETBUFFERFV, alGetBufferfv)
|
||||
DEFINE_ENTRY(LPALGETBUFFERI, alGetBufferi)
|
||||
DEFINE_ENTRY(LPALGETBUFFER3I, alGetBuffer3i)
|
||||
DEFINE_ENTRY(LPALGETBUFFERIV, alGetBufferiv)
|
||||
DEFINE_ENTRY(LPALDOPPLERFACTOR, alDopplerFactor)
|
||||
DEFINE_ENTRY(LPALDOPPLERVELOCITY, alDopplerVelocity)
|
||||
DEFINE_ENTRY(LPALSPEEDOFSOUND, alSpeedOfSound)
|
||||
DEFINE_ENTRY(LPALDISTANCEMODEL, alDistanceModel)
|
||||
DEFINE_ENTRY(LPALCCREATECONTEXT, alcCreateContext)
|
||||
DEFINE_ENTRY(LPALCMAKECONTEXTCURRENT, alcMakeContextCurrent)
|
||||
DEFINE_ENTRY(LPALCPROCESSCONTEXT, alcProcessContext)
|
||||
DEFINE_ENTRY(LPALCSUSPENDCONTEXT, alcSuspendContext)
|
||||
DEFINE_ENTRY(LPALCDESTROYCONTEXT, alcDestroyContext)
|
||||
DEFINE_ENTRY(LPALCGETCURRENTCONTEXT, alcGetCurrentContext)
|
||||
DEFINE_ENTRY(LPALCGETCONTEXTSDEVICE, alcGetContextsDevice)
|
||||
DEFINE_ENTRY(LPALCOPENDEVICE, alcOpenDevice)
|
||||
DEFINE_ENTRY(LPALCCLOSEDEVICE, alcCloseDevice)
|
||||
DEFINE_ENTRY(LPALCGETERROR, alcGetError)
|
||||
DEFINE_ENTRY(LPALCISEXTENSIONPRESENT, alcIsExtensionPresent)
|
||||
DEFINE_ENTRY(LPALCGETPROCADDRESS, alcGetProcAddress)
|
||||
DEFINE_ENTRY(LPALCGETENUMVALUE, alcGetEnumValue)
|
||||
DEFINE_ENTRY(LPALCGETSTRING, alcGetString)
|
||||
DEFINE_ENTRY(LPALCGETINTEGERV, alcGetIntegerv)
|
||||
DEFINE_ENTRY(LPALCCAPTUREOPENDEVICE, alcCaptureOpenDevice)
|
||||
DEFINE_ENTRY(LPALCCAPTURECLOSEDEVICE, alcCaptureCloseDevice)
|
||||
DEFINE_ENTRY(LPALCCAPTURESTART, alcCaptureStart)
|
||||
DEFINE_ENTRY(LPALCCAPTURESTOP, alcCaptureStop)
|
||||
DEFINE_ENTRY(LPALCCAPTURESAMPLES, alcCaptureSamples)
|
117
src/sound/oalload.h
Normal file
117
src/sound/oalload.h
Normal file
|
@ -0,0 +1,117 @@
|
|||
#ifndef OALDEF_H
|
||||
#define OALDEF_H
|
||||
|
||||
#if defined _WIN32 && !defined NO_OPENAL
|
||||
|
||||
#define DEFINE_ENTRY(type, name) static type p_##name;
|
||||
#include "oaldef.h"
|
||||
#undef DEFINE_ENTRY
|
||||
struct oalloadentry
|
||||
{
|
||||
const char *name;
|
||||
FARPROC *funcaddr;
|
||||
};
|
||||
static oalloadentry oalfuncs[] = {
|
||||
#define DEFINE_ENTRY(type, name) { #name, (FARPROC*)&p_##name },
|
||||
#include "oaldef.h"
|
||||
#undef DEFINE_ENTRY
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
|
||||
#define alEnable p_alEnable
|
||||
#define alDisable p_alDisable
|
||||
#define alIsEnabled p_alIsEnabled
|
||||
#define alGetString p_alGetString
|
||||
#define alGetBooleanv p_alGetBooleanv
|
||||
#define alGetIntegerv p_alGetIntegerv
|
||||
#define alGetFloatv p_alGetFloatv
|
||||
#define alGetDoublev p_alGetDoublev
|
||||
#define alGetBoolean p_alGetBoolean
|
||||
#define alGetInteger p_alGetInteger
|
||||
#define alGetFloat p_alGetFloat
|
||||
#define alGetDouble p_alGetDouble
|
||||
#define alGetError p_alGetError
|
||||
#define alIsExtensionPresent p_alIsExtensionPresent
|
||||
#define alGetProcAddress p_alGetProcAddress
|
||||
#define alGetEnumValue p_alGetEnumValue
|
||||
#define alListenerf p_alListenerf
|
||||
#define alListener3f p_alListener3f
|
||||
#define alListenerfv p_alListenerfv
|
||||
#define alListeneri p_alListeneri
|
||||
#define alListener3i p_alListener3i
|
||||
#define alListeneriv p_alListeneriv
|
||||
#define alGetListenerf p_alGetListenerf
|
||||
#define alGetListener3f p_alGetListener3f
|
||||
#define alGetListenerfv p_alGetListenerfv
|
||||
#define alGetListeneri p_alGetListeneri
|
||||
#define alGetListener3i p_alGetListener3i
|
||||
#define alGetListeneriv p_alGetListeneriv
|
||||
#define alGenSources p_alGenSources
|
||||
#define alDeleteSources p_alDeleteSources
|
||||
#define alIsSource p_alIsSource
|
||||
#define alSourcef p_alSourcef
|
||||
#define alSource3f p_alSource3f
|
||||
#define alSourcefv p_alSourcefv
|
||||
#define alSourcei p_alSourcei
|
||||
#define alSource3i p_alSource3i
|
||||
#define alSourceiv p_alSourceiv
|
||||
#define alGetSourcef p_alGetSourcef
|
||||
#define alGetSource3f p_alGetSource3f
|
||||
#define alGetSourcefv p_alGetSourcefv
|
||||
#define alGetSourcei p_alGetSourcei
|
||||
#define alGetSource3i p_alGetSource3i
|
||||
#define alGetSourceiv p_alGetSourceiv
|
||||
#define alSourcePlayv p_alSourcePlayv
|
||||
#define alSourceStopv p_alSourceStopv
|
||||
#define alSourceRewindv p_alSourceRewindv
|
||||
#define alSourcePausev p_alSourcePausev
|
||||
#define alSourcePlay p_alSourcePlay
|
||||
#define alSourceStop p_alSourceStop
|
||||
#define alSourceRewind p_alSourceRewind
|
||||
#define alSourcePause p_alSourcePause
|
||||
#define alSourceQueueBuffers p_alSourceQueueBuffers
|
||||
#define alSourceUnqueueBuffers p_alSourceUnqueueBuffers
|
||||
#define alGenBuffers p_alGenBuffers
|
||||
#define alDeleteBuffers p_alDeleteBuffers
|
||||
#define alIsBuffer p_alIsBuffer
|
||||
#define alBufferData p_alBufferData
|
||||
#define alBufferf p_alBufferf
|
||||
#define alBuffer3f p_alBuffer3f
|
||||
#define alBufferfv p_alBufferfv
|
||||
#define alBufferi p_alBufferi
|
||||
#define alBuffer3i p_alBuffer3i
|
||||
#define alBufferiv p_alBufferiv
|
||||
#define alGetBufferf p_alGetBufferf
|
||||
#define alGetBuffer3f p_alGetBuffer3f
|
||||
#define alGetBufferfv p_alGetBufferfv
|
||||
#define alGetBufferi p_alGetBufferi
|
||||
#define alGetBuffer3i p_alGetBuffer3i
|
||||
#define alGetBufferiv p_alGetBufferiv
|
||||
#define alDopplerFactor p_alDopplerFactor
|
||||
#define alDopplerVelocity p_alDopplerVelocity
|
||||
#define alSpeedOfSound p_alSpeedOfSound
|
||||
#define alDistanceModel p_alDistanceModel
|
||||
#define alcCreateContext p_alcCreateContext
|
||||
#define alcMakeContextCurrent p_alcMakeContextCurrent
|
||||
#define alcProcessContext p_alcProcessContext
|
||||
#define alcSuspendContext p_alcSuspendContext
|
||||
#define alcDestroyContext p_alcDestroyContext
|
||||
#define alcGetCurrentContext p_alcGetCurrentContext
|
||||
#define alcGetContextsDevice p_alcGetContextsDevice
|
||||
#define alcOpenDevice p_alcOpenDevice
|
||||
#define alcCloseDevice p_alcCloseDevice
|
||||
#define alcGetError p_alcGetError
|
||||
#define alcIsExtensionPresent p_alcIsExtensionPresent
|
||||
#define alcGetProcAddress p_alcGetProcAddress
|
||||
#define alcGetEnumValue p_alcGetEnumValue
|
||||
#define alcGetString p_alcGetString
|
||||
#define alcGetIntegerv p_alcGetIntegerv
|
||||
#define alcCaptureOpenDevice p_alcCaptureOpenDevice
|
||||
#define alcCaptureCloseDevice p_alcCaptureCloseDevice
|
||||
#define alcCaptureStart p_alcCaptureStart
|
||||
#define alcCaptureStop p_alcCaptureStop
|
||||
#define alcCaptureSamples p_alcCaptureSamples
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -54,34 +54,49 @@
|
|||
#include "i_musicinterns.h"
|
||||
#include "tempfiles.h"
|
||||
|
||||
#include "oalload.h"
|
||||
|
||||
CVAR (String, snd_aldevice, "Default", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Bool, snd_efx, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
|
||||
#ifdef _WIN32
|
||||
static HMODULE hmodOpenAL;
|
||||
#endif
|
||||
|
||||
bool IsOpenALPresent()
|
||||
{
|
||||
#ifdef NO_OPENAL
|
||||
return false;
|
||||
#elif !defined _WIN32
|
||||
return true; // on non-Windows we cannot delay load the library so it has to be present.
|
||||
return true;
|
||||
#else
|
||||
static bool cached_result;
|
||||
static bool cached_result = false;
|
||||
static bool done = false;
|
||||
|
||||
if (!done)
|
||||
{
|
||||
done = true;
|
||||
|
||||
__try
|
||||
if (hmodOpenAL == NULL)
|
||||
{
|
||||
// just call one function from the API to force loading the DLL
|
||||
alcGetError(NULL);
|
||||
}
|
||||
__except (CheckException(GetExceptionCode()))
|
||||
{
|
||||
// FMod could not be delay loaded
|
||||
return false;
|
||||
hmodOpenAL = LoadLibrary(NicePath("$PROGDIR/openal32.dll"));
|
||||
if (hmodOpenAL == NULL)
|
||||
{
|
||||
hmodOpenAL = LoadLibrary("openal32.dll");
|
||||
if (hmodOpenAL == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(int i = 0; oalfuncs[i].name != NULL; i++)
|
||||
{
|
||||
*oalfuncs[i].funcaddr = GetProcAddress(hmodOpenAL, oalfuncs[i].name);
|
||||
if (oalfuncs[i].funcaddr == NULL)
|
||||
{
|
||||
FreeLibrary(hmodOpenAL);
|
||||
hmodOpenAL = NULL;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
cached_result = true;
|
||||
}
|
||||
|
@ -89,6 +104,8 @@ bool IsOpenALPresent()
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
void I_BuildALDeviceList(FOptionValues *opt)
|
||||
{
|
||||
opt->mValues.Resize(1);
|
||||
|
|
|
@ -276,9 +276,9 @@ FPNGTexture::FPNGTexture (FileReader &lump, int lumpnum, const FString &filename
|
|||
lump.Read (trans, len);
|
||||
HaveTrans = true;
|
||||
// Save for colortype 2
|
||||
NonPaletteTrans[0] = BigShort(((WORD *)trans)[0]);
|
||||
NonPaletteTrans[1] = BigShort(((WORD *)trans)[1]);
|
||||
NonPaletteTrans[2] = BigShort(((WORD *)trans)[2]);
|
||||
NonPaletteTrans[0] = WORD(trans[0] * 256 + trans[1]);
|
||||
NonPaletteTrans[1] = WORD(trans[2] * 256 + trans[3]);
|
||||
NonPaletteTrans[2] = WORD(trans[4] * 256 + trans[5]);
|
||||
break;
|
||||
|
||||
case MAKE_ID('a','l','P','h'):
|
||||
|
|
Loading…
Reference in a new issue