X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/e7bc59fe98396b7c67024911b03bf1e08728df3e..16f64e28170d4473eebaa309d3082785c32b809c:/Model/src/simulator.cpp diff --git a/Model/src/simulator.cpp b/Model/src/simulator.cpp index 981b546..66148f2 100644 --- a/Model/src/simulator.cpp +++ b/Model/src/simulator.cpp @@ -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(255 * (r / 65535.0f)); + g = static_cast(255 * (g / 65535.0f)); + b = static_cast(255 * (b / 65535.0f)); + return RGB(r,g,b); }