Skip to content

Commit

Permalink
Traktor: Minor cleanup in Mesh editor classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed Apr 10, 2024
1 parent 77d582e commit 6150e29
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 49 deletions.
16 changes: 2 additions & 14 deletions code/Mesh/Editor/IndexRange.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -9,19 +9,8 @@
#include <algorithm>
#include "Mesh/Editor/IndexRange.h"

namespace traktor
namespace traktor::mesh
{
namespace mesh
{

IndexRange::IndexRange()
: offsetFirst(0)
, offsetLast(0)
, minIndex(0)
, maxIndex(0)
, opaque(true)
{
}

void IndexRange::mergeInto(AlignedVector< IndexRange >& ranges) const
{
Expand Down Expand Up @@ -53,5 +42,4 @@ bool IndexRange::operator < (const IndexRange& rh) const
return offsetFirst < rh.offsetFirst;
}

}
}
20 changes: 7 additions & 13 deletions code/Mesh/Editor/IndexRange.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -11,26 +11,20 @@
#include "Core/Config.h"
#include "Core/Containers/AlignedVector.h"

namespace traktor
namespace traktor::mesh
{
namespace mesh
{

struct IndexRange
{
int32_t offsetFirst;
int32_t offsetLast;
int32_t minIndex;
int32_t maxIndex;
bool opaque;

IndexRange();
int32_t offsetFirst = 0;
int32_t offsetLast = 0;
int32_t minIndex = 0;
int32_t maxIndex = 0;
bool opaque = true;

void mergeInto(AlignedVector< IndexRange >& ranges) const;

bool operator < (const IndexRange& rh) const;
};

}
}

7 changes: 2 additions & 5 deletions code/Mesh/Editor/MeshBrowsePreview.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -16,10 +16,8 @@
#include "Ui/Application.h"
#include "Ui/Bitmap.h"

namespace traktor
namespace traktor::mesh
{
namespace mesh
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.render.MeshBrowsePreview", 0, MeshBrowsePreview, editor::IBrowsePreview)

Expand Down Expand Up @@ -54,5 +52,4 @@ Ref< ui::Bitmap > MeshBrowsePreview::generate(const editor::IEditor* editor, db:
return new ui::Bitmap(meshThumb);
}

}
}
8 changes: 2 additions & 6 deletions code/Mesh/Editor/MeshBrowsePreview.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -18,10 +18,8 @@
# define T_DLLCLASS T_DLLIMPORT
#endif

namespace traktor
namespace traktor::mesh
{
namespace mesh
{

/*! Mesh preview generator.
* \ingroup Mesh
Expand All @@ -36,6 +34,4 @@ class T_DLLCLASS MeshBrowsePreview : public editor::IBrowsePreview
virtual Ref< ui::Bitmap > generate(const editor::IEditor* editor, db::Instance* instance) const override final;
};

}
}

7 changes: 2 additions & 5 deletions code/Mesh/Editor/MeshComponentPipeline.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -12,10 +12,8 @@
#include "Mesh/MeshComponentData.h"
#include "Mesh/Editor/MeshComponentPipeline.h"

namespace traktor
namespace traktor::mesh
{
namespace mesh
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.mesh.MeshComponentPipeline", 0, MeshComponentPipeline, editor::IPipeline)

Expand Down Expand Up @@ -82,5 +80,4 @@ Ref< ISerializable > MeshComponentPipeline::buildProduct(
return DeepClone(sourceAsset).create();
}

}
}
8 changes: 2 additions & 6 deletions code/Mesh/Editor/MeshComponentPipeline.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -18,10 +18,8 @@
# define T_DLLCLASS T_DLLIMPORT
#endif

namespace traktor
namespace traktor::mesh
{
namespace mesh
{

class T_DLLCLASS MeshComponentPipeline : public editor::IPipeline
{
Expand Down Expand Up @@ -66,6 +64,4 @@ class T_DLLCLASS MeshComponentPipeline : public editor::IPipeline
) const override final;
};

}
}

0 comments on commit 6150e29

Please sign in to comment.