SDL_Surface *STT_RightButton_Up::BuildTexture(SDL_Surface *surf,
                                              const Uint32 xsize,
                                              const Uint32 ysize,
                                              const SDL_Color &col) {
  SDL_Surface *ret = BuildInternal(surf, xsize, ysize, base_col(col),
                                   light_col(col), dark_col(col));

  int width = xsize / 16;
  if (width > int(ysize / 16)) width = ysize / 16;
  if (width < 1) width = 1;

  SDL_Rect point = {width * 2, width * 2, width, width};

  for (Uint32 pos = ysize / 4; pos <= ysize / 2; ++pos) {
    point.x = xsize / 2;
    point.y = pos;
    point.w = (xsize * pos / ysize) - ysize / 4;
    SDL_FillRect(ret, &point,
                 SDL_MapRGB(ret->format, textcol.r, textcol.g, textcol.b));
    point.y = ysize - pos;
    SDL_FillRect(ret, &point,
                 SDL_MapRGB(ret->format, textcol.r, textcol.g, textcol.b));
  }

  return ret;
}
Exemple #2
0
void LED_board::shift_through_cols(){
    static int current_col = 0;
    if(current_col > (NUM_COL-1)){
        current_col = 0;
    }
    
    light_col(current_col);
    current_col++;
}