mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-02 13:51:52 +00:00
- fixed some warnings and updated vectors.h
This commit is contained in:
parent
1241b277f3
commit
57add9a45c
3 changed files with 29 additions and 11 deletions
|
@ -126,7 +126,7 @@ bool InterplayDecoder::FillSamples(void *buff, int len)
|
|||
audio.Packets.pop_front();
|
||||
plock.unlock();
|
||||
|
||||
int nSamples = pkt.nSize;
|
||||
int nSamples = (int)pkt.nSize;
|
||||
const uint8_t *samplePtr = pkt.pData.get();
|
||||
if (audio.bCompressed)
|
||||
{
|
||||
|
@ -153,7 +153,7 @@ bool InterplayDecoder::FillSamples(void *buff, int len)
|
|||
audio.samples[audio.nWrite++] = predictor[ch];
|
||||
|
||||
// toggle channel
|
||||
ch ^= stereo;
|
||||
ch ^= stereo ? 1 : 0;
|
||||
}
|
||||
}
|
||||
else if (audio.nBitDepth == 8)
|
||||
|
|
|
@ -732,7 +732,7 @@ void SmackerDecoder::GetNextFrame()
|
|||
framePacketData.pop_front();
|
||||
flock.unlock();
|
||||
|
||||
uint32_t frameSize = pkt.size;
|
||||
uint32_t frameSize = (uint32_t)pkt.size;
|
||||
uint8_t frameFlag = frameFlags[currentFrame];
|
||||
|
||||
const uint8_t *packetDataPtr = pkt.data.get();
|
||||
|
@ -1235,7 +1235,7 @@ uint32_t SmackerDecoder::GetAudioData(uint32_t trackIndex, int16_t *audioBuffer)
|
|||
track->bytesReadThisFrame = 0;
|
||||
|
||||
const uint8_t *packetDataPtr = pkt.data.get();
|
||||
uint32_t size = pkt.size;
|
||||
uint32_t size = (uint32_t)pkt.size;
|
||||
|
||||
DecodeAudio(packetDataPtr, size, *track);
|
||||
|
||||
|
|
|
@ -577,7 +577,7 @@ struct TVector3
|
|||
}
|
||||
|
||||
up = n ^right;
|
||||
right.MakeUnit();;
|
||||
right.MakeUnit();
|
||||
up.MakeUnit();
|
||||
}
|
||||
|
||||
|
@ -665,6 +665,7 @@ struct TVector3
|
|||
template<class vec_t>
|
||||
struct TVector4
|
||||
{
|
||||
typedef TVector2<vec_t> Vector2;
|
||||
typedef TVector3<vec_t> Vector3;
|
||||
|
||||
vec_t X, Y, Z, W;
|
||||
|
@ -723,6 +724,29 @@ struct TVector4
|
|||
return X != other.X || Y != other.Y || Z != other.Z || W != other.W;
|
||||
}
|
||||
|
||||
// returns the XY fields as a 2D-vector.
|
||||
const Vector2& XY() const
|
||||
{
|
||||
return *reinterpret_cast<const Vector2*>(this);
|
||||
}
|
||||
|
||||
Vector2& XY()
|
||||
{
|
||||
return *reinterpret_cast<Vector2*>(this);
|
||||
}
|
||||
|
||||
// returns the XY fields as a 2D-vector.
|
||||
const Vector3& XYZ() const
|
||||
{
|
||||
return *reinterpret_cast<const Vector3*>(this);
|
||||
}
|
||||
|
||||
Vector3& XYZ()
|
||||
{
|
||||
return *reinterpret_cast<Vector3*>(this);
|
||||
}
|
||||
|
||||
|
||||
// Test for approximate equality
|
||||
bool ApproximatelyEquals(const TVector4 &other) const
|
||||
{
|
||||
|
@ -838,12 +862,6 @@ struct TVector4
|
|||
return *this;
|
||||
}
|
||||
|
||||
// returns the XYZ fields as a 3D-vector.
|
||||
Vector3 XYZ() const
|
||||
{
|
||||
return{ X, Y, Z };
|
||||
}
|
||||
|
||||
// Add a 4D vector and a 3D vector.
|
||||
friend TVector4 operator+ (const TVector4 &v4, const Vector3 &v3)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue