Skip to content

Commit

Permalink
#5773: Remove TexDef adapter methods - the client code in Face::setTe…
Browse files Browse the repository at this point in the history
…xdef is no longer used either
  • Loading branch information
codereader committed Oct 9, 2021
1 parent 4b5bcfc commit 7857cfa
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 43 deletions.
13 changes: 0 additions & 13 deletions radiantcore/brush/Face.cpp
Expand Up @@ -468,19 +468,6 @@ void Face::SetTexdef(const TextureProjection& projection)
texdefChanged();
}

void Face::setTexdef(const TexDef& texDef)
{
TextureProjection projection;

// Construct the BPTexDef out of the TexDef
projection.setFromShiftScaleRotate(texDef.toShiftScaleRotation());

// The bprimitive texdef needs to be scaled using our current texture dims
projection.getTextureMatrix().addScale(_shader.getWidth(), _shader.getHeight());

SetTexdef(projection);
}

ShiftScaleRotation Face::getShiftScaleRotation() const
{
auto ssr = _texdef.getTextureMatrix().getShiftScaleRotation();
Expand Down
4 changes: 0 additions & 4 deletions radiantcore/brush/Face.h
Expand Up @@ -139,10 +139,6 @@ class Face :
void GetTexdef(TextureProjection& projection) const;
void SetTexdef(const TextureProjection& projection);

// Applies the given shift/scale/rotation values to this face's texture projection
// The incoming values are measured in pixels and will be scaled internally.
void setTexdef(const TexDef& texDef);

// Constructs the texture projection matrix from the given (world) vertex and texture coords.
// Three vertices and their UV coordinates are enough to construct the texdef.
void setTexDefFromPoints(const Vector3 points[3], const Vector2 uvs[3]);
Expand Down
19 changes: 0 additions & 19 deletions radiantcore/brush/TexDef.cpp
Expand Up @@ -104,22 +104,3 @@ void TexDef::normalise(double width, double height)
_def.shift[0] = float_mod(_def.shift[0], width);
_def.shift[1] = float_mod(_def.shift[1], height);
}

ShiftScaleRotation TexDef::toShiftScaleRotation() const
{
ShiftScaleRotation result;

result.shift[0] = _def.shift[0];
result.shift[1] = _def.shift[1];
result.rotate = _def.rotate;
result.scale[0] = _def.scale[0];
result.scale[1] = _def.scale[1];

return result;
}

TexDef TexDef::CreateFromShiftScaleRotation(const ShiftScaleRotation& scr)
{
return TexDef(scr);
}

7 changes: 0 additions & 7 deletions radiantcore/brush/TexDef.h
Expand Up @@ -33,13 +33,6 @@ class TexDef final
// This function normalises shift values to the smallest positive congruent values.
void normalise(double width, double height);

// Converts this instance's values to a ShiftScaleRotation structure
// Since TexDef is using the same format to store its values internally
// this is equivalent to a few simple assignment or copy operations.
ShiftScaleRotation toShiftScaleRotation() const;

static TexDef CreateFromShiftScaleRotation(const ShiftScaleRotation& scr);

friend std::ostream& operator<<(std::ostream& st, const TexDef& texdef);
};

Expand Down

0 comments on commit 7857cfa

Please sign in to comment.