Ejemplo n.º 1
0
void drawTank(){
	int fb_row;
	int rowDiff;
	int curRow;
	int curCol;
	for(curRow = tankPosY; curRow < 460; curRow++){
		fb_row = curRow*640;
		rowDiff = curRow - tankPosY;
		//iterate through the row/column and get individual pixel values
		for(curCol = tankPosX-2; curCol < tankPosX + 34; curCol++){
			framebuffer[fb_row+curCol] = getTankPixel(rowDiff, curCol - tankPosX);
		}
	}
}
Ejemplo n.º 2
0
Archivo: Tank.cpp Proyecto: heeh/Tetris
void Tank::make2DVertexArray()
{

  int row = 0;
  int col = 0;

  float sCol = 0;
  float sRow = 0;

  while (row < m_height){
    while (col < m_width){
      if (getTankPixel(row, col) == 1)
        sCol = col * RECTSIZE;
      sRow = row * RECTSIZE;
      //setVertex(sRow, sCol);

      col++;
    }
    row++;
    col = 0;
  }
}