Example #1
0
func (r *SDLRenderer) drawCell(window_surf, cell_surface *sdl.Surface,
	x, y, w, h int32, transparent bool) error {
	if cell_surface == nil {
		return fmt.Errorf("unknown cell type")
	}
	if !transparent {
		err := r.getCellImage(grid.Cell{Type: grid.Empty}).BlitScaled(nil,
			window_surf, &sdl.Rect{X: x, Y: y + statusSize, W: w, H: h})
		if err != nil {
			return err
		}
	}
	return cell_surface.BlitScaled(nil, window_surf, &sdl.Rect{
		X: x, Y: y + statusSize, W: w, H: h})
}