Converting unsigned ints to regular ints again, undid that while merging.
This commit is contained in:
parent
3e205b4157
commit
7279dc66bd
@ -62,7 +62,7 @@ Converter::Converter(){
|
|||||||
Converter::~Converter(){
|
Converter::~Converter(){
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<unsigned int> Converter::newComposition(int type, float posX, float posZ){
|
std::vector<int> Converter::newComposition(int type, float posX, float posZ){
|
||||||
XMLElement* newComposition = doc->NewElement("composition");
|
XMLElement* newComposition = doc->NewElement("composition");
|
||||||
doc->InsertFirstChild(newComposition);
|
doc->InsertFirstChild(newComposition);
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ std::vector<unsigned int> Converter::newComposition(int type, float posX, float
|
|||||||
newComposition->InsertFirstChild(xRot);
|
newComposition->InsertFirstChild(xRot);
|
||||||
newComposition->InsertFirstChild(scale);
|
newComposition->InsertFirstChild(scale);
|
||||||
|
|
||||||
std::vector<unsigned int> ret = nextID;
|
std::vector<int> ret = nextID;
|
||||||
nextID[1] += 1;
|
nextID[1] += 1;
|
||||||
if (nextID[1] == 255){
|
if (nextID[1] == 255){
|
||||||
nextID[1] = 0;
|
nextID[1] = 0;
|
||||||
@ -158,7 +158,7 @@ void Converter::save(){
|
|||||||
doc->SaveFile(charXmlFile);
|
doc->SaveFile(charXmlFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<unsigned int> Converter::getNextID(){
|
std::vector<int> Converter::getNextID(){
|
||||||
return nextID;
|
return nextID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,14 +12,14 @@ class Converter {
|
|||||||
Converter();
|
Converter();
|
||||||
~Converter();
|
~Converter();
|
||||||
void updateComposition(int idG, int idB, float posX, float posZ); //updates the position of a composition
|
void updateComposition(int idG, int idB, float posX, float posZ); //updates the position of a composition
|
||||||
std::vector<unsigned int> newComposition(int type, float posX, float posZ);//creates a new composition and returns its ID
|
std::vector<int> newComposition(int type, float posX, float posZ);//creates a new composition and returns its ID
|
||||||
void deleteComposition(int idG, int idB);
|
void deleteComposition(int idG, int idB);
|
||||||
void save(); //writes the xml to file
|
void save(); //writes the xml to file
|
||||||
std::vector<unsigned int> getNextID(); //returns the next unused ID
|
std::vector<int> getNextID(); //returns the next unused ID
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::vector<unsigned int> nextID;
|
std::vector<int> nextID;
|
||||||
void errorCheck(XMLError error);
|
void errorCheck(XMLError error);
|
||||||
std::string xmlFile;
|
std::string xmlFile;
|
||||||
XMLDocument* doc = new XMLDocument();
|
XMLDocument* doc = new XMLDocument();
|
||||||
|
@ -34,7 +34,7 @@ int main( int argc, char *argv[] ){
|
|||||||
//if there is a composition here, adjust the xml and image
|
//if there is a composition here, adjust the xml and image
|
||||||
if(image[pixel]!=0 && image[pixel]!=255){
|
if(image[pixel]!=0 && image[pixel]!=255){
|
||||||
if((image[pixel+1]==0 && image[pixel+2]==0) || (image[pixel+1]==255 && image[pixel+2]==255)){
|
if((image[pixel+1]==0 && image[pixel+2]==0) || (image[pixel+1]==255 && image[pixel+2]==255)){
|
||||||
std::vector<unsigned int> temp;
|
std::vector<int> temp;
|
||||||
temp = conv.newComposition(image[pixel], 0.5+rowNum-0.5*height, 0.5+columnNum-0.5*width);
|
temp = conv.newComposition(image[pixel], 0.5+rowNum-0.5*height, 0.5+columnNum-0.5*width);
|
||||||
idFound[temp[0]][temp[1]] = true;
|
idFound[temp[0]][temp[1]] = true;
|
||||||
image[pixel+1] = temp[0];
|
image[pixel+1] = temp[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user