Update to ZDoom r1033:

- Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t.
- Grouped the sector plane texture transformation values into a separate
  structure and replaced all access to them with wrapper functions.
- Add environment 255, 255 as a way to get the software underwater effect in
  any zone you want.
- Using a too-recent version of FMOD now gives an error, since there may be
  breaking changes to the API from one version to the next (excluding
  revisions in stable branches, which only represent bug fixes).
- Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone
  unnoticed before: The delayhi and delaylo parameters for Channel::setDelay()
  and getDelay() were swapped.
- Fixed: P_ChangeSector could incorrectly block movement when checking for
  mid textures linked to a moving floor.
- Fixed AActor's bouncefactor definitions which I accidentally changed when
  adding wallbouncefactor.
- Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead 
  of subtracting it.
- Fixed: SBARINFO's popup code used 1-based indices to address a C++ array.
- Fixed: ACS's ChangeSky command didn't clean up the stack.
- Fixed: Wall scrolling interpolations incremented their reference count twice.
- Fixed: Before a level's thinkers are loaded all previous interpolations must
  be cleared.
- Fixed: deleted interpolations didn't NULL the pointer in the interpolated
  object. Also added all interpolation pointers to DSectorMarker to ensure
  that they are properyl processed by the garbage collector.
- Added scaling to double size for idmypos display.
- Changed: Players don't telefrag when they are spawned now but after all
  actors have been spawned to avoid accidental voodoo doll telefragging.
- Fixed: ACS scripts for non-existent maps were started on the current one.
- Added a 'wallbouncefactor' property to AActor.
- Reverted forceunderwater change from r1026 and fixed the problem for real:
  SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec.
  So the initial check of the current sector in AActor::UpdateWaterLevel
  must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK.
- Dehacked fix discovered by entryway: Dehacked only changes the blue armor's
  armortype. It does not touch the armor given by the megasphere.
- Changed forcewater handling so that only control sectors created by one-
  sided lines become swimmable, since there's a good chance that a two-sided
  line is creating the control sector out of a normal, accessible portion of
  the map. (See e.g. linedef 29242 of zdoomcmp1.)
- Added self-modifying code notifications for Valgrind.
  Build with make VALGRIND=1 to turn them on.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2008-06-14 15:37:17 +00:00
parent 84342b5d45
commit 9c8f4874cf
44 changed files with 635 additions and 324 deletions

View file

@ -1,3 +1,54 @@
June 12, 2008
- Add environment 255, 255 as a way to get the software underwater effect in
any zone you want.
- Using a too-recent version of FMOD now gives an error, since there may be
breaking changes to the API from one version to the next (excluding
revisions in stable branches, which only represent bug fixes).
- Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone
unnoticed before: The delayhi and delaylo parameters for Channel::setDelay()
and getDelay() were swapped.
June 12, 2008 (Changes by Graf Zahl)
- Fixed: P_ChangeSector could incorrectly block movement when checking for
mid textures linked to a moving floor.
- Fixed AActor's bouncefactor definitions which I accidentally changed when
adding wallbouncefactor.
- Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead
of subtracting it.
June 11, 2008 (Changes by Graf Zahl)
- Fixed: SBARINFO's popup code used 1-based indices to address a C++ array.
- Fixed: ACS's ChangeSky command didn't clean up the stack.
- Fixed: Wall scrolling interpolations incremented their reference count twice.
- Fixed: Before a level's thinkers are loaded all previous interpolations must
be cleared.
- Fixed: deleted interpolations didn't NULL the pointer in the interpolated
object. Also added all interpolation pointers to DSectorMarker to ensure
that they are properyl processed by the garbage collector.
June 10, 2008 (Changes by Graf Zahl)
- Added scaling to double size for idmypos display.
- Changed: Players don't telefrag when they are spawned now but after all
actors have been spawned to avoid accidental voodoo doll telefragging.
- Fixed: ACS scripts for non-existent maps were started on the current one.
- Added a 'wallbouncefactor' property to AActor.
- Reverted forceunderwater change from r1026 and fixed the problem for real:
SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec.
So the initial check of the current sector in AActor::UpdateWaterLevel
must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK.
June 9, 2008
- Dehacked fix discovered by entryway: Dehacked only changes the blue armor's
armortype. It does not touch the armor given by the megasphere.
- Changed forcewater handling so that only control sectors created by one-
sided lines become swimmable, since there's a good chance that a two-sided
line is creating the control sector out of a normal, accessible portion of
the map. (See e.g. linedef 29242 of zdoomcmp1.)
June 7, 2008
- Added self-modifying code notifications for Valgrind.
Build with make VALGRIND=1 to turn them on.
June 6, 2008
- Fixed: There was still an inventory bar check in FMugShot::GetFace() after
separating it from DDoomStatusBar.

View file

@ -3,6 +3,8 @@
; See the included license file "BUILDLIC.TXT" for license info.
; This file has been modified from Ken Silverman's original release
%include "src/valgrind.inc"
SECTION .data
%ifndef M_TARGET_LINUX
@ -56,6 +58,7 @@ setvlinebpl_:
mov [fixchain1m+2], eax
mov [fixchain2ma+2], eax
mov [fixchain2mb+2], eax
selfmod fixchain1a, fixchain2mb+6
ret
; pass it log2(texheight)
@ -87,6 +90,7 @@ setupvlineasm:
dec eax
mov dword [machvsh2+2], eax ;(1<<shy)-1
mov dword [machvsh4+2], eax ;(1<<shy)-1
selfmod premach3a, machvsh8+6
ret
SECTION .rtext progbits alloc exec write align=64
@ -250,6 +254,7 @@ machvsh12: rol ebx, 88h ;sh
add ebp, ebx
mov ecx, esi
selfmod beginvlineasm4, machvline4end+6
jmp short beginvlineasm4
ALIGN 16
beginvlineasm4:
@ -323,6 +328,7 @@ setupmvlineasm:
mov byte [machmv14+2], cl
mov byte [machmv15+2], cl
mov byte [machmv16+2], cl
selfmod maskmach3a, machmv13+6
ret
ALIGN 16
@ -405,6 +411,7 @@ mvlineasm4:
mov ebp, [vplce+12]
fixchain2ma: sub edi, 320
selfmod beginmvlineasm4, machmv2+6
jmp short beginmvlineasm4
ALIGN 16
beginmvlineasm4:
@ -529,3 +536,5 @@ mvcase1: mov [edi], bl
jmp beginmvlineasm4
ALIGN 16
mvcase0: jmp beginmvlineasm4
align 16

View file

@ -692,6 +692,7 @@ public:
// This is not the same as meleerange
fixed_t maxtargetrange; // any target farther away cannot be attacked
fixed_t bouncefactor; // Strife's grenades use 50%, Hexen's Flechettes 70.
fixed_t wallbouncefactor; // The bounce factor for walls can be different.
int bouncecount; // Strife's grenades only bounce twice before exploding
fixed_t gravity; // [GRB] Gravity factor
int FastChaseStrafeCount;

View file

@ -68,6 +68,7 @@
#include "c_dispatch.h"
#include "p_acs.h"
#include "s_sndseq.h"
#include "r_interpolate.h"
// MACROS ------------------------------------------------------------------
@ -92,6 +93,8 @@
// Number of sectors to mark for each step.
#define SECTORSTEPSIZE 32
#define POLYSTEPSIZE 120
#define SIDEDEFSTEPSIZE 240
#define GCSTEPSIZE 1024u
#define GCSWEEPMAX 40
@ -107,9 +110,11 @@ class DSectorMarker : public DObject
{
DECLARE_CLASS(DSectorMarker, DObject)
public:
DSectorMarker() : SecNum(0) {}
DSectorMarker() : SecNum(0),PolyNum(0),SideNum(0) {}
size_t PropagateMark();
int SecNum;
int PolyNum;
int SideNum;
};
IMPLEMENT_CLASS(DSectorMarker)
@ -231,6 +236,7 @@ static DObject **SweepList(DObject **p, size_t count, size_t *finalize_count)
// thinker pointer is changed. This seems easier and perfectly reasonable, since
// a live thinker that isn't on a thinker list isn't much of a thinker.
assert(!curr->IsKindOf(RUNTIME_CLASS(DThinker)) || (curr->ObjectFlags & OF_Sentinel));
assert(!curr->IsKindOf(RUNTIME_CLASS(DInterpolation)));
curr->Destroy();
}
curr->ObjectFlags |= OF_Cleanup;
@ -600,11 +606,11 @@ void DelSoftRoot(DObject *obj)
size_t DSectorMarker::PropagateMark()
{
int i;
int marked = 0;
bool moretodo = false;
if (sectors == NULL)
if (sectors != NULL)
{
return 0;
}
for (i = 0; i < SECTORSTEPSIZE && SecNum + i < numsectors; ++i)
{
sector_t *sec = &sectors[SecNum + i];
@ -615,17 +621,51 @@ size_t DSectorMarker::PropagateMark()
GC::Mark(sec->floordata);
GC::Mark(sec->ceilingdata);
GC::Mark(sec->lightingdata);
for(int j=0;j<4;j++) GC::Mark(sec->interpolations[j]);
}
// If there are more sectors to mark, put ourself back into the gray
// list.
marked += i * sizeof(sector_t);
if (SecNum + i < numsectors)
{
SecNum += i;
moretodo = true;
}
}
if (!moretodo && polyobjs != NULL)
{
for (i = 0; i < POLYSTEPSIZE && PolyNum + i < po_NumPolyobjs; ++i)
{
GC::Mark(polyobjs[PolyNum + i].interpolation);
}
marked += i * sizeof(FPolyObj);
if (PolyNum + i < po_NumPolyobjs)
{
PolyNum += i;
moretodo = true;
}
}
if (!moretodo && sides != NULL)
{
for (i = 0; i < SIDEDEFSTEPSIZE && SideNum + i < numsides; ++i)
{
side_t *side = &sides[SideNum + i];
for(int j=0;j<3;j++) GC::Mark(side->textures[j].interpolation);
}
marked += i * sizeof(side_t);
if (SideNum + i < numsides)
{
SideNum += i;
moretodo = true;
}
}
// If there are more sectors to mark, put ourself back into the gray
// list.
if (moretodo)
{
Black2Gray();
GCNext = GC::Gray;
GC::Gray = this;
}
return i * sizeof(sector_t);
return marked;
}
//==========================================================================

View file

@ -75,6 +75,7 @@
#include "sbarinfo.h"
#include "r_translate.h"
#include "p_lnspec.h"
#include "r_interpolate.h"
#include "gi.h"
@ -2753,6 +2754,7 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
}
FBehavior::StaticSerializeModuleStates (arc);
if (arc.IsLoading()) interpolator.ClearInterpolations();
P_SerializeThinkers (arc, hubLoad);
P_SerializeWorld (arc);
P_SerializePolyobjs (arc);

View file

@ -246,8 +246,8 @@ void DSBarInfo::Draw (EHudState state)
popbar = STBAR_POPUPKEYS;
else if(currentPopup == POP_Status)
popbar = STBAR_POPUPSTATUS;
doCommands(SBarInfoScript->huds[popbar], SBarInfoScript->popups[currentPopup].getXOffset(), SBarInfoScript->popups[currentPopup].getYOffset(),
SBarInfoScript->popups[currentPopup].getAlpha(SBarInfoScript->huds[popbar].alpha));
doCommands(SBarInfoScript->huds[popbar], SBarInfoScript->popups[currentPopup-1].getXOffset(), SBarInfoScript->popups[currentPopup-1].getYOffset(),
SBarInfoScript->popups[currentPopup-1].getAlpha(SBarInfoScript->huds[popbar].alpha));
}
}
@ -321,12 +321,12 @@ void DSBarInfo::Tick ()
MugShot.Tick(CPlayer);
if(currentPopup != POP_None)
{
SBarInfoScript->popups[currentPopup].tick();
if(SBarInfoScript->popups[currentPopup].opened == false && SBarInfoScript->popups[currentPopup].isDoneMoving())
SBarInfoScript->popups[currentPopup-1].tick();
if(SBarInfoScript->popups[currentPopup-1].opened == false && SBarInfoScript->popups[currentPopup-1].isDoneMoving())
{
currentPopup = pendingPopup;
if(currentPopup != POP_None)
SBarInfoScript->popups[currentPopup].open();
SBarInfoScript->popups[currentPopup-1].open();
}
}
}
@ -351,13 +351,13 @@ void DSBarInfo::ShowPop(int popnum)
else
pendingPopup = POP_None;
if(currentPopup != POP_None)
SBarInfoScript->popups[currentPopup].close();
SBarInfoScript->popups[currentPopup-1].close();
else
{
currentPopup = pendingPopup;
pendingPopup = POP_None;
if(currentPopup != POP_None)
SBarInfoScript->popups[currentPopup].open();
SBarInfoScript->popups[currentPopup-1].open();
}
}

View file

@ -746,9 +746,9 @@ static void DrawCoordinates(player_t * CPlayer)
z = P_PointInSector(x, y)->floorplane.ZatPoint(x, y);
}
int vwidth = con_scaletext!=2? SCREENWIDTH : SCREENWIDTH/2;
int vheight = con_scaletext!=2? SCREENHEIGHT : SCREENHEIGHT/2;
int xpos = vwidth - SmallFont->StringWidth("X:-99999");
int vwidth = con_scaletext==0? SCREENWIDTH : SCREENWIDTH/2;
int vheight = con_scaletext==0? SCREENHEIGHT : SCREENHEIGHT/2;
int xpos = vwidth - SmallFont->StringWidth("X: -00000")-6;
int ypos = 18;
sprintf(coordstr, "X: %d", x>>FRACBITS);

View file

@ -1120,21 +1120,46 @@ void DBaseStatusBar::Draw (EHudState state)
if (idmypos)
{ // Draw current coordinates
int height = screen->Font->GetHeight();
int y = ::ST_Y - height;
char labels[3] = { 'X', 'Y', 'Z' };
fixed_t *value;
int i;
int vwidth;
int vheight;
int xpos;
int y;
if (con_scaletext == 0)
{
vwidth = SCREENWIDTH;
vheight = SCREENHEIGHT;
xpos = vwidth - 80;
y = ::ST_Y - height;
}
else
{
vwidth = SCREENWIDTH/2;
vheight = SCREENHEIGHT/2;
xpos = vwidth - SmallFont->StringWidth("X: -00000")-6;
y = ::ST_Y/2 - height;
}
if (gameinfo.gametype == GAME_Strife)
{
if (con_scaletext == 0)
y -= height * 4;
else
y -= height * 2;
}
value = &CPlayer->mo->z;
for (i = 2, value = &CPlayer->mo->z; i >= 0; y -= height, --value, --i)
{
sprintf (line, "%c: %d", labels[i], *value >> FRACBITS);
screen->DrawText (CR_GREEN, SCREENWIDTH - 80, y, line, TAG_DONE);
screen->DrawText (CR_GREEN, xpos, y, line,
DTA_KeepRatio, true,
DTA_VirtualWidth, vwidth, DTA_VirtualHeight, vheight,
TAG_DONE);
BorderNeedRefresh = screen->GetPageCount();
}
}

View file

@ -131,13 +131,7 @@ sector_t * gl_FakeFlat(sector_t * sec, sector_t * dest, bool back)
if (!back)
{
dest->floorpic = diffTex ? sec->floorpic : s->floorpic;
dest->floor_xoffs = s->floor_xoffs;
dest->floor_yoffs = s->floor_yoffs;
dest->floor_xscale = s->floor_xscale;
dest->floor_yscale = s->floor_yscale;
dest->floor_angle = s->floor_angle;
dest->base_floor_angle = s->base_floor_angle;
dest->base_floor_yoffs = s->base_floor_yoffs;
dest->planes[sector_t::floor].xform = s->planes[sector_t::floor].xform;
dest->ceilingplane = s->floorplane;
@ -148,25 +142,13 @@ sector_t * gl_FakeFlat(sector_t * sec, sector_t * dest, bool back)
//dest->floorplane.FlipVert ();
//dest->floorplane.ChangeHeight (+1);
dest->ceilingpic = dest->floorpic;
dest->ceiling_xoffs = dest->floor_xoffs;
dest->ceiling_yoffs = dest->floor_yoffs;
dest->ceiling_xscale = dest->floor_xscale;
dest->ceiling_yscale = dest->floor_yscale;
dest->ceiling_angle = dest->floor_angle;
dest->base_ceiling_angle = dest->base_floor_angle;
dest->base_ceiling_yoffs = dest->base_floor_yoffs;
dest->planes[sector_t::ceiling].xform = dest->planes[sector_t::floor].xform;
}
else
{
dest->ceilingpic = diffTex ? s->floorpic : s->ceilingpic;
dest->ceiling_xoffs = s->ceiling_xoffs;
dest->ceiling_yoffs = s->ceiling_yoffs;
dest->ceiling_xscale = s->ceiling_xscale;
dest->ceiling_yscale = s->ceiling_yscale;
dest->ceiling_angle = s->ceiling_angle;
dest->base_ceiling_angle = s->base_ceiling_angle;
dest->base_ceiling_yoffs = s->base_ceiling_yoffs;
dest->planes[sector_t::ceiling].xform = s->planes[sector_t::ceiling].xform;
}
if (!(s->MoreFlags & SECF_NOFAKELIGHT))
@ -192,23 +174,13 @@ sector_t * gl_FakeFlat(sector_t * sec, sector_t * dest, bool back)
{
dest->ceilingpic = diffTex ? sec->ceilingpic : s->ceilingpic;
dest->floorpic = s->ceilingpic;
dest->floor_xoffs = dest->ceiling_xoffs = s->ceiling_xoffs;
dest->floor_yoffs = dest->ceiling_yoffs = s->ceiling_yoffs;
dest->floor_xscale = dest->ceiling_xscale = s->ceiling_xscale;
dest->floor_yscale = dest->ceiling_yscale = s->ceiling_yscale;
dest->floor_angle = dest->ceiling_angle = s->ceiling_angle;
dest->base_floor_angle = dest->base_ceiling_angle = s->base_ceiling_angle;
dest->base_floor_yoffs = dest->base_ceiling_yoffs = s->base_ceiling_yoffs;
dest->planes[sector_t::ceiling].xform = dest->planes[sector_t::floor].xform = s->planes[sector_t::ceiling].xform;
if (s->floorpic != skyflatnum)
{
dest->ceilingplane = sec->ceilingplane;
dest->floorpic = s->floorpic;
dest->floor_xoffs = s->floor_xoffs;
dest->floor_yoffs = s->floor_yoffs;
dest->floor_xscale = s->floor_xscale;
dest->floor_yscale = s->floor_yscale;
dest->floor_angle = s->floor_angle;
dest->planes[sector_t::floor].xform = s->planes[sector_t::floor].xform;
}
if (!(s->MoreFlags & SECF_NOFAKELIGHT))

View file

@ -672,8 +672,8 @@ void gl_SetSpriteLighting(FRenderStyle style, AActor *thing, int lightlevel, int
{
ThingColor = thing->fillcolor;
}
gl_ModifyColor(ThingColor.r, ThingColor.g, ThingColor.b, cm->LightColor.a);
}
gl_ModifyColor(ThingColor.r, ThingColor.g, ThingColor.b, cm->LightColor.a);
// This doesn't work like in the software renderer.
if (style.Flags & STYLEF_InvertSource)

View file

@ -1264,11 +1264,11 @@ void GLDrawInfo::CollectSectorStacksCeiling(subsector_t * sub, sector_t * anchor
me->ceilingplane != anchor->ceilingplane ||
GetCeilingLight(me) != GetCeilingLight(anchor) ||
me->ColorMap != anchor->ColorMap ||
me->ceiling_xoffs != anchor->ceiling_xoffs ||
me->ceiling_yoffs + me->base_ceiling_yoffs != anchor->ceiling_yoffs + anchor->base_ceiling_yoffs ||
me->ceiling_xscale != anchor->ceiling_xscale ||
me->ceiling_yscale != anchor->ceiling_yscale ||
me->ceiling_angle + me->base_ceiling_angle != anchor->ceiling_angle + anchor->base_ceiling_angle)
me->GetXOffset(sector_t::ceiling) != anchor->GetXOffset(sector_t::ceiling) ||
me->GetYOffset(sector_t::ceiling) != anchor->GetYOffset(sector_t::ceiling) ||
me->GetXScale(sector_t::ceiling) != anchor->GetXScale(sector_t::ceiling) ||
me->GetYScale(sector_t::ceiling) != anchor->GetYScale(sector_t::ceiling) ||
me->GetAngle(sector_t::ceiling) != anchor->GetAngle(sector_t::ceiling))
{
// different visplane so it can't belong to this stack
return;
@ -1312,11 +1312,11 @@ void GLDrawInfo::CollectSectorStacksFloor(subsector_t * sub, sector_t * anchor)
me->floorplane != anchor->floorplane ||
GetFloorLight(me) != GetFloorLight(anchor) ||
me->ColorMap != anchor->ColorMap ||
me->floor_xoffs != anchor->floor_xoffs ||
me->floor_yoffs + me->base_floor_yoffs != anchor->floor_yoffs + anchor->base_floor_yoffs ||
me->floor_xscale != anchor->floor_xscale ||
me->floor_yscale != anchor->floor_yscale ||
me->floor_angle + me->base_floor_angle != anchor->floor_angle + anchor->base_floor_angle)
me->GetXOffset(sector_t::floor) != anchor->GetXOffset(sector_t::floor) ||
me->GetYOffset(sector_t::floor) != anchor->GetYOffset(sector_t::floor) ||
me->GetXScale(sector_t::floor) != anchor->GetXScale(sector_t::floor) ||
me->GetYScale(sector_t::floor) != anchor->GetYScale(sector_t::floor) ||
me->GetAngle(sector_t::floor) != anchor->GetAngle(sector_t::floor))
{
// different visplane so it can't belong to this stack
return;

View file

@ -80,27 +80,22 @@ struct GLSectorPlane
void GetFromSector(sector_t * sec, bool ceiling)
{
xoffs = sec->GetXOffset(ceiling);
yoffs = sec->GetYOffset(ceiling);
xscale = sec->GetXScale(ceiling);
yscale = sec->GetYScale(ceiling);
angle = sec->GetAngle(ceiling);
if (ceiling)
{
texture = sec->ceilingpic;
plane = sec->ceilingplane;
texheight = sec->ceilingtexz;
xoffs = sec->ceiling_xoffs;
yoffs = sec->ceiling_yoffs + sec->base_ceiling_yoffs;
xscale = sec->ceiling_xscale;
yscale = sec->ceiling_yscale;
angle = sec->ceiling_angle + sec->base_ceiling_angle;
}
else
{
texture = sec->floorpic;
plane = sec->floorplane;
texheight = sec->floortexz;
xoffs = sec->floor_xoffs;
yoffs = sec->floor_yoffs + sec->base_floor_yoffs;
xscale = sec->floor_xscale;
yscale = sec->floor_yscale;
angle = sec->floor_angle + sec->base_floor_angle;
}
}
};

View file

@ -288,6 +288,7 @@ enum
ADEF_MaxDropOffHeight,
ADEF_MaxStepHeight,
ADEF_BounceFactor,
ADEF_WallBounceFactor,
ADEF_BounceCount,
ADEF_FloatSpeed,
ADEF_RDFactor,

View file

@ -223,6 +223,7 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint)
case ADEF_MaxDropOffHeight: actor->MaxDropOffHeight = dataint; break;
case ADEF_MaxStepHeight: actor->MaxStepHeight = dataint; break;
case ADEF_BounceFactor: actor->bouncefactor = dataint; break;
case ADEF_WallBounceFactor: actor->wallbouncefactor = dataint; break;
case ADEF_BounceCount: actor->bouncecount = dataint; break;
case ADEF_RDFactor: sgClass->Meta.SetMetaFixed (AMETA_RDFactor, dataint); break;
case ADEF_FXFlags: actor->effects = dataint; break;

View file

@ -265,6 +265,7 @@ public:
#define PROP_MaxDropOffHeight(x) ADD_FIXD_PROP(ADEF_MaxDropOffHeight,x)
#define PROP_MaxStepHeight(x) ADD_FIXD_PROP(ADEF_MaxStepHeight,x)
#define PROP_BounceFactor(x) ADD_LONG_PROP(ADEF_BounceFactor,x)
#define PROP_WallBounceFactor(x) ADD_LONG_PROP(ADEF_WallBounceFactor,x)
#define PROP_BounceCount(x) ADD_LONG_PROP(ADEF_BounceCount,x)
#define PROP_RadiusdamageFactor(x) ADD_LONG_PROP(ADEF_RDFactor,x)
#define PROP_FXFlags(x) ADD_LONG_PROP(ADEF_FXFlags,x)

View file

@ -5073,6 +5073,7 @@ int DLevelScript::RunScript ()
sky2texture = TexMan.GetTexture (sky2name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_ReturnFirst);
}
R_InitSkyMap ();
sp -= 2;
}
break;

View file

@ -376,10 +376,10 @@ static void LoadSectors (sectortype *bsec)
sec->floorplane.ic = FRACUNIT;
sprintf (tnam, "BTIL%04d", LittleShort(bsec->floorpicnum));
sec->floorpic = TexMan.GetTexture (tnam, FTexture::TEX_Build);
sec->floor_xscale = (bsec->floorstat & 8) ? FRACUNIT*2 : FRACUNIT;
sec->floor_yscale = (bsec->floorstat & 8) ? FRACUNIT*2 : FRACUNIT;
sec->floor_xoffs = (bsec->floorxpanning << FRACBITS) + (32 << FRACBITS);
sec->floor_yoffs = bsec->floorypanning << FRACBITS;
sec->SetXScale(sector_t::floor, (bsec->floorstat & 8) ? FRACUNIT*2 : FRACUNIT);
sec->SetYScale(sector_t::floor, (bsec->floorstat & 8) ? FRACUNIT*2 : FRACUNIT);
sec->SetXOffset(sector_t::floor, (bsec->floorxpanning << FRACBITS) + (32 << FRACBITS));
sec->SetYOffset(sector_t::floor, bsec->floorypanning << FRACBITS);
sec->FloorLight = SHADE2LIGHT (bsec->floorshade);
sec->FloorFlags = SECF_ABSLIGHTING;
@ -394,10 +394,10 @@ static void LoadSectors (sectortype *bsec)
sky1texture = sky2texture = sec->ceilingpic;
sec->ceilingpic = skyflatnum;
}
sec->ceiling_xscale = (bsec->ceilingstat & 8) ? FRACUNIT*2 : FRACUNIT;
sec->ceiling_yscale = (bsec->ceilingstat & 8) ? FRACUNIT*2 : FRACUNIT;
sec->ceiling_xoffs = (bsec->ceilingxpanning << FRACBITS) + (32 << FRACBITS);
sec->ceiling_yoffs = bsec->ceilingypanning << FRACBITS;
sec->SetXScale(sector_t::ceiling, (bsec->ceilingstat & 8) ? FRACUNIT*2 : FRACUNIT);
sec->SetYScale(sector_t::ceiling, (bsec->ceilingstat & 8) ? FRACUNIT*2 : FRACUNIT);
sec->SetXOffset(sector_t::ceiling, (bsec->ceilingxpanning << FRACBITS) + (32 << FRACBITS));
sec->SetYOffset(sector_t::ceiling, bsec->ceilingypanning << FRACBITS);
sec->CeilingLight = SHADE2LIGHT (bsec->ceilingshade);
sec->CeilingFlags = SECF_ABSLIGHTING;
@ -414,30 +414,30 @@ static void LoadSectors (sectortype *bsec)
if (bsec->floorstat & 4)
{
sec->floor_angle = ANGLE_90;
sec->floor_xscale = -sec->floor_xscale;
sec->SetAngle(sector_t::floor, ANGLE_90);
sec->SetXScale(sector_t::floor, -sec->GetXScale(sector_t::floor));
}
if (bsec->floorstat & 16)
{
sec->floor_xscale = -sec->floor_xscale;
sec->SetXScale(sector_t::floor, -sec->GetXScale(sector_t::floor));
}
if (bsec->floorstat & 32)
{
sec->floor_yscale = -sec->floor_yscale;
sec->SetYScale(sector_t::floor, -sec->GetYScale(sector_t::floor));
}
if (bsec->ceilingstat & 4)
{
sec->ceiling_angle = ANGLE_90;
sec->floor_yscale = -sec->floor_yscale;
sec->SetAngle(sector_t::ceiling, ANGLE_90);
sec->SetYScale(sector_t::ceiling, -sec->GetYScale(sector_t::ceiling));
}
if (bsec->ceilingstat & 16)
{
sec->ceiling_xscale = -sec->ceiling_xscale;
sec->SetXScale(sector_t::ceiling, -sec->GetXScale(sector_t::ceiling));
}
if (bsec->ceilingstat & 32)
{
sec->ceiling_yscale = -sec->ceiling_yscale;
sec->SetYScale(sector_t::ceiling, -sec->GetYScale(sector_t::ceiling));
}
}
}
@ -512,7 +512,7 @@ static void LoadWalls (walltype *walls, int numwalls, sectortype *bsec)
}
sides[i].TexelLength = walls[i].xrepeat * 8;
sides[i].Light = SHADE2LIGHT(walls[i].shade);
sides[i].SetLight(SHADE2LIGHT(walls[i].shade));
sides[i].Flags = WALLF_ABSLIGHTING;
sides[i].RightSide = walls[i].point2;
sides[walls[i].point2].LeftSide = i;

View file

@ -1558,10 +1558,11 @@ FUNC(LS_ACS_Execute)
{
level_info_t *info;
if ( (arg1 == 0) || !(info = FindLevelByNum (arg1)) )
if (arg1 == 0)
return P_StartScript (it, ln, arg0, level.mapname, backSide, arg2, arg3, arg4, false, false);
else
else if ((info = FindLevelByNum (arg1)) )
return P_StartScript (it, ln, arg0, info->mapname, backSide, arg2, arg3, arg4, false, false);
else return false;
}
FUNC(LS_ACS_ExecuteAlways)
@ -1569,10 +1570,11 @@ FUNC(LS_ACS_ExecuteAlways)
{
level_info_t *info;
if ( (arg1 == 0) || !(info = FindLevelByNum (arg1)) )
if (arg1 == 0)
return P_StartScript (it, ln, arg0, level.mapname, backSide, arg2, arg3, arg4, true, false);
else
else if ((info = FindLevelByNum (arg1)) )
return P_StartScript (it, ln, arg0, info->mapname, backSide, arg2, arg3, arg4, true, false);
else return false;
}
FUNC(LS_ACS_LockedExecute)
@ -1607,9 +1609,9 @@ FUNC(LS_ACS_Suspend)
{
level_info_t *info;
if ( (arg1 == 0) || !(info = FindLevelByNum (arg1)) )
if (arg1 == 0)
P_SuspendScript (arg0, level.mapname);
else
else if ((info = FindLevelByNum (arg1)) )
P_SuspendScript (arg0, info->mapname);
return true;
@ -1620,9 +1622,9 @@ FUNC(LS_ACS_Terminate)
{
level_info_t *info;
if ( (arg1 == 0) || !(info = FindLevelByNum (arg1)) )
if (arg1 == 0)
P_TerminateScript (arg0, level.mapname);
else
else if ((info = FindLevelByNum (arg1)) )
P_TerminateScript (arg0, info->mapname);
return true;
@ -2158,8 +2160,8 @@ FUNC(LS_Sector_SetCeilingPanning)
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
sectors[secnum].ceiling_xoffs = xofs;
sectors[secnum].ceiling_yoffs = yofs;
sectors[secnum].SetXOffset(sector_t::ceiling, xofs);
sectors[secnum].SetYOffset(sector_t::ceiling, yofs);
}
return true;
}
@ -2173,8 +2175,8 @@ FUNC(LS_Sector_SetFloorPanning)
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
sectors[secnum].floor_xoffs = xofs;
sectors[secnum].floor_yoffs = yofs;
sectors[secnum].SetXOffset(sector_t::floor, xofs);
sectors[secnum].SetYOffset(sector_t::floor, yofs);
}
return true;
}
@ -2194,9 +2196,9 @@ FUNC(LS_Sector_SetCeilingScale)
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
if (xscale)
sectors[secnum].ceiling_xscale = xscale;
sectors[secnum].SetXScale(sector_t::ceiling, arg1);
if (yscale)
sectors[secnum].ceiling_yscale = yscale;
sectors[secnum].SetYScale(sector_t::ceiling, arg2);
}
return true;
}
@ -2214,9 +2216,9 @@ FUNC(LS_Sector_SetFloorScale2)
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
if (arg1)
sectors[secnum].floor_xscale = arg1;
sectors[secnum].SetXScale(sector_t::floor, arg1);
if (arg2)
sectors[secnum].floor_yscale = arg2;
sectors[secnum].SetXScale(sector_t::floor, arg1);
}
return true;
}
@ -2234,9 +2236,9 @@ FUNC(LS_Sector_SetCeilingScale2)
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
if (arg1)
sectors[secnum].ceiling_xscale = arg1;
sectors[secnum].SetXScale(sector_t::ceiling, arg1);
if (arg2)
sectors[secnum].ceiling_yscale = arg2;
sectors[secnum].SetXScale(sector_t::ceiling, arg1);
}
return true;
}
@ -2256,9 +2258,9 @@ FUNC(LS_Sector_SetFloorScale)
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
if (xscale)
sectors[secnum].floor_xscale = xscale;
sectors[secnum].SetXScale(sector_t::floor, arg1);
if (yscale)
sectors[secnum].floor_yscale = yscale;
sectors[secnum].SetXScale(sector_t::floor, arg1);
}
return true;
}
@ -2272,8 +2274,8 @@ FUNC(LS_Sector_SetRotation)
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
sectors[secnum].floor_angle = floor;
sectors[secnum].ceiling_angle = ceiling;
sectors[secnum].SetAngle(sector_t::floor, floor);
sectors[secnum].SetAngle(sector_t::ceiling, ceiling);
}
return true;
}

View file

@ -2397,7 +2397,7 @@ bool FSlide::BounceWall (AActor *mo)
deltaangle >>= ANGLETOFINESHIFT;
movelen = P_AproxDistance (mo->momx, mo->momy);
movelen = (movelen * 192) >> 8; // friction
movelen = FixedMul(movelen, mo->wallbouncefactor);
FBoundingBox box(mo->x, mo->y, mo->radius);
if (box.BoxOnLineSide (line) == -1)

View file

@ -315,6 +315,7 @@ void AActor::Serialize (FArchive &arc)
<< MaxDropOffHeight
<< MaxStepHeight
<< bouncefactor
<< wallbouncefactor
<< bouncecount
<< maxtargetrange
<< meleethreshold
@ -3137,7 +3138,7 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
return false;
}
if (Sector->MoreFlags & SECF_UNDERWATERMASK)
if (Sector->MoreFlags & SECF_UNDERWATER) // intentionally not SECF_UNDERWATERMASK
{
waterlevel = 3;
}
@ -3147,7 +3148,7 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
if (hsec != NULL && !(hsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
{
fh = hsec->floorplane.ZatPoint (x, y);
//if (hsec->MoreFlags & SECF_UNDERWATERMASK) // also check Boom-style non-swimmable sectors!
//if (hsec->MoreFlags & SECF_UNDERWATERMASK) // also check Boom-style non-swimmable sectors
{
if (z < fh)
{
@ -3172,7 +3173,7 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
}
}
// even non-swimmable deep water must be checked here to do the splashes correctly
// But the water level must be reset when this function returns!
// But the water level must be reset when this function returns
if (!(hsec->MoreFlags&SECF_UNDERWATERMASK)) reset=true;
}
else
@ -3280,6 +3281,7 @@ BEGIN_DEFAULTS (AActor, Any, -1, 0)
PROP_MaxDropOffHeight(24)
PROP_MaxStepHeight(24)
PROP_BounceFactor(FRACUNIT*7/10)
PROP_WallBounceFactor(FRACUNIT*3/4)
PROP_BounceCount(-1)
PROP_FloatSpeed(4)
PROP_Gravity(FRACUNIT)

View file

@ -311,13 +311,8 @@ void P_SerializeWorld (FArchive &arc)
<< sec->stairlock
<< sec->prevsec
<< sec->nextsec
<< sec->floor_xoffs << sec->floor_yoffs
<< sec->ceiling_xoffs << sec->ceiling_yoffs
<< sec->floor_xscale << sec->floor_yscale
<< sec->ceiling_xscale << sec->ceiling_yscale
<< sec->floor_angle << sec->ceiling_angle
<< sec->base_ceiling_angle << sec->base_ceiling_yoffs
<< sec->base_floor_angle << sec->base_floor_yoffs
<< sec->planes[sector_t::floor]
<< sec->planes[sector_t::ceiling]
<< sec->heightsec
<< sec->bottommap << sec->midmap << sec->topmap
<< sec->gravity
@ -429,6 +424,13 @@ FArchive &operator<< (FArchive &arc, side_t::part &p)
return arc;
}
FArchive &operator<< (FArchive &arc, sector_t::splane &p)
{
arc << p.xform.xoffs << p.xform.yoffs << p.xform.xscale << p.xform.yscale
<< p.xform.angle << p.xform.base_yoffs << p.xform.base_angle;
return arc;
}
//
// Thinkers

View file

@ -1250,10 +1250,10 @@ void P_LoadSectors (MapData * map)
ss->prevsec = -1; // stair retriggering until build completes
// killough 3/7/98:
ss->floor_xscale = FRACUNIT; // [RH] floor and ceiling scaling
ss->floor_yscale = FRACUNIT;
ss->ceiling_xscale = FRACUNIT;
ss->ceiling_yscale = FRACUNIT;
ss->SetXScale(sector_t::floor, FRACUNIT); // [RH] floor and ceiling scaling
ss->SetYScale(sector_t::floor, FRACUNIT);
ss->SetXScale(sector_t::ceiling, FRACUNIT);
ss->SetYScale(sector_t::ceiling, FRACUNIT);
ss->heightsec = NULL; // sector used to get floor and ceiling height
// killough 3/7/98: end changes
@ -1532,6 +1532,11 @@ void P_SpawnThings (int position)
{
SpawnMapThing (i, &MapThingsConverted[i], position);
}
for(int i=0; i<MAXPLAYERS; i++)
{
if (playeringame[i])
P_PlayerStartStomp(players[i].mo);
}
}

View file

@ -807,12 +807,12 @@ void DWallLightTransfer::DoTransfer (BYTE lightlevel, int target, BYTE flags)
if (flags & WLF_SIDE1 && line->sidenum[0]!=NO_SIDE)
{
sides[line->sidenum[0]].Light = lightlevel;
sides[line->sidenum[0]].SetLight(lightlevel);
}
if (flags & WLF_SIDE2 && line->sidenum[1]!=NO_SIDE)
{
sides[line->sidenum[1]].Light = lightlevel;
sides[line->sidenum[1]].SetLight(lightlevel);
}
}
}
@ -976,7 +976,7 @@ void P_SpawnSpecials (void)
// killough 3/7/98:
// support for drawn heights coming from different sector
case Transfer_Heights:
sec = sides[*lines[i].sidenum].sector;
sec = sides[lines[i].sidenum[0]].sector;
if (lines[i].args[1] & 2)
{
sec->MoreFlags |= SECF_FAKEFLOORONLY;
@ -1154,13 +1154,13 @@ void DScroller::Tick ()
break;
case sc_floor: // killough 3/7/98: Scroll floor texture
sectors[m_Affectee].floor_xoffs += dx;
sectors[m_Affectee].floor_yoffs += dy;
sectors[m_Affectee].AddXOffset(sector_t::floor, dx);
sectors[m_Affectee].AddYOffset(sector_t::floor, dy);
break;
case sc_ceiling: // killough 3/7/98: Scroll ceiling texture
sectors[m_Affectee].ceiling_xoffs += dx;
sectors[m_Affectee].ceiling_yoffs += dy;
sectors[m_Affectee].AddXOffset(sector_t::ceiling, dx);
sectors[m_Affectee].AddYOffset(sector_t::ceiling, dy);
break;
// [RH] Don't actually carry anything here. That happens later.

View file

@ -204,6 +204,11 @@ struct UDMFParser
return FLOAT2FIXED(CheckFloat(key));
}
angle_t CheckAngle(const char *key)
{
return angle_t(CheckFloat(key) * ANGLE_90 / 90.);
}
bool CheckBool(const char *key)
{
if (sc.TokenType == TK_True) return true;
@ -724,7 +729,7 @@ struct UDMFParser
break;
case NAME_light:
sd->Light = CheckInt(key);
sd->SetLight(CheckInt(key));
break;
case NAME_lightabsolute:
@ -767,10 +772,10 @@ struct UDMFParser
memset(sec, 0, sizeof(*sec));
sec->lightlevel = 160;
sec->floor_xscale = FRACUNIT; // [RH] floor and ceiling scaling
sec->floor_yscale = FRACUNIT;
sec->ceiling_xscale = FRACUNIT;
sec->ceiling_yscale = FRACUNIT;
sec->SetXScale(sector_t::floor, FRACUNIT); // [RH] floor and ceiling scaling
sec->SetYScale(sector_t::floor, FRACUNIT);
sec->SetXScale(sector_t::ceiling, FRACUNIT);
sec->SetYScale(sector_t::ceiling, FRACUNIT);
sec->oldspecial = !!(sec->special&SECRET_MASK);
sec->thinglist = NULL;
sec->touching_thinglist = NULL; // phares 3/14/98
@ -835,43 +840,43 @@ struct UDMFParser
if (namespace_bits & (Zd|Zdt)) switch(key)
{
case NAME_Xpanningfloor:
sec->floor_xoffs = CheckFixed(key);
sec->SetXOffset(sector_t::floor, CheckFixed(key));
break;
case NAME_Ypanningfloor:
sec->floor_yoffs = CheckFixed(key);
sec->SetYOffset(sector_t::floor, CheckFixed(key));
break;
case NAME_Xpanningceiling:
sec->ceiling_xoffs = CheckFixed(key);
sec->SetXOffset(sector_t::ceiling, CheckFixed(key));
break;
case NAME_Ypanningceiling:
sec->ceiling_yoffs = CheckFixed(key);
sec->SetYOffset(sector_t::ceiling, CheckFixed(key));
break;
case NAME_Xscalefloor:
sec->floor_xscale = CheckFixed(key);
sec->SetXScale(sector_t::floor, CheckFixed(key));
break;
case NAME_Yscalefloor:
sec->floor_yscale = CheckFixed(key);
sec->SetYScale(sector_t::floor, CheckFixed(key));
break;
case NAME_Xscaleceiling:
sec->ceiling_xscale = CheckFixed(key);
sec->SetXScale(sector_t::ceiling, CheckFixed(key));
break;
case NAME_Yscaleceiling:
sec->ceiling_yscale = CheckFixed(key);
sec->SetYScale(sector_t::ceiling, CheckFixed(key));
break;
case NAME_Rotationfloor:
sec->floor_angle = CheckFixed(key);
sec->SetAngle(sector_t::floor, CheckAngle(key));
break;
case NAME_Rotationceiling:
sec->ceiling_angle = CheckFixed(key);
sec->SetAngle(sector_t::ceiling, CheckAngle(key));
break;
case NAME_Lightfloor:

View file

@ -456,13 +456,7 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
if ((underwater && !back) || doorunderwater)
{ // head-below-floor hack
tempsec->floorpic = diffTex ? sec->floorpic : s->floorpic;
tempsec->floor_xoffs = s->floor_xoffs;
tempsec->floor_yoffs = s->floor_yoffs;
tempsec->floor_xscale = s->floor_xscale;
tempsec->floor_yscale = s->floor_yscale;
tempsec->floor_angle = s->floor_angle;
tempsec->base_floor_angle = s->base_floor_angle;
tempsec->base_floor_yoffs = s->base_floor_yoffs;
tempsec->planes[sector_t::floor].xform = s->planes[sector_t::floor].xform;
tempsec->ceilingplane = s->floorplane;
tempsec->ceilingplane.FlipVert ();
@ -473,24 +467,12 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
tempsec->floorplane.FlipVert ();
tempsec->floorplane.ChangeHeight (+1);
tempsec->ceilingpic = tempsec->floorpic;
tempsec->ceiling_xoffs = tempsec->floor_xoffs;
tempsec->ceiling_yoffs = tempsec->floor_yoffs;
tempsec->ceiling_xscale = tempsec->floor_xscale;
tempsec->ceiling_yscale = tempsec->floor_yscale;
tempsec->ceiling_angle = tempsec->floor_angle;
tempsec->base_ceiling_angle = tempsec->base_floor_angle;
tempsec->base_ceiling_yoffs = tempsec->base_floor_yoffs;
tempsec->planes[sector_t::ceiling].xform = tempsec->planes[sector_t::floor].xform;
}
else
{
tempsec->ceilingpic = diffTex ? s->floorpic : s->ceilingpic;
tempsec->ceiling_xoffs = s->ceiling_xoffs;
tempsec->ceiling_yoffs = s->ceiling_yoffs;
tempsec->ceiling_xscale = s->ceiling_xscale;
tempsec->ceiling_yscale = s->ceiling_yscale;
tempsec->ceiling_angle = s->ceiling_angle;
tempsec->base_ceiling_angle = s->base_ceiling_angle;
tempsec->base_ceiling_yoffs = s->base_ceiling_yoffs;
tempsec->planes[sector_t::ceiling].xform = s->planes[sector_t::ceiling].xform;
}
if (!(s->MoreFlags & SECF_NOFAKELIGHT))
@ -521,23 +503,13 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
tempsec->ceilingpic = diffTex ? sec->ceilingpic : s->ceilingpic;
tempsec->floorpic = s->ceilingpic;
tempsec->floor_xoffs = tempsec->ceiling_xoffs = s->ceiling_xoffs;
tempsec->floor_yoffs = tempsec->ceiling_yoffs = s->ceiling_yoffs;
tempsec->floor_xscale = tempsec->ceiling_xscale = s->ceiling_xscale;
tempsec->floor_yscale = tempsec->ceiling_yscale = s->ceiling_yscale;
tempsec->floor_angle = tempsec->ceiling_angle = s->ceiling_angle;
tempsec->base_floor_angle = tempsec->base_ceiling_angle = s->base_ceiling_angle;
tempsec->base_floor_yoffs = tempsec->base_ceiling_yoffs = s->base_ceiling_yoffs;
tempsec->planes[sector_t::ceiling].xform = tempsec->planes[sector_t::floor].xform = s->planes[sector_t::ceiling].xform;
if (s->floorpic != skyflatnum)
{
tempsec->ceilingplane = sec->ceilingplane;
tempsec->floorpic = s->floorpic;
tempsec->floor_xoffs = s->floor_xoffs;
tempsec->floor_yoffs = s->floor_yoffs;
tempsec->floor_xscale = s->floor_xscale;
tempsec->floor_yscale = s->floor_yscale;
tempsec->floor_angle = s->floor_angle;
tempsec->planes[sector_t::floor].xform = s->planes[sector_t::floor].xform;
}
if (!(s->MoreFlags & SECF_NOFAKELIGHT))
@ -782,10 +754,10 @@ void R_AddLine (seg_t *line)
|| curline->sidedef->GetTexture(side_t::mid) != 0
// killough 3/7/98: Take flats offsets into account:
|| backsector->floor_xoffs != frontsector->floor_xoffs
|| (backsector->floor_yoffs + backsector->base_floor_yoffs) != (frontsector->floor_yoffs + backsector->base_floor_yoffs)
|| backsector->ceiling_xoffs != frontsector->ceiling_xoffs
|| (backsector->ceiling_yoffs + backsector->base_ceiling_yoffs) != (frontsector->ceiling_yoffs + frontsector->base_ceiling_yoffs)
|| backsector->GetXOffset(sector_t::floor) != frontsector->GetXOffset(sector_t::floor)
|| backsector->GetYOffset(sector_t::floor) != frontsector->GetYOffset(sector_t::floor)
|| backsector->GetXOffset(sector_t::ceiling) != frontsector->GetXOffset(sector_t::ceiling)
|| backsector->GetYOffset(sector_t::ceiling) != frontsector->GetYOffset(sector_t::ceiling)
|| backsector->FloorLight != frontsector->FloorLight
|| backsector->CeilingLight != frontsector->CeilingLight
@ -796,14 +768,14 @@ void R_AddLine (seg_t *line)
|| backsector->ColorMap != frontsector->ColorMap
// [RH] and scaling
|| backsector->floor_xscale != frontsector->floor_xscale
|| backsector->floor_yscale != frontsector->floor_yscale
|| backsector->ceiling_xscale != frontsector->ceiling_xscale
|| backsector->ceiling_yscale != frontsector->ceiling_yscale
|| backsector->GetXScale(sector_t::floor) != frontsector->GetXScale(sector_t::floor)
|| backsector->GetYScale(sector_t::floor) != frontsector->GetYScale(sector_t::floor)
|| backsector->GetXScale(sector_t::ceiling) != frontsector->GetXScale(sector_t::ceiling)
|| backsector->GetYScale(sector_t::ceiling) != frontsector->GetYScale(sector_t::ceiling)
// [RH] and rotation
|| (backsector->floor_angle + backsector->base_floor_angle) != (frontsector->floor_angle + frontsector->base_floor_angle)
|| (backsector->ceiling_angle + backsector->base_ceiling_angle) != (frontsector->ceiling_angle + frontsector->base_ceiling_angle)
|| backsector->GetAngle(sector_t::floor) != frontsector->GetAngle(sector_t::floor)
|| backsector->GetAngle(sector_t::ceiling) != frontsector->GetAngle(sector_t::ceiling)
)
{
solid = false;
@ -1078,11 +1050,11 @@ void R_Subsector (subsector_t *sub)
frontsector->sky & PL_SKYFLAT ? frontsector->sky :
frontsector->ceilingpic,
ceilinglightlevel + r_actualextralight, // killough 4/11/98
frontsector->ceiling_xoffs, // killough 3/7/98
frontsector->ceiling_yoffs + frontsector->base_ceiling_yoffs,
frontsector->ceiling_xscale,
frontsector->ceiling_yscale,
frontsector->ceiling_angle + frontsector->base_ceiling_angle,
frontsector->GetXOffset(sector_t::ceiling), // killough 3/7/98
frontsector->GetYOffset(sector_t::ceiling), // killough 3/7/98
frontsector->GetXScale(sector_t::ceiling),
frontsector->GetYScale(sector_t::ceiling),
frontsector->GetAngle(sector_t::ceiling),
frontsector->CeilingSkyBox
) : NULL;
@ -1103,11 +1075,11 @@ void R_Subsector (subsector_t *sub)
frontsector->sky & PL_SKYFLAT ? frontsector->sky :
frontsector->floorpic,
floorlightlevel + r_actualextralight, // killough 3/16/98
frontsector->floor_xoffs, // killough 3/7/98
frontsector->floor_yoffs + frontsector->base_floor_yoffs,
frontsector->floor_xscale,
frontsector->floor_yscale,
frontsector->floor_angle + frontsector->base_floor_angle,
frontsector->GetXOffset(sector_t::floor), // killough 3/7/98
frontsector->GetYOffset(sector_t::floor), // killough 3/7/98
frontsector->GetXScale(sector_t::floor),
frontsector->GetYScale(sector_t::floor),
frontsector->GetAngle(sector_t::floor),
frontsector->FloorSkyBox
) : NULL;

View file

@ -332,6 +332,21 @@ struct extsector_t
};
struct FTransform
{
// killough 3/7/98: floor and ceiling texture offsets
fixed_t xoffs, yoffs;
// [RH] floor and ceiling texture scales
fixed_t xscale, yscale;
// [RH] floor and ceiling texture rotation
angle_t angle;
// base values
fixed_t base_angle, base_yoffs;
};
struct sector_t
{
// Member functions
@ -359,6 +374,102 @@ struct sector_t
DInterpolation *SetInterpolation(int position, bool attach);
void StopInterpolation(int position);
enum
{
floor,
ceiling
};
struct splane
{
FTransform xform;
};
splane planes[2];
void SetXOffset(int pos, fixed_t o)
{
planes[pos].xform.xoffs = o;
}
void AddXOffset(int pos, fixed_t o)
{
planes[pos].xform.xoffs += o;
}
fixed_t GetXOffset(int pos) const
{
return planes[pos].xform.xoffs;
}
void SetYOffset(int pos, fixed_t o)
{
planes[pos].xform.yoffs = o;
}
void AddYOffset(int pos, fixed_t o)
{
planes[pos].xform.yoffs += o;
}
fixed_t GetYOffset(int pos, bool addbase = true) const
{
if (!addbase)
{
return planes[pos].xform.yoffs;
}
else
{
return planes[pos].xform.yoffs + planes[pos].xform.base_yoffs;
}
}
void SetXScale(int pos, fixed_t o)
{
planes[pos].xform.xscale = o;
}
fixed_t GetXScale(int pos) const
{
return planes[pos].xform.xscale;
}
void SetYScale(int pos, fixed_t o)
{
planes[pos].xform.yscale = o;
}
fixed_t GetYScale(int pos) const
{
return planes[pos].xform.yscale;
}
void SetAngle(int pos, angle_t o)
{
planes[pos].xform.angle = o;
}
angle_t GetAngle(int pos, bool addbase = true) const
{
if (!addbase)
{
return planes[pos].xform.angle;
}
else
{
return planes[pos].xform.angle + planes[pos].xform.base_angle;
}
}
void SetBase(int pos, fixed_t y, angle_t o)
{
planes[pos].xform.base_yoffs = y;
planes[pos].xform.base_angle = o;
}
// Member variables
fixed_t CenterFloor () const { return floorplane.ZatPoint (soundorg[0], soundorg[1]); }
fixed_t CenterCeiling () const { return ceilingplane.ZatPoint (soundorg[0], soundorg[1]); }
@ -370,20 +481,6 @@ struct sector_t
// [RH] give floor and ceiling even more properties
FDynamicColormap *ColorMap; // [RH] Per-sector colormap
// killough 3/7/98: floor and ceiling texture offsets
fixed_t floor_xoffs, floor_yoffs;
fixed_t ceiling_xoffs, ceiling_yoffs;
// [RH] floor and ceiling texture scales
fixed_t floor_xscale, floor_yscale;
fixed_t ceiling_xscale, ceiling_yscale;
// [RH] floor and ceiling texture rotation
angle_t floor_angle, ceiling_angle;
fixed_t base_ceiling_angle, base_ceiling_yoffs;
fixed_t base_floor_angle, base_floor_yoffs;
BYTE FloorLight, CeilingLight;
BYTE FloorFlags, CeilingFlags;
int floorpic, ceilingpic;
@ -476,6 +573,9 @@ struct sector_t
};
FArchive &operator<< (FArchive &arc, sector_t::splane &p);
struct ReverbContainer;
struct zone_t
{
@ -524,6 +624,11 @@ struct side_t
int GetLightLevel (bool foggy, int baselight) const;
void SetLight(SWORD l)
{
Light = l;
}
int GetTexture(int which) const
{
return textures[which].texture;

View file

@ -88,6 +88,7 @@ public:
DSectorScrollInterpolation() {}
DSectorScrollInterpolation(sector_t *sector, bool plane);
void Destroy();
void UpdateInterpolation();
void Restore();
void Interpolate(fixed_t smoothratio);
@ -114,6 +115,7 @@ public:
DWallScrollInterpolation() {}
DWallScrollInterpolation(side_t *side, int part);
void Destroy();
void UpdateInterpolation();
void Restore();
void Interpolate(fixed_t smoothratio);
@ -137,6 +139,7 @@ public:
DPolyobjInterpolation() {}
DPolyobjInterpolation(FPolyObj *poly);
void Destroy();
void UpdateInterpolation();
void Restore();
void Interpolate(fixed_t smoothratio);
@ -180,14 +183,6 @@ FInterpolator interpolator;
int FInterpolator::CountInterpolations ()
{
int count = 0;
DInterpolation *probe = Head;
while (probe != NULL)
{
count++;
probe = probe->Next;
}
return count;
}
@ -217,6 +212,7 @@ void FInterpolator::AddInterpolation(DInterpolation *interp)
if (Head != NULL) Head->Prev = &interp->Next;
Head = interp;
interp->Prev = &Head;
count++;
}
//==========================================================================
@ -233,6 +229,7 @@ void FInterpolator::RemoveInterpolation(DInterpolation *interp)
if (interp->Next != NULL) interp->Next->Prev = interp->Prev;
interp->Next = NULL;
interp->Prev = NULL;
count--;
}
}
@ -403,6 +400,17 @@ DSectorPlaneInterpolation::DSectorPlaneInterpolation(sector_t *_sector, bool _pl
void DSectorPlaneInterpolation::Destroy()
{
if (ceiling)
{
assert(sector->interpolations[sector_t::CeilingMove] == this);
sector->interpolations[sector_t::CeilingMove] = NULL;
}
else
{
assert(sector->interpolations[sector_t::FloorMove] == this);
sector->interpolations[sector_t::FloorMove] = NULL;
}
for(unsigned i=0; i<attached.Size(); i++)
{
attached[i]->DelRef();
@ -552,18 +560,31 @@ DSectorScrollInterpolation::DSectorScrollInterpolation(sector_t *_sector, bool _
//
//==========================================================================
void DSectorScrollInterpolation::UpdateInterpolation()
void DSectorScrollInterpolation::Destroy()
{
if (!ceiling)
if (ceiling)
{
oldx = sector->floor_xoffs;
oldy = sector->floor_yoffs;
assert(sector->interpolations[sector_t::CeilingScroll] == this);
sector->interpolations[sector_t::CeilingScroll] = NULL;
}
else
{
oldx = sector->ceiling_xoffs;
oldy = sector->ceiling_yoffs;
assert(sector->interpolations[sector_t::FloorScroll] == this);
sector->interpolations[sector_t::FloorScroll] = NULL;
}
Super::Destroy();
}
//==========================================================================
//
//
//
//==========================================================================
void DSectorScrollInterpolation::UpdateInterpolation()
{
oldx = sector->GetXOffset(ceiling);
oldy = sector->GetYOffset(ceiling, false);
}
//==========================================================================
@ -574,16 +595,8 @@ void DSectorScrollInterpolation::UpdateInterpolation()
void DSectorScrollInterpolation::Restore()
{
if (!ceiling)
{
sector->floor_xoffs = bakx;
sector->floor_yoffs = baky;
}
else
{
sector->ceiling_xoffs = bakx;
sector->ceiling_yoffs = baky;
}
sector->SetXOffset(ceiling, bakx);
sector->SetYOffset(ceiling, bakx);
}
//==========================================================================
@ -594,25 +607,11 @@ void DSectorScrollInterpolation::Restore()
void DSectorScrollInterpolation::Interpolate(fixed_t smoothratio)
{
fixed_t *px;
fixed_t *py;
bakx = sector->GetXOffset(ceiling);
baky = sector->GetYOffset(ceiling, false);
if (!ceiling)
{
px = &sector->floor_xoffs;
py = &sector->floor_yoffs;
}
else
{
px = &sector->ceiling_xoffs;
py = &sector->ceiling_yoffs;
}
bakx = *px;
baky = *py;
*px = oldx + FixedMul(bakx - oldx, smoothratio);
*py = oldy + FixedMul(baky - oldy, smoothratio);
sector->SetXOffset(ceiling, oldx + FixedMul(bakx - oldx, smoothratio));
sector->SetYOffset(ceiling, oldy + FixedMul(baky - oldy, smoothratio));
}
//==========================================================================
@ -654,6 +653,19 @@ DWallScrollInterpolation::DWallScrollInterpolation(side_t *_side, int _part)
//
//==========================================================================
void DWallScrollInterpolation::Destroy()
{
assert(side->textures[part].interpolation == this);
side->textures[part].interpolation = NULL;
Super::Destroy();
}
//==========================================================================
//
//
//
//==========================================================================
void DWallScrollInterpolation::UpdateInterpolation()
{
oldx = side->GetTextureXOffset(part);
@ -726,6 +738,19 @@ DPolyobjInterpolation::DPolyobjInterpolation(FPolyObj *po)
//
//==========================================================================
void DPolyobjInterpolation::Destroy()
{
assert(poly->interpolation == this);
poly->interpolation = NULL;
Super::Destroy();
}
//==========================================================================
//
//
//
//==========================================================================
void DPolyobjInterpolation::UpdateInterpolation()
{
for(int i = 0; i < poly->numvertices; i++)
@ -801,7 +826,6 @@ DInterpolation *side_t::SetInterpolation(int position)
if (textures[position].interpolation == NULL)
{
textures[position].interpolation = new DWallScrollInterpolation(this, position);
textures[position].interpolation->AddRef();
}
textures[position].interpolation->AddRef();
GC::WriteBarrier(textures[position].interpolation);

View file

@ -41,6 +41,7 @@ struct FInterpolator
{
DInterpolation *Head;
bool didInterp;
int count;
int CountInterpolations ();
@ -49,6 +50,7 @@ public:
{
Head = NULL;
didInterp = false;
count = 0;
}
void UpdateInterpolations();
void AddInterpolation(DInterpolation *);

View file

@ -1683,16 +1683,6 @@ bool R_AlignFlat (int linenum, int side, int fc)
dist = -dist;
}
if (fc)
{
sec->base_ceiling_angle = 0-angle;
sec->base_ceiling_yoffs = dist & ((1<<(FRACBITS+8))-1);
}
else
{
sec->base_floor_angle = 0-angle;
sec->base_floor_yoffs = dist & ((1<<(FRACBITS+8))-1);
}
sec->SetBase(fc, dist & ((1<<(FRACBITS+8))-1), 0-angle);
return true;
}

View file

@ -1300,10 +1300,10 @@ void RP_AddLine (seg_t *line)
|| curline->sidedef->GetTexture(side_t::mid) != 0
// killough 3/7/98: Take flats offsets into account:
|| backsector->floor_xoffs != frontsector->floor_xoffs
|| (backsector->floor_yoffs + backsector->base_floor_yoffs) != (frontsector->floor_yoffs + backsector->base_floor_yoffs)
|| backsector->ceiling_xoffs != frontsector->ceiling_xoffs
|| (backsector->ceiling_yoffs + backsector->base_ceiling_yoffs) != (frontsector->ceiling_yoffs + frontsector->base_ceiling_yoffs)
|| backsector->GetXOffset(sector_t::floor) != frontsector->GetXOffset(sector_t::floor)
|| backsector->GetYOffset(sector_t::floor) != frontsector->GetYOffset(sector_t::floor)
|| backsector->GetXOffset(sector_t::ceiling) != frontsector->GetXOffset(sector_t::ceiling)
|| backsector->GetYOffset(sector_t::ceiling) != frontsector->GetYOffset(sector_t::ceiling)
|| backsector->FloorLight != frontsector->FloorLight
|| backsector->CeilingLight != frontsector->CeilingLight
@ -1314,14 +1314,14 @@ void RP_AddLine (seg_t *line)
|| backsector->ColorMap != frontsector->ColorMap
// [RH] and scaling
|| backsector->floor_xscale != frontsector->floor_xscale
|| backsector->floor_yscale != frontsector->floor_yscale
|| backsector->ceiling_xscale != frontsector->ceiling_xscale
|| backsector->ceiling_yscale != frontsector->ceiling_yscale
|| backsector->GetXScale(sector_t::floor) != frontsector->GetXScale(sector_t::floor)
|| backsector->GetYScale(sector_t::floor) != frontsector->GetYScale(sector_t::floor)
|| backsector->GetXScale(sector_t::ceiling) != frontsector->GetXScale(sector_t::ceiling)
|| backsector->GetYScale(sector_t::ceiling) != frontsector->GetYScale(sector_t::ceiling)
// [RH] and rotation
|| (backsector->floor_angle + backsector->base_floor_angle) != (frontsector->floor_angle + frontsector->base_floor_angle)
|| (backsector->ceiling_angle + backsector->base_ceiling_angle) != (frontsector->ceiling_angle + frontsector->base_ceiling_angle)
|| backsector->GetAngle(sector_t::floor) != frontsector->GetAngle(sector_t::floor)
|| backsector->GetAngle(sector_t::ceiling) != frontsector->GetAngle(sector_t::ceiling)
)
{
solid = false;

View file

@ -1268,8 +1268,8 @@ void R_NewWall (bool needlights)
|| backsector->floorpic != frontsector->floorpic
// killough 3/7/98: Add checks for (x,y) offsets
|| backsector->floor_xoffs != frontsector->floor_xoffs
|| (backsector->floor_yoffs + backsector->base_floor_yoffs) != (frontsector->floor_yoffs + frontsector->base_floor_yoffs)
|| backsector->GetXOffset(sector_t::floor) != frontsector->GetXOffset(sector_t::floor)
|| backsector->GetYOffset(sector_t::floor) != frontsector->GetYOffset(sector_t::floor)
// killough 4/15/98: prevent 2s normals
// from bleeding through deep water
@ -1281,10 +1281,10 @@ void R_NewWall (bool needlights)
// [RH] Add checks for colormaps
|| backsector->ColorMap != frontsector->ColorMap
|| backsector->floor_xscale != frontsector->floor_xscale
|| backsector->floor_yscale != frontsector->floor_yscale
|| backsector->GetXScale(sector_t::floor) != frontsector->GetXScale(sector_t::floor)
|| backsector->GetYScale(sector_t::floor) != frontsector->GetYScale(sector_t::floor)
|| (backsector->floor_angle + backsector->base_floor_angle) != (frontsector->floor_angle + frontsector->base_floor_angle)
|| backsector->GetAngle(sector_t::floor) != frontsector->GetAngle(sector_t::floor)
|| (sidedef->GetTexture(side_t::mid) && linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX))
;
@ -1297,8 +1297,8 @@ void R_NewWall (bool needlights)
|| backsector->ceilingpic != frontsector->ceilingpic
// killough 3/7/98: Add checks for (x,y) offsets
|| backsector->ceiling_xoffs != frontsector->ceiling_xoffs
|| (backsector->ceiling_yoffs + backsector->base_ceiling_yoffs) != (frontsector->ceiling_yoffs + frontsector->base_ceiling_yoffs)
|| backsector->GetXOffset(sector_t::ceiling) != frontsector->GetXOffset(sector_t::ceiling)
|| backsector->GetYOffset(sector_t::ceiling) != frontsector->GetYOffset(sector_t::ceiling)
// killough 4/15/98: prevent 2s normals
// from bleeding through fake ceilings
@ -1310,10 +1310,10 @@ void R_NewWall (bool needlights)
// [RH] Add check for colormaps
|| backsector->ColorMap != frontsector->ColorMap
|| backsector->ceiling_xscale != frontsector->ceiling_xscale
|| backsector->ceiling_yscale != frontsector->ceiling_yscale
|| backsector->GetXScale(sector_t::ceiling) != frontsector->GetXScale(sector_t::ceiling)
|| backsector->GetYScale(sector_t::ceiling) != frontsector->GetYScale(sector_t::ceiling)
|| (backsector->ceiling_angle + backsector->base_ceiling_angle) != (frontsector->ceiling_angle + frontsector->base_ceiling_angle)
|| backsector->GetAngle(sector_t::ceiling) != frontsector->GetAngle(sector_t::ceiling)
|| (sidedef->GetTexture(side_t::mid) && linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX))
);

View file

@ -103,9 +103,22 @@ static const char *ReverbFieldNames[NUM_REVERB_FIELDS+2] =
static const char *BoolNames[3] = { "False", "True", NULL };
static ReverbContainer DSPWater =
{
// Based on the "off" reverb, this one uses the software water effect,
// which is completely independant from EAX-like reverb.
NULL,
"DSP Water",
0xffff,
true,
false,
{0, 0, 7.5f, 1.00f, -10000, -10000, 0, 1.00f, 1.00f, 1.0f, -2602, 0.007f, 0.0f,0.0f,0.0f, 200, 0.011f, 0.0f,0.0f,0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 0.0f, 0.0f, 0x33f },
true
};
static ReverbContainer Psychotic =
{
NULL,
&DSPWater,
"Psychotic",
0x1900,
true,
@ -564,6 +577,7 @@ static void ReadReverbDef (int lump)
newenv->ID = (id1 << 8) | id2;
newenv->Builtin = false;
newenv->Properties = props;
newenv->SoftwareWater = false;
S_AddEnvironment (newenv);
}
}

View file

@ -132,7 +132,7 @@ void S_CacheSound (sfxinfo_t *sfx);
void S_Sound (int channel, const char *name, float volume, int attenuation);
void S_Sound (AActor *ent, int channel, const char *name, float volume, int attenuation);
void S_Sound (fixed_t *pt, int channel, const char *name, float volume, int attenuation);
void S_Sound (fixed_t x, fixed_t y, int channel, const char *name, float volume, int attenuation);
//void S_Sound (fixed_t x, fixed_t y, int channel, const char *name, float volume, int attenuation);
void S_SoundID (int channel, int sfxid, float volume, int attenuation);
void S_SoundID (AActor *ent, int channel, int sfxid, float volume, int attenuation);
void S_SoundID (fixed_t *pt, int channel, int sfxid, float volume, int attenuation);
@ -299,6 +299,7 @@ struct ReverbContainer
bool Builtin;
bool Modified;
REVERB_PROPERTIES Properties;
bool SoftwareWater;
};
extern ReverbContainer *Environments;

View file

@ -46,7 +46,7 @@ namespace FMOD
/*
FMOD global system functions (optional).
*/
inline FMOD_RESULT Memory_Initialize(void *poolmem, int poollen, FMOD_MEMORY_ALLOCCALLBACK useralloc, FMOD_MEMORY_REALLOCCALLBACK userrealloc, FMOD_MEMORY_FREECALLBACK userfree) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree); }
inline FMOD_RESULT Memory_Initialize(void *poolmem, int poollen, FMOD_MEMORY_ALLOCCALLBACK useralloc, FMOD_MEMORY_REALLOCCALLBACK userrealloc, FMOD_MEMORY_FREECALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags = (FMOD_MEMORY_NORMAL | FMOD_MEMORY_XBOX360_PHYSICAL)) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); }
inline FMOD_RESULT Memory_GetStats (int *currentalloced, int *maxalloced) { return FMOD_Memory_GetStats(currentalloced, maxalloced); }
inline FMOD_RESULT Debug_SetLevel(FMOD_DEBUGLEVEL level) { return FMOD_Debug_SetLevel(level); }
inline FMOD_RESULT Debug_GetLevel(FMOD_DEBUGLEVEL *level) { return FMOD_Debug_GetLevel(level); }
@ -93,7 +93,7 @@ namespace FMOD
FMOD_RESULT getAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings) { return FMOD_System_GetAdvancedSettings(this, settings); }
FMOD_RESULT setSpeakerMode (FMOD_SPEAKERMODE speakermode) { return FMOD_System_SetSpeakerMode(this, speakermode); }
FMOD_RESULT getSpeakerMode (FMOD_SPEAKERMODE *speakermode) { return FMOD_System_GetSpeakerMode(this, speakermode); }
FMOD_RESULT setCallback (FMOD_SYSTEM_CALLBACKTYPE type, FMOD_SYSTEM_CALLBACK callback) { return FMOD_System_SetCallback(this, type, callback); }
FMOD_RESULT setCallback (FMOD_SYSTEM_CALLBACK callback) { return FMOD_System_SetCallback(this, callback); }
// Plug-in support
FMOD_RESULT setPluginPath (const char *path) { return FMOD_System_SetPluginPath(this, path); }
@ -280,8 +280,8 @@ namespace FMOD
FMOD_RESULT getFrequency (float *frequency) { return FMOD_Channel_GetFrequency(this, frequency); }
FMOD_RESULT setPan (float pan) { return FMOD_Channel_SetPan(this, pan); }
FMOD_RESULT getPan (float *pan) { return FMOD_Channel_GetPan(this, pan); }
FMOD_RESULT setDelay (FMOD_DELAYTYPE delaytype, unsigned int delayhi, unsigned int delaylo) { return FMOD_Channel_SetDelay(this, delaytype, delaylo, delayhi); }
FMOD_RESULT getDelay (FMOD_DELAYTYPE delaytype, unsigned int *delayhi, unsigned int *delaylo) { return FMOD_Channel_GetDelay(this, delaytype, delaylo, delayhi); }
FMOD_RESULT setDelay (FMOD_DELAYTYPE delaytype, unsigned int delayhi, unsigned int delaylo) { return FMOD_Channel_SetDelay(this, delaytype, delayhi, delaylo); }
FMOD_RESULT getDelay (FMOD_DELAYTYPE delaytype, unsigned int *delayhi, unsigned int *delaylo) { return FMOD_Channel_GetDelay(this, delaytype, delayhi, delaylo); }
FMOD_RESULT setSpeakerMix (float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright) { return FMOD_Channel_SetSpeakerMix(this, frontleft, frontright, center, lfe, backleft, backright, sideleft, sideright); }
FMOD_RESULT getSpeakerMix (float *frontleft, float *frontright, float *center, float *lfe, float *backleft, float *backright, float *sideleft, float *sideright) { return FMOD_Channel_GetSpeakerMix(this, frontleft, frontright, center, lfe, backleft, backright, sideleft, sideright); }
FMOD_RESULT setSpeakerLevels (FMOD_SPEAKER speaker, float *levels, int numlevels) { return FMOD_Channel_SetSpeakerLevels(this, speaker, levels, numlevels); }
@ -469,6 +469,8 @@ namespace FMOD
FMOD_RESULT getActive (bool *active) { FMOD_BOOL b; FMOD_RESULT res = FMOD_DSP_GetActive(this, &b); *active = b; return res; }
FMOD_RESULT setBypass (bool bypass) { return FMOD_DSP_SetBypass(this, bypass); }
FMOD_RESULT getBypass (bool *bypass) { FMOD_BOOL b; FMOD_RESULT res = FMOD_DSP_GetBypass(this, &b); *bypass = b; return res; }
FMOD_RESULT setSpeakerActive (FMOD_SPEAKER speaker, bool active) { return FMOD_DSP_SetSpeakerActive(this, speaker, active); }
FMOD_RESULT getSpeakerActive (FMOD_SPEAKER speaker, bool *active) { FMOD_BOOL b; FMOD_RESULT res = FMOD_DSP_GetSpeakerActive(this, speaker, &b); *active = b; return res; }
FMOD_RESULT reset () { return FMOD_DSP_Reset(this); }
// DSP parameter control.

View file

@ -641,10 +641,20 @@ bool FMODSoundRenderer::Init()
return false;
}
const char *wrongver = NULL;
if (version < FMOD_VERSION)
{
Printf (" "TEXTCOLOR_ORANGE"Error! You are using an old version of FMOD (%x.%02x.%02x).\n"
wrongver = "an old";
}
else if ((version & 0xFFFF00) > (FMOD_VERSION & 0xFFFF00))
{
wrongver = "a new";
}
if (wrongver != NULL)
{
Printf (" "TEXTCOLOR_ORANGE"Error! You are using %s version of FMOD (%x.%02x.%02x).\n"
" "TEXTCOLOR_ORANGE"This program requires version %x.%02x.%02x\n",
wrongver,
version >> 16, (version >> 8) & 255, version & 255,
FMOD_VERSION >> 16, (FMOD_VERSION >> 8) & 255, FMOD_VERSION & 255);
return false;
@ -1487,8 +1497,11 @@ FSoundChan *FMODSoundRenderer::StartSound3D(sfxinfo_t *sfx, float vol, float dis
chan->setFrequency(freq);
}
chan->setVolume(vol);
if (mode & FMOD_3D)
{
chan->set3DAttributes((FMOD_VECTOR *)pos, (FMOD_VECTOR *)vel);
chan->set3DSpread(snd_3dspread);
}
chan->setDelay(FMOD_DELAYTYPE_DSPCLOCK_START, DSPClockHi, DSPClockLo);
chan->setPaused(false);
FSoundChan *schan = CommonChannelSetup(chan);
@ -1707,11 +1720,6 @@ void FMODSoundRenderer::UpdateListener()
{
env = DefaultEnvironments[0];
}
/* if (env == DefaultEnvironments[0] && underwater)
{
env = DefaultEnvironments[22];
}
*/
}
if (env != PrevEnvironment || env->Modified)
{
@ -1721,7 +1729,7 @@ void FMODSoundRenderer::UpdateListener()
PrevEnvironment = env;
}
if (underwater)
if (underwater || env->SoftwareWater)
{
//PausableSfx->setPitch(0.64171f); // This appears to be what Duke 3D uses
PausableSfx->setPitch(0.7937005f); // Approx. 4 semitones lower; what Nash suggesetd

View file

@ -3,5 +3,5 @@
// This file was automatically generated by the
// updaterevision tool. Do not edit by hand.
#define ZD_SVN_REVISION_STRING "1024"
#define ZD_SVN_REVISION_NUMBER 1024
#define ZD_SVN_REVISION_STRING "1032"
#define ZD_SVN_REVISION_NUMBER 1032

View file

@ -1548,7 +1548,7 @@ void A_SpawnItemEx(AActor * self)
xmom = newxmom;
}
AActor * mo = Spawn( missile, x, y, self->z + self->floorclip + zofs, ALLOW_REPLACE);
AActor * mo = Spawn( missile, x, y, self->z - self->floorclip + zofs, ALLOW_REPLACE);
InitSpawnedItem(self, mo, flags);
if (mo)
{

View file

@ -1572,6 +1572,15 @@ static void ActorBounceFactor (FScanner &sc, AActor *defaults, Baggage &bag)
defaults->bouncefactor = clamp<fixed_t>(fixed_t(sc.Float * FRACUNIT), 0, FRACUNIT);
}
//==========================================================================
//
//==========================================================================
static void ActorWallBounceFactor (FScanner &sc, AActor *defaults, Baggage &bag)
{
sc.MustGetFloat ();
defaults->wallbouncefactor = clamp<fixed_t>(fixed_t(sc.Float * FRACUNIT), 0, FRACUNIT);
}
//==========================================================================
//
//==========================================================================
@ -2747,6 +2756,7 @@ static const ActorProps props[] =
{ "tag", ActorTag, RUNTIME_CLASS(AActor) },
{ "translation", ActorTranslation, RUNTIME_CLASS(AActor) },
{ "vspeed", ActorVSpeed, RUNTIME_CLASS(AActor) },
{ "wallbouncefactor", ActorWallBounceFactor, RUNTIME_CLASS(AActor) },
{ "weapon.ammogive", (apf)WeaponAmmoGive1, RUNTIME_CLASS(AWeapon) },
{ "weapon.ammogive1", (apf)WeaponAmmoGive1, RUNTIME_CLASS(AWeapon) },
{ "weapon.ammogive2", (apf)WeaponAmmoGive2, RUNTIME_CLASS(AWeapon) },

View file

@ -33,6 +33,8 @@
BITS 32
%include "src/valgrind.inc"
; Segment/section definition macros.
SECTION .data
@ -177,6 +179,8 @@ R_SetSpanSource_ASM:
mov [mspreadf+2],ecx
mov [mspreadg+2],ecx
selfmod spreada, mspreadg+6
mov [ds_cursource],ecx
ret
@ -203,6 +207,8 @@ R_SetSpanColormap_ASM:
mov [mspmapf+2],ecx
mov [mspmapg+2],ecx
selfmod spmapa, mspmapg+6
mov [ds_curcolormap],ecx
ret
@ -275,10 +281,14 @@ R_SetSpanSize_ASM:
mov [dmsy3+2],dl
mov [dmsy4+2],dl
selfmod dsy1, dmsm7+6
aret: ret
SECTION .rtext progbits alloc exec write align=64
rtext_start:
GLOBAL @R_DrawSpanP_ASM@0
GLOBAL _R_DrawSpanP_ASM
GLOBAL R_DrawSpanP_ASM
@ -1731,6 +1741,7 @@ ac4p: add eax,320 ; pitch
ac4nil: pop edi
ret
rtext_end:
align 16
;************************
@ -1759,6 +1770,7 @@ R_SetupShadedCol:
mov [s4fg2+3],eax
mov [s4fg3+3],eax
mov [s4fg4+3],eax
selfmod s4cm1, s4fg4+7
.cdone ret
GLOBAL R_SetupAddCol
@ -1790,6 +1802,7 @@ R_SetupAddCol:
mov [a4bg2+3],eax
mov [a4bg3+3],eax
mov [a4bg4+3],eax
selfmod a4cm1, a4bg4+7
.dbdone ret
GLOBAL R_SetupAddClampCol
@ -1821,6 +1834,7 @@ R_SetupAddClampCol:
mov [ac4bg2+3],eax
mov [ac4bg3+3],eax
mov [ac4bg4+3],eax
selfmod ac4cm1, ac4bg4+7
.dbdone ret
EXTERN setvlinebpl_
@ -1847,5 +1861,6 @@ _ASM_PatchPitch:
mov [s4p2+2],ecx
inc ecx
mov [s4p3+2],ecx
selfmod rtext_start, rtext_end
call setpitch3
jmp setvlinebpl_

View file

@ -37,6 +37,8 @@
BITS 32
%include "src/valgrind.inc"
%define SPACEFILLER4 (0x44444444)
%ifndef M_TARGET_LINUX
@ -160,6 +162,7 @@ R_SetTiltedSpanSource_ASM:
mov [fetch9+3],ecx
mov [fetch10+3],ecx
mov [ds_curtiltedsource],ecx
selfmod rtext_start, rtext_end
ret
GLOBAL SetTiltedSpanSize
@ -209,10 +212,14 @@ SetTiltedSpanSize:
mov [m9+2],eax
mov [m10+2],eax
selfmod rtext_start, rtext_end
ret
SECTION .rtext progbits alloc exec write align=64
rtext_start:
GLOBAL R_DrawTiltedPlane_ASM
GLOBAL @R_DrawTiltedPlane_ASM@8
@ -619,3 +626,5 @@ fetch10 mov al,[ebp+esi+SPACEFILLER4]
pop esi
pop ebx
ret
rtext_end:

View file

@ -1,3 +1,5 @@
%include "src/valgrind.inc"
%ifdef M_TARGET_WATCOM
SEGMENT DATA PUBLIC ALIGN=16 CLASS=DATA USE32
SEGMENT DATA
@ -57,6 +59,7 @@ setpitch3:
mov [vltpitcha+2],eax
mov [vlt1pitch1+2], eax
mov [vlt1pitch2+2], eax
selfmod vltpitch, vlt1pitch2+6
ret
ALIGN 16
@ -74,6 +77,7 @@ setupvlinetallasm:
mov [preshift+2], cl
mov [shift11+2], cl
mov [shift12+2], cl
selfmod shifter1, shift12+6
ret
SECTION .rtext progbits alloc exec write align=64
@ -126,6 +130,7 @@ vlinetallasm4:
mov ecx, [vplce+4]
mov esi, [vplce+8]
mov eax, [vplce+12]
selfmod loopit, vltpitch
jmp loopit
ALIGN 16
@ -217,6 +222,7 @@ vlinetallasmathlon4:
mov ecx, [vplce+4]
mov esi, [vplce+8]
mov eax, [vplce+12]
selfmod loopita, vltpitcha
jmp loopita
; Unfortunately, this code has not been carefully analyzed to determine

31
src/valgrind.inc Normal file
View file

@ -0,0 +1,31 @@
%ifdef VALGRIND_AWARE
%define VG_USERREQ__DISCARD_TRANSLATIONS 0x1002
%macro selfmod 2
pusha
sub esp,6*4
mov dword [esp], VG_USERREQ__DISCARD_TRANSLATIONS
mov dword [esp+4], %1
mov dword [esp+8], %2 - %1
mov dword [esp+12], 0
mov dword [esp+16], 0
mov dword [esp+20], 0
mov eax, esp
; special instruction preamble
rol edi, 3
rol edi, 13
rol edi, 29
rol edi, 19
xchg ebx, ebx
; restore state
add esp,6*4
popa
%endmacro
%else
%macro selfmod 2
%endmacro
%endif

View file

@ -77,7 +77,7 @@
// SAVESIG should match SAVEVER.
// MINSAVEVER is the minimum level snapshot version that can be loaded.
#define MINSAVEVER 1018
#define MINSAVEVER 1033
#if ZD_SVN_REVISION_NUMBER < MINSAVEVER
// Never write a savegame with a version lower than what we need

View file

@ -51,6 +51,13 @@ ACTOR MegasphereHealth : Health // for manipulation by Dehacked
+INVENTORY.ALWAYSPICKUP
}
// DeHackEd can only modify the blue armor's type, not the megasphere's.
actor BlueArmorForMegasphere : BlueArmor
{
Armor.SavePercent 50
Armor.SaveAmount 200
}
ACTOR Megasphere : CustomInventory 83
{
Game Doom
@ -65,7 +72,7 @@ ACTOR Megasphere : CustomInventory 83
MEGA ABCD 6 BRIGHT
Loop
Pickup:
TNT1 A 0 A_GiveInventory("BlueArmor", 1)
TNT1 A 0 A_GiveInventory("BlueArmorForMegasphere", 1)
TNT1 A 0 A_GiveInventory("MegasphereHealth", 1)
Stop
}