示例#1
0
文件: file.c 项目: szhowardhuang/fs2
void cat(string file, int trans)
{
  string tmp;

  tmp = read_file(file);

  if (trans)
    tmp = trans_color(tmp);

  write(tmp);
  tmp = 0;
}
示例#2
0
void QtNextBoxWidget::draw_nextbox(QPainter* painter)
{
    const Tetris::Box* box = group.get_next_box();
    // because of Koening , so "Tetris::" do not needed
    Tetris::Dot d = /*Tetris::*/find_most_left(box);
    //这里赋值0是很有道理的,因为只需要左移动,不需要下移动
    d.y = 0;

    for (const Tetris::Dot* p = box->begin(); p != box->end(); ++p)
    {
        draw_oneblock(painter, *p - d, trans_color(box->get_color()));
    }
}