Merge branch 'master' into whaven

This commit is contained in:
Christoph Oelckers 2021-05-09 11:24:48 +02:00
commit ccc77cefbb
118 changed files with 1880 additions and 1594 deletions

View file

@ -719,7 +719,11 @@ set( NOT_COMPILED_SOURCE_FILES
zcc-parse.c
zcc-parse.h
common/platform/win32/zutil.natvis
games/blood/src/_polymost.cpp
games/duke/src/_polymost.cpp
games/sw/src/_polymost.cpp
# Blood
games/blood/src/actor.cpp
games/blood/src/ai.cpp

View file

@ -15,11 +15,8 @@
static_assert('\xff' == 255, "Char must be unsigned!");
#if !defined __cplusplus || (__cplusplus < 201103L && !defined _MSC_VER)
# error C++11 or greater is required.
#endif
#include "compat.h"
#include "printf.h"
#include "palette.h"
#include "binaryangle.h"
@ -218,6 +215,7 @@ typedef struct {
// The texel index offset in the y direction of a parallaxed sky:
// XXX: currently always 0.
int yoffs;
int yoffs2;
int lognumtiles; // 1<<lognumtiles: number of tiles in multi-sky
int16_t tileofs[MAXPSKYTILES]; // for 0 <= j < (1<<lognumtiles): tile offset relative to basetile
@ -239,11 +237,11 @@ static inline psky_t *getpskyidx(int32_t picnum)
EXTERN psky_t * tileSetupSky(int32_t tilenum);
psky_t* defineSky(int32_t const tilenum, int horiz, int lognumtiles, const uint16_t* tileofs, int yoff = 0);
psky_t* defineSky(int32_t const tilenum, int horiz, int lognumtiles, const uint16_t* tileofs, int yoff = 0, int yoff2 = 0x7fffffff);
// Get properties of parallaxed sky to draw.
// Returns: pointer to tile offset array. Sets-by-pointer the other three.
const int16_t* getpsky(int32_t picnum, int32_t* dapyscale, int32_t* dapskybits, int32_t* dapyoffs, int32_t* daptileyscale);
const int16_t* getpsky(int32_t picnum, int32_t* dapyscale, int32_t* dapskybits, int32_t* dapyoffs, int32_t* daptileyscale, bool alt = false);
EXTERN char parallaxtype;
@ -733,6 +731,17 @@ inline void setgotpic(int32_t tilenume)
gotpic[tilenume >> 3] |= 1 << (tilenume & 7);
}
inline void cleargotpic(int32_t tilenume)
{
gotpic[tilenume >> 3] &= ~(1 << (tilenume & 7));
}
inline bool testgotpic(int32_t tilenume, bool reset = false)
{
bool res = gotpic[tilenume >> 3] & (1 << (tilenume & 7));
if (reset) gotpic[tilenume >> 3] &= ~(1 << (tilenume & 7));
return res;
}
#include "iterators.h"

View file

@ -14,19 +14,6 @@
////////// Language and compiler feature polyfills //////////
# define EXTERNC
#ifndef UNREFERENCED_PARAMETER
# define UNREFERENCED_PARAMETER(x) (x) = (x)
#endif
#if defined __GNUC__ || defined __clang__
# define ATTRIBUTE(attrlist) __attribute__(attrlist)
#else
# define ATTRIBUTE(attrlist)
#endif
# define fallthrough__ [[fallthrough]]
////////// Architecture detection //////////

View file

@ -1,19 +0,0 @@
// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
// Ken Silverman's official web site: "http://www.advsys.net/ken"
// See the included license file "BUILDLIC.TXT" for license info.
//
// This file has been modified from Ken Silverman's original release
// by Jonathon Fowler (jf@jonof.id.au)
// by the EDuke32 team (development@voidpoint.com)
#ifndef mmulti_h_
#define mmulti_h_
#define MAXMULTIPLAYERS 16
extern int myconnectindex, numplayers;
extern int connecthead, connectpoint2[MAXMULTIPLAYERS];
#endif // mmulti_h_

View file

@ -595,19 +595,20 @@ psky_t * tileSetupSky(int32_t const tilenum)
return &multipskies.Last();
}
psky_t * defineSky(int32_t const tilenum, int horiz, int lognumtiles, const uint16_t *tileofs, int yoff)
psky_t * defineSky(int32_t const tilenum, int horiz, int lognumtiles, const uint16_t *tileofs, int yoff, int yoff2)
{
auto sky = tileSetupSky(tilenum);
sky->horizfrac = horiz;
sky->lognumtiles = lognumtiles;
sky->yoffs = yoff;
sky->yoffs2 = yoff2 == 0x7fffffff ? yoff : yoff2;
memcpy(sky->tileofs, tileofs, 2 << lognumtiles);
return sky;
}
// Get properties of parallaxed sky to draw.
// Returns: pointer to tile offset array. Sets-by-pointer the other three.
const int16_t* getpsky(int32_t picnum, int32_t* dapyscale, int32_t* dapskybits, int32_t* dapyoffs, int32_t* daptileyscale)
const int16_t* getpsky(int32_t picnum, int32_t* dapyscale, int32_t* dapskybits, int32_t* dapyoffs, int32_t* daptileyscale, bool alt)
{
psky_t const* const psky = getpskyidx(picnum);
@ -616,7 +617,7 @@ const int16_t* getpsky(int32_t picnum, int32_t* dapyscale, int32_t* dapskybits,
if (dapyscale)
*dapyscale = (parallaxyscale_override == 0 ? psky->horizfrac : parallaxyscale_override);
if (dapyoffs)
*dapyoffs = psky->yoffs + parallaxyoffs_override;
*dapyoffs = (alt? psky->yoffs2 : psky->yoffs) + parallaxyoffs_override;
if (daptileyscale)
*daptileyscale = psky->yscale;

View file

@ -26,11 +26,10 @@ static int32_t curextra=MAXTILES;
using namespace Polymost;
int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate);
static int32_t addtileP(int32_t model,int32_t tile,int32_t pallet)
static int32_t addtileP(int32_t ,int32_t tile,int32_t pallet)
{
// tile >= 0 && tile < MAXTILES
UNREFERENCED_PARAMETER(model);
if (curextra==MAXTILES+EXTRATILES-1)
{
Printf("warning: max EXTRATILES reached\n");
@ -1108,7 +1107,7 @@ void md3_vox_calcmat_common(tspriteptr_t tspr, const vec3f_t *a0, float f, float
}
static void md3draw_handle_triangles(const md3surf_t *s, uint16_t *indexhandle,
int32_t texunits, const md3model_t *M)
int32_t , const md3model_t *M)
{
int32_t i;
@ -1130,10 +1129,6 @@ static void md3draw_handle_triangles(const md3surf_t *s, uint16_t *indexhandle,
}
}
GLInterface.Draw(DT_Triangles, data.second, s->numtris *3);
#ifndef USE_GLEXT
UNREFERENCED_PARAMETER(texunits);
#endif
}
static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr)

View file

@ -57,7 +57,7 @@ int pm_smoothratio;
// For testing - will be removed later.
CVAR(Int, skytile, 0, 0)
CVAR(Bool, testnewrenderer, true, 0)
CVAR(Bool, testnewrenderer, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
extern fixed_t global100horiz; // (-100..300)-scale horiz (the one passed to drawrooms)
static vec3_t spritesxyz[MAXSPRITESONSCREEN + 1];

View file

@ -239,8 +239,13 @@ void VkRenderBuffers::CreateShadowmap()
ImageBuilder builder;
builder.setSize(gl_shadowmap_quality, 1024);
builder.setFormat(VK_FORMAT_R32_SFLOAT);
builder.setFormat(SceneNormalFormat);
builder.setUsage(VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT);
if (!builder.isFormatSupported(fb->device, VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT))
{
SceneNormalFormat = VK_FORMAT_R8G8B8A8_UNORM;
builder.setFormat(SceneNormalFormat);
}
Shadowmap.Image = builder.create(fb->device);
Shadowmap.Image->SetDebugName("VkRenderBuffers.Shadowmap");

View file

@ -41,7 +41,6 @@
#include "c_dispatch.h"
#include "d_net.h"
#include "gamestate.h"
#include "mmulti.h"
#include "gstrings.h"
#include "gamecontrol.h"
#include "screenjob.h"

View file

@ -63,7 +63,6 @@
#include "vm.h"
#include "gstrings.h"
#include "s_music.h"
#include "mmulti.h"
#include "printf.h"
#include "i_time.h"
#include "d_ticcmd.h"

View file

@ -10,6 +10,9 @@ enum
MAXPLAYERS = 8
};
extern int myconnectindex, numplayers;
extern int connecthead, connectpoint2[MAXPLAYERS];
class FDynamicBuffer
{
public:

View file

@ -887,6 +887,7 @@ void parseMultiPsky(FScanner& sc, FScriptPosition& pos)
if (sky.tilenum != DEFAULTPSKY && (unsigned)sky.tilenum >= MAXUSERTILES) return;
if ((1 << sky.lognumtiles) > MAXPSKYTILES) return;
sky.yoffs2 = sky.yoffs;
auto psky = tileSetupSky(sky.tilenum);
*psky = sky;
}

View file

@ -651,6 +651,94 @@ MapFlagHandlers[] =
{ NULL, MITYPE_IGNORE, 0, 0}
};
void PrintCutscene(const char* name, CutsceneDef& cut)
{
if (cut.function.IsEmpty() && cut.video.IsEmpty()) return;
Printf("\t%s\n\t{\n", name);
if (cut.function.IsNotEmpty())
{
Printf("\t\tfunction = %s\n", cut.function.GetChars());
}
if (cut.video.IsNotEmpty())
{
Printf("\t\tvideo = \"%s\"\n", cut.video.GetChars());
}
if (cut.soundName.IsNotEmpty())
{
Printf("\t\tsound = \"%s\"\n", cut.soundName.GetChars());
}
Printf("\t}\n");
}
CCMD(mapinfo)
{
for (auto& vol : volumes)
{
Printf("episode %s\n{\n", vol.startmap.GetChars());
if (vol.name.IsNotEmpty()) Printf("\tname = \"%s\"\n", vol.name.GetChars());
if (vol.subtitle.IsNotEmpty()) Printf("\tsubtitle = \"%s\"\n{\n", vol.subtitle.GetChars());
Printf("}\n");
}
for (auto& clust : clusters)
{
Printf("cluster %d\n{\n", clust.index);
if (clust.name.IsNotEmpty()) Printf("\tname = \"%s\"\n", clust.name.GetChars());
if (clust.InterBackground.IsNotEmpty()) Printf("\tInterBackground = %s\n", clust.InterBackground.GetChars());
PrintCutscene("intro", clust.intro);
PrintCutscene("outro", clust.outro);
PrintCutscene("gameover", clust.gameover);
Printf("}\n");
}
for (auto& map : mapList)
{
int lump = fileSystem.FindFile(map->fileName);
if (lump >= 0)
{
int rfnum = fileSystem.GetFileContainer(lump);
Printf("map %s \"%s\"\n{\n", map->labelName.GetChars(), map->DisplayName());
Printf("\tlevelnum = %d\n\tCluster = %d\n", map->levelNumber, map->cluster);
if (map->Author.IsNotEmpty())
{
FString auth = map->Author;
auth.Substitute("\"", "\\\"");
Printf("\tAuthor = \"%s\"\n", auth.GetChars());
}
if (map->NextMap.IsNotEmpty()) Printf("\tNext = %s\n", map->NextMap.GetChars());
if (map->NextSecret.IsNotEmpty()) Printf("\tSecretNext = %s\n", map->NextSecret.GetChars());
if (map->InterBackground.IsNotEmpty()) Printf("\tInterBackground = %s\n", map->InterBackground.GetChars());
if (map->music.IsNotEmpty()) Printf("\tMusic = \"%s\"\n", map->music.GetChars());
if (map->musicorder > 0) Printf("\tMusicorder = %d\n", map->musicorder);
if (map->cdSongId > 0) Printf("\tCDtrack = %d\n", map->cdSongId);
if (map->parTime) Printf("\tParTime = %d\n", map->parTime);
if (map->designerTime) Printf("\tDesignerTime = %d\n", map->designerTime);
for (int i = 0; i < MAX_MESSAGES; i++)
{
if (map->messages[i].IsNotEmpty()) Printf("\tMessage = %d, \"%s\"\n", i + 1, map->messages[i].GetChars());
}
for (auto& flagh : MapFlagHandlers)
{
if (flagh.type == MITYPE_SETFLAG)
{
if (map->flags & flagh.data1) Printf("\t%s\n", flagh.name);
}
if (flagh.type == MITYPE_SETFLAGG)
{
if (map->gameflags & flagh.data1) Printf("\t%s\n", flagh.name);
}
}
PrintCutscene("intro", map->intro);
PrintCutscene("outro", map->outro);
Printf("}\n");
}
else
{
//Printf("%s - %s (defined but does not exist)\n", map->fileName.GetChars(), map->DisplayName());
}
}
}
//==========================================================================
//
// ParseMapDefinition
@ -786,7 +874,7 @@ static int GetDefaultLevelNum(const char *mapname)
(mapname[2] == 'M' || mapname[2] == 'L') &&
mapname[3] >= '0' && mapname[3] <= '9')
{
int epinum = mapname[1] - '1';
int epinum = mapname[1] - '0';
int mapnum = mapname[3] - '0';
return makelevelnum(epinum, mapnum);
}
@ -837,7 +925,7 @@ MapRecord *FMapInfoParser::ParseMapHeader(MapRecord &defaultinfo)
if (map != &sink && map->name.IsEmpty()) sc.ScriptError("Missing level name");
sc.UnGet();
}
map->levelNumber = GetDefaultLevelNum(map->labelName);
if (!map->levelNumber) map->levelNumber = GetDefaultLevelNum(map->labelName);
return map;
}
@ -1218,6 +1306,7 @@ void G_ParseMapInfo ()
}
// Parse any extra RMAPINFOs.
lastlump = 0;
while ((lump = fileSystem.FindLump ("RMAPINFO", &lastlump, false)) != -1)
{
FMapInfoParser parse;

View file

@ -57,7 +57,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c_dispatch.h"
#include "glbackend/glbackend.h"
#include "engineerrors.h"
#include "mmulti.h"
#include "gamestate.h"
#include "gstrings.h"
#include "texturemanager.h"
@ -106,7 +105,7 @@ CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
// The last remains of sdlayer.cpp
GameInterface* gi;
int myconnectindex, numplayers;
int connecthead, connectpoint2[MAXMULTIPLAYERS];
int connecthead, connectpoint2[MAXPLAYERS];
auto vsnprintfptr = vsnprintf; // This is an inline in Visual Studio but we need an address for it to satisfy the MinGW compiled libraries.
int lastTic;
@ -565,12 +564,12 @@ int GameMain()
{
r = RunGame();
}
catch (const CExitEvent & exit)
catch (const CExitEvent& exit)
{
// Just let the rest of the function execute.
r = exit.Reason();
}
catch (const std::exception & err)
catch (const std::exception& err)
{
// shut down critical systems before showing a message box.
I_ShowFatalError(err.what());
@ -617,22 +616,6 @@ int GameMain()
void SetDefaultStrings()
{
// Duke 1.3 does not define its episodes through CON.
if ((g_gameType & GAMEFLAG_DUKE) && fileSystem.FindFile("E4L1.MAP") < 0)
{
auto vol0 = AllocateVolume(); vol0->index = 0;
auto vol1 = AllocateVolume(); vol1->index = 1; vol1->flags = VF_SHAREWARELOCK;
auto vol2 = AllocateVolume(); vol2->index = 2; vol1->flags = VF_SHAREWARELOCK;
// Pre-Atomic releases do not define this.
vol0->name = "$L.A. Meltdown";
vol1->name = "$Lunar Apocalypse";
vol2->name = "$Shrapnel City";
gSkillNames[0] = "$Piece of Cake";
gSkillNames[1] = "$Let's Rock";
gSkillNames[2] = "$Come get Some";
gSkillNames[3] = "$Damn I'm Good";
}
// Blood hard codes its skill names, so we have to define them manually.
if (isBlood())
{
@ -854,6 +837,56 @@ void CreateStatusBar()
StatusBar = static_cast<DBaseStatusBar*>(stbarclass->CreateNew());
}
void GetGames()
{
auto getgames = Args->CheckValue("-getgames");
if (getgames)
{
try
{
auto groups = GrpScan();
FSerializer arc;
if (arc.OpenWriter())
{
if (arc.BeginArray("games"))
{
for (auto& entry : groups)
{
if (arc.BeginObject(nullptr))
{
arc("filename", entry.FileName)
("description", entry.FileInfo.name)
("defname", entry.FileInfo.defname)
("scriptname", entry.FileInfo.scriptname)
("gamefilter", entry.FileInfo.gamefilter)
("gameid", entry.FileInfo.gameid)
("fgcolor", entry.FileInfo.FgColor)
("bkcolor", entry.FileInfo.BgColor)
("addon", entry.FileInfo.isAddon)
.EndObject();
}
}
arc.EndArray();
}
unsigned int len;
auto p = arc.GetOutput(&len);
FILE* f = fopen(getgames, "wb");
if (f)
{
fwrite(p, 1, len, f);
fclose(f);
}
}
}
catch (...)
{
// Ignore all errors
}
throw CExitEvent(0);
}
}
//==========================================================================
//
//
@ -880,6 +913,7 @@ int RunGame()
I_DetectOS();
userConfig.ProcessOptions();
G_LoadConfig();
GetGames();
auto usedgroups = SetupGame();
bool colorset = false;

View file

@ -84,7 +84,6 @@ struct GameInterface
virtual double SmallFontScale() { return 1; }
virtual void SerializeGameState(FSerializer& arc) {}
virtual void DrawPlayerSprite(const DVector2& origin, bool onteam) {}
virtual void QuitToTitle() {}
virtual void SetAmbience(bool on) {}
virtual FString GetCoordString() { return "'stat coord' not implemented"; }
virtual void ExitFromMenu() { throw CExitEvent(0); }

View file

@ -74,7 +74,6 @@
#include "vm.h"
#include "gamestate.h"
#include "screenjob.h"
#include "mmulti.h"
#include "c_console.h"
#include "uiinput.h"
#include "v_video.h"

View file

@ -68,59 +68,6 @@ CCMD(listmaps)
}
}
CCMD(mapinfo)
{
const char* mapname = nullptr;
if (argv.argc() > 1) mapname = argv[1];
if (!mapname)
{
for (auto& vol : volumes)
{
Printf("Volume %d\n\tName = '%s'\n\tstartmap = '%s'\n}\n", vol.index, vol.name.GetChars(), vol.startmap.GetChars());
}
for (auto& clus : clusters)
{
if (clus.intro.isdefined() || clus.outro.isdefined())
{
Printf("Cluster %d\n\tName = '%s'\n", clus.index, clus.name.GetChars());
if (clus.intro.function.IsNotEmpty()) Printf("\tIntro function = %s\n", clus.intro.function.GetChars());
if (clus.intro.video.IsNotEmpty()) Printf("\tIntro video = %s\n", clus.intro.video.GetChars());
if (clus.outro.function.IsNotEmpty()) Printf("\tOutro function = %s\n", clus.outro.function.GetChars());
if (clus.outro.video.IsNotEmpty()) Printf("\tOutro video = %s\n", clus.outro.video.GetChars());
Printf("}\n");
}
}
}
for (auto& map : mapList)
{
if (mapname && map->labelName.CompareNoCase(mapname)) continue;
int lump = fileSystem.FindFile(map->fileName);
if (lump >= 0)
{
int rfnum = fileSystem.GetFileContainer(lump);
Printf("%s - %s (%s)\n{\n", map->fileName.GetChars(), map->DisplayName(), fileSystem.GetResourceFileName(rfnum));
Printf("\tlevel number = %d\n\tCluster = %d\n\tIndex = %d\n", map->levelNumber, map->cluster, map->mapindex);
if (map->Author.IsNotEmpty()) Printf("\tAuthor = '%s'\n", map->Author.GetChars());
if (map->NextMap.IsNotEmpty()) Printf("\tNext map = '%s'\n", map->NextMap.GetChars());
if (map->NextSecret.IsNotEmpty()) Printf("\tNext secret map = '%s'\n", map->NextSecret.GetChars());
if (map->music.IsNotEmpty()) Printf("\tMusic = '%s:%d'", map->music.GetChars(), map->musicorder);
if (map->cdSongId > 0) Printf("\tCD track = %d\n", map->cdSongId);
if (map->parTime) Printf("\tPar Time = %d\n", map->parTime);
if (map->designerTime) Printf("\tPar Time = %d\n", map->designerTime);
if (map->intro.function.IsNotEmpty()) Printf("\tIntro function = %s\n", map->intro.function.GetChars());
if (map->intro.video.IsNotEmpty()) Printf("\tIntro video = %s\n", map->intro.video.GetChars());
if (map->outro.function.IsNotEmpty()) Printf("\tOutro function = %s\n", map->outro.function.GetChars());
if (map->outro.video.IsNotEmpty()) Printf("\tOutro video = %s\n", map->outro.video.GetChars());
Printf("}\n");
}
else
{
Printf("%s - %s (defined but does not exist)\n", map->fileName.GetChars(), map->DisplayName());
}
}
}
int CutsceneDef::GetSound()
{
int id;
@ -185,9 +132,10 @@ VolumeRecord* AllocateVolume()
MapRecord* FindMapByIndexOnly(int cluster, int num)
{
int levelnum = makelevelnum(cluster, num);
for (auto& map : mapList)
{
if (map->mapindex == num && map->cluster == cluster) return map.Data();
if (map->levelNumber == levelnum) return map.Data();
}
return nullptr;
}
@ -195,7 +143,7 @@ MapRecord* FindMapByIndexOnly(int cluster, int num)
MapRecord* FindMapByIndex(int cluster, int num)
{
auto map = FindMapByLevelNum(num);
if (!map) map = FindMapByIndexOnly(cluster, num); // modern definitions take precedence.
if (!map && num < 1000) map = FindMapByLevelNum(makelevelnum(cluster, num));
return map;
}

View file

@ -115,7 +115,6 @@ struct ClusterDef
FString InterBackground;
int index = -1;
int flags = 0; // engine and common flags
int gameflags = 0; // game specific flags.
};
struct VolumeRecord // episodes
@ -147,7 +146,6 @@ struct MapRecord
int flags = 0;
int gameflags = 0;
int levelNumber = -1;
int mapindex = -1; // index in the episode. This only for finding the next map in the progression when nothing explicit is defined.
int cluster = -1;
PalEntry fadeto = 0;

View file

@ -64,6 +64,7 @@
#include "i_net.h"
#include "savegamehelp.h"
#include "gi.h"
#include "raze_music.h"
EXTERN_CVAR(Int, cl_gfxlocalization)
EXTERN_CVAR(Bool, m_quickexit)
@ -272,7 +273,8 @@ CCMD(menu_endgame)
{
STAT_Cancel();
M_ClearMenus();
gi->QuitToTitle();
Mus_Stop();
gameaction = ga_mainmenu;
});
M_ActivateMenu(newmenu);

View file

@ -275,10 +275,13 @@ int BunchDrawer::ClipLine(int aline, bool portal)
void BunchDrawer::ProcessBunch(int bnch)
{
FBunch* bunch = &Bunches[bnch];
int start = bunch->startline;
int end = bunch->endline;
ClipWall.Clock();
for (int i = bunch->startline; i <= bunch->endline; i++)
for (int i = start; i <= end; i++)
{
bunch = &Bunches[bnch]; // re-get the pointer in case of reallocation.
int clipped = ClipLine(i, bunch->portal);
if (clipped & CL_Draw)

View file

@ -251,8 +251,8 @@ void HWDrawList::SortPlaneIntoPlane(SortNode * head,SortNode * sort)
if (fh->z == fs->z)
{
// Make sure we have consistent ordering with two floor sprites of the same distance if they overlap
int time1 = fh->sprite ? fh->sprite->time : -1;
int time2 = fs->sprite ? fs->sprite->time : -1;
int time1 = fh->Sprite ? fh->Sprite->time : -1;
int time2 = fs->Sprite ? fs->Sprite->time : -1;
if (time1 == time2) head->AddToEqual(sort);
else if (time2 < time1)head->AddToLeft(sort);
else head->AddToRight(sort);
@ -404,8 +404,8 @@ void HWDrawList::SortWallIntoWall(HWDrawInfo *di, SortNode * head,SortNode * sor
if (fabs(v1)<MIN_EQ && fabs(v2)<MIN_EQ)
{
int time1 = wh->sprite ? wh->sprite->time : -1;
int time2 = ws->sprite ? ws->sprite->time : -1;
int time1 = wh->Sprite ? wh->Sprite->time : -1;
int time2 = ws->Sprite ? ws->Sprite->time : -1;
if ((ws->type==RENDERWALL_FOGBOUNDARY && wh->type!=RENDERWALL_FOGBOUNDARY) || time2 < time1)
{
@ -591,7 +591,7 @@ inline int HWDrawList::CompareSprites(SortNode * a,SortNode * b)
if (s1->depth < s2->depth) return 1;
if (s1->depth > s2->depth) return -1;
return s1->sprite->time - s2->sprite->time;
return s1->Sprite->time - s2->Sprite->time;
}
//==========================================================================
@ -737,8 +737,8 @@ void HWDrawList::SortWallsVert(HWDrawInfo* di)
HWWall* w1 = walls[a.index];
HWWall* w2 = walls[b.index];
if (w1->glseg.y1 != w2->glseg.y1) return w1->glseg.y1 < w2->glseg.y1;
int time1 = w1->sprite ? w1->sprite->time : -1;
int time2 = w2->sprite ? w2->sprite->time : -1;
int time1 = w1->Sprite ? w1->Sprite->time : -1;
int time2 = w2->Sprite ? w2->Sprite->time : -1;
return time1 < time2;
});
@ -747,8 +747,8 @@ void HWDrawList::SortWallsVert(HWDrawInfo* di)
HWWall* w1 = walls[a.index];
HWWall* w2 = walls[b.index];
if (w1->glseg.y1 != w2->glseg.y1) return w1->glseg.y1 > w2->glseg.y1;
int time1 = w1->sprite ? w1->sprite->time : -1;
int time2 = w2->sprite ? w2->sprite->time : -1;
int time1 = w1->Sprite ? w1->Sprite->time : -1;
int time2 = w2->Sprite ? w2->Sprite->time : -1;
return time1 < time2;
});
@ -784,8 +784,8 @@ void HWDrawList::SortWallsHorz(HWDrawInfo* di)
HWWall* w1 = walls[a.index];
HWWall* w2 = walls[b.index];
if (w1->glseg.x1 != w2->glseg.x1) return w1->glseg.x1 < w2->glseg.x1;
int time1 = w1->sprite ? w1->sprite->time : -1;
int time2 = w2->sprite ? w2->sprite->time : -1;
int time1 = w1->Sprite ? w1->Sprite->time : -1;
int time2 = w2->Sprite ? w2->Sprite->time : -1;
return time1 < time2;
});
@ -794,8 +794,8 @@ void HWDrawList::SortWallsHorz(HWDrawInfo* di)
HWWall* w1 = walls[a.index];
HWWall* w2 = walls[b.index];
if (w1->glseg.x1 != w2->glseg.x1) return w1->glseg.x1 > w2->glseg.x1;
int time1 = w1->sprite ? w1->sprite->time : -1;
int time2 = w2->sprite ? w2->sprite->time : -1;
int time1 = w1->Sprite ? w1->Sprite->time : -1;
int time2 = w2->Sprite ? w2->Sprite->time : -1;
return time1 < time2;
});
@ -831,8 +831,8 @@ void HWDrawList::SortFlats(HWDrawInfo* di)
HWFlat* w1 = flats[a.index];
HWFlat* w2 = flats[b.index];
if (w1->z != w2->z) return w1->z < w2->z;
int time1 = w1->sprite ? w1->sprite->time : -1;
int time2 = w2->sprite ? w2->sprite->time : -1;
int time1 = w1->Sprite ? w1->Sprite->time : -1;
int time2 = w2->Sprite ? w2->Sprite->time : -1;
return time1 < time2;
});
@ -841,8 +841,8 @@ void HWDrawList::SortFlats(HWDrawInfo* di)
HWFlat* w1 = flats[a.index];
HWFlat* w2 = flats[b.index];
if (w1->z != w2->z) return w2->z < w1->z;
int time1 = w1->sprite ? w1->sprite->time : -1;
int time2 = w2->sprite ? w2->sprite->time : -1;
int time1 = w1->Sprite ? w1->Sprite->time : -1;
int time2 = w2->Sprite ? w2->Sprite->time : -1;
return time1 < time2;
});

View file

@ -50,7 +50,7 @@ void HWDrawInfo::AddWall(HWWall *wall)
int list;
if (wall->type != RENDERWALL_M2S) list = GLDL_PLAINWALLS;
else if (wall->sprite == nullptr) list = GLDL_MASKEDWALLS;
else if (wall->Sprite == nullptr) list = GLDL_MASKEDWALLS;
else if (wall->glseg.x1 == wall->glseg.x2) list = GLDL_MASKEDWALLSV;
else if (wall->glseg.y1 == wall->glseg.y2) list = GLDL_MASKEDWALLSH;
else list = GLDL_MASKEDWALLSS;
@ -98,11 +98,11 @@ void HWDrawInfo::AddFlat(HWFlat *flat)
if (flat->RenderStyle != LegacyRenderStyles[STYLE_Translucent] || flat->alpha < 1.f - FLT_EPSILON || checkTranslucentReplacement(flat->texture->GetID(), flat->palette))
{
// translucent portals go into the translucent border list.
list = flat->sprite? GLDL_TRANSLUCENT : GLDL_TRANSLUCENTBORDER;
list = flat->Sprite? GLDL_TRANSLUCENT : GLDL_TRANSLUCENTBORDER;
}
else
{
list = flat->sprite ? GLDL_MASKEDFLATS : GLDL_PLAINFLATS;
list = flat->Sprite ? GLDL_MASKEDFLATS : GLDL_PLAINFLATS;
}
auto newflat = drawlists[list].NewFlat();
*newflat = *flat;

View file

@ -185,7 +185,7 @@ public:
public:
walltype* seg;
spritetype* sprite;
spritetype* Sprite;
sectortype* frontsector, * backsector;
//private:
@ -251,7 +251,7 @@ class HWFlat
public:
int section;
sectortype * sec;
spritetype* sprite; // for flat sprites.
spritetype* Sprite; // for flat sprites.
FGameTexture *texture;
float z; // the z position of the flat (only valid for non-sloped planes)
@ -294,7 +294,7 @@ class HWSprite
{
public:
spritetype* sprite;
spritetype* Sprite;
PalEntry fade;
int shade, palette;
float visibility;

View file

@ -96,7 +96,7 @@ void HWFlat::MakeVertices()
{
if (vertcount > 0) return;
bool canvas = texture->isHardwareCanvas();
if (sprite == nullptr)
if (Sprite == nullptr)
{
auto mesh = sectorGeometry.get(section, plane, geoofs);
if (!mesh) return;
@ -117,12 +117,12 @@ void HWFlat::MakeVertices()
else
{
vec2_t pos[4];
GetFlatSpritePosition(sprite, sprite->pos.vec2, pos, true);
GetFlatSpritePosition(Sprite, Sprite->pos.vec2, pos, true);
auto ret = screen->mVertexData->AllocVertices(6);
auto vp = ret.first;
float x = !(sprite->cstat & CSTAT_SPRITE_XFLIP) ? 0.f : 1.f;
float y = !(sprite->cstat & CSTAT_SPRITE_YFLIP) ? 0.f : 1.f;
float x = !(Sprite->cstat & CSTAT_SPRITE_XFLIP) ? 0.f : 1.f;
float y = !(Sprite->cstat & CSTAT_SPRITE_YFLIP) ? 0.f : 1.f;
for (unsigned i = 0; i < 6; i++)
{
const static unsigned indices[] = { 0, 1, 2, 0, 2, 3 };
@ -144,7 +144,7 @@ void HWFlat::MakeVertices()
//==========================================================================
void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
{
if (screen->BuffersArePersistent() && !sprite)
if (screen->BuffersArePersistent() && !Sprite)
{
MakeVertices();
}
@ -156,7 +156,7 @@ void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
}
#endif
if (!sprite)
if (!Sprite)
{
auto mesh = sectorGeometry.get(section, plane, geoofs);
state.SetNormal(mesh->normal);
@ -182,7 +182,7 @@ void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
if (texture && !checkTranslucentReplacement(texture->GetID(), palette)) state.AlphaFunc(Alpha_GEqual, texture->alphaThreshold);
else state.AlphaFunc(Alpha_GEqual, 0.f);
}
state.SetMaterial(texture, UF_Texture, 0, sprite == nullptr? CLAMP_NONE : CLAMP_XY, TRANSLATION(Translation_Remap + curbasepal, palette), -1);
state.SetMaterial(texture, UF_Texture, 0, Sprite == nullptr? CLAMP_NONE : CLAMP_XY, TRANSLATION(Translation_Remap + curbasepal, palette), -1);
state.SetLightIndex(dynlightindex);
state.Draw(DT_Triangles, vertindex, vertcount);
@ -208,7 +208,7 @@ void HWFlat::PutFlat(HWDrawInfo *di, int whichplane)
{
vertcount = 0;
plane = whichplane;
if (!screen->BuffersArePersistent() || sprite || di->ingeo) // should be made static buffer content later (when the logic is working)
if (!screen->BuffersArePersistent() || Sprite || di->ingeo) // should be made static buffer content later (when the logic is working)
{
#if 0
if (di->Level->HasDynamicLights && texture != nullptr && !di->isFullbrightScene() && !(hacktype & (SSRF_PLANEHACK | SSRF_FLOODHACK)))
@ -250,7 +250,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int section
visibility = sectorVisibility(frontsector);
sec = frontsector;
section = section_;
sprite = nullptr;
Sprite = nullptr;
geoofs = di->geoofs;
//
@ -352,7 +352,7 @@ void HWFlat::ProcessFlatSprite(HWDrawInfo* di, spritetype* sprite, sectortype* s
if (texture && texture->isValid())
{
this->sprite = sprite;
this->Sprite = sprite;
sec = sector;
shade = sprite->shade;
palette = sprite->pal;

View file

@ -118,13 +118,42 @@ bool FPortalSceneState::RenderFirstSkyPortal(int recursion, HWDrawInfo *outer_di
HWPortal* best = nullptr;
unsigned bestindex = 0;
if (recursion > 0 || outer_di->Portals.Size() != 1 || !outer_di->Portals[0]->IsSky()) return false;
// Find the one with the highest amount of lines.
// Normally this is also the one that saves the largest amount
// of time by drawing it before the scene itself.
auto& portals = outer_di->Portals;
for (int i = portals.Size() - 1; i >= 0; --i)
{
auto p = portals[i];
if (p->lines.Size() > 0 && p->IsSky())
{
// Cannot clear the depth buffer inside a portal recursion
if (recursion && p->NeedDepthBuffer()) continue;
best = outer_di->Portals[0];
outer_di->Portals.Clear();
RenderPortal(best, state, false, outer_di);
delete best;
return true;
if (!best || p->lines.Size() > best->lines.Size())
{
best = p;
bestindex = i;
}
// If the portal area contains the current camera viewpoint, let's always use it because it's likely to give the largest area.
if (p->boundingBox.contains(outer_di->Viewpoint.Pos))
{
best = p;
bestindex = i;
break;
}
}
}
if (best)
{
portals.Delete(bestindex);
RenderPortal(best, state, false, outer_di);
delete best;
return true;
}
return false;
}

View file

@ -54,7 +54,7 @@ void initSkyInfo(HWDrawInfo *di, HWSkyInfo* sky, sectortype* sector, int plane,
{
int remap = TRANSLATION(Translation_Remap + curbasepal, palette);
int16_t const* dapskyoff = getpsky(picnum, &dapyscale, &dapskybits, &dapyoffs, &daptileyscale);
int16_t const* dapskyoff = getpsky(picnum, &dapyscale, &dapskybits, &dapyoffs, &daptileyscale, true);
int tw = tileWidth(picnum);
if ((1 << sizeToBits(tw)) < tw) dapskybits--; // Build math is weird.

View file

@ -315,7 +315,7 @@ void HWSprite::Process(HWDrawInfo* di, spritetype* spr, sectortype* sector, int
if (!tex || !tex->isValid()) return;
texture = tex;
sprite = spr;
Sprite = spr;
modelframe = 0;
dynlightindex = -1;
@ -442,7 +442,7 @@ void HWSprite::Process(HWDrawInfo* di, spritetype* spr, sectortype* sector, int
bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, spritetype* spr, sectortype* sector, bool rotate)
{
sprite = spr;
Sprite = spr;
auto sprext = &spriteext[spr->owner];
texture = nullptr;
@ -528,7 +528,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, spritetype* spr, se
auto vp = di->Viewpoint;
depth = (float)((x - vp.Pos.X) * vp.TanCos + (y - vp.Pos.Y) * vp.TanSin);
PutSprite(di, spriteHasTranslucency(sprite));
PutSprite(di, spriteHasTranslucency(Sprite));
rendered_sprites++;
return true;
}

View file

@ -158,7 +158,7 @@ void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
SetLightAndFog(state, fade, palette, shade, visibility, alpha);
state.SetMaterial(texture, UF_Texture, 0, (flags & (HWF_CLAMPX | HWF_CLAMPY)), TRANSLATION(Translation_Remap + curbasepal, palette), -1);
if (sprite == nullptr)
if (Sprite == nullptr)
{
int h = (int)texture->GetDisplayHeight();
int h2 = 1 << sizeToBits(h);
@ -479,7 +479,8 @@ void HWWall::PutPortal(HWDrawInfo *di, int ptype, int plane)
case PORTALTYPE_LINETOSPRITE:
// These are also unique.
portal = new HWLineToSpritePortal(&portalState, seg, &sprite[seg->portalnum]);
assert(seg->portalnum >= 0 && seg->portalnum < MAXSPRITES);
portal = new HWLineToSpritePortal(&portalState, seg, &::sprite[seg->portalnum]);
di->Portals.Push(portal);
portal->AddLine(this);
break;
@ -704,7 +705,7 @@ void HWWall::DoTexture(HWDrawInfo* di, walltype* wal, walltype* refwall, float r
{
float h = hl + (hr - hl) * frac;
h = (-(float)(refheight + (h * 256)) / ((th * 2048.0f) / (float)(wal->yrepeat))) + ypanning;
if (wal->cstat & CSTAT_WALL_YFLIP) h = -h;
if (refwall->cstat & CSTAT_WALL_YFLIP) h = -h;
return h;
};
@ -866,7 +867,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
this->seg = wal;
this->frontsector = frontsector;
this->backsector = backsector;
sprite = nullptr;
Sprite = nullptr;
vertindex = 0;
vertcount = 0;
@ -1021,7 +1022,7 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect
if (!tex || !tex->isValid()) return;
seg = nullptr;
sprite = spr;
Sprite = spr;
vec2_t pos[2];
int sprz = spr->pos.z;
@ -1053,7 +1054,7 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect
fade = lookups.getFade(sector->floorpal); // fog is per sector.
visibility = sectorVisibility(sector);
SetSpriteTranslucency(sprite, alpha, RenderStyle);
SetSpriteTranslucency(Sprite, alpha, RenderStyle);
int height, topofs;
if (hw_hightile && TileFiles.tiledata[spr->picnum].hiofs.xsize)
@ -1122,5 +1123,5 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect
std::swap(tcs[UPLFT], tcs[UPRGT]);
}
PutWall(di, spriteHasTranslucency(sprite));
PutWall(di, spriteHasTranslucency(Sprite));
}

View file

@ -59,6 +59,7 @@
#include "render.h"
#include "hw_sections.h"
#include "sectorgeometry.h"
#include "d_net.h"
#include <zlib.h>
@ -144,8 +145,8 @@ bool ReadSavegame(const char* name)
FSerializer arc;
if (!arc.OpenReader((const char*)data, info->LumpSize))
{
delete savereader;
info->Unlock();
delete savereader;
return false;
}
info->Unlock();
@ -422,7 +423,6 @@ FString G_BuildSaveName (const char *prefix)
}
#include "build.h"
#include "mmulti.h"
#define V(x) x
static spritetype zsp;

View file

@ -110,7 +110,7 @@ void processSpritesOnOtherSideOfPortal(int x, int y, int interpolation)
for (int i = mirrorcnt-1; i >= 0; i--)
{
int nTile = 4080+i;
if (TestBitString(gotpic, nTile))
if (testgotpic(nTile))
{
if (mirror[i].type == 1 || mirror[i].type == 2)
{
@ -144,9 +144,9 @@ void render3DViewPolymost(int nSectnum, int cX, int cY, int cZ, binangle cA, fix
}
cH = q16horiz(ClipRange(cH.asq16(), gi->playerHorizMin(), gi->playerHorizMax()));
RORHACK:
int ror_status[16];
bool ror_status[16];
for (int i = 0; i < 16; i++)
ror_status[i] = TestBitString(gotpic, 4080 + i);
ror_status[i] = testgotpic(4080 + i);
fixed_t deliriumPitchI = interpolatedvalue(IntToFixed(deliriumPitchO), IntToFixed(deliriumPitch), gInterpolate);
DrawMirrors(cX, cY, cZ, cA.asq16(), cH.asq16() + deliriumPitchI, gInterpolate, gViewIndex);
int bakCstat = gView->pSprite->cstat;
@ -163,7 +163,7 @@ RORHACK:
viewProcessSprites(pm_tsprite, pm_spritesortcnt, cX, cY, cZ, cA.asbuild(), gInterpolate);
bool do_ror_hack = false;
for (int i = 0; i < 16; i++)
if (ror_status[i] != TestBitString(gotpic, 4080 + i))
if (ror_status[i] != testgotpic(4080 + i))
do_ror_hack = true;
if (do_ror_hack)
{
@ -188,7 +188,7 @@ void setPortalFlags(char mode)
for (int i = mirrorcnt - 1; i >= 0; i--)
{
int nTile = 4080 + i;
if (TestBitString(gotpic, nTile))
if (testgotpic(nTile))
{
switch (mirror[i].type)
{
@ -215,9 +215,8 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int
for (int i = mirrorcnt - 1; i >= 0; i--)
{
int nTile = 4080 + i;
if (TestBitString(gotpic, nTile))
if (testgotpic(nTile, true))
{
ClearBitString(gotpic, nTile);
switch (mirror[i].type)
{
case 0:
@ -287,7 +286,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int
renderDrawMasks();
sector[nSector].floorstat = fstat;
for (int i = 0; i < 16; i++)
ClearBitString(gotpic, 4080 + i);
cleargotpic(4080 + i);
if (viewPlayer >= 0)
{
gPlayer[viewPlayer].pSprite->cstat = bakCstat;
@ -319,7 +318,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int
renderDrawMasks();
sector[nSector].ceilingstat = cstat;
for (int i = 0; i < 16; i++)
ClearBitString(gotpic, 4080 + i);
cleargotpic(4080 + i);
if (viewPlayer >= 0)
{
gPlayer[viewPlayer].pSprite->cstat = bakCstat;

File diff suppressed because it is too large Load diff

View file

@ -211,21 +211,16 @@ void actDoLight(int spriteNum);
bool IsUnderwaterSector(int nSector);
void actInit(bool bSaveLoad);
void ConcussSprite(int a1, spritetype *pSprite, int x, int y, int z, int a6);
int actWallBounceVector(int *x, int *y, int nWall, int a4);
int actFloorBounceVector(int *x, int *y, int *z, int nSector, int a5);
void sub_2A620(int nSprite, int x, int y, int z, int nSector, int nDist, int a7, int a8, DAMAGE_TYPE a9, int a10, int a11, int a12, int a13);
void sub_2AA94(DBloodActor *actor);
spritetype *actSpawnFloor(spritetype *pSprite);
spritetype *actDropAmmo(spritetype *pSprite, int nType);
spritetype *actDropWeapon(spritetype *pSprite, int nType);
spritetype *actDropItem(spritetype *pSprite, int nType);
spritetype *actDropKey(spritetype *pSprite, int nType);
spritetype *actDropFlag(spritetype *pSprite, int nType);
void actRadiusDamage(DBloodActor* source, int x, int y, int z, int nSector, int nDist, int a7, int a8, DAMAGE_TYPE a9, int a10, int a11);
spritetype *actDropObject(spritetype *pSprite, int nType);
bool actHealDude(DBloodActor* pXDude, int a2, int a3);
bool actHealDude(XSPRITE *pXDude, int a2, int a3);
void actKillDude(DBloodActor* a1, DBloodActor* pSprite, DAMAGE_TYPE a3, int a4);
void actKillDude(int a1, spritetype *pSprite, DAMAGE_TYPE a3, int a4);
int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE a3, int a4);
int actDamageSprite(DBloodActor* pSource, DBloodActor* pTarget, DAMAGE_TYPE damageType, int damage);
void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRITE **a5, int *a6, walltype **a7, XWALL **a8, int *a9, sectortype **a10, XSECTOR **a11);
void actImpactMissile(spritetype *pMissile, int hitCode);
void actKickObject(spritetype *pSprite1, spritetype *pSprite2);
@ -239,17 +234,21 @@ void actExplodeSprite(spritetype *pSprite);
void actActivateGibObject(DBloodActor *actor);
bool IsUnderWater(spritetype *pSprite);
void actProcessSprites(void);
spritetype * actSpawnSprite(int nSector, int x, int y, int z, int nStat, char a6);
spritetype * actSpawnSprite_(int nSector, int x, int y, int z, int nStat, char a6);
DBloodActor* actSpawnSprite(int nSector, int x, int y, int z, int nStat, bool a6);
spritetype *actSpawnDude(spritetype *pSource, short nType, int a3, int a4);
spritetype * actSpawnSprite(spritetype *pSource, int nStat);
spritetype * actSpawnThing(int nSector, int x, int y, int z, int nThingType);
spritetype * actFireThing(spritetype *pSprite, int a2, int a3, int a4, int thingType, int a6);
spritetype * actFireThing_(spritetype *pSprite, int a2, int a3, int a4, int thingType, int a6);
DBloodActor* actFireThing(DBloodActor* pSprite, int a2, int a3, int a4, int thingType, int a6);
spritetype* actFireMissile(spritetype *pSprite, int a2, int a3, int a4, int a5, int a6, int nType);
int actGetRespawnTime(spritetype *pSprite);
bool actCheckRespawn(spritetype *pSprite);
bool actCanSplatWall(int nWall);
void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, VECTOR_TYPE vectorType);
void actPostSprite(int nSprite, int nStatus);
void actPostSprite(DBloodActor* actor, int status);
void actPostProcess(void);
void MakeSplash(DBloodActor *actor);
void actBuildMissile(spritetype* pMissile, int nXSprite, int nSprite);

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "savegamehelp.h"
#include "mmulti.h"
#include "blood.h"
@ -93,7 +92,7 @@ bool isImmune(spritetype* pSprite, int dmgType, int minScale)
else if (IsDudeSprite(pSprite))
{
if (IsPlayerSprite(pSprite)) return (gPlayer[pSprite->type - kDudePlayer1].godMode || gPlayer[pSprite->type - kDudePlayer1].damageControl[dmgType] <= minScale);
else return (dudeInfo[pSprite->type - kDudeBase].at70[dmgType] <= minScale);
else return (dudeInfo[pSprite->type - kDudeBase].damageVal[dmgType] <= minScale);
}
}
@ -879,19 +878,21 @@ void aiSetTarget(XSPRITE *pXSprite, int nTarget)
}
int aiDamageSprite(spritetype *pSprite, XSPRITE *pXSprite, int nSource, DAMAGE_TYPE nDmgType, int nDamage)
int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType, int nDamage)
{
assert(nSource < kMaxSprites);
auto pSprite = &actor->s();
XSPRITE* pXSprite = &actor->x();
if (!pXSprite->health)
return 0;
auto actor = &bloodActors[pXSprite->reference];
pXSprite->health = ClipLow(pXSprite->health - nDamage, 0);
cumulDamage[pSprite->extra] += nDamage;
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
int nSprite = pXSprite->reference;
if (nSource >= 0)
if (source)
{
spritetype *pSource = &sprite[nSource];
spritetype *pSource = &source->s();
int nSource = pSource->index;
if (pSprite == pSource)
return 0;
if (pXSprite->target == -1 || (nSource != pXSprite->target && Chance(pSprite->type == pSource->type ? nDamage*pDudeInfo->changeTargetKin : nDamage*pDudeInfo->changeTarget)))

View file

@ -88,7 +88,6 @@ struct TARGETTRACK {
extern const int dword_138BB0[5];
extern DUDEEXTRA gDudeExtra[];
extern int gDudeSlope[];
bool dudeIsPlayingSeq(spritetype *pSprite, int nSeq);
void aiPlay3DSound(spritetype *pSprite, int a2, AI_SFX_PRIORITY a3, int a4);
@ -100,7 +99,7 @@ void aiMoveDodge(DBloodActor *actor);
void aiActivateDude(DBloodActor *actor);
void aiSetTarget(XSPRITE *pXSprite, int x, int y, int z);
void aiSetTarget(XSPRITE *pXSprite, int nTarget);
int aiDamageSprite(spritetype *pSprite, XSPRITE *pXSprite, int nSource, DAMAGE_TYPE nDmgType, int nDamage);
int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType, int nDamage);
void aiThinkTarget(DBloodActor* actor);
void sub_5F15C(spritetype *pSprite, XSPRITE *pXSprite);
void aiProcessDudes(void);

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else!
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"
@ -147,7 +146,7 @@ void cultThrowSeqCallback(int, DBloodActor* actor)
int nDist2 = nDist / 540;
if (nDist > 0x1e00)
v4 = 0;
spritetype *pMissile = actFireThing(pSprite, 0, 0, dz/128-14500, nMissile, (nDist2<<23)/120);
spritetype *pMissile = actFireThing_(pSprite, 0, 0, dz/128-14500, nMissile, (nDist2<<23)/120);
if (v4)
xsprite[pMissile->extra].Impact = 1;
else
@ -162,7 +161,7 @@ void sub_68170(int, DBloodActor* actor)
if (gGameOptions.nDifficulty > 2)
nMissile = kThingArmedTNTBundle;
sfxPlay3DSound(pSprite, 455, -1, 0);
spritetype* pMissile = actFireThing(pSprite, 0, 0, actor->dudeSlope - 9460, nMissile, 0x133333);
spritetype* pMissile = actFireThing_(pSprite, 0, 0, actor->dudeSlope - 9460, nMissile, 0x133333);
evPost(pMissile->index, 3, 120*(2+Random(2)), kCmdOn);
}
@ -182,7 +181,7 @@ void sub_68230(int, DBloodActor* actor)
int dz = pTarget->z - pSprite->z;
int nDist = approxDist(dx, dy);
int nDist2 = nDist / 540;
spritetype *pMissile = actFireThing(pSprite, 0, 0, dz/128-14500, nMissile, (nDist2<<17)/120);
spritetype *pMissile = actFireThing_(pSprite, 0, 0, dz/128-14500, nMissile, (nDist2<<17)/120);
xsprite[pMissile->extra].Impact = 1;
}

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"
@ -103,7 +102,7 @@ void ThrowFSeqCallback(int, DBloodActor* actor)
{
XSPRITE* pXSprite = &actor->x();
spritetype* pSprite = &actor->s();
actFireThing(&actor->s(), 0, 0, actor->dudeSlope-7500, kThingBone, 0xeeeee);
actFireThing_(&actor->s(), 0, 0, actor->dudeSlope-7500, kThingBone, 0xeeeee);
}
void BlastSSeqCallback(int, DBloodActor* actor)
@ -203,7 +202,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
void ThrowSSeqCallback(int, DBloodActor* actor)
{
spritetype* pSprite = &actor->s();
actFireThing(pSprite, 0, 0, actor->dudeSlope - 7500, kThingBone, Chance(0x6000) ? 0x133333 : 0x111111);
actFireThing_(pSprite, 0, 0, actor->dudeSlope - 7500, kThingBone, Chance(0x6000) ? 0x133333 : 0x111111);
}
static void gargThinkTarget(DBloodActor* actor)

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"
@ -86,7 +85,7 @@ void ghostSlashSeqCallback(int, DBloodActor* actor)
void ghostThrowSeqCallback(int, DBloodActor* actor)
{
actFireThing(&actor->s(), 0, 0, actor->dudeSlope - 7500, kThingBone, 0xeeeee);
actFireThing_(&actor->s(), 0, 0, actor->dudeSlope - 7500, kThingBone, 0xeeeee);
}
void ghostBlastSeqCallback(int, DBloodActor* actor)

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"
@ -98,7 +97,7 @@ void podAttack(int, DBloodActor* actor)
sfxPlay3DSound(pSprite, 2474, -1, 0);
else
sfxPlay3DSound(pSprite, 2475, -1, 0);
pMissile = actFireThing(pSprite, 0, -8000, dz/128-14500, kThingPodGreenBall, (nDist2<<23)/120);
pMissile = actFireThing_(pSprite, 0, -8000, dz/128-14500, kThingPodGreenBall, (nDist2<<23)/120);
}
if (pMissile)
seqSpawn(68, 3, pMissile->extra, -1);
@ -108,7 +107,7 @@ void podAttack(int, DBloodActor* actor)
if (pDudeInfo->seeDist*0.1 < nDist)
{
sfxPlay3DSound(pSprite, 2454, -1, 0);
pMissile = actFireThing(pSprite, 0, -8000, dz/128-14500, kThingPodFireBall, (nDist2<<23)/120);
pMissile = actFireThing_(pSprite, 0, -8000, dz/128-14500, kThingPodFireBall, (nDist2<<23)/120);
}
if (pMissile)
seqSpawn(22, 3, pMissile->extra, -1);
@ -120,8 +119,7 @@ void podAttack(int, DBloodActor* actor)
void sub_70284(int, DBloodActor* actor)
{
XSPRITE* pXSprite = &actor->x();
spritetype* pSprite = &actor->s();
auto pSprite = &actor->s();
sfxPlay3DSound(pSprite, 2502, -1, 0);
int nDist, nBurn;
DAMAGE_TYPE dmgType;
@ -138,7 +136,7 @@ void sub_70284(int, DBloodActor* actor)
nDist = 75;
break;
}
sub_2A620(pSprite->index, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, nDist, 1, 5*(1+gGameOptions.nDifficulty), dmgType, 2, nBurn, 0, 0);
actRadiusDamage(actor, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, nDist, 1, 5*(1+gGameOptions.nDifficulty), dmgType, 2, nBurn);
}
static void aiPodSearch(DBloodActor* actor)

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -26,7 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "raze_sound.h"
#include "blood.h"
@ -307,7 +306,7 @@ static void ThrowThing(DBloodActor* actor, bool impact)
}
spritetype* pThing = NULL;
if ((pThing = actFireThing(pSprite, 0, 0, (dz / 128) - zThrow, curWeapon, DivScale(dist / 540, 120, 23))) == NULL) return;
if ((pThing = actFireThing_(pSprite, 0, 0, (dz / 128) - zThrow, curWeapon, DivScale(dist / 540, 120, 23))) == NULL) return;
else if (pThinkInfo->picnum < 0 && pThing->type != kModernThingThrowableRock) pThing->picnum = 0;
pThing->owner = pSprite->index;
@ -1593,7 +1592,7 @@ void dudeLeechOperate(spritetype* pSprite, XSPRITE* pXSprite, EVENT event)
}
bool doExplosion(spritetype* pSprite, int nType) {
spritetype* pExplosion = actSpawnSprite(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, kStatExplosion, true);
spritetype* pExplosion = actSpawnSprite_(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, kStatExplosion, true);
if (pExplosion->extra < 0 || pExplosion->extra >= kMaxXSprites)
return false;

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"

View file

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "v_font.h"
#include "blood.h"

View file

@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else!
#include "build.h"
#include "mmulti.h"
#include "compat.h"
#include "g_input.h"
#include "automap.h"
@ -419,7 +418,7 @@ void GameInterface::app_init()
HookReplaceFunctions();
Printf(PRINT_NONOTIFY, "Loading tiles\n");
if (!tileInit(0, NULL))
if (!tileInit())
I_FatalError("TILES###.ART files not found");
levelLoadDefaults();

View file

@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "gamestruct.h"
#include "mapinfo.h"
#include "d_net.h"
#include "common_game.h"
#include "fx.h"
@ -120,7 +121,6 @@ struct GameInterface : ::GameInterface
void MenuOpened() override;
void MenuClosed() override;
bool CanSave() override;
void QuitToTitle() override;
FString GetCoordString() override;
ReservedSpace GetReservedScreenSpace(int viewsize) override;
void UpdateSounds() override;

View file

@ -22,6 +22,10 @@ public:
dudeSlope = 0;
}
bool hasX() { return sprite[index].extra > 0; }
void addX()
{
if (s().extra == -1) dbInsertXSprite(s().index);
}
spritetype& s() { return sprite[index]; }
XSPRITE& x() { return xsprite[sprite[index].extra]; } // calling this does not validate the xsprite!
SPRITEHIT& hit() { return gSpriteHit[sprite[index].extra]; }
@ -42,10 +46,20 @@ public:
DBloodActor* GetOwner()
{
if (s().owner == -1) return nullptr;
if (s().owner == -1 || s().owner == kMaxSprites-1) return nullptr;
return base() + s().owner;
}
void SetSpecialOwner() // nnext hackery
{
s().owner = kMaxSprites - 1;
}
bool GetSpecialOwner()
{
return (s().owner == kMaxSprites - 1);
}
bool IsPlayerActor()
{
return s().type >= kDudePlayer1 && s().type <= kDudePlayer8;
@ -124,5 +138,26 @@ inline int DeleteSprite(DBloodActor* nSprite)
return 0;
}
inline void actBurnSprite(DBloodActor* pSource, DBloodActor* pTarget, int nTime)
{
auto pXSprite = &pTarget->x();
pXSprite->burnTime = ClipHigh(pXSprite->burnTime + nTime, sprite[pXSprite->reference].statnum == kStatDude ? 2400 : 1200);
pXSprite->burnSource = pSource->s().index;
}
inline void GetActorExtents(DBloodActor* actor, int* top, int* bottom)
{
GetSpriteExtents(&actor->s(), top, bottom);
}
inline DBloodActor *PLAYER::fragger()
{
return fraggerId == -1? nullptr : &bloodActors[fraggerId];
}
inline void PLAYER::setFragger(DBloodActor* actor)
{
fraggerId = actor == nullptr ? -1 : actor->s().index;
}
END_BLD_NS

View file

@ -440,21 +440,6 @@ enum
// -------------------------------
// NUKE-TODO:
enum BLOOD_GLOBALFLAGS {
BLOOD_FORCE_WIDELOADSCREEN = 1<<0,
};
enum searchpathtypes_t {
SEARCHPATH_REMOVE = 1<<0,
};
extern void G_SetupGlobalPsky(void);
#pragma pack(push,1)
struct LOCATION {
@ -475,35 +460,6 @@ struct Aim {
#pragma pack(pop)
inline int ksgnf(float f)
{
if (f < 0)
return -1;
if (f > 0)
return 1;
return 0;
}
inline int IncBy(int a, int b)
{
a += b;
int q = a % b;
a -= q;
if (q < 0)
a -= b;
return a;
}
inline int DecBy(int a, int b)
{
a--;
int q = a % b;
a -= q;
if (q < 0)
a -= b;
return a;
}
inline int ClipLow(int a, int b)
{
if (a < b)

View file

@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else!
#include "mmulti.h"
#include "blood.h"
#include "gamestate.h"
#include "inputstate.h"

View file

@ -26,7 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "compat.h"
#include "mmulti.h"
#include "c_bind.h"
#include "razemenu.h"
#include "gamestate.h"
@ -164,12 +163,6 @@ FSavegameInfo GameInterface::GetSaveSig()
return { SAVESIG_BLD, MINSAVEVER_BLD, SAVEVER_BLD };
}
void GameInterface::QuitToTitle()
{
Mus_Stop();
gameaction = ga_mainmenu;
}
END_BLD_NS
using namespace Blood;

View file

@ -49,7 +49,7 @@ struct DUDEINFO {
int angSpeed; // turn speed
int nGibType[3]; // which gib used when explode dude
int startDamage[7]; // start damage shift
int at70[7]; // real damage? Hmm?
int damageVal[7]; // real damage? Hmm?
int at8c; // unused ?
int at90; // unused ?
};

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "v_draw.h"
#include "mmulti.h"
#include "statistics.h"
#include "gstrings.h"
#include "gamestate.h"

View file

@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "blood.h"
#include "bloodactor.h"
BEGIN_BLD_NS
@ -164,7 +165,7 @@ spritetype * CFX::fxSpawn(FX_ID nFx, int nSector, int x, int y, int z, unsigned
return NULL;
destroy(nSprite);
}
spritetype *pSprite = actSpawnSprite(nSector, x, y, z, 1, 0);
spritetype *pSprite = actSpawnSprite_(nSector, x, y, z, 1, 0);
pSprite->type = nFx;
pSprite->picnum = pFX->picnum;
pSprite->cstat |= pFX->cstat;
@ -261,9 +262,8 @@ void CFX::fxProcess(void)
}
}
void fxSpawnBlood(spritetype *pSprite, int a2)
void fxSpawnBlood(spritetype *pSprite, int )
{
UNREFERENCED_PARAMETER(a2);
if (pSprite->sectnum < 0 || pSprite->sectnum >= numsectors)
return;
int nSector = pSprite->sectnum;
@ -282,9 +282,8 @@ void fxSpawnBlood(spritetype *pSprite, int a2)
}
}
void sub_746D4(spritetype *pSprite, int a2)
void sub_746D4(spritetype *pSprite, int )
{
UNREFERENCED_PARAMETER(a2);
if (pSprite->sectnum < 0 || pSprite->sectnum >= numsectors)
return;
int nSector = pSprite->sectnum;
@ -355,4 +354,11 @@ void fxPrecache()
}
}
DBloodActor* CFX::fxSpawnActor(FX_ID nFx, int nSector, int x, int y, int z, unsigned int a6)
{
auto spr = fxSpawn(nFx, nSector, x, y, z, a6);
return spr ? &bloodActors[spr->index] : nullptr;
}
END_BLD_NS

View file

@ -94,6 +94,7 @@ public:
void destroy(int);
void remove(int);
spritetype * fxSpawn(FX_ID, int, int, int, int, unsigned int);
DBloodActor* fxSpawnActor(FX_ID, int, int, int, int, unsigned int);
void fxProcess(void);
};

View file

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "v_font.h"
#include "blood.h"

View file

@ -97,7 +97,7 @@ void levelLoadMapInfo(IniFile* pIni, MapRecord* pLevelInfo, const char* pzSectio
char buffer[16];
pLevelInfo->SetName(pIni->GetKeyString(pzSection, "Title", pLevelInfo->labelName));
pLevelInfo->Author = pIni->GetKeyString(pzSection, "Author", "");
pLevelInfo->music = pIni->GetKeyString(pzSection, "Song", ""); DefaultExtension(pLevelInfo->music, ".mid");
pLevelInfo->music = pIni->GetKeyString(pzSection, "Song", ""); if (pLevelInfo->music.IsNotEmpty()) DefaultExtension(pLevelInfo->music, ".mid");
pLevelInfo->cdSongId = pIni->GetKeyInt(pzSection, "Track", -1);
*nextmap = pIni->GetKeyInt(pzSection, "EndingA", 0);
*nextsecret = pIni->GetKeyInt(pzSection, "EndingB", 0);
@ -193,7 +193,6 @@ void levelLoadDefaults(void)
CheckSectionAbend(pMap);
SetLevelNum(pLevelInfo, makelevelnum(i, j));
pLevelInfo->cluster = i;
pLevelInfo->mapindex = j;
pLevelInfo->labelName = pMap;
if (j == 1) volume->startmap = pLevelInfo->labelName;
pLevelInfo->fileName.Format("%s.map", pMap);
@ -219,12 +218,14 @@ void levelLoadDefaults(void)
if (nmap) map->NextMap = nmap->labelName;
else map->NextMap = "-";
}
else map->NextMap = "-";
if (nextsecrets[j - 1] > 0)
{
auto nmap = FindMapByIndexOnly(i, nextsecrets[j - 1]);
if (nmap) map->NextSecret = nmap->labelName;
else map->NextSecret = "-";
}
else map->NextSecret = "-";
}
}
}
@ -246,7 +247,7 @@ void levelTryPlayMusic()
{
buffer = currentLevel->music;
if (Mus_Play(currentLevel->labelName, buffer, true)) return;
DefaultExtension(buffer, ".mid");
if (buffer.IsNotEmpty()) DefaultExtension(buffer, ".mid");
}
if (!Mus_Play(currentLevel->labelName, buffer, true))
{

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <stdio.h>
#include "build.h"
#include "compat.h"
#include "mmulti.h"
#include "blood.h"
#include "i_specialpaths.h"
@ -643,6 +642,7 @@ void SerializeState(FSerializer& arc)
("cheating", bPlayerCheated)
("skyhoriz", pSky->horizfrac)
("skyy", pSky->yoffs)
("skyy2", pSky->yoffs2)
("scale", pSky->yscale)
.Array("tileofs", pSky->tileofs, countof(pSky->tileofs))
("numtiles", pSky->lognumtiles)

View file

@ -23,7 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else!
#include "build.h"
#include "mmulti.h"
#include "compat.h"
#include "gamecontrol.h"

View file

@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "automap.h"
#include "mmulti.h"
#include "savegamehelp.h"
#include "blood.h"

View file

@ -119,7 +119,7 @@ extern short voxelIndex[MAXTILES];
extern int nPrecacheCount;
int tileInit(char a1, const char *a2);
int tileInit();
void tilePrecacheTile(int nTile, int nType, int palette);
char tileGetSurfType(int hit);

View file

@ -31,7 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifdef NOONE_EXTENSIONS
#include <random>
#include "mmulti.h"
#include "blood.h"
#include "savegamehelp.h"
@ -127,7 +126,7 @@ bool nnExtIsImmune(spritetype* pSprite, int dmgType, int minScale) {
else if (IsDudeSprite(pSprite)) {
if (IsPlayerSprite(pSprite)) return (gPlayer[pSprite->type - kDudePlayer1].damageControl[dmgType]);
else if (pSprite->type == kDudeModernCustom) return (gGenDudeExtra[pSprite->index].dmgControl[dmgType] <= minScale);
else return (getDudeInfo(pSprite->type)->at70[dmgType] <= minScale);
else return (getDudeInfo(pSprite->type)->damageVal[dmgType] <= minScale);
}
}
@ -2336,11 +2335,11 @@ void useSpriteDamager(XSPRITE* pXSource, spritetype* pSprite) {
}
else if (!pPlayer) actKillDude(pSource->index, pSprite, (DAMAGE_TYPE)dmgType, dmg);
else playerDamageSprite(pSource->index, pPlayer, (DAMAGE_TYPE)dmgType, dmg);
else playerDamageSprite(&bloodActors[pSource->index], pPlayer, (DAMAGE_TYPE)dmgType, dmg);
}
else if ((pXSprite->health = ClipLow(pXSprite->health - dmg, 1)) > 16) return;
else if (!pPlayer) actKillDude(pSource->index, pSprite, DAMAGE_TYPE_2, dmg);
else playerDamageSprite(pSource->index, pPlayer, DAMAGE_TYPE_2, dmg);
else playerDamageSprite(&bloodActors[pSource->index], pPlayer, DAMAGE_TYPE_2, dmg);
return;
}
@ -2532,8 +2531,6 @@ void condError(XSPRITE* pXCond, const char* pzFormat, ...) {
bool condCheckMixed(XSPRITE* pXCond, EVENT event, int cmpOp, bool PUSH) {
UNREFERENCED_PARAMETER(PUSH);
//int var = -1;
int cond = pXCond->data1 - kCondMixedBase; int arg1 = pXCond->data2;
int arg2 = pXCond->data3; int arg3 = pXCond->data4;
@ -2812,8 +2809,6 @@ bool condCheckSector(XSPRITE* pXCond, int cmpOp, bool PUSH) {
bool condCheckWall(XSPRITE* pXCond, int cmpOp, bool PUSH) {
UNREFERENCED_PARAMETER(PUSH);
int var = -1;
int cond = pXCond->data1 - kCondWallBase; int arg1 = pXCond->data2;
int arg2 = pXCond->data3; //int arg3 = pXCond->data4;
@ -2929,8 +2924,6 @@ bool condCheckPlayer(XSPRITE* pXCond, int cmpOp, bool PUSH) {
bool condCheckDude(XSPRITE* pXCond, int cmpOp, bool PUSH) {
UNREFERENCED_PARAMETER(cmpOp);
int var = -1; //PLAYER* pPlayer = NULL;
int cond = pXCond->data1 - kCondDudeBase; int arg1 = pXCond->data2;
int arg2 = pXCond->data3; //int arg3 = pXCond->data4;
@ -3026,7 +3019,6 @@ bool condCheckDude(XSPRITE* pXCond, int cmpOp, bool PUSH) {
bool condCheckSprite(XSPRITE* pXCond, int cmpOp, bool PUSH) {
UNREFERENCED_PARAMETER(PUSH);
auto actor = &bloodActors[pXCond->reference];
int var = -1; PLAYER* pPlayer = NULL; bool retn = false;
int cond = pXCond->data1 - kCondSpriteBase; int arg1 = pXCond->data2;
@ -4093,8 +4085,7 @@ void seqTxSendCmdAll(XSPRITE* pXSource, int nIndex, COMMAND_ID cmd, bool modernS
void useRandomTx(XSPRITE* pXSource, COMMAND_ID cmd, bool setState) {
UNREFERENCED_PARAMETER(cmd);
spritetype* pSource = &sprite[pXSource->reference];
int tx = 0; int maxRetries = kMaxRandomizeRetries;

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "compat.h"
#include "mmulti.h"
#include "blood.h"
#include "mapinfo.h"

View file

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "automap.h"
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"
#include "gstrings.h"
@ -582,7 +581,7 @@ void playerSetRace(PLAYER *pPlayer, int nLifeMode)
pPlayer->pSprite->clipdist = pDudeInfo->clipdist;
for (int i = 0; i < 7; i++)
pDudeInfo->at70[i] = MulScale(Handicap[gSkill], pDudeInfo->startDamage[i], 8);
pDudeInfo->damageVal[i] = MulScale(Handicap[gSkill], pDudeInfo->startDamage[i], 8);
}
void playerSetGodMode(PLAYER *pPlayer, bool bGodMode)
@ -661,7 +660,7 @@ void playerStart(int nPlayer, int bNewLevel)
pStartZone = &gStartZone[Random(8)];
}
spritetype *pSprite = actSpawnSprite(pStartZone->sectnum, pStartZone->x, pStartZone->y, pStartZone->z, 6, 1);
spritetype *pSprite = actSpawnSprite_(pStartZone->sectnum, pStartZone->x, pStartZone->y, pStartZone->z, 6, 1);
assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
XSPRITE *pXSprite = &xsprite[pSprite->extra];
pPlayer->pSprite = pSprite;
@ -1741,7 +1740,7 @@ spritetype *playerFireMissile(PLAYER *pPlayer, int a2, int a3, int a4, int a5, i
spritetype * playerFireThing(PLAYER *pPlayer, int a2, int a3, int thingType, int a5)
{
assert(thingType >= kThingBase && thingType < kThingMax);
return actFireThing(pPlayer->pSprite, a2, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->slope+a3, thingType, a5);
return actFireThing_(pPlayer->pSprite, a2, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->slope+a3, thingType, a5);
}
void playerFrag(PLAYER *pKiller, PLAYER *pVictim)
@ -1883,9 +1882,9 @@ spritetype *flagDropped(PLAYER *pPlayer, int a2)
return pSprite;
}
int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, int nDamage)
int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, int nDamage)
{
assert(nSource < kMaxSprites);
int nSource = source ? source->s().index : -1;
assert(pPlayer != NULL);
if (pPlayer->damageControl[nDamageType] || pPlayer->godMode)
return 0;
@ -2116,7 +2115,7 @@ void PlayerKneelsOver(int, DBloodActor* actor)
if (gPlayer[p].pXSprite == pXSprite)
{
PLAYER *pPlayer = &gPlayer[p];
playerDamageSprite(pPlayer->fraggerId, pPlayer, DAMAGE_TYPE_5, 500<<4);
playerDamageSprite(pPlayer->fragger(), pPlayer, DAMAGE_TYPE_5, 500<<4);
return;
}
}

View file

@ -145,6 +145,8 @@ struct PLAYER
int fragInfo[8];
int teamId;
int fraggerId;
DBloodActor* fragger();
void setFragger(DBloodActor*);
int underwaterTime;
int bubbleTime;
int restTime;
@ -272,7 +274,7 @@ void playerFrag(PLAYER *pKiller, PLAYER *pVictim);
void FragPlayer(PLAYER *pPlayer, int nSprite);
int playerDamageArmor(PLAYER *pPlayer, DAMAGE_TYPE nType, int nDamage);
spritetype *flagDropped(PLAYER *pPlayer, int a2);
int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, int nDamage);
int playerDamageSprite(DBloodActor* nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, int nDamage);
int UseAmmo(PLAYER *pPlayer, int nAmmoType, int nDec);
void voodooTarget(PLAYER *pPlayer);
void playerLandingSound(PLAYER *pPlayer);

View file

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "v_font.h"
#include "blood.h"

View file

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "v_font.h"
#include "blood.h"

View file

@ -487,6 +487,12 @@ void seqKillAll()
activeList.clear();
}
void seqKill(DBloodActor* actor)
{
activeList.remove(4, actor->s().extra);
}
//---------------------------------------------------------------------------
//
//
@ -586,6 +592,11 @@ void seqSpawn(int nSeqID, int type, int nXIndex, int callback)
pInst->Update();
}
void seqSpawn(int a1, DBloodActor* actor, int a4)
{
seqSpawn(a1, 3, actor->s().extra, a4);
}
//---------------------------------------------------------------------------
//
//

View file

@ -100,7 +100,10 @@ void seqPrecacheId(int id, int palette);
SEQINST* GetInstance(int a1, int a2);
void UnlockInstance(SEQINST* pInst);
void seqSpawn(int a1, int a2, int a3, int a4 = -1);
void seqSpawn(int a1, DBloodActor* actor, int a4 = -1);
void seqKill(int a1, int a2);
void seqKill(DBloodActor* actor);
void seqKillAll(void);
int seqGetStatus(int a1, int a2);
int seqGetID(int a1, int a2);

View file

@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
bool artLoaded = false;
int nTileFiles = 0;
int tileStart[256];
@ -44,14 +43,8 @@ char surfType[kMaxTiles];
int8_t tileShade[kMaxTiles];
short voxelIndex[kMaxTiles];
int tileInit(char a1, const char *a2)
int tileInit()
{
UNREFERENCED_PARAMETER(a1);
if (artLoaded)
return 1;
for (int i = 0; i < kMaxTiles; i++)
voxelIndex[i] = 0;
auto hFile = fileSystem.OpenFileReader("SURFACE.DAT");
if (hFile.isOpen())
{
@ -76,8 +69,6 @@ int tileInit(char a1, const char *a2)
if (voxelIndex[i] >= 0 && voxelIndex[i] < kMaxVoxels)
voxreserve.Set(voxelIndex[i]);
}
artLoaded = 1;
return 1;
}

View file

@ -26,7 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "compat.h"
#include "mmulti.h"
#include "blood.h"
#include "d_net.h"

View file

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "v_font.h"
#include "blood.h"
@ -341,8 +340,6 @@ void UpdateBlend()
videoTintBlood(nRed, nGreen, nBlue);
}
uint8_t otherMirrorGotpic[2];
uint8_t bakMirrorGotpic[2];
// int gVisibility;
int deliriumTilt, deliriumTurn, deliriumPitch;
@ -543,7 +540,6 @@ void SetupView(int &cX, int& cY, int& cZ, binangle& cA, fixedhoriz& cH, int& nSe
void renderCrystalBall()
{
#if 0
// needs to be redone for pure hardware rendering when MP is working again.
int tmp = (PlayClock / 240) % (gNetPlayers - 1);
int i = connecthead;
while (1)
@ -594,37 +590,7 @@ void renderCrystalBall()
{
v14 = 10;
}
memcpy(bakMirrorGotpic, gotpic + 510, 2);
memcpy(gotpic + 510, otherMirrorGotpic, 2);
g_visibility = (int32_t)(ClipLow(gVisibility - 32 * pOther->visibility, 0));
int vc4, vc8;
getzsofslope(vcc, vd8, vd4, &vc8, &vc4);
if (vd0 >= vc4)
{
vd0 = vc4 - (gUpperLink[vcc] >= 0 ? 0 : (8 << 8));
}
if (vd0 <= vc8)
{
vd0 = vc8 + (gLowerLink[vcc] >= 0 ? 0 : (8 << 8));
}
v54 = ClipRange(v54, -200, 200);
RORHACKOTHER:
int ror_status[16];
for (int i = 0; i < 16; i++)
ror_status[i] = TestBitString(gotpic, 4080 + i);
DrawMirrors(vd8, vd4, vd0, IntToFixed(v50), IntToFixed(v54), gInterpolate, -1);
drawrooms(vd8, vd4, vd0, v50, v54, vcc);
bool do_ror_hack = false;
for (int i = 0; i < 16; i++)
if (ror_status[i] != TestBitString(gotpic, 4080 + i))
do_ror_hack = true;
if (do_ror_hack)
{
spritesortcnt = 0;
goto RORHACKOTHER;
}
memcpy(otherMirrorGotpic, gotpic + 510, 2);
memcpy(gotpic + 510, bakMirrorGotpic, 2);
viewProcessSprites(vd8, vd4, vd0, v50, gInterpolate);
renderDrawMasks();
renderRestoreTarget();
@ -637,10 +603,9 @@ void viewDrawScreen(bool sceneonly)
{
int nPalette = 0;
if (TestBitString(gotpic, 2342))
if (testgotpic(2342, true))
{
FireProcess();
ClearBitString(gotpic, 2342);
}
if (!paused && (!M_Active() || gGameOptions.nGameType != 0))

View file

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <string.h>
#include "compat.h"
#include "build.h"
#include "mmulti.h"
#include "blood.h"
@ -1548,9 +1547,8 @@ void AltFireVoodoo(int nTrigger, PLAYER *pPlayer)
}
}
void DropVoodoo(int nTrigger, PLAYER *pPlayer)
void DropVoodoo(int , PLAYER *pPlayer)
{
UNREFERENCED_PARAMETER(nTrigger);
sfxPlay3DSound(pPlayer->pSprite, 455, 2, 0);
spritetype *pSprite = playerFireThing(pPlayer, 0, -4730, kThingVoodooHead, 0xccccc);
if (pSprite)
@ -1610,9 +1608,8 @@ void FireTesla(int nTrigger, PLAYER *pPlayer)
}
}
void AltFireTesla(int nTrigger, PLAYER *pPlayer)
void AltFireTesla(int , PLAYER *pPlayer)
{
UNREFERENCED_PARAMETER(nTrigger);
spritetype *pSprite = pPlayer->pSprite;
playerFireMissile(pPlayer, 0, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileTeslaAlt);
UseAmmo(pPlayer, pPlayer->weaponAmmo, 35);
@ -1640,9 +1637,8 @@ void FireNapalm(int nTrigger, PLAYER *pPlayer)
pPlayer->flashEffect = 1;
}
void FireNapalm2(int nTrigger, PLAYER *pPlayer)
void FireNapalm2(int , PLAYER *pPlayer)
{
UNREFERENCED_PARAMETER(nTrigger);
spritetype *pSprite = pPlayer->pSprite;
playerFireMissile(pPlayer, -120, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFireballNapam);
playerFireMissile(pPlayer, 120, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFireballNapam);
@ -1651,9 +1647,8 @@ void FireNapalm2(int nTrigger, PLAYER *pPlayer)
pPlayer->flashEffect = 1;
}
void AltFireNapalm(int nTrigger, PLAYER *pPlayer)
void AltFireNapalm(int , PLAYER *pPlayer)
{
UNREFERENCED_PARAMETER(nTrigger);
int nSpeed = MulScale(0x8000, 0x177777, 16)+0x66666;
spritetype *pMissile = playerFireThing(pPlayer, 0, -4730, kThingNapalmBall, nSpeed);
if (pMissile)
@ -1691,9 +1686,8 @@ void FireLifeLeech(int nTrigger, PLAYER *pPlayer)
pPlayer->visibility = ClipHigh(pPlayer->visibility+5, 50);
}
void AltFireLifeLeech(int nTrigger, PLAYER *pPlayer)
void AltFireLifeLeech(int , PLAYER *pPlayer)
{
UNREFERENCED_PARAMETER(nTrigger);
sfxPlay3DSound(pPlayer->pSprite, 455, 2, 0);
spritetype *pMissile = playerFireThing(pPlayer, 0, -4730, kThingDroppedLifeLeech, 0x19999);
if (pMissile)
@ -1726,9 +1720,8 @@ void AltFireLifeLeech(int nTrigger, PLAYER *pPlayer)
}
}
void FireBeast(int nTrigger, PLAYER * pPlayer)
void FireBeast(int , PLAYER * pPlayer)
{
UNREFERENCED_PARAMETER(nTrigger);
int r1 = Random2(2000);
int r2 = Random2(2000);
int r3 = Random2(2000);

View file

@ -15,8 +15,7 @@ void SE40_Draw(int tag, spritetype *spr, int x, int y, int z, binangle a, fixedh
i = FOF; //Effect TILE
tileDelete(FOF);
if (!(gotpic[i >> 3] & (1 << (i & 7)))) return;
gotpic[i >> 3] &= ~(1 << (i & 7));
if (!testgotpic(FOF, true)) return;
floor1 = spr;
@ -165,7 +164,7 @@ void se40code(int x, int y, int z, binangle a, fixedhoriz h, int smoothratio)
void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz choriz, int smoothratio)
{
if ((gotpic[TILE_MIRROR >> 3] & (1 << (TILE_MIRROR & 7))) > 0)
if (testgotpic(TILE_MIRROR, true))
{
int dst = 0x7fffffff, i = 0;
for (int k = 0; k < mirrorcnt; k++)
@ -194,7 +193,6 @@ void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz cho
renderCompleteMirror(); //Reverse screen x-wise in this function
g_visibility = j;
}
gotpic[TILE_MIRROR >> 3] &= ~(1 << (TILE_MIRROR & 7));
}
}

View file

@ -563,9 +563,8 @@ void thunder(void)
if (!thunderflash)
{
if ((gotpic[RRTILE2577 >> 3] & (1 << (RRTILE2577 & 7))) > 0)
if (testgotpic(RRTILE2577, true))
{
gotpic[RRTILE2577 >> 3] &= ~(1 << (RRTILE2577 & 7));
g_visibility = 256; // this is an engine variable
if (krand() > 65000)
{
@ -593,9 +592,8 @@ void thunder(void)
}
if (!winderflash)
{
if ((gotpic[RRTILE2562 >> 3] & (1 << (RRTILE2562 & 7))) > 0)
if (testgotpic(RRTILE2562, true))
{
gotpic[RRTILE2562 >> 3] &= ~(1 << (RRTILE2562 & 7));
if (krand() > 65000)
{
winderflash = 1;

View file

@ -29,7 +29,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
#include "ns.h"
#include "global.h"
#include "names_r.h"
#include "mmulti.h"
#include "mapinfo.h"
#include "dukeactor.h"

View file

@ -136,10 +136,4 @@ void GameInterface::DrawPlayerSprite(const DVector2& origin, bool onteam)
DrawTexture(twod, tex, x, y, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TranslationIndex, color, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE);
}
void GameInterface::QuitToTitle()
{
gameaction = ga_startup;
}
END_DUKE_NS

View file

@ -40,7 +40,6 @@ struct GameInterface : public ::GameInterface
FSavegameInfo GetSaveSig() override;
double SmallFontScale() override { return isRR() ? 0.5 : 1.; }
void SerializeGameState(FSerializer& arc) override;
void QuitToTitle() override;
FString GetCoordString() override;
void ExitFromMenu() override;
ReservedSpace GetReservedScreenSpace(int viewsize) override;

View file

@ -219,6 +219,12 @@ static void setupbackdrop()
}
}
}
if (isNam())
{
defineSky(212, 65536, 3, pskyoff, 0, 140);
defineSky(225, 65536, 3, pskyoff, 0, 140);
}
}
//---------------------------------------------------------------------------

View file

@ -1728,7 +1728,6 @@ int ConCompiler::parsecommand()
SetLevelNum(map, makelevelnum(j + 1, k + 1));
map->mapindex = k + 1;
map->cluster = j + 1;
textptr += 5;
@ -3236,7 +3235,7 @@ void loadcons()
{
if (map->cluster == 1)
{
if (!FindMapByIndexOnly(map->cluster, map->mapindex + 1))
if (!FindMapByLevelNum(map->levelNumber + 1))
{
auto nextmap = FindMapByIndexOnly(map->cluster + 1, 1);
if (nextmap)

View file

@ -37,7 +37,6 @@ source as it is released.
#include "serializer.h"
#include "names.h"
#include "build.h"
#include "mmulti.h"
#include "gamevar.h"
#include "mapinfo.h"

View file

@ -3,7 +3,6 @@
#include "build.h"
#include "compat.h"
#include "duke3d.h"
#include "mmulti.h"
#include "quotemgr.h"
#include "sounds.h"
#include "constants.h"

View file

@ -824,7 +824,7 @@ static void SpawnPortals()
{
for (int i = 0; i < numwalls; i++)
{
if (wall[i].overpicnum == TILE_MIRROR) wall[i].portalflags |= PORTAL_WALL_MIRROR;
if (wall[i].overpicnum == TILE_MIRROR && (wall[i].cstat & CSTAT_WALL_1WAY)) wall[i].portalflags |= PORTAL_WALL_MIRROR;
}
portalClear();

View file

@ -994,7 +994,11 @@ void spawneffector(DDukeActor* actor)
}
if (!found)
{
I_Error("Found lonely Sector Effector (lotag 0) at (%d,%d)\n", sp->x, sp->y);
sp->picnum = 0;
sp->cstat = CSTAT_SPRITE_NOFIND;
changespritesect(actor, STAT_REMOVED);
Printf("Found lonely Sector Effector (lotag 0) at (%d,%d)\n", sp->x, sp->y);
return;
}
}

View file

@ -39,7 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "d_protocol.h"
#include "gstrings.h"
#include "aistuff.h"
#include "mmulti.h"
#include "d_net.h"
BEGIN_PS_NS

View file

@ -67,11 +67,6 @@ void GameInterface::MenuSound(EMenuSounds snd)
}
}
void GameInterface::QuitToTitle()
{
gameaction = ga_mainmenu;
}
FSavegameInfo GameInterface::GetSaveSig()
{
return { SAVESIG_PS, MINSAVEVER_PS, SAVEVER_PS };

View file

@ -225,7 +225,6 @@ struct GameInterface : ::GameInterface
void SerializeGameState(FSerializer& arc);
bool CanSave() override;
ReservedSpace GetReservedScreenSpace(int viewsize) override { return { 0, 24 }; }
void QuitToTitle() override;
void UpdateSounds() override;
void ErrorCleanup() override;
void Ticker() override;

View file

@ -79,7 +79,7 @@ void GameInterface::Render()
DrawView(smoothratio);
DrawStatusBar();
DrawCrosshair(MAXTILES, PlayerList[nLocalPlayer].nHealth >> 3, -PlayerList[nLocalPlayer].angle.look_anghalf(smoothratio), 0, 1);
DrawCrosshair(kCrosshairTile, PlayerList[nLocalPlayer].nHealth >> 3, -PlayerList[nLocalPlayer].angle.look_anghalf(smoothratio), 0, 1);
if (paused && !M_Active())
{

View file

@ -156,6 +156,7 @@ uint8_t LoadLevel(MapRecord* map)
pSky->tileofs[2] = 0;
pSky->tileofs[3] = 0;
pSky->yoffs = 256;
pSky->yoffs2 = 256;
pSky->lognumtiles = 2;
pSky->horizfrac = 65536;
pSky->yscale = 65536;

View file

@ -23,7 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "view.h"
#include "v_2ddrawer.h"
#include "automap.h"
#include "mmulti.h"
#include "v_draw.h"
BEGIN_PS_NS

Some files were not shown because too many files have changed in this diff Show more