mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 07:01:09 +00:00
- silenced lots of warnings for deliberate type conversions.
The ones in d_net.cpp are not in active code.
This commit is contained in:
parent
9c097e1763
commit
902f8c9706
29 changed files with 98 additions and 93 deletions
|
@ -59,7 +59,7 @@ static inline void get_floorspr_points(DCoreActor *spr, int32_t px, int32_t py,
|
||||||
|
|
||||||
inline int32_t spriteGetZOfSlope(const spritetypebase* tspr, int dax, int day, int heinum)
|
inline int32_t spriteGetZOfSlope(const spritetypebase* tspr, int dax, int day, int heinum)
|
||||||
{
|
{
|
||||||
return spriteGetZOfSlopef(tspr, DVector2(dax * inttoworld, day * inttoworld), heinum) * zworldtoint;
|
return int(spriteGetZOfSlopef(tspr, DVector2(dax * inttoworld, day * inttoworld), heinum) * zworldtoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -414,11 +414,11 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
||||||
if (p1.X >= clipMin.X && p1.X <= clipMax.X && p1.Y >= clipMin.Y && p1.Y <= clipMax.Y)
|
if (p1.X >= clipMin.X && p1.X <= clipMax.X && p1.Y >= clipMin.Y && p1.Y <= clipMax.Y)
|
||||||
{
|
{
|
||||||
double height_, daz_ = actor->spr.pos.Z + actor->GetOffsetAndHeight(height_);
|
double height_, daz_ = actor->spr.pos.Z + actor->GetOffsetAndHeight(height_);
|
||||||
int height = height_ * zworldtoint, daz = daz_ * zworldtoint;
|
int height = int(height_ * zworldtoint), daz = int(daz_ * zworldtoint);
|
||||||
|
|
||||||
if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist)
|
if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist)
|
||||||
{
|
{
|
||||||
int cd = actor->clipdist * worldtoint;
|
int cd = int(actor->clipdist * worldtoint);
|
||||||
int32_t bsz = cd + walldist;
|
int32_t bsz = cd + walldist;
|
||||||
if (diff.X < 0) bsz = -bsz;
|
if (diff.X < 0) bsz = -bsz;
|
||||||
addclipline(p1.X-bsz, p1.Y-bsz, p1.X-bsz, p1.Y+bsz, obj, false);
|
addclipline(p1.X-bsz, p1.Y-bsz, p1.X-bsz, p1.Y+bsz, obj, false);
|
||||||
|
@ -432,7 +432,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
||||||
case CSTAT_SPRITE_ALIGNMENT_WALL:
|
case CSTAT_SPRITE_ALIGNMENT_WALL:
|
||||||
{
|
{
|
||||||
double height_, daz_ = actor->spr.pos.Z + actor->GetOffsetAndHeight(height_);
|
double height_, daz_ = actor->spr.pos.Z + actor->GetOffsetAndHeight(height_);
|
||||||
int height = height_ * zworldtoint, daz = daz_ * zworldtoint;
|
int height = int(height_ * zworldtoint), daz = int(daz_ * zworldtoint);
|
||||||
|
|
||||||
if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist)
|
if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist)
|
||||||
{
|
{
|
||||||
|
|
|
@ -68,7 +68,7 @@ static uint64_t GetClockTimeNS()
|
||||||
{
|
{
|
||||||
auto tp = GetTimePoint() - StartupTimeNS;
|
auto tp = GetTimePoint() - StartupTimeNS;
|
||||||
if (TimeScale == 1.0) return tp;
|
if (TimeScale == 1.0) return tp;
|
||||||
else return tp / 1000 * TimeScale * 1000;
|
else return uint64_t(tp / 1000 * TimeScale * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t MSToNS(unsigned int ms)
|
static uint64_t MSToNS(unsigned int ms)
|
||||||
|
|
|
@ -332,7 +332,7 @@ public:
|
||||||
|
|
||||||
unsigned IndexOf(const T* elem) const
|
unsigned IndexOf(const T* elem) const
|
||||||
{
|
{
|
||||||
return elem - Array;
|
return unsigned(elem - Array);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int Find(const T& item) const
|
unsigned int Find(const T& item) const
|
||||||
|
|
|
@ -184,7 +184,7 @@ static void CalcMapBounds()
|
||||||
static void AutomapControl(const DVector2& cangvect)
|
static void AutomapControl(const DVector2& cangvect)
|
||||||
{
|
{
|
||||||
static double nonsharedtimer;
|
static double nonsharedtimer;
|
||||||
double ms = screen->FrameTime;
|
double ms = (double)screen->FrameTime;
|
||||||
double interval;
|
double interval;
|
||||||
|
|
||||||
if (nonsharedtimer > 0 || ms < nonsharedtimer)
|
if (nonsharedtimer > 0 || ms < nonsharedtimer)
|
||||||
|
|
|
@ -168,7 +168,7 @@ public:
|
||||||
|
|
||||||
int native_clipdist()
|
int native_clipdist()
|
||||||
{
|
{
|
||||||
return clipdist * 4;
|
return int(clipdist * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy_clipdist(DCoreActor* other)
|
void copy_clipdist(DCoreActor* other)
|
||||||
|
@ -439,7 +439,7 @@ void SetActor(DCoreActor* actor, const DVector3& newpos);
|
||||||
inline int clipmove(DVector3& pos, sectortype** const sect, const DVector2& mvec,
|
inline int clipmove(DVector3& pos, sectortype** const sect, const DVector2& mvec,
|
||||||
double const walldist, double const ceildist, double const flordist, unsigned const cliptype, CollisionBase& result, int clipmoveboxtracenum = 3)
|
double const walldist, double const ceildist, double const flordist, unsigned const cliptype, CollisionBase& result, int clipmoveboxtracenum = 3)
|
||||||
{
|
{
|
||||||
auto vect = vec3_t(pos.X * worldtoint, pos.Y * worldtoint, pos.Z * zworldtoint);
|
auto vect = vec3_t(int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint));
|
||||||
int sectno = *sect ? sector.IndexOf(*sect) : -1;
|
int sectno = *sect ? sector.IndexOf(*sect) : -1;
|
||||||
result = clipmove_(&vect, §no, FloatToFixed<18>(mvec.X), FloatToFixed<18>(mvec.Y), int(walldist * worldtoint), int(ceildist * zworldtoint), int(flordist * zworldtoint), cliptype, clipmoveboxtracenum);
|
result = clipmove_(&vect, §no, FloatToFixed<18>(mvec.X), FloatToFixed<18>(mvec.Y), int(walldist * worldtoint), int(ceildist * zworldtoint), int(flordist * zworldtoint), cliptype, clipmoveboxtracenum);
|
||||||
pos = { vect.X * inttoworld, vect.Y * inttoworld, vect.Z * zinttoworld };
|
pos = { vect.X * inttoworld, vect.Y * inttoworld, vect.Z * zinttoworld };
|
||||||
|
@ -450,9 +450,9 @@ inline int clipmove(DVector3& pos, sectortype** const sect, const DVector2& mvec
|
||||||
inline int pushmove(DVector3& pos, sectortype** const sect, double const walldist, double const ceildist, double const flordist,
|
inline int pushmove(DVector3& pos, sectortype** const sect, double const walldist, double const ceildist, double const flordist,
|
||||||
uint32_t const cliptype, bool clear = true)
|
uint32_t const cliptype, bool clear = true)
|
||||||
{
|
{
|
||||||
auto vect = vec3_t(pos.X * worldtoint, pos.Y * worldtoint, pos.Z * zworldtoint);
|
auto vect = vec3_t(int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint));
|
||||||
int sectno = *sect ? sector.IndexOf(*sect) : -1;
|
int sectno = *sect ? sector.IndexOf(*sect) : -1;
|
||||||
int res = pushmove_(&vect, §no, walldist * worldtoint, ceildist * zworldtoint, flordist * zworldtoint, cliptype, clear);
|
int res = pushmove_(&vect, §no, int(walldist * worldtoint), int(ceildist * zworldtoint), int(flordist * zworldtoint), cliptype, clear);
|
||||||
pos = { vect.X * inttoworld, vect.Y * inttoworld, vect.Z * zinttoworld };
|
pos = { vect.X * inttoworld, vect.Y * inttoworld, vect.Z * zinttoworld };
|
||||||
*sect = sectno == -1 ? nullptr : §or[sectno];
|
*sect = sectno == -1 ? nullptr : §or[sectno];
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -1032,8 +1032,8 @@ void NetUpdate (void)
|
||||||
int mod = maketic - ticdup;
|
int mod = maketic - ticdup;
|
||||||
int modp, tic;
|
int modp, tic;
|
||||||
|
|
||||||
int svel = 0;
|
float svel = 0;
|
||||||
int fvel = 0;
|
float fvel = 0;
|
||||||
float avel = 0;
|
float avel = 0;
|
||||||
float horz = 0;
|
float horz = 0;
|
||||||
|
|
||||||
|
|
|
@ -906,7 +906,7 @@ void parseMultiPsky(FScanner& sc, FScriptPosition& pos)
|
||||||
else if (sc.Compare("yoffset")) sc.GetNumber(sky.pmoffset, true);
|
else if (sc.Compare("yoffset")) sc.GetNumber(sky.pmoffset, true);
|
||||||
else if (sc.Compare("baseline")) sc.GetNumber(sky.baselineofs, true);
|
else if (sc.Compare("baseline")) sc.GetNumber(sky.baselineofs, true);
|
||||||
else if (sc.Compare("lognumtiles")) sc.GetNumber(sky.lognumtiles, true);
|
else if (sc.Compare("lognumtiles")) sc.GetNumber(sky.lognumtiles, true);
|
||||||
else if (sc.Compare("yscale")) { int intscale; sc.GetNumber(intscale, true); sky.scale = intscale * (1. / 65536.); }
|
else if (sc.Compare("yscale")) { int intscale; sc.GetNumber(intscale, true); sky.scale = intscale * (1.f / 65536.f); }
|
||||||
else if (sc.Compare({ "tile", "panel" }))
|
else if (sc.Compare({ "tile", "panel" }))
|
||||||
{
|
{
|
||||||
if (!sc.CheckString("}"))
|
if (!sc.CheckString("}"))
|
||||||
|
|
|
@ -171,7 +171,7 @@ int getslopeval(sectortype* sect, const DVector3& pos, double basez)
|
||||||
{
|
{
|
||||||
auto wal = sect->firstWall();
|
auto wal = sect->firstWall();
|
||||||
double i = (pos.XY() - wal->pos).dot(wal->delta().Rotated90CCW());
|
double i = (pos.XY() - wal->pos).dot(wal->delta().Rotated90CCW());
|
||||||
return i == 0? 0 : SLOPEVAL_FACTOR * (pos.Z - basez) * wal->Length() / i;
|
return i == 0? 0 : int(SLOPEVAL_FACTOR * (pos.Z - basez) * wal->Length() / i);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -569,9 +569,9 @@ inline int rintersect(int x1, int y1, int z1, int vx, int vy, int vz, int x3, in
|
||||||
double result = GetRayIntersect(DVector3(x1 * inttoworld, y1 * inttoworld, z1 * zinttoworld), DVector3(vx * inttoworld, vy * inttoworld, vz * zinttoworld),
|
double result = GetRayIntersect(DVector3(x1 * inttoworld, y1 * inttoworld, z1 * zinttoworld), DVector3(vx * inttoworld, vy * inttoworld, vz * zinttoworld),
|
||||||
DVector2(x3 * inttoworld, y3 * inttoworld), DVector2((x4 - x3) * inttoworld, (y4 - y3) * inttoworld), retv);
|
DVector2(x3 * inttoworld, y3 * inttoworld), DVector2((x4 - x3) * inttoworld, (y4 - y3) * inttoworld), retv);
|
||||||
if (result < 0) return -1;
|
if (result < 0) return -1;
|
||||||
*intx = retv.X * worldtoint;
|
*intx = int(retv.X * worldtoint);
|
||||||
*inty = retv.Y * worldtoint;
|
*inty = int(retv.Y * worldtoint);
|
||||||
*intz = retv.Z * zworldtoint;
|
*intz = int(retv.Z * zworldtoint);
|
||||||
return FloatToFixed(result);
|
return FloatToFixed(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,8 +158,8 @@ void processMovement(InputPacket* const currInput, InputPacket* const inputBuffe
|
||||||
if (isRR() && drink_amt >= 66 && drink_amt <= 87) currInput->svel += drink_amt & 1 ? -currInput->fvel : currInput->fvel;
|
if (isRR() && drink_amt >= 66 && drink_amt <= 87) currInput->svel += drink_amt & 1 ? -currInput->fvel : currInput->fvel;
|
||||||
|
|
||||||
// add collected input to game's local input accumulation packet.
|
// add collected input to game's local input accumulation packet.
|
||||||
inputBuffer->fvel = clamp<float>(inputBuffer->fvel + currInput->fvel, -keymove, keymove);
|
inputBuffer->fvel = clamp<float>(inputBuffer->fvel + currInput->fvel, -(float)keymove, (float)keymove);
|
||||||
inputBuffer->svel = clamp<float>(inputBuffer->svel + currInput->svel, -keymove, keymove);
|
inputBuffer->svel = clamp<float>(inputBuffer->svel + currInput->svel, -(float)keymove, (float)keymove);
|
||||||
inputBuffer->avel += currInput->avel;
|
inputBuffer->avel += currInput->avel;
|
||||||
inputBuffer->horz += currInput->horz;
|
inputBuffer->horz += currInput->horz;
|
||||||
}
|
}
|
||||||
|
|
|
@ -370,7 +370,7 @@ struct walltype
|
||||||
{
|
{
|
||||||
DVector2 pos;
|
DVector2 pos;
|
||||||
|
|
||||||
vec2_t wall_int_pos() const { return vec2_t(pos.X * worldtoint, pos.Y * worldtoint); };
|
vec2_t wall_int_pos() const { return vec2_t(int(pos.X * worldtoint), int(pos.Y * worldtoint)); };
|
||||||
vec2_t int_delta() const { return point2Wall()->wall_int_pos() - wall_int_pos(); }
|
vec2_t int_delta() const { return point2Wall()->wall_int_pos() - wall_int_pos(); }
|
||||||
|
|
||||||
void setPosFromMap(int x, int y) { pos = { x * maptoworld, y * maptoworld }; }
|
void setPosFromMap(int x, int y) { pos = { x * maptoworld, y * maptoworld }; }
|
||||||
|
|
|
@ -1566,7 +1566,7 @@ class GLDefsParser
|
||||||
ExtraUniformCVARData* oldextra = nullptr;
|
ExtraUniformCVARData* oldextra = nullptr;
|
||||||
sc.MustGetFloat();
|
sc.MustGetFloat();
|
||||||
|
|
||||||
val.Float = oldval.Float = sc.Float;
|
val.Float = oldval.Float = (float)sc.Float;
|
||||||
|
|
||||||
if (!Args->CheckParm ("-shaderuniformtest"))
|
if (!Args->CheckParm ("-shaderuniformtest"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -163,7 +163,7 @@ void vertex_t::RecalcVertexHeights()
|
||||||
float heights[2];
|
float heights[2];
|
||||||
|
|
||||||
auto point = wall[masterwall].pos;
|
auto point = wall[masterwall].pos;
|
||||||
PlanesAtPoint(§or[sect], point.X, point.Y, &heights[0], &heights[1]);
|
PlanesAtPoint(§or[sect], (float)point.X, (float)point.Y, &heights[0], &heights[1]);
|
||||||
for(auto height : heights)
|
for(auto height : heights)
|
||||||
{
|
{
|
||||||
int k;
|
int k;
|
||||||
|
|
|
@ -42,6 +42,11 @@
|
||||||
#include "hw_sections.h"
|
#include "hw_sections.h"
|
||||||
#include "tesselator.h"
|
#include "tesselator.h"
|
||||||
|
|
||||||
|
// this is too noisy in this file.
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4244)
|
||||||
|
#endif
|
||||||
|
|
||||||
SectionGeometry sectionGeometry;
|
SectionGeometry sectionGeometry;
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -158,7 +163,7 @@ public:
|
||||||
// To calculate the inverse Build performs an integer division with significant loss of precision
|
// To calculate the inverse Build performs an integer division with significant loss of precision
|
||||||
// that can cause the texture to be shifted by multiple pixels.
|
// that can cause the texture to be shifted by multiple pixels.
|
||||||
// The code below calculates the amount of this deviation so that it can be added back to the formula.
|
// The code below calculates the amount of this deviation so that it can be added back to the formula.
|
||||||
int x = ix2 - ix1, y = iy2 - iy1;
|
int x = int(ix2 - ix1), y = int(iy2 - iy1);
|
||||||
int len = int(sqrt(double(x) * x + double(y) * y));
|
int len = int(sqrt(double(x) * x + double(y) * y));
|
||||||
if (len != 0)
|
if (len != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -171,7 +171,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, setfloorxpan, sector_setfloorxpan)
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
||||||
PARAM_FLOAT(xpan);
|
PARAM_FLOAT(xpan);
|
||||||
self->setfloorxpan(xpan);
|
sector_setfloorxpan(self, xpan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, setceilingxpan, sector_setceilingxpan
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
||||||
PARAM_FLOAT(xpan);
|
PARAM_FLOAT(xpan);
|
||||||
self->setceilingxpan(xpan);
|
sector_setceilingxpan(self, xpan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, addfloorxpan, sector_addfloorxpan)
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
||||||
PARAM_FLOAT(xpan);
|
PARAM_FLOAT(xpan);
|
||||||
self->addfloorxpan(xpan);
|
sector_addfloorxpan(self, xpan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, addceilingxpan, sector_addceilingxpan
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
||||||
PARAM_FLOAT(xpan);
|
PARAM_FLOAT(xpan);
|
||||||
self->addceilingxpan(xpan);
|
sector_addceilingxpan(self, xpan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, setfloorypan, sector_setfloorypan)
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
||||||
PARAM_FLOAT(ypan);
|
PARAM_FLOAT(ypan);
|
||||||
self->setfloorypan(ypan);
|
sector_setfloorypan(self, ypan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, setceilingypan, sector_setceilingypan
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
||||||
PARAM_FLOAT(ypan);
|
PARAM_FLOAT(ypan);
|
||||||
self->setceilingypan(ypan);
|
sector_setceilingypan(self, ypan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, addfloorypan, sector_addfloorypan)
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
||||||
PARAM_FLOAT(ypan);
|
PARAM_FLOAT(ypan);
|
||||||
self->addfloorypan(ypan);
|
sector_addfloorypan(self, ypan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, addceilingypan, sector_addceilingypan
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
PARAM_SELF_STRUCT_PROLOGUE(sectortype);
|
||||||
PARAM_FLOAT(ypan);
|
PARAM_FLOAT(ypan);
|
||||||
self->addceilingypan(ypan);
|
sector_addceilingypan(self, ypan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_walltype, setxpan, wall_setxpan)
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(walltype);
|
PARAM_SELF_STRUCT_PROLOGUE(walltype);
|
||||||
PARAM_FLOAT(xpan);
|
PARAM_FLOAT(xpan);
|
||||||
self->setxpan(xpan);
|
wall_setxpan(self, xpan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,7 +353,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_walltype, addxpan, wall_addxpan)
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(walltype);
|
PARAM_SELF_STRUCT_PROLOGUE(walltype);
|
||||||
PARAM_FLOAT(xpan);
|
PARAM_FLOAT(xpan);
|
||||||
self->addxpan(xpan);
|
wall_addxpan(self, xpan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_walltype, setypan, wall_setypan)
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(walltype);
|
PARAM_SELF_STRUCT_PROLOGUE(walltype);
|
||||||
PARAM_FLOAT(ypan);
|
PARAM_FLOAT(ypan);
|
||||||
self->setypan(ypan);
|
wall_setypan(self, ypan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,7 +381,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_walltype, addypan, wall_addypan)
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(walltype);
|
PARAM_SELF_STRUCT_PROLOGUE(walltype);
|
||||||
PARAM_FLOAT(ypan);
|
PARAM_FLOAT(ypan);
|
||||||
self->addypan(ypan);
|
wall_addypan(self, ypan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ void CGameMenuItemQAV::Draw(void)
|
||||||
{
|
{
|
||||||
int xdim43 = Scale(twod->GetHeight(), 4, 3);
|
int xdim43 = Scale(twod->GetHeight(), 4, 3);
|
||||||
int nCount = (twod->GetWidth() + xdim43 - 1) / xdim43;
|
int nCount = (twod->GetWidth() + xdim43 - 1) / xdim43;
|
||||||
int backX = data->x;
|
double backX = data->x;
|
||||||
for (int i = 0; i < nCount; i++)
|
for (int i = 0; i < nCount; i++)
|
||||||
{
|
{
|
||||||
data->Draw(currentDuration, 10 + kQavOrientationLeft, 0, 0, false, interpfrac);
|
data->Draw(currentDuration, 10 + kQavOrientationLeft, 0, 0, false, interpfrac);
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
DBloodActor* actor() { assert(isActor()); return GC::ReadBarrier(ActorP); }
|
DBloodActor* actor() { assert(isActor()); return GC::ReadBarrier(ActorP); }
|
||||||
sectortype* sector() { assert(isSector()); return &::sector[index >> 8]; }
|
sectortype* sector() { assert(isSector()); return &::sector[index >> 8]; }
|
||||||
walltype* wall() { assert(isWall()); return &::wall[index >> 8]; }
|
walltype* wall() { assert(isWall()); return &::wall[index >> 8]; }
|
||||||
int rawindex() { return index >> 8; }
|
int rawindex() { return int(index >> 8); }
|
||||||
|
|
||||||
bool operator==(const EventObject& other) const { return index == other.index; }
|
bool operator==(const EventObject& other) const { return index == other.index; }
|
||||||
bool operator!=(const EventObject& other) const { return index != other.index; }
|
bool operator!=(const EventObject& other) const { return index != other.index; }
|
||||||
|
|
|
@ -70,12 +70,12 @@ bool CheckProximity(DBloodActor* actor, const DVector3& pos, sectortype* pSector
|
||||||
|
|
||||||
bool CheckProximityWall(walltype* pWall, const DVector2& pos, int nDist)
|
bool CheckProximityWall(walltype* pWall, const DVector2& pos, int nDist)
|
||||||
{
|
{
|
||||||
int x = pos.X * (1. / maptoworld);
|
int x = int(pos.X * (1. / maptoworld));
|
||||||
int y = pos.Y * (1. / maptoworld);
|
int y = int(pos.Y * (1. / maptoworld));
|
||||||
int x1 = pWall->pos.X * (1./maptoworld);
|
int x1 = int(pWall->pos.X * (1./maptoworld));
|
||||||
int y1 = pWall->pos.Y * (1./maptoworld);
|
int y1 = int(pWall->pos.Y * (1./maptoworld));
|
||||||
int x2 = pWall->point2Wall()->pos.X * (1./maptoworld);
|
int x2 = int(pWall->point2Wall()->pos.X * (1./maptoworld));
|
||||||
int y2 = pWall->point2Wall()->pos.Y * (1./maptoworld);
|
int y2 = int(pWall->point2Wall()->pos.Y * (1./maptoworld));
|
||||||
nDist <<= 4;
|
nDist <<= 4;
|
||||||
if (x1 < x2)
|
if (x1 < x2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1572,7 +1572,7 @@ void debrisConcuss(DBloodActor* owneractor, int listIndex, const DVector3& pos,
|
||||||
|
|
||||||
dmg = int(dmg * (0x4000 / (0x4000 + dv.LengthSquared())));
|
dmg = int(dmg * (0x4000 / (0x4000 + dv.LengthSquared())));
|
||||||
bool thing = (actor->spr.type >= kThingBase && actor->spr.type < kThingMax);
|
bool thing = (actor->spr.type >= kThingBase && actor->spr.type < kThingMax);
|
||||||
int size = (tileWidth(actor->spr.picnum) * actor->spr.scale.X * tileHeight(actor->spr.picnum) * actor->spr.scale.Y) * 2048;
|
double size = (tileWidth(actor->spr.picnum) * actor->spr.scale.X * tileHeight(actor->spr.picnum) * actor->spr.scale.Y) * 2048;
|
||||||
if (actor->xspr.physAttr & kPhysDebrisExplode)
|
if (actor->xspr.physAttr & kPhysDebrisExplode)
|
||||||
{
|
{
|
||||||
if (actor->spriteMass.mass > 0)
|
if (actor->spriteMass.mass > 0)
|
||||||
|
|
|
@ -93,7 +93,7 @@ void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3
|
||||||
auto actor = (DBloodActor*)source;
|
auto actor = (DBloodActor*)source;
|
||||||
|
|
||||||
// Engine expects velocity in units per second, not units per tic.
|
// Engine expects velocity in units per second, not units per tic.
|
||||||
if (vel) *vel = FVector3(actor->vel.X * 30, actor->vel.Z * -30, actor->vel.Y * -30);
|
if (vel) *vel = FVector3(float(actor->vel.X * 30), float(actor->vel.Z * -30), float(actor->vel.Y * -30));
|
||||||
*pos = GetSoundPos(actor->spr.pos);
|
*pos = GetSoundPos(actor->spr.pos);
|
||||||
}
|
}
|
||||||
else if (type == SOURCE_Ambient)
|
else if (type == SOURCE_Ambient)
|
||||||
|
@ -120,7 +120,7 @@ void GameInterface::UpdateSounds()
|
||||||
|
|
||||||
if (pPlayer->actor)
|
if (pPlayer->actor)
|
||||||
{
|
{
|
||||||
listener.angle = -pPlayer->actor->spr.angle.Radians();
|
listener.angle = float(-pPlayer->actor->spr.angle.Radians());
|
||||||
listener.velocity.Zero();
|
listener.velocity.Zero();
|
||||||
listener.position = GetSoundPos(pPlayer->actor->spr.pos);
|
listener.position = GetSoundPos(pPlayer->actor->spr.pos);
|
||||||
listener.valid = true;
|
listener.valid = true;
|
||||||
|
|
|
@ -1412,7 +1412,7 @@ bool rat(DDukeActor* actor, bool makesound)
|
||||||
if (ssp(actor, CLIPMASK0))
|
if (ssp(actor, CLIPMASK0))
|
||||||
{
|
{
|
||||||
if (makesound && (krand() & 255) == 0) S_PlayActorSound(RATTY, actor);
|
if (makesound && (krand() & 255) == 0) S_PlayActorSound(RATTY, actor);
|
||||||
actor->spr.angle += mapangle((krand() & 31) - 15 + BobVal(actor->temp_data[0] << 8) * 8);
|
actor->spr.angle += mapangle((krand() & 31) - 15 + int(BobVal(actor->temp_data[0] << 8) * 8));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -4141,11 +4141,11 @@ void handle_se20(DDukeActor* actor)
|
||||||
SetActor(ps[p].GetActor(), ps[p].pos.plusZ(gs.playerheight));
|
SetActor(ps[p].GetActor(), ps[p].pos.plusZ(gs.playerheight));
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->addfloorxpan(-vec.X * 2);
|
sc->addfloorxpan(-(float)vec.X * 2);
|
||||||
sc->addfloorypan(-vec.Y * 2);
|
sc->addfloorypan(-(float)vec.Y * 2);
|
||||||
|
|
||||||
sc->addceilingxpan(-vec.X * 2);
|
sc->addceilingxpan(-(float)vec.X * 2);
|
||||||
sc->addceilingypan(-vec.Y * 2);
|
sc->addceilingypan(-(float)vec.Y * 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -847,7 +847,7 @@ static void movetripbomb(DDukeActor *actor)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = actor->spr.extra;
|
auto ex = actor->spr.extra;
|
||||||
actor->spr.extra = 1;
|
actor->spr.extra = 1;
|
||||||
auto ang = actor->spr.angle;
|
auto ang = actor->spr.angle;
|
||||||
j = fi.ifhitbyweapon(actor);
|
j = fi.ifhitbyweapon(actor);
|
||||||
|
@ -855,7 +855,7 @@ static void movetripbomb(DDukeActor *actor)
|
||||||
{
|
{
|
||||||
actor->temp_data[2] = 16;
|
actor->temp_data[2] = 16;
|
||||||
}
|
}
|
||||||
actor->spr.extra = x;
|
actor->spr.extra = ex;
|
||||||
actor->spr.angle = ang;
|
actor->spr.angle = ang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@ static short torchtype[64];
|
||||||
struct jaildoor
|
struct jaildoor
|
||||||
{
|
{
|
||||||
sectortype* sect;
|
sectortype* sect;
|
||||||
|
double dist;
|
||||||
|
double drag;
|
||||||
int speed;
|
int speed;
|
||||||
float dist;
|
|
||||||
float drag;
|
|
||||||
int16_t direction;
|
int16_t direction;
|
||||||
int16_t sound;
|
int16_t sound;
|
||||||
int16_t open;
|
int16_t open;
|
||||||
|
@ -58,9 +58,9 @@ struct minecart
|
||||||
{
|
{
|
||||||
sectortype* sect;
|
sectortype* sect;
|
||||||
sectortype* childsect;
|
sectortype* childsect;
|
||||||
|
double dist;
|
||||||
|
double drag;
|
||||||
int speed;
|
int speed;
|
||||||
float dist;
|
|
||||||
float drag;
|
|
||||||
int16_t direction;
|
int16_t direction;
|
||||||
int16_t sound;
|
int16_t sound;
|
||||||
int16_t open;
|
int16_t open;
|
||||||
|
|
|
@ -297,12 +297,12 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
|
|
||||||
case PLAYER_EXITX:
|
case PLAYER_EXITX:
|
||||||
if (bSet) ps[iPlayer].Exit.X = lValue * maptoworld;
|
if (bSet) ps[iPlayer].Exit.X = lValue * maptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].Exit.X / maptoworld, sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].Exit.X / maptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_EXITY:
|
case PLAYER_EXITY:
|
||||||
if (bSet) ps[iPlayer].Exit.Y = lValue * maptoworld;
|
if (bSet) ps[iPlayer].Exit.Y = lValue * maptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].Exit.Y / maptoworld, sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].Exit.Y / maptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_LOOGIEX:
|
case PLAYER_LOOGIEX:
|
||||||
|
@ -326,15 +326,15 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_POSX: // oh, my... :( Writing to these has been disabled until I know how to do it without the engine shitting all over itself.
|
case PLAYER_POSX: // oh, my... :( Writing to these has been disabled until I know how to do it without the engine shitting all over itself.
|
||||||
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].pos.X * (1/maptoworld), sActor, sPlayer);
|
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].pos.X * (1/maptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_POSY:
|
case PLAYER_POSY:
|
||||||
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].pos.Y * (1 / maptoworld), sActor, sPlayer);
|
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].pos.Y * (1 / maptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_POSZ:
|
case PLAYER_POSZ:
|
||||||
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].pos.Z * (1 / zmaptoworld), sActor, sPlayer);
|
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].pos.Z * (1 / zmaptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_HORIZ:
|
case PLAYER_HORIZ:
|
||||||
|
@ -369,37 +369,37 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
|
|
||||||
case PLAYER_BOBPOSX:
|
case PLAYER_BOBPOSX:
|
||||||
if (bSet) ps[iPlayer].bobpos.X = lValue * maptoworld;
|
if (bSet) ps[iPlayer].bobpos.X = lValue * maptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].bobpos.X * (1/maptoworld), sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].bobpos.X * (1/maptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_BOBPOSY:
|
case PLAYER_BOBPOSY:
|
||||||
if (bSet) ps[iPlayer].bobpos.Y = lValue * maptoworld;
|
if (bSet) ps[iPlayer].bobpos.Y = lValue * maptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].bobpos.Y * (1/maptoworld), sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].bobpos.Y * (1/maptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_OPOSX:
|
case PLAYER_OPOSX:
|
||||||
if (bSet) ps[iPlayer].opos.X = lValue * maptoworld;
|
if (bSet) ps[iPlayer].opos.X = lValue * maptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].opos.X * (1/maptoworld), sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].opos.X * (1/maptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_OPOSY:
|
case PLAYER_OPOSY:
|
||||||
if (bSet) ps[iPlayer].opos.Y = lValue * maptoworld;
|
if (bSet) ps[iPlayer].opos.Y = lValue * maptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].opos.Y * (1 / maptoworld), sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].opos.Y * (1 / maptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_OPOSZ:
|
case PLAYER_OPOSZ:
|
||||||
if (bSet) ps[iPlayer].opos.Z = lValue * zmaptoworld;
|
if (bSet) ps[iPlayer].opos.Z = lValue * zmaptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].opos.Z * (1 / zmaptoworld), sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].opos.Z * (1 / zmaptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_PYOFF:
|
case PLAYER_PYOFF:
|
||||||
if (bSet) ps[iPlayer].pyoff = lValue * zmaptoworld;
|
if (bSet) ps[iPlayer].pyoff = lValue * zmaptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].pyoff / zmaptoworld, sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].pyoff / zmaptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_OPYOFF:
|
case PLAYER_OPYOFF:
|
||||||
if (bSet) ps[iPlayer].opyoff = lValue * zmaptoworld;
|
if (bSet) ps[iPlayer].opyoff = lValue * zmaptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].opyoff / zmaptoworld, sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].opyoff / zmaptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_POSXV:
|
case PLAYER_POSXV:
|
||||||
|
@ -414,7 +414,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
|
|
||||||
case PLAYER_POSZV:
|
case PLAYER_POSZV:
|
||||||
if (bSet) ps[iPlayer].vel.Z = lValue * zmaptoworld;
|
if (bSet) ps[iPlayer].vel.Z = lValue * zmaptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].vel.Z / zmaptoworld, sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].vel.Z / zmaptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_LAST_PISSED_TIME:
|
case PLAYER_LAST_PISSED_TIME:
|
||||||
|
@ -424,12 +424,12 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
|
|
||||||
case PLAYER_TRUEFZ:
|
case PLAYER_TRUEFZ:
|
||||||
if (bSet) ps[iPlayer].truefz = lValue * zmaptoworld;
|
if (bSet) ps[iPlayer].truefz = lValue * zmaptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].truefz * (1/zmaptoworld), sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].truefz * (1/zmaptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_TRUECZ:
|
case PLAYER_TRUECZ:
|
||||||
if (bSet) ps[iPlayer].truecz = lValue * zmaptoworld;
|
if (bSet) ps[iPlayer].truecz = lValue * zmaptoworld;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].truecz * (1 / zmaptoworld), sActor, sPlayer);
|
else SetGameVarID(lVar2, int(ps[iPlayer].truecz * (1 / zmaptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_PLAYER_PAR:
|
case PLAYER_PLAYER_PAR:
|
||||||
|
@ -953,10 +953,10 @@ void DoWall(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, i
|
||||||
switch (lLabelID)
|
switch (lLabelID)
|
||||||
{
|
{
|
||||||
case WALL_X:
|
case WALL_X:
|
||||||
if (!bSet) SetGameVarID(lVar2, wallp->pos.X / maptoworld, sActor, sPlayer);
|
if (!bSet) SetGameVarID(lVar2, int(wallp->pos.X / maptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case WALL_Y:
|
case WALL_Y:
|
||||||
if (!bSet) SetGameVarID(lVar2, wallp->pos.Y / maptoworld, sActor, sPlayer);
|
if (!bSet) SetGameVarID(lVar2, int(wallp->pos.Y / maptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case WALL_POINT2:
|
case WALL_POINT2:
|
||||||
if (!bSet) SetGameVarID(lVar2, wallp->point2, sActor, sPlayer);
|
if (!bSet) SetGameVarID(lVar2, wallp->point2, sActor, sPlayer);
|
||||||
|
@ -1168,13 +1168,13 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
switch (lLabelID)
|
switch (lLabelID)
|
||||||
{
|
{
|
||||||
case ACTOR_X:
|
case ACTOR_X:
|
||||||
if (!bSet) SetGameVarID(lVar2, act->spr.pos.X / maptoworld, sActor, sPlayer);
|
if (!bSet) SetGameVarID(lVar2, int(act->spr.pos.X / maptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case ACTOR_Y:
|
case ACTOR_Y:
|
||||||
if (!bSet) SetGameVarID(lVar2, act->spr.pos.Y / maptoworld, sActor, sPlayer);
|
if (!bSet) SetGameVarID(lVar2, int(act->spr.pos.Y / maptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case ACTOR_Z:
|
case ACTOR_Z:
|
||||||
if (!bSet) SetGameVarID(lVar2, act->spr.pos.Z / zmaptoworld, sActor, sPlayer);
|
if (!bSet) SetGameVarID(lVar2, int(act->spr.pos.Z / zmaptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case ACTOR_CSTAT:
|
case ACTOR_CSTAT:
|
||||||
if (bSet) act->spr.cstat = ESpriteFlags::FromInt(lValue);
|
if (bSet) act->spr.cstat = ESpriteFlags::FromInt(lValue);
|
||||||
|
@ -1235,7 +1235,7 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
break;
|
break;
|
||||||
case ACTOR_XVEL:
|
case ACTOR_XVEL:
|
||||||
if (bSet) act->vel.X = lValue * maptoworld;
|
if (bSet) act->vel.X = lValue * maptoworld;
|
||||||
else SetGameVarID(lVar2, act->vel.X / maptoworld, sActor, sPlayer);
|
else SetGameVarID(lVar2, int(act->vel.X / maptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case ACTOR_YVEL:
|
case ACTOR_YVEL:
|
||||||
if (bSet) act->spr.yint = lValue;
|
if (bSet) act->spr.yint = lValue;
|
||||||
|
@ -1243,7 +1243,7 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
break;
|
break;
|
||||||
case ACTOR_ZVEL:
|
case ACTOR_ZVEL:
|
||||||
if (bSet) act->vel.Z = lValue * zmaptoworld;
|
if (bSet) act->vel.Z = lValue * zmaptoworld;
|
||||||
else SetGameVarID(lVar2, act->vel.Z / zmaptoworld, sActor, sPlayer);
|
else SetGameVarID(lVar2, int(act->vel.Z / zmaptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case ACTOR_LOTAG:
|
case ACTOR_LOTAG:
|
||||||
if (bSet) act->spr.lotag = lValue;
|
if (bSet) act->spr.lotag = lValue;
|
||||||
|
@ -1300,19 +1300,19 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
break;
|
break;
|
||||||
case ACTOR_HTFLOORZ:
|
case ACTOR_HTFLOORZ:
|
||||||
if (bSet) act->floorz = lValue * zmaptoworld;
|
if (bSet) act->floorz = lValue * zmaptoworld;
|
||||||
else SetGameVarID(lVar2, act->floorz * (1/zmaptoworld), sActor, sPlayer);
|
else SetGameVarID(lVar2, int(act->floorz * (1/zmaptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case ACTOR_HTCEILINGZ:
|
case ACTOR_HTCEILINGZ:
|
||||||
if (bSet) act->ceilingz = lValue * zmaptoworld;
|
if (bSet) act->ceilingz = lValue * zmaptoworld;
|
||||||
else SetGameVarID(lVar2, act->ceilingz * (1/zmaptoworld), sActor, sPlayer);
|
else SetGameVarID(lVar2, int(act->ceilingz * (1/zmaptoworld)), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case ACTOR_HTLASTVX:
|
case ACTOR_HTLASTVX:
|
||||||
if (bSet) act->ovel.X = lValue * maptoworld;
|
if (bSet) act->ovel.X = lValue * maptoworld;
|
||||||
else SetGameVarID(lVar2, act->ovel.X / maptoworld, sActor, sPlayer);
|
else SetGameVarID(lVar2, int(act->ovel.X / maptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case ACTOR_HTLASTVY:
|
case ACTOR_HTLASTVY:
|
||||||
if (bSet) act->ovel.Y = lValue * maptoworld;
|
if (bSet) act->ovel.Y = lValue * maptoworld;
|
||||||
else SetGameVarID(lVar2, act->ovel.Y / maptoworld, sActor, sPlayer);
|
else SetGameVarID(lVar2, int(act->ovel.Y / maptoworld), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case ACTOR_HTG_T0:
|
case ACTOR_HTG_T0:
|
||||||
if (bSet) act->temp_data[0] = lValue;
|
if (bSet) act->temp_data[0] = lValue;
|
||||||
|
|
|
@ -25,13 +25,13 @@ class GameVarValue
|
||||||
public:
|
public:
|
||||||
GameVarValue() = default;
|
GameVarValue() = default;
|
||||||
explicit GameVarValue(DDukeActor* actor_) { ActorP = actor_; assert(isActor()); }
|
explicit GameVarValue(DDukeActor* actor_) { ActorP = actor_; assert(isActor()); }
|
||||||
explicit GameVarValue(int val) { index = (val << 8) | Value; }
|
explicit GameVarValue(intptr_t val) { index = (val << 8) | Value; }
|
||||||
|
|
||||||
bool isActor() const { return (index & 7) == Actor; }
|
bool isActor() const { return (index & 7) == Actor; }
|
||||||
bool isValue() const { return (index & 7) == Value; }
|
bool isValue() const { return (index & 7) == Value; }
|
||||||
|
|
||||||
DDukeActor* actor() { assert(isActor()); return GC::ReadBarrier(ActorP); }
|
DDukeActor* actor() { assert(isActor()); return GC::ReadBarrier(ActorP); }
|
||||||
int value() { assert(isValue()); return index >> 8; }
|
int value() { assert(isValue()); return int(index >> 8); }
|
||||||
int safeValue() { return isValue() ? value() : actor() == nullptr ? 0 : -1; } // return -1 for valid actors and 0 for null. This allows most comparisons to work.
|
int safeValue() { return isValue() ? value() : actor() == nullptr ? 0 : -1; } // return -1 for valid actors and 0 for null. This allows most comparisons to work.
|
||||||
DDukeActor* safeActor() { return isActor() ? actor() : nullptr; }
|
DDukeActor* safeActor() { return isActor() ? actor() : nullptr; }
|
||||||
|
|
||||||
|
|
|
@ -759,7 +759,7 @@ static void processVehicleInput(player_struct *p, ControlInfo* const hidInput, I
|
||||||
input.avel = (float)boatApplyTurn(p, hidInput, kbdLeft, kbdRight, scaleAdjust);
|
input.avel = (float)boatApplyTurn(p, hidInput, kbdLeft, kbdRight, scaleAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
loc.fvel = clamp<float>(p->MotoSpeed, -(MAXVELMOTO >> 3), MAXVELMOTO) * (1.f / 40.f);
|
loc.fvel = clamp<float>((float)p->MotoSpeed, -(MAXVELMOTO >> 3), MAXVELMOTO) * (1.f / 40.f);
|
||||||
input.avel *= BAngToDegree;
|
input.avel *= BAngToDegree;
|
||||||
loc.avel += input.avel;
|
loc.avel += input.avel;
|
||||||
}
|
}
|
||||||
|
@ -850,8 +850,8 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
||||||
{
|
{
|
||||||
*packet = loc;
|
*packet = loc;
|
||||||
auto velvect = DVector2(loc.fvel, loc.svel).Rotated(p->angle.ang) + p->fric;
|
auto velvect = DVector2(loc.fvel, loc.svel).Rotated(p->angle.ang) + p->fric;
|
||||||
packet->fvel = velvect.X;
|
packet->fvel = (float)velvect.X;
|
||||||
packet->svel = velvect.Y;
|
packet->svel = (float)velvect.Y;
|
||||||
loc = {};
|
loc = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -440,7 +440,7 @@ void StartRegenerate(DExhumedActor* pActor)
|
||||||
if (pos >= Regenerates.Size())
|
if (pos >= Regenerates.Size())
|
||||||
{
|
{
|
||||||
// ?? CHECKME
|
// ?? CHECKME
|
||||||
pActor->spr.xint = pActor->spr.scale.X * INV_REPEAT_SCALE;
|
pActor->spr.xint = int16_t(pActor->spr.scale.X * INV_REPEAT_SCALE);
|
||||||
pActor->spr.inittype = pActor->spr.shade;
|
pActor->spr.inittype = pActor->spr.shade;
|
||||||
pActor->spr.yint = pActor->spr.pal;
|
pActor->spr.yint = pActor->spr.pal;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2110,7 +2110,7 @@ struct ANIM
|
||||||
animactor->user.pos.Z = value;
|
animactor->user.pos.Z = value;
|
||||||
break;
|
break;
|
||||||
case ANIM_SUdepth:
|
case ANIM_SUdepth:
|
||||||
sector[animindex].depth_fixed = value;
|
sector[animindex].depth_fixed = (int)value;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,8 +208,8 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
||||||
{
|
{
|
||||||
*packet = loc;
|
*packet = loc;
|
||||||
auto velvect = DVector2(loc.fvel, loc.svel).Rotated(pp->angle.ang);
|
auto velvect = DVector2(loc.fvel, loc.svel).Rotated(pp->angle.ang);
|
||||||
packet->fvel = velvect.X;
|
packet->fvel = (float)velvect.X;
|
||||||
packet->svel = velvect.Y;
|
packet->svel = (float)velvect.Y;
|
||||||
loc = {};
|
loc = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue