mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 12:30:46 +00:00
Merge branch 'master' into newrenderer2
This commit is contained in:
commit
55ad51ee1f
29 changed files with 264 additions and 231 deletions
20
.github/workflows/continuous_integration.yml
vendored
20
.github/workflows/continuous_integration.yml
vendored
|
@ -25,43 +25,43 @@ jobs:
|
||||||
- {
|
- {
|
||||||
name: "macOS",
|
name: "macOS",
|
||||||
os: macos-10.15,
|
os: macos-10.15,
|
||||||
extra_options: "-DDYN_FLUIDSYNTH=OFF -DDYN_OPENAL=OFF -DDYN_SNDFILE=OFF -DDYN_MPG123=OFF",
|
|
||||||
deps_cmdline: "brew install libvpx",
|
deps_cmdline: "brew install libvpx",
|
||||||
build_type: "Release"
|
build_type: "Release"
|
||||||
}
|
}
|
||||||
- {
|
- {
|
||||||
name: "macOS",
|
name: "macOS",
|
||||||
os: macos-10.15,
|
os: macos-10.15,
|
||||||
|
extra_options: "-DDYN_FLUIDSYNTH=OFF -DDYN_OPENAL=OFF -DDYN_SNDFILE=OFF -DDYN_MPG123=OFF",
|
||||||
deps_cmdline: "brew install libvpx fluidsynth mpg123 libsndfile",
|
deps_cmdline: "brew install libvpx fluidsynth mpg123 libsndfile",
|
||||||
build_type: "Debug"
|
build_type: "Debug"
|
||||||
}
|
}
|
||||||
- {
|
- {
|
||||||
name: "Linux GCC 7",
|
name: "Linux GCC 7",
|
||||||
os: ubuntu-20.04,
|
os: ubuntu-20.04,
|
||||||
extra_options: "-DCMAKE_C_COMPILER=/usr/bin/gcc-7 -DCMAKE_CXX_COMPILER=/usr/bin/g++-7",
|
extra_options: "-DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7",
|
||||||
deps_cmdline: "sudo apt update && sudo apt install libsdl2-dev libvpx-dev libgtk2.0-dev gcc-7 g++-7",
|
deps_cmdline: "sudo apt update && sudo apt install g++-7 libsdl2-dev libvpx-dev libgtk2.0-dev",
|
||||||
build_type: "RelWithDebInfo"
|
build_type: "RelWithDebInfo"
|
||||||
}
|
}
|
||||||
- {
|
- {
|
||||||
name: "Linux GCC 10",
|
name: "Linux GCC 10",
|
||||||
os: ubuntu-20.04,
|
os: ubuntu-20.04,
|
||||||
extra_options: "-DCMAKE_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10",
|
extra_options: "-DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10",
|
||||||
deps_cmdline: "sudo apt update && sudo apt install libsdl2-dev libvpx-dev libgtk-3-dev",
|
deps_cmdline: "sudo apt update && sudo apt install g++-10 libsdl2-dev libvpx-dev libgtk-3-dev",
|
||||||
build_type: "MinSizeRel"
|
build_type: "MinSizeRel"
|
||||||
}
|
}
|
||||||
- {
|
- {
|
||||||
name: "Linux Clang 6",
|
name: "Linux Clang 6",
|
||||||
os: ubuntu-20.04,
|
os: ubuntu-20.04,
|
||||||
extra_options: "-DCMAKE_C_COMPILER=/usr/bin/clang-6.0 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-6.0 \
|
extra_options: "-DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 \
|
||||||
-DDYN_FLUIDSYNTH=OFF -DDYN_OPENAL=OFF -DDYN_SNDFILE=OFF -DDYN_MPG123=OFF",
|
-DDYN_FLUIDSYNTH=OFF -DDYN_OPENAL=OFF -DDYN_SNDFILE=OFF -DDYN_MPG123=OFF",
|
||||||
deps_cmdline: "sudo apt update && sudo apt install clang-6.0 libsdl2-dev libvpx-dev libopenal-dev libfluidsynth-dev libmpg123-dev libsndfile1-dev",
|
deps_cmdline: "sudo apt update && sudo apt install clang-6.0 libsdl2-dev libvpx-dev libopenal-dev libfluidsynth-dev libmpg123-dev libsndfile1-dev",
|
||||||
build_type: "Debug"
|
build_type: "Debug"
|
||||||
}
|
}
|
||||||
- {
|
- {
|
||||||
name: "Linux Clang 10",
|
name: "Linux Clang 11",
|
||||||
os: ubuntu-20.04,
|
os: ubuntu-20.04,
|
||||||
extra_options: "-DCMAKE_C_COMPILER=/usr/bin/clang-10 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-10",
|
extra_options: "-DCMAKE_C_COMPILER=clang-11 -DCMAKE_CXX_COMPILER=clang++-11",
|
||||||
deps_cmdline: "sudo apt update && sudo apt install libsdl2-dev libvpx-dev",
|
deps_cmdline: "sudo apt update && sudo apt install clang-11 libsdl2-dev libvpx-dev",
|
||||||
build_type: "Release"
|
build_type: "Release"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ jobs:
|
||||||
cd build
|
cd build
|
||||||
git clone https://github.com/coelckers/ZMusic.git
|
git clone https://github.com/coelckers/ZMusic.git
|
||||||
cd ZMusic
|
cd ZMusic
|
||||||
git checkout 1.1.4
|
git checkout 1.1.6
|
||||||
cd ..
|
cd ..
|
||||||
cmake -B zmusic_build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_INSTALL_PREFIX=`pwd`/zmusic_install ${{ matrix.config.extra_options }} ZMusic
|
cmake -B zmusic_build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_INSTALL_PREFIX=`pwd`/zmusic_install ${{ matrix.config.extra_options }} ZMusic
|
||||||
cmake --build zmusic_build --target install --parallel 3
|
cmake --build zmusic_build --target install --parallel 3
|
||||||
|
|
|
@ -181,6 +181,10 @@ enum
|
||||||
CSTAT_SPRITE_RESERVED5 = 1u<<14u, // used by Duke 3D (Polymer), Shadow Warrior, Blood
|
CSTAT_SPRITE_RESERVED5 = 1u<<14u, // used by Duke 3D (Polymer), Shadow Warrior, Blood
|
||||||
|
|
||||||
CSTAT_SPRITE_INVISIBLE = 1u<<15u,
|
CSTAT_SPRITE_INVISIBLE = 1u<<15u,
|
||||||
|
|
||||||
|
// Raze extensions, using the higher bits to avoid conflitcs with the reserved and undocumented bits above.
|
||||||
|
CSTAT_SPRITE_MDLROTATE = 1u<<16u, // Only for tsprites: rotate if this is a model or voxel.
|
||||||
|
|
||||||
};
|
};
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -212,6 +216,7 @@ enum
|
||||||
CSTAT_WALL_RESERVED1 = 1u<<13u,
|
CSTAT_WALL_RESERVED1 = 1u<<13u,
|
||||||
CSTAT_WALL_RESERVED2 = 1u<<14u, // used by Shadow Warrior, Blood
|
CSTAT_WALL_RESERVED2 = 1u<<14u, // used by Shadow Warrior, Blood
|
||||||
CSTAT_WALL_RESERVED3 = 1u<<15u, // used by Shadow Warrior, Blood
|
CSTAT_WALL_RESERVED3 = 1u<<15u, // used by Shadow Warrior, Blood
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -234,7 +239,7 @@ struct spritetype
|
||||||
};
|
};
|
||||||
vec3_t opos;
|
vec3_t opos;
|
||||||
};
|
};
|
||||||
uint16_t cstat;
|
uint32_t cstat;
|
||||||
int16_t picnum;
|
int16_t picnum;
|
||||||
int8_t shade;
|
int8_t shade;
|
||||||
uint8_t pal, clipdist, blend;
|
uint8_t pal, clipdist, blend;
|
||||||
|
|
|
@ -210,7 +210,7 @@ EXTERN voxmodel_t *voxmodels[MAXVOXELS];
|
||||||
|
|
||||||
void voxfree(voxmodel_t *m);
|
void voxfree(voxmodel_t *m);
|
||||||
voxmodel_t *voxload(int lumpnum);
|
voxmodel_t *voxload(int lumpnum);
|
||||||
int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr);
|
int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr, bool rotate);
|
||||||
|
|
||||||
#endif // defined USE_OPENGL
|
#endif // defined USE_OPENGL
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
extern tspritetype pm_tsprite[MAXSPRITESONSCREEN];
|
extern tspritetype pm_tsprite[MAXSPRITESONSCREEN];
|
||||||
extern int pm_spritesortcnt;
|
extern int pm_spritesortcnt;
|
||||||
|
extern int pm_smoothratio;
|
||||||
|
|
||||||
|
|
||||||
namespace Polymost
|
namespace Polymost
|
||||||
|
|
|
@ -1532,7 +1532,7 @@ int32_t polymost_mddraw(tspriteptr_t tspr)
|
||||||
mdmodel_t *const vm = models[tile2model[Ptile2tile(tspr->picnum,
|
mdmodel_t *const vm = models[tile2model[Ptile2tile(tspr->picnum,
|
||||||
(tspr->owner >= MAXSPRITES) ? tspr->pal : sprite[tspr->owner].pal)].modelid];
|
(tspr->owner >= MAXSPRITES) ? tspr->pal : sprite[tspr->owner].pal)].modelid];
|
||||||
if (vm->mdnum == 1)
|
if (vm->mdnum == 1)
|
||||||
return polymost_voxdraw((voxmodel_t *)vm,tspr);
|
return polymost_voxdraw((voxmodel_t *)vm,tspr, false); // can't access rotating info anymore
|
||||||
else if (vm->mdnum == 3)
|
else if (vm->mdnum == 3)
|
||||||
return polymost_md3draw((md3model_t *)vm,tspr);
|
return polymost_md3draw((md3model_t *)vm,tspr);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -25,6 +25,7 @@ Ken Silverman's official web site: http://www.advsys.net/ken
|
||||||
#include "gamefuncs.h"
|
#include "gamefuncs.h"
|
||||||
#include "hw_drawinfo.h"
|
#include "hw_drawinfo.h"
|
||||||
#include "gamestruct.h"
|
#include "gamestruct.h"
|
||||||
|
#include "gamestruct.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -46,6 +47,7 @@ CVARD(Bool, hw_animsmoothing, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "enable/di
|
||||||
CVARD(Bool, hw_models, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "enable/disable model rendering")
|
CVARD(Bool, hw_models, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "enable/disable model rendering")
|
||||||
CVARD(Bool, hw_parallaxskypanning, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "enable/disable parallaxed floor/ceiling panning when drawing a parallaxing sky")
|
CVARD(Bool, hw_parallaxskypanning, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "enable/disable parallaxed floor/ceiling panning when drawing a parallaxing sky")
|
||||||
CVARD(Float, hw_shadescale, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "multiplier for shading")
|
CVARD(Float, hw_shadescale, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "multiplier for shading")
|
||||||
|
int pm_smoothratio;
|
||||||
|
|
||||||
|
|
||||||
//{ "r_yshearing", "enable/disable y-shearing", (void*)&r_yshearing, CVAR_BOOL, 0, 1 }, disabled because not fully functional
|
//{ "r_yshearing", "enable/disable y-shearing", (void*)&r_yshearing, CVAR_BOOL, 0, 1 }, disabled because not fully functional
|
||||||
|
@ -2747,13 +2749,15 @@ void polymost_drawsprite(int32_t snum)
|
||||||
{
|
{
|
||||||
if ((tspr->cstat & 48) != 48 && tiletovox[tspr->picnum] >= 0 && voxmodels[tiletovox[tspr->picnum]])
|
if ((tspr->cstat & 48) != 48 && tiletovox[tspr->picnum] >= 0 && voxmodels[tiletovox[tspr->picnum]])
|
||||||
{
|
{
|
||||||
if (polymost_voxdraw(voxmodels[tiletovox[tspr->picnum]], tspr)) return;
|
int num = tiletovox[tspr->picnum];
|
||||||
|
if (polymost_voxdraw(voxmodels[num], tspr, voxrotate[num>>3] & (1<<(num&7)))) return;
|
||||||
break; // else, render as flat sprite
|
break; // else, render as flat sprite
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((tspr->cstat & 48) == 48 && tspr->picnum < MAXVOXELS && voxmodels[tspr->picnum])
|
if ((tspr->cstat & 48) == 48 && tspr->picnum < MAXVOXELS && voxmodels[tspr->picnum])
|
||||||
{
|
{
|
||||||
polymost_voxdraw(voxmodels[tspr->picnum], tspr);
|
int num = tspr->picnum;
|
||||||
|
polymost_voxdraw(voxmodels[tspr->picnum], tspr, voxrotate[num >> 3] & (1 << (num & 7)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "hw_renderstate.h"
|
#include "hw_renderstate.h"
|
||||||
#include "texturemanager.h"
|
#include "texturemanager.h"
|
||||||
#include "voxels.h"
|
#include "voxels.h"
|
||||||
|
#include "gamecontrol.h"
|
||||||
#include "hw_models.h"
|
#include "hw_models.h"
|
||||||
#include "printf.h"
|
#include "printf.h"
|
||||||
|
|
||||||
|
@ -50,7 +51,7 @@ voxmodel_t *voxload(int lumpnum)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Draw voxel model as perfect cubes
|
//Draw voxel model as perfect cubes
|
||||||
int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr)
|
int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate)
|
||||||
{
|
{
|
||||||
float f, g, k0, zoff;
|
float f, g, k0, zoff;
|
||||||
|
|
||||||
|
@ -60,6 +61,13 @@ int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr)
|
||||||
if ((tspr->cstat & 48) == 32)
|
if ((tspr->cstat & 48) == 32)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if ((tspr->cstat & CSTAT_SPRITE_MDLROTATE) || rotate)
|
||||||
|
{
|
||||||
|
int myclock = (PlayClock << 3) + MulScale(4 << 3, pm_smoothratio, 16);
|
||||||
|
tspr->ang = (tspr->ang + myclock) & 2047; // will be applied in md3_vox_calcmat_common.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
vec3f_t m0 = { m->scale, m->scale, m->scale };
|
vec3f_t m0 = { m->scale, m->scale, m->scale };
|
||||||
vec3f_t a0 = { 0, 0, m->zadd*m->scale };
|
vec3f_t a0 = { 0, 0, m->zadd*m->scale };
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
extern FString currentGame;
|
extern FString currentGame;
|
||||||
extern FString LumpFilter;
|
extern FString LumpFilter;
|
||||||
|
extern int PlayClock;
|
||||||
class FArgs;
|
class FArgs;
|
||||||
extern bool GUICapture;
|
extern bool GUICapture;
|
||||||
extern bool AppActive;
|
extern bool AppActive;
|
||||||
|
|
|
@ -272,60 +272,68 @@ void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlIn
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void sethorizon(fixedhoriz* horiz, float const horz, ESyncBits* actions, double const scaleAdjust)
|
void sethorizon(PlayerHorizon* horizon, float const horz, ESyncBits* actions, double const scaleAdjust)
|
||||||
{
|
{
|
||||||
// Store current horizon as true pitch.
|
// Process only if no targeted horizon set.
|
||||||
double pitch = horiz->aspitch();
|
if (!horizon->targetset())
|
||||||
|
|
||||||
if (horz)
|
|
||||||
{
|
{
|
||||||
*actions &= ~SB_CENTERVIEW;
|
// Store current horizon as true pitch.
|
||||||
pitch += horz;
|
double pitch = horizon->horiz.aspitch();
|
||||||
}
|
|
||||||
|
|
||||||
// this is the locked type
|
if (horz)
|
||||||
if (*actions & (SB_AIM_UP|SB_AIM_DOWN))
|
|
||||||
{
|
|
||||||
*actions &= ~SB_CENTERVIEW;
|
|
||||||
double const amount = HorizToPitch(250. / GameTicRate);
|
|
||||||
|
|
||||||
if (*actions & SB_AIM_DOWN)
|
|
||||||
pitch -= scaleAdjust * amount;
|
|
||||||
|
|
||||||
if (*actions & SB_AIM_UP)
|
|
||||||
pitch += scaleAdjust * amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
// this is the unlocked type
|
|
||||||
if (*actions & (SB_LOOK_UP|SB_LOOK_DOWN))
|
|
||||||
{
|
|
||||||
*actions |= SB_CENTERVIEW;
|
|
||||||
double const amount = HorizToPitch(500. / GameTicRate);
|
|
||||||
|
|
||||||
if (*actions & SB_LOOK_DOWN)
|
|
||||||
pitch -= scaleAdjust * amount;
|
|
||||||
|
|
||||||
if (*actions & SB_LOOK_UP)
|
|
||||||
pitch += scaleAdjust * amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
// clamp before converting back to horizon
|
|
||||||
*horiz = q16horiz(clamp(PitchToHoriz(pitch), gi->playerHorizMin(), gi->playerHorizMax()));
|
|
||||||
|
|
||||||
// return to center if conditions met.
|
|
||||||
if ((*actions & SB_CENTERVIEW) && !(*actions & (SB_LOOK_UP|SB_LOOK_DOWN)))
|
|
||||||
{
|
|
||||||
if (abs(horiz->asq16()) > FloatToFixed(0.25))
|
|
||||||
{
|
{
|
||||||
// move horiz back to 0
|
|
||||||
*horiz -= q16horiz(xs_CRoundToInt(scaleAdjust * horiz->asq16() * (10. / GameTicRate)));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// not looking anymore because horiz is back at 0
|
|
||||||
*horiz = q16horiz(0);
|
|
||||||
*actions &= ~SB_CENTERVIEW;
|
*actions &= ~SB_CENTERVIEW;
|
||||||
|
pitch += horz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is the locked type
|
||||||
|
if (*actions & (SB_AIM_UP|SB_AIM_DOWN))
|
||||||
|
{
|
||||||
|
*actions &= ~SB_CENTERVIEW;
|
||||||
|
double const amount = HorizToPitch(250. / GameTicRate);
|
||||||
|
|
||||||
|
if (*actions & SB_AIM_DOWN)
|
||||||
|
pitch -= scaleAdjust * amount;
|
||||||
|
|
||||||
|
if (*actions & SB_AIM_UP)
|
||||||
|
pitch += scaleAdjust * amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this is the unlocked type
|
||||||
|
if (*actions & (SB_LOOK_UP|SB_LOOK_DOWN))
|
||||||
|
{
|
||||||
|
*actions |= SB_CENTERVIEW;
|
||||||
|
double const amount = HorizToPitch(500. / GameTicRate);
|
||||||
|
|
||||||
|
if (*actions & SB_LOOK_DOWN)
|
||||||
|
pitch -= scaleAdjust * amount;
|
||||||
|
|
||||||
|
if (*actions & SB_LOOK_UP)
|
||||||
|
pitch += scaleAdjust * amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
// clamp before converting back to horizon
|
||||||
|
horizon->horiz = q16horiz(clamp(PitchToHoriz(pitch), gi->playerHorizMin(), gi->playerHorizMax()));
|
||||||
|
|
||||||
|
// return to center if conditions met.
|
||||||
|
if ((*actions & SB_CENTERVIEW) && !(*actions & (SB_LOOK_UP|SB_LOOK_DOWN)))
|
||||||
|
{
|
||||||
|
if (abs(horizon->horiz.asq16()) > FloatToFixed(0.25))
|
||||||
|
{
|
||||||
|
// move horiz back to 0
|
||||||
|
horizon->horiz -= q16horiz(xs_CRoundToInt(scaleAdjust * horizon->horiz.asq16() * (10. / GameTicRate)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// not looking anymore because horiz is back at 0
|
||||||
|
horizon->horiz = q16horiz(0);
|
||||||
|
*actions &= ~SB_CENTERVIEW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*actions &= ~SB_CENTERVIEW;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,34 +367,41 @@ void applylook(PlayerAngle* angle, float const avel, ESyncBits* actions, double
|
||||||
angle->rotscrnang -= bamlook(xs_CRoundToInt(scaleAdjust * (720. / GameTicRate) * BAMUNIT));
|
angle->rotscrnang -= bamlook(xs_CRoundToInt(scaleAdjust * (720. / GameTicRate) * BAMUNIT));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*actions & SB_TURNAROUND)
|
if (!angle->targetset())
|
||||||
{
|
{
|
||||||
if (angle->spin.asbam() == 0)
|
if (*actions & SB_TURNAROUND)
|
||||||
{
|
{
|
||||||
// currently not spinning, so start a spin
|
if (angle->spin.asbam() == 0)
|
||||||
angle->spin = buildlook(-1024);
|
{
|
||||||
|
// currently not spinning, so start a spin
|
||||||
|
angle->spin = buildlook(-1024);
|
||||||
|
}
|
||||||
|
*actions &= ~SB_TURNAROUND;
|
||||||
}
|
}
|
||||||
*actions &= ~SB_TURNAROUND;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (angle->spin.asbam() < 0)
|
if (angle->spin.asbam() < 0)
|
||||||
{
|
|
||||||
// return spin to 0
|
|
||||||
lookangle add = bamlook(xs_CRoundToUInt(scaleAdjust * ((!(*actions & SB_CROUCH) ? 3840. : 1920.) / GameTicRate) * BAMUNIT));
|
|
||||||
angle->spin += add;
|
|
||||||
if (angle->spin.asbam() > 0)
|
|
||||||
{
|
{
|
||||||
// Don't overshoot our target. With variable factor this is possible.
|
// return spin to 0
|
||||||
add -= angle->spin;
|
lookangle add = bamlook(xs_CRoundToUInt(scaleAdjust * ((!(*actions & SB_CROUCH) ? 3840. : 1920.) / GameTicRate) * BAMUNIT));
|
||||||
|
angle->spin += add;
|
||||||
|
if (angle->spin.asbam() > 0)
|
||||||
|
{
|
||||||
|
// Don't overshoot our target. With variable factor this is possible.
|
||||||
|
add -= angle->spin;
|
||||||
|
angle->spin = bamlook(0);
|
||||||
|
}
|
||||||
|
angle->ang += bamang(add.asbam());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (avel)
|
||||||
|
{
|
||||||
|
// add player's input
|
||||||
|
angle->ang += degang(avel);
|
||||||
angle->spin = bamlook(0);
|
angle->spin = bamlook(0);
|
||||||
}
|
}
|
||||||
angle->ang += bamang(add.asbam());
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (avel)
|
|
||||||
{
|
{
|
||||||
// add player's input
|
|
||||||
angle->ang += degang(avel);
|
|
||||||
angle->spin = bamlook(0);
|
angle->spin = bamlook(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "m_fixed.h"
|
#include "m_fixed.h"
|
||||||
#include "binaryangle.h"
|
#include "binaryangle.h"
|
||||||
#include "gamecvars.h"
|
#include "gamecvars.h"
|
||||||
|
#include "gamestruct.h"
|
||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
|
|
||||||
int getincangle(int a, int na);
|
int getincangle(int a, int na);
|
||||||
|
@ -12,8 +13,7 @@ lookangle getincanglebam(binangle a, binangle na);
|
||||||
|
|
||||||
struct PlayerHorizon
|
struct PlayerHorizon
|
||||||
{
|
{
|
||||||
fixedhoriz horiz, ohoriz, horizoff, ohorizoff, target;
|
fixedhoriz horiz, ohoriz, horizoff, ohorizoff;
|
||||||
double adjustment;
|
|
||||||
|
|
||||||
void backup()
|
void backup()
|
||||||
{
|
{
|
||||||
|
@ -29,14 +29,7 @@ struct PlayerHorizon
|
||||||
|
|
||||||
void addadjustment(double value)
|
void addadjustment(double value)
|
||||||
{
|
{
|
||||||
if (!SyncInput())
|
__addadjustment(q16horiz(FloatToFixed(value)));
|
||||||
{
|
|
||||||
adjustment += value * FRACUNIT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
horiz += q16horiz(FloatToFixed(value));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetadjustment()
|
void resetadjustment()
|
||||||
|
@ -46,53 +39,35 @@ struct PlayerHorizon
|
||||||
|
|
||||||
void settarget(int value, bool backup = false)
|
void settarget(int value, bool backup = false)
|
||||||
{
|
{
|
||||||
if (!SyncInput() && !backup)
|
__settarget(buildhoriz(clamp(value, FixedToInt(gi->playerHorizMin()), FixedToInt(gi->playerHorizMax()))), backup);
|
||||||
{
|
|
||||||
target = buildhoriz(value);
|
|
||||||
if (target.asq16() == 0) target = q16horiz(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
horiz = buildhoriz(value);
|
|
||||||
if (backup) ohoriz = horiz;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void settarget(double value, bool backup = false)
|
void settarget(double value, bool backup = false)
|
||||||
{
|
{
|
||||||
if (!SyncInput() && !backup)
|
__settarget(buildfhoriz(clamp(value, FixedToFloat(gi->playerHorizMin()), FixedToFloat(gi->playerHorizMax()))), backup);
|
||||||
{
|
|
||||||
target = buildfhoriz(value);
|
|
||||||
if (target.asq16() == 0) target = q16horiz(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
horiz = buildfhoriz(value);
|
|
||||||
if (backup) ohoriz = horiz;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void settarget(fixedhoriz value, bool backup = false)
|
void settarget(fixedhoriz value, bool backup = false)
|
||||||
{
|
{
|
||||||
if (!SyncInput() && !backup)
|
__settarget(q16horiz(clamp(value.asq16(), gi->playerHorizMin(), gi->playerHorizMax())), backup);
|
||||||
{
|
}
|
||||||
target = value;
|
|
||||||
if (target.asq16() == 0) target = q16horiz(1);
|
bool targetset()
|
||||||
}
|
{
|
||||||
else
|
return target.asq16();
|
||||||
{
|
|
||||||
horiz = value;
|
|
||||||
if (backup) ohoriz = horiz;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void processhelpers(double const scaleAdjust)
|
void processhelpers(double const scaleAdjust)
|
||||||
{
|
{
|
||||||
if (target.asq16())
|
if (targetset())
|
||||||
{
|
{
|
||||||
horiz += q16horiz(xs_CRoundToInt(scaleAdjust * (target - horiz).asq16()));
|
auto delta = (target - horiz).asq16();
|
||||||
|
|
||||||
if (abs((horiz - target).asq16()) < FRACUNIT)
|
if (abs(delta) > FRACUNIT)
|
||||||
|
{
|
||||||
|
horiz += q16horiz(xs_CRoundToInt(scaleAdjust * delta));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
horiz = target;
|
horiz = target;
|
||||||
target = q16horiz(0);
|
target = q16horiz(0);
|
||||||
|
@ -121,13 +96,42 @@ struct PlayerHorizon
|
||||||
fixed_t const curr = sum().asq16();
|
fixed_t const curr = sum().asq16();
|
||||||
return q16horiz(prev + xs_CRoundToInt(ratio * (curr - prev)));
|
return q16horiz(prev + xs_CRoundToInt(ratio * (curr - prev)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
fixedhoriz target;
|
||||||
|
double adjustment;
|
||||||
|
|
||||||
|
void __addadjustment(fixedhoriz value)
|
||||||
|
{
|
||||||
|
if (!SyncInput())
|
||||||
|
{
|
||||||
|
adjustment += value.asq16();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
horiz += value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void __settarget(fixedhoriz value, bool backup = false)
|
||||||
|
{
|
||||||
|
if (!SyncInput() && !backup)
|
||||||
|
{
|
||||||
|
target = value;
|
||||||
|
if (!targetset()) target = q16horiz(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
horiz = value;
|
||||||
|
if (backup) ohoriz = horiz;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PlayerAngle
|
struct PlayerAngle
|
||||||
{
|
{
|
||||||
binangle ang, oang, target;
|
binangle ang, oang;
|
||||||
lookangle look_ang, olook_ang, rotscrnang, orotscrnang, spin;
|
lookangle look_ang, olook_ang, rotscrnang, orotscrnang, spin;
|
||||||
double adjustment;
|
|
||||||
|
|
||||||
void backup()
|
void backup()
|
||||||
{
|
{
|
||||||
|
@ -145,50 +149,22 @@ struct PlayerAngle
|
||||||
|
|
||||||
void addadjustment(int value)
|
void addadjustment(int value)
|
||||||
{
|
{
|
||||||
if (!SyncInput())
|
__addadjustment(buildang(value));
|
||||||
{
|
|
||||||
adjustment += BAngToBAM(value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ang += buildang(value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void addadjustment(double value)
|
void addadjustment(double value)
|
||||||
{
|
{
|
||||||
if (!SyncInput())
|
__addadjustment(buildfang(value));
|
||||||
{
|
|
||||||
adjustment += value * BAMUNIT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ang += bamang(xs_CRoundToUInt(value * BAMUNIT));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void addadjustment(lookangle value)
|
void addadjustment(lookangle value)
|
||||||
{
|
{
|
||||||
if (!SyncInput())
|
__addadjustment(bamang(value.asbam()));
|
||||||
{
|
|
||||||
adjustment += value.asbam();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ang += bamang(value.asbam());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void addadjustment(binangle value)
|
void addadjustment(binangle value)
|
||||||
{
|
{
|
||||||
if (!SyncInput())
|
__addadjustment(value);
|
||||||
{
|
|
||||||
adjustment += value.asbam();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ang += value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetadjustment()
|
void resetadjustment()
|
||||||
|
@ -198,53 +174,35 @@ struct PlayerAngle
|
||||||
|
|
||||||
void settarget(int value, bool backup = false)
|
void settarget(int value, bool backup = false)
|
||||||
{
|
{
|
||||||
if (!SyncInput() && !backup)
|
__settarget(buildang(value & 2047), backup);
|
||||||
{
|
|
||||||
target = buildang(value & 2047);
|
|
||||||
if (target.asbam() == 0) target = bamang(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ang = buildang(value & 2047);
|
|
||||||
if (backup) oang = ang;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void settarget(double value, bool backup = false)
|
void settarget(double value, bool backup = false)
|
||||||
{
|
{
|
||||||
if (!SyncInput() && !backup)
|
__settarget(buildfang(fmod(value, 2048)), backup);
|
||||||
{
|
|
||||||
target = buildfang(fmod(value, 2048));
|
|
||||||
if (target.asbam() == 0) target = bamang(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ang = buildfang(fmod(value, 2048));
|
|
||||||
if (backup) oang = ang;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void settarget(binangle value, bool backup = false)
|
void settarget(binangle value, bool backup = false)
|
||||||
{
|
{
|
||||||
if (!SyncInput() && !backup)
|
__settarget(value, backup);
|
||||||
{
|
}
|
||||||
target = value;
|
|
||||||
if (target.asbam() == 0) target = bamang(1);
|
bool targetset()
|
||||||
}
|
{
|
||||||
else
|
return target.asbam();
|
||||||
{
|
|
||||||
ang = value;
|
|
||||||
if (backup) oang = ang;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void processhelpers(double const scaleAdjust)
|
void processhelpers(double const scaleAdjust)
|
||||||
{
|
{
|
||||||
if (target.asbam())
|
if (targetset())
|
||||||
{
|
{
|
||||||
ang += bamang(xs_CRoundToUInt(scaleAdjust * getincanglebam(ang, target).asbam()));
|
auto delta = getincanglebam(ang, target).asbam();
|
||||||
|
|
||||||
if (getincanglebam(ang, target).asbam() < BAMUNIT)
|
if (delta > BAMUNIT)
|
||||||
|
{
|
||||||
|
ang += bamang(xs_CRoundToUInt(scaleAdjust * delta));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ang = target;
|
ang = target;
|
||||||
target = bamang(0);
|
target = bamang(0);
|
||||||
|
@ -291,6 +249,36 @@ struct PlayerAngle
|
||||||
{
|
{
|
||||||
return (!SyncInput() ? look_ang : interpolatedlookang(smoothratio)).asbam() * (0.5 / BAMUNIT); // Used within draw code for weapon and crosshair when looking left/right.
|
return (!SyncInput() ? look_ang : interpolatedlookang(smoothratio)).asbam() * (0.5 / BAMUNIT); // Used within draw code for weapon and crosshair when looking left/right.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
binangle target;
|
||||||
|
double adjustment;
|
||||||
|
|
||||||
|
void __addadjustment(binangle value)
|
||||||
|
{
|
||||||
|
if (!SyncInput())
|
||||||
|
{
|
||||||
|
adjustment += value.asbam();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ang += value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void __settarget(binangle value, bool backup = false)
|
||||||
|
{
|
||||||
|
if (!SyncInput() && !backup)
|
||||||
|
{
|
||||||
|
target = value;
|
||||||
|
if (!targetset()) target = bamang(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ang = value;
|
||||||
|
if (backup) oang = ang;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class FSerializer;
|
class FSerializer;
|
||||||
|
@ -302,6 +290,6 @@ void updateTurnHeldAmt(double const scaleAdjust);
|
||||||
bool const isTurboTurnTime();
|
bool const isTurboTurnTime();
|
||||||
void resetTurnHeldAmt();
|
void resetTurnHeldAmt();
|
||||||
void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlInfo* const hidInput, double const scaleAdjust, int const drink_amt = 0, bool const allowstrafe = true, double const turnscale = 1);
|
void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlInfo* const hidInput, double const scaleAdjust, int const drink_amt = 0, bool const allowstrafe = true, double const turnscale = 1);
|
||||||
void sethorizon(fixedhoriz* horiz, float const horz, ESyncBits* actions, double const scaleAdjust = 1);
|
void sethorizon(PlayerHorizon* horizon, float const horz, ESyncBits* actions, double const scaleAdjust = 1);
|
||||||
void applylook(PlayerAngle* angle, float const avel, ESyncBits* actions, double const scaleAdjust = 1);
|
void applylook(PlayerAngle* angle, float const avel, ESyncBits* actions, double const scaleAdjust = 1);
|
||||||
void calcviewpitch(vec2_t const pos, fixedhoriz* horizoff, binangle const ang, bool const aimmode, bool const canslopetilt, int const cursectnum, double const scaleAdjust = 1, bool const climbing = false);
|
void calcviewpitch(vec2_t const pos, fixedhoriz* horizoff, binangle const ang, bool const aimmode, bool const canslopetilt, int const cursectnum, double const scaleAdjust = 1, bool const climbing = false);
|
||||||
|
|
|
@ -574,8 +574,8 @@ void viewProcessSprites(spritetype* tsprite, int& spritesortcnt, int32_t cX, int
|
||||||
|
|
||||||
int const nVoxel = tiletovox[pTSprite->picnum];
|
int const nVoxel = tiletovox[pTSprite->picnum];
|
||||||
|
|
||||||
if (nVoxel != -1 && ((voxrotate[nVoxel >> 3] & (1 << (nVoxel & 7))) != 0 || (picanm[nRootTile].extra & 7) == 7))
|
if (nVoxel != -1 && (picanm[nRootTile].extra & 7) == 7)
|
||||||
pTSprite->ang = (pTSprite->ang + myclock) & 2047;
|
pTSprite->cstat |= CSTAT_SPRITE_MDLROTATE; // per-sprite rotation setting.
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pTSprite->cstat&48) != 48 && hw_models && !(spriteext[nSprite].flags&SPREXT_NOTMD))
|
if ((pTSprite->cstat&48) != 48 && hw_models && !(spriteext[nSprite].flags&SPREXT_NOTMD))
|
||||||
|
@ -590,7 +590,7 @@ void viewProcessSprites(spritetype* tsprite, int& spritesortcnt, int32_t cX, int
|
||||||
pTSprite->xoffset += tileLeftOffset(nAnimTile);
|
pTSprite->xoffset += tileLeftOffset(nAnimTile);
|
||||||
|
|
||||||
if ((picanm[nRootTile].extra&7) == 7)
|
if ((picanm[nRootTile].extra&7) == 7)
|
||||||
pTSprite->ang = (pTSprite->ang+myclock)&2047;
|
pTSprite->cstat |= CSTAT_SPRITE_MDLROTATE; // per-sprite rotation setting.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
|
||||||
if (gView->pXSprite->health != 0)
|
if (gView->pXSprite->health != 0)
|
||||||
{
|
{
|
||||||
applylook(&pPlayer->angle, input.avel, &pPlayer->input.actions, scaleAdjust);
|
applylook(&pPlayer->angle, input.avel, &pPlayer->input.actions, scaleAdjust);
|
||||||
sethorizon(&pPlayer->horizon.horiz, input.horz, &pPlayer->input.actions, scaleAdjust);
|
sethorizon(&pPlayer->horizon, input.horz, &pPlayer->input.actions, scaleAdjust);
|
||||||
doslopetilting(pPlayer, scaleAdjust);
|
doslopetilting(pPlayer, scaleAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,7 @@ void playlogos()
|
||||||
jobs[job++] = { Create<DImageScreen>(2518, DScreenJob::fadein) };
|
jobs[job++] = { Create<DImageScreen>(2518, DScreenJob::fadein) };
|
||||||
|
|
||||||
RunScreenJob(jobs, job, [](bool) {
|
RunScreenJob(jobs, job, [](bool) {
|
||||||
|
Mus_Stop();
|
||||||
gameaction = ga_mainmenu;
|
gameaction = ga_mainmenu;
|
||||||
}, true, true);
|
}, true, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1327,7 +1327,8 @@ void ProcessInput(PLAYER *pPlayer)
|
||||||
else if (pPlayer->restTime >= 0)
|
else if (pPlayer->restTime >= 0)
|
||||||
pPlayer->restTime += 4;
|
pPlayer->restTime += 4;
|
||||||
|
|
||||||
pPlayer->isRunning = !!(pInput->actions & SB_RUN) && pPlayer->restTime <= 10;
|
// This was just too broken. Every single place in the game depending on 'isRunning' will misbehave if this is set because originally it never worked as intended.
|
||||||
|
pPlayer->isRunning = false;// !!(pInput->actions& SB_RUN) && pPlayer->restTime <= 10;
|
||||||
|
|
||||||
WeaponProcess(pPlayer);
|
WeaponProcess(pPlayer);
|
||||||
if (pXSprite->health == 0)
|
if (pXSprite->health == 0)
|
||||||
|
@ -1548,7 +1549,7 @@ void ProcessInput(PLAYER *pPlayer)
|
||||||
|
|
||||||
if (SyncInput())
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
sethorizon(&pPlayer->horizon.horiz, pInput->horz, &pInput->actions);
|
sethorizon(&pPlayer->horizon, pInput->horz, &pInput->actions);
|
||||||
doslopetilting(pPlayer);
|
doslopetilting(pPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -623,8 +623,8 @@ private:
|
||||||
else
|
else
|
||||||
DrawStatSprite(nTile, x, y, 40, 5);
|
DrawStatSprite(nTile, x, y, 40, 5);
|
||||||
}
|
}
|
||||||
DrawStatMaskedSprite(2202, 118.5, 185.5, pPlayer->isRunning ? 16 : 40);
|
DrawStatMaskedSprite(2202, 118.5, 185.5, /*pPlayer->isRunning ? 16 :*/ 40);
|
||||||
DrawStatMaskedSprite(2202, 201.5, 185.5, pPlayer->isRunning ? 16 : 40);
|
DrawStatMaskedSprite(2202, 201.5, 185.5, /*pPlayer->isRunning ? 16 :*/ 40);
|
||||||
if (pPlayer->throwPower)
|
if (pPlayer->throwPower)
|
||||||
{
|
{
|
||||||
TileHGauge(2260, 124, 175.5, pPlayer->throwPower, 65536);
|
TileHGauge(2260, 124, 175.5, pPlayer->throwPower, 65536);
|
||||||
|
|
|
@ -652,6 +652,7 @@ void viewDrawScreen(bool sceneonly)
|
||||||
gInterpolate = I_GetTimeFrac() * MaxSmoothRatio;
|
gInterpolate = I_GetTimeFrac() * MaxSmoothRatio;
|
||||||
}
|
}
|
||||||
else gInterpolate = MaxSmoothRatio;
|
else gInterpolate = MaxSmoothRatio;
|
||||||
|
pm_smoothratio = (int)gInterpolate;
|
||||||
|
|
||||||
if (cl_interpolate)
|
if (cl_interpolate)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ void movemasterswitch(DDukeActor *actor, int spectype1, int spectype2)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sj->statnum == 6)
|
else if (sj->statnum == STAT_STANDABLE)
|
||||||
{
|
{
|
||||||
if (sj->picnum == spectype1 || sj->picnum == spectype2) // SEENINE and OOZFILTER
|
if (sj->picnum == spectype1 || sj->picnum == spectype2) // SEENINE and OOZFILTER
|
||||||
{
|
{
|
||||||
|
@ -1010,7 +1010,12 @@ void movemasterswitch(DDukeActor *actor, int spectype1, int spectype2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
deletesprite(actor);
|
// we cannot delete this because it may be used as a sound source.
|
||||||
|
// This originally depended on undefined behavior as the deleted sprite was still used for the sound
|
||||||
|
// with no checking if it got reused in the mean time.
|
||||||
|
spri->picnum = 0; // give it a picnum without any behavior attached, just in case
|
||||||
|
spri->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||||
|
changespritestat(actor->GetIndex(), STAT_REMOVED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2556,26 +2556,29 @@ static void greenslime(DDukeActor *actor)
|
||||||
{
|
{
|
||||||
auto s5 = actor->temp_actor;
|
auto s5 = actor->temp_actor;
|
||||||
makeitfall(actor);
|
makeitfall(actor);
|
||||||
s5->s.xvel = 0;
|
if (s5)
|
||||||
|
|
||||||
int l = s5->s.ang;
|
|
||||||
|
|
||||||
s->z = s5->s.z;
|
|
||||||
s->x = s5->s.x + bcos(l, -11);
|
|
||||||
s->y = s5->s.y + bsin(l, -11);
|
|
||||||
|
|
||||||
s->picnum = GREENSLIME + 2 + (global_random & 1);
|
|
||||||
|
|
||||||
if (s->yrepeat < 64) s->yrepeat += 2;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (s->xrepeat < 32) s->xrepeat += 4;
|
s5->s.xvel = 0;
|
||||||
|
|
||||||
|
int l = s5->s.ang;
|
||||||
|
|
||||||
|
s->z = s5->s.z;
|
||||||
|
s->x = s5->s.x + bcos(l, -11);
|
||||||
|
s->y = s5->s.y + bsin(l, -11);
|
||||||
|
|
||||||
|
s->picnum = GREENSLIME + 2 + (global_random & 1);
|
||||||
|
|
||||||
|
if (s->yrepeat < 64) s->yrepeat += 2;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
t[0] = -1;
|
if (s->xrepeat < 32) s->xrepeat += 4;
|
||||||
x = ldist(actor, s5);
|
else
|
||||||
if (x < 768) {
|
{
|
||||||
s5->s.xrepeat = 0;
|
t[0] = -1;
|
||||||
|
x = ldist(actor, s5);
|
||||||
|
if (x < 768) {
|
||||||
|
s5->s.xrepeat = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,6 +256,7 @@ enum
|
||||||
|
|
||||||
STAT_DESTRUCT = 100,
|
STAT_DESTRUCT = 100,
|
||||||
STAT_BOWLING = 105,
|
STAT_BOWLING = 105,
|
||||||
|
STAT_REMOVED = MAXSTATUS-2,
|
||||||
STAT_NETALLOC = MAXSTATUS-1
|
STAT_NETALLOC = MAXSTATUS-1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -842,7 +842,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
|
||||||
doslopetilting(p, scaleAdjust);
|
doslopetilting(p, scaleAdjust);
|
||||||
applylook(&p->angle, p->adjustavel(input.avel), &p->sync.actions, scaleAdjust);
|
applylook(&p->angle, p->adjustavel(input.avel), &p->sync.actions, scaleAdjust);
|
||||||
p->apply_seasick(scaleAdjust);
|
p->apply_seasick(scaleAdjust);
|
||||||
sethorizon(&p->horizon.horiz, input.horz, &p->sync.actions, scaleAdjust);
|
sethorizon(&p->horizon, input.horz, &p->sync.actions, scaleAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
p->angle.processhelpers(scaleAdjust);
|
p->angle.processhelpers(scaleAdjust);
|
||||||
|
|
|
@ -3139,7 +3139,7 @@ HORIZONLY:
|
||||||
|
|
||||||
if (SyncInput())
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
sethorizon(&p->horizon.horiz, PlayerHorizon(snum), &p->sync.actions);
|
sethorizon(&p->horizon, PlayerHorizon(snum), &p->sync.actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
p->checkhardlanding();
|
p->checkhardlanding();
|
||||||
|
|
|
@ -4001,7 +4001,7 @@ HORIZONLY:
|
||||||
|
|
||||||
if (SyncInput())
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
sethorizon(&p->horizon.horiz, PlayerHorizon(snum), &p->sync.actions);
|
sethorizon(&p->horizon, PlayerHorizon(snum), &p->sync.actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
p->checkhardlanding();
|
p->checkhardlanding();
|
||||||
|
|
|
@ -263,6 +263,7 @@ void displayrooms(int snum, double smoothratio)
|
||||||
int tiltcs = 0; // JBF 20030807
|
int tiltcs = 0; // JBF 20030807
|
||||||
|
|
||||||
p = &ps[snum];
|
p = &ps[snum];
|
||||||
|
pm_smoothratio = (int)smoothratio;
|
||||||
|
|
||||||
if (automapMode == am_full || p->cursectnum == -1)
|
if (automapMode == am_full || p->cursectnum == -1)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -445,10 +445,6 @@ void GameInterface::UpdateSounds(void)
|
||||||
|
|
||||||
int S_PlaySound3D(int sndnum, DDukeActor* actor, const vec3_t* pos, int channel, EChanFlags flags)
|
int S_PlaySound3D(int sndnum, DDukeActor* actor, const vec3_t* pos, int channel, EChanFlags flags)
|
||||||
{
|
{
|
||||||
if (sndnum == GENERIC_AMBIENCE1 || sndnum == DUMPSTER_MOVE)
|
|
||||||
{
|
|
||||||
int a = 0;
|
|
||||||
}
|
|
||||||
auto const pl = &ps[myconnectindex];
|
auto const pl = &ps[myconnectindex];
|
||||||
if (!soundEngine->isValidSoundId(sndnum+1) || !SoundEnabled() || actor == nullptr || !playrunning() ||
|
if (!soundEngine->isValidSoundId(sndnum+1) || !SoundEnabled() || actor == nullptr || !playrunning() ||
|
||||||
(pl->timebeforeexit > 0 && pl->timebeforeexit <= REALGAMETICSPERSEC * 3)) return -1;
|
(pl->timebeforeexit > 0 && pl->timebeforeexit <= REALGAMETICSPERSEC * 3)) return -1;
|
||||||
|
|
|
@ -125,7 +125,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
|
||||||
if (!nFreeze)
|
if (!nFreeze)
|
||||||
{
|
{
|
||||||
applylook(&pPlayer->angle, input.avel, &sPlayerInput[nLocalPlayer].actions, scaleAdjust);
|
applylook(&pPlayer->angle, input.avel, &sPlayerInput[nLocalPlayer].actions, scaleAdjust);
|
||||||
sethorizon(&pPlayer->horizon.horiz, input.horz, &sPlayerInput[nLocalPlayer].actions, scaleAdjust);
|
sethorizon(&pPlayer->horizon, input.horz, &sPlayerInput[nLocalPlayer].actions, scaleAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
pPlayer->angle.processhelpers(scaleAdjust);
|
pPlayer->angle.processhelpers(scaleAdjust);
|
||||||
|
|
|
@ -2656,7 +2656,7 @@ loc_1BD2E:
|
||||||
if (SyncInput())
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
Player* pPlayer = &PlayerList[nPlayer];
|
Player* pPlayer = &PlayerList[nPlayer];
|
||||||
sethorizon(&pPlayer->horizon.horiz, sPlayerInput[nPlayer].pan, &sPlayerInput[nLocalPlayer].actions);
|
sethorizon(&pPlayer->horizon, sPlayerInput[nPlayer].pan, &sPlayerInput[nLocalPlayer].actions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // else, player's health is less than 0
|
else // else, player's health is less than 0
|
||||||
|
|
|
@ -216,6 +216,7 @@ void DrawView(double smoothRatio, bool sceneonly)
|
||||||
zbob = bsin(2 * bobangle, -3);
|
zbob = bsin(2 * bobangle, -3);
|
||||||
|
|
||||||
DoInterpolations(smoothRatio / 65536.);
|
DoInterpolations(smoothRatio / 65536.);
|
||||||
|
pm_smoothratio = (int)smoothRatio;
|
||||||
|
|
||||||
int nPlayerSprite = PlayerList[nLocalPlayer].nSprite;
|
int nPlayerSprite = PlayerList[nLocalPlayer].nSprite;
|
||||||
int nPlayerOldCstat = sprite[nPlayerSprite].cstat;
|
int nPlayerOldCstat = sprite[nPlayerSprite].cstat;
|
||||||
|
|
|
@ -1489,6 +1489,7 @@ drawscreen(PLAYERp pp, double smoothratio)
|
||||||
PreDraw();
|
PreDraw();
|
||||||
|
|
||||||
PreUpdatePanel(smoothratio);
|
PreUpdatePanel(smoothratio);
|
||||||
|
pm_smoothratio = (int)smoothratio;
|
||||||
|
|
||||||
if (!ScreenSavePic)
|
if (!ScreenSavePic)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1669,7 +1669,7 @@ DoPlayerHorizon(PLAYERp pp, float const horz, double const scaleAdjust)
|
||||||
{
|
{
|
||||||
bool const canslopetilt = !TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING) && TEST(sector[pp->cursectnum].floorstat, FLOOR_STAT_SLOPE);
|
bool const canslopetilt = !TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING) && TEST(sector[pp->cursectnum].floorstat, FLOOR_STAT_SLOPE);
|
||||||
calcviewpitch(pp->pos.vec2, &pp->horizon.horizoff, pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursectnum, scaleAdjust, TEST(pp->Flags, PF_CLIMBING));
|
calcviewpitch(pp->pos.vec2, &pp->horizon.horizoff, pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursectnum, scaleAdjust, TEST(pp->Flags, PF_CLIMBING));
|
||||||
sethorizon(&pp->horizon.horiz, horz, &pp->input.actions, scaleAdjust);
|
sethorizon(&pp->horizon, horz, &pp->input.actions, scaleAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue