mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-06-30 16:45:12 +08:00
Fixing compilation issues.
This commit is contained in:
parent
2c932b1bf4
commit
2f67a16c6f
@ -485,7 +485,7 @@ bool load_amf(const char *path, Model *model)
|
|||||||
}
|
}
|
||||||
int done = feof(pFile);
|
int done = feof(pFile);
|
||||||
if (XML_Parse(parser, buff, len, done) == XML_STATUS_ERROR) {
|
if (XML_Parse(parser, buff, len, done) == XML_STATUS_ERROR) {
|
||||||
printf("AMF parser: Parse error at line %u:\n%s\n",
|
printf("AMF parser: Parse error at line %ul:\n%s\n",
|
||||||
XML_GetCurrentLineNumber(parser),
|
XML_GetCurrentLineNumber(parser),
|
||||||
XML_ErrorString(XML_GetErrorCode(parser)));
|
XML_ErrorString(XML_GetErrorCode(parser)));
|
||||||
break;
|
break;
|
||||||
@ -527,7 +527,7 @@ bool store_amf(const char *path, Model *model)
|
|||||||
std::string instances;
|
std::string instances;
|
||||||
for (size_t object_id = 0; object_id < model->objects.size(); ++ object_id) {
|
for (size_t object_id = 0; object_id < model->objects.size(); ++ object_id) {
|
||||||
ModelObject *object = model->objects[object_id];
|
ModelObject *object = model->objects[object_id];
|
||||||
fprintf(file, " <object id=\"%d\">\n", object_id);
|
fprintf(file, " <object id=\"" PRINTF_ZU "\">\n", object_id);
|
||||||
for (const std::string &key : object->config.keys())
|
for (const std::string &key : object->config.keys())
|
||||||
fprintf(file, " <metadata type=\"slic3r.%s\">%s</metadata>\n", key.c_str(), object->config.serialize(key).c_str());
|
fprintf(file, " <metadata type=\"slic3r.%s\">%s</metadata>\n", key.c_str(), object->config.serialize(key).c_str());
|
||||||
if (! object->name.empty())
|
if (! object->name.empty())
|
||||||
@ -556,9 +556,9 @@ bool store_amf(const char *path, Model *model)
|
|||||||
for (size_t i = 0; i < stl.stats.shared_vertices; ++ i) {
|
for (size_t i = 0; i < stl.stats.shared_vertices; ++ i) {
|
||||||
fprintf(file, " <vertex>\n");
|
fprintf(file, " <vertex>\n");
|
||||||
fprintf(file, " <coordinates>\n");
|
fprintf(file, " <coordinates>\n");
|
||||||
fprintf(file, " <x>%s</x>\n", stl.v_shared[i].x);
|
fprintf(file, " <x>%f</x>\n", stl.v_shared[i].x);
|
||||||
fprintf(file, " <y>%s</y>\n", stl.v_shared[i].x);
|
fprintf(file, " <y>%f</y>\n", stl.v_shared[i].y);
|
||||||
fprintf(file, " <z>%s</z>\n", stl.v_shared[i].x);
|
fprintf(file, " <z>%f</z>\n", stl.v_shared[i].z);
|
||||||
fprintf(file, " </coordinates>\n");
|
fprintf(file, " </coordinates>\n");
|
||||||
fprintf(file, " </vertex>\n");
|
fprintf(file, " </vertex>\n");
|
||||||
}
|
}
|
||||||
@ -592,10 +592,10 @@ bool store_amf(const char *path, Model *model)
|
|||||||
for (ModelInstance *instance : object->instances) {
|
for (ModelInstance *instance : object->instances) {
|
||||||
char buf[512];
|
char buf[512];
|
||||||
sprintf(buf,
|
sprintf(buf,
|
||||||
" <instance objectid=\"%d\">\n"
|
" <instance objectid=\"" PRINTF_ZU "\">\n"
|
||||||
" <deltax>%s</deltax>\n"
|
" <deltax>%lf</deltax>\n"
|
||||||
" <deltay>%s</deltay>\n"
|
" <deltay>%lf</deltay>\n"
|
||||||
" <rz>%s</rz>\n"
|
" <rz>%lf</rz>\n"
|
||||||
" </instance>\n",
|
" </instance>\n",
|
||||||
object_id,
|
object_id,
|
||||||
instance->offset.x,
|
instance->offset.x,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "objparser.hpp"
|
#include "objparser.hpp"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user