mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 08:31:23 +00:00
- made adjustments to floating point bounding boxes for nodes and changes to the WarpBuffer function.
This commit is contained in:
parent
737646b45d
commit
24526f7da5
3 changed files with 7 additions and 32 deletions
|
@ -396,27 +396,6 @@ void R_SetView()
|
||||||
viewy = FLOAT2FIXED(ViewPos.Y);
|
viewy = FLOAT2FIXED(ViewPos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
angle_t R_PointToPseudoAngle (fixed_t x, fixed_t y)
|
|
||||||
{
|
|
||||||
double vecx = double(x-viewx);
|
|
||||||
double vecy = double(y-viewy);
|
|
||||||
|
|
||||||
if (vecx == 0 && vecy == 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
double result = vecy / (fabs(vecx) + fabs(vecy));
|
|
||||||
if (vecx < 0)
|
|
||||||
{
|
|
||||||
result = 2.f - result;
|
|
||||||
}
|
|
||||||
return xs_Fix<30>::ToFix(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
angle_t R_PointToPseudoAngle(double x, double y)
|
angle_t R_PointToPseudoAngle(double x, double y)
|
||||||
{
|
{
|
||||||
double vecx = x - ViewPos.X;
|
double vecx = x - ViewPos.X;
|
||||||
|
@ -447,7 +426,7 @@ angle_t R_PointToPseudoAngle(double x, double y)
|
||||||
// if some part of the bbox might be visible.
|
// if some part of the bbox might be visible.
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
static const int checkcoord[12][4] = // killough -- static const
|
static const BYTE checkcoord[12][4] = // killough -- static const
|
||||||
{
|
{
|
||||||
{3,0,2,1},
|
{3,0,2,1},
|
||||||
{3,0,2,0},
|
{3,0,2,0},
|
||||||
|
@ -462,17 +441,17 @@ angle_t R_PointToPseudoAngle(double x, double y)
|
||||||
{2,1,3,0}
|
{2,1,3,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool Clipper::CheckBox(const fixed_t *bspcoord)
|
bool Clipper::CheckBox(const float *bspcoord)
|
||||||
{
|
{
|
||||||
angle_t angle1, angle2;
|
angle_t angle1, angle2;
|
||||||
|
|
||||||
int boxpos;
|
int boxpos;
|
||||||
const int* check;
|
const BYTE* check;
|
||||||
|
|
||||||
// Find the corners of the box
|
// Find the corners of the box
|
||||||
// that define the edges from current viewpoint.
|
// that define the edges from current viewpoint.
|
||||||
boxpos = (viewx <= bspcoord[BOXLEFT] ? 0 : viewx < bspcoord[BOXRIGHT ] ? 1 : 2) +
|
boxpos = (ViewPos.X <= bspcoord[BOXLEFT] ? 0 : ViewPos.X < bspcoord[BOXRIGHT ] ? 1 : 2) +
|
||||||
(viewy >= bspcoord[BOXTOP ] ? 0 : viewy > bspcoord[BOXBOTTOM] ? 4 : 8);
|
(ViewPos.Y >= bspcoord[BOXTOP ] ? 0 : ViewPos.Y > bspcoord[BOXBOTTOM] ? 4 : 8);
|
||||||
|
|
||||||
if (boxpos == 5) return true;
|
if (boxpos == 5) return true;
|
||||||
|
|
||||||
|
|
|
@ -129,13 +129,12 @@ public:
|
||||||
SafeRemoveClipRange(AngleToPseudo(startangle), AngleToPseudo(endangle));
|
SafeRemoveClipRange(AngleToPseudo(startangle), AngleToPseudo(endangle));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckBox(const fixed_t *bspcoord);
|
bool CheckBox(const float *bspcoord);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern Clipper clipper;
|
extern Clipper clipper;
|
||||||
|
|
||||||
angle_t R_PointToPseudoAngle (fixed_t x, fixed_t y);
|
|
||||||
angle_t R_PointToPseudoAngle(double x, double y);
|
angle_t R_PointToPseudoAngle(double x, double y);
|
||||||
void R_SetView();
|
void R_SetView();
|
||||||
|
|
||||||
|
|
|
@ -315,10 +315,7 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla
|
||||||
// need to do software warping
|
// need to do software warping
|
||||||
FWarpTexture *wt = static_cast<FWarpTexture*>(tex);
|
FWarpTexture *wt = static_cast<FWarpTexture*>(tex);
|
||||||
unsigned char *warpbuffer = new unsigned char[w*h*4];
|
unsigned char *warpbuffer = new unsigned char[w*h*4];
|
||||||
if (tex->bWarped != 2)
|
WarpBuffer((DWORD*)warpbuffer, (const DWORD*)buffer, w, h, wt->WidthOffsetMultiplier, wt->HeightOffsetMultiplier, r_FrameTime, wt->Speed, tex->bWarped);
|
||||||
WarpBufferType1((DWORD*)warpbuffer, (const DWORD*)buffer, w, h, wt->WidthOffsetMultiplier, wt->HeightOffsetMultiplier, r_FrameTime, wt->Speed);
|
|
||||||
else
|
|
||||||
WarpBufferType2((DWORD*)warpbuffer, (const DWORD*)buffer, w, h, wt->WidthOffsetMultiplier, wt->HeightOffsetMultiplier, r_FrameTime, wt->Speed);
|
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
buffer = warpbuffer;
|
buffer = warpbuffer;
|
||||||
wt->GenTime = r_FrameTime;
|
wt->GenTime = r_FrameTime;
|
||||||
|
|
Loading…
Reference in a new issue