Skip to content

Commit

Permalink
padding
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Dec 30, 2024
1 parent ff89987 commit 92be21c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/engine/qcommon/q_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,8 @@ void ZeroBounds( bounds_t &b )
void ClearBounds( bounds_t &b )
{
bounds_t cleared = {
{ 99999, 99999, 99999 },
{ -99999, -99999, -99999 },
{ 99999, 99999, 99999 }, 0,
{ -99999, -99999, -99999 }, 0,
};

BoundsCopy( cleared, b );
Expand Down
4 changes: 3 additions & 1 deletion src/engine/qcommon/q_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ void Com_Free_Aligned( void *ptr );
struct bounds_t
{
alignas(16) vec3_t mins;
vec_t pad_mins;
alignas(16) vec3_t maxs;
vec_t pad_maxs;

vec3_t& at( bool index )
{
Expand Down Expand Up @@ -1718,7 +1720,7 @@ void MatrixTransformBounds( const matrix_t m, const bounds_t &b, bounds_t &o );
vec_t dist;
byte type; // for fast side tests: 0,1,2 = axial, 3 = nonaxial
byte signbits; // signx + (signy<<1) + (signz<<2), used as lookup during collision
byte pad[ 2 ];
byte pad[ 12 ];
};

enum class traceType_t
Expand Down
20 changes: 10 additions & 10 deletions src/engine/renderer/tr_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3374,8 +3374,8 @@ static void RB_RenderDebugUtils()
vec3_t forward, left, up;

static const bounds_t size = {
{ -2, -2, -2 },
{ 2, 2, 2 },
{ -2, -2, -2 }, 0,
{ 2, 2, 2 }, 0,
};

gl_genericShader->SetVertexSkinning( false );
Expand Down Expand Up @@ -3517,8 +3517,8 @@ static void RB_RenderDebugUtils()
Color::Color lightColor;

static const bounds_t size = {
{ -1, -1, -1 },
{ 1, 1, 1 },
{ -1, -1, -1 }, 0,
{ 1, 1, 1 }, 0,
};

gl_genericShader->SetVertexSkinning( false );
Expand Down Expand Up @@ -3635,8 +3635,8 @@ static void RB_RenderDebugUtils()
int i;

static const bounds_t size = {
{ -1, -1, -1 },
{ 1, 1, 1 },
{ -1, -1, -1 }, 0,
{ 1, 1, 1 }, 0,
};

gl_genericShader->SetVertexSkinning( false );
Expand Down Expand Up @@ -3983,13 +3983,13 @@ static void RB_RenderDebugUtils()
!( backEnd.refdef.rdflags & ( RDF_NOWORLDMODEL | RDF_NOCUBEMAP ) ) )
{
static const bounds_t size = {
{ -8, -8, -8 },
{ 8, 8, 8 },
{ -8, -8, -8 }, 0,
{ 8, 8, 8 }, 0,
};

static const bounds_t outline = {
{ -9, -9, -9 },
{ 9, 9, 9 },
{ -9, -9, -9 }, 0,
{ 9, 9, 9 }, 0,
};

// choose right shader program ----------------------------------
Expand Down
7 changes: 1 addition & 6 deletions src/engine/renderer/tr_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,12 +1112,7 @@ void R_CalcFrustumFarCornersUnsafe( const plane_t frustum[ FRUSTUM_FAR + 1 ], ve

static void CopyPlane( const cplane_t *in, cplane_t *out )
{
VectorCopy( in->normal, out->normal );
out->dist = in->dist;
out->type = in->type;
out->signbits = in->signbits;
out->pad[ 0 ] = in->pad[ 0 ];
out->pad[ 1 ] = in->pad[ 1 ];
memcpy( out, in, sizeof(cplane_t) );
}

static void R_SetupSplitFrustums()
Expand Down

0 comments on commit 92be21c

Please sign in to comment.