Fixed the filesytem for the converter.
This commit is contained in:
parent
ca3b29251e
commit
cfe29d2830
BIN
Levels/ObjectSetups/BackupLevel0.png
Normal file
BIN
Levels/ObjectSetups/BackupLevel0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 158 B |
116
Levels/ObjectSetups/Level0.xml
Normal file
116
Levels/ObjectSetups/Level0.xml
Normal file
@ -0,0 +1,116 @@
|
||||
<composition>
|
||||
<scale>1.0</scale>
|
||||
<xRot>0.0</xRot>
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<xPos>3.500000</xPos>
|
||||
<yOffset>0.0</yOffset>
|
||||
<zPos>3.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>9</idBlue>
|
||||
<typeID>99</typeID>
|
||||
</composition>
|
||||
|
||||
<composition>
|
||||
<scale>1.0</scale>
|
||||
<xRot>0.0</xRot>
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<xPos>3.500000</xPos>
|
||||
<yOffset>0.0</yOffset>
|
||||
<zPos>-0.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>8</idBlue>
|
||||
<typeID>99</typeID>
|
||||
</composition>
|
||||
|
||||
<composition>
|
||||
<scale>1.0</scale>
|
||||
<xRot>0.0</xRot>
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<xPos>2.500000</xPos>
|
||||
<yOffset>0.0</yOffset>
|
||||
<zPos>-2.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>7</idBlue>
|
||||
<typeID>99</typeID>
|
||||
</composition>
|
||||
|
||||
<composition>
|
||||
<scale>1.0</scale>
|
||||
<xRot>0.0</xRot>
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<xPos>1.500000</xPos>
|
||||
<yOffset>0.0</yOffset>
|
||||
<zPos>0.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>6</idBlue>
|
||||
<typeID>99</typeID>
|
||||
</composition>
|
||||
|
||||
<composition>
|
||||
<scale>1.0</scale>
|
||||
<xRot>0.0</xRot>
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<xPos>-0.500000</xPos>
|
||||
<yOffset>0.0</yOffset>
|
||||
<zPos>1.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>5</idBlue>
|
||||
<typeID>99</typeID>
|
||||
</composition>
|
||||
|
||||
<composition>
|
||||
<scale>1.0</scale>
|
||||
<xRot>0.0</xRot>
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<xPos>-0.500000</xPos>
|
||||
<yOffset>0.0</yOffset>
|
||||
<zPos>-1.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>4</idBlue>
|
||||
<typeID>99</typeID>
|
||||
</composition>
|
||||
|
||||
<composition>
|
||||
<scale>1.0</scale>
|
||||
<xRot>0.0</xRot>
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<xPos>-2.500000</xPos>
|
||||
<yOffset>0.0</yOffset>
|
||||
<zPos>-1.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>3</idBlue>
|
||||
<typeID>99</typeID>
|
||||
</composition>
|
||||
|
||||
<composition>
|
||||
<scale>1.0</scale>
|
||||
<xRot>0.0</xRot>
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<xPos>-3.500000</xPos>
|
||||
<yOffset>0.0</yOffset>
|
||||
<zPos>-3.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>2</idBlue>
|
||||
<typeID>99</typeID>
|
||||
</composition>
|
||||
|
||||
<composition>
|
||||
<scale>1.0</scale>
|
||||
<xRot>0.0</xRot>
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<xPos>-4.500000</xPos>
|
||||
<yOffset>0.0</yOffset>
|
||||
<zPos>-4.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>1</idBlue>
|
||||
<typeID>99</typeID>
|
||||
</composition>
|
Before Width: | Height: | Size: 721 KiB After Width: | Height: | Size: 721 KiB |
@ -1,6 +1,7 @@
|
||||
#include "converter.hh"
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <sys/stat.h>
|
||||
|
||||
using namespace tinyxml2;
|
||||
|
||||
@ -14,10 +15,20 @@ Converter::Converter(std::string level){
|
||||
printf("Could not open Compositions!!!\n");
|
||||
}
|
||||
|
||||
//Create a backup of the current Level png file, if no backup exists
|
||||
std::string pngFile = "../Levels/ObjectSetups/Level" + level + ".png";
|
||||
std::string backupPNG = "../Levels/ObjectSetups/BackupLevel" + level + ".png";
|
||||
struct stat buf;
|
||||
if(stat(backupPNG.c_str(), &buf) != 0){
|
||||
std::ifstream src(pngFile, std::ios::binary);
|
||||
std::ofstream dst(backupPNG, std::ios::binary);
|
||||
dst << src.rdbuf();
|
||||
}
|
||||
|
||||
//Create a backup of the current Level xml file
|
||||
std::string backup = "../Levels/ObjectSetups/BackupLevel" + level + ".xml";
|
||||
std::string backupXML = "../Levels/ObjectSetups/BackupLevel" + level + ".xml";
|
||||
std::ifstream src(xmlFile, std::ios::binary);
|
||||
std::ofstream dst(backup, std::ios::binary);
|
||||
std::ofstream dst(backupXML, std::ios::binary);
|
||||
dst << src.rdbuf();
|
||||
|
||||
//Load the Level xml file
|
||||
|
Loading…
Reference in New Issue
Block a user