Skip to content

Commit c3140ea

Browse files
committed
disable some old code to make STL writer compile
1 parent b3bf45d commit c3140ea

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

include/nbl/asset/interchange/IGeometryWriter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class IGeometryWriter : public IAssetWriter
2626
private:
2727
};
2828

29+
inline IGeometryWriter::~IGeometryWriter() { }
30+
2931
}
3032

3133
#endif

src/nbl/asset/interchange/CSTLMeshWriter.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ CSTLMeshWriter::CSTLMeshWriter()
2424
#endif
2525
}
2626

27-
2827
CSTLMeshWriter::~CSTLMeshWriter()
2928
{
29+
3030
}
3131

3232
//! writes a mesh
@@ -37,11 +37,11 @@ bool CSTLMeshWriter::writeAsset(system::IFile* _file, const SAssetWriteParams& _
3737

3838
SAssetWriteContext inCtx{_params, _file};
3939

40-
const asset::ICPUMesh* mesh =
40+
const asset::ICPUPolygonGeometry* mesh =
4141
# ifndef _NBL_DEBUG
42-
static_cast<const asset::ICPUMesh*>(_params.rootAsset);
42+
static_cast<const asset::ICPUPolygonGeometry*>(_params.rootAsset);
4343
# else
44-
dynamic_cast<const asset::ICPUMesh*>(_params.rootAsset);
44+
dynamic_cast<const asset::ICPUPolygonGeometry*>(_params.rootAsset);
4545
# endif
4646
assert(mesh);
4747

@@ -64,8 +64,9 @@ bool CSTLMeshWriter::writeAsset(system::IFile* _file, const SAssetWriteParams& _
6464
namespace
6565
{
6666
template <class I>
67-
inline void writeFacesBinary(const asset::ICPUMeshBuffer* buffer, const bool& noIndices, system::IFile* file, uint32_t _colorVaid, IAssetWriter::SAssetWriteContext* context, size_t* fileOffset)
67+
inline void writeFacesBinary(const asset::ICPUPolygonGeometry* geom, const bool& noIndices, system::IFile* file, uint32_t _colorVaid, IAssetWriter::SAssetWriteContext* context, size_t* fileOffset)
6868
{
69+
#if 0
6970
auto& inputParams = buffer->getPipeline()->getCachedCreationParams().vertexInput;
7071
bool hasColor = inputParams.enabledAttribFlags & core::createBitmask({ COLOR_ATTRIBUTE });
7172
const asset::E_FORMAT colorType = static_cast<asset::E_FORMAT>(hasColor ? inputParams.attributes[COLOR_ATTRIBUTE].format : asset::EF_UNKNOWN);
@@ -165,10 +166,11 @@ inline void writeFacesBinary(const asset::ICPUMeshBuffer* buffer, const bool& no
165166
*fileOffset += success.getBytesProcessed();
166167
}
167168
}
169+
#endif
168170
}
169171
}
170172

171-
bool CSTLMeshWriter::writeMeshBinary(const asset::ICPUMesh* mesh, SContext* context)
173+
bool CSTLMeshWriter::writeMeshBinary(const asset::ICPUPolygonGeometry* geom, SContext* context)
172174
{
173175
// write STL MESH header
174176
const char headerTxt[] = "Irrlicht-baw Engine";
@@ -209,7 +211,8 @@ bool CSTLMeshWriter::writeMeshBinary(const asset::ICPUMesh* mesh, SContext* cont
209211
context->fileOffset += success.getBytesProcessed();
210212
}
211213
}
212-
214+
215+
#if 0
213216
uint32_t facenum = 0;
214217
for (auto& mb : mesh->getMeshBuffers())
215218
facenum += mb->getIndexCount()/3;
@@ -220,7 +223,6 @@ bool CSTLMeshWriter::writeMeshBinary(const asset::ICPUMesh* mesh, SContext* cont
220223
context->fileOffset += success.getBytesProcessed();
221224
}
222225
// write mesh buffers
223-
224226
for (auto& buffer : mesh->getMeshBuffers())
225227
if (buffer)
226228
{
@@ -235,10 +237,11 @@ bool CSTLMeshWriter::writeMeshBinary(const asset::ICPUMesh* mesh, SContext* cont
235237
else
236238
writeFacesBinary<uint16_t>(buffer, true, context->writeContext.outputFile, COLOR_ATTRIBUTE, &context->writeContext, &context->fileOffset); //template param doesn't matter if there's no indices
237239
}
240+
#endif
238241
return true;
239242
}
240243

241-
bool CSTLMeshWriter::writeMeshASCII(const asset::ICPUMesh* mesh, SContext* context)
244+
bool CSTLMeshWriter::writeMeshASCII(const asset::ICPUPolygonGeometry* geom, SContext* context)
242245
{
243246
// write STL MESH header
244247
const char headerTxt[] = "Irrlicht-baw Engine ";
@@ -275,6 +278,7 @@ bool CSTLMeshWriter::writeMeshASCII(const asset::ICPUMesh* mesh, SContext* conte
275278
context->fileOffset += success.getBytesProcessed();
276279
}
277280

281+
#if 0
278282
// write mesh buffers
279283
for (auto& buffer : mesh->getMeshBuffers())
280284
if (buffer)
@@ -331,6 +335,8 @@ bool CSTLMeshWriter::writeMeshASCII(const asset::ICPUMesh* mesh, SContext* conte
331335
}
332336
}
333337

338+
#endif
339+
334340
{
335341
system::IFile::success_t success;;
336342
context->writeContext.outputFile->write(success, "endsolid ", context->fileOffset, 9);

src/nbl/asset/interchange/CSTLMeshWriter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace nbl::asset
1717
class CSTLMeshWriter : public IGeometryWriter
1818
{
1919
protected:
20-
virtual ~CSTLMeshWriter();
20+
~CSTLMeshWriter() override;
2121

2222
public:
2323
CSTLMeshWriter();

0 commit comments

Comments
 (0)