Skip to content

Commit

Permalink
renderer: rename halfToFloat and floatToHalf as halfToFloat4 and floa…
Browse files Browse the repository at this point in the history
…tToHalf4 to avoid confusion
  • Loading branch information
illwieckz committed Jun 11, 2024
1 parent 9d172c3 commit 0d6b114
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/engine/renderer/tr_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static inline void floatToHalf2( const vec2_t in, f16vec2_t out )
out[ 1 ] = floatToHalf( in[ 1 ] );
}

static inline void floatToHalf( const vec4_t in, f16vec4_t out )
static inline void floatToHalf4( const vec4_t in, f16vec4_t out )
{
out[ 0 ] = floatToHalf( in[ 0 ] );
out[ 1 ] = floatToHalf( in[ 1 ] );
Expand All @@ -158,7 +158,7 @@ static inline void halfToFloat2( const f16vec2_t in, vec2_t out )
out[ 1 ] = halfToFloat( in[ 1 ] );
}

static inline void halfToFloat( const f16vec4_t in, vec4_t out )
static inline void halfToFloat4( const f16vec4_t in, vec4_t out )
{
out[ 0 ] = halfToFloat( in[ 0 ] );
out[ 1 ] = halfToFloat( in[ 1 ] );
Expand Down
8 changes: 4 additions & 4 deletions src/engine/renderer/tr_shade_calc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ static void ComputeCorner( int firstVertex, int numVertexes )
for( int j = 0; j < 4; j++ )
{
vec4_t &tc = tcs[ j ];
halfToFloat( v[ j ].f16TexCoords, tc );
halfToFloat4( v[ j ].f16TexCoords, tc );
VectorAdd( tc, midtc, midtc );
midtc[ 3 ] += tc[ 3 ];
}
Expand All @@ -510,7 +510,7 @@ static void ComputeCorner( int firstVertex, int numVertexes )
{
tc[ 3 ] = -tc[ 3 ];
}
floatToHalf( tc, v[ j ].f16TexCoords );
floatToHalf4( tc, v[ j ].f16TexCoords );
}
}
else
Expand Down Expand Up @@ -587,7 +587,7 @@ static void AutospriteDeform( int firstVertex, int numVertexes, int numIndexes )
if ( glConfig2.halfFloatVertexAvailable )
{
f16vec4_t f16Orientation;
floatToHalf( orientation, f16Orientation );
floatToHalf4( orientation, f16Orientation );

Vector4Copy( f16Orientation, v[ 0 ].f16SpriteOrientation );
Vector4Copy( f16Orientation, v[ 1 ].f16SpriteOrientation );
Expand Down Expand Up @@ -744,7 +744,7 @@ static void Autosprite2Deform( int firstVertex, int numVertexes, int numIndexes

if ( glConfig2.halfFloatVertexAvailable )
{
floatToHalf( orientation, v1->f16SpriteOrientation );
floatToHalf4( orientation, v1->f16SpriteOrientation );
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/engine/renderer/tr_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ void Tess_AddSprite( const vec3_t center, const Color::Color32Bit color, float r

if ( glConfig2.halfFloatVertexAvailable )
{
floatToHalf( texCoord, tess.verts[ ndx + i ].f16TexCoords );
floatToHalf( orientation, tess.verts[ ndx + i ].f16SpriteOrientation );
floatToHalf4( texCoord, tess.verts[ ndx + i ].f16TexCoords );
floatToHalf4( orientation, tess.verts[ ndx + i ].f16SpriteOrientation );
}
else
{
Expand Down

0 comments on commit 0d6b114

Please sign in to comment.