home *** CD-ROM | disk | FTP | other *** search
- #include <owl\owlpch.h>
- #pragma hdrstop
- #include <stdio.h>
- #include <string.h>
- #include <dos.h>
- #include <cstring.h>
- #include <dir.h>
- #include "matrix.h"
- #include "suflib.h"
- #include "parts.h"
- #include "profile.h"
- #include "files.h"
-
- #include "log.h"
-
- static char *indfile = "_temp1.ind";
- static char *frmfile = "_temp.frm";
- static char *cRend = "rendwin.exe";
-
- static char *atrname[5] = {"WH", "BL", "RD", "GR", "MG"};
-
- void RendMechanic(Parts *parts, CameraParts *camera, int color)
- {
- char str[128];
- FILE *fp;
- sprintf(str, "%s%s", tempdir.c_str(), indfile);
- if ((fp = fopen(str, "w")) == NULL) {
- return;
- }
- sprintf(str, "%s%s", tempdir.c_str(), frmfile);
- parts->FileWrite(camera, str, NULL);
-
- if (color < 0 || color > 4) {
- fprintf(fp, "%s\n", atrfile.c_str());
- } else {
- fprintf(fp, "%s\\GENIE_%s.ATR\n", atrdir.c_str(), atrname[color]);
- }
- fprintf(fp, "%s%s\n", tempdir.c_str(), frmfile);
- for (Parts *p = parts; p != NULL; p = p->next) {
- for (Parts *op = parts; op != p && op != NULL; op = op->next) {
- if (op->object == p->object) {
- break;
- }
- }
- if (op == p || op == NULL) {
- char *f = p->object->filename;
- if (strncmpi(f, simplepartsdir.c_str(), simplepartsdir.length()) == 0) {
- fprintf(fp, "%s%s\n", partsdir.c_str(), f+simplepartsdir.length());
- } else if (f[1] == ':' || f[0] == '\\') {
- fprintf(fp, "%s\n", f);
- } else {
- fprintf(fp, "%s%s\n", partsdir.c_str(), f);
- }
- }
- }
- if (rendoption == "") {
- fprintf(fp, "-c512x384 -n -g\n");
- } else {
- fprintf(fp, "%s\n", rendoption.c_str());
- }
- fclose(fp);
-
- sprintf(str, "%s%s @%s%s", pathdir.c_str(), cRend, tempdir.c_str(), indfile);
- WinExec(str, SW_SHOW);
- }
-
-