mirror of
https://github.com/leozide/leocad
synced 2025-02-06 08:46:06 +01:00
Fixed POV-Ray exporter bug on Linux.
This commit is contained in:
parent
ec1023dcfa
commit
b51074ffd6
2 changed files with 32 additions and 6 deletions
|
@ -32,6 +32,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LC_LINUX
|
#ifdef LC_LINUX
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#define LC_MAXPATH 1024 //FILENAME_MAX
|
#define LC_MAXPATH 1024 //FILENAME_MAX
|
||||||
#define KEY_SHIFT 0x01
|
#define KEY_SHIFT 0x01
|
||||||
#define KEY_CONTROL 0x02
|
#define KEY_CONTROL 0x02
|
||||||
|
|
|
@ -4220,13 +4220,13 @@ void Project::HandleCommand(LC_COMMANDS id, unsigned long nParam)
|
||||||
sprintf(Line, "merge {\n object {\n %s%s\n texture { %s }\n }\n"
|
sprintf(Line, "merge {\n object {\n %s%s\n texture { %s }\n }\n"
|
||||||
" object {\n %s_slope\n texture { %s normal { bumps 0.3 scale 0.02 } }\n }\n"
|
" object {\n %s_slope\n texture { %s normal { bumps 0.3 scale 0.02 } }\n }\n"
|
||||||
" matrix <%.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f>\n}\n",
|
" matrix <%.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f>\n}\n",
|
||||||
PieceTable + Index * LC_PIECE_NAME_LEN, Suffix, ColorTable[Color], PieceTable + Index * LC_PIECE_NAME_LEN, ColorTable[Color],
|
PieceTable + Index * LC_PIECE_NAME_LEN, Suffix, &ColorTable[Color][0], PieceTable + Index * LC_PIECE_NAME_LEN, ColorTable[Color],
|
||||||
-fl[11], -fl[5], fl[8], -fl[9], -fl[3], fl[6], -fl[10], -fl[4], fl[7], pos[1], pos[0], pos[2]);
|
-fl[11], -fl[5], fl[8], -fl[9], -fl[3], fl[6], -fl[10], -fl[4], fl[7], pos[1], pos[0], pos[2]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(Line, "object {\n %s%s\n texture { %s }\n matrix <%.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f>\n}\n",
|
sprintf(Line, "object {\n %s%s\n texture { %s }\n matrix <%.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f>\n}\n",
|
||||||
PieceTable + Index * LC_PIECE_NAME_LEN, Suffix, ColorTable[Color], -fl[11], -fl[5], fl[8], -fl[9], -fl[3], fl[6], -fl[10], -fl[4], fl[7], pos[1], pos[0], pos[2]);
|
PieceTable + Index * LC_PIECE_NAME_LEN, Suffix, &ColorTable[Color][0], -fl[11], -fl[5], fl[8], -fl[9], -fl[3], fl[6], -fl[10], -fl[4], fl[7], pos[1], pos[0], pos[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
POVFile.WriteLine(Line);
|
POVFile.WriteLine(Line);
|
||||||
|
@ -4239,16 +4239,40 @@ void Project::HandleCommand(LC_COMMANDS id, unsigned long nParam)
|
||||||
if (opts.render)
|
if (opts.render)
|
||||||
{
|
{
|
||||||
#ifdef LC_WINDOWS
|
#ifdef LC_WINDOWS
|
||||||
// TODO: Linux support
|
|
||||||
char CmdLine[LC_MAXPATH * 3 + 100];
|
char CmdLine[LC_MAXPATH * 3 + 100];
|
||||||
|
|
||||||
if (opts.libpath[0])
|
if (opts.libpath[0])
|
||||||
sprintf(CmdLine, "+L\"%s\\lg\\\" +L\"%s\\ar\\\" +I\"%s\"", opts.libpath, opts.libpath, opts.outpath);
|
sprintf(CmdLine, "\"+L%slg\\\" \"+L%sar\\\" \"+I%s\"", opts.libpath, opts.libpath, opts.outpath);
|
||||||
else
|
else
|
||||||
sprintf(CmdLine, "+I\"%s\"", opts.libpath, opts.outpath);
|
sprintf(CmdLine, "\"+I%s\"", opts.outpath);
|
||||||
|
|
||||||
ShellExecute(::GetDesktopWindow(), "open", opts.povpath, CmdLine, NULL, SW_SHOWNORMAL);
|
ShellExecute(::GetDesktopWindow(), "open", opts.povpath, CmdLine, NULL, SW_SHOWNORMAL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef LC_LINUX
|
||||||
|
pid_t pID = fork();
|
||||||
|
|
||||||
|
if (pID == 0)
|
||||||
|
{
|
||||||
|
char InputArg[LC_MAXPATH + 16];
|
||||||
|
|
||||||
|
sprintf(InputArg, "+I%s", opts.outpath);
|
||||||
|
|
||||||
|
if (opts.libpath[0])
|
||||||
|
{
|
||||||
|
char LibArg1[LC_MAXPATH + 16], LibArg2[LC_MAXPATH + 16];
|
||||||
|
|
||||||
|
sprintf(LibArg1, "+L%slg/", opts.libpath);
|
||||||
|
sprintf(LibArg2, "+L%sar/", opts.libpath);
|
||||||
|
|
||||||
|
execl(opts.povpath, opts.povpath, InputArg, LibArg1, LibArg2, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
execl(opts.povpath, opts.povpath, InputArg, NULL);
|
||||||
|
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue