diff --git a/src/d_player.h b/src/d_player.h index 0a1f012a..67778473 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -181,11 +181,12 @@ typedef enum CF_TIMEFREEZE = 1 << 15, // Player has an active time freezer CF_DRAIN = 1 << 16, // Player owns a drain powerup CF_REGENERATION = 1 << 17, // Player owns a regeneration artifact - CF_HIGHJUMP = 1 << 18, // more Skulltag flags. Implemetation not guaranteed though. ;) + CF_HIGHJUMP = 1 << 18, // more Skulltag flags. Implementation not guaranteed though. ;) CF_REFLECTION = 1 << 19, CF_PROSPERITY = 1 << 20, - CF_DOUBLEFIRINGSPEED= 1 << 21, + CF_DOUBLEFIRINGSPEED= 1 << 21, // Player owns a double firing speed artifact CF_EXTREMELYDEAD = 1 << 22, // [RH] Reliably let the status bar know about extreme deaths. + CF_INFINITEAMMO = 1 << 23, // Player owns an infinite ammo artifact } cheat_t; #define WPIECE1 1 diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index 2c7e3e86..61c0eb9f 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -184,7 +184,7 @@ static void SpawnFly(AActor *self, const PClass *spawntype, FSoundID sound) if (di->Name != NAME_None) { n -= di->amount; // logically, none of the -1 values have survived by now. - if (n > -1) di = di->Next; // If we get into the negatives, we've reached the end of the list. + if ((di->Next != NULL) && (n > -1)) di = di->Next; else n = -1; } } diff --git a/src/g_hexen/a_flechette.cpp b/src/g_hexen/a_flechette.cpp index 3c120d87..ce33a189 100644 --- a/src/g_hexen/a_flechette.cpp +++ b/src/g_hexen/a_flechette.cpp @@ -274,9 +274,10 @@ int APoisonCloud::DoSpecialDamage (AActor *victim, int damage) { P_PoisonDamage (victim->player, this, 15+(pr_poisoncloudd()&15), false); // Don't play painsound - P_PoisonPlayer (victim->player, this, this->target, 50); - S_Sound (victim, CHAN_VOICE, "*poison", 1, ATTN_NORM); + // If successful, play the posion sound. + if (P_PoisonPlayer (victim->player, this, this->target, 50)) + S_Sound (victim, CHAN_VOICE, "*poison", 1, ATTN_NORM); } } return -1; diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 5140d54a..72985da1 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -1836,3 +1836,39 @@ void APowerMorph::EndEffect( ) // Unmorph suceeded Player = NULL; } + +// Infinite Ammo Powerup ----------------------------------------------------- + +IMPLEMENT_CLASS(APowerInfiniteAmmo) + +//=========================================================================== +// +// APowerInfiniteAmmo :: InitEffect +// +//=========================================================================== + +void APowerInfiniteAmmo::InitEffect( ) +{ + if (Owner== NULL || Owner->player == NULL) + return; + + // Give the player infinite ammo + Owner->player->cheats |= CF_INFINITEAMMO; +} + +//=========================================================================== +// +// APowerInfiniteAmmo :: EndEffect +// +//=========================================================================== + +void APowerInfiniteAmmo::EndEffect( ) +{ + // Nothing to do if there's no owner. + if (Owner != NULL && Owner->player != NULL) + { + // Take away the limitless ammo + Owner->player->cheats &= ~CF_INFINITEAMMO; + } +} + diff --git a/src/g_shared/a_randomspawner.cpp b/src/g_shared/a_randomspawner.cpp index 579ccb30..88e0e79c 100644 --- a/src/g_shared/a_randomspawner.cpp +++ b/src/g_shared/a_randomspawner.cpp @@ -29,7 +29,6 @@ class ARandomSpawner : public AActor int n=0; Super::PostBeginPlay(); - drop = di = GetDropItems(); if (di != NULL) { @@ -52,7 +51,7 @@ class ARandomSpawner : public AActor if (di->Name != NAME_None) { n -= di->amount; - if (di->Next != NULL) di = di->Next; else n=0; + if ((di->Next != NULL) && (n > -1)) di = di->Next; else n = -1; } } // So now we can spawn the dropped item. @@ -81,6 +80,22 @@ class ARandomSpawner : public AActor newmobj->tracer = tracer; newmobj->CopyFriendliness(this, false); if (!(flags & MF_DROPPED)) newmobj->flags &= ~MF_DROPPED; + + // Handle special altitude flags + if (newmobj->flags & MF_SPAWNCEILING) + { + newmobj->z = newmobj->ceilingz - newmobj->height; + } + else if (newmobj->flags2 & MF2_SPAWNFLOAT) + { + fixed_t space = newmobj->ceilingz - newmobj->height - newmobj->floorz; + if (space > 48*FRACUNIT) + { + space -= 40*FRACUNIT; + newmobj->z = MulScale8 (space, pr_randomspawn()) + newmobj->floorz + 40*FRACUNIT; + } + } + // Special1 is used to count how many recursions we're in. if (newmobj->IsKindOf(PClass::FindClass("RandomSpawner"))) newmobj->special1 = ++special1; diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index af650a0f..e606d8cb 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -404,7 +404,7 @@ bool AWeapon::CheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo) int count1, count2; int enough, enoughmask; - if (dmflags & DF_INFINITE_AMMO) + if ((dmflags & DF_INFINITE_AMMO) || (Owner->player->cheats & CF_INFINITEAMMO)) { return true; } @@ -462,7 +462,7 @@ bool AWeapon::CheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo) bool AWeapon::DepleteAmmo (bool altFire, bool checkEnough) { - if (!(dmflags & DF_INFINITE_AMMO)) + if (!((dmflags & DF_INFINITE_AMMO) || (Owner->player->cheats & CF_INFINITEAMMO))) { if (checkEnough && !CheckAmmo (altFire ? AltFire : PrimaryFire, false)) { diff --git a/src/gl/gl_renderstruct.h b/src/gl/gl_renderstruct.h index f956e798..16255a35 100644 --- a/src/gl/gl_renderstruct.h +++ b/src/gl/gl_renderstruct.h @@ -152,7 +152,6 @@ public: float alpha; FGLTexture *gltexture; - FColormap Colormap; ERenderStyle RenderStyle; diff --git a/src/gl/gl_texture.cpp b/src/gl/gl_texture.cpp index d8a248b7..11df5feb 100644 --- a/src/gl/gl_texture.cpp +++ b/src/gl/gl_texture.cpp @@ -699,6 +699,8 @@ FGLTexture::FGLTexture(FTexture * tx) bHasColorkey = false; + tempScaleX = tempScaleY = FRACUNIT; + for (int i=GLUSE_PATCH; i<=GLUSE_TEXTURE; i++) { Width[i] = tex->GetWidth(); @@ -777,11 +779,97 @@ FGLTexture::~FGLTexture() } } + +//=========================================================================== +// +// Sets a temporary scaling factor for this texture +// +//=========================================================================== + +void FGLTexture::SetWallScaling(fixed_t x, fixed_t y) +{ + if (x != tempScaleX) + { + fixed_t scale_x = FixedMul(x, tex->xScale); + int foo = (Width[GLUSE_TEXTURE] << 17) / scale_x; + RenderWidth[GLUSE_TEXTURE] = (foo >> 1) + (foo & 1); + scalex = scale_x/(float)FRACUNIT; + tempScaleX = x; + } + if (y != tempScaleY) + { + fixed_t scale_y = FixedMul(y, tex->yScale); + int foo = (Width[GLUSE_TEXTURE] << 17) / scaley; + RenderHeight[GLUSE_TEXTURE] = (foo >> 1) + (foo & 1); + scaley = scale_y/(float)FRACUNIT; + tempScaleY = y; + } +} + +//=========================================================================== +// +// +// +//=========================================================================== + +fixed_t FGLTexture::RowOffset(fixed_t rowoffset) const +{ + if (tempScaleX == FRACUNIT) + { + if (scaley==1.f || tex->bWorldPanning) return rowoffset; + else return quickertoint(rowoffset/scaley); + } + else + { + if (tex->bWorldPanning) return FixedDiv(rowoffset, tempScaleY); + else return quickertoint(rowoffset/scaley); + } +} + +//=========================================================================== +// +// +// +//=========================================================================== + +fixed_t FGLTexture::TextureOffset(fixed_t textureoffset) const +{ + if (tempScaleX == FRACUNIT) + { + if (scalex==1.f || tex->bWorldPanning) return textureoffset; + else return quickertoint(textureoffset/scalex); + } + else + { + if (tex->bWorldPanning) return FixedDiv(textureoffset, tempScaleX); + else return quickertoint(textureoffset/scalex); + } +} + + +//=========================================================================== +// +// Returns the size for which texture offset coordinates are used. +// +//=========================================================================== + +fixed_t FGLTexture::TextureAdjustWidth(ETexUse i) const +{ + if (tex->bWorldPanning) + { + if (i == GLUSE_PATCH || tempScaleX == FRACUNIT) return RenderWidth[i]; + else return FixedDiv(Width[i], tempScaleX); + } + else return Width[i]; +} + + //=========================================================================== // // GetRect // //=========================================================================== + void FGLTexture::GetRect(GL_RECT * r, FGLTexture::ETexUse i) const { r->left=-(float)GetScaledLeftOffset(i); diff --git a/src/gl/gl_texture.h b/src/gl/gl_texture.h index d421f876..ae6046b3 100644 --- a/src/gl/gl_texture.h +++ b/src/gl/gl_texture.h @@ -146,6 +146,7 @@ private: short RenderWidth[2]; short RenderHeight[2]; float AlphaThreshold; + fixed_t tempScaleX, tempScaleY; bool FindHoles(const unsigned char * buffer, int w, int h); bool ProcessData(unsigned char * buffer, int w, int h, int cm, bool ispatch); @@ -186,30 +187,19 @@ public: void GetRect(GL_RECT * r, ETexUse i) const; + void SetWallScaling(fixed_t x, fixed_t y); + int TextureHeight(ETexUse i) const { return RenderHeight[i]; } int TextureWidth(ETexUse i) const { return RenderWidth[i]; } int GetAreaCount() const { return areacount; } GL_RECT * GetAreas() const { return areas; } - fixed_t RowOffset(fixed_t rowoffset) const - { - if (scaley==1.f || tex->bWorldPanning) return rowoffset; - else return quickertoint(rowoffset/scaley); - } - - fixed_t TextureOffset(fixed_t textureoffset) const - { - if (scalex==1.f || tex->bWorldPanning) return textureoffset; - else return quickertoint(textureoffset/scalex); - } + fixed_t RowOffset(fixed_t rowoffset) const; + fixed_t TextureOffset(fixed_t textureoffset) const; // Returns the size for which texture offset coordinates are used. - fixed_t TextureAdjustWidth(ETexUse i) const - { - if (tex->bWorldPanning) return RenderWidth[i]; - else return Width[i]; - } + fixed_t TextureAdjustWidth(ETexUse i) const; int GetWidth(ETexUse i) const { diff --git a/src/gl/gl_walls.cpp b/src/gl/gl_walls.cpp index 0211a1d7..c94d5815 100644 --- a/src/gl/gl_walls.cpp +++ b/src/gl/gl_walls.cpp @@ -695,6 +695,7 @@ void GLWall::DoTexture(int _type,seg_t * seg,int peg, texpos = side_t::mid; break; } + gltexture->SetWallScaling(seg->sidedef->GetTextureXScale(texpos), seg->sidedef->GetTextureYScale(texpos)); type = (seg->linedef->special == Line_Mirror && _type == RENDERWALL_M1S && !(gl.flags & RFL_NOSTENCIL) && gl_mirrors) ? RENDERWALL_MIRROR : _type; @@ -705,6 +706,8 @@ void GLWall::DoTexture(int _type,seg_t * seg,int peg, if (!SetWallCoordinates(seg, ceilingrefheight, topleft, topright, bottomleft, bottomright, seg->sidedef->GetTextureXOffset(texpos))) return; + gltexture->SetWallScaling(FRACUNIT, FRACUNIT); + // Add this wall to the render list sector_t * sec = sub? sub->sector : seg->frontsector; if (sec->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap) PutWall(false); @@ -727,6 +730,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary, fixed_t topleft,bottomleft,topright,bottomright; GLSeg glsave=glseg; fixed_t texturetop, texturebottom; + bool wrap = (seg->linedef->flags&ML_WRAP_MIDTEX) || (seg->sidedef->Flags&WALLF_WRAP_MIDTEX); // // @@ -738,6 +742,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary, // Align the texture to the ORIGINAL sector's height!! // At this point slopes don't matter because they don't affect the texture's z-position + gltexture->SetWallScaling(seg->sidedef->GetTextureXScale(side_t::mid), seg->sidedef->GetTextureYScale(side_t::mid)); fixed_t rowoffset=gltexture->RowOffset(seg->sidedef->GetTextureYOffset(side_t::mid)); if ( (seg->linedef->flags & ML_DONTPEGBOTTOM) >0) { @@ -758,9 +763,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary, // decide which planes to use for the polygon // // - if (realfront!=realback || - drawfogboundary || (seg->linedef->flags&ML_WRAP_MIDTEX) || - (realfront->heightsec && !(realfront->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))) + if (realfront!=realback || drawfogboundary || wrap || realfront->GetHeightSec()) { // // @@ -820,7 +823,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary, // if we don't need a fog sheet let's clip away some unnecessary parts of the polygon // // - if (!drawfogboundary && !(seg->linedef->flags&ML_WRAP_MIDTEX)) + if (!drawfogboundary && !wrap) { if (texturetopbottomleft && texturebottom>bottomright) bottomleft=bottomright=texturebottom; @@ -876,13 +879,15 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary, { flags&=~GLT_CLAMPX; } - if (!(seg->linedef->flags&ML_WRAP_MIDTEX)) + if (!wrap) { flags|=GLT_CLAMPY; } } SetWallCoordinates(seg, texturetop, topleft, topright, bottomleft, bottomright, t_ofs); + if (gltexture != NULL) gltexture->SetWallScaling(FRACUNIT, FRACUNIT); + // // // draw fog sheet if required @@ -1036,19 +1041,30 @@ void GLWall::BuildFFBlock(seg_t * seg, F3DFloor * rover, } else { - FTextureID texno; - if (rover->flags&FF_UPPERTEXTURE) texno = seg->sidedef->GetTexture(side_t::top); - else if (rover->flags&FF_LOWERTEXTURE) texno = seg->sidedef->GetTexture(side_t::bottom); - else texno = mastersd->GetTexture(side_t::mid); + if (rover->flags&FF_UPPERTEXTURE) + { + gltexture = FGLTexture::ValidateTexture(seg->sidedef->GetTexture(side_t::top)); + if (!gltexture) return; + gltexture->SetWallScaling(seg->sidedef->GetTextureXScale(side_t::top), seg->sidedef->GetTextureYScale(side_t::top)); + } + else if (rover->flags&FF_LOWERTEXTURE) + { + gltexture = FGLTexture::ValidateTexture(seg->sidedef->GetTexture(side_t::bottom)); + if (!gltexture) return; + gltexture->SetWallScaling(seg->sidedef->GetTextureXScale(side_t::bottom), seg->sidedef->GetTextureYScale(side_t::bottom)); + } + else + { + gltexture = FGLTexture::ValidateTexture(mastersd->GetTexture(side_t::mid)); + if (!gltexture) return; + gltexture->SetWallScaling(mastersd->GetTextureXScale(side_t::mid), mastersd->GetTextureYScale(side_t::mid)); + } - gltexture = FGLTexture::ValidateTexture(texno); - if (!gltexture) return; const WorldTextureInfo * wti=gltexture->GetWorldTextureInfo(); if (!wti) return; - to=(rover->flags&(FF_UPPERTEXTURE|FF_LOWERTEXTURE))? 0:gltexture->TextureOffset(mastersd->GetTextureXOffset(side_t::mid)); ul=wti->FixToTexU(to+gltexture->TextureOffset(seg->sidedef->GetTextureXOffset(side_t::mid))); @@ -1066,6 +1082,7 @@ void GLWall::BuildFFBlock(seg_t * seg, F3DFloor * rover, lolft.v=wti->FixToTexV(to+rowoffset+*rover->top.texheight-ff_bottomleft); lorgt.v=wti->FixToTexV(to+rowoffset+*rover->top.texheight-ff_bottomright); type=RENDERWALL_FFBLOCK; + gltexture->SetWallScaling(FRACUNIT, FRACUNIT); } ztop[0]=TO_GL(ff_topleft); diff --git a/src/m_options.cpp b/src/m_options.cpp index 0e8a9775..2cb5b8bc 100644 --- a/src/m_options.cpp +++ b/src/m_options.cpp @@ -991,8 +991,7 @@ static menuitem_t ModesItems[] = { { redtext, VMTestText, {NULL}, {0.0}, {0.0}, {0.0}, {NULL} }, }; -#define VM_DEPTHITEM 0 -#define VM_ASPECTITEM 0 +#define VM_ASPECTITEM 1 #define VM_RESSTART 6 #define VM_ENTERLINE 16 #define VM_TESTLINE 18 diff --git a/src/namedef.h b/src/namedef.h index ee6f4f20..c2b5b110 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -410,6 +410,12 @@ xx(offsetx_mid) xx(offsety_mid) xx(offsetx_bottom) xx(offsety_bottom) +xx(scalex_top) +xx(scaley_top) +xx(scalex_mid) +xx(scaley_mid) +xx(scalex_bottom) +xx(scaley_bottom) xx(light) xx(lightabsolute) xx(nofakecontrast) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 9bcadd15..6ec5bdcc 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1388,11 +1388,11 @@ bool AActor::OkayToSwitchTarget (AActor *other) // //========================================================================== -void P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison) +bool P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison) { if((player->cheats&CF_GODMODE) || (player->mo->flags2 & MF2_INVULNERABLE)) { - return; + return false; } if (source != NULL && source->player != player && player->mo->IsTeammate (source)) { @@ -1407,6 +1407,7 @@ void P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poi player->poisoncount = 100; } } + return true; } //========================================================================== @@ -1490,6 +1491,7 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage, P_SetMobjState(target, target->info->painstate); } */ + return; } bool CheckCheatmode (); diff --git a/src/p_local.h b/src/p_local.h index 438aaf7a..27cd5acc 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -450,7 +450,7 @@ extern FBlockNode** blocklinks; // for thing chains void P_TouchSpecialThing (AActor *special, AActor *toucher); void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, FName mod, int flags=0); bool P_GiveBody (AActor *actor, int num); -void P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison); +bool P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison); void P_PoisonDamage (player_t *player, AActor *source, int damage, bool playPainSound); enum EDmgFlags diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 7d6be8ef..ba6a04c6 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -420,6 +420,10 @@ void extsector_t::Serialize(FArchive &arc) FArchive &operator<< (FArchive &arc, side_t::part &p) { arc << p.xoffset << p.yoffset << p.interpolation << p.texture;// << p.Light; + if (SaveVersion >= 1645) + { + arc << p.xscale << p.yscale; + } return arc; } diff --git a/src/p_setup.cpp b/src/p_setup.cpp index fa4047f5..9cc87a24 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -2371,6 +2371,8 @@ void P_LoadSideDefs2 (MapData * map) sd->SetTextureXOffset(LittleShort(msd->textureoffset)<SetTextureYOffset(LittleShort(msd->rowoffset)<SetTextureXScale(FRACUNIT); + sd->SetTextureYScale(FRACUNIT); sd->linenum = NO_INDEX; sd->Flags = 0; sd->Index = i; diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 52e93b69..dfc1adb9 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -348,10 +348,13 @@ struct UDMFParser return parsedString; } - void Flag(DWORD &value, int mask, const char *key) + template + void Flag(T &value, int mask, const char *key) { - if (CheckBool(key)) value |= mask; - else value &= ~mask; + if (CheckBool(key)) + value |= mask; + else + value &= ~mask; } @@ -859,6 +862,8 @@ struct UDMFParser strncpy(sdt->bottomtexture, "-", 8); strncpy(sdt->toptexture, "-", 8); strncpy(sdt->midtexture, "-", 8); + sd->SetTextureXScale(FRACUNIT); + sd->SetTextureYScale(FRACUNIT); sc.MustGetToken('{'); while (!sc.CheckToken('}')) @@ -920,23 +925,52 @@ struct UDMFParser sd->SetTextureYOffset(side_t::bottom, CheckFixed(key)); continue; + case NAME_scalex_top: + sd->SetTextureXScale(side_t::top, CheckFixed(key)); + continue; + + case NAME_scaley_top: + sd->SetTextureYScale(side_t::top, CheckFixed(key)); + continue; + + case NAME_scalex_mid: + sd->SetTextureXScale(side_t::mid, CheckFixed(key)); + continue; + + case NAME_scaley_mid: + sd->SetTextureYScale(side_t::mid, CheckFixed(key)); + continue; + + case NAME_scalex_bottom: + sd->SetTextureXScale(side_t::bottom, CheckFixed(key)); + continue; + + case NAME_scaley_bottom: + sd->SetTextureYScale(side_t::bottom, CheckFixed(key)); + continue; + case NAME_light: sd->SetLight(CheckInt(key)); continue; case NAME_lightabsolute: - if (CheckBool(key)) sd->Flags |= WALLF_ABSLIGHTING; - else sd->Flags &= ~WALLF_ABSLIGHTING; + Flag(sd->Flags, WALLF_ABSLIGHTING, key); continue; case NAME_nofakecontrast: - if (CheckBool(key)) sd->Flags |= WALLF_NOFAKECONTRAST; - else sd->Flags &= WALLF_NOFAKECONTRAST; + Flag(sd->Flags, WALLF_NOFAKECONTRAST, key); continue; case NAME_smoothlighting: - if (CheckBool(key)) sd->Flags |= WALLF_SMOOTHLIGHTING; - else sd->Flags &= ~WALLF_SMOOTHLIGHTING; + Flag(sd->Flags, WALLF_SMOOTHLIGHTING, key); + continue; + + case NAME_Wrapmidtex: + Flag(sd->Flags, WALLF_WRAP_MIDTEX, key); + continue; + + case NAME_Clipmidtex: + Flag(sd->Flags, WALLF_CLIP_MIDTEX, key); continue; default: diff --git a/src/r_bsp.h b/src/r_bsp.h index d82117cd..5701647a 100644 --- a/src/r_bsp.h +++ b/src/r_bsp.h @@ -36,6 +36,7 @@ struct drawseg_t fixed_t sz1, sz2; // z for left, right of parent seg on screen fixed_t siz1, siz2; // 1/z for left, right of parent seg on screen fixed_t cx, cy, cdx, cdy; + fixed_t yrepeat; BYTE silhouette; // 0=none, 1=bottom, 2=top, 3=both BYTE bFogBoundary; int shade; diff --git a/src/r_defs.h b/src/r_defs.h index c831d33a..1af91d2b 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -721,10 +721,12 @@ class DBaseDecal; enum { - WALLF_ABSLIGHTING = 1, // Light is absolute instead of relative - WALLF_NOAUTODECALS = 2, // Do not attach impact decals to this wall + WALLF_ABSLIGHTING = 1, // Light is absolute instead of relative + WALLF_NOAUTODECALS = 2, // Do not attach impact decals to this wall WALLF_NOFAKECONTRAST = 4, // Don't do fake contrast for this wall in side_t::GetLightLevel WALLF_SMOOTHLIGHTING = 8, // Similar to autocontrast but applies to all angles. + WALLF_CLIP_MIDTEX = 16, // Like the line counterpart, but only for this side. + WALLF_WRAP_MIDTEX = 32, // Like the line counterpart, but only for this side. }; struct side_t @@ -739,6 +741,8 @@ struct side_t { fixed_t xoffset; fixed_t yoffset; + fixed_t xscale; + fixed_t yscale; FTextureID texture; TObjPtr interpolation; //int Light; @@ -808,6 +812,32 @@ struct side_t textures[which].yoffset += delta; } + void SetTextureXScale(int which, fixed_t scale) + { + textures[which].xscale = scale <= 0? FRACUNIT : scale; + } + void SetTextureXScale(fixed_t scale) + { + textures[top].xscale = textures[mid].xscale = textures[bottom].xscale = scale <= 0? FRACUNIT : scale; + } + fixed_t GetTextureXScale(int which) const + { + return textures[which].xscale; + } + + void SetTextureYScale(int which, fixed_t scale) + { + textures[which].yscale = scale <= 0? FRACUNIT : scale; + } + void SetTextureYScale(fixed_t scale) + { + textures[top].yscale = textures[mid].yscale = textures[bottom].yscale = scale <= 0? FRACUNIT : scale; + } + fixed_t GetTextureYScale(int which) const + { + return textures[which].yscale; + } + DInterpolation *SetInterpolation(int position); void StopInterpolation(int position); //For GL diff --git a/src/r_draw.h b/src/r_draw.h index 518a7c4f..4d452b49 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -266,12 +266,12 @@ bool R_GetTransMaskDrawers (fixed_t (**tmvline1)(), void (**tmvline4)()); // to just use the texture's GetColumn() method. It just exists // for double-layer skies. const BYTE *R_GetColumn (FTexture *tex, int col); -void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, const BYTE *(*getcol)(FTexture *tex, int col)=R_GetColumn); +void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrepeat, const BYTE *(*getcol)(FTexture *tex, int col)=R_GetColumn); // maskwallscan is exactly like wallscan but does not draw anything where the texture is color 0. -void maskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, const BYTE *(*getcol)(FTexture *tex, int col)=R_GetColumn); +void maskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrepeat, const BYTE *(*getcol)(FTexture *tex, int col)=R_GetColumn); // transmaskwallscan is like maskwallscan, but it can also blend to the background -void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, const BYTE *(*getcol)(FTexture *tex, int col)=R_GetColumn); +void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrepeat, const BYTE *(*getcol)(FTexture *tex, int col)=R_GetColumn); #endif diff --git a/src/r_plane.cpp b/src/r_plane.cpp index c67dbe28..bb6df2bf 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -865,8 +865,8 @@ static void R_DrawSky (visplane_t *pl) { lastskycol[x] = 0xffffffff; } - wallscan (pl->minx, pl->maxx, (short *)pl->top, (short *)pl->bottom, swall, lwall, - backskytex == NULL ? R_GetOneSkyColumn : R_GetTwoSkyColumns); + wallscan (pl->minx, pl->maxx, (short *)pl->top, (short *)pl->bottom, swall, lwall, + frontyScale, backskytex == NULL ? R_GetOneSkyColumn : R_GetTwoSkyColumns); } else { // The texture does not tile nicely @@ -906,7 +906,7 @@ static void R_DrawSkyStriped (visplane_t *pl) { lastskycol[x] = 0xffffffff; } - wallscan (pl->minx, pl->maxx, top, bot, swall, lwall, + wallscan (pl->minx, pl->maxx, top, bot, swall, lwall, frontyScale, backskytex == NULL ? R_GetOneSkyColumn : R_GetTwoSkyColumns); yl = yh; yh += drawheight; diff --git a/src/r_segs.cpp b/src/r_segs.cpp index bc04fc37..5bcbafc2 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -127,6 +127,12 @@ static fixed_t rw_scalestep; static fixed_t rw_midtexturemid; static fixed_t rw_toptexturemid; static fixed_t rw_bottomtexturemid; +static fixed_t rw_midtexturescalex; +static fixed_t rw_midtexturescaley; +static fixed_t rw_toptexturescalex; +static fixed_t rw_toptexturescaley; +static fixed_t rw_bottomtexturescalex; +static fixed_t rw_bottomtexturescaley; FTexture *rw_pic; @@ -204,7 +210,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; + fixed_t texheight, textop, texheightscale; sprflipvert = false; @@ -252,13 +258,18 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) } MaskedSWall = (fixed_t *)(openings + ds->swall) - ds->x1; - MaskedScaleY = tex->yScale; + MaskedScaleY = ds->yrepeat; maskedtexturecol = (fixed_t *)(openings + ds->maskedtexturecol) - ds->x1; spryscale = ds->iscale + ds->iscalestep * (x1 - ds->x1); rw_scalestep = ds->iscalestep; // find positioning texheight = tex->GetScaledHeight() << FRACBITS; + texheightscale = curline->sidedef->GetTextureYScale(side_t::mid); + if (texheightscale != FRACUNIT) + { + texheight = FixedDiv(texheight, texheightscale); + } if (curline->linedef->flags & ML_DONTPEGBOTTOM) { dc_texturemid = MAX (frontsector->GetPlaneTexZ(sector_t::floor), backsector->GetPlaneTexZ(sector_t::floor)) + texheight; @@ -276,14 +287,14 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) // still be positioned in world units rather than texels. dc_texturemid += rowoffset - viewz; textop = dc_texturemid; - dc_texturemid = MulScale16 (dc_texturemid, tex->yScale); + 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. - textop = dc_texturemid - viewz + SafeDivScale16 (rowoffset, tex->yScale); - dc_texturemid = MulScale16 (dc_texturemid - viewz, tex->yScale) + rowoffset; + textop = dc_texturemid - viewz + SafeDivScale16 (rowoffset, MaskedScaleY); + dc_texturemid = MulScale16 (dc_texturemid - viewz, MaskedScaleY) + rowoffset; } } @@ -292,7 +303,8 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) else if (fixedcolormap) dc_colormap = fixedcolormap; - if (!(curline->linedef->flags & ML_WRAP_MIDTEX)) + if (!(curline->linedef->flags & ML_WRAP_MIDTEX) && + !(curline->sidedef->Flags & WALLF_WRAP_MIDTEX)) { // Texture does not wrap vertically. // [RH] Don't bother drawing segs that are completely offscreen @@ -378,11 +390,11 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) rw_pic = tex; if (colfunc == basecolfunc) { - maskwallscan(x1, x2, mceilingclip, mfloorclip, MaskedSWall, maskedtexturecol); + maskwallscan(x1, x2, mceilingclip, mfloorclip, MaskedSWall, maskedtexturecol, ds->yrepeat); } else { - transmaskwallscan(x1, x2, mceilingclip, mfloorclip, MaskedSWall, maskedtexturecol); + transmaskwallscan(x1, x2, mceilingclip, mfloorclip, MaskedSWall, maskedtexturecol, ds->yrepeat); } } @@ -408,13 +420,13 @@ inline fixed_t prevline1 (fixed_t vince, BYTE *colormap, int count, fixed_t vplc } void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, - const BYTE *(*getcol)(FTexture *tex, int x)) + fixed_t yrepeat, const BYTE *(*getcol)(FTexture *tex, int x)) { int x, shiftval; int y1ve[4], y2ve[4], u4, d4, z; char bad; fixed_t light = rw_light - rw_lightstep; - SDWORD yrepeat, texturemid, xoffset; + SDWORD texturemid, xoffset; BYTE *basecolormapdata; // This function also gets used to draw skies. Unlike BUILD, skies are @@ -433,7 +445,7 @@ void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t rw_pic->GetHeight(); // Make sure texture size is loaded shiftval = rw_pic->HeightBits; setupvline (32-shiftval); - yrepeat = rw_pic->yScale >> (2 + shiftval); + yrepeat >>= 2 + shiftval; texturemid = dc_texturemid << (16 - shiftval); xoffset = rw_offset; basecolormapdata = basecolormap->Maps; @@ -570,7 +582,7 @@ void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t NetUpdate (); } -void wallscan_striped (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal) +void wallscan_striped (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrepeat) { bool flooding = false; FDynamicColormap *startcolormap = basecolormap; @@ -614,7 +626,7 @@ void wallscan_striped (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, { down[j] = clamp (most3[j], up[j], dwal[j]); } - wallscan (x1, x2, up, down, swal, lwal); + wallscan (x1, x2, up, down, swal, lwal, yrepeat); up = down; down = (down == most1) ? most2 : most1; @@ -641,7 +653,7 @@ void wallscan_striped (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, } } } - wallscan (x1, x2, up, dwal, swal, lwal); + wallscan (x1, x2, up, dwal, swal, lwal, yrepeat); basecolormap = startcolormap; wallshade = startshade; } @@ -658,14 +670,14 @@ inline fixed_t mvline1 (fixed_t vince, BYTE *colormap, int count, fixed_t vplce, } void maskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, - const BYTE *(*getcol)(FTexture *tex, int x)) + fixed_t yrepeat, const BYTE *(*getcol)(FTexture *tex, int x)) { int x, shiftval; BYTE *p; int y1ve[4], y2ve[4], u4, d4, startx, dax, z; char bad; fixed_t light = rw_light - rw_lightstep; - SDWORD yrepeat, texturemid, xoffset; + SDWORD texturemid, xoffset; BYTE *basecolormapdata; if (rw_pic->UseType == FTexture::TEX_Null) @@ -675,7 +687,7 @@ void maskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixe if (!rw_pic->bMasked) { // Textures that aren't masked can use the faster wallscan. - wallscan (x1, x2, uwal, dwal, swal, lwal, getcol); + wallscan (x1, x2, uwal, dwal, swal, lwal, yrepeat, getcol); return; } @@ -685,7 +697,7 @@ void maskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixe rw_pic->GetHeight(); // Make sure texture size is loaded shiftval = rw_pic->HeightBits; setupmvline (32-shiftval); - yrepeat = rw_pic->yScale >> (2 + shiftval); + yrepeat >>= 2 + shiftval; texturemid = dc_texturemid << (16 - shiftval); xoffset = rw_offset; basecolormapdata = basecolormap->Maps; @@ -827,7 +839,7 @@ inline void preptmvline1 (fixed_t vince, BYTE *colormap, int count, fixed_t vplc } void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, - const BYTE *(*getcol)(FTexture *tex, int x)) + fixed_t yrepeat, const BYTE *(*getcol)(FTexture *tex, int x)) { fixed_t (*tmvline1)(); void (*tmvline4)(); @@ -836,7 +848,7 @@ void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, int y1ve[4], y2ve[4], u4, d4, startx, dax, z; char bad; fixed_t light = rw_light - rw_lightstep; - SDWORD yrepeat, texturemid, xoffset; + SDWORD texturemid, xoffset; BYTE *basecolormapdata; if (rw_pic->UseType == FTexture::TEX_Null) @@ -847,7 +859,7 @@ void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, if (!R_GetTransMaskDrawers (&tmvline1, &tmvline4)) { // The current translucency is unsupported, so draw with regular maskwallscan instead. - maskwallscan (x1, x2, uwal, dwal, swal, lwal, getcol); + maskwallscan (x1, x2, uwal, dwal, swal, lwal, yrepeat, getcol); return; } @@ -857,7 +869,7 @@ void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, rw_pic->GetHeight(); // Make sure texture size is loaded shiftval = rw_pic->HeightBits; setuptmvline (32-shiftval); - yrepeat = rw_pic->yScale >> (2 + shiftval); + yrepeat >>= 2 + shiftval; texturemid = dc_texturemid << (16 - shiftval); xoffset = rw_offset; basecolormapdata = basecolormap->Maps; @@ -1006,7 +1018,7 @@ void R_RenderSegLoop () int x1 = rw_x; int x2 = rw_stopx; int x; - int xscale; + fixed_t xscale, yscale; fixed_t xoffset = rw_offset; if (fixedlightlev) @@ -1065,7 +1077,8 @@ void R_RenderSegLoop () { dc_texturemid = rw_midtexturemid; rw_pic = midtexture; - xscale = rw_pic->xScale; + xscale = FixedMul(rw_pic->xScale, rw_midtexturescalex); + yscale = FixedMul(rw_pic->yScale, rw_midtexturescaley); if (xscale != lwallscale) { PrepLWall (lwall, curline->sidedef->TexelLength*xscale); @@ -1073,7 +1086,7 @@ void R_RenderSegLoop () } if (midtexture->bWorldPanning) { - rw_offset = MulScale16 (rw_offset_mid, midtexture->xScale); + rw_offset = MulScale16 (rw_offset_mid, xscale); } else { @@ -1081,11 +1094,11 @@ void R_RenderSegLoop () } if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights) { - wallscan (x1, x2-1, walltop, wallbottom, swall, lwall); + wallscan (x1, x2-1, walltop, wallbottom, swall, lwall, yscale); } else { - wallscan_striped (x1, x2-1, walltop, wallbottom, swall, lwall); + wallscan_striped (x1, x2-1, walltop, wallbottom, swall, lwall, yscale); } } clearbufshort (ceilingclip+x1, x2-x1, viewheight); @@ -1103,7 +1116,8 @@ void R_RenderSegLoop () { dc_texturemid = rw_toptexturemid; rw_pic = toptexture; - xscale = rw_pic->xScale; + xscale = FixedMul(rw_pic->xScale, rw_toptexturescalex); + yscale = FixedMul(rw_pic->yScale, rw_toptexturescaley); if (xscale != lwallscale) { PrepLWall (lwall, curline->sidedef->TexelLength*xscale); @@ -1111,7 +1125,7 @@ void R_RenderSegLoop () } if (toptexture->bWorldPanning) { - rw_offset = MulScale16 (rw_offset_top, toptexture->xScale); + rw_offset = MulScale16 (rw_offset_top, xscale); } else { @@ -1119,11 +1133,11 @@ void R_RenderSegLoop () } if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights) { - wallscan (x1, x2-1, walltop, wallupper, swall, lwall); + wallscan (x1, x2-1, walltop, wallupper, swall, lwall, yscale); } else { - wallscan_striped (x1, x2-1, walltop, wallupper, swall, lwall); + wallscan_striped (x1, x2-1, walltop, wallupper, swall, lwall, yscale); } } memcpy (ceilingclip+x1, wallupper+x1, (x2-x1)*sizeof(short)); @@ -1144,7 +1158,8 @@ void R_RenderSegLoop () { dc_texturemid = rw_bottomtexturemid; rw_pic = bottomtexture; - xscale = rw_pic->xScale; + xscale = FixedMul(rw_pic->xScale, rw_bottomtexturescalex); + yscale = FixedMul(rw_pic->yScale, rw_bottomtexturescaley); if (xscale != lwallscale) { PrepLWall (lwall, curline->sidedef->TexelLength*xscale); @@ -1152,7 +1167,7 @@ void R_RenderSegLoop () } if (bottomtexture->bWorldPanning) { - rw_offset = MulScale16 (rw_offset_bottom, bottomtexture->xScale); + rw_offset = MulScale16 (rw_offset_bottom, xscale); } else { @@ -1160,11 +1175,11 @@ void R_RenderSegLoop () } if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights) { - wallscan (x1, x2-1, walllower, wallbottom, swall, lwall); + wallscan (x1, x2-1, walllower, wallbottom, swall, lwall, yscale); } else { - wallscan_striped (x1, x2-1, walllower, wallbottom, swall, lwall); + wallscan_striped (x1, x2-1, walllower, wallbottom, swall, lwall, yscale); } } memcpy (floorclip+x1, walllower+x1, (x2-x1)*sizeof(short)); @@ -1179,7 +1194,7 @@ void R_RenderSegLoop () void R_NewWall (bool needlights) { - fixed_t rowoffset; + fixed_t rowoffset, yrepeat; rw_markmirror = false; @@ -1205,6 +1220,9 @@ void R_NewWall (bool needlights) midtexture = TexMan(sidedef->GetTexture(side_t::mid)); rw_offset_mid = sidedef->GetTextureXOffset(side_t::mid); rowoffset = sidedef->GetTextureYOffset(side_t::mid); + rw_midtexturescalex = sidedef->GetTextureXScale(side_t::mid); + rw_midtexturescaley = sidedef->GetTextureYScale(side_t::mid); + yrepeat = FixedMul(midtexture->yScale, rw_midtexturescaley); if (linedef->flags & ML_DONTPEGBOTTOM) { // bottom of texture at bottom rw_midtexturemid = frontsector->GetPlaneTexZ(sector_t::floor) + (midtexture->GetHeight() << FRACBITS); @@ -1219,14 +1237,13 @@ void R_NewWall (bool needlights) } if (midtexture->bWorldPanning) { - rw_midtexturemid = MulScale16 (rw_midtexturemid - viewz + rowoffset, midtexture->yScale); + rw_midtexturemid = MulScale16(rw_midtexturemid - viewz + rowoffset, yrepeat); } else { // rowoffset is added outside the multiply so that it positions the texture // by texels instead of world units. - rw_midtexturemid = MulScale16 (rw_midtexturemid - viewz, midtexture->yScale) - + rowoffset; + rw_midtexturemid = MulScale16(rw_midtexturemid - viewz, yrepeat) + rowoffset; } } } @@ -1295,7 +1312,9 @@ void R_NewWall (bool needlights) || backsector->GetAngle(sector_t::floor) != frontsector->GetAngle(sector_t::floor) - || (sidedef->GetTexture(side_t::mid).isValid() && linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX)) + || (sidedef->GetTexture(side_t::mid).isValid() && + ((linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX)) || + (sidedef->Flags & (WALLF_CLIP_MIDTEX|WALLF_WRAP_MIDTEX)))) ; markceiling = (frontsector->GetTexture(sector_t::ceiling) != skyflatnum || @@ -1324,20 +1343,24 @@ void R_NewWall (bool needlights) || backsector->GetAngle(sector_t::ceiling) != frontsector->GetAngle(sector_t::ceiling) - || (sidedef->GetTexture(side_t::mid).isValid() && linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX)) + || (sidedef->GetTexture(side_t::mid).isValid() && + ((linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX)) || + (sidedef->Flags & (WALLF_CLIP_MIDTEX|WALLF_WRAP_MIDTEX)))) ); } if (rw_havehigh) { // top texture toptexture = TexMan(sidedef->GetTexture(side_t::top)); - const fixed_t scale = toptexture->yScale; rw_offset_top = sidedef->GetTextureXOffset(side_t::top); rowoffset = sidedef->GetTextureYOffset(side_t::top); + rw_toptexturescalex = sidedef->GetTextureXScale(side_t::top); + rw_toptexturescaley = sidedef->GetTextureYScale(side_t::top); + yrepeat = FixedMul(toptexture->yScale, rw_toptexturescaley); if (linedef->flags & ML_DONTPEGTOP) { // top of texture at top - rw_toptexturemid = MulScale16 (frontsector->GetPlaneTexZ(sector_t::ceiling) - viewz, scale); + rw_toptexturemid = MulScale16 (frontsector->GetPlaneTexZ(sector_t::ceiling) - viewz, yrepeat); if (rowoffset < 0 && toptexture != NULL) { rowoffset += toptexture->GetHeight() << FRACBITS; @@ -1345,11 +1368,11 @@ void R_NewWall (bool needlights) } else { // bottom of texture at bottom - rw_toptexturemid = MulScale16 (backsector->GetPlaneTexZ(sector_t::ceiling) - viewz, scale) + (toptexture->GetHeight() << FRACBITS); + rw_toptexturemid = MulScale16(backsector->GetPlaneTexZ(sector_t::ceiling) - viewz, yrepeat) + (toptexture->GetHeight() << FRACBITS); } if (toptexture->bWorldPanning) { - rw_toptexturemid += MulScale16 (rowoffset, scale); + rw_toptexturemid += MulScale16(rowoffset, yrepeat); } else { @@ -1362,6 +1385,9 @@ void R_NewWall (bool needlights) rw_offset_bottom = sidedef->GetTextureXOffset(side_t::bottom); rowoffset = sidedef->GetTextureYOffset(side_t::bottom); + rw_bottomtexturescalex = sidedef->GetTextureXScale(side_t::bottom); + rw_bottomtexturescaley = sidedef->GetTextureYScale(side_t::bottom); + yrepeat = FixedMul(bottomtexture->yScale, rw_bottomtexturescaley); if (linedef->flags & ML_DONTPEGBOTTOM) { // bottom of texture at bottom rw_bottomtexturemid = rw_frontlowertop; @@ -1376,13 +1402,11 @@ void R_NewWall (bool needlights) } if (bottomtexture->bWorldPanning) { - rw_bottomtexturemid = MulScale16 (rw_bottomtexturemid - viewz + rowoffset, - bottomtexture->yScale); + rw_bottomtexturemid = MulScale16(rw_bottomtexturemid - viewz + rowoffset, yrepeat); } else { - rw_bottomtexturemid = MulScale16 (rw_bottomtexturemid - viewz, bottomtexture->yScale) - + rowoffset; + rw_bottomtexturemid = MulScale16(rw_bottomtexturemid - viewz, yrepeat) + rowoffset; } } } @@ -1405,13 +1429,15 @@ void R_NewWall (bool needlights) segtextured = midtex != NULL || toptexture != NULL || bottomtexture != NULL; // calculate light table - if (needlights && (segtextured || (backsector && IsFogBoundary (frontsector, backsector)))) + if (needlights && (segtextured || (backsector && IsFogBoundary(frontsector, backsector)))) { - lwallscale = midtex ? midtex->xScale : - toptexture ? toptexture->xScale : - bottomtexture ? bottomtexture->xScale : FRACUNIT; + lwallscale = + midtex ? FixedMul(midtex->xScale, sidedef->GetTextureXScale(side_t::mid)) : + toptexture ? FixedMul(toptexture->xScale, sidedef->GetTextureXScale(side_t::top)) : + bottomtexture ? FixedMul(bottomtexture->xScale, sidedef->GetTextureXScale(side_t::bottom)) : + FRACUNIT; - PrepWall (swall, lwall, sidedef->TexelLength*lwallscale); + PrepWall (swall, lwall, sidedef->TexelLength * lwallscale); if (!fixedcolormap) { @@ -1629,12 +1655,12 @@ void R_StoreWallRange (int start, int stop) lwal = (fixed_t *)(openings + ds_p->maskedtexturecol); swal = (fixed_t *)(openings + ds_p->swall); FTexture *pic = TexMan(sidedef->GetTexture(side_t::mid)); - int scaley = pic->yScale; - int xoffset = sidedef->GetTextureXOffset(side_t::mid); + fixed_t yrepeat = FixedMul(pic->yScale, sidedef->GetTextureYScale(side_t::mid)); + fixed_t xoffset = sidedef->GetTextureXOffset(side_t::mid); if (pic->bWorldPanning) { - xoffset = MulScale16 (xoffset, pic->xScale); + xoffset = MulScale16 (xoffset, lwallscale); } for (i = start; i < stop; i++) @@ -1643,8 +1669,8 @@ void R_StoreWallRange (int start, int stop) *swal++ = swall[i]; } - fixed_t istart = MulScale18 (*((fixed_t *)(openings + ds_p->swall)), scaley); - fixed_t iend = MulScale18 (*(swal - 1), scaley); + fixed_t istart = MulScale18 (*((fixed_t *)(openings + ds_p->swall)), yrepeat); + fixed_t iend = MulScale18 (*(swal - 1), yrepeat); if (istart < 3 && istart >= 0) istart = 3; if (istart > -3 && istart < 0) istart = -3; @@ -1652,8 +1678,8 @@ void R_StoreWallRange (int start, int stop) if (iend > -3 && iend < 0) iend = -3; istart = DivScale32 (1, istart); iend = DivScale32 (1, iend); + ds_p->yrepeat = yrepeat; ds_p->iscale = istart; - if (stop - start > 1) { ds_p->iscalestep = (iend - istart) / (stop - start - 1); diff --git a/src/svnrevision.h b/src/svnrevision.h index 01b015c1..d4667c53 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "1643" -#define ZD_SVN_REVISION_NUMBER 1643 +#define ZD_SVN_REVISION_STRING "1648" +#define ZD_SVN_REVISION_NUMBER 1648 diff --git a/wadsrc/static/actors/hexen/flame.txt b/wadsrc/static/actors/hexen/flame.txt index 17d283df..c3a222ea 100644 --- a/wadsrc/static/actors/hexen/flame.txt +++ b/wadsrc/static/actors/hexen/flame.txt @@ -58,6 +58,7 @@ ACTOR FlameSmall : SwitchableDecoration 10501 SpawnID 97 +NOTELEPORT +INVISIBLE + Radius 15 RenderStyle Add States { @@ -90,6 +91,7 @@ ACTOR FlameLarge : SwitchableDecoration 10503 SpawnID 99 +NOTELEPORT +INVISIBLE + Radius 15 RenderStyle Add States { diff --git a/wadsrc/static/actors/shared/inventory.txt b/wadsrc/static/actors/shared/inventory.txt index 02fc6611..03285eea 100644 --- a/wadsrc/static/actors/shared/inventory.txt +++ b/wadsrc/static/actors/shared/inventory.txt @@ -109,17 +109,11 @@ ACTOR HexenArmor : Armor native +Inventory.UNDROPPABLE } -ACTOR DehackedPickup : Inventory native -{ -} +ACTOR DehackedPickup : Inventory native {} -ACTOR FakeInventory : Inventory native -{ -} +ACTOR FakeInventory : Inventory native {} -ACTOR CustomInventory : Inventory native -{ -} +ACTOR CustomInventory : Inventory native {} Actor Health : Inventory native { @@ -148,9 +142,7 @@ ACTOR PowerupGiver : Inventory native Inventory.PickupSound "misc/p_pkup" } -ACTOR Powerup : Inventory native -{ -} +ACTOR Powerup : Inventory native {} ACTOR PowerInvulnerable : Powerup native { @@ -170,9 +162,7 @@ ACTOR PowerInvisibility : Powerup native Powerup.Duration -60 } -ACTOR PowerGhost : PowerInvisibility native -{ -} +ACTOR PowerGhost : PowerInvisibility native {} ACTOR PowerShadow : PowerInvisibility native { @@ -199,9 +189,7 @@ ACTOR PowerLightAmp : Powerup native Powerup.Duration -120 } -ACTOR PowerTorch : PowerLightAmp native -{ -} +ACTOR PowerTorch : PowerLightAmp native {} ACTOR PowerFlight : Powerup native { @@ -290,23 +278,22 @@ ACTOR PowerRegeneration : Powerup native Powerup.Duration -120 } -ACTOR PowerHighJump : Powerup native -{ -} +ACTOR PowerHighJump : Powerup native {} -ACTOR PowerDoubleFiringSpeed : Powerup native -{ -} +ACTOR PowerDoubleFiringSpeed : Powerup native {} ACTOR PowerMorph : Powerup native { Powerup.Duration -40 } -ACTOR MapRevealer : Inventory native +ACTOR PowerInfiniteAmmo : Powerup native { + Powerup.Duration -30 } +ACTOR MapRevealer : Inventory native {} + ACTOR PuzzleItem : Inventory native { +NOGRAVITY @@ -342,7 +329,4 @@ Actor WeaponHolder : Inventory native +INVENTORY.UNDROPPABLE } -Actor WeaponPiece : Inventory native -{ -} - +Actor WeaponPiece : Inventory native {}