From 12ce76426e7902238f85b3bd4318a77cd7889f04 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 26 Oct 2016 12:13:57 +0200 Subject: [PATCH 1/3] Revert "Allows loading directories as IWADs using "-iwad" command line parameter." This reverts commit 81449728d7a6217460e9e451eca20232e86a3316. Reverted because it compromises the IWAD file lookup and fixing it properly is not so trivial. The skipping of adding the file name extension was not only broken, but even after fixing the code does not work if the IWADs are located outside the working directory. --- src/d_iwad.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 6fa8604a0c..1fc63e03d3 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -292,7 +292,6 @@ void FIWadManager::ParseIWadInfos(const char *fn) int FIWadManager::ScanIWAD (const char *iwad) { FResourceFile *iwadfile = FResourceFile::OpenResourceFile(iwad, NULL, true); - if (iwadfile == NULL) iwadfile = FResourceFile::OpenDirectory(iwad, true); //mxd. A directory can also work as an IWAD if (iwadfile != NULL) { @@ -345,7 +344,7 @@ int FIWadManager::CheckIWAD (const char *doomwaddir, WadStuff *wads) iwad.Format ("%s%s%s", doomwaddir, slash, mIWadNames[i].GetChars()); FixPathSeperator (iwad); - if (DirEntryExists(iwad)) + if (FileExists (iwad)) { wads[i].Type = ScanIWAD (iwad); if (wads[i].Type != -1) @@ -414,7 +413,7 @@ int FIWadManager::IdentifyVersion (TArray &wadfiles, const char *iwad, } else { - if(FileExists(custwad)) DefaultExtension (custwad, ".wad"); //mxd. Don't treat folders as .wads + DefaultExtension (custwad, ".wad"); iwadparm = custwad; mIWadNames[0] = custwad; CheckIWAD ("", &wads[0]); From 327d4d85a748d1d149741a5ef4df7838dfdf88f1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 26 Oct 2016 15:02:20 +0200 Subject: [PATCH 2/3] - fixed: UseOffsets can only be handled after the patch is has been set up. --- src/textures/multipatchtexture.cpp | 14 ++++++++------ src/textures/texture.cpp | 2 -- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/textures/multipatchtexture.cpp b/src/textures/multipatchtexture.cpp index 860c59b3a9..88d8815a6f 100644 --- a/src/textures/multipatchtexture.cpp +++ b/src/textures/multipatchtexture.cpp @@ -192,6 +192,7 @@ protected: int UseType = TEX_Null; bool Silent = false; bool HasLine = false; + bool UseOffsets = false; FScriptPosition sc; }; @@ -1139,11 +1140,7 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part, TexInit &init) } else if (sc.Compare("useoffsets")) { - if (part.Texture != NULL) - { - part.OriginX -= part.Texture->LeftOffset; - part.OriginY -= part.Texture->TopOffset; - } + init.UseOffsets = true; } } } @@ -1341,7 +1338,7 @@ void FMultiPatchTexture::ResolvePatches() else { // If it could be resolved, just print a developer warning. - DPrintf(DMSG_WARNING, "Resolved self-referencing texture by picking an older entry for %s", Inits[i].TexName.GetChars()); + DPrintf(DMSG_WARNING, "Resolved self-referencing texture by picking an older entry for %s\n", Inits[i].TexName.GetChars()); } } @@ -1358,6 +1355,11 @@ void FMultiPatchTexture::ResolvePatches() Parts[i].Texture = TexMan[texno]; bComplex |= Parts[i].Texture->bComplex; Parts[i].Texture->bKeepAround = true; + if (Inits[i].UseOffsets) + { + Parts[i].OriginX -= Parts[i].Texture->LeftOffset; + Parts[i].OriginY -= Parts[i].Texture->TopOffset; + } } } for (int i = 0; i < NumParts; i++) diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index bc0eaffa35..760437db99 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -615,8 +615,6 @@ namespace PalEntry FTexture::GetSkyCapColor(bool bottom) { PalEntry col; - int w; - int h; if (!bSWSkyColorDone) { From 4c420938c9518e34c38a79e1c533a91d6b581651 Mon Sep 17 00:00:00 2001 From: "Jason A. Yundt" Date: Wed, 12 Oct 2016 15:17:20 -0400 Subject: [PATCH 3/3] - Added install rules so that 'make install' works. --- CMakeLists.txt | 20 ++++++++++++++++++++ src/CMakeLists.txt | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 541347f149..607eb00549 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,15 @@ function( add_pk3 PK3_NAME PK3_DIR ) SOURCES ${PK3_SRCS}) # Phase 3: Assign source files to a nice folder structure in the IDE assort_pk3_source_folder("Source Files" ${PK3_DIR}) + # Phase 4: Add the resulting PK3 to the install target. + if( WIN32 ) + set( INSTALL_PK3_PATH . CACHE STRING "Directory where zdoom.pk3 will be placed during install." ) + else() + set( INSTALL_PK3_PATH share/games/doom CACHE STRING "Directory where zdoom.pk3 will be placed during install." ) + endif() + install(FILES "${PROJECT_BINARY_DIR}/${PK3_NAME}" + DESTINATION ${INSTALL_PK3_PATH} + COMPONENT "Game resources") endfunction() # Macro for building libraries without debugging information @@ -252,6 +261,7 @@ if( ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB ) message( STATUS "Using system zlib, includes found at ${ZLIB_INCLUDE_DIR}" ) else() message( STATUS "Using internal zlib" ) + set( SKIP_INSTALL_ALL TRUE ) # Avoid installing zlib alongside zdoom add_subdirectory( zlib ) set( ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib ) set( ZLIB_LIBRARIES z ) @@ -295,6 +305,16 @@ if( NOT CMAKE_CROSSCOMPILING ) endif() endif() +# Install the entire docs directory in the distributed zip package +if( WIN32 ) + set( INSTALL_DOCS_PATH docs CACHE STRING "Directory where the documentation will be placed during install." ) +else() + set( INSTALL_DOCS_PATH share/doc/${ZDOOM_EXE_NAME} CACHE STRING "Directory where the zdoom documentation will be placed during install." ) +endif() +install(DIRECTORY docs/ + DESTINATION ${INSTALL_DOCS_PATH} + COMPONENT "Documentation") + add_subdirectory( lzma ) add_subdirectory( tools ) add_subdirectory( dumb ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ebfac30504..09e2201434 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1419,6 +1419,15 @@ if( APPLE ) endif() endif() +if( WIN32 ) + set( INSTALL_PATH . CACHE STRING "Directory where the zdoom executable will be placed during install." ) +else() + set( INSTALL_PATH bin CACHE STRING "Directory where the zdoom executable will be placed during install." ) +endif() +install(TARGETS zdoom + DESTINATION ${INSTALL_PATH} + COMPONENT "Game executable") + source_group("Assembly Files\\ia32" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/asm_ia32/.+") source_group("Assembly Files\\x86_64" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/asm_x86_64/.+") source_group("Audio Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/.+")