Merge remote-tracking branch 'remotes/Github_private/back_to_basics2' into Packet

# Conflicts:
#	source/core/inputstate.cpp
#	source/exhumed/src/exhumed.h
This commit is contained in:
Christoph Oelckers 2020-08-29 01:19:48 +02:00
commit dc1f56e8f9
55 changed files with 117 additions and 217 deletions

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 "baselayer.h"
#include "common.h"
#include "common_game.h"
#include "g_input.h"
@ -791,8 +790,9 @@ static void gameTicker()
else
{
netCheckSync();
auto beforeSwapTime = I_msTimeF();
viewDrawScreen();
g_gameUpdateAndDrawTime = g_beforeSwapTime/* I_msTimeF()*/ - gameUpdateStartTime;
g_gameUpdateAndDrawTime = beforeSwapTime/* I_msTimeF()*/ - gameUpdateStartTime;
}
}

View file

@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "misc.h"
#include "db.h"
#include "mapinfo.h"
#include "gamestruct.h"
BEGIN_BLD_NS

View file

@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#pragma once
#include "baselayer.h"
#include "build.h"
#include "common.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 "baselayer.h"
#include "mmulti.h"
#include "gamecontrol.h"
#include "common_game.h"

View file

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

View file

@ -66,7 +66,7 @@ void viewInitializePrediction(void)
predict.at6f = gMe->cantJump;
predict.at70 = gMe->isRunning;
predict.at72 = gMe->isUnderwater;
predict.at71 = gMe->input.syncFlags.jump;
predict.at71 = !!(gMe->input.actions & SB_JUMP);
predict.at50 = gMe->pSprite->x;
predict.at54 = gMe->pSprite->y;
predict.at58 = gMe->pSprite->z;
@ -78,7 +78,7 @@ void viewInitializePrediction(void)
predict.at6a = gMe->pXSprite->height;
predict.at48 = gMe->posture;
predict.at4c = gMe->spin;
predict.at6e = gMe->input.syncFlags.lookCenter;
predict.at6e = !!(gMe->input.actions & SB_CENTERVIEW);
memcpy(&predict.at75,&gSpriteHit[gMe->pSprite->extra],sizeof(SPRITEHIT));
predict.at0 = gMe->bobPhase;
predict.at4 = gMe->bobAmp;
@ -135,8 +135,8 @@ static void fakeProcessInput(PLAYER *pPlayer, InputPacket *pInput)
gViewLookAdjust = 0.f;
}
predict.at70 = pInput->syncFlags.run;
predict.at71 = pInput->syncFlags.jump;
predict.at70 = !!(gMe->input.actions & SB_RUN);
predict.at71 = !!(gMe->input.actions & SB_JUMP);
if (predict.at48 == 1)
{
int x = Cos(fix16_to_int(predict.at30));
@ -190,7 +190,7 @@ static void fakeProcessInput(PLAYER *pPlayer, InputPacket *pInput)
}
if (pInput->q16avel)
predict.at30 = (predict.at30+pInput->q16avel)&0x7ffffff;
if (pInput->syncFlags.spin180)
if (pInput->actions & SB_TURNAROUND)
if (!predict.at4c)
predict.at4c = -1024;
if (predict.at4c < 0)
@ -215,11 +215,11 @@ static void fakeProcessInput(PLAYER *pPlayer, InputPacket *pInput)
case 1:
if (predict.at71)
predict.at64 -= pPosture->normalJumpZ;//0x5b05;
if (pInput->syncFlags.crouch)
if (pInput->actions & SB_CROUCH)
predict.at64 += pPosture->normalJumpZ;//0x5b05;
break;
case 2:
if (!pInput->syncFlags.crouch)
if (!(pInput->actions & SB_CROUCH))
predict.at48 = 0;
break;
default:
@ -228,7 +228,7 @@ static void fakeProcessInput(PLAYER *pPlayer, InputPacket *pInput)
else predict.at64 = pPosture->normalJumpZ;//-0xbaaaa;
predict.at6f = 1;
}
if (pInput->syncFlags.crouch)
if (pInput->actions & SB_CROUCH)
predict.at48 = 2;
break;
}

View file

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "common_game.h"
#include "levels.h"
#include "sound.h"
#include "baselayer.h"
#include "raze_music.h"
#include "raze_sound.h"
#include "gamecontrol.h"

View file

@ -690,11 +690,7 @@ void viewDrawScreen(bool sceneonly)
int yxAspect = yxaspect;
int viewingRange = viewingrange;
if (r_usenewaspect)
{
newaspect_enable = 1;
videoSetCorrectedAspect();
}
int v1 = Blrintf(double(viewingrange) * tan(r_fov * (PI / 360.)));
@ -1004,8 +1000,6 @@ void viewDrawScreen(bool sceneonly)
bDeliriumOld = bDelirium && gDeliriumBlur;
if (r_usenewaspect)
newaspect_enable = 0;
renderSetAspect(viewingRange, yxAspect);
int nClipDist = gView->pSprite->clipdist << 2;
int ve8, vec, vf0, vf4;

View file

@ -1,42 +0,0 @@
// Base services interface declaration
// for the Build Engine
// by Jonathon Fowler (jf@jonof.id.au)
#pragma once
#ifndef baselayer_h_
#define baselayer_h_
#include "compat.h"
#include "c_dispatch.h"
#include "c_cvars.h"
#include "inputstate.h"
#include "printf.h"
#include "zstring.h"
#include "vectors.h"
extern int32_t swapcomplete;
EXTERN_CVAR(Bool, r_usenewaspect)
// video
extern int32_t newaspect_enable;
extern int32_t r_fpgrouscan;
extern int32_t setaspect_new_use_dimen;
extern int32_t xres, yres, bpp;
int32_t videoCheckMode(int32_t *x, int32_t *y, int32_t c, int32_t fs, int32_t forced);
int32_t videoSetMode(int32_t x, int32_t y, int32_t c, int32_t fs);
void videoGetModes(void);
void videoShowFrame(int32_t);
int32_t videoUpdatePalette(int32_t start, int32_t num);
extern int32_t qsetmode;
#define in3dmode() (qsetmode==200)
extern int32_t g_logFlushWindow;
#include "gamestruct.h"
#endif // baselayer_h_

View file

@ -646,7 +646,6 @@ void vox_undefine(int32_t const);
void vox_deinit();
int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daupscaledydim, int32_t dabpp, int32_t daupscalefactor);
void videoNextPage(void);
void videoSetCorrectedAspect();
void videoSetViewableArea(int32_t x1, int32_t y1, int32_t x2, int32_t y2);
void renderSetAspect(int32_t daxrange, int32_t daaspect);

View file

@ -2,7 +2,6 @@
# define polymost_h_
#include "baselayer.h" // glinfo
#include "mdsprite.h"
void Polymost_CacheHitList(uint8_t* hash);

View file

@ -5,9 +5,8 @@
#include "compat.h"
#include "compat.h"
#include "baselayer.h"
#include "build.h"
#include "printf.h"
#include "matrix.h"
#include "../../glbackend/glbackend.h"
#include "textures.h"

View file

@ -7,9 +7,9 @@
// by the EDuke32 team (development@voidpoint.com)
#include "build.h"
#include "baselayer.h"
#include "clip.h"
#include "engine_priv.h"
#include "printf.h"
static int16_t clipnum;

View file

@ -8,7 +8,6 @@
#include "build.h"
#include "compat.h"
#include "engine_priv.h"
#include "baselayer.h"
#include "scriptfile.h"
#include "common.h"

View file

@ -9,7 +9,6 @@
#define engine_c_
#include "gl_load.h"
#include "baselayer.h"
#include "build.h"
#include "imagehelpers.h"
@ -28,6 +27,8 @@
#include "version.h"
#include "earcut.hpp"
#include "gamestate.h"
#include "inputstate.h"
#include "printf.h"
#ifdef USE_OPENGL
# include "mdsprite.h"
@ -79,11 +80,6 @@ static int32_t beforedrawrooms = 1;
static int32_t oxdimen = -1, oviewingrange = -1, oxyaspect = -1;
// r_usenewaspect is the cvar, newaspect_enable to trigger the new behaviour in the code
CVAR(Bool, r_usenewaspect, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
int32_t newaspect_enable=0;
int32_t r_fpgrouscan = 1;
int32_t globalflags;
static int8_t tempbuf[MAXWALLS];
@ -350,7 +346,6 @@ int16_t globalpicnum;
static int32_t globaly1, globalx2;
int16_t sectorborder[256];
int32_t ydim16, qsetmode = 0;
int16_t pointhighlight=-1, linehighlight=-1, highlightcnt=0;
int32_t halfxdim16, midydim16;
@ -2143,10 +2138,8 @@ void renderDrawMapView(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
}
}
if (r_usenewaspect)
renderSetAspect(oviewingrange, oyxaspect);
else
renderSetAspect(65536, divscale16(ydim*320, xdim*200));
}
//////////////////// LOADING AND SAVING ROUTINES ////////////////////
@ -2681,15 +2674,9 @@ int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daups
daupscaledxdim = max(320, daupscaledxdim);
daupscaledydim = max(200, daupscaledydim);
if (in3dmode() &&
(xres == daupscaledxdim) && (yres == daupscaledydim) && (bpp == dabpp))
return 0;
Bstrcpy(kensmessage,"!!!! BUILD engine&tools programmed by Ken Silverman of E.G. RI."
" (c) Copyright 1995 Ken Silverman. Summary: BUILD = Ken. !!!!");
j = bpp;
rendmode = REND_POLYMOST;
upscalefactor = 1;
@ -2713,26 +2700,9 @@ int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daups
if (searchx < 0) { searchx = halfxdimen; searchy = (ydimen>>1); }
qsetmode = 200;
return 0;
}
//
// nextpage
//
void videoNextPage(void)
{
g_beforeSwapTime = I_msTimeF();
videoShowFrame(0);
omdtims = mdtims;
mdtims = I_msTime();
for (native_t i = 0; i < MAXSPRITES + MAXUNIQHUDID; ++i)
if ((mdpause && spriteext[i].mdanimtims) || (spriteext[i].flags & SPREXT_NOMDANIM))
spriteext[i].mdanimtims += mdtims - omdtims;
}
//
// qloadkvx
//
@ -3718,30 +3688,20 @@ void rotatepoint(vec2_t const pivot, vec2_t p, int16_t const daang, vec2_t * con
p2->y = dmulscale14(p.y, dacos, p.x, dasin) + pivot.y;
}
int32_t setaspect_new_use_dimen = 0;
void videoSetCorrectedAspect()
{
if (/*r_usenewaspect &&*/ newaspect_enable && videoGetRenderMode() != REND_POLYMER)
{
// In DOS the game world is displayed with an aspect of 1.28 instead 1.333,
// meaning we have to stretch it by a factor of 1.25 instead of 1.2
// to get perfect squares
int32_t yx = (65536 * 5) / 4;
int32_t vr, y, x;
const int32_t xd = setaspect_new_use_dimen ? xdimen : xdim;
const int32_t yd = setaspect_new_use_dimen ? ydimen : ydim;
x = xd;
y = yd;
x = xdim;
y = ydim;
vr = divscale16(x*3, y*4);
renderSetAspect(vr, yx);
}
else
renderSetAspect(65536, divscale16(ydim*320, xdim*200));
}
//

View file

@ -109,7 +109,6 @@ extern int16_t searchbottomwall, searchisbottom;
extern char inpreparemirror;
extern int16_t sectorborder[256];
extern int32_t qsetmode;
extern int32_t hitallsprites;
extern int32_t xb1[MAXWALLSB];

View file

@ -5,7 +5,6 @@
#include "compat.h"
#include "build.h"
#include "pragmas.h"
#include "baselayer.h"
#include "engine_priv.h"
#include "polymost.h"
#include "mdsprite.h"
@ -18,6 +17,7 @@
#include "flatvertices.h"
#include "texturemanager.h"
#include "hw_renderstate.h"
#include "printf.h"
#include "../../glbackend/glbackend.h"
static int32_t curextra=MAXTILES;
@ -1677,6 +1677,16 @@ static void mdfree(mdmodel_t *vm)
if (vm->mdnum == 2 || vm->mdnum == 3) { md3free((md3model_t *)vm); return; }
}
static void updateModelInterpolation()
{
// sigh...
omdtims = mdtims;
mdtims = I_msTime();
for (native_t i = 0; i < MAXSPRITES + MAXUNIQHUDID; ++i)
if ((mdpause && spriteext[i].mdanimtims) || (spriteext[i].flags & SPREXT_NOMDANIM))
spriteext[i].mdanimtims += mdtims - omdtims;
}
#endif
//---------------------------------------- MD LIBRARY ENDS ----------------------------------------

View file

@ -1,8 +1,8 @@
#include "compat.h"
#include "build.h"
#include "baselayer.h"
#include "scriptfile.h"
#include "printf.h"
usermaphack_t g_loadedMapHack; // used only for the MD4 part

View file

@ -21,6 +21,7 @@ Ken Silverman's official web site: http://www.advsys.net/ken
#include "palettecontainer.h"
#include "texturemanager.h"
#include "hw_renderstate.h"
#include "printf.h"
CVAR(Bool, hw_detailmapping, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, hw_glowmapping, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)

View file

@ -7,10 +7,10 @@
#include "compat.h"
#include "scriptfile.h"
#include "baselayer.h"
#include "compat.h"
#include "common.h"
#include "filesystem.h"
#include "printf.h"
#define ISWS(x) ((x == ' ') || (x == '\t') || (x == '\r') || (x == '\n'))

View file

@ -5,7 +5,6 @@
#include "compat.h"
#include "build.h"
#include "pragmas.h"
#include "baselayer.h"
#include "engine_priv.h"
#include "polymost.h"
#include "mdsprite.h"

View file

@ -53,6 +53,9 @@ enum EKeyCodes
KEY_PGUP = 0xc9, // DIK_PRIOR
KEY_PGDN = 0xd1, // DIK_NEXT
KEY_VOLUMEDOWN = 0xAE, // DIK_VOLUMEDOWN
KEY_VOLUMEUP = 0xB0, // DIK_VOLUMEUP
KEY_FIRSTMOUSEBUTTON = 0x100,
KEY_MOUSE1 = 0x100,
KEY_MOUSE2 = 0x101,

View file

@ -91,11 +91,9 @@ CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
}
// The last remains of sdlayer.cpp
double g_beforeSwapTime;
GameInterface* gi;
int myconnectindex, numplayers;
int connecthead, connectpoint2[MAXMULTIPLAYERS];
int32_t xres = -1, yres = -1, bpp = 0;
auto vsnprintfptr = vsnprintf; // This is an inline in Visual Studio but we need an address for it to satisfy the MinGW compiled libraries.
int gameclock;
int lastTic;
@ -939,10 +937,10 @@ void app_loop()
{
try
{
I_SetFrameTime();
TickSubsystems();
twod->SetSize(screen->GetWidth(), screen->GetHeight());
twodpsp.SetSize(screen->GetWidth(), screen->GetHeight());
I_SetFrameTime();
handleevents();
updatePauseStatus();
@ -963,7 +961,7 @@ void app_loop()
soundEngine->UpdateSounds(I_GetTime());
Mus_UpdateMusic(); // must be at the end.
videoNextPage();
videoShowFrame(0);
videoSetBrightness(0); // immediately reset this so that the value doesn't stick around in the backend.
}
catch (CRecoverableError& err)

View file

@ -96,7 +96,6 @@ struct GameInterface
};
extern GameInterface* gi;
extern double g_beforeSwapTime;
void ImGui_Begin_Frame();

View file

@ -40,6 +40,7 @@
#include "statusbar.h"
#include"packet.h"
#include "gamecontrol.h"
#include "gamestruct.h"
static int WeaponToSend = 0;
ESyncBits ActionsToSend = 0;
@ -93,14 +94,32 @@ void InputState::GetMouseDelta(ControlInfo * info)
//
//==========================================================================
static int exclKeys[] = { KEY_VOLUMEDOWN, KEY_VOLUMEUP };
void InputState::AddEvent(const event_t *ev)
{
if (ev->type == EV_KeyDown || ev->type == EV_KeyUp)
{
int key = ev->data1;
bool state = ev->type == EV_KeyDown;
bool ignore = false;
KeyStatus[key] = (uint8_t)state;
if (state && !(key > KEY_LASTJOYBUTTON && key < KEY_PAD_LTHUMB_RIGHT))
// Check if key is to be excluded from setting AnyKeyStatus.
for (int i = 0; i < 2; i++)
{
if (exclKeys[i] == key)
{
ignore = true;
break;
}
}
if (key > KEY_LASTJOYBUTTON && key < KEY_PAD_LTHUMB_RIGHT)
{
ignore = true;
}
if (state && !ignore)
AnyKeyStatus = true;
}
}

View file

@ -39,7 +39,6 @@
#include "d_event.h"
#include "menu.h"
#include "v_draw.h"
#include "baselayer.h"
#include "gamecontrol.h"
#include "build.h"
#include "zstring.h"

View file

@ -52,6 +52,7 @@
#include "build.h"
#include "serializer.h"
#include "findfile.h"
#include "inputstate.h"
FSavegameManager savegameManager;

View file

@ -149,7 +149,7 @@ struct InputPacket
int16_t fvel;
fix16_t q16avel;
fix16_t q16horz;
fix16_t q16aimvel; // only used by SW
fix16_t q16horiz; // only used by SW
fix16_t q16ang; // only used by SW
ESyncBits actions;

View file

@ -44,6 +44,7 @@
#include "m_swap.h"
#include "v_colortables.h"
#include "v_font.h"
#include "printf.h"
#include "../../glbackend/glbackend.h"
LookupTableInfo lookups;

View file

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

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 "baselayer.h"
#include "common.h"
#include "engine.h"
#include "exhumed.h"

View file

@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define __exhumed_h__
#include "compat.h"
#include "baselayer.h"
#include "v_text.h"
#include "printf.h"
#include "gamecvars.h"
@ -252,7 +251,7 @@ struct GameInterface : ::GameInterface
bool SaveGame(FSaveGameNode* sv) override;
bool CanSave() override;
ReservedSpace GetReservedScreenSpace(int viewsize) override { return { 0, 24 }; }
void QuitToTitle();
void QuitToTitle() override;
FString statFPS() 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 "baselayer.h"
#include "common.h"
#include "engine.h"
#include "exhumed.h"

View file

@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "names.h"
#include <cstdio>
#include <cstring>
#include "baselayer.h"
#include "c_bind.h"
#include "sound.h"
#include "v_2ddrawer.h"

View file

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

View file

@ -222,9 +222,7 @@ static void analyzesprites()
void ResetView()
{
//videoSetGameMode(gSetup.fullscreen, gSetup.xdim, gSetup.ydim, gSetup.bpp, 0);
EraseScreen(overscanindex);
//videoUpdatePalette(0, 256);
#ifdef USE_OPENGL
videoTintBlood(0, 0, 0);
#endif
@ -360,14 +358,9 @@ void DrawView(double smoothRatio, bool sceneonly)
int const viewingRange = viewingrange;
int const vr = Blrintf(65536.f * tanf(r_fov * (fPI / 360.f)));
if (r_usenewaspect)
{
newaspect_enable = 1;
videoSetCorrectedAspect();
renderSetAspect(mulscale16(vr, viewingrange), yxaspect);
}
else
renderSetAspect(vr, yxaspect);
if (HavePLURemap())
{
@ -402,11 +395,8 @@ void DrawView(double smoothRatio, bool sceneonly)
}
}
if (r_usenewaspect)
{
newaspect_enable = 0;
renderSetAspect(viewingRange, divscale16(ydim * 8, xdim * 5));
}
if (nFreeze)
{

View file

@ -373,6 +373,8 @@ enum miscConstants
MAXTORCHSECTORS = 64,
MAXGEOSECTORS = 64,
CRACK_TIME = 777,
DUKE3D_NO_WIDESCREEN_PINNING = 1 << 0,
};

View file

@ -1,8 +1,6 @@
#ifndef duke3d_h_
#define duke3d_h_
// JBF
#include "baselayer.h"
#include "build.h"
#include "compat.h"

View file

@ -31,7 +31,6 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
#include "ns.h" // Must come before everything else!
#include "duke3d.h"
#include "baselayer.h"
#include "m_argv.h"
#include "mapinfo.h"
#include "texturemanager.h"

View file

@ -32,7 +32,6 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
#include "ns.h" // Must come before everything else!
#include "duke3d.h"
#include "baselayer.h"
#include "m_argv.h"
#include "mapinfo.h"
#include "texturemanager.h"

View file

@ -31,10 +31,10 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
#include "gamestate.h"
#include "duke3d.h"
#include "sbar.h"
#include "baselayer.h"
#include "m_argv.h"
#include "mapinfo.h"
#include "texturemanager.h"
#include "glbackend/glbackend.h"
BEGIN_DUKE_NS
@ -329,7 +329,7 @@ bool GameTicker()
int const currentTic = I_GetTime();
gameclock = I_GetBuildTime();
if (playrunning() && currentTic - lastTic >= 1)
while (playrunning() && currentTic - lastTic >= 1)
{
lastTic = currentTic;

View file

@ -732,7 +732,7 @@ void playerCrouch(int snum)
if (GetGameVarID(g_iReturnVarID, p->i, snum) == 0)
{
p->posz += (2048 + 768);
p->crack_time = 777;
p->crack_time = CRACK_TIME;
}
}

View file

@ -112,7 +112,7 @@ void shoot_d(int i, int atwith)
sz = ps[p].posz + ps[p].pyoff + (4 << 8);
sa = ps[p].getang();
ps[p].crack_time = 777;
ps[p].crack_time = CRACK_TIME;
}
else
@ -1356,7 +1356,7 @@ int doincrements_d(struct player_struct* p)
if (p->crack_time == 0)
{
p->knuckle_incs = 1;
p->crack_time = 777;
p->crack_time = CRACK_TIME;
}
}
@ -1590,7 +1590,7 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
if (GetGameVarID(g_iReturnVarID, pi, snum) == 0)
{
p->posz -= j;
p->crack_time = 777;
p->crack_time = CRACK_TIME;
}
}
@ -1602,7 +1602,7 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
if (GetGameVarID(g_iReturnVarID, pi, snum) == 0)
{
p->posz += j;
p->crack_time = 777;
p->crack_time = CRACK_TIME;
}
}
@ -1949,7 +1949,7 @@ static void fireweapon(int snum)
auto p = &ps[snum];
int pi = p->i;
p->crack_time = 777;
p->crack_time = CRACK_TIME;
if (p->holster_weapon == 1)
{
@ -2793,8 +2793,6 @@ void processinput_d(int snum)
// may still be needed later for demo recording
applylook(snum, 1, sb_avel);
p->crack_time = 777;
}
if (p->spritebridge == 0)
@ -2838,7 +2836,7 @@ void processinput_d(int snum)
if (p->posxv || p->posyv || sb_fvel || sb_svel)
{
p->crack_time = 777;
p->crack_time = CRACK_TIME;
k = sintable[p->bobcounter & 2047] >> 12;

View file

@ -107,7 +107,7 @@ void shoot_r(int i, int atwith)
sz = ps[p].posz + ps[p].pyoff + (4 << 8);
sa = ps[p].getang();
if (isRRRA()) ps[p].crack_time = 777;
if (isRRRA()) ps[p].crack_time = CRACK_TIME;
}
else
{
@ -1288,7 +1288,7 @@ int doincrements_r(struct player_struct* p)
if (p->crack_time == 0)
{
p->knuckle_incs = 1;
p->crack_time = 777;
p->crack_time = CRACK_TIME;
}
}
@ -2616,7 +2616,7 @@ static void fireweapon(int snum)
auto p = &ps[snum];
int pi = p->i;
p->crack_time = 777;
p->crack_time = CRACK_TIME;
if (p->holster_weapon == 1)
{
@ -2998,7 +2998,7 @@ static void operateweapon(int snum, ESyncBits actions, EDukeSyncBits sb_snum, in
S_PlayActorSound(SHOTGUN_COCK, pi);
break;
case 38:
p->kickback_pic = 0;
p->okickback_pic = p->kickback_pic = 0;
p->shotgun_state[0] = 0;
p->shotgun_state[1] = 0;
return;
@ -3010,7 +3010,7 @@ static void operateweapon(int snum, ESyncBits actions, EDukeSyncBits sb_snum, in
{
case 16:
checkavailweapon(p);
p->kickback_pic = 0;
p->okickback_pic = p->kickback_pic = 0;
p->shotgun_state[0] = 1;
p->shotgun_state[1] = 0;
return;
@ -3704,8 +3704,6 @@ void processinput_r(int snum)
// may still be needed later for demo recording
applylook(snum, 1, sb_avel);
p->crack_time = 777;
}
if (p->spritebridge == 0)
@ -3731,7 +3729,7 @@ void processinput_r(int snum)
if (p->posxv || p->posyv || sb_fvel || sb_svel)
{
p->crack_time = 777;
p->crack_time = CRACK_TIME;
k = sintable[p->bobcounter & 2047] >> 12;

View file

@ -144,7 +144,7 @@ void fireweapon_ww(int snum)
auto p = &ps[snum];
int pi = p->i;
p->crack_time = 777;
p->crack_time = CRACK_TIME;
if (p->holster_weapon == 1)
{

View file

@ -30,7 +30,6 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
#include "duke3d.h"
#include "sbar.h"
#include "baselayer.h"
#include "m_argv.h"
#include "mapinfo.h"
#include "texturemanager.h"

View file

@ -483,7 +483,6 @@ void displayrooms(int snum, double smoothratio)
g_visibility = p->visibility;
newaspect_enable = 1;
videoSetCorrectedAspect();
sect = p->cursectnum;

View file

@ -48,6 +48,7 @@
#include "hw_viewpointbuffer.h"
#include "hw_renderstate.h"
#include "hw_cvars.h"
#include "gamestruct.h"
CVAR(Bool, gl_texture, true, 0)

View file

@ -362,5 +362,5 @@ void renderSetVisibility(float v);
void renderBeginScene();
void renderFinishScene();
void DrawRateStuff();
void videoShowFrame(int32_t);
void hud_drawsprite(double sx, double sy, int z, double a, int picnum, int dashade, int dapalnum, int dastat, double alpha = 1);

View file

@ -1796,11 +1796,8 @@ drawscreen(PLAYERp pp, double smoothratio)
JS_DrawCameras(pp, tx, ty, tz);
}
if (r_usenewaspect)
{
newaspect_enable = 1;
videoSetCorrectedAspect();
}
renderSetAspect(Blrintf(float(viewingrange)* tanf(r_fov* (fPI / 360.f))), yxaspect);
OverlapDraw = TRUE;
DrawOverlapRoom(tx, ty, tz, tq16ang, tq16horiz, tsectnum);
@ -1822,11 +1819,8 @@ drawscreen(PLAYERp pp, double smoothratio)
post_analyzesprites();
renderDrawMasks();
if (r_usenewaspect)
{
newaspect_enable = 0;
renderSetAspect(viewingRange, divscale16(ydim * 8, xdim * 5));
}
UpdatePanel(smoothratio);
#define SLIME 2305

View file

@ -29,10 +29,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#define MAIN
#define QUIET
#include "build.h"
#include "baselayer.h"
#include "baselayer.h"
#include "names2.h"
#include "panel.h"
#include "game.h"

View file

@ -38,7 +38,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "build.h"
#include "compat.h"
#include "baselayer.h"
#include "mmulti.h"
#include "mytypes.h"
@ -49,6 +48,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "c_cvars.h"
#include "mapinfo.h"
#include "gamecontrol.h"
#include "gamestruct.h"
#include "packet.h"
EXTERN_CVAR(Bool, sw_ninjahack)

View file

@ -68,7 +68,7 @@ double elapsedInputTicks;
double scaleAdjustmentToInterval(double x) { return x * (120 / synctics) / (1000.0 / elapsedInputTicks); }
void DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16angvel);
void DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel);
void DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16horz);
void GameInterface::ResetFollowPos(bool)
@ -187,7 +187,7 @@ getinput(InputPacket *loc, SWBOOL tied)
keymove = 0;
int32_t svel = 0, vel = 0;
fix16_t q16aimvel = 0, q16angvel = 0;
fix16_t q16horz = 0, q16angvel = 0;
if (buttonMap.ButtonDown(gamefunc_Strafe) && !pp->sop)
{
@ -201,14 +201,14 @@ getinput(InputPacket *loc, SWBOOL tied)
}
if (mouseaim)
q16aimvel = fix16_ssub(q16aimvel, fix16_from_float(info.mousey / aimvelScale));
q16horz = fix16_ssub(q16horz, fix16_from_float(info.mousey / aimvelScale));
else
vel -= (info.mousey * ticrateScale) * 8.f;
if (in_mouseflip)
q16aimvel = -q16aimvel;
q16horz = -q16horz;
q16aimvel -= fix16_from_dbl(scaleAdjustmentToInterval((info.dpitch * ticrateScale) / aimvelScale));
q16horz -= fix16_from_dbl(scaleAdjustmentToInterval((info.dpitch * ticrateScale) / aimvelScale));
svel -= info.dx * keymove;
vel -= info.dz * keymove;
@ -268,13 +268,13 @@ getinput(InputPacket *loc, SWBOOL tied)
vel += -keymove;
q16angvel = fix16_clamp(q16angvel, -fix16_from_int(MAXANGVEL), fix16_from_int(MAXANGVEL));
q16aimvel = fix16_clamp(q16aimvel, -fix16_from_int(MAXHORIZVEL), fix16_from_int(MAXHORIZVEL));
q16horz = fix16_clamp(q16horz, -fix16_from_int(MAXHORIZVEL), fix16_from_int(MAXHORIZVEL));
void DoPlayerTeleportPause(PLAYERp pp);
if (PedanticMode)
{
q16angvel = fix16_floor(q16angvel);
q16aimvel = fix16_floor(q16aimvel);
q16horz = fix16_floor(q16horz);
}
else
{
@ -283,7 +283,7 @@ getinput(InputPacket *loc, SWBOOL tied)
if (TEST(pp->Flags2, PF2_INPUT_CAN_TURN))
DoPlayerTurn(pp, &pp->camq16ang, q16angvel);
if (TEST(pp->Flags2, PF2_INPUT_CAN_AIM))
DoPlayerHorizon(pp, &pp->camq16horiz, q16aimvel);
DoPlayerHorizon(pp, &pp->camq16horiz, q16horz);
pp->oq16ang += pp->camq16ang - prevcamq16ang;
pp->oq16horiz += pp->camq16horiz - prevcamq16horiz;
}
@ -307,7 +307,7 @@ getinput(InputPacket *loc, SWBOOL tied)
}
loc->q16avel += q16angvel;
loc->q16aimvel += q16aimvel;
loc->q16horz += q16horz;
if (!CommEnabled)
{

View file

@ -26,7 +26,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "ns.h"
#include "build.h"
#include "baselayer.h"
#include "mmulti.h"
#include "gamecontrol.h"
@ -80,9 +79,9 @@ typedef struct
int32_t fvel;
int32_t svel;
fix16_t q16avel;
fix16_t q16aimvel;
fix16_t q16ang;
fix16_t q16horz;
fix16_t q16ang;
fix16_t q16horiz;
int32_t bits;
ESyncBits actions;
} SW_AVERAGE_PACKET;
@ -201,9 +200,9 @@ UpdateInputs(void)
AveragePacket.fvel += loc.fvel;
AveragePacket.svel += loc.svel;
AveragePacket.q16avel += loc.q16avel;
AveragePacket.q16aimvel += loc.q16aimvel;
AveragePacket.q16horz += loc.q16horz;
AveragePacket.q16ang = Player[myconnectindex].camq16ang;
AveragePacket.q16horz = Player[myconnectindex].camq16horiz;
AveragePacket.q16horiz = Player[myconnectindex].camq16horiz;
SET(AveragePacket.bits, loc.bits);
SET(AveragePacket.actions, loc.actions);
// The above would or the weapon numbers together. Undo that now. The last one should win.
@ -227,9 +226,9 @@ UpdateInputs(void)
loc.fvel = AveragePacket.fvel / MovesPerPacket;
loc.svel = AveragePacket.svel / MovesPerPacket;
loc.q16avel = fix16_div(AveragePacket.q16avel, fix16_from_int(MovesPerPacket));
loc.q16aimvel = fix16_div(AveragePacket.q16aimvel, fix16_from_int(MovesPerPacket));
loc.q16horz = fix16_div(AveragePacket.q16horz, fix16_from_int(MovesPerPacket));
loc.q16ang = AveragePacket.q16ang;
loc.q16horz = AveragePacket.q16horz;
loc.q16horiz = AveragePacket.q16horiz;
loc.bits = AveragePacket.bits;
loc.actions = AveragePacket.actions;

View file

@ -1911,7 +1911,7 @@ PlayerAutoLook(PLAYERp pp)
extern int PlaxCeilGlobZadjust, PlaxFloorGlobZadjust;
void
DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel)
DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16horz)
{
int i;
#define HORIZ_SPEED (16)
@ -1922,7 +1922,7 @@ DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel)
if (!PedanticMode && (pq16horiz == &pp->q16horiz))
{
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
pp->q16horiz = pp->input.q16horz;
pp->q16horiz = pp->input.q16horiz;
if ((pp == &Player[myconnectindex]) || (pp == ppp)) // No coop view?
pp->oq16horiz = pp->q16horiz;
return;
@ -1932,9 +1932,9 @@ DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel)
if (cl_slopetilting)
PlayerAutoLook(pp);
if (q16aimvel)
if (q16horz)
{
pp->q16horizbase += q16aimvel;
pp->q16horizbase += q16horz;
SET(pp->Flags, PF_LOCK_HORIZ | PF_LOOKING);
}
@ -2698,7 +2698,7 @@ DoPlayerMove(PLAYERp pp)
DoPlayerSetWadeDepth(pp);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
if (pp->cursectnum >= 0 && TEST(sector[pp->cursectnum].extra, SECTFX_DYNAMIC_AREA))
{
@ -2906,7 +2906,7 @@ DoPlayerMoveBoat(PLAYERp pp)
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->posx, pp->posy);
pp->cursectnum = save_sectnum; // for speed
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
}
void DoTankTreads(PLAYERp pp)
@ -3385,7 +3385,7 @@ DoPlayerMoveTank(PLAYERp pp)
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->posx, pp->posy);
pp->cursectnum = save_sectnum; // for speed
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
DoTankTreads(pp);
}
@ -3402,7 +3402,7 @@ DoPlayerMoveTurret(PLAYERp pp)
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->sop->xmid, pp->sop->ymid);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
}
void
@ -3979,7 +3979,7 @@ DoPlayerClimb(PLAYERp pp)
sp->z = pp->posz + PLAYER_HEIGHT;
changespritesect(pp->PlayerSprite, pp->cursectnum);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
if (FAF_ConnectArea(pp->cursectnum))
{
@ -7407,7 +7407,7 @@ void ChopsCheck(PLAYERp pp)
{
if (!M_Active() && !TEST(pp->Flags, PF_DEAD) && !pp->sop_riding && numplayers <= 1)
{
if ((pp->input.bits|pp->input.fvel|pp->input.svel|pp->input.q16avel|pp->input.q16aimvel) ||
if ((pp->input.bits|pp->input.fvel|pp->input.svel|pp->input.q16avel|pp->input.q16horz) ||
TEST(pp->Flags, PF_CLIMBING|PF_FALLING|PF_DIVING))
{
// Hit a input key or other reason to stop chops