void roadmap_screen_obj_draw (void) {

   RoadMapScreenObj cursor;
   int height = roadmap_canvas_height ();
   int width = roadmap_canvas_width();

   if (!initialized)
      return;

   if ((height != screen_height) && (width != screen_width)){
	   roadmap_screen_obj_reload();
   }

   for (cursor = RoadMapObjectList; cursor != NULL; cursor = cursor->next) {
      int state = 0;
      int image_mode = IMAGE_NORMAL;
      RoadMapGuiPoint pos;

      if (cursor->state_fn) {
         state = (*cursor->state_fn) ();
         if ((state < 0) || (state >= MAX_STATES)) continue;
      }

      if (cursor == RoadMapScreenObjSelected) {
         image_mode = IMAGE_SELECTED;
      }

      roadmap_screen_obj_pos (cursor, &pos);

      if (cursor->images[state]) {

         roadmap_canvas_draw_image (cursor->images[state], &pos,
                                    cursor->opacity, image_mode);
      }

      if (cursor->sprites[state]) {

         if (cursor->flags & OBJ_FLAG_NO_ROTATE) {
            roadmap_sprite_draw (cursor->sprites[state], &pos,
                                 -roadmap_math_get_orientation());
         } else {
            roadmap_sprite_draw (cursor->sprites[state], &pos, 0);
         }
      }
   }
}
Beispiel #2
0
static void roadmap_display_highlight (const RoadMapPosition *position) {

    RoadMapGuiPoint point;

    roadmap_math_coordinate (position, &point);
    roadmap_math_rotate_project_coordinate ( &point);
    roadmap_sprite_draw ("Highlight", &point, 0);
}