@@ -24,9 +24,9 @@ CSTLMeshWriter::CSTLMeshWriter()
24
24
#endif
25
25
}
26
26
27
-
28
27
CSTLMeshWriter::~CSTLMeshWriter ()
29
28
{
29
+
30
30
}
31
31
32
32
// ! writes a mesh
@@ -37,11 +37,11 @@ bool CSTLMeshWriter::writeAsset(system::IFile* _file, const SAssetWriteParams& _
37
37
38
38
SAssetWriteContext inCtx{_params, _file};
39
39
40
- const asset::ICPUMesh * mesh =
40
+ const asset::ICPUPolygonGeometry * mesh =
41
41
# ifndef _NBL_DEBUG
42
- static_cast <const asset::ICPUMesh *>(_params.rootAsset );
42
+ static_cast <const asset::ICPUPolygonGeometry *>(_params.rootAsset );
43
43
# else
44
- dynamic_cast <const asset::ICPUMesh *>(_params.rootAsset );
44
+ dynamic_cast <const asset::ICPUPolygonGeometry *>(_params.rootAsset );
45
45
# endif
46
46
assert (mesh);
47
47
@@ -64,8 +64,9 @@ bool CSTLMeshWriter::writeAsset(system::IFile* _file, const SAssetWriteParams& _
64
64
namespace
65
65
{
66
66
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)
68
68
{
69
+ #if 0
69
70
auto& inputParams = buffer->getPipeline()->getCachedCreationParams().vertexInput;
70
71
bool hasColor = inputParams.enabledAttribFlags & core::createBitmask({ COLOR_ATTRIBUTE });
71
72
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
165
166
*fileOffset += success.getBytesProcessed();
166
167
}
167
168
}
169
+ #endif
168
170
}
169
171
}
170
172
171
- bool CSTLMeshWriter::writeMeshBinary (const asset::ICPUMesh* mesh , SContext* context)
173
+ bool CSTLMeshWriter::writeMeshBinary (const asset::ICPUPolygonGeometry* geom , SContext* context)
172
174
{
173
175
// write STL MESH header
174
176
const char headerTxt[] = " Irrlicht-baw Engine" ;
@@ -209,7 +211,8 @@ bool CSTLMeshWriter::writeMeshBinary(const asset::ICPUMesh* mesh, SContext* cont
209
211
context->fileOffset += success.getBytesProcessed ();
210
212
}
211
213
}
212
-
214
+
215
+ #if 0
213
216
uint32_t facenum = 0;
214
217
for (auto& mb : mesh->getMeshBuffers())
215
218
facenum += mb->getIndexCount()/3;
@@ -220,7 +223,6 @@ bool CSTLMeshWriter::writeMeshBinary(const asset::ICPUMesh* mesh, SContext* cont
220
223
context->fileOffset += success.getBytesProcessed();
221
224
}
222
225
// write mesh buffers
223
-
224
226
for (auto& buffer : mesh->getMeshBuffers())
225
227
if (buffer)
226
228
{
@@ -235,10 +237,11 @@ bool CSTLMeshWriter::writeMeshBinary(const asset::ICPUMesh* mesh, SContext* cont
235
237
else
236
238
writeFacesBinary<uint16_t>(buffer, true, context->writeContext.outputFile, COLOR_ATTRIBUTE, &context->writeContext, &context->fileOffset); //template param doesn't matter if there's no indices
237
239
}
240
+ #endif
238
241
return true ;
239
242
}
240
243
241
- bool CSTLMeshWriter::writeMeshASCII (const asset::ICPUMesh* mesh , SContext* context)
244
+ bool CSTLMeshWriter::writeMeshASCII (const asset::ICPUPolygonGeometry* geom , SContext* context)
242
245
{
243
246
// write STL MESH header
244
247
const char headerTxt[] = " Irrlicht-baw Engine " ;
@@ -275,6 +278,7 @@ bool CSTLMeshWriter::writeMeshASCII(const asset::ICPUMesh* mesh, SContext* conte
275
278
context->fileOffset += success.getBytesProcessed ();
276
279
}
277
280
281
+ #if 0
278
282
// write mesh buffers
279
283
for (auto& buffer : mesh->getMeshBuffers())
280
284
if (buffer)
@@ -331,6 +335,8 @@ bool CSTLMeshWriter::writeMeshASCII(const asset::ICPUMesh* mesh, SContext* conte
331
335
}
332
336
}
333
337
338
+ #endif
339
+
334
340
{
335
341
system::IFile::success_t success;;
336
342
context->writeContext .outputFile ->write (success, " endsolid " , context->fileOffset , 9 );
0 commit comments