Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/coelckers/gzdoom into master
Browse files Browse the repository at this point in the history
# Conflicts:
#	wadsrc_widescreen/static
  • Loading branch information
drfrag666 committed May 23, 2021
2 parents a1d7bfc + 5cde021 commit 2be2e7f
Show file tree
Hide file tree
Showing 37 changed files with 1,680 additions and 1,454 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,22 @@ jobs:
if [[ ! -z "${{ matrix.config.deps_cmdline }}" ]]; then
eval ${{ matrix.config.deps_cmdline }}
fi
# Build and install ZMusic
mkdir build
cd build
git clone https://github.com/coelckers/ZMusic.git
cd ZMusic
git checkout 1.1.6
cd ..
cmake -B zmusic_build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_INSTALL_PREFIX=`pwd`/zmusic_install ${{ matrix.config.extra_options }} ZMusic
cmake --build zmusic_build --target install --parallel 3
if [[ "${{ runner.os }}" == 'macOS' ]]; then
export ZMUSIC_PACKAGE=zmusic-1.1.7-macos.tar.bz2
elif [[ "${{ runner.os }}" == 'Linux' ]]; then
export ZMUSIC_PACKAGE=zmusic-1.1.7-linux.tar.bz2
fi
if [[ ! -z "${ZMUSIC_PACKAGE}" ]]; then
cd build
wget -q "https://github.com/coelckers/gzdoom/releases/download/ci_deps/${ZMUSIC_PACKAGE}"
tar -xf "${ZMUSIC_PACKAGE}"
fi
- name: Configure
shell: bash
run: |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_PREFIX_PATH=`pwd`/build/zmusic_install ${{ matrix.config.extra_options }} .
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_PREFIX_PATH=`pwd`/build/zmusic -DPK3_QUIET_ZIPDIR=ON ${{ matrix.config.extra_options }} .
- name: Build
shell: bash
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ if( HAVE_VM_JIT AND UNIX )
else( HAVE_LIBEXECINFO )
set( HAVE_VM_JIT NO )
endif( HAVE_LIBEXECINFO )
set( CMAKE_REQUIRED_FLAGS )
endif( NOT HAVE_BACKTRACE )
endif( HAVE_VM_JIT AND UNIX )

Expand Down
2 changes: 2 additions & 0 deletions src/common/engine/startupinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ struct FStartupInfo
uint32_t FgColor; // Foreground color for title banner
uint32_t BkColor; // Background color for title banner
FString Song;
FString con;
FString def;
int Type;
int LoadLights = -1;
int LoadBrightmaps = -1;
Expand Down
14 changes: 12 additions & 2 deletions src/common/rendering/hwrenderer/data/hw_renderstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,18 +555,28 @@ class FRenderState
mRenderStyle = rs;
}

auto GetDepthBias()
{
return mBias;
}

void SetDepthBias(float a, float b)
{
mBias.mChanged = mBias.mFactor != a || mBias.mUnits != b;
mBias.mFactor = a;
mBias.mUnits = b;
mBias.mChanged = true;
}

void SetDepthBias(FDepthBiasState& bias)
{
SetDepthBias(bias.mFactor, bias.mUnits);
}

void ClearDepthBias()
{
mBias.mChanged = mBias.mFactor != 0 || mBias.mUnits != 0;
mBias.mFactor = 0;
mBias.mUnits = 0;
mBias.mChanged = true;
}

private:
Expand Down
2 changes: 1 addition & 1 deletion src/common/scripting/backend/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ FxExpression *FxIntCast::Resolve(FCompileContext &ctx)
{
ExpVal constval = static_cast<FxConstant *>(basex)->GetValue();
FxExpression *x = new FxConstant(constval.GetInt(), ScriptPosition);
if (constval.GetInt() != constval.GetFloat())
if (constval.GetInt() != constval.GetFloat() && !Explicit)
{
ScriptPosition.Message(MSG_WARNING, "Truncation of floating point constant %f", constval.GetFloat());
}
Expand Down
50 changes: 43 additions & 7 deletions src/common/textures/formats/pngtexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class FPNGTexture : public FImageSource
uint32_t StartOfPalette = 0;
};

FImageSource* StbImage_TryCreate(FileReader& file, int lumpnum);

//==========================================================================
//
Expand Down Expand Up @@ -127,6 +128,46 @@ FImageSource *PNGImage_TryCreate(FileReader & data, int lumpnum)
}
if (!((1 << bitdepth) & 0x116))
{
// Try STBImage for 16 bit PNGs.
auto tex = StbImage_TryCreate(data, lumpnum);
if (tex)
{
// STBImage does not handle grAb, so do that here and insert the data into the texture.
data.Seek(33, FileReader::SeekSet);

int len = data.ReadInt32BE();
int id = data.ReadInt32();
while (id != MAKE_ID('I', 'D', 'A', 'T') && id != MAKE_ID('I', 'E', 'N', 'D'))
{
if (id != MAKE_ID('g', 'r', 'A', 'b'))
{
data.Seek(len, FileReader::SeekCur);
}
else
{
int ihotx = data.ReadInt32BE();
int ihoty = data.ReadInt32BE();
if (ihotx < -32768 || ihotx > 32767)
{
Printf("X-Offset for PNG texture %s is bad: %d (0x%08x)\n", fileSystem.GetFileFullName(lumpnum), ihotx, ihotx);
ihotx = 0;
}
if (ihoty < -32768 || ihoty > 32767)
{
Printf("Y-Offset for PNG texture %s is bad: %d (0x%08x)\n", fileSystem.GetFileFullName(lumpnum), ihoty, ihoty);
ihoty = 0;
}
tex->SetOffsets(ihotx, ihoty);
}

data.Seek(4, FileReader::SeekCur); // Skip CRC
len = data.ReadInt32BE();
id = MAKE_ID('I', 'E', 'N', 'D');
id = data.ReadInt32();
}
return tex;
}

Printf(TEXTCOLOR_YELLOW"WARNING: failed to load PNG %s: the bit-depth (%u) is not supported!\n", fileSystem.GetFileFullName(lumpnum), bitdepth);
return NULL;
}
Expand Down Expand Up @@ -185,13 +226,8 @@ FPNGTexture::FPNGTexture (FileReader &lump, int lumpnum, int width, int height,
case MAKE_ID('g','r','A','b'):
// This is like GRAB found in an ILBM, except coordinates use 4 bytes
{
uint32_t hotx, hoty;
int ihotx, ihoty;

lump.Read(&hotx, 4);
lump.Read(&hoty, 4);
ihotx = BigLong((int)hotx);
ihoty = BigLong((int)hoty);
int ihotx = lump.ReadInt32BE();
int ihoty = lump.ReadInt32BE();
if (ihotx < -32768 || ihotx > 32767)
{
Printf ("X-Offset for PNG texture %s is bad: %d (0x%08x)\n", fileSystem.GetFileFullName (lumpnum), ihotx, ihotx);
Expand Down
2 changes: 1 addition & 1 deletion src/common/textures/formats/stbtexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#define STBI_NO_STDIO
// Undefine formats we do not want to support here.
#define STBI_NO_JPEG
#define STBI_NO_PNG
//#define STBI_NO_PNG we need PNG for 16 bit channel images. Regular ones still use our own, more flexible decoder.
#define STBI_NO_TGA
#define STBI_NO_PSD
#define STBI_NO_HDR
Expand Down
1 change: 1 addition & 0 deletions src/d_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,7 @@ void D_DoAdvanceDemo (void)

void D_StartTitle (void)
{
playedtitlemusic = false;
gameaction = ga_nothing;
demosequence = -1;
D_AdvanceDemo ();
Expand Down
9 changes: 9 additions & 0 deletions src/intermission/intermission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,15 @@ void DIntermissionScreenText::Init(FIntermissionAction *desc, bool first)
Super::Init(desc, first);
mText = static_cast<FIntermissionActionTextscreen*>(desc)->mText;
if (mText[0] == '$') mText = GStrings(&mText[1]);

auto lines = mText.Split("\n");
mText = "";
for (auto& line : lines)
{
line.StripRight();
mText << line << "\n";
}

mTextSpeed = static_cast<FIntermissionActionTextscreen*>(desc)->mTextSpeed;
mTextX = static_cast<FIntermissionActionTextscreen*>(desc)->mTextX;
usesDefault = mTextX < 0;
Expand Down
6 changes: 4 additions & 2 deletions src/playsim/a_decals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ DBaseDecal *DImpactDecal::CloneSelf (const FDecalTemplate *tpl, double ix, doubl
//
//----------------------------------------------------------------------------

void SprayDecal(AActor *shooter, const char *name, double distance, DVector3 offset, DVector3 direction)
void SprayDecal(AActor *shooter, const char *name, double distance, DVector3 offset, DVector3 direction, bool useBloodColor, uint32_t decalColor)
{
//just in case
if (!shooter)
Expand Down Expand Up @@ -859,12 +859,14 @@ void SprayDecal(AActor *shooter, const char *name, double distance, DVector3 off
else
dir = direction;

uint32_t bloodTrans = useBloodColor ? shooter->BloodTranslation : 0;
PalEntry entry = !useBloodColor ? (PalEntry)decalColor : shooter->BloodColor;

if (Trace(off, shooter->Sector, dir, distance, 0, ML_BLOCKEVERYTHING, shooter, trace, TRACE_NoSky))
{
if (trace.HitType == TRACE_HitWall)
{
DImpactDecal::StaticCreate(shooter->Level, name, trace.HitPos, trace.Line->sidedef[trace.Side], NULL);
DImpactDecal::StaticCreate(shooter->Level, name, trace.HitPos, trace.Line->sidedef[trace.Side], NULL, entry, bloodTrans);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/playsim/a_sharedglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DBaseDecal;
struct SpreadInfo;

DBaseDecal *ShootDecal(FLevelLocals *Level, const FDecalTemplate *tpl, sector_t *sec, double x, double y, double z, DAngle angle, double tracedist, bool permanent);
void SprayDecal(AActor *shooter, const char *name,double distance = 172., DVector3 offset = DVector3(0., 0., 0.), DVector3 direction = DVector3(0., 0., 0.) );
void SprayDecal(AActor *shooter, const char *name,double distance = 172., DVector3 offset = DVector3(0., 0., 0.), DVector3 direction = DVector3(0., 0., 0.), bool useBloodColor = false, uint32_t decalColor = 0);

class DBaseDecal : public DThinker
{
Expand Down
4 changes: 3 additions & 1 deletion src/playsim/p_actionfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5005,7 +5005,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SprayDecal)
PARAM_FLOAT(direction_x);
PARAM_FLOAT(direction_y);
PARAM_FLOAT(direction_z);
SprayDecal(self, name, dist, DVector3(offset_x, offset_y, offset_z), DVector3(direction_x, direction_y, direction_z) );
PARAM_BOOL(useBloodColor);
PARAM_COLOR(decalColor);
SprayDecal(self, name, dist, DVector3(offset_x, offset_y, offset_z), DVector3(direction_x, direction_y, direction_z), useBloodColor, decalColor);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/playsim/p_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4610,7 +4610,7 @@ AActor *P_LineAttack(AActor *t1, DAngle angle, double distance,
}

P_GeometryLineAttack(trace, t1, damage, damageType);

if (victim != NULL) victim->unlinked = trace.unlinked;

// position a bit closer for puffs
if (nointeract || trace.HitType != TRACE_HitWall || ((trace.Line->special != Line_Horizon) || spawnSky))
Expand Down
8 changes: 4 additions & 4 deletions src/playsim/p_switch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,13 @@ bool P_ChangeSwitchTexture (side_t *side, int useAgain, uint8_t special, bool *q
{
texture = side_t::top;
}
else if ((Switch = TexAnim.FindSwitch (side->GetTexture(side_t::bottom))) != NULL)
else if ((Switch = TexAnim.FindSwitch(side->GetTexture(side_t::mid))) != NULL)
{
texture = side_t::bottom;
texture = side_t::mid;
}
else if ((Switch = TexAnim.FindSwitch (side->GetTexture(side_t::mid))) != NULL)
else if ((Switch = TexAnim.FindSwitch (side->GetTexture(side_t::bottom))) != NULL)
{
texture = side_t::mid;
texture = side_t::bottom;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/rendering/hwrenderer/scene/hw_sprites.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ void HWSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingp
const float NO_VAL = 100000000.0f;
bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(NAME_Inventory)) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE));
bool smarterclip = !clipthing && gl_spriteclip == 3;
if (clipthing || gl_spriteclip > 1)
if ((clipthing || gl_spriteclip > 1) && !(thing->flags2 & MF2_FLOATBOB))
{

float btm = NO_VAL;
Expand Down
10 changes: 5 additions & 5 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ const char *GetVersionString();

/** Lots of different version numbers **/

#define VERSIONSTR "4.6pre"
#define VERSIONSTR "4.7pre"

// The version as seen in the Windows resource
#define RC_FILEVERSION 4,5,9999,0
#define RC_PRODUCTVERSION 4,5,9999,0
#define RC_FILEVERSION 4,6,9999,0
#define RC_PRODUCTVERSION 4,6,9999,0
#define RC_PRODUCTVERSION2 VERSIONSTR
// These are for content versioning.
#define VER_MAJOR 4
#define VER_MINOR 6
#define VER_MINOR 7
#define VER_REVISION 0

// This should always refer to the GZDoom version a derived port is based on and not reflect the derived port's version number!
#define ENG_MAJOR 4
#define ENG_MINOR 6
#define ENG_MINOR 7
#define ENG_REVISION 0

// Version identifier for network games.
Expand Down
Loading

0 comments on commit 2be2e7f

Please sign in to comment.