This commit is contained in:
Christoph Oelckers 2016-10-29 16:08:46 +02:00
commit 7f2350cf64
10 changed files with 84 additions and 20 deletions

View file

@ -94,6 +94,15 @@ function( add_pk3 PK3_NAME PK3_DIR )
SOURCES ${PK3_SRCS}) SOURCES ${PK3_SRCS})
# Phase 3: Assign source files to a nice folder structure in the IDE # Phase 3: Assign source files to a nice folder structure in the IDE
assort_pk3_source_folder("Source Files" ${PK3_DIR}) 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() endfunction()
# Macro for building libraries without debugging information # 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}" ) message( STATUS "Using system zlib, includes found at ${ZLIB_INCLUDE_DIR}" )
else() else()
message( STATUS "Using internal zlib" ) message( STATUS "Using internal zlib" )
set( SKIP_INSTALL_ALL TRUE ) # Avoid installing zlib alongside zdoom
add_subdirectory( zlib ) add_subdirectory( zlib )
set( ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib ) set( ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib )
set( ZLIB_LIBRARIES z ) set( ZLIB_LIBRARIES z )
@ -295,6 +305,16 @@ if( NOT CMAKE_CROSSCOMPILING )
endif() endif()
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( lzma )
add_subdirectory( tools ) add_subdirectory( tools )
add_subdirectory( dumb ) add_subdirectory( dumb )

View file

@ -1564,6 +1564,15 @@ if( APPLE )
endif() endif()
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\\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("Assembly Files\\x86_64" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/asm_x86_64/.+")
source_group("Audio Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/.+") source_group("Audio Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/.+")

View file

@ -1655,9 +1655,10 @@ static void G_QueueBody (AActor *body)
// //
// G_DoReborn // G_DoReborn
// //
EXTERN_CVAR(Bool, sv_singleplayerrespawn)
void G_DoReborn (int playernum, bool freshbot) void G_DoReborn (int playernum, bool freshbot)
{ {
if (!multiplayer && !(level.flags2 & LEVEL2_ALLOWRESPAWN)) if (!multiplayer && !(level.flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn)
{ {
if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars())) if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars()))
{ // Load game from the last point it was saved { // Load game from the last point it was saved

View file

@ -526,6 +526,8 @@ static bool unloading;
// //
//========================================================================== //==========================================================================
EXTERN_CVAR(Bool, sv_singleplayerrespawn)
void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill) void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill)
{ {
level_info_t *nextinfo = NULL; level_info_t *nextinfo = NULL;
@ -634,7 +636,7 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill
// If this is co-op, respawn any dead players now so they can // If this is co-op, respawn any dead players now so they can
// keep their inventory on the next map. // keep their inventory on the next map.
if ((multiplayer || level.flags2 & LEVEL2_ALLOWRESPAWN) && !deathmatch && player->playerstate == PST_DEAD) if ((multiplayer || level.flags2 & LEVEL2_ALLOWRESPAWN || sv_singleplayerrespawn) && !deathmatch && player->playerstate == PST_DEAD)
{ {
// Copied from the end of P_DeathThink [[ // Copied from the end of P_DeathThink [[
player->cls = NULL; // Force a new class if the player is using a random class player->cls = NULL; // Force a new class if the player is using a random class

View file

@ -1,4 +1,4 @@
// Emacs style mode select -*- C++ -*- // Emacs style mode select -*- C++ -*-
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Id:$ // $Id:$
@ -4495,6 +4495,7 @@ void AActor::AdjustFloorClip ()
// Most of the player structure stays unchanged between levels. // Most of the player structure stays unchanged between levels.
// //
EXTERN_CVAR (Bool, chasedemo) EXTERN_CVAR (Bool, chasedemo)
EXTERN_CVAR(Bool, sv_singleplayerrespawn)
extern bool demonew; extern bool demonew;
@ -4682,7 +4683,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
{ // Give all cards in death match mode. { // Give all cards in death match mode.
p->mo->GiveDeathmatchInventory (); p->mo->GiveDeathmatchInventory ();
} }
else if ((multiplayer || (level.flags2 & LEVEL2_ALLOWRESPAWN)) && state == PST_REBORN && oldactor != NULL) else if ((multiplayer || (level.flags2 & LEVEL2_ALLOWRESPAWN) || sv_singleplayerrespawn) && state == PST_REBORN && oldactor != NULL)
{ // Special inventory handling for respawning in coop { // Special inventory handling for respawning in coop
p->mo->FilterCoopRespawnInventory (oldactor); p->mo->FilterCoopRespawnInventory (oldactor);
} }

View file

@ -65,6 +65,9 @@ static FRandom pr_skullpop ("SkullPop");
// [RH] # of ticks to complete a turn180 // [RH] # of ticks to complete a turn180
#define TURN180_TICKS ((TICRATE / 4) + 1) #define TURN180_TICKS ((TICRATE / 4) + 1)
// [SP] Allows respawn in single player
CVAR(Bool, sv_singleplayerrespawn, false, CVAR_SERVERINFO | CVAR_LATCH)
// Variables for prediction // Variables for prediction
CVAR (Bool, cl_noprediction, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, cl_noprediction, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR(Bool, cl_predict_specials, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, cl_predict_specials, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
@ -2211,7 +2214,9 @@ void P_DeathThink (player_t *player)
if (level.time >= player->respawn_time || ((player->cmd.ucmd.buttons & BT_USE) && player->Bot == NULL)) if (level.time >= player->respawn_time || ((player->cmd.ucmd.buttons & BT_USE) && player->Bot == NULL))
{ {
player->cls = NULL; // Force a new class if the player is using a random class player->cls = NULL; // Force a new class if the player is using a random class
player->playerstate = (multiplayer || (level.flags2 & LEVEL2_ALLOWRESPAWN)) ? PST_REBORN : PST_ENTER; player->playerstate =
(multiplayer || (level.flags2 & LEVEL2_ALLOWRESPAWN) || sv_singleplayerrespawn)
? PST_REBORN : PST_ENTER;
if (player->mo->special1 > 2) if (player->mo->special1 > 2)
{ {
player->mo->special1 = 0; player->mo->special1 = 0;

View file

@ -192,6 +192,7 @@ protected:
int UseType = TEX_Null; int UseType = TEX_Null;
bool Silent = false; bool Silent = false;
bool HasLine = false; bool HasLine = false;
bool UseOffsets = false;
FScriptPosition sc; FScriptPosition sc;
}; };
@ -297,8 +298,6 @@ FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchl
Printf ("Texture %s is left without any patches\n", Name.GetChars()); Printf ("Texture %s is left without any patches\n", Name.GetChars());
} }
CheckForHacks ();
DefinitionLump = deflumpnum; DefinitionLump = deflumpnum;
} }
@ -1142,11 +1141,7 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part, TexInit &init)
} }
else if (sc.Compare("useoffsets")) else if (sc.Compare("useoffsets"))
{ {
if (part.Texture != NULL) init.UseOffsets = true;
{
part.OriginX -= part.Texture->LeftOffset;
part.OriginY -= part.Texture->TopOffset;
}
} }
} }
} }
@ -1324,6 +1319,29 @@ void FMultiPatchTexture::ResolvePatches()
for (int i = 0; i < NumParts; i++) for (int i = 0; i < NumParts; i++)
{ {
FTextureID texno = TexMan.CheckForTexture(Inits[i].TexName, Inits[i].UseType); FTextureID texno = TexMan.CheckForTexture(Inits[i].TexName, Inits[i].UseType);
if (texno == id) // we found ourselves. Try looking for another one with the same name which is not a multipatch texture itself.
{
TArray<FTextureID> list;
TexMan.ListTextures(Inits[i].TexName, list, true);
for (int i = list.Size() - 1; i >= 0; i--)
{
if (list[i] != id && !TexMan[list[i]]->bMultiPatch)
{
texno = list[i];
break;
}
}
if (texno == id)
{
if (Inits[i].HasLine) Inits[i].sc.Message(MSG_WARNING, "Texture '%s' references itself as patch\n", Inits[i].TexName.GetChars());
else Printf(TEXTCOLOR_YELLOW "Texture '%s' references itself as patch\n", Inits[i].TexName.GetChars());
}
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\n", Inits[i].TexName.GetChars());
}
}
if (!texno.isValid()) if (!texno.isValid())
{ {
@ -1338,6 +1356,11 @@ void FMultiPatchTexture::ResolvePatches()
Parts[i].Texture = TexMan[texno]; Parts[i].Texture = TexMan[texno];
bComplex |= Parts[i].Texture->bComplex; bComplex |= Parts[i].Texture->bComplex;
Parts[i].Texture->bKeepAround = true; 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++) for (int i = 0; i < NumParts; i++)
@ -1353,6 +1376,8 @@ void FMultiPatchTexture::ResolvePatches()
delete[] Inits; delete[] Inits;
Inits = nullptr; Inits = nullptr;
CheckForHacks();
// If this texture is just a wrapper around a single patch, we can simply // If this texture is just a wrapper around a single patch, we can simply
// forward GetPixels() and GetColumn() calls to that patch. // forward GetPixels() and GetColumn() calls to that patch.

View file

@ -615,8 +615,6 @@ namespace
PalEntry FTexture::GetSkyCapColor(bool bottom) PalEntry FTexture::GetSkyCapColor(bool bottom)
{ {
PalEntry col; PalEntry col;
int w;
int h;
if (!bSWSkyColorDone) if (!bSWSkyColorDone)
{ {

View file

@ -267,7 +267,7 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF
// //
//========================================================================== //==========================================================================
int FTextureManager::ListTextures (const char *name, TArray<FTextureID> &list) int FTextureManager::ListTextures (const char *name, TArray<FTextureID> &list, bool listall)
{ {
int i; int i;
@ -293,11 +293,14 @@ int FTextureManager::ListTextures (const char *name, TArray<FTextureID> &list)
// NULL textures must be ignored. // NULL textures must be ignored.
if (tex->UseType!=FTexture::TEX_Null) if (tex->UseType!=FTexture::TEX_Null)
{ {
unsigned int j; unsigned int j = list.Size();
for(j = 0; j < list.Size(); j++) if (!listall)
{ {
// Check for overriding definitions from newer WADs for (j = 0; j < list.Size(); j++)
if (Textures[list[j].GetIndex()].Texture->UseType == tex->UseType) break; {
// Check for overriding definitions from newer WADs
if (Textures[list[j].GetIndex()].Texture->UseType == tex->UseType) break;
}
} }
if (j==list.Size()) list.Push(FTextureID(i)); if (j==list.Size()) list.Push(FTextureID(i));
} }

View file

@ -412,7 +412,7 @@ public:
FTextureID CheckForTexture (const char *name, int usetype, BITFIELD flags=TEXMAN_TryAny); FTextureID CheckForTexture (const char *name, int usetype, BITFIELD flags=TEXMAN_TryAny);
FTextureID GetTexture (const char *name, int usetype, BITFIELD flags=0); FTextureID GetTexture (const char *name, int usetype, BITFIELD flags=0);
int ListTextures (const char *name, TArray<FTextureID> &list); int ListTextures (const char *name, TArray<FTextureID> &list, bool listall = false);
void AddTexturesLump (const void *lumpdata, int lumpsize, int deflumpnum, int patcheslump, int firstdup=0, bool texture1=false); void AddTexturesLump (const void *lumpdata, int lumpsize, int deflumpnum, int patcheslump, int firstdup=0, bool texture1=false);
void AddTexturesLumps (int lump1, int lump2, int patcheslump); void AddTexturesLumps (int lump1, int lump2, int patcheslump);