Skip to content

Commit 2f5e36e

Browse files
Merge branch 'master' into actor-sight-blocker
2 parents f888895 + 05167fd commit 2f5e36e

File tree

110 files changed

+3209
-1814
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+3209
-1814
lines changed

auto-setup-linux.sh

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
#!/bin/bash
2+
#**
3+
#** auto-setup-linux.sh
4+
#** Automatic (easy) setup and build script for Linux
5+
#**
6+
#** Note that this script assumes you have both 'git' and 'cmake' installed properly and in your PATH!
7+
#** This script also assumes you have installed a build system that cmake can automatically detect.
8+
#** Such as GCC or Clang. Requires appropriate supporting libraries installed too!
9+
#** Without these items, this script will FAIL! So make sure you have your build environment properly
10+
#** set up in order for this script to succeed.
11+
#**
12+
#** The purpose of this script is to get someone easily going with a full working compile of GZDoom.
13+
#** This allows anyone to make simple changes or tweaks to the engine as they see fit and easily
14+
#** compile their own copy without having to follow complex instructions to get it working.
15+
#** Every build environment is different, and every computer system is different - this should work
16+
#** in most typical systems under Windows but it may fail under certain types of systems or conditions.
17+
#** Not guaranteed to work and your mileage will vary.
18+
#**
19+
#** Prerequisite Packages used in testing (from Linux Mint-XFCE):
20+
#** nasm autoconf libtool libsystemd-dev clang-15 libx11-dev libsdl2-dev libgtk-3-dev
21+
#**
22+
#**---------------------------------------------------------------------------
23+
#** Copyright 2024 Rachael Alexanderson and the GZDoom team
24+
#** All rights reserved.
25+
#**
26+
#** Redistribution and use in source and binary forms, with or without
27+
#** modification, are permitted provided that the following conditions
28+
#** are met:
29+
#**
30+
#** 1. Redistributions of source code must retain the above copyright
31+
#** notice, this list of conditions and the following disclaimer.
32+
#** 2. Redistributions in binary form must reproduce the above copyright
33+
#** notice, this list of conditions and the following disclaimer in the
34+
#** documentation and/or other materials provided with the distribution.
35+
#** 3. The name of the author may not be used to endorse or promote products
36+
#** derived from this software without specific prior written permission.
37+
#**
38+
#** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
39+
#** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
40+
#** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
41+
#** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
42+
#** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
43+
#** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
44+
#** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
45+
#** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
46+
#** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
47+
#** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48+
#**---------------------------------------------------------------------------
49+
#**
50+
51+
# -- Always operate within the build folder
52+
BUILDFOLDER=$(dirname "$0")/build
53+
54+
if [ ! -d "$BUILDFOLDER" ]; then
55+
mkdir "$BUILDFOLDER"
56+
fi
57+
cd "$BUILDFOLDER"
58+
59+
if [ -d "vcpkg" ]; then
60+
git -C ./vcpkg pull
61+
fi
62+
if [ ! -d "vcpkg" ]; then
63+
git clone https://github.com/microsoft/vcpkg
64+
fi
65+
if [ -d "zmusic" ]; then
66+
git -C ./zmusic fetch
67+
fi
68+
if [ ! -d "zmusic" ]; then
69+
git clone https://github.com/zdoom/zmusic
70+
fi
71+
if [ -d "zmusic" ]; then
72+
git -C ./zmusic checkout 1.1.12
73+
fi
74+
75+
if [ ! -d "zmusic/build" ]; then
76+
mkdir zmusic/build
77+
fi
78+
if [ ! -d "vcpkg_installed" ]; then
79+
mkdir vcpkg_installed
80+
fi
81+
82+
cmake -S ./zmusic -B ./zmusic/build \
83+
-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake \
84+
-DVCPKG_LIBSNDFILE=1 \
85+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
86+
-DVCPKG_INSTALLLED_DIR=../vcpkg_installed/
87+
pushd ./zmusic/build
88+
make -j $(nproc)
89+
popd
90+
91+
cmake -S .. -B . \
92+
-DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake \
93+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
94+
-DVCPKG_INSTALLLED_DIR=./vcpkg_installed/
95+
make -j $(nproc); rc=$?
96+
97+
# -- If successful, show the build
98+
if [ $rc -eq 0 ]; then
99+
if [ -f gzdoom ]; then
100+
xdg-open .
101+
fi
102+
fi
103+
104+
exit $rc

auto-setup-windows.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ goto aftercopyright
1919
** Not guaranteed to work and your mileage will vary.
2020
**
2121
**---------------------------------------------------------------------------
22-
** Copyright 2023 Rachael Alexanderson and the GZDoom team
22+
** Copyright 2023-2024 Rachael Alexanderson and the GZDoom team
2323
** All rights reserved.
2424
**
2525
** Redistribution and use in source and binary forms, with or without

cmake/FindZMusic.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ if(ZMUSIC_INCLUDE_DIR AND ZMUSIC_LIBRARIES)
1010
set(ZMUSIC_FIND_QUIETLY TRUE)
1111
endif()
1212

13-
find_path(ZMUSIC_INCLUDE_DIR zmusic.h)
13+
find_path(ZMUSIC_INCLUDE_DIR zmusic.h
14+
HINTS
15+
${CMAKE_SOURCE_DIR}/build/zmusic/include
16+
)
1417

15-
find_library(ZMUSIC_LIBRARIES NAMES zmusic)
18+
find_library(ZMUSIC_LIBRARIES NAMES zmusic
19+
HINTS
20+
${CMAKE_SOURCE_DIR}/build/zmusic/build/source
21+
)
1622
mark_as_advanced(ZMUSIC_LIBRARIES ZMUSIC_INCLUDE_DIR)
1723

1824
# handle the QUIETLY and REQUIRED arguments and set ZMUSIC_FOUND to TRUE if

libraries/ZWidget/src/core/widget.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,10 @@ void Widget::OnWindowMouseMove(const Point& pos)
563563
do
564564
{
565565
widget->OnMouseMove(widget->MapFrom(this, pos));
566+
if (widget == this)
567+
break;
566568
widget = widget->Parent();
567-
} while (widget != this);
569+
} while (widget);
568570
}
569571
}
570572

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ if( NOT WIN32 AND NOT APPLE )
13861386
IF ("${INSTALL_RPATH}" STREQUAL "")
13871387
set_target_properties(zdoom PROPERTIES
13881388
#allow libzmusic.so.1 library in same folder as executable at runtime
1389-
INSTALL_RPATH "\$ORIGIN"
1389+
INSTALL_RPATH "\$ORIGIN:\$ORIGIN/zmusic/build/source"
13901390
BUILD_WITH_INSTALL_RPATH ON
13911391
)
13921392
endif()

src/am_map.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,7 +2952,8 @@ void DAutomap::drawThings ()
29522952
if (am_cheat > 0 || !(t->flags6 & MF6_NOTONAUTOMAP)
29532953
|| (am_thingrenderstyles && !(t->renderflags & RF_INVISIBLE) && !(t->flags6 & MF6_NOTONAUTOMAP)))
29542954
{
2955-
DVector3 pos = t->InterpolatedPosition(r_viewpoint.TicFrac) + t->Level->Displacements.getOffset(sec.PortalGroup, MapPortalGroup);
2955+
DVector3 fracPos = t->InterpolatedPosition(r_viewpoint.TicFrac);
2956+
FVector2 pos = FVector2(float(fracPos.X),float(fracPos.Y)) + FVector2(t->Level->Displacements.getOffset(sec.PortalGroup, MapPortalGroup)) + FVector2(t->AutomapOffsets);
29562957
p.x = pos.X;
29572958
p.y = pos.Y;
29582959

@@ -2962,14 +2963,14 @@ void DAutomap::drawThings ()
29622963
spriteframe_t *frame;
29632964
int rotation = 0;
29642965

2965-
// try all modes backwards until a valid texture has been found.
2966+
// try all modes backwards until a valid texture has been found.
29662967
for(int show = am_showthingsprites; show > 0 && texture == nullptr; show--)
29672968
{
29682969
const spritedef_t& sprite = sprites[t->sprite];
29692970
const size_t spriteIndex = sprite.spriteframes + (show > 1 ? t->frame : 0);
29702971

29712972
frame = &SpriteFrames[spriteIndex];
2972-
DAngle angle = DAngle::fromDeg(270. + 22.5) - t->InterpolatedAngles(r_viewpoint.TicFrac).Yaw;
2973+
DAngle angle = DAngle::fromDeg(270.) - t->InterpolatedAngles(r_viewpoint.TicFrac).Yaw - t->SpriteRotation;
29732974
if (frame->Texture[0] != frame->Texture[1]) angle += DAngle::fromDeg(180. / 16);
29742975
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
29752976
{

src/common/engine/namedef.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ xx(__decorate_internal_float__)
8080
// Per-actor sound channels (for deprecated PlaySoundEx function) Do not separate this block!!!
8181
xx(Auto)
8282
xx(Weapon)
83-
xx(BobPivot3D)
8483
xx(Voice)
8584
xx(Item)
8685
xx(Body)

src/common/engine/palettecontainer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
**
3333
*/
3434

35+
#include <cmath>
3536
#include "palutil.h"
3637
#include "sc_man.h"
3738
#include "m_crc32.h"

src/common/filesystem/source/files_decompress.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,11 +980,12 @@ bool OpenDecompressor(FileReader& self, FileReader &parent, FileReader::Size len
980980
}
981981
dec->Length = length;
982982
}
983-
if ((flags & DCF_CACHED))
983+
if ((flags & (DCF_CACHED| DCF_SEEKABLE))) // the buffering reader does not seem to be stable, so cache it instead until we find out what's wrong.
984984
{
985985
// read everything into a MemoryArrayReader.
986986
FileData data(nullptr, length);
987987
fr->Read(data.writable(), length);
988+
delete fr;
988989
fr = new MemoryArrayReader(data);
989990
}
990991
else if ((flags & DCF_SEEKABLE))

src/common/filesystem/source/filesystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, LumpFilterInf
395395
std::string path = filename;
396396
path += ':';
397397
path += resfile->getName(i);
398-
auto embedded = resfile->GetEntryReader(i, READER_NEW, READERFLAG_SEEKABLE);
398+
auto embedded = resfile->GetEntryReader(i, READER_CACHED);
399399
AddFile(path.c_str(), &embedded, filter, Printf, hashfile);
400400
}
401401
}

0 commit comments

Comments
 (0)