ports/games/yadex/files/patch-src_pic2img.cc
Alexey Dokuchaev 7bcec47ef1 Improve the port and catch it up with modern reality a bit:
- Fix a runtime crash (segfault) due to `MasterDirectory dirbuf' if-block
  local variable being used after it went out of scope by making it local
  to the LoadPicture() function instead

- Add the HEXEN option which brings better Hexen support to Yadex (duh).
  Unfortunately, it depends on the SEARCH patch and conflicts with the
  LAPTOP_KEYS patch (which is the reason why I didn't introduce it years
  ago: we did not have IMPLIES/PREVENTS back then, but we do now)

- Building with 3D Render option requires USE_CXXSTD=c++98 due to infamous
  "in-class initializer for static data member of type 'const double'
  requires 'constexpr' specifier" error in `src/r_render.cc'.  Actually,
  we could get away with c++03, but GCC 4.2, which is still used on e.g.
  powerpc and sparc64, does not support it.  Enable it unconditionally so
  the port is always built against the same C++ standard regardless of the
  selected options

- Reword option descriptions to avoid using verbs, per our conventions
2018-09-05 18:28:46 +00:00

18 lines
552 B
C++

--- src/pic2img.cc.orig 2003-03-28 12:37:32 UTC
+++ src/pic2img.cc
@@ -72,6 +72,7 @@ int LoadPicture (
int *pic_width, // To return the size of the picture
int *pic_height) // (can be NULL)
{
+MasterDirectory dirbuf;
MDirPtr dir;
i16 pic_width_;
i16 pic_height_;
@@ -95,7 +96,6 @@ u8 *buf; /* This variable is set to point to the
// Locate the lump where the picture is
if (picloc.wad != 0)
{
- MasterDirectory dirbuf;
dirbuf.wadfile = picloc.wad;
dirbuf.dir.start = picloc.ofs;
dirbuf.dir.size = picloc.len;