Merge branch 'back_to_basics2' into InputStuffs

# Conflicts:
#	source/core/d_net.cpp
This commit is contained in:
Mitchell Richters 2020-09-09 06:56:27 +10:00
commit b72a3326d0
162 changed files with 905 additions and 901 deletions

View file

@ -1,14 +1,11 @@
### Raze programming:
* Christoph Oelckers
* Christoph Oelckers, Mitchell Richters
### Raze special thanks:
* Rachael, dpJudas, Enjay, Nash
* sinisterseed, Rachael, dpJudas, Enjay, Nash
### EDuke32 engine & game programming:
* TerminX
* Hendricks266
* pogokeen
* Plagman
### EDuke32 engine:
* TerminX, Hendricks266, pogokeen, Plagman
* Helixhorned
### JFDuke3D by:
@ -18,24 +15,28 @@
* Ken Silverman
### NBlood programming:
* Nuke.YKT
* NoOne
* sirlemonhead
* Nuke.YKT, NoOne, sirlemonhead
### Widescreen tiles & NBlood logo:
### Blood Widescreen tiles
* Maxi Clouds
### NBlood special thanks:
* NY00123, MetHy, Striker, oasiz, Mblackwell, Zombie, Marphy Black, SAmik37, meleemario
### NBlood contributors:
* alexey-lysiuk, CommonLoon102, Jan200101
### VoidSW programming
* Hendricks266, NY00123, TerminX
### PCExhumed programming:
* sirlemonhead
* Nuke.YKT
* NY00123
* sirlemonhead, Nuke.YKT, NY00123
### PCExhumed special thanks:
* Hendricks266, JonoF, NY00123, MetHy, oasiz, Daedolon, NoOne, phredreeke, Lobotomy Software
### Exhumed BigFont
* Dynamo
## BuildGDX
* M210

View file

@ -2,17 +2,27 @@
[![Build Status](https://github.com/coelckers/Raze/workflows/Continuous%20Integration/badge.svg)](https://github.com/coelckers/Raze/actions?query=workflow%3A%22Continuous+Integration%22)
## Raze is a fork of EDuke32 backed by GZDoom tech and combines EDuke32, PCExhumed, NBlood, and RedNukem in a single package.
## Raze is a fork of Build engine games backed by GZDoom tech and combines Duke Nukem 3D, Blood, Redneck Rampage, Shadow Warrior and Exhumed/Powerslave in a single package. It is also capable of playing Nam and WW2 GI.
Copyright (c) 1998-2020 ZDoom + GZDoom teams, and contributors
The game modules are based on the following sources:
* Duke Nukem: JFDuke, EDuke 2.0, World Tour extensions from DukeGDX and some minor fixes from EDuke32.
* Redneck Rampage: Nuke.YKT's reconstructed source available in the Rednukem Git repo.
* Blood: NBlood.
* Shadow Warrior: SWP and VoidSW.
* Exhumed/Powerslave: PCExhumed, with some enhancements inspired by PowerslaveGDX.
ZDoom, GZDoom Copyright (c) 1998-2020 ZDoom + GZDoom teams, and contributors
Doom Source (c) 1997 id Software, Raven Software, and contributors
EDuke32 Source (c) 2005-2020 EDuke32 teams, and contributors
EDuke32 and VoidSW Source (c) 2005-2020 EDuke32 teams, and contributors
NBlood source (c) 2019 Nuke.YKT
NBlood source (c) 2019-2020 Nuke.YKT
PCExhumed source (c) 2019 sirlemonhead, Nuke.YKT
PCExhumed source (c) 2019-2020 sirlemonhead, Nuke.YKT
BuildGDX (c) 2020
Duke Nukem 3D Source (c) 1996-2003 3D Realms

View file

@ -29,7 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "automap.h"
#include "pragmas.h"
#include "mmulti.h"
#include "common.h"
#include "common_game.h"
#include "actor.h"

View file

@ -26,7 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "mmulti.h"
#include "compat.h"
#include "common.h"
#include "common_game.h"
#include "g_input.h"
#include "automap.h"
@ -63,6 +62,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "choke.h"
#include "d_net.h"
#include "v_video.h"
#include "statusbar.h"
BEGIN_BLD_NS
@ -242,7 +242,7 @@ void StartLevel(MapRecord* level)
paused = 0;
levelTryPlayMusic();
gChoke.reset();
Printf(TEXTCOLOR_GOLD "%s: %s\n", level->LabelName(), level->DisplayName());
setLevelStarted(level);
}

View file

@ -23,7 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#pragma once
#include "build.h"
#include "common.h"
#include "pragmas.h"
#include "misc.h"
#include "printf.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 "compat.h"
#include "common.h"
#include "blood.h"
#include "dude.h"

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 "common.h"
#include "mmulti.h"
#include "common_game.h"
#include "blood.h"

View file

@ -354,13 +354,13 @@ void fxSpawnEjectingShell(spritetype *pSprite, int z, int a3, int a4)
}
}
void fxPrecache(void)
void fxPrecache(HitList &hits)
{
for (int i = 0; i < kFXMax; i++)
{
tilePrecacheTile(gFXData[i].at12, 0);
tilePrecacheTile(gFXData[i].at12, 0, hits);
if (gFXData[i].at2)
seqPrecacheId(gFXData[i].at2);
seqPrecacheId(gFXData[i].at2, hits);
}
}

View file

@ -102,8 +102,6 @@ void sub_746D4(spritetype *pSprite, int a2);
void fxSpawnEjectingBrass(spritetype *pSprite, int z, int a3, int a4);
void fxSpawnEjectingShell(spritetype *pSprite, int z, int a3, int a4);
void fxPrecache(void);
extern CFX gFX;
END_BLD_NS

View file

@ -511,7 +511,7 @@ void GibWall(int nWall, GIBTYPE nGibType, CGibVelocity *pVel)
}
}
void gibPrecache(void)
void gibPrecache(HitList &hits)
{
for (int i = 0; i < kGibMax; i++)
{
@ -521,7 +521,7 @@ void gibPrecache(void)
for (int j = 0; j < gibList[i].atc; j++)
{
if (pThing[j].Kills >= 0)
tilePrecacheTile(pThing[j].Kills);
tilePrecacheTile(pThing[j].Kills, -1, hits);
}
}
}

View file

@ -74,5 +74,4 @@ public:
void GibSprite(spritetype *pSprite, GIBTYPE nGibType, CGibPosition *pPos, CGibVelocity *pVel);
//void GibFX(int nWall, GIBFX * pGFX, int a3, int a4, int a5, int a6, CGibVelocity * pVel);
void GibWall(int nWall, GIBTYPE nGibType, CGibVelocity *pVel);
void gibPrecache(void);
END_BLD_NS

View file

@ -64,7 +64,7 @@ void levelInitINI(const char *pzIni)
if (!fileSystem.FileExists(pzIni))
ThrowError("Initialization: %s does not exist", pzIni);
BloodINI = new IniFile(pzIni);
Bstrncpy(BloodIniFile, pzIni, BMAX_PATH);
strncpy(BloodIniFile, pzIni, BMAX_PATH);
}

View file

@ -22,11 +22,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//-------------------------------------------------------------------------
#pragma once
#include "common.h"
#include "build.h"
#include "m_fixed.h"
#include "filesystem.h"
BEGIN_BLD_NS
using HitList = FixedBitArray<MAXTILES>;
void playlogos();
unsigned int qrand(void);
int wrand(void);
@ -56,7 +59,7 @@ void WeaponProcess(PLAYER *pPlayer);
void WeaponUpdateState(PLAYER* pPlayer);
void sub_51340(spritetype *pMissile, int a2);
void StartQAV(PLAYER* pPlayer, int nWeaponQAV, int a3 = -1, char a4 = 0);
void WeaponPrecache(void);
void WeaponPrecache(HitList &hits);
struct ZONE {
int x, y, z;
@ -121,13 +124,12 @@ extern signed char tileShade[MAXTILES];
extern short voxelIndex[MAXTILES];
extern int nPrecacheCount;
extern char precachehightile[2][(MAXTILES+7)>>3];
int tileInit(char a1, const char *a2);
void tileProcessGLVoxels(void);
void tilePreloadTile(int nTile);
void tilePrecacheTile(int nTile, int nType, HitList& hits);
void tilePrecacheTile(int nTile, int nType = 1);
char tileGetSurfType(int hit);
void scrLoadPalette(void);

View file

@ -33,36 +33,139 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
#define gotpic blafasl
int nPrecacheCount;
void fxPrecache(HitList &hits);
void gibPrecache(HitList &hits);
void tilePreloadTile(int nTile)
{
if (!r_precache) return;
int n = 1;
switch (picanm[nTile].extra & 7)
{
case 0:
n = 1;
break;
case 1:
n = 5;
break;
case 2:
n = 8;
break;
case 3:
n = 2;
break;
case 6:
case 7:
if (voxelIndex[nTile] < 0 || voxelIndex[nTile] >= kMaxVoxels)
{
voxelIndex[nTile] = -1;
picanm[nTile].extra &= ~7;
}
break;
}
while (n--)
{
if (picanm[nTile].sf & PICANM_ANIMTYPE_MASK)
{
for (int frame = picanm[nTile].num; frame >= 0; frame--)
{
if ((picanm[nTile].sf & PICANM_ANIMTYPE_MASK) == PICANM_ANIMTYPE_BACK)
PrecacheHardwareTextures(nTile - frame);
else
PrecacheHardwareTextures(nTile + frame);
}
}
else
PrecacheHardwareTextures(nTile);
nTile += 1 + picanm[nTile].num;
}
}
void tilePrecacheTile(int nTile, int nType, HitList &hits)
{
int n = 1;
switch (picanm[nTile].extra & 7)
{
case 0:
n = 1;
break;
case 1:
n = 5;
break;
case 2:
n = 8;
break;
case 3:
n = 2;
break;
}
while (n--)
{
if (picanm[nTile].sf & PICANM_ANIMTYPE_MASK)
{
for (int frame = picanm[nTile].num; frame >= 0; frame--)
{
int tile;
if ((picanm[nTile].sf & PICANM_ANIMTYPE_MASK) == PICANM_ANIMTYPE_BACK)
tile = nTile - frame;
else
tile = nTile + frame;
if (!hits[tile])
{
nPrecacheCount++;
hits.Set(tile);
}
}
}
else
{
if (!hits[nTile])
{
nPrecacheCount++;
hits.Set(nTile);
}
}
nTile += 1 + picanm[nTile].num;
}
}
// To do: This needs to handle the sprite palettes as well to properly precache the needed content.
void viewPrecacheTiles(void)
void viewPrecacheTiles(HitList &hits)
{
tilePrecacheTile(2173, 0);
tilePrecacheTile(2200, 0);
tilePrecacheTile(2201, 0);
tilePrecacheTile(2202, 0);
tilePrecacheTile(2207, 0);
tilePrecacheTile(2208, 0);
tilePrecacheTile(2209, 0);
tilePrecacheTile(2229, 0);
tilePrecacheTile(2260, 0);
tilePrecacheTile(2559, 0);
tilePrecacheTile(2169, 0);
tilePrecacheTile(2578, 0);
tilePrecacheTile(2586, 0);
tilePrecacheTile(2602, 0);
tilePrecacheTile(2173, 0, hits);
tilePrecacheTile(2200, 0, hits);
tilePrecacheTile(2201, 0, hits);
tilePrecacheTile(2202, 0, hits);
tilePrecacheTile(2207, 0, hits);
tilePrecacheTile(2208, 0, hits);
tilePrecacheTile(2209, 0, hits);
tilePrecacheTile(2229, 0, hits);
tilePrecacheTile(2260, 0, hits);
tilePrecacheTile(2559, 0, hits);
tilePrecacheTile(2169, 0, hits);
tilePrecacheTile(2578, 0, hits);
tilePrecacheTile(2586, 0, hits);
tilePrecacheTile(2602, 0, hits);
for (int i = 0; i < 10; i++)
{
tilePrecacheTile(2190 + i, 0);
tilePrecacheTile(2230 + i, 0);
tilePrecacheTile(2240 + i, 0);
tilePrecacheTile(2250 + i, 0);
tilePrecacheTile(kSBarNumberHealth + i, 0);
tilePrecacheTile(kSBarNumberAmmo + i, 0);
tilePrecacheTile(kSBarNumberInv + i, 0);
tilePrecacheTile(kSBarNumberArmor1 + i, 0);
tilePrecacheTile(kSBarNumberArmor2 + i, 0);
tilePrecacheTile(kSBarNumberArmor3 + i, 0);
tilePrecacheTile(2190 + i, 0, hits);
tilePrecacheTile(2230 + i, 0, hits);
tilePrecacheTile(2240 + i, 0, hits);
tilePrecacheTile(2250 + i, 0, hits);
tilePrecacheTile(kSBarNumberHealth + i, 0, hits);
tilePrecacheTile(kSBarNumberAmmo + i, 0, hits);
tilePrecacheTile(kSBarNumberInv + i, 0, hits);
tilePrecacheTile(kSBarNumberArmor1 + i, 0, hits);
tilePrecacheTile(kSBarNumberArmor2 + i, 0, hits);
tilePrecacheTile(kSBarNumberArmor3 + i, 0, hits);
}
/*
for (int i = 0; i < 5; i++)
@ -73,54 +176,54 @@ void viewPrecacheTiles(void)
*/
for (int i = 0; i < 6; i++)
{
tilePrecacheTile(2220 + i, 0);
tilePrecacheTile(2552 + i, 0);
tilePrecacheTile(2220 + i, 0, hits);
tilePrecacheTile(2552 + i, 0, hits);
}
}
void PrecacheDude(spritetype *pSprite)
void PrecacheDude(spritetype *pSprite, HitList &hits)
{
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
seqPrecacheId(pDudeInfo->seqStartID);
seqPrecacheId(pDudeInfo->seqStartID+5);
seqPrecacheId(pDudeInfo->seqStartID+1);
seqPrecacheId(pDudeInfo->seqStartID+2);
seqPrecacheId(pDudeInfo->seqStartID , hits);
seqPrecacheId(pDudeInfo->seqStartID+5, hits);
seqPrecacheId(pDudeInfo->seqStartID+1, hits);
seqPrecacheId(pDudeInfo->seqStartID+2, hits);
switch (pSprite->type)
{
case kDudeCultistTommy:
case kDudeCultistShotgun:
case kDudeCultistTesla:
case kDudeCultistTNT:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+8);
seqPrecacheId(pDudeInfo->seqStartID+9);
seqPrecacheId(pDudeInfo->seqStartID+13);
seqPrecacheId(pDudeInfo->seqStartID+14);
seqPrecacheId(pDudeInfo->seqStartID+15);
seqPrecacheId(pDudeInfo->seqStartID+6 , hits);
seqPrecacheId(pDudeInfo->seqStartID+7 , hits);
seqPrecacheId(pDudeInfo->seqStartID+8 , hits);
seqPrecacheId(pDudeInfo->seqStartID+9 , hits);
seqPrecacheId(pDudeInfo->seqStartID+13, hits);
seqPrecacheId(pDudeInfo->seqStartID+14, hits);
seqPrecacheId(pDudeInfo->seqStartID+15, hits);
break;
case kDudeZombieButcher:
case kDudeGillBeast:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+8);
seqPrecacheId(pDudeInfo->seqStartID+9);
seqPrecacheId(pDudeInfo->seqStartID+10);
seqPrecacheId(pDudeInfo->seqStartID+11);
seqPrecacheId(pDudeInfo->seqStartID+6, hits);
seqPrecacheId(pDudeInfo->seqStartID+7, hits);
seqPrecacheId(pDudeInfo->seqStartID+8, hits);
seqPrecacheId(pDudeInfo->seqStartID+9, hits);
seqPrecacheId(pDudeInfo->seqStartID+10, hits);
seqPrecacheId(pDudeInfo->seqStartID+11, hits);
break;
case kDudeGargoyleStatueFlesh:
case kDudeGargoyleStatueStone:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+6, hits);
seqPrecacheId(pDudeInfo->seqStartID+6, hits); //???
fallthrough__;
case kDudeGargoyleFlesh:
case kDudeGargoyleStone:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+8);
seqPrecacheId(pDudeInfo->seqStartID+9);
seqPrecacheId(pDudeInfo->seqStartID+6, hits);
seqPrecacheId(pDudeInfo->seqStartID+7, hits);
seqPrecacheId(pDudeInfo->seqStartID+8, hits);
seqPrecacheId(pDudeInfo->seqStartID+9, hits);
break;
case kDudePhantasm:
case kDudeHellHound:
@ -129,88 +232,88 @@ void PrecacheDude(spritetype *pSprite)
case kDudeSpiderBlack:
case kDudeSpiderMother:
case kDudeTchernobog:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+8);
seqPrecacheId(pDudeInfo->seqStartID+6, hits);
seqPrecacheId(pDudeInfo->seqStartID+7, hits);
seqPrecacheId(pDudeInfo->seqStartID+8, hits);
break;
case kDudeCerberusTwoHead:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+6, hits);
seqPrecacheId(pDudeInfo->seqStartID+7, hits);
fallthrough__;
case kDudeHand:
case kDudeBoneEel:
case kDudeBat:
case kDudeRat:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+6, hits);
seqPrecacheId(pDudeInfo->seqStartID+7, hits);
break;
case kDudeCultistBeast:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+6, hits);
break;
case kDudeZombieAxeBuried:
seqPrecacheId(pDudeInfo->seqStartID+12);
seqPrecacheId(pDudeInfo->seqStartID+9);
seqPrecacheId(pDudeInfo->seqStartID+12, hits);
seqPrecacheId(pDudeInfo->seqStartID+9, hits);
fallthrough__;
case kDudeZombieAxeLaying:
seqPrecacheId(pDudeInfo->seqStartID+10);
seqPrecacheId(pDudeInfo->seqStartID+10, hits);
fallthrough__;
case kDudeZombieAxeNormal:
seqPrecacheId(pDudeInfo->seqStartID+6);
seqPrecacheId(pDudeInfo->seqStartID+7);
seqPrecacheId(pDudeInfo->seqStartID+8);
seqPrecacheId(pDudeInfo->seqStartID+11);
seqPrecacheId(pDudeInfo->seqStartID+13);
seqPrecacheId(pDudeInfo->seqStartID+14);
seqPrecacheId(pDudeInfo->seqStartID+6, hits);
seqPrecacheId(pDudeInfo->seqStartID+7, hits);
seqPrecacheId(pDudeInfo->seqStartID+8, hits);
seqPrecacheId(pDudeInfo->seqStartID+11, hits);
seqPrecacheId(pDudeInfo->seqStartID+13, hits);
seqPrecacheId(pDudeInfo->seqStartID+14, hits);
break;
}
}
void PrecacheThing(spritetype *pSprite) {
void PrecacheThing(spritetype *pSprite, HitList &hits) {
switch (pSprite->type) {
case kThingGlassWindow: // worthless...
case kThingFluorescent:
seqPrecacheId(12);
seqPrecacheId(12, hits);
break;
case kThingSpiderWeb:
seqPrecacheId(15);
seqPrecacheId(15, hits);
break;
case kThingMetalGrate:
seqPrecacheId(21);
seqPrecacheId(21, hits);
break;
case kThingFlammableTree:
seqPrecacheId(25);
seqPrecacheId(26);
seqPrecacheId(25, hits);
seqPrecacheId(26, hits);
break;
case kTrapMachinegun:
seqPrecacheId(38);
seqPrecacheId(40);
seqPrecacheId(28);
seqPrecacheId(38, hits);
seqPrecacheId(40, hits);
seqPrecacheId(28, hits);
break;
case kThingObjectGib:
//case kThingObjectExplode: weird that only gib object is precached and this one is not
break;
}
tilePrecacheTile(pSprite->picnum);
tilePrecacheTile(pSprite->picnum, -1, hits);
}
void PreloadTiles(void)
void PreloadTiles(HitList & hits)
{
nPrecacheCount = 0;
int skyTile = -1;
memset(gotpic,0,sizeof(gotpic));
hits.Zero();
// Fonts
for (int i = 0; i < numsectors; i++)
{
tilePrecacheTile(sector[i].floorpicnum, 0);
tilePrecacheTile(sector[i].ceilingpicnum, 0);
tilePrecacheTile(sector[i].floorpicnum, 0, hits);
tilePrecacheTile(sector[i].ceilingpicnum, 0, hits);
if ((sector[i].ceilingstat&1) != 0 && skyTile == -1)
skyTile = sector[i].ceilingpicnum;
}
for (int i = 0; i < numwalls; i++)
{
tilePrecacheTile(wall[i].picnum, 0);
tilePrecacheTile(wall[i].picnum, 0, hits);
if (wall[i].overpicnum >= 0)
tilePrecacheTile(wall[i].overpicnum, 0);
tilePrecacheTile(wall[i].overpicnum, 0, hits);
}
for (int i = 0; i < kMaxSprites; i++)
{
@ -220,13 +323,13 @@ void PreloadTiles(void)
switch (pSprite->statnum)
{
case kStatDude:
PrecacheDude(pSprite);
PrecacheDude(pSprite, hits);
break;
case kStatThing:
PrecacheThing(pSprite);
PrecacheThing(pSprite, hits);
break;
default:
tilePrecacheTile(pSprite->picnum);
tilePrecacheTile(pSprite->picnum, -1, hits);
break;
}
}
@ -235,49 +338,50 @@ void PreloadTiles(void)
// Precache common SEQs
for (int i = 0; i < 100; i++)
{
seqPrecacheId(i);
seqPrecacheId(i, hits);
}
tilePrecacheTile(1147); // water drip
tilePrecacheTile(1160); // blood drip
tilePrecacheTile(1147, -1, hits); // water drip
tilePrecacheTile(1160, -1, hits); // blood drip
// Player SEQs
seqPrecacheId(dudeInfo[31].seqStartID+6);
seqPrecacheId(dudeInfo[31].seqStartID+7);
seqPrecacheId(dudeInfo[31].seqStartID+8);
seqPrecacheId(dudeInfo[31].seqStartID+9);
seqPrecacheId(dudeInfo[31].seqStartID+10);
seqPrecacheId(dudeInfo[31].seqStartID+14);
seqPrecacheId(dudeInfo[31].seqStartID+15);
seqPrecacheId(dudeInfo[31].seqStartID+12);
seqPrecacheId(dudeInfo[31].seqStartID+16);
seqPrecacheId(dudeInfo[31].seqStartID+17);
seqPrecacheId(dudeInfo[31].seqStartID+18);
seqPrecacheId(dudeInfo[31].seqStartID+6, hits);
seqPrecacheId(dudeInfo[31].seqStartID+7, hits);
seqPrecacheId(dudeInfo[31].seqStartID+8, hits);
seqPrecacheId(dudeInfo[31].seqStartID+9, hits);
seqPrecacheId(dudeInfo[31].seqStartID+10, hits);
seqPrecacheId(dudeInfo[31].seqStartID+14, hits);
seqPrecacheId(dudeInfo[31].seqStartID+15, hits);
seqPrecacheId(dudeInfo[31].seqStartID+12, hits);
seqPrecacheId(dudeInfo[31].seqStartID+16, hits);
seqPrecacheId(dudeInfo[31].seqStartID+17, hits);
seqPrecacheId(dudeInfo[31].seqStartID+18, hits);
if (skyTile > -1 && skyTile < kMaxTiles)
{
for (int i = 1; i < gSkyCount; i++)
tilePrecacheTile(skyTile+i, 0);
tilePrecacheTile(skyTile+i, 0, hits);
}
WeaponPrecache();
viewPrecacheTiles();
fxPrecache();
gibPrecache();
WeaponPrecache(hits);
viewPrecacheTiles(hits);
fxPrecache(hits);
gibPrecache(hits);
I_GetEvent();
}
void PreloadCache(void)
void PreloadCache()
{
if (!r_precache) return;
PreloadTiles();
HitList hits;
PreloadTiles(hits);
int cnt = 0;
int percentDisplayed = -1;
for (int i = 0; i < kMaxTiles; i++)
{
if (TestBitString(gotpic, i))
if (hits[i])
{
PrecacheHardwareTextures(i);
@ -285,7 +389,6 @@ void PreloadCache(void)
I_GetEvent();
}
}
memset(gotpic,0,sizeof(gotpic));
}
END_BLD_NS

View file

@ -170,14 +170,14 @@ void QAV::Preload(void)
}
}
void QAV::Precache(void)
void QAV::Precache(HitList &hits)
{
for (int i = 0; i < nFrames; i++)
{
for (int j = 0; j < 8; j++)
{
if (frames[i].tiles[j].picnum >= 0)
tilePrecacheTile(frames[i].tiles[j].picnum, 0);
tilePrecacheTile(frames[i].tiles[j].picnum, 0, hits);
}
}
}

View file

@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h"
#include "common_game.h"
#include "blood.h"
#include "misc.h"
class F2DDrawer;
@ -85,7 +86,7 @@ struct QAV
void Draw(double x, double y, int ticks, int stat, int shade, int palnum, bool in3dscene);
void Play(int, int, int, void *);
void Preload(void);
void Precache(void);
void Precache(HitList &hits);
void PlaySound(int nSound);
void PlaySound3D(spritetype *pSprite, int nSound, int a3, int a4);

View file

@ -66,20 +66,20 @@ void Seq::Preload(void)
tilePreloadTile(seqGetTile(&frames[i]));
}
void Seq::Precache(void)
void Seq::Precache(HitList &hits)
{
if (memcmp(signature, "SEQ\x1a", 4) != 0)
ThrowError("Invalid sequence");
if ((version & 0xff00) != 0x300)
ThrowError("Obsolete sequence version");
for (int i = 0; i < nFrames; i++)
tilePrecacheTile(seqGetTile(&frames[i]));
tilePrecacheTile(seqGetTile(&frames[i]), -1, hits);
}
void seqPrecacheId(int id)
void seqPrecacheId(int id, HitList &hits)
{
auto pSeq = getSequence(id);
if (pSeq) pSeq->Precache();
if (pSeq) pSeq->Precache(hits);
}
SEQINST siWall[kMaxXWalls];

View file

@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//-------------------------------------------------------------------------
#pragma once
#include "misc.h"
BEGIN_BLD_NS
@ -58,7 +59,7 @@ struct Seq {
int atc;
SEQFRAME frames[1];
void Preload(void);
void Precache(void);
void Precache(HitList &);
};
struct ACTIVE
@ -84,7 +85,7 @@ inline int seqGetTile(SEQFRAME* pFrame)
}
int seqRegisterClient(void(*pClient)(int, int));
void seqPrecacheId(int id);
void seqPrecacheId(int id, HitList &hits);
SEQINST * GetInstance(int a1, int a2);
void UnlockInstance(SEQINST *pInst);
void seqSpawn(int a1, int a2, int a3, int a4 = -1);

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 "common.h"
#include "common_game.h"
#include "blood.h"
@ -112,105 +111,6 @@ void tileProcessGLVoxels(void)
}
#endif
void tilePreloadTile(int nTile)
{
if (!r_precache) return;
int n = 1;
switch (picanm[nTile].extra&7)
{
case 0:
n = 1;
break;
case 1:
n = 5;
break;
case 2:
n = 8;
break;
case 3:
n = 2;
break;
case 6:
case 7:
if (voxelIndex[nTile] < 0 || voxelIndex[nTile] >= kMaxVoxels)
{
voxelIndex[nTile] = -1;
picanm[nTile].extra &= ~7;
}
break;
}
while(n--)
{
if (picanm[nTile].sf&PICANM_ANIMTYPE_MASK)
{
for (int frame = picanm[nTile].num; frame >= 0; frame--)
{
if ((picanm[nTile].sf&PICANM_ANIMTYPE_MASK) == PICANM_ANIMTYPE_BACK)
PrecacheHardwareTextures(nTile-frame);
else
PrecacheHardwareTextures(nTile+frame);
}
}
else
PrecacheHardwareTextures(nTile);
nTile += 1+picanm[nTile].num;
}
}
int nPrecacheCount;
char precachehightile[2][(MAXTILES+7)>>3];
void tilePrecacheTile(int nTile, int nType)
{
int n = 1;
switch (picanm[nTile].extra&7)
{
case 0:
n = 1;
break;
case 1:
n = 5;
break;
case 2:
n = 8;
break;
case 3:
n = 2;
break;
}
while(n--)
{
if (picanm[nTile].sf&PICANM_ANIMTYPE_MASK)
{
for (int frame = picanm[nTile].num; frame >= 0; frame--)
{
int tile;
if ((picanm[nTile].sf&PICANM_ANIMTYPE_MASK) == PICANM_ANIMTYPE_BACK)
tile = nTile-frame;
else
tile = nTile+frame;
if (!TestBitString(gotpic, tile))
{
nPrecacheCount++;
SetBitString(gotpic, tile);
}
SetBitString(precachehightile[nType], tile);
}
}
else
{
if (!TestBitString(gotpic, nTile))
{
nPrecacheCount++;
SetBitString(gotpic, nTile);
}
SetBitString(precachehightile[nType], nTile);
}
nTile += 1+picanm[nTile].num;
}
}
char tileGetSurfType(int hit)
{
int n = hit & 0x3fff;

View file

@ -22,7 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//-------------------------------------------------------------------------
#pragma once
#include "build.h"
#include "common.h"
#include "common_game.h"
#include "blood.h"

View file

@ -228,23 +228,6 @@ GameStats GameInterface::getStats()
return { gKillMgr.Kills, gKillMgr.TotalKills, gSecretMgr.Founds, gSecretMgr.Total, gFrameCount / kTicsPerSec, gPlayer[myconnectindex].fragCount };
}
void viewDrawMapTitle(void)
{
if (!hud_showmapname || M_Active())
return;
int const fadeStartTic = kTicsPerSec;
int const fadeEndTic = int(1.5f*kTicsPerSec);
if (gFrameCount > fadeEndTic)
return;
int const alpha = 255 - clamp((gFrameCount-fadeStartTic)*255/(fadeEndTic-fadeStartTic), 0, 255);
if (alpha != 0)
{
viewDrawText(1, currentLevel->DisplayName(), 160, 50, -128, 0, 1, 1, 0, alpha);
}
}
void viewDrawAimedPlayerName(void)
{
if (!cl_idplayers || (gView->aim.dx == 0 && gView->aim.dy == 0))
@ -411,19 +394,9 @@ void viewSetMessage(const char *pMessage, const int pal, const MESSAGE_PRIORITY
Printf(printlevel|PRINT_NOTIFY, "%s\n", pMessage);
}
char errMsg[256];
void viewSetErrorMessage(const char *pMessage)
{
if (!pMessage)
{
strcpy(errMsg, "");
}
else
{
strcpy(errMsg, pMessage);
}
Printf(PRINT_BOLD|PRINT_NOTIFY, "%s\n", pMessage);
}
void DoLensEffect(void)
@ -1014,7 +987,6 @@ void viewDrawScreen(bool sceneonly)
}
#endif
viewDrawMapTitle();
viewDrawAimedPlayerName();
if (paused)
{
@ -1025,10 +997,6 @@ void viewDrawScreen(bool sceneonly)
FStringf gTempStr("] %s [", gProfile[gView->nPlayer].name);
viewDrawText(0, gTempStr, 160, 10, 0, 0, 1, 0);
}
if (errMsg[0])
{
viewDrawText(0, errMsg, 160, 20, 0, 0, 1, 0);
}
if (cl_interpolate)
{
RestoreInterpolations();
@ -1041,22 +1009,12 @@ bool GameInterface::GenerateSavePic()
return true;
}
#define LOW_FPS 60
#define SLOW_FRAME_TIME 20
#if defined GEKKO
# define FPS_YOFFSET 16
#else
# define FPS_YOFFSET 0
#endif
FString GameInterface::GetCoordString()
{
FString out;
out.Format("pos= %d, %d, %d - angle = %2.3f",
gMe->pSprite->x, gMe->pSprite->y, gMe->pSprite->z, gMe->pSprite->ang);
gMe->pSprite->x, gMe->pSprite->y, gMe->pSprite->z, gMe->pSprite->ang * (360./2048));
return out;
}

View file

@ -223,12 +223,12 @@ void WeaponInit(void)
}
}
void WeaponPrecache(void)
void WeaponPrecache(HitList &hits)
{
for (int i = 0; i < kQAVEnd; i++)
{
if (weaponQAV[i])
weaponQAV[i]->Precache();
weaponQAV[i]->Precache(hits);
}
}

View file

@ -31,6 +31,8 @@ static_assert('\xff' == 255, "Char must be unsigned!");
#include "buildtiles.h"
#include "c_cvars.h"
#include "cmdlib.h"
#include "m_fixed.h"
#include "mathutil.h"
typedef int64_t coord_t;

View file

@ -1,72 +0,0 @@
//
// Definitions of common non-engine data structures/functions
// (and declarations of data appearing in both)
// for EDuke32 and Mapster32
//
#ifndef EDUKE32_COMMON_H_
#define EDUKE32_COMMON_H_
#include "compat.h"
#include "pragmas.h" // klabs
#include "scriptfile.h"
#include "mathutil.h"
//// TYPES
struct strllist
{
struct strllist *next;
char *str;
};
typedef struct
{
const char *text;
int32_t tokenid;
}
tokenlist;
enum
{
T_EOF = -2,
T_ERROR = -1,
};
//// EXTERN DECLS
extern const char *s_buildRev;
extern const char *s_buildTimestamp;
//// FUNCTIONS
void G_AddDef(const char *buffer);
void G_AddDefModule(const char *buffer);
// returns a buffer of size BMAX_PATH
static inline char *dup_filename(const char *fn)
{
char * const buf = (char *) Xmalloc(BMAX_PATH);
return Bstrncpyz(buf, fn, BMAX_PATH);
}
static inline void realloc_copy(char **fn, const char *buf)
{
uint8_t len = Bstrlen(buf) + 1;
*fn = (char *)Xrealloc(*fn, len);
Bstrncpy(*fn, buf, len);
}
int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens);
void COMMON_clearbackground(int32_t numcols, int32_t numrows);
// timer defs for profiling function chunks the simple way
#define EDUKE32_TMRDEF int32_t t[20], ti=0; const char *tmrstr=__func__; fprintf(stderr,"%s\n",tmrstr); t[ti++]=I_msTime();
#define EDUKE32_TMRTIC t[ti++]=I_msTime()
#define EDUKE32_TMRPRN do { int ii=0; fprintf(stderr,"%s: ",tmrstr); for (ii=1; ii<ti; ii++) fprintf(stderr,"%d ", t[ii]-t[ii-1]); fprintf(stderr,"\n"); } while (0)
#endif

View file

@ -20,66 +20,9 @@
# define EDUKE32_GCC_PREREQ(major, minor) 0
#endif
#ifdef __clang__
# define EDUKE32_CLANG_PREREQ(major, minor) (major < __clang_major__ || (major == __clang_major__ && minor <= __clang_minor__))
#else
# define EDUKE32_CLANG_PREREQ(major, minor) 0
#endif
#ifndef __has_builtin
# define __has_builtin(x) 0 // Compatibility with non-clang compilers.
#endif
#ifndef __has_feature
# define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#ifndef __has_extension
# define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
#endif
#ifndef __has_cpp_attribute
# define __has_cpp_attribute(x) 0
#endif
#ifdef _MSC_VER
# define EDUKE32_MSVC_PREREQ(major) ((major) <= (_MSC_VER))
# ifdef __cplusplus
# define EDUKE32_MSVC_CXX_PREREQ(major) ((major) <= (_MSC_VER))
# else
# define EDUKE32_MSVC_CXX_PREREQ(major) 0
# endif
#else
# define EDUKE32_MSVC_PREREQ(major) 0
# define EDUKE32_MSVC_CXX_PREREQ(major) 0
#endif
////////// Language detection //////////
#if defined __STDC__
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L
# define CSTD 2011
# elif defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
# define CSTD 1999
# elif defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L
# define CSTD 1994
# else
# define CSTD 1989
# endif
#else
# define CSTD 0
#endif
#if defined __cplusplus && __cplusplus >= 201703L
# define CXXSTD 2017
#elif defined __cplusplus && __cplusplus >= 201402L
# define CXXSTD 2014
#elif defined __cplusplus && __cplusplus >= 201103L
# define CXXSTD 2011
#elif defined __cplusplus && __cplusplus >= 199711L
# define CXXSTD 2014 // Thanks, Microsoft... :?
#else
# define CXXSTD 0
#endif
////////// Language and compiler feature polyfills //////////
# define EXTERNC
@ -123,42 +66,13 @@
# endif
#endif
#if EDUKE32_GCC_PREREQ(2,0) || defined _MSC_VER
# define EDUKE32_FUNCTION __FUNCTION__
#elif CSTD >= 1999 || CXXSTD >= 2011
# define EDUKE32_FUNCTION __func__
#else
# define EDUKE32_FUNCTION "???"
#endif
#if CXXSTD >= 2011
# if __has_cpp_attribute(fallthrough)
# define fallthrough__ [[fallthrough]]
# elif __has_cpp_attribute(clang::fallthrough)
# define fallthrough__ [[clang::fallthrough]]
# elif __has_cpp_attribute(gnu::fallthrough)
# define fallthrough__ [[gnu::fallthrough]]
# endif
#endif
#ifndef fallthrough__
# if !defined __clang__ && EDUKE32_GCC_PREREQ(7,0)
# define fallthrough__ __attribute__((fallthrough))
# elif defined _MSC_VER
# define fallthrough__ __fallthrough
# else
# define fallthrough__
# endif
#endif
////////// Architecture detection //////////
#ifdef WORDS_BIGENDIAN
# define B_LITTLE_ENDIAN 0
# define B_BIG_ENDIAN 1
#else
# define B_LITTLE_ENDIAN 1
# define B_BIG_ENDIAN 0
#endif
@ -184,9 +98,7 @@
#include <limits.h>
#include <stdarg.h>
#include <stddef.h>
#ifndef USE_PHYSFS
#include <stdio.h>
#endif
#include <stdlib.h>
#include <string.h>
@ -201,16 +113,10 @@
#include <assert.h>
#ifdef __cplusplus
# include <limits>
# if CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800)
# include <algorithm>
# include <functional>
# include <type_traits>
// we need this because MSVC does not properly identify C++11 support
# define HAVE_CXX11_HEADERS
# endif
#endif
////////// Platform headers //////////
@ -218,19 +124,6 @@
# include <malloc.h>
#endif
#ifndef USE_PHYSFS
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#if defined(_WIN32)
# include <direct.h>
# include <io.h>
#else
# include <unistd.h>
#endif
#endif
#include "engineerrors.h"
////////// DEPRECATED: Standard library prefixing //////////
@ -242,52 +135,15 @@ typedef ssize_t bssize_t;
#define BMAX_PATH 256
#define Bstrcpy strcpy
#define Bstrncpy strncpy
#define Bstrcmp strcmp
#define Bstrncmp strncmp
#define Bstrcat strcat
#define Bstrncat strncat
#define Bstrlen strlen
#define Bstrchr strchr
#define Bstrrchr strrchr
#define Bstrtol strtol
#define Bstrtoul strtoul
#define Bstrtod strtod
#define Bstrstr strstr
#define Bmemcpy memcpy
#define Bmemset memset
////////// Standard library wrappers //////////
#if defined(__arm__)
# define Bsqrtf __builtin_sqrtf
#else
# define Bsqrtf sqrtf
#endif
////////// Metaprogramming structs //////////
# if CXXSTD >= 2014
using std::enable_if_t;
# elif defined HAVE_CXX11_HEADERS
template <bool B, class T = void>
using enable_if_t = typename std::enable_if<B, T>::type;
# endif
using native_t = intptr_t;
typedef struct MAY_ALIAS {
int32_t x, y;
} vec2_t;
typedef struct {
uint32_t x, y;
} vec2u_t;
typedef struct {
float x, y;
} vec2f_t;
@ -336,10 +192,6 @@ static_assert(sizeof(vec3d_t) == sizeof(double) * 3);
#include "basics.h"
# define ARRAY_SIZE(arr) countof(arr)
////////// Pointer management //////////
#define DO_FREE_AND_NULL(var) do { \
@ -363,7 +215,6 @@ static FORCE_INLINE uint16_t B_UNBUF16(void const * const buf) { return *(uint16
////////// Abstract data operations //////////
template <typename T, typename X, typename Y> constexpr T clamp(T in, X min, Y max) { return in <= (T) min ? (T) min : (in >= (T) max ? (T) max : in); }
template <typename T, typename X, typename Y> constexpr T clamp2(T in, X min, Y max) { return in >= (T) max ? (T) max : (in <= (T) min ? (T) min : in); }
using std::min;
using std::max;
@ -378,9 +229,8 @@ static struct
} pow2char;
static FORCE_INLINE void bitmap_set(uint8_t *const ptr, int const n) { ptr[n>>3] |= pow2char[n&7]; }
static FORCE_INLINE void bitmap_clear(uint8_t *const ptr, int const n) { ptr[n>>3] &= ~pow2char[n&7]; }
static FORCE_INLINE char bitmap_test(uint8_t const *const ptr, int const n) { return ptr[n>>3] & pow2char[n&7]; }
static FORCE_INLINE void bitmap_set(uint8_t *const ptr, int const n) { ptr[n>>3] |= 1 << (n&7); }
static FORCE_INLINE char bitmap_test(uint8_t const *const ptr, int const n) { return ptr[n>>3] & (1 << (n&7)); }
////////// Utility functions //////////
@ -388,7 +238,7 @@ static FORCE_INLINE char bitmap_test(uint8_t const *const ptr, int const n) { re
template <typename T>
void bfirst_search_init(T *const list, uint8_t *const bitmap, T *const eltnumptr, int const maxelts, int const firstelt)
{
Bmemset(bitmap, 0, (maxelts+7)>>3);
memset(bitmap, 0, (maxelts+7)>>3);
list[0] = firstelt;
bitmap_set(bitmap, firstelt);
@ -405,14 +255,6 @@ void bfirst_search_try(T *const list, uint8_t *const bitmap, T *const eltnumptr,
}
}
// Copy min(strlen(src)+1, n) characters into dst, always terminate with a NUL.
static FORCE_INLINE char *Bstrncpyz(char *dst, const char *src, bsize_t n)
{
Bstrncpy(dst, src, n);
dst[n-1] = 0;
return dst;
}
////////// PANICKING ALLOCATION WRAPPERS //////////
@ -424,18 +266,6 @@ static FORCE_INLINE char *Bstrncpyz(char *dst, const char *src, bsize_t n)
////////// Inlined external libraries //////////
#include "m_fixed.h"
#include "vectors.h"
inline FVector3 GetSoundPos(const vec3_t *pos)
{
// converts a Build coordinate to a sound system coordinate
const float xmul = 1 / 16.f;
const float ymul = -1 / 16.f;
const float zmul = -1 / 256.f;
return { pos->x* xmul, pos->z* zmul, pos->y* ymul };
}
/* End dependence on compat.o object. */

View file

@ -78,7 +78,7 @@ static inline float polymost_invsqrt_approximation(float x)
return n.f * (1.5f - haf * (n.f * n.f));
#else
// this is the comment
return 1.f / Bsqrtf(x);
return 1.f / sqrtf(x);
#endif
}

View file

@ -30,4 +30,21 @@ int32_t scriptfile_getsymbolvalue(char const *name, int32_t *val);
int32_t scriptfile_addsymbolvalue(char const *name, int32_t val);
void scriptfile_clearsymbols(void);
typedef struct
{
const char *text;
int32_t tokenid;
}
tokenlist;
enum
{
T_EOF = -2,
T_ERROR = -1,
};
int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens);
#endif

View file

@ -21,6 +21,11 @@
#include <vpx/vp8dx.h>
#include "animvpx.h"
struct vec2u_t
{
uint32_t x, y;
} ;
const char *animvpx_read_ivf_header_errmsg[] = {
"All OK",
"couldn't read 32-byte IVF header",
@ -145,8 +150,8 @@ int32_t animvpx_init_codec(const animvpx_ivf_header_t *info, FileReader & inhand
codec->errmsg_detail = codec->errmsg = NULL;
codec->numframes = 0;
Bmemset(codec->sumtimes, 0, sizeof(codec->sumtimes));
Bmemset(codec->maxtimes, 0, sizeof(codec->maxtimes));
memset(codec->sumtimes, 0, sizeof(codec->sumtimes));
memset(codec->maxtimes, 0, sizeof(codec->maxtimes));
return 0;
}

View file

@ -54,7 +54,7 @@ void engineInitClipMaps()
DO_FREE_AND_NULL(loadsprite);
// two's complement trick, -1 = 0xff
Bmemset(&pictoidx, -1, sizeof(pictoidx));
memset(&pictoidx, -1, sizeof(pictoidx));
numsectors = 0;
numwalls = 0;
@ -334,7 +334,7 @@ static inline int32_t cliptrace(vec2_t const pos, vec2_t * const goal)
topu--;
} while (area.x*(n.y-p1.y) <= (n.x-p1.x)*area.y);
if (klabs(pos.x-n.x)+klabs(pos.y-n.y) < klabs(pos.x-goal->x)+klabs(pos.y-goal->y))
if (abs(pos.x-n.x)+abs(pos.y-n.y) < abs(pos.x-goal->x)+abs(pos.y-goal->y))
{
*goal = n;
hitwall = z;
@ -412,7 +412,7 @@ static void clipupdatesector(vec2_t const pos, int16_t * const sectnum, int wall
if (nsecs > (walldist + 8))
{
Printf("%s(): initial position (%d, %d) not within initial sector %d; shortest distance %d.\n", EDUKE32_FUNCTION, pos.x, pos.y, *sectnum, nsecs);
Printf("%s(): initial position (%d, %d) not within initial sector %d; shortest distance %d.\n", __func__, pos.x, pos.y, *sectnum, nsecs);
walldist = 0x7fff;
}
@ -505,7 +505,7 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int
clipmove_warned = 0;
Bmemset(clipsectormap, 0, (numsectors+7)>>3);
memset(clipsectormap, 0, (numsectors+7)>>3);
bitmap_set(clipsectormap, *sectnum);
do
@ -875,7 +875,7 @@ int pushmove(vec3_t *const vect, int16_t *const sectnum,
clipsectorlist[0] = *sectnum;
clipsectnum = 1;
Bmemset(clipsectormap, 0, (numsectors + 7) >> 3);
memset(clipsectormap, 0, (numsectors + 7) >> 3);
bitmap_set(clipsectormap, *sectnum);
}
@ -1029,7 +1029,7 @@ void getzrange(const vec3_t *pos, int16_t sectnum,
clipsectorlist[0] = sectnum;
clipsectnum = 1;
clipspritenum = 0;
Bmemset(clipsectormap, 0, (numsectors+7)>>3);
memset(clipsectormap, 0, (numsectors+7)>>3);
bitmap_set(clipsectormap, sectnum);
do //Collect sectors inside your square first

View file

@ -10,7 +10,6 @@
#include "engine_priv.h"
#include "scriptfile.h"
#include "common.h"
#include "mdsprite.h" // md3model_t
#include "buildtiles.h"
#include "bitmap.h"
@ -56,7 +55,7 @@ if (sc.Compare("music"))
while (pScript->textptr < musicEnd)
{
switch (getatoken(pScript, soundTokens, ARRAY_SIZE(soundTokens)))
switch (getatoken(pScript, soundTokens, countof(soundTokens)))
{
case T_ID: scriptfile_getstring(pScript, &musicID); break;
case T_FILE: scriptfile_getstring(pScript, &fileName); break;
@ -362,7 +361,7 @@ static int32_t defsparser(scriptfile *script)
iter = 0;
}
#endif
tokn = getatoken(script,basetokens,ARRAY_SIZE(basetokens));
tokn = getatoken(script,basetokens,countof(basetokens));
cmdtokptr = script->ltextptr;
switch (tokn)
{
@ -575,7 +574,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&blockend)) break;
while (script->textptr < blockend)
{
int32_t token = getatoken(script,artfiletokens,ARRAY_SIZE(artfiletokens));
int32_t token = getatoken(script,artfiletokens,countof(artfiletokens));
switch (token)
{
case T_FILE:
@ -686,7 +685,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&textureend)) break;
while (script->textptr < textureend)
{
int32_t token = getatoken(script,tilefromtexturetokens,ARRAY_SIZE(tilefromtexturetokens));
int32_t token = getatoken(script,tilefromtexturetokens,countof(tilefromtexturetokens));
switch (token)
{
case T_FILE:
@ -723,7 +722,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&ifmatchend)) break;
while (script->textptr < ifmatchend)
{
int32_t token = getatoken(script,ifmatchtokens,ARRAY_SIZE(ifmatchtokens));
int32_t token = getatoken(script,ifmatchtokens,countof(ifmatchtokens));
switch (token)
{
case T_CRC32:
@ -902,7 +901,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&blockend)) break;
while (script->textptr < blockend)
{
int32_t token = getatoken(script,copytiletokens,ARRAY_SIZE(copytiletokens));
int32_t token = getatoken(script,copytiletokens,countof(copytiletokens));
switch (token)
{
case T_TILE:
@ -1296,7 +1295,7 @@ static int32_t defsparser(scriptfile *script)
{ "flags", T_FLAGS },
};
Bmemset(usedframebitmap, 0, sizeof(usedframebitmap));
memset(usedframebitmap, 0, sizeof(usedframebitmap));
modelskin = lastmodelskin = 0;
seenframe = 0;
@ -1314,7 +1313,7 @@ static int32_t defsparser(scriptfile *script)
#endif
while (script->textptr < modelend)
{
int32_t token = getatoken(script,modeltokens,ARRAY_SIZE(modeltokens));
int32_t token = getatoken(script,modeltokens,countof(modeltokens));
switch (token)
{
//case T_ERROR: Printf("Error on line %s:%d in model tokens\n", script->filename,script->linenum); break;
@ -1353,7 +1352,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&frameend)) break;
while (script->textptr < frameend)
{
switch (getatoken(script,modelframetokens,ARRAY_SIZE(modelframetokens)))
switch (getatoken(script,modelframetokens,countof(modelframetokens)))
{
case T_PAL:
scriptfile_getsymbol(script,&pal); break;
@ -1438,7 +1437,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&animend)) break;
while (script->textptr < animend)
{
switch (getatoken(script,modelanimtokens,ARRAY_SIZE(modelanimtokens)))
switch (getatoken(script,modelanimtokens,countof(modelanimtokens)))
{
case T_FRAME0:
scriptfile_getstring(script,&startframe); break;
@ -1513,7 +1512,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&skinend)) break;
while (script->textptr < skinend)
{
switch (getatoken(script,modelskintokens,ARRAY_SIZE(modelskintokens)))
switch (getatoken(script,modelskintokens,countof(modelskintokens)))
{
case T_PAL:
scriptfile_getsymbol(script,&palnum); break;
@ -1616,7 +1615,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&frameend)) break;
while (script->textptr < frameend)
{
switch (getatoken(script,modelhudtokens,ARRAY_SIZE(modelhudtokens)))
switch (getatoken(script,modelhudtokens,countof(modelhudtokens)))
{
case T_TILE:
scriptfile_getsymbol(script,&ftilenume); ltilenume = ftilenume; break;
@ -1739,7 +1738,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&modelend)) break;
while (script->textptr < modelend)
{
switch (getatoken(script, voxeltokens, ARRAY_SIZE(voxeltokens)))
switch (getatoken(script, voxeltokens, countof(voxeltokens)))
{
//case T_ERROR: Printf("Error on line %s:%d in voxel tokens\n", script->filename,linenum); break;
case T_TILE:
@ -1812,7 +1811,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&modelend)) break;
while (script->textptr < modelend)
{
switch (getatoken(script,skyboxtokens,ARRAY_SIZE(skyboxtokens)))
switch (getatoken(script,skyboxtokens,countof(skyboxtokens)))
{
//case T_ERROR: Printf("Error on line %s:%d in skybox tokens\n",script->filename,linenum); break;
case T_TILE:
@ -1864,7 +1863,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&highpalend)) break;
while (script->textptr < highpalend)
{
switch (getatoken(script,highpaltokens,ARRAY_SIZE(highpaltokens)))
switch (getatoken(script,highpaltokens,countof(highpaltokens)))
{
case T_BASEPAL:
scriptfile_getsymbol(script,&basepal); break;
@ -1921,7 +1920,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&tintend)) break;
while (script->textptr < tintend)
{
switch (getatoken(script,tinttokens,ARRAY_SIZE(tinttokens)))
switch (getatoken(script,tinttokens,countof(tinttokens)))
{
case T_PAL:
scriptfile_getsymbol(script,&pal); break;
@ -1983,7 +1982,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&endtextptr)) break;
while (script->textptr < endtextptr)
{
switch (getatoken(script, palookuptokens, ARRAY_SIZE(palookuptokens)))
switch (getatoken(script, palookuptokens, countof(palookuptokens)))
{
case T_PAL:
scriptfile_getsymbol(script, &pal);
@ -2079,7 +2078,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&textureend)) break;
while (script->textptr < textureend)
{
token = getatoken(script,texturetokens,ARRAY_SIZE(texturetokens));
token = getatoken(script,texturetokens,countof(texturetokens));
switch (token)
{
case T_PAL:
@ -2109,7 +2108,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&palend)) break;
while (script->textptr < palend)
{
switch (getatoken(script,texturetokens_pal,ARRAY_SIZE(texturetokens_pal)))
switch (getatoken(script,texturetokens_pal,countof(texturetokens_pal)))
{
case T_FILE:
scriptfile_getstring(script,&fn); break;
@ -2189,7 +2188,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&detailend)) break;
while (script->textptr < detailend)
{
switch (getatoken(script,texturetokens_pal,ARRAY_SIZE(texturetokens_pal)))
switch (getatoken(script,texturetokens_pal,countof(texturetokens_pal)))
{
case T_FILE:
scriptfile_getstring(script,&fn); break;
@ -2366,7 +2365,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&dummy)) break;
while (script->textptr < dummy)
{
switch (getatoken(script,sound_musictokens,ARRAY_SIZE(sound_musictokens)))
switch (getatoken(script,sound_musictokens,countof(sound_musictokens)))
{
case T_ID:
scriptfile_getstring(script,&dummy2);
@ -2395,7 +2394,7 @@ static int32_t defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&mapinfoend)) break;
while (script->textptr < mapinfoend)
{
switch (getatoken(script,mapinfotokens,ARRAY_SIZE(mapinfotokens)))
switch (getatoken(script,mapinfotokens,countof(mapinfotokens)))
{
case T_MAPFILE:
scriptfile_getstring(script,&dummy);
@ -2416,7 +2415,7 @@ static int32_t defsparser(scriptfile *script)
char smallbuf[3] = { 0, 0, 0 };
smallbuf[0] = mapmd4string[2*i];
smallbuf[1] = mapmd4string[2*i+1];
newusermaphack->md4[i] = Bstrtol(smallbuf, NULL, 16);
newusermaphack->md4[i] = strtol(smallbuf, NULL, 16);
}
break;
@ -2486,7 +2485,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < blockend)
{
int32_t token = getatoken(script,subtokens,ARRAY_SIZE(subtokens));
int32_t token = getatoken(script,subtokens,countof(subtokens));
switch (token)
{
case T_HORIZFRAC:
@ -2574,7 +2573,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < blockend)
{
int32_t token = getatoken(script,subtokens,ARRAY_SIZE(subtokens));
int32_t token = getatoken(script,subtokens,countof(subtokens));
switch (token)
{
case T_RAW:
@ -2597,7 +2596,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < rawblockend)
{
int32_t token = getatoken(script,rawsubtokens,ARRAY_SIZE(rawsubtokens));
int32_t token = getatoken(script,rawsubtokens,countof(rawsubtokens));
switch (token)
{
case T_FILE:
@ -2753,7 +2752,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < blockend)
{
int32_t token = getatoken(script,subtokens,ARRAY_SIZE(subtokens));
int32_t token = getatoken(script,subtokens,countof(subtokens));
switch (token)
{
case T_RAW:
@ -2776,7 +2775,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < subblockend)
{
int32_t token = getatoken(script,rawsubtokens,ARRAY_SIZE(rawsubtokens));
int32_t token = getatoken(script,rawsubtokens,countof(rawsubtokens));
switch (token)
{
case T_FILE:
@ -2897,7 +2896,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < subblockend)
{
switch (getatoken(script, fogpaltokens, ARRAY_SIZE(fogpaltokens)))
switch (getatoken(script, fogpaltokens, countof(fogpaltokens)))
{
case T_RED:
scriptfile_getnumber(script,&red);
@ -2945,7 +2944,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < subblockend)
{
switch (getatoken(script, makepalookuptokens, ARRAY_SIZE(makepalookuptokens)))
switch (getatoken(script, makepalookuptokens, countof(makepalookuptokens)))
{
case T_RED:
scriptfile_getnumber(script,&red);
@ -3045,7 +3044,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < blockend)
{
int32_t token = getatoken(script,subtokens,ARRAY_SIZE(subtokens));
int32_t token = getatoken(script,subtokens,countof(subtokens));
switch (token)
{
case T_RAW:
@ -3066,7 +3065,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < rawblockend)
{
int32_t token = getatoken(script,rawsubtokens,ARRAY_SIZE(rawsubtokens));
int32_t token = getatoken(script,rawsubtokens,countof(rawsubtokens));
switch (token)
{
case T_FILE:
@ -3169,7 +3168,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < glblendblockend)
{
int32_t glblendtoken = getatoken(script,glblendtokens,ARRAY_SIZE(glblendtokens));
int32_t glblendtoken = getatoken(script,glblendtokens,countof(glblendtokens));
switch (glblendtoken)
{
case T_FORWARD:
@ -3200,7 +3199,7 @@ static int32_t defsparser(scriptfile *script)
while (script->textptr < glblenddefblockend)
{
int32_t glblenddeftoken = getatoken(script,glblenddeftokens,ARRAY_SIZE(glblenddeftokens));
int32_t glblenddeftoken = getatoken(script,glblenddeftokens,countof(glblenddeftokens));
switch (glblenddeftoken)
{
case T_SRC:
@ -3220,7 +3219,7 @@ static int32_t defsparser(scriptfile *script)
{ "ONE_MINUS_DST_COLOR", T_ONE_MINUS_DST_COLOR },
};
int32_t factortoken = getatoken(script,blendFuncTokens,ARRAY_SIZE(blendFuncTokens));
int32_t factortoken = getatoken(script,blendFuncTokens,countof(blendFuncTokens));
#ifdef USE_OPENGL
uint8_t * const factor = glblenddeftoken == T_SRC ? &glbdef->src : &glbdef->dst;

View file

@ -13,7 +13,6 @@
#include "automap.h"
#include "imagehelpers.h"
#include "common.h"
#include "compat.h"
#include "engine_priv.h"
#include "palette.h"
@ -584,7 +583,7 @@ static void dosetaspect(void)
{
j = (x&65535); k = FixedToInt(x); x += xinc;
if (k < 0 || k >= (int32_t)ARRAY_SIZE(qradarang)-1)
if (k < 0 || k >= (int32_t)countof(qradarang)-1)
{
no_radarang2 = 1;
break;
@ -1288,7 +1287,7 @@ int32_t renderDrawRoomsQ16(int32_t daposx, int32_t daposy, int32_t daposz,
if ((xyaspect != oxyaspect) || (xdimen != oxdimen) || (viewingrange != oviewingrange))
dosetaspect();
Bmemset(gotsector, 0, sizeof(gotsector));
memset(gotsector, 0, sizeof(gotsector));
i = xdimen-1;
@ -1897,7 +1896,7 @@ void renderDrawMapView(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
renderSetAspect(65536, divscale16((320*5)/8, 200));
Bmemset(gotsector, 0, sizeof(gotsector));
memset(gotsector, 0, sizeof(gotsector));
vec2_t const c1 = { (windowxy1.x<<12), (windowxy1.y<<12) };
vec2_t const c2 = { ((windowxy2.x+1)<<12)-1, ((windowxy2.y+1)<<12)-1 };
@ -2205,13 +2204,13 @@ static int32_t engineFinishLoadBoard(const vec3_t *dapos, int16_t *dacursectnum,
updatesector(dapos->x, dapos->y, dacursectnum);
{
Bmemset(spriteext, 0, sizeof(spriteext_t)*MAXSPRITES);
memset(spriteext, 0, sizeof(spriteext_t)*MAXSPRITES);
#ifndef NEW_MAP_FORMAT
Bmemset(wallext, 0, sizeof(wallext_t)*MAXWALLS);
memset(wallext, 0, sizeof(wallext_t)*MAXWALLS);
#endif
#ifdef USE_OPENGL
Bmemset(spritesmooth, 0, sizeof(spritesmooth_t)*(MAXSPRITES+MAXUNIQHUDID));
memset(spritesmooth, 0, sizeof(spritesmooth_t)*(MAXSPRITES+MAXUNIQHUDID));
# ifdef POLYMER
if (videoGetRenderMode() == REND_POLYMER)
@ -2237,7 +2236,7 @@ static int32_t engineFinishLoadBoard(const vec3_t *dapos, int16_t *dacursectnum,
static void remove_sprite(int32_t i)
{
Bmemset(&sprite[i], 0, sizeof(spritetype));
memset(&sprite[i], 0, sizeof(spritetype));
sprite[i].statnum = MAXSTATUS;
sprite[i].sectnum = MAXSECTORS;
}
@ -2653,7 +2652,7 @@ int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daups
daupscaledxdim = max(320, daupscaledxdim);
daupscaledydim = max(200, daupscaledydim);
Bstrcpy(kensmessage,"!!!! BUILD engine&tools programmed by Ken Silverman of E.G. RI."
strcpy(kensmessage,"!!!! BUILD engine&tools programmed by Ken Silverman of E.G. RI."
" (c) Copyright 1995 Ken Silverman. Summary: BUILD = Ken. !!!!");
rendmode = REND_POLYMOST;
@ -3095,7 +3094,7 @@ int32_t cansee(int32_t x1, int32_t y1, int32_t z1, int16_t sect1, int32_t x2, in
const int32_t x21 = x2-x1, y21 = y2-y1, z21 = z2-z1;
static uint8_t sectbitmap[(MAXSECTORS+7)>>3];
Bmemset(sectbitmap, 0, sizeof(sectbitmap));
memset(sectbitmap, 0, sizeof(sectbitmap));
if (x1 == x2 && y1 == y2)
return (sect1 == sect2);
@ -3276,7 +3275,7 @@ void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day, uint8_t flags)
uint8_t *const walbitmap = (uint8_t *)tempbuf;
if ((flags&1)==0)
Bmemset(walbitmap, 0, (numwalls+7)>>3);
memset(walbitmap, 0, (numwalls+7)>>3);
yaxwalls[numyaxwalls++] = pointhighlight;
for (i=0; i<numyaxwalls; i++)

View file

@ -9,7 +9,6 @@
#include "polymost.h"
#include "mdsprite.h"
#include "common.h"
#include "palette.h"
#include "textures.h"
#include "bitmap.h"
@ -104,9 +103,9 @@ void freeallmodels()
nextmodelid = 0;
}
Bmemset(tile2model,-1,sizeof(tile2model));
memset(tile2model,-1,sizeof(tile2model));
for (i=0; i<MAXTILES; i++)
Bmemset(tile2model[i].hudmem, 0, sizeof(tile2model[i].hudmem));
memset(tile2model[i].hudmem, 0, sizeof(tile2model[i].hudmem));
curextra=MAXTILES;
@ -175,7 +174,7 @@ static int32_t framename2index(mdmodel_t *vm, const char *nam)
for (i=0; i<m->numframes; i++)
{
fr = (md2frame_t *)&m->frames[i*m->framebytes];
if (!Bstrcmp(fr->name, nam)) break;
if (!strcmp(fr->name, nam)) break;
}
}
break;
@ -183,7 +182,7 @@ static int32_t framename2index(mdmodel_t *vm, const char *nam)
{
md3model_t *m = (md3model_t *)vm;
for (i=0; i<m->numframes; i++)
if (!Bstrcmp(m->head.frames[i].nam,nam)) break;
if (!strcmp(m->head.frames[i].nam,nam)) break;
}
break;
}
@ -231,7 +230,7 @@ int32_t md_defineanimation(int32_t modelid, const char *framestart, const char *
if ((uint32_t)modelid >= (uint32_t)nextmodelid) return -1;
Bmemset(&ma, 0, sizeof(ma));
memset(&ma, 0, sizeof(ma));
m = (md2model_t *)models[modelid];
if (m->mdnum < 2) return 0;
@ -250,7 +249,7 @@ int32_t md_defineanimation(int32_t modelid, const char *framestart, const char *
map = (mdanim_t *)Xmalloc(sizeof(mdanim_t));
Bmemcpy(map, &ma, sizeof(ma));
memcpy(map, &ma, sizeof(ma));
map->next = m->animations;
m->animations = map;
@ -308,8 +307,8 @@ int32_t md_thinoutmodel(int32_t modelid, uint8_t *usedframebitmap)
if (otonframe[i]>=0 && otonframe[i] != i)
{
if (m->muladdframes)
Bmemcpy(&m->muladdframes[2*otonframe[i]], &m->muladdframes[2*i], 2*sizeof(vec3f_t));
Bmemcpy(&m->head.frames[otonframe[i]], &m->head.frames[i], sizeof(md3frame_t));
memcpy(&m->muladdframes[2*otonframe[i]], &m->muladdframes[2*i], 2*sizeof(vec3f_t));
memcpy(&m->head.frames[otonframe[i]], &m->head.frames[i], sizeof(md3frame_t));
}
}
@ -319,7 +318,7 @@ int32_t md_thinoutmodel(int32_t modelid, uint8_t *usedframebitmap)
for (i=0; i<m->numframes; i++)
if (otonframe[i]>=0 && otonframe[i] != i)
Bmemcpy(&s->xyzn[otonframe[i]*s->numverts], &s->xyzn[i*s->numverts], s->numverts*sizeof(md3xyzn_t));
memcpy(&s->xyzn[otonframe[i]*s->numverts], &s->xyzn[i*s->numverts], s->numverts*sizeof(md3xyzn_t));
}
////// tweak frame indices in various places
@ -757,13 +756,13 @@ static md2model_t *md2load(FileReader & fil, const char *filnam)
}
#endif
Bstrcpy(st,filnam);
strcpy(st,filnam);
for (i=strlen(st)-1; i>0; i--)
if ((st[i] == '/') || (st[i] == '\\')) { i++; break; }
if (i<0) i=0;
st[i] = 0;
m->basepath = (char *)Xmalloc(i+1);
Bstrcpy(m->basepath, st);
strcpy(m->basepath, st);
m->skinfn = (char *)Xmalloc(ournumskins*64);
if (m->numskins > 0)
@ -803,7 +802,7 @@ static md2model_t *md2load(FileReader & fil, const char *filnam)
while (i < m->numframes)
{
f = (md2frame_t *)&m->frames[i*m->framebytes];
Bstrcpy(m3->head.frames[i].nam, f->name);
strcpy(m3->head.frames[i].nam, f->name);
//Printf("Copied frame %s.\n", m3->head.frames[i].nam);
m3->muladdframes[i*2] = f->mul;
m3->muladdframes[i*2+1] = f->add;
@ -825,7 +824,7 @@ static md2model_t *md2load(FileReader & fil, const char *filnam)
maxmodelverts = max(maxmodelverts, s->numverts);
Bstrcpy(s->nam, "Dummy surface from MD2");
strcpy(s->nam, "Dummy surface from MD2");
s->shaders = NULL;
@ -1105,8 +1104,8 @@ static void md3postload_common(md3model_t *m)
{
frame = &m->head.frames[framei];
Bmemset(&frame->min, 0, sizeof(vec3f_t));
Bmemset(&frame->max, 0, sizeof(vec3f_t));
memset(&frame->min, 0, sizeof(vec3f_t));
memset(&frame->max, 0, sizeof(vec3f_t));
frame->r = 0.0f;
@ -1185,7 +1184,7 @@ static void md3postload_common(md3model_t *m)
++surfi;
}
frame->r = Bsqrtf(frame->r);
frame->r = sqrtf(frame->r);
++framei;
}
@ -1393,7 +1392,7 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr)
if (sext->pitch || sext->roll)
{
float f = 1.f/((fxdimen * fviewingrange) * (256.f/(65536.f*128.f)) * (m0.x+m1.x));
Bmemset(&a0, 0, sizeof(a0));
memset(&a0, 0, sizeof(a0));
if (sext->pivot_offset.x)
a0.x = (float) sext->pivot_offset.x * f;
@ -1644,8 +1643,8 @@ static mdmodel_t *mdload(const char *filnam)
// smuggle the file name into the model struct.
// head.nam is unused as far as I can tell
Bstrncpyz(vm3->head.nam, filnam, sizeof(vm3->head.nam));
strncpy(vm3->head.nam, filnam, sizeof(vm3->head.nam));
vm3->head.nam[sizeof(vm3->head.nam)-1] = 0;
md3postload_common(vm3);
}

View file

@ -107,9 +107,9 @@ int32_t engineLoadMHK(const char *filename)
if (filename)
{
Bmemset(spriteext, 0, sizeof(spriteext_t) * MAXSPRITES);
Bmemset(spritesmooth, 0, sizeof(spritesmooth_t) *(MAXSPRITES+MAXUNIQHUDID));
Bstrcpy(fn, filename);
memset(spriteext, 0, sizeof(spriteext_t) * MAXSPRITES);
memset(spritesmooth, 0, sizeof(spritesmooth_t) *(MAXSPRITES+MAXUNIQHUDID));
strcpy(fn, filename);
script = scriptfile_fromfile(filename);
}
else if (fn[0])

View file

@ -7,7 +7,6 @@ Ken Silverman's official web site: http://www.advsys.net/ken
#include "build.h"
#include "automap.h"
#include "common.h"
#include "engine_priv.h"
#include "mdsprite.h"
#include "polymost.h"
@ -145,7 +144,7 @@ static float* multiplyMatrix4f(float m0[4*4], const float m1[4*4])
multMatrix4RowCol(3, 2);
multMatrix4RowCol(3, 3);
Bmemcpy(m0, mR, sizeof(float)*4*4);
memcpy(m0, mR, sizeof(float)*4*4);
return m0;
@ -1125,7 +1124,7 @@ static void polymost_internal_nonparallaxed(vec2f_t n0, vec2f_t n1, float ryp0,
if (globalorientation&64) //Hack for relative alignment on slopes
{
float r = global_cf_heinum * (1.0f / 4096.f);
r = Bsqrtf(r*r+1);
r = sqrtf(r*r+1);
if (!(globalorientation&4)) { xtex.v *= r; ytex.v *= r; otex.v *= r; }
else { xtex.u *= r; ytex.u *= r; otex.u *= r; }
}
@ -2499,8 +2498,8 @@ void polymost_drawrooms()
else
{
float r = (float)(ydimen >> 1) - (ghoriz + ghorizcorrect);
gshang = r / Bsqrtf(r * r + ghalfx * ghalfx / (gvrcorrection * gvrcorrection));
gchang = Bsqrtf(1.f - gshang * gshang);
gshang = r / sqrtf(r * r + ghalfx * ghalfx / (gvrcorrection * gvrcorrection));
gchang = sqrtf(1.f - gshang * gshang);
ghoriz2 = 0.f;
}
@ -2611,7 +2610,7 @@ void polymost_drawrooms()
while (numbunches > 0)
{
Bmemset(ptempbuf,0,numbunches+3); ptempbuf[0] = 1;
memset(ptempbuf,0,numbunches+3); ptempbuf[0] = 1;
int32_t closest = 0; //Almost works, but not quite :(
@ -2896,8 +2895,8 @@ void polymost_prepareMirror(int32_t dax, int32_t day, int32_t daz, fixed_t daang
else
{
float r = (float)(ydimen >> 1) - (ghoriz+ghorizcorrect);
gshang = r / Bsqrtf(r * r + ghalfx * ghalfx / (gvrcorrection * gvrcorrection));
gchang = Bsqrtf(1.f - gshang * gshang);
gshang = r / sqrtf(r * r + ghalfx * ghalfx / (gvrcorrection * gvrcorrection));
gchang = sqrtf(1.f - gshang * gshang);
ghoriz2 = 0.f;
}
ghoriz = (float)(ydimen>>1);
@ -2942,7 +2941,7 @@ static wallspriteinfo_t wsprinfo[MAXSPRITES];
void Polymost_prepare_loadboard(void)
{
Bmemset(wsprinfo, 0, sizeof(wsprinfo));
memset(wsprinfo, 0, sizeof(wsprinfo));
}
void polymost_deletesprite(int num)

View file

@ -8,7 +8,6 @@
#include "compat.h"
#include "scriptfile.h"
#include "compat.h"
#include "common.h"
#include "filesystem.h"
#include "printf.h"
@ -137,7 +136,7 @@ int scriptfile_getsymbol(scriptfile *sf, int32_t *num)
if (!t) return -1;
char * e;
int32_t v = Bstrtol(t, &e, 10);
int32_t v = strtol(t, &e, 10);
if (*e)
{
@ -322,12 +321,12 @@ scriptfile *scriptfile_fromstring(const char *string)
{
if (!string) return nullptr;
uint32_t flen = Bstrlen(string);
uint32_t flen = strlen(string);
char * tx = (char *)Xmalloc(flen + 2);
scriptfile *sf = (scriptfile *)Xmalloc(sizeof(scriptfile));
Bmemcpy(tx, string, flen);
memcpy(tx, string, flen);
tx[flen] = tx[flen+1] = 0;
scriptfile_preparse(sf,tx,flen);
@ -374,7 +373,7 @@ static char *getsymbtabspace(int32_t reqd)
int32_t scriptfile_getsymbolvalue(char const *name, int32_t *val)
{
if (Bstrlen(name) > 2)
if (strlen(name) > 2)
{
if (name[0] == '0' && tolower(name[1]) == 'x') // hex constants
{

View file

@ -317,10 +317,10 @@ static void addquad(int32_t x0, int32_t y0, int32_t z0, int32_t x1, int32_t y1,
//Extend borders vertically
for (bssize_t yy=0; yy<VOXBORDWIDTH; yy++)
{
Bmemcpy(&gvox->mytex[(shp[z].y+yy)*gvox->mytexx + shp[z].x],
memcpy(&gvox->mytex[(shp[z].y+yy)*gvox->mytexx + shp[z].x],
&gvox->mytex[(shp[z].y+VOXBORDWIDTH)*gvox->mytexx + shp[z].x],
(x+(VOXBORDWIDTH<<1))<<2);
Bmemcpy(&gvox->mytex[(shp[z].y+y+yy+VOXBORDWIDTH)*gvox->mytexx + shp[z].x],
memcpy(&gvox->mytex[(shp[z].y+y+yy+VOXBORDWIDTH)*gvox->mytexx + shp[z].x],
&gvox->mytex[(shp[z].y+y-1+VOXBORDWIDTH)*gvox->mytexx + shp[z].x],
(x+(VOXBORDWIDTH<<1))<<2);
}
@ -863,7 +863,7 @@ voxmodel_t *voxload(const char *filnam)
{
int32_t is8bit, ret;
const int32_t i = Bstrlen(filnam)-4;
const int32_t i = strlen(filnam)-4;
if (i < 0)
return NULL;
@ -905,7 +905,7 @@ voxmodel_t *loadkvxfrombuf(const char *kvxbuffer, int32_t length)
if (!buffer)
return NULL;
Bmemcpy(buffer, kvxbuffer, length);
memcpy(buffer, kvxbuffer, length);
int32_t *longptr = (int32_t*)buffer;
@ -1107,7 +1107,7 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr)
//transform to Build coords
float omat[16];
Bmemcpy(omat, mat, sizeof(omat));
memcpy(omat, mat, sizeof(omat));
f = 1.f/64.f;
g = m0.x*f; mat[0] *= g; mat[1] *= g; mat[2] *= g;

View file

@ -1098,6 +1098,10 @@ SoundHandle OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int length)
data.resize(total * 2);
}
data.resize(total);
if (total == 0)
{
return retval;
}
SoundDecoder_Close(decoder);
ALenum err;

View file

@ -40,6 +40,7 @@
#include "templates.h"
#include "palettecontainer.h"
#include "files.h"
#include "c_dispatch.h"
PaletteContainer GPalette;
FColorMatcher ColorMatcher;
@ -820,4 +821,15 @@ bool FRemapTable::AddColors(int start, int count, const uint8_t*colors, int tran
}
CCMD(exportpalette)
{
FILE* f = fopen("palette.pal", "wb");
if (!f) return;
for (int i = 0; i < 256; i++)
{
fputc(GPalette.BaseColors[i].r, f);
fputc(GPalette.BaseColors[i].g, f);
fputc(GPalette.BaseColors[i].b, f);
}
fclose(f);
}

View file

@ -56,7 +56,7 @@ public:
virtual void Resize(size_t newsize) = 0;
virtual void Map() {} // Only needed by old OpenGL but this needs to be in the interface.
virtual void Unmap() {}
void *Memory() { assert(map); return map; }
void *Memory() { return map; }
size_t Size() { return buffersize; }
};

View file

@ -176,6 +176,7 @@ CCMD(give)
if (found == -1)
{
Printf("Unable to give %s\n", argv[1]);
return;
}
if (!CheckCheatmode(true, true))
{

View file

@ -1017,10 +1017,10 @@ void NetUpdate (void)
int mod = maketic - ticdup;
int modp, j;
int svel;
int fvel;
int64_t q16avel;
int64_t q16horz;
int svel = 0;
int fvel = 0;
int64_t q16avel = 0;
int64_t q16horz = 0;
for (j = 0; j < ticdup; ++j)
{

View file

@ -909,7 +909,6 @@ int RunGame()
S_ParseSndInfo();
InitStatistics();
LoadScripts();
M_Init();
SetDefaultStrings();
if (Args->CheckParm("-sounddebug"))
C_DoCommand("stat sounddebug");
@ -924,6 +923,7 @@ int RunGame()
SetupGameButtons();
gi->app_init();
M_Init();
enginePostInit(); // This must not be done earlier!
videoInit();

View file

@ -35,7 +35,6 @@
*/
#include "c_cvars.h"
#include "common.h"
#include "gameconfigfile.h"
#include "gamecontrol.h"
#include "m_argv.h"

View file

@ -12,11 +12,6 @@ struct vec2_t
int32_t x, y;
};
struct vec2u_t
{
uint32_t x, y;
};
struct vec2f_t
{
float x, y;
@ -50,4 +45,4 @@ struct vec3_16_t
vec2_16_t vec2;
};
};
#endif
#endif

View file

@ -84,6 +84,8 @@
#include "build.h"
#include "g_input.h"
#include "mapinfo.h"
#include "automap.h"
#include "statusbar.h"
CVAR(Bool, vid_activeinbackground, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, r_ticstability, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
@ -292,6 +294,7 @@ static void GameTicker()
gameupdatetime.Reset();
gameupdatetime.Clock();
gi->Ticker();
levelTextTime--;
gameupdatetime.Unclock();
break;
@ -348,6 +351,7 @@ void Display()
twodpsp.SetSize(screen->GetWidth(), screen->GetHeight());
gi->Render();
DrawFullscreenBlends();
drawMapTitle();
break;
}
[[fallthrough]];

View file

@ -158,6 +158,7 @@ static const gamefilter games[] = {
{ "Blood", GAMEFLAG_BLOOD},
{ "ShadowWarrior", GAMEFLAG_SW},
{ "Exhumed", GAMEFLAG_POWERSLAVE|GAMEFLAG_EXHUMED},
{ "Worldtour", GAMEFLAG_WORLDTOUR},
};
// for other parts that need to filter by game name.

View file

@ -36,7 +36,6 @@
#include "palette.h"
#include "superfasthash.h"
#include "common.h"
#include "memarena.h"
#include "palettecontainer.h"
#include "palutil.h"

View file

@ -1,5 +1,18 @@
#pragma once
#include "s_soundinternal.h"
#include "m_fixed.h"
#include "vectors.h"
#include "build.h"
inline FVector3 GetSoundPos(const vec3_t *pos)
{
// converts a Build coordinate to a sound system coordinate
const float xmul = 1 / 16.f;
const float ymul = -1 / 16.f;
const float zmul = -1 / 256.f;
return { pos->x* xmul, pos->z* zmul, pos->y* ymul };
}
enum
{

View file

@ -52,6 +52,7 @@
#include "raze_sound.h"
#include "gamestruct.h"
#include "automap.h"
#include "statusbar.h"
static CompositeSavegameWriter savewriter;
static FResourceFile *savereader;
@ -75,6 +76,7 @@ static void SerializeSession(FSerializer& arc)
quoteMgr.Serialize(arc);
S_SerializeSounds(arc);
SerializeAutomap(arc);
SerializeHud(arc);
}
//=============================================================================
@ -189,16 +191,17 @@ bool OpenSaveGameForWrite(const char* filename, const char *name)
auto savesig = gi->GetSaveSig();
auto gs = gi->getStats();
FStringf timeStr("%02d:%02d", gs.timesecnd / 60, gs.timesecnd % 60);
auto lev = currentLevel;
savegameinfo.AddString("Software", buf)
("Save Version", savesig.currentsavever)
.AddString("Engine", savesig.savesig)
.AddString("Game Resource", fileSystem.GetResourceFileName(1))
.AddString("Map Name", currentLevel->DisplayName())
.AddString("Map Name", lev->DisplayName())
.AddString("Creation Time", myasctime())
.AddString("Title", name)
.AddString("Map File", currentLevel->fileName)
.AddString("Map Label", currentLevel->labelName)
.AddString("Map File", lev->fileName)
.AddString("Map Label", lev->labelName)
.AddString("Map Time", timeStr);
const char *fn = currentLevel->fileName;

View file

@ -41,7 +41,6 @@
#include "sc_man.h"
#include "resourcefile.h"
#include "printf.h"
#include "common.h"
#include "version.h"
#include "gamecontrol.h"
#include "m_argv.h"
@ -954,7 +953,7 @@ bool AddINIFile(const char* pzFile, bool bForce = false)
pINIIter = pINIIter->pNext = new INICHAIN;
pINIIter->pNext = NULL;
pINIIter->pDescription = NULL;
Bstrncpy(pINIIter->zName, pzFile, BMAX_PATH);
strncpy(pINIIter->zName, pzFile, BMAX_PATH);
for (int i = 0; i < countof(gINIDescription); i++)
{
if (!strnicmp(pINIIter->zName, gINIDescription[i].pzFilename, BMAX_PATH))

View file

@ -762,11 +762,12 @@ void DBaseStatusBar::PrintLevelStats(FLevelStats &stats)
void DBaseStatusBar::PrintAutomapInfo(FLevelStats& stats)
{
auto lev = currentLevel;
FString mapname;
if (am_showlabel)
mapname.Format(TEXTCOLOR_ESCAPESTR "%c%s: " TEXTCOLOR_ESCAPESTR "%c%s", stats.letterColor+'A', currentLevel->LabelName(), stats.standardColor+'A', currentLevel->DisplayName());
mapname.Format(TEXTCOLOR_ESCAPESTR "%c%s: " TEXTCOLOR_ESCAPESTR "%c%s", stats.letterColor+'A', lev->LabelName(), stats.standardColor+'A', lev->DisplayName());
else
mapname = currentLevel->DisplayName();
mapname = lev->DisplayName();
double y;
double scale = stats.fontscale * (am_textfont? *hud_statscale : 1); // the tiny default font used by all games here cannot be scaled for readability purposes.
@ -784,13 +785,13 @@ void DBaseStatusBar::PrintAutomapInfo(FLevelStats& stats)
{
y = 200 - stats.screenbottomspace - spacing;
}
const auto &volname = gVolumeNames[volfromlevelnum(currentLevel->levelNumber)];
const auto &volname = gVolumeNames[volfromlevelnum(lev->levelNumber)];
if (volname.IsEmpty() && am_nameontop) y = 1;
DrawText(twod, stats.font, stats.standardColor, 2 * hud_statscale, y, mapname, DTA_FullscreenScale, FSMode_ScaleToHeight, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200,
DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_KeepRatio, true, TAG_DONE);
y -= spacing;
if (!(currentLevel->flags & MI_USERMAP) && !(g_gameType & GAMEFLAG_PSEXHUMED) && volname.IsNotEmpty())
if (!(lev->flags & MI_USERMAP) && !(g_gameType & GAMEFLAG_PSEXHUMED) && volname.IsNotEmpty())
DrawText(twod, stats.font, stats.standardColor, 2 * hud_statscale, y, GStrings.localize(volname),
DTA_FullscreenScale, FSMode_ScaleToHeight, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200,
DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_KeepRatio, true, TAG_DONE);
@ -857,4 +858,51 @@ void setViewport(int viewSize)
videoSetViewableArea(x0, y0, x1, y1);
}
//============================================================================
//
//
//
//============================================================================
int levelTextTime;
void SerializeHud(FSerializer &arc)
{
if (arc.BeginObject("hud"))
{
arc("texttimer", levelTextTime)
.EndObject();
}
}
void setLevelStarted(MapRecord *mi)
{
levelTextTime = 85;
Printf(TEXTCOLOR_GOLD "%s: %s\n", mi->LabelName(), mi->DisplayName());
}
void drawMapTitle()
{
if (!hud_showmapname || levelTextTime <= 0 || M_Active())
return;
double alpha = levelTextTime > 16? 1.0 : levelTextTime / 16.;
if (alpha > 0)
{
double scale = (g_gameType & GAMEFLAG_RRALL)? 0.4 : (g_gameType & GAMEFLAG_SW)? 0.7 : 1.0;
auto text = currentLevel->DisplayName();
double x = 160 - BigFont->StringWidth(text) * scale / 2.;
double y = (g_gameType & GAMEFLAG_BLOOD)? 50 : 100 - BigFont->GetHeight()/2.;
bool shadow = true;
if (shadow)
{
DrawText(twod, BigFont, CR_UNDEFINED, x+1, y+1, text, DTA_FullscreenScale, FSMode_Fit320x200, DTA_Color, 0xff000000, DTA_Alpha, alpha / 2., DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE);
}
DrawText(twod, BigFont, CR_UNDEFINED, x, y, text, DTA_FullscreenScale, FSMode_Fit320x200, DTA_Alpha, alpha, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE);
}
}

View file

@ -344,5 +344,11 @@ enum DI_Flags
void SBar_DrawString(DBaseStatusBar* self, DHUDFont* font, const FString& string, double x, double y, int flags, int trans, double alpha, int wrapwidth, int linespacing, double scaleX, double scaleY);
void setViewport(int viewSize);
struct MapRecord;
void setLevelStarted(MapRecord *);
void drawMapTitle();
class FSerializer;
void SerializeHud(FSerializer &arc);
extern int levelTextTime;
#endif /* __SBAR_H__ */

View file

@ -898,6 +898,33 @@ bool TextOverlay::AdvanceCinemaText(double clock)
//
//---------------------------------------------------------------------------
enum EScenes
{
CINEMA_BEFORE_LEVEL_5,
CINEMA_AFTER_LEVEL_10,
CINEMA_BEFORE_LEVEL_11,
CINEMA_AFTER_LEVEL_15,
CINEMA_LOSE_SCENE,
CINEMA_AFTER_LEVEL_20,
};
struct CinemaDef
{
short tile;
short palette;
short text;
short track;
};
static CinemaDef cinemas[] = {
{ 3449, 3, 2, 2},
{ 3451, 5, 4, 3},
{ 3454, 1, 3, 4},
{ 3446, 7, 6, 6},
{ 3445, 4, 7, 7},
{ 3448, 6, 8, 8}
};
static const char * const cinpalfname[] = {
"3454.pal",
"3452.pal",
@ -948,17 +975,13 @@ class DCinema : public DScreenJob
public:
DCinema(int nVal, int checklevel = -1) : DScreenJob(fadein|fadeout)
{
static const short cinematiles[] = { 3454, 3452, 3449, 3445, 3451, 3448, 3446};
static const int8_t bxvals[] = { 4, 0, 2, 7, 3, 8, 6 };
static const int8_t dxvals[] = { 4, -1, 2, -1, 3, 8, 6 };
if (nVal < 1 || nVal >7) return;
cinematile = cinematiles[nVal-1];
currentCinemaPalette = nVal;
edx = dxvals[nVal - 1];
if (nVal < 0 || nVal >5) return;
cinematile = cinemas[nVal].tile;
currentCinemaPalette = cinemas[nVal].palette;
text.Start(0);
text.ReadyCinemaText(bxvals[nVal - 1]);
text.SetPalette(nVal);
text.ReadyCinemaText(cinemas[nVal].text);
text.SetPalette(currentCinemaPalette);
edx = cinemas[nVal].track;
check = checklevel;
}
@ -1273,9 +1296,7 @@ void DoGameOverScene(bool finallevel)
if (finallevel)
{
playCDtrack(9, false);
//FadeToWhite();
job = { Create<DCinema>(4) };
job = { Create<DCinema>(CINEMA_LOSE_SCENE) };
}
else
{
@ -1289,15 +1310,19 @@ void DoGameOverScene(bool finallevel)
void DoAfterCinemaScene(int nLevel, TArray<JobDesc>& jobs)
{
static const uint8_t nAfterScene[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 7, 0, 0, 0, 0, 6 };
if (nAfterScene[nLevel]) jobs.Push({ Create<DCinema>(nAfterScene[nLevel]) });
int scene = -1;
if (nLevel == 10) scene = CINEMA_AFTER_LEVEL_10;
if (nLevel == 15) scene = CINEMA_AFTER_LEVEL_15;
if (nLevel == 20) scene = CINEMA_AFTER_LEVEL_20;
if (scene > 0) jobs.Push({ Create<DCinema>(scene) });
if (nLevel == 19) jobs.Push({ Create<DLastLevelCinema>() });
if (nLevel == 20) jobs.Push({ Create<DExCredits>() });
}
void DoBeforeCinemaScene(int nLevel, TArray<JobDesc>& jobs)
{
if (nLevel == 5) jobs.Push({ Create<DCinema>(3) });
else if (nLevel == 11) jobs.Push({ Create<DCinema>(1, 11) });
if (nLevel == 5) jobs.Push({ Create<DCinema>(CINEMA_BEFORE_LEVEL_5) });
else if (nLevel == 11) jobs.Push({ Create<DCinema>(CINEMA_BEFORE_LEVEL_11, 11) });
}
END_PS_NS

View file

@ -18,7 +18,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h"
#include "automap.h"
#include "compat.h"
#include "common.h"
#include "engine.h"
#include "exhumed.h"
#include "sequence.h"

View file

@ -83,7 +83,6 @@ extern int SectDepth[];
extern short SectSoundSect[];
extern int SectAbove[];
uint8_t LoadLevel(int nMap);
void LoadObjects();
// light

View file

@ -17,7 +17,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//-------------------------------------------------------------------------
#include "ns.h"
#include "compat.h"
#include "common.h"
#include "engine.h"
#include "exhumed.h"
#include "sequence.h"
@ -54,8 +53,6 @@ BEGIN_PS_NS
extern short bPlayerPan;
extern short bLockPan;
extern const char* s_buildRev;
extern const char* s_buildTimestamp;
void uploadCinemaPalettes();

View file

@ -258,6 +258,7 @@ struct GameInterface : ::GameInterface
void NewGame(MapRecord *map, int skill) override;
void LevelCompleted(MapRecord *map, int skill) override;
void NextLevel(MapRecord *map, int skill) override;
bool DrawAutomapPlayer(int x, int y, int z, int a) override;
::GameStats getStats() override;

View file

@ -17,7 +17,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//-------------------------------------------------------------------------
#include "ns.h"
#include "compat.h"
#include "common.h"
#include "engine.h"
#include "exhumed.h"
#include "sequence.h"
@ -86,7 +85,7 @@ static void FinishLevel(int lnum, TArray<JobDesc> &jobs)
}
else nPlayerLives[0] = 0;
DoAfterCinemaScene(lnum, jobs);
DoAfterCinemaScene(lnum-1, jobs);
}

View file

@ -311,7 +311,7 @@ int CheckCloseRange(short nPlayer, int *x, int *y, int *z, short *nSector)
if (sqrtNum > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
sqrtNum = INT_MAX;
}

View file

@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "status.h"
#include <stdio.h>
#include <string.h>
#include "statusbar.h"
BEGIN_PS_NS
@ -78,7 +79,6 @@ uint8_t LoadLevel(int nMap)
initspritelists();
currentLevel = FindMapByLevelNum(nMap);
// init stuff
{
@ -177,10 +177,10 @@ uint8_t LoadLevel(int nMap)
void InitLevel(int level) // todo: use a map record
{
StopCD();
currentLevel = FindMapByLevelNum(level);
if (!LoadLevel(level)) {
I_Error("Can't load level %d...\n", level);
}
currentLevel = FindMapByLevelNum(level);
for (int i = 0; i < nTotalPlayers; i++)
{
@ -207,7 +207,7 @@ void InitLevel(int level) // todo: use a map record
if (nTrack != 0) nTrack--;
playCDtrack((nTrack % 8) + 11, true);
setLevelStarted(currentLevel);
}
void InitNewGame()

View file

@ -23,6 +23,8 @@ 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
@ -51,4 +53,54 @@ void DrawMap()
DrawOverheadMap(initx, inity, inita);
}
}
template<typename T> void GetSpriteExtents(T const* const pSprite, int* top, int* bottom)
{
*top = *bottom = pSprite->z;
if ((pSprite->cstat & 0x30) != 0x20)
{
int height = tileHeight(pSprite->picnum);
int center = height / 2 + tileTopOffset(pSprite->picnum);
*top -= (pSprite->yrepeat << 2) * center;
*bottom += (pSprite->yrepeat << 2) * (height - center);
}
}
bool GameInterface::DrawAutomapPlayer(int x, int y, int z, int a)
{
int nCos = z * sintable[(0 - a) & 2047];
int nSin = z * sintable[(1536 - a) & 2047];
int nCos2 = mulscale16(nCos, yxaspect);
int nSin2 = mulscale16(nSin, yxaspect);
for (int i = connecthead; i >= 0; i = connectpoint2[i])
{
int nPSprite = PlayerList[i].nSprite;
spritetype* pSprite = &sprite[nPSprite];
int px = pSprite->x - x;
int py = pSprite->y - y;
int pa = (pSprite->ang - a) & 2047;
int x1 = dmulscale16(px, nCos, -py, nSin);
int y1 = dmulscale16(py, nCos2, px, nSin2);
if (i == nLocalPlayer)// || gGameOptions.nGameType == 1)
{
int nTile = pSprite->picnum;
int ceilZ, ceilHit, floorZ, floorHit;
getzrange_old(pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, &ceilZ, &ceilHit, &floorZ, &floorHit, (pSprite->clipdist << 2) + 16, CLIPMASK0);
int nTop, nBottom;
GetSpriteExtents(pSprite, &nTop, &nBottom);
int nScale = mulscale((pSprite->yrepeat + ((floorZ - nBottom) >> 8)) * z, yxaspect, 16);
nScale = clamp(nScale, 8000, 65536 << 1);
// Players on automap
double x = xdim / 2. + x1 / double(1 << 12);
double y = ydim / 2. + y1 / double(1 << 12);
// This very likely needs fixing later
DrawTexture(twod, tileGetTexture(nTile /*+ ((leveltime >> 2) & 3)*/, true), x, y, DTA_ClipLeft, windowxy1.x, DTA_ClipTop, windowxy1.y, DTA_ScaleX, z / 1536., DTA_ScaleY, z / 1536., DTA_CenterOffset, true,
DTA_ClipRight, windowxy2.x + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & 2 ? 0.5 : 1.), TAG_DONE);
break;
}
}
return true;
}
END_PS_NS

View file

@ -692,7 +692,7 @@ int PlotCourseToSprite(int nSprite1, int nSprite2)
if (diff > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
diff = INT_MAX;
}
@ -854,7 +854,7 @@ void CreatePushBlock(int nSector)
if (sqrtNum > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
sqrtNum = INT_MAX;
}
@ -1127,7 +1127,7 @@ void SetQuake(short nSprite, int nVal)
if (sqrtNum > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
sqrtNum = INT_MAX;
}
@ -1189,7 +1189,7 @@ int AngleChase(int nSprite, int nSprite2, int ebx, int ecx, int push1)
if (sqrtNum > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
sqrtNum = INT_MAX;
}
@ -1241,7 +1241,7 @@ int AngleChase(int nSprite, int nSprite2, int ebx, int ecx, int push1)
if (sqrtNum > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
sqrtNum = INT_MAX;
}

View file

@ -2706,3 +2706,4 @@ static SavegameHelper sgh("objects",
nullptr);
END_PS_NS

View file

@ -22,7 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h"
#include "compat.h"
#include "build.h"
#include "common.h"
#include "exhumed.h"
#include "player.h"
#include "view.h"

View file

@ -183,7 +183,7 @@ void feebtag(int x, int y, int z, int nSector, short *nSprite, int nVal2, int nV
if (diff > INT_MAX)
{
Printf("%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
Printf("%s %d: overflow\n", __func__, __LINE__);
diff = INT_MAX;
}
@ -708,6 +708,7 @@ void FuncPlayer(int a, int nDamage, int nRun)
{
int var_48 = 0;
int var_40;
bool mplevel = currentLevel->levelNumber > 20;
short nPlayer = RunData[nRun].nVal;
assert(nPlayer >= 0 && nPlayer < kMaxPlayers);
@ -1211,7 +1212,7 @@ loc_1AB8E:
if (sqrtNum > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
sqrtNum = INT_MAX;
}
@ -1485,7 +1486,7 @@ do_default:
// loc_1B3C7
// CHECKME - is order of evaluation correct?
if (currentLevel->levelNumber <= 20 || (var_70 >= 25 && (var_70 <= 25 || var_70 == 50)))
if (!mplevel || (var_70 >= 25 && (var_70 <= 25 || var_70 == 50)))
{
DestroyItemAnim(nValB);
mydeletesprite(nValB);
@ -1941,7 +1942,7 @@ do_default_b:
if (weapons & var_18)
{
if (currentLevel->levelNumber > 20)
if (mplevel)
{
AddAmmo(nPlayer, WeaponInfo[var_40].nAmmoType, ebx);
}
@ -2003,7 +2004,7 @@ do_default_b:
if (weapons & var_18)
{
if (currentLevel->levelNumber > 20)
if (mplevel)
{
AddAmmo(nPlayer, WeaponInfo[var_40].nAmmoType, ebx);
}
@ -2065,7 +2066,7 @@ do_default_b:
if (weapons & var_18)
{
if (currentLevel->levelNumber > 20)
if (mplevel)
{
AddAmmo(nPlayer, WeaponInfo[var_40].nAmmoType, ebx);
}
@ -2127,7 +2128,7 @@ do_default_b:
if (weapons & var_18)
{
if (currentLevel->levelNumber > 20)
if (mplevel)
{
AddAmmo(nPlayer, WeaponInfo[var_40].nAmmoType, ebx);
}
@ -2189,7 +2190,7 @@ do_default_b:
if (weapons & var_18)
{
if (currentLevel->levelNumber > 20)
if (mplevel)
{
AddAmmo(nPlayer, WeaponInfo[var_40].nAmmoType, ebx);
}
@ -2251,7 +2252,7 @@ do_default_b:
if (weapons & var_18)
{
if (currentLevel->levelNumber > 20)
if (mplevel)
{
AddAmmo(nPlayer, WeaponInfo[var_40].nAmmoType, ebx);
}
@ -2708,7 +2709,7 @@ loc_1BD2E:
}
else
{
DoGameOverScene((currentLevel->levelNumber == 20));
DoGameOverScene(mplevel);
return;
}
}

View file

@ -262,7 +262,7 @@ int QueenAngleChase(short nSprite, short nSprite2, int val1, int val2)
if (sqrtVal > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
sqrtVal = INT_MAX;
}
@ -307,7 +307,7 @@ int QueenAngleChase(short nSprite, short nSprite2, int val1, int val2)
if (sqrtNum > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
sqrtNum = INT_MAX;
}

View file

@ -1550,7 +1550,7 @@ int runlist_CheckRadialDamage(short nSprite)
if (sqrtNum > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
sqrtNum = INT_MAX;
}

View file

@ -152,7 +152,7 @@ int BuildSnake(short nPlayer, short zVal)
if (sqrtNum > INT_MAX)
{
DPrintf(DMSG_WARNING, "%s %d: overflow\n", EDUKE32_FUNCTION, __LINE__);
DPrintf(DMSG_WARNING, "%s %d: overflow\n", __func__, __LINE__);
sqrtNum = INT_MAX;
}

View file

@ -514,12 +514,13 @@ void MoveStatus()
class DExhumedStatusBar : public DBaseStatusBar
{
DHUDFont textfont;
DHUDFont textfont, numberFont;
public:
DExhumedStatusBar()
{
textfont = { SmallFont, 1, Off, 1, 1 };
numberFont = { BigFont, 0, Off, 1, 1 };
}
private:
@ -589,6 +590,19 @@ private:
}
}
//---------------------------------------------------------------------------
//
// draws a sequence animation to the status bar
//
//---------------------------------------------------------------------------
FGameTexture * GetStatusSequencePic(short nSequence, uint16_t edx)
{
edx += SeqBase[nSequence];
int nFrameBase = FrameBase[edx];
return tileGetTexture(ChunkPict[nFrameBase]);
}
//---------------------------------------------------------------------------
//
//
@ -698,6 +712,132 @@ private:
}
}
//==========================================================================
//
// Fullscreen HUD variant #1
//
//==========================================================================
void DrawHUD2()
{
BeginHUD(320, 200, 1);
auto pp = &PlayerList[nLocalPlayer];
FString format;
FGameTexture* img;
double imgScale;
double baseScale = numberFont.mFont->GetHeight() * 0.9375;
//
// Health
//
img = GetStatusSequencePic(nStatusSeqOffset + 125, 0);
imgScale = baseScale / img->GetDisplayHeight();
DrawGraphic(img, 1.5, -1, DI_ITEM_LEFT_BOTTOM, 1., -1, -1, imgScale, imgScale);
if (!althud_flashing || pp->nHealth > 150 || (leveltime & 8))
{
int s = -8;
if (althud_flashing && pp->nHealth > 800)
s += (sintable[(leveltime << 7) & 2047] >> 10);
int intens = clamp(255 - 4 * s, 0, 255);
auto pe = PalEntry(255, intens, intens, intens);
format.Format("%d", pp->nHealth >> 3);
SBar_DrawString(this, &numberFont, format, 20, -numberFont.mFont->GetHeight()+2, DI_TEXT_ALIGN_LEFT, CR_UNTRANSLATED, 1, 0, 0, 1, 1);
}
//
// Magic
//
if (nItemSeq >= 0)
{
img = GetStatusSequencePic(nItemSeq + nStatusSeqOffset, nItemFrame);
imgScale = baseScale / img->GetDisplayHeight();
DrawGraphic(img, 70, -1, DI_ITEM_CENTER_BOTTOM, 1., -1, -1, imgScale, imgScale);
format.Format("%d", pp->nMagic / 10);
SBar_DrawString(this, &numberFont, format, 87, -numberFont.mFont->GetHeight()+2, DI_TEXT_ALIGN_LEFT, CR_UNTRANSLATED, 1, 0, 0, 1, 1);
}
//
// Weapon
//
const short ammo_sprites[] = { -1, -1 };
int weapon = pp->nCurrentWeapon;
int wicon = 0;// ammo_sprites[weapon];
int ammo = nCounterDest;// pp->WpnAmmo[weapon];
if (ammo > 0) // wicon > 0
{
format.Format("%d", ammo);
img = tileGetTexture(wicon);
imgScale = baseScale / img->GetDisplayHeight();
auto imgX = 21.125;
auto strlen = format.Len();
if (strlen > 1)
{
imgX += (imgX * 0.855) * (strlen - 1);
}
if ((!althud_flashing || leveltime & 8 || ammo > 10))// (DamageData[weapon].max_ammo / 10)))
{
SBar_DrawString(this, &numberFont, format, -4, -numberFont.mFont->GetHeight()+2, DI_TEXT_ALIGN_RIGHT, CR_UNTRANSLATED, 1, 0, 0, 1, 1);
}
//DrawGraphic(img, -imgX, -1, DI_ITEM_RIGHT_BOTTOM, 1, -1, -1, imgScale, imgScale);
}
#if 0
//
// Selected inventory item
//
img = tileGetTexture(icons[pp->InventoryNum]);
imgScale = baseScale / img->GetDisplayHeight();
int x = 165;
DrawGraphic(img, x, -1, DI_ITEM_LEFT_BOTTOM, 1, -1, -1, imgScale, imgScale);
PlayerUpdateInventoryState(pp, x + 3.0, -18.0, 1, 1);
PlayerUpdateInventoryPercent(pp, x + 3.5, -20.5, 1, 1);
#endif
//
// keys
//
uint16_t nKeys = PlayerList[nLocalPlayer].keys;
int val = 675;
int x = -134;
for (int i = 0; i < 4; i++)
{
if (nKeys & 0x1000)
{
auto tex = tileGetTexture(val);
if (tex && tex->isValid())
{
DrawGraphic(tex, x, -2, DI_ITEM_LEFT_BOTTOM, 1, -1, -1, 1, 1);
}
}
nKeys >>= 1;
val += 4;
x += 20;
}
#if 0
DisplayKeys(pp, -25, -38, 0.8625, 0.8625);
PrintLevelStats(int(baseScale + 4));
#endif
}
//---------------------------------------------------------------------------
//
// draw the full status bar
@ -706,11 +846,6 @@ private:
void DrawStatus()
{
BeginStatusBar(320, 200, 40);
char numberBuf[10] = { 0 };
char stringBuf[20] = { 0 };
char coordBuf[50] = { 0 }; // not sure of the size for this?
if (hud_size <= Hud_StbarOverlay)
{
// draw the main bar itself
@ -727,7 +862,8 @@ private:
}
else if (hud_size == Hud_full)
{
BeginHUD(320, 200, 1);
DrawHUD2();
return;
}
if (/*!bFullScreen &&*/ nNetTime)

View file

@ -1082,9 +1082,4 @@ void PrintPaused_d()
BigText(160, 100, GStrings("Game Paused"));
}
void PrintLevelName_d(double alpha)
{
BigText(160, 114, currentLevel->DisplayName(), alpha);
}
END_DUKE_NS

View file

@ -641,10 +641,5 @@ void PrintPaused_r()
BigText(160, 100, GStrings("Game Paused"), 0);
}
void PrintLevelName_r(double alpha)
{
BigText(160, 114, currentLevel->DisplayName(), 0, alpha);
}
END_DUKE_NS

View file

@ -96,7 +96,6 @@ void addspritetodelete(int spnum)
//
//
//---------------------------------------------------------------------------
void VM_Execute(native_t loop);
void ParseState::parseifelse(int condition)
{

View file

@ -84,9 +84,6 @@ void GameInterface::Ticker()
}
}
if (levelTextTime > 0)
levelTextTime--;
fi.think();
if ((everyothertime & 1) == 0)

View file

@ -76,7 +76,6 @@ int rtsplaying;
int tempwallptr;
weaponhit hittype[MAXSPRITES];
bool sound445done; // this was local state inside a function, but this must be maintained globally and serialized
int levelTextTime; // must be serialized
uint16_t frags[MAXPLAYERS][MAXPLAYERS];
player_struct ps[MAXPLAYERS];
int spriteqamount = 64;

View file

@ -62,7 +62,6 @@ extern int rtsplaying;
extern int tempwallptr;
extern weaponhit hittype[MAXSPRITES];
extern bool sound445done;
extern int levelTextTime;
extern uint16_t frags[MAXPLAYERS][MAXPLAYERS];
extern player_struct ps[MAXPLAYERS];
extern int spriteqamount;

View file

@ -1281,6 +1281,7 @@ void displayweapon_d(int snum, double smoothratio)
auto displayshrinker = [&]
{
auto shrinker = isWorldTour() ? SHRINKERWIDE : SHRINKER;
weapon_xoffset += 28;
looking_arc += 18;
if (sprite[p->i].pal == 1)
@ -1297,7 +1298,7 @@ void displayweapon_d(int snum, double smoothratio)
o, 2);
hud_drawpal(weapon_xoffset + 188 - look_anghalf,
looking_arc + 240 - gun_pos, SHRINKER - 2, gs, o, pal);
looking_arc + 240 - gun_pos, shrinker - 2, gs, o, pal);
}
else
{
@ -1307,7 +1308,7 @@ void displayweapon_d(int snum, double smoothratio)
o, 0);
hud_drawpal(weapon_xoffset + 188 - look_anghalf,
looking_arc + 240 - gun_pos, SHRINKER, gs, o, pal);
looking_arc + 240 - gun_pos, shrinker, gs, o, pal);
}
}
else
@ -1325,7 +1326,7 @@ void displayweapon_d(int snum, double smoothratio)
o, 2);
hud_drawpal(weapon_xoffset + 188 - look_anghalf,
looking_arc + 240 - gun_pos, SHRINKER - 1, gs, o, pal);
looking_arc + 240 - gun_pos, shrinker - 1, gs, o, pal);
}
else
@ -1335,7 +1336,7 @@ void displayweapon_d(int snum, double smoothratio)
o, 0);
hud_drawpal(weapon_xoffset + 188 - look_anghalf,
looking_arc + 240 - gun_pos, SHRINKER + 1, gs, o, pal);
looking_arc + 240 - gun_pos, shrinker + 1, gs, o, pal);
}
}
};
@ -1372,7 +1373,7 @@ void displayweapon_d(int snum, double smoothratio)
looking_arc += krand() & 1;
}
gun_pos -= 16;
hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, FLAMETHROWER + 1, 32, o, pal);
hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, FLAMETHROWER + 1, -32, o, pal);
hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 235 - gun_pos, FLAMETHROWER + 2 + cat_frames[*kb % 6], -32, o, pal);
}
};

View file

@ -1007,7 +1007,7 @@ void sethorizon(int snum, ESyncBits actions, double factor, fixed_t adjustment)
auto p = &ps[snum];
// Calculate adjustment as true pitch (Fixed point math really sucks...)
double horizAngle = clamp2(atan2(p->q16horiz - IntToFixed(100), IntToFixed(128)) * (512. / pi::pi()) + (factor * p->pitchAdjust) + (adjustment / 65536.), -180, 180);
double horizAngle = clamp(atan2(p->q16horiz - IntToFixed(100), IntToFixed(128)) * (512. / pi::pi()) + (factor * p->pitchAdjust) + (adjustment / 65536.), -180, 180);
if (p->return_to_center > 0 && (actions & (SB_LOOK_UP | SB_LOOK_DOWN)) == 0) // only snap back if no relevant button is pressed.
{

View file

@ -1723,7 +1723,7 @@ static void movement(int snum, ESyncBits actions, int psect, int fz, int cz, int
if ((p->posz + p->poszv) >= (fz - (i << 8))) // hit the ground
{
S_StopSound(DUKE_SCREAM, pi);
//S_StopSound(DUKE_SCREAM, pi);
if (sector[p->cursectnum].lotag != 1)
{
if (p->falling_counter > 62) quickkill(p);

View file

@ -749,7 +749,6 @@ void resettimevars(void)
{
cloudclock = 0;
ud.levelclock = 0;
levelTextTime = 85;
if (camsprite >= 0)
hittype[camsprite].temp_data[0] = 0;
}
@ -872,7 +871,7 @@ static int LoadTheMap(MapRecord *mi, struct player_struct *p, int gamemode)
return 1;
}
currentLevel = mi;
SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
SECRET_SetMapName(mi->DisplayName(), mi->name);
STAT_NewLevel(mi->fileName);
G_LoadMapHack(mi->fileName);
@ -990,7 +989,7 @@ int enterlevel(MapRecord *mi, int gamemode)
ps[myconnectindex].over_shoulder_on = 0;
clearfrags();
resettimevars(); // Here we go
Printf(TEXTCOLOR_GOLD "%s: %s\n", mi->LabelName(), mi->DisplayName());
setLevelStarted(mi);
return 0;
}

View file

@ -408,7 +408,6 @@ void GameInterface::SerializeGameState(FSerializer& arc)
("rtsplaying", rtsplaying)
("tempwallptr", tempwallptr)
("sound445done", sound445done)
("leveltexttime", levelTextTime)
.Array("players", ps, ud.multimode)
("spriteqamount", spriteqamount)
.Array("shadedsector", shadedsector, numsectors)

View file

@ -27,7 +27,6 @@ public:
};
extern int levelTextTime;
void DrawBorder();
END_DUKE_NS

View file

@ -440,7 +440,6 @@ public:
};
void PrintLevelName_d(double alpha);
void drawstatusbar_d(int snum)
{
@ -453,16 +452,6 @@ void drawstatusbar_d(int snum)
{
dsb.Statusbar(snum);
}
if (hud_showmapname && levelTextTime > 1 && !M_Active())
{
double alpha;
if (levelTextTime > 16) alpha = 1.;
else alpha = (levelTextTime) / 16.;
PrintLevelName_d(alpha);
}
}
END_DUKE_NS

View file

@ -457,15 +457,6 @@ void drawstatusbar_r(int snum)
{
dsb.Statusbar(snum);
}
if (hud_showmapname && levelTextTime > 1 && !M_Active())
{
double alpha;
if (levelTextTime > 16) alpha = 1.;
else alpha = (levelTextTime) / 16.;
PrintLevelName_r(alpha);
}
}
END_DUKE_NS

View file

@ -26,7 +26,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "ns.h"
#include "build.h"
#include "common.h"
#include "names2.h"
#include "game.h"

View file

@ -43,6 +43,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "network.h"
#include "pal.h"
#include "automap.h"
#include "statusbar.h"
#include "mytypes.h"
@ -59,7 +60,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "misc.h"
#include "jsector.h"
#include "common.h"
#include "gameconfigfile.h"
#include "printf.h"
#include "m_argv.h"
@ -391,6 +391,7 @@ void InitLevel(MapRecord *maprec)
// reset NewGame
NewGame = false;
setLevelStarted(maprec);
}
//---------------------------------------------------------------------------

View file

@ -523,7 +523,7 @@ int StdRandomRange(int range);
)
#define SIZ ARRAY_SIZE
#define SIZ countof
//

View file

@ -26,7 +26,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "ns.h"
#include "build.h"
#include "common.h"
#include "names2.h"
#include "panel.h"

View file

@ -26,7 +26,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "ns.h"
#include "build.h"
#include "common.h"
#include "mytypes.h"
#include "names2.h"

View file

@ -35,7 +35,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "gamecontrol.h"
#include "gstrings.h"
#include "common.h"
#include "v_text.h"
#include "printf.h"

View file

@ -28,7 +28,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#undef MAIN
#include "build.h"
#include "common.h"
#include "names2.h"
#include "panel.h"

View file

@ -26,7 +26,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "ns.h"
#include "build.h"
#include "common.h"
#include "mytypes.h"
#include "names2.h"

View file

@ -26,7 +26,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "ns.h"
#include "build.h"
#include "common.h"
#include "gamecontrol.h"

View file

@ -52,7 +52,7 @@ constexpr enable_if_t<!std::is_pointer<T>::value, size_t> SAVE_SIZEOF(T const &
#define SAVE_CODE(s) (void*)(s)
#define SAVE_DATA(s) { (void*)&(s), SAVE_SIZEOF(s) }
#define NUM_SAVEABLE_ITEMS(x) ARRAY_SIZE(x)
#define NUM_SAVEABLE_ITEMS(x) countof(x)
typedef struct
{

View file

@ -25,7 +25,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
//-------------------------------------------------------------------------
#include "ns.h"
#include "build.h"
#include "common.h"
#include "names2.h"
#include "panel.h"

View file

@ -25,7 +25,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
//-------------------------------------------------------------------------
#include "ns.h"
#include "build.h"
#include "common.h"
#include "names2.h"
#include "panel.h"

View file

@ -89,6 +89,7 @@ TArray<uint8_t> base64_encode(unsigned char const* bytes_to_encode, size_t in_le
while((i++ < 3))
reta.Push('=');
reta.Push(0);
}
return reta;

View file

@ -15,8 +15,8 @@ KP3 "+Look_Down"
mapbind KP- "+Shrink_Screen"
mapbind KP+ "+Enlarge_Screen"
mapbind W "+am_panup"
mapbind A "+am_pandown"
mapbind S "+am_panleft"
mapbind S "+am_pandown"
mapbind A "+am_panleft"
mapbind D "+am_panright"
KP- "sizedown"

View file

@ -578,10 +578,6 @@ OptionMenu "WeaponsControlMenu"// protected
Control "$CNTRLMNU_QUICKKICK" , "+quick_kick"
}
ifgame(Redneck, RedneckRides)
{
Control "$CNTRLMNU_PEE" , "+quick_kick"
}
ifgame(Blood)
{
Control "$CNTRLMNU_PROXIMITYBOMBS","slot 11"
@ -645,6 +641,7 @@ OptionMenu "InventoryControlsMenu"// protected
Control "$CNTRLMNU_YEEHAA" , "useitem 5"
Control "$CNTRLMNU_WHISKEY" , "useitem 1"
Control "$CNTRLMNU_MOONSHINE" , "useitem 2"
Control "$CNTRLMNU_PEE", "+quick_kick"
}
ifgame(Blood)
{
@ -1209,6 +1206,10 @@ OptionMenu SoundOptions //protected
{
Option "$SNDMNU_CDEMU", "mus_redbook", "OnOff"
}
ifgame(Worldtour)
{
Option "$SNDMNU_WTMUSIC", "wt_forcemidi", "OnOff"
}
ifgame(Duke, Nam, WW2GI, Redneck, RedneckRides, ShadowWarrior)
{
Option "$SNDMNU_AMBIENCE", "snd_ambience", "OnOff"
@ -1596,12 +1597,14 @@ OptionMenu "EngineCredits"
Submenu " ---->", "EngineCredits1a"
StaticText "Developers"
StaticText "Christoph Oelckers", 0
StaticText "Mitchell Richters", 0
StaticText ""
StaticText "Additional Developers"
StaticText "Rachael Alexanderson", 0
StaticText "Magnus Norddahl", 0
StaticText "Alexey Lysiuk", 0
StaticText ""
StaticText "The Raze team thanks the following contributors"
StaticText "Mitchell Richters", 0
StaticText "Nash Muhandes", 0
StaticText "Dynamo", 0
}
@ -1612,17 +1615,17 @@ OptionMenu "EngineCredits1a"
Submenu " ---->", "EngineCredits1b"
StaticText "Raze QA"
StaticText "sinisterseed ", 0
StaticText "Major Cooke Dynamo ", 0
StaticText "Nash Muhandes   Martin Howe       ", 0
StaticText "sinisterseed Dynamo ", 0
StaticText "SanyaWaffles      Nigel Rowand      ", 0
StaticText "Major Cooke ", 0
}
OptionMenu "EngineCredits1b"
{
title "$MNU_CREDITS"
Submenu " ---->", "EngineCredits2"
StaticText "ZDoom / GZDoom"
StaticText "ZDoom / GZDoom / ZDuke"
StaticText "Marisa \"Randi\" Heit", 0
StaticText "Braden \"Blzut3\" Obrzut", 0
StaticText ""
@ -1636,6 +1639,12 @@ OptionMenu "EngineCredits2"
{
title "$MNU_CREDITS"
Submenu " ---->", "EngineCredits2a"
StaticText "EDuke 2.0"
StaticText "Matt Saettler", 0
StaticText ""
StaticText "JFDuke / JFSW", 0
StaticText "Jonathon \"JonoF\" Fowler", 0
StaticText ""
StaticText "EDuke32 / VoidSW"
StaticText "Richard \"TerminX\" Gobeille", 0
StaticText "Evan \"Hendricks266\" Ramos", 0
@ -1659,9 +1668,6 @@ OptionMenu "EngineCredits2a"
StaticText "PCExhumed"
StaticText "Alexey \"Nuke.YKT\" Skrybykin", 0
StaticText "sirlemonhead", 0
StaticText ""
StaticText "Special thanks to"
StaticText "Jonathon \"JonoF\" Fowler", 0
}
OptionMenu "EngineCredits3"

Binary file not shown.

Binary file not shown.

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