Converting unsigned ints to regular ints again, undid that while merging.
This commit is contained in:
parent
4ad1f0607d
commit
7f20ef3ec5
@ -62,7 +62,7 @@ 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");
|
||||
doc->InsertFirstChild(newComposition);
|
||||
|
||||
@ -102,7 +102,7 @@ std::vector<unsigned int> Converter::newComposition(int type, float posX, float
|
||||
newComposition->InsertFirstChild(xRot);
|
||||
newComposition->InsertFirstChild(scale);
|
||||
|
||||
std::vector<unsigned int> ret = nextID;
|
||||
std::vector<int> ret = nextID;
|
||||
nextID[1] += 1;
|
||||
if (nextID[1] == 255){
|
||||
nextID[1] = 0;
|
||||
@ -158,7 +158,7 @@ void Converter::save(){
|
||||
doc->SaveFile(charXmlFile);
|
||||
}
|
||||
|
||||
std::vector<unsigned int> Converter::getNextID(){
|
||||
std::vector<int> Converter::getNextID(){
|
||||
return nextID;
|
||||
}
|
||||
|
||||
|
@ -12,14 +12,14 @@ class Converter {
|
||||
Converter();
|
||||
~Converter();
|
||||
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 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:
|
||||
|
||||
std::vector<unsigned int> nextID;
|
||||
std::vector<int> nextID;
|
||||
void errorCheck(XMLError error);
|
||||
std::string xmlFile;
|
||||
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(image[pixel]!=0 && image[pixel]!=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);
|
||||
idFound[temp[0]][temp[1]] = true;
|
||||
image[pixel+1] = temp[0];
|
||||
|
Loading…
Reference in New Issue
Block a user