]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Model/src/simulator.cpp
Se corrige el bug en la union (del modelo) que probablemente era el error
[z.facultad/75.42/plaqui.git] / Model / src / simulator.cpp
index 981b546feb2f4fa32dfe18cac5a3fb609525473c..66148f296928aba5295d06ea1136ff8f7a57042f 100644 (file)
@@ -545,7 +545,7 @@ std::string Simulator::get_state_as_xml()
 
 RGB Simulator::loadRGB(xmlNodePtr nodo)
 {
-       unsigned r,g,b;
+       unsigned long r,g,b;
        while (nodo != NULL) {
                if (nodo->type == XML_ELEMENT_NODE) {
                        if (xmlStrcmp(nodo->name, BAD_CAST"rojo")==0)
@@ -557,6 +557,10 @@ RGB Simulator::loadRGB(xmlNodePtr nodo)
                }
                nodo = nodo->next;
        }
+       r = static_cast<unsigned long>(255 * (r / 65535.0f));
+       g = static_cast<unsigned long>(255 * (g / 65535.0f));
+       b = static_cast<unsigned long>(255 * (b / 65535.0f));
+
        return RGB(r,g,b);
 }