Conflicts:
	src/version.h
This commit is contained in:
Christoph Oelckers 2015-04-03 09:45:04 +02:00
commit f0886ce1f1
21 changed files with 223 additions and 47 deletions

View file

@ -778,6 +778,7 @@ set( NOT_COMPILED_SOURCE_FILES
g_hexen/a_fighterquietus.cpp g_hexen/a_fighterquietus.cpp
g_hexen/a_firedemon.cpp g_hexen/a_firedemon.cpp
g_hexen/a_flechette.cpp g_hexen/a_flechette.cpp
g_hexen/a_flies.cpp
g_hexen/a_fog.cpp g_hexen/a_fog.cpp
g_hexen/a_healingradius.cpp g_hexen/a_healingradius.cpp
g_hexen/a_heresiarch.cpp g_hexen/a_heresiarch.cpp

View file

@ -1035,7 +1035,7 @@ public:
virtual bool UpdateWaterLevel (fixed_t oldz, bool splash=true); virtual bool UpdateWaterLevel (fixed_t oldz, bool splash=true);
bool isFast(); bool isFast();
bool isSlow(); bool isSlow();
void SetIdle(); void SetIdle(bool nofunction=false);
void ClearCounters(); void ClearCounters();
FState *GetRaiseState(); FState *GetRaiseState();
void Revive(); void Revive();

View file

@ -641,6 +641,23 @@ CCMD (error_fatal)
} }
} }
//==========================================================================
//
// CCMD crashout
//
// Debugging routine for testing the crash logger.
// Useless in a win32 debug build, because that doesn't enable the crash logger.
//
//==========================================================================
#if !defined(_WIN32) || !defined(_DEBUG)
CCMD (crashout)
{
*(volatile int *)0 = 0;
}
#endif
CCMD (dir) CCMD (dir)
{ {
FString dir, path; FString dir, path;

View file

@ -47,6 +47,7 @@
#include "v_video.h" #include "v_video.h"
#include "gameconfigfile.h" #include "gameconfigfile.h"
#include "resourcefiles/resourcefile.h" #include "resourcefiles/resourcefile.h"
#include "version.h"
CVAR (Bool, queryiwad, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); CVAR (Bool, queryiwad, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
@ -504,19 +505,19 @@ int FIWadManager::IdentifyVersion (TArray<FString> &wadfiles, const char *iwad,
if (numwads == 0) if (numwads == 0)
{ {
I_FatalError ("Cannot find a game IWAD (doom.wad, doom2.wad, heretic.wad, etc.).\n" I_FatalError ("Cannot find a game IWAD (doom.wad, doom2.wad, heretic.wad, etc.).\n"
"Did you install ZDoom properly? You can do either of the following:\n" "Did you install " GAMENAME " properly? You can do either of the following:\n"
"\n" "\n"
#if defined(_WIN32) #if defined(_WIN32)
"1. Place one or more of these wads in the same directory as ZDoom.\n" "1. Place one or more of these wads in the same directory as " GAMENAME ".\n"
"2. Edit your zdoom-username.ini and add the directories of your iwads\n" "2. Edit your " GAMENAMELOWERCASE "-username.ini and add the directories of your iwads\n"
"to the list beneath [IWADSearch.Directories]"); "to the list beneath [IWADSearch.Directories]");
#elif defined(__APPLE__) #elif defined(__APPLE__)
"1. Place one or more of these wads in ~/Library/Application Support/zdoom/\n" "1. Place one or more of these wads in ~/Library/Application Support/" GAMENAMELOWERCASE "/\n"
"2. Edit your ~/Library/Preferences/zdoom.ini and add the directories\n" "2. Edit your ~/Library/Preferences/" GAMENAMELOWERCASE ".ini and add the directories\n"
"of your iwads to the list beneath [IWADSearch.Directories]"); "of your iwads to the list beneath [IWADSearch.Directories]");
#else #else
"1. Place one or more of these wads in ~/.config/zdoom/.\n" "1. Place one or more of these wads in ~/.config/" GAMENAMELOWERCASE "/.\n"
"2. Edit your ~/.config/zdoom/zdoom.ini and add the directories of your\n" "2. Edit your ~/.config/" GAMENAMELOWERCASE "/" GAMENAMELOWERCASE ".ini and add the directories of your\n"
"iwads to the list beneath [IWADSearch.Directories]"); "iwads to the list beneath [IWADSearch.Directories]");
#endif #endif
} }

106
src/g_hexen/a_flies.cpp Normal file
View file

@ -0,0 +1,106 @@
static FRandom pr_fly("GetOffMeFly");
//===========================================================================
//
// FindCorpse
//
// Finds a corpse to buzz around. We can't use a blockmap check because
// corpses generally aren't linked into the blockmap.
//
//===========================================================================
static AActor *FindCorpse(AActor *fly, sector_t *sec, int recurselimit)
{
AActor *fallback = NULL;
sec->validcount = validcount;
// Search the current sector
for (AActor *check = sec->thinglist; check != NULL; check = check->snext)
{
if (check == fly)
continue;
if (!(check->flags & MF_CORPSE))
continue;
if (!P_CheckSight(fly, check))
continue;
fallback = check;
if (pr_fly(2)) // 50% chance to try to pick a different corpse
continue;
return check;
}
if (--recurselimit <= 0 || (fallback != NULL && pr_fly(2)))
{
return fallback;
}
// Try neighboring sectors
for (int i = 0; i < sec->linecount; ++i)
{
line_t *line = sec->lines[i];
sector_t *sec2 = (line->frontsector == sec) ? line->backsector : line->frontsector;
if (sec2 != NULL && sec2->validcount != validcount)
{
AActor *neighbor = FindCorpse(fly, sec2, recurselimit);
if (neighbor != NULL)
{
return neighbor;
}
}
}
return fallback;
}
DEFINE_ACTION_FUNCTION(AActor, A_FlySearch)
{
// The version from the retail beta is not so great for general use:
// 1. Pick one of the first fifty thinkers at random.
// 2. Starting from that thinker, find one that is an actor, not itself,
// and within sight. Give up after 100 sequential thinkers.
// It's effectively useless if there are more than 150 thinkers on a map.
//
// So search the sectors instead. We can't potentially find something all
// the way on the other side of the map and we can't find invisible corpses,
// but at least we aren't crippled on maps with lots of stuff going on.
validcount++;
AActor *other = FindCorpse(self, self->Sector, 5);
if (other != NULL)
{
self->target = other;
self->SetState(self->FindState("Buzz"));
}
}
DEFINE_ACTION_FUNCTION(AActor, A_FlyBuzz)
{
AActor *targ = self->target;
if (targ == NULL || !(targ->flags & MF_CORPSE) || pr_fly() < 5)
{
self->SetIdle();
return;
}
angle_t ang = R_PointToAngle2(self->x, self->y, targ->x, targ->y);
self->angle = ang;
self->args[0]++;
ang >>= ANGLETOFINESHIFT;
if (!P_TryMove(self, self->x + 6 * finecosine[ang], self->y + 6 * finesine[ang], true))
{
self->SetIdle(true);
return;
}
if (self->args[0] & 2)
{
self->velx += (pr_fly() - 128) << BOBTOFINESHIFT;
self->vely += (pr_fly() - 128) << BOBTOFINESHIFT;
}
int zrand = pr_fly();
if (targ->z + 5*FRACUNIT < self->z && zrand > 150)
{
zrand = -zrand;
}
self->velz = zrand << BOBTOFINESHIFT;
if (pr_fly() < 40)
{
S_Sound(self, CHAN_VOICE, self->ActiveSound, 0.5f, ATTN_STATIC);
}
}

View file

@ -38,6 +38,7 @@
#include "a_fighterquietus.cpp" #include "a_fighterquietus.cpp"
#include "a_firedemon.cpp" #include "a_firedemon.cpp"
#include "a_flechette.cpp" #include "a_flechette.cpp"
#include "a_flies.cpp"
#include "a_fog.cpp" #include "a_fog.cpp"
#include "a_healingradius.cpp" #include "a_healingradius.cpp"
#include "a_heresiarch.cpp" #include "a_heresiarch.cpp"

View file

@ -204,7 +204,7 @@ FString M_GetConfigPath(bool for_reading)
{ {
path += "/" GAME_DIR; path += "/" GAME_DIR;
CreatePath(path); CreatePath(path);
path += "/zdoom.ini"; path += "/" GAMENAMELOWERCASE ".ini";
} }
else else
{ // construct "$PROGDIR/zdoom-$USER.ini" { // construct "$PROGDIR/zdoom-$USER.ini"
@ -224,11 +224,11 @@ FString M_GetConfigPath(bool for_reading)
*probe = '_'; *probe = '_';
++probe; ++probe;
} }
path << "zdoom-" << uname << ".ini"; path << GAMENAMELOWERCASE "-" << uname << ".ini";
} }
else else
{ // Couldn't get user name, so just use zdoom.ini { // Couldn't get user name, so just use zdoom.ini
path += "zdoom.ini"; path += GAMENAMELOWERCASE ".ini";
} }
} }
@ -239,7 +239,7 @@ FString M_GetConfigPath(bool for_reading)
if (!FileExists(path)) if (!FileExists(path))
{ {
path = progdir; path = progdir;
path << "zdoom.ini"; path << GAMENAMELOWERCASE ".ini";
} }
} }
@ -411,11 +411,11 @@ FString M_GetConfigPath(bool for_reading)
noErr == FSRefMakePath(&folder, (UInt8*)cpath, PATH_MAX)) noErr == FSRefMakePath(&folder, (UInt8*)cpath, PATH_MAX))
{ {
FString path; FString path;
path << cpath << "/zdoom.ini"; path << cpath << "/" GAMENAMELOWERCASE ".ini";
return path; return path;
} }
// Ungh. // Ungh.
return "zdoom.ini"; return GAMENAMELOWERCASE ".ini";
} }
//=========================================================================== //===========================================================================
@ -497,12 +497,12 @@ FString GetUserFile (const char *file)
// This can be removed after a release or two // This can be removed after a release or two
// Transfer the old zdoom directory to the new location // Transfer the old zdoom directory to the new location
bool moved = false; bool moved = false;
FString oldpath = NicePath("~/.zdoom/"); FString oldpath = NicePath("~/." GAMENAMELOWERCASE "/");
if (stat (oldpath, &extrainfo) != -1) if (stat (oldpath, &extrainfo) != -1)
{ {
if (rename(oldpath, path) == -1) if (rename(oldpath, path) == -1)
{ {
I_Error ("Failed to move old zdoom directory (%s) to new location (%s).", I_Error ("Failed to move old " GAMENAMELOWERCASE " directory (%s) to new location (%s).",
oldpath.GetChars(), path.GetChars()); oldpath.GetChars(), path.GetChars());
} }
else else
@ -598,7 +598,7 @@ FString M_GetCajunPath(const char *botfilename)
FString M_GetConfigPath(bool for_reading) FString M_GetConfigPath(bool for_reading)
{ {
return GetUserFile("zdoom.ini"); return GetUserFile(GAMENAMELOWERCASE ".ini");
} }
//=========================================================================== //===========================================================================

View file

@ -1033,6 +1033,8 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
{ {
target->velx = target->vely = target->velz = 0; target->velx = target->vely = target->velz = 0;
} }
player = target->player;
if (!(flags & DMG_FORCED)) // DMG_FORCED skips all special damage checks, TELEFRAG_DAMAGE may not be reduced at all if (!(flags & DMG_FORCED)) // DMG_FORCED skips all special damage checks, TELEFRAG_DAMAGE may not be reduced at all
{ {
if (target->flags2 & MF2_DORMANT) if (target->flags2 & MF2_DORMANT)
@ -1043,7 +1045,6 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
if (damage < TELEFRAG_DAMAGE) // TELEFRAG_DAMAGE may not be reduced at all or it may not guarantee its effect. if (damage < TELEFRAG_DAMAGE) // TELEFRAG_DAMAGE may not be reduced at all or it may not guarantee its effect.
{ {
player = target->player;
if (player && damage > 1) if (player && damage > 1)
{ {
// Take half damage in trainer mode // Take half damage in trainer mode
@ -1119,12 +1120,12 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
return -1; return -1;
} }
} }
}
if (target->flags5 & MF5_NODAMAGE) if (target->flags5 & MF5_NODAMAGE)
{ {
damage = 0; damage = 0;
} }
} }
}
if (damage < 0) if (damage < 0)
{ {
// any negative value means that something in the above chain has cancelled out all damage and all damage effects, including pain. // any negative value means that something in the above chain has cancelled out all damage and all damage effects, including pain.
@ -1331,7 +1332,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
// but telefragging should still do enough damage to kill the player) // but telefragging should still do enough damage to kill the player)
// Ignore players that are already dead. // Ignore players that are already dead.
// [MC]Buddha2 absorbs telefrag damage, and anything else thrown their way. // [MC]Buddha2 absorbs telefrag damage, and anything else thrown their way.
if (((player->cheats & CF_BUDDHA2) || (((player->cheats & CF_BUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && (damage < TELEFRAG_DAMAGE))) && (player->playerstate != PST_DEAD)) if (!(flags & DMG_FORCED) && (((player->cheats & CF_BUDDHA2) || (((player->cheats & CF_BUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && (damage < TELEFRAG_DAMAGE))) && (player->playerstate != PST_DEAD)))
{ {
// If this is a voodoo doll we need to handle the real player as well. // If this is a voodoo doll we need to handle the real player as well.
player->mo->health = target->health = player->health = 1; player->mo->health = target->health = player->health = 1;
@ -1396,7 +1397,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
if (target->health <= 0) if (target->health <= 0)
{ {
//[MC]Buddha flag for monsters. //[MC]Buddha flag for monsters.
if ((target->flags7 & MF7_BUDDHA) && (damage < TELEFRAG_DAMAGE) && ((inflictor == NULL || !(inflictor->flags7 & MF7_FOILBUDDHA)) && !(flags & DMG_FOILBUDDHA))) if (!(flags & DMG_FORCED) && ((target->flags7 & MF7_BUDDHA) && (damage < TELEFRAG_DAMAGE) && ((inflictor == NULL || !(inflictor->flags7 & MF7_FOILBUDDHA)) && !(flags & DMG_FOILBUDDHA))))
{ //FOILBUDDHA or Telefrag damage must kill it. { //FOILBUDDHA or Telefrag damage must kill it.
target->health = 1; target->health = 1;
} }

View file

@ -1034,7 +1034,7 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm)
// Both things overlap in x or y direction // Both things overlap in x or y direction
bool unblocking = false; bool unblocking = false;
if (tm.FromPMove) if (tm.FromPMove || tm.thing->player != NULL)
{ {
// Both actors already overlap. To prevent them from remaining stuck allow the move if it // Both actors already overlap. To prevent them from remaining stuck allow the move if it
// takes them further apart or the move does not change the position (when called from P_ChangeSector.) // takes them further apart or the move does not change the position (when called from P_ChangeSector.)

View file

@ -6236,11 +6236,11 @@ void AActor::Crash()
} }
} }
void AActor::SetIdle() void AActor::SetIdle(bool nofunction)
{ {
FState *idle = FindState (NAME_Idle); FState *idle = FindState (NAME_Idle);
if (idle == NULL) idle = SpawnState; if (idle == NULL) idle = SpawnState;
SetState(idle); SetState(idle, nofunction);
} }
int AActor::SpawnHealth() int AActor::SpawnHealth()

View file

@ -37,7 +37,7 @@ static struct {
pid_t pid; pid_t pid;
int has_siginfo; int has_siginfo;
siginfo_t siginfo; siginfo_t siginfo;
char buf[1024]; char buf[4096];
} crash_info; } crash_info;

View file

@ -240,7 +240,7 @@ int main (int argc, char **argv)
#if !defined (__APPLE__) #if !defined (__APPLE__)
{ {
int s[4] = { SIGSEGV, SIGILL, SIGFPE, SIGBUS }; int s[4] = { SIGSEGV, SIGILL, SIGFPE, SIGBUS };
cc_install_handlers(argc, argv, 4, s, "zdoom-crash.log", DoomSpecificInfo); cc_install_handlers(argc, argv, 4, s, GAMENAMELOWERCASE "-crash.log", DoomSpecificInfo);
} }
#endif // !__APPLE__ #endif // !__APPLE__

View file

@ -90,13 +90,14 @@ const char *GetVersionString();
// More stuff that needs to be different for derivatives. // More stuff that needs to be different for derivatives.
#define GAMENAME "GZDoom" #define GAMENAME "GZDoom"
#define GAMENAMELOWERCASE "gzdoom"
#define FORUM_URL "http://forum.drdteam.org" #define FORUM_URL "http://forum.drdteam.org"
#define BUGS_FORUM_URL "http://forum.drdteam.org/viewforum.php?f=24" #define BUGS_FORUM_URL "http://forum.drdteam.org/viewforum.php?f=24"
#if defined(__APPLE__) || defined(_WIN32) #if defined(__APPLE__) || defined(_WIN32)
#define GAME_DIR GAMENAME #define GAME_DIR GAMENAME
#else #else
#define GAME_DIR ".config/gzdoom" #define GAME_DIR ".config/" GAMENAMELOWERCASE
#endif #endif

View file

@ -1288,20 +1288,3 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE nothing, LPSTR cmdline, int n
MainThread = INVALID_HANDLE_VALUE; MainThread = INVALID_HANDLE_VALUE;
return 0; return 0;
} }
//==========================================================================
//
// CCMD crashout
//
// Debugging routine for testing the crash logger.
// Useless in a debug build, because that doesn't enable the crash logger.
//
//==========================================================================
#ifndef _DEBUG
#include "c_dispatch.h"
CCMD (crashout)
{
*(int *)0 = 0;
}
#endif

View file

@ -0,0 +1,28 @@
// Buzzy fly ----------------------------------------------------------------
ACTOR LittleFly 112
{
Game Hexen
+NOBLOCKMAP +NOGRAVITY
+CANPASS
Speed 6
Radius 5
Height 5
Mass 2
ActiveSound "FlyBuzz"
action native A_FlySearch();
action native A_FlyBuzz();
States
{
Spawn:
TNT1 A 20 A_FlySearch // [RH] Invisible when not flying
Loop
Buzz:
AFLY ABCD 3 A_FlyBuzz
Loop
}
}

View file

@ -93,6 +93,7 @@
#include "actors/hexen/mageplayer.txt" #include "actors/hexen/mageplayer.txt"
#include "actors/hexen/pig.txt" #include "actors/hexen/pig.txt"
#include "actors/hexen/flame.txt" #include "actors/hexen/flame.txt"
#include "actors/hexen/flies.txt"
#include "actors/hexen/hexenarmor.txt" #include "actors/hexen/hexenarmor.txt"
#include "actors/hexen/hexendecorations.txt" #include "actors/hexen/hexendecorations.txt"
#include "actors/hexen/hexenkeys.txt" #include "actors/hexen/hexenkeys.txt"

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

View file

@ -5228,6 +5228,42 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath=".\src\g_hexen\a_flies.cpp"
>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File <File
RelativePath=".\src\g_hexen\a_fog.cpp" RelativePath=".\src\g_hexen\a_fog.cpp"
> >