void Cutbit::draw( Torbit& target_torbit, const int x, const int y, const int fx, const int fy, const bool mirr, const double rot, const double scal, const Mode mode) const { BITMAP* target = target_torbit.get_al_bitmap(); if (bitmap && fx >= 0 && fy >= 0 && fx < x_frames && fy < y_frames) { // Schneide zunaechst ein Subbitmap aus unter Beachtung der Framewahl // Hat das Bild keine Frames, entfaellt +1 fuer den aeusseren Rahmen. BITMAP* sprite; if (x_frames == 1 && y_frames == 1) sprite = create_sub_bitmap(bitmap, 0, 0, xl, yl); else sprite = create_sub_bitmap(bitmap, fx * (xl+1) + 1, fy * (yl+1) + 1, xl, yl); if (mode == NORMAL) { target_torbit.draw_from(sprite, x, y, mirr, rot, scal); } else { const int PINK = color[COL_PINK]; const int BLACK = color[COL_BLACK]; const int GREY = color[COL_EDITOR_DARK]; const int size = xl > yl ? xl : yl; Torbit excerpt(size, size); excerpt.clear_to_color(PINK); excerpt.draw_from(sprite, 0, 0, mirr, rot, scal); if (mode == NOOW) { target_torbit.draw (excerpt.get_al_bitmap(), x, y); target_torbit.draw_from(excerpt.get_al_bitmap(), x, y); } else if (mode == NOOW_EDITOR) { for (int ix = 0; ix < size; ++ix) for (int iy = 0; iy < size; ++iy) { const int c = target_torbit.get_pixel(x + ix, y + iy); const int e = excerpt .get_pixel( ix, iy); if ((c == BLACK || c == PINK || c == GREY) && e != BLACK && e != PINK) target_torbit.set_pixel(x + ix, y + iy, e); } } else if (mode == DARK || mode == DARK_EDITOR) { for (int ix = 0; ix < size; ++ix) for (int iy = 0; iy < size; ++iy) if (excerpt.get_pixel(ix, iy) != PINK) target_torbit.set_pixel(x+ix, y+iy, mode==DARK ? PINK : GREY); } } // Fertig destroy_bitmap(sprite); } // Keine gueltige Frame-Angabe else { int col_text = makecol(255, 255, 255); int col_back = makecol( 64, 64, 64); if (!bitmap) col_back = makecol(255, 64, 64); std::ostringstream str; str << "( " << fx << " | " << fy << " )"; textout_ex(target, font, "Frame?!?!", x, y, col_text, col_back); textout_ex(target, font, str.str().c_str(), x, y+8,col_text, col_back); } }