]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Client/src/principal.cpp
Mas cosas bonitas en el cliente
[z.facultad/75.42/plaqui.git] / Client / src / principal.cpp
index f9cb07fc7761a03aee0d281e329635e68e5a6f7f..870c06a96d2de14b4867034c1732647c57915445 100644 (file)
@@ -799,7 +799,7 @@ void Principal::read_status_xml(const std::string &frame)
 
 Gdk::Color Principal::get_rgb_from_xml(xmlNodePtr nodo)
 {
-       unsigned r,g,b;
+       gushort r,g,b;
        while (nodo != NULL) {
                if (nodo->type == XML_ELEMENT_NODE) {
                        if (xmlStrcmp(nodo->name, BAD_CAST"r")==0)
@@ -811,14 +811,14 @@ Gdk::Color Principal::get_rgb_from_xml(xmlNodePtr nodo)
                }
                nodo = nodo->next;
        }
-       r = 65535 * r / 255;
-       g = 65535 * g / 255;
-       b = 65535 * b / 255;
+       r = static_cast<gushort>(65535 * (r / 255.0f));
+       g = static_cast<gushort>(65535 * (g / 255.0f));
+       b = static_cast<gushort>(65535 * (b / 255.0f));
        Gdk::Color c;
        c.set_rgb(r,g,b);
-
        return c;
 }
+
 float Principal::get_float_from_xml(xmlNodePtr nodo)
 {
        float tmp = -1;
@@ -846,7 +846,6 @@ bool Principal::get_bool_from_xml(xmlNodePtr nodo)
                }
                nodo = nodo->next;
        }
-       std::cout << "AAACCCCAA : " << tmp << std::endl;
        return tmp == "true";
 }