Beispiel #1
0
    bool in_range(IntPoint chunk, IntPoint coords, IntPoint range_chunk, IntPoint center, IntPoint radius) {
        IntPoint abs = get_abs(chunk, coords);
        IntPoint tl_abs = get_abs(range_chunk,
                IntPoint(center.row - radius.row,
                    center.col - radius.col));

        IntPoint br_abs = get_abs(range_chunk,
                IntPoint(center.row + radius.row,
                    center.col + radius.col));

        bool is_x = (abs.col>=tl_abs.col && abs.col<br_abs.col);
        bool is_y = (abs.row>=tl_abs.row && abs.row<br_abs.row);
        return (is_x && is_y);
    }
Beispiel #2
0
int main(int argc, char **argv)
{
    char *path = "/root/";
    char *name = "gogogo";
    char abs[256];

    get_abs(path, name, abs);
    printf("%s\n",abs);

    return 0;
}
Beispiel #3
0
 void set_float(ControllerMessage& msg, float value)
 {
   msg.set_abs_float(get_abs(), value);
 }
Beispiel #4
0
 void set(ControllerMessage& msg, int value, int min, int max)
 {
   msg.set_abs(get_abs(), value, min, max);
 }
Beispiel #5
0
 int get(const ControllerMessage& msg)
 {
   return msg.get_abs(get_abs());
 }
Beispiel #6
0
 float get_float(const ControllerMessage& msg)
 {
   return msg.get_abs_float(get_abs());
 }
Beispiel #7
0
 void widget::draw_box(int x, int y, int w, int h)
 {
     get_abs(x, y);
     get_screen().draw_rect_2d(static_cast<float>(x), static_cast<float>(y), static_cast<float>(x+w), static_cast<float>(y+h));
 } // widget::draw_box()
Beispiel #8
0
 void widget::draw_line(int x0, int y0, int x1, int y1)
 {
     get_abs(x0, y0);
     get_abs(x1, y1);
     get_screen().draw_line_2d(x0, y0, x1, y1);
 } // widget::draw_line()