Skip to content

Commit

Permalink
Minor code review (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored Aug 28, 2024
1 parent 3c45ee7 commit fb0a22e
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Src/AlphaTestEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ class AlphaTestEffect::Impl : public EffectBase<AlphaTestEffectTraits>
public:
explicit Impl(_In_ ID3D11Device* device);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

D3D11_COMPARISON_FUNC alphaFunction;
int referenceAlpha;

Expand Down
6 changes: 6 additions & 0 deletions Src/BasicEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class BasicEffect::Impl : public EffectBase<BasicEffectTraits>
public:
explicit Impl(_In_ ID3D11Device* device);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

bool lightingEnabled;
bool preferPerPixelLighting;
bool vertexColorEnabled;
Expand Down
6 changes: 6 additions & 0 deletions Src/DGSLEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ class DGSLEffect::Impl : public AlignedNew<DGSLEffectConstants>
static_assert(MaxDirectionalLights == 4, "Mismatch with DGSL pipline");
}

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void Initialize(_In_ ID3D11Device* device, bool enableSkinning)
{
weightsPerVertex = enableSkinning ? 4 : 0;
Expand Down
6 changes: 6 additions & 0 deletions Src/DebugEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ class DebugEffect::Impl : public EffectBase<DebugEffectTraits>
public:
explicit Impl(_In_ ID3D11Device* device);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

bool vertexColorEnabled;
bool biasedVertexNormals;
bool instancing;
Expand Down
6 changes: 6 additions & 0 deletions Src/DualTextureEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ class DualTextureEffect::Impl : public EffectBase<DualTextureEffectTraits>
public:
explicit Impl(_In_ ID3D11Device* device);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

bool vertexColorEnabled;

EffectColor color;
Expand Down
6 changes: 6 additions & 0 deletions Src/EnvironmentMapEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ class EnvironmentMapEffect::Impl : public EffectBase<EnvironmentMapEffectTraits>
public:
explicit Impl(_In_ ID3D11Device* device);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

bool preferPerPixelLighting;
bool fresnelEnabled;
bool specularEnabled;
Expand Down
6 changes: 6 additions & 0 deletions Src/GeometricPrimitive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class GeometricPrimitive::Impl
public:
Impl() noexcept : mIndexCount(0) {}

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void Initialize(_In_ ID3D11DeviceContext* deviceContext, const VertexCollection& vertices, const IndexCollection& indices);

void XM_CALLCONV Draw(FXMMATRIX world, CXMMATRIX view, CXMMATRIX projection,
Expand Down
6 changes: 6 additions & 0 deletions Src/NormalMapEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class NormalMapEffect::Impl : public EffectBase<NormalMapEffectTraits>
public:
explicit Impl(_In_ ID3D11Device* device);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void Initialize(_In_ ID3D11Device* device, bool enableSkinning);

ComPtr<ID3D11ShaderResourceView> normalTexture;
Expand Down
6 changes: 6 additions & 0 deletions Src/PBREffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ class PBREffect::Impl : public EffectBase<PBREffectTraits>
public:
explicit Impl(_In_ ID3D11Device* device);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void Initialize(_In_ ID3D11Device* device, bool enableSkinning);

ComPtr<ID3D11ShaderResourceView> albedoTexture;
Expand Down
6 changes: 6 additions & 0 deletions Src/PrimitiveBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ class PrimitiveBatchBase::Impl
public:
Impl(_In_ ID3D11DeviceContext* deviceContext, size_t maxIndices, size_t maxVertices, size_t vertexSize);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void Begin();
void End();

Expand Down
6 changes: 6 additions & 0 deletions Src/SkinnedEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ class SkinnedEffect::Impl : public EffectBase<SkinnedEffectTraits>
public:
explicit Impl(_In_ ID3D11Device* device);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

bool preferPerPixelLighting;
bool biasedVertexNormals;
int weightsPerVertex;
Expand Down
6 changes: 6 additions & 0 deletions Src/SpriteBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ XM_ALIGNED_STRUCT(16) SpriteBatch::Impl : public AlignedNew<SpriteBatch::Impl>
public:
explicit Impl(_In_ ID3D11DeviceContext* deviceContext);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void XM_CALLCONV Begin(SpriteSortMode sortMode,
_In_opt_ ID3D11BlendState* blendState,
_In_opt_ ID3D11SamplerState* samplerState,
Expand Down
6 changes: 6 additions & 0 deletions Src/SpriteFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class SpriteFont::Impl
size_t glyphCount,
float lineSpacing) noexcept(false);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

Glyph const* FindGlyph(wchar_t character) const;

void SetDefaultCharacter(wchar_t character);
Expand Down

0 comments on commit fb0a22e

Please sign in to comment.